xref: /openbmc/linux/tools/include/uapi/asm-generic/socket.h (revision 2612e3bbc0386368a850140a6c9b990cd496a5ec)
113a748eaSMartin KaFai Lau /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
213a748eaSMartin KaFai Lau #ifndef __ASM_GENERIC_SOCKET_H
313a748eaSMartin KaFai Lau #define __ASM_GENERIC_SOCKET_H
413a748eaSMartin KaFai Lau 
513a748eaSMartin KaFai Lau #include <linux/posix_types.h>
613a748eaSMartin KaFai Lau #include <asm/sockios.h>
713a748eaSMartin KaFai Lau 
813a748eaSMartin KaFai Lau /* For setsockopt(2) */
913a748eaSMartin KaFai Lau #define SOL_SOCKET	1
1013a748eaSMartin KaFai Lau 
1113a748eaSMartin KaFai Lau #define SO_DEBUG	1
1213a748eaSMartin KaFai Lau #define SO_REUSEADDR	2
1313a748eaSMartin KaFai Lau #define SO_TYPE		3
1413a748eaSMartin KaFai Lau #define SO_ERROR	4
1513a748eaSMartin KaFai Lau #define SO_DONTROUTE	5
1613a748eaSMartin KaFai Lau #define SO_BROADCAST	6
1713a748eaSMartin KaFai Lau #define SO_SNDBUF	7
1813a748eaSMartin KaFai Lau #define SO_RCVBUF	8
1913a748eaSMartin KaFai Lau #define SO_SNDBUFFORCE	32
2013a748eaSMartin KaFai Lau #define SO_RCVBUFFORCE	33
2113a748eaSMartin KaFai Lau #define SO_KEEPALIVE	9
2213a748eaSMartin KaFai Lau #define SO_OOBINLINE	10
2313a748eaSMartin KaFai Lau #define SO_NO_CHECK	11
2413a748eaSMartin KaFai Lau #define SO_PRIORITY	12
2513a748eaSMartin KaFai Lau #define SO_LINGER	13
2613a748eaSMartin KaFai Lau #define SO_BSDCOMPAT	14
2713a748eaSMartin KaFai Lau #define SO_REUSEPORT	15
2813a748eaSMartin KaFai Lau #ifndef SO_PASSCRED /* powerpc only differs in these */
2913a748eaSMartin KaFai Lau #define SO_PASSCRED	16
3013a748eaSMartin KaFai Lau #define SO_PEERCRED	17
3113a748eaSMartin KaFai Lau #define SO_RCVLOWAT	18
3213a748eaSMartin KaFai Lau #define SO_SNDLOWAT	19
3313a748eaSMartin KaFai Lau #define SO_RCVTIMEO_OLD	20
3413a748eaSMartin KaFai Lau #define SO_SNDTIMEO_OLD	21
3513a748eaSMartin KaFai Lau #endif
3613a748eaSMartin KaFai Lau 
3713a748eaSMartin KaFai Lau /* Security levels - as per NRL IPv6 - don't actually do anything */
3813a748eaSMartin KaFai Lau #define SO_SECURITY_AUTHENTICATION		22
3913a748eaSMartin KaFai Lau #define SO_SECURITY_ENCRYPTION_TRANSPORT	23
4013a748eaSMartin KaFai Lau #define SO_SECURITY_ENCRYPTION_NETWORK		24
4113a748eaSMartin KaFai Lau 
4213a748eaSMartin KaFai Lau #define SO_BINDTODEVICE	25
4313a748eaSMartin KaFai Lau 
4413a748eaSMartin KaFai Lau /* Socket filtering */
4513a748eaSMartin KaFai Lau #define SO_ATTACH_FILTER	26
4613a748eaSMartin KaFai Lau #define SO_DETACH_FILTER	27
4713a748eaSMartin KaFai Lau #define SO_GET_FILTER		SO_ATTACH_FILTER
4813a748eaSMartin KaFai Lau 
4913a748eaSMartin KaFai Lau #define SO_PEERNAME		28
5013a748eaSMartin KaFai Lau 
5113a748eaSMartin KaFai Lau #define SO_ACCEPTCONN		30
5213a748eaSMartin KaFai Lau 
5313a748eaSMartin KaFai Lau #define SO_PEERSEC		31
5413a748eaSMartin KaFai Lau #define SO_PASSSEC		34
5513a748eaSMartin KaFai Lau 
5613a748eaSMartin KaFai Lau #define SO_MARK			36
5713a748eaSMartin KaFai Lau 
5813a748eaSMartin KaFai Lau #define SO_PROTOCOL		38
5913a748eaSMartin KaFai Lau #define SO_DOMAIN		39
6013a748eaSMartin KaFai Lau 
6113a748eaSMartin KaFai Lau #define SO_RXQ_OVFL             40
6213a748eaSMartin KaFai Lau 
6313a748eaSMartin KaFai Lau #define SO_WIFI_STATUS		41
6413a748eaSMartin KaFai Lau #define SCM_WIFI_STATUS	SO_WIFI_STATUS
6513a748eaSMartin KaFai Lau #define SO_PEEK_OFF		42
6613a748eaSMartin KaFai Lau 
6713a748eaSMartin KaFai Lau /* Instruct lower device to use last 4-bytes of skb data as FCS */
6813a748eaSMartin KaFai Lau #define SO_NOFCS		43
6913a748eaSMartin KaFai Lau 
7013a748eaSMartin KaFai Lau #define SO_LOCK_FILTER		44
7113a748eaSMartin KaFai Lau 
7213a748eaSMartin KaFai Lau #define SO_SELECT_ERR_QUEUE	45
7313a748eaSMartin KaFai Lau 
7413a748eaSMartin KaFai Lau #define SO_BUSY_POLL		46
7513a748eaSMartin KaFai Lau 
7613a748eaSMartin KaFai Lau #define SO_MAX_PACING_RATE	47
7713a748eaSMartin KaFai Lau 
7813a748eaSMartin KaFai Lau #define SO_BPF_EXTENSIONS	48
7913a748eaSMartin KaFai Lau 
8013a748eaSMartin KaFai Lau #define SO_INCOMING_CPU		49
8113a748eaSMartin KaFai Lau 
8213a748eaSMartin KaFai Lau #define SO_ATTACH_BPF		50
8313a748eaSMartin KaFai Lau #define SO_DETACH_BPF		SO_DETACH_FILTER
8413a748eaSMartin KaFai Lau 
8513a748eaSMartin KaFai Lau #define SO_ATTACH_REUSEPORT_CBPF	51
8613a748eaSMartin KaFai Lau #define SO_ATTACH_REUSEPORT_EBPF	52
8713a748eaSMartin KaFai Lau 
8813a748eaSMartin KaFai Lau #define SO_CNX_ADVICE		53
8913a748eaSMartin KaFai Lau 
9013a748eaSMartin KaFai Lau #define SCM_TIMESTAMPING_OPT_STATS	54
9113a748eaSMartin KaFai Lau 
9213a748eaSMartin KaFai Lau #define SO_MEMINFO		55
9313a748eaSMartin KaFai Lau 
9413a748eaSMartin KaFai Lau #define SO_INCOMING_NAPI_ID	56
9513a748eaSMartin KaFai Lau 
9613a748eaSMartin KaFai Lau #define SO_COOKIE		57
9713a748eaSMartin KaFai Lau 
9813a748eaSMartin KaFai Lau #define SCM_TIMESTAMPING_PKTINFO	58
9913a748eaSMartin KaFai Lau 
10013a748eaSMartin KaFai Lau #define SO_PEERGROUPS		59
10113a748eaSMartin KaFai Lau 
10213a748eaSMartin KaFai Lau #define SO_ZEROCOPY		60
10313a748eaSMartin KaFai Lau 
10413a748eaSMartin KaFai Lau #define SO_TXTIME		61
10513a748eaSMartin KaFai Lau #define SCM_TXTIME		SO_TXTIME
10613a748eaSMartin KaFai Lau 
10713a748eaSMartin KaFai Lau #define SO_BINDTOIFINDEX	62
10813a748eaSMartin KaFai Lau 
10913a748eaSMartin KaFai Lau #define SO_TIMESTAMP_OLD        29
11013a748eaSMartin KaFai Lau #define SO_TIMESTAMPNS_OLD      35
11113a748eaSMartin KaFai Lau #define SO_TIMESTAMPING_OLD     37
11213a748eaSMartin KaFai Lau 
11313a748eaSMartin KaFai Lau #define SO_TIMESTAMP_NEW        63
11413a748eaSMartin KaFai Lau #define SO_TIMESTAMPNS_NEW      64
11513a748eaSMartin KaFai Lau #define SO_TIMESTAMPING_NEW     65
11613a748eaSMartin KaFai Lau 
11713a748eaSMartin KaFai Lau #define SO_RCVTIMEO_NEW         66
11813a748eaSMartin KaFai Lau #define SO_SNDTIMEO_NEW         67
11913a748eaSMartin KaFai Lau 
12013a748eaSMartin KaFai Lau #define SO_DETACH_REUSEPORT_BPF 68
12113a748eaSMartin KaFai Lau 
1226fd1d51cSErin MacNeil #define SO_RCVMARK		75
1236fd1d51cSErin MacNeil 
1245e2ff670SAlexander Mikhalitsyn #define SO_PASSPIDFD		76
125*7b26952aSAlexander Mikhalitsyn #define SO_PEERPIDFD		77
1265e2ff670SAlexander Mikhalitsyn 
12713a748eaSMartin KaFai Lau #if !defined(__KERNEL__)
12813a748eaSMartin KaFai Lau 
12913a748eaSMartin KaFai Lau #if __BITS_PER_LONG == 64 || (defined(__x86_64__) && defined(__ILP32__))
13013a748eaSMartin KaFai Lau /* on 64-bit and x32, avoid the ?: operator */
13113a748eaSMartin KaFai Lau #define SO_TIMESTAMP		SO_TIMESTAMP_OLD
13213a748eaSMartin KaFai Lau #define SO_TIMESTAMPNS		SO_TIMESTAMPNS_OLD
13313a748eaSMartin KaFai Lau #define SO_TIMESTAMPING		SO_TIMESTAMPING_OLD
13413a748eaSMartin KaFai Lau 
13513a748eaSMartin KaFai Lau #define SO_RCVTIMEO		SO_RCVTIMEO_OLD
13613a748eaSMartin KaFai Lau #define SO_SNDTIMEO		SO_SNDTIMEO_OLD
13713a748eaSMartin KaFai Lau #else
13813a748eaSMartin KaFai Lau #define SO_TIMESTAMP (sizeof(time_t) == sizeof(__kernel_long_t) ? SO_TIMESTAMP_OLD : SO_TIMESTAMP_NEW)
13913a748eaSMartin KaFai Lau #define SO_TIMESTAMPNS (sizeof(time_t) == sizeof(__kernel_long_t) ? SO_TIMESTAMPNS_OLD : SO_TIMESTAMPNS_NEW)
14013a748eaSMartin KaFai Lau #define SO_TIMESTAMPING (sizeof(time_t) == sizeof(__kernel_long_t) ? SO_TIMESTAMPING_OLD : SO_TIMESTAMPING_NEW)
14113a748eaSMartin KaFai Lau 
14213a748eaSMartin KaFai Lau #define SO_RCVTIMEO (sizeof(time_t) == sizeof(__kernel_long_t) ? SO_RCVTIMEO_OLD : SO_RCVTIMEO_NEW)
14313a748eaSMartin KaFai Lau #define SO_SNDTIMEO (sizeof(time_t) == sizeof(__kernel_long_t) ? SO_SNDTIMEO_OLD : SO_SNDTIMEO_NEW)
14413a748eaSMartin KaFai Lau #endif
14513a748eaSMartin KaFai Lau 
14613a748eaSMartin KaFai Lau #define SCM_TIMESTAMP           SO_TIMESTAMP
14713a748eaSMartin KaFai Lau #define SCM_TIMESTAMPNS         SO_TIMESTAMPNS
14813a748eaSMartin KaFai Lau #define SCM_TIMESTAMPING        SO_TIMESTAMPING
14913a748eaSMartin KaFai Lau 
15013a748eaSMartin KaFai Lau #endif
15113a748eaSMartin KaFai Lau 
15213a748eaSMartin KaFai Lau #endif /* __ASM_GENERIC_SOCKET_H */
153