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