18c2ecf20Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
28c2ecf20Sopenharmony_ci/*
38c2ecf20Sopenharmony_ci * This file is subject to the terms and conditions of the GNU General Public
48c2ecf20Sopenharmony_ci * License.  See the file "COPYING" in the main directory of this archive
58c2ecf20Sopenharmony_ci * for more details.
68c2ecf20Sopenharmony_ci *
78c2ecf20Sopenharmony_ci * Copyright (C) 1997, 1999, 2000, 2001 Ralf Baechle
88c2ecf20Sopenharmony_ci * Copyright (C) 2000, 2001 Silicon Graphics, Inc.
98c2ecf20Sopenharmony_ci */
108c2ecf20Sopenharmony_ci#ifndef _UAPI_ASM_SOCKET_H
118c2ecf20Sopenharmony_ci#define _UAPI_ASM_SOCKET_H
128c2ecf20Sopenharmony_ci
138c2ecf20Sopenharmony_ci#include <linux/posix_types.h>
148c2ecf20Sopenharmony_ci#include <asm/sockios.h>
158c2ecf20Sopenharmony_ci
168c2ecf20Sopenharmony_ci/*
178c2ecf20Sopenharmony_ci * For setsockopt(2)
188c2ecf20Sopenharmony_ci *
198c2ecf20Sopenharmony_ci * This defines are ABI conformant as far as Linux supports these ...
208c2ecf20Sopenharmony_ci */
218c2ecf20Sopenharmony_ci#define SOL_SOCKET	0xffff
228c2ecf20Sopenharmony_ci
238c2ecf20Sopenharmony_ci#define SO_DEBUG	0x0001	/* Record debugging information.  */
248c2ecf20Sopenharmony_ci#define SO_REUSEADDR	0x0004	/* Allow reuse of local addresses.  */
258c2ecf20Sopenharmony_ci#define SO_KEEPALIVE	0x0008	/* Keep connections alive and send
268c2ecf20Sopenharmony_ci				   SIGPIPE when they die.  */
278c2ecf20Sopenharmony_ci#define SO_DONTROUTE	0x0010	/* Don't do local routing.  */
288c2ecf20Sopenharmony_ci#define SO_BROADCAST	0x0020	/* Allow transmission of
298c2ecf20Sopenharmony_ci				   broadcast messages.	*/
308c2ecf20Sopenharmony_ci#define SO_LINGER	0x0080	/* Block on close of a reliable
318c2ecf20Sopenharmony_ci				   socket to transmit pending data.  */
328c2ecf20Sopenharmony_ci#define SO_OOBINLINE 0x0100	/* Receive out-of-band data in-band.  */
338c2ecf20Sopenharmony_ci#define SO_REUSEPORT 0x0200	/* Allow local address and port reuse.  */
348c2ecf20Sopenharmony_ci
358c2ecf20Sopenharmony_ci#define SO_TYPE		0x1008	/* Compatible name for SO_STYLE.  */
368c2ecf20Sopenharmony_ci#define SO_STYLE	SO_TYPE /* Synonym */
378c2ecf20Sopenharmony_ci#define SO_ERROR	0x1007	/* get error status and clear */
388c2ecf20Sopenharmony_ci#define SO_SNDBUF	0x1001	/* Send buffer size. */
398c2ecf20Sopenharmony_ci#define SO_RCVBUF	0x1002	/* Receive buffer. */
408c2ecf20Sopenharmony_ci#define SO_SNDLOWAT	0x1003	/* send low-water mark */
418c2ecf20Sopenharmony_ci#define SO_RCVLOWAT	0x1004	/* receive low-water mark */
428c2ecf20Sopenharmony_ci#define SO_SNDTIMEO_OLD	0x1005	/* send timeout */
438c2ecf20Sopenharmony_ci#define SO_RCVTIMEO_OLD	0x1006	/* receive timeout */
448c2ecf20Sopenharmony_ci#define SO_ACCEPTCONN	0x1009
458c2ecf20Sopenharmony_ci#define SO_PROTOCOL	0x1028	/* protocol type */
468c2ecf20Sopenharmony_ci#define SO_DOMAIN	0x1029	/* domain/socket family */
478c2ecf20Sopenharmony_ci
488c2ecf20Sopenharmony_ci/* linux-specific, might as well be the same as on i386 */
498c2ecf20Sopenharmony_ci#define SO_NO_CHECK	11
508c2ecf20Sopenharmony_ci#define SO_PRIORITY	12
518c2ecf20Sopenharmony_ci#define SO_BSDCOMPAT	14
528c2ecf20Sopenharmony_ci
538c2ecf20Sopenharmony_ci#define SO_PASSCRED	17
548c2ecf20Sopenharmony_ci#define SO_PEERCRED	18
558c2ecf20Sopenharmony_ci
568c2ecf20Sopenharmony_ci/* Security levels - as per NRL IPv6 - don't actually do anything */
578c2ecf20Sopenharmony_ci#define SO_SECURITY_AUTHENTICATION		22
588c2ecf20Sopenharmony_ci#define SO_SECURITY_ENCRYPTION_TRANSPORT	23
598c2ecf20Sopenharmony_ci#define SO_SECURITY_ENCRYPTION_NETWORK		24
608c2ecf20Sopenharmony_ci
618c2ecf20Sopenharmony_ci#define SO_BINDTODEVICE		25
628c2ecf20Sopenharmony_ci
638c2ecf20Sopenharmony_ci/* Socket filtering */
648c2ecf20Sopenharmony_ci#define SO_ATTACH_FILTER	26
658c2ecf20Sopenharmony_ci#define SO_DETACH_FILTER	27
668c2ecf20Sopenharmony_ci#define SO_GET_FILTER		SO_ATTACH_FILTER
678c2ecf20Sopenharmony_ci
688c2ecf20Sopenharmony_ci#define SO_PEERNAME		28
698c2ecf20Sopenharmony_ci
708c2ecf20Sopenharmony_ci#define SO_PEERSEC		30
718c2ecf20Sopenharmony_ci#define SO_SNDBUFFORCE		31
728c2ecf20Sopenharmony_ci#define SO_RCVBUFFORCE		33
738c2ecf20Sopenharmony_ci#define SO_PASSSEC		34
748c2ecf20Sopenharmony_ci
758c2ecf20Sopenharmony_ci#define SO_MARK			36
768c2ecf20Sopenharmony_ci
778c2ecf20Sopenharmony_ci#define SO_RXQ_OVFL		40
788c2ecf20Sopenharmony_ci
798c2ecf20Sopenharmony_ci#define SO_WIFI_STATUS		41
808c2ecf20Sopenharmony_ci#define SCM_WIFI_STATUS		SO_WIFI_STATUS
818c2ecf20Sopenharmony_ci#define SO_PEEK_OFF		42
828c2ecf20Sopenharmony_ci
838c2ecf20Sopenharmony_ci/* Instruct lower device to use last 4-bytes of skb data as FCS */
848c2ecf20Sopenharmony_ci#define SO_NOFCS		43
858c2ecf20Sopenharmony_ci
868c2ecf20Sopenharmony_ci#define SO_LOCK_FILTER		44
878c2ecf20Sopenharmony_ci
888c2ecf20Sopenharmony_ci#define SO_SELECT_ERR_QUEUE	45
898c2ecf20Sopenharmony_ci
908c2ecf20Sopenharmony_ci#define SO_BUSY_POLL		46
918c2ecf20Sopenharmony_ci
928c2ecf20Sopenharmony_ci#define SO_MAX_PACING_RATE	47
938c2ecf20Sopenharmony_ci
948c2ecf20Sopenharmony_ci#define SO_BPF_EXTENSIONS	48
958c2ecf20Sopenharmony_ci
968c2ecf20Sopenharmony_ci#define SO_INCOMING_CPU		49
978c2ecf20Sopenharmony_ci
988c2ecf20Sopenharmony_ci#define SO_ATTACH_BPF		50
998c2ecf20Sopenharmony_ci#define SO_DETACH_BPF		SO_DETACH_FILTER
1008c2ecf20Sopenharmony_ci
1018c2ecf20Sopenharmony_ci#define SO_ATTACH_REUSEPORT_CBPF	51
1028c2ecf20Sopenharmony_ci#define SO_ATTACH_REUSEPORT_EBPF	52
1038c2ecf20Sopenharmony_ci
1048c2ecf20Sopenharmony_ci#define SO_CNX_ADVICE		53
1058c2ecf20Sopenharmony_ci
1068c2ecf20Sopenharmony_ci#define SCM_TIMESTAMPING_OPT_STATS	54
1078c2ecf20Sopenharmony_ci
1088c2ecf20Sopenharmony_ci#define SO_MEMINFO		55
1098c2ecf20Sopenharmony_ci
1108c2ecf20Sopenharmony_ci#define SO_INCOMING_NAPI_ID	56
1118c2ecf20Sopenharmony_ci
1128c2ecf20Sopenharmony_ci#define SO_COOKIE		57
1138c2ecf20Sopenharmony_ci
1148c2ecf20Sopenharmony_ci#define SCM_TIMESTAMPING_PKTINFO	58
1158c2ecf20Sopenharmony_ci
1168c2ecf20Sopenharmony_ci#define SO_PEERGROUPS		59
1178c2ecf20Sopenharmony_ci
1188c2ecf20Sopenharmony_ci#define SO_ZEROCOPY		60
1198c2ecf20Sopenharmony_ci
1208c2ecf20Sopenharmony_ci#define SO_TXTIME		61
1218c2ecf20Sopenharmony_ci#define SCM_TXTIME		SO_TXTIME
1228c2ecf20Sopenharmony_ci
1238c2ecf20Sopenharmony_ci#define SO_BINDTOIFINDEX	62
1248c2ecf20Sopenharmony_ci
1258c2ecf20Sopenharmony_ci#define SO_TIMESTAMP_OLD        29
1268c2ecf20Sopenharmony_ci#define SO_TIMESTAMPNS_OLD      35
1278c2ecf20Sopenharmony_ci#define SO_TIMESTAMPING_OLD     37
1288c2ecf20Sopenharmony_ci
1298c2ecf20Sopenharmony_ci#define SO_TIMESTAMP_NEW        63
1308c2ecf20Sopenharmony_ci#define SO_TIMESTAMPNS_NEW      64
1318c2ecf20Sopenharmony_ci#define SO_TIMESTAMPING_NEW     65
1328c2ecf20Sopenharmony_ci
1338c2ecf20Sopenharmony_ci#define SO_RCVTIMEO_NEW         66
1348c2ecf20Sopenharmony_ci#define SO_SNDTIMEO_NEW         67
1358c2ecf20Sopenharmony_ci
1368c2ecf20Sopenharmony_ci#define SO_DETACH_REUSEPORT_BPF 68
1378c2ecf20Sopenharmony_ci
1388c2ecf20Sopenharmony_ci#if !defined(__KERNEL__)
1398c2ecf20Sopenharmony_ci
1408c2ecf20Sopenharmony_ci#if __BITS_PER_LONG == 64
1418c2ecf20Sopenharmony_ci#define SO_TIMESTAMP		SO_TIMESTAMP_OLD
1428c2ecf20Sopenharmony_ci#define SO_TIMESTAMPNS		SO_TIMESTAMPNS_OLD
1438c2ecf20Sopenharmony_ci#define SO_TIMESTAMPING		SO_TIMESTAMPING_OLD
1448c2ecf20Sopenharmony_ci
1458c2ecf20Sopenharmony_ci#define SO_RCVTIMEO             SO_RCVTIMEO_OLD
1468c2ecf20Sopenharmony_ci#define SO_SNDTIMEO             SO_SNDTIMEO_OLD
1478c2ecf20Sopenharmony_ci#else
1488c2ecf20Sopenharmony_ci#define SO_TIMESTAMP (sizeof(time_t) == sizeof(__kernel_long_t) ? SO_TIMESTAMP_OLD : SO_TIMESTAMP_NEW)
1498c2ecf20Sopenharmony_ci#define SO_TIMESTAMPNS (sizeof(time_t) == sizeof(__kernel_long_t) ? SO_TIMESTAMPNS_OLD : SO_TIMESTAMPNS_NEW)
1508c2ecf20Sopenharmony_ci#define SO_TIMESTAMPING (sizeof(time_t) == sizeof(__kernel_long_t) ? SO_TIMESTAMPING_OLD : SO_TIMESTAMPING_NEW)
1518c2ecf20Sopenharmony_ci
1528c2ecf20Sopenharmony_ci#define SO_RCVTIMEO (sizeof(time_t) == sizeof(__kernel_long_t) ? SO_RCVTIMEO_OLD : SO_RCVTIMEO_NEW)
1538c2ecf20Sopenharmony_ci#define SO_SNDTIMEO (sizeof(time_t) == sizeof(__kernel_long_t) ? SO_SNDTIMEO_OLD : SO_SNDTIMEO_NEW)
1548c2ecf20Sopenharmony_ci#endif
1558c2ecf20Sopenharmony_ci
1568c2ecf20Sopenharmony_ci#define SCM_TIMESTAMP           SO_TIMESTAMP
1578c2ecf20Sopenharmony_ci#define SCM_TIMESTAMPNS         SO_TIMESTAMPNS
1588c2ecf20Sopenharmony_ci#define SCM_TIMESTAMPING        SO_TIMESTAMPING
1598c2ecf20Sopenharmony_ci
1608c2ecf20Sopenharmony_ci#endif
1618c2ecf20Sopenharmony_ci
1628c2ecf20Sopenharmony_ci#endif /* _UAPI_ASM_SOCKET_H */
163