original files of m241

This commit is contained in:
neelimap
2026-07-30 11:19:44 +05:30
parent 170c2b3f3a
commit afc7070c1f
12254 changed files with 7655111 additions and 0 deletions
@@ -0,0 +1,185 @@
/* if_ether.h - network interface Ethernet header file */
/* Copyright 2001 - 2005 Wind River Systems, Inc. */
/*
* Copyright (c) 1982, 1986, 1993
* The Regents of the University of California. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
* This product includes software developed by the University of
* California, Berkeley and its contributors.
* 4. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* @(#)if_ether.h 8.3 (Berkeley) 5/2/95
* $FreeBSD: src/sys/netinet/if_ether.h,v 1.24.2.1 2002/02/13 21:38:56 fjoe Exp $
*/
/*
modification history
--------------------
02a,25oct06,kch Removed unsupported sockaddr_inarp and llinfo_arp structures.
01z,09sep06,kch Cleanup for IPNet integration.
01y,23feb05,vvv restored ether_tag_header definition for
backward-compatibility (SPR #102773)
01x,18feb05,wap Allow sysctl init routines to be scaled out
01w,08feb05,vvv _KERNEL cleanup
01v,23aug04,rp merged from COMP_WN_IPV6_BASE6_ITER5_TO_UNIFIED_PRE_MERGE
01u,28may04,niq Merging from base6 label POST_ITER5_FRZ16_REBASE (ver
/main/vdt/base6_itn5_networking-int/2)
01t,24feb04,nee Adding the prototype for ipEtherResolvRtn
01s,20nov03,niq Remove copyright_wrs.h file inclusion
01r,04nov03,rlm Ran batch header path update for header re-org.
01q,03nov03,rlm Removed wrn/coreip/ prefix from #includes for header re-org.
01p,23oct03,rlm updated #includes for header re-org
01o,15sep03,vvv updated path for new headers
01n,13aug03,niq Fix definition of la_rt (Part of Accordion Base6 merge)
01m,15may03,spm Tornado 2.2 FCS merge (SPR #63006; ver 01h,24may02,vvv:
TOR2_2-FCS-COPY label, tor2 branch, /wind/river VOB)
01l,09may03,vvv changed include order to fix build
01k,01may03,spm Tornado 2.2 CP1 merge (from ver 01i,13jan03,rae:
TOR2_2-CP1-F label, tor2_2-patch branch, /wind/river VOB)
01j,01feb03,pas merge from FreeBSD 4.7 - changed arp_rtrequest(),
arp_ifinit() calls
01i,09sep02,hsh add c++ protection
01h,13feb02,ham changed for tornado build
01g,09dec01,ppp adding llinfo_arp structure
01f,03oct01,ann commenting the prototype for arpintr
01e,17sep01,ppp Commenting out the static declaration of in_arpinput
01d,10sep01,ann adding some macros that could be helpful
01c,24aug01,ann moving the forward declaration of arpintr here from
if_ether.c
01b,14aug01,ppp Commenting out two definations.
01a,01aug01,ppp Created from FreeBSD 4.3
*/
#ifndef _NETINET_IF_ETHER_H_
#define _NETINET_IF_ETHER_H_
#include <cfgDefs.h>
#include <netinet/in.h>
#include <net/ethernet.h>
#include <net/if_arp.h>
#include <cfgDefs.h>
#ifdef __cplusplus
extern "C" {
#endif
/* Ether header for tagged frames */
struct ether_tag_header
{
u_char ether_dhost [6];
u_char ether_shost [6];
u_char etherTag [4];
u_short ether_type;
};
/*
* Clarinet
* The following macros are required as they are used in all the
* driver header files which include if_ether.h
*/
/*
* for compilers that have 4-bytes structure alignment rule,
* it is understood that sizeof (ether_header) is 0x10
*/
#define SIZEOF_ETHERHEADER 0xe
/* For tagged Ethernet headers */
#define SIZEOF_TAG_ETHERHEADER 0x12
/* minimal size of an ethernet frame including the headers supported
* by most ethernet chips.
*/
#define ETHERSMALL 60
/* End of Clarinet introduced macros */
/*
* Macro to map an IP multicast address to an Ethernet multicast address.
* The high-order 25 bits of the Ethernet address are statically assigned,
* and the low-order 23 bits are taken from the low end of the IP address.
*/
#define ETHER_MAP_IP_MULTICAST(ipaddr, enaddr) \
/* struct in_addr *ipaddr; */ \
/* u_char enaddr[ETHER_ADDR_LEN]; */ \
{ \
(enaddr)[0] = 0x01; \
(enaddr)[1] = 0x00; \
(enaddr)[2] = 0x5e; \
(enaddr)[3] = ((u_char *)ipaddr)[1] & 0x7f; \
(enaddr)[4] = ((u_char *)ipaddr)[2]; \
(enaddr)[5] = ((u_char *)ipaddr)[3]; \
}
/*
* Macro to map an IP6 multicast address to an Ethernet multicast address.
* The high-order 16 bits of the Ethernet address are statically assigned,
* and the low-order 32 bits are taken from the low end of the IP6 address.
*/
#define ETHER_MAP_IPV6_MULTICAST(ip6addr, enaddr) \
/* struct in6_addr *ip6addr; */ \
/* u_char enaddr[ETHER_ADDR_LEN]; */ \
{ \
(enaddr)[0] = 0x33; \
(enaddr)[1] = 0x33; \
(enaddr)[2] = ((u_char *)ip6addr)[12]; \
(enaddr)[3] = ((u_char *)ip6addr)[13]; \
(enaddr)[4] = ((u_char *)ip6addr)[14]; \
(enaddr)[5] = ((u_char *)ip6addr)[15]; \
}
#define ETHER_MULTICAST(enaddr) \
((enaddr)[0] == 0x1) && ((enaddr)[1] == 0x0) && ((enaddr)[2] == 0x5e)
/*
* Ethernet Address Resolution Protocol.
*
* See RFC 826 for protocol description. Structure below is adapted
* to resolving internet addresses. Field names used correspond to
* RFC 826.
*/
struct ether_arp {
struct arphdr ea_hdr; /* fixed-size header */
u_char arp_sha[ETHER_ADDR_LEN]; /* sender hardware address */
u_char arp_spa[4]; /* sender protocol address */
u_char arp_tha[ETHER_ADDR_LEN]; /* target hardware address */
u_char arp_tpa[4]; /* target protocol address */
};
#define arp_hrd ea_hdr.ar_hrd
#define arp_pro ea_hdr.ar_pro
#define arp_hln ea_hdr.ar_hln
#define arp_pln ea_hdr.ar_pln
#define arp_op ea_hdr.ar_op
#ifdef __cplusplus
}
#endif
#endif /* _NETINET_IF_ETHER_H_ */
@@ -0,0 +1,201 @@
/* igmp.h - igmp header file */
/* Copyright 2001-2005 Wind River Systems, Inc. */
/*
* Copyright (c) 1988 Stephen Deering.
* Copyright (c) 1992, 1993
* The Regents of the University of California. All rights reserved.
*
* This code is derived from software contributed to Berkeley by
* Stephen Deering of Stanford University.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
* This product includes software developed by the University of
* California, Berkeley and its contributors.
* 4. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* @(#)igmp.h 8.1 (Berkeley) 6/10/93
* $FreeBSD: src/sys/netinet/igmp.h,v 1.10 1999/08/28 00:49:15 peter Exp $
*/
/*
modification history
--------------------
01i,09jan12,h_x Move extern "C" after last header file include.
01h,29jun05,spm updated for IGMPv3 support
01g,20nov03,niq Remove copyright_wrs.h file inclusion
01f,05nov03,cdw Removal of unnecessary _KERNEL guards.
01e,04nov03,rlm Ran batch header path update for header re-org.
01d,03nov03,rlm Removed wrn/coreip/ prefix from #includes for header re-org.
01c,10jun03,vvv include netVersion.h
01b,10sep02,hsh add c++ protection
01a,27aug01,hsh Created from BSD 4.3
*/
#ifndef _NETINET_IGMP_H_
#define _NETINET_IGMP_H_
#include <netVersion.h>
#ifdef __cplusplus
extern "C" {
#endif
/*
* Internet Group Management Protocol (IGMP) definitions.
*
* Written by Steve Deering, Stanford, May 1988.
*
* MULTICAST Revision: 3.5.1.2
*/
/*
* IGMPv1/v2 packet and v3 Query packet format.
*/
struct igmp {
u_char igmp_type; /* version & type of IGMP message */
u_char igmp_code; /* subtype for routing msgs */
#define IGMP_EXP(x) (((x) >> 4) & 0x07)
#define IGMP_MANT(x) ((x) & 0x0f)
u_int16_t igmp_cksum; /* IP-style checksum */
struct in_addr igmp_group; /* group address being specified */
/* (zero for general query) */
u_int8_t igmp_rtval; /* Reserved, S Flag and QRV */
#define IGMP_QRESV(x) (((x) >> 4) & 0x0f)
#define IGMP_SFLAG(x) (((x) >> 3) & 0x01)
#define IGMP_QRV(x) ((x) & 0x07) /* querier's robustness variable */
u_int8_t igmp_qqi; /* querier's query interval (QQI) */
u_int16_t igmp_numsrc; /* number of sources (zero for general*/
/* and group-specific queries) */
struct in_addr src[1]; /* source address list */
} __attribute__((__packed__));
/*
* IGMPv3 Membership Report Message header.
*/
struct igmp_report_hdr {
u_int8_t igmp_type; /* version & type of IGMP message */
u_int8_t igmp_reserved1; /* reserved (set to zero) */
u_int16_t igmp_cksum; /* IP-style checksum */
u_int16_t igmp_reserved2; /* reserved (set to zero) */
u_int16_t igmp_grpnum; /* number of group record */
} __attribute__((__packed__));
/*
* IGMPv3 Group Record header.
*/
struct igmp_group_record_hdr {
u_int8_t record_type; /* record types for membership report */
u_int8_t auxlen; /* aux data length (must be zero) */
u_int16_t numsrc; /* number of sources */
struct in_addr group; /* group address */
struct in_addr src[1]; /* source address list */
} __attribute__((__packed__));
#define IGMP_MINLEN 8
/*
* Message types, including version number.
*/
#define IGMP_MEMBERSHIP_QUERY 0x11 /* membership query */
#define IGMP_V1_MEMBERSHIP_REPORT 0x12 /* Ver. 1 membership report */
#define IGMP_V2_MEMBERSHIP_REPORT 0x16 /* Ver. 2 membership report */
#define IGMP_V2_LEAVE_GROUP 0x17 /* Leave-group message */
#define IGMP_DVMRP 0x13 /* DVMRP routing message */
#define IGMP_PIM 0x14 /* PIM routing message */
#define IGMP_MTRACE_RESP 0x1e /* traceroute resp.(to sender)*/
#define IGMP_MTRACE 0x1f /* mcast traceroute messages */
#define IGMP_MAX_HOST_REPORT_DELAY 10 /* max delay for response to */
/* query (in seconds) according */
/* to RFC1112 */
#define IGMP_TIMER_SCALE 10 /* denotes that the igmp code field */
/* specifies time in 10th of seconds*/
/*
* The following four defininitions are for backwards compatibility.
* They should be removed as soon as all applications are updated to
* use the new constant names.
*/
#define IGMP_HOST_MEMBERSHIP_QUERY IGMP_MEMBERSHIP_QUERY
#define IGMP_HOST_MEMBERSHIP_REPORT IGMP_V1_MEMBERSHIP_REPORT
#define IGMP_HOST_NEW_MEMBERSHIP_REPORT IGMP_V2_MEMBERSHIP_REPORT
#define IGMP_HOST_LEAVE_MESSAGE IGMP_V2_LEAVE_GROUP
#ifdef __cplusplus
}
#endif
#define IGMP_v3_HOST_MEMBERSHIP_REPORT 0x22 /* v3 membership report */
#define IGMP_v3_GENERAL_QUERY 1
#define IGMP_v3_GROUP_QUERY 2
#define IGMP_v3_GROUP_SOURCE_QUERY 3
#define IGMP_v3_QUERY_MINLEN 12
/*
* States for the IGMP state table.
*/
#define IGMP_DELAYING_MEMBER 1
#define IGMP_IDLE_MEMBER 2
#define IGMP_LAZY_MEMBER 3
#define IGMP_SLEEPING_MEMBER 4
#define IGMP_AWAKENING_MEMBER 5
#define IGMP_QUERY_PENDING_MEMBER 6 /* pending General Query */
#define IGMP_G_QUERY_PENDING_MEMBER 7 /* pending Grp-specific Query */
#define IGMP_SG_QUERY_PENDING_MEMBER 8 /* pending Grp-Src-specific Q.*/
/*
* Group Record Types in the IGMP Membership Report
*/
#define MODE_IS_INCLUDE 1
#define MODE_IS_EXCLUDE 2
#define CHANGE_TO_INCLUDE_MODE 3
#define CHANGE_TO_EXCLUDE_MODE 4
#define ALLOW_NEW_SOURCES 5
#define BLOCK_OLD_SOURCES 6
/*
* States for IGMP router version cache.
*/
#define IGMP_v1_ROUTER 1
#define IGMP_v2_ROUTER 2
#define IGMP_v3_ROUTER 3
/*
* IGMP Query version
*/
#define IGMP_v1_QUERY IGMP_v1_ROUTER
#define IGMP_v2_QUERY IGMP_v2_ROUTER
#define IGMP_v3_QUERY IGMP_v3_ROUTER
#endif /* _NETINET_IGMP_H_ */
@@ -0,0 +1,551 @@
/* in.h - internet header file */
/*
* Copyright (c) 1984-2007 Wind River Systems, Inc.
*
* The right to copy, distribute or otherwise make use of this software
* may be licensed only pursuant to the terms of an applicable Wind River
* license agreement. No license to Wind River intellectual property rights
* is granted herein. All rights not licensed by Wind River are reserved
* by Wind River.
*/
/*
* Copyright (c) 2002 INRIA. All rights reserved.
*
* Implementation of Internet Group Management Protocol, Version 3.
* Developed by Hitoshi Asaeda, INRIA, February 2002.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. Neither the name of INRIA nor the names of its contributors may be
* used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
/*
* Copyright (c) 1982, 1986, 1990, 1993
* The Regents of the University of California. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
* This product includes software developed by the University of
* California, Berkeley and its contributors.
* 4. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SER Added IP_MULTICAST_IF structure definition.VICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* @(#)in.h 8.3 (Berkeley) 1/3/94
* $FreeBSD: src/sys/netinet/in.h,v 1.48.2.12 2004/06/16 06:57:49 ru Exp $
* $FreeBSD: src/sys/netinet/in.h,v 1.48.2.11 2003/09/09 19:09:22 bms Exp $
*/
/*
modification history
--------------------
02l,09jan12,h_x Move extern "C" after last header file include.
02k,22jun10,h_x Fix WIND00219346
02j,07may09,kjn Added definition of struct in_pktinfo.
02i,12jul07,kch Restore multicast sockopts number and the required group_req
and group_source_req argument structures (WIND00102340).
02h,20nov06,kch Removed unsupported group_filter structure and related
defines. Added ip_mreqn structure definition.
02g,25oct06,kch Removed Kame specific ip_msfilter and ip_mreq_source
structures. Added new socket options for IP_RECVTTL,
IP_RECVTOS, IP_UDP_XCHKSUM, IP_NAT, IP_FW, IP_NEXTHOP,
IP_X_SENDERLINKADDR and IP_X_VRID.
02f,12sep06,kch Removed obsolete prototypes and unsupported proto defines
for IPNet integration.
02e,03feb06,spw Correct IN_ADDR_IS_LINKLOCAL macro
02d,25aug05,dlk Add section tags.
02c,18may05,kch Merged from FreeBSD v 1.48.2.12.
02b,19apr05,rp merged from comp_wn_ipv6_mld_interim-dev
02a,18apr05,vvv included in6.h for user-space
01z,03mar05,vvv removed reference to _KERNEL
01y,25feb05,niq merge from niqbal.tor3.mroute for IP router alert changes
01x,17feb05,dlk NTOHL() etc. only usable as statements, not expressions.
01w,07feb05,vvv _KERNEL cleanup
01v,24jan05,vvv osdep.h cleanup
01u,20jan05,sar Removal of divert, dummynet and fw code.
01t,14oct04,nee include osdep.h and machdep.h when _KERNEL is defined
(SPR #102593)
01s,31may04,nee Adding macro IN_ADDR_IS_LINKLOCAL
01r,25nov03,ppp added a comment before the inclusion of in6.h
01q,21nov03,ppp rtp work
01p,04nov03,rlm Ran batch header path update for header re-org.
01o,03nov03,rlm Removed wrn/coreip/ prefix from #includes for header re-org.
01n,23oct03,rlm updated #includes for header re-org
01m,07aug03,niq Merging from Accordion label ACCORDION_BASE6_MERGE_BASELINE
01l,13jun03,syy Added declaration for inet_ntoa_b() (SPR#88384)
01k,15may03,vvv included mbuf.h
01j,09may03,vvv included vxWorks.h
01i,01feb03,pas merge from FreeBSD 4.7 - moved satosin() etc here
01h,09sep02,hsh add c++ protection
01g,15jul02,ann moved the early declaration of some structures to avoid
compilation warnings
01f,08feb02,nee making in_socktrim non static
01e,02oct01,ppp Removing the INET6 guard fot in6.h
01d,18sep01,qli fixed a header inclusion error
01c,18sep01,ppp guarding the inclusion of in6.h by INET6 for the link
temporarily
01b,23aug01,ppp Adding the WindRiver copyright
01a,08aug01,ppp Created from FreeBSD 4.3
*/
#ifndef _NETINET_IN_H_
#define _NETINET_IN_H_
#include <vxWorks.h>
#ifdef _WRS_KERNEL
#include <net/mbuf.h>
#endif
#include <sys/socket.h>
#ifdef __cplusplus
extern "C" {
#endif
/*
* Constants and structures defined by the internet system,
* Per RFC 790, September 1981, and numerous additions.
*/
/*
* Protocols (RFC 1700)
*/
#define IPPROTO_IP 0 /* dummy for IP */
#define IPPROTO_HOPOPTS 0 /* IP6 hop-by-hop options */
#define IPPROTO_ICMP 1 /* control message protocol */
#define IPPROTO_IGMP 2 /* group mgmt protocol */
#define IPPROTO_IPV4 4 /* IPv4 encapsulation */
#define IPPROTO_IPIP IPPROTO_IPV4 /* for compatibility */
#define IPPROTO_TCP 6 /* tcp */
#define IPPROTO_UDP 17 /* user datagram protocol */
#define IPPROTO_IPV6 41 /* IP6 header */
#define IPPROTO_RSVP 46 /* resource reservation */
#define IPPROTO_GRE 47 /* General Routing Encap. */
#define IPPROTO_ESP 50 /* IP6 Encap Sec. Payload */
#define IPPROTO_AH 51 /* IP6 Auth Header */
#define IPPROTO_MOBILE 55 /* IP Mobility */
#define IPPROTO_ICMPV6 58 /* ICMP6 */
#define IPPROTO_OSPFIGP 89 /* OSPFIGP */
#define IPPROTO_PIM 103 /* Protocol Independent Mcast */
#define IPPROTO_L2TP 115 /* L2TP */
#define IPPROTO_MH 135 /* IPv6 Mobility Header */
#define IPPROTO_UDPLITE 136 /* UDP-Lite (RFC3828) */
/* 255: Reserved */
/* BSD Private, local use, namespace incursion */
#define IPPROTO_RAW 255 /* raw IP packet */
#define IPPROTO_MAX 256
/* last return value of *_input(), meaning "all job for this pkt is done". */
#define IPPROTO_DONE 257
/*
* Local port number conventions:
*
* When a user does a bind(2) or connect(2) with a port number of zero,
* a non-conflicting local port address is chosen.
* The default range is IPPORT_RESERVED through
* IPPORT_USERRESERVED, although that is settable by sysctl.
*
* A user may set the IPPROTO_IP option IP_PORTRANGE to change this
* default assignment range.
*
* The value IP_PORTRANGE_DEFAULT causes the default behavior.
*
* The value IP_PORTRANGE_HIGH changes the range of candidate port numbers
* into the "high" range. These are reserved for client outbound connections
* which do not want to be filtered by any firewalls.
*
* The value IP_PORTRANGE_LOW changes the range to the "low" are
* that is (by convention) restricted to privileged processes. This
* convention is based on "vouchsafe" principles only. It is only secure
* if you trust the remote host to restrict these ports.
*
* The default range of ports and the high range can be changed by
* sysctl(3). (net.inet.ip.port{hi,low}{first,last}_auto)
*
* Changing those values has bad security implications if you are
* using a a stateless firewall that is allowing packets outside of that
* range in order to allow transparent outgoing connections.
*
* Such a firewall configuration will generally depend on the use of these
* default values. If you change them, you may find your Security
* Administrator looking for you with a heavy object.
*
* For a slightly more orthodox text view on this:
*
* ftp://ftp.isi.edu/in-notes/iana/assignments/port-numbers
*
* port numbers are divided into three ranges:
*
* 0 - 1023 Well Known Ports
* 1024 - 49151 Registered Ports
* 49152 - 65535 Dynamic and/or Private Ports
*
*/
/*
* Ports < IPPORT_RESERVED are reserved for
* privileged processes (e.g. root). (IP_PORTRANGE_LOW)
* Ports > IPPORT_USERRESERVED are reserved
* for servers, not necessarily privileged. (IP_PORTRANGE_DEFAULT)
*/
#define IPPORT_RESERVED 1024
#define IPPORT_USERRESERVED 5000
/*
* Default local port range to use by setting IP_PORTRANGE_HIGH
*/
#define IPPORT_HIFIRSTAUTO 49152
#define IPPORT_HILASTAUTO 65535
/*
* Scanning for a free reserved port return a value below IPPORT_RESERVED,
* but higher than IPPORT_RESERVEDSTART. Traditionally the start value was
* 512, but that conflicts with some well-known-services that firewalls may
* have a fit if we use.
*/
#define IPPORT_RESERVEDSTART 600
/*
* Internet address (a structure for historical reasons)
*/
typedef u_int32_t in_addr_t;
struct in_addr {
in_addr_t s_addr;
};
/*
* Definitions of bits in internet address integers.
* On subnets, the decomposition of addresses to host and net parts
* is done according to subnet mask, not the masks here.
*/
#define IN_CLASSA(i) (((u_int32_t)(i) & 0x80000000) == 0)
#define IN_CLASSA_NET 0xff000000
#define IN_CLASSA_NSHIFT 24
#define IN_CLASSA_HOST 0x00ffffff
#define IN_CLASSA_MAX 128
#define IN_CLASSB(i) (((u_int32_t)(i) & 0xc0000000) == 0x80000000)
#define IN_CLASSB_NET 0xffff0000
#define IN_CLASSB_NSHIFT 16
#define IN_CLASSB_HOST 0x0000ffff
#define IN_CLASSB_MAX 65536
#define IN_CLASSC(i) (((u_int32_t)(i) & 0xe0000000) == 0xc0000000)
#define IN_CLASSC_NET 0xffffff00
#define IN_CLASSC_NSHIFT 8
#define IN_CLASSC_HOST 0x000000ff
#define IN_CLASSD(i) (((u_int32_t)(i) & 0xf0000000) == 0xe0000000)
#define IN_CLASSD_NET 0xf0000000 /* These ones aren't really */
#define IN_CLASSD_NSHIFT 28 /* net and host fields, but */
#define IN_CLASSD_HOST 0x0fffffff /* routing needn't know. */
#define IN_MULTICAST(i) IN_CLASSD(i)
#define IN_EXPERIMENTAL(i) (((u_int32_t)(i) & 0xf0000000) == 0xf0000000)
#define IN_BADCLASS(i) (((u_int32_t)(i) & 0xf0000000) == 0xf0000000)
#define IN_LOCAL_GROUP(i) (((u_int32_t)(i) & 0xffffff00) == 0xe0000000)
#define INADDR_ANY (u_int32_t)0x00000000
#define INADDR_LOOPBACK (u_int32_t)0x7f000001
#define INADDR_BROADCAST (u_int32_t)0xffffffff /* must be masked */
#define INADDR_NONE 0xffffffff /* -1 return */
#define INADDR_UNSPEC_GROUP (u_int32_t)0xe0000000 /* 224.0.0.0 */
#define INADDR_ALLHOSTS_GROUP (u_int32_t)0xe0000001 /* 224.0.0.1 */
#define INADDR_ALLRTRS_GROUP (u_int32_t)0xe0000002 /* 224.0.0.2 */
#define INADDR_NEW_ALLRTRS_GROUP (u_int32_t)0xe0000016 /* 224.0.0.22 */
#define INADDR_MAX_LOCAL_GROUP (u_int32_t)0xe00000ff /* 224.0.0.255 */
#define IN_LOOPBACKNET 127 /* official! */
#define INADDR_LINKLOCAL 0xA9FE0000 /* 169.254 */
#define IN_ADDR_IS_LINKLOCAL(i) (((u_int32_t)(i) & 0xFFFF0000) == INADDR_LINKLOCAL)
#if _BYTE_ORDER == _BIG_ENDIAN
#define ntohl(x) (x)
#define ntohs(x) (x)
#define htonl(x) (x)
#define htons(x) (x)
#define NTOHL(x) do {} while (FALSE)
#define NTOHS(x) do {} while (FALSE)
#define HTONL(x) do {} while (FALSE)
#define HTONS(x) do {} while (FALSE)
#else
#define ntohl(x) ((((x) & 0x000000ff) << 24) | \
(((x) & 0x0000ff00) << 8) | \
(((x) & 0x00ff0000) >> 8) | \
(((x) & 0xff000000) >> 24))
#define htonl(x) ((((x) & 0x000000ff) << 24) | \
(((x) & 0x0000ff00) << 8) | \
(((x) & 0x00ff0000) >> 8) | \
(((x) & 0xff000000) >> 24))
#define ntohs(x) ((((x) & 0x00ff) << 8) | \
(((x) & 0xff00) >> 8))
#define htons(x) ((((x) & 0x00ff) << 8) | \
(((x) & 0xff00) >> 8))
#define NTOHL(x) do {(x) = ntohl((u_int32_t)(x)); } while (FALSE)
#define NTOHS(x) do {(x) = ntohs((u_short)(x)); } while (FALSE)
#define HTONL(x) do {(x) = htonl((u_int32_t)(x)); } while (FALSE)
#define HTONS(x) do {(x) = htons((u_short)(x)); } while (FALSE)
#endif /* _BYTE_ORDER */
/*
* Socket address, internet style.
*/
struct sockaddr_in {
u_char sin_len;
u_char sin_family;
u_short sin_port;
struct in_addr sin_addr;
char sin_zero[8];
};
#define INET_ADDRSTRLEN 16
/*
* Options for use with [gs]etsockopt at the IP level.
* First word of comment is data type; bool is stored in int.
*/
#define IP_OPTIONS 1 /* char[0..40]; set/get IP options */
#define IP_HDRINCL 2 /* int; header is included with data */
#define IP_TOS 3 /* int; IP type of service and preced. */
#define IP_TTL 4 /* int; IP time to live */
#define IP_RECVDSTADDR 7 /* int; receive IP dst addr w/dgram */
#define IP_PKTINFO 8 /* int; turn packet information ancillary
* data" on/off
*/
#define IP_MULTICAST_IF 9 /* struct in_addr or struct ip_mreq or
* struct ip_mreqn. Which one is used
* is determined by size of argument.
* Controls which interface multicast
* packets sent from this socket should
* use
*/
#define IP_MULTICAST_TTL 10 /* u_char; set/get IP multicast ttl */
#define IP_MULTICAST_LOOP 11 /* u_char; set/get IP multicast loopback */
#define IP_ADD_MEMBERSHIP 12 /* struct ip_mreq or struct ip_mreqn.
* Which one that is used is determiend
* by size of argument. drop an IPv4
* group membership
*/
#define IP_JOIN_GROUP IP_ADD_MEMBERSHIP
#define IP_DROP_MEMBERSHIP 13 /* struct ip_mreq or struct ip_mreqn.
* Which one that is used is determiend
* by size of argument. drop an IPv4
* group membershi
*/
#define IP_LEAVE_GROUP IP_DROP_MEMBERSHIP
#define IP_RECVIF 20 /* int; receive reception if w/dgram */
#define IP_ROUTER_ALERT 21 /* u_char; accept router alert packets */
#define IP_DONTFRAG 22 /* u_char; set the DF bit on each packet
* sent from this socket
*/
#define IP_NOLOCALFRAG 23 /* int; enable/disable support for
* local fragmentation (default off,
* which means that local
* fragmentation is allowed)
*/
#define IP_RECVTTL 31 /* int; turn "get the time-to-live
* ancillary data" on/off
*/
#define IP_RECVTOS 32 /* int; turn "get the type-of-service ancillary data" on/off */
#define IP_UDP_XCHKSUM 40 /* int; Turn on/off checksum for outgoing
* UDP packages (default on)
*/
/* NOTE: 42-47 is used by MCAST_xxx macros */
#define IP_NAT 50 /* Ipnet_nat_ctrl; Network address translation control */
#define IP_FW 51 /* Ipfirewall_ctrl; Firewall control */
#define IP_NEXTHOP 52 /* struct sockaddr_in; specify the next
* hop router as ancillary data
*/
#define IP_X_SENDERLINKADDR 100 /* int; recvmsg() returns a struct
* sockaddr_dl that will contain the link
* address of the sender
*/
#define IP_X_VRID 101 /* u_char; specify the virtual router ID
* as ancillary data
*/
/* MCAST_* sockopts number should not be duplicated with IPv6-level sockopts */
/*
* Any-Source Multicast API; cannot be mixed with Source-Specific
* Multicast API
*/
#define MCAST_JOIN_GROUP 42 /* join an any-source group */
#define MCAST_BLOCK_SOURCE 43 /* block a given source */
#define MCAST_UNBLOCK_SOURCE 44 /* unblock a given source */
#define MCAST_LEAVE_GROUP 45 /* leave an any-source group */
/*
* Source-Specific Multicast API; cannot be mixed with Any-Source
* Multicast API
*/
#define MCAST_JOIN_SOURCE_GROUP 46 /* join a source-specific group */
#define MCAST_LEAVE_SOURCE_GROUP 47 /* leave a source-specific grou */
/*
* Defaults and limits for options
*/
#define IP_DEFAULT_MULTICAST_TTL 1 /* normally limit m'casts to 1 hop */
#define IP_DEFAULT_MULTICAST_LOOP 1 /* normally hear sends if a member */
#define IP_MAX_MEMBERSHIPS 20 /* per socket */
#define IP_MAX_SOURCE_FILTER 128 /* max number of MSF per group */
#define SO_MAX_SOURCE_FILTER 64 /* max number of MSF per socket */
/*
* Argument structure for IP_ADD_MEMBERSHIP and IP_DROP_MEMBERSHIP.
*/
struct ip_mreq {
struct in_addr imr_multiaddr; /* IP multicast address of group */
struct in_addr imr_interface; /* local IP address of interface */
};
#define MCAST_INCLUDE 0 /* Exclude filter mode */
#define MCAST_EXCLUDE 1 /* Include filter mode */
/*
* Argument structure for IP_ADD_MEMBERSHIP and IP_DROP_MEMBERSHI.
*/
struct ip_mreqn
{
struct in_addr imr_multiaddr; /* IPv4 class D multicast addr */
struct in_addr imr_interface; /* IPv4 address of local interface */
u_int32_t imr_ifindex; /* Interface index of local interface */
};
/*
* Argument structure for MCAST_JOIN_GROUP and MCAST_LEAVE_GROUP
*/
struct group_req {
u_int32_t gr_interface; /* interface index */
struct sockaddr_storage gr_group; /* group address */
};
/*
* Argument structure for MCAST_BLOCK_SOURCE, MCAST_UNBLOCK_SOURCE,
* MCAST_JOIN_SOURCE_GROUP and MCAST_LEAVE_SOURCE_GROUP
*/
struct group_source_req {
u_int32_t gsr_interface; /* interface index */
struct sockaddr_storage gsr_group; /* group address */
struct sockaddr_storage gsr_source; /* source address */
};
/*
* Ancillary data for IP_PKTINFO. It can be use toghether with
* sendmsg() to specify egress interface and/or source address. It
* will be returned by recvmsg() if reception of packet information
* has been enabled via the IP_PKTINFO socket option.
*/
struct in_pktinfo {
u_int32_t ipi_ifindex; /* egress/ingress interface index */
struct in_addr ipi_addr; /* local address of packet */
};
/*
* Argument for IP_PORTRANGE:
* - which range to search when port is unspecified at bind() or connect()
*/
#define IP_PORTRANGE_DEFAULT 0 /* default range */
#define IP_PORTRANGE_HIGH 1 /* "high" - request firewall bypass */
#define IP_PORTRANGE_LOW 2 /* "low" - vouchsafe security */
/* Packet reassembly stuff */
#define IPREASS_NHASH_LOG2 6
#define IPREASS_NHASH (1 << IPREASS_NHASH_LOG2)
#define IPREASS_HMASK (IPREASS_NHASH - 1)
#define IPREASS_HASH(x,y) \
(((((x) & 0xF) | ((((x) >> 8) & 0xF) << 4)) ^ (y)) & IPREASS_HMASK)
#define RTQ_TIMEOUT 60*10 /* run no less than once every ten minutes */
/*
* Definitions for inet sysctl operations.
*
* Third level is protocol number.
* Fourth level is desired variable within that protocol.
*/
#define IPPROTO_MAXID (IPPROTO_AH + 1) /* don't list to IPPROTO_MAX */
/* INET6 stuff, temporary workaround */
#define __KAME_NETINET_IN_H_INCLUDED_
#include <netinet6/in6.h>
#undef __KAME_NETINET_IN_H_INCLUDED_
#ifdef _WRS_KERNEL
void inet_ntoa_b __P((struct in_addr, char *));
char *inet_ntoa __P((struct in_addr)); /* in libkern */
#if 0
#define satosin(sa) ((struct sockaddr_in *)(sa))
#define sintosa(sin) ((struct sockaddr *)(sin))
#define ifatoia(ifa) ((struct in_ifaddr *)(ifa))
#endif
#endif /* _WRS_KERNEL */
#ifdef __cplusplus
}
#endif
#endif
@@ -0,0 +1,91 @@
/* in_systm.h - miscellaneous internetwork definitions for kernel */
/* Copyright 2001-2005 Wind River Systems, Inc. */
/*
* Copyright (c) 1982, 1986, 1993
* The Regents of the University of California. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
* This product includes software developed by the University of
* California, Berkeley and its contributors.
* 4. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* @(#)in_systm.h 8.1 (Berkeley) 6/10/93
* $FreeBSD: src/sys/netinet/in_systm.h,v 1.9 1999/12/29 04:41:00 peter Exp $
*/
/*
modification history
--------------------
01i,09jan12,h_x Move extern "C" after last header file include.
01h,07feb05,vvv _KERNEL cleanup
01g,20nov03,niq Remove copyright_wrs.h file inclusion
01f,05nov03,cdw Removal of unnecessary _KERNEL guards.
01e,04nov03,rlm Ran batch header path update for header re-org.
01d,03nov03,rlm Removed wrn/coreip/ prefix from #includes for header re-org.
01c,10jun03,vvv include netVersion.h
01b,09sep02,hsh add c++ protection
01a,23aug01,ann ported to clarinet from freeBSD 4.3 version 1.9
*/
#ifndef _NETINET_IN_SYSTM_H_
#define _NETINET_IN_SYSTM_H_
#include <netVersion.h>
#ifdef __cplusplus
extern "C" {
#endif
/*
* Miscellaneous internetwork
* definitions for kernel.
*/
/*
* Network types.
*
* Internally the system keeps counters in the headers with the bytes
* swapped so that VAX instructions will work on them. It reverses
* the bytes before transmission at each protocol level. The n_ types
* represent the types with the bytes in ``high-ender'' order.
*/
typedef u_int16_t n_short; /* short as received from the net */
typedef u_int32_t n_long; /* long as received from the net */
typedef u_int32_t n_time; /* ms since 00:00 GMT, byte rev */
#ifdef _WRS_KERNEL
n_time iptime __P((void));
#endif
#ifdef __cplusplus
}
#endif
#endif
@@ -0,0 +1,152 @@
/* in_var.h - in_var header file */
/*
* Copyright (c) 2001-2006 Wind River Systems, Inc.
*
* The right to copy, distribute or otherwise make use of this software
* may be licensed only pursuant to the terms of an applicable Wind River
* license agreement.
*/
/*
* Copyright (c) 1985, 1986, 1993
* The Regents of the University of California. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
* This product includes software developed by the University of
* California, Berkeley and its contributors.
* 4. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* @(#)in_var.h 8.2 (Berkeley) 1/9/95
* $FreeBSD: src/sys/netinet/in_var.h,v 1.33.2.3 2001/12/14 20:09:34 jlemon Exp $
*/
/*
* Copyright (c) 2002 INRIA. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
* This product includes software developed by INRIA and its
* contributors.
* 4. Neither the name of INRIA nor the names of its contributors may be
* used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
/*
* Implementation of Internet Group Management Protocol, Version 3.
*
* Developed by Hitoshi Asaeda, INRIA, February 2002.
*/
/*
modification history
--------------------
02d,30nov06,kch Added netinet6/in6_var.h include.
02c,09sep06,kch Cleanup for IPNet integration
02b,02mar06,dlk Remove references to ipflow* functions (SPR #104107).
02a,25aug05,dlk Add section tags.
01z,13jul05,dlk Added ipintrqJob declaration.
01y,29jun05,spm updated for IGMPv3 support
01x,19apr05,rp merged from comp_wn_ipv6_mld_interim-dev
01w,02mar05,niq Make router alert support scalable
01v,25feb05,niq merge from niqbal.tor3.mroute for IP router alert changes
01u,07feb05,vvv _KERNEL cleanup
01t,31jan05,niq virtual stack changes for sysctl
01s,24jan05,vvv osdep.h cleanup
01r,23aug04,rp merged from COMP_WN_IPV6_BASE6_ITER5_TO_UNIFIED_PRE_MERGE
01q,28may04,niq Merging from base6 label POST_ITER5_FRZ16_REBASE (ver
/main/vdt/base6_itn5_networking-int/2)
01p,25nov03,ppp added a comment around the inclusion of in6_var.h
01o,21nov03,ppp rtp work
01n,20nov03,niq Remove copyright_wrs.h file inclusion
01m,04nov03,rlm Ran batch header path update for header re-org.
01l,03nov03,rlm Removed wrn/coreip/ prefix from #includes for header re-org.
01k,23oct03,rlm updated #includes for header re-org
01j,07aug03,niq Merging from Accordion label ACCORDION_BASE6_MERGE_BASELINE
01i,23jul03,vvv added _KERNEL protection to fix warnings (SPR #89813)
01h,09may03,vvv included if.h
01g,01feb03,pas merge from FreeBSD 4.7 - added hash table for IP addresses
01f,09sep02,hsh add c++ protection
01e,28mar02,ppp modified it for backward compatibilty with A.E. 1.1
01d,03dec01,niq Sysctl changes for Clarinet
01c,02oct01,ppp removing the guaed for in6_var.h
01b,18sep01,ppp temporarily guarding in6_var.h by INET6 for the link process
01a,27aug01,hsh Created from FreeBSD 4.3
*/
#ifndef _NETINET_IN_VAR_H_
#define _NETINET_IN_VAR_H_
#include <sys/queue.h>
#ifdef _WRS_KERNEL
#include <sys/fnv_hash.h>
#endif
#include <net/if.h>
#ifdef __cplusplus
extern "C" {
#endif
struct in_aliasreq {
char ifra_name[IFNAMSIZ]; /* if name, e.g. "en0" */
struct sockaddr_in ifra_addr;
struct sockaddr_in ifra_broadaddr;
#define ifra_dstaddr ifra_broadaddr
struct sockaddr_in ifra_mask;
};
#ifdef __cplusplus
}
#endif
#ifdef INET6
#include <netinet6/in6_var.h>
#endif /* INET6 */
#endif /* _NETINET_IN_VAR_H_ */
@@ -0,0 +1,244 @@
/* ip.h - ip head file */
/*
* Copyright (c) 2001-2005 Wind River Systems, Inc.
*
* The right to copy, distribute, modify or otherwise make use
* of this software may be licensed only pursuant to the terms
* of an applicable Wind River license agreement.
*/
/*
* Copyright (c) 1982, 1986, 1993
* The Regents of the University of California. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
* This product includes software developed by the University of
* California, Berkeley and its contributors.
* 4. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* @(#)ip.h 8.2 (Berkeley) 6/1/94
* $FreeBSD: src/sys/netinet/ip.h,v 1.25 2003/10/29 15:07:03 ume Exp $
* $FreeBSD: src/sys/netinet/ip.h,v 1.17 1999/12/22 19:13:20 shin Exp $
*/
/*
modification history
--------------------
01l,09jan12,h_x Move extern "C" after last header file include.
01k,19apr05,rp merged from comp_wn_ipv6_mld_interim-dev
01j,15feb05,vvv include in_systm.h only in kernel
01i,07feb05,vvv _KERNEL cleanup
01h,14jan05,vvv osdep.h cleanup
01g,20nov03,niq Remove copyright_wrs.h file inclusion
01f,04nov03,rlm Ran batch header path update for header re-org.
01e,03nov03,rlm Removed wrn/coreip/ prefix from #includes for header re-org.
01d,07aug03,niq Merging from Accordion label ACCORDION_BASE6_MERGE_BASELINE
01c,09may03,vvv included in.h and in_systm.h
01b,09sep02,hsh add c++ protection
01a,23aug01,ann ported to clarinet from freeBSD 4.3 version 1.17
*/
#ifndef _NETINET_IP_H_
#define _NETINET_IP_H_
#include <netinet/in.h>
#ifdef _WRS_KERNEL
#include <netinet/in_systm.h>
#endif
#ifdef __cplusplus
extern "C" {
#endif
/*
* Definitions for internet protocol version 4.
* Per RFC 791, September 1981.
*/
#define IPVERSION 4
/*
* Structure of an internet header, naked of options.
*/
struct ip {
#ifdef _IP_VHL
u_char ip_vhl; /* version << 4 | header length >> 2 */
#else
#if _BYTE_ORDER == _LITTLE_ENDIAN
u_int ip_hl:4, /* header length */
ip_v:4; /* version */
#endif
#if _BYTE_ORDER == _BIG_ENDIAN
u_int ip_v:4, /* version */
ip_hl:4; /* header length */
#endif
#endif /* not _IP_VHL */
u_char ip_tos; /* type of service */
u_short ip_len; /* total length */
u_short ip_id; /* identification */
u_short ip_off; /* fragment offset field */
#define IP_RF 0x8000 /* reserved fragment flag */
#define IP_DF 0x4000 /* dont fragment flag */
#define IP_MF 0x2000 /* more fragments flag */
#define IP_OFFMASK 0x1fff /* mask for fragmenting bits */
u_char ip_ttl; /* time to live */
u_char ip_p; /* protocol */
u_short ip_sum; /* checksum */
struct in_addr ip_src,ip_dst; /* source and dest address */
};
#ifdef _IP_VHL
#define IP_MAKE_VHL(v, hl) ((v) << 4 | (hl))
#define IP_VHL_HL(vhl) ((vhl) & 0x0f)
#define IP_VHL_V(vhl) ((vhl) >> 4)
#define IP_VHL_BORING 0x45
#endif
#define IP_MAXPACKET 65535 /* maximum packet size */
/*
* Definitions for IP type of service (ip_tos)
*/
#define IPTOS_LOWDELAY 0x10
#define IPTOS_THROUGHPUT 0x08
#define IPTOS_RELIABILITY 0x04
#define IPTOS_MINCOST 0x02
#if 1
/* ECN RFC3168 obsoletes RFC2481, and these will be deprecated soon. */
/* ECN bits proposed by Sally Floyd */
#define IPTOS_CE 0x01 /* congestion experienced */
#define IPTOS_ECT 0x02 /* ECN-capable transport */
#endif
/*
* Definitions for IP precedence (also in ip_tos) (hopefully unused)
*/
#define IPTOS_PREC_NETCONTROL 0xe0
#define IPTOS_PREC_INTERNETCONTROL 0xc0
#define IPTOS_PREC_CRITIC_ECP 0xa0
#define IPTOS_PREC_FLASHOVERRIDE 0x80
#define IPTOS_PREC_FLASH 0x60
#define IPTOS_PREC_IMMEDIATE 0x40
#define IPTOS_PREC_PRIORITY 0x20
#define IPTOS_PREC_ROUTINE 0x00
/*
* ECN (Explicit Congestion Notification) codepoints in RFC3168
* mapped to the lower 2 bits of the TOS field.
*/
#define IPTOS_ECN_NOTECT 0x00 /* not-ECT */
#define IPTOS_ECN_ECT1 0x01 /* ECN-capable transport (1) */
#define IPTOS_ECN_ECT0 0x02 /* ECN-capable transport (0) */
#define IPTOS_ECN_CE 0x03 /* congestion experienced */
#define IPTOS_ECN_MASK 0x03 /* ECN field mask */
/*
* Definitions for options.
*/
#define IPOPT_COPIED(o) ((o)&0x80)
#define IPOPT_CLASS(o) ((o)&0x60)
#define IPOPT_NUMBER(o) ((o)&0x1f)
#define IPOPT_CONTROL 0x00
#define IPOPT_RESERVED1 0x20
#define IPOPT_DEBMEAS 0x40
#define IPOPT_RESERVED2 0x60
#define IPOPT_EOL 0 /* end of option list */
#define IPOPT_NOP 1 /* no operation */
#define IPOPT_RR 7 /* record packet route */
#define IPOPT_TS 68 /* timestamp */
#define IPOPT_SECURITY 130 /* provide s,c,h,tcc */
#define IPOPT_LSRR 131 /* loose source route */
#define IPOPT_ESO 133 /* extended security */
#define IPOPT_CIPSO 134 /* commerical security */
#define IPOPT_SATID 136 /* satnet id */
#define IPOPT_SSRR 137 /* strict source route */
#define IPOPT_RA 148 /* router alert */
/*
* Offsets to fields in options other than EOL and NOP.
*/
#define IPOPT_OPTVAL 0 /* option ID */
#define IPOPT_OLEN 1 /* option length */
#define IPOPT_OFFSET 2 /* offset within option */
#define IPOPT_MINOFF 4 /* min value of above */
/*
* Time stamp option structure.
*/
struct ip_timestamp {
u_char ipt_code; /* IPOPT_TS */
u_char ipt_len; /* size of structure (variable) */
u_char ipt_ptr; /* index of current entry */
#if _BYTE_ORDER == _LITTLE_ENDIAN
u_int ipt_flg:4, /* flags, see below */
ipt_oflw:4; /* overflow counter */
#endif
#if _BYTE_ORDER == _BIG_ENDIAN
u_int ipt_oflw:4, /* overflow counter */
ipt_flg:4; /* flags, see below */
#endif
union ipt_timestamp {
u_long ipt_time[1];
struct ipt_ta {
struct in_addr ipt_addr;
u_long ipt_time;
} ipt_ta[1];
} ipt_timestamp;
};
/* flag bits for ipt_flg */
#define IPOPT_TS_TSONLY 0 /* timestamps only */
#define IPOPT_TS_TSANDADDR 1 /* timestamps and addresses */
#define IPOPT_TS_PRESPEC 3 /* specified modules only */
/* bits for security (not byte swapped) */
#define IPOPT_SECUR_UNCLASS 0x0000
#define IPOPT_SECUR_CONFID 0xf135
#define IPOPT_SECUR_EFTO 0x789a
#define IPOPT_SECUR_MMMM 0xbc4d
#define IPOPT_SECUR_RESTR 0xaf13
#define IPOPT_SECUR_SECRET 0xd788
#define IPOPT_SECUR_TOPSECRET 0x6bc5
/*
* Internet implementation parameters.
*/
#define MAXTTL 255 /* maximum time to live (seconds) */
#define IPDEFTTL 64 /* default ttl, from RFC 1340 */
#define IPFRAGTTL 60 /* time to live for frags, slowhz */
#define IPTTLDEC 1 /* subtracted when forwarding */
#define IP_MSS 576 /* default maximum segment size */
#ifdef __cplusplus
}
#endif
#endif
@@ -0,0 +1,28 @@
/* ip6.h - IPv6 protocol definitions */
/*
* Copyright (c) 2005 Wind River Systems, Inc.
*
* The right to copy, distribute, modify or otherwise make use
* of this software may be licensed only pursuant to the terms
* of an applicable Wind River license agreement.
*/
/*
modification history
--------------------
01a,29jun05,vvv written
*/
#ifndef __INCip6h
#define __INCip6h
/*
* This file has been added to satisfy the requirement in RFC3542
* that ip6.h should be in the netinet directory. The copy in netinet6
* is retained for backward compatibility.
*/
#include <netinet6/ip6.h>
#endif /* not __INCip6h */
@@ -0,0 +1,235 @@
/* ip_icmp.h - interface control message protocol header file */
/* Copyright 2001-2006 Wind River Systems, Inc. */
/*
* Copyright (c) 1982, 1986, 1993
* The Regents of the University of California. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
* This product includes software developed by the University of
* California, Berkeley and its contributors.
* 4. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* @(#)ip_icmp.h 8.1 (Berkeley) 6/10/93
* $FreeBSD: src/sys/netinet/ip_icmp.h,v 1.16 1999/12/29 04:41:01 peter Exp $
*/
/*
modification history
--------------------
01m,09jan12,h_x Move extern "C" after last header file include.
01l,21sep06,tlu Cleanup for IPNET integration
01k,10sep06,kch Cleanup for IPNet integration.
01j,04jul05,dlk Added result member to icmp_info structure (SPR #110450).
01i,07feb05,vvv _KERNEL cleanup
01h,20nov03,niq Remove copyright_wrs.h file inclusion
01g,04nov03,rlm Ran batch header path update for header re-org.
01f,03nov03,rlm Removed wrn/coreip/ prefix from #includes for header re-org.
01e,07aug03,niq Merging from Accordion label ACCORDION_BASE6_MERGE_BASELINE.
01d,09may03,vvv included in_systm.h and ip.h
01c,10sep02,hsh add c++ protection
01b,20jun02,ppp adding the structure for icmp_info
01a,22aug01,ppp Created from BSD 4.3
*/
#ifndef _NETINET_IP_ICMP_H_
#define _NETINET_IP_ICMP_H_
#include <netinet/ip.h>
#ifdef __cplusplus
extern "C" {
#endif
/*
* Interface Control Message Protocol Definitions.
* Per RFC 792, September 1981.
*/
/*
* Internal of an ICMP Router Advertisement
*/
struct icmp_ra_addr {
u_int32_t ira_addr;
u_int32_t ira_preference;
};
/*
* Structure of an icmp header.
*/
struct icmp {
u_char icmp_type; /* type of message, see below */
u_char icmp_code; /* type sub code */
u_short icmp_cksum; /* ones complement cksum of struct */
union {
u_char ih_pptr; /* ICMP_PARAMPROB */
struct in_addr ih_gwaddr; /* ICMP_REDIRECT */
struct ih_idseq {
u_int16_t icd_id;
u_int16_t icd_seq;
} ih_idseq;
int ih_void;
/* ICMP_UNREACH_NEEDFRAG -- Path MTU Discovery (RFC1191) */
struct ih_pmtu {
u_int16_t ipm_void;
u_int16_t ipm_nextmtu;
} ih_pmtu;
struct ih_rtradv {
u_char irt_num_addrs;
u_char irt_wpa;
u_int16_t irt_lifetime;
} ih_rtradv;
} icmp_hun;
#define icmp_pptr icmp_hun.ih_pptr
#define icmp_gwaddr icmp_hun.ih_gwaddr
#define icmp_id icmp_hun.ih_idseq.icd_id
#define icmp_seq icmp_hun.ih_idseq.icd_seq
#define icmp_void icmp_hun.ih_void
#define icmp_pmvoid icmp_hun.ih_pmtu.ipm_void
#define icmp_nextmtu icmp_hun.ih_pmtu.ipm_nextmtu
#define icmp_num_addrs icmp_hun.ih_rtradv.irt_num_addrs
#define icmp_wpa icmp_hun.ih_rtradv.irt_wpa
#define icmp_lifetime icmp_hun.ih_rtradv.irt_lifetime
union {
struct id_ts {
u_int32_t its_otime;
u_int32_t its_rtime;
u_int32_t its_ttime;
} id_ts;
struct id_ip {
struct ip idi_ip;
/* options and then 64 bits of data */
} id_ip;
struct icmp_ra_addr id_radv;
u_int32_t id_mask;
char id_data[1];
} icmp_dun;
#define icmp_otime icmp_dun.id_ts.its_otime
#define icmp_rtime icmp_dun.id_ts.its_rtime
#define icmp_ttime icmp_dun.id_ts.its_ttime
#define icmp_ip icmp_dun.id_ip.idi_ip
#define icmp_radv icmp_dun.id_radv
#define icmp_mask icmp_dun.id_mask
#define icmp_data icmp_dun.id_data
};
/*
* Added this structure for passing additional information to ctl functions
* that may want to use it
*/
struct icmp_info {
struct sockaddr_in sock;
u_short errorPktLen;
u_short result;
#define ICMP4_RESULT_ACCEPT 0
#define ICMP4_RESULT_REJECT 1
};
/*
* Lower bounds on packet lengths for various types.
* For the error advice packets must first insure that the
* packet is large enough to contain the returned ip header.
* Only then can we do the check to see if 64 bits of packet
* data have been returned, since we need to check the returned
* ip header length.
*/
#define ICMP_MINLEN 8 /* abs minimum */
#define ICMP_TSLEN (8 + 3 * sizeof (n_time)) /* timestamp */
#define ICMP_MASKLEN 12 /* address mask */
#define ICMP_ADVLENMIN (8 + sizeof (struct ip) + 8) /* min */
#ifndef _IP_VHL
#define ICMP_ADVLEN(p) (8 + ((p)->icmp_ip.ip_hl << 2) + 8)
/* N.B.: must separately check that ip_hl >= 5 */
#else
#define ICMP_ADVLEN(p) (8 + (IP_VHL_HL((p)->icmp_ip.ip_vhl) << 2) + 8)
/* N.B.: must separately check that header length >= 5 */
#endif
/*
* Definition of type and code field values.
*/
#define ICMP_ECHOREPLY 0 /* echo reply */
#define ICMP_UNREACH 3 /* dest unreachable, codes: */
#define ICMP_UNREACH_NET 0 /* bad net */
#define ICMP_UNREACH_HOST 1 /* bad host */
#define ICMP_UNREACH_PROTOCOL 2 /* bad protocol */
#define ICMP_UNREACH_PORT 3 /* bad port */
#define ICMP_UNREACH_NEEDFRAG 4 /* IP_DF caused drop */
#define ICMP_UNREACH_SRCFAIL 5 /* src route failed */
#define ICMP_UNREACH_NET_UNKNOWN 6 /* unknown net */
#define ICMP_UNREACH_HOST_UNKNOWN 7 /* unknown host */
#define ICMP_UNREACH_ISOLATED 8 /* src host isolated */
#define ICMP_UNREACH_NET_PROHIB 9 /* prohibited access */
#define ICMP_UNREACH_HOST_PROHIB 10 /* ditto */
#define ICMP_UNREACH_TOSNET 11 /* bad tos for net */
#define ICMP_UNREACH_TOSHOST 12 /* bad tos for host */
#define ICMP_UNREACH_FILTER_PROHIB 13 /* admin prohib */
#define ICMP_UNREACH_HOST_PRECEDENCE 14 /* host prec vio. */
#define ICMP_UNREACH_PRECEDENCE_CUTOFF 15 /* prec cutoff */
#define ICMP_SOURCEQUENCH 4 /* packet lost, slow down */
#define ICMP_REDIRECT 5 /* shorter route, codes: */
#define ICMP_REDIRECT_NET 0 /* for network */
#define ICMP_REDIRECT_HOST 1 /* for host */
#define ICMP_REDIRECT_TOSNET 2 /* for tos and net */
#define ICMP_REDIRECT_TOSHOST 3 /* for tos and host */
#define ICMP_ECHO 8 /* echo service */
#define ICMP_ROUTERADVERT 9 /* router advertisement */
#define ICMP_ROUTERSOLICIT 10 /* router solicitation */
#define ICMP_TIMXCEED 11 /* time exceeded, code: */
#define ICMP_TIMXCEED_INTRANS 0 /* ttl==0 in transit */
#define ICMP_TIMXCEED_REASS 1 /* ttl==0 in reass */
#define ICMP_PARAMPROB 12 /* ip header bad */
#define ICMP_PARAMPROB_ERRATPTR 0 /* error at param ptr */
#define ICMP_PARAMPROB_OPTABSENT 1 /* req. opt. absent */
#define ICMP_PARAMPROB_LENGTH 2 /* bad length */
#define ICMP_TSTAMP 13 /* timestamp request */
#define ICMP_TSTAMPREPLY 14 /* timestamp reply */
#define ICMP_IREQ 15 /* information request */
#define ICMP_IREQREPLY 16 /* information reply */
#define ICMP_MASKREQ 17 /* address mask request */
#define ICMP_MASKREPLY 18 /* address mask reply */
#define ICMP_MAXTYPE 18
#define ICMP_INFOTYPE(type) \
((type) == ICMP_ECHOREPLY || (type) == ICMP_ECHO || \
(type) == ICMP_ROUTERADVERT || (type) == ICMP_ROUTERSOLICIT || \
(type) == ICMP_TSTAMP || (type) == ICMP_TSTAMPREPLY || \
(type) == ICMP_IREQ || (type) == ICMP_IREQREPLY || \
(type) == ICMP_MASKREQ || (type) == ICMP_MASKREPLY)
#ifdef __cplusplus
}
#endif
#endif
@@ -0,0 +1,178 @@
/* ip_mroute.h - multicast forwarding header file */
/*
* Copyright (c) 1984-2007 Wind River Systems, Inc.
*
* The right to copy, distribute or otherwise make use of this software
* may be licensed only pursuant to the terms of an applicable Wind River
* license agreement. No license to Wind River intellectual property rights
* is granted herein. All rights not licensed by Wind River are reserved
* by Wind River.
*/
/*
* Copyright (c) 1989 Stephen Deering.
* Copyright (c) 1992, 1993
* The Regents of the University of California. All rights reserved.
*
* This code is derived from software contributed to Berkeley by
* Stephen Deering of Stanford University.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
* This product includes software developed by the University of
* California, Berkeley and its contributors.
* 4. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* @(#)ip_mroute.h 8.1 (Berkeley) 6/10/93
* $FreeBSD: src/sys/netinet/ip_mroute.h,v 1.17 1999/12/29 04:41:01 peter Exp $
*/
/*
modification history
--------------------
01j,09jan12,h_x Move extern "C" after last header file include.
01i,12jul07,kch Re-integrated to support IP multicast source forwarding
for IPNET (WIND00102340).
01h,16jul05,dlk Added tbf_timeo member to struct tbf for timer cancellation
when shutting down mrouter in virtual stack destructor.
01g,25feb05,niq add support for router alert
01f,31jan05,niq merge mroute changes from comp_wn_ipv6_multicast_interim-dev
branch (ver 1)
01e,20sep04,rae fix compiler warnings
01d,24jun03,rae add #include netVersion.h
01c,10oct01,rae merge from truestack ver 01k (v2 upgrade)
01b,08apr97,vin removed declarations for ip_mforward and ip_mrouter_done.
implemented ip_mforward as a hook for scalability.
01a,03mar96,vin created from BSD4.4lite2.
*/
#ifndef _NETINET_IP_MROUTE_H_
#define _NETINET_IP_MROUTE_H_
#include <netinet/in.h>
#ifdef __cplusplus
extern "C" {
#endif
/*
* Definitions for IP multicast forwarding.
*
* Written by David Waitzman, BBN Labs, August 1988.
* Modified by Steve Deering, Stanford, February 1989.
* Modified by Ajit Thyagarajan, PARC, August 1993.
* Modified by Ajit Thyagarajan, PARC, August 1994.
* Modified by Ahmed Helmy, SGI, June 1996.
* Modified by Pavlin Radoslavov, ICSI, October 2002.
*
* MROUTING Revision: 3.3.1.3
* and PIM-SMv2 and PIM-DM support, advanced API support,
* bandwidth metering and signaling.
*/
/***** IP_IPPROTO_IP level multicast socket options: *****/
#define MRT_BASE 0x40000000
/*
* Multicast Routing set/getsockopt commands.
*/
#define MRT_INIT (MRT_BASE + 0) /* initialize mrouted */
#define MRT_DONE (MRT_BASE + 1) /* shut down mrouted */
#define MRT_ADD_VIF (MRT_BASE + 2) /* create virtual interface */
#define MRT_DEL_VIF (MRT_BASE + 3) /* delete virtual interface */
#define MRT_ADD_MFC (MRT_BASE + 4) /* insert forwarding cache entry */
#define MRT_DEL_MFC (MRT_BASE + 5) /* delete forwarding cache entry */
#define MRT_VERSION (MRT_BASE + 6) /* get kernel version number */
#define MRT_ASSERT (MRT_BASE + 7) /* enable assert processing */
#define MRT_PIM MRT_ASSERT /* enable PIM processing */
#define MAXVIFS 32 /* Maximum number of virtual interfaces */
typedef u_short vifi_t; /* Virtual interface index type */
/*
* Structure used for IPv4 multicast routing
*/
/*
* Argument structure for MRT_ADD_VIF.
* (MRT_DEL_VIF takes a single vifi_t argument.)
*/
struct vifctl {
vifi_t vifc_vifi; /* the index of the vif to be added */
u_char vifc_flags; /* VIFF_ flags defined below */
u_char vifc_threshold; /* min ttl required to forward on vif */
u_int32_t vifc_rate_limit; /* max rate */
struct in_addr vifc_lcl_addr; /* local interface address */
struct in_addr vifc_rmt_addr; /* remote address (tunnels only) */
};
#define VIFF_TUNNEL 0x1 /* vif represents a tunnel end-point */
#define VIFF_REGISTER 0x4 /* used for PIM Register encap/decap */
/*
* Argument structure for MRT_ADD_MFC and MRT_DEL_MFC
*/
struct mfcctl {
struct in_addr mfcc_origin; /* ip origin of mcasts */
struct in_addr mfcc_mcastgrp; /* multicast group associated*/
vifi_t mfcc_parent; /* incoming vif */
u_char mfcc_ttls[MAXVIFS]; /* forwarding ttls on vifs */
};
/* Structure used by SIOCGETSGCNT ioctl
* Holds statistsic for the route matching 'src' and 'grp'
*/
struct sioc_sg_req
{
struct in_addr src; /* The source address */
struct in_addr grp; /* The destination group address */
u_int32_t pktcnt; /* Packets sent along this route */
u_int32_t bytecnt; /* Bytes sent along this route */
u_int32_t wrong_if; /* Number of packet received on the wrong
* VIF matching this route
*/
};
/* Structure used by SIOCGETVIFCNT ioctl.
* Hold statistics for the virtual interface
*/
struct sioc_vif_req
{
vifi_t vifi; /* Virtual interface index */
u_int32_t icount; /* Number of packets received on this interface */
u_int32_t ocount; /* Number of packets sent on this interface */
u_int32_t ibytes; /* Number of bytes received on this interface */
u_int32_t obytes; /* Number of bytes sent on this interface */
};
#ifdef __cplusplus
}
#endif
#endif /* _NETINET_IP_MROUTE_H_ */
@@ -0,0 +1,35 @@
/* sctp.h - IPNET SCTP header file */
/*
* Copyright (c) 2009 Wind River Systems, Inc.
*
* The right to copy, distribute or otherwise make use of this software
* may be licensed only pursuant to the terms of an applicable Wind River
* license agreement. No license to Wind River intellectual property rights
* is granted herein. All rights not licensed by Wind River are reserved
* by Wind River.
*/
/*
modification history
--------------------
01a,18Feb09,jgy Created,base on draft-ietf-tsvwg-sctpsocket-16.
*/
/*
****************************************************************************
* 1 DESCRIPTION
****************************************************************************
*
* This is the header file for SCTP SOCKET.
*/
#ifndef SCTP_H
#define SCTP_H
#include <sys/sctp_socket.h>
#endif
@@ -0,0 +1,50 @@
/* sockunion.h -File Transfer Protocol library header */
/*
modification history
--------------------
01g,09jan12,h_x Move extern "C" after last header file include.
01f,24apr07,tkf Add IPv6-Only build support.
01e,07jan05,syy Port to RTP
01d,05nov03,cdw Removal of unnecessary _KERNEL guards.
01c,04nov03,rlm Ran batch header path update for header re-org.
01b,03nov03,rlm Removed wrn/coreip/ prefix from #includes for header re-org.
01a,15sep02,ant written
*/
#ifndef __INCsockunionh
#define __INCsockunionh
/* includes */
#include <netinet/in.h>
#ifdef __cplusplus
extern "C" {
#endif
/* typedefs */
union sockunion {
struct sockinet {
u_char si_len;
u_char si_family;
u_short si_port;
} su_si;
#ifdef INET
struct sockaddr_in su_sin;
#endif
#ifdef INET6
struct sockaddr_in6 su_sin6;
#endif
};
#define su_len su_si.si_len
#define su_family su_si.si_family
#define su_port su_si.si_port
#ifdef __cplusplus
}
#endif
#endif /* __INCsockunionh */
@@ -0,0 +1,171 @@
/* tcp.h - TCP protocol definitions */
/* Copyright 2001-2005 Wind River Systems, Inc. */
/*
* Copyright (c) 1982, 1986, 1993
* The Regents of the University of California. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
* This product includes software developed by the University of
* California, Berkeley and its contributors.
* 4. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* @(#)tcp.h 8.1 (Berkeley) 6/10/93
* $FreeBSD: src/sys/netinet/tcp.h,v 1.13.2.3 2001/03/01 22:08:42 jlemon Exp $
*/
/*
modification history
--------------------
01k,09jan12,h_x Move extern "C" after last header file include.
01j,04oct06,kch Updated TCP user-settable options.
01i,14jan05,vvv osdep.h cleanup
01h,20nov03,niq Remove copyright_wrs.h file inclusion
01g,05nov03,cdw Removal of unnecessary _KERNEL guards.
01f,04nov03,rlm Ran batch header path update for header re-org.
01e,03nov03,rlm Removed wrn/coreip/ prefix from #includes for header re-org.
01d,10jun03,vvv include netVersion.h
01c,10sep02,hsh add c++ protection
01b,08feb02,pas EAR code cleanup
01a,13aug01,pas Created from FreeBSD4.3-RELEASE(July-17-01).
*/
#ifndef _NETINET_TCP_H_
#define _NETINET_TCP_H_
#include <netVersion.h>
#ifdef __cplusplus
extern "C" {
#endif
typedef u_int32_t tcp_seq;
typedef u_int32_t tcp_cc; /* connection count per rfc1644 */
#define tcp6_seq tcp_seq /* for KAME src sync over BSD*'s */
#define tcp6hdr tcphdr /* for KAME src sync over BSD*'s */
/*
* TCP header.
* Per RFC 793, September, 1981.
*/
struct tcphdr {
u_short th_sport; /* source port */
u_short th_dport; /* destination port */
tcp_seq th_seq; /* sequence number */
tcp_seq th_ack; /* acknowledgement number */
#if _BYTE_ORDER == _LITTLE_ENDIAN
u_int th_x2:4, /* (unused) */
th_off:4; /* data offset */
#endif
#if _BYTE_ORDER == _BIG_ENDIAN
u_int th_off:4, /* data offset */
th_x2:4; /* (unused) */
#endif
u_char th_flags;
#define TH_FIN 0x01
#define TH_SYN 0x02
#define TH_RST 0x04
#define TH_PUSH 0x08
#define TH_ACK 0x10
#define TH_URG 0x20
#define TH_ECE 0x40
#define TH_CWR 0x80
#define TH_FLAGS (TH_FIN|TH_SYN|TH_RST|TH_ACK|TH_URG|TH_ECE|TH_CWR)
u_short th_win; /* window */
u_short th_sum; /* checksum */
u_short th_urp; /* urgent pointer */
};
#define TCPOPT_EOL 0
#define TCPOPT_NOP 1
#define TCPOPT_MAXSEG 2
#define TCPOLEN_MAXSEG 4
#define TCPOPT_WINDOW 3
#define TCPOLEN_WINDOW 3
#define TCPOPT_SACK_PERMITTED 4 /* Experimental */
#define TCPOLEN_SACK_PERMITTED 2
#define TCPOPT_SACK 5 /* Experimental */
#define TCPOPT_TIMESTAMP 8
#define TCPOLEN_TIMESTAMP 10
#define TCPOLEN_TSTAMP_APPA (TCPOLEN_TIMESTAMP+2) /* appendix A */
#define TCPOPT_TSTAMP_HDR \
(TCPOPT_NOP<<24|TCPOPT_NOP<<16|TCPOPT_TIMESTAMP<<8|TCPOLEN_TIMESTAMP)
#define TCPOPT_CC 11 /* CC options: RFC-1644 */
#define TCPOPT_CCNEW 12
#define TCPOPT_CCECHO 13
#define TCPOLEN_CC 6
#define TCPOLEN_CC_APPA (TCPOLEN_CC+2)
#define TCPOPT_CC_HDR(ccopt) \
(TCPOPT_NOP<<24|TCPOPT_NOP<<16|(ccopt)<<8|TCPOLEN_CC)
/*
* Default maximum segment size for TCP.
* With an IP MSS of 576, this is 536,
* but 512 is probably more convenient.
* This should be defined as MIN(512, IP_MSS - sizeof (struct tcpiphdr)).
*/
#define TCP_MSS 512
/*
* Default maximum segment size for TCP6.
* With an IP6 MSS of 1280, this is 1220,
* but 1024 is probably more convenient. (xxx kazu in doubt)
* This should be defined as MIN(1024, IP6_MSS - sizeof (struct tcpip6hdr))
*/
#define TCP6_MSS 1024
#define TCP_MAXWIN 65535 /* largest value for (unscaled) window */
#define TTCP_CLIENT_SND_WND 4096 /* dflt send window for T/TCP client */
#define TCP_MAX_WINSHIFT 14 /* maximum window shift */
#define TCP_MAXBURST 4 /* maximum segments in a burst */
#define TCP_MAXHLEN (0xf<<2) /* max length of header in bytes */
#define TCP_MAXOLEN (TCP_MAXHLEN - sizeof(struct tcphdr))
/* max space left for options */
/*
* User-settable options (used with setsockopt).
*/
#define TCP_NODELAY 1 /* don't delay send to coalesce packets */
#define TCP_MAXSEG 2 /* set maximum segment size */
#define TCP_NOPUSH 3 /* don't push last block of write */
#define TCP_KEEPIDLE 4 /* Send first keepalive probe when the connections
been isdl this time (in seconds) */
#define TCP_KEEPINTVL 5 /* Interval (in seconds) between keepalives */
#define TCP_KEEPCNT 6 /* Maximum number of keepalives before dropping
the connection */
#ifdef __cplusplus
}
#endif
#endif
@@ -0,0 +1,88 @@
/* udp.h - udp header file */
/* Copyright 2001-2003 Wind River Systems, Inc. */
/*
* Copyright (c) 1982, 1986, 1993
* The Regents of the University of California. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
* This product includes software developed by the University of
* California, Berkeley and its contributors.
* 4. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* @(#)udp.h 8.1 (Berkeley) 6/10/93
* $FreeBSD: src/sys/netinet/udp.h,v 1.7 1999/08/28 00:49:34 peter Exp $
*/
/*
modification history
--------------------
01h,09jan12,h_x Move extern "C" after last header file include.
01g,20nov03,niq Remove copyright_wrs.h file inclusion
01f,05nov03,cdw Removal of unnecessary _KERNEL guards.
01e,04nov03,rlm Ran batch header path update for header re-org.
01d,03nov03,rlm Removed wrn/coreip/ prefix from #includes for header re-org.
01c,10jun03,vvv include netVersion.h
01b,10sep02,hsh add c++ protection
01a,24aug01,hsh Created from BSD 4.3
*/
#ifndef _NETINET_UDP_H_
#define _NETINET_UDP_H_
#include <netVersion.h>
#ifdef __cplusplus
extern "C" {
#endif
/*
* Udp protocol header.
* Per RFC 768, September, 1981.
*/
struct udphdr {
u_short uh_sport; /* source port */
u_short uh_dport; /* destination port */
u_short uh_ulen; /* udp length */
u_short uh_sum; /* udp checksum */
};
/* UDPLite socket options, level IPPROTO_UDPLITE */
#define UDPLITE_SEND_CSCOV 10 /* Number of octets that must be
covered by the checksum.
0 = all octets
8 = only header
>8 = header plus part of
payload */
#ifdef __cplusplus
}
#endif
#endif