1 /**
2  * D header file for GNU/Linux.
3  *
4  * License:   $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost License 1.0)
5  * Authors:   Paul O'Neil
6  */
7 module core.sys.linux.sys.socket;
8 
9 public import core.sys.posix.sys.socket;
10 
11 version (linux):
12 extern(C):
13 @nogc:
14 nothrow:
15 
16 enum
17 {
18     // Protocol families.
19     PF_UNSPEC     = 0,
20     PF_LOCAL      = 1,
21     PF_UNIX       = PF_LOCAL,
22     PF_FILE       = PF_LOCAL,
23     PF_INET       = 2,
24     PF_AX25       = 3,
25     PF_NETROM     = 6,
26     PF_BRIDGE     = 7,
27     PF_ATMPVC     = 8,
28     PF_X25        = 9,
29     PF_INET6      = 10,
30     PF_ROSE       = 11,
31     PF_DECnet     = 12,
32     PF_NETBEUI    = 13,
33     PF_SECURITY   = 14,
34     PF_KEY        = 15,
35     PF_NETLINK    = 16,
36     PF_ROUTE      = PF_NETLINK,
37     PF_PACKET     = 17,
38     PF_ASH        = 18,
39     PF_ECONET     = 19,
40     PF_ATMSVC     = 20,
41     PF_RDS        = 21,
42     PF_SNA        = 22,
43     PF_IRDA       = 23,
44     PF_PPPOX      = 24,
45     PF_WANPIPE    = 25,
46     PF_LLC        = 26,
47     PF_IB         = 27,
48     PF_MPLS       = 28,
49     PF_CAN        = 29,
50     PF_TIPC       = 30,
51     PF_BLUETOOTH  = 31,
52     PF_IUCV       = 32,
53     PF_RXRPC      = 33,
54     PF_ISDN       = 34,
55     PF_PHONET     = 35,
56     PF_IEEE802154 = 36,
57     PF_CAIF       = 37,
58     PF_ALG        = 38,
59     PF_NFC        = 39,
60     PF_VSOCK      = 40,
61     PF_KCM        = 41,
62     PF_QIPCRTR    = 42,
63     PF_SMC        = 43,
64     PF_MAX        = 44,
65 
66     // Address families.
67     AF_LOCAL      = PF_LOCAL,
68     AF_FILE       = AF_LOCAL,
69     AF_AX25       = PF_AX25,
70     AF_NETROM     = PF_NETROM,
71     AF_BRIDGE     = PF_BRIDGE,
72     AF_ATMPVC     = PF_ATMPVC,
73     AF_X25        = PF_X25,
74     AF_INET6      = PF_INET6,
75     AF_ROSE       = PF_ROSE,
76     AF_DECnet     = PF_DECnet,
77     AF_NETBEUI    = PF_NETBEUI,
78     AF_SECURITY   = PF_SECURITY,
79     AF_KEY        = PF_KEY,
80     AF_NETLINK    = PF_NETLINK,
81     AF_ROUTE      = PF_ROUTE,
82     AF_PACKET     = PF_PACKET,
83     AF_ASH        = PF_ASH,
84     AF_ECONET     = PF_ECONET,
85     AF_ATMSVC     = PF_ATMSVC,
86     AF_RDS        = PF_RDS,
87     AF_SNA        = PF_SNA,
88     AF_IRDA       = PF_IRDA,
89     AF_PPPOX      = PF_PPPOX,
90     AF_WANPIPE    = PF_WANPIPE,
91     AF_LLC        = PF_LLC,
92     AF_IB         = PF_IB,
93     AF_MPLS       = PF_MPLS,
94     AF_CAN        = PF_CAN,
95     AF_TIPC       = PF_TIPC,
96     AF_BLUETOOTH  = PF_BLUETOOTH,
97     AF_IUCV       = PF_IUCV,
98     AF_RXRPC      = PF_RXRPC,
99     AF_ISDN       = PF_ISDN,
100     AF_PHONET     = PF_PHONET,
101     AF_IEEE802154 = PF_IEEE802154,
102     AF_CAIF       = PF_CAIF,
103     AF_ALG        = PF_ALG,
104     AF_NFC        = PF_NFC,
105     AF_VSOCK      = PF_VSOCK,
106     AF_KCM        = PF_KCM,
107     AF_QIPCRTR    = PF_QIPCRTR,
108     AF_SMC        = PF_SMC,
109     AF_MAX        = PF_MAX,
110 }
111 
112 // For getsockopt() and setsockopt()
113 enum
114 {
115     SO_SECURITY_AUTHENTICATION       = 22,
116     SO_SECURITY_ENCRYPTION_TRANSPORT = 23,
117     SO_SECURITY_ENCRYPTION_NETWORK   = 24,
118 
119     SO_BINDTODEVICE            = 25,
120 
121     SO_ATTACH_FILTER           = 26,
122     SO_DETACH_FILTER           = 27,
123     SO_GET_FILTER              = SO_ATTACH_FILTER,
124 
125     SO_PEERNAME                = 28,
126     SO_TIMESTAMP               = 29,
127     SCM_TIMESTAMP              = SO_TIMESTAMP,
128 
129     SO_PASSSEC                 = 34,
130     SO_TIMESTAMPNS             = 35,
131     SCM_TIMESTAMPNS            = SO_TIMESTAMPNS,
132     SO_MARK                    = 36,
133     SO_TIMESTAMPING            = 37,
134     SCM_TIMESTAMPING           = SO_TIMESTAMPING,
135     SO_RXQ_OVFL                = 40,
136     SO_WIFI_STATUS             = 41,
137     SCM_WIFI_STATUS            = SO_WIFI_STATUS,
138     SO_PEEK_OFF                = 42,
139     SO_NOFCS                   = 43,
140     SO_LOCK_FILTER             = 44,
141     SO_SELECT_ERR_QUEUE        = 45,
142     SO_BUSY_POLL               = 46,
143     SO_MAX_PACING_RATE         = 47,
144     SO_BPF_EXTENSIONS          = 48,
145     SO_INCOMING_CPU            = 49,
146     SO_ATTACH_BPF              = 50,
147     SO_DETACH_BPF              = SO_DETACH_FILTER,
148     SO_ATTACH_REUSEPORT_CBPF   = 51,
149     SO_ATTACH_REUSEPORT_EBPF   = 52,
150     SO_CNX_ADVICE              = 53,
151     SCM_TIMESTAMPING_OPT_STATS = 54,
152     SO_MEMINFO                 = 55,
153     SO_INCOMING_NAPI_ID        = 56,
154     SO_COOKIE                  = 57,
155     SCM_TIMESTAMPING_PKTINFO   = 58,
156     SO_PEERGROUPS              = 59,
157     SO_ZEROCOPY                = 60,
158 }
159 
160 enum : uint
161 {
162     MSG_TRYHARD      = 0x04,
163     MSG_PROXY        = 0x10,
164     MSG_DONTWAIT     = 0x40,
165     MSG_FIN          = 0x200,
166     MSG_SYN          = 0x400,
167     MSG_CONFIRM      = 0x800,
168     MSG_RST          = 0x1000,
169     MSG_ERRQUEUE     = 0x2000,
170     MSG_MORE         = 0x8000,
171     MSG_WAITFORONE   = 0x10000,
172     MSG_BATCH        = 0x40000,
173     MSG_ZEROCOPY     = 0x4000000,
174     MSG_FASTOPEN     = 0x20000000,
175     MSG_CMSG_CLOEXEC = 0x40000000
176 }