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
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
123114struct tcpvegas_info {
124115 __u32 tcpv_enabled ;
@@ -134,7 +125,7 @@ struct inet_hashinfo;
134125struct 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);
144135extern void inet_diag_unregister (const struct inet_diag_handler * handler );
145136#endif /* __KERNEL__ */
146137
147- #endif /* _TCP_DIAG_H_ */
138+ #endif /* _INET_DIAG_H_ */
0 commit comments