1 /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */ 2 #ifndef _UAPI_ASM_SOCKET_H 3 #define _UAPI_ASM_SOCKET_H 4 5 #include <linux/posix_types.h> 6 #include <asm/sockios.h> 7 8 /* For setsockopt(2) */ 9 /* 10 * Note: we only bother about making the SOL_SOCKET options 11 * same as OSF/1, as that's all that "normal" programs are 12 * likely to set. We don't necessarily want to be binary 13 * compatible with _everything_. 14 */ 15 #define SOL_SOCKET 0xffff 16 17 #define SO_DEBUG 0x0001 18 #define SO_REUSEADDR 0x0004 19 #define SO_KEEPALIVE 0x0008 20 #define SO_DONTROUTE 0x0010 21 #define SO_BROADCAST 0x0020 22 #define SO_LINGER 0x0080 23 #define SO_OOBINLINE 0x0100 24 #define SO_REUSEPORT 0x0200 25 26 #define SO_TYPE 0x1008 27 #define SO_ERROR 0x1007 28 #define SO_SNDBUF 0x1001 29 #define SO_RCVBUF 0x1002 30 #define SO_SNDBUFFORCE 0x100a 31 #define SO_RCVBUFFORCE 0x100b 32 #define SO_RCVLOWAT 0x1010 33 #define SO_SNDLOWAT 0x1011 34 #define SO_RCVTIMEO_OLD 0x1012 35 #define SO_SNDTIMEO_OLD 0x1013 36 #define SO_ACCEPTCONN 0x1014 37 #define SO_PROTOCOL 0x1028 38 #define SO_DOMAIN 0x1029 39 40 /* linux-specific, might as well be the same as on i386 */ 41 #define SO_NO_CHECK 11 42 #define SO_PRIORITY 12 43 #define SO_BSDCOMPAT 14 44 45 #define SO_PASSCRED 17 46 #define SO_PEERCRED 18 47 #define SO_BINDTODEVICE 25 48 49 /* Socket filtering */ 50 #define SO_ATTACH_FILTER 26 51 #define SO_DETACH_FILTER 27 52 #define SO_GET_FILTER SO_ATTACH_FILTER 53 54 #define SO_PEERNAME 28 55 56 #define SO_PEERSEC 30 57 #define SO_PASSSEC 34 58 59 /* Security levels - as per NRL IPv6 - don't actually do anything */ 60 #define SO_SECURITY_AUTHENTICATION 19 61 #define SO_SECURITY_ENCRYPTION_TRANSPORT 20 62 #define SO_SECURITY_ENCRYPTION_NETWORK 21 63 64 #define SO_MARK 36 65 66 #define SO_RXQ_OVFL 40 67 68 #define SO_WIFI_STATUS 41 69 #define SCM_WIFI_STATUS SO_WIFI_STATUS 70 #define SO_PEEK_OFF 42 71 72 /* Instruct lower device to use last 4-bytes of skb data as FCS */ 73 #define SO_NOFCS 43 74 75 #define SO_LOCK_FILTER 44 76 77 #define SO_SELECT_ERR_QUEUE 45 78 79 #define SO_BUSY_POLL 46 80 81 #define SO_MAX_PACING_RATE 47 82 83 #define SO_BPF_EXTENSIONS 48 84 85 #define SO_INCOMING_CPU 49 86 87 #define SO_ATTACH_BPF 50 88 #define SO_DETACH_BPF SO_DETACH_FILTER 89 90 #define SO_ATTACH_REUSEPORT_CBPF 51 91 #define SO_ATTACH_REUSEPORT_EBPF 52 92 93 #define SO_CNX_ADVICE 53 94 95 #define SCM_TIMESTAMPING_OPT_STATS 54 96 97 #define SO_MEMINFO 55 98 99 #define SO_INCOMING_NAPI_ID 56 100 101 #define SO_COOKIE 57 102 103 #define SCM_TIMESTAMPING_PKTINFO 58 104 105 #define SO_PEERGROUPS 59 106 107 #define SO_ZEROCOPY 60 108 109 #define SO_TXTIME 61 110 #define SCM_TXTIME SO_TXTIME 111 112 #define SO_BINDTOIFINDEX 62 113 114 #define SO_TIMESTAMP_OLD 29 115 #define SO_TIMESTAMPNS_OLD 35 116 #define SO_TIMESTAMPING_OLD 37 117 118 #define SO_TIMESTAMP_NEW 63 119 #define SO_TIMESTAMPNS_NEW 64 120 #define SO_TIMESTAMPING_NEW 65 121 122 #define SO_RCVTIMEO_NEW 66 123 #define SO_SNDTIMEO_NEW 67 124 125 #define SO_DETACH_REUSEPORT_BPF 68 126 127 #define SO_PREFER_BUSY_POLL 69 128 #define SO_BUSY_POLL_BUDGET 70 129 130 #define SO_NETNS_COOKIE 71 131 132 #define SO_BUF_LOCK 72 133 134 #define SO_RESERVE_MEM 73 135 136 #define SO_TXREHASH 74 137 138 #define SO_RCVMARK 75 139 140 #if !defined(__KERNEL__) 141 142 #if __BITS_PER_LONG == 64 143 #define SO_TIMESTAMP SO_TIMESTAMP_OLD 144 #define SO_TIMESTAMPNS SO_TIMESTAMPNS_OLD 145 #define SO_TIMESTAMPING SO_TIMESTAMPING_OLD 146 147 #define SO_RCVTIMEO SO_RCVTIMEO_OLD 148 #define SO_SNDTIMEO SO_SNDTIMEO_OLD 149 #else 150 #define SO_TIMESTAMP (sizeof(time_t) == sizeof(__kernel_long_t) ? SO_TIMESTAMP_OLD : SO_TIMESTAMP_NEW) 151 #define SO_TIMESTAMPNS (sizeof(time_t) == sizeof(__kernel_long_t) ? SO_TIMESTAMPNS_OLD : SO_TIMESTAMPNS_NEW) 152 #define SO_TIMESTAMPING (sizeof(time_t) == sizeof(__kernel_long_t) ? SO_TIMESTAMPING_OLD : SO_TIMESTAMPING_NEW) 153 154 #define SO_RCVTIMEO (sizeof(time_t) == sizeof(__kernel_long_t) ? SO_RCVTIMEO_OLD : SO_RCVTIMEO_NEW) 155 #define SO_SNDTIMEO (sizeof(time_t) == sizeof(__kernel_long_t) ? SO_SNDTIMEO_OLD : SO_SNDTIMEO_NEW) 156 #endif 157 158 #define SCM_TIMESTAMP SO_TIMESTAMP 159 #define SCM_TIMESTAMPNS SO_TIMESTAMPNS 160 #define SCM_TIMESTAMPING SO_TIMESTAMPING 161 162 #endif 163 164 #endif /* _UAPI_ASM_SOCKET_H */ 165