Skip to content

Commit 73c1f4a

Browse files
Arnaldo Carvalho de MeloDavid S. Miller
authored andcommitted
[TCPDIAG]: Just rename everything to inet_diag
Next changeset will rename tcp_diag.[ch] to inet_diag.[ch]. I'm taking this longer route so as to easy review, making clear the changes made all along the way. Signed-off-by: Arnaldo Carvalho de Melo <acme@mandriva.com> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent 4f5736c commit 73c1f4a

10 files changed

Lines changed: 275 additions & 283 deletions

File tree

‎include/linux/netlink.h‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
#define NETLINK_W1 1 /* 1-wire subsystem */
99
#define NETLINK_USERSOCK 2 /* Reserved for user mode socket protocols */
1010
#define NETLINK_FIREWALL 3 /* Firewalling hook */
11-
#define NETLINK_TCPDIAG 4 /* TCP socket monitoring */
11+
#define NETLINK_INET_DIAG 4 /* INET socket monitoring */
1212
#define NETLINK_NFLOG 5 /* netfilter/iptables ULOG */
1313
#define NETLINK_XFRM 6 /* ipsec */
1414
#define NETLINK_SELINUX 7 /* SELinux event notifications */

‎include/linux/tcp_diag.h‎

Lines changed: 63 additions & 72 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
#ifndef _TCP_DIAG_H_
2-
#define _TCP_DIAG_H_ 1
1+
#ifndef _INET_DIAG_H_
2+
#define _INET_DIAG_H_ 1
33

44
/* Just some random number */
55
#define TCPDIAG_GETSOCK 18
@@ -8,68 +8,62 @@
88
#define INET_DIAG_GETSOCK_MAX 24
99

1010
/* Socket identity */
11-
struct tcpdiag_sockid
12-
{
13-
__u16 tcpdiag_sport;
14-
__u16 tcpdiag_dport;
15-
__u32 tcpdiag_src[4];
16-
__u32 tcpdiag_dst[4];
17-
__u32 tcpdiag_if;
18-
__u32 tcpdiag_cookie[2];
19-
#define TCPDIAG_NOCOOKIE (~0U)
11+
struct inet_diag_sockid {
12+
__u16 idiag_sport;
13+
__u16 idiag_dport;
14+
__u32 idiag_src[4];
15+
__u32 idiag_dst[4];
16+
__u32 idiag_if;
17+
__u32 idiag_cookie[2];
18+
#define INET_DIAG_NOCOOKIE (~0U)
2019
};
2120

2221
/* Request structure */
2322

24-
struct tcpdiagreq
25-
{
26-
__u8 tcpdiag_family; /* Family of addresses. */
27-
__u8 tcpdiag_src_len;
28-
__u8 tcpdiag_dst_len;
29-
__u8 tcpdiag_ext; /* Query extended information */
23+
struct inet_diag_req {
24+
__u8 idiag_family; /* Family of addresses. */
25+
__u8 idiag_src_len;
26+
__u8 idiag_dst_len;
27+
__u8 idiag_ext; /* Query extended information */
3028

31-
struct tcpdiag_sockid id;
29+
struct inet_diag_sockid id;
3230

33-
__u32 tcpdiag_states; /* States to dump */
34-
__u32 tcpdiag_dbs; /* Tables to dump (NI) */
31+
__u32 idiag_states; /* States to dump */
32+
__u32 idiag_dbs; /* Tables to dump (NI) */
3533
};
3634

37-
enum
38-
{
39-
TCPDIAG_REQ_NONE,
40-
TCPDIAG_REQ_BYTECODE,
35+
enum {
36+
INET_DIAG_REQ_NONE,
37+
INET_DIAG_REQ_BYTECODE,
4138
};
4239

43-
#define TCPDIAG_REQ_MAX TCPDIAG_REQ_BYTECODE
40+
#define INET_DIAG_REQ_MAX INET_DIAG_REQ_BYTECODE
4441

4542
/* Bytecode is sequence of 4 byte commands followed by variable arguments.
4643
* All the commands identified by "code" are conditional jumps forward:
4744
* to offset cc+"yes" or to offset cc+"no". "yes" is supposed to be
4845
* length of the command and its arguments.
4946
*/
5047

51-
struct tcpdiag_bc_op
52-
{
48+
struct inet_diag_bc_op {
5349
unsigned char code;
5450
unsigned char yes;
5551
unsigned short no;
5652
};
5753

58-
enum
59-
{
60-
TCPDIAG_BC_NOP,
61-
TCPDIAG_BC_JMP,
62-
TCPDIAG_BC_S_GE,
63-
TCPDIAG_BC_S_LE,
64-
TCPDIAG_BC_D_GE,
65-
TCPDIAG_BC_D_LE,
66-
TCPDIAG_BC_AUTO,
67-
TCPDIAG_BC_S_COND,
68-
TCPDIAG_BC_D_COND,
54+
enum {
55+
INET_DIAG_BC_NOP,
56+
INET_DIAG_BC_JMP,
57+
INET_DIAG_BC_S_GE,
58+
INET_DIAG_BC_S_LE,
59+
INET_DIAG_BC_D_GE,
60+
INET_DIAG_BC_D_LE,
61+
INET_DIAG_BC_AUTO,
62+
INET_DIAG_BC_S_COND,
63+
INET_DIAG_BC_D_COND,
6964
};
7065

71-
struct tcpdiag_hostcond
72-
{
66+
struct inet_diag_hostcond {
7367
__u8 family;
7468
__u8 prefix_len;
7569
int port;
@@ -78,47 +72,44 @@ struct tcpdiag_hostcond
7872

7973
/* Base info structure. It contains socket identity (addrs/ports/cookie)
8074
* and, alas, the information shown by netstat. */
81-
struct tcpdiagmsg
82-
{
83-
__u8 tcpdiag_family;
84-
__u8 tcpdiag_state;
85-
__u8 tcpdiag_timer;
86-
__u8 tcpdiag_retrans;
87-
88-
struct tcpdiag_sockid id;
89-
90-
__u32 tcpdiag_expires;
91-
__u32 tcpdiag_rqueue;
92-
__u32 tcpdiag_wqueue;
93-
__u32 tcpdiag_uid;
94-
__u32 tcpdiag_inode;
75+
struct inet_diag_msg {
76+
__u8 idiag_family;
77+
__u8 idiag_state;
78+
__u8 idiag_timer;
79+
__u8 idiag_retrans;
80+
81+
struct inet_diag_sockid id;
82+
83+
__u32 idiag_expires;
84+
__u32 idiag_rqueue;
85+
__u32 idiag_wqueue;
86+
__u32 idiag_uid;
87+
__u32 idiag_inode;
9588
};
9689

9790
/* Extensions */
9891

99-
enum
100-
{
101-
TCPDIAG_NONE,
102-
TCPDIAG_MEMINFO,
103-
TCPDIAG_INFO,
104-
TCPDIAG_VEGASINFO,
105-
TCPDIAG_CONG,
92+
enum {
93+
INET_DIAG_NONE,
94+
INET_DIAG_MEMINFO,
95+
INET_DIAG_INFO,
96+
INET_DIAG_VEGASINFO,
97+
INET_DIAG_CONG,
10698
};
10799

108-
#define TCPDIAG_MAX TCPDIAG_CONG
100+
#define INET_DIAG_MAX INET_DIAG_CONG
109101

110102

111-
/* TCPDIAG_MEM */
103+
/* INET_DIAG_MEM */
112104

113-
struct tcpdiag_meminfo
114-
{
115-
__u32 tcpdiag_rmem;
116-
__u32 tcpdiag_wmem;
117-
__u32 tcpdiag_fmem;
118-
__u32 tcpdiag_tmem;
105+
struct inet_diag_meminfo {
106+
__u32 idiag_rmem;
107+
__u32 idiag_wmem;
108+
__u32 idiag_fmem;
109+
__u32 idiag_tmem;
119110
};
120111

121-
/* TCPDIAG_VEGASINFO */
112+
/* INET_DIAG_VEGASINFO */
122113

123114
struct tcpvegas_info {
124115
__u32 tcpv_enabled;
@@ -134,7 +125,7 @@ struct inet_hashinfo;
134125
struct inet_diag_handler {
135126
struct inet_hashinfo *idiag_hashinfo;
136127
void (*idiag_get_info)(struct sock *sk,
137-
struct tcpdiagmsg *r,
128+
struct inet_diag_msg *r,
138129
void *info);
139130
__u16 idiag_info_size;
140131
__u16 idiag_type;
@@ -144,4 +135,4 @@ extern int inet_diag_register(const struct inet_diag_handler *handler);
144135
extern void inet_diag_unregister(const struct inet_diag_handler *handler);
145136
#endif /* __KERNEL__ */
146137

147-
#endif /* _TCP_DIAG_H_ */
138+
#endif /* _INET_DIAG_H_ */

‎include/net/tcp.h‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -690,7 +690,7 @@ struct tcp_congestion_ops {
690690
u32 (*undo_cwnd)(struct sock *sk);
691691
/* hook for packet ack accounting (optional) */
692692
void (*pkts_acked)(struct sock *sk, u32 num_acked);
693-
/* get info for tcp_diag (optional) */
693+
/* get info for inet_diag (optional) */
694694
void (*get_info)(struct sock *sk, u32 ext, struct sk_buff *skb);
695695

696696
char name[TCP_CA_NAME_MAX];

‎net/dccp/Kconfig‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@ config IP_DCCP
2020
If in doubt, say N.
2121

2222
config IP_DCCP_DIAG
23-
depends on IP_DCCP && IP_TCPDIAG
24-
def_tristate y if (IP_DCCP = y && IP_TCPDIAG = y)
23+
depends on IP_DCCP && IP_INET_DIAG
24+
def_tristate y if (IP_DCCP = y && IP_INET_DIAG = y)
2525
def_tristate m
2626

2727
source "net/dccp/ccids/Kconfig"

‎net/dccp/diag.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,10 @@
1616

1717
#include "dccp.h"
1818

19-
static void dccp_diag_get_info(struct sock *sk, struct tcpdiagmsg *r,
19+
static void dccp_diag_get_info(struct sock *sk, struct inet_diag_msg *r,
2020
void *_info)
2121
{
22-
r->tcpdiag_rqueue = r->tcpdiag_wqueue = 0;
22+
r->idiag_rqueue = r->idiag_wqueue = 0;
2323
}
2424

2525
static struct inet_diag_handler dccp_diag_handler = {

‎net/ipv4/Kconfig‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -413,13 +413,13 @@ config INET_TUNNEL
413413

414414
If unsure, say Y.
415415

416-
config IP_TCPDIAG
417-
tristate "IP: TCP socket monitoring interface"
416+
config IP_INET_DIAG
417+
tristate "IP: INET socket monitoring interface"
418418
default y
419419
---help---
420-
Support for TCP socket monitoring interface used by native Linux
421-
tools such as ss. ss is included in iproute2, currently downloadable
422-
at <http://developer.osdl.org/dev/iproute2>.
420+
Support for INET (TCP, DCCP, etc) socket monitoring interface used by
421+
native Linux tools such as ss. ss is included in iproute2, currently
422+
downloadable at <http://developer.osdl.org/dev/iproute2>.
423423

424424
If unsure, say Y.
425425

‎net/ipv4/Makefile‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ obj-$(CONFIG_IP_ROUTE_MULTIPATH_WRANDOM) += multipath_wrandom.o
3030
obj-$(CONFIG_IP_ROUTE_MULTIPATH_DRR) += multipath_drr.o
3131
obj-$(CONFIG_NETFILTER) += netfilter/
3232
obj-$(CONFIG_IP_VS) += ipvs/
33-
obj-$(CONFIG_IP_TCPDIAG) += tcp_diag.o
33+
obj-$(CONFIG_IP_INET_DIAG) += tcp_diag.o
3434
obj-$(CONFIG_IP_ROUTE_MULTIPATH_CACHED) += multipath.o
3535
obj-$(CONFIG_TCP_CONG_BIC) += tcp_bic.o
3636
obj-$(CONFIG_TCP_CONG_WESTWOOD) += tcp_westwood.o

0 commit comments

Comments
 (0)