1 #ifndef _UAPI_INET_DIAG_H_
2 #define _UAPI_INET_DIAG_H_
4 #include <linux/types.h>
6 /* Just some random number */
7 #define TCPDIAG_GETSOCK 18
8 #define DCCPDIAG_GETSOCK 19
10 #define INET_DIAG_GETSOCK_MAX 24
13 struct inet_diag_sockid {
19 __u32 idiag_cookie[2];
20 #define INET_DIAG_NOCOOKIE (~0U)
23 /* Request structure */
25 struct inet_diag_req {
26 __u8 idiag_family; /* Family of addresses. */
29 __u8 idiag_ext; /* Query extended information */
31 struct inet_diag_sockid id;
33 __u32 idiag_states; /* States to dump */
34 __u32 idiag_dbs; /* Tables to dump (NI) */
37 struct inet_diag_req_v2 {
43 struct inet_diag_sockid id;
47 * SOCK_RAW sockets require the underlied protocol to be
48 * additionally specified so we can use @pad member for
49 * this, but we can't rename it because userspace programs
50 * still may depend on this name. Instead lets use another
51 * structure definition as an alias for struct
54 struct inet_diag_req_raw {
58 __u8 sdiag_raw_protocol;
60 struct inet_diag_sockid id;
65 INET_DIAG_REQ_BYTECODE,
68 #define INET_DIAG_REQ_MAX INET_DIAG_REQ_BYTECODE
70 /* Bytecode is sequence of 4 byte commands followed by variable arguments.
71 * All the commands identified by "code" are conditional jumps forward:
72 * to offset cc+"yes" or to offset cc+"no". "yes" is supposed to be
73 * length of the command and its arguments.
76 struct inet_diag_bc_op {
92 INET_DIAG_BC_DEV_COND, /* u32 ifindex */
93 INET_DIAG_BC_MARK_COND,
96 struct inet_diag_hostcond {
103 struct inet_diag_markcond {
108 /* Base info structure. It contains socket identity (addrs/ports/cookie)
109 * and, alas, the information shown by netstat. */
110 struct inet_diag_msg {
116 struct inet_diag_sockid id;
138 INET_DIAG_PROTOCOL, /* response attribute only */
150 #define INET_DIAG_MAX (__INET_DIAG_MAX - 1)
154 struct inet_diag_meminfo {
161 /* INET_DIAG_VEGASINFO */
163 struct tcpvegas_info {
170 /* INET_DIAG_DCTCPINFO */
172 struct tcp_dctcp_info {
174 __u16 dctcp_ce_state;
180 /* INET_DIAG_BBRINFO */
182 struct tcp_bbr_info {
183 /* u64 bw: max-filtered BW (app throughput) estimate in Byte per sec: */
184 __u32 bbr_bw_lo; /* lower 32 bits of bw */
185 __u32 bbr_bw_hi; /* upper 32 bits of bw */
186 __u32 bbr_min_rtt; /* min-filtered RTT in uSec */
187 __u32 bbr_pacing_gain; /* pacing gain shifted left 8 bits */
188 __u32 bbr_cwnd_gain; /* cwnd gain shifted left 8 bits */
192 struct tcpvegas_info vegas;
193 struct tcp_dctcp_info dctcp;
194 struct tcp_bbr_info bbr;
196 #endif /* _UAPI_INET_DIAG_H_ */