inet_diag.c (62ad6fcd743792bf294f2a7ba26ab8f462065150) inet_diag.c (8dcf01fc009d12d01fd195ed95eaaee61178f21a)
1/*
2 * inet_diag.c Module for monitoring INET transport protocols sockets.
3 *
4 * Authors: Alexey Kuznetsov, <kuznet@ms2.inr.ac.ru>
5 *
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License
8 * as published by the Free Software Foundation; either version

--- 127 unchanged lines hidden (view full) ---

136 minfo->idiag_tmem = sk_wmem_alloc_get(sk);
137 }
138
139 if (ext & (1 << (INET_DIAG_SKMEMINFO - 1)))
140 if (sock_diag_put_meminfo(sk, skb, INET_DIAG_SKMEMINFO))
141 goto rtattr_failure;
142
143 if (icsk == NULL) {
1/*
2 * inet_diag.c Module for monitoring INET transport protocols sockets.
3 *
4 * Authors: Alexey Kuznetsov, <kuznet@ms2.inr.ac.ru>
5 *
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License
8 * as published by the Free Software Foundation; either version

--- 127 unchanged lines hidden (view full) ---

136 minfo->idiag_tmem = sk_wmem_alloc_get(sk);
137 }
138
139 if (ext & (1 << (INET_DIAG_SKMEMINFO - 1)))
140 if (sock_diag_put_meminfo(sk, skb, INET_DIAG_SKMEMINFO))
141 goto rtattr_failure;
142
143 if (icsk == NULL) {
144 handler->idiag_get_info(sk, r, NULL);
144 r->idiag_rqueue = r->idiag_wqueue = 0;
145 goto out;
146 }
147
148#define EXPIRES_IN_MS(tmo) DIV_ROUND_UP((tmo - jiffies) * 1000, HZ)
149
150 if (icsk->icsk_pending == ICSK_TIME_RETRANS) {
151 r->idiag_timer = 1;
152 r->idiag_retrans = icsk->icsk_retransmits;

--- 841 unchanged lines hidden (view full) ---

994 };
995 return netlink_dump_start(sock_diag_nlsk, skb, h, &c);
996 }
997 }
998
999 return inet_diag_get_exact(skb, h, (struct inet_diag_req_v2 *)NLMSG_DATA(h));
1000}
1001
145 goto out;
146 }
147
148#define EXPIRES_IN_MS(tmo) DIV_ROUND_UP((tmo - jiffies) * 1000, HZ)
149
150 if (icsk->icsk_pending == ICSK_TIME_RETRANS) {
151 r->idiag_timer = 1;
152 r->idiag_retrans = icsk->icsk_retransmits;

--- 841 unchanged lines hidden (view full) ---

994 };
995 return netlink_dump_start(sock_diag_nlsk, skb, h, &c);
996 }
997 }
998
999 return inet_diag_get_exact(skb, h, (struct inet_diag_req_v2 *)NLMSG_DATA(h));
1000}
1001
1002static struct sock_diag_handler inet_diag_handler = {
1002static const struct sock_diag_handler inet_diag_handler = {
1003 .family = AF_INET,
1004 .dump = inet_diag_handler_dump,
1005};
1006
1003 .family = AF_INET,
1004 .dump = inet_diag_handler_dump,
1005};
1006
1007static struct sock_diag_handler inet6_diag_handler = {
1007static const struct sock_diag_handler inet6_diag_handler = {
1008 .family = AF_INET6,
1009 .dump = inet_diag_handler_dump,
1010};
1011
1012int inet_diag_register(const struct inet_diag_handler *h)
1013{
1014 const __u16 type = h->idiag_type;
1015 int err = -EINVAL;

--- 71 unchanged lines hidden ---
1008 .family = AF_INET6,
1009 .dump = inet_diag_handler_dump,
1010};
1011
1012int inet_diag_register(const struct inet_diag_handler *h)
1013{
1014 const __u16 type = h->idiag_type;
1015 int err = -EINVAL;

--- 71 unchanged lines hidden ---