162306a36Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
262306a36Sopenharmony_ci#ifndef __ASM_GENERIC_SOCKET_H
362306a36Sopenharmony_ci#define __ASM_GENERIC_SOCKET_H
462306a36Sopenharmony_ci
562306a36Sopenharmony_ci#include <linux/posix_types.h>
662306a36Sopenharmony_ci#include <asm/sockios.h>
762306a36Sopenharmony_ci
862306a36Sopenharmony_ci/* For setsockopt(2) */
962306a36Sopenharmony_ci#define SOL_SOCKET	1
1062306a36Sopenharmony_ci
1162306a36Sopenharmony_ci#define SO_DEBUG	1
1262306a36Sopenharmony_ci#define SO_REUSEADDR	2
1362306a36Sopenharmony_ci#define SO_TYPE		3
1462306a36Sopenharmony_ci#define SO_ERROR	4
1562306a36Sopenharmony_ci#define SO_DONTROUTE	5
1662306a36Sopenharmony_ci#define SO_BROADCAST	6
1762306a36Sopenharmony_ci#define SO_SNDBUF	7
1862306a36Sopenharmony_ci#define SO_RCVBUF	8
1962306a36Sopenharmony_ci#define SO_SNDBUFFORCE	32
2062306a36Sopenharmony_ci#define SO_RCVBUFFORCE	33
2162306a36Sopenharmony_ci#define SO_KEEPALIVE	9
2262306a36Sopenharmony_ci#define SO_OOBINLINE	10
2362306a36Sopenharmony_ci#define SO_NO_CHECK	11
2462306a36Sopenharmony_ci#define SO_PRIORITY	12
2562306a36Sopenharmony_ci#define SO_LINGER	13
2662306a36Sopenharmony_ci#define SO_BSDCOMPAT	14
2762306a36Sopenharmony_ci#define SO_REUSEPORT	15
2862306a36Sopenharmony_ci#ifndef SO_PASSCRED /* powerpc only differs in these */
2962306a36Sopenharmony_ci#define SO_PASSCRED	16
3062306a36Sopenharmony_ci#define SO_PEERCRED	17
3162306a36Sopenharmony_ci#define SO_RCVLOWAT	18
3262306a36Sopenharmony_ci#define SO_SNDLOWAT	19
3362306a36Sopenharmony_ci#define SO_RCVTIMEO_OLD	20
3462306a36Sopenharmony_ci#define SO_SNDTIMEO_OLD	21
3562306a36Sopenharmony_ci#endif
3662306a36Sopenharmony_ci
3762306a36Sopenharmony_ci/* Security levels - as per NRL IPv6 - don't actually do anything */
3862306a36Sopenharmony_ci#define SO_SECURITY_AUTHENTICATION		22
3962306a36Sopenharmony_ci#define SO_SECURITY_ENCRYPTION_TRANSPORT	23
4062306a36Sopenharmony_ci#define SO_SECURITY_ENCRYPTION_NETWORK		24
4162306a36Sopenharmony_ci
4262306a36Sopenharmony_ci#define SO_BINDTODEVICE	25
4362306a36Sopenharmony_ci
4462306a36Sopenharmony_ci/* Socket filtering */
4562306a36Sopenharmony_ci#define SO_ATTACH_FILTER	26
4662306a36Sopenharmony_ci#define SO_DETACH_FILTER	27
4762306a36Sopenharmony_ci#define SO_GET_FILTER		SO_ATTACH_FILTER
4862306a36Sopenharmony_ci
4962306a36Sopenharmony_ci#define SO_PEERNAME		28
5062306a36Sopenharmony_ci
5162306a36Sopenharmony_ci#define SO_ACCEPTCONN		30
5262306a36Sopenharmony_ci
5362306a36Sopenharmony_ci#define SO_PEERSEC		31
5462306a36Sopenharmony_ci#define SO_PASSSEC		34
5562306a36Sopenharmony_ci
5662306a36Sopenharmony_ci#define SO_MARK			36
5762306a36Sopenharmony_ci
5862306a36Sopenharmony_ci#define SO_PROTOCOL		38
5962306a36Sopenharmony_ci#define SO_DOMAIN		39
6062306a36Sopenharmony_ci
6162306a36Sopenharmony_ci#define SO_RXQ_OVFL             40
6262306a36Sopenharmony_ci
6362306a36Sopenharmony_ci#define SO_WIFI_STATUS		41
6462306a36Sopenharmony_ci#define SCM_WIFI_STATUS	SO_WIFI_STATUS
6562306a36Sopenharmony_ci#define SO_PEEK_OFF		42
6662306a36Sopenharmony_ci
6762306a36Sopenharmony_ci/* Instruct lower device to use last 4-bytes of skb data as FCS */
6862306a36Sopenharmony_ci#define SO_NOFCS		43
6962306a36Sopenharmony_ci
7062306a36Sopenharmony_ci#define SO_LOCK_FILTER		44
7162306a36Sopenharmony_ci
7262306a36Sopenharmony_ci#define SO_SELECT_ERR_QUEUE	45
7362306a36Sopenharmony_ci
7462306a36Sopenharmony_ci#define SO_BUSY_POLL		46
7562306a36Sopenharmony_ci
7662306a36Sopenharmony_ci#define SO_MAX_PACING_RATE	47
7762306a36Sopenharmony_ci
7862306a36Sopenharmony_ci#define SO_BPF_EXTENSIONS	48
7962306a36Sopenharmony_ci
8062306a36Sopenharmony_ci#define SO_INCOMING_CPU		49
8162306a36Sopenharmony_ci
8262306a36Sopenharmony_ci#define SO_ATTACH_BPF		50
8362306a36Sopenharmony_ci#define SO_DETACH_BPF		SO_DETACH_FILTER
8462306a36Sopenharmony_ci
8562306a36Sopenharmony_ci#define SO_ATTACH_REUSEPORT_CBPF	51
8662306a36Sopenharmony_ci#define SO_ATTACH_REUSEPORT_EBPF	52
8762306a36Sopenharmony_ci
8862306a36Sopenharmony_ci#define SO_CNX_ADVICE		53
8962306a36Sopenharmony_ci
9062306a36Sopenharmony_ci#define SCM_TIMESTAMPING_OPT_STATS	54
9162306a36Sopenharmony_ci
9262306a36Sopenharmony_ci#define SO_MEMINFO		55
9362306a36Sopenharmony_ci
9462306a36Sopenharmony_ci#define SO_INCOMING_NAPI_ID	56
9562306a36Sopenharmony_ci
9662306a36Sopenharmony_ci#define SO_COOKIE		57
9762306a36Sopenharmony_ci
9862306a36Sopenharmony_ci#define SCM_TIMESTAMPING_PKTINFO	58
9962306a36Sopenharmony_ci
10062306a36Sopenharmony_ci#define SO_PEERGROUPS		59
10162306a36Sopenharmony_ci
10262306a36Sopenharmony_ci#define SO_ZEROCOPY		60
10362306a36Sopenharmony_ci
10462306a36Sopenharmony_ci#define SO_TXTIME		61
10562306a36Sopenharmony_ci#define SCM_TXTIME		SO_TXTIME
10662306a36Sopenharmony_ci
10762306a36Sopenharmony_ci#define SO_BINDTOIFINDEX	62
10862306a36Sopenharmony_ci
10962306a36Sopenharmony_ci#define SO_TIMESTAMP_OLD        29
11062306a36Sopenharmony_ci#define SO_TIMESTAMPNS_OLD      35
11162306a36Sopenharmony_ci#define SO_TIMESTAMPING_OLD     37
11262306a36Sopenharmony_ci
11362306a36Sopenharmony_ci#define SO_TIMESTAMP_NEW        63
11462306a36Sopenharmony_ci#define SO_TIMESTAMPNS_NEW      64
11562306a36Sopenharmony_ci#define SO_TIMESTAMPING_NEW     65
11662306a36Sopenharmony_ci
11762306a36Sopenharmony_ci#define SO_RCVTIMEO_NEW         66
11862306a36Sopenharmony_ci#define SO_SNDTIMEO_NEW         67
11962306a36Sopenharmony_ci
12062306a36Sopenharmony_ci#define SO_DETACH_REUSEPORT_BPF 68
12162306a36Sopenharmony_ci
12262306a36Sopenharmony_ci#define SO_PREFER_BUSY_POLL	69
12362306a36Sopenharmony_ci#define SO_BUSY_POLL_BUDGET	70
12462306a36Sopenharmony_ci
12562306a36Sopenharmony_ci#define SO_NETNS_COOKIE		71
12662306a36Sopenharmony_ci
12762306a36Sopenharmony_ci#define SO_BUF_LOCK		72
12862306a36Sopenharmony_ci
12962306a36Sopenharmony_ci#define SO_RESERVE_MEM		73
13062306a36Sopenharmony_ci
13162306a36Sopenharmony_ci#define SO_TXREHASH		74
13262306a36Sopenharmony_ci
13362306a36Sopenharmony_ci#define SO_RCVMARK		75
13462306a36Sopenharmony_ci
13562306a36Sopenharmony_ci#define SO_PASSPIDFD		76
13662306a36Sopenharmony_ci#define SO_PEERPIDFD		77
13762306a36Sopenharmony_ci
13862306a36Sopenharmony_ci#if !defined(__KERNEL__)
13962306a36Sopenharmony_ci
14062306a36Sopenharmony_ci#if __BITS_PER_LONG == 64 || (defined(__x86_64__) && defined(__ILP32__))
14162306a36Sopenharmony_ci/* on 64-bit and x32, avoid the ?: operator */
14262306a36Sopenharmony_ci#define SO_TIMESTAMP		SO_TIMESTAMP_OLD
14362306a36Sopenharmony_ci#define SO_TIMESTAMPNS		SO_TIMESTAMPNS_OLD
14462306a36Sopenharmony_ci#define SO_TIMESTAMPING		SO_TIMESTAMPING_OLD
14562306a36Sopenharmony_ci
14662306a36Sopenharmony_ci#define SO_RCVTIMEO		SO_RCVTIMEO_OLD
14762306a36Sopenharmony_ci#define SO_SNDTIMEO		SO_SNDTIMEO_OLD
14862306a36Sopenharmony_ci#else
14962306a36Sopenharmony_ci#define SO_TIMESTAMP (sizeof(time_t) == sizeof(__kernel_long_t) ? SO_TIMESTAMP_OLD : SO_TIMESTAMP_NEW)
15062306a36Sopenharmony_ci#define SO_TIMESTAMPNS (sizeof(time_t) == sizeof(__kernel_long_t) ? SO_TIMESTAMPNS_OLD : SO_TIMESTAMPNS_NEW)
15162306a36Sopenharmony_ci#define SO_TIMESTAMPING (sizeof(time_t) == sizeof(__kernel_long_t) ? SO_TIMESTAMPING_OLD : SO_TIMESTAMPING_NEW)
15262306a36Sopenharmony_ci
15362306a36Sopenharmony_ci#define SO_RCVTIMEO (sizeof(time_t) == sizeof(__kernel_long_t) ? SO_RCVTIMEO_OLD : SO_RCVTIMEO_NEW)
15462306a36Sopenharmony_ci#define SO_SNDTIMEO (sizeof(time_t) == sizeof(__kernel_long_t) ? SO_SNDTIMEO_OLD : SO_SNDTIMEO_NEW)
15562306a36Sopenharmony_ci#endif
15662306a36Sopenharmony_ci
15762306a36Sopenharmony_ci#define SCM_TIMESTAMP           SO_TIMESTAMP
15862306a36Sopenharmony_ci#define SCM_TIMESTAMPNS         SO_TIMESTAMPNS
15962306a36Sopenharmony_ci#define SCM_TIMESTAMPING        SO_TIMESTAMPING
16062306a36Sopenharmony_ci
16162306a36Sopenharmony_ci#endif
16262306a36Sopenharmony_ci
16362306a36Sopenharmony_ci#endif /* __ASM_GENERIC_SOCKET_H */
164