aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/inet_diag.h
diff options
context:
space:
mode:
authorPavel Emelyanov <xemul@parallels.com>2011-12-09 01:23:18 -0500
committerDavid S. Miller <davem@davemloft.net>2011-12-09 14:14:08 -0500
commit1942c518ca017f376b267a7c5e78c15d37202442 (patch)
tree9ead5443adf15f2264240c928ff2514349fdcade /include/linux/inet_diag.h
parent3c4d05c8056724aff3abc20650807dd828fded54 (diff)
inet_diag: Generalize inet_diag dump and get_exact calls
Introduce two callbacks in inet_diag_handler -- one for dumping all sockets (with filters) and the other one for dumping a single sk. Replace direct calls to icsk handlers with indirect calls to callbacks provided by handlers. Make existing TCP and DCCP handlers use provided helpers for icsk-s. The UDP diag module will provide its own. Signed-off-by: Pavel Emelyanov <xemul@parallels.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/linux/inet_diag.h')
-rw-r--r--include/linux/inet_diag.h18
1 files changed, 17 insertions, 1 deletions
diff --git a/include/linux/inet_diag.h b/include/linux/inet_diag.h
index eaf5865c9e8a..78972a149dff 100644
--- a/include/linux/inet_diag.h
+++ b/include/linux/inet_diag.h
@@ -138,9 +138,18 @@ struct inet_hashinfo;
138struct nlattr; 138struct nlattr;
139struct nlmsghdr; 139struct nlmsghdr;
140struct sk_buff; 140struct sk_buff;
141struct netlink_callback;
141 142
142struct inet_diag_handler { 143struct inet_diag_handler {
143 struct inet_hashinfo *idiag_hashinfo; 144 void (*dump)(struct sk_buff *skb,
145 struct netlink_callback *cb,
146 struct inet_diag_req *r,
147 struct nlattr *bc);
148
149 int (*dump_one)(struct sk_buff *in_skb,
150 const struct nlmsghdr *nlh,
151 struct inet_diag_req *req);
152
144 void (*idiag_get_info)(struct sock *sk, 153 void (*idiag_get_info)(struct sock *sk,
145 struct inet_diag_msg *r, 154 struct inet_diag_msg *r,
146 void *info); 155 void *info);
@@ -152,6 +161,13 @@ int inet_sk_diag_fill(struct sock *sk, struct inet_connection_sock *icsk,
152 struct sk_buff *skb, struct inet_diag_req *req, 161 struct sk_buff *skb, struct inet_diag_req *req,
153 u32 pid, u32 seq, u16 nlmsg_flags, 162 u32 pid, u32 seq, u16 nlmsg_flags,
154 const struct nlmsghdr *unlh); 163 const struct nlmsghdr *unlh);
164void inet_diag_dump_icsk(struct inet_hashinfo *h, struct sk_buff *skb,
165 struct netlink_callback *cb, struct inet_diag_req *r,
166 struct nlattr *bc);
167int inet_diag_dump_one_icsk(struct inet_hashinfo *hashinfo,
168 struct sk_buff *in_skb, const struct nlmsghdr *nlh,
169 struct inet_diag_req *req);
170
155int inet_diag_bc_sk(const struct nlattr *_bc, struct sock *sk); 171int inet_diag_bc_sk(const struct nlattr *_bc, struct sock *sk);
156int inet_diag_check_cookie(struct sock *sk, struct inet_diag_req *req); 172int inet_diag_check_cookie(struct sock *sk, struct inet_diag_req *req);
157 173