18c2ecf20Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
28c2ecf20Sopenharmony_ci#ifndef _ASM_SOCKET_H
38c2ecf20Sopenharmony_ci#define _ASM_SOCKET_H
48c2ecf20Sopenharmony_ci
58c2ecf20Sopenharmony_ci#include <linux/posix_types.h>
68c2ecf20Sopenharmony_ci#include <asm/sockios.h>
78c2ecf20Sopenharmony_ci
88c2ecf20Sopenharmony_ci/* For setsockopt(2) */
98c2ecf20Sopenharmony_ci#define SOL_SOCKET	0xffff
108c2ecf20Sopenharmony_ci
118c2ecf20Sopenharmony_ci#define SO_DEBUG	0x0001
128c2ecf20Sopenharmony_ci#define SO_PASSCRED	0x0002
138c2ecf20Sopenharmony_ci#define SO_REUSEADDR	0x0004
148c2ecf20Sopenharmony_ci#define SO_KEEPALIVE	0x0008
158c2ecf20Sopenharmony_ci#define SO_DONTROUTE	0x0010
168c2ecf20Sopenharmony_ci#define SO_BROADCAST	0x0020
178c2ecf20Sopenharmony_ci#define SO_PEERCRED	0x0040
188c2ecf20Sopenharmony_ci#define SO_LINGER	0x0080
198c2ecf20Sopenharmony_ci#define SO_OOBINLINE	0x0100
208c2ecf20Sopenharmony_ci#define SO_REUSEPORT	0x0200
218c2ecf20Sopenharmony_ci#define SO_BSDCOMPAT    0x0400
228c2ecf20Sopenharmony_ci#define SO_RCVLOWAT     0x0800
238c2ecf20Sopenharmony_ci#define SO_SNDLOWAT     0x1000
248c2ecf20Sopenharmony_ci#define SO_RCVTIMEO_OLD     0x2000
258c2ecf20Sopenharmony_ci#define SO_SNDTIMEO_OLD     0x4000
268c2ecf20Sopenharmony_ci#define SO_ACCEPTCONN	0x8000
278c2ecf20Sopenharmony_ci
288c2ecf20Sopenharmony_ci#define SO_SNDBUF	0x1001
298c2ecf20Sopenharmony_ci#define SO_RCVBUF	0x1002
308c2ecf20Sopenharmony_ci#define SO_SNDBUFFORCE	0x100a
318c2ecf20Sopenharmony_ci#define SO_RCVBUFFORCE	0x100b
328c2ecf20Sopenharmony_ci#define SO_ERROR	0x1007
338c2ecf20Sopenharmony_ci#define SO_TYPE		0x1008
348c2ecf20Sopenharmony_ci#define SO_PROTOCOL	0x1028
358c2ecf20Sopenharmony_ci#define SO_DOMAIN	0x1029
368c2ecf20Sopenharmony_ci
378c2ecf20Sopenharmony_ci/* Linux specific, keep the same. */
388c2ecf20Sopenharmony_ci#define SO_NO_CHECK	0x000b
398c2ecf20Sopenharmony_ci#define SO_PRIORITY	0x000c
408c2ecf20Sopenharmony_ci
418c2ecf20Sopenharmony_ci#define SO_BINDTODEVICE 0x000d
428c2ecf20Sopenharmony_ci
438c2ecf20Sopenharmony_ci#define SO_ATTACH_FILTER	0x001a
448c2ecf20Sopenharmony_ci#define SO_DETACH_FILTER        0x001b
458c2ecf20Sopenharmony_ci#define SO_GET_FILTER		SO_ATTACH_FILTER
468c2ecf20Sopenharmony_ci
478c2ecf20Sopenharmony_ci#define SO_PEERNAME		0x001c
488c2ecf20Sopenharmony_ci
498c2ecf20Sopenharmony_ci#define SO_PEERSEC		0x001e
508c2ecf20Sopenharmony_ci#define SO_PASSSEC		0x001f
518c2ecf20Sopenharmony_ci
528c2ecf20Sopenharmony_ci#define SO_MARK			0x0022
538c2ecf20Sopenharmony_ci
548c2ecf20Sopenharmony_ci#define SO_RXQ_OVFL             0x0024
558c2ecf20Sopenharmony_ci
568c2ecf20Sopenharmony_ci#define SO_WIFI_STATUS		0x0025
578c2ecf20Sopenharmony_ci#define SCM_WIFI_STATUS		SO_WIFI_STATUS
588c2ecf20Sopenharmony_ci#define SO_PEEK_OFF		0x0026
598c2ecf20Sopenharmony_ci
608c2ecf20Sopenharmony_ci/* Instruct lower device to use last 4-bytes of skb data as FCS */
618c2ecf20Sopenharmony_ci#define SO_NOFCS		0x0027
628c2ecf20Sopenharmony_ci
638c2ecf20Sopenharmony_ci#define SO_LOCK_FILTER		0x0028
648c2ecf20Sopenharmony_ci
658c2ecf20Sopenharmony_ci#define SO_SELECT_ERR_QUEUE	0x0029
668c2ecf20Sopenharmony_ci
678c2ecf20Sopenharmony_ci#define SO_BUSY_POLL		0x0030
688c2ecf20Sopenharmony_ci
698c2ecf20Sopenharmony_ci#define SO_MAX_PACING_RATE	0x0031
708c2ecf20Sopenharmony_ci
718c2ecf20Sopenharmony_ci#define SO_BPF_EXTENSIONS	0x0032
728c2ecf20Sopenharmony_ci
738c2ecf20Sopenharmony_ci#define SO_INCOMING_CPU		0x0033
748c2ecf20Sopenharmony_ci
758c2ecf20Sopenharmony_ci#define SO_ATTACH_BPF		0x0034
768c2ecf20Sopenharmony_ci#define SO_DETACH_BPF		SO_DETACH_FILTER
778c2ecf20Sopenharmony_ci
788c2ecf20Sopenharmony_ci#define SO_ATTACH_REUSEPORT_CBPF	0x0035
798c2ecf20Sopenharmony_ci#define SO_ATTACH_REUSEPORT_EBPF	0x0036
808c2ecf20Sopenharmony_ci
818c2ecf20Sopenharmony_ci#define SO_CNX_ADVICE		0x0037
828c2ecf20Sopenharmony_ci
838c2ecf20Sopenharmony_ci#define SCM_TIMESTAMPING_OPT_STATS	0x0038
848c2ecf20Sopenharmony_ci
858c2ecf20Sopenharmony_ci#define SO_MEMINFO		0x0039
868c2ecf20Sopenharmony_ci
878c2ecf20Sopenharmony_ci#define SO_INCOMING_NAPI_ID	0x003a
888c2ecf20Sopenharmony_ci
898c2ecf20Sopenharmony_ci#define SO_COOKIE		0x003b
908c2ecf20Sopenharmony_ci
918c2ecf20Sopenharmony_ci#define SCM_TIMESTAMPING_PKTINFO	0x003c
928c2ecf20Sopenharmony_ci
938c2ecf20Sopenharmony_ci#define SO_PEERGROUPS		0x003d
948c2ecf20Sopenharmony_ci
958c2ecf20Sopenharmony_ci#define SO_ZEROCOPY		0x003e
968c2ecf20Sopenharmony_ci
978c2ecf20Sopenharmony_ci#define SO_TXTIME		0x003f
988c2ecf20Sopenharmony_ci#define SCM_TXTIME		SO_TXTIME
998c2ecf20Sopenharmony_ci
1008c2ecf20Sopenharmony_ci#define SO_BINDTOIFINDEX	0x0041
1018c2ecf20Sopenharmony_ci
1028c2ecf20Sopenharmony_ci/* Security levels - as per NRL IPv6 - don't actually do anything */
1038c2ecf20Sopenharmony_ci#define SO_SECURITY_AUTHENTICATION		0x5001
1048c2ecf20Sopenharmony_ci#define SO_SECURITY_ENCRYPTION_TRANSPORT	0x5002
1058c2ecf20Sopenharmony_ci#define SO_SECURITY_ENCRYPTION_NETWORK		0x5004
1068c2ecf20Sopenharmony_ci
1078c2ecf20Sopenharmony_ci#define SO_TIMESTAMP_OLD         0x001d
1088c2ecf20Sopenharmony_ci#define SO_TIMESTAMPNS_OLD       0x0021
1098c2ecf20Sopenharmony_ci#define SO_TIMESTAMPING_OLD      0x0023
1108c2ecf20Sopenharmony_ci
1118c2ecf20Sopenharmony_ci#define SO_TIMESTAMP_NEW         0x0046
1128c2ecf20Sopenharmony_ci#define SO_TIMESTAMPNS_NEW       0x0042
1138c2ecf20Sopenharmony_ci#define SO_TIMESTAMPING_NEW      0x0043
1148c2ecf20Sopenharmony_ci
1158c2ecf20Sopenharmony_ci#define SO_RCVTIMEO_NEW          0x0044
1168c2ecf20Sopenharmony_ci#define SO_SNDTIMEO_NEW          0x0045
1178c2ecf20Sopenharmony_ci
1188c2ecf20Sopenharmony_ci#define SO_DETACH_REUSEPORT_BPF  0x0047
1198c2ecf20Sopenharmony_ci
1208c2ecf20Sopenharmony_ci#if !defined(__KERNEL__)
1218c2ecf20Sopenharmony_ci
1228c2ecf20Sopenharmony_ci
1238c2ecf20Sopenharmony_ci#if __BITS_PER_LONG == 64
1248c2ecf20Sopenharmony_ci#define SO_TIMESTAMP		SO_TIMESTAMP_OLD
1258c2ecf20Sopenharmony_ci#define SO_TIMESTAMPNS		SO_TIMESTAMPNS_OLD
1268c2ecf20Sopenharmony_ci#define SO_TIMESTAMPING		SO_TIMESTAMPING_OLD
1278c2ecf20Sopenharmony_ci
1288c2ecf20Sopenharmony_ci#define SO_RCVTIMEO		SO_RCVTIMEO_OLD
1298c2ecf20Sopenharmony_ci#define SO_SNDTIMEO		SO_SNDTIMEO_OLD
1308c2ecf20Sopenharmony_ci#else
1318c2ecf20Sopenharmony_ci#define SO_TIMESTAMP (sizeof(time_t) == sizeof(__kernel_long_t) ? SO_TIMESTAMP_OLD : SO_TIMESTAMP_NEW)
1328c2ecf20Sopenharmony_ci#define SO_TIMESTAMPNS (sizeof(time_t) == sizeof(__kernel_long_t) ? SO_TIMESTAMPNS_OLD : SO_TIMESTAMPNS_NEW)
1338c2ecf20Sopenharmony_ci#define SO_TIMESTAMPING (sizeof(time_t) == sizeof(__kernel_long_t) ? SO_TIMESTAMPING_OLD : SO_TIMESTAMPING_NEW)
1348c2ecf20Sopenharmony_ci
1358c2ecf20Sopenharmony_ci#define SO_RCVTIMEO (sizeof(time_t) == sizeof(__kernel_long_t) ? SO_RCVTIMEO_OLD : SO_RCVTIMEO_NEW)
1368c2ecf20Sopenharmony_ci#define SO_SNDTIMEO (sizeof(time_t) == sizeof(__kernel_long_t) ? SO_SNDTIMEO_OLD : SO_SNDTIMEO_NEW)
1378c2ecf20Sopenharmony_ci#endif
1388c2ecf20Sopenharmony_ci
1398c2ecf20Sopenharmony_ci#define SCM_TIMESTAMP          SO_TIMESTAMP
1408c2ecf20Sopenharmony_ci#define SCM_TIMESTAMPNS        SO_TIMESTAMPNS
1418c2ecf20Sopenharmony_ci#define SCM_TIMESTAMPING       SO_TIMESTAMPING
1428c2ecf20Sopenharmony_ci
1438c2ecf20Sopenharmony_ci#endif
1448c2ecf20Sopenharmony_ci
1458c2ecf20Sopenharmony_ci#endif /* _ASM_SOCKET_H */
146