sl@0: // © Portions copyright (c) 2006 Nokia Corporation. All rights reserved. sl@0: sl@0: /*- sl@0: * Copyright (c) 1982, 1986, 1990, 1993 sl@0: * The Regents of the University of California. All rights reserved. sl@0: * sl@0: * Redistribution and use in source and binary forms, with or without sl@0: * modification, are permitted provided that the following conditions sl@0: * are met: sl@0: * 1. Redistributions of source code must retain the above copyright sl@0: * notice, this list of conditions and the following disclaimer. sl@0: * 2. Redistributions in binary form must reproduce the above copyright sl@0: * notice, this list of conditions and the following disclaimer in the sl@0: * documentation and/or other materials provided with the distribution. sl@0: * 4. Neither the name of the University nor the names of its contributors sl@0: * may be used to endorse or promote products derived from this software sl@0: * without specific prior written permission. sl@0: * sl@0: * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND sl@0: * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE sl@0: * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE sl@0: * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE sl@0: * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL sl@0: * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS sl@0: * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) sl@0: * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT sl@0: * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY sl@0: * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF sl@0: * SUCH DAMAGE. sl@0: * sl@0: * @(#)in.h 8.3 (Berkeley) 1/3/94 sl@0: * $FreeBSD: src/sys/netinet/in.h,v 1.90.2.3 2005/10/02 15:45:47 andre Exp $ sl@0: */ sl@0: sl@0: #ifndef _NETINET_IN_H_ sl@0: #define _NETINET_IN_H_ sl@0: sl@0: #include sl@0: #include sl@0: #include sl@0: sl@0: /* Protocols common to RFC 1700, POSIX, and X/Open. */ sl@0: #ifdef __SYMBIAN32__ sl@0: #define IPPROTO_IP 0x100 /* KProtocolInetIp */ sl@0: #else sl@0: #define IPPROTO_IP 0 /* dummy for IP */ sl@0: #endif // __SYMBIAN32__ sl@0: #define IPPROTO_ICMP 1 /* control message protocol KProtocolInetIcmp */ sl@0: #define IPPROTO_TCP 6 /* tcp KProtocolInetTcp */ sl@0: #define IPPROTO_UDP 17 /* user datagram protocol KProtocolInetUdp */ sl@0: sl@0: #define INADDR_ANY (u_int32_t)0x00000000 sl@0: #define INADDR_BROADCAST (u_int32_t)0xffffffff /* must be masked */ sl@0: sl@0: #ifndef _UINT8_T_DECLARED sl@0: typedef __uint8_t uint8_t; sl@0: #define _UINT8_T_DECLARED sl@0: #endif sl@0: sl@0: #ifndef _UINT16_T_DECLARED sl@0: typedef __uint16_t uint16_t; sl@0: #define _UINT16_T_DECLARED sl@0: #endif sl@0: sl@0: #ifndef _UINT32_T_DECLARED sl@0: typedef __uint32_t uint32_t; sl@0: #define _UINT32_T_DECLARED sl@0: #endif sl@0: sl@0: #ifndef _IN_ADDR_T_DECLARED sl@0: typedef uint32_t in_addr_t; sl@0: #define _IN_ADDR_T_DECLARED sl@0: #endif sl@0: sl@0: #ifndef _IN_PORT_T_DECLARED sl@0: typedef uint16_t in_port_t; sl@0: #define _IN_PORT_T_DECLARED sl@0: #endif sl@0: sl@0: #ifndef _SA_FAMILY_T_DECLARED sl@0: typedef __sa_family_t sa_family_t; sl@0: #define _SA_FAMILY_T_DECLARED sl@0: #endif sl@0: sl@0: /* Internet address (a structure for historical reasons). */ sl@0: #ifndef _STRUCT_IN_ADDR_DECLARED sl@0: struct in_addr { sl@0: in_addr_t s_addr; sl@0: }; sl@0: #define _STRUCT_IN_ADDR_DECLARED sl@0: #endif sl@0: sl@0: /* Socket address, internet style. */ sl@0: #ifdef __SYMBIAN32__ sl@0: struct sockaddr_in { sl@0: u_short sin_family; sl@0: u_short sin_port; sl@0: struct in_addr sin_addr; sl@0: char sin_zero[20]; sl@0: }; sl@0: #else sl@0: struct sockaddr_in { sl@0: uint8_t sin_len; sl@0: sa_family_t sin_family; sl@0: in_port_t sin_port; sl@0: struct in_addr sin_addr; sl@0: char sin_zero[8]; sl@0: }; sl@0: #endif // __SYMBIAN32__ sl@0: sl@0: #ifdef __SYMBIAN32__ sl@0: #define SOL_IP 0x100 /* options for IP level KSolInetIp */ sl@0: #define SOL_TCP 0x106 /* options for TCP level KSolInetTcp */ sl@0: sl@0: /* sl@0: * User-settable options (used with setsockopt). sl@0: */ sl@0: #define TCP_NODELAY 0x304 /* don't delay send to coalesce packets KSoTcpNoDelay */ sl@0: #define TCP_MAXSEG 0x303 /* set maximum segment size KSoTcpMaxSegSize */ sl@0: sl@0: #endif //__SYMBIAN32__ sl@0: sl@0: #ifndef _KERNEL sl@0: sl@0: #ifndef _BYTEORDER_PROTOTYPED sl@0: #define _BYTEORDER_PROTOTYPED sl@0: __BEGIN_DECLS sl@0: IMPORT_C uint32_t htonl(uint32_t); sl@0: IMPORT_C uint16_t htons(uint16_t); sl@0: uint32_t ntohl(uint32_t); sl@0: uint16_t ntohs(uint16_t); sl@0: __END_DECLS sl@0: #endif sl@0: sl@0: #ifndef _BYTEORDER_FUNC_DEFINED sl@0: #define _BYTEORDER_FUNC_DEFINED sl@0: #define htonl(x) __htonl(x) sl@0: #define htons(x) __htons(x) sl@0: #define ntohl(x) __ntohl(x) sl@0: #define ntohs(x) __ntohs(x) sl@0: #endif sl@0: sl@0: #endif /* !_KERNEL */ sl@0: sl@0: #if __POSIX_VISIBLE >= 200112 sl@0: #define IPPROTO_RAW 255 /* raw IP packet */ sl@0: #define INET_ADDRSTRLEN 16 sl@0: #endif sl@0: sl@0: #if __BSD_VISIBLE sl@0: /* sl@0: * Constants and structures defined by the internet system, sl@0: * Per RFC 790, September 1981, and numerous additions. sl@0: */ sl@0: sl@0: /* sl@0: * Protocols (RFC 1700) sl@0: */ sl@0: #define IPPROTO_HOPOPTS 0 /* IP6 hop-by-hop options */ sl@0: #define IPPROTO_IGMP 2 /* group mgmt protocol */ sl@0: #define IPPROTO_GGP 3 /* gateway^2 (deprecated) */ sl@0: #define IPPROTO_IPV4 4 /* IPv4 encapsulation */ sl@0: #define IPPROTO_IPIP IPPROTO_IPV4 /* for compatibility */ sl@0: #define IPPROTO_ST 7 /* Stream protocol II */ sl@0: #define IPPROTO_EGP 8 /* exterior gateway protocol */ sl@0: #define IPPROTO_PIGP 9 /* private interior gateway */ sl@0: #define IPPROTO_RCCMON 10 /* BBN RCC Monitoring */ sl@0: #define IPPROTO_NVPII 11 /* network voice protocol*/ sl@0: #define IPPROTO_PUP 12 /* pup */ sl@0: #define IPPROTO_ARGUS 13 /* Argus */ sl@0: #define IPPROTO_EMCON 14 /* EMCON */ sl@0: #define IPPROTO_XNET 15 /* Cross Net Debugger */ sl@0: #define IPPROTO_CHAOS 16 /* Chaos*/ sl@0: #define IPPROTO_MUX 18 /* Multiplexing */ sl@0: #define IPPROTO_MEAS 19 /* DCN Measurement Subsystems */ sl@0: #define IPPROTO_HMP 20 /* Host Monitoring */ sl@0: #define IPPROTO_PRM 21 /* Packet Radio Measurement */ sl@0: #define IPPROTO_IDP 22 /* xns idp */ sl@0: #define IPPROTO_TRUNK1 23 /* Trunk-1 */ sl@0: #define IPPROTO_TRUNK2 24 /* Trunk-2 */ sl@0: #define IPPROTO_LEAF1 25 /* Leaf-1 */ sl@0: #define IPPROTO_LEAF2 26 /* Leaf-2 */ sl@0: #define IPPROTO_RDP 27 /* Reliable Data */ sl@0: #define IPPROTO_IRTP 28 /* Reliable Transaction */ sl@0: #define IPPROTO_TP 29 /* tp-4 w/ class negotiation */ sl@0: #define IPPROTO_BLT 30 /* Bulk Data Transfer */ sl@0: #define IPPROTO_NSP 31 /* Network Services */ sl@0: #define IPPROTO_INP 32 /* Merit Internodal */ sl@0: #define IPPROTO_SEP 33 /* Sequential Exchange */ sl@0: #define IPPROTO_3PC 34 /* Third Party Connect */ sl@0: #define IPPROTO_IDPR 35 /* InterDomain Policy Routing */ sl@0: #define IPPROTO_XTP 36 /* XTP */ sl@0: #define IPPROTO_DDP 37 /* Datagram Delivery */ sl@0: #define IPPROTO_CMTP 38 /* Control Message Transport */ sl@0: #define IPPROTO_TPXX 39 /* TP++ Transport */ sl@0: #define IPPROTO_IL 40 /* IL transport protocol */ sl@0: #define IPPROTO_IPV6 41 /* IP6 header */ sl@0: #define IPPROTO_SDRP 42 /* Source Demand Routing */ sl@0: #define IPPROTO_ROUTING 43 /* IP6 routing header */ sl@0: #define IPPROTO_FRAGMENT 44 /* IP6 fragmentation header */ sl@0: #define IPPROTO_IDRP 45 /* InterDomain Routing*/ sl@0: #define IPPROTO_RSVP 46 /* resource reservation */ sl@0: #define IPPROTO_GRE 47 /* General Routing Encap. */ sl@0: #define IPPROTO_MHRP 48 /* Mobile Host Routing */ sl@0: #define IPPROTO_BHA 49 /* BHA */ sl@0: #define IPPROTO_ESP 50 /* IP6 Encap Sec. Payload */ sl@0: #define IPPROTO_AH 51 /* IP6 Auth Header */ sl@0: #define IPPROTO_INLSP 52 /* Integ. Net Layer Security */ sl@0: #define IPPROTO_SWIPE 53 /* IP with encryption */ sl@0: #define IPPROTO_NHRP 54 /* Next Hop Resolution */ sl@0: #define IPPROTO_MOBILE 55 /* IP Mobility */ sl@0: #define IPPROTO_TLSP 56 /* Transport Layer Security */ sl@0: #define IPPROTO_SKIP 57 /* SKIP */ sl@0: #define IPPROTO_ICMPV6 58 /* ICMP6 */ sl@0: #define IPPROTO_NONE 59 /* IP6 no next header */ sl@0: #define IPPROTO_DSTOPTS 60 /* IP6 destination option */ sl@0: #define IPPROTO_AHIP 61 /* any host internal protocol */ sl@0: #define IPPROTO_CFTP 62 /* CFTP */ sl@0: #define IPPROTO_HELLO 63 /* "hello" routing protocol */ sl@0: #define IPPROTO_SATEXPAK 64 /* SATNET/Backroom EXPAK */ sl@0: #define IPPROTO_KRYPTOLAN 65 /* Kryptolan */ sl@0: #define IPPROTO_RVD 66 /* Remote Virtual Disk */ sl@0: #define IPPROTO_IPPC 67 /* Pluribus Packet Core */ sl@0: #define IPPROTO_ADFS 68 /* Any distributed FS */ sl@0: #define IPPROTO_SATMON 69 /* Satnet Monitoring */ sl@0: #define IPPROTO_VISA 70 /* VISA Protocol */ sl@0: #define IPPROTO_IPCV 71 /* Packet Core Utility */ sl@0: #define IPPROTO_CPNX 72 /* Comp. Prot. Net. Executive */ sl@0: #define IPPROTO_CPHB 73 /* Comp. Prot. HeartBeat */ sl@0: #define IPPROTO_WSN 74 /* Wang Span Network */ sl@0: #define IPPROTO_PVP 75 /* Packet Video Protocol */ sl@0: #define IPPROTO_BRSATMON 76 /* BackRoom SATNET Monitoring */ sl@0: #define IPPROTO_ND 77 /* Sun net disk proto (temp.) */ sl@0: #define IPPROTO_WBMON 78 /* WIDEBAND Monitoring */ sl@0: #define IPPROTO_WBEXPAK 79 /* WIDEBAND EXPAK */ sl@0: #define IPPROTO_EON 80 /* ISO cnlp */ sl@0: #define IPPROTO_VMTP 81 /* VMTP */ sl@0: #define IPPROTO_SVMTP 82 /* Secure VMTP */ sl@0: #define IPPROTO_VINES 83 /* Banyon VINES */ sl@0: #define IPPROTO_TTP 84 /* TTP */ sl@0: #define IPPROTO_IGP 85 /* NSFNET-IGP */ sl@0: #define IPPROTO_DGP 86 /* dissimilar gateway prot. */ sl@0: #define IPPROTO_TCF 87 /* TCF */ sl@0: #define IPPROTO_IGRP 88 /* Cisco/GXS IGRP */ sl@0: #define IPPROTO_OSPFIGP 89 /* OSPFIGP */ sl@0: #define IPPROTO_SRPC 90 /* Strite RPC protocol */ sl@0: #define IPPROTO_LARP 91 /* Locus Address Resoloution */ sl@0: #define IPPROTO_MTP 92 /* Multicast Transport */ sl@0: #define IPPROTO_AX25 93 /* AX.25 Frames */ sl@0: #define IPPROTO_IPEIP 94 /* IP encapsulated in IP */ sl@0: #define IPPROTO_MICP 95 /* Mobile Int.ing control */ sl@0: #define IPPROTO_SCCSP 96 /* Semaphore Comm. security */ sl@0: #define IPPROTO_ETHERIP 97 /* Ethernet IP encapsulation */ sl@0: #ifdef __SYMBIAN32__ sl@0: #define IPPROTO_ENCAP 4 /* IP in IP encapsulation */ sl@0: #else sl@0: #define IPPROTO_ENCAP 98 /* encapsulation header */ sl@0: #endif // __SYMBIAN32__ sl@0: #define IPPROTO_APES 99 /* any private encr. scheme */ sl@0: #define IPPROTO_GMTP 100 /* GMTP*/ sl@0: #define IPPROTO_IPCOMP 108 /* payload compression (IPComp) */ sl@0: /* 101-254: Partly Unassigned */ sl@0: #define IPPROTO_PIM 103 /* Protocol Independent Mcast */ sl@0: #define IPPROTO_CARP 112 /* CARP */ sl@0: #define IPPROTO_PGM 113 /* PGM */ sl@0: #define IPPROTO_PFSYNC 240 /* PFSYNC */ sl@0: /* 255: Reserved */ sl@0: /* BSD Private, local use, namespace incursion, no longer used */ sl@0: #define IPPROTO_OLD_DIVERT 254 /* OLD divert pseudo-proto */ sl@0: #ifdef __SYMBIAN32__ sl@0: #define IPPROTO_MAX 0x101 sl@0: #else sl@0: #define IPPROTO_MAX 256 sl@0: #endif // __SYMBIAN32__ sl@0: sl@0: /* last return value of *_input(), meaning "all job for this pkt is done". */ sl@0: #define IPPROTO_DONE 257 sl@0: sl@0: /* Only used internally, so can be outside the range of valid IP protocols. */ sl@0: #define IPPROTO_DIVERT 258 /* divert pseudo-protocol */ sl@0: sl@0: /* sl@0: * Defined to avoid confusion. The master value is defined by sl@0: * PROTO_SPACER in sys/protosw.h. sl@0: */ sl@0: #define IPPROTO_SPACER 32767 /* spacer for loadable protos */ sl@0: sl@0: /* sl@0: * Local port number conventions: sl@0: * sl@0: * When a user does a bind(2) or connect(2) with a port number of zero, sl@0: * a non-conflicting local port address is chosen. sl@0: * The default range is IPPORT_HIFIRSTAUTO through sl@0: * IPPORT_HILASTAUTO, although that is settable by sysctl. sl@0: * sl@0: * A user may set the IPPROTO_IP option IP_PORTRANGE to change this sl@0: * default assignment range. sl@0: * sl@0: * The value IP_PORTRANGE_DEFAULT causes the default behavior. sl@0: * sl@0: * The value IP_PORTRANGE_HIGH changes the range of candidate port numbers sl@0: * into the "high" range. These are reserved for client outbound connections sl@0: * which do not want to be filtered by any firewalls. Note that by default sl@0: * this is the same as IP_PORTRANGE_DEFAULT. sl@0: * sl@0: * The value IP_PORTRANGE_LOW changes the range to the "low" are sl@0: * that is (by convention) restricted to privileged processes. This sl@0: * convention is based on "vouchsafe" principles only. It is only secure sl@0: * if you trust the remote host to restrict these ports. sl@0: * sl@0: * The default range of ports and the high range can be changed by sl@0: * sysctl(3). (net.inet.ip.port{hi,low}{first,last}_auto) sl@0: * sl@0: * Changing those values has bad security implications if you are sl@0: * using a stateless firewall that is allowing packets outside of that sl@0: * range in order to allow transparent outgoing connections. sl@0: * sl@0: * Such a firewall configuration will generally depend on the use of these sl@0: * default values. If you change them, you may find your Security sl@0: * Administrator looking for you with a heavy object. sl@0: * sl@0: * For a slightly more orthodox text view on this: sl@0: * sl@0: * ftp://ftp.isi.edu/in-notes/iana/assignments/port-numbers sl@0: * sl@0: * port numbers are divided into three ranges: sl@0: * sl@0: * 0 - 1023 Well Known Ports sl@0: * 1024 - 49151 Registered Ports sl@0: * 49152 - 65535 Dynamic and/or Private Ports sl@0: * sl@0: */ sl@0: sl@0: /* sl@0: * Ports < IPPORT_RESERVED are reserved for sl@0: * privileged processes (e.g. root). (IP_PORTRANGE_LOW) sl@0: */ sl@0: #define IPPORT_RESERVED 1024 sl@0: sl@0: /* sl@0: * Default local port range, used by both IP_PORTRANGE_DEFAULT sl@0: * and IP_PORTRANGE_HIGH. sl@0: */ sl@0: #define IPPORT_HIFIRSTAUTO 49152 sl@0: #define IPPORT_HILASTAUTO 65535 sl@0: sl@0: /* sl@0: * Scanning for a free reserved port return a value below IPPORT_RESERVED, sl@0: * but higher than IPPORT_RESERVEDSTART. Traditionally the start value was sl@0: * 512, but that conflicts with some well-known-services that firewalls may sl@0: * have a fit if we use. sl@0: */ sl@0: #define IPPORT_RESERVEDSTART 600 sl@0: sl@0: #define IPPORT_MAX 65535 sl@0: sl@0: /* sl@0: * Definitions of bits in internet address integers. sl@0: * On subnets, the decomposition of addresses to host and net parts sl@0: * is done according to subnet mask, not the masks here. sl@0: */ sl@0: #define IN_CLASSA(i) (((u_int32_t)(i) & 0x80000000) == 0) sl@0: #define IN_CLASSA_NET 0xff000000 sl@0: #define IN_CLASSA_NSHIFT 24 sl@0: #define IN_CLASSA_HOST 0x00ffffff sl@0: #define IN_CLASSA_MAX 128 sl@0: sl@0: #define IN_CLASSB(i) (((u_int32_t)(i) & 0xc0000000) == 0x80000000) sl@0: #define IN_CLASSB_NET 0xffff0000 sl@0: #define IN_CLASSB_NSHIFT 16 sl@0: #define IN_CLASSB_HOST 0x0000ffff sl@0: #define IN_CLASSB_MAX 65536 sl@0: sl@0: #define IN_CLASSC(i) (((u_int32_t)(i) & 0xe0000000) == 0xc0000000) sl@0: #define IN_CLASSC_NET 0xffffff00 sl@0: #define IN_CLASSC_NSHIFT 8 sl@0: #define IN_CLASSC_HOST 0x000000ff sl@0: sl@0: #define IN_CLASSD(i) (((u_int32_t)(i) & 0xf0000000) == 0xe0000000) sl@0: #define IN_CLASSD_NET 0xf0000000 /* These ones aren't really */ sl@0: #define IN_CLASSD_NSHIFT 28 /* net and host fields, but */ sl@0: #define IN_CLASSD_HOST 0x0fffffff /* routing needn't know. */ sl@0: #define IN_MULTICAST(i) IN_CLASSD(i) sl@0: sl@0: #define IN_EXPERIMENTAL(i) (((u_int32_t)(i) & 0xf0000000) == 0xf0000000) sl@0: #define IN_BADCLASS(i) (((u_int32_t)(i) & 0xf0000000) == 0xf0000000) sl@0: sl@0: #define INADDR_LOOPBACK (u_int32_t)0x7f000001 sl@0: #ifndef _KERNEL sl@0: #define INADDR_NONE 0xffffffff /* -1 return */ sl@0: #endif sl@0: sl@0: #define INADDR_UNSPEC_GROUP (u_int32_t)0xe0000000 /* 224.0.0.0 */ sl@0: #define INADDR_ALLHOSTS_GROUP (u_int32_t)0xe0000001 /* 224.0.0.1 */ sl@0: #define INADDR_ALLRTRS_GROUP (u_int32_t)0xe0000002 /* 224.0.0.2 */ sl@0: #define INADDR_CARP_GROUP (u_int32_t)0xe0000012 /* 224.0.0.18 */ sl@0: #define INADDR_PFSYNC_GROUP (u_int32_t)0xe00000f0 /* 224.0.0.240 */ sl@0: #define INADDR_ALLMDNS_GROUP (u_int32_t)0xe00000fb /* 224.0.0.251 */ sl@0: #define INADDR_MAX_LOCAL_GROUP (u_int32_t)0xe00000ff /* 224.0.0.255 */ sl@0: sl@0: #define IN_LOOPBACKNET 127 /* official! */ sl@0: sl@0: /* sl@0: * Options for use with [gs]etsockopt at the IP level. sl@0: * First word of comment is data type; bool is stored in int. sl@0: */ sl@0: #ifdef __SYMBIAN32__ sl@0: #define IP_OPTIONS 0x306 /* buf/ip_opts; set/get IP options */ sl@0: #else sl@0: #define IP_OPTIONS 1 /* buf/ip_opts; set/get IP options */ sl@0: #endif // __SYMBIAN32__ sl@0: #ifdef __SYMBIAN32__ sl@0: #define IP_HDRINCL 0x308 /* int; header is included with data */ sl@0: #else sl@0: #define IP_HDRINCL 2 /* int; header is included with data */ sl@0: #endif // __SYMBIAN32__ sl@0: #ifdef __SYMBIAN32__ sl@0: #define IP_TOS 0x309 /* int; IP type of service and preced. */ sl@0: #else sl@0: #define IP_TOS 3 /* int; IP type of service and preced. */ sl@0: #endif // __SYMBIAN32__ sl@0: #ifdef __SYMBIAN32__ sl@0: #define IP_TTL 0x310 /* int; IP time to live */ sl@0: #else sl@0: #define IP_TTL 4 /* int; IP time to live */ sl@0: #endif // __SYMBIAN32__ sl@0: #ifdef __SYMBIAN32__ sl@0: #define IP_RECVOPTS -1 /* bool; receive all IP opts w/dgram */ sl@0: #else sl@0: #define IP_RECVOPTS 5 /* bool; receive all IP opts w/dgram */ sl@0: #endif sl@0: #ifdef __SYMBIAN32__ sl@0: #define IP_RECVRETOPTS -2 /* bool; receive IP opts for response */ sl@0: #else sl@0: #define IP_RECVRETOPTS 6 /* bool; receive IP opts for response */ sl@0: #endif sl@0: #ifdef __SYMBIAN32__ sl@0: #define IP_RECVDSTADDR -3 /* bool; receive IP dst addr w/dgram */ sl@0: #else sl@0: #define IP_RECVDSTADDR 7 /* bool; receive IP dst addr w/dgram */ sl@0: #endif sl@0: #define IP_SENDSRCADDR IP_RECVDSTADDR /* cmsg_type to set src addr */ sl@0: #ifdef __SYMBIAN32__ sl@0: #define IP_RETOPTS -4 /* ip_opts; set/get IP options */ sl@0: #else sl@0: #define IP_RETOPTS 8 /* ip_opts; set/get IP options */ sl@0: #endif // __SYMBIAN32__ sl@0: #ifdef __SYMBIAN32__ sl@0: #define IP_MULTICAST_IF -5 /* set/get IP multicast interface */ sl@0: #else sl@0: #define IP_MULTICAST_IF 9 /* u_char; set/get IP multicast i/f */ sl@0: #endif // __SYMBIAN32__ sl@0: #ifdef __SYMBIAN32__ sl@0: #define IP_MULTICAST_TTL -6 /* set/get IP multicast timetolive */ sl@0: #else sl@0: #define IP_MULTICAST_TTL 10 /* u_char; set/get IP multicast ttl */ sl@0: #endif // __SYMBIAN32__ sl@0: #ifdef __SYMBIAN32__ sl@0: #define IP_MULTICAST_LOOP -7 /* u_char; set/get IP multicast loopback */ sl@0: #else sl@0: #define IP_MULTICAST_LOOP 11 /* u_char; set/get IP multicast loopback */ sl@0: #endif // __SYMBIAN32__ sl@0: #ifdef __SYMBIAN32__ sl@0: #define IP_ADD_MEMBERSHIP 0x46d /* ip_mreq; add an IP group membership */ sl@0: #else sl@0: #define IP_ADD_MEMBERSHIP 12 /* ip_mreq; add an IP group membership */ sl@0: #endif // __SYMBIAN32__ sl@0: #ifdef __SYMBIAN32__ sl@0: #define IP_DROP_MEMBERSHIP 0x46e /* ip_mreq; drop an IP group membership */ sl@0: #else sl@0: #define IP_DROP_MEMBERSHIP 13 /* ip_mreq; drop an IP group membership */ sl@0: #endif // __SYMBIAN32__ sl@0: #define IP_MULTICAST_VIF 14 /* set/get IP mcast virt. iface */ sl@0: #define IP_RSVP_ON 15 /* enable RSVP in kernel */ sl@0: #define IP_RSVP_OFF 16 /* disable RSVP in kernel */ sl@0: #define IP_RSVP_VIF_ON 17 /* set RSVP per-vif socket */ sl@0: #define IP_RSVP_VIF_OFF 18 /* unset RSVP per-vif socket */ sl@0: #define IP_PORTRANGE 19 /* int; range to choose for unspec port */ sl@0: #define IP_RECVIF 20 /* bool; receive reception if w/dgram */ sl@0: /* for IPSEC */ sl@0: #define IP_IPSEC_POLICY 21 /* int; set/get security policy */ sl@0: #define IP_FAITH 22 /* bool; accept FAITH'ed connections */ sl@0: sl@0: #define IP_ONESBCAST 23 /* bool: send all-ones broadcast */ sl@0: sl@0: #define IP_FW_TABLE_ADD 40 /* add entry */ sl@0: #define IP_FW_TABLE_DEL 41 /* delete entry */ sl@0: #define IP_FW_TABLE_FLUSH 42 /* flush table */ sl@0: #define IP_FW_TABLE_GETSIZE 43 /* get table size */ sl@0: #define IP_FW_TABLE_LIST 44 /* list table contents */ sl@0: sl@0: #define IP_FW_ADD 50 /* add a firewall rule to chain */ sl@0: #define IP_FW_DEL 51 /* delete a firewall rule from chain */ sl@0: #define IP_FW_FLUSH 52 /* flush firewall rule chain */ sl@0: #define IP_FW_ZERO 53 /* clear single/all firewall counter(s) */ sl@0: #define IP_FW_GET 54 /* get entire firewall rule chain */ sl@0: #define IP_FW_RESETLOG 55 /* reset logging counters */ sl@0: sl@0: #define IP_DUMMYNET_CONFIGURE 60 /* add/configure a dummynet pipe */ sl@0: #define IP_DUMMYNET_DEL 61 /* delete a dummynet pipe from chain */ sl@0: #define IP_DUMMYNET_FLUSH 62 /* flush dummynet */ sl@0: #define IP_DUMMYNET_GET 64 /* get entire dummynet pipes */ sl@0: sl@0: #define IP_RECVTTL 65 /* bool; receive IP TTL w/dgram */ sl@0: #define IP_MINTTL 66 /* minimum TTL for packet or drop */ sl@0: #define IP_DONTFRAG 67 /* don't fragment packet */ sl@0: sl@0: /* sl@0: * Defaults and limits for options sl@0: */ sl@0: #define IP_DEFAULT_MULTICAST_TTL 1 /* normally limit m'casts to 1 hop */ sl@0: #define IP_DEFAULT_MULTICAST_LOOP 1 /* normally hear sends if a member */ sl@0: #define IP_MAX_MEMBERSHIPS 20 /* per socket */ sl@0: sl@0: /* sl@0: * Argument structure for IP_ADD_MEMBERSHIP and IP_DROP_MEMBERSHIP. sl@0: */ sl@0: struct ip_mreq { sl@0: struct in_addr imr_multiaddr; /* IP multicast address of group */ sl@0: struct in_addr imr_interface; /* local IP address of interface */ sl@0: }; sl@0: sl@0: /* sl@0: * Argument for IP_PORTRANGE: sl@0: * - which range to search when port is unspecified at bind() or connect() sl@0: */ sl@0: #define IP_PORTRANGE_DEFAULT 0 /* default range */ sl@0: #define IP_PORTRANGE_HIGH 1 /* "high" - request firewall bypass */ sl@0: #define IP_PORTRANGE_LOW 2 /* "low" - vouchsafe security */ sl@0: sl@0: /* sl@0: * Definitions for inet sysctl operations. sl@0: * sl@0: * Third level is protocol number. sl@0: * Fourth level is desired variable within that protocol. sl@0: */ sl@0: #define IPPROTO_MAXID (IPPROTO_AH + 1) /* don't list to IPPROTO_MAX */ sl@0: sl@0: #define CTL_IPPROTO_NAMES { \ sl@0: { "ip", CTLTYPE_NODE }, \ sl@0: { "icmp", CTLTYPE_NODE }, \ sl@0: { "igmp", CTLTYPE_NODE }, \ sl@0: { "ggp", CTLTYPE_NODE }, \ sl@0: { 0, 0 }, \ sl@0: { 0, 0 }, \ sl@0: { "tcp", CTLTYPE_NODE }, \ sl@0: { 0, 0 }, \ sl@0: { "egp", CTLTYPE_NODE }, \ sl@0: { 0, 0 }, \ sl@0: { 0, 0 }, \ sl@0: { 0, 0 }, \ sl@0: { "pup", CTLTYPE_NODE }, \ sl@0: { 0, 0 }, \ sl@0: { 0, 0 }, \ sl@0: { 0, 0 }, \ sl@0: { 0, 0 }, \ sl@0: { "udp", CTLTYPE_NODE }, \ sl@0: { 0, 0 }, \ sl@0: { 0, 0 }, \ sl@0: { 0, 0 }, \ sl@0: { 0, 0 }, \ sl@0: { "idp", CTLTYPE_NODE }, \ sl@0: { 0, 0 }, \ sl@0: { 0, 0 }, \ sl@0: { 0, 0 }, \ sl@0: { 0, 0 }, \ sl@0: { 0, 0 }, \ sl@0: { 0, 0 }, \ sl@0: { 0, 0 }, \ sl@0: { 0, 0 }, \ sl@0: { 0, 0 }, \ sl@0: { 0, 0 }, \ sl@0: { 0, 0 }, \ sl@0: { 0, 0 }, \ sl@0: { 0, 0 }, \ sl@0: { 0, 0 }, \ sl@0: { 0, 0 }, \ sl@0: { 0, 0 }, \ sl@0: { 0, 0 }, \ sl@0: { 0, 0 }, \ sl@0: { 0, 0 }, \ sl@0: { 0, 0 }, \ sl@0: { 0, 0 }, \ sl@0: { 0, 0 }, \ sl@0: { 0, 0 }, \ sl@0: { 0, 0 }, \ sl@0: { 0, 0 }, \ sl@0: { 0, 0 }, \ sl@0: { 0, 0 }, \ sl@0: { 0, 0 }, \ sl@0: { "ipsec", CTLTYPE_NODE }, \ sl@0: { 0, 0 }, \ sl@0: { 0, 0 }, \ sl@0: { 0, 0 }, \ sl@0: { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, \ sl@0: { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, \ sl@0: { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, \ sl@0: { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, \ sl@0: { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, \ sl@0: { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, \ sl@0: { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, \ sl@0: { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, \ sl@0: { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, \ sl@0: { 0, 0 }, \ sl@0: { 0, 0 }, \ sl@0: { 0, 0 }, \ sl@0: { "pim", CTLTYPE_NODE }, \ sl@0: } sl@0: sl@0: /* sl@0: * Names for IP sysctl objects sl@0: */ sl@0: #define IPCTL_FORWARDING 1 /* act as router */ sl@0: #define IPCTL_SENDREDIRECTS 2 /* may send redirects when forwarding */ sl@0: #define IPCTL_DEFTTL 3 /* default TTL */ sl@0: #ifdef notyet sl@0: #define IPCTL_DEFMTU 4 /* default MTU */ sl@0: #endif sl@0: #define IPCTL_RTEXPIRE 5 /* cloned route expiration time */ sl@0: #define IPCTL_RTMINEXPIRE 6 /* min value for expiration time */ sl@0: #define IPCTL_RTMAXCACHE 7 /* trigger level for dynamic expire */ sl@0: #define IPCTL_SOURCEROUTE 8 /* may perform source routes */ sl@0: #define IPCTL_DIRECTEDBROADCAST 9 /* may re-broadcast received packets */ sl@0: #define IPCTL_INTRQMAXLEN 10 /* max length of netisr queue */ sl@0: #define IPCTL_INTRQDROPS 11 /* number of netisr q drops */ sl@0: #define IPCTL_STATS 12 /* ipstat structure */ sl@0: #define IPCTL_ACCEPTSOURCEROUTE 13 /* may accept source routed packets */ sl@0: #define IPCTL_FASTFORWARDING 14 /* use fast IP forwarding code */ sl@0: #define IPCTL_KEEPFAITH 15 /* FAITH IPv4->IPv6 translater ctl */ sl@0: #define IPCTL_GIF_TTL 16 /* default TTL for gif encap packet */ sl@0: #define IPCTL_MAXID 17 sl@0: sl@0: #define IPCTL_NAMES { \ sl@0: { 0, 0 }, \ sl@0: { "forwarding", CTLTYPE_INT }, \ sl@0: { "redirect", CTLTYPE_INT }, \ sl@0: { "ttl", CTLTYPE_INT }, \ sl@0: { "mtu", CTLTYPE_INT }, \ sl@0: { "rtexpire", CTLTYPE_INT }, \ sl@0: { "rtminexpire", CTLTYPE_INT }, \ sl@0: { "rtmaxcache", CTLTYPE_INT }, \ sl@0: { "sourceroute", CTLTYPE_INT }, \ sl@0: { "directed-broadcast", CTLTYPE_INT }, \ sl@0: { "intr-queue-maxlen", CTLTYPE_INT }, \ sl@0: { "intr-queue-drops", CTLTYPE_INT }, \ sl@0: { "stats", CTLTYPE_STRUCT }, \ sl@0: { "accept_sourceroute", CTLTYPE_INT }, \ sl@0: { "fastforwarding", CTLTYPE_INT }, \ sl@0: } sl@0: sl@0: #endif /* __BSD_VISIBLE */ sl@0: sl@0: #ifdef _KERNEL sl@0: sl@0: struct ifnet; struct mbuf; /* forward declarations for Standard C */ sl@0: sl@0: char *inet_ntoa(struct in_addr); /* in libkern */ sl@0: sl@0: #define in_hosteq(s, t) ((s).s_addr == (t).s_addr) sl@0: #define in_nullhost(x) ((x).s_addr == INADDR_ANY) sl@0: sl@0: #define satosin(sa) ((struct sockaddr_in *)(sa)) sl@0: #define sintosa(sin) ((struct sockaddr *)(sin)) sl@0: #define ifatoia(ifa) ((struct in_ifaddr *)(ifa)) sl@0: sl@0: #endif /* _KERNEL */ sl@0: sl@0: /* INET6 stuff */ sl@0: #if __POSIX_VISIBLE >= 200112 sl@0: #define __KAME_NETINET_IN_H_INCLUDED_ sl@0: #include sl@0: #undef __KAME_NETINET_IN_H_INCLUDED_ sl@0: #endif sl@0: sl@0: #ifndef _KERNEL sl@0: sl@0: __BEGIN_DECLS sl@0: IMPORT_C int bindresvport (int __sockfd, struct sockaddr_in *__sock_in); sl@0: __END_DECLS sl@0: sl@0: #endif /* _KERNEL */ sl@0: sl@0: #endif /* !_NETINET_IN_H_*/