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