headers: More removal of the BSD Advertising Clause.

Taken from FreeBSD; some minor cleanup elsewhere.

udp.h rewritten entirely as it contained no copyrightable
material and bears little resemblance to BSD's.
This commit is contained in:
Augustin Cavalier
2020-07-03 15:00:37 -04:00
parent ebffd73fc5
commit 6996e5b271
5 changed files with 115 additions and 196 deletions
+10 -18
View File
@@ -1,4 +1,5 @@
/* Copyright (c) 1983, 1989 /*
* Copyright (c) 1983, 1989
* The Regents of the University of California. All rights reserved. * The Regents of the University of California. All rights reserved.
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
@@ -9,11 +10,7 @@
* 2. Redistributions in binary form must reproduce the above copyright * 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the * notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution. * documentation and/or other materials provided with the distribution.
* 3. All advertising materials mentioning features or use of this software * 3. Neither the name of the University nor the names of its contributors
* 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 * may be used to endorse or promote products derived from this software
* without specific prior written permission. * without specific prior written permission.
* *
@@ -29,12 +26,6 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE. * SUCH DAMAGE.
*/ */
/*
* from nameser.h 8.1 (Berkeley) 6/2/93
* $Id: nameser_compat.h 24644 2008-03-29 12:37:05Z bonefish $
*/
#ifndef _ARPA_NAMESER_COMPAT_ #ifndef _ARPA_NAMESER_COMPAT_
#define _ARPA_NAMESER_COMPAT_ #define _ARPA_NAMESER_COMPAT_
@@ -43,14 +34,13 @@
#include <endian.h> #include <endian.h>
#if !defined(BYTE_ORDER) || \ #if !defined(BYTE_ORDER) || \
(BYTE_ORDER != BIG_ENDIAN && BYTE_ORDER != LITTLE_ENDIAN && \ (BYTE_ORDER != BIG_ENDIAN && BYTE_ORDER != LITTLE_ENDIAN)
BYTE_ORDER != PDP_ENDIAN)
/* you must determine what the correct bit order is for /* you must determine what the correct bit order is for
* your compiler - the next line is an intentional error * your compiler - the next line is an intentional error
* which will force your compiles to bomb until you fix * which will force your compiles to bomb until you fix
* the above macros. * the above macros.
*/ */
error "Undefined or invalid BYTE_ORDER"; #error "Undefined or invalid BYTE_ORDER";
#endif #endif
/* /*
@@ -66,7 +56,7 @@ typedef struct {
/* fields in third byte */ /* fields in third byte */
unsigned qr: 1; /* response flag */ unsigned qr: 1; /* response flag */
unsigned opcode: 4; /* purpose of message */ unsigned opcode: 4; /* purpose of message */
unsigned aa: 1; /* authoritive answer */ unsigned aa: 1; /* authoritative answer */
unsigned tc: 1; /* truncated message */ unsigned tc: 1; /* truncated message */
unsigned rd: 1; /* recursion desired */ unsigned rd: 1; /* recursion desired */
/* fields in fourth byte */ /* fields in fourth byte */
@@ -76,11 +66,11 @@ typedef struct {
unsigned cd: 1; /* checking disabled by resolver */ unsigned cd: 1; /* checking disabled by resolver */
unsigned rcode :4; /* response code */ unsigned rcode :4; /* response code */
#endif #endif
#if BYTE_ORDER == LITTLE_ENDIAN || BYTE_ORDER == PDP_ENDIAN #if BYTE_ORDER == LITTLE_ENDIAN
/* fields in third byte */ /* fields in third byte */
unsigned rd :1; /* recursion desired */ unsigned rd :1; /* recursion desired */
unsigned tc :1; /* truncated message */ unsigned tc :1; /* truncated message */
unsigned aa :1; /* authoritive answer */ unsigned aa :1; /* authoritative answer */
unsigned opcode :4; /* purpose of message */ unsigned opcode :4; /* purpose of message */
unsigned qr :1; /* response flag */ unsigned qr :1; /* response flag */
/* fields in fourth byte */ /* fields in fourth byte */
@@ -178,6 +168,8 @@ typedef struct {
#define T_ATMA ns_t_atma #define T_ATMA ns_t_atma
#define T_NAPTR ns_t_naptr #define T_NAPTR ns_t_naptr
#define T_A6 ns_t_a6 #define T_A6 ns_t_a6
#define T_DNAME ns_t_dname
#define T_OPT ns_t_opt
#define T_TSIG ns_t_tsig #define T_TSIG ns_t_tsig
#define T_IXFR ns_t_ixfr #define T_IXFR ns_t_ixfr
#define T_AXFR ns_t_axfr #define T_AXFR ns_t_axfr
+1 -5
View File
@@ -13,11 +13,7 @@
* 2. Redistributions in binary form must reproduce the above copyright * 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the * notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution. * documentation and/or other materials provided with the distribution.
* 3. All advertising materials mentioning features or use of this software * 3. Neither the name of the University nor the names of its contributors
* 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 * may be used to endorse or promote products derived from this software
* without specific prior written permission. * without specific prior written permission.
* *
+1 -8
View File
@@ -1,4 +1,3 @@
/* Parts of this file are covered under the following copyright */
/* /*
* Copyright (c) 1982, 1986, 1993 * Copyright (c) 1982, 1986, 1993
* The Regents of the University of California. All rights reserved. * The Regents of the University of California. All rights reserved.
@@ -11,11 +10,7 @@
* 2. Redistributions in binary form must reproduce the above copyright * 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the * notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution. * documentation and/or other materials provided with the distribution.
* 3. All advertising materials mentioning features or use of this software * 3. Neither the name of the University nor the names of its contributors
* 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 * may be used to endorse or promote products derived from this software
* without specific prior written permission. * without specific prior written permission.
* *
@@ -30,8 +25,6 @@
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * 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 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE. * SUCH DAMAGE.
*
* @(#)ip_icmp.h 8.1 (Berkeley) 6/10/93
*/ */
#ifndef NETINET_IP_ICMP_H #ifndef NETINET_IP_ICMP_H
+1 -30
View File
@@ -1,4 +1,3 @@
/* Parts of this file are covered under the following copyright */
/* /*
* Copyright (c) 1982, 1986, 1993 * Copyright (c) 1982, 1986, 1993
* The Regents of the University of California. All rights reserved. * The Regents of the University of California. All rights reserved.
@@ -11,11 +10,7 @@
* 2. Redistributions in binary form must reproduce the above copyright * 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the * notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution. * documentation and/or other materials provided with the distribution.
* 3. All advertising materials mentioning features or use of this software * 3. Neither the name of the University nor the names of its contributors
* 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 * may be used to endorse or promote products derived from this software
* without specific prior written permission. * without specific prior written permission.
* *
@@ -30,8 +25,6 @@
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * 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 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE. * SUCH DAMAGE.
*
* @(#)ip_var.h 8.1 (Berkeley) 6/10/93
*/ */
#ifndef NETINET_IP_VAR_H #ifndef NETINET_IP_VAR_H
@@ -139,26 +132,4 @@ struct ipstat {
int32_t ips_outhwcsum; /* hardware checksummed on output */ int32_t ips_outhwcsum; /* hardware checksummed on output */
}; };
/* #ifdef _KERNEL_MODE */
#define IP_FORWARDING 0x1 /* most of ip header exists */
#define IP_ALLOWBROADCAST SO_BROADCAST /* can send broadcast packets */
#define IP_RAWOUTPUT 0x4 /* raw ip header exists */
#define IP_ROUTETOIF SO_DONTROUTE /* bypass routing tables */
#define IP_MTUDISC 0x10 /* pmtu discovery, set DF */
#if 0
/* struct ipstat ipstat; */
void ipv4_input(struct mbuf *, int);
int ipv4_output(struct mbuf *, struct mbuf *, struct route *, int, void *);
int ipv4_ctloutput(int, struct socket *, int, int, struct mbuf **);
int ip_dooptions(struct mbuf *);
void ip_stripoptions (struct mbuf *, struct mbuf *);
struct mbuf *ip_srcroute(void);
#endif /* _KERNEL_MODE */
#endif /* NETINET_IP_VAR_H */ #endif /* NETINET_IP_VAR_H */
+5 -38
View File
@@ -1,42 +1,9 @@
/* /*
* Copyright (c) 1982, 1986, 1993 * Copyright 2020, Haiku, Inc. All rights reserved.
*The Regents of the University of California. All rights reserved. * Distributed under the terms of the MIT License.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
*
* This product includes software developed by the University of
* California, Berkeley and its contributors.
*
* 4. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
*@(#)udp.h8.1 (Berkeley) 6/10/93
*/ */
#ifndef _NETINET_UDP_H
#ifndef NETINET_UDP_H #define _NETINET_UDP_H
#define NETINET_UDP_H
#include <stdint.h> #include <stdint.h>
@@ -47,4 +14,4 @@ struct udphdr {
uint16_t uh_sum; uint16_t uh_sum;
}; };
#endif /* NETINET_UDP_H */ #endif /* _NETINET_UDP_H */