aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPavel Emelyanov <xemul@parallels.com>2012-01-10 17:36:35 -0500
committerDavid S. Miller <davem@davemloft.net>2012-01-11 15:56:06 -0500
commitc8991362a0d3cf317dfbfb6cb946607870654e6d (patch)
tree21db1072591e2549fedd6d54586efe3ef7f45cb4
parentf515e6b77045b4b1f54617d9fbf4a22b95a58757 (diff)
inet_diag: Rename inet_diag_req into inet_diag_req_v2
Signed-off-by: Pavel Emelyanov <xemul@parallels.com> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--include/linux/inet_diag.h12
-rw-r--r--net/dccp/diag.c4
-rw-r--r--net/ipv4/inet_diag.c34
-rw-r--r--net/ipv4/tcp_diag.c4
-rw-r--r--net/ipv4/udp_diag.c14
5 files changed, 34 insertions, 34 deletions
diff --git a/include/linux/inet_diag.h b/include/linux/inet_diag.h
index 34e8d52c1925..a5b7e910eea9 100644
--- a/include/linux/inet_diag.h
+++ b/include/linux/inet_diag.h
@@ -34,7 +34,7 @@ struct inet_diag_req_compat {
34 __u32 idiag_dbs; /* Tables to dump (NI) */ 34 __u32 idiag_dbs; /* Tables to dump (NI) */
35}; 35};
36 36
37struct inet_diag_req { 37struct inet_diag_req_v2 {
38 __u8 sdiag_family; 38 __u8 sdiag_family;
39 __u8 sdiag_protocol; 39 __u8 sdiag_protocol;
40 __u8 idiag_ext; 40 __u8 idiag_ext;
@@ -143,12 +143,12 @@ struct netlink_callback;
143struct inet_diag_handler { 143struct inet_diag_handler {
144 void (*dump)(struct sk_buff *skb, 144 void (*dump)(struct sk_buff *skb,
145 struct netlink_callback *cb, 145 struct netlink_callback *cb,
146 struct inet_diag_req *r, 146 struct inet_diag_req_v2 *r,
147 struct nlattr *bc); 147 struct nlattr *bc);
148 148
149 int (*dump_one)(struct sk_buff *in_skb, 149 int (*dump_one)(struct sk_buff *in_skb,
150 const struct nlmsghdr *nlh, 150 const struct nlmsghdr *nlh,
151 struct inet_diag_req *req); 151 struct inet_diag_req_v2 *req);
152 152
153 void (*idiag_get_info)(struct sock *sk, 153 void (*idiag_get_info)(struct sock *sk,
154 struct inet_diag_msg *r, 154 struct inet_diag_msg *r,
@@ -158,15 +158,15 @@ struct inet_diag_handler {
158 158
159struct inet_connection_sock; 159struct inet_connection_sock;
160int inet_sk_diag_fill(struct sock *sk, struct inet_connection_sock *icsk, 160int inet_sk_diag_fill(struct sock *sk, struct inet_connection_sock *icsk,
161 struct sk_buff *skb, struct inet_diag_req *req, 161 struct sk_buff *skb, struct inet_diag_req_v2 *req,
162 u32 pid, u32 seq, u16 nlmsg_flags, 162 u32 pid, u32 seq, u16 nlmsg_flags,
163 const struct nlmsghdr *unlh); 163 const struct nlmsghdr *unlh);
164void inet_diag_dump_icsk(struct inet_hashinfo *h, struct sk_buff *skb, 164void inet_diag_dump_icsk(struct inet_hashinfo *h, struct sk_buff *skb,
165 struct netlink_callback *cb, struct inet_diag_req *r, 165 struct netlink_callback *cb, struct inet_diag_req_v2 *r,
166 struct nlattr *bc); 166 struct nlattr *bc);
167int inet_diag_dump_one_icsk(struct inet_hashinfo *hashinfo, 167int inet_diag_dump_one_icsk(struct inet_hashinfo *hashinfo,
168 struct sk_buff *in_skb, const struct nlmsghdr *nlh, 168 struct sk_buff *in_skb, const struct nlmsghdr *nlh,
169 struct inet_diag_req *req); 169 struct inet_diag_req_v2 *req);
170 170
171int inet_diag_bc_sk(const struct nlattr *_bc, struct sock *sk); 171int inet_diag_bc_sk(const struct nlattr *_bc, struct sock *sk);
172 172
diff --git a/net/dccp/diag.c b/net/dccp/diag.c
index 8f1625753377..028fc43aacbd 100644
--- a/net/dccp/diag.c
+++ b/net/dccp/diag.c
@@ -49,13 +49,13 @@ static void dccp_diag_get_info(struct sock *sk, struct inet_diag_msg *r,
49} 49}
50 50
51static void dccp_diag_dump(struct sk_buff *skb, struct netlink_callback *cb, 51static void dccp_diag_dump(struct sk_buff *skb, struct netlink_callback *cb,
52 struct inet_diag_req *r, struct nlattr *bc) 52 struct inet_diag_req_v2 *r, struct nlattr *bc)
53{ 53{
54 inet_diag_dump_icsk(&dccp_hashinfo, skb, cb, r, bc); 54 inet_diag_dump_icsk(&dccp_hashinfo, skb, cb, r, bc);
55} 55}
56 56
57static int dccp_diag_dump_one(struct sk_buff *in_skb, const struct nlmsghdr *nlh, 57static int dccp_diag_dump_one(struct sk_buff *in_skb, const struct nlmsghdr *nlh,
58 struct inet_diag_req *req) 58 struct inet_diag_req_v2 *req)
59{ 59{
60 return inet_diag_dump_one_icsk(&dccp_hashinfo, in_skb, nlh, req); 60 return inet_diag_dump_one_icsk(&dccp_hashinfo, in_skb, nlh, req);
61} 61}
diff --git a/net/ipv4/inet_diag.c b/net/ipv4/inet_diag.c
index 2240a8e8c44d..cf23a7cacdd4 100644
--- a/net/ipv4/inet_diag.c
+++ b/net/ipv4/inet_diag.c
@@ -71,7 +71,7 @@ static inline void inet_diag_unlock_handler(
71} 71}
72 72
73int inet_sk_diag_fill(struct sock *sk, struct inet_connection_sock *icsk, 73int inet_sk_diag_fill(struct sock *sk, struct inet_connection_sock *icsk,
74 struct sk_buff *skb, struct inet_diag_req *req, 74 struct sk_buff *skb, struct inet_diag_req_v2 *req,
75 u32 pid, u32 seq, u16 nlmsg_flags, 75 u32 pid, u32 seq, u16 nlmsg_flags,
76 const struct nlmsghdr *unlh) 76 const struct nlmsghdr *unlh)
77{ 77{
@@ -193,7 +193,7 @@ nlmsg_failure:
193EXPORT_SYMBOL_GPL(inet_sk_diag_fill); 193EXPORT_SYMBOL_GPL(inet_sk_diag_fill);
194 194
195static int inet_csk_diag_fill(struct sock *sk, 195static int inet_csk_diag_fill(struct sock *sk,
196 struct sk_buff *skb, struct inet_diag_req *req, 196 struct sk_buff *skb, struct inet_diag_req_v2 *req,
197 u32 pid, u32 seq, u16 nlmsg_flags, 197 u32 pid, u32 seq, u16 nlmsg_flags,
198 const struct nlmsghdr *unlh) 198 const struct nlmsghdr *unlh)
199{ 199{
@@ -202,7 +202,7 @@ static int inet_csk_diag_fill(struct sock *sk,
202} 202}
203 203
204static int inet_twsk_diag_fill(struct inet_timewait_sock *tw, 204static int inet_twsk_diag_fill(struct inet_timewait_sock *tw,
205 struct sk_buff *skb, struct inet_diag_req *req, 205 struct sk_buff *skb, struct inet_diag_req_v2 *req,
206 u32 pid, u32 seq, u16 nlmsg_flags, 206 u32 pid, u32 seq, u16 nlmsg_flags,
207 const struct nlmsghdr *unlh) 207 const struct nlmsghdr *unlh)
208{ 208{
@@ -253,7 +253,7 @@ nlmsg_failure:
253} 253}
254 254
255static int sk_diag_fill(struct sock *sk, struct sk_buff *skb, 255static int sk_diag_fill(struct sock *sk, struct sk_buff *skb,
256 struct inet_diag_req *r, u32 pid, u32 seq, u16 nlmsg_flags, 256 struct inet_diag_req_v2 *r, u32 pid, u32 seq, u16 nlmsg_flags,
257 const struct nlmsghdr *unlh) 257 const struct nlmsghdr *unlh)
258{ 258{
259 if (sk->sk_state == TCP_TIME_WAIT) 259 if (sk->sk_state == TCP_TIME_WAIT)
@@ -264,7 +264,7 @@ static int sk_diag_fill(struct sock *sk, struct sk_buff *skb,
264} 264}
265 265
266int inet_diag_dump_one_icsk(struct inet_hashinfo *hashinfo, struct sk_buff *in_skb, 266int inet_diag_dump_one_icsk(struct inet_hashinfo *hashinfo, struct sk_buff *in_skb,
267 const struct nlmsghdr *nlh, struct inet_diag_req *req) 267 const struct nlmsghdr *nlh, struct inet_diag_req_v2 *req)
268{ 268{
269 int err; 269 int err;
270 struct sock *sk; 270 struct sock *sk;
@@ -333,7 +333,7 @@ EXPORT_SYMBOL_GPL(inet_diag_dump_one_icsk);
333 333
334static int inet_diag_get_exact(struct sk_buff *in_skb, 334static int inet_diag_get_exact(struct sk_buff *in_skb,
335 const struct nlmsghdr *nlh, 335 const struct nlmsghdr *nlh,
336 struct inet_diag_req *req) 336 struct inet_diag_req_v2 *req)
337{ 337{
338 const struct inet_diag_handler *handler; 338 const struct inet_diag_handler *handler;
339 int err; 339 int err;
@@ -540,7 +540,7 @@ static int inet_diag_bc_audit(const void *bytecode, int bytecode_len)
540static int inet_csk_diag_dump(struct sock *sk, 540static int inet_csk_diag_dump(struct sock *sk,
541 struct sk_buff *skb, 541 struct sk_buff *skb,
542 struct netlink_callback *cb, 542 struct netlink_callback *cb,
543 struct inet_diag_req *r, 543 struct inet_diag_req_v2 *r,
544 const struct nlattr *bc) 544 const struct nlattr *bc)
545{ 545{
546 if (!inet_diag_bc_sk(bc, sk)) 546 if (!inet_diag_bc_sk(bc, sk))
@@ -554,7 +554,7 @@ static int inet_csk_diag_dump(struct sock *sk,
554static int inet_twsk_diag_dump(struct inet_timewait_sock *tw, 554static int inet_twsk_diag_dump(struct inet_timewait_sock *tw,
555 struct sk_buff *skb, 555 struct sk_buff *skb,
556 struct netlink_callback *cb, 556 struct netlink_callback *cb,
557 struct inet_diag_req *r, 557 struct inet_diag_req_v2 *r,
558 const struct nlattr *bc) 558 const struct nlattr *bc)
559{ 559{
560 if (bc != NULL) { 560 if (bc != NULL) {
@@ -639,7 +639,7 @@ nlmsg_failure:
639 639
640static int inet_diag_dump_reqs(struct sk_buff *skb, struct sock *sk, 640static int inet_diag_dump_reqs(struct sk_buff *skb, struct sock *sk,
641 struct netlink_callback *cb, 641 struct netlink_callback *cb,
642 struct inet_diag_req *r, 642 struct inet_diag_req_v2 *r,
643 const struct nlattr *bc) 643 const struct nlattr *bc)
644{ 644{
645 struct inet_diag_entry entry; 645 struct inet_diag_entry entry;
@@ -721,7 +721,7 @@ out:
721} 721}
722 722
723void inet_diag_dump_icsk(struct inet_hashinfo *hashinfo, struct sk_buff *skb, 723void inet_diag_dump_icsk(struct inet_hashinfo *hashinfo, struct sk_buff *skb,
724 struct netlink_callback *cb, struct inet_diag_req *r, struct nlattr *bc) 724 struct netlink_callback *cb, struct inet_diag_req_v2 *r, struct nlattr *bc)
725{ 725{
726 int i, num; 726 int i, num;
727 int s_i, s_num; 727 int s_i, s_num;
@@ -872,7 +872,7 @@ out:
872EXPORT_SYMBOL_GPL(inet_diag_dump_icsk); 872EXPORT_SYMBOL_GPL(inet_diag_dump_icsk);
873 873
874static int __inet_diag_dump(struct sk_buff *skb, struct netlink_callback *cb, 874static int __inet_diag_dump(struct sk_buff *skb, struct netlink_callback *cb,
875 struct inet_diag_req *r, struct nlattr *bc) 875 struct inet_diag_req_v2 *r, struct nlattr *bc)
876{ 876{
877 const struct inet_diag_handler *handler; 877 const struct inet_diag_handler *handler;
878 878
@@ -887,12 +887,12 @@ static int __inet_diag_dump(struct sk_buff *skb, struct netlink_callback *cb,
887static int inet_diag_dump(struct sk_buff *skb, struct netlink_callback *cb) 887static int inet_diag_dump(struct sk_buff *skb, struct netlink_callback *cb)
888{ 888{
889 struct nlattr *bc = NULL; 889 struct nlattr *bc = NULL;
890 int hdrlen = sizeof(struct inet_diag_req); 890 int hdrlen = sizeof(struct inet_diag_req_v2);
891 891
892 if (nlmsg_attrlen(cb->nlh, hdrlen)) 892 if (nlmsg_attrlen(cb->nlh, hdrlen))
893 bc = nlmsg_find_attr(cb->nlh, hdrlen, INET_DIAG_REQ_BYTECODE); 893 bc = nlmsg_find_attr(cb->nlh, hdrlen, INET_DIAG_REQ_BYTECODE);
894 894
895 return __inet_diag_dump(skb, cb, (struct inet_diag_req *)NLMSG_DATA(cb->nlh), bc); 895 return __inet_diag_dump(skb, cb, (struct inet_diag_req_v2 *)NLMSG_DATA(cb->nlh), bc);
896} 896}
897 897
898static inline int inet_diag_type2proto(int type) 898static inline int inet_diag_type2proto(int type)
@@ -910,7 +910,7 @@ static inline int inet_diag_type2proto(int type)
910static int inet_diag_dump_compat(struct sk_buff *skb, struct netlink_callback *cb) 910static int inet_diag_dump_compat(struct sk_buff *skb, struct netlink_callback *cb)
911{ 911{
912 struct inet_diag_req_compat *rc = NLMSG_DATA(cb->nlh); 912 struct inet_diag_req_compat *rc = NLMSG_DATA(cb->nlh);
913 struct inet_diag_req req; 913 struct inet_diag_req_v2 req;
914 struct nlattr *bc = NULL; 914 struct nlattr *bc = NULL;
915 int hdrlen = sizeof(struct inet_diag_req_compat); 915 int hdrlen = sizeof(struct inet_diag_req_compat);
916 916
@@ -930,7 +930,7 @@ static int inet_diag_get_exact_compat(struct sk_buff *in_skb,
930 const struct nlmsghdr *nlh) 930 const struct nlmsghdr *nlh)
931{ 931{
932 struct inet_diag_req_compat *rc = NLMSG_DATA(nlh); 932 struct inet_diag_req_compat *rc = NLMSG_DATA(nlh);
933 struct inet_diag_req req; 933 struct inet_diag_req_v2 req;
934 934
935 req.sdiag_family = rc->idiag_family; 935 req.sdiag_family = rc->idiag_family;
936 req.sdiag_protocol = inet_diag_type2proto(nlh->nlmsg_type); 936 req.sdiag_protocol = inet_diag_type2proto(nlh->nlmsg_type);
@@ -970,7 +970,7 @@ static int inet_diag_rcv_msg_compat(struct sk_buff *skb, struct nlmsghdr *nlh)
970 970
971static int inet_diag_handler_dump(struct sk_buff *skb, struct nlmsghdr *h) 971static int inet_diag_handler_dump(struct sk_buff *skb, struct nlmsghdr *h)
972{ 972{
973 int hdrlen = sizeof(struct inet_diag_req); 973 int hdrlen = sizeof(struct inet_diag_req_v2);
974 974
975 if (nlmsg_len(h) < hdrlen) 975 if (nlmsg_len(h) < hdrlen)
976 return -EINVAL; 976 return -EINVAL;
@@ -990,7 +990,7 @@ static int inet_diag_handler_dump(struct sk_buff *skb, struct nlmsghdr *h)
990 inet_diag_dump, NULL, 0); 990 inet_diag_dump, NULL, 0);
991 } 991 }
992 992
993 return inet_diag_get_exact(skb, h, (struct inet_diag_req *)NLMSG_DATA(h)); 993 return inet_diag_get_exact(skb, h, (struct inet_diag_req_v2 *)NLMSG_DATA(h));
994} 994}
995 995
996static struct sock_diag_handler inet_diag_handler = { 996static struct sock_diag_handler inet_diag_handler = {
diff --git a/net/ipv4/tcp_diag.c b/net/ipv4/tcp_diag.c
index 8cd357a8be79..ed3f2ad42e0f 100644
--- a/net/ipv4/tcp_diag.c
+++ b/net/ipv4/tcp_diag.c
@@ -35,13 +35,13 @@ static void tcp_diag_get_info(struct sock *sk, struct inet_diag_msg *r,
35} 35}
36 36
37static void tcp_diag_dump(struct sk_buff *skb, struct netlink_callback *cb, 37static void tcp_diag_dump(struct sk_buff *skb, struct netlink_callback *cb,
38 struct inet_diag_req *r, struct nlattr *bc) 38 struct inet_diag_req_v2 *r, struct nlattr *bc)
39{ 39{
40 inet_diag_dump_icsk(&tcp_hashinfo, skb, cb, r, bc); 40 inet_diag_dump_icsk(&tcp_hashinfo, skb, cb, r, bc);
41} 41}
42 42
43static int tcp_diag_dump_one(struct sk_buff *in_skb, const struct nlmsghdr *nlh, 43static int tcp_diag_dump_one(struct sk_buff *in_skb, const struct nlmsghdr *nlh,
44 struct inet_diag_req *req) 44 struct inet_diag_req_v2 *req)
45{ 45{
46 return inet_diag_dump_one_icsk(&tcp_hashinfo, in_skb, nlh, req); 46 return inet_diag_dump_one_icsk(&tcp_hashinfo, in_skb, nlh, req);
47} 47}
diff --git a/net/ipv4/udp_diag.c b/net/ipv4/udp_diag.c
index 69f8a7ca63dd..e5e18cb8a586 100644
--- a/net/ipv4/udp_diag.c
+++ b/net/ipv4/udp_diag.c
@@ -19,7 +19,7 @@
19#include <linux/sock_diag.h> 19#include <linux/sock_diag.h>
20 20
21static int sk_diag_dump(struct sock *sk, struct sk_buff *skb, 21static int sk_diag_dump(struct sock *sk, struct sk_buff *skb,
22 struct netlink_callback *cb, struct inet_diag_req *req, 22 struct netlink_callback *cb, struct inet_diag_req_v2 *req,
23 struct nlattr *bc) 23 struct nlattr *bc)
24{ 24{
25 if (!inet_diag_bc_sk(bc, sk)) 25 if (!inet_diag_bc_sk(bc, sk))
@@ -30,7 +30,7 @@ static int sk_diag_dump(struct sock *sk, struct sk_buff *skb,
30} 30}
31 31
32static int udp_dump_one(struct udp_table *tbl, struct sk_buff *in_skb, 32static int udp_dump_one(struct udp_table *tbl, struct sk_buff *in_skb,
33 const struct nlmsghdr *nlh, struct inet_diag_req *req) 33 const struct nlmsghdr *nlh, struct inet_diag_req_v2 *req)
34{ 34{
35 int err = -EINVAL; 35 int err = -EINVAL;
36 struct sock *sk; 36 struct sock *sk;
@@ -88,7 +88,7 @@ out_nosk:
88} 88}
89 89
90static void udp_dump(struct udp_table *table, struct sk_buff *skb, struct netlink_callback *cb, 90static void udp_dump(struct udp_table *table, struct sk_buff *skb, struct netlink_callback *cb,
91 struct inet_diag_req *r, struct nlattr *bc) 91 struct inet_diag_req_v2 *r, struct nlattr *bc)
92{ 92{
93 int num, s_num, slot, s_slot; 93 int num, s_num, slot, s_slot;
94 94
@@ -136,13 +136,13 @@ done:
136} 136}
137 137
138static void udp_diag_dump(struct sk_buff *skb, struct netlink_callback *cb, 138static void udp_diag_dump(struct sk_buff *skb, struct netlink_callback *cb,
139 struct inet_diag_req *r, struct nlattr *bc) 139 struct inet_diag_req_v2 *r, struct nlattr *bc)
140{ 140{
141 udp_dump(&udp_table, skb, cb, r, bc); 141 udp_dump(&udp_table, skb, cb, r, bc);
142} 142}
143 143
144static int udp_diag_dump_one(struct sk_buff *in_skb, const struct nlmsghdr *nlh, 144static int udp_diag_dump_one(struct sk_buff *in_skb, const struct nlmsghdr *nlh,
145 struct inet_diag_req *req) 145 struct inet_diag_req_v2 *req)
146{ 146{
147 return udp_dump_one(&udp_table, in_skb, nlh, req); 147 return udp_dump_one(&udp_table, in_skb, nlh, req);
148} 148}
@@ -154,13 +154,13 @@ static const struct inet_diag_handler udp_diag_handler = {
154}; 154};
155 155
156static void udplite_diag_dump(struct sk_buff *skb, struct netlink_callback *cb, 156static void udplite_diag_dump(struct sk_buff *skb, struct netlink_callback *cb,
157 struct inet_diag_req *r, struct nlattr *bc) 157 struct inet_diag_req_v2 *r, struct nlattr *bc)
158{ 158{
159 udp_dump(&udplite_table, skb, cb, r, bc); 159 udp_dump(&udplite_table, skb, cb, r, bc);
160} 160}
161 161
162static int udplite_diag_dump_one(struct sk_buff *in_skb, const struct nlmsghdr *nlh, 162static int udplite_diag_dump_one(struct sk_buff *in_skb, const struct nlmsghdr *nlh,
163 struct inet_diag_req *req) 163 struct inet_diag_req_v2 *req)
164{ 164{
165 return udp_dump_one(&udplite_table, in_skb, nlh, req); 165 return udp_dump_one(&udplite_table, in_skb, nlh, req);
166} 166}