linux_socket.h revision 1.8.4.1 1 1.8.4.1 thorpej /* $NetBSD: linux_socket.h,v 1.8.4.1 2002/01/10 19:51:49 thorpej Exp $ */
2 1.4 erh
3 1.4 erh /*-
4 1.6 fvdl * Copyright (c) 1995, 1998 The NetBSD Foundation, Inc.
5 1.4 erh * All rights reserved.
6 1.4 erh *
7 1.4 erh * This code is derived from software contributed to The NetBSD Foundation
8 1.6 fvdl * by Frank van der Linden and Eric Haszlakiewicz.
9 1.4 erh *
10 1.4 erh * Redistribution and use in source and binary forms, with or without
11 1.4 erh * modification, are permitted provided that the following conditions
12 1.4 erh * are met:
13 1.4 erh * 1. Redistributions of source code must retain the above copyright
14 1.4 erh * notice, this list of conditions and the following disclaimer.
15 1.4 erh * 2. Redistributions in binary form must reproduce the above copyright
16 1.4 erh * notice, this list of conditions and the following disclaimer in the
17 1.4 erh * documentation and/or other materials provided with the distribution.
18 1.4 erh * 3. All advertising materials mentioning features or use of this software
19 1.4 erh * must display the following acknowledgement:
20 1.4 erh * This product includes software developed by the NetBSD
21 1.4 erh * Foundation, Inc. and its contributors.
22 1.4 erh * 4. Neither the name of The NetBSD Foundation nor the names of its
23 1.4 erh * contributors may be used to endorse or promote products derived
24 1.4 erh * from this software without specific prior written permission.
25 1.4 erh *
26 1.4 erh * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
27 1.4 erh * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
28 1.4 erh * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
29 1.4 erh * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
30 1.4 erh * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
31 1.4 erh * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
32 1.4 erh * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
33 1.4 erh * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
34 1.4 erh * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
35 1.4 erh * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
36 1.4 erh * POSSIBILITY OF SUCH DAMAGE.
37 1.1 fvdl */
38 1.1 fvdl
39 1.5 christos #ifndef _LINUX_SOCKET_H
40 1.5 christos #define _LINUX_SOCKET_H
41 1.1 fvdl
42 1.1 fvdl /*
43 1.1 fvdl * Various Linux socket defines. Everything that is not re-defined here
44 1.1 fvdl * is the same as in NetBSD.
45 1.1 fvdl *
46 1.1 fvdl * COMPAT_43 is assumed, and the osockaddr struct is used (it is what
47 1.1 fvdl * Linux uses)
48 1.1 fvdl */
49 1.1 fvdl
50 1.1 fvdl /*
51 1.1 fvdl * Address families. There are fewer of them, and they're numbered
52 1.1 fvdl * a bit different
53 1.1 fvdl */
54 1.1 fvdl
55 1.1 fvdl #define LINUX_AF_UNSPEC 0
56 1.1 fvdl #define LINUX_AF_UNIX 1
57 1.1 fvdl #define LINUX_AF_INET 2
58 1.1 fvdl #define LINUX_AF_AX25 3
59 1.1 fvdl #define LINUX_AF_IPX 4
60 1.1 fvdl #define LINUX_AF_APPLETALK 5
61 1.4 erh #define LINUX_AF_NETROM 6
62 1.4 erh #define LINUX_AF_BRIDGE 7
63 1.4 erh #define LINUX_AF_ATMPVC 8
64 1.4 erh #define LINUX_AF_X25 9
65 1.4 erh #define LINUX_AF_INET6 10
66 1.4 erh #define LINUX_AF_ROSE 11
67 1.4 erh #define LINUX_AF_DECnet 12
68 1.4 erh #define LINUX_AF_NETBEUI 13
69 1.4 erh #define LINUX_AF_SECURITY 14
70 1.4 erh #define LINUX_pseudo_AF_KEY 15
71 1.4 erh #define LINUX_AF_NETLINK 16
72 1.4 erh #define LINUX_AF_PACKET 17
73 1.4 erh #define LINUX_AF_ASH 18
74 1.4 erh #define LINUX_AF_ECONET 19
75 1.4 erh #define LINUX_AF_ATMSVC 20
76 1.4 erh #define LINUX_AF_SNA 22
77 1.4 erh #define LINUX_AF_MAX 32
78 1.1 fvdl
79 1.1 fvdl /*
80 1.1 fvdl * Option levels for [gs]etsockopt(2). Only SOL_SOCKET is different,
81 1.1 fvdl * the rest matches IPPROTO_XXX
82 1.1 fvdl */
83 1.1 fvdl
84 1.4 erh /* SOL_SOCKET is machine dependant on Linux */
85 1.1 fvdl #define LINUX_SOL_IP 0
86 1.4 erh #define LINUX_SOL_TCP 6
87 1.4 erh #define LINUX_SOL_UDP 17
88 1.4 erh /* Unused for now: */
89 1.4 erh #define LINUX_SOL_IPV6 41
90 1.4 erh #define LINUX_SOL_ICMPV6 58
91 1.4 erh #define LINUX_SOL_RAW 255
92 1.1 fvdl #define LINUX_SOL_IPX 256
93 1.1 fvdl #define LINUX_SOL_AX25 257
94 1.4 erh #define LINUX_SOL_ATALK 258
95 1.4 erh #define LINUX_SOL_NETROM 259
96 1.4 erh #define LINUX_SOL_ROSE 260
97 1.4 erh #define LINUX_SOL_DECNET 261
98 1.4 erh #define LINUX_SOL_X25 262
99 1.4 erh #define LINUX_SOL_PACKET 263
100 1.4 erh #define LINUX_SOL_ATM 264
101 1.4 erh #define LINUX_SOL_AAL 265
102 1.1 fvdl
103 1.1 fvdl /*
104 1.4 erh * Options for [gs]etsockopt(2), socket level are machine dependant.
105 1.1 fvdl */
106 1.1 fvdl
107 1.1 fvdl /*
108 1.4 erh * Options for [gs]etsockopt(2), IP level.
109 1.1 fvdl */
110 1.1 fvdl
111 1.2 mycroft #define LINUX_IP_TOS 1
112 1.2 mycroft #define LINUX_IP_TTL 2
113 1.2 mycroft #define LINUX_IP_MULTICAST_IF 32
114 1.2 mycroft #define LINUX_IP_MULTICAST_TTL 33
115 1.2 mycroft #define LINUX_IP_MULTICAST_LOOP 34
116 1.2 mycroft #define LINUX_IP_ADD_MEMBERSHIP 35
117 1.2 mycroft #define LINUX_IP_DROP_MEMBERSHIP 36
118 1.3 mycroft
119 1.3 mycroft /*
120 1.4 erh * Options for [gs]etsockopt(2), TCP level.
121 1.3 mycroft */
122 1.3 mycroft
123 1.3 mycroft #define LINUX_TCP_NODELAY 1
124 1.3 mycroft #define LINUX_TCP_MAXSEG 2
125 1.1 fvdl
126 1.5 christos #if defined(__i386__)
127 1.5 christos #include <compat/linux/arch/i386/linux_socket.h>
128 1.7 itohy #elif defined(__m68k__)
129 1.7 itohy #include <compat/linux/arch/m68k/linux_socket.h>
130 1.5 christos #elif defined(__alpha__)
131 1.5 christos #include <compat/linux/arch/alpha/linux_socket.h>
132 1.8 manu #elif defined(__powerpc__)
133 1.8 manu #include <compat/linux/arch/powerpc/linux_socket.h>
134 1.8.4.1 thorpej #elif defined(__mips__)
135 1.8.4.1 thorpej #include <compat/linux/arch/mips/linux_socket.h>
136 1.5 christos #else
137 1.5 christos #error Undefined linux_socket.h machine type.
138 1.5 christos #endif
139 1.5 christos
140 1.5 christos #endif /* !_LINUX_SOCKET_H */
141