162306a36Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
262306a36Sopenharmony_ci#ifndef _UAPI_ASM_SOCKET_H
362306a36Sopenharmony_ci#define _UAPI_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_REUSEADDR	0x0004
1362306a36Sopenharmony_ci#define SO_KEEPALIVE	0x0008
1462306a36Sopenharmony_ci#define SO_DONTROUTE	0x0010
1562306a36Sopenharmony_ci#define SO_BROADCAST	0x0020
1662306a36Sopenharmony_ci#define SO_LINGER	0x0080
1762306a36Sopenharmony_ci#define SO_OOBINLINE	0x0100
1862306a36Sopenharmony_ci#define SO_REUSEPORT	0x0200
1962306a36Sopenharmony_ci#define SO_SNDBUF	0x1001
2062306a36Sopenharmony_ci#define SO_RCVBUF	0x1002
2162306a36Sopenharmony_ci#define SO_SNDBUFFORCE	0x100a
2262306a36Sopenharmony_ci#define SO_RCVBUFFORCE	0x100b
2362306a36Sopenharmony_ci#define SO_SNDLOWAT	0x1003
2462306a36Sopenharmony_ci#define SO_RCVLOWAT	0x1004
2562306a36Sopenharmony_ci#define SO_SNDTIMEO_OLD	0x1005
2662306a36Sopenharmony_ci#define SO_RCVTIMEO_OLD	0x1006
2762306a36Sopenharmony_ci#define SO_ERROR	0x1007
2862306a36Sopenharmony_ci#define SO_TYPE		0x1008
2962306a36Sopenharmony_ci#define SO_PROTOCOL	0x1028
3062306a36Sopenharmony_ci#define SO_DOMAIN	0x1029
3162306a36Sopenharmony_ci#define SO_PEERNAME	0x2000
3262306a36Sopenharmony_ci
3362306a36Sopenharmony_ci#define SO_NO_CHECK	0x400b
3462306a36Sopenharmony_ci#define SO_PRIORITY	0x400c
3562306a36Sopenharmony_ci#define SO_BSDCOMPAT	0x400e
3662306a36Sopenharmony_ci#define SO_PASSCRED	0x4010
3762306a36Sopenharmony_ci#define SO_PEERCRED	0x4011
3862306a36Sopenharmony_ci
3962306a36Sopenharmony_ci/* Security levels - as per NRL IPv6 - don't actually do anything */
4062306a36Sopenharmony_ci#define SO_SECURITY_AUTHENTICATION		0x4016
4162306a36Sopenharmony_ci#define SO_SECURITY_ENCRYPTION_TRANSPORT	0x4017
4262306a36Sopenharmony_ci#define SO_SECURITY_ENCRYPTION_NETWORK		0x4018
4362306a36Sopenharmony_ci
4462306a36Sopenharmony_ci#define SO_BINDTODEVICE	0x4019
4562306a36Sopenharmony_ci
4662306a36Sopenharmony_ci/* Socket filtering */
4762306a36Sopenharmony_ci#define SO_ATTACH_FILTER        0x401a
4862306a36Sopenharmony_ci#define SO_DETACH_FILTER        0x401b
4962306a36Sopenharmony_ci#define SO_GET_FILTER		SO_ATTACH_FILTER
5062306a36Sopenharmony_ci
5162306a36Sopenharmony_ci#define SO_ACCEPTCONN		0x401c
5262306a36Sopenharmony_ci
5362306a36Sopenharmony_ci#define SO_PEERSEC		0x401d
5462306a36Sopenharmony_ci#define SO_PASSSEC		0x401e
5562306a36Sopenharmony_ci
5662306a36Sopenharmony_ci#define SO_MARK			0x401f
5762306a36Sopenharmony_ci
5862306a36Sopenharmony_ci#define SO_RXQ_OVFL             0x4021
5962306a36Sopenharmony_ci
6062306a36Sopenharmony_ci#define SO_WIFI_STATUS		0x4022
6162306a36Sopenharmony_ci#define SCM_WIFI_STATUS		SO_WIFI_STATUS
6262306a36Sopenharmony_ci#define SO_PEEK_OFF		0x4023
6362306a36Sopenharmony_ci
6462306a36Sopenharmony_ci/* Instruct lower device to use last 4-bytes of skb data as FCS */
6562306a36Sopenharmony_ci#define SO_NOFCS		0x4024
6662306a36Sopenharmony_ci
6762306a36Sopenharmony_ci#define SO_LOCK_FILTER		0x4025
6862306a36Sopenharmony_ci
6962306a36Sopenharmony_ci#define SO_SELECT_ERR_QUEUE	0x4026
7062306a36Sopenharmony_ci
7162306a36Sopenharmony_ci#define SO_BUSY_POLL		0x4027
7262306a36Sopenharmony_ci
7362306a36Sopenharmony_ci#define SO_MAX_PACING_RATE	0x4028
7462306a36Sopenharmony_ci
7562306a36Sopenharmony_ci#define SO_BPF_EXTENSIONS	0x4029
7662306a36Sopenharmony_ci
7762306a36Sopenharmony_ci#define SO_INCOMING_CPU		0x402A
7862306a36Sopenharmony_ci
7962306a36Sopenharmony_ci#define SO_ATTACH_BPF		0x402B
8062306a36Sopenharmony_ci#define SO_DETACH_BPF		SO_DETACH_FILTER
8162306a36Sopenharmony_ci
8262306a36Sopenharmony_ci#define SO_ATTACH_REUSEPORT_CBPF	0x402C
8362306a36Sopenharmony_ci#define SO_ATTACH_REUSEPORT_EBPF	0x402D
8462306a36Sopenharmony_ci
8562306a36Sopenharmony_ci#define SO_CNX_ADVICE		0x402E
8662306a36Sopenharmony_ci
8762306a36Sopenharmony_ci#define SCM_TIMESTAMPING_OPT_STATS	0x402F
8862306a36Sopenharmony_ci
8962306a36Sopenharmony_ci#define SO_MEMINFO		0x4030
9062306a36Sopenharmony_ci
9162306a36Sopenharmony_ci#define SO_INCOMING_NAPI_ID	0x4031
9262306a36Sopenharmony_ci
9362306a36Sopenharmony_ci#define SO_COOKIE		0x4032
9462306a36Sopenharmony_ci
9562306a36Sopenharmony_ci#define SCM_TIMESTAMPING_PKTINFO	0x4033
9662306a36Sopenharmony_ci
9762306a36Sopenharmony_ci#define SO_PEERGROUPS		0x4034
9862306a36Sopenharmony_ci
9962306a36Sopenharmony_ci#define SO_ZEROCOPY		0x4035
10062306a36Sopenharmony_ci
10162306a36Sopenharmony_ci#define SO_TXTIME		0x4036
10262306a36Sopenharmony_ci#define SCM_TXTIME		SO_TXTIME
10362306a36Sopenharmony_ci
10462306a36Sopenharmony_ci#define SO_BINDTOIFINDEX	0x4037
10562306a36Sopenharmony_ci
10662306a36Sopenharmony_ci#define SO_TIMESTAMP_OLD        0x4012
10762306a36Sopenharmony_ci#define SO_TIMESTAMPNS_OLD      0x4013
10862306a36Sopenharmony_ci#define SO_TIMESTAMPING_OLD     0x4020
10962306a36Sopenharmony_ci
11062306a36Sopenharmony_ci#define SO_TIMESTAMP_NEW        0x4038
11162306a36Sopenharmony_ci#define SO_TIMESTAMPNS_NEW      0x4039
11262306a36Sopenharmony_ci#define SO_TIMESTAMPING_NEW     0x403A
11362306a36Sopenharmony_ci
11462306a36Sopenharmony_ci#define SO_RCVTIMEO_NEW         0x4040
11562306a36Sopenharmony_ci#define SO_SNDTIMEO_NEW         0x4041
11662306a36Sopenharmony_ci
11762306a36Sopenharmony_ci#define SO_DETACH_REUSEPORT_BPF 0x4042
11862306a36Sopenharmony_ci
11962306a36Sopenharmony_ci#define SO_PREFER_BUSY_POLL	0x4043
12062306a36Sopenharmony_ci#define SO_BUSY_POLL_BUDGET	0x4044
12162306a36Sopenharmony_ci
12262306a36Sopenharmony_ci#define SO_NETNS_COOKIE		0x4045
12362306a36Sopenharmony_ci
12462306a36Sopenharmony_ci#define SO_BUF_LOCK		0x4046
12562306a36Sopenharmony_ci
12662306a36Sopenharmony_ci#define SO_RESERVE_MEM		0x4047
12762306a36Sopenharmony_ci
12862306a36Sopenharmony_ci#define SO_TXREHASH		0x4048
12962306a36Sopenharmony_ci
13062306a36Sopenharmony_ci#define SO_RCVMARK		0x4049
13162306a36Sopenharmony_ci
13262306a36Sopenharmony_ci#define SO_PASSPIDFD		0x404A
13362306a36Sopenharmony_ci#define SO_PEERPIDFD		0x404B
13462306a36Sopenharmony_ci
13562306a36Sopenharmony_ci#if !defined(__KERNEL__)
13662306a36Sopenharmony_ci
13762306a36Sopenharmony_ci#if __BITS_PER_LONG == 64
13862306a36Sopenharmony_ci#define SO_TIMESTAMP		SO_TIMESTAMP_OLD
13962306a36Sopenharmony_ci#define SO_TIMESTAMPNS		SO_TIMESTAMPNS_OLD
14062306a36Sopenharmony_ci#define SO_TIMESTAMPING         SO_TIMESTAMPING_OLD
14162306a36Sopenharmony_ci#define SO_RCVTIMEO		SO_RCVTIMEO_OLD
14262306a36Sopenharmony_ci#define SO_SNDTIMEO		SO_SNDTIMEO_OLD
14362306a36Sopenharmony_ci#else
14462306a36Sopenharmony_ci#define SO_TIMESTAMP (sizeof(time_t) == sizeof(__kernel_long_t) ? SO_TIMESTAMP_OLD : SO_TIMESTAMP_NEW)
14562306a36Sopenharmony_ci#define SO_TIMESTAMPNS (sizeof(time_t) == sizeof(__kernel_long_t) ? SO_TIMESTAMPNS_OLD : SO_TIMESTAMPNS_NEW)
14662306a36Sopenharmony_ci#define SO_TIMESTAMPING (sizeof(time_t) == sizeof(__kernel_long_t) ? SO_TIMESTAMPING_OLD : SO_TIMESTAMPING_NEW)
14762306a36Sopenharmony_ci
14862306a36Sopenharmony_ci#define SO_RCVTIMEO (sizeof(time_t) == sizeof(__kernel_long_t) ? SO_RCVTIMEO_OLD : SO_RCVTIMEO_NEW)
14962306a36Sopenharmony_ci#define SO_SNDTIMEO (sizeof(time_t) == sizeof(__kernel_long_t) ? SO_SNDTIMEO_OLD : SO_SNDTIMEO_NEW)
15062306a36Sopenharmony_ci#endif
15162306a36Sopenharmony_ci
15262306a36Sopenharmony_ci#define SCM_TIMESTAMP           SO_TIMESTAMP
15362306a36Sopenharmony_ci#define SCM_TIMESTAMPNS         SO_TIMESTAMPNS
15462306a36Sopenharmony_ci#define SCM_TIMESTAMPING        SO_TIMESTAMPING
15562306a36Sopenharmony_ci
15662306a36Sopenharmony_ci#endif
15762306a36Sopenharmony_ci
15862306a36Sopenharmony_ci#endif /* _UAPI_ASM_SOCKET_H */
159