git: 46ddeb6be8e8 - main - netinet6: retire ip6protosw.h

From: Gleb Smirnoff <glebius_at_FreeBSD.org>
Date: Tue, 04 Oct 2022 03:57:30 UTC
The branch main has been updated by glebius:

URL: https://cgit.FreeBSD.org/src/commit/?id=46ddeb6be8e839d4e404c98c230fe1b57a9ea32f

commit 46ddeb6be8e839d4e404c98c230fe1b57a9ea32f
Author:     Gleb Smirnoff <glebius@FreeBSD.org>
AuthorDate: 2022-10-04 03:53:04 +0000
Commit:     Gleb Smirnoff <glebius@FreeBSD.org>
CommitDate: 2022-10-04 03:53:04 +0000

    netinet6: retire ip6protosw.h
    
    The netinet/ipprotosw.h and netinet6/ip6protosw.h were KAME relics, with
    the former removed in f0ffb944d25 in 2001 and the latter survived until
    today.  It has been reduced down to only one useful declaration that
    moves to ip6_var.h
    
    Reviewed by:            melifaro
    Differential revision:  https://reviews.freebsd.org/D36726
---
 ObsoleteFiles.inc          |   3 ++
 sys/netinet/sctp_os_bsd.h  |   1 -
 sys/netinet/tcp_subr.c     |   3 --
 sys/netinet/tcp_timewait.c |   3 --
 sys/netinet6/icmp6.c       |   1 -
 sys/netinet6/in6_proto.c   |   2 -
 sys/netinet6/ip6_input.c   |   2 -
 sys/netinet6/ip6_output.c  |   1 -
 sys/netinet6/ip6_var.h     |  29 +++++++++++
 sys/netinet6/ip6protosw.h  | 119 ---------------------------------------------
 sys/netinet6/raw_ip6.c     |   1 -
 sys/netinet6/udp6_usrreq.c |   1 -
 sys/netipsec/ipsec_input.c |   1 -
 13 files changed, 32 insertions(+), 135 deletions(-)

diff --git a/ObsoleteFiles.inc b/ObsoleteFiles.inc
index 3d9e7d4c6dd4..6cccea90c74f 100644
--- a/ObsoleteFiles.inc
+++ b/ObsoleteFiles.inc
@@ -52,6 +52,9 @@
 #   xargs -n1 | sort | uniq -d;
 # done
 
+# 20221003: ip6protosw.h removed
+OLD_FILES+=usr/include/netinet6/ip6protosw.h
+
 # 20221001: deorbit opie
 OLD_FILES+=etc/opieaccess
 OLD_FILES+=etc/opiekeys
diff --git a/sys/netinet/sctp_os_bsd.h b/sys/netinet/sctp_os_bsd.h
index 8240fca64c48..d9b5c140f14c 100644
--- a/sys/netinet/sctp_os_bsd.h
+++ b/sys/netinet/sctp_os_bsd.h
@@ -92,7 +92,6 @@ __FBSDID("$FreeBSD$");
 #include <netinet6/in6_fib.h>
 #include <netinet6/ip6_var.h>
 #include <netinet6/in6_pcb.h>
-#include <netinet6/ip6protosw.h>
 #include <netinet6/nd6.h>
 #include <netinet6/scope6_var.h>
 #endif				/* INET6 */
diff --git a/sys/netinet/tcp_subr.c b/sys/netinet/tcp_subr.c
index 9b3525815f73..b9c5be5592f5 100644
--- a/sys/netinet/tcp_subr.c
+++ b/sys/netinet/tcp_subr.c
@@ -120,9 +120,6 @@ __FBSDID("$FreeBSD$");
 #ifdef TCPDEBUG
 #include <netinet/tcp_debug.h>
 #endif
-#ifdef INET6
-#include <netinet6/ip6protosw.h>
-#endif
 #ifdef TCP_OFFLOAD
 #include <netinet/tcp_offload.h>
 #endif
diff --git a/sys/netinet/tcp_timewait.c b/sys/netinet/tcp_timewait.c
index ad183aa2e18f..5cac0af946a9 100644
--- a/sys/netinet/tcp_timewait.c
+++ b/sys/netinet/tcp_timewait.c
@@ -86,9 +86,6 @@ __FBSDID("$FreeBSD$");
 #ifdef TCPDEBUG
 #include <netinet/tcp_debug.h>
 #endif
-#ifdef INET6
-#include <netinet6/ip6protosw.h>
-#endif
 
 #include <netinet/udp.h>
 #include <netinet/udp_var.h>
diff --git a/sys/netinet6/icmp6.c b/sys/netinet6/icmp6.c
index 6b81c7a6b000..0d8786907716 100644
--- a/sys/netinet6/icmp6.c
+++ b/sys/netinet6/icmp6.c
@@ -107,7 +107,6 @@ __FBSDID("$FreeBSD$");
 #include <netinet6/in6_fib.h>
 #include <netinet6/in6_ifattach.h>
 #include <netinet6/in6_pcb.h>
-#include <netinet6/ip6protosw.h>
 #include <netinet6/ip6_var.h>
 #include <netinet6/scope6_var.h>
 #include <netinet6/mld6_var.h>
diff --git a/sys/netinet6/in6_proto.c b/sys/netinet6/in6_proto.c
index 688702e17e34..da15e6e2d13d 100644
--- a/sys/netinet6/in6_proto.c
+++ b/sys/netinet6/in6_proto.c
@@ -119,8 +119,6 @@ __FBSDID("$FreeBSD$");
 #include <netinet6/sctp6_var.h>
 #endif /* SCTP */
 
-#include <netinet6/ip6protosw.h>
-
 /* netinet6/raw_ip6.c */
 extern struct protosw rip6_protosw;
 /* netinet6/udp6_usrreq.c */
diff --git a/sys/netinet6/ip6_input.c b/sys/netinet6/ip6_input.c
index 5c802beae2ee..31a3170475cb 100644
--- a/sys/netinet6/ip6_input.c
+++ b/sys/netinet6/ip6_input.c
@@ -129,8 +129,6 @@ __FBSDID("$FreeBSD$");
 
 #include <netipsec/ipsec_support.h>
 
-#include <netinet6/ip6protosw.h>
-
 ip6proto_input_t	*ip6_protox[IPPROTO_MAX] = {
 			    [0 ... IPPROTO_MAX - 1] = rip6_input };
 ip6proto_ctlinput_t	*ip6_ctlprotox[IPPROTO_MAX] = {
diff --git a/sys/netinet6/ip6_output.c b/sys/netinet6/ip6_output.c
index 617271f96407..b976b0583515 100644
--- a/sys/netinet6/ip6_output.c
+++ b/sys/netinet6/ip6_output.c
@@ -121,7 +121,6 @@ __FBSDID("$FreeBSD$");
 #include <netinet/sctp_crc32.h>
 #endif
 
-#include <netinet6/ip6protosw.h>
 #include <netinet6/scope6_var.h>
 
 extern int in6_mcast_loop;
diff --git a/sys/netinet6/ip6_var.h b/sys/netinet6/ip6_var.h
index 69ed33bd8e70..2b15443fc4d6 100644
--- a/sys/netinet6/ip6_var.h
+++ b/sys/netinet6/ip6_var.h
@@ -414,6 +414,35 @@ u_int32_t ip6_randomid(void);
 u_int32_t ip6_randomflowlabel(void);
 void in6_delayed_cksum(struct mbuf *m, uint32_t plen, u_short offset);
 
+/*
+ * Argument type for the last arg of ip6proto_ctlinput_t().
+ *
+ * IPv6 ICMP IPv6 [exthdrs] finalhdr payload
+ * ^    ^    ^              ^
+ * |    |    ip6c_ip6       ip6c_off
+ * |    ip6c_icmp6
+ * ip6c_m
+ *
+ * ip6c_finaldst usually points to ip6c_ip6->ip6_dst.  if the original
+ * (internal) packet carries a routing header, it may point the final
+ * destination address in the routing header.
+ *
+ * ip6c_src: ip6c_ip6->ip6_src + scope info + flowlabel in ip6c_ip6
+ *	(beware of flowlabel, if you try to compare it against others)
+ * ip6c_dst: ip6c_finaldst + scope info
+ */
+struct ip6ctlparam {
+	struct mbuf *ip6c_m;		/* start of mbuf chain */
+	struct icmp6_hdr *ip6c_icmp6;	/* icmp6 header of target packet */
+	struct ip6_hdr *ip6c_ip6;	/* ip6 header of target packet */
+	int ip6c_off;			/* offset of the target proto header */
+	struct sockaddr_in6 *ip6c_src;	/* srcaddr w/ additional info */
+	struct sockaddr_in6 *ip6c_dst;	/* (final) dstaddr w/ additional info */
+	struct in6_addr *ip6c_finaldst;	/* final destination address */
+	void *ip6c_cmdarg;		/* control command dependent data */
+	u_int8_t ip6c_nxt;		/* final next header field */
+};
+
 typedef int	ip6proto_input_t(struct mbuf **, int *, int);
 typedef void	ip6proto_ctlinput_t(int, struct sockaddr *, void *);
 int	ip6proto_register(uint8_t, ip6proto_input_t, ip6proto_ctlinput_t);
diff --git a/sys/netinet6/ip6protosw.h b/sys/netinet6/ip6protosw.h
deleted file mode 100644
index d978e33042b9..000000000000
--- a/sys/netinet6/ip6protosw.h
+++ /dev/null
@@ -1,119 +0,0 @@
-/*-
- * SPDX-License-Identifier: BSD-3-Clause
- *
- * 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: ip6protosw.h,v 1.25 2001/09/26 06:13:03 keiichi 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.
- *
- *	@(#)protosw.h	8.1 (Berkeley) 6/2/93
- *	BSDI protosw.h,v 2.3 1996/10/11 16:02:40 pjd Exp
- * $FreeBSD$
- */
-
-#ifndef _NETINET6_IP6PROTOSW_H_
-#define _NETINET6_IP6PROTOSW_H_
-
-/*
- * Protocol switch table for IPv6.
- * All other definitions should refer to sys/protosw.h
- */
-
-struct mbuf;
-struct sockaddr;
-struct socket;
-struct domain;
-struct thread;
-struct ip6_hdr;
-struct icmp6_hdr;
-struct in6_addr;
-struct pr_usrreqs;
-
-/*
- * argument type for the last arg of pr_ctlinput().
- * should be consulted only with AF_INET6 family.
- *
- * IPv6 ICMP IPv6 [exthdrs] finalhdr payload
- * ^    ^    ^              ^
- * |    |    ip6c_ip6       ip6c_off
- * |    ip6c_icmp6
- * ip6c_m
- *
- * ip6c_finaldst usually points to ip6c_ip6->ip6_dst.  if the original
- * (internal) packet carries a routing header, it may point the final
- * destination address in the routing header.
- *
- * ip6c_src: ip6c_ip6->ip6_src + scope info + flowlabel in ip6c_ip6
- *	(beware of flowlabel, if you try to compare it against others)
- * ip6c_dst: ip6c_finaldst + scope info
- */
-struct ip6ctlparam {
-	struct mbuf *ip6c_m;		/* start of mbuf chain */
-	struct icmp6_hdr *ip6c_icmp6;	/* icmp6 header of target packet */
-	struct ip6_hdr *ip6c_ip6;	/* ip6 header of target packet */
-	int ip6c_off;			/* offset of the target proto header */
-	struct sockaddr_in6 *ip6c_src;	/* srcaddr w/ additional info */
-	struct sockaddr_in6 *ip6c_dst;	/* (final) dstaddr w/ additional info */
-	struct in6_addr *ip6c_finaldst;	/* final destination address */
-	void *ip6c_cmdarg;		/* control command dependent data */
-	u_int8_t ip6c_nxt;		/* final next header field */
-};
-
-#ifdef _KERNEL
-extern struct protosw inet6sw[];
-#endif
-
-#endif /* !_NETINET6_IP6PROTOSW_H_ */
diff --git a/sys/netinet6/raw_ip6.c b/sys/netinet6/raw_ip6.c
index 0a5d343f3725..b1cf9fc68a59 100644
--- a/sys/netinet6/raw_ip6.c
+++ b/sys/netinet6/raw_ip6.c
@@ -98,7 +98,6 @@ __FBSDID("$FreeBSD$");
 #include <netinet/icmp6.h>
 #include <netinet/ip6.h>
 #include <netinet/ip_var.h>
-#include <netinet6/ip6protosw.h>
 #include <netinet6/ip6_mroute.h>
 #include <netinet6/in6_pcb.h>
 #include <netinet6/ip6_var.h>
diff --git a/sys/netinet6/udp6_usrreq.c b/sys/netinet6/udp6_usrreq.c
index c8e65f640842..4c06e5ea9433 100644
--- a/sys/netinet6/udp6_usrreq.c
+++ b/sys/netinet6/udp6_usrreq.c
@@ -114,7 +114,6 @@ __FBSDID("$FreeBSD$");
 #include <netinet/udp_var.h>
 #include <netinet/udplite.h>
 
-#include <netinet6/ip6protosw.h>
 #include <netinet6/ip6_var.h>
 #include <netinet6/in6_fib.h>
 #include <netinet6/in6_pcb.h>
diff --git a/sys/netipsec/ipsec_input.c b/sys/netipsec/ipsec_input.c
index ca6c6592dfa4..7effed48121a 100644
--- a/sys/netipsec/ipsec_input.c
+++ b/sys/netipsec/ipsec_input.c
@@ -95,7 +95,6 @@ __FBSDID("$FreeBSD$");
 #include <netipsec/key_debug.h>
 
 #include <netipsec/xform.h>
-#include <netinet6/ip6protosw.h>
 
 #include <machine/in_cksum.h>
 #include <machine/stdarg.h>