Merge tag 'io_uring-5.11-2021-01-16' of git://git.kernel.dk/linux-block
[linux/fpc-iii.git] / include / uapi / asm-generic / socket.h
blob4dcd13d097a9e7f40aec3d09c902bc7e9b5e32c0
1 /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2 #ifndef __ASM_GENERIC_SOCKET_H
3 #define __ASM_GENERIC_SOCKET_H
5 #include <linux/posix_types.h>
6 #include <asm/sockios.h>
8 /* For setsockopt(2) */
9 #define SOL_SOCKET 1
11 #define SO_DEBUG 1
12 #define SO_REUSEADDR 2
13 #define SO_TYPE 3
14 #define SO_ERROR 4
15 #define SO_DONTROUTE 5
16 #define SO_BROADCAST 6
17 #define SO_SNDBUF 7
18 #define SO_RCVBUF 8
19 #define SO_SNDBUFFORCE 32
20 #define SO_RCVBUFFORCE 33
21 #define SO_KEEPALIVE 9
22 #define SO_OOBINLINE 10
23 #define SO_NO_CHECK 11
24 #define SO_PRIORITY 12
25 #define SO_LINGER 13
26 #define SO_BSDCOMPAT 14
27 #define SO_REUSEPORT 15
28 #ifndef SO_PASSCRED /* powerpc only differs in these */
29 #define SO_PASSCRED 16
30 #define SO_PEERCRED 17
31 #define SO_RCVLOWAT 18
32 #define SO_SNDLOWAT 19
33 #define SO_RCVTIMEO_OLD 20
34 #define SO_SNDTIMEO_OLD 21
35 #endif
37 /* Security levels - as per NRL IPv6 - don't actually do anything */
38 #define SO_SECURITY_AUTHENTICATION 22
39 #define SO_SECURITY_ENCRYPTION_TRANSPORT 23
40 #define SO_SECURITY_ENCRYPTION_NETWORK 24
42 #define SO_BINDTODEVICE 25
44 /* Socket filtering */
45 #define SO_ATTACH_FILTER 26
46 #define SO_DETACH_FILTER 27
47 #define SO_GET_FILTER SO_ATTACH_FILTER
49 #define SO_PEERNAME 28
51 #define SO_ACCEPTCONN 30
53 #define SO_PEERSEC 31
54 #define SO_PASSSEC 34
56 #define SO_MARK 36
58 #define SO_PROTOCOL 38
59 #define SO_DOMAIN 39
61 #define SO_RXQ_OVFL 40
63 #define SO_WIFI_STATUS 41
64 #define SCM_WIFI_STATUS SO_WIFI_STATUS
65 #define SO_PEEK_OFF 42
67 /* Instruct lower device to use last 4-bytes of skb data as FCS */
68 #define SO_NOFCS 43
70 #define SO_LOCK_FILTER 44
72 #define SO_SELECT_ERR_QUEUE 45
74 #define SO_BUSY_POLL 46
76 #define SO_MAX_PACING_RATE 47
78 #define SO_BPF_EXTENSIONS 48
80 #define SO_INCOMING_CPU 49
82 #define SO_ATTACH_BPF 50
83 #define SO_DETACH_BPF SO_DETACH_FILTER
85 #define SO_ATTACH_REUSEPORT_CBPF 51
86 #define SO_ATTACH_REUSEPORT_EBPF 52
88 #define SO_CNX_ADVICE 53
90 #define SCM_TIMESTAMPING_OPT_STATS 54
92 #define SO_MEMINFO 55
94 #define SO_INCOMING_NAPI_ID 56
96 #define SO_COOKIE 57
98 #define SCM_TIMESTAMPING_PKTINFO 58
100 #define SO_PEERGROUPS 59
102 #define SO_ZEROCOPY 60
104 #define SO_TXTIME 61
105 #define SCM_TXTIME SO_TXTIME
107 #define SO_BINDTOIFINDEX 62
109 #define SO_TIMESTAMP_OLD 29
110 #define SO_TIMESTAMPNS_OLD 35
111 #define SO_TIMESTAMPING_OLD 37
113 #define SO_TIMESTAMP_NEW 63
114 #define SO_TIMESTAMPNS_NEW 64
115 #define SO_TIMESTAMPING_NEW 65
117 #define SO_RCVTIMEO_NEW 66
118 #define SO_SNDTIMEO_NEW 67
120 #define SO_DETACH_REUSEPORT_BPF 68
122 #define SO_PREFER_BUSY_POLL 69
123 #define SO_BUSY_POLL_BUDGET 70
125 #if !defined(__KERNEL__)
127 #if __BITS_PER_LONG == 64 || (defined(__x86_64__) && defined(__ILP32__))
128 /* on 64-bit and x32, avoid the ?: operator */
129 #define SO_TIMESTAMP SO_TIMESTAMP_OLD
130 #define SO_TIMESTAMPNS SO_TIMESTAMPNS_OLD
131 #define SO_TIMESTAMPING SO_TIMESTAMPING_OLD
133 #define SO_RCVTIMEO SO_RCVTIMEO_OLD
134 #define SO_SNDTIMEO SO_SNDTIMEO_OLD
135 #else
136 #define SO_TIMESTAMP (sizeof(time_t) == sizeof(__kernel_long_t) ? SO_TIMESTAMP_OLD : SO_TIMESTAMP_NEW)
137 #define SO_TIMESTAMPNS (sizeof(time_t) == sizeof(__kernel_long_t) ? SO_TIMESTAMPNS_OLD : SO_TIMESTAMPNS_NEW)
138 #define SO_TIMESTAMPING (sizeof(time_t) == sizeof(__kernel_long_t) ? SO_TIMESTAMPING_OLD : SO_TIMESTAMPING_NEW)
140 #define SO_RCVTIMEO (sizeof(time_t) == sizeof(__kernel_long_t) ? SO_RCVTIMEO_OLD : SO_RCVTIMEO_NEW)
141 #define SO_SNDTIMEO (sizeof(time_t) == sizeof(__kernel_long_t) ? SO_SNDTIMEO_OLD : SO_SNDTIMEO_NEW)
142 #endif
144 #define SCM_TIMESTAMP SO_TIMESTAMP
145 #define SCM_TIMESTAMPNS SO_TIMESTAMPNS
146 #define SCM_TIMESTAMPING SO_TIMESTAMPING
148 #endif
150 #endif /* __ASM_GENERIC_SOCKET_H */