]>
Commit | Line | Data |
---|---|---|
1da177e4 LT |
1 | #ifndef _TCP_DIAG_H_ |
2 | #define _TCP_DIAG_H_ 1 | |
3 | ||
4 | /* Just some random number */ | |
5 | #define TCPDIAG_GETSOCK 18 | |
540722ff | 6 | #define DCCPDIAG_GETSOCK 19 |
1da177e4 LT |
7 | |
8 | /* Socket identity */ | |
9 | struct tcpdiag_sockid | |
10 | { | |
11 | __u16 tcpdiag_sport; | |
12 | __u16 tcpdiag_dport; | |
13 | __u32 tcpdiag_src[4]; | |
14 | __u32 tcpdiag_dst[4]; | |
15 | __u32 tcpdiag_if; | |
16 | __u32 tcpdiag_cookie[2]; | |
17 | #define TCPDIAG_NOCOOKIE (~0U) | |
18 | }; | |
19 | ||
20 | /* Request structure */ | |
21 | ||
22 | struct tcpdiagreq | |
23 | { | |
24 | __u8 tcpdiag_family; /* Family of addresses. */ | |
25 | __u8 tcpdiag_src_len; | |
26 | __u8 tcpdiag_dst_len; | |
27 | __u8 tcpdiag_ext; /* Query extended information */ | |
28 | ||
29 | struct tcpdiag_sockid id; | |
30 | ||
31 | __u32 tcpdiag_states; /* States to dump */ | |
32 | __u32 tcpdiag_dbs; /* Tables to dump (NI) */ | |
33 | }; | |
34 | ||
35 | enum | |
36 | { | |
37 | TCPDIAG_REQ_NONE, | |
38 | TCPDIAG_REQ_BYTECODE, | |
39 | }; | |
40 | ||
41 | #define TCPDIAG_REQ_MAX TCPDIAG_REQ_BYTECODE | |
42 | ||
43 | /* Bytecode is sequence of 4 byte commands followed by variable arguments. | |
44 | * All the commands identified by "code" are conditional jumps forward: | |
45 | * to offset cc+"yes" or to offset cc+"no". "yes" is supposed to be | |
46 | * length of the command and its arguments. | |
47 | */ | |
48 | ||
49 | struct tcpdiag_bc_op | |
50 | { | |
51 | unsigned char code; | |
52 | unsigned char yes; | |
53 | unsigned short no; | |
54 | }; | |
55 | ||
56 | enum | |
57 | { | |
58 | TCPDIAG_BC_NOP, | |
59 | TCPDIAG_BC_JMP, | |
60 | TCPDIAG_BC_S_GE, | |
61 | TCPDIAG_BC_S_LE, | |
62 | TCPDIAG_BC_D_GE, | |
63 | TCPDIAG_BC_D_LE, | |
64 | TCPDIAG_BC_AUTO, | |
65 | TCPDIAG_BC_S_COND, | |
66 | TCPDIAG_BC_D_COND, | |
67 | }; | |
68 | ||
69 | struct tcpdiag_hostcond | |
70 | { | |
71 | __u8 family; | |
72 | __u8 prefix_len; | |
73 | int port; | |
74 | __u32 addr[0]; | |
75 | }; | |
76 | ||
77 | /* Base info structure. It contains socket identity (addrs/ports/cookie) | |
78 | * and, alas, the information shown by netstat. */ | |
79 | struct tcpdiagmsg | |
80 | { | |
81 | __u8 tcpdiag_family; | |
82 | __u8 tcpdiag_state; | |
83 | __u8 tcpdiag_timer; | |
84 | __u8 tcpdiag_retrans; | |
85 | ||
86 | struct tcpdiag_sockid id; | |
87 | ||
88 | __u32 tcpdiag_expires; | |
89 | __u32 tcpdiag_rqueue; | |
90 | __u32 tcpdiag_wqueue; | |
91 | __u32 tcpdiag_uid; | |
92 | __u32 tcpdiag_inode; | |
93 | }; | |
94 | ||
95 | /* Extensions */ | |
96 | ||
97 | enum | |
98 | { | |
99 | TCPDIAG_NONE, | |
100 | TCPDIAG_MEMINFO, | |
101 | TCPDIAG_INFO, | |
102 | TCPDIAG_VEGASINFO, | |
056ede6c | 103 | TCPDIAG_CONG, |
1da177e4 LT |
104 | }; |
105 | ||
056ede6c | 106 | #define TCPDIAG_MAX TCPDIAG_CONG |
1da177e4 LT |
107 | |
108 | ||
109 | /* TCPDIAG_MEM */ | |
110 | ||
111 | struct tcpdiag_meminfo | |
112 | { | |
113 | __u32 tcpdiag_rmem; | |
114 | __u32 tcpdiag_wmem; | |
115 | __u32 tcpdiag_fmem; | |
116 | __u32 tcpdiag_tmem; | |
117 | }; | |
118 | ||
119 | /* TCPDIAG_VEGASINFO */ | |
120 | ||
121 | struct tcpvegas_info { | |
122 | __u32 tcpv_enabled; | |
123 | __u32 tcpv_rttcnt; | |
124 | __u32 tcpv_rtt; | |
125 | __u32 tcpv_minrtt; | |
126 | }; | |
127 | ||
1da177e4 | 128 | #endif /* _TCP_DIAG_H_ */ |