Subversion Repositories HelenOS

Rev

Go to most recent revision | Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
4712 mejdrech 1
/*
2
 * Copyright (c) 2009 Lukas Mejdrech
3
 * All rights reserved.
4
 *
5
 * Redistribution and use in source and binary forms, with or without
6
 * modification, are permitted provided that the following conditions
7
 * are met:
8
 *
9
 * - Redistributions of source code must retain the above copyright
10
 *   notice, this list of conditions and the following disclaimer.
11
 * - Redistributions in binary form must reproduce the above copyright
12
 *   notice, this list of conditions and the following disclaimer in the
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
15
 *   derived from this software without specific prior written permission.
16
 *
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
19
 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
20
 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
21
 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
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
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
26
 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27
 */
28
 
29
/** @addtogroup socket
30
 *  @{
31
 */
32
 
33
/** @file
34
 *  Socket codes and definitions.
35
 *  This is a part of the network application library.
36
 */
37
 
38
#ifndef __NET_SOCKET_CODES_H__
39
#define __NET_SOCKET_CODES_H__
40
 
41
#include <sys/types.h>
42
 
43
/** @name Address families definitions
44
*/
45
/*@{*/
46
/** Unspecified address family.
47
 */
48
#define AF_UNSPEC   0
49
 
50
/** Unix domain sockets address family.
51
 */
52
#define AF_UNIXL    1
53
 
54
/** POSIX name for AF_UNIX address family.
55
 */
56
#define AF_LOCAL    1
57
 
58
/** Internet IP Protocol address family.
59
 */
60
#define AF_INET     2
61
 
62
/** Amateur Radio AX.25 address family.
63
 */
64
#define AF_AX25     3
65
 
66
/** Novell IPX address family.
67
 */
68
#define AF_IPX      4
69
 
70
/** AppleTalk DDP address family.
71
 */
72
#define AF_APPLETALK    5
73
 
74
/** Amateur Radio NET/ROM address family.
75
 */
76
#define AF_NETROM   6
77
 
78
/** Multiprotocol bridge address family.
79
 */
80
#define AF_BRIDGE   7
81
 
82
/** ATM PVCs address family.
83
 */
84
#define AF_ATMPVC   8
85
 
86
/** Reserved for X.25 project address family.
87
 */
88
#define AF_X25      9
89
 
90
/** IP version 6 address family.
91
 */
92
#define AF_INET6    10
93
 
94
/** Amateur Radio X.25 PLP address family.
95
 */
96
#define AF_ROSE     11
97
 
98
/** Reserved for DECnet project address family.
99
 */
100
#define AF_DECnet   12
101
 
102
/** Reserved for 802.2LLC project address family.
103
 */
104
#define AF_NETBEUI  13
105
 
106
/** Security callback pseudo AF address family.
107
 */
108
#define AF_SECURITY 14
109
 
110
/** PF_KEY key management API address family.
111
 */
112
#define AF_KEY      15
113
 
114
/** Alias to emulate 4.4BSD address family.
115
 */
116
#define AF_NETLINK  16
117
 
118
/** Packet family address family.
119
 */
120
#define AF_PACKET   17
121
 
122
/** Ash address family.
123
 */
124
#define AF_ASH      18
125
 
126
/** Acorn Econet address family.
127
 */
128
#define AF_ECONET   19
129
 
130
/** ATM SVCs address family.
131
 */
132
#define AF_ATMSVC   20
133
 
134
/** Linux SNA Project (nutters!) address family.
135
 */
136
#define AF_SNA      22
137
 
138
/** IRDA sockets address family.
139
 */
140
#define AF_IRDA     23
141
 
142
/** PPPoX sockets address family.
143
 */
144
#define AF_PPPOX    24
145
 
146
/** Wanpipe API Sockets address family.
147
 */
148
#define AF_WANPIPE  25
149
 
150
/** Linux LLC address family.
151
 */
152
#define AF_LLC      26
153
 
154
/** Controller Area Network address family.
155
 */
156
#define AF_CAN      29
157
 
158
/** TIPC sockets address family.
159
 */
160
#define AF_TIPC     30
161
 
162
/** Bluetooth sockets address family.
163
 */
164
#define AF_BLUETOOTH    31
165
 
166
/** IUCV sockets address family.
167
 */
168
#define AF_IUCV     32
169
 
170
/** RxRPC sockets address family.
171
 */
172
#define AF_RXRPC    33
173
 
174
/** Maximum address family.
175
 */
176
#define AF_MAX      34
177
/*@}*/
178
 
179
/** @name Protocol families definitions
180
 *  Same as address families.
181
 */
182
/*@{*/
183
/** Unspecified protocol family.
184
 */
185
#define PF_UNSPEC   AF_UNSPEC
186
 
187
/** Unix domain sockets protocol family.
188
 */
189
#define PF_UNIXL    AF_UNIXL
190
 
191
/** POSIX name for AF_UNIX protocol family.
192
 */
193
#define PF_LOCAL    AF_LOCAL
194
 
195
/** Internet IP Protocol protocol family.
196
 */
197
#define PF_INET     AF_INET
198
 
199
/** Amateur Radio AX.25 protocol family.
200
 */
201
#define PF_AX25     AF_AX25
202
 
203
/** Novell IPX protocol family.
204
 */
205
#define PF_IPX      AF_IPX
206
 
207
/** AppleTalk DDP protocol family.
208
 */
209
#define PF_APPLETALK    AF_APPLETALK
210
 
211
/** Amateur Radio NET/ROM protocol family.
212
 */
213
#define PF_NETROM   AF_NETROM
214
 
215
/** Multiprotocol bridge protocol family.
216
 */
217
#define PF_BRIDGE   AF_BRIDGE
218
 
219
/** ATM PVCs protocol family.
220
 */
221
#define PF_ATMPVC   AF_ATMPVC
222
 
223
/** Reserved for X.25 project protocol family.
224
 */
225
#define PF_X25      AF_X25
226
 
227
/** IP version 6 protocol family.
228
 */
229
#define PF_INET6    AF_INET6
230
 
231
/** Amateur Radio X.25 PLP protocol family.
232
 */
233
#define PF_ROSE     AF_ROSE
234
 
235
/** Reserved for DECnet project protocol family.
236
 */
237
#define PF_DECnet   AF_DECnet
238
 
239
/** Reserved for 802.2LLC project protocol family.
240
 */
241
#define PF_NETBEUI  AF_NETBEUI
242
 
243
/** Security callback pseudo AF protocol family.
244
 */
245
#define PF_SECURITY AF_SECURITY
246
 
247
/** PF_KEY key management API protocol family.
248
 */
249
#define PF_KEY      AF_KEY
250
 
251
/** Alias to emulate 4.4BSD protocol family.
252
 */
253
#define PF_NETLINK  AF_NETLINK
254
 
255
/** Packet family protocol family.
256
 */
257
#define PF_PACKET   AF_PACKET
258
 
259
/** Ash protocol family.
260
 */
261
#define PF_ASH      AF_ASH
262
 
263
/** Acorn Econet protocol family.
264
 */
265
#define PF_ECONET   AF_ECONET
266
 
267
/** ATM SVCs protocol family.
268
 */
269
#define PF_ATMSVC   AF_ATMSVC
270
 
271
/** Linux SNA Project (nutters!) protocol family.
272
 */
273
#define PF_SNA      AF_SNA
274
 
275
/** IRDA sockets protocol family.
276
 */
277
#define PF_IRDA     AF_IRDA
278
 
279
/** PPPoX sockets protocol family.
280
 */
281
#define PF_PPPOX    AF_PPPOX
282
 
283
/** Wanpipe API Sockets protocol family.
284
 */
285
#define PF_WANPIPE  AF_WANPIPE
286
 
287
/** Linux LLC protocol family.
288
 */
289
#define PF_LLC      AF_LLC
290
 
291
/** Controller Area Network protocol family.
292
 */
293
#define PF_CAN      AF_CAN
294
 
295
/** TIPC sockets protocol family.
296
 */
297
#define PF_TIPC     AF_TIPC
298
 
299
/** Bluetooth sockets protocol family.
300
 */
301
#define PF_BLUETOOTH    AF_BLUETOOTH
302
 
303
/** IUCV sockets protocol family.
304
 */
305
#define PF_IUCV     AF_IUCV
306
 
307
/** RxRPC sockets protocol family.
308
 */
309
#define PF_RXRPC    AF_RXRPC
310
 
311
/** Maximum protocol family.
312
 */
313
#define PF_MAX      AF_MAX
314
/*@}*/
315
 
316
/** @name Socket option levels definitions
317
 *  Thanks to BSD these must match IPPROTO_xxx
318
 */
319
/*@{*/
320
 
321
/** IP socket option level.
322
 */
323
#define SOL_IP      0
324
 
325
/** ICMP socket option level.
326
 */
327
#define SOL_ICMP    1
328
 
329
/** TCP socket option level.
330
 */
331
#define SOL_TCP     6
332
 
333
/** UDP socket option level.
334
 */
335
#define SOL_UDP     17
336
 
337
/** IPV socket option level.
338
 */
339
#define SOL_IPV6    41
340
 
341
/** ICMPV socket option level.
342
 */
343
#define SOL_ICMPV6  58
344
 
345
/** SCTP socket option level.
346
 */
347
#define SOL_SCTP    132
348
 
349
/** UDP-Lite (RFC 3828) socket option level.
350
 */
351
#define SOL_UDPLITE 136
352
 
353
/** RAW socket option level.
354
 */
355
#define SOL_RAW     255
356
 
357
/** IPX socket option level.
358
 */
359
#define SOL_IPX     256
360
 
361
/** AX socket option level.
362
 */
363
#define SOL_AX25    257
364
 
365
/** ATALK socket option level.
366
 */
367
#define SOL_ATALK   258
368
 
369
/** NETROM socket option level.
370
 */
371
#define SOL_NETROM  259
372
 
373
/** ROSE socket option level.
374
 */
375
#define SOL_ROSE    260
376
 
377
/** DECNET socket option level.
378
 */
379
#define SOL_DECNET  261
380
 
381
/** X25 socket option level.
382
 */
383
#define SOL_X25     262
384
 
385
/** PACKET socket option level.
386
 */
387
#define SOL_PACKET  263
388
 
389
/** ATM layer (cell level) socket option level.
390
 */
391
#define SOL_ATM     264
392
 
393
/** ATM Adaption Layer (packet level) socket option level.
394
 */
395
#define SOL_AAL     265
396
 
397
/** IRDA socket option level.
398
 */
399
#define SOL_IRDA    266
400
 
401
/** NETBEUI socket option level.
402
 */
403
#define SOL_NETBEUI 267
404
 
405
/** LLC socket option level.
406
 */
407
#define SOL_LLC     268
408
 
409
/** DCCP socket option level.
410
 */
411
#define SOL_DCCP    269
412
 
413
/** NETLINK socket option level.
414
 */
415
#define SOL_NETLINK 270
416
 
417
/** TIPC socket option level.
418
 */
419
#define SOL_TIPC    271
420
 
421
/** RXRPC socket option level.
422
 */
423
#define SOL_RXRPC   272
424
 
425
/** PPPOL socket option level.
426
 */
427
#define SOL_PPPOL2TP    273
428
 
429
/** BLUETOOTH socket option level.
430
 */
431
#define SOL_BLUETOOTH   274
432
 
433
/*@}*/
434
 
435
//
436
/* * IPX options.
437
 */
438
//#define IPX_TYPE  1
439
 
440
/** Socket types.
441
 */
442
typedef enum sock_type{
443
    /** Stream (connection oriented) socket.
444
     */
445
    SOCK_STREAM = 1,
446
    /** Datagram (connectionless oriented) socket.
447
     */
448
    SOCK_DGRAM  = 2,
449
    /** Raw socket.
450
     */
451
    SOCK_RAW    = 3
452
} sock_type_t;
453
 
454
/** Type definition of the socket length.
455
 */
456
typedef int32_t socklen_t;
457
 
458
#endif
459
 
460
/** @}
461
 */