18c2ecf20Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */ 28c2ecf20Sopenharmony_ci#ifndef _UAPI_ASM_SOCKET_H 38c2ecf20Sopenharmony_ci#define _UAPI_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_REUSEADDR 0x0004 138c2ecf20Sopenharmony_ci#define SO_KEEPALIVE 0x0008 148c2ecf20Sopenharmony_ci#define SO_DONTROUTE 0x0010 158c2ecf20Sopenharmony_ci#define SO_BROADCAST 0x0020 168c2ecf20Sopenharmony_ci#define SO_LINGER 0x0080 178c2ecf20Sopenharmony_ci#define SO_OOBINLINE 0x0100 188c2ecf20Sopenharmony_ci#define SO_REUSEPORT 0x0200 198c2ecf20Sopenharmony_ci#define SO_SNDBUF 0x1001 208c2ecf20Sopenharmony_ci#define SO_RCVBUF 0x1002 218c2ecf20Sopenharmony_ci#define SO_SNDBUFFORCE 0x100a 228c2ecf20Sopenharmony_ci#define SO_RCVBUFFORCE 0x100b 238c2ecf20Sopenharmony_ci#define SO_SNDLOWAT 0x1003 248c2ecf20Sopenharmony_ci#define SO_RCVLOWAT 0x1004 258c2ecf20Sopenharmony_ci#define SO_SNDTIMEO_OLD 0x1005 268c2ecf20Sopenharmony_ci#define SO_RCVTIMEO_OLD 0x1006 278c2ecf20Sopenharmony_ci#define SO_ERROR 0x1007 288c2ecf20Sopenharmony_ci#define SO_TYPE 0x1008 298c2ecf20Sopenharmony_ci#define SO_PROTOCOL 0x1028 308c2ecf20Sopenharmony_ci#define SO_DOMAIN 0x1029 318c2ecf20Sopenharmony_ci#define SO_PEERNAME 0x2000 328c2ecf20Sopenharmony_ci 338c2ecf20Sopenharmony_ci#define SO_NO_CHECK 0x400b 348c2ecf20Sopenharmony_ci#define SO_PRIORITY 0x400c 358c2ecf20Sopenharmony_ci#define SO_BSDCOMPAT 0x400e 368c2ecf20Sopenharmony_ci#define SO_PASSCRED 0x4010 378c2ecf20Sopenharmony_ci#define SO_PEERCRED 0x4011 388c2ecf20Sopenharmony_ci 398c2ecf20Sopenharmony_ci/* Security levels - as per NRL IPv6 - don't actually do anything */ 408c2ecf20Sopenharmony_ci#define SO_SECURITY_AUTHENTICATION 0x4016 418c2ecf20Sopenharmony_ci#define SO_SECURITY_ENCRYPTION_TRANSPORT 0x4017 428c2ecf20Sopenharmony_ci#define SO_SECURITY_ENCRYPTION_NETWORK 0x4018 438c2ecf20Sopenharmony_ci 448c2ecf20Sopenharmony_ci#define SO_BINDTODEVICE 0x4019 458c2ecf20Sopenharmony_ci 468c2ecf20Sopenharmony_ci/* Socket filtering */ 478c2ecf20Sopenharmony_ci#define SO_ATTACH_FILTER 0x401a 488c2ecf20Sopenharmony_ci#define SO_DETACH_FILTER 0x401b 498c2ecf20Sopenharmony_ci#define SO_GET_FILTER SO_ATTACH_FILTER 508c2ecf20Sopenharmony_ci 518c2ecf20Sopenharmony_ci#define SO_ACCEPTCONN 0x401c 528c2ecf20Sopenharmony_ci 538c2ecf20Sopenharmony_ci#define SO_PEERSEC 0x401d 548c2ecf20Sopenharmony_ci#define SO_PASSSEC 0x401e 558c2ecf20Sopenharmony_ci 568c2ecf20Sopenharmony_ci#define SO_MARK 0x401f 578c2ecf20Sopenharmony_ci 588c2ecf20Sopenharmony_ci#define SO_RXQ_OVFL 0x4021 598c2ecf20Sopenharmony_ci 608c2ecf20Sopenharmony_ci#define SO_WIFI_STATUS 0x4022 618c2ecf20Sopenharmony_ci#define SCM_WIFI_STATUS SO_WIFI_STATUS 628c2ecf20Sopenharmony_ci#define SO_PEEK_OFF 0x4023 638c2ecf20Sopenharmony_ci 648c2ecf20Sopenharmony_ci/* Instruct lower device to use last 4-bytes of skb data as FCS */ 658c2ecf20Sopenharmony_ci#define SO_NOFCS 0x4024 668c2ecf20Sopenharmony_ci 678c2ecf20Sopenharmony_ci#define SO_LOCK_FILTER 0x4025 688c2ecf20Sopenharmony_ci 698c2ecf20Sopenharmony_ci#define SO_SELECT_ERR_QUEUE 0x4026 708c2ecf20Sopenharmony_ci 718c2ecf20Sopenharmony_ci#define SO_BUSY_POLL 0x4027 728c2ecf20Sopenharmony_ci 738c2ecf20Sopenharmony_ci#define SO_MAX_PACING_RATE 0x4028 748c2ecf20Sopenharmony_ci 758c2ecf20Sopenharmony_ci#define SO_BPF_EXTENSIONS 0x4029 768c2ecf20Sopenharmony_ci 778c2ecf20Sopenharmony_ci#define SO_INCOMING_CPU 0x402A 788c2ecf20Sopenharmony_ci 798c2ecf20Sopenharmony_ci#define SO_ATTACH_BPF 0x402B 808c2ecf20Sopenharmony_ci#define SO_DETACH_BPF SO_DETACH_FILTER 818c2ecf20Sopenharmony_ci 828c2ecf20Sopenharmony_ci#define SO_ATTACH_REUSEPORT_CBPF 0x402C 838c2ecf20Sopenharmony_ci#define SO_ATTACH_REUSEPORT_EBPF 0x402D 848c2ecf20Sopenharmony_ci 858c2ecf20Sopenharmony_ci#define SO_CNX_ADVICE 0x402E 868c2ecf20Sopenharmony_ci 878c2ecf20Sopenharmony_ci#define SCM_TIMESTAMPING_OPT_STATS 0x402F 888c2ecf20Sopenharmony_ci 898c2ecf20Sopenharmony_ci#define SO_MEMINFO 0x4030 908c2ecf20Sopenharmony_ci 918c2ecf20Sopenharmony_ci#define SO_INCOMING_NAPI_ID 0x4031 928c2ecf20Sopenharmony_ci 938c2ecf20Sopenharmony_ci#define SO_COOKIE 0x4032 948c2ecf20Sopenharmony_ci 958c2ecf20Sopenharmony_ci#define SCM_TIMESTAMPING_PKTINFO 0x4033 968c2ecf20Sopenharmony_ci 978c2ecf20Sopenharmony_ci#define SO_PEERGROUPS 0x4034 988c2ecf20Sopenharmony_ci 998c2ecf20Sopenharmony_ci#define SO_ZEROCOPY 0x4035 1008c2ecf20Sopenharmony_ci 1018c2ecf20Sopenharmony_ci#define SO_TXTIME 0x4036 1028c2ecf20Sopenharmony_ci#define SCM_TXTIME SO_TXTIME 1038c2ecf20Sopenharmony_ci 1048c2ecf20Sopenharmony_ci#define SO_BINDTOIFINDEX 0x4037 1058c2ecf20Sopenharmony_ci 1068c2ecf20Sopenharmony_ci#define SO_TIMESTAMP_OLD 0x4012 1078c2ecf20Sopenharmony_ci#define SO_TIMESTAMPNS_OLD 0x4013 1088c2ecf20Sopenharmony_ci#define SO_TIMESTAMPING_OLD 0x4020 1098c2ecf20Sopenharmony_ci 1108c2ecf20Sopenharmony_ci#define SO_TIMESTAMP_NEW 0x4038 1118c2ecf20Sopenharmony_ci#define SO_TIMESTAMPNS_NEW 0x4039 1128c2ecf20Sopenharmony_ci#define SO_TIMESTAMPING_NEW 0x403A 1138c2ecf20Sopenharmony_ci 1148c2ecf20Sopenharmony_ci#define SO_RCVTIMEO_NEW 0x4040 1158c2ecf20Sopenharmony_ci#define SO_SNDTIMEO_NEW 0x4041 1168c2ecf20Sopenharmony_ci 1178c2ecf20Sopenharmony_ci#define SO_DETACH_REUSEPORT_BPF 0x4042 1188c2ecf20Sopenharmony_ci 1198c2ecf20Sopenharmony_ci#if !defined(__KERNEL__) 1208c2ecf20Sopenharmony_ci 1218c2ecf20Sopenharmony_ci#if __BITS_PER_LONG == 64 1228c2ecf20Sopenharmony_ci#define SO_TIMESTAMP SO_TIMESTAMP_OLD 1238c2ecf20Sopenharmony_ci#define SO_TIMESTAMPNS SO_TIMESTAMPNS_OLD 1248c2ecf20Sopenharmony_ci#define SO_TIMESTAMPING SO_TIMESTAMPING_OLD 1258c2ecf20Sopenharmony_ci#define SO_RCVTIMEO SO_RCVTIMEO_OLD 1268c2ecf20Sopenharmony_ci#define SO_SNDTIMEO SO_SNDTIMEO_OLD 1278c2ecf20Sopenharmony_ci#else 1288c2ecf20Sopenharmony_ci#define SO_TIMESTAMP (sizeof(time_t) == sizeof(__kernel_long_t) ? SO_TIMESTAMP_OLD : SO_TIMESTAMP_NEW) 1298c2ecf20Sopenharmony_ci#define SO_TIMESTAMPNS (sizeof(time_t) == sizeof(__kernel_long_t) ? SO_TIMESTAMPNS_OLD : SO_TIMESTAMPNS_NEW) 1308c2ecf20Sopenharmony_ci#define SO_TIMESTAMPING (sizeof(time_t) == sizeof(__kernel_long_t) ? SO_TIMESTAMPING_OLD : SO_TIMESTAMPING_NEW) 1318c2ecf20Sopenharmony_ci 1328c2ecf20Sopenharmony_ci#define SO_RCVTIMEO (sizeof(time_t) == sizeof(__kernel_long_t) ? SO_RCVTIMEO_OLD : SO_RCVTIMEO_NEW) 1338c2ecf20Sopenharmony_ci#define SO_SNDTIMEO (sizeof(time_t) == sizeof(__kernel_long_t) ? SO_SNDTIMEO_OLD : SO_SNDTIMEO_NEW) 1348c2ecf20Sopenharmony_ci#endif 1358c2ecf20Sopenharmony_ci 1368c2ecf20Sopenharmony_ci#define SCM_TIMESTAMP SO_TIMESTAMP 1378c2ecf20Sopenharmony_ci#define SCM_TIMESTAMPNS SO_TIMESTAMPNS 1388c2ecf20Sopenharmony_ci#define SCM_TIMESTAMPING SO_TIMESTAMPING 1398c2ecf20Sopenharmony_ci 1408c2ecf20Sopenharmony_ci#endif 1418c2ecf20Sopenharmony_ci 1428c2ecf20Sopenharmony_ci#endif /* _UAPI_ASM_SOCKET_H */ 143