1 /* SPDX-License-Identifier: (LGPL-2.1 OR BSD-2-Clause) */
2 #ifndef __BPF_TRACING_NET_H__
3 #define __BPF_TRACING_NET_H__
4 
5 #define AF_INET			2
6 #define AF_INET6		10
7 
8 #define SOL_SOCKET		1
9 #define SO_REUSEADDR		2
10 #define SO_SNDBUF		7
11 #define SO_RCVBUF		8
12 #define SO_KEEPALIVE		9
13 #define SO_PRIORITY		12
14 #define SO_REUSEPORT		15
15 #define SO_RCVLOWAT		18
16 #define SO_BINDTODEVICE		25
17 #define SO_MARK			36
18 #define SO_MAX_PACING_RATE	47
19 #define SO_BINDTOIFINDEX	62
20 #define SO_TXREHASH		74
21 #define __SO_ACCEPTCON		(1 << 16)
22 
23 #define IP_TOS			1
24 
25 #define IPV6_TCLASS		67
26 #define IPV6_AUTOFLOWLABEL	70
27 
28 #define TC_ACT_UNSPEC		(-1)
29 #define TC_ACT_SHOT		2
30 
31 #define SOL_TCP			6
32 #define TCP_NODELAY		1
33 #define TCP_MAXSEG		2
34 #define TCP_KEEPIDLE		4
35 #define TCP_KEEPINTVL		5
36 #define TCP_KEEPCNT		6
37 #define TCP_SYNCNT		7
38 #define TCP_WINDOW_CLAMP	10
39 #define TCP_CONGESTION		13
40 #define TCP_THIN_LINEAR_TIMEOUTS	16
41 #define TCP_USER_TIMEOUT	18
42 #define TCP_NOTSENT_LOWAT	25
43 #define TCP_SAVE_SYN		27
44 #define TCP_SAVED_SYN		28
45 #define TCP_CA_NAME_MAX		16
46 #define TCP_NAGLE_OFF		1
47 
48 #define ICSK_TIME_RETRANS	1
49 #define ICSK_TIME_PROBE0	3
50 #define ICSK_TIME_LOSS_PROBE	5
51 #define ICSK_TIME_REO_TIMEOUT	6
52 
53 #define IFNAMSIZ		16
54 
55 #define RTF_GATEWAY		0x0002
56 
57 #define TCP_INFINITE_SSTHRESH	0x7fffffff
58 #define TCP_PINGPONG_THRESH	3
59 
60 #define fib_nh_dev		nh_common.nhc_dev
61 #define fib_nh_gw_family	nh_common.nhc_gw_family
62 #define fib_nh_gw6		nh_common.nhc_gw.ipv6
63 
64 #define inet_daddr		sk.__sk_common.skc_daddr
65 #define inet_rcv_saddr		sk.__sk_common.skc_rcv_saddr
66 #define inet_dport		sk.__sk_common.skc_dport
67 
68 #define ir_loc_addr		req.__req_common.skc_rcv_saddr
69 #define ir_num			req.__req_common.skc_num
70 #define ir_rmt_addr		req.__req_common.skc_daddr
71 #define ir_rmt_port		req.__req_common.skc_dport
72 #define ir_v6_rmt_addr		req.__req_common.skc_v6_daddr
73 #define ir_v6_loc_addr		req.__req_common.skc_v6_rcv_saddr
74 
75 #define sk_num			__sk_common.skc_num
76 #define sk_dport		__sk_common.skc_dport
77 #define sk_family		__sk_common.skc_family
78 #define sk_rmem_alloc		sk_backlog.rmem_alloc
79 #define sk_refcnt		__sk_common.skc_refcnt
80 #define sk_state		__sk_common.skc_state
81 #define sk_v6_daddr		__sk_common.skc_v6_daddr
82 #define sk_v6_rcv_saddr		__sk_common.skc_v6_rcv_saddr
83 #define sk_flags		__sk_common.skc_flags
84 #define sk_reuse		__sk_common.skc_reuse
85 
86 #define s6_addr32		in6_u.u6_addr32
87 
88 #define tw_daddr		__tw_common.skc_daddr
89 #define tw_rcv_saddr		__tw_common.skc_rcv_saddr
90 #define tw_dport		__tw_common.skc_dport
91 #define tw_refcnt		__tw_common.skc_refcnt
92 #define tw_v6_daddr		__tw_common.skc_v6_daddr
93 #define tw_v6_rcv_saddr		__tw_common.skc_v6_rcv_saddr
94 
95 #endif
96