1/****************************************************************************
2 ****************************************************************************
3 ***
4 ***   This header was automatically generated from a Linux kernel header
5 ***   of the same name, to make information necessary for userspace to
6 ***   call into the kernel available to libc.  It contains only constants,
7 ***   structures, and macros generated from the original header, and thus,
8 ***   contains no copyrightable information.
9 ***
10 ***   To edit the content of this header, modify the corresponding
11 ***   source file (e.g. under external/kernel-headers/original/) then
12 ***   run bionic/libc/kernel/tools/update_all.py
13 ***
14 ***   Any manual change here will be lost the next time this script will
15 ***   be run. You've been warned!
16 ***
17 ****************************************************************************
18 ****************************************************************************/
19#ifndef _UAPI_INET_DIAG_H_
20#define _UAPI_INET_DIAG_H_
21#include <linux/types.h>
22#define TCPDIAG_GETSOCK 18
23#define DCCPDIAG_GETSOCK 19
24#define INET_DIAG_GETSOCK_MAX 24
25struct inet_diag_sockid {
26  __be16 idiag_sport;
27  __be16 idiag_dport;
28  __be32 idiag_src[4];
29  __be32 idiag_dst[4];
30  __u32 idiag_if;
31  __u32 idiag_cookie[2];
32#define INET_DIAG_NOCOOKIE (~0U)
33};
34struct inet_diag_req {
35  __u8 idiag_family;
36  __u8 idiag_src_len;
37  __u8 idiag_dst_len;
38  __u8 idiag_ext;
39  struct inet_diag_sockid id;
40  __u32 idiag_states;
41  __u32 idiag_dbs;
42};
43struct inet_diag_req_v2 {
44  __u8 sdiag_family;
45  __u8 sdiag_protocol;
46  __u8 idiag_ext;
47  __u8 pad;
48  __u32 idiag_states;
49  struct inet_diag_sockid id;
50};
51struct inet_diag_req_raw {
52  __u8 sdiag_family;
53  __u8 sdiag_protocol;
54  __u8 idiag_ext;
55  __u8 sdiag_raw_protocol;
56  __u32 idiag_states;
57  struct inet_diag_sockid id;
58};
59enum {
60  INET_DIAG_REQ_NONE,
61  INET_DIAG_REQ_BYTECODE,
62  INET_DIAG_REQ_SK_BPF_STORAGES,
63  INET_DIAG_REQ_PROTOCOL,
64  __INET_DIAG_REQ_MAX,
65};
66#define INET_DIAG_REQ_MAX (__INET_DIAG_REQ_MAX - 1)
67struct inet_diag_bc_op {
68  unsigned char code;
69  unsigned char yes;
70  unsigned short no;
71};
72enum {
73  INET_DIAG_BC_NOP,
74  INET_DIAG_BC_JMP,
75  INET_DIAG_BC_S_GE,
76  INET_DIAG_BC_S_LE,
77  INET_DIAG_BC_D_GE,
78  INET_DIAG_BC_D_LE,
79  INET_DIAG_BC_AUTO,
80  INET_DIAG_BC_S_COND,
81  INET_DIAG_BC_D_COND,
82  INET_DIAG_BC_DEV_COND,
83  INET_DIAG_BC_MARK_COND,
84  INET_DIAG_BC_S_EQ,
85  INET_DIAG_BC_D_EQ,
86  INET_DIAG_BC_CGROUP_COND,
87};
88struct inet_diag_hostcond {
89  __u8 family;
90  __u8 prefix_len;
91  int port;
92  __be32 addr[0];
93};
94struct inet_diag_markcond {
95  __u32 mark;
96  __u32 mask;
97};
98struct inet_diag_msg {
99  __u8 idiag_family;
100  __u8 idiag_state;
101  __u8 idiag_timer;
102  __u8 idiag_retrans;
103  struct inet_diag_sockid id;
104  __u32 idiag_expires;
105  __u32 idiag_rqueue;
106  __u32 idiag_wqueue;
107  __u32 idiag_uid;
108  __u32 idiag_inode;
109};
110enum {
111  INET_DIAG_NONE,
112  INET_DIAG_MEMINFO,
113  INET_DIAG_INFO,
114  INET_DIAG_VEGASINFO,
115  INET_DIAG_CONG,
116  INET_DIAG_TOS,
117  INET_DIAG_TCLASS,
118  INET_DIAG_SKMEMINFO,
119  INET_DIAG_SHUTDOWN,
120  INET_DIAG_DCTCPINFO,
121  INET_DIAG_PROTOCOL,
122  INET_DIAG_SKV6ONLY,
123  INET_DIAG_LOCALS,
124  INET_DIAG_PEERS,
125  INET_DIAG_PAD,
126  INET_DIAG_MARK,
127  INET_DIAG_BBRINFO,
128  INET_DIAG_CLASS_ID,
129  INET_DIAG_MD5SIG,
130  INET_DIAG_ULP_INFO,
131  INET_DIAG_SK_BPF_STORAGES,
132  INET_DIAG_CGROUP_ID,
133  INET_DIAG_SOCKOPT,
134  __INET_DIAG_MAX,
135};
136#define INET_DIAG_MAX (__INET_DIAG_MAX - 1)
137enum {
138  INET_ULP_INFO_UNSPEC,
139  INET_ULP_INFO_NAME,
140  INET_ULP_INFO_TLS,
141  INET_ULP_INFO_MPTCP,
142  __INET_ULP_INFO_MAX,
143};
144#define INET_ULP_INFO_MAX (__INET_ULP_INFO_MAX - 1)
145struct inet_diag_meminfo {
146  __u32 idiag_rmem;
147  __u32 idiag_wmem;
148  __u32 idiag_fmem;
149  __u32 idiag_tmem;
150};
151struct inet_diag_sockopt {
152  __u8 recverr : 1, is_icsk : 1, freebind : 1, hdrincl : 1, mc_loop : 1, transparent : 1, mc_all : 1, nodefrag : 1;
153  __u8 bind_address_no_port : 1, recverr_rfc4884 : 1, defer_connect : 1, unused : 5;
154};
155struct tcpvegas_info {
156  __u32 tcpv_enabled;
157  __u32 tcpv_rttcnt;
158  __u32 tcpv_rtt;
159  __u32 tcpv_minrtt;
160};
161struct tcp_dctcp_info {
162  __u16 dctcp_enabled;
163  __u16 dctcp_ce_state;
164  __u32 dctcp_alpha;
165  __u32 dctcp_ab_ecn;
166  __u32 dctcp_ab_tot;
167};
168struct tcp_bbr_info {
169  __u32 bbr_bw_lo;
170  __u32 bbr_bw_hi;
171  __u32 bbr_min_rtt;
172  __u32 bbr_pacing_gain;
173  __u32 bbr_cwnd_gain;
174};
175union tcp_cc_info {
176  struct tcpvegas_info vegas;
177  struct tcp_dctcp_info dctcp;
178  struct tcp_bbr_info bbr;
179};
180#endif
181