1 /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2 #ifndef _UAPI_ASM_SOCKET_H
3 #define _UAPI_ASM_SOCKET_H
5 #include <linux/posix_types.h>
6 #include <asm/sockios.h>
8 /* For setsockopt(2) */
10 * Note: we only bother about making the SOL_SOCKET options
11 * same as OSF/1, as that's all that "normal" programs are
12 * likely to set. We don't necessarily want to be binary
13 * compatible with _everything_.
15 #define SOL_SOCKET 0xffff
17 #define SO_DEBUG 0x0001
18 #define SO_REUSEADDR 0x0004
19 #define SO_KEEPALIVE 0x0008
20 #define SO_DONTROUTE 0x0010
21 #define SO_BROADCAST 0x0020
22 #define SO_LINGER 0x0080
23 #define SO_OOBINLINE 0x0100
24 #define SO_REUSEPORT 0x0200
26 #define SO_TYPE 0x1008
27 #define SO_ERROR 0x1007
28 #define SO_SNDBUF 0x1001
29 #define SO_RCVBUF 0x1002
30 #define SO_SNDBUFFORCE 0x100a
31 #define SO_RCVBUFFORCE 0x100b
32 #define SO_RCVLOWAT 0x1010
33 #define SO_SNDLOWAT 0x1011
34 #define SO_RCVTIMEO_OLD 0x1012
35 #define SO_SNDTIMEO_OLD 0x1013
36 #define SO_ACCEPTCONN 0x1014
37 #define SO_PROTOCOL 0x1028
38 #define SO_DOMAIN 0x1029
40 /* linux-specific, might as well be the same as on i386 */
41 #define SO_NO_CHECK 11
42 #define SO_PRIORITY 12
43 #define SO_BSDCOMPAT 14
45 #define SO_PASSCRED 17
46 #define SO_PEERCRED 18
47 #define SO_BINDTODEVICE 25
49 /* Socket filtering */
50 #define SO_ATTACH_FILTER 26
51 #define SO_DETACH_FILTER 27
52 #define SO_GET_FILTER SO_ATTACH_FILTER
54 #define SO_PEERNAME 28
59 /* Security levels - as per NRL IPv6 - don't actually do anything */
60 #define SO_SECURITY_AUTHENTICATION 19
61 #define SO_SECURITY_ENCRYPTION_TRANSPORT 20
62 #define SO_SECURITY_ENCRYPTION_NETWORK 21
66 #define SO_RXQ_OVFL 40
68 #define SO_WIFI_STATUS 41
69 #define SCM_WIFI_STATUS SO_WIFI_STATUS
70 #define SO_PEEK_OFF 42
72 /* Instruct lower device to use last 4-bytes of skb data as FCS */
75 #define SO_LOCK_FILTER 44
77 #define SO_SELECT_ERR_QUEUE 45
79 #define SO_BUSY_POLL 46
81 #define SO_MAX_PACING_RATE 47
83 #define SO_BPF_EXTENSIONS 48
85 #define SO_INCOMING_CPU 49
87 #define SO_ATTACH_BPF 50
88 #define SO_DETACH_BPF SO_DETACH_FILTER
90 #define SO_ATTACH_REUSEPORT_CBPF 51
91 #define SO_ATTACH_REUSEPORT_EBPF 52
93 #define SO_CNX_ADVICE 53
95 #define SCM_TIMESTAMPING_OPT_STATS 54
99 #define SO_INCOMING_NAPI_ID 56
103 #define SCM_TIMESTAMPING_PKTINFO 58
105 #define SO_PEERGROUPS 59
107 #define SO_ZEROCOPY 60
110 #define SCM_TXTIME SO_TXTIME
112 #define SO_BINDTOIFINDEX 62
114 #define SO_TIMESTAMP_OLD 29
115 #define SO_TIMESTAMPNS_OLD 35
116 #define SO_TIMESTAMPING_OLD 37
118 #define SO_TIMESTAMP_NEW 63
119 #define SO_TIMESTAMPNS_NEW 64
120 #define SO_TIMESTAMPING_NEW 65
122 #define SO_RCVTIMEO_NEW 66
123 #define SO_SNDTIMEO_NEW 67
125 #define SO_DETACH_REUSEPORT_BPF 68
127 #define SO_PREFER_BUSY_POLL 69
128 #define SO_BUSY_POLL_BUDGET 70
130 #define SO_NETNS_COOKIE 71
132 #define SO_BUF_LOCK 72
134 #define SO_RESERVE_MEM 73
136 #define SO_TXREHASH 74
138 #define SO_RCVMARK 75
140 #if !defined(__KERNEL__)
142 #if __BITS_PER_LONG == 64
143 #define SO_TIMESTAMP SO_TIMESTAMP_OLD
144 #define SO_TIMESTAMPNS SO_TIMESTAMPNS_OLD
145 #define SO_TIMESTAMPING SO_TIMESTAMPING_OLD
147 #define SO_RCVTIMEO SO_RCVTIMEO_OLD
148 #define SO_SNDTIMEO SO_SNDTIMEO_OLD
150 #define SO_TIMESTAMP (sizeof(time_t) == sizeof(__kernel_long_t) ? SO_TIMESTAMP_OLD : SO_TIMESTAMP_NEW)
151 #define SO_TIMESTAMPNS (sizeof(time_t) == sizeof(__kernel_long_t) ? SO_TIMESTAMPNS_OLD : SO_TIMESTAMPNS_NEW)
152 #define SO_TIMESTAMPING (sizeof(time_t) == sizeof(__kernel_long_t) ? SO_TIMESTAMPING_OLD : SO_TIMESTAMPING_NEW)
154 #define SO_RCVTIMEO (sizeof(time_t) == sizeof(__kernel_long_t) ? SO_RCVTIMEO_OLD : SO_RCVTIMEO_NEW)
155 #define SO_SNDTIMEO (sizeof(time_t) == sizeof(__kernel_long_t) ? SO_SNDTIMEO_OLD : SO_SNDTIMEO_NEW)
158 #define SCM_TIMESTAMP SO_TIMESTAMP
159 #define SCM_TIMESTAMPNS SO_TIMESTAMPNS
160 #define SCM_TIMESTAMPING SO_TIMESTAMPING
164 #endif /* _UAPI_ASM_SOCKET_H */