• 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 	INET_DIAG_BC_S_EQ,
61 	INET_DIAG_BC_D_EQ,
62 };
63 
64 struct inet_diag_hostcond {
65 	uint8_t family;
66 	uint8_t prefix_len;
67 	int port;
68 	uint32_t addr[0];
69 };
70 
71 struct inet_diag_markcond {
72 	uint32_t mark;
73 	uint32_t mask;
74 };
75 
76 /* Info structure */
77 struct inet_diag_msg {
78 	uint8_t idiag_family;
79 	uint8_t idiag_state;
80 	uint8_t idiag_timer;
81 	uint8_t idiag_retrans;
82 
83 	struct inet_diag_sockid id;
84 
85 	uint32_t idiag_expires;
86 	uint32_t idiag_rqueue;
87 	uint32_t idiag_wqueue;
88 	uint32_t idiag_uid;
89 	uint32_t idiag_inode;
90 };
91 
92 /* Extensions */
93 enum {
94 	INET_DIAG_NONE,
95 	INET_DIAG_MEMINFO,
96 	INET_DIAG_INFO,
97 	INET_DIAG_VEGASINFO,
98 	INET_DIAG_CONG,
99 	INET_DIAG_TOS,
100 	INET_DIAG_TCLASS,
101 	INET_DIAG_SKMEMINFO,
102 	INET_DIAG_SHUTDOWN,
103 	INET_DIAG_DCTCPINFO,
104 	INET_DIAG_PROTOCOL,  /* response attribute only */
105 	INET_DIAG_SKV6ONLY,
106 	INET_DIAG_LOCALS,
107 	INET_DIAG_PEERS,
108 	INET_DIAG_PAD,
109 	INET_DIAG_MARK,
110 	INET_DIAG_BBRINFO,
111 	INET_DIAG_CLASS_ID,
112 };
113 
114 /* INET_DIAG_MEM */
115 struct inet_diag_meminfo {
116 	uint32_t idiag_rmem;
117 	uint32_t idiag_wmem;
118 	uint32_t idiag_fmem;
119 	uint32_t idiag_tmem;
120 };
121 
122 /* INET_DIAG_VEGASINFO */
123 struct tcpvegas_info {
124 	uint32_t tcpv_enabled;
125 	uint32_t tcpv_rttcnt;
126 	uint32_t tcpv_rtt;
127 	uint32_t tcpv_minrtt;
128 };
129 
130 /* INET_DIAG_DCTCPINFO */
131 struct tcp_dctcp_info {
132 	uint16_t dctcp_enabled;
133 	uint16_t dctcp_ce_state;
134 	uint32_t dctcp_alpha;
135 	uint32_t dctcp_ab_ecn;
136 	uint32_t dctcp_ab_tot;
137 };
138 
139 /* INET_DIAG_BBRINFO */
140 struct tcp_bbr_info {
141 	uint32_t bbr_bw_lo;
142 	uint32_t bbr_bw_hi;
143 	uint32_t bbr_min_rtt;
144 	uint32_t bbr_pacing_gain;
145 	uint32_t bbr_cwnd_gain;
146 };
147 
148 #endif /* !STRACE_LINUX_INET_DIAG_H */
149