summaryrefslogtreecommitdiff
path: root/system/include/net/netinet
diff options
context:
space:
mode:
authorBruce Mitchener <bruce.mitchener@gmail.com>2013-08-04 00:32:45 +0800
committerAlon Zakai <alonzakai@gmail.com>2013-09-13 10:07:02 -0700
commit5c6e1633d218bd5b9c5077634829eb14d326308f (patch)
tree50a4fd55b51a0fab6506addf610a666afabaec9b /system/include/net/netinet
parent27d496610e0ef93c9805a6a1a77de3f053405c6b (diff)
Update libc headers to use musl headers.
Diffstat (limited to 'system/include/net/netinet')
-rw-r--r--system/include/net/netinet/in.h230
-rw-r--r--system/include/net/netinet/tcp.h246
2 files changed, 0 insertions, 476 deletions
diff --git a/system/include/net/netinet/in.h b/system/include/net/netinet/in.h
deleted file mode 100644
index 1d3952f5..00000000
--- a/system/include/net/netinet/in.h
+++ /dev/null
@@ -1,230 +0,0 @@
-
-#ifndef _NET_NETINET_IN_H
-#define _NET_NETINET_IN_H
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include <arpa/inet.h>
-#include <stdint.h>
-
-enum {
- IPPROTO_IP = 0,
-#define IPPROTO_IP IPPROTO_IP
- IPPROTO_HOPOPTS = 0,
-#define IPPROTO_HOPOPTS IPPROTO_HOPOPTS
- IPPROTO_ICMP = 1,
-#define IPPROTO_ICMP IPPROTO_ICMP
- IPPROTO_IGMP = 2,
-#define IPPROTO_IGMP IPPROTO_IGMP
- IPPROTO_IPIP = 4,
-#define IPPROTO_IPIP IPPROTO_IPIP
- IPPROTO_TCP = 6,
-#define IPPROTO_TCP IPPROTO_TCP
- IPPROTO_EGP = 8,
-#define IPPROTO_EGP IPPROTO_EGP
- IPPROTO_PUP = 12,
-#define IPPROTO_PUP IPPROTO_PUP
- IPPROTO_UDP = 17,
-#define IPPROTO_UDP IPPROTO_UDP
- IPPROTO_IDP = 22,
-#define IPPROTO_IDP IPPROTO_IDP
- IPPROTO_TP = 29,
-#define IPPROTO_TP IPPROTO_TP
- IPPROTO_DCCP = 33,
-#define IPPROTO_DCCP IPPROTO_DCCP
- IPPROTO_IPV6 = 41,
-#define IPPROTO_IPV6 IPPROTO_IPV6
- IPPROTO_ROUTING = 43,
-#define IPPROTO_ROUTING IPPROTO_ROUTING
- IPPROTO_FRAGMENT = 44,
-#define IPPROTO_FRAGMENT IPPROTO_FRAGMENT
- IPPROTO_RSVP = 46,
-#define IPPROTO_RSVP IPPROTO_RSVP
- IPPROTO_GRE = 47,
-#define IPPROTO_GRE IPPROTO_GRE
- IPPROTO_ESP = 50,
-#define IPPROTO_ESP IPPROTO_ESP
- IPPROTO_AH = 51,
-#define IPPROTO_AH IPPROTO_AH
- IPPROTO_ICMPV6 = 58,
-#define IPPROTO_ICMPV6 IPPROTO_ICMPV6
- IPPROTO_NONE = 59,
-#define IPPROTO_NONE IPPROTO_NONE
- IPPROTO_DSTOPTS = 60,
-#define IPPROTO_DSTOPTS IPPROTO_DSTOPTS
- IPPROTO_MTP = 92,
-#define IPPROTO_MTP IPPROTO_MTP
- IPPROTO_ENCAP = 98,
-#define IPPROTO_ENCAP IPPROTO_ENCAP
- IPPROTO_PIM = 103,
-#define IPPROTO_PIM IPPROTO_PIM
- IPPROTO_COMP = 108,
-#define IPPROTO_COMP IPPROTO_COMP
- IPPROTO_SCTP = 132,
-#define IPPROTO_SCTP IPPROTO_SCTP
- IPPROTO_UDPLITE = 136,
-#define IPPROTO_UDPLITE IPPROTO_UDPLITE
- IPPROTO_RAW = 255,
-#define IPPROTO_RAW IPPROTO_RAW
- IPPROTO_MAX
-};
-
-#define INET_ADDRSTRLEN 16
-#define INET6_ADDRSTRLEN 46
-
-#define INADDR_ANY 0
-#define INADDR_LOOPBACK 0x7f000001 /* 127.0.0.1 */
-
-struct in_addr {
- unsigned long s_addr;
-};
-
-struct sockaddr_in {
- int sin_family;
- unsigned short sin_port;
- struct in_addr sin_addr;
- char sin_zero[6];
-};
-
-struct in6_addr {
- union {
- uint8_t _s6_addr8[16];
- uint16_t _s6_addr16[8];
- uint32_t _s6_addr32[4];
- } _u;
-#define s6_addr _u._s6_addr8
-#define s6_addr16 _u._s6_addr16
-#define s6_addr32 _u._s6_addr32
-};
-
-extern const struct in6_addr in6addr_any;
-extern const struct in6_addr in6addr_loopback;
-extern const struct in6_addr in6addr_linklocal_allnodes;
-extern const struct in6_addr in6addr_linklocal_allrouters;
-extern const struct in6_addr in6addr_interfacelocal_allnodes;
-extern const struct in6_addr in6addr_interfacelocal_allrouters;
-extern const struct in6_addr in6addr_sitelocal_allrouters;
-
-#define IN6ADDR_ANY_INIT { { { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 } } }
-#define IN6ADDR_LOOPBACK_INIT { { { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1 } } }
-#define IN6ADDR_LINKLOCAL_ALLNODES_INIT \
- { { { 0xff,2,0,0,0,0,0,0,0,0,0,0,0,0,0,1 } } }
-#define IN6ADDR_LINKLOCAL_ALLROUTERS_INIT \
- { { { 0xff,2,0,0,0,0,0,0,0,0,0,0,0,0,0,2 } } }
-
-struct sockaddr_in6 {
- int sin6_family;
- unsigned short sin6_port;
- int sin6_flowinfo;
- struct in6_addr sin6_addr;
- int sin6_scope_id;
-};
-
-struct ip_mreq {
- struct in_addr imr_multiaddr;
- struct in_addr imr_interface;
-};
-
-#define IP_PMTUDISC_DONT 0
-#define IP_PMTUDISC_WANT 1
-#define IP_PMTUDISC_DO 2
-#define IP_PMTUDISC_PROBE 3
-
-#define IP_MULTICAST_IF 32
-#define IP_MULTICAST_TTL 33
-#define IP_MULTICAST_LOOP 34
-#define IP_ADD_MEMBERSHIP 35
-#define IP_DROP_MEMBERSHIP 36
-#define IP_UNBLOCK_SOURCE 37
-#define IP_BLOCK_SOURCE 38
-#define IP_ADD_SOURCE_MEMBERSHIP 39
-#define IP_DROP_SOURCE_MEMBERSHIP 40
-#define IP_MSFILTER 41
-#define MCAST_JOIN_GROUP 42
-#define MCAST_BLOCK_SOURCE 43
-#define MCAST_UNBLOCK_SOURCE 44
-#define MCAST_LEAVE_GROUP 45
-#define MCAST_JOIN_SOURCE_GROUP 46
-#define MCAST_LEAVE_SOURCE_GROUP 47
-#define MCAST_MSFILTER 48
-#define IP_MULTICAST_ALL 49
-#define IP_UNICAST_IF 50
-
-/*
- * Tests for IPv6 address types
- */
-
-#define IN6_IS_ADDR_LINKLOCAL(addr) \
- (((addr)->s6_addr32[0] & htonl(0xffc00000)) == htonl(0xfe800000))
-
-#define IN6_IS_ADDR_LOOPBACK(addr) \
- (((addr)->s6_addr32[0] == 0) && ((addr)->s6_addr32[1] == 0) && \
- ((addr)->s6_addr32[2] == 0) && ((addr)->s6_addr32[3] == htonl(1)))
-
-#define IN6_IS_ADDR_MULTICAST(addr) \
- ((addr)->s6_addr8[0] == 0xff)
-
-#define IN6_IS_ADDR_SITELOCAL(addr) \
- (((addr)->s6_addr32[0] & htonl(0xffc00000)) == htonl(0xfec00000))
-
-#define IN6_IS_ADDR_UNSPECIFIED(addr) \
- (((addr)->s6_addr32[0] == 0) && ((addr)->s6_addr32[1] == 0) && \
- ((addr)->s6_addr32[2] == 0) && ((addr)->s6_addr32[3] == 0))
-
-#define IN6_IS_ADDR_V4COMPAT(addr) \
- (((addr)->s6_addr32[0] == 0) && ((addr)->s6_addr32[1] == 0) && \
- ((addr)->s6_addr32[2] == 0) && ((addr)->s6_addr32[3] & ~htonl(1)))
-
-#define IN6_IS_ADDR_V4MAPPED(addr) \
- (((addr)->s6_addr32[0] == 0) && ((addr)->s6_addr32[1] == 0) && \
- ((addr)->s6_addr32[2] == htonl(0xffff)))
-
-#define IN6_ARE_ADDR_EQUAL(addr1, addr2) \
- (((addr1)->s6_addr32[0] == (addr2)->s6_addr32[0]) && \
- ((addr1)->s6_addr32[1] == (addr2)->s6_addr32[1]) && \
- ((addr1)->s6_addr32[2] == (addr2)->s6_addr32[2]) && \
- ((addr1)->s6_addr32[3] == (addr2)->s6_addr32[3]))
-
-/*
- * IPv6 Multicast scoping. The scope is stored
- * in the bottom 4 bits of the second byte of the
- * multicast address.
- */
- /* 0x0 */ /* reserved */
-#define IN6_NODE_LOCAL 0x1 /* node-local scope */
-#define IN6_LINK_LOCAL 0x2 /* link-local scope */
- /* 0x3 */ /* (unassigned) */
- /* 0x4 */ /* (unassigned) */
-#define IN6_SITE_LOCAL 0x5 /* site-local scope */
- /* 0x6 */ /* (unassigned) */
- /* 0x7 */ /* (unassigned) */
-#define IN6_ORG_LOCAL 0x8 /* organization-local scope */
- /* 0x9 */ /* (unassigned) */
- /* 0xA */ /* (unassigned) */
- /* 0xB */ /* (unassigned) */
- /* 0xC */ /* (unassigned) */
- /* 0xD */ /* (unassigned) */
-#define IN6_GLOBAL 0xE /* global scope */
- /* 0xF */ /* reserved */
-
-#define IN6_MSCOPE(addr) ((addr)->s6_addr8[1] & 0x0f)
-
-#define IN6_IS_ADDR_MC_NODELOCAL(addr) \
- (IN6_IS_ADDR_MULTICAST(addr) && (IN6_MSCOPE(addr) == IN6_NODE_LOCAL))
-#define IN6_IS_ADDR_MC_LINKLOCAL(addr) \
- (IN6_IS_ADDR_MULTICAST(addr) && (IN6_MSCOPE(addr) == IN6_LINK_LOCAL))
-#define IN6_IS_ADDR_MC_SITELOCAL(addr) \
- (IN6_IS_ADDR_MULTICAST(addr) && (IN6_MSCOPE(addr) == IN6_SITE_LOCAL))
-#define IN6_IS_ADDR_MC_ORGLOCAL(addr) \
- (IN6_IS_ADDR_MULTICAST(addr) && (IN6_MSCOPE(addr) == IN6_ORG_LOCAL))
-#define IN6_IS_ADDR_MC_GLOBAL(addr) \
- (IN6_IS_ADDR_MULTICAST(addr) && (IN6_MSCOPE(addr) == IN6_GLOBAL))
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
-
diff --git a/system/include/net/netinet/tcp.h b/system/include/net/netinet/tcp.h
deleted file mode 100644
index 06e8414b..00000000
--- a/system/include/net/netinet/tcp.h
+++ /dev/null
@@ -1,246 +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
- */
-
-#ifndef _NETINET_TCP_H
-#define _NETINET_TCP_H 1
-
-#include <features.h>
-
-/*
- * User-settable options (used with setsockopt).
- */
-#define TCP_NODELAY 1 /* Don't delay send to coalesce packets */
-#define TCP_MAXSEG 2 /* Set maximum segment size */
-#define TCP_CORK 3 /* Control sending of partial frames */
-#define TCP_KEEPIDLE 4 /* Start keeplives after this period */
-#define TCP_KEEPINTVL 5 /* Interval between keepalives */
-#define TCP_KEEPCNT 6 /* Number of keepalives before death */
-#define TCP_SYNCNT 7 /* Number of SYN retransmits */
-#define TCP_LINGER2 8 /* Life time of orphaned FIN-WAIT-2 state */
-#define TCP_DEFER_ACCEPT 9 /* Wake up listener only when data arrive */
-#define TCP_WINDOW_CLAMP 10 /* Bound advertised window */
-#define TCP_INFO 11 /* Information about this connection. */
-#define TCP_QUICKACK 12 /* Bock/reenable quick ACKs. */
-#define TCP_CONGESTION 13 /* Congestion control algorithm. */
-#define TCP_MD5SIG 14 /* TCP MD5 Signature (RFC2385) */
-
-#ifdef __USE_MISC
-# include <sys/types.h>
-# include <sys/socket.h>
-
-# ifdef __FAVOR_BSD
-typedef u_int32_t tcp_seq;
-/*
- * TCP header.
- * Per RFC 793, September, 1981.
- */
-struct tcphdr
- {
- u_int16_t th_sport; /* source port */
- u_int16_t th_dport; /* destination port */
- tcp_seq th_seq; /* sequence number */
- tcp_seq th_ack; /* acknowledgement number */
-# if __BYTE_ORDER == __LITTLE_ENDIAN
- u_int8_t th_x2:4; /* (unused) */
- u_int8_t th_off:4; /* data offset */
-# endif
-# if __BYTE_ORDER == __BIG_ENDIAN
- u_int8_t th_off:4; /* data offset */
- u_int8_t th_x2:4; /* (unused) */
-# endif
- u_int8_t 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
- u_int16_t th_win; /* window */
- u_int16_t th_sum; /* checksum */
- u_int16_t th_urp; /* urgent pointer */
-};
-
-# else /* !__FAVOR_BSD */
-struct tcphdr
- {
- u_int16_t source;
- u_int16_t dest;
- u_int32_t seq;
- u_int32_t ack_seq;
-# if __BYTE_ORDER == __LITTLE_ENDIAN
- u_int16_t res1:4;
- u_int16_t doff:4;
- u_int16_t fin:1;
- u_int16_t syn:1;
- u_int16_t rst:1;
- u_int16_t psh:1;
- u_int16_t ack:1;
- u_int16_t urg:1;
- u_int16_t res2:2;
-# elif __BYTE_ORDER == __BIG_ENDIAN
- u_int16_t doff:4;
- u_int16_t res1:4;
- u_int16_t res2:2;
- u_int16_t urg:1;
- u_int16_t ack:1;
- u_int16_t psh:1;
- u_int16_t rst:1;
- u_int16_t syn:1;
- u_int16_t fin:1;
-# else
-# error "Adjust your <bits/endian.h> defines"
-# endif
- u_int16_t window;
- u_int16_t check;
- u_int16_t urg_ptr;
-};
-# endif /* __FAVOR_BSD */
-
-enum
-{
- TCP_ESTABLISHED = 1,
- TCP_SYN_SENT,
- TCP_SYN_RECV,
- TCP_FIN_WAIT1,
- TCP_FIN_WAIT2,
- TCP_TIME_WAIT,
- TCP_CLOSE,
- TCP_CLOSE_WAIT,
- TCP_LAST_ACK,
- TCP_LISTEN,
- TCP_CLOSING /* now a valid state */
-};
-
-# define TCPOPT_EOL 0
-# define TCPOPT_NOP 1
-# define TCPOPT_MAXSEG 2
-# define TCPOLEN_MAXSEG 4
-# define TCPOPT_WINDOW 3
-# define TCPOLEN_WINDOW 3
-# define TCPOPT_SACK_PERMITTED 4 /* Experimental */
-# define TCPOLEN_SACK_PERMITTED 2
-# define TCPOPT_SACK 5 /* Experimental */
-# define TCPOPT_TIMESTAMP 8
-# define TCPOLEN_TIMESTAMP 10
-# define TCPOLEN_TSTAMP_APPA (TCPOLEN_TIMESTAMP+2) /* appendix A */
-
-# define TCPOPT_TSTAMP_HDR \
- (TCPOPT_NOP<<24|TCPOPT_NOP<<16|TCPOPT_TIMESTAMP<<8|TCPOLEN_TIMESTAMP)
-
-/*
- * Default maximum segment size for TCP.
- * With an IP MSS of 576, this is 536,
- * but 512 is probably more convenient.
- * This should be defined as MIN(512, IP_MSS - sizeof (struct tcpiphdr)).
- */
-# define TCP_MSS 512
-
-# define TCP_MAXWIN 65535 /* largest value for (unscaled) window */
-
-# define TCP_MAX_WINSHIFT 14 /* maximum window shift */
-
-# define SOL_TCP 6 /* TCP level */
-
-
-# define TCPI_OPT_TIMESTAMPS 1
-# define TCPI_OPT_SACK 2
-# define TCPI_OPT_WSCALE 4
-# define TCPI_OPT_ECN 8
-
-/* Values for tcpi_state. */
-enum tcp_ca_state
-{
- TCP_CA_Open = 0,
- TCP_CA_Disorder = 1,
- TCP_CA_CWR = 2,
- TCP_CA_Recovery = 3,
- TCP_CA_Loss = 4
-};
-
-struct tcp_info
-{
- u_int8_t tcpi_state;
- u_int8_t tcpi_ca_state;
- u_int8_t tcpi_retransmits;
- u_int8_t tcpi_probes;
- u_int8_t tcpi_backoff;
- u_int8_t tcpi_options;
- u_int8_t tcpi_snd_wscale : 4, tcpi_rcv_wscale : 4;
-
- u_int32_t tcpi_rto;
- u_int32_t tcpi_ato;
- u_int32_t tcpi_snd_mss;
- u_int32_t tcpi_rcv_mss;
-
- u_int32_t tcpi_unacked;
- u_int32_t tcpi_sacked;
- u_int32_t tcpi_lost;
- u_int32_t tcpi_retrans;
- u_int32_t tcpi_fackets;
-
- /* Times. */
- u_int32_t tcpi_last_data_sent;
- u_int32_t tcpi_last_ack_sent; /* Not remembered, sorry. */
- u_int32_t tcpi_last_data_recv;
- u_int32_t tcpi_last_ack_recv;
-
- /* Metrics. */
- u_int32_t tcpi_pmtu;
- u_int32_t tcpi_rcv_ssthresh;
- u_int32_t tcpi_rtt;
- u_int32_t tcpi_rttvar;
- u_int32_t tcpi_snd_ssthresh;
- u_int32_t tcpi_snd_cwnd;
- u_int32_t tcpi_advmss;
- u_int32_t tcpi_reordering;
-
- u_int32_t tcpi_rcv_rtt;
- u_int32_t tcpi_rcv_space;
-
- u_int32_t tcpi_total_retrans;
-};
-
-
-/* For TCP_MD5SIG socket option. */
-#define TCP_MD5SIG_MAXKEYLEN 80
-
-struct tcp_md5sig
-{
- struct sockaddr_storage tcpm_addr; /* Address associated. */
- u_int16_t __tcpm_pad1; /* Zero. */
- u_int16_t tcpm_keylen; /* Key length. */
- u_int32_t __tcpm_pad2; /* Zero. */
- u_int8_t tcpm_key[TCP_MD5SIG_MAXKEYLEN]; /* Key (binary). */
-};
-
-#endif /* Misc. */
-
-#endif /* netinet/tcp.h */