Moving all NetBSD headers back where they belong.

Moving include/sys NetBSD headers to /sys/sys
Moving include/arch/*/ NetBSD headers to /sys/arch/*/include

Change-Id: Ia1a45d4e83ab806c84093ec2b61bdbea9bed65a0
This commit is contained in:
2012-11-26 16:59:26 +01:00
parent be89757ef5
commit f6aac1c3b5
222 changed files with 4556 additions and 5262 deletions

5
sys/netinet/Makefile Normal file
View File

@@ -0,0 +1,5 @@
INCSDIR= /usr/include/netinet
INCS+= in.h tcp.h
.include <bsd.kinc.mk>

View File

@@ -234,6 +234,14 @@ struct in_addr {
/*
* Socket address, internet style.
*/
#ifdef __minix
struct sockaddr_in
{
sa_family_t sin_family;
in_port_t sin_port;
struct in_addr sin_addr;
};
#else /* !__minix */
struct sockaddr_in {
uint8_t sin_len;
sa_family_t sin_family;
@@ -241,9 +249,11 @@ struct sockaddr_in {
struct in_addr sin_addr;
__int8_t sin_zero[8];
};
#endif /* !__minix */
#define INET_ADDRSTRLEN 16
#ifndef __minix
/*
* Structure used to describe IP options.
* Used to store options internally, to pass them to a process,
@@ -259,11 +269,13 @@ struct ip_opts {
__int8_t ip_opts[40]; /* actually variable in size */
#endif
};
#endif /* __minix */
/*
* Options for use with [gs]etsockopt at the IP level.
* First word of comment is data type; bool is stored in int.
*/
#ifndef __minix
#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. */
@@ -275,8 +287,10 @@ struct ip_opts {
#define IP_MULTICAST_IF 9 /* in_addr; 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 */
#endif /* !__minix */
#define IP_ADD_MEMBERSHIP 12 /* ip_mreq; add an IP group membership */
#define IP_DROP_MEMBERSHIP 13 /* ip_mreq; drop an IP group membership */
#ifndef __minix
#define IP_PORTRANGE 19 /* int; range to use for ephemeral port */
#define IP_RECVIF 20 /* bool; receive reception if w/dgram */
#define IP_ERRORMTU 21 /* int; get MTU of last xmit = EMSGSIZE */
@@ -285,13 +299,16 @@ struct ip_opts {
#endif
#define IP_RECVTTL 23 /* bool; receive IP TTL w/dgram */
#define IP_MINTTL 24 /* minimum TTL for packet or drop */
#endif /* !__minix */
#ifndef __minix
/*
* Defaults and limits for options
*/
#define IP_DEFAULT_MULTICAST_TTL 1 /* normally limit m'casts to 1 hop */
#define IP_DEFAULT_MULTICAST_LOOP 1 /* normally hear sends if a member */
#define IP_MAX_MEMBERSHIPS 20 /* per socket; must fit in one mbuf */
#endif /* !__minix */
/*
* Argument structure for IP_ADD_MEMBERSHIP and IP_DROP_MEMBERSHIP.
@@ -301,6 +318,7 @@ struct ip_mreq {
struct in_addr imr_interface; /* local IP address of interface */
};
#ifndef __minix
/*
* Argument for IP_PORTRANGE:
* - which range to search when port is unspecified at bind() or connect()
@@ -484,12 +502,14 @@ struct ip_mreq {
{ "stats", CTLTYPE_STRUCT }, \
}
#endif /* _NETBSD_SOURCE */
#endif /* __minix */
/* INET6 stuff */
#define __KAME_NETINET_IN_H_INCLUDED_
#include <netinet6/in6.h>
#undef __KAME_NETINET_IN_H_INCLUDED_
#ifndef __minix
#ifdef _KERNEL
/*
* in_cksum_phdr:
@@ -597,5 +617,6 @@ sockaddr_in_alloc(const struct in_addr *addr, in_port_t port, int flags)
return sa;
}
#endif /* _KERNEL */
#endif /* __minix */
#endif /* !_NETINET_IN_H_ */

119
sys/netinet/tcp.h Normal file
View File

@@ -0,0 +1,119 @@
/* $NetBSD: tcp.h,v 1.28 2007/12/25 18:33:47 perry Exp $ */
/*
* Copyright (c) 1982, 1986, 1993
* The Regents of the University of California. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. 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_
#include <sys/featuretest.h>
#if defined(_NETBSD_SOURCE)
typedef u_int32_t tcp_seq;
/*
* TCP header.
* Per RFC 793, September, 1981.
* Updated by RFC 3168, September, 2001.
*/
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
/*LINTED non-portable bitfields*/
u_int8_t th_x2:4, /* (unused) */
th_off:4; /* data offset */
#endif
#if BYTE_ORDER == BIG_ENDIAN
/*LINTED non-portable bitfields*/
u_int8_t th_off:4, /* data offset */
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
#define TH_ECE 0x40
#define TH_CWR 0x80
u_int16_t th_win; /* window */
u_int16_t th_sum; /* checksum */
u_int16_t th_urp; /* urgent pointer */
} __packed;
#define TCPOPT_EOL 0
#define TCPOPT_NOP 1
#define TCPOPT_MAXSEG 2
#define TCPOLEN_MAXSEG 4
#define TCPOPT_WINDOW 3
#define TCPOLEN_WINDOW 3
#define TCPOPT_SACK_PERMITTED 4 /* Experimental */
#define TCPOLEN_SACK_PERMITTED 2
#define TCPOPT_SACK 5 /* Experimental */
#define TCPOPT_TIMESTAMP 8
#define TCPOLEN_TIMESTAMP 10
#define TCPOLEN_TSTAMP_APPA (TCPOLEN_TIMESTAMP+2) /* appendix A */
#define TCPOPT_TSTAMP_HDR \
(TCPOPT_NOP<<24|TCPOPT_NOP<<16|TCPOPT_TIMESTAMP<<8|TCPOLEN_TIMESTAMP)
#define TCPOPT_SIGNATURE 19 /* Keyed MD5: RFC 2385 */
#define TCPOLEN_SIGNATURE 18
#define TCPOLEN_SIGLEN (TCPOLEN_SIGNATURE+2) /* padding */
#define MAX_TCPOPTLEN 40 /* max # bytes that go in options */
/*
* Default maximum segment size for TCP.
* This is defined by RFC 1112 Sec 4.2.2.6.
*/
#define TCP_MSS 536
#define TCP_MINMSS 216
#define TCP_MAXWIN 65535 /* largest value for (unscaled) window */
#define TCP_MAX_WINSHIFT 14 /* maximum window shift */
#define TCP_MAXBURST 4 /* maximum segments in a burst */
#endif /* _NETBSD_SOURCE */
/*
* User-settable options (used with setsockopt).
*/
#define TCP_NODELAY 1 /* don't delay send to coalesce packets */
#endif /* !_NETINET_TCP_H_ */