Blame view

include/uapi/linux/inet_diag.h 3.43 KB
607ca46e9   David Howells   UAPI: (Scripted) ...
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
  #ifndef _UAPI_INET_DIAG_H_
  #define _UAPI_INET_DIAG_H_
  
  #include <linux/types.h>
  
  /* Just some random number */
  #define TCPDIAG_GETSOCK 18
  #define DCCPDIAG_GETSOCK 19
  
  #define INET_DIAG_GETSOCK_MAX 24
  
  /* Socket identity */
  struct inet_diag_sockid {
  	__be16	idiag_sport;
  	__be16	idiag_dport;
  	__be32	idiag_src[4];
  	__be32	idiag_dst[4];
  	__u32	idiag_if;
  	__u32	idiag_cookie[2];
  #define INET_DIAG_NOCOOKIE (~0U)
  };
  
  /* Request structure */
  
  struct inet_diag_req {
  	__u8	idiag_family;		/* Family of addresses. */
  	__u8	idiag_src_len;
  	__u8	idiag_dst_len;
  	__u8	idiag_ext;		/* Query extended information */
  
  	struct inet_diag_sockid id;
  
  	__u32	idiag_states;		/* States to dump */
  	__u32	idiag_dbs;		/* Tables to dump (NI) */
  };
  
  struct inet_diag_req_v2 {
  	__u8	sdiag_family;
  	__u8	sdiag_protocol;
  	__u8	idiag_ext;
  	__u8	pad;
  	__u32	idiag_states;
  	struct inet_diag_sockid id;
  };
  
  enum {
  	INET_DIAG_REQ_NONE,
  	INET_DIAG_REQ_BYTECODE,
  };
  
  #define INET_DIAG_REQ_MAX INET_DIAG_REQ_BYTECODE
  
  /* Bytecode is sequence of 4 byte commands followed by variable arguments.
   * All the commands identified by "code" are conditional jumps forward:
   * to offset cc+"yes" or to offset cc+"no". "yes" is supposed to be
   * length of the command and its arguments.
   */
   
  struct inet_diag_bc_op {
  	unsigned char	code;
  	unsigned char	yes;
  	unsigned short	no;
  };
  
  enum {
  	INET_DIAG_BC_NOP,
  	INET_DIAG_BC_JMP,
  	INET_DIAG_BC_S_GE,
  	INET_DIAG_BC_S_LE,
  	INET_DIAG_BC_D_GE,
  	INET_DIAG_BC_D_LE,
  	INET_DIAG_BC_AUTO,
  	INET_DIAG_BC_S_COND,
  	INET_DIAG_BC_D_COND,
637c841dd   David Ahern   net: diag: Add su...
75
  	INET_DIAG_BC_DEV_COND,   /* u32 ifindex */
a52e95abf   Lorenzo Colitti   net: diag: allow ...
76
  	INET_DIAG_BC_MARK_COND,
607ca46e9   David Howells   UAPI: (Scripted) ...
77
78
79
80
81
82
83
84
  };
  
  struct inet_diag_hostcond {
  	__u8	family;
  	__u8	prefix_len;
  	int	port;
  	__be32	addr[0];
  };
a52e95abf   Lorenzo Colitti   net: diag: allow ...
85
86
87
88
  struct inet_diag_markcond {
  	__u32 mark;
  	__u32 mask;
  };
607ca46e9   David Howells   UAPI: (Scripted) ...
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
  /* Base info structure. It contains socket identity (addrs/ports/cookie)
   * and, alas, the information shown by netstat. */
  struct inet_diag_msg {
  	__u8	idiag_family;
  	__u8	idiag_state;
  	__u8	idiag_timer;
  	__u8	idiag_retrans;
  
  	struct inet_diag_sockid id;
  
  	__u32	idiag_expires;
  	__u32	idiag_rqueue;
  	__u32	idiag_wqueue;
  	__u32	idiag_uid;
  	__u32	idiag_inode;
  };
  
  /* Extensions */
  
  enum {
  	INET_DIAG_NONE,
  	INET_DIAG_MEMINFO,
  	INET_DIAG_INFO,
  	INET_DIAG_VEGASINFO,
  	INET_DIAG_CONG,
  	INET_DIAG_TOS,
  	INET_DIAG_TCLASS,
  	INET_DIAG_SKMEMINFO,
e4e541a84   Pavel Emelyanov   sock-diag: Report...
117
  	INET_DIAG_SHUTDOWN,
e3118e835   Daniel Borkmann   net: tcp: add DCT...
118
  	INET_DIAG_DCTCPINFO,
35ac838a9   Craig Gallek   sock_diag: implem...
119
  	INET_DIAG_PROTOCOL,  /* response attribute only */
204621551   Phil Sutter   net: inet_diag: e...
120
  	INET_DIAG_SKV6ONLY,
8f840e47f   Xin Long   sctp: add the sct...
121
122
  	INET_DIAG_LOCALS,
  	INET_DIAG_PEERS,
6ed46d124   Nicolas Dichtel   sock_diag: align ...
123
  	INET_DIAG_PAD,
d545caca8   Lorenzo Colitti   net: inet: diag: ...
124
  	INET_DIAG_MARK,
0f8782ea1   Neal Cardwell   tcp_bbr: add BBR ...
125
  	INET_DIAG_BBRINFO,
6ed46d124   Nicolas Dichtel   sock_diag: align ...
126
  	__INET_DIAG_MAX,
607ca46e9   David Howells   UAPI: (Scripted) ...
127
  };
6ed46d124   Nicolas Dichtel   sock_diag: align ...
128
  #define INET_DIAG_MAX (__INET_DIAG_MAX - 1)
607ca46e9   David Howells   UAPI: (Scripted) ...
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
  
  /* INET_DIAG_MEM */
  
  struct inet_diag_meminfo {
  	__u32	idiag_rmem;
  	__u32	idiag_wmem;
  	__u32	idiag_fmem;
  	__u32	idiag_tmem;
  };
  
  /* INET_DIAG_VEGASINFO */
  
  struct tcpvegas_info {
  	__u32	tcpv_enabled;
  	__u32	tcpv_rttcnt;
  	__u32	tcpv_rtt;
  	__u32	tcpv_minrtt;
  };
e3118e835   Daniel Borkmann   net: tcp: add DCT...
147
148
149
150
151
152
153
154
155
  /* INET_DIAG_DCTCPINFO */
  
  struct tcp_dctcp_info {
  	__u16	dctcp_enabled;
  	__u16	dctcp_ce_state;
  	__u32	dctcp_alpha;
  	__u32	dctcp_ab_ecn;
  	__u32	dctcp_ab_tot;
  };
607ca46e9   David Howells   UAPI: (Scripted) ...
156

0f8782ea1   Neal Cardwell   tcp_bbr: add BBR ...
157
158
159
160
161
162
163
164
165
166
  /* INET_DIAG_BBRINFO */
  
  struct tcp_bbr_info {
  	/* u64 bw: max-filtered BW (app throughput) estimate in Byte per sec: */
  	__u32	bbr_bw_lo;		/* lower 32 bits of bw */
  	__u32	bbr_bw_hi;		/* upper 32 bits of bw */
  	__u32	bbr_min_rtt;		/* min-filtered RTT in uSec */
  	__u32	bbr_pacing_gain;	/* pacing gain shifted left 8 bits */
  	__u32	bbr_cwnd_gain;		/* cwnd gain shifted left 8 bits */
  };
64f40ff5b   Eric Dumazet   tcp: prepare CC g...
167
168
169
  union tcp_cc_info {
  	struct tcpvegas_info	vegas;
  	struct tcp_dctcp_info	dctcp;
0f8782ea1   Neal Cardwell   tcp_bbr: add BBR ...
170
  	struct tcp_bbr_info	bbr;
64f40ff5b   Eric Dumazet   tcp: prepare CC g...
171
  };
607ca46e9   David Howells   UAPI: (Scripted) ...
172
  #endif /* _UAPI_INET_DIAG_H_ */