Home | History | Annotate | Line # | Download | only in common
linux_socket.h revision 1.4
      1  1.4      erh /*	$NetBSD: linux_socket.h,v 1.4 1998/10/01 01:19:07 erh 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.4      erh /* Note: Machine dependant portions of this file exist. */
     71  1.4      erh 
     72  1.4      erh #ifndef _COMMON_LINUX_SOCKET_H
     73  1.4      erh #define _COMMON_LINUX_SOCKET_H
     74  1.1     fvdl 
     75  1.1     fvdl /*
     76  1.1     fvdl  * Various Linux socket defines. Everything that is not re-defined here
     77  1.1     fvdl  * is the same as in NetBSD.
     78  1.1     fvdl  *
     79  1.1     fvdl  * COMPAT_43 is assumed, and the osockaddr struct is used (it is what
     80  1.1     fvdl  * Linux uses)
     81  1.1     fvdl  */
     82  1.1     fvdl 
     83  1.1     fvdl /*
     84  1.1     fvdl  * Address families. There are fewer of them, and they're numbered
     85  1.1     fvdl  * a bit different
     86  1.1     fvdl  */
     87  1.1     fvdl 
     88  1.1     fvdl #define LINUX_AF_UNSPEC		0
     89  1.1     fvdl #define LINUX_AF_UNIX		1
     90  1.1     fvdl #define LINUX_AF_INET		2
     91  1.1     fvdl #define LINUX_AF_AX25		3
     92  1.1     fvdl #define LINUX_AF_IPX		4
     93  1.1     fvdl #define LINUX_AF_APPLETALK	5
     94  1.4      erh #define LINUX_AF_NETROM		6
     95  1.4      erh #define LINUX_AF_BRIDGE		7
     96  1.4      erh #define LINUX_AF_ATMPVC		8
     97  1.4      erh #define LINUX_AF_X25		9
     98  1.4      erh #define LINUX_AF_INET6		10
     99  1.4      erh #define LINUX_AF_ROSE		11
    100  1.4      erh #define LINUX_AF_DECnet		12
    101  1.4      erh #define LINUX_AF_NETBEUI	13
    102  1.4      erh #define LINUX_AF_SECURITY	14
    103  1.4      erh #define LINUX_pseudo_AF_KEY	15
    104  1.4      erh #define LINUX_AF_NETLINK	16
    105  1.4      erh #define LINUX_AF_PACKET		17
    106  1.4      erh #define LINUX_AF_ASH		18
    107  1.4      erh #define LINUX_AF_ECONET		19
    108  1.4      erh #define	LINUX_AF_ATMSVC		20
    109  1.4      erh #define	LINUX_AF_SNA		22
    110  1.4      erh #define LINUX_AF_MAX		32
    111  1.1     fvdl 
    112  1.1     fvdl /*
    113  1.1     fvdl  * Option levels for [gs]etsockopt(2). Only SOL_SOCKET is different,
    114  1.1     fvdl  * the rest matches IPPROTO_XXX
    115  1.1     fvdl  */
    116  1.1     fvdl 
    117  1.4      erh /* SOL_SOCKET is machine dependant on Linux */
    118  1.1     fvdl #define LINUX_SOL_IP		0
    119  1.4      erh #define LINUX_SOL_TCP		6
    120  1.4      erh #define LINUX_SOL_UDP		17
    121  1.4      erh /* Unused for now: */
    122  1.4      erh #define LINUX_SOL_IPV6		41
    123  1.4      erh #define LINUX_SOL_ICMPV6	58
    124  1.4      erh #define LINUX_SOL_RAW		255
    125  1.1     fvdl #define LINUX_SOL_IPX		256
    126  1.1     fvdl #define LINUX_SOL_AX25		257
    127  1.4      erh #define LINUX_SOL_ATALK		258
    128  1.4      erh #define LINUX_SOL_NETROM	259
    129  1.4      erh #define LINUX_SOL_ROSE		260
    130  1.4      erh #define LINUX_SOL_DECNET	261
    131  1.4      erh #define LINUX_SOL_X25		262
    132  1.4      erh #define LINUX_SOL_PACKET	263
    133  1.4      erh #define LINUX_SOL_ATM		264
    134  1.4      erh #define LINUX_SOL_AAL		265
    135  1.1     fvdl 
    136  1.1     fvdl /*
    137  1.4      erh  * Options for [gs]etsockopt(2), socket level are machine dependant.
    138  1.1     fvdl  */
    139  1.1     fvdl 
    140  1.1     fvdl /*
    141  1.4      erh  * Options for [gs]etsockopt(2), IP level.
    142  1.1     fvdl  */
    143  1.1     fvdl 
    144  1.2  mycroft #define LINUX_IP_TOS		1
    145  1.2  mycroft #define LINUX_IP_TTL		2
    146  1.2  mycroft #define	LINUX_IP_MULTICAST_IF	32
    147  1.2  mycroft #define	LINUX_IP_MULTICAST_TTL	33
    148  1.2  mycroft #define	LINUX_IP_MULTICAST_LOOP	34
    149  1.2  mycroft #define	LINUX_IP_ADD_MEMBERSHIP	35
    150  1.2  mycroft #define	LINUX_IP_DROP_MEMBERSHIP 36
    151  1.3  mycroft 
    152  1.3  mycroft /*
    153  1.4      erh  * Options for [gs]etsockopt(2), TCP level.
    154  1.3  mycroft  */
    155  1.3  mycroft 
    156  1.3  mycroft #define	LINUX_TCP_NODELAY	1
    157  1.3  mycroft #define	LINUX_TCP_MAXSEG	2
    158  1.1     fvdl 
    159  1.4      erh #endif /* !_COMMON_LINUX_SOCKET_H */
    160