From 3f575da2f29de31162cbc454857889bc7e83f587 Mon Sep 17 00:00:00 2001 From: Sebastian Huber Date: Thu, 7 Dec 2017 07:22:44 +0100 Subject: Remove obsolete network header files Update #3254. --- cpukit/libnetworking/Makefile.am | 15 - cpukit/libnetworking/include/arpa/inet.h | 157 ----- cpukit/libnetworking/include/net/if.h | 297 -------- cpukit/libnetworking/include/netdb.h | 306 --------- cpukit/libnetworking/include/netinet/in.h | 669 ------------------ cpukit/libnetworking/include/netinet/tcp.h | 123 ---- cpukit/libnetworking/include/netinet6/in6.h | 745 --------------------- .../libnetworking/include/sys/_sockaddr_storage.h | 54 -- cpukit/libnetworking/include/sys/socket.h | 689 ------------------- cpukit/libnetworking/include/sys/syslog.h | 191 ------ cpukit/libnetworking/include/sys/ttydefaults.h | 96 --- cpukit/libnetworking/include/sys/un.h | 76 --- cpukit/libnetworking/include/syslog.h | 1 - cpukit/libnetworking/preinstall.am | 49 -- 14 files changed, 3468 deletions(-) delete mode 100644 cpukit/libnetworking/include/arpa/inet.h delete mode 100644 cpukit/libnetworking/include/net/if.h delete mode 100644 cpukit/libnetworking/include/netdb.h delete mode 100644 cpukit/libnetworking/include/netinet/in.h delete mode 100644 cpukit/libnetworking/include/netinet/tcp.h delete mode 100644 cpukit/libnetworking/include/netinet6/in6.h delete mode 100644 cpukit/libnetworking/include/sys/_sockaddr_storage.h delete mode 100644 cpukit/libnetworking/include/sys/socket.h delete mode 100644 cpukit/libnetworking/include/sys/syslog.h delete mode 100644 cpukit/libnetworking/include/sys/ttydefaults.h delete mode 100644 cpukit/libnetworking/include/sys/un.h delete mode 100644 cpukit/libnetworking/include/syslog.h (limited to 'cpukit/libnetworking') diff --git a/cpukit/libnetworking/Makefile.am b/cpukit/libnetworking/Makefile.am index 3719e615c7..d6c8af89dd 100644 --- a/cpukit/libnetworking/Makefile.am +++ b/cpukit/libnetworking/Makefile.am @@ -200,21 +200,6 @@ include_vm_HEADERS += vm/vm_param.h include_dev_miidir = $(includedir)/dev/mii include_dev_mii_HEADERS = dev/mii/mii.h -if !HAS_NEWLIB_20170522_HEADER -include_arpa_HEADERS += include/arpa/inet.h -include_HEADERS += include/netdb.h -include_HEADERS += include/syslog.h -include_net_HEADERS += include/net/if.h -include_netinet6_HEADERS = include/netinet6/in6.h -include_netinet_HEADERS += include/netinet/in.h -include_netinet_HEADERS += include/netinet/tcp.h -include_sys_HEADERS += include/sys/_sockaddr_storage.h -include_sys_HEADERS += include/sys/socket.h -include_sys_HEADERS += include/sys/syslog.h -include_sys_HEADERS += include/sys/ttydefaults.h -include_sys_HEADERS += include/sys/un.h -endif - ## libc libc_CPPFLAGS = -DNOPOLL -DNOSELECT -D__BSD_VISIBLE -D_THREAD_SAFE diff --git a/cpukit/libnetworking/include/arpa/inet.h b/cpukit/libnetworking/include/arpa/inet.h deleted file mode 100644 index 91e3a828ab..0000000000 --- a/cpukit/libnetworking/include/arpa/inet.h +++ /dev/null @@ -1,157 +0,0 @@ -/* - * ++Copyright++ 1983, 1993 - * - - * Copyright (c) 1983, 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. 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. - * - - * Portions Copyright (c) 1993 by Digital Equipment Corporation. - * - * Permission to use, copy, modify, and distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies, and that - * the name of Digital Equipment Corporation not be used in advertising or - * publicity pertaining to distribution of the document or software without - * specific, written prior permission. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND DIGITAL EQUIPMENT CORP. DISCLAIMS ALL - * WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL DIGITAL EQUIPMENT - * CORPORATION BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL - * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR - * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS - * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS - * SOFTWARE. - * - - * --Copyright-- - */ - -/*% - * @(#)inet.h 8.1 (Berkeley) 6/2/93 - * $Id: inet.h,v 1.3 2005/04/27 04:56:16 sra Exp $ - * $FreeBSD: head/include/arpa/inet.h 269867 2014-08-12 12:36:06Z ume $ - */ - -#ifndef _ARPA_INET_H_ -#define _ARPA_INET_H_ - -/* External definitions for functions in inet(3). */ - -#include -#include - -/* Required for byteorder(3) functions. */ -#include - -#define INET_ADDRSTRLEN 16 -#define INET6_ADDRSTRLEN 46 - -#ifndef _UINT16_T_DECLARED -typedef __uint16_t uint16_t; -#define _UINT16_T_DECLARED -#endif - -#ifndef _UINT32_T_DECLARED -typedef __uint32_t uint32_t; -#define _UINT32_T_DECLARED -#endif - -#ifndef _IN_ADDR_T_DECLARED -typedef uint32_t in_addr_t; -#define _IN_ADDR_T_DECLARED -#endif - -#ifndef _IN_PORT_T_DECLARED -typedef uint16_t in_port_t; -#define _IN_PORT_T_DECLARED -#endif - -#if __BSD_VISIBLE -#ifndef _SIZE_T_DECLARED -typedef __size_t size_t; -#define _SIZE_T_DECLARED -#endif -#endif - -/* - * XXX socklen_t is used by a POSIX.1-2001 interface, but not required by - * POSIX.1-2001. - */ -#ifndef _SOCKLEN_T_DECLARED -typedef __socklen_t socklen_t; -#define _SOCKLEN_T_DECLARED -#endif - -#ifndef _STRUCT_IN_ADDR_DECLARED -struct in_addr { - in_addr_t s_addr; -}; -#define _STRUCT_IN_ADDR_DECLARED -#endif - -__BEGIN_DECLS -#ifndef _BYTEORDER_PROTOTYPED -#define _BYTEORDER_PROTOTYPED -uint32_t htonl(uint32_t); -uint16_t htons(uint16_t); -uint32_t ntohl(uint32_t); -uint16_t ntohs(uint16_t); -#endif - -in_addr_t inet_addr(const char *); -/*const*/ char *inet_ntoa(struct in_addr); -const char *inet_ntop(int, const void * __restrict, char * __restrict, - socklen_t); -int inet_pton(int, const char * __restrict, void * __restrict); - -#if __BSD_VISIBLE -int inet_aton(const char *, struct in_addr *); -in_addr_t inet_lnaof(struct in_addr); -struct in_addr inet_makeaddr(in_addr_t, in_addr_t); -char * inet_neta(in_addr_t, char *, size_t); -in_addr_t inet_netof(struct in_addr); -in_addr_t inet_network(const char *); -char *inet_net_ntop(int, const void *, int, char *, size_t); -int inet_net_pton(int, const char *, void *, size_t); -char *inet_ntoa_r(struct in_addr, char *buf, socklen_t size); -char *inet_cidr_ntop(int, const void *, int, char *, size_t); -int inet_cidr_pton(int, const char *, void *, int *); -unsigned inet_nsap_addr(const char *, unsigned char *, int); -char *inet_nsap_ntoa(int, const unsigned char *, char *); -#endif /* __BSD_VISIBLE */ -__END_DECLS - -#ifndef _BYTEORDER_FUNC_DEFINED -#define _BYTEORDER_FUNC_DEFINED -#define htonl(x) __htonl(x) -#define htons(x) __htons(x) -#define ntohl(x) __ntohl(x) -#define ntohs(x) __ntohs(x) -#endif - -#endif /* !_ARPA_INET_H_ */ - -/*! \file */ diff --git a/cpukit/libnetworking/include/net/if.h b/cpukit/libnetworking/include/net/if.h deleted file mode 100644 index 241d51c5e5..0000000000 --- a/cpukit/libnetworking/include/net/if.h +++ /dev/null @@ -1,297 +0,0 @@ -/* - * Copyright (c) 1982, 1986, 1989, 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. - * 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.h 8.1 (Berkeley) 6/10/93 - * $FreeBSD: src/sys/net/if.h,v 1.95 2005/02/25 19:46:41 brooks Exp $ - */ - - -#ifndef _NET_IF_H_ -#define _NET_IF_H_ - -#include - -#if defined(__rtems__) -/* - * FIXME - HACK: BSD defines __BSD_VISIBLE in sys/cdefs.h - * RTEMS sys/cdefs.h doesn't, so we enforce it here. - */ -#ifndef __BSD_VISIBLE -#define __BSD_VISIBLE 1 -#endif -#include -#include /* struct sockaddr */ -#endif - -#ifdef _KERNEL -#include -#endif - -#if __BSD_VISIBLE -/* - * does not depend on on most other systems. This - * helps userland compatibility. (struct timeval ifi_lastchange) - */ -#ifndef _KERNEL -#include -#endif - -struct ifnet; -struct ether_header; -#endif - -/* - * Length of interface external name, including terminating '\0'. - * Note: this is the same size as a generic device's external name. - */ -#define IF_NAMESIZE 16 -#if __BSD_VISIBLE -#define IFNAMSIZ IF_NAMESIZE -#define IF_MAXUNIT 0x7fff /* historical value */ -#endif -#if __BSD_VISIBLE - -/* - * Structure used to query names of interface cloners. - */ - -struct if_clonereq { - int ifcr_total; /* total cloners (out) */ - int ifcr_count; /* room for this many in user buffer */ - char *ifcr_buffer; /* buffer for cloner names */ -}; - -/* - * Structure describing information about an interface - * which may be of interest to management entities. - */ -struct if_data { - /* generic interface information */ - u_char ifi_type; /* ethernet, tokenring, etc */ - u_char ifi_physical; /* e.g., AUI, Thinnet, 10base-T, etc */ - u_char ifi_addrlen; /* media address length */ - u_char ifi_hdrlen; /* media header length */ - u_char ifi_recvquota; /* polling quota for receive intrs */ - u_char ifi_xmitquota; /* polling quota for xmit intrs */ - u_long ifi_mtu; /* maximum transmission unit */ - u_long ifi_metric; /* routing metric (external only) */ - u_long ifi_baudrate; /* linespeed */ - /* volatile statistics */ - u_long ifi_ipackets; /* packets received on interface */ - u_long ifi_ierrors; /* input errors on interface */ - u_long ifi_opackets; /* packets sent on interface */ - u_long ifi_oerrors; /* output errors on interface */ - u_long ifi_collisions; /* collisions on csma interfaces */ - u_long ifi_ibytes; /* total number of octets received */ - u_long ifi_obytes; /* total number of octets sent */ - u_long ifi_imcasts; /* packets received via multicast */ - u_long ifi_omcasts; /* packets sent via multicast */ - u_long ifi_iqdrops; /* dropped on input, this interface */ - u_long ifi_noproto; /* destined for unsupported protocol */ - u_long ifi_recvtiming; /* usec spent receiving when timing */ - u_long ifi_xmittiming; /* usec spent xmitting when timing */ - struct timeval ifi_lastchange; /* time of last administrative change */ -}; - -#define IFF_UP 0x1 /* interface is up */ -#define IFF_BROADCAST 0x2 /* broadcast address valid */ -#define IFF_DEBUG 0x4 /* turn on debugging */ -#define IFF_LOOPBACK 0x8 /* is a loopback net */ -#define IFF_POINTOPOINT 0x10 /* interface is point-to-point link */ -#define IFF_SMART 0x20 /* interface manages own routes */ -#define IFF_DRV_RUNNING 0x40 /* resources allocated */ -#define IFF_NOARP 0x80 /* no address resolution protocol */ -#define IFF_PROMISC 0x100 /* receive all packets */ -#define IFF_ALLMULTI 0x200 /* receive all multicast packets */ -#define IFF_DRV_OACTIVE 0x400 /* tx hardware queue is full */ -#define IFF_SIMPLEX 0x800 /* can't hear own transmissions */ -#define IFF_LINK0 0x1000 /* per link layer defined bit */ -#define IFF_LINK1 0x2000 /* per link layer defined bit */ -#define IFF_LINK2 0x4000 /* per link layer defined bit */ -#define IFF_ALTPHYS IFF_LINK2 /* use alternate physical connection */ -#define IFF_MULTICAST 0x8000 /* supports multicast */ -#define IFF_POLLING 0x10000 /* Interface is in polling mode. */ -#define IFF_PPROMISC 0x20000 /* user-requested promisc mode */ -#define IFF_MONITOR 0x40000 /* user-requested monitor mode */ -#define IFF_STATICARP 0x80000 /* static ARP */ -#define IFF_NEEDSGIANT 0x100000 /* hold Giant over if_start calls */ - -/* flags set internally only: */ -#define IFF_CANTCHANGE \ - (IFF_BROADCAST|IFF_POINTOPOINT|IFF_RUNNING|IFF_OACTIVE|\ - IFF_SIMPLEX|IFF_MULTICAST|IFF_ALLMULTI|IFF_SMART|IFF_PROMISC|\ - IFF_POLLING) - -/* - * Values for if_link_state. - */ -#define LINK_STATE_UNKNOWN 0 /* link invalid/unknown */ -#define LINK_STATE_DOWN 1 /* link is down */ -#define LINK_STATE_UP 2 /* link is up */ - -/* - * Some convenience macros used for setting ifi_baudrate. - * XXX 1000 vs. 1024? --thorpej@netbsd.org - */ -#define IF_Kbps(x) ((x) * 1000) /* kilobits/sec. */ -#define IF_Mbps(x) (IF_Kbps((x) * 1000)) /* megabits/sec. */ -#define IF_Gbps(x) (IF_Mbps((x) * 1000)) /* gigabits/sec. */ - -#define IFQ_MAXLEN 50 -#define IFNET_SLOWHZ 1 /* granularity is 1 second */ - -/* - * Message format for use in obtaining information about interfaces - * from getkerninfo and the routing socket - */ -struct if_msghdr { - u_short ifm_msglen; /* to skip over non-understood messages */ - u_char ifm_version; /* future binary compatibility */ - u_char ifm_type; /* message type */ - int ifm_addrs; /* like rtm_addrs */ - int ifm_flags; /* value of if_flags */ - u_short ifm_index; /* index for associated ifp */ - struct if_data ifm_data;/* statistics and other data about if */ -}; - -/* - * Message format for use in obtaining information about interface addresses - * from getkerninfo and the routing socket - */ -struct ifa_msghdr { - u_short ifam_msglen; /* to skip over non-understood messages */ - u_char ifam_version; /* future binary compatibility */ - u_char ifam_type; /* message type */ - int ifam_addrs; /* like rtm_addrs */ - int ifam_flags; /* value of ifa_flags */ - u_short ifam_index; /* index for associated ifp */ - int ifam_metric; /* value of ifa_metric */ -}; - -/* forward declaration */ -struct mbuf; - -/* - * Interface request structure used for socket - * ioctl's. All interface ioctl's must have parameter - * definitions which begin with ifr_name. The - * remainder may be interface specific. - */ -struct ifreq { - char ifr_name[IFNAMSIZ]; /* if name, e.g. "en0" */ - union { - struct sockaddr ifru_addr; - struct sockaddr ifru_dstaddr; - struct sockaddr ifru_broadaddr; - short ifru_flags[2]; - int32_t ifru_metric; - int32_t ifru_mtu; - int ifru_phys; - int ifru_media; - caddr_t ifru_data; - } ifr_ifru; -#define ifr_addr ifr_ifru.ifru_addr /* address */ -#define ifr_dstaddr ifr_ifru.ifru_dstaddr /* other end of p-to-p link */ -#define ifr_broadaddr ifr_ifru.ifru_broadaddr /* broadcast address */ -#define ifr_flags ifr_ifru.ifru_flags[0] /* flags (low 16 bits) */ -#define ifr_flagshigh ifr_ifru.ifru_flags[1] /* flags (high 16 bits) */ -#define ifr_metric ifr_ifru.ifru_metric /* metric */ -#define ifr_mtu ifr_ifru.ifru_mtu /* mtu */ -#define ifr_phys ifr_ifru.ifru_phys /* physical wire */ -#define ifr_media ifr_ifru.ifru_media /* physical media */ -#define ifr_data ifr_ifru.ifru_data /* for use by interface */ -}; - -struct ifaliasreq { - char ifra_name[IFNAMSIZ]; /* if name, e.g. "en0" */ - struct sockaddr ifra_addr; - struct sockaddr ifra_broadaddr; - struct sockaddr ifra_mask; -}; - -struct ifmediareq { - char ifm_name[IFNAMSIZ]; /* if name, e.g. "en0" */ - int ifm_current; /* current media options */ - int ifm_mask; /* don't care mask */ - int ifm_status; /* media status */ - int ifm_active; /* active options */ - int ifm_count; /* # entries in ifm_ulist array */ - int *ifm_ulist; /* media words */ -}; - -/* - * Structure used to retrieve aux status data from interfaces. - * Kernel suppliers to this interface should respect the formatting - * needed by ifconfig(8): each line starts with a TAB and ends with - * a newline. The canonical example to copy and paste is in if_tun.c. - */ - -#define IFSTATMAX 800 /* 10 lines of text */ -struct ifstat { - char ifs_name[IFNAMSIZ]; /* if name, e.g. "en0" */ - char ascii[IFSTATMAX + 1]; -}; - -/* - * Structure used in SIOCGIFCONF request. - * Used to retrieve interface configuration - * for machine (useful for programs which - * must know all networks accessible). - */ -struct ifconf { - int ifc_len; /* size of associated buffer */ - union { - caddr_t ifcu_buf; - struct ifreq *ifcu_req; - } ifc_ifcu; -#define ifc_buf ifc_ifcu.ifcu_buf /* buffer address */ -#define ifc_req ifc_ifcu.ifcu_req /* array of structures returned */ -}; -#endif /* __BSD_VISIBLE */ - -#ifndef _KERNEL -struct if_nameindex { - unsigned int if_index; /* 1, 2, ... */ - char *if_name; /* null terminated name: "le0", ... */ -}; - -__BEGIN_DECLS -void if_freenameindex(struct if_nameindex *); -char *if_indextoname(unsigned int, char *); -struct if_nameindex *if_nameindex(void); -__END_DECLS -#endif - -#ifdef _KERNEL - -/* XXX - this should go away soon. */ -#include - -#endif - -#endif /* !_NET_IF_H_ */ diff --git a/cpukit/libnetworking/include/netdb.h b/cpukit/libnetworking/include/netdb.h deleted file mode 100644 index 948a3c8cb0..0000000000 --- a/cpukit/libnetworking/include/netdb.h +++ /dev/null @@ -1,306 +0,0 @@ -/*- - * Copyright (c) 1980, 1983, 1988, 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. 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. - * - * - - * Portions Copyright (c) 1993 by Digital Equipment Corporation. - * - * Permission to use, copy, modify, and distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies, and that - * the name of Digital Equipment Corporation not be used in advertising or - * publicity pertaining to distribution of the document or software without - * specific, written prior permission. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND DIGITAL EQUIPMENT CORP. DISCLAIMS ALL - * WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL DIGITAL EQUIPMENT - * CORPORATION BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL - * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR - * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS - * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS - * SOFTWARE. - * - - * --Copyright-- - */ - -/* - * @(#)netdb.h 8.1 (Berkeley) 6/2/93 - * From: Id: netdb.h,v 8.9 1996/11/19 08:39:29 vixie Exp $ - * $FreeBSD: head/include/netdb.h 301711 2016-06-09 01:28:44Z markj $ - */ - -#ifndef _NETDB_H_ -#define _NETDB_H_ - -#include -#include - -#ifndef _IN_ADDR_T_DECLARED -typedef __uint32_t in_addr_t; -#define _IN_ADDR_T_DECLARED -#endif - -#ifndef _IN_PORT_T_DECLARED -typedef __uint16_t in_port_t; -#define _IN_PORT_T_DECLARED -#endif - -#ifndef _SIZE_T_DECLARED -typedef __size_t size_t; -#define _SIZE_T_DECLARED -#endif - -#ifndef _SOCKLEN_T_DECLARED -typedef __socklen_t socklen_t; -#define _SOCKLEN_T_DECLARED -#endif - -#ifndef _UINT32_T_DECLARED -typedef __uint32_t uint32_t; -#define _UINT32_T_DECLARED -#endif - -#ifndef _PATH_HEQUIV -# define _PATH_HEQUIV "/etc/hosts.equiv" -#endif -#define _PATH_HOSTS "/etc/hosts" -#define _PATH_NETWORKS "/etc/networks" -#define _PATH_PROTOCOLS "/etc/protocols" -#define _PATH_SERVICES "/etc/services" -#define _PATH_SERVICES_DB "/var/db/services.db" - -#define h_errno (*__h_errno()) - -/* - * Structures returned by network data base library. All addresses are - * supplied in host order, and returned in network order (suitable for - * use in system calls). - */ -struct hostent { - char *h_name; /* official name of host */ - char **h_aliases; /* alias list */ - int h_addrtype; /* host address type */ - int h_length; /* length of address */ - char **h_addr_list; /* list of addresses from name server */ -#define h_addr h_addr_list[0] /* address, for backward compatibility */ -}; - -struct netent { - char *n_name; /* official name of net */ - char **n_aliases; /* alias list */ - int n_addrtype; /* net address type */ - uint32_t n_net; /* network # */ -}; - -struct servent { - char *s_name; /* official service name */ - char **s_aliases; /* alias list */ - int s_port; /* port # */ - char *s_proto; /* protocol to use */ -}; - -struct protoent { - char *p_name; /* official protocol name */ - char **p_aliases; /* alias list */ - int p_proto; /* protocol # */ -}; - -struct addrinfo { - int ai_flags; /* AI_PASSIVE, AI_CANONNAME, AI_NUMERICHOST */ - int ai_family; /* AF_xxx */ - int ai_socktype; /* SOCK_xxx */ - int ai_protocol; /* 0 or IPPROTO_xxx for IPv4 and IPv6 */ - socklen_t ai_addrlen; /* length of ai_addr */ - char *ai_canonname; /* canonical name for hostname */ - struct sockaddr *ai_addr; /* binary address */ - struct addrinfo *ai_next; /* next structure in linked list */ -}; - -#define IPPORT_RESERVED 1024 - -/* - * Error return codes from gethostbyname() and gethostbyaddr() - * (left in h_errno). - */ - -#define NETDB_INTERNAL -1 /* see errno */ -#define NETDB_SUCCESS 0 /* no problem */ -#define HOST_NOT_FOUND 1 /* Authoritative Answer Host not found */ -#define TRY_AGAIN 2 /* Non-Authoritative Host not found, or SERVERFAIL */ -#define NO_RECOVERY 3 /* Non recoverable errors, FORMERR, REFUSED, NOTIMP */ -#define NO_DATA 4 /* Valid name, no data record of requested type */ -#define NO_ADDRESS NO_DATA /* no address, look for MX record */ - -/* - * Error return codes from getaddrinfo() - */ -#if 0 -/* obsoleted */ -#define EAI_ADDRFAMILY 1 /* address family for hostname not supported */ -#endif -#define EAI_AGAIN 2 /* temporary failure in name resolution */ -#define EAI_BADFLAGS 3 /* invalid value for ai_flags */ -#define EAI_FAIL 4 /* non-recoverable failure in name resolution */ -#define EAI_FAMILY 5 /* ai_family not supported */ -#define EAI_MEMORY 6 /* memory allocation failure */ -#if 0 -/* obsoleted */ -#define EAI_NODATA 7 /* no address associated with hostname */ -#endif -#define EAI_NONAME 8 /* hostname nor servname provided, or not known */ -#define EAI_SERVICE 9 /* servname not supported for ai_socktype */ -#define EAI_SOCKTYPE 10 /* ai_socktype not supported */ -#define EAI_SYSTEM 11 /* system error returned in errno */ -#define EAI_BADHINTS 12 /* invalid value for hints */ -#define EAI_PROTOCOL 13 /* resolved protocol is unknown */ -#define EAI_OVERFLOW 14 /* argument buffer overflow */ -#define EAI_MAX 15 - -/* - * Flag values for getaddrinfo() - */ -#define AI_PASSIVE 0x00000001 /* get address to use bind() */ -#define AI_CANONNAME 0x00000002 /* fill ai_canonname */ -#define AI_NUMERICHOST 0x00000004 /* prevent host name resolution */ -#define AI_NUMERICSERV 0x00000008 /* prevent service name resolution */ -/* valid flags for addrinfo (not a standard def, apps should not use it) */ -#define AI_MASK \ - (AI_PASSIVE | AI_CANONNAME | AI_NUMERICHOST | AI_NUMERICSERV | \ - AI_ADDRCONFIG | AI_ALL | AI_V4MAPPED) - -#define AI_ALL 0x00000100 /* IPv6 and IPv4-mapped (with AI_V4MAPPED) */ -#define AI_V4MAPPED_CFG 0x00000200 /* accept IPv4-mapped if kernel supports */ -#define AI_ADDRCONFIG 0x00000400 /* only if any address is assigned */ -#define AI_V4MAPPED 0x00000800 /* accept IPv4-mapped IPv6 address */ -/* special recommended flags for getipnodebyname */ -#define AI_DEFAULT (AI_V4MAPPED_CFG | AI_ADDRCONFIG) - -/* - * Constants for getnameinfo() - */ -#define NI_MAXHOST 1025 -#define NI_MAXSERV 32 - -/* - * Flag values for getnameinfo() - */ -#define NI_NOFQDN 0x00000001 -#define NI_NUMERICHOST 0x00000002 -#define NI_NAMEREQD 0x00000004 -#define NI_NUMERICSERV 0x00000008 -#define NI_DGRAM 0x00000010 -#if 0 /* obsolete */ -#define NI_WITHSCOPEID 0x00000020 -#endif - -/* - * Scope delimit character - */ -#define SCOPE_DELIMITER '%' - -__BEGIN_DECLS -void endhostent(void); -void endnetent(void); -void endprotoent(void); -void endservent(void); -#if __BSD_VISIBLE || (__POSIX_VISIBLE && __POSIX_VISIBLE <= 200112) -struct hostent *gethostbyaddr(const void *, socklen_t, int); -struct hostent *gethostbyname(const char *); -#endif -struct hostent *gethostent(void); -struct netent *getnetbyaddr(uint32_t, int); -struct netent *getnetbyname(const char *); -struct netent *getnetent(void); -struct protoent *getprotobyname(const char *); -struct protoent *getprotobynumber(int); -struct protoent *getprotoent(void); -struct servent *getservbyname(const char *, const char *); -struct servent *getservbyport(int, const char *); -struct servent *getservent(void); -void sethostent(int); -/* void sethostfile(const char *); */ -void setnetent(int); -void setprotoent(int); -int getaddrinfo(const char *, const char *, - const struct addrinfo *, struct addrinfo **); -int getnameinfo(const struct sockaddr *, socklen_t, char *, - size_t, char *, size_t, int); -void freeaddrinfo(struct addrinfo *); -const char *gai_strerror(int); -void setservent(int); - -#if __BSD_VISIBLE -void endnetgrent(void); -void freehostent(struct hostent *); -int gethostbyaddr_r(const void *, socklen_t, int, struct hostent *, - char *, size_t, struct hostent **, int *); -int gethostbyname_r(const char *, struct hostent *, char *, size_t, - struct hostent **, int *); -struct hostent *gethostbyname2(const char *, int); -int gethostbyname2_r(const char *, int, struct hostent *, char *, - size_t, struct hostent **, int *); -int gethostent_r(struct hostent *, char *, size_t, - struct hostent **, int *); -struct hostent *getipnodebyaddr(const void *, size_t, int, int *); -struct hostent *getipnodebyname(const char *, int, int, int *); -int getnetbyaddr_r(uint32_t, int, struct netent *, char *, size_t, - struct netent**, int *); -int getnetbyname_r(const char *, struct netent *, char *, size_t, - struct netent **, int *); -int getnetent_r(struct netent *, char *, size_t, struct netent **, - int *); -int getnetgrent(char **, char **, char **); -int getnetgrent_r(char **, char **, char **, char *, size_t); -int getprotobyname_r(const char *, struct protoent *, char *, - size_t, struct protoent **); -int getprotobynumber_r(int, struct protoent *, char *, size_t, - struct protoent **); -int getprotoent_r(struct protoent *, char *, size_t, - struct protoent **); -int getservbyname_r(const char *, const char *, struct servent *, - char *, size_t, struct servent **); -int getservbyport_r(int, const char *, struct servent *, char *, - size_t, struct servent **); -int getservent_r(struct servent *, char *, size_t, - struct servent **); -void herror(const char *); -const char *hstrerror(int); -int innetgr(const char *, const char *, const char *, const char *); -void setnetgrent(const char *); -#endif - - -/* - * PRIVATE functions specific to the FreeBSD implementation - */ - -/* DO NOT USE THESE, THEY ARE SUBJECT TO CHANGE AND ARE NOT PORTABLE!!! */ -int * __h_errno(void); -__END_DECLS - -#endif /* !_NETDB_H_ */ diff --git a/cpukit/libnetworking/include/netinet/in.h b/cpukit/libnetworking/include/netinet/in.h deleted file mode 100644 index 4361a44767..0000000000 --- a/cpukit/libnetworking/include/netinet/in.h +++ /dev/null @@ -1,669 +0,0 @@ -/*- - * 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. - * 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: head/sys/netinet/in.h 281649 2015-04-17 11:57:06Z glebius $ - */ - -#ifndef _NETINET_IN_H_ -#define _NETINET_IN_H_ - -#include -#include -#include - -/* Protocols common to RFC 1700, POSIX, and X/Open. */ -#define IPPROTO_IP 0 /* dummy for IP */ -#define IPPROTO_ICMP 1 /* control message protocol */ -#define IPPROTO_TCP 6 /* tcp */ -#define IPPROTO_UDP 17 /* user datagram protocol */ - -#define INADDR_ANY ((in_addr_t)0x00000000) -#define INADDR_BROADCAST ((in_addr_t)0xffffffff) /* must be masked */ - -#ifndef _UINT8_T_DECLARED -typedef __uint8_t uint8_t; -#define _UINT8_T_DECLARED -#endif - -#ifndef _UINT16_T_DECLARED -typedef __uint16_t uint16_t; -#define _UINT16_T_DECLARED -#endif - -#ifndef _UINT32_T_DECLARED -typedef __uint32_t uint32_t; -#define _UINT32_T_DECLARED -#endif - -#ifndef _IN_ADDR_T_DECLARED -typedef uint32_t in_addr_t; -#define _IN_ADDR_T_DECLARED -#endif - -#ifndef _IN_PORT_T_DECLARED -typedef uint16_t in_port_t; -#define _IN_PORT_T_DECLARED -#endif - -#ifndef _SA_FAMILY_T_DECLARED -typedef __sa_family_t sa_family_t; -#define _SA_FAMILY_T_DECLARED -#endif - -/* Internet address (a structure for historical reasons). */ -#ifndef _STRUCT_IN_ADDR_DECLARED -struct in_addr { - in_addr_t s_addr; -}; -#define _STRUCT_IN_ADDR_DECLARED -#endif - -#ifndef _SOCKLEN_T_DECLARED -typedef __socklen_t socklen_t; -#define _SOCKLEN_T_DECLARED -#endif - -#include - -/* Socket address, internet style. */ -struct sockaddr_in { - uint8_t sin_len; - sa_family_t sin_family; - in_port_t sin_port; - struct in_addr sin_addr; - char sin_zero[8]; -}; - -#if !defined(_KERNEL) && __POSIX_VISIBLE >= 200112 - -#ifndef _BYTEORDER_PROTOTYPED -#define _BYTEORDER_PROTOTYPED -__BEGIN_DECLS -uint32_t htonl(uint32_t); -uint16_t htons(uint16_t); -uint32_t ntohl(uint32_t); -uint16_t ntohs(uint16_t); -__END_DECLS -#endif - -#ifndef _BYTEORDER_FUNC_DEFINED -#define _BYTEORDER_FUNC_DEFINED -#define htonl(x) __htonl(x) -#define htons(x) __htons(x) -#define ntohl(x) __ntohl(x) -#define ntohs(x) __ntohs(x) -#endif - -#endif /* !_KERNEL && __POSIX_VISIBLE >= 200112 */ - -#if __POSIX_VISIBLE >= 200112 -#define IPPROTO_IPV6 41 /* IP6 header */ -#define IPPROTO_RAW 255 /* raw IP packet */ -#define INET_ADDRSTRLEN 16 -#endif - -#if __BSD_VISIBLE -/* - * Constants and structures defined by the internet system, - * Per RFC 790, September 1981, and numerous additions. - */ - -/* - * Protocols (RFC 1700) - */ -#define IPPROTO_HOPOPTS 0 /* IP6 hop-by-hop options */ -#define IPPROTO_IGMP 2 /* group mgmt protocol */ -#define IPPROTO_GGP 3 /* gateway^2 (deprecated) */ -#define IPPROTO_IPV4 4 /* IPv4 encapsulation */ -#define IPPROTO_IPIP IPPROTO_IPV4 /* for compatibility */ -#define IPPROTO_ST 7 /* Stream protocol II */ -#define IPPROTO_EGP 8 /* exterior gateway protocol */ -#define IPPROTO_PIGP 9 /* private interior gateway */ -#define IPPROTO_RCCMON 10 /* BBN RCC Monitoring */ -#define IPPROTO_NVPII 11 /* network voice protocol*/ -#define IPPROTO_PUP 12 /* pup */ -#define IPPROTO_ARGUS 13 /* Argus */ -#define IPPROTO_EMCON 14 /* EMCON */ -#define IPPROTO_XNET 15 /* Cross Net Debugger */ -#define IPPROTO_CHAOS 16 /* Chaos*/ -#define IPPROTO_MUX 18 /* Multiplexing */ -#define IPPROTO_MEAS 19 /* DCN Measurement Subsystems */ -#define IPPROTO_HMP 20 /* Host Monitoring */ -#define IPPROTO_PRM 21 /* Packet Radio Measurement */ -#define IPPROTO_IDP 22 /* xns idp */ -#define IPPROTO_TRUNK1 23 /* Trunk-1 */ -#define IPPROTO_TRUNK2 24 /* Trunk-2 */ -#define IPPROTO_LEAF1 25 /* Leaf-1 */ -#define IPPROTO_LEAF2 26 /* Leaf-2 */ -#define IPPROTO_RDP 27 /* Reliable Data */ -#define IPPROTO_IRTP 28 /* Reliable Transaction */ -#define IPPROTO_TP 29 /* tp-4 w/ class negotiation */ -#define IPPROTO_BLT 30 /* Bulk Data Transfer */ -#define IPPROTO_NSP 31 /* Network Services */ -#define IPPROTO_INP 32 /* Merit Internodal */ -#define IPPROTO_SEP 33 /* Sequential Exchange */ -#define IPPROTO_3PC 34 /* Third Party Connect */ -#define IPPROTO_IDPR 35 /* InterDomain Policy Routing */ -#define IPPROTO_XTP 36 /* XTP */ -#define IPPROTO_DDP 37 /* Datagram Delivery */ -#define IPPROTO_CMTP 38 /* Control Message Transport */ -#define IPPROTO_TPXX 39 /* TP++ Transport */ -#define IPPROTO_IL 40 /* IL transport protocol */ -#define IPPROTO_SDRP 42 /* Source Demand Routing */ -#define IPPROTO_ROUTING 43 /* IP6 routing header */ -#define IPPROTO_FRAGMENT 44 /* IP6 fragmentation header */ -#define IPPROTO_IDRP 45 /* InterDomain Routing*/ -#define IPPROTO_RSVP 46 /* resource reservation */ -#define IPPROTO_GRE 47 /* General Routing Encap. */ -#define IPPROTO_MHRP 48 /* Mobile Host Routing */ -#define IPPROTO_BHA 49 /* BHA */ -#define IPPROTO_ESP 50 /* IP6 Encap Sec. Payload */ -#define IPPROTO_AH 51 /* IP6 Auth Header */ -#define IPPROTO_INLSP 52 /* Integ. Net Layer Security */ -#define IPPROTO_SWIPE 53 /* IP with encryption */ -#define IPPROTO_NHRP 54 /* Next Hop Resolution */ -#define IPPROTO_MOBILE 55 /* IP Mobility */ -#define IPPROTO_TLSP 56 /* Transport Layer Security */ -#define IPPROTO_SKIP 57 /* SKIP */ -#define IPPROTO_ICMPV6 58 /* ICMP6 */ -#define IPPROTO_NONE 59 /* IP6 no next header */ -#define IPPROTO_DSTOPTS 60 /* IP6 destination option */ -#define IPPROTO_AHIP 61 /* any host internal protocol */ -#define IPPROTO_CFTP 62 /* CFTP */ -#define IPPROTO_HELLO 63 /* "hello" routing protocol */ -#define IPPROTO_SATEXPAK 64 /* SATNET/Backroom EXPAK */ -#define IPPROTO_KRYPTOLAN 65 /* Kryptolan */ -#define IPPROTO_RVD 66 /* Remote Virtual Disk */ -#define IPPROTO_IPPC 67 /* Pluribus Packet Core */ -#define IPPROTO_ADFS 68 /* Any distributed FS */ -#define IPPROTO_SATMON 69 /* Satnet Monitoring */ -#define IPPROTO_VISA 70 /* VISA Protocol */ -#define IPPROTO_IPCV 71 /* Packet Core Utility */ -#define IPPROTO_CPNX 72 /* Comp. Prot. Net. Executive */ -#define IPPROTO_CPHB 73 /* Comp. Prot. HeartBeat */ -#define IPPROTO_WSN 74 /* Wang Span Network */ -#define IPPROTO_PVP 75 /* Packet Video Protocol */ -#define IPPROTO_BRSATMON 76 /* BackRoom SATNET Monitoring */ -#define IPPROTO_ND 77 /* Sun net disk proto (temp.) */ -#define IPPROTO_WBMON 78 /* WIDEBAND Monitoring */ -#define IPPROTO_WBEXPAK 79 /* WIDEBAND EXPAK */ -#define IPPROTO_EON 80 /* ISO cnlp */ -#define IPPROTO_VMTP 81 /* VMTP */ -#define IPPROTO_SVMTP 82 /* Secure VMTP */ -#define IPPROTO_VINES 83 /* Banyon VINES */ -#define IPPROTO_TTP 84 /* TTP */ -#define IPPROTO_IGP 85 /* NSFNET-IGP */ -#define IPPROTO_DGP 86 /* dissimilar gateway prot. */ -#define IPPROTO_TCF 87 /* TCF */ -#define IPPROTO_IGRP 88 /* Cisco/GXS IGRP */ -#define IPPROTO_OSPFIGP 89 /* OSPFIGP */ -#define IPPROTO_SRPC 90 /* Strite RPC protocol */ -#define IPPROTO_LARP 91 /* Locus Address Resoloution */ -#define IPPROTO_MTP 92 /* Multicast Transport */ -#define IPPROTO_AX25 93 /* AX.25 Frames */ -#define IPPROTO_IPEIP 94 /* IP encapsulated in IP */ -#define IPPROTO_MICP 95 /* Mobile Int.ing control */ -#define IPPROTO_SCCSP 96 /* Semaphore Comm. security */ -#define IPPROTO_ETHERIP 97 /* Ethernet IP encapsulation */ -#define IPPROTO_ENCAP 98 /* encapsulation header */ -#define IPPROTO_APES 99 /* any private encr. scheme */ -#define IPPROTO_GMTP 100 /* GMTP*/ -#define IPPROTO_IPCOMP 108 /* payload compression (IPComp) */ -#define IPPROTO_SCTP 132 /* SCTP */ -#define IPPROTO_MH 135 /* IPv6 Mobility Header */ -#define IPPROTO_UDPLITE 136 /* UDP-Lite */ -#define IPPROTO_HIP 139 /* IP6 Host Identity Protocol */ -#define IPPROTO_SHIM6 140 /* IP6 Shim6 Protocol */ -/* 101-254: Partly Unassigned */ -#define IPPROTO_PIM 103 /* Protocol Independent Mcast */ -#define IPPROTO_CARP 112 /* CARP */ -#define IPPROTO_PGM 113 /* PGM */ -#define IPPROTO_MPLS 137 /* MPLS-in-IP */ -#define IPPROTO_PFSYNC 240 /* PFSYNC */ -#define IPPROTO_RESERVED_253 253 /* Reserved */ -#define IPPROTO_RESERVED_254 254 /* Reserved */ -/* 255: Reserved */ -/* BSD Private, local use, namespace incursion, no longer used */ -#define IPPROTO_OLD_DIVERT 254 /* OLD divert pseudo-proto */ -#define IPPROTO_MAX 256 - -/* last return value of *_input(), meaning "all job for this pkt is done". */ -#define IPPROTO_DONE 257 - -/* Only used internally, so can be outside the range of valid IP protocols. */ -#define IPPROTO_DIVERT 258 /* divert pseudo-protocol */ -#define IPPROTO_SEND 259 /* SeND pseudo-protocol */ - -/* - * Defined to avoid confusion. The master value is defined by - * PROTO_SPACER in sys/protosw.h. - */ -#define IPPROTO_SPACER 32767 /* spacer for loadable protos */ - -/* - * 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: - * - * 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) - */ -#define IPPORT_RESERVED 1024 - -/* - * Default local port range, used by IP_PORTRANGE_DEFAULT - */ -#define IPPORT_EPHEMERALFIRST 10000 -#define IPPORT_EPHEMERALLAST 65535 - -/* - * Dynamic port range, used by 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 - -#define IPPORT_MAX 65535 - -/* - * 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) (((in_addr_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) (((in_addr_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) (((in_addr_t)(i) & 0xe0000000) == 0xc0000000) -#define IN_CLASSC_NET 0xffffff00 -#define IN_CLASSC_NSHIFT 8 -#define IN_CLASSC_HOST 0x000000ff - -#define IN_CLASSD(i) (((in_addr_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) (((in_addr_t)(i) & 0xf0000000) == 0xf0000000) -#define IN_BADCLASS(i) (((in_addr_t)(i) & 0xf0000000) == 0xf0000000) - -#define IN_LINKLOCAL(i) (((in_addr_t)(i) & 0xffff0000) == 0xa9fe0000) -#define IN_LOOPBACK(i) (((in_addr_t)(i) & 0xff000000) == 0x7f000000) -#define IN_ZERONET(i) (((in_addr_t)(i) & 0xff000000) == 0) - -#define IN_PRIVATE(i) ((((in_addr_t)(i) & 0xff000000) == 0x0a000000) || \ - (((in_addr_t)(i) & 0xfff00000) == 0xac100000) || \ - (((in_addr_t)(i) & 0xffff0000) == 0xc0a80000)) - -#define IN_LOCAL_GROUP(i) (((in_addr_t)(i) & 0xffffff00) == 0xe0000000) - -#define IN_ANY_LOCAL(i) (IN_LINKLOCAL(i) || IN_LOCAL_GROUP(i)) - -#define INADDR_LOOPBACK ((in_addr_t)0x7f000001) -#ifndef _KERNEL -#define INADDR_NONE ((in_addr_t)0xffffffff) /* -1 return */ -#endif - -#define INADDR_UNSPEC_GROUP ((in_addr_t)0xe0000000) /* 224.0.0.0 */ -#define INADDR_ALLHOSTS_GROUP ((in_addr_t)0xe0000001) /* 224.0.0.1 */ -#define INADDR_ALLRTRS_GROUP ((in_addr_t)0xe0000002) /* 224.0.0.2 */ -#define INADDR_ALLRPTS_GROUP ((in_addr_t)0xe0000016) /* 224.0.0.22, IGMPv3 */ -#define INADDR_CARP_GROUP ((in_addr_t)0xe0000012) /* 224.0.0.18 */ -#define INADDR_PFSYNC_GROUP ((in_addr_t)0xe00000f0) /* 224.0.0.240 */ -#define INADDR_ALLMDNS_GROUP ((in_addr_t)0xe00000fb) /* 224.0.0.251 */ -#define INADDR_MAX_LOCAL_GROUP ((in_addr_t)0xe00000ff) /* 224.0.0.255 */ - -#define IN_LOOPBACKNET 127 /* official! */ - -#define IN_RFC3021_MASK ((in_addr_t)0xfffffffe) - -/* - * 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 /* buf/ip_opts; 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_RECVOPTS 5 /* bool; receive all IP opts w/dgram */ -#define IP_RECVRETOPTS 6 /* bool; receive IP opts for response */ -#define IP_RECVDSTADDR 7 /* bool; receive IP dst addr w/dgram */ -#define IP_SENDSRCADDR IP_RECVDSTADDR /* cmsg_type to set src addr */ -#define IP_RETOPTS 8 /* ip_opts; set/get IP options */ -#define IP_MULTICAST_IF 9 /* struct in_addr *or* struct ip_mreqn; - * set/get IP multicast i/f */ -#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 /* ip_mreq; add an IP group membership */ -#define IP_DROP_MEMBERSHIP 13 /* ip_mreq; drop an IP group membership */ -#define IP_MULTICAST_VIF 14 /* set/get IP mcast virt. iface */ -#define IP_RSVP_ON 15 /* enable RSVP in kernel */ -#define IP_RSVP_OFF 16 /* disable RSVP in kernel */ -#define IP_RSVP_VIF_ON 17 /* set RSVP per-vif socket */ -#define IP_RSVP_VIF_OFF 18 /* unset RSVP per-vif socket */ -#define IP_PORTRANGE 19 /* int; range to choose for unspec port */ -#define IP_RECVIF 20 /* bool; receive reception if w/dgram */ -/* for IPSEC */ -#define IP_IPSEC_POLICY 21 /* int; set/get security policy */ - /* unused; was IP_FAITH */ -#define IP_ONESBCAST 23 /* bool: send all-ones broadcast */ -#define IP_BINDANY 24 /* bool: allow bind to any address */ -#define IP_BINDMULTI 25 /* bool: allow multiple listeners on a tuple */ -#define IP_RSS_LISTEN_BUCKET 26 /* int; set RSS listen bucket */ - -/* - * 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. - */ -#define IP_FW_TABLE_ADD 40 /* add entry */ -#define IP_FW_TABLE_DEL 41 /* delete entry */ -#define IP_FW_TABLE_FLUSH 42 /* flush table */ -#define IP_FW_TABLE_GETSIZE 43 /* get table size */ -#define IP_FW_TABLE_LIST 44 /* list table contents */ - -#define IP_FW3 48 /* generic ipfw v.3 sockopts */ -#define IP_DUMMYNET3 49 /* generic dummynet v.3 sockopts */ - -#define IP_FW_ADD 50 /* add a firewall rule to chain */ -#define IP_FW_DEL 51 /* delete a firewall rule from chain */ -#define IP_FW_FLUSH 52 /* flush firewall rule chain */ -#define IP_FW_ZERO 53 /* clear single/all firewall counter(s) */ -#define IP_FW_GET 54 /* get entire firewall rule chain */ -#define IP_FW_RESETLOG 55 /* reset logging counters */ - -#define IP_FW_NAT_CFG 56 /* add/config a nat rule */ -#define IP_FW_NAT_DEL 57 /* delete a nat rule */ -#define IP_FW_NAT_GET_CONFIG 58 /* get configuration of a nat rule */ -#define IP_FW_NAT_GET_LOG 59 /* get log of a nat rule */ - -#define IP_DUMMYNET_CONFIGURE 60 /* add/configure a dummynet pipe */ -#define IP_DUMMYNET_DEL 61 /* delete a dummynet pipe from chain */ -#define IP_DUMMYNET_FLUSH 62 /* flush dummynet */ -#define IP_DUMMYNET_GET 64 /* get entire dummynet pipes */ - -#define IP_RECVTTL 65 /* bool; receive IP TTL w/dgram */ -#define IP_MINTTL 66 /* minimum TTL for packet or drop */ -#define IP_DONTFRAG 67 /* don't fragment packet */ -#define IP_RECVTOS 68 /* bool; receive IP TOS w/dgram */ - -/* IPv4 Source Filter Multicast API [RFC3678] */ -#define IP_ADD_SOURCE_MEMBERSHIP 70 /* join a source-specific group */ -#define IP_DROP_SOURCE_MEMBERSHIP 71 /* drop a single source */ -#define IP_BLOCK_SOURCE 72 /* block a source */ -#define IP_UNBLOCK_SOURCE 73 /* unblock a source */ - -/* The following option is private; do not use it from user applications. */ -#define IP_MSFILTER 74 /* set/get filter list */ - -/* Protocol Independent Multicast API [RFC3678] */ -#define MCAST_JOIN_GROUP 80 /* join an any-source group */ -#define MCAST_LEAVE_GROUP 81 /* leave all sources for group */ -#define MCAST_JOIN_SOURCE_GROUP 82 /* join a source-specific group */ -#define MCAST_LEAVE_SOURCE_GROUP 83 /* leave a single source */ -#define MCAST_BLOCK_SOURCE 84 /* block a source */ -#define MCAST_UNBLOCK_SOURCE 85 /* unblock a source */ - -/* Flow and RSS definitions */ -#define IP_FLOWID 90 /* get flow id for the given socket/inp */ -#define IP_FLOWTYPE 91 /* get flow type (M_HASHTYPE) */ -#define IP_RSSBUCKETID 92 /* get RSS flowid -> bucket mapping */ -#define IP_RECVFLOWID 93 /* bool; receive IP flowid/flowtype w/ datagram */ -#define IP_RECVRSSBUCKETID 94 /* bool; receive IP RSS bucket id w/ datagram */ - -/* - * 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 */ - -/* - * 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. - */ -#define IP_MIN_MEMBERSHIPS 31 -#define IP_MAX_MEMBERSHIPS 4095 -#define IP_MAX_SOURCE_FILTER 1024 /* XXX to be unused */ - -/* - * Default resource limits for IPv4 multicast source filtering. - * These may be modified by sysctl. - */ -#define IP_MAX_GROUP_SRC_FILTER 512 /* sources per group */ -#define IP_MAX_SOCK_SRC_FILTER 128 /* sources per socket/group */ -#define IP_MAX_SOCK_MUTE_FILTER 128 /* XXX no longer used */ - -/* - * 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 */ -}; - -/* - * 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 { - struct in_addr imr_multiaddr; /* IP multicast address of group */ - struct in_addr imr_address; /* local IP address of interface */ - int imr_ifindex; /* Interface index; cast to uint32_t */ -}; - -/* - * Argument structure for IPv4 Multicast Source Filter APIs. [RFC3678] - */ -struct ip_mreq_source { - struct in_addr imr_multiaddr; /* IP multicast address of group */ - struct in_addr imr_sourceaddr; /* IP address of source */ - struct in_addr imr_interface; /* local IP address of interface */ -}; - -/* - * Argument structures for Protocol-Independent Multicast Source - * Filter APIs. [RFC3678] - */ -struct group_req { - uint32_t gr_interface; /* interface index */ - struct sockaddr_storage gr_group; /* group address */ -}; - -struct group_source_req { - uint32_t gsr_interface; /* interface index */ - struct sockaddr_storage gsr_group; /* group address */ - struct sockaddr_storage gsr_source; /* source address */ -}; - -#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 { - uint32_t msfr_ifindex; /* interface index */ - uint32_t msfr_fmode; /* filter mode for group */ - uint32_t msfr_nsrcs; /* # of sources in msfr_srcs */ - struct sockaddr_storage msfr_group; /* group address */ - struct sockaddr_storage *msfr_srcs; /* pointer to the first member - * 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. - */ -int setipv4sourcefilter(int, struct in_addr, struct in_addr, uint32_t, - uint32_t, struct in_addr *); -int getipv4sourcefilter(int, struct in_addr, struct in_addr, uint32_t *, - uint32_t *, struct in_addr *); -int setsourcefilter(int, uint32_t, struct sockaddr *, socklen_t, - uint32_t, uint32_t, struct sockaddr_storage *); -int getsourcefilter(int, uint32_t, struct sockaddr *, socklen_t, - uint32_t *, uint32_t *, struct sockaddr_storage *); - -/* - * Filter modes; also used to represent per-socket filter mode internally. - */ -#define MCAST_UNDEFINED 0 /* fmode: not yet defined */ -#define MCAST_INCLUDE 1 /* fmode: include these source(s) */ -#define MCAST_EXCLUDE 2 /* fmode: exclude these source(s) */ - -/* - * 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 */ - -/* - * Identifiers for IP sysctl nodes - */ -#define IPCTL_FORWARDING 1 /* act as router */ -#define IPCTL_SENDREDIRECTS 2 /* may send redirects when forwarding */ -#define IPCTL_DEFTTL 3 /* default TTL */ -#ifdef notyet -#define IPCTL_DEFMTU 4 /* default MTU */ -#endif -/* IPCTL_RTEXPIRE 5 deprecated */ -/* IPCTL_RTMINEXPIRE 6 deprecated */ -/* IPCTL_RTMAXCACHE 7 deprecated */ -#define IPCTL_SOURCEROUTE 8 /* may perform source routes */ -#define IPCTL_DIRECTEDBROADCAST 9 /* may re-broadcast received packets */ -#define IPCTL_INTRQMAXLEN 10 /* max length of netisr queue */ -#define IPCTL_INTRQDROPS 11 /* number of netisr q drops */ -#define IPCTL_STATS 12 /* ipstat structure */ -#define IPCTL_ACCEPTSOURCEROUTE 13 /* may accept source routed packets */ -#define IPCTL_FASTFORWARDING 14 /* use fast IP forwarding code */ - /* 15, unused, was: IPCTL_KEEPFAITH */ -#define IPCTL_GIF_TTL 16 /* default TTL for gif encap packet */ - -#endif /* __BSD_VISIBLE */ - -#ifdef _KERNEL - -struct ifnet; struct mbuf; /* forward declarations for Standard C */ - -int in_broadcast(struct in_addr, struct ifnet *); -int in_canforward(struct in_addr); -int in_localaddr(struct in_addr); -int in_localip(struct in_addr); -int in_ifhasaddr(struct ifnet *, struct in_addr); -int inet_aton(const char *, struct in_addr *); /* in libkern */ -char *inet_ntoa(struct in_addr); /* in libkern */ -char *inet_ntoa_r(struct in_addr ina, char *buf); /* in libkern */ -char *inet_ntop(int, const void *, char *, socklen_t); /* in libkern */ -int inet_pton(int af, const char *, void *); /* in libkern */ -void in_ifdetach(struct ifnet *); - -#define in_hosteq(s, t) ((s).s_addr == (t).s_addr) -#define in_nullhost(x) ((x).s_addr == INADDR_ANY) -#define in_allhosts(x) ((x).s_addr == htonl(INADDR_ALLHOSTS_GROUP)) - -#define satosin(sa) ((struct sockaddr_in *)(sa)) -#define sintosa(sin) ((struct sockaddr *)(sin)) -#define ifatoia(ifa) ((struct in_ifaddr *)(ifa)) -#endif /* _KERNEL */ - -/* INET6 stuff */ -#if __POSIX_VISIBLE >= 200112 -#define __KAME_NETINET_IN_H_INCLUDED_ -#include -#undef __KAME_NETINET_IN_H_INCLUDED_ -#endif - -#endif /* !_NETINET_IN_H_*/ diff --git a/cpukit/libnetworking/include/netinet/tcp.h b/cpukit/libnetworking/include/netinet/tcp.h deleted file mode 100644 index 9df1b7e88f..0000000000 --- a/cpukit/libnetworking/include/netinet/tcp.h +++ /dev/null @@ -1,123 +0,0 @@ -/* - * 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. - * 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.30 2005/01/07 01:45:45 imp Exp $ - */ - - -#ifndef _NETINET_TCP_H_ -#define _NETINET_TCP_H_ - -#include - -#if __BSD_VISIBLE -#include /* BYTE_ORDER */ - -typedef u_int32_t tcp_seq; - -#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 0L -#define TCPOPT_NOP 1L -#define TCPOPT_MAXSEG 2L -#define TCPOLEN_MAXSEG 4L -#define TCPOPT_WINDOW 3L -#define TCPOLEN_WINDOW 3L -#define TCPOPT_SACK_PERMITTED 4L /* Experimental */ -#define TCPOLEN_SACK_PERMITTED 2L -#define TCPOPT_SACK 5L /* Experimental */ -#define TCPOPT_TIMESTAMP 8L -#define TCPOLEN_TIMESTAMP 10L -#define TCPOLEN_TSTAMP_APPA (uint32_t)(TCPOLEN_TIMESTAMP+2) /* appendix A */ - -/* - * Default maximum segment size for TCP. - * With an IP MTU 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 - -#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_MAXHLEN (0xf<<2) /* max length of header in bytes */ -#define TCP_MAXOLEN (TCP_MAXHLEN - sizeof(struct tcphdr)) - /* max space left for options */ -#endif /* __BSD_VISIBLE */ - -/* - * User-settable options (used with setsockopt). - */ -#define TCP_NODELAY 0x01 /* don't delay send to coalesce packets */ -#if __BSD_VISIBLE -#define TCP_MAXSEG 0x02 /* set maximum segment size */ -#define TCP_NOPUSH 0x04 /* don't push last block of write */ -#define TCP_NOOPT 0x08 /* don't use TCP options */ -#define TCP_MD5SIG 0x10 /* use MD5 digests (RFC2385) */ -#define TCP_INFO 0x20 /* retrieve tcp_info structure */ -#endif - -#endif /* !_NETINET_TCP_H_ */ diff --git a/cpukit/libnetworking/include/netinet6/in6.h b/cpukit/libnetworking/include/netinet6/in6.h deleted file mode 100644 index c5297690b2..0000000000 --- a/cpukit/libnetworking/include/netinet6/in6.h +++ /dev/null @@ -1,745 +0,0 @@ -/*- - * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project. - * 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. Neither the name of the project 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 PROJECT 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 PROJECT 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. - * - * $KAME: in6.h,v 1.89 2001/05/27 13:28:35 itojun Exp $ - */ - -/*- - * 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. - * 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: head/sys/netinet6/in6.h 301217 2016-06-02 17:51:29Z gnn $ - */ - -#ifndef __KAME_NETINET_IN_H_INCLUDED_ -#error "do not include netinet6/in6.h directly, include netinet/in.h. see RFC2553" -#endif - -#ifndef _NETINET6_IN6_H_ -#define _NETINET6_IN6_H_ - -/* - * Identification of the network protocol stack - * for *BSD-current/release: http://www.kame.net/dev/cvsweb.cgi/kame/COVERAGE - * has the table of implementation/integration differences. - */ -#define __KAME__ -#define __KAME_VERSION "FreeBSD" - -/* - * IPv6 port allocation rules should mirror the IPv4 rules and are controlled - * by the net.inet.ip.portrange sysctl tree. The following defines exist - * for compatibility with userland applications that need them. - */ -#if __BSD_VISIBLE -#define IPV6PORT_RESERVED 1024 -#define IPV6PORT_ANONMIN 49152 -#define IPV6PORT_ANONMAX 65535 -#define IPV6PORT_RESERVEDMIN 600 -#define IPV6PORT_RESERVEDMAX (IPV6PORT_RESERVED-1) -#endif - -/* - * IPv6 address - */ -struct in6_addr { - union { - uint8_t __u6_addr8[16]; - uint16_t __u6_addr16[8]; - uint32_t __u6_addr32[4]; - } __u6_addr; /* 128-bit IP6 address */ -}; - -#define s6_addr __u6_addr.__u6_addr8 -#ifdef _KERNEL /* XXX nonstandard */ -#define s6_addr8 __u6_addr.__u6_addr8 -#define s6_addr16 __u6_addr.__u6_addr16 -#define s6_addr32 __u6_addr.__u6_addr32 -#endif - -#define INET6_ADDRSTRLEN 46 - -/* - * XXX missing POSIX.1-2001 macro IPPROTO_IPV6. - */ - -/* - * Socket address for IPv6 - */ -#if __BSD_VISIBLE -#define SIN6_LEN -#endif - -struct sockaddr_in6 { - uint8_t sin6_len; /* length of this struct */ - sa_family_t sin6_family; /* AF_INET6 */ - in_port_t sin6_port; /* Transport layer port # */ - uint32_t sin6_flowinfo; /* IP6 flow information */ - struct in6_addr sin6_addr; /* IP6 address */ - uint32_t sin6_scope_id; /* scope zone index */ -}; - -/* - * Local definition for masks - */ -#ifdef _KERNEL /* XXX nonstandard */ -#define IN6MASK0 {{{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }}} -#define IN6MASK32 {{{ 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }}} -#define IN6MASK64 {{{ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }}} -#define IN6MASK96 {{{ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, \ - 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00 }}} -#define IN6MASK128 {{{ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, \ - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff }}} -#endif - -#ifdef _KERNEL -extern const struct sockaddr_in6 sa6_any; - -extern const struct in6_addr in6mask0; -extern const struct in6_addr in6mask32; -extern const struct in6_addr in6mask64; -extern const struct in6_addr in6mask96; -extern const struct in6_addr in6mask128; -#endif /* _KERNEL */ - -/* - * Macros started with IPV6_ADDR is KAME local - */ -#ifdef _KERNEL /* XXX nonstandard */ -#if _BYTE_ORDER == _BIG_ENDIAN -#define IPV6_ADDR_INT32_ONE 1 -#define IPV6_ADDR_INT32_TWO 2 -#define IPV6_ADDR_INT32_MNL 0xff010000 -#define IPV6_ADDR_INT32_MLL 0xff020000 -#define IPV6_ADDR_INT32_SMP 0x0000ffff -#define IPV6_ADDR_INT16_ULL 0xfe80 -#define IPV6_ADDR_INT16_USL 0xfec0 -#define IPV6_ADDR_INT16_MLL 0xff02 -#elif _BYTE_ORDER == _LITTLE_ENDIAN -#define IPV6_ADDR_INT32_ONE 0x01000000 -#define IPV6_ADDR_INT32_TWO 0x02000000 -#define IPV6_ADDR_INT32_MNL 0x000001ff -#define IPV6_ADDR_INT32_MLL 0x000002ff -#define IPV6_ADDR_INT32_SMP 0xffff0000 -#define IPV6_ADDR_INT16_ULL 0x80fe -#define IPV6_ADDR_INT16_USL 0xc0fe -#define IPV6_ADDR_INT16_MLL 0x02ff -#endif -#endif - -/* - * Definition of some useful macros to handle IP6 addresses - */ -#if __BSD_VISIBLE -#define IN6ADDR_ANY_INIT \ - {{{ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }}} -#define IN6ADDR_LOOPBACK_INIT \ - {{{ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01 }}} -#define IN6ADDR_NODELOCAL_ALLNODES_INIT \ - {{{ 0xff, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01 }}} -#define IN6ADDR_INTFACELOCAL_ALLNODES_INIT \ - {{{ 0xff, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01 }}} -#define IN6ADDR_LINKLOCAL_ALLNODES_INIT \ - {{{ 0xff, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01 }}} -#define IN6ADDR_LINKLOCAL_ALLROUTERS_INIT \ - {{{ 0xff, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02 }}} -#define IN6ADDR_LINKLOCAL_ALLV2ROUTERS_INIT \ - {{{ 0xff, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x16 }}} -#endif - -extern const struct in6_addr in6addr_any; -extern const struct in6_addr in6addr_loopback; -#if __BSD_VISIBLE -extern const struct in6_addr in6addr_nodelocal_allnodes; -extern const struct in6_addr in6addr_linklocal_allnodes; -extern const struct in6_addr in6addr_linklocal_allrouters; -extern const struct in6_addr in6addr_linklocal_allv2routers; -#endif - -/* - * Equality - * NOTE: Some of kernel programming environment (for example, openbsd/sparc) - * does not supply memcmp(). For userland memcmp() is preferred as it is - * in ANSI standard. - */ -#ifdef _KERNEL -#define IN6_ARE_ADDR_EQUAL(a, b) \ - (bcmp(&(a)->s6_addr[0], &(b)->s6_addr[0], sizeof(struct in6_addr)) == 0) -#else -#if __BSD_VISIBLE -#define IN6_ARE_ADDR_EQUAL(a, b) \ - (memcmp(&(a)->s6_addr[0], &(b)->s6_addr[0], sizeof(struct in6_addr)) == 0) -#endif -#endif - -/* - * Unspecified - */ -#define IN6_IS_ADDR_UNSPECIFIED(a) \ - ((a)->__u6_addr.__u6_addr32[0] == 0 && \ - (a)->__u6_addr.__u6_addr32[1] == 0 && \ - (a)->__u6_addr.__u6_addr32[2] == 0 && \ - (a)->__u6_addr.__u6_addr32[3] == 0) - -/* - * Loopback - */ -#define IN6_IS_ADDR_LOOPBACK(a) \ - ((a)->__u6_addr.__u6_addr32[0] == 0 && \ - (a)->__u6_addr.__u6_addr32[1] == 0 && \ - (a)->__u6_addr.__u6_addr32[2] == 0 && \ - (a)->__u6_addr.__u6_addr32[3] == ntohl(1)) - -/* - * IPv4 compatible - */ -#define IN6_IS_ADDR_V4COMPAT(a) \ - ((a)->__u6_addr.__u6_addr32[0] == 0 && \ - (a)->__u6_addr.__u6_addr32[1] == 0 && \ - (a)->__u6_addr.__u6_addr32[2] == 0 && \ - (a)->__u6_addr.__u6_addr32[3] != 0 && \ - (a)->__u6_addr.__u6_addr32[3] != ntohl(1)) - -/* - * Mapped - */ -#define IN6_IS_ADDR_V4MAPPED(a) \ - ((a)->__u6_addr.__u6_addr32[0] == 0 && \ - (a)->__u6_addr.__u6_addr32[1] == 0 && \ - (a)->__u6_addr.__u6_addr32[2] == ntohl(0x0000ffff)) - -/* - * KAME Scope Values - */ - -#ifdef _KERNEL /* XXX nonstandard */ -#define IPV6_ADDR_SCOPE_NODELOCAL 0x01 -#define IPV6_ADDR_SCOPE_INTFACELOCAL 0x01 -#define IPV6_ADDR_SCOPE_LINKLOCAL 0x02 -#define IPV6_ADDR_SCOPE_SITELOCAL 0x05 -#define IPV6_ADDR_SCOPE_ORGLOCAL 0x08 /* just used in this file */ -#define IPV6_ADDR_SCOPE_GLOBAL 0x0e -#else -#define __IPV6_ADDR_SCOPE_NODELOCAL 0x01 -#define __IPV6_ADDR_SCOPE_INTFACELOCAL 0x01 -#define __IPV6_ADDR_SCOPE_LINKLOCAL 0x02 -#define __IPV6_ADDR_SCOPE_SITELOCAL 0x05 -#define __IPV6_ADDR_SCOPE_ORGLOCAL 0x08 /* just used in this file */ -#define __IPV6_ADDR_SCOPE_GLOBAL 0x0e -#endif - -/* - * Unicast Scope - * Note that we must check topmost 10 bits only, not 16 bits (see RFC2373). - */ -#define IN6_IS_ADDR_LINKLOCAL(a) \ - (((a)->s6_addr[0] == 0xfe) && (((a)->s6_addr[1] & 0xc0) == 0x80)) -#define IN6_IS_ADDR_SITELOCAL(a) \ - (((a)->s6_addr[0] == 0xfe) && (((a)->s6_addr[1] & 0xc0) == 0xc0)) - -/* - * Multicast - */ -#define IN6_IS_ADDR_MULTICAST(a) ((a)->s6_addr[0] == 0xff) - -#ifdef _KERNEL /* XXX nonstandard */ -#define IPV6_ADDR_MC_SCOPE(a) ((a)->s6_addr[1] & 0x0f) -#else -#define __IPV6_ADDR_MC_SCOPE(a) ((a)->s6_addr[1] & 0x0f) -#endif - -/* - * Multicast Scope - */ -#ifdef _KERNEL /* refers nonstandard items */ -#define IN6_IS_ADDR_MC_NODELOCAL(a) \ - (IN6_IS_ADDR_MULTICAST(a) && \ - (IPV6_ADDR_MC_SCOPE(a) == IPV6_ADDR_SCOPE_NODELOCAL)) -#define IN6_IS_ADDR_MC_INTFACELOCAL(a) \ - (IN6_IS_ADDR_MULTICAST(a) && \ - (IPV6_ADDR_MC_SCOPE(a) == IPV6_ADDR_SCOPE_INTFACELOCAL)) -#define IN6_IS_ADDR_MC_LINKLOCAL(a) \ - (IN6_IS_ADDR_MULTICAST(a) && \ - (IPV6_ADDR_MC_SCOPE(a) == IPV6_ADDR_SCOPE_LINKLOCAL)) -#define IN6_IS_ADDR_MC_SITELOCAL(a) \ - (IN6_IS_ADDR_MULTICAST(a) && \ - (IPV6_ADDR_MC_SCOPE(a) == IPV6_ADDR_SCOPE_SITELOCAL)) -#define IN6_IS_ADDR_MC_ORGLOCAL(a) \ - (IN6_IS_ADDR_MULTICAST(a) && \ - (IPV6_ADDR_MC_SCOPE(a) == IPV6_ADDR_SCOPE_ORGLOCAL)) -#define IN6_IS_ADDR_MC_GLOBAL(a) \ - (IN6_IS_ADDR_MULTICAST(a) && \ - (IPV6_ADDR_MC_SCOPE(a) == IPV6_ADDR_SCOPE_GLOBAL)) -#else -#define IN6_IS_ADDR_MC_NODELOCAL(a) \ - (IN6_IS_ADDR_MULTICAST(a) && \ - (__IPV6_ADDR_MC_SCOPE(a) == __IPV6_ADDR_SCOPE_NODELOCAL)) -#define IN6_IS_ADDR_MC_LINKLOCAL(a) \ - (IN6_IS_ADDR_MULTICAST(a) && \ - (__IPV6_ADDR_MC_SCOPE(a) == __IPV6_ADDR_SCOPE_LINKLOCAL)) -#define IN6_IS_ADDR_MC_SITELOCAL(a) \ - (IN6_IS_ADDR_MULTICAST(a) && \ - (__IPV6_ADDR_MC_SCOPE(a) == __IPV6_ADDR_SCOPE_SITELOCAL)) -#define IN6_IS_ADDR_MC_ORGLOCAL(a) \ - (IN6_IS_ADDR_MULTICAST(a) && \ - (__IPV6_ADDR_MC_SCOPE(a) == __IPV6_ADDR_SCOPE_ORGLOCAL)) -#define IN6_IS_ADDR_MC_GLOBAL(a) \ - (IN6_IS_ADDR_MULTICAST(a) && \ - (__IPV6_ADDR_MC_SCOPE(a) == __IPV6_ADDR_SCOPE_GLOBAL)) -#endif - -#ifdef _KERNEL /* nonstandard */ -/* - * KAME Scope - */ -#define IN6_IS_SCOPE_LINKLOCAL(a) \ - ((IN6_IS_ADDR_LINKLOCAL(a)) || \ - (IN6_IS_ADDR_MC_LINKLOCAL(a))) -#define IN6_IS_SCOPE_EMBED(a) \ - ((IN6_IS_ADDR_LINKLOCAL(a)) || \ - (IN6_IS_ADDR_MC_LINKLOCAL(a)) || \ - (IN6_IS_ADDR_MC_INTFACELOCAL(a))) - -#define IFA6_IS_DEPRECATED(a) \ - ((a)->ia6_lifetime.ia6t_pltime != ND6_INFINITE_LIFETIME && \ - (u_int32_t)((time_uptime - (a)->ia6_updatetime)) > \ - (a)->ia6_lifetime.ia6t_pltime) -#define IFA6_IS_INVALID(a) \ - ((a)->ia6_lifetime.ia6t_vltime != ND6_INFINITE_LIFETIME && \ - (u_int32_t)((time_uptime - (a)->ia6_updatetime)) > \ - (a)->ia6_lifetime.ia6t_vltime) -#endif /* _KERNEL */ - -/* - * IP6 route structure - */ -#if __BSD_VISIBLE -struct route_in6 { - struct rtentry *ro_rt; - struct llentry *ro_lle; - /* - * ro_prepend and ro_plen are only used for bpf to pass in a - * preformed header. They are not cacheable. - */ - char *ro_prepend; - uint16_t ro_plen; - uint16_t ro_flags; - uint16_t ro_mtu; /* saved ro_rt mtu */ - uint16_t spare; - struct sockaddr_in6 ro_dst; -}; -#endif - -#ifdef _KERNEL -#define MTAG_ABI_IPV6 1444287380 /* IPv6 ABI */ -#define IPV6_TAG_DIRECT 0 /* direct-dispatch IPv6 */ -#endif /* _KERNEL */ - -/* - * Options for use with [gs]etsockopt at the IPV6 level. - * First word of comment is data type; bool is stored in int. - */ -/* no hdrincl */ -#if 0 /* the followings are relic in IPv4 and hence are disabled */ -#define IPV6_OPTIONS 1 /* buf/ip6_opts; set/get IP6 options */ -#define IPV6_RECVOPTS 5 /* bool; receive all IP6 opts w/dgram */ -#define IPV6_RECVRETOPTS 6 /* bool; receive IP6 opts for response */ -#define IPV6_RECVDSTADDR 7 /* bool; receive IP6 dst addr w/dgram */ -#define IPV6_RETOPTS 8 /* ip6_opts; set/get IP6 options */ -#endif -#define IPV6_SOCKOPT_RESERVED1 3 /* reserved for future use */ -#define IPV6_UNICAST_HOPS 4 /* int; IP6 hops */ -#define IPV6_MULTICAST_IF 9 /* u_int; set/get IP6 multicast i/f */ -#define IPV6_MULTICAST_HOPS 10 /* int; set/get IP6 multicast hops */ -#define IPV6_MULTICAST_LOOP 11 /* u_int; set/get IP6 multicast loopback */ -#define IPV6_JOIN_GROUP 12 /* ipv6_mreq; join a group membership */ -#define IPV6_LEAVE_GROUP 13 /* ipv6_mreq; leave a group membership */ -#define IPV6_PORTRANGE 14 /* int; range to choose for unspec port */ -#define ICMP6_FILTER 18 /* icmp6_filter; icmp6 filter */ -/* RFC2292 options */ -#ifdef _KERNEL -#define IPV6_2292PKTINFO 19 /* bool; send/recv if, src/dst addr */ -#define IPV6_2292HOPLIMIT 20 /* bool; hop limit */ -#define IPV6_2292NEXTHOP 21 /* bool; next hop addr */ -#define IPV6_2292HOPOPTS 22 /* bool; hop-by-hop option */ -#define IPV6_2292DSTOPTS 23 /* bool; destinaion option */ -#define IPV6_2292RTHDR 24 /* bool; routing header */ -#define IPV6_2292PKTOPTIONS 25 /* buf/cmsghdr; set/get IPv6 options */ -#endif - -#define IPV6_CHECKSUM 26 /* int; checksum offset for raw socket */ -#define IPV6_V6ONLY 27 /* bool; make AF_INET6 sockets v6 only */ -#ifndef _KERNEL -#define IPV6_BINDV6ONLY IPV6_V6ONLY -#endif - -#if 1 /* IPSEC */ -#define IPV6_IPSEC_POLICY 28 /* struct; get/set security policy */ -#endif /* IPSEC */ - - /* 29; unused; was IPV6_FAITH */ -#if 1 /* IPV6FIREWALL */ -#define IPV6_FW_ADD 30 /* add a firewall rule to chain */ -#define IPV6_FW_DEL 31 /* delete a firewall rule from chain */ -#define IPV6_FW_FLUSH 32 /* flush firewall rule chain */ -#define IPV6_FW_ZERO 33 /* clear single/all firewall counter(s) */ -#define IPV6_FW_GET 34 /* get entire firewall rule chain */ -#endif - -/* new socket options introduced in RFC3542 */ -#define IPV6_RTHDRDSTOPTS 35 /* ip6_dest; send dst option before rthdr */ - -#define IPV6_RECVPKTINFO 36 /* bool; recv if, dst addr */ -#define IPV6_RECVHOPLIMIT 37 /* bool; recv hop limit */ -#define IPV6_RECVRTHDR 38 /* bool; recv routing header */ -#define IPV6_RECVHOPOPTS 39 /* bool; recv hop-by-hop option */ -#define IPV6_RECVDSTOPTS 40 /* bool; recv dst option after rthdr */ -#ifdef _KERNEL -#define IPV6_RECVRTHDRDSTOPTS 41 /* bool; recv dst option before rthdr */ -#endif - -#define IPV6_USE_MIN_MTU 42 /* bool; send packets at the minimum MTU */ -#define IPV6_RECVPATHMTU 43 /* bool; notify an according MTU */ - -#define IPV6_PATHMTU 44 /* mtuinfo; get the current path MTU (sopt), - 4 bytes int; MTU notification (cmsg) */ -#if 0 /*obsoleted during 2292bis -> 3542*/ -#define IPV6_REACHCONF 45 /* no data; ND reachability confirm - (cmsg only/not in of RFC3542) */ -#endif - -/* more new socket options introduced in RFC3542 */ -#define IPV6_PKTINFO 46 /* in6_pktinfo; send if, src addr */ -#define IPV6_HOPLIMIT 47 /* int; send hop limit */ -#define IPV6_NEXTHOP 48 /* sockaddr; next hop addr */ -#define IPV6_HOPOPTS 49 /* ip6_hbh; send hop-by-hop option */ -#define IPV6_DSTOPTS 50 /* ip6_dest; send dst option befor rthdr */ -#define IPV6_RTHDR 51 /* ip6_rthdr; send routing header */ -#if 0 -#define IPV6_PKTOPTIONS 52 /* buf/cmsghdr; set/get IPv6 options */ - /* obsoleted by RFC3542 */ -#endif - -#define IPV6_RECVTCLASS 57 /* bool; recv traffic class values */ - -#define IPV6_AUTOFLOWLABEL 59 /* bool; attach flowlabel automagically */ - -#define IPV6_TCLASS 61 /* int; send traffic class value */ -#define IPV6_DONTFRAG 62 /* bool; disable IPv6 fragmentation */ - -#define IPV6_PREFER_TEMPADDR 63 /* int; prefer temporary addresses as - * the source address. - */ - -#define IPV6_BINDANY 64 /* bool: allow bind to any address */ - -#define IPV6_BINDMULTI 65 /* bool; allow multibind to same addr/port */ -#define IPV6_RSS_LISTEN_BUCKET 66 /* int; set RSS listen bucket */ -#define IPV6_FLOWID 67 /* int; flowid of given socket */ -#define IPV6_FLOWTYPE 68 /* int; flowtype of given socket */ -#define IPV6_RSSBUCKETID 69 /* int; RSS bucket ID of given socket */ -#define IPV6_RECVFLOWID 70 /* bool; receive IP6 flowid/flowtype w/ datagram */ -#define IPV6_RECVRSSBUCKETID 71 /* bool; receive IP6 RSS bucket id w/ datagram */ - -/* - * The following option is private; do not use it from user applications. - * It is deliberately defined to the same value as IP_MSFILTER. - */ -#define IPV6_MSFILTER 74 /* struct __msfilterreq; - * set/get multicast source filter list. - */ - -/* to define items, should talk with KAME guys first, for *BSD compatibility */ - -#define IPV6_RTHDR_LOOSE 0 /* this hop need not be a neighbor. XXX old spec */ -#define IPV6_RTHDR_STRICT 1 /* this hop must be a neighbor. XXX old spec */ -#define IPV6_RTHDR_TYPE_0 0 /* IPv6 routing header type 0 */ - -/* - * Defaults and limits for options - */ -#define IPV6_DEFAULT_MULTICAST_HOPS 1 /* normally limit m'casts to 1 hop */ -#define IPV6_DEFAULT_MULTICAST_LOOP 1 /* normally hear sends if a member */ - -/* - * The im6o_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. - */ -#define IPV6_MIN_MEMBERSHIPS 31 -#define IPV6_MAX_MEMBERSHIPS 4095 - -/* - * Default resource limits for IPv6 multicast source filtering. - * These may be modified by sysctl. - */ -#define IPV6_MAX_GROUP_SRC_FILTER 512 /* sources per group */ -#define IPV6_MAX_SOCK_SRC_FILTER 128 /* sources per socket/group */ - -/* - * Argument structure for IPV6_JOIN_GROUP and IPV6_LEAVE_GROUP. - */ -struct ipv6_mreq { - struct in6_addr ipv6mr_multiaddr; - unsigned int ipv6mr_interface; -}; - -/* - * IPV6_PKTINFO: Packet information(RFC2292 sec 5) - */ -struct in6_pktinfo { - struct in6_addr ipi6_addr; /* src/dst IPv6 address */ - unsigned int ipi6_ifindex; /* send/recv interface index */ -}; - -/* - * Control structure for IPV6_RECVPATHMTU socket option. - */ -struct ip6_mtuinfo { - struct sockaddr_in6 ip6m_addr; /* or sockaddr_storage? */ - uint32_t ip6m_mtu; -}; - -/* - * Argument for IPV6_PORTRANGE: - * - which range to search when port is unspecified at bind() or connect() - */ -#define IPV6_PORTRANGE_DEFAULT 0 /* default range */ -#define IPV6_PORTRANGE_HIGH 1 /* "high" - request firewall bypass */ -#define IPV6_PORTRANGE_LOW 2 /* "low" - vouchsafe security */ - -#if __BSD_VISIBLE -/* - * Definitions for inet6 sysctl operations. - * - * Third level is protocol number. - * Fourth level is desired variable within that protocol. - */ -#define IPV6PROTO_MAXID (IPPROTO_PIM + 1) /* don't list to IPV6PROTO_MAX */ - -/* - * Names for IP sysctl objects - */ -#define IPV6CTL_FORWARDING 1 /* act as router */ -#define IPV6CTL_SENDREDIRECTS 2 /* may send redirects when forwarding*/ -#define IPV6CTL_DEFHLIM 3 /* default Hop-Limit */ -#ifdef notyet -#define IPV6CTL_DEFMTU 4 /* default MTU */ -#endif -#define IPV6CTL_FORWSRCRT 5 /* forward source-routed dgrams */ -#define IPV6CTL_STATS 6 /* stats */ -#define IPV6CTL_MRTSTATS 7 /* multicast forwarding stats */ -#define IPV6CTL_MRTPROTO 8 /* multicast routing protocol */ -#define IPV6CTL_MAXFRAGPACKETS 9 /* max packets reassembly queue */ -#define IPV6CTL_SOURCECHECK 10 /* verify source route and intf */ -#define IPV6CTL_SOURCECHECK_LOGINT 11 /* minimume logging interval */ -#define IPV6CTL_ACCEPT_RTADV 12 - /* 13; unused; was: IPV6CTL_KEEPFAITH */ -#define IPV6CTL_LOG_INTERVAL 14 -#define IPV6CTL_HDRNESTLIMIT 15 -#define IPV6CTL_DAD_COUNT 16 -#define IPV6CTL_AUTO_FLOWLABEL 17 -#define IPV6CTL_DEFMCASTHLIM 18 -#define IPV6CTL_GIF_HLIM 19 /* default HLIM for gif encap packet */ -#define IPV6CTL_KAME_VERSION 20 -#define IPV6CTL_USE_DEPRECATED 21 /* use deprecated addr (RFC2462 5.5.4) */ -#define IPV6CTL_RR_PRUNE 22 /* walk timer for router renumbering */ -#if 0 /* obsolete */ -#define IPV6CTL_MAPPED_ADDR 23 -#endif -#define IPV6CTL_V6ONLY 24 -/* IPV6CTL_RTEXPIRE 25 deprecated */ -/* IPV6CTL_RTMINEXPIRE 26 deprecated */ -/* IPV6CTL_RTMAXCACHE 27 deprecated */ - -#define IPV6CTL_USETEMPADDR 32 /* use temporary addresses (RFC3041) */ -#define IPV6CTL_TEMPPLTIME 33 /* preferred lifetime for tmpaddrs */ -#define IPV6CTL_TEMPVLTIME 34 /* valid lifetime for tmpaddrs */ -#define IPV6CTL_AUTO_LINKLOCAL 35 /* automatic link-local addr assign */ -#define IPV6CTL_RIP6STATS 36 /* raw_ip6 stats */ -#define IPV6CTL_PREFER_TEMPADDR 37 /* prefer temporary addr as src */ -#define IPV6CTL_ADDRCTLPOLICY 38 /* get/set address selection policy */ -#define IPV6CTL_USE_DEFAULTZONE 39 /* use default scope zone */ - -#define IPV6CTL_MAXFRAGS 41 /* max fragments */ -#if 0 -#define IPV6CTL_IFQ 42 /* ip6intrq node */ -#define IPV6CTL_ISATAPRTR 43 /* isatap router */ -#endif -#define IPV6CTL_MCAST_PMTU 44 /* enable pMTU discovery for multicast? */ - -/* New entries should be added here from current IPV6CTL_MAXID value. */ -/* to define items, should talk with KAME guys first, for *BSD compatibility */ -#define IPV6CTL_STEALTH 45 - -#define ICMPV6CTL_ND6_ONLINKNSRFC4861 47 -#define IPV6CTL_NO_RADR 48 /* No defroute from RA */ -#define IPV6CTL_NORBIT_RAIF 49 /* Disable R-bit in NA on RA - * receiving IF. */ -#define IPV6CTL_RFC6204W3 50 /* Accept defroute even when forwarding - enabled */ -#define IPV6CTL_MAXID 51 -#endif /* __BSD_VISIBLE */ - -/* - * Since both netinet/ and netinet6/ call into netipsec/ and netpfil/, - * the protocol specific mbuf flags are shared between them. - */ -#define M_FASTFWD_OURS M_PROTO1 /* changed dst to local */ -#define M_IP6_NEXTHOP M_PROTO2 /* explicit ip nexthop */ -#define M_IP_NEXTHOP M_PROTO2 /* explicit ip nexthop */ -#define M_SKIP_FIREWALL M_PROTO3 /* skip firewall processing */ -#define M_AUTHIPHDR M_PROTO4 -#define M_DECRYPTED M_PROTO5 -#define M_LOOP M_PROTO6 -#define M_AUTHIPDGM M_PROTO7 -#define M_RTALERT_MLD M_PROTO8 - -#ifdef _KERNEL -struct cmsghdr; -struct ip6_hdr; - -int in6_cksum_pseudo(struct ip6_hdr *, uint32_t, uint8_t, uint16_t); -int in6_cksum(struct mbuf *, u_int8_t, u_int32_t, u_int32_t); -int in6_cksum_partial(struct mbuf *, u_int8_t, u_int32_t, u_int32_t, - u_int32_t); -int in6_localaddr(struct in6_addr *); -int in6_localip(struct in6_addr *); -int in6_ifhasaddr(struct ifnet *, struct in6_addr *); -int in6_addrscope(const struct in6_addr *); -char *ip6_sprintf(char *, const struct in6_addr *); -struct in6_ifaddr *in6_ifawithifp(struct ifnet *, struct in6_addr *); -extern void in6_if_up(struct ifnet *); -struct sockaddr; -extern u_char ip6_protox[]; - -void in6_sin6_2_sin(struct sockaddr_in *sin, - struct sockaddr_in6 *sin6); -void in6_sin_2_v4mapsin6(struct sockaddr_in *sin, - struct sockaddr_in6 *sin6); -void in6_sin6_2_sin_in_sock(struct sockaddr *nam); -void in6_sin_2_v4mapsin6_in_sock(struct sockaddr **nam); -extern void addrsel_policy_init(void); - -#define satosin6(sa) ((struct sockaddr_in6 *)(sa)) -#define sin6tosa(sin6) ((struct sockaddr *)(sin6)) -#define ifatoia6(ifa) ((struct in6_ifaddr *)(ifa)) - -#endif /* _KERNEL */ - -#ifndef _SIZE_T_DECLARED -typedef __size_t size_t; -#define _SIZE_T_DECLARED -#endif - -#ifndef _SOCKLEN_T_DECLARED -typedef __socklen_t socklen_t; -#define _SOCKLEN_T_DECLARED -#endif - -#if __BSD_VISIBLE - -__BEGIN_DECLS -struct cmsghdr; - -extern int inet6_option_space(int); -extern int inet6_option_init(void *, struct cmsghdr **, int); -extern int inet6_option_append(struct cmsghdr *, const uint8_t *, - int, int); -extern uint8_t *inet6_option_alloc(struct cmsghdr *, int, int, int); -extern int inet6_option_next(const struct cmsghdr *, uint8_t **); -extern int inet6_option_find(const struct cmsghdr *, uint8_t **, int); - -extern size_t inet6_rthdr_space(int, int); -extern struct cmsghdr *inet6_rthdr_init(void *, int); -extern int inet6_rthdr_add(struct cmsghdr *, const struct in6_addr *, - unsigned int); -extern int inet6_rthdr_lasthop(struct cmsghdr *, unsigned int); -#if 0 /* not implemented yet */ -extern int inet6_rthdr_reverse(const struct cmsghdr *, struct cmsghdr *); -#endif -extern int inet6_rthdr_segments(const struct cmsghdr *); -extern struct in6_addr *inet6_rthdr_getaddr(struct cmsghdr *, int); -extern int inet6_rthdr_getflags(const struct cmsghdr *, int); - -extern int inet6_opt_init(void *, socklen_t); -extern int inet6_opt_append(void *, socklen_t, int, uint8_t, socklen_t, - uint8_t, void **); -extern int inet6_opt_finish(void *, socklen_t, int); -extern int inet6_opt_set_val(void *, int, void *, socklen_t); - -extern int inet6_opt_next(void *, socklen_t, int, uint8_t *, socklen_t *, - void **); -extern int inet6_opt_find(void *, socklen_t, int, uint8_t, socklen_t *, - void **); -extern int inet6_opt_get_val(void *, int, void *, socklen_t); -extern socklen_t inet6_rth_space(int, int); -extern void *inet6_rth_init(void *, socklen_t, int, int); -extern int inet6_rth_add(void *, const struct in6_addr *); -extern int inet6_rth_reverse(const void *, void *); -extern int inet6_rth_segments(const void *); -extern struct in6_addr *inet6_rth_getaddr(const void *, int); -__END_DECLS - -#endif /* __BSD_VISIBLE */ - -#endif /* !_NETINET6_IN6_H_ */ diff --git a/cpukit/libnetworking/include/sys/_sockaddr_storage.h b/cpukit/libnetworking/include/sys/_sockaddr_storage.h deleted file mode 100644 index b6c3616f63..0000000000 --- a/cpukit/libnetworking/include/sys/_sockaddr_storage.h +++ /dev/null @@ -1,54 +0,0 @@ -/*- - * Copyright (c) 1982, 1985, 1986, 1988, 1993, 1994 - * 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. - * 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. - * - * @(#)socket.h 8.4 (Berkeley) 2/21/94 - * $FreeBSD: head/sys/sys/_sockaddr_storage.h 196967 2009-09-08 10:39:38Z phk $ - */ - -#ifndef _SYS__SOCKADDR_STORAGE_H_ -#define _SYS__SOCKADDR_STORAGE_H_ - -/* - * RFC 2553: protocol-independent placeholder for socket addresses - */ -#define _SS_MAXSIZE 128U -#define _SS_ALIGNSIZE (sizeof(__int64_t)) -#define _SS_PAD1SIZE (_SS_ALIGNSIZE - sizeof(unsigned char) - \ - sizeof(sa_family_t)) -#define _SS_PAD2SIZE (_SS_MAXSIZE - sizeof(unsigned char) - \ - sizeof(sa_family_t) - _SS_PAD1SIZE - _SS_ALIGNSIZE) - -struct sockaddr_storage { - unsigned char ss_len; /* address length */ - sa_family_t ss_family; /* address family */ - char __ss_pad1[_SS_PAD1SIZE]; - __int64_t __ss_align; /* force desired struct alignment */ - char __ss_pad2[_SS_PAD2SIZE]; -}; - -#endif /* !_SYS__SOCKADDR_STORAGE_H_ */ diff --git a/cpukit/libnetworking/include/sys/socket.h b/cpukit/libnetworking/include/sys/socket.h deleted file mode 100644 index 99bfa1c072..0000000000 --- a/cpukit/libnetworking/include/sys/socket.h +++ /dev/null @@ -1,689 +0,0 @@ -/*- - * Copyright (c) 1982, 1985, 1986, 1988, 1993, 1994 - * 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. - * 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. - * - * @(#)socket.h 8.4 (Berkeley) 2/21/94 - * $FreeBSD: head/sys/sys/socket.h 301038 2016-05-31 13:32:33Z ed $ - */ - -#ifndef _SYS_SOCKET_H_ -#define _SYS_SOCKET_H_ - -#include -#include -#include -#include - -/* - * Definitions related to sockets: types, address families, options. - */ - -/* - * Data types. - */ -#if __BSD_VISIBLE -#ifndef _GID_T_DECLARED -typedef __gid_t gid_t; -#define _GID_T_DECLARED -#endif - -#ifndef _OFF_T_DECLARED -typedef __off_t off_t; -#define _OFF_T_DECLARED -#endif - -#ifndef _PID_T_DECLARED -typedef __pid_t pid_t; -#define _PID_T_DECLARED -#endif -#endif - -#ifndef _SA_FAMILY_T_DECLARED -typedef __sa_family_t sa_family_t; -#define _SA_FAMILY_T_DECLARED -#endif - -#ifndef _SOCKLEN_T_DECLARED -typedef __socklen_t socklen_t; -#define _SOCKLEN_T_DECLARED -#endif - -#ifndef _SSIZE_T_DECLARED -typedef __ssize_t ssize_t; -#define _SSIZE_T_DECLARED -#endif - -#if __BSD_VISIBLE -#ifndef _UID_T_DECLARED -typedef __uid_t uid_t; -#define _UID_T_DECLARED -#endif -#endif - -#ifndef _UINT32_T_DECLARED -typedef __uint32_t uint32_t; -#define _UINT32_T_DECLARED -#endif - -#ifndef _UINTPTR_T_DECLARED -typedef __uintptr_t uintptr_t; -#define _UINTPTR_T_DECLARED -#endif - -/* - * Types - */ -#define SOCK_STREAM 1 /* stream socket */ -#define SOCK_DGRAM 2 /* datagram socket */ -#define SOCK_RAW 3 /* raw-protocol interface */ -#if __BSD_VISIBLE -#define SOCK_RDM 4 /* reliably-delivered message */ -#endif -#define SOCK_SEQPACKET 5 /* sequenced packet stream */ - -#if __BSD_VISIBLE -/* - * Creation flags, OR'ed into socket() and socketpair() type argument. - */ -#define SOCK_CLOEXEC 0x10000000 -#define SOCK_NONBLOCK 0x20000000 -#endif - -/* - * Option flags per-socket. - */ -#define SO_DEBUG 0x0001 /* turn on debugging info recording */ -#define SO_ACCEPTCONN 0x0002 /* socket has had listen() */ -#define SO_REUSEADDR 0x0004 /* allow local address reuse */ -#define SO_KEEPALIVE 0x0008 /* keep connections alive */ -#define SO_DONTROUTE 0x0010 /* just use interface addresses */ -#define SO_BROADCAST 0x0020 /* permit sending of broadcast msgs */ -#if __BSD_VISIBLE -#define SO_USELOOPBACK 0x0040 /* bypass hardware when possible */ -#endif -#define SO_LINGER 0x0080 /* linger on close if data present */ -#define SO_OOBINLINE 0x0100 /* leave received OOB data in line */ -#if __BSD_VISIBLE -#define SO_REUSEPORT 0x0200 /* allow local address & port reuse */ -#define SO_TIMESTAMP 0x0400 /* timestamp received dgram traffic */ -#define SO_NOSIGPIPE 0x0800 /* no SIGPIPE from EPIPE */ -#define SO_ACCEPTFILTER 0x1000 /* there is an accept filter */ -#define SO_BINTIME 0x2000 /* timestamp received dgram traffic */ -#endif -#define SO_NO_OFFLOAD 0x4000 /* socket cannot be offloaded */ -#define SO_NO_DDP 0x8000 /* disable direct data placement */ - -/* - * Additional options, not kept in so_options. - */ -#define SO_SNDBUF 0x1001 /* send buffer size */ -#define SO_RCVBUF 0x1002 /* receive buffer size */ -#define SO_SNDLOWAT 0x1003 /* send low-water mark */ -#define SO_RCVLOWAT 0x1004 /* receive low-water mark */ -#define SO_SNDTIMEO 0x1005 /* send timeout */ -#define SO_RCVTIMEO 0x1006 /* receive timeout */ -#define SO_ERROR 0x1007 /* get error status and clear */ -#define SO_TYPE 0x1008 /* get socket type */ -#if __BSD_VISIBLE -#define SO_LABEL 0x1009 /* socket's MAC label */ -#define SO_PEERLABEL 0x1010 /* socket's peer's MAC label */ -#define SO_LISTENQLIMIT 0x1011 /* socket's backlog limit */ -#define SO_LISTENQLEN 0x1012 /* socket's complete queue length */ -#define SO_LISTENINCQLEN 0x1013 /* socket's incomplete queue length */ -#define SO_SETFIB 0x1014 /* use this FIB to route */ -#define SO_USER_COOKIE 0x1015 /* user cookie (dummynet etc.) */ -#define SO_PROTOCOL 0x1016 /* get socket protocol (Linux name) */ -#define SO_PROTOTYPE SO_PROTOCOL /* alias for SO_PROTOCOL (SunOS name) */ -#endif - -/* - * Space reserved for new socket options added by third-party vendors. - * This range applies to all socket option levels. New socket options - * in FreeBSD should always use an option value less than SO_VENDOR. - */ -#if __BSD_VISIBLE -#define SO_VENDOR 0x80000000 -#endif - -/* - * Structure used for manipulating linger option. - */ -struct linger { - int l_onoff; /* option on/off */ - int l_linger; /* linger time */ -}; - -#if __BSD_VISIBLE -struct accept_filter_arg { - char af_name[16]; - char af_arg[256-16]; -}; -#endif - -/* - * Level number for (get/set)sockopt() to apply to socket itself. - */ -#define SOL_SOCKET 0xffff /* options for socket level */ - -/* - * Address families. - */ -#define AF_UNSPEC 0 /* unspecified */ -#if __BSD_VISIBLE -#define AF_LOCAL AF_UNIX /* local to host (pipes, portals) */ -#endif -#define AF_UNIX 1 /* standardized name for AF_LOCAL */ -#define AF_INET 2 /* internetwork: UDP, TCP, etc. */ -#if __BSD_VISIBLE -#define AF_IMPLINK 3 /* arpanet imp addresses */ -#define AF_PUP 4 /* pup protocols: e.g. BSP */ -#define AF_CHAOS 5 /* mit CHAOS protocols */ -#define AF_NETBIOS 6 /* SMB protocols */ -#define AF_ISO 7 /* ISO protocols */ -#define AF_OSI AF_ISO -#define AF_ECMA 8 /* European computer manufacturers */ -#define AF_DATAKIT 9 /* datakit protocols */ -#define AF_CCITT 10 /* CCITT protocols, X.25 etc */ -#define AF_SNA 11 /* IBM SNA */ -#define AF_DECnet 12 /* DECnet */ -#define AF_DLI 13 /* DEC Direct data link interface */ -#define AF_LAT 14 /* LAT */ -#define AF_HYLINK 15 /* NSC Hyperchannel */ -#define AF_APPLETALK 16 /* Apple Talk */ -#define AF_ROUTE 17 /* Internal Routing Protocol */ -#define AF_LINK 18 /* Link layer interface */ -#define pseudo_AF_XTP 19 /* eXpress Transfer Protocol (no AF) */ -#define AF_COIP 20 /* connection-oriented IP, aka ST II */ -#define AF_CNT 21 /* Computer Network Technology */ -#define pseudo_AF_RTIP 22 /* Help Identify RTIP packets */ -#define AF_IPX 23 /* Novell Internet Protocol */ -#define AF_SIP 24 /* Simple Internet Protocol */ -#define pseudo_AF_PIP 25 /* Help Identify PIP packets */ -#define AF_ISDN 26 /* Integrated Services Digital Network*/ -#define AF_E164 AF_ISDN /* CCITT E.164 recommendation */ -#define pseudo_AF_KEY 27 /* Internal key-management function */ -#endif -#define AF_INET6 28 /* IPv6 */ -#if __BSD_VISIBLE -#define AF_NATM 29 /* native ATM access */ -#define AF_ATM 30 /* ATM */ -#define pseudo_AF_HDRCMPLT 31 /* Used by BPF to not rewrite headers - * in interface output routine - */ -#define AF_NETGRAPH 32 /* Netgraph sockets */ -#define AF_SLOW 33 /* 802.3ad slow protocol */ -#define AF_SCLUSTER 34 /* Sitara cluster protocol */ -#define AF_ARP 35 -#define AF_BLUETOOTH 36 /* Bluetooth sockets */ -#define AF_IEEE80211 37 /* IEEE 802.11 protocol */ -#define AF_INET_SDP 40 /* OFED Socket Direct Protocol ipv4 */ -#define AF_INET6_SDP 42 /* OFED Socket Direct Protocol ipv6 */ -#define AF_MAX 42 -/* - * When allocating a new AF_ constant, please only allocate - * even numbered constants for FreeBSD until 134 as odd numbered AF_ - * constants 39-133 are now reserved for vendors. - */ -#define AF_VENDOR00 39 -#define AF_VENDOR01 41 -#define AF_VENDOR02 43 -#define AF_VENDOR03 45 -#define AF_VENDOR04 47 -#define AF_VENDOR05 49 -#define AF_VENDOR06 51 -#define AF_VENDOR07 53 -#define AF_VENDOR08 55 -#define AF_VENDOR09 57 -#define AF_VENDOR10 59 -#define AF_VENDOR11 61 -#define AF_VENDOR12 63 -#define AF_VENDOR13 65 -#define AF_VENDOR14 67 -#define AF_VENDOR15 69 -#define AF_VENDOR16 71 -#define AF_VENDOR17 73 -#define AF_VENDOR18 75 -#define AF_VENDOR19 77 -#define AF_VENDOR20 79 -#define AF_VENDOR21 81 -#define AF_VENDOR22 83 -#define AF_VENDOR23 85 -#define AF_VENDOR24 87 -#define AF_VENDOR25 89 -#define AF_VENDOR26 91 -#define AF_VENDOR27 93 -#define AF_VENDOR28 95 -#define AF_VENDOR29 97 -#define AF_VENDOR30 99 -#define AF_VENDOR31 101 -#define AF_VENDOR32 103 -#define AF_VENDOR33 105 -#define AF_VENDOR34 107 -#define AF_VENDOR35 109 -#define AF_VENDOR36 111 -#define AF_VENDOR37 113 -#define AF_VENDOR38 115 -#define AF_VENDOR39 117 -#define AF_VENDOR40 119 -#define AF_VENDOR41 121 -#define AF_VENDOR42 123 -#define AF_VENDOR43 125 -#define AF_VENDOR44 127 -#define AF_VENDOR45 129 -#define AF_VENDOR46 131 -#define AF_VENDOR47 133 -#endif - -/* - * Structure used by kernel to store most - * addresses. - */ -struct sockaddr { - unsigned char sa_len; /* total length */ - sa_family_t sa_family; /* address family */ - char sa_data[14]; /* actually longer; address value */ -}; -#if __BSD_VISIBLE -#define SOCK_MAXADDRLEN 255 /* longest possible addresses */ - -/* - * Structure used by kernel to pass protocol - * information in raw sockets. - */ -struct sockproto { - unsigned short sp_family; /* address family */ - unsigned short sp_protocol; /* protocol */ -}; -#endif - -#include - -#if __BSD_VISIBLE -/* - * Protocol families, same as address families for now. - */ -#define PF_UNSPEC AF_UNSPEC -#define PF_LOCAL AF_LOCAL -#define PF_UNIX PF_LOCAL /* backward compatibility */ -#define PF_INET AF_INET -#define PF_IMPLINK AF_IMPLINK -#define PF_PUP AF_PUP -#define PF_CHAOS AF_CHAOS -#define PF_NETBIOS AF_NETBIOS -#define PF_ISO AF_ISO -#define PF_OSI AF_ISO -#define PF_ECMA AF_ECMA -#define PF_DATAKIT AF_DATAKIT -#define PF_CCITT AF_CCITT -#define PF_SNA AF_SNA -#define PF_DECnet AF_DECnet -#define PF_DLI AF_DLI -#define PF_LAT AF_LAT -#define PF_HYLINK AF_HYLINK -#define PF_APPLETALK AF_APPLETALK -#define PF_ROUTE AF_ROUTE -#define PF_LINK AF_LINK -#define PF_XTP pseudo_AF_XTP /* really just proto family, no AF */ -#define PF_COIP AF_COIP -#define PF_CNT AF_CNT -#define PF_SIP AF_SIP -#define PF_IPX AF_IPX -#define PF_RTIP pseudo_AF_RTIP /* same format as AF_INET */ -#define PF_PIP pseudo_AF_PIP -#define PF_ISDN AF_ISDN -#define PF_KEY pseudo_AF_KEY -#define PF_INET6 AF_INET6 -#define PF_NATM AF_NATM -#define PF_ATM AF_ATM -#define PF_NETGRAPH AF_NETGRAPH -#define PF_SLOW AF_SLOW -#define PF_SCLUSTER AF_SCLUSTER -#define PF_ARP AF_ARP -#define PF_BLUETOOTH AF_BLUETOOTH -#define PF_IEEE80211 AF_IEEE80211 -#define PF_INET_SDP AF_INET_SDP -#define PF_INET6_SDP AF_INET6_SDP - -#define PF_MAX AF_MAX - -/* - * Definitions for network related sysctl, CTL_NET. - * - * Second level is protocol family. - * Third level is protocol number. - * - * Further levels are defined by the individual families. - */ - -/* - * PF_ROUTE - Routing table - * - * Three additional levels are defined: - * Fourth: address family, 0 is wildcard - * Fifth: type of info, defined below - * Sixth: flag(s) to mask with for NET_RT_FLAGS - */ -#define NET_RT_DUMP 1 /* dump; may limit to a.f. */ -#define NET_RT_FLAGS 2 /* by flags, e.g. RESOLVING */ -#define NET_RT_IFLIST 3 /* survey interface list */ -#define NET_RT_IFMALIST 4 /* return multicast address list */ -#define NET_RT_IFLISTL 5 /* Survey interface list, using 'l'en - * versions of msghdr structs. */ -#endif /* __BSD_VISIBLE */ - -/* - * Maximum queue length specifiable by listen. - */ -#define SOMAXCONN 128 - -/* - * Message header for recvmsg and sendmsg calls. - * Used value-result for recvmsg, value only for sendmsg. - */ -struct msghdr { - void *msg_name; /* optional address */ - socklen_t msg_namelen; /* size of address */ - struct iovec *msg_iov; /* scatter/gather array */ - int msg_iovlen; /* # elements in msg_iov */ - void *msg_control; /* ancillary data, see below */ - socklen_t msg_controllen; /* ancillary data buffer len */ - int msg_flags; /* flags on received message */ -}; - -#define MSG_OOB 0x1 /* process out-of-band data */ -#define MSG_PEEK 0x2 /* peek at incoming message */ -#define MSG_DONTROUTE 0x4 /* send without using routing tables */ -#define MSG_EOR 0x8 /* data completes record */ -#define MSG_TRUNC 0x10 /* data discarded before delivery */ -#define MSG_CTRUNC 0x20 /* control data lost before delivery */ -#define MSG_WAITALL 0x40 /* wait for full request or error */ -#if __POSIX_VISIBLE >= 200809 -#define MSG_NOSIGNAL 0x20000 /* do not generate SIGPIPE on EOF */ -#endif -#if __BSD_VISIBLE -#define MSG_DONTWAIT 0x80 /* this message should be nonblocking */ -#define MSG_EOF 0x100 /* data completes connection */ -#define MSG_NOTIFICATION 0x2000 /* SCTP notification */ -#define MSG_NBIO 0x4000 /* FIONBIO mode, used by fifofs */ -#define MSG_COMPAT 0x8000 /* used in sendit() */ -#define MSG_CMSG_CLOEXEC 0x40000 /* make received fds close-on-exec */ -#define MSG_WAITFORONE 0x80000 /* for recvmmsg() */ -#endif -#ifdef _KERNEL -#define MSG_SOCALLBCK 0x10000 /* for use by socket callbacks - soreceive (TCP) */ -#endif - -/* - * Header for ancillary data objects in msg_control buffer. - * Used for additional information with/about a datagram - * not expressible by flags. The format is a sequence - * of message elements headed by cmsghdr structures. - */ -struct cmsghdr { - socklen_t cmsg_len; /* data byte count, including hdr */ - int cmsg_level; /* originating protocol */ - int cmsg_type; /* protocol-specific type */ -/* followed by u_char cmsg_data[]; */ -}; - -#if __BSD_VISIBLE -/* - * While we may have more groups than this, the cmsgcred struct must - * be able to fit in an mbuf and we have historically supported a - * maximum of 16 groups. -*/ -#define CMGROUP_MAX 16 - -/* - * Credentials structure, used to verify the identity of a peer - * process that has sent us a message. This is allocated by the - * peer process but filled in by the kernel. This prevents the - * peer from lying about its identity. (Note that cmcred_groups[0] - * is the effective GID.) - */ -struct cmsgcred { - pid_t cmcred_pid; /* PID of sending process */ - uid_t cmcred_uid; /* real UID of sending process */ - uid_t cmcred_euid; /* effective UID of sending process */ - gid_t cmcred_gid; /* real GID of sending process */ - short cmcred_ngroups; /* number or groups */ - gid_t cmcred_groups[CMGROUP_MAX]; /* groups */ -}; - -/* - * Socket credentials. - */ -struct sockcred { - uid_t sc_uid; /* real user id */ - uid_t sc_euid; /* effective user id */ - gid_t sc_gid; /* real group id */ - gid_t sc_egid; /* effective group id */ - int sc_ngroups; /* number of supplemental groups */ - gid_t sc_groups[1]; /* variable length */ -}; - -/* - * Compute size of a sockcred structure with groups. - */ -#define SOCKCREDSIZE(ngrps) \ - (sizeof(struct sockcred) + (sizeof(gid_t) * ((ngrps) - 1))) - -#endif /* __BSD_VISIBLE */ - -/* given pointer to struct cmsghdr, return pointer to data */ -#define CMSG_DATA(cmsg) ((unsigned char *)(cmsg) + \ - _ALIGN(sizeof(struct cmsghdr))) - -/* given pointer to struct cmsghdr, return pointer to next cmsghdr */ -#define CMSG_NXTHDR(mhdr, cmsg) \ - ((char *)(cmsg) == (char *)0 ? CMSG_FIRSTHDR(mhdr) : \ - ((char *)(cmsg) + _ALIGN(((struct cmsghdr *)(cmsg))->cmsg_len) + \ - _ALIGN(sizeof(struct cmsghdr)) > \ - (char *)(mhdr)->msg_control + (mhdr)->msg_controllen) ? \ - (struct cmsghdr *)0 : \ - (struct cmsghdr *)(void *)((char *)(cmsg) + \ - _ALIGN(((struct cmsghdr *)(cmsg))->cmsg_len))) - -/* - * RFC 2292 requires to check msg_controllen, in case that the kernel returns - * an empty list for some reasons. - */ -#define CMSG_FIRSTHDR(mhdr) \ - ((mhdr)->msg_controllen >= sizeof(struct cmsghdr) ? \ - (struct cmsghdr *)(mhdr)->msg_control : \ - (struct cmsghdr *)0) - -#if __BSD_VISIBLE -/* RFC 2292 additions */ -#define CMSG_SPACE(l) (_ALIGN(sizeof(struct cmsghdr)) + _ALIGN(l)) -#define CMSG_LEN(l) (_ALIGN(sizeof(struct cmsghdr)) + (l)) -#endif - -#ifdef _KERNEL -#define CMSG_ALIGN(n) _ALIGN(n) -#endif - -/* "Socket"-level control message types: */ -#define SCM_RIGHTS 0x01 /* access rights (array of int) */ -#if __BSD_VISIBLE -#define SCM_TIMESTAMP 0x02 /* timestamp (struct timeval) */ -#define SCM_CREDS 0x03 /* process creds (struct cmsgcred) */ -#define SCM_BINTIME 0x04 /* timestamp (struct bintime) */ -#endif - -#if __BSD_VISIBLE -/* - * 4.3 compat sockaddr, move to compat file later - */ -struct osockaddr { - unsigned short sa_family; /* address family */ - char sa_data[14]; /* up to 14 bytes of direct address */ -}; - -/* - * 4.3-compat message header (move to compat file later). - */ -struct omsghdr { - char *msg_name; /* optional address */ - int msg_namelen; /* size of address */ - struct iovec *msg_iov; /* scatter/gather array */ - int msg_iovlen; /* # elements in msg_iov */ - char *msg_accrights; /* access rights sent/received */ - int msg_accrightslen; -}; -#endif - -/* - * howto arguments for shutdown(2), specified by Posix.1g. - */ -#define SHUT_RD 0 /* shut down the reading side */ -#define SHUT_WR 1 /* shut down the writing side */ -#define SHUT_RDWR 2 /* shut down both sides */ - -#if __BSD_VISIBLE -/* for SCTP */ -/* we cheat and use the SHUT_XX defines for these */ -#define PRU_FLUSH_RD SHUT_RD -#define PRU_FLUSH_WR SHUT_WR -#define PRU_FLUSH_RDWR SHUT_RDWR -#endif - - -#if __BSD_VISIBLE -/* - * sendfile(2) header/trailer struct - */ -struct sf_hdtr { - struct iovec *headers; /* pointer to an array of header struct iovec's */ - int hdr_cnt; /* number of header iovec's */ - struct iovec *trailers; /* pointer to an array of trailer struct iovec's */ - int trl_cnt; /* number of trailer iovec's */ -}; - -/* - * Sendfile-specific flag(s) - */ -#define SF_NODISKIO 0x00000001 -#define SF_MNOWAIT 0x00000002 /* obsolete */ -#define SF_SYNC 0x00000004 -#define SF_NOCACHE 0x00000010 -#define SF_FLAGS(rh, flags) (((rh) << 16) | (flags)) - -#ifdef _KERNEL -#define SF_READAHEAD(flags) ((flags) >> 16) -#endif /* _KERNEL */ - -/* - * Sendmmsg/recvmmsg specific structure(s) - */ -struct mmsghdr { - struct msghdr msg_hdr; /* message header */ - ssize_t msg_len; /* message length */ -}; -#endif /* __BSD_VISIBLE */ - -#ifndef _KERNEL - -#include - -__BEGIN_DECLS -int accept(int, struct sockaddr * __restrict, socklen_t * __restrict); -int bind(int, const struct sockaddr *, socklen_t); -int connect(int, const struct sockaddr *, socklen_t); -#if __BSD_VISIBLE -int accept4(int, struct sockaddr * __restrict, socklen_t * __restrict, int); -int bindat(int, int, const struct sockaddr *, socklen_t); -int connectat(int, int, const struct sockaddr *, socklen_t); -#endif -int getpeername(int, struct sockaddr * __restrict, socklen_t * __restrict); -int getsockname(int, struct sockaddr * __restrict, socklen_t * __restrict); -int getsockopt(int, int, int, void * __restrict, socklen_t * __restrict); -int listen(int, int); -ssize_t recv(int, void *, size_t, int); -ssize_t recvfrom(int, void *, size_t, int, struct sockaddr * __restrict, socklen_t * __restrict); -ssize_t recvmsg(int, struct msghdr *, int); -#if __BSD_VISIBLE -struct timespec; -ssize_t recvmmsg(int, struct mmsghdr * __restrict, size_t, int, - const struct timespec * __restrict); -#endif -ssize_t send(int, const void *, size_t, int); -ssize_t sendto(int, const void *, - size_t, int, const struct sockaddr *, socklen_t); -ssize_t sendmsg(int, const struct msghdr *, int); -#if __BSD_VISIBLE -int sendfile(int, int, off_t, size_t, struct sf_hdtr *, off_t *, int); -ssize_t sendmmsg(int, struct mmsghdr * __restrict, size_t, int); -int setfib(int); -#endif -int setsockopt(int, int, int, const void *, socklen_t); -int shutdown(int, int); -int sockatmark(int); -int socket(int, int, int); -int socketpair(int, int, int, int *); -__END_DECLS - -#endif /* !_KERNEL */ - -#ifdef _KERNEL -struct socket; - -struct tcpcb *so_sototcpcb(struct socket *so); -struct inpcb *so_sotoinpcb(struct socket *so); -struct sockbuf *so_sockbuf_snd(struct socket *); -struct sockbuf *so_sockbuf_rcv(struct socket *); - -int so_state_get(const struct socket *); -void so_state_set(struct socket *, int); - -int so_options_get(const struct socket *); -void so_options_set(struct socket *, int); - -int so_error_get(const struct socket *); -void so_error_set(struct socket *, int); - -int so_linger_get(const struct socket *); -void so_linger_set(struct socket *, int); - -struct protosw *so_protosw_get(const struct socket *); -void so_protosw_set(struct socket *, struct protosw *); - -void so_sorwakeup_locked(struct socket *so); -void so_sowwakeup_locked(struct socket *so); - -void so_sorwakeup(struct socket *so); -void so_sowwakeup(struct socket *so); - -void so_lock(struct socket *so); -void so_unlock(struct socket *so); - -void so_listeners_apply_all(struct socket *so, void (*func)(struct socket *, void *), void *arg); - -#endif - - -#endif /* !_SYS_SOCKET_H_ */ diff --git a/cpukit/libnetworking/include/sys/syslog.h b/cpukit/libnetworking/include/sys/syslog.h deleted file mode 100644 index d6eadd4c7d..0000000000 --- a/cpukit/libnetworking/include/sys/syslog.h +++ /dev/null @@ -1,191 +0,0 @@ -/* - * Copyright (c) 1982, 1986, 1988, 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. - * 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. - * - * @(#)syslog.h 8.1 (Berkeley) 6/2/93 - * $FreeBSD: src/sys/sys/syslog.h,v 1.26 2005/01/07 02:29:24 imp Exp $ - */ - - -#ifndef _SYS_SYSLOG_H_ -#define _SYS_SYSLOG_H_ - -#define _PATH_LOG "/var/run/log" -#define _PATH_OLDLOG "/dev/log" /* backward compatibility */ - -/* - * priorities/facilities are encoded into a single 32-bit quantity, where the - * bottom 3 bits are the priority (0-7) and the top 28 bits are the facility - * (0-big number). Both the priorities and the facilities map roughly - * one-to-one to strings in the syslogd(8) source code. This mapping is - * included in this file. - * - * priorities (these are ordered) - */ -#define LOG_EMERG 0 /* system is unusable */ -#define LOG_ALERT 1 /* action must be taken immediately */ -#define LOG_CRIT 2 /* critical conditions */ -#define LOG_ERR 3 /* error conditions */ -#define LOG_WARNING 4 /* warning conditions */ -#define LOG_NOTICE 5 /* normal but significant condition */ -#define LOG_INFO 6 /* informational */ -#define LOG_DEBUG 7 /* debug-level messages */ - -#define LOG_PRIMASK 0x07 /* mask to extract priority part (internal) */ - /* extract priority */ -#define LOG_PRI(p) ((p) & LOG_PRIMASK) -#define LOG_MAKEPRI(fac, pri) ((fac) | (pri)) - -#ifdef SYSLOG_NAMES -#define INTERNAL_NOPRI 0x10 /* the "no priority" priority */ - /* mark "facility" */ -#define INTERNAL_MARK LOG_MAKEPRI((LOG_NFACILITIES<<3), 0) -typedef struct _code { - const char *c_name; - int c_val; -} CODE; - -CODE prioritynames[] = { - { "alert", LOG_ALERT, }, - { "crit", LOG_CRIT, }, - { "debug", LOG_DEBUG, }, - { "emerg", LOG_EMERG, }, - { "err", LOG_ERR, }, - { "error", LOG_ERR, }, /* DEPRECATED */ - { "info", LOG_INFO, }, - { "none", INTERNAL_NOPRI, }, /* INTERNAL */ - { "notice", LOG_NOTICE, }, - { "panic", LOG_EMERG, }, /* DEPRECATED */ - { "warn", LOG_WARNING, }, /* DEPRECATED */ - { "warning", LOG_WARNING, }, - { NULL, -1, } -}; -#endif - -/* facility codes */ -#define LOG_KERN (0<<3) /* kernel messages */ -#define LOG_USER (1<<3) /* random user-level messages */ -#define LOG_MAIL (2<<3) /* mail system */ -#define LOG_DAEMON (3<<3) /* system daemons */ -#define LOG_AUTH (4<<3) /* authorization messages */ -#define LOG_SYSLOG (5<<3) /* messages generated internally by syslogd */ -#define LOG_LPR (6<<3) /* line printer subsystem */ -#define LOG_NEWS (7<<3) /* network news subsystem */ -#define LOG_UUCP (8<<3) /* UUCP subsystem */ -#define LOG_CRON (9<<3) /* clock daemon */ -#define LOG_AUTHPRIV (10<<3) /* authorization messages (private) */ - /* Facility #10 clashes in DEC UNIX, where */ - /* it's defined as LOG_MEGASAFE for AdvFS */ - /* event logging. */ -#define LOG_FTP (11<<3) /* ftp daemon */ -#define LOG_NTP (12<<3) /* NTP subsystem */ - - /* other codes through 15 reserved for system use */ -#define LOG_LOCAL0 (16<<3) /* reserved for local use */ -#define LOG_LOCAL1 (17<<3) /* reserved for local use */ -#define LOG_LOCAL2 (18<<3) /* reserved for local use */ -#define LOG_LOCAL3 (19<<3) /* reserved for local use */ -#define LOG_LOCAL4 (20<<3) /* reserved for local use */ -#define LOG_LOCAL5 (21<<3) /* reserved for local use */ -#define LOG_LOCAL6 (22<<3) /* reserved for local use */ -#define LOG_LOCAL7 (23<<3) /* reserved for local use */ - -#define LOG_NFACILITIES 24 /* current number of facilities */ -#define LOG_FACMASK 0x03f8 /* mask to extract facility part */ - /* facility of pri */ -#define LOG_FAC(p) (((p) & LOG_FACMASK) >> 3) - -#ifdef SYSLOG_NAMES -CODE facilitynames[] = { - { "auth", LOG_AUTH, }, - { "authpriv", LOG_AUTHPRIV, }, - { "cron", LOG_CRON, }, - { "daemon", LOG_DAEMON, }, - { "ftp", LOG_FTP, }, - { "kern", LOG_KERN, }, - { "lpr", LOG_LPR, }, - { "mail", LOG_MAIL, }, - { "mark", INTERNAL_MARK, }, /* INTERNAL */ - { "news", LOG_NEWS, }, - { "ntp", LOG_NTP, }, - { "security", LOG_AUTH, }, /* DEPRECATED */ - { "syslog", LOG_SYSLOG, }, - { "user", LOG_USER, }, - { "uucp", LOG_UUCP, }, - { "local0", LOG_LOCAL0, }, - { "local1", LOG_LOCAL1, }, - { "local2", LOG_LOCAL2, }, - { "local3", LOG_LOCAL3, }, - { "local4", LOG_LOCAL4, }, - { "local5", LOG_LOCAL5, }, - { "local6", LOG_LOCAL6, }, - { "local7", LOG_LOCAL7, }, - { NULL, -1, } -}; -#endif - -#ifdef _KERNEL -#define LOG_PRINTF -1 /* pseudo-priority to indicate use of printf */ -#endif - -/* - * arguments to setlogmask. - */ -#define LOG_MASK(pri) (1 << (pri)) /* mask for one priority */ -#define LOG_UPTO(pri) ((1 << ((pri)+1)) - 1) /* all priorities through pri */ - -/* - * Option flags for openlog. - * - * LOG_ODELAY no longer does anything. - * LOG_NDELAY is the inverse of what it used to be. - */ -#define LOG_PID 0x01 /* log the pid with each message */ -#define LOG_CONS 0x02 /* log on the console if errors in sending */ -#define LOG_ODELAY 0x04 /* delay open until first syslog() (default) */ -#define LOG_NDELAY 0x08 /* don't delay open */ -#define LOG_NOWAIT 0x10 /* don't wait for console forks: DEPRECATED */ -#define LOG_PERROR 0x20 /* log to stderr as well */ - -#ifdef _KERNEL - -#else /* not _KERNEL */ - -#include -#include - -__BEGIN_DECLS -void closelog(void); -void openlog(const char *, int, int); -int setlogmask(int); -void syslog(int, const char *, ...); -void vsyslog(int, const char *, va_list); -__END_DECLS - -#endif /* !_KERNEL */ - -#endif diff --git a/cpukit/libnetworking/include/sys/ttydefaults.h b/cpukit/libnetworking/include/sys/ttydefaults.h deleted file mode 100644 index e81cf54f94..0000000000 --- a/cpukit/libnetworking/include/sys/ttydefaults.h +++ /dev/null @@ -1,96 +0,0 @@ -/*- - * Copyright (c) 1982, 1986, 1993 - * The Regents of the University of California. All rights reserved. - * (c) UNIX System Laboratories, Inc. - * All or some portions of this file are derived from material licensed - * to the University of California by American Telephone and Telegraph - * Co. or Unix System Laboratories, Inc. and are reproduced herein with - * the permission of UNIX System Laboratories, Inc. - * - * 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. - * - * @(#)ttydefaults.h 8.4 (Berkeley) 1/21/94 - */ - -/* - * System wide defaults for terminal state. - */ -#ifndef _SYS_TTYDEFAULTS_H_ -#define _SYS_TTYDEFAULTS_H_ - -/* - * Defaults on "first" open. - */ -#define TTYDEF_IFLAG (BRKINT | ICRNL | IMAXBEL | IXON | IXANY) -#define TTYDEF_OFLAG (OPOST | ONLCR) -#define TTYDEF_LFLAG (ECHO | ICANON | ISIG | IEXTEN | ECHOE|ECHOKE|ECHOCTL) -#define TTYDEF_CFLAG (CREAD | CS8 | HUPCL) -#define TTYDEF_SPEED (B9600) - -/* - * Control Character Defaults - */ -#define CTRL(x) (x&037) -#define CEOF CTRL('d') -#define CEOL 0xff /* XXX avoid _POSIX_VDISABLE */ -#define CERASE 0177 -#define CINTR CTRL('c') -#define CSTATUS CTRL('t') -#define CKILL CTRL('u') -#define CMIN 1 -#define CQUIT 034 /* FS, ^\ */ -#define CSUSP CTRL('z') -#define CTIME 0 -#define CDSUSP CTRL('y') -#define CSTART CTRL('q') -#define CSTOP CTRL('s') -#define CLNEXT CTRL('v') -#define CDISCARD CTRL('o') -#define CWERASE CTRL('w') -#define CREPRINT CTRL('r') -#define CEOT CEOF -/* compat */ -#define CBRK CEOL -#define CRPRNT CREPRINT -#define CFLUSH CDISCARD - -/* PROTECTED INCLUSION ENDS HERE */ -#endif /* !_SYS_TTYDEFAULTS_H_ */ - -/* - * #define TTYDEFCHARS to include an array of default control characters. - */ -#ifdef TTYDEFCHARS -static cc_t ttydefchars[NCCS] = { - CEOF, CEOL, CEOL, CERASE, CWERASE, CKILL, CREPRINT, - _POSIX_VDISABLE, CINTR, CQUIT, CSUSP, CDSUSP, CSTART, CSTOP, CLNEXT, - CDISCARD, CMIN, CTIME, CSTATUS, _POSIX_VDISABLE -}; -#undef TTYDEFCHARS -#endif diff --git a/cpukit/libnetworking/include/sys/un.h b/cpukit/libnetworking/include/sys/un.h deleted file mode 100644 index 2b8e3f5f40..0000000000 --- a/cpukit/libnetworking/include/sys/un.h +++ /dev/null @@ -1,76 +0,0 @@ -/* - * 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. - * 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. - * - * @(#)un.h 8.3 (Berkeley) 2/19/95 - * $FreeBSD: src/sys/sys/un.h,v 1.29 2005/04/13 00:01:46 mdodd Exp $ - */ - - -#ifndef _SYS_UN_H_ -#define _SYS_UN_H_ - -#include -#include - -#ifndef _SA_FAMILY_T_DECLARED -typedef __sa_family_t sa_family_t; -#define _SA_FAMILY_T_DECLARED -#endif - -/* - * Definitions for UNIX IPC domain. - */ -struct sockaddr_un { - unsigned char sun_len; /* sockaddr len including null */ - sa_family_t sun_family; /* AF_UNIX */ - char sun_path[104]; /* path name (gag) */ -}; - -#if __BSD_VISIBLE - -/* Socket options. */ -#define LOCAL_PEERCRED 0x001 /* retrieve peer credentials */ -#define LOCAL_CREDS 0x002 /* pass credentials to receiver */ -#define LOCAL_CONNWAIT 0x004 /* connects block until accepted */ - -#ifdef _KERNEL -struct mbuf; -struct socket; -struct sockopt; - -#else /* !_KERNEL */ - -/* actual length of an initialized sockaddr_un */ -#define SUN_LEN(su) \ - (sizeof(*(su)) - sizeof((su)->sun_path) + strlen((su)->sun_path)) - -#endif /* _KERNEL */ - -#endif /* __BSD_VISIBLE */ - -#endif /* !_SYS_UN_H_ */ diff --git a/cpukit/libnetworking/include/syslog.h b/cpukit/libnetworking/include/syslog.h deleted file mode 100644 index 830b4928ad..0000000000 --- a/cpukit/libnetworking/include/syslog.h +++ /dev/null @@ -1 +0,0 @@ -#include diff --git a/cpukit/libnetworking/preinstall.am b/cpukit/libnetworking/preinstall.am index a3aa406408..66d018304c 100644 --- a/cpukit/libnetworking/preinstall.am +++ b/cpukit/libnetworking/preinstall.am @@ -418,55 +418,6 @@ $(PROJECT_INCLUDE)/dev/mii/mii.h: dev/mii/mii.h $(PROJECT_INCLUDE)/dev/mii/$(dir $(INSTALL_DATA) $< $(PROJECT_INCLUDE)/dev/mii/mii.h PREINSTALL_FILES += $(PROJECT_INCLUDE)/dev/mii/mii.h -if !HAS_NEWLIB_20170522_HEADER -$(PROJECT_INCLUDE)/arpa/inet.h: include/arpa/inet.h $(PROJECT_INCLUDE)/arpa/$(dirstamp) - $(INSTALL_DATA) $< $(PROJECT_INCLUDE)/arpa/inet.h -PREINSTALL_FILES += $(PROJECT_INCLUDE)/arpa/inet.h - -$(PROJECT_INCLUDE)/netdb.h: include/netdb.h $(PROJECT_INCLUDE)/$(dirstamp) - $(INSTALL_DATA) $< $(PROJECT_INCLUDE)/netdb.h -PREINSTALL_FILES += $(PROJECT_INCLUDE)/netdb.h - -$(PROJECT_INCLUDE)/syslog.h: include/syslog.h $(PROJECT_INCLUDE)/$(dirstamp) - $(INSTALL_DATA) $< $(PROJECT_INCLUDE)/syslog.h -PREINSTALL_FILES += $(PROJECT_INCLUDE)/syslog.h - -$(PROJECT_INCLUDE)/net/if.h: include/net/if.h $(PROJECT_INCLUDE)/net/$(dirstamp) - $(INSTALL_DATA) $< $(PROJECT_INCLUDE)/net/if.h -PREINSTALL_FILES += $(PROJECT_INCLUDE)/net/if.h - -$(PROJECT_INCLUDE)/netinet6/in6.h: include/netinet6/in6.h $(PROJECT_INCLUDE)/netinet6/$(dirstamp) - $(INSTALL_DATA) $< $(PROJECT_INCLUDE)/netinet6/in6.h -PREINSTALL_FILES += $(PROJECT_INCLUDE)/netinet6/in6.h - -$(PROJECT_INCLUDE)/netinet/in.h: include/netinet/in.h $(PROJECT_INCLUDE)/netinet/$(dirstamp) - $(INSTALL_DATA) $< $(PROJECT_INCLUDE)/netinet/in.h -PREINSTALL_FILES += $(PROJECT_INCLUDE)/netinet/in.h - -$(PROJECT_INCLUDE)/netinet/tcp.h: include/netinet/tcp.h $(PROJECT_INCLUDE)/netinet/$(dirstamp) - $(INSTALL_DATA) $< $(PROJECT_INCLUDE)/netinet/tcp.h -PREINSTALL_FILES += $(PROJECT_INCLUDE)/netinet/tcp.h - -$(PROJECT_INCLUDE)/sys/_sockaddr_storage.h: include/sys/_sockaddr_storage.h $(PROJECT_INCLUDE)/sys/$(dirstamp) - $(INSTALL_DATA) $< $(PROJECT_INCLUDE)/sys/_sockaddr_storage.h -PREINSTALL_FILES += $(PROJECT_INCLUDE)/sys/_sockaddr_storage.h - -$(PROJECT_INCLUDE)/sys/socket.h: include/sys/socket.h $(PROJECT_INCLUDE)/sys/$(dirstamp) - $(INSTALL_DATA) $< $(PROJECT_INCLUDE)/sys/socket.h -PREINSTALL_FILES += $(PROJECT_INCLUDE)/sys/socket.h - -$(PROJECT_INCLUDE)/sys/syslog.h: include/sys/syslog.h $(PROJECT_INCLUDE)/sys/$(dirstamp) - $(INSTALL_DATA) $< $(PROJECT_INCLUDE)/sys/syslog.h -PREINSTALL_FILES += $(PROJECT_INCLUDE)/sys/syslog.h - -$(PROJECT_INCLUDE)/sys/ttydefaults.h: include/sys/ttydefaults.h $(PROJECT_INCLUDE)/sys/$(dirstamp) - $(INSTALL_DATA) $< $(PROJECT_INCLUDE)/sys/ttydefaults.h -PREINSTALL_FILES += $(PROJECT_INCLUDE)/sys/ttydefaults.h - -$(PROJECT_INCLUDE)/sys/un.h: include/sys/un.h $(PROJECT_INCLUDE)/sys/$(dirstamp) - $(INSTALL_DATA) $< $(PROJECT_INCLUDE)/sys/un.h -PREINSTALL_FILES += $(PROJECT_INCLUDE)/sys/un.h -endif $(PROJECT_INCLUDE)/ifaddrs.h: ifaddrs.h $(PROJECT_INCLUDE)/$(dirstamp) $(INSTALL_DATA) $< $(PROJECT_INCLUDE)/ifaddrs.h PREINSTALL_FILES += $(PROJECT_INCLUDE)/ifaddrs.h -- cgit v1.2.3