14 #include <linux/types.h>
15 #include <linux/stddef.h>
16 #include <linux/kernel.h>
23 #include <linux/audit.h>
24 #include <linux/ipv6.h>
28 #include <linux/tcp.h>
29 #include <linux/udp.h>
30 #include <linux/dccp.h>
72 struct udphdr *uh = udp_hdr(skb);
90 struct sctphdr *sh = sctp_hdr(skb);
102 #if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE)
127 offset = skb_network_offset(skb);
128 offset +=
sizeof(*ip6);
139 th = skb_header_pointer(skb, offset,
sizeof(_tcph), &_tcph);
150 uh = skb_header_pointer(skb, offset,
sizeof(_udph), &_udph);
161 dh = skb_header_pointer(skb, offset,
sizeof(_dccph), &_dccph);
172 sh = skb_header_pointer(skb, offset,
sizeof(_sctph), &_sctph);
187 static inline void print_ipv6_addr(
struct audit_buffer *ab,
189 char *name1,
char *name2)
191 if (!ipv6_addr_any(addr))
198 __be16 port,
char *name1,
char *name2)
211 static void dump_common_audit_data(
struct audit_buffer *ab,
240 inode = a->
u.
path.dentry->d_inode;
281 if (tsk && tsk->
pid) {
293 switch (sk->sk_family) {
297 print_ipv4_addr(ab, inet->inet_rcv_saddr,
300 print_ipv4_addr(ab, inet->inet_daddr,
312 print_ipv6_addr(ab, &inet6->
daddr,
319 if (u->
path.dentry) {
326 p = &u->
addr->name->sun_path[0];
336 switch (a->
u.
net->family) {
338 print_ipv4_addr(ab, a->
u.
net->v4info.saddr,
341 print_ipv4_addr(ab, a->
u.
net->v4info.daddr,
346 print_ipv6_addr(ab, &a->
u.
net->v6info.saddr,
349 print_ipv6_addr(ab, &a->
u.
net->v6info.daddr,
354 if (a->
u.
net->netif > 0) {
368 if (a->
u.key_struct.key_desc) {
407 dump_common_audit_data(ab, a);