aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv4/inet_diag.c
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 /net/ipv4/inet_diag.c
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>
Diffstat (limited to 'net/ipv4/inet_diag.c')
-rw-r--r--net/ipv4/inet_diag.c34
1 files changed, 17 insertions, 17 deletions
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 = {