Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Pavel Emelyanov and committed by
David S. Miller
c8991362 f515e6b7

+34 -34
+6 -6
include/linux/inet_diag.h
··· 34 34 __u32 idiag_dbs; /* Tables to dump (NI) */ 35 35 }; 36 36 37 - struct inet_diag_req { 37 + struct inet_diag_req_v2 { 38 38 __u8 sdiag_family; 39 39 __u8 sdiag_protocol; 40 40 __u8 idiag_ext; ··· 143 143 struct inet_diag_handler { 144 144 void (*dump)(struct sk_buff *skb, 145 145 struct netlink_callback *cb, 146 - struct inet_diag_req *r, 146 + struct inet_diag_req_v2 *r, 147 147 struct nlattr *bc); 148 148 149 149 int (*dump_one)(struct sk_buff *in_skb, 150 150 const struct nlmsghdr *nlh, 151 - struct inet_diag_req *req); 151 + struct inet_diag_req_v2 *req); 152 152 153 153 void (*idiag_get_info)(struct sock *sk, 154 154 struct inet_diag_msg *r, ··· 158 158 159 159 struct inet_connection_sock; 160 160 int 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 162 u32 pid, u32 seq, u16 nlmsg_flags, 163 163 const struct nlmsghdr *unlh); 164 164 void 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 166 struct nlattr *bc); 167 167 int inet_diag_dump_one_icsk(struct inet_hashinfo *hashinfo, 168 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 171 171 int inet_diag_bc_sk(const struct nlattr *_bc, struct sock *sk); 172 172
+2 -2
net/dccp/diag.c
··· 49 49 } 50 50 51 51 static 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 54 inet_diag_dump_icsk(&dccp_hashinfo, skb, cb, r, bc); 55 55 } 56 56 57 57 static 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 60 return inet_diag_dump_one_icsk(&dccp_hashinfo, in_skb, nlh, req); 61 61 }
+17 -17
net/ipv4/inet_diag.c
··· 71 71 } 72 72 73 73 int 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 75 u32 pid, u32 seq, u16 nlmsg_flags, 76 76 const struct nlmsghdr *unlh) 77 77 { ··· 193 193 EXPORT_SYMBOL_GPL(inet_sk_diag_fill); 194 194 195 195 static 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 197 u32 pid, u32 seq, u16 nlmsg_flags, 198 198 const struct nlmsghdr *unlh) 199 199 { ··· 202 202 } 203 203 204 204 static 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 206 u32 pid, u32 seq, u16 nlmsg_flags, 207 207 const struct nlmsghdr *unlh) 208 208 { ··· 253 253 } 254 254 255 255 static 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 257 const struct nlmsghdr *unlh) 258 258 { 259 259 if (sk->sk_state == TCP_TIME_WAIT) ··· 264 264 } 265 265 266 266 int 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 269 int err; 270 270 struct sock *sk; ··· 333 333 334 334 static int inet_diag_get_exact(struct sk_buff *in_skb, 335 335 const struct nlmsghdr *nlh, 336 - struct inet_diag_req *req) 336 + struct inet_diag_req_v2 *req) 337 337 { 338 338 const struct inet_diag_handler *handler; 339 339 int err; ··· 540 540 static int inet_csk_diag_dump(struct sock *sk, 541 541 struct sk_buff *skb, 542 542 struct netlink_callback *cb, 543 - struct inet_diag_req *r, 543 + struct inet_diag_req_v2 *r, 544 544 const struct nlattr *bc) 545 545 { 546 546 if (!inet_diag_bc_sk(bc, sk)) ··· 554 554 static int inet_twsk_diag_dump(struct inet_timewait_sock *tw, 555 555 struct sk_buff *skb, 556 556 struct netlink_callback *cb, 557 - struct inet_diag_req *r, 557 + struct inet_diag_req_v2 *r, 558 558 const struct nlattr *bc) 559 559 { 560 560 if (bc != NULL) { ··· 639 639 640 640 static int inet_diag_dump_reqs(struct sk_buff *skb, struct sock *sk, 641 641 struct netlink_callback *cb, 642 - struct inet_diag_req *r, 642 + struct inet_diag_req_v2 *r, 643 643 const struct nlattr *bc) 644 644 { 645 645 struct inet_diag_entry entry; ··· 721 721 } 722 722 723 723 void 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 726 int i, num; 727 727 int s_i, s_num; ··· 872 872 EXPORT_SYMBOL_GPL(inet_diag_dump_icsk); 873 873 874 874 static 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 877 const struct inet_diag_handler *handler; 878 878 ··· 887 887 static int inet_diag_dump(struct sk_buff *skb, struct netlink_callback *cb) 888 888 { 889 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 892 if (nlmsg_attrlen(cb->nlh, hdrlen)) 893 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 898 898 static inline int inet_diag_type2proto(int type) ··· 910 910 static int inet_diag_dump_compat(struct sk_buff *skb, struct netlink_callback *cb) 911 911 { 912 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 914 struct nlattr *bc = NULL; 915 915 int hdrlen = sizeof(struct inet_diag_req_compat); 916 916 ··· 930 930 const struct nlmsghdr *nlh) 931 931 { 932 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 935 req.sdiag_family = rc->idiag_family; 936 936 req.sdiag_protocol = inet_diag_type2proto(nlh->nlmsg_type); ··· 970 970 971 971 static 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 975 if (nlmsg_len(h) < hdrlen) 976 976 return -EINVAL; ··· 990 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 996 996 static struct sock_diag_handler inet_diag_handler = {
+2 -2
net/ipv4/tcp_diag.c
··· 35 35 } 36 36 37 37 static 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 40 inet_diag_dump_icsk(&tcp_hashinfo, skb, cb, r, bc); 41 41 } 42 42 43 43 static 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 46 return inet_diag_dump_one_icsk(&tcp_hashinfo, in_skb, nlh, req); 47 47 }
+7 -7
net/ipv4/udp_diag.c
··· 19 19 #include <linux/sock_diag.h> 20 20 21 21 static 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 23 struct nlattr *bc) 24 24 { 25 25 if (!inet_diag_bc_sk(bc, sk)) ··· 30 30 } 31 31 32 32 static 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 35 int err = -EINVAL; 36 36 struct sock *sk; ··· 88 88 } 89 89 90 90 static 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 93 int num, s_num, slot, s_slot; 94 94 ··· 136 136 } 137 137 138 138 static 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 141 udp_dump(&udp_table, skb, cb, r, bc); 142 142 } 143 143 144 144 static 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 147 return udp_dump_one(&udp_table, in_skb, nlh, req); 148 148 } ··· 154 154 }; 155 155 156 156 static 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 159 udp_dump(&udplite_table, skb, cb, r, bc); 160 160 } 161 161 162 162 static 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 165 return udp_dump_one(&udplite_table, in_skb, nlh, req); 166 166 }