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