2 #include <linux/socket.h>
6 #include <linux/module.h>
9 #include <linux/inet_diag.h>
10 #include <linux/sock_diag.h>
20 ((
u32)(
unsigned long)sk != cookie[0] ||
21 (
u32)((((
unsigned long)sk) >> 31) >> 1) != cookie[1]))
30 cookie[0] = (
u32)(
unsigned long)
sk;
31 cookie[1] = (
u32)(((
unsigned long)sk >> 31) >> 1);
48 return nla_put(skb, attrtype,
sizeof(mem), &mem);
63 inet_rcv_compat =
NULL;
76 if (sock_diag_handlers[hndl->
family])
79 sock_diag_handlers[hndl->
family] = hndl;
94 BUG_ON(sock_diag_handlers[family] != hnld);
102 if (sock_diag_handlers[family] ==
NULL)
103 request_module(
"net-pf-%d-proto-%d-type-%d",
PF_NETLINK,
107 return sock_diag_handlers[
family];
115 static int __sock_diag_rcv_msg(
struct sk_buff *skb,
struct nlmsghdr *nlh)
121 if (nlmsg_len(nlh) <
sizeof(*req))
128 err = hndl->
dump(skb, nlh);
129 sock_diag_unlock_handler(hndl);
134 static int sock_diag_rcv_msg(
struct sk_buff *skb,
struct nlmsghdr *nlh)
141 if (inet_rcv_compat ==
NULL)
142 request_module(
"net-pf-%d-proto-%d-type-%d",
PF_NETLINK,
146 if (inet_rcv_compat !=
NULL)
147 ret = inet_rcv_compat(skb, nlh);
154 return __sock_diag_rcv_msg(skb, nlh);
162 static void sock_diag_rcv(
struct sk_buff *skb)
172 .input = sock_diag_rcv,
186 .init = diag_net_init,
187 .exit = diag_net_exit,
190 static int __init sock_diag_init(
void)
195 static void __exit sock_diag_exit(
void)