Rev 3912 | Rev 4578 | Go to most recent revision | Only display areas with differences | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 3912 | Rev 4243 | ||
---|---|---|---|
1 | /* |
1 | /* |
2 | * Copyright (c) 2009 Lukas Mejdrech |
2 | * Copyright (c) 2009 Lukas Mejdrech |
3 | * All rights reserved. |
3 | * All rights reserved. |
4 | * |
4 | * |
5 | * Redistribution and use in source and binary forms, with or without |
5 | * Redistribution and use in source and binary forms, with or without |
6 | * modification, are permitted provided that the following conditions |
6 | * modification, are permitted provided that the following conditions |
7 | * are met: |
7 | * are met: |
8 | * |
8 | * |
9 | * - Redistributions of source code must retain the above copyright |
9 | * - Redistributions of source code must retain the above copyright |
10 | * notice, this list of conditions and the following disclaimer. |
10 | * notice, this list of conditions and the following disclaimer. |
11 | * - Redistributions in binary form must reproduce the above copyright |
11 | * - Redistributions in binary form must reproduce the above copyright |
12 | * notice, this list of conditions and the following disclaimer in the |
12 | * notice, this list of conditions and the following disclaimer in the |
13 | * documentation and/or other materials provided with the distribution. |
13 | * documentation and/or other materials provided with the distribution. |
14 | * - The name of the author may not be used to endorse or promote products |
14 | * - The name of the author may not be used to endorse or promote products |
15 | * derived from this software without specific prior written permission. |
15 | * derived from this software without specific prior written permission. |
16 | * |
16 | * |
17 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR |
17 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR |
18 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES |
18 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES |
19 | * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. |
19 | * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. |
20 | * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, |
20 | * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, |
21 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT |
21 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT |
22 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
22 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
23 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
23 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
24 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
24 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
25 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF |
25 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF |
26 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
26 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
27 | */ |
27 | */ |
28 | 28 | ||
29 | /** @addtogroup net |
29 | /** @addtogroup net |
30 | * @{ |
30 | * @{ |
31 | */ |
31 | */ |
32 | 32 | ||
33 | /** @file |
33 | /** @file |
34 | * Common socket constants. |
34 | * Common socket constants. |
35 | * Based on the linux src/include/linux/socket.h header file. |
35 | * Based on the linux src/include/linux/socket.h header file. |
36 | */ |
36 | */ |
37 | 37 | ||
38 | #ifndef __NET_SOCKET_H__ |
38 | #ifndef __NET_SOCKET_H__ |
39 | #define __NET_SOCKET_H__ |
39 | #define __NET_SOCKET_H__ |
40 | 40 | ||
41 | /* Supported address families. */ |
41 | /* Supported address families. */ |
42 | /** Unspecified address family. |
42 | /** Unspecified address family. |
43 | */ |
43 | */ |
44 | #define AF_UNSPEC 0 |
44 | #define AF_UNSPEC 0 |
45 | 45 | ||
46 | /** Unix domain sockets address family. |
46 | /** Unix domain sockets address family. |
47 | */ |
47 | */ |
48 | #define AF_UNIXL 1 |
48 | #define AF_UNIXL 1 |
49 | 49 | ||
50 | /** POSIX name for AF_UNIX address family. |
50 | /** POSIX name for AF_UNIX address family. |
51 | */ |
51 | */ |
52 | #define AF_LOCAL 1 |
52 | #define AF_LOCAL 1 |
53 | 53 | ||
54 | /** Internet IP Protocol address family. |
54 | /** Internet IP Protocol address family. |
55 | */ |
55 | */ |
56 | #define AF_INET 2 |
56 | #define AF_INET 2 |
57 | 57 | ||
58 | /** Amateur Radio AX.25 address family. |
58 | /** Amateur Radio AX.25 address family. |
59 | */ |
59 | */ |
60 | #define AF_AX25 3 |
60 | #define AF_AX25 3 |
61 | 61 | ||
62 | /** Novell IPX address family. |
62 | /** Novell IPX address family. |
63 | */ |
63 | */ |
64 | #define AF_IPX 4 |
64 | #define AF_IPX 4 |
65 | 65 | ||
66 | /** AppleTalk DDP address family. |
66 | /** AppleTalk DDP address family. |
67 | */ |
67 | */ |
68 | #define AF_APPLETALK 5 |
68 | #define AF_APPLETALK 5 |
69 | 69 | ||
70 | /** Amateur Radio NET/ROM address family. |
70 | /** Amateur Radio NET/ROM address family. |
71 | */ |
71 | */ |
72 | #define AF_NETROM 6 |
72 | #define AF_NETROM 6 |
73 | 73 | ||
74 | /** Multiprotocol bridge address family. |
74 | /** Multiprotocol bridge address family. |
75 | */ |
75 | */ |
76 | #define AF_BRIDGE 7 |
76 | #define AF_BRIDGE 7 |
77 | 77 | ||
78 | /** ATM PVCs address family. |
78 | /** ATM PVCs address family. |
79 | */ |
79 | */ |
80 | #define AF_ATMPVC 8 |
80 | #define AF_ATMPVC 8 |
81 | 81 | ||
82 | /** Reserved for X.25 project address family. |
82 | /** Reserved for X.25 project address family. |
83 | */ |
83 | */ |
84 | #define AF_X25 9 |
84 | #define AF_X25 9 |
85 | 85 | ||
86 | /** IP version 6 address family. |
86 | /** IP version 6 address family. |
87 | */ |
87 | */ |
88 | #define AF_INET6 10 |
88 | #define AF_INET6 10 |
89 | 89 | ||
90 | /** Amateur Radio X.25 PLP address family. |
90 | /** Amateur Radio X.25 PLP address family. |
91 | */ |
91 | */ |
92 | #define AF_ROSE 11 |
92 | #define AF_ROSE 11 |
93 | 93 | ||
94 | /** Reserved for DECnet project address family. |
94 | /** Reserved for DECnet project address family. |
95 | */ |
95 | */ |
96 | #define AF_DECnet 12 |
96 | #define AF_DECnet 12 |
97 | 97 | ||
98 | /** Reserved for 802.2LLC project address family. |
98 | /** Reserved for 802.2LLC project address family. |
99 | */ |
99 | */ |
100 | #define AF_NETBEUI 13 |
100 | #define AF_NETBEUI 13 |
101 | 101 | ||
102 | /** Security callback pseudo AF address family. |
102 | /** Security callback pseudo AF address family. |
103 | */ |
103 | */ |
104 | #define AF_SECURITY 14 |
104 | #define AF_SECURITY 14 |
105 | 105 | ||
106 | /** PF_KEY key management API address family. |
106 | /** PF_KEY key management API address family. |
107 | */ |
107 | */ |
108 | #define AF_KEY 15 |
108 | #define AF_KEY 15 |
109 | 109 | ||
110 | /** Alias to emulate 4.4BSD address family. |
110 | /** Alias to emulate 4.4BSD address family. |
111 | */ |
111 | */ |
112 | #define AF_NETLINK 16 |
112 | #define AF_NETLINK 16 |
113 | 113 | ||
114 | /** Packet family address family. |
114 | /** Packet family address family. |
115 | */ |
115 | */ |
116 | #define AF_PACKET 17 |
116 | #define AF_PACKET 17 |
117 | 117 | ||
118 | /** Ash address family. |
118 | /** Ash address family. |
119 | */ |
119 | */ |
120 | #define AF_ASH 18 |
120 | #define AF_ASH 18 |
121 | 121 | ||
122 | /** Acorn Econet address family. |
122 | /** Acorn Econet address family. |
123 | */ |
123 | */ |
124 | #define AF_ECONET 19 |
124 | #define AF_ECONET 19 |
125 | 125 | ||
126 | /** ATM SVCs address family. |
126 | /** ATM SVCs address family. |
127 | */ |
127 | */ |
128 | #define AF_ATMSVC 20 |
128 | #define AF_ATMSVC 20 |
129 | 129 | ||
130 | /** Linux SNA Project (nutters!) address family. |
130 | /** Linux SNA Project (nutters!) address family. |
131 | */ |
131 | */ |
132 | #define AF_SNA 22 |
132 | #define AF_SNA 22 |
133 | 133 | ||
134 | /** IRDA sockets address family. |
134 | /** IRDA sockets address family. |
135 | */ |
135 | */ |
136 | #define AF_IRDA 23 |
136 | #define AF_IRDA 23 |
137 | 137 | ||
138 | /** PPPoX sockets address family. |
138 | /** PPPoX sockets address family. |
139 | */ |
139 | */ |
140 | #define AF_PPPOX 24 |
140 | #define AF_PPPOX 24 |
141 | 141 | ||
142 | /** Wanpipe API Sockets address family. |
142 | /** Wanpipe API Sockets address family. |
143 | */ |
143 | */ |
144 | #define AF_WANPIPE 25 |
144 | #define AF_WANPIPE 25 |
145 | 145 | ||
146 | /** Linux LLC address family. |
146 | /** Linux LLC address family. |
147 | */ |
147 | */ |
148 | #define AF_LLC 26 |
148 | #define AF_LLC 26 |
149 | 149 | ||
150 | /** Controller Area Network address family. |
150 | /** Controller Area Network address family. |
151 | */ |
151 | */ |
152 | #define AF_CAN 29 |
152 | #define AF_CAN 29 |
153 | 153 | ||
154 | /** TIPC sockets address family. |
154 | /** TIPC sockets address family. |
155 | */ |
155 | */ |
156 | #define AF_TIPC 30 |
156 | #define AF_TIPC 30 |
157 | 157 | ||
158 | /** Bluetooth sockets address family. |
158 | /** Bluetooth sockets address family. |
159 | */ |
159 | */ |
160 | #define AF_BLUETOOTH 31 |
160 | #define AF_BLUETOOTH 31 |
161 | 161 | ||
162 | /** IUCV sockets address family. |
162 | /** IUCV sockets address family. |
163 | */ |
163 | */ |
164 | #define AF_IUCV 32 |
164 | #define AF_IUCV 32 |
165 | 165 | ||
166 | /** RxRPC sockets address family. |
166 | /** RxRPC sockets address family. |
167 | */ |
167 | */ |
168 | #define AF_RXRPC 33 |
168 | #define AF_RXRPC 33 |
169 | 169 | ||
170 | /** Maximum address family. |
170 | /** Maximum address family. |
171 | */ |
171 | */ |
172 | #define AF_MAX 34 |
172 | #define AF_MAX 34 |
173 | 173 | ||
174 | /* Protocol families, same as address families. */ |
174 | /* Protocol families, same as address families. */ |
175 | /* |
175 | /* |
176 | #define PF_UNSPEC AF_UNSPEC |
176 | #define PF_UNSPEC AF_UNSPEC |
177 | #define PF_UNIX AF_UNIX |
177 | #define PF_UNIX AF_UNIX |
178 | #define PF_LOCAL AF_LOCAL |
178 | #define PF_LOCAL AF_LOCAL |
179 | #define PF_INET AF_INET |
179 | #define PF_INET AF_INET |
180 | #define PF_AX25 AF_AX25 |
180 | #define PF_AX25 AF_AX25 |
181 | #define PF_IPX AF_IPX |
181 | #define PF_IPX AF_IPX |
182 | #define PF_APPLETALK AF_APPLETALK |
182 | #define PF_APPLETALK AF_APPLETALK |
183 | #define PF_NETROM AF_NETROM |
183 | #define PF_NETROM AF_NETROM |
184 | #define PF_BRIDGE AF_BRIDGE |
184 | #define PF_BRIDGE AF_BRIDGE |
185 | #define PF_ATMPVC AF_ATMPVC |
185 | #define PF_ATMPVC AF_ATMPVC |
186 | #define PF_X25 AF_X25 |
186 | #define PF_X25 AF_X25 |
187 | #define PF_INET6 AF_INET6 |
187 | #define PF_INET6 AF_INET6 |
188 | #define PF_ROSE AF_ROSE |
188 | #define PF_ROSE AF_ROSE |
189 | #define PF_DECnet AF_DECnet |
189 | #define PF_DECnet AF_DECnet |
190 | #define PF_NETBEUI AF_NETBEUI |
190 | #define PF_NETBEUI AF_NETBEUI |
191 | #define PF_SECURITY AF_SECURITY |
191 | #define PF_SECURITY AF_SECURITY |
192 | #define PF_KEY AF_KEY |
192 | #define PF_KEY AF_KEY |
193 | #define PF_NETLINK AF_NETLINK |
193 | #define PF_NETLINK AF_NETLINK |
194 | #define PF_ROUTE AF_ROUTE |
194 | #define PF_ROUTE AF_ROUTE |
195 | #define PF_PACKET AF_PACKET |
195 | #define PF_PACKET AF_PACKET |
196 | #define PF_ASH AF_ASH |
196 | #define PF_ASH AF_ASH |
197 | #define PF_ECONET AF_ECONET |
197 | #define PF_ECONET AF_ECONET |
198 | #define PF_ATMSVC AF_ATMSVC |
198 | #define PF_ATMSVC AF_ATMSVC |
199 | #define PF_SNA AF_SNA |
199 | #define PF_SNA AF_SNA |
200 | #define PF_IRDA AF_IRDA |
200 | #define PF_IRDA AF_IRDA |
201 | #define PF_PPPOX AF_PPPOX |
201 | #define PF_PPPOX AF_PPPOX |
202 | #define PF_WANPIPE AF_WANPIPE |
202 | #define PF_WANPIPE AF_WANPIPE |
203 | #define PF_LLC AF_LLC |
203 | #define PF_LLC AF_LLC |
204 | #define PF_CAN AF_CAN |
204 | #define PF_CAN AF_CAN |
205 | #define PF_TIPC AF_TIPC |
205 | #define PF_TIPC AF_TIPC |
206 | #define PF_BLUETOOTH AF_BLUETOOTH |
206 | #define PF_BLUETOOTH AF_BLUETOOTH |
207 | #define PF_IUCV AF_IUCV |
207 | #define PF_IUCV AF_IUCV |
208 | #define PF_RXRPC AF_RXRPC |
208 | #define PF_RXRPC AF_RXRPC |
209 | #define PF_MAX AF_MAX |
209 | #define PF_MAX AF_MAX |
210 | */ |
210 | */ |
211 | /* Setsockoptions(2) level. Thanks to BSD these must match IPPROTO_xxx */ |
211 | /* Setsockoptions(2) level. Thanks to BSD these must match IPPROTO_xxx */ |
212 | /*#define SOL_IP 0 |
212 | /*#define SOL_IP 0 |
213 | #define SOL_ICMP 1 |
213 | #define SOL_ICMP 1 |
214 | #define SOL_TCP 6 |
214 | #define SOL_TCP 6 |
215 | #define SOL_UDP 17 |
215 | #define SOL_UDP 17 |
216 | #define SOL_IPV6 41 |
216 | #define SOL_IPV6 41 |
217 | #define SOL_ICMPV6 58 |
217 | #define SOL_ICMPV6 58 |
218 | #define SOL_SCTP 132 |
218 | #define SOL_SCTP 132 |
219 | #define SOL_UDPLITE 136 *//* UDP-Lite (RFC 3828) */ |
219 | #define SOL_UDPLITE 136 *//* UDP-Lite (RFC 3828) */ |
220 | /*#define SOL_RAW 255 |
220 | /*#define SOL_RAW 255 |
221 | #define SOL_IPX 256 |
221 | #define SOL_IPX 256 |
222 | #define SOL_AX25 257 |
222 | #define SOL_AX25 257 |
223 | #define SOL_ATALK 258 |
223 | #define SOL_ATALK 258 |
224 | #define SOL_NETROM 259 |
224 | #define SOL_NETROM 259 |
225 | #define SOL_ROSE 260 |
225 | #define SOL_ROSE 260 |
226 | #define SOL_DECNET 261 |
226 | #define SOL_DECNET 261 |
227 | #define SOL_X25 262 |
227 | #define SOL_X25 262 |
228 | #define SOL_PACKET 263 |
228 | #define SOL_PACKET 263 |
229 | #define SOL_ATM 264 *//* ATM layer (cell level) */ |
229 | #define SOL_ATM 264 *//* ATM layer (cell level) */ |
230 | /*#define SOL_AAL 265 *//* ATM Adaption Layer (packet level) */ |
230 | /*#define SOL_AAL 265 *//* ATM Adaption Layer (packet level) */ |
231 | /*#define SOL_IRDA 266 |
231 | /*#define SOL_IRDA 266 |
232 | #define SOL_NETBEUI 267 |
232 | #define SOL_NETBEUI 267 |
233 | #define SOL_LLC 268 |
233 | #define SOL_LLC 268 |
234 | #define SOL_DCCP 269 |
234 | #define SOL_DCCP 269 |
235 | #define SOL_NETLINK 270 |
235 | #define SOL_NETLINK 270 |
236 | #define SOL_TIPC 271 |
236 | #define SOL_TIPC 271 |
237 | #define SOL_RXRPC 272 |
237 | #define SOL_RXRPC 272 |
238 | #define SOL_PPPOL2TP 273 |
238 | #define SOL_PPPOL2TP 273 |
239 | #define SOL_BLUETOOTH 274 |
239 | #define SOL_BLUETOOTH 274 |
240 | */ |
240 | */ |
241 | // |
241 | // |
242 | ///** IPX options. |
242 | /* * IPX options. |
243 | // */ |
243 | */ |
244 | //#define IPX_TYPE 1 |
244 | //#define IPX_TYPE 1 |
245 | 245 | ||
246 | #endif |
246 | #endif |
247 | 247 | ||
248 | /** @} |
248 | /** @} |
249 | */ |
249 | */ |
250 | 250 |