blob: 6d559bb8bce1f0229aad8825ed9521ddcd17978f [file] [log] [blame]
Elliott Hughes180edef2023-11-02 00:08:05 +00001/*
2 * This file is auto-generated. Modifications will be lost.
3 *
4 * See https://android.googlesource.com/platform/bionic/+/master/libc/kernel/
5 * for more information.
6 */
Ben Cheng655a7c02013-10-16 16:09:24 -07007#ifndef _UAPI_INET_DIAG_H_
8#define _UAPI_INET_DIAG_H_
9#include <linux/types.h>
10#define TCPDIAG_GETSOCK 18
Ben Cheng655a7c02013-10-16 16:09:24 -070011#define DCCPDIAG_GETSOCK 19
12#define INET_DIAG_GETSOCK_MAX 24
13struct inet_diag_sockid {
Tao Baod7db5942015-01-28 10:07:51 -080014 __be16 idiag_sport;
Tao Baod7db5942015-01-28 10:07:51 -080015 __be16 idiag_dport;
16 __be32 idiag_src[4];
17 __be32 idiag_dst[4];
18 __u32 idiag_if;
Tao Baod7db5942015-01-28 10:07:51 -080019 __u32 idiag_cookie[2];
Ben Cheng655a7c02013-10-16 16:09:24 -070020#define INET_DIAG_NOCOOKIE (~0U)
21};
22struct inet_diag_req {
Tao Baod7db5942015-01-28 10:07:51 -080023 __u8 idiag_family;
24 __u8 idiag_src_len;
25 __u8 idiag_dst_len;
26 __u8 idiag_ext;
Tao Baod7db5942015-01-28 10:07:51 -080027 struct inet_diag_sockid id;
28 __u32 idiag_states;
29 __u32 idiag_dbs;
Ben Cheng655a7c02013-10-16 16:09:24 -070030};
Ben Cheng655a7c02013-10-16 16:09:24 -070031struct inet_diag_req_v2 {
Tao Baod7db5942015-01-28 10:07:51 -080032 __u8 sdiag_family;
33 __u8 sdiag_protocol;
34 __u8 idiag_ext;
Tao Baod7db5942015-01-28 10:07:51 -080035 __u8 pad;
36 __u32 idiag_states;
37 struct inet_diag_sockid id;
Ben Cheng655a7c02013-10-16 16:09:24 -070038};
Christopher Ferris48af7cb2017-02-21 12:35:09 -080039struct inet_diag_req_raw {
40 __u8 sdiag_family;
41 __u8 sdiag_protocol;
42 __u8 idiag_ext;
Christopher Ferris48af7cb2017-02-21 12:35:09 -080043 __u8 sdiag_raw_protocol;
44 __u32 idiag_states;
45 struct inet_diag_sockid id;
46};
Ben Cheng655a7c02013-10-16 16:09:24 -070047enum {
Tao Baod7db5942015-01-28 10:07:51 -080048 INET_DIAG_REQ_NONE,
49 INET_DIAG_REQ_BYTECODE,
Christopher Ferrisaf09c702020-06-01 20:29:29 -070050 INET_DIAG_REQ_SK_BPF_STORAGES,
Christopher Ferris25c18d42020-10-14 17:42:58 -070051 INET_DIAG_REQ_PROTOCOL,
Christopher Ferrisaf09c702020-06-01 20:29:29 -070052 __INET_DIAG_REQ_MAX,
Ben Cheng655a7c02013-10-16 16:09:24 -070053};
Christopher Ferrisaf09c702020-06-01 20:29:29 -070054#define INET_DIAG_REQ_MAX (__INET_DIAG_REQ_MAX - 1)
Ben Cheng655a7c02013-10-16 16:09:24 -070055struct inet_diag_bc_op {
Tao Baod7db5942015-01-28 10:07:51 -080056 unsigned char code;
57 unsigned char yes;
Tao Baod7db5942015-01-28 10:07:51 -080058 unsigned short no;
Ben Cheng655a7c02013-10-16 16:09:24 -070059};
60enum {
Tao Baod7db5942015-01-28 10:07:51 -080061 INET_DIAG_BC_NOP,
Tao Baod7db5942015-01-28 10:07:51 -080062 INET_DIAG_BC_JMP,
63 INET_DIAG_BC_S_GE,
64 INET_DIAG_BC_S_LE,
65 INET_DIAG_BC_D_GE,
Tao Baod7db5942015-01-28 10:07:51 -080066 INET_DIAG_BC_D_LE,
67 INET_DIAG_BC_AUTO,
68 INET_DIAG_BC_S_COND,
69 INET_DIAG_BC_D_COND,
Christopher Ferris49f525c2016-12-12 14:55:36 -080070 INET_DIAG_BC_DEV_COND,
Christopher Ferris6a9755d2017-01-13 14:09:31 -080071 INET_DIAG_BC_MARK_COND,
Christopher Ferris76a1d452018-06-27 14:12:29 -070072 INET_DIAG_BC_S_EQ,
73 INET_DIAG_BC_D_EQ,
Christopher Ferris8177cdf2020-08-03 11:53:55 -070074 INET_DIAG_BC_CGROUP_COND,
Ben Cheng655a7c02013-10-16 16:09:24 -070075};
76struct inet_diag_hostcond {
Christopher Ferris6a9755d2017-01-13 14:09:31 -080077 __u8 family;
Christopher Ferris49f525c2016-12-12 14:55:36 -080078 __u8 prefix_len;
Tao Baod7db5942015-01-28 10:07:51 -080079 int port;
Christopher Ferris7447a1c2022-10-04 18:24:44 -070080 __be32 addr[];
Christopher Ferris6a9755d2017-01-13 14:09:31 -080081};
82struct inet_diag_markcond {
83 __u32 mark;
84 __u32 mask;
Christopher Ferris6a9755d2017-01-13 14:09:31 -080085};
Christopher Ferris49f525c2016-12-12 14:55:36 -080086struct inet_diag_msg {
Tao Baod7db5942015-01-28 10:07:51 -080087 __u8 idiag_family;
88 __u8 idiag_state;
Christopher Ferris6a9755d2017-01-13 14:09:31 -080089 __u8 idiag_timer;
Christopher Ferris49f525c2016-12-12 14:55:36 -080090 __u8 idiag_retrans;
Tao Baod7db5942015-01-28 10:07:51 -080091 struct inet_diag_sockid id;
92 __u32 idiag_expires;
Christopher Ferris6a9755d2017-01-13 14:09:31 -080093 __u32 idiag_rqueue;
Christopher Ferris49f525c2016-12-12 14:55:36 -080094 __u32 idiag_wqueue;
Tao Baod7db5942015-01-28 10:07:51 -080095 __u32 idiag_uid;
96 __u32 idiag_inode;
Christopher Ferris6a9755d2017-01-13 14:09:31 -080097};
Christopher Ferris49f525c2016-12-12 14:55:36 -080098enum {
Tao Baod7db5942015-01-28 10:07:51 -080099 INET_DIAG_NONE,
100 INET_DIAG_MEMINFO,
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800101 INET_DIAG_INFO,
Christopher Ferris49f525c2016-12-12 14:55:36 -0800102 INET_DIAG_VEGASINFO,
Tao Baod7db5942015-01-28 10:07:51 -0800103 INET_DIAG_CONG,
104 INET_DIAG_TOS,
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800105 INET_DIAG_TCLASS,
Christopher Ferris49f525c2016-12-12 14:55:36 -0800106 INET_DIAG_SKMEMINFO,
Tao Baod7db5942015-01-28 10:07:51 -0800107 INET_DIAG_SHUTDOWN,
108 INET_DIAG_DCTCPINFO,
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800109 INET_DIAG_PROTOCOL,
Christopher Ferris49f525c2016-12-12 14:55:36 -0800110 INET_DIAG_SKV6ONLY,
Christopher Ferris106b3a82016-08-24 12:15:38 -0700111 INET_DIAG_LOCALS,
112 INET_DIAG_PEERS,
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800113 INET_DIAG_PAD,
114 INET_DIAG_MARK,
115 INET_DIAG_BBRINFO,
Christopher Ferris1308ad32017-11-14 17:32:13 -0800116 INET_DIAG_CLASS_ID,
117 INET_DIAG_MD5SIG,
Christopher Ferris9584fa42019-12-09 15:36:13 -0800118 INET_DIAG_ULP_INFO,
Christopher Ferrisaf09c702020-06-01 20:29:29 -0700119 INET_DIAG_SK_BPF_STORAGES,
Christopher Ferris8177cdf2020-08-03 11:53:55 -0700120 INET_DIAG_CGROUP_ID,
Christopher Ferris32ff3f82020-12-14 13:10:04 -0800121 INET_DIAG_SOCKOPT,
Christopher Ferris49f525c2016-12-12 14:55:36 -0800122 __INET_DIAG_MAX,
Christopher Ferris05d08e92016-02-04 13:16:38 -0800123};
Christopher Ferris106b3a82016-08-24 12:15:38 -0700124#define INET_DIAG_MAX (__INET_DIAG_MAX - 1)
Christopher Ferris9584fa42019-12-09 15:36:13 -0800125enum {
126 INET_ULP_INFO_UNSPEC,
127 INET_ULP_INFO_NAME,
128 INET_ULP_INFO_TLS,
Christopher Ferrisaf09c702020-06-01 20:29:29 -0700129 INET_ULP_INFO_MPTCP,
Christopher Ferris9584fa42019-12-09 15:36:13 -0800130 __INET_ULP_INFO_MAX,
131};
132#define INET_ULP_INFO_MAX (__INET_ULP_INFO_MAX - 1)
Christopher Ferris82d75042015-01-26 10:57:07 -0800133struct inet_diag_meminfo {
Christopher Ferris49f525c2016-12-12 14:55:36 -0800134 __u32 idiag_rmem;
Tao Baod7db5942015-01-28 10:07:51 -0800135 __u32 idiag_wmem;
136 __u32 idiag_fmem;
Tao Baod7db5942015-01-28 10:07:51 -0800137 __u32 idiag_tmem;
Christopher Ferris49f525c2016-12-12 14:55:36 -0800138};
Christopher Ferris32ff3f82020-12-14 13:10:04 -0800139struct inet_diag_sockopt {
140 __u8 recverr : 1, is_icsk : 1, freebind : 1, hdrincl : 1, mc_loop : 1, transparent : 1, mc_all : 1, nodefrag : 1;
141 __u8 bind_address_no_port : 1, recverr_rfc4884 : 1, defer_connect : 1, unused : 5;
142};
Ben Cheng655a7c02013-10-16 16:09:24 -0700143struct tcpvegas_info {
Tao Baod7db5942015-01-28 10:07:51 -0800144 __u32 tcpv_enabled;
Tao Baod7db5942015-01-28 10:07:51 -0800145 __u32 tcpv_rttcnt;
Christopher Ferris49f525c2016-12-12 14:55:36 -0800146 __u32 tcpv_rtt;
Tao Baod7db5942015-01-28 10:07:51 -0800147 __u32 tcpv_minrtt;
Ben Cheng655a7c02013-10-16 16:09:24 -0700148};
Christopher Ferris82d75042015-01-26 10:57:07 -0800149struct tcp_dctcp_info {
Christopher Ferris49f525c2016-12-12 14:55:36 -0800150 __u16 dctcp_enabled;
Tao Baod7db5942015-01-28 10:07:51 -0800151 __u16 dctcp_ce_state;
152 __u32 dctcp_alpha;
Tao Baod7db5942015-01-28 10:07:51 -0800153 __u32 dctcp_ab_ecn;
Christopher Ferris49f525c2016-12-12 14:55:36 -0800154 __u32 dctcp_ab_tot;
Christopher Ferris05d08e92016-02-04 13:16:38 -0800155};
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800156struct tcp_bbr_info {
157 __u32 bbr_bw_lo;
158 __u32 bbr_bw_hi;
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800159 __u32 bbr_min_rtt;
160 __u32 bbr_pacing_gain;
161 __u32 bbr_cwnd_gain;
162};
Christopher Ferris05d08e92016-02-04 13:16:38 -0800163union tcp_cc_info {
164 struct tcpvegas_info vegas;
Christopher Ferris49f525c2016-12-12 14:55:36 -0800165 struct tcp_dctcp_info dctcp;
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800166 struct tcp_bbr_info bbr;
Christopher Ferris82d75042015-01-26 10:57:07 -0800167};
Ben Cheng655a7c02013-10-16 16:09:24 -0700168#endif