1
2 #ifndef _UAPI_INET_DIAG_H_
3 #define _UAPI_INET_DIAG_H_
4
5 #include <linux/types.h>
6
7
8 #define TCPDIAG_GETSOCK 18
9 #define DCCPDIAG_GETSOCK 19
10
11 #define INET_DIAG_GETSOCK_MAX 24
12
13
14 struct inet_diag_sockid {
15 __be16 idiag_sport;
16 __be16 idiag_dport;
17 __be32 idiag_src[4];
18 __be32 idiag_dst[4];
19 __u32 idiag_if;
20 __u32 idiag_cookie[2];
21 #define INET_DIAG_NOCOOKIE (~0U)
22 };
23
24
25
26 struct inet_diag_req {
27 __u8 idiag_family;
28 __u8 idiag_src_len;
29 __u8 idiag_dst_len;
30 __u8 idiag_ext;
31
32 struct inet_diag_sockid id;
33
34 __u32 idiag_states;
35 __u32 idiag_dbs;
36 };
37
38 struct inet_diag_req_v2 {
39 __u8 sdiag_family;
40 __u8 sdiag_protocol;
41 __u8 idiag_ext;
42 __u8 pad;
43 __u32 idiag_states;
44 struct inet_diag_sockid id;
45 };
46
47
48
49
50
51
52
53
54
55 struct inet_diag_req_raw {
56 __u8 sdiag_family;
57 __u8 sdiag_protocol;
58 __u8 idiag_ext;
59 __u8 sdiag_raw_protocol;
60 __u32 idiag_states;
61 struct inet_diag_sockid id;
62 };
63
64 enum {
65 INET_DIAG_REQ_NONE,
66 INET_DIAG_REQ_BYTECODE,
67 };
68
69 #define INET_DIAG_REQ_MAX INET_DIAG_REQ_BYTECODE
70
71
72
73
74
75
76
77 struct inet_diag_bc_op {
78 unsigned char code;
79 unsigned char yes;
80 unsigned short no;
81 };
82
83 enum {
84 INET_DIAG_BC_NOP,
85 INET_DIAG_BC_JMP,
86 INET_DIAG_BC_S_GE,
87 INET_DIAG_BC_S_LE,
88 INET_DIAG_BC_D_GE,
89 INET_DIAG_BC_D_LE,
90 INET_DIAG_BC_AUTO,
91 INET_DIAG_BC_S_COND,
92 INET_DIAG_BC_D_COND,
93 INET_DIAG_BC_DEV_COND,
94 INET_DIAG_BC_MARK_COND,
95 INET_DIAG_BC_S_EQ,
96 INET_DIAG_BC_D_EQ,
97 };
98
99 struct inet_diag_hostcond {
100 __u8 family;
101 __u8 prefix_len;
102 int port;
103 __be32 addr[0];
104 };
105
106 struct inet_diag_markcond {
107 __u32 mark;
108 __u32 mask;
109 };
110
111
112
113 struct inet_diag_msg {
114 __u8 idiag_family;
115 __u8 idiag_state;
116 __u8 idiag_timer;
117 __u8 idiag_retrans;
118
119 struct inet_diag_sockid id;
120
121 __u32 idiag_expires;
122 __u32 idiag_rqueue;
123 __u32 idiag_wqueue;
124 __u32 idiag_uid;
125 __u32 idiag_inode;
126 };
127
128
129
130 enum {
131 INET_DIAG_NONE,
132 INET_DIAG_MEMINFO,
133 INET_DIAG_INFO,
134 INET_DIAG_VEGASINFO,
135 INET_DIAG_CONG,
136 INET_DIAG_TOS,
137 INET_DIAG_TCLASS,
138 INET_DIAG_SKMEMINFO,
139 INET_DIAG_SHUTDOWN,
140
141
142
143
144
145
146 INET_DIAG_DCTCPINFO,
147 INET_DIAG_PROTOCOL,
148 INET_DIAG_SKV6ONLY,
149 INET_DIAG_LOCALS,
150 INET_DIAG_PEERS,
151 INET_DIAG_PAD,
152 INET_DIAG_MARK,
153 INET_DIAG_BBRINFO,
154 INET_DIAG_CLASS_ID,
155 INET_DIAG_MD5SIG,
156 INET_DIAG_ULP_INFO,
157 __INET_DIAG_MAX,
158 };
159
160 #define INET_DIAG_MAX (__INET_DIAG_MAX - 1)
161
162 enum {
163 INET_ULP_INFO_UNSPEC,
164 INET_ULP_INFO_NAME,
165 INET_ULP_INFO_TLS,
166 __INET_ULP_INFO_MAX,
167 };
168 #define INET_ULP_INFO_MAX (__INET_ULP_INFO_MAX - 1)
169
170
171
172 struct inet_diag_meminfo {
173 __u32 idiag_rmem;
174 __u32 idiag_wmem;
175 __u32 idiag_fmem;
176 __u32 idiag_tmem;
177 };
178
179
180
181 struct tcpvegas_info {
182 __u32 tcpv_enabled;
183 __u32 tcpv_rttcnt;
184 __u32 tcpv_rtt;
185 __u32 tcpv_minrtt;
186 };
187
188
189
190 struct tcp_dctcp_info {
191 __u16 dctcp_enabled;
192 __u16 dctcp_ce_state;
193 __u32 dctcp_alpha;
194 __u32 dctcp_ab_ecn;
195 __u32 dctcp_ab_tot;
196 };
197
198
199
200 struct tcp_bbr_info {
201
202 __u32 bbr_bw_lo;
203 __u32 bbr_bw_hi;
204 __u32 bbr_min_rtt;
205 __u32 bbr_pacing_gain;
206 __u32 bbr_cwnd_gain;
207 };
208
209 union tcp_cc_info {
210 struct tcpvegas_info vegas;
211 struct tcp_dctcp_info dctcp;
212 struct tcp_bbr_info bbr;
213 };
214 #endif