162306a36Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
262306a36Sopenharmony_ci/*
362306a36Sopenharmony_ci * This file is subject to the terms and conditions of the GNU General Public
462306a36Sopenharmony_ci * License.  See the file "COPYING" in the main directory of this archive
562306a36Sopenharmony_ci * for more details.
662306a36Sopenharmony_ci *
762306a36Sopenharmony_ci * Copyright (C) 1997, 1999, 2000, 2001 Ralf Baechle
862306a36Sopenharmony_ci * Copyright (C) 2000, 2001 Silicon Graphics, Inc.
962306a36Sopenharmony_ci */
1062306a36Sopenharmony_ci#ifndef _UAPI_ASM_SOCKET_H
1162306a36Sopenharmony_ci#define _UAPI_ASM_SOCKET_H
1262306a36Sopenharmony_ci
1362306a36Sopenharmony_ci#include <linux/posix_types.h>
1462306a36Sopenharmony_ci#include <asm/sockios.h>
1562306a36Sopenharmony_ci
1662306a36Sopenharmony_ci/*
1762306a36Sopenharmony_ci * For setsockopt(2)
1862306a36Sopenharmony_ci *
1962306a36Sopenharmony_ci * This defines are ABI conformant as far as Linux supports these ...
2062306a36Sopenharmony_ci */
2162306a36Sopenharmony_ci#define SOL_SOCKET	0xffff
2262306a36Sopenharmony_ci
2362306a36Sopenharmony_ci#define SO_DEBUG	0x0001	/* Record debugging information.  */
2462306a36Sopenharmony_ci#define SO_REUSEADDR	0x0004	/* Allow reuse of local addresses.  */
2562306a36Sopenharmony_ci#define SO_KEEPALIVE	0x0008	/* Keep connections alive and send
2662306a36Sopenharmony_ci				   SIGPIPE when they die.  */
2762306a36Sopenharmony_ci#define SO_DONTROUTE	0x0010	/* Don't do local routing.  */
2862306a36Sopenharmony_ci#define SO_BROADCAST	0x0020	/* Allow transmission of
2962306a36Sopenharmony_ci				   broadcast messages.	*/
3062306a36Sopenharmony_ci#define SO_LINGER	0x0080	/* Block on close of a reliable
3162306a36Sopenharmony_ci				   socket to transmit pending data.  */
3262306a36Sopenharmony_ci#define SO_OOBINLINE 0x0100	/* Receive out-of-band data in-band.  */
3362306a36Sopenharmony_ci#define SO_REUSEPORT 0x0200	/* Allow local address and port reuse.  */
3462306a36Sopenharmony_ci
3562306a36Sopenharmony_ci#define SO_TYPE		0x1008	/* Compatible name for SO_STYLE.  */
3662306a36Sopenharmony_ci#define SO_STYLE	SO_TYPE /* Synonym */
3762306a36Sopenharmony_ci#define SO_ERROR	0x1007	/* get error status and clear */
3862306a36Sopenharmony_ci#define SO_SNDBUF	0x1001	/* Send buffer size. */
3962306a36Sopenharmony_ci#define SO_RCVBUF	0x1002	/* Receive buffer. */
4062306a36Sopenharmony_ci#define SO_SNDLOWAT	0x1003	/* send low-water mark */
4162306a36Sopenharmony_ci#define SO_RCVLOWAT	0x1004	/* receive low-water mark */
4262306a36Sopenharmony_ci#define SO_SNDTIMEO_OLD	0x1005	/* send timeout */
4362306a36Sopenharmony_ci#define SO_RCVTIMEO_OLD	0x1006	/* receive timeout */
4462306a36Sopenharmony_ci#define SO_ACCEPTCONN	0x1009
4562306a36Sopenharmony_ci#define SO_PROTOCOL	0x1028	/* protocol type */
4662306a36Sopenharmony_ci#define SO_DOMAIN	0x1029	/* domain/socket family */
4762306a36Sopenharmony_ci
4862306a36Sopenharmony_ci/* linux-specific, might as well be the same as on i386 */
4962306a36Sopenharmony_ci#define SO_NO_CHECK	11
5062306a36Sopenharmony_ci#define SO_PRIORITY	12
5162306a36Sopenharmony_ci#define SO_BSDCOMPAT	14
5262306a36Sopenharmony_ci
5362306a36Sopenharmony_ci#define SO_PASSCRED	17
5462306a36Sopenharmony_ci#define SO_PEERCRED	18
5562306a36Sopenharmony_ci
5662306a36Sopenharmony_ci/* Security levels - as per NRL IPv6 - don't actually do anything */
5762306a36Sopenharmony_ci#define SO_SECURITY_AUTHENTICATION		22
5862306a36Sopenharmony_ci#define SO_SECURITY_ENCRYPTION_TRANSPORT	23
5962306a36Sopenharmony_ci#define SO_SECURITY_ENCRYPTION_NETWORK		24
6062306a36Sopenharmony_ci
6162306a36Sopenharmony_ci#define SO_BINDTODEVICE		25
6262306a36Sopenharmony_ci
6362306a36Sopenharmony_ci/* Socket filtering */
6462306a36Sopenharmony_ci#define SO_ATTACH_FILTER	26
6562306a36Sopenharmony_ci#define SO_DETACH_FILTER	27
6662306a36Sopenharmony_ci#define SO_GET_FILTER		SO_ATTACH_FILTER
6762306a36Sopenharmony_ci
6862306a36Sopenharmony_ci#define SO_PEERNAME		28
6962306a36Sopenharmony_ci
7062306a36Sopenharmony_ci#define SO_PEERSEC		30
7162306a36Sopenharmony_ci#define SO_SNDBUFFORCE		31
7262306a36Sopenharmony_ci#define SO_RCVBUFFORCE		33
7362306a36Sopenharmony_ci#define SO_PASSSEC		34
7462306a36Sopenharmony_ci
7562306a36Sopenharmony_ci#define SO_MARK			36
7662306a36Sopenharmony_ci
7762306a36Sopenharmony_ci#define SO_RXQ_OVFL		40
7862306a36Sopenharmony_ci
7962306a36Sopenharmony_ci#define SO_WIFI_STATUS		41
8062306a36Sopenharmony_ci#define SCM_WIFI_STATUS		SO_WIFI_STATUS
8162306a36Sopenharmony_ci#define SO_PEEK_OFF		42
8262306a36Sopenharmony_ci
8362306a36Sopenharmony_ci/* Instruct lower device to use last 4-bytes of skb data as FCS */
8462306a36Sopenharmony_ci#define SO_NOFCS		43
8562306a36Sopenharmony_ci
8662306a36Sopenharmony_ci#define SO_LOCK_FILTER		44
8762306a36Sopenharmony_ci
8862306a36Sopenharmony_ci#define SO_SELECT_ERR_QUEUE	45
8962306a36Sopenharmony_ci
9062306a36Sopenharmony_ci#define SO_BUSY_POLL		46
9162306a36Sopenharmony_ci
9262306a36Sopenharmony_ci#define SO_MAX_PACING_RATE	47
9362306a36Sopenharmony_ci
9462306a36Sopenharmony_ci#define SO_BPF_EXTENSIONS	48
9562306a36Sopenharmony_ci
9662306a36Sopenharmony_ci#define SO_INCOMING_CPU		49
9762306a36Sopenharmony_ci
9862306a36Sopenharmony_ci#define SO_ATTACH_BPF		50
9962306a36Sopenharmony_ci#define SO_DETACH_BPF		SO_DETACH_FILTER
10062306a36Sopenharmony_ci
10162306a36Sopenharmony_ci#define SO_ATTACH_REUSEPORT_CBPF	51
10262306a36Sopenharmony_ci#define SO_ATTACH_REUSEPORT_EBPF	52
10362306a36Sopenharmony_ci
10462306a36Sopenharmony_ci#define SO_CNX_ADVICE		53
10562306a36Sopenharmony_ci
10662306a36Sopenharmony_ci#define SCM_TIMESTAMPING_OPT_STATS	54
10762306a36Sopenharmony_ci
10862306a36Sopenharmony_ci#define SO_MEMINFO		55
10962306a36Sopenharmony_ci
11062306a36Sopenharmony_ci#define SO_INCOMING_NAPI_ID	56
11162306a36Sopenharmony_ci
11262306a36Sopenharmony_ci#define SO_COOKIE		57
11362306a36Sopenharmony_ci
11462306a36Sopenharmony_ci#define SCM_TIMESTAMPING_PKTINFO	58
11562306a36Sopenharmony_ci
11662306a36Sopenharmony_ci#define SO_PEERGROUPS		59
11762306a36Sopenharmony_ci
11862306a36Sopenharmony_ci#define SO_ZEROCOPY		60
11962306a36Sopenharmony_ci
12062306a36Sopenharmony_ci#define SO_TXTIME		61
12162306a36Sopenharmony_ci#define SCM_TXTIME		SO_TXTIME
12262306a36Sopenharmony_ci
12362306a36Sopenharmony_ci#define SO_BINDTOIFINDEX	62
12462306a36Sopenharmony_ci
12562306a36Sopenharmony_ci#define SO_TIMESTAMP_OLD        29
12662306a36Sopenharmony_ci#define SO_TIMESTAMPNS_OLD      35
12762306a36Sopenharmony_ci#define SO_TIMESTAMPING_OLD     37
12862306a36Sopenharmony_ci
12962306a36Sopenharmony_ci#define SO_TIMESTAMP_NEW        63
13062306a36Sopenharmony_ci#define SO_TIMESTAMPNS_NEW      64
13162306a36Sopenharmony_ci#define SO_TIMESTAMPING_NEW     65
13262306a36Sopenharmony_ci
13362306a36Sopenharmony_ci#define SO_RCVTIMEO_NEW         66
13462306a36Sopenharmony_ci#define SO_SNDTIMEO_NEW         67
13562306a36Sopenharmony_ci
13662306a36Sopenharmony_ci#define SO_DETACH_REUSEPORT_BPF 68
13762306a36Sopenharmony_ci
13862306a36Sopenharmony_ci#define SO_PREFER_BUSY_POLL	69
13962306a36Sopenharmony_ci#define SO_BUSY_POLL_BUDGET	70
14062306a36Sopenharmony_ci
14162306a36Sopenharmony_ci#define SO_NETNS_COOKIE		71
14262306a36Sopenharmony_ci
14362306a36Sopenharmony_ci#define SO_BUF_LOCK		72
14462306a36Sopenharmony_ci
14562306a36Sopenharmony_ci#define SO_RESERVE_MEM		73
14662306a36Sopenharmony_ci
14762306a36Sopenharmony_ci#define SO_TXREHASH		74
14862306a36Sopenharmony_ci
14962306a36Sopenharmony_ci#define SO_RCVMARK		75
15062306a36Sopenharmony_ci
15162306a36Sopenharmony_ci#define SO_PASSPIDFD		76
15262306a36Sopenharmony_ci#define SO_PEERPIDFD		77
15362306a36Sopenharmony_ci
15462306a36Sopenharmony_ci#if !defined(__KERNEL__)
15562306a36Sopenharmony_ci
15662306a36Sopenharmony_ci#if __BITS_PER_LONG == 64
15762306a36Sopenharmony_ci#define SO_TIMESTAMP		SO_TIMESTAMP_OLD
15862306a36Sopenharmony_ci#define SO_TIMESTAMPNS		SO_TIMESTAMPNS_OLD
15962306a36Sopenharmony_ci#define SO_TIMESTAMPING		SO_TIMESTAMPING_OLD
16062306a36Sopenharmony_ci
16162306a36Sopenharmony_ci#define SO_RCVTIMEO             SO_RCVTIMEO_OLD
16262306a36Sopenharmony_ci#define SO_SNDTIMEO             SO_SNDTIMEO_OLD
16362306a36Sopenharmony_ci#else
16462306a36Sopenharmony_ci#define SO_TIMESTAMP (sizeof(time_t) == sizeof(__kernel_long_t) ? SO_TIMESTAMP_OLD : SO_TIMESTAMP_NEW)
16562306a36Sopenharmony_ci#define SO_TIMESTAMPNS (sizeof(time_t) == sizeof(__kernel_long_t) ? SO_TIMESTAMPNS_OLD : SO_TIMESTAMPNS_NEW)
16662306a36Sopenharmony_ci#define SO_TIMESTAMPING (sizeof(time_t) == sizeof(__kernel_long_t) ? SO_TIMESTAMPING_OLD : SO_TIMESTAMPING_NEW)
16762306a36Sopenharmony_ci
16862306a36Sopenharmony_ci#define SO_RCVTIMEO (sizeof(time_t) == sizeof(__kernel_long_t) ? SO_RCVTIMEO_OLD : SO_RCVTIMEO_NEW)
16962306a36Sopenharmony_ci#define SO_SNDTIMEO (sizeof(time_t) == sizeof(__kernel_long_t) ? SO_SNDTIMEO_OLD : SO_SNDTIMEO_NEW)
17062306a36Sopenharmony_ci#endif
17162306a36Sopenharmony_ci
17262306a36Sopenharmony_ci#define SCM_TIMESTAMP           SO_TIMESTAMP
17362306a36Sopenharmony_ci#define SCM_TIMESTAMPNS         SO_TIMESTAMPNS
17462306a36Sopenharmony_ci#define SCM_TIMESTAMPING        SO_TIMESTAMPING
17562306a36Sopenharmony_ci
17662306a36Sopenharmony_ci#endif
17762306a36Sopenharmony_ci
17862306a36Sopenharmony_ci#endif /* _UAPI_ASM_SOCKET_H */
179