/*-
* 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
* 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.h 8.3 (Berkeley) 1/3/94
* $FreeBSD$
*/
#ifndef _NETINET_IN_H_
#define _NETINET_IN_H_
#ifndef _UINT8_T_DECLARED
#define _UINT8_T_DECLARED
#endif
#ifndef _UINT16_T_DECLARED
#define _UINT16_T_DECLARED
#endif
#ifndef _UINT32_T_DECLARED
#define _UINT32_T_DECLARED
#endif
#ifndef _IN_ADDR_T_DECLARED
#define _IN_ADDR_T_DECLARED
#endif
#ifndef _IN_PORT_T_DECLARED
#define _IN_PORT_T_DECLARED
#endif
#ifndef _SA_FAMILY_T_DECLARED
#define _SA_FAMILY_T_DECLARED
#endif
/* Internet address (a structure for historical reasons). */
#ifndef _STRUCT_IN_ADDR_DECLARED
struct in_addr {
};
#define _STRUCT_IN_ADDR_DECLARED
#endif
#ifndef _SOCKLEN_T_DECLARED
#define _SOCKLEN_T_DECLARED
#endif
#include <sys/_sockaddr_storage.h>
/* Socket address, internet style. */
struct sockaddr_in {
};
#ifndef _BYTEORDER_PROTOTYPED
#define _BYTEORDER_PROTOTYPED
#endif
#ifndef _BYTEORDER_FUNC_DEFINED
#define _BYTEORDER_FUNC_DEFINED
#endif
#endif /* !_KERNEL && __POSIX_VISIBLE >= 200112 */
#if __POSIX_VISIBLE >= 200112
#endif
#if __BSD_VISIBLE
/*
* Constants and structures defined by the internet system,
* Per RFC 790, September 1981, and numerous additions.
*/
/*
* Protocols (RFC 1700)
*/
/* 101-254: Partly Unassigned */
/* 255: Reserved */
/* BSD Private, local use, namespace incursion, no longer used */
/* last return value of *_input(), meaning "all job for this pkt is done". */
/* Only used internally, so can be outside the range of valid IP protocols. */
/*
* Defined to avoid confusion. The master value is defined by
*/
/*
* 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_HIFIRSTAUTO through
* IPPORT_HILASTAUTO, 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 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:
*
*
* port numbers are divided into three ranges:
*
* 0 - 1023 Well Known Ports
* 1024 - 49151 Registered Ports
*
*/
/*
* Ports < IPPORT_RESERVED are reserved for
* privileged processes (e.g. root). (IP_PORTRANGE_LOW)
*/
/*
* Default local port range, used by IP_PORTRANGE_DEFAULT
*/
/*
* Dynamic port range, used by IP_PORTRANGE_HIGH.
*/
/*
* 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.
*/
/*
* 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.
*/
#ifndef _KERNEL
#endif
/*
* Options for use with [gs]etsockopt at the IP level.
* First word of comment is data type; bool is stored in int.
*/
/* for IPSEC */
/* unused; was IP_FAITH */
/*
* Options for controlling the firewall and dummynet.
* Historical options (from 40 to 64) will eventually be
* replaced by only two options, IP_FW3 and IP_DUMMYNET3.
*/
/* IPv4 Source Filter Multicast API [RFC3678] */
/* The following option is private; do not use it from user applications. */
/* Protocol Independent Multicast API [RFC3678] */
/* Flow and RSS definitions */
/*
* Defaults and limits for options
*/
/*
* The imo_membership vector for each socket is now dynamically allocated at
* run-time, bounded by USHRT_MAX, and is reallocated when needed, sized
* according to a power-of-two increment.
*/
/*
* Default resource limits for IPv4 multicast source filtering.
* These may be modified by sysctl.
*/
/*
* Argument structure for IP_ADD_MEMBERSHIP and IP_DROP_MEMBERSHIP.
*/
struct ip_mreq {
};
/*
* Modified argument structure for IP_MULTICAST_IF, obtained from Linux.
* This is used to specify an interface index for multicast sends, as
* the IPv4 legacy APIs do not support this (unless IP_SENDIF is available).
*/
struct ip_mreqn {
};
/*
* Argument structure for IPv4 Multicast Source Filter APIs. [RFC3678]
*/
struct ip_mreq_source {
};
/*
* Argument structures for Protocol-Independent Multicast Source
* Filter APIs. [RFC3678]
*/
struct group_req {
};
struct group_source_req {
};
#ifndef __MSFILTERREQ_DEFINED
#define __MSFILTERREQ_DEFINED
/*
* The following structure is private; do not use it from user applications.
* It is used to communicate IP_MSFILTER/IPV6_MSFILTER information between
* the RFC 3678 libc functions and the kernel.
*/
struct __msfilterreq {
* of a contiguous array of
* sources to filter in full.
*/
};
#endif
struct sockaddr;
/*
* Advanced (Full-state) APIs [RFC3678]
* The RFC specifies uint_t for the 6th argument to [sg]etsourcefilter().
* We use uint32_t here to be consistent.
*/
/*
* Filter modes; also used to represent per-socket filter mode internally.
*/
/*
* Argument for IP_PORTRANGE:
* - which range to search when port is unspecified at bind() or connect()
*/
/*
* Identifiers for IP sysctl nodes
*/
#ifdef notyet
#endif
/* IPCTL_RTEXPIRE 5 deprecated */
/* IPCTL_RTMINEXPIRE 6 deprecated */
/* IPCTL_RTMAXCACHE 7 deprecated */
/* 15, unused, was: IPCTL_KEEPFAITH */
#endif /* __BSD_VISIBLE */
#ifdef _KERNEL
int in_canforward(struct in_addr);
int in_localaddr(struct in_addr);
int in_localip(struct in_addr);
void in_ifdetach(struct ifnet *);
#endif /* _KERNEL */
/* INET6 stuff */
#if __POSIX_VISIBLE >= 200112
#define __KAME_NETINET_IN_H_INCLUDED_
#endif
#endif /* !_NETINET_IN_H_*/