162306a36Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
262306a36Sopenharmony_ci#ifndef _ASM_SOCKET_H
362306a36Sopenharmony_ci#define _ASM_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	0xffff
1062306a36Sopenharmony_ci
1162306a36Sopenharmony_ci#define SO_DEBUG	0x0001
1262306a36Sopenharmony_ci#define SO_PASSCRED	0x0002
1362306a36Sopenharmony_ci#define SO_REUSEADDR	0x0004
1462306a36Sopenharmony_ci#define SO_KEEPALIVE	0x0008
1562306a36Sopenharmony_ci#define SO_DONTROUTE	0x0010
1662306a36Sopenharmony_ci#define SO_BROADCAST	0x0020
1762306a36Sopenharmony_ci#define SO_PEERCRED	0x0040
1862306a36Sopenharmony_ci#define SO_LINGER	0x0080
1962306a36Sopenharmony_ci#define SO_OOBINLINE	0x0100
2062306a36Sopenharmony_ci#define SO_REUSEPORT	0x0200
2162306a36Sopenharmony_ci#define SO_BSDCOMPAT    0x0400
2262306a36Sopenharmony_ci#define SO_RCVLOWAT     0x0800
2362306a36Sopenharmony_ci#define SO_SNDLOWAT     0x1000
2462306a36Sopenharmony_ci#define SO_RCVTIMEO_OLD     0x2000
2562306a36Sopenharmony_ci#define SO_SNDTIMEO_OLD     0x4000
2662306a36Sopenharmony_ci#define SO_ACCEPTCONN	0x8000
2762306a36Sopenharmony_ci
2862306a36Sopenharmony_ci#define SO_SNDBUF	0x1001
2962306a36Sopenharmony_ci#define SO_RCVBUF	0x1002
3062306a36Sopenharmony_ci#define SO_SNDBUFFORCE	0x100a
3162306a36Sopenharmony_ci#define SO_RCVBUFFORCE	0x100b
3262306a36Sopenharmony_ci#define SO_ERROR	0x1007
3362306a36Sopenharmony_ci#define SO_TYPE		0x1008
3462306a36Sopenharmony_ci#define SO_PROTOCOL	0x1028
3562306a36Sopenharmony_ci#define SO_DOMAIN	0x1029
3662306a36Sopenharmony_ci
3762306a36Sopenharmony_ci/* Linux specific, keep the same. */
3862306a36Sopenharmony_ci#define SO_NO_CHECK	0x000b
3962306a36Sopenharmony_ci#define SO_PRIORITY	0x000c
4062306a36Sopenharmony_ci
4162306a36Sopenharmony_ci#define SO_BINDTODEVICE 0x000d
4262306a36Sopenharmony_ci
4362306a36Sopenharmony_ci#define SO_ATTACH_FILTER	0x001a
4462306a36Sopenharmony_ci#define SO_DETACH_FILTER        0x001b
4562306a36Sopenharmony_ci#define SO_GET_FILTER		SO_ATTACH_FILTER
4662306a36Sopenharmony_ci
4762306a36Sopenharmony_ci#define SO_PEERNAME		0x001c
4862306a36Sopenharmony_ci
4962306a36Sopenharmony_ci#define SO_PEERSEC		0x001e
5062306a36Sopenharmony_ci#define SO_PASSSEC		0x001f
5162306a36Sopenharmony_ci
5262306a36Sopenharmony_ci#define SO_MARK			0x0022
5362306a36Sopenharmony_ci
5462306a36Sopenharmony_ci#define SO_RXQ_OVFL             0x0024
5562306a36Sopenharmony_ci
5662306a36Sopenharmony_ci#define SO_WIFI_STATUS		0x0025
5762306a36Sopenharmony_ci#define SCM_WIFI_STATUS		SO_WIFI_STATUS
5862306a36Sopenharmony_ci#define SO_PEEK_OFF		0x0026
5962306a36Sopenharmony_ci
6062306a36Sopenharmony_ci/* Instruct lower device to use last 4-bytes of skb data as FCS */
6162306a36Sopenharmony_ci#define SO_NOFCS		0x0027
6262306a36Sopenharmony_ci
6362306a36Sopenharmony_ci#define SO_LOCK_FILTER		0x0028
6462306a36Sopenharmony_ci
6562306a36Sopenharmony_ci#define SO_SELECT_ERR_QUEUE	0x0029
6662306a36Sopenharmony_ci
6762306a36Sopenharmony_ci#define SO_BUSY_POLL		0x0030
6862306a36Sopenharmony_ci
6962306a36Sopenharmony_ci#define SO_MAX_PACING_RATE	0x0031
7062306a36Sopenharmony_ci
7162306a36Sopenharmony_ci#define SO_BPF_EXTENSIONS	0x0032
7262306a36Sopenharmony_ci
7362306a36Sopenharmony_ci#define SO_INCOMING_CPU		0x0033
7462306a36Sopenharmony_ci
7562306a36Sopenharmony_ci#define SO_ATTACH_BPF		0x0034
7662306a36Sopenharmony_ci#define SO_DETACH_BPF		SO_DETACH_FILTER
7762306a36Sopenharmony_ci
7862306a36Sopenharmony_ci#define SO_ATTACH_REUSEPORT_CBPF	0x0035
7962306a36Sopenharmony_ci#define SO_ATTACH_REUSEPORT_EBPF	0x0036
8062306a36Sopenharmony_ci
8162306a36Sopenharmony_ci#define SO_CNX_ADVICE		0x0037
8262306a36Sopenharmony_ci
8362306a36Sopenharmony_ci#define SCM_TIMESTAMPING_OPT_STATS	0x0038
8462306a36Sopenharmony_ci
8562306a36Sopenharmony_ci#define SO_MEMINFO		0x0039
8662306a36Sopenharmony_ci
8762306a36Sopenharmony_ci#define SO_INCOMING_NAPI_ID	0x003a
8862306a36Sopenharmony_ci
8962306a36Sopenharmony_ci#define SO_COOKIE		0x003b
9062306a36Sopenharmony_ci
9162306a36Sopenharmony_ci#define SCM_TIMESTAMPING_PKTINFO	0x003c
9262306a36Sopenharmony_ci
9362306a36Sopenharmony_ci#define SO_PEERGROUPS		0x003d
9462306a36Sopenharmony_ci
9562306a36Sopenharmony_ci#define SO_ZEROCOPY		0x003e
9662306a36Sopenharmony_ci
9762306a36Sopenharmony_ci#define SO_TXTIME		0x003f
9862306a36Sopenharmony_ci#define SCM_TXTIME		SO_TXTIME
9962306a36Sopenharmony_ci
10062306a36Sopenharmony_ci#define SO_BINDTOIFINDEX	0x0041
10162306a36Sopenharmony_ci
10262306a36Sopenharmony_ci/* Security levels - as per NRL IPv6 - don't actually do anything */
10362306a36Sopenharmony_ci#define SO_SECURITY_AUTHENTICATION		0x5001
10462306a36Sopenharmony_ci#define SO_SECURITY_ENCRYPTION_TRANSPORT	0x5002
10562306a36Sopenharmony_ci#define SO_SECURITY_ENCRYPTION_NETWORK		0x5004
10662306a36Sopenharmony_ci
10762306a36Sopenharmony_ci#define SO_TIMESTAMP_OLD         0x001d
10862306a36Sopenharmony_ci#define SO_TIMESTAMPNS_OLD       0x0021
10962306a36Sopenharmony_ci#define SO_TIMESTAMPING_OLD      0x0023
11062306a36Sopenharmony_ci
11162306a36Sopenharmony_ci#define SO_TIMESTAMP_NEW         0x0046
11262306a36Sopenharmony_ci#define SO_TIMESTAMPNS_NEW       0x0042
11362306a36Sopenharmony_ci#define SO_TIMESTAMPING_NEW      0x0043
11462306a36Sopenharmony_ci
11562306a36Sopenharmony_ci#define SO_RCVTIMEO_NEW          0x0044
11662306a36Sopenharmony_ci#define SO_SNDTIMEO_NEW          0x0045
11762306a36Sopenharmony_ci
11862306a36Sopenharmony_ci#define SO_DETACH_REUSEPORT_BPF  0x0047
11962306a36Sopenharmony_ci
12062306a36Sopenharmony_ci#define SO_PREFER_BUSY_POLL	 0x0048
12162306a36Sopenharmony_ci#define SO_BUSY_POLL_BUDGET	 0x0049
12262306a36Sopenharmony_ci
12362306a36Sopenharmony_ci#define SO_NETNS_COOKIE          0x0050
12462306a36Sopenharmony_ci
12562306a36Sopenharmony_ci#define SO_BUF_LOCK              0x0051
12662306a36Sopenharmony_ci
12762306a36Sopenharmony_ci#define SO_RESERVE_MEM           0x0052
12862306a36Sopenharmony_ci
12962306a36Sopenharmony_ci#define SO_TXREHASH              0x0053
13062306a36Sopenharmony_ci
13162306a36Sopenharmony_ci#define SO_RCVMARK               0x0054
13262306a36Sopenharmony_ci
13362306a36Sopenharmony_ci#define SO_PASSPIDFD             0x0055
13462306a36Sopenharmony_ci#define SO_PEERPIDFD             0x0056
13562306a36Sopenharmony_ci
13662306a36Sopenharmony_ci#if !defined(__KERNEL__)
13762306a36Sopenharmony_ci
13862306a36Sopenharmony_ci
13962306a36Sopenharmony_ci#if __BITS_PER_LONG == 64
14062306a36Sopenharmony_ci#define SO_TIMESTAMP		SO_TIMESTAMP_OLD
14162306a36Sopenharmony_ci#define SO_TIMESTAMPNS		SO_TIMESTAMPNS_OLD
14262306a36Sopenharmony_ci#define SO_TIMESTAMPING		SO_TIMESTAMPING_OLD
14362306a36Sopenharmony_ci
14462306a36Sopenharmony_ci#define SO_RCVTIMEO		SO_RCVTIMEO_OLD
14562306a36Sopenharmony_ci#define SO_SNDTIMEO		SO_SNDTIMEO_OLD
14662306a36Sopenharmony_ci#else
14762306a36Sopenharmony_ci#define SO_TIMESTAMP (sizeof(time_t) == sizeof(__kernel_long_t) ? SO_TIMESTAMP_OLD : SO_TIMESTAMP_NEW)
14862306a36Sopenharmony_ci#define SO_TIMESTAMPNS (sizeof(time_t) == sizeof(__kernel_long_t) ? SO_TIMESTAMPNS_OLD : SO_TIMESTAMPNS_NEW)
14962306a36Sopenharmony_ci#define SO_TIMESTAMPING (sizeof(time_t) == sizeof(__kernel_long_t) ? SO_TIMESTAMPING_OLD : SO_TIMESTAMPING_NEW)
15062306a36Sopenharmony_ci
15162306a36Sopenharmony_ci#define SO_RCVTIMEO (sizeof(time_t) == sizeof(__kernel_long_t) ? SO_RCVTIMEO_OLD : SO_RCVTIMEO_NEW)
15262306a36Sopenharmony_ci#define SO_SNDTIMEO (sizeof(time_t) == sizeof(__kernel_long_t) ? SO_SNDTIMEO_OLD : SO_SNDTIMEO_NEW)
15362306a36Sopenharmony_ci#endif
15462306a36Sopenharmony_ci
15562306a36Sopenharmony_ci#define SCM_TIMESTAMP          SO_TIMESTAMP
15662306a36Sopenharmony_ci#define SCM_TIMESTAMPNS        SO_TIMESTAMPNS
15762306a36Sopenharmony_ci#define SCM_TIMESTAMPING       SO_TIMESTAMPING
15862306a36Sopenharmony_ci
15962306a36Sopenharmony_ci#endif
16062306a36Sopenharmony_ci
16162306a36Sopenharmony_ci#endif /* _ASM_SOCKET_H */
162