1 /* 2 * This program is free software; you can redistribute it and/or modify 3 * it under the terms of the GNU General Public License version 2 as 4 * published by the Free Software Foundation, or (at your option) any 5 * later version. See the COPYING file in the top-level directory. 6 */ 7 8 #ifndef SPARC_SOCKBITS_H 9 #define SPARC_SOCKBITS_H 10 11 /** sock_type - Socket types 12 * 13 * Please notice that for binary compat reasons SPARC has to 14 * override the enum sock_type in include/linux/net.h, so 15 * we define ARCH_HAS_SOCKET_TYPES here. 16 * 17 * @SOCK_DGRAM - datagram (conn.less) socket 18 * @SOCK_STREAM - stream (connection) socket 19 * @SOCK_RAW - raw socket 20 * @SOCK_RDM - reliably-delivered message 21 * @SOCK_SEQPACKET - sequential packet socket 22 * @SOCK_DCCP - Datagram Congestion Control Protocol socket 23 * @SOCK_PACKET - linux specific way of getting packets at the dev level. 24 * For writing rarp and other similar things on the user 25 * level. 26 * @SOCK_CLOEXEC - sets the close-on-exec (FD_CLOEXEC) flag. 27 * @SOCK_NONBLOCK - sets the O_NONBLOCK file status flag. 28 */ 29 30 #define ARCH_HAS_SOCKET_TYPES 1 31 32 enum sock_type { 33 TARGET_SOCK_STREAM = 1, 34 TARGET_SOCK_DGRAM = 2, 35 TARGET_SOCK_RAW = 3, 36 TARGET_SOCK_RDM = 4, 37 TARGET_SOCK_SEQPACKET = 5, 38 TARGET_SOCK_DCCP = 6, 39 TARGET_SOCK_PACKET = 10, 40 TARGET_SOCK_CLOEXEC = 020000000, 41 TARGET_SOCK_NONBLOCK = 040000, 42 }; 43 44 #define TARGET_SOCK_MAX (TARGET_SOCK_PACKET + 1) 45 #define TARGET_SOCK_TYPE_MASK 0xf /* Covers up to TARGET_SOCK_MAX-1. */ 46 47 #define TARGET_SO_PASSSEC 31 48 49 /* For setsockopt(2) */ 50 #define TARGET_SOL_SOCKET 1 51 52 #define TARGET_SO_DEBUG 1 53 #define TARGET_SO_REUSEADDR 2 54 #define TARGET_SO_TYPE 3 55 #define TARGET_SO_ERROR 4 56 #define TARGET_SO_DONTROUTE 5 57 #define TARGET_SO_BROADCAST 6 58 #define TARGET_SO_SNDBUF 7 59 #define TARGET_SO_RCVBUF 8 60 #define TARGET_SO_SNDBUFFORCE 32 61 #define TARGET_SO_RCVBUFFORCE 33 62 #define TARGET_SO_KEEPALIVE 9 63 #define TARGET_SO_OOBINLINE 10 64 #define TARGET_SO_NO_CHECK 11 65 #define TARGET_SO_PRIORITY 12 66 #define TARGET_SO_LINGER 13 67 #define TARGET_SO_BSDCOMPAT 14 68 /* To add :#define TARGET_SO_REUSEPORT 15 */ 69 #define TARGET_SO_PASSCRED 16 70 #define TARGET_SO_PEERCRED 17 71 #define TARGET_SO_RCVLOWAT 18 72 #define TARGET_SO_SNDLOWAT 19 73 #define TARGET_SO_RCVTIMEO 20 74 #define TARGET_SO_SNDTIMEO 21 75 76 /* Security levels - as per NRL IPv6 - don't actually do anything */ 77 #define TARGET_SO_SECURITY_AUTHENTICATION 22 78 #define TARGET_SO_SECURITY_ENCRYPTION_TRANSPORT 23 79 #define TARGET_SO_SECURITY_ENCRYPTION_NETWORK 24 80 81 #define TARGET_SO_BINDTODEVICE 25 82 83 /* Socket filtering */ 84 #define TARGET_SO_ATTACH_FILTER 26 85 #define TARGET_SO_DETACH_FILTER 27 86 87 #define TARGET_SO_PEERNAME 28 88 #define TARGET_SO_TIMESTAMP 29 89 #define TARGET_SCM_TIMESTAMP TARGET_SO_TIMESTAMP 90 91 #define TARGET_SO_ACCEPTCONN 30 92 93 #define TARGET_SO_PEERSEC 31 94 #endif 95