18c2ecf20Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
28c2ecf20Sopenharmony_ci#ifndef __ASM_GENERIC_SOCKET_H
38c2ecf20Sopenharmony_ci#define __ASM_GENERIC_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	1
108c2ecf20Sopenharmony_ci
118c2ecf20Sopenharmony_ci#define SO_DEBUG	1
128c2ecf20Sopenharmony_ci#define SO_REUSEADDR	2
138c2ecf20Sopenharmony_ci#define SO_TYPE		3
148c2ecf20Sopenharmony_ci#define SO_ERROR	4
158c2ecf20Sopenharmony_ci#define SO_DONTROUTE	5
168c2ecf20Sopenharmony_ci#define SO_BROADCAST	6
178c2ecf20Sopenharmony_ci#define SO_SNDBUF	7
188c2ecf20Sopenharmony_ci#define SO_RCVBUF	8
198c2ecf20Sopenharmony_ci#define SO_SNDBUFFORCE	32
208c2ecf20Sopenharmony_ci#define SO_RCVBUFFORCE	33
218c2ecf20Sopenharmony_ci#define SO_KEEPALIVE	9
228c2ecf20Sopenharmony_ci#define SO_OOBINLINE	10
238c2ecf20Sopenharmony_ci#define SO_NO_CHECK	11
248c2ecf20Sopenharmony_ci#define SO_PRIORITY	12
258c2ecf20Sopenharmony_ci#define SO_LINGER	13
268c2ecf20Sopenharmony_ci#define SO_BSDCOMPAT	14
278c2ecf20Sopenharmony_ci#define SO_REUSEPORT	15
288c2ecf20Sopenharmony_ci#ifndef SO_PASSCRED /* powerpc only differs in these */
298c2ecf20Sopenharmony_ci#define SO_PASSCRED	16
308c2ecf20Sopenharmony_ci#define SO_PEERCRED	17
318c2ecf20Sopenharmony_ci#define SO_RCVLOWAT	18
328c2ecf20Sopenharmony_ci#define SO_SNDLOWAT	19
338c2ecf20Sopenharmony_ci#define SO_RCVTIMEO_OLD	20
348c2ecf20Sopenharmony_ci#define SO_SNDTIMEO_OLD	21
358c2ecf20Sopenharmony_ci#endif
368c2ecf20Sopenharmony_ci
378c2ecf20Sopenharmony_ci/* Security levels - as per NRL IPv6 - don't actually do anything */
388c2ecf20Sopenharmony_ci#define SO_SECURITY_AUTHENTICATION		22
398c2ecf20Sopenharmony_ci#define SO_SECURITY_ENCRYPTION_TRANSPORT	23
408c2ecf20Sopenharmony_ci#define SO_SECURITY_ENCRYPTION_NETWORK		24
418c2ecf20Sopenharmony_ci
428c2ecf20Sopenharmony_ci#define SO_BINDTODEVICE	25
438c2ecf20Sopenharmony_ci
448c2ecf20Sopenharmony_ci/* Socket filtering */
458c2ecf20Sopenharmony_ci#define SO_ATTACH_FILTER	26
468c2ecf20Sopenharmony_ci#define SO_DETACH_FILTER	27
478c2ecf20Sopenharmony_ci#define SO_GET_FILTER		SO_ATTACH_FILTER
488c2ecf20Sopenharmony_ci
498c2ecf20Sopenharmony_ci#define SO_PEERNAME		28
508c2ecf20Sopenharmony_ci
518c2ecf20Sopenharmony_ci#define SO_ACCEPTCONN		30
528c2ecf20Sopenharmony_ci
538c2ecf20Sopenharmony_ci#define SO_PEERSEC		31
548c2ecf20Sopenharmony_ci#define SO_PASSSEC		34
558c2ecf20Sopenharmony_ci
568c2ecf20Sopenharmony_ci#define SO_MARK			36
578c2ecf20Sopenharmony_ci
588c2ecf20Sopenharmony_ci#define SO_PROTOCOL		38
598c2ecf20Sopenharmony_ci#define SO_DOMAIN		39
608c2ecf20Sopenharmony_ci
618c2ecf20Sopenharmony_ci#define SO_RXQ_OVFL             40
628c2ecf20Sopenharmony_ci
638c2ecf20Sopenharmony_ci#define SO_WIFI_STATUS		41
648c2ecf20Sopenharmony_ci#define SCM_WIFI_STATUS	SO_WIFI_STATUS
658c2ecf20Sopenharmony_ci#define SO_PEEK_OFF		42
668c2ecf20Sopenharmony_ci
678c2ecf20Sopenharmony_ci/* Instruct lower device to use last 4-bytes of skb data as FCS */
688c2ecf20Sopenharmony_ci#define SO_NOFCS		43
698c2ecf20Sopenharmony_ci
708c2ecf20Sopenharmony_ci#define SO_LOCK_FILTER		44
718c2ecf20Sopenharmony_ci
728c2ecf20Sopenharmony_ci#define SO_SELECT_ERR_QUEUE	45
738c2ecf20Sopenharmony_ci
748c2ecf20Sopenharmony_ci#define SO_BUSY_POLL		46
758c2ecf20Sopenharmony_ci
768c2ecf20Sopenharmony_ci#define SO_MAX_PACING_RATE	47
778c2ecf20Sopenharmony_ci
788c2ecf20Sopenharmony_ci#define SO_BPF_EXTENSIONS	48
798c2ecf20Sopenharmony_ci
808c2ecf20Sopenharmony_ci#define SO_INCOMING_CPU		49
818c2ecf20Sopenharmony_ci
828c2ecf20Sopenharmony_ci#define SO_ATTACH_BPF		50
838c2ecf20Sopenharmony_ci#define SO_DETACH_BPF		SO_DETACH_FILTER
848c2ecf20Sopenharmony_ci
858c2ecf20Sopenharmony_ci#define SO_ATTACH_REUSEPORT_CBPF	51
868c2ecf20Sopenharmony_ci#define SO_ATTACH_REUSEPORT_EBPF	52
878c2ecf20Sopenharmony_ci
888c2ecf20Sopenharmony_ci#define SO_CNX_ADVICE		53
898c2ecf20Sopenharmony_ci
908c2ecf20Sopenharmony_ci#define SCM_TIMESTAMPING_OPT_STATS	54
918c2ecf20Sopenharmony_ci
928c2ecf20Sopenharmony_ci#define SO_MEMINFO		55
938c2ecf20Sopenharmony_ci
948c2ecf20Sopenharmony_ci#define SO_INCOMING_NAPI_ID	56
958c2ecf20Sopenharmony_ci
968c2ecf20Sopenharmony_ci#define SO_COOKIE		57
978c2ecf20Sopenharmony_ci
988c2ecf20Sopenharmony_ci#define SCM_TIMESTAMPING_PKTINFO	58
998c2ecf20Sopenharmony_ci
1008c2ecf20Sopenharmony_ci#define SO_PEERGROUPS		59
1018c2ecf20Sopenharmony_ci
1028c2ecf20Sopenharmony_ci#define SO_ZEROCOPY		60
1038c2ecf20Sopenharmony_ci
1048c2ecf20Sopenharmony_ci#define SO_TXTIME		61
1058c2ecf20Sopenharmony_ci#define SCM_TXTIME		SO_TXTIME
1068c2ecf20Sopenharmony_ci
1078c2ecf20Sopenharmony_ci#define SO_BINDTOIFINDEX	62
1088c2ecf20Sopenharmony_ci
1098c2ecf20Sopenharmony_ci#define SO_TIMESTAMP_OLD        29
1108c2ecf20Sopenharmony_ci#define SO_TIMESTAMPNS_OLD      35
1118c2ecf20Sopenharmony_ci#define SO_TIMESTAMPING_OLD     37
1128c2ecf20Sopenharmony_ci
1138c2ecf20Sopenharmony_ci#define SO_TIMESTAMP_NEW        63
1148c2ecf20Sopenharmony_ci#define SO_TIMESTAMPNS_NEW      64
1158c2ecf20Sopenharmony_ci#define SO_TIMESTAMPING_NEW     65
1168c2ecf20Sopenharmony_ci
1178c2ecf20Sopenharmony_ci#define SO_RCVTIMEO_NEW         66
1188c2ecf20Sopenharmony_ci#define SO_SNDTIMEO_NEW         67
1198c2ecf20Sopenharmony_ci
1208c2ecf20Sopenharmony_ci#define SO_DETACH_REUSEPORT_BPF 68
1218c2ecf20Sopenharmony_ci
1228c2ecf20Sopenharmony_ci#if !defined(__KERNEL__)
1238c2ecf20Sopenharmony_ci
1248c2ecf20Sopenharmony_ci#if __BITS_PER_LONG == 64 || (defined(__x86_64__) && defined(__ILP32__))
1258c2ecf20Sopenharmony_ci/* on 64-bit and x32, avoid the ?: operator */
1268c2ecf20Sopenharmony_ci#define SO_TIMESTAMP		SO_TIMESTAMP_OLD
1278c2ecf20Sopenharmony_ci#define SO_TIMESTAMPNS		SO_TIMESTAMPNS_OLD
1288c2ecf20Sopenharmony_ci#define SO_TIMESTAMPING		SO_TIMESTAMPING_OLD
1298c2ecf20Sopenharmony_ci
1308c2ecf20Sopenharmony_ci#define SO_RCVTIMEO		SO_RCVTIMEO_OLD
1318c2ecf20Sopenharmony_ci#define SO_SNDTIMEO		SO_SNDTIMEO_OLD
1328c2ecf20Sopenharmony_ci#else
1338c2ecf20Sopenharmony_ci#define SO_TIMESTAMP (sizeof(time_t) == sizeof(__kernel_long_t) ? SO_TIMESTAMP_OLD : SO_TIMESTAMP_NEW)
1348c2ecf20Sopenharmony_ci#define SO_TIMESTAMPNS (sizeof(time_t) == sizeof(__kernel_long_t) ? SO_TIMESTAMPNS_OLD : SO_TIMESTAMPNS_NEW)
1358c2ecf20Sopenharmony_ci#define SO_TIMESTAMPING (sizeof(time_t) == sizeof(__kernel_long_t) ? SO_TIMESTAMPING_OLD : SO_TIMESTAMPING_NEW)
1368c2ecf20Sopenharmony_ci
1378c2ecf20Sopenharmony_ci#define SO_RCVTIMEO (sizeof(time_t) == sizeof(__kernel_long_t) ? SO_RCVTIMEO_OLD : SO_RCVTIMEO_NEW)
1388c2ecf20Sopenharmony_ci#define SO_SNDTIMEO (sizeof(time_t) == sizeof(__kernel_long_t) ? SO_SNDTIMEO_OLD : SO_SNDTIMEO_NEW)
1398c2ecf20Sopenharmony_ci#endif
1408c2ecf20Sopenharmony_ci
1418c2ecf20Sopenharmony_ci#define SCM_TIMESTAMP           SO_TIMESTAMP
1428c2ecf20Sopenharmony_ci#define SCM_TIMESTAMPNS         SO_TIMESTAMPNS
1438c2ecf20Sopenharmony_ci#define SCM_TIMESTAMPING        SO_TIMESTAMPING
1448c2ecf20Sopenharmony_ci
1458c2ecf20Sopenharmony_ci#endif
1468c2ecf20Sopenharmony_ci
1478c2ecf20Sopenharmony_ci#endif /* __ASM_GENERIC_SOCKET_H */
148