• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 #ifndef STRACE_LINUX_INET_DIAG_H
2 #define STRACE_LINUX_INET_DIAG_H
3 
4 #define TCPDIAG_GETSOCK 18
5 #define DCCPDIAG_GETSOCK 19
6 
7 /* Socket identity */
8 struct inet_diag_sockid {
9 	uint16_t idiag_sport;
10 	uint16_t idiag_dport;
11 	uint32_t idiag_src[4];
12 	uint32_t idiag_dst[4];
13 	uint32_t idiag_if;
14 	uint32_t idiag_cookie[2];
15 };
16 
17 /* Request structures */
18 struct inet_diag_req {
19 	uint8_t idiag_family;
20 	uint8_t idiag_src_len;
21 	uint8_t idiag_dst_len;
22 	uint8_t idiag_ext;
23 	struct inet_diag_sockid id;
24 	uint32_t idiag_states;
25 	uint32_t idiag_dbs;
26 };
27 
28 struct inet_diag_req_v2 {
29 	uint8_t sdiag_family;
30 	uint8_t sdiag_protocol;
31 	uint8_t idiag_ext;
32 	uint8_t pad;
33 	uint32_t idiag_states;
34 	struct inet_diag_sockid id;
35 };
36 
37 enum {
38 	INET_DIAG_REQ_NONE,
39 	INET_DIAG_REQ_BYTECODE,
40 };
41 
42 struct inet_diag_bc_op {
43 	unsigned char code;
44 	unsigned char yes;
45 	unsigned short no;
46 };
47 
48 enum {
49 	INET_DIAG_BC_NOP,
50 	INET_DIAG_BC_JMP,
51 	INET_DIAG_BC_S_GE,
52 	INET_DIAG_BC_S_LE,
53 	INET_DIAG_BC_D_GE,
54 	INET_DIAG_BC_D_LE,
55 	INET_DIAG_BC_AUTO,
56 	INET_DIAG_BC_S_COND,
57 	INET_DIAG_BC_D_COND,
58 	INET_DIAG_BC_DEV_COND,   /* u32 ifindex */
59 	INET_DIAG_BC_MARK_COND,
60 };
61 
62 struct inet_diag_hostcond {
63 	uint8_t family;
64 	uint8_t prefix_len;
65 	int port;
66 	uint32_t addr[0];
67 };
68 
69 struct inet_diag_markcond {
70 	uint32_t mark;
71 	uint32_t mask;
72 };
73 
74 /* Info structure */
75 struct inet_diag_msg {
76 	uint8_t idiag_family;
77 	uint8_t idiag_state;
78 	uint8_t idiag_timer;
79 	uint8_t idiag_retrans;
80 
81 	struct inet_diag_sockid id;
82 
83 	uint32_t idiag_expires;
84 	uint32_t idiag_rqueue;
85 	uint32_t idiag_wqueue;
86 	uint32_t idiag_uid;
87 	uint32_t idiag_inode;
88 };
89 
90 /* Extensions */
91 enum {
92 	INET_DIAG_NONE,
93 	INET_DIAG_MEMINFO,
94 	INET_DIAG_INFO,
95 	INET_DIAG_VEGASINFO,
96 	INET_DIAG_CONG,
97 	INET_DIAG_TOS,
98 	INET_DIAG_TCLASS,
99 	INET_DIAG_SKMEMINFO,
100 	INET_DIAG_SHUTDOWN,
101 	INET_DIAG_DCTCPINFO,
102 	INET_DIAG_PROTOCOL,  /* response attribute only */
103 	INET_DIAG_SKV6ONLY,
104 	INET_DIAG_LOCALS,
105 	INET_DIAG_PEERS,
106 	INET_DIAG_PAD,
107 	INET_DIAG_MARK,
108 	INET_DIAG_BBRINFO,
109 	INET_DIAG_CLASS_ID,
110 };
111 
112 /* INET_DIAG_MEM */
113 struct inet_diag_meminfo {
114 	uint32_t idiag_rmem;
115 	uint32_t idiag_wmem;
116 	uint32_t idiag_fmem;
117 	uint32_t idiag_tmem;
118 };
119 
120 /* INET_DIAG_VEGASINFO */
121 struct tcpvegas_info {
122 	uint32_t tcpv_enabled;
123 	uint32_t tcpv_rttcnt;
124 	uint32_t tcpv_rtt;
125 	uint32_t tcpv_minrtt;
126 };
127 
128 /* INET_DIAG_DCTCPINFO */
129 struct tcp_dctcp_info {
130 	uint16_t dctcp_enabled;
131 	uint16_t dctcp_ce_state;
132 	uint32_t dctcp_alpha;
133 	uint32_t dctcp_ab_ecn;
134 	uint32_t dctcp_ab_tot;
135 };
136 
137 /* INET_DIAG_BBRINFO */
138 struct tcp_bbr_info {
139 	uint32_t bbr_bw_lo;
140 	uint32_t bbr_bw_hi;
141 	uint32_t bbr_min_rtt;
142 	uint32_t bbr_pacing_gain;
143 	uint32_t bbr_cwnd_gain;
144 };
145 
146 #endif /* !STRACE_LINUX_INET_DIAG_H */
147