Module Name: src
Committed By: ozaki-r
Date: Fri Nov 4 09:01:54 UTC 2022
Modified Files:
src/sys/dist/pf/net: pf.c
src/sys/netinet: dccp_usrreq.c in_pcb.c in_pcb.h portalgo.c
sctp_output.c tcp_input.c tcp_output.c tcp_subr.c tcp_syncache.c
tcp_usrreq.c
src/sys/netinet6: dccp6_usrreq.c in6_pcb.c in6_src.c raw_ip6.c
sctp6_usrreq.c udp6_usrreq.c
Log Message:
inpcb: rename functions to in6pcb_*
To generate a diff of this commit:
cvs rdiff -u -r1.86 -r1.87 src/sys/dist/pf/net/pf.c
cvs rdiff -u -r1.25 -r1.26 src/sys/netinet/dccp_usrreq.c
cvs rdiff -u -r1.195 -r1.196 src/sys/netinet/in_pcb.c
cvs rdiff -u -r1.74 -r1.75 src/sys/netinet/in_pcb.h
cvs rdiff -u -r1.14 -r1.15 src/sys/netinet/portalgo.c
cvs rdiff -u -r1.32 -r1.33 src/sys/netinet/sctp_output.c
cvs rdiff -u -r1.437 -r1.438 src/sys/netinet/tcp_input.c
cvs rdiff -u -r1.217 -r1.218 src/sys/netinet/tcp_output.c
cvs rdiff -u -r1.295 -r1.296 src/sys/netinet/tcp_subr.c
cvs rdiff -u -r1.5 -r1.6 src/sys/netinet/tcp_syncache.c
cvs rdiff -u -r1.237 -r1.238 src/sys/netinet/tcp_usrreq.c
cvs rdiff -u -r1.14 -r1.15 src/sys/netinet6/dccp6_usrreq.c
cvs rdiff -u -r1.174 -r1.175 src/sys/netinet6/in6_pcb.c
cvs rdiff -u -r1.90 -r1.91 src/sys/netinet6/in6_src.c
cvs rdiff -u -r1.181 -r1.182 src/sys/netinet6/raw_ip6.c
cvs rdiff -u -r1.23 -r1.24 src/sys/netinet6/sctp6_usrreq.c
cvs rdiff -u -r1.153 -r1.154 src/sys/netinet6/udp6_usrreq.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/sys/dist/pf/net/pf.c
diff -u src/sys/dist/pf/net/pf.c:1.86 src/sys/dist/pf/net/pf.c:1.87
--- src/sys/dist/pf/net/pf.c:1.86 Fri Nov 4 09:00:58 2022
+++ src/sys/dist/pf/net/pf.c Fri Nov 4 09:01:53 2022
@@ -1,4 +1,4 @@
-/* $NetBSD: pf.c,v 1.86 2022/11/04 09:00:58 ozaki-r Exp $ */
+/* $NetBSD: pf.c,v 1.87 2022/11/04 09:01:53 ozaki-r Exp $ */
/* $OpenBSD: pf.c,v 1.552.2.1 2007/11/27 16:37:57 henning Exp $ */
/*
@@ -37,7 +37,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: pf.c,v 1.86 2022/11/04 09:00:58 ozaki-r Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pf.c,v 1.87 2022/11/04 09:01:53 ozaki-r Exp $");
#include "pflog.h"
@@ -2802,11 +2802,11 @@ pf_socket_lookup(int direction, struct p
#define in_pcbhashlookup(tbl, saddr, sport, daddr, dport) \
inpcb_lookup(tbl, saddr, sport, daddr, dport, NULL)
#define in6_pcbhashlookup(tbl, saddr, sport, daddr, dport) \
- in6_pcblookup_connect(tbl, saddr, sport, daddr, dport, 0, NULL)
+ in6pcb_lookup(tbl, saddr, sport, daddr, dport, 0, NULL)
#define in_pcblookup_listen(tbl, addr, port, zero) \
inpcb_lookup_bound(tbl, addr, port)
#define in6_pcblookup_listen(tbl, addr, port, zero) \
- in6_pcblookup_bind(tbl, addr, port, zero)
+ in6pcb_lookup_bound(tbl, addr, port, zero)
#endif
#ifdef INET
Index: src/sys/netinet/dccp_usrreq.c
diff -u src/sys/netinet/dccp_usrreq.c:1.25 src/sys/netinet/dccp_usrreq.c:1.26
--- src/sys/netinet/dccp_usrreq.c:1.25 Fri Nov 4 09:00:58 2022
+++ src/sys/netinet/dccp_usrreq.c Fri Nov 4 09:01:53 2022
@@ -1,5 +1,5 @@
/* $KAME: dccp_usrreq.c,v 1.67 2005/11/03 16:05:04 nishida Exp $ */
-/* $NetBSD: dccp_usrreq.c,v 1.25 2022/11/04 09:00:58 ozaki-r Exp $ */
+/* $NetBSD: dccp_usrreq.c,v 1.26 2022/11/04 09:01:53 ozaki-r Exp $ */
/*
* Copyright (c) 2003 Joacim H�ggmark, Magnus Erixzon, Nils-Erik Mattsson
@@ -67,7 +67,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: dccp_usrreq.c,v 1.25 2022/11/04 09:00:58 ozaki-r Exp $");
+__KERNEL_RCSID(0, "$NetBSD: dccp_usrreq.c,v 1.26 2022/11/04 09:01:53 ozaki-r Exp $");
#ifdef _KERNEL_OPT
#include "opt_inet.h"
@@ -337,11 +337,11 @@ dccp_input(struct mbuf *m, int off, int
*/
#ifdef INET6
if (isipv6) {
- inp = in6_pcblookup_connect(&dccpbtable, &ip6->ip6_src,
+ inp = in6pcb_lookup(&dccpbtable, &ip6->ip6_src,
dh->dh_sport, &ip6->ip6_dst, dh->dh_dport, 0, 0);
if (inp == NULL) {
/* XXX stats increment? */
- inp = in6_pcblookup_bind(&dccpbtable, &ip6->ip6_dst,
+ inp = in6pcb_lookup_bound(&dccpbtable, &ip6->ip6_dst,
dh->dh_dport, 0);
}
} else
@@ -1779,8 +1779,8 @@ dccp_doconnect(struct socket *so, struct
if (inp->inp_lport == 0) {
#ifdef INET6
if (isipv6) {
- DCCP_DEBUG((LOG_INFO, "Running in6_pcbbind!\n"));
- error = in6_pcbbind(inp, NULL, l);
+ DCCP_DEBUG((LOG_INFO, "Running in6pcb_bind!\n"));
+ error = in6pcb_bind(inp, NULL, l);
} else
#endif /* INET6 */
{
@@ -1794,8 +1794,8 @@ dccp_doconnect(struct socket *so, struct
#ifdef INET6
if (isipv6) {
- error = in6_pcbconnect(inp, (struct sockaddr_in6 *)nam, l);
- DCCP_DEBUG((LOG_INFO, "in6_pcbconnect=%d\n",error));
+ error = in6pcb_connect(inp, (struct sockaddr_in6 *)nam, l);
+ DCCP_DEBUG((LOG_INFO, "in6pcb_connect=%d\n",error));
} else
#endif
error = inpcb_connect(inp, (struct sockaddr_in *)nam, l);
@@ -2133,7 +2133,7 @@ dccp_newdccpcb(int family, void *aux)
in4p_ip(inp).ip_ttl = ip_defttl;
break;
case PF_INET6:
- in6p_ip6(inp).ip6_hlim = in6_selecthlim_rt(inp);
+ in6p_ip6(inp).ip6_hlim = in6pcb_selecthlim_rt(inp);
break;
}
Index: src/sys/netinet/in_pcb.c
diff -u src/sys/netinet/in_pcb.c:1.195 src/sys/netinet/in_pcb.c:1.196
--- src/sys/netinet/in_pcb.c:1.195 Fri Nov 4 09:00:58 2022
+++ src/sys/netinet/in_pcb.c Fri Nov 4 09:01:53 2022
@@ -1,4 +1,4 @@
-/* $NetBSD: in_pcb.c,v 1.195 2022/11/04 09:00:58 ozaki-r Exp $ */
+/* $NetBSD: in_pcb.c,v 1.196 2022/11/04 09:01:53 ozaki-r Exp $ */
/*
* Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@@ -93,7 +93,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: in_pcb.c,v 1.195 2022/11/04 09:00:58 ozaki-r Exp $");
+__KERNEL_RCSID(0, "$NetBSD: in_pcb.c,v 1.196 2022/11/04 09:01:53 ozaki-r Exp $");
#ifdef _KERNEL_OPT
#include "opt_inet.h"
@@ -405,7 +405,7 @@ inpcb_bind_port(struct inpcb *inp, struc
#ifdef INET6
in6_in_2_v4mapin6(&sin->sin_addr, &mapped);
- t6 = in6_pcblookup_port(table, &mapped, sin->sin_port, wild, &vestige);
+ t6 = in6pcb_lookup_local(table, &mapped, sin->sin_port, wild, &vestige);
if (t6 && (reuseport & t6->inp_socket->so_options) == 0)
return (EADDRINUSE);
if (!t6 && vestige.valid) {
@@ -1119,7 +1119,7 @@ inpcb_set_state(struct inpcb *inp, int s
#ifdef INET6
if (inp->inp_af == AF_INET6) {
- in6_pcbstate(inp, state);
+ in6pcb_set_state(inp, state);
return;
}
#else
@@ -1158,7 +1158,7 @@ inpcb_rtentry(struct inpcb *inp)
#ifdef INET6
if (inp->inp_af == AF_INET6)
- return in6_pcbrtentry(inp);
+ return in6pcb_rtentry(inp);
#endif
if (inp->inp_af != AF_INET)
return (NULL);
Index: src/sys/netinet/in_pcb.h
diff -u src/sys/netinet/in_pcb.h:1.74 src/sys/netinet/in_pcb.h:1.75
--- src/sys/netinet/in_pcb.h:1.74 Fri Nov 4 09:00:58 2022
+++ src/sys/netinet/in_pcb.h Fri Nov 4 09:01:53 2022
@@ -1,4 +1,4 @@
-/* $NetBSD: in_pcb.h,v 1.74 2022/11/04 09:00:58 ozaki-r Exp $ */
+/* $NetBSD: in_pcb.h,v 1.75 2022/11/04 09:01:53 ozaki-r Exp $ */
/*
* Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@@ -284,36 +284,36 @@ struct rtentry *
inpcb_rtentry(struct inpcb *);
void inpcb_rtentry_unref(struct rtentry *, struct inpcb *);
-void in6_pcbinit(struct inpcbtable *, int, int);
-int in6_pcbbind(void *, struct sockaddr_in6 *, struct lwp *);
-int in6_pcbconnect(void *, struct sockaddr_in6 *, struct lwp *);
-void in6_pcbdetach(struct inpcb *);
-void in6_pcbdisconnect(struct inpcb *);
-struct inpcb *in6_pcblookup_port(struct inpcbtable *, struct in6_addr *,
+void in6pcb_init(struct inpcbtable *, int, int);
+int in6pcb_bind(void *, struct sockaddr_in6 *, struct lwp *);
+int in6pcb_connect(void *, struct sockaddr_in6 *, struct lwp *);
+void in6pcb_destroy(struct inpcb *);
+void in6pcb_disconnect(struct inpcb *);
+struct inpcb *in6pcb_lookup_local(struct inpcbtable *, struct in6_addr *,
u_int, int, struct vestigial_inpcb *);
-int in6_pcbnotify(struct inpcbtable *, const struct sockaddr *,
+int in6pcb_notify(struct inpcbtable *, const struct sockaddr *,
u_int, const struct sockaddr *, u_int, int, void *,
void (*)(struct inpcb *, int));
-void in6_pcbpurgeif0(struct inpcbtable *, struct ifnet *);
-void in6_pcbpurgeif(struct inpcbtable *, struct ifnet *);
-void in6_pcbstate(struct inpcb *, int);
-void in6_rtchange(struct inpcb *, int);
-void in6_setpeeraddr(struct inpcb *, struct sockaddr_in6 *);
-void in6_setsockaddr(struct inpcb *, struct sockaddr_in6 *);
+void in6pcb_purgeif0(struct inpcbtable *, struct ifnet *);
+void in6pcb_purgeif(struct inpcbtable *, struct ifnet *);
+void in6pcb_set_state(struct inpcb *, int);
+void in6pcb_rtchange(struct inpcb *, int);
+void in6pcb_fetch_peeraddr(struct inpcb *, struct sockaddr_in6 *);
+void in6pcb_fetch_sockaddr(struct inpcb *, struct sockaddr_in6 *);
/* in in6_src.c */
-int in6_selecthlim(struct inpcb *, struct ifnet *);
-int in6_selecthlim_rt(struct inpcb *);
-int in6_pcbsetport(struct sockaddr_in6 *, struct inpcb *, struct lwp *);
+int in6pcb_selecthlim(struct inpcb *, struct ifnet *);
+int in6pcb_selecthlim_rt(struct inpcb *);
+int in6pcb_set_port(struct sockaddr_in6 *, struct inpcb *, struct lwp *);
extern struct rtentry *
- in6_pcbrtentry(struct inpcb *);
+ in6pcb_rtentry(struct inpcb *);
extern void
- in6_pcbrtentry_unref(struct rtentry *, struct inpcb *);
-extern struct inpcb *in6_pcblookup_connect(struct inpcbtable *,
+ in6pcb_rtentry_unref(struct rtentry *, struct inpcb *);
+extern struct inpcb *in6pcb_lookup(struct inpcbtable *,
const struct in6_addr *, u_int, const struct in6_addr *, u_int, int,
struct vestigial_inpcb *);
-extern struct inpcb *in6_pcblookup_bind(struct inpcbtable *,
+extern struct inpcb *in6pcb_lookup_bound(struct inpcbtable *,
const struct in6_addr *, u_int, int);
static inline void
Index: src/sys/netinet/portalgo.c
diff -u src/sys/netinet/portalgo.c:1.14 src/sys/netinet/portalgo.c:1.15
--- src/sys/netinet/portalgo.c:1.14 Fri Nov 4 09:00:58 2022
+++ src/sys/netinet/portalgo.c Fri Nov 4 09:01:53 2022
@@ -1,4 +1,4 @@
-/* $NetBSD: portalgo.c,v 1.14 2022/11/04 09:00:58 ozaki-r Exp $ */
+/* $NetBSD: portalgo.c,v 1.15 2022/11/04 09:01:53 ozaki-r Exp $ */
/*
* Copyright 2011 Vlad Balan
@@ -34,7 +34,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: portalgo.c,v 1.14 2022/11/04 09:00:58 ozaki-r Exp $");
+__KERNEL_RCSID(0, "$NetBSD: portalgo.c,v 1.15 2022/11/04 09:01:53 ozaki-r Exp $");
#ifdef _KERNEL_OPT
#include "opt_inet.h"
@@ -307,7 +307,7 @@ check_suitable_port(uint16_t port, struc
sin6.sin6_addr = in6p_laddr(inp);
so = inp->inp_socket;
- /* XXX: this is redundant when called from in6_pcbbind */
+ /* XXX: this is redundant when called from in6pcb_bind */
if ((so->so_options & (SO_REUSEADDR|SO_REUSEPORT)) == 0 &&
((so->so_proto->pr_flags & PR_CONNREQUIRED) == 0 ||
(so->so_options & SO_ACCEPTCONN) == 0))
@@ -326,10 +326,10 @@ check_suitable_port(uint16_t port, struc
} else
#endif
{
- t = in6_pcblookup_port(table, &sin6.sin6_addr,
+ t = in6pcb_lookup_local(table, &sin6.sin6_addr,
htons(port), wild, &vestigial);
if (!t && vestigial.valid) {
- DPRINTF("%s in6_pcblookup_port returned "
+ DPRINTF("%s in6pcb_lookup_local returned "
"a result\n", __func__);
return false;
}
Index: src/sys/netinet/sctp_output.c
diff -u src/sys/netinet/sctp_output.c:1.32 src/sys/netinet/sctp_output.c:1.33
--- src/sys/netinet/sctp_output.c:1.32 Fri Oct 28 05:26:29 2022
+++ src/sys/netinet/sctp_output.c Fri Nov 4 09:01:53 2022
@@ -1,4 +1,4 @@
-/* $NetBSD: sctp_output.c,v 1.32 2022/10/28 05:26:29 ozaki-r Exp $ */
+/* $NetBSD: sctp_output.c,v 1.33 2022/11/04 09:01:53 ozaki-r Exp $ */
/* $KAME: sctp_output.c,v 1.48 2005/06/16 18:29:24 jinmei Exp $ */
/*
@@ -30,7 +30,7 @@
* SUCH DAMAGE.
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: sctp_output.c,v 1.32 2022/10/28 05:26:29 ozaki-r Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sctp_output.c,v 1.33 2022/11/04 09:01:53 ozaki-r Exp $");
#ifdef _KERNEL_OPT
#include "opt_ipsec.h"
@@ -2416,7 +2416,7 @@ sctp_lowlevel_chunk_output(struct sctp_i
* We set the hop limit now since there is a good chance that
* our ro pointer is now filled
*/
- ip6h->ip6_hlim = in6_selecthlim(&inp->ip_inp.inp,
+ ip6h->ip6_hlim = in6pcb_selecthlim(&inp->ip_inp.inp,
(ro ?
(rt ? (rt->rt_ifp) : (NULL)) :
(NULL)));
Index: src/sys/netinet/tcp_input.c
diff -u src/sys/netinet/tcp_input.c:1.437 src/sys/netinet/tcp_input.c:1.438
--- src/sys/netinet/tcp_input.c:1.437 Fri Nov 4 09:00:58 2022
+++ src/sys/netinet/tcp_input.c Fri Nov 4 09:01:53 2022
@@ -1,4 +1,4 @@
-/* $NetBSD: tcp_input.c,v 1.437 2022/11/04 09:00:58 ozaki-r Exp $ */
+/* $NetBSD: tcp_input.c,v 1.438 2022/11/04 09:01:53 ozaki-r Exp $ */
/*
* Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@@ -138,7 +138,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: tcp_input.c,v 1.437 2022/11/04 09:00:58 ozaki-r Exp $");
+__KERNEL_RCSID(0, "$NetBSD: tcp_input.c,v 1.438 2022/11/04 09:01:53 ozaki-r Exp $");
#ifdef _KERNEL_OPT
#include "opt_inet.h"
@@ -1381,11 +1381,11 @@ findpcb:
/* mapped addr case */
in6_in_2_v4mapin6(&ip->ip_src, &s);
in6_in_2_v4mapin6(&ip->ip_dst, &d);
- inp = in6_pcblookup_connect(&tcbtable, &s,
+ inp = in6pcb_lookup(&tcbtable, &s,
th->th_sport, &d, th->th_dport, 0, &vestige);
if (inp == NULL && !vestige.valid) {
TCP_STATINC(TCP_STAT_PCBHASHMISS);
- inp = in6_pcblookup_bind(&tcbtable, &d,
+ inp = in6pcb_lookup_bound(&tcbtable, &d,
th->th_dport, 0);
}
}
@@ -1416,11 +1416,11 @@ findpcb:
#else
faith = 0;
#endif
- inp = in6_pcblookup_connect(&tcbtable, &ip6->ip6_src,
+ inp = in6pcb_lookup(&tcbtable, &ip6->ip6_src,
th->th_sport, &ip6->ip6_dst, th->th_dport, faith, &vestige);
if (inp == NULL && !vestige.valid) {
TCP_STATINC(TCP_STAT_PCBHASHMISS);
- inp = in6_pcblookup_bind(&tcbtable, &ip6->ip6_dst,
+ inp = in6pcb_lookup_bound(&tcbtable, &ip6->ip6_dst,
th->th_dport, faith);
}
if (inp == NULL && !vestige.valid) {
Index: src/sys/netinet/tcp_output.c
diff -u src/sys/netinet/tcp_output.c:1.217 src/sys/netinet/tcp_output.c:1.218
--- src/sys/netinet/tcp_output.c:1.217 Fri Nov 4 09:00:58 2022
+++ src/sys/netinet/tcp_output.c Fri Nov 4 09:01:53 2022
@@ -1,4 +1,4 @@
-/* $NetBSD: tcp_output.c,v 1.217 2022/11/04 09:00:58 ozaki-r Exp $ */
+/* $NetBSD: tcp_output.c,v 1.218 2022/11/04 09:01:53 ozaki-r Exp $ */
/*
* Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@@ -135,7 +135,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: tcp_output.c,v 1.217 2022/11/04 09:00:58 ozaki-r Exp $");
+__KERNEL_RCSID(0, "$NetBSD: tcp_output.c,v 1.218 2022/11/04 09:01:53 ozaki-r Exp $");
#ifdef _KERNEL_OPT
#include "opt_inet.h"
@@ -1546,7 +1546,7 @@ timer:
}
#ifdef INET6
else if (tp->t_inpcb->inp_af == AF_INET6) {
- ip->ip_ttl = in6_selecthlim(tp->t_inpcb, NULL); /*XXX*/
+ ip->ip_ttl = in6pcb_selecthlim(tp->t_inpcb, NULL); /*XXX*/
ip->ip_tos = ecn_tos; /*XXX*/
}
#endif
@@ -1562,7 +1562,7 @@ timer:
* setsockopt. Also, desired default hop limit might
* be changed via Neighbor Discovery.
*/
- ip6->ip6_hlim = in6_selecthlim_rt(tp->t_inpcb);
+ ip6->ip6_hlim = in6pcb_selecthlim_rt(tp->t_inpcb);
}
ip6->ip6_flow |= htonl(ecn_tos << 20);
/* ip6->ip6_flow = ??? (from template) */
Index: src/sys/netinet/tcp_subr.c
diff -u src/sys/netinet/tcp_subr.c:1.295 src/sys/netinet/tcp_subr.c:1.296
--- src/sys/netinet/tcp_subr.c:1.295 Fri Nov 4 09:00:58 2022
+++ src/sys/netinet/tcp_subr.c Fri Nov 4 09:01:53 2022
@@ -1,4 +1,4 @@
-/* $NetBSD: tcp_subr.c,v 1.295 2022/11/04 09:00:58 ozaki-r Exp $ */
+/* $NetBSD: tcp_subr.c,v 1.296 2022/11/04 09:01:53 ozaki-r Exp $ */
/*
* Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@@ -91,7 +91,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: tcp_subr.c,v 1.295 2022/11/04 09:00:58 ozaki-r Exp $");
+__KERNEL_RCSID(0, "$NetBSD: tcp_subr.c,v 1.296 2022/11/04 09:01:53 ozaki-r Exp $");
#ifdef _KERNEL_OPT
#include "opt_inet.h"
@@ -807,7 +807,7 @@ tcp_respond(struct tcpcb *tp, struct mbu
tlen);
ip6->ip6_plen = htons(tlen);
if (tp && tp->t_inpcb->inp_af == AF_INET6)
- ip6->ip6_hlim = in6_selecthlim_rt(tp->t_inpcb);
+ ip6->ip6_hlim = in6pcb_selecthlim_rt(tp->t_inpcb);
else
ip6->ip6_hlim = ip6_defhlim;
ip6->ip6_flow &= ~IPV6_FLOWINFO_MASK;
@@ -975,7 +975,7 @@ tcp_newtcpcb(int family, struct inpcb *i
break;
#ifdef INET6
case AF_INET6:
- in6p_ip6(inp).ip6_hlim = in6_selecthlim_rt(inp);
+ in6p_ip6(inp).ip6_hlim = in6pcb_selecthlim_rt(inp);
inp->inp_ppcb = (void *)tp;
tp->t_inpcb = inp;
@@ -1295,7 +1295,7 @@ tcp6_ctlinput(int cmd, const struct sock
*/
return NULL;
} else if (PRC_IS_REDIRECT(cmd))
- notify = in6_rtchange, d = NULL;
+ notify = in6pcb_rtchange, d = NULL;
else if (cmd == PRC_MSGSIZE)
; /* special code is present, see below */
else if (cmd == PRC_HOSTDEAD)
@@ -1336,7 +1336,7 @@ tcp6_ctlinput(int cmd, const struct sock
* corresponding to the address in the ICMPv6 message
* payload.
*/
- if (in6_pcblookup_connect(&tcbtable, &sa6->sin6_addr,
+ if (in6pcb_lookup(&tcbtable, &sa6->sin6_addr,
th.th_dport,
(const struct in6_addr *)&sa6_src->sin6_addr,
th.th_sport, 0, 0))
@@ -1352,13 +1352,13 @@ tcp6_ctlinput(int cmd, const struct sock
icmp6_mtudisc_update((struct ip6ctlparam *)d, valid);
/*
- * no need to call in6_pcbnotify, it should have been
+ * no need to call in6pcb_notify, it should have been
* called via callback if necessary
*/
return NULL;
}
- nmatch = in6_pcbnotify(&tcbtable, sa, th.th_dport,
+ nmatch = in6pcb_notify(&tcbtable, sa, th.th_dport,
(const struct sockaddr *)sa6_src, th.th_sport, cmd, NULL, notify);
if (nmatch == 0 && syn_cache_count &&
(inet6ctlerrmap[cmd] == EHOSTUNREACH ||
@@ -1367,7 +1367,7 @@ tcp6_ctlinput(int cmd, const struct sock
syn_cache_unreach((const struct sockaddr *)sa6_src,
sa, &th);
} else {
- (void) in6_pcbnotify(&tcbtable, sa, 0,
+ (void) in6pcb_notify(&tcbtable, sa, 0,
(const struct sockaddr *)sa6_src, 0, cmd, NULL, notify);
}
@@ -1425,7 +1425,7 @@ tcp_ctlinput(int cmd, const struct socka
th->th_dport, ip->ip_src, th->th_sport, 0)) != NULL)
;
#ifdef INET6
- else if ((inp = in6_pcblookup_connect(&tcbtable, &dst6,
+ else if ((inp = in6pcb_lookup(&tcbtable, &dst6,
th->th_dport, &src6, th->th_sport, 0, 0)) != NULL)
;
#endif
@@ -1602,7 +1602,7 @@ tcp6_mtudisc_callback(struct in6_addr *f
sin6.sin6_family = AF_INET6;
sin6.sin6_len = sizeof(struct sockaddr_in6);
sin6.sin6_addr = *faddr;
- (void) in6_pcbnotify(&tcbtable, (struct sockaddr *)&sin6, 0,
+ (void) in6pcb_notify(&tcbtable, (struct sockaddr *)&sin6, 0,
(const struct sockaddr *)&sa6_any, 0, PRC_MSGSIZE, NULL, tcp6_mtudisc);
}
@@ -1615,15 +1615,15 @@ tcp6_mtudisc(struct inpcb *inp, int errn
if (tp == NULL)
return;
- rt = in6_pcbrtentry(inp);
+ rt = in6pcb_rtentry(inp);
if (rt != NULL) {
/*
* If this was not a host route, remove and realloc.
*/
if ((rt->rt_flags & RTF_HOST) == 0) {
- in6_pcbrtentry_unref(rt, inp);
- in6_rtchange(inp, errno);
- rt = in6_pcbrtentry(inp);
+ in6pcb_rtentry_unref(rt, inp);
+ in6pcb_rtchange(inp, errno);
+ rt = in6pcb_rtentry(inp);
if (rt == NULL)
return;
}
@@ -1640,7 +1640,7 @@ tcp6_mtudisc(struct inpcb *inp, int errn
tp->snd_cwnd = TCP_INITIAL_WINDOW(tcp_init_win,
rt->rt_rmx.rmx_mtu);
}
- in6_pcbrtentry_unref(rt, inp);
+ in6pcb_rtentry_unref(rt, inp);
}
/*
@@ -1869,7 +1869,7 @@ tcp_established(struct tcpcb *tp)
while (tp->t_inpcb->inp_af == AF_INET6) {
so = tp->t_inpcb->inp_socket;
#if defined(RTV_RPIPE)
- rt = in6_pcbrtentry(tp->t_inpcb);
+ rt = in6pcb_rtentry(tp->t_inpcb);
#endif
if (__predict_true(tcp_msl_enable)) {
extern const struct in6_addr in6addr_loopback;
Index: src/sys/netinet/tcp_syncache.c
diff -u src/sys/netinet/tcp_syncache.c:1.5 src/sys/netinet/tcp_syncache.c:1.6
--- src/sys/netinet/tcp_syncache.c:1.5 Fri Nov 4 09:00:58 2022
+++ src/sys/netinet/tcp_syncache.c Fri Nov 4 09:01:53 2022
@@ -1,4 +1,4 @@
-/* $NetBSD: tcp_syncache.c,v 1.5 2022/11/04 09:00:58 ozaki-r Exp $ */
+/* $NetBSD: tcp_syncache.c,v 1.6 2022/11/04 09:01:53 ozaki-r Exp $ */
/*
* Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@@ -148,7 +148,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: tcp_syncache.c,v 1.5 2022/11/04 09:00:58 ozaki-r Exp $");
+__KERNEL_RCSID(0, "$NetBSD: tcp_syncache.c,v 1.6 2022/11/04 09:01:53 ozaki-r Exp $");
#ifdef _KERNEL_OPT
#include "opt_inet.h"
@@ -683,7 +683,7 @@ syn_cache_get(struct sockaddr *src, stru
/* IPv4 packet to AF_INET6 socket */
in6_sin_2_v4mapsin6((struct sockaddr_in *)src, &sin6);
}
- if (in6_pcbconnect(inp, &sin6, NULL)) {
+ if (in6pcb_connect(inp, &sin6, NULL)) {
goto resetandabort;
}
}
@@ -1341,7 +1341,7 @@ syn_cache_respond(struct syn_cache *sc)
break;
#ifdef INET6
case AF_INET6:
- ip6->ip6_hlim = in6_selecthlim(NULL,
+ ip6->ip6_hlim = in6pcb_selecthlim(NULL,
(rt = rtcache_validate(ro)) != NULL ? rt->rt_ifp : NULL);
rtcache_unref(rt, ro);
Index: src/sys/netinet/tcp_usrreq.c
diff -u src/sys/netinet/tcp_usrreq.c:1.237 src/sys/netinet/tcp_usrreq.c:1.238
--- src/sys/netinet/tcp_usrreq.c:1.237 Fri Nov 4 09:00:58 2022
+++ src/sys/netinet/tcp_usrreq.c Fri Nov 4 09:01:53 2022
@@ -1,4 +1,4 @@
-/* $NetBSD: tcp_usrreq.c,v 1.237 2022/11/04 09:00:58 ozaki-r Exp $ */
+/* $NetBSD: tcp_usrreq.c,v 1.238 2022/11/04 09:01:53 ozaki-r Exp $ */
/*
* Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@@ -99,7 +99,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: tcp_usrreq.c,v 1.237 2022/11/04 09:00:58 ozaki-r Exp $");
+__KERNEL_RCSID(0, "$NetBSD: tcp_usrreq.c,v 1.238 2022/11/04 09:01:53 ozaki-r Exp $");
#ifdef _KERNEL_OPT
#include "opt_inet.h"
@@ -541,7 +541,7 @@ tcp_accept(struct socket *so, struct soc
}
#ifdef INET6
else if (inp->inp_af == AF_INET6) {
- in6_setpeeraddr(inp, (struct sockaddr_in6 *)nam);
+ in6pcb_fetch_peeraddr(inp, (struct sockaddr_in6 *)nam);
}
#endif
tcp_debug_trace(so, tp, ostate, PRU_ACCEPT);
@@ -580,7 +580,7 @@ tcp_bind(struct socket *so, struct socka
break;
#ifdef INET6
case PF_INET6:
- error = in6_pcbbind(inp, sin6, l);
+ error = in6pcb_bind(inp, sin6, l);
if (!error) {
/* mapped addr case */
if (IN6_IS_ADDR_V4MAPPED(&in6p_laddr(inp)))
@@ -624,7 +624,7 @@ tcp_listen(struct socket *so, struct lwp
}
#ifdef INET6
if (inp->inp_af == AF_INET6 && inp->inp_lport == 0) {
- error = in6_pcbbind(inp, NULL, l);
+ error = in6pcb_bind(inp, NULL, l);
if (error)
goto release;
}
@@ -674,11 +674,11 @@ tcp_connect(struct socket *so, struct so
#ifdef INET6
if (inp->inp_af == AF_INET6) {
if (inp->inp_lport == 0) {
- error = in6_pcbbind(inp, NULL, l);
+ error = in6pcb_bind(inp, NULL, l);
if (error)
goto release;
}
- error = in6_pcbconnect(inp, (struct sockaddr_in6 *)nam, l);
+ error = in6pcb_connect(inp, (struct sockaddr_in6 *)nam, l);
if (!error) {
/* mapped addr case */
if (IN6_IS_ADDR_V4MAPPED(&in6p_faddr(inp)))
@@ -696,7 +696,7 @@ tcp_connect(struct socket *so, struct so
inpcb_disconnect(inp);
#ifdef INET6
else if (inp->inp_af == AF_INET6)
- in6_pcbdisconnect(inp);
+ in6pcb_disconnect(inp);
#endif
error = ENOBUFS;
goto release;
@@ -880,7 +880,7 @@ tcp_peeraddr(struct socket *so, struct s
}
#ifdef INET6
else if (inp->inp_af == AF_INET6) {
- in6_setpeeraddr(inp, (struct sockaddr_in6 *)nam);
+ in6pcb_fetch_peeraddr(inp, (struct sockaddr_in6 *)nam);
}
#endif
tcp_debug_trace(so, tp, ostate, PRU_PEERADDR);
@@ -910,7 +910,7 @@ tcp_sockaddr(struct socket *so, struct s
}
#ifdef INET6
if (inp->inp_af == AF_INET6) {
- in6_setsockaddr(inp, (struct sockaddr_in6 *)nam);
+ in6pcb_fetch_sockaddr(inp, (struct sockaddr_in6 *)nam);
}
#endif
tcp_debug_trace(so, tp, ostate, PRU_SOCKADDR);
@@ -1112,7 +1112,7 @@ tcp_purgeif(struct socket *so, struct if
break;
#ifdef INET6
case PF_INET6:
- in6_pcbpurgeif0(&tcbtable, ifp);
+ in6pcb_purgeif0(&tcbtable, ifp);
#ifdef NET_MPSAFE
mutex_exit(softnet_lock);
#endif
@@ -1120,7 +1120,7 @@ tcp_purgeif(struct socket *so, struct if
#ifdef NET_MPSAFE
mutex_enter(softnet_lock);
#endif
- in6_pcbpurgeif(&tcbtable, ifp);
+ in6pcb_purgeif(&tcbtable, ifp);
break;
#endif
default:
@@ -1454,7 +1454,7 @@ inet6_ident_core(struct in6_addr *raddr,
struct inpcb *inp;
struct socket *sockp;
- inp = in6_pcblookup_connect(&tcbtable, raddr, rport, laddr, lport, 0, 0);
+ inp = in6pcb_lookup(&tcbtable, raddr, rport, laddr, lport, 0, 0);
if (inp == NULL || (sockp = inp->inp_socket) == NULL)
return ESRCH;
Index: src/sys/netinet6/dccp6_usrreq.c
diff -u src/sys/netinet6/dccp6_usrreq.c:1.14 src/sys/netinet6/dccp6_usrreq.c:1.15
--- src/sys/netinet6/dccp6_usrreq.c:1.14 Fri Oct 28 05:26:29 2022
+++ src/sys/netinet6/dccp6_usrreq.c Fri Nov 4 09:01:53 2022
@@ -1,5 +1,5 @@
/* $KAME: dccp6_usrreq.c,v 1.13 2005/07/27 08:42:56 nishida Exp $ */
-/* $NetBSD: dccp6_usrreq.c,v 1.14 2022/10/28 05:26:29 ozaki-r Exp $ */
+/* $NetBSD: dccp6_usrreq.c,v 1.15 2022/11/04 09:01:53 ozaki-r Exp $ */
/*
* Copyright (C) 2003 WIDE Project.
@@ -31,7 +31,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: dccp6_usrreq.c,v 1.14 2022/10/28 05:26:29 ozaki-r Exp $");
+__KERNEL_RCSID(0, "$NetBSD: dccp6_usrreq.c,v 1.15 2022/11/04 09:01:53 ozaki-r Exp $");
#ifdef _KERNEL_OPT
#include "opt_inet.h"
@@ -137,7 +137,7 @@ dccp6_bind(struct socket *so, struct soc
intodccpcb(inp)->inp_vflag &= ~INP_IPV4;
intodccpcb(inp)->inp_vflag |= INP_IPV6;
- error = in6_pcbbind(inp, sinp, td);
+ error = in6pcb_bind(inp, sinp, td);
INP_UNLOCK(inp);
INP_INFO_WUNLOCK(&dccpbinfo);
return error;
@@ -249,7 +249,7 @@ dccp6_listen(struct socket *so, struct l
dp = intodccpcb(inp);
DCCP_DEBUG((LOG_INFO, "Checking inp->inp_lport!\n"));
if (inp->inp_lport == 0) {
- error = in6_pcbbind(inp, NULL, l);
+ error = in6pcb_bind(inp, NULL, l);
}
if (error == 0) {
dp->state = DCCPS_LISTEN;
@@ -283,7 +283,7 @@ dccp6_accept(struct socket *so, struct s
}
INP_LOCK(inp);
INP_INFO_RUNLOCK(&dccpbinfo);
- in6_setpeeraddr(inp, (struct sockaddr_in6 *)nam);
+ in6pcb_fetch_peeraddr(inp, (struct sockaddr_in6 *)nam);
INP_UNLOCK(inp);
return error;
@@ -319,7 +319,7 @@ dccp6_purgeif(struct socket *so, struct
s = splsoftnet();
mutex_enter(softnet_lock);
- in6_pcbpurgeif0(&dccpbtable, ifp);
+ in6pcb_purgeif0(&dccpbtable, ifp);
#ifdef NET_MPSAFE
mutex_exit(softnet_lock);
#endif
@@ -327,7 +327,7 @@ dccp6_purgeif(struct socket *so, struct
#ifdef NET_MPSAFE
mutex_enter(softnet_lock);
#endif
- in6_pcbpurgeif(&dccpbtable, ifp);
+ in6pcb_purgeif(&dccpbtable, ifp);
mutex_exit(softnet_lock);
splx(s);
@@ -380,7 +380,7 @@ dccp6_peeraddr(struct socket *so, struct
KASSERT(sotoinpcb(so) != NULL);
KASSERT(nam != NULL);
- in6_setpeeraddr(sotoinpcb(so), (struct sockaddr_in6 *)nam);
+ in6pcb_fetch_peeraddr(sotoinpcb(so), (struct sockaddr_in6 *)nam);
return 0;
}
@@ -391,7 +391,7 @@ dccp6_sockaddr(struct socket *so, struct
KASSERT(sotoinpcb(so) != NULL);
KASSERT(nam != NULL);
- in6_setsockaddr(sotoinpcb(so), (struct sockaddr_in6 *)nam);
+ in6pcb_fetch_sockaddr(sotoinpcb(so), (struct sockaddr_in6 *)nam);
return 0;
}
Index: src/sys/netinet6/in6_pcb.c
diff -u src/sys/netinet6/in6_pcb.c:1.174 src/sys/netinet6/in6_pcb.c:1.175
--- src/sys/netinet6/in6_pcb.c:1.174 Fri Nov 4 09:00:58 2022
+++ src/sys/netinet6/in6_pcb.c Fri Nov 4 09:01:53 2022
@@ -1,4 +1,4 @@
-/* $NetBSD: in6_pcb.c,v 1.174 2022/11/04 09:00:58 ozaki-r Exp $ */
+/* $NetBSD: in6_pcb.c,v 1.175 2022/11/04 09:01:53 ozaki-r Exp $ */
/* $KAME: in6_pcb.c,v 1.84 2001/02/08 18:02:08 itojun Exp $ */
/*
@@ -62,7 +62,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: in6_pcb.c,v 1.174 2022/11/04 09:00:58 ozaki-r Exp $");
+__KERNEL_RCSID(0, "$NetBSD: in6_pcb.c,v 1.175 2022/11/04 09:01:53 ozaki-r Exp $");
#ifdef _KERNEL_OPT
#include "opt_inet.h"
@@ -130,7 +130,7 @@ int ip6_lowportmin = IPV6PORT_RESERVEDM
int ip6_lowportmax = IPV6PORT_RESERVEDMAX;
void
-in6_pcbinit(struct inpcbtable *table, int bindhashsize, int connecthashsize)
+in6pcb_init(struct inpcbtable *table, int bindhashsize, int connecthashsize)
{
inpcb_init(table, bindhashsize, connecthashsize);
@@ -141,7 +141,7 @@ in6_pcbinit(struct inpcbtable *table, in
* Bind address from sin6 to inp.
*/
static int
-in6_pcbbind_addr(struct inpcb *inp, struct sockaddr_in6 *sin6, struct lwp *l)
+in6pcb_bind_addr(struct inpcb *inp, struct sockaddr_in6 *sin6, struct lwp *l)
{
int error;
int s;
@@ -230,7 +230,7 @@ out:
* Bind port from sin6 to inp.
*/
static int
-in6_pcbbind_port(struct inpcb *inp, struct sockaddr_in6 *sin6, struct lwp *l)
+in6pcb_bind_port(struct inpcb *inp, struct sockaddr_in6 *sin6, struct lwp *l)
{
struct inpcbtable *table = inp->inp_table;
struct socket *so = inp->inp_socket;
@@ -294,7 +294,7 @@ in6_pcbbind_port(struct inpcb *inp, stru
struct inpcb *t;
struct vestigial_inpcb vestige;
- t = in6_pcblookup_port(table, &sin6->sin6_addr,
+ t = in6pcb_lookup_local(table, &sin6->sin6_addr,
sin6->sin6_port, wild, &vestige);
if (t && (reuseport & t->inp_socket->so_options) == 0)
return (EADDRINUSE);
@@ -307,7 +307,7 @@ in6_pcbbind_port(struct inpcb *inp, stru
if (sin6->sin6_port == 0) {
int e;
- e = in6_pcbsetport(sin6, inp, l);
+ e = in6pcb_set_port(sin6, inp, l);
if (e != 0)
return (e);
} else {
@@ -323,7 +323,7 @@ in6_pcbbind_port(struct inpcb *inp, stru
}
int
-in6_pcbbind(void *v, struct sockaddr_in6 *sin6, struct lwp *l)
+in6pcb_bind(void *v, struct sockaddr_in6 *sin6, struct lwp *l)
{
struct inpcb *inp = v;
struct sockaddr_in6 lsin6;
@@ -353,12 +353,12 @@ in6_pcbbind(void *v, struct sockaddr_in6
}
/* Bind address. */
- error = in6_pcbbind_addr(inp, sin6, l);
+ error = in6pcb_bind_addr(inp, sin6, l);
if (error)
return (error);
/* Bind port. */
- error = in6_pcbbind_port(inp, sin6, l);
+ error = in6pcb_bind_port(inp, sin6, l);
if (error) {
/*
* Reset the address here to "any" so we don't "leak" the
@@ -383,7 +383,7 @@ in6_pcbbind(void *v, struct sockaddr_in6
* then pick one.
*/
int
-in6_pcbconnect(void *v, struct sockaddr_in6 *sin6, struct lwp *l)
+in6pcb_connect(void *v, struct sockaddr_in6 *sin6, struct lwp *l)
{
struct inpcb *inp = v;
struct in6_addr *in6a = NULL;
@@ -498,13 +498,13 @@ in6_pcbconnect(void *v, struct sockaddr_
}
if (ifp != NULL) {
- in6p_ip6(inp).ip6_hlim = (u_int8_t)in6_selecthlim(inp, ifp);
+ in6p_ip6(inp).ip6_hlim = (u_int8_t)in6pcb_selecthlim(inp, ifp);
if_put(ifp, &psref);
} else
- in6p_ip6(inp).ip6_hlim = (u_int8_t)in6_selecthlim_rt(inp);
+ in6p_ip6(inp).ip6_hlim = (u_int8_t)in6pcb_selecthlim_rt(inp);
curlwp_bindx(bound);
- if (in6_pcblookup_connect(inp->inp_table, &sin6->sin6_addr,
+ if (in6pcb_lookup(inp->inp_table, &sin6->sin6_addr,
sin6->sin6_port,
IN6_IS_ADDR_UNSPECIFIED(&in6p_laddr(inp)) ? in6a : &in6p_laddr(inp),
inp->inp_lport, 0, &vestige)
@@ -515,7 +515,7 @@ in6_pcbconnect(void *v, struct sockaddr_
in6p_laddr(inp).s6_addr32[3] == 0))
{
if (inp->inp_lport == 0) {
- error = in6_pcbbind(inp, NULL, l);
+ error = in6pcb_bind(inp, NULL, l);
if (error != 0)
return error;
}
@@ -531,7 +531,7 @@ in6_pcbconnect(void *v, struct sockaddr_
lsin.sin6_addr = in6p_laddr(inp);
lsin.sin6_port = 0;
- if ((error = in6_pcbbind_port(inp, &lsin, l)) != 0)
+ if ((error = in6pcb_bind_port(inp, &lsin, l)) != 0)
return error;
}
@@ -548,7 +548,7 @@ in6_pcbconnect(void *v, struct sockaddr_
}
void
-in6_pcbdisconnect(struct inpcb *inp)
+in6pcb_disconnect(struct inpcb *inp)
{
memset((void *)&in6p_faddr(inp), 0, sizeof(in6p_faddr(inp)));
inp->inp_fport = 0;
@@ -563,7 +563,7 @@ in6_pcbdisconnect(struct inpcb *inp)
}
void
-in6_setsockaddr(struct inpcb *inp, struct sockaddr_in6 *sin6)
+in6pcb_fetch_sockaddr(struct inpcb *inp, struct sockaddr_in6 *sin6)
{
if (inp->inp_af != AF_INET6)
@@ -574,7 +574,7 @@ in6_setsockaddr(struct inpcb *inp, struc
}
void
-in6_setpeeraddr(struct inpcb *inp, struct sockaddr_in6 *sin6)
+in6pcb_fetch_peeraddr(struct inpcb *inp, struct sockaddr_in6 *sin6)
{
if (inp->inp_af != AF_INET6)
@@ -599,7 +599,7 @@ in6_setpeeraddr(struct inpcb *inp, struc
* header, in sin6_flowinfo member.
*/
int
-in6_pcbnotify(struct inpcbtable *table, const struct sockaddr *dst,
+in6pcb_notify(struct inpcbtable *table, const struct sockaddr *dst,
u_int fport_arg, const struct sockaddr *src, u_int lport_arg, int cmd,
void *cmdarg, void (*notify)(struct inpcb *, int))
{
@@ -626,8 +626,8 @@ in6_pcbnotify(struct inpcbtable *table,
/*
* Redirects go to all references to the destination,
- * and use in6_rtchange to invalidate the route cache.
- * Dead host indications: also use in6_rtchange to invalidate
+ * and use in6pcb_rtchange to invalidate the route cache.
+ * Dead host indications: also use in6pcb_rtchange to invalidate
* the cache, and deliver the error to all the sockets.
* Otherwise, if we have knowledge of the local port and address,
* deliver only to that socket.
@@ -638,7 +638,7 @@ in6_pcbnotify(struct inpcbtable *table,
memset((void *)&sa6_src.sin6_addr, 0, sizeof(sa6_src.sin6_addr));
if (cmd != PRC_HOSTDEAD)
- notify = in6_rtchange;
+ notify = in6pcb_rtchange;
}
errno = inet6ctlerrmap[cmd];
@@ -745,7 +745,7 @@ in6_pcbnotify(struct inpcbtable *table,
}
void
-in6_pcbpurgeif0(struct inpcbtable *table, struct ifnet *ifp)
+in6pcb_purgeif0(struct inpcbtable *table, struct ifnet *ifp)
{
struct inpcb *inp;
struct ip6_moptions *im6o;
@@ -795,7 +795,7 @@ in6_pcbpurgeif0(struct inpcbtable *table
}
void
-in6_pcbpurgeif(struct inpcbtable *table, struct ifnet *ifp)
+in6pcb_purgeif(struct inpcbtable *table, struct ifnet *ifp)
{
struct rtentry *rt;
struct inpcb *inp;
@@ -806,7 +806,7 @@ in6_pcbpurgeif(struct inpcbtable *table,
if ((rt = rtcache_validate(&inp->inp_route)) != NULL &&
rt->rt_ifp == ifp) {
rtcache_unref(rt, &inp->inp_route);
- in6_rtchange(inp, 0);
+ in6pcb_rtchange(inp, 0);
} else
rtcache_unref(rt, &inp->inp_route);
}
@@ -817,7 +817,7 @@ in6_pcbpurgeif(struct inpcbtable *table,
* allocated the next time output is attempted.
*/
void
-in6_rtchange(struct inpcb *inp, int errno)
+in6pcb_rtchange(struct inpcb *inp, int errno)
{
if (inp->inp_af != AF_INET6)
return;
@@ -830,7 +830,7 @@ in6_rtchange(struct inpcb *inp, int errn
}
struct inpcb *
-in6_pcblookup_port(struct inpcbtable *table, struct in6_addr *laddr6,
+in6pcb_lookup_local(struct inpcbtable *table, struct in6_addr *laddr6,
u_int lport_arg, int lookup_wildcard, struct vestigial_inpcb *vp)
{
struct inpcbhead *head;
@@ -966,7 +966,7 @@ in6_pcblookup_port(struct inpcbtable *ta
* IPv4 mapped address.
*/
struct rtentry *
-in6_pcbrtentry(struct inpcb *inp)
+in6pcb_rtentry(struct inpcb *inp)
{
struct rtentry *rt;
struct route *ro;
@@ -1033,14 +1033,14 @@ in6_pcbrtentry(struct inpcb *inp)
}
void
-in6_pcbrtentry_unref(struct rtentry *rt, struct inpcb *inp)
+in6pcb_rtentry_unref(struct rtentry *rt, struct inpcb *inp)
{
rtcache_unref(rt, &inp->inp_route);
}
struct inpcb *
-in6_pcblookup_connect(struct inpcbtable *table, const struct in6_addr *faddr6,
+in6pcb_lookup(struct inpcbtable *table, const struct in6_addr *faddr6,
u_int fport_arg, const struct in6_addr *laddr6, u_int lport_arg,
int faith,
struct vestigial_inpcb *vp)
@@ -1086,7 +1086,7 @@ in6_pcblookup_connect(struct inpcbtable
}
struct inpcb *
-in6_pcblookup_bind(struct inpcbtable *table, const struct in6_addr *laddr6,
+in6pcb_lookup_bound(struct inpcbtable *table, const struct in6_addr *laddr6,
u_int lport_arg, int faith)
{
struct inpcbhead *head;
@@ -1163,7 +1163,7 @@ out:
}
void
-in6_pcbstate(struct inpcb *inp, int state)
+in6pcb_set_state(struct inpcb *inp, int state)
{
if (inp->inp_af != AF_INET6)
Index: src/sys/netinet6/in6_src.c
diff -u src/sys/netinet6/in6_src.c:1.90 src/sys/netinet6/in6_src.c:1.91
--- src/sys/netinet6/in6_src.c:1.90 Fri Oct 28 05:25:36 2022
+++ src/sys/netinet6/in6_src.c Fri Nov 4 09:01:53 2022
@@ -1,4 +1,4 @@
-/* $NetBSD: in6_src.c,v 1.90 2022/10/28 05:25:36 ozaki-r Exp $ */
+/* $NetBSD: in6_src.c,v 1.91 2022/11/04 09:01:53 ozaki-r Exp $ */
/* $KAME: in6_src.c,v 1.159 2005/10/19 01:40:32 t-momose Exp $ */
/*
@@ -66,7 +66,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: in6_src.c,v 1.90 2022/10/28 05:25:36 ozaki-r Exp $");
+__KERNEL_RCSID(0, "$NetBSD: in6_src.c,v 1.91 2022/11/04 09:01:53 ozaki-r Exp $");
#ifdef _KERNEL_OPT
#include "opt_inet.h"
@@ -809,7 +809,7 @@ out:
* 3. The system default hoplimit.
*/
int
-in6_selecthlim(struct inpcb *inp, struct ifnet *ifp)
+in6pcb_selecthlim(struct inpcb *inp, struct ifnet *ifp)
{
if (inp && in6p_hops6(inp) >= 0)
return in6p_hops6(inp);
@@ -820,27 +820,27 @@ in6_selecthlim(struct inpcb *inp, struct
}
int
-in6_selecthlim_rt(struct inpcb *inp)
+in6pcb_selecthlim_rt(struct inpcb *inp)
{
struct rtentry *rt;
if (inp == NULL)
- return in6_selecthlim(inp, NULL);
+ return in6pcb_selecthlim(inp, NULL);
rt = rtcache_validate(&inp->inp_route);
if (rt != NULL) {
- int ret = in6_selecthlim(inp, rt->rt_ifp);
+ int ret = in6pcb_selecthlim(inp, rt->rt_ifp);
rtcache_unref(rt, &inp->inp_route);
return ret;
} else
- return in6_selecthlim(inp, NULL);
+ return in6pcb_selecthlim(inp, NULL);
}
/*
* Find an empty port and set it to the specified PCB.
*/
int
-in6_pcbsetport(struct sockaddr_in6 *sin6, struct inpcb *inp, struct lwp *l)
+in6pcb_set_port(struct sockaddr_in6 *sin6, struct inpcb *inp, struct lwp *l)
{
struct socket *so = inp->inp_socket;
struct inpcbtable *table = inp->inp_table;
@@ -877,7 +877,7 @@ in6_pcbsetport(struct sockaddr_in6 *sin6
inp->inp_flags |= IN6P_ANONPORT;
*lastport = lport;
inp->inp_lport = htons(lport);
- in6_pcbstate(inp, INP_BOUND);
+ in6pcb_set_state(inp, INP_BOUND);
return (0); /* success */
}
Index: src/sys/netinet6/raw_ip6.c
diff -u src/sys/netinet6/raw_ip6.c:1.181 src/sys/netinet6/raw_ip6.c:1.182
--- src/sys/netinet6/raw_ip6.c:1.181 Fri Nov 4 09:00:58 2022
+++ src/sys/netinet6/raw_ip6.c Fri Nov 4 09:01:53 2022
@@ -1,4 +1,4 @@
-/* $NetBSD: raw_ip6.c,v 1.181 2022/11/04 09:00:58 ozaki-r Exp $ */
+/* $NetBSD: raw_ip6.c,v 1.182 2022/11/04 09:01:53 ozaki-r Exp $ */
/* $KAME: raw_ip6.c,v 1.82 2001/07/23 18:57:56 jinmei Exp $ */
/*
@@ -62,7 +62,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: raw_ip6.c,v 1.181 2022/11/04 09:00:58 ozaki-r Exp $");
+__KERNEL_RCSID(0, "$NetBSD: raw_ip6.c,v 1.182 2022/11/04 09:01:53 ozaki-r Exp $");
#ifdef _KERNEL_OPT
#include "opt_ipsec.h"
@@ -129,7 +129,7 @@ rip6_init(void)
{
sysctl_net_inet6_raw6_setup(NULL);
- in6_pcbinit(&raw6cbtable, 1, 1);
+ in6pcb_init(&raw6cbtable, 1, 1);
rip6stat_percpu = percpu_alloc(sizeof(uint64_t) * RIP6_NSTATS);
}
@@ -262,7 +262,7 @@ rip6_ctlinput(int cmd, const struct sock
struct ip6ctlparam *ip6cp = NULL;
const struct sockaddr_in6 *sa6_src = NULL;
void *cmdarg;
- void (*notify)(struct inpcb *, int) = in6_rtchange;
+ void (*notify)(struct inpcb *, int) = in6pcb_rtchange;
int nxt;
if (sa->sa_family != AF_INET6 ||
@@ -272,7 +272,7 @@ rip6_ctlinput(int cmd, const struct sock
if ((unsigned)cmd >= PRC_NCMDS)
return NULL;
if (PRC_IS_REDIRECT(cmd))
- notify = in6_rtchange, d = NULL;
+ notify = in6pcb_rtchange, d = NULL;
else if (cmd == PRC_HOSTDEAD)
d = NULL;
else if (cmd == PRC_MSGSIZE)
@@ -307,7 +307,7 @@ rip6_ctlinput(int cmd, const struct sock
* from icmp6_notify_error()
*/
inp = NULL;
- inp = in6_pcblookup_connect(&raw6cbtable, &sa6->sin6_addr, 0,
+ inp = in6pcb_lookup(&raw6cbtable, &sa6->sin6_addr, 0,
(const struct in6_addr *)&sa6_src->sin6_addr, 0, 0, 0);
#if 0
if (!inp) {
@@ -318,7 +318,7 @@ rip6_ctlinput(int cmd, const struct sock
* We should at least check if the local
* address (= s) is really ours.
*/
- inp = in6_pcblookup_bind(&raw6cbtable,
+ inp = in6pcb_lookup_bound(&raw6cbtable,
&sa6->sin6_addr, 0, 0);
}
#endif
@@ -338,14 +338,14 @@ rip6_ctlinput(int cmd, const struct sock
/*
* regardless of if we called icmp6_mtudisc_update(),
- * we need to call in6_pcbnotify(), to notify path MTU
+ * we need to call in6pcb_notify(), to notify path MTU
* change to the userland (RFC3542), because some
* unconnected sockets may share the same destination
* and want to know the path MTU.
*/
}
- (void) in6_pcbnotify(&raw6cbtable, sa, 0,
+ (void) in6pcb_notify(&raw6cbtable, sa, 0,
sin6tocsa(sa6_src), 0, cmd, cmdarg, notify);
return NULL;
}
@@ -454,7 +454,7 @@ rip6_output(struct mbuf *m, struct socke
ip6->ip6_vfc |= IPV6_VERSION;
/* ip6_plen will be filled in ip6_output, so not fill it here. */
ip6->ip6_nxt = in6p_ip6(inp).ip6_nxt;
- ip6->ip6_hlim = in6_selecthlim(inp, oifp);
+ ip6->ip6_hlim = in6pcb_selecthlim(inp, oifp);
if_put(oifp, &psref);
oifp = NULL;
@@ -819,7 +819,7 @@ rip6_peeraddr(struct socket *so, struct
KASSERT(sotoinpcb(so) != NULL);
KASSERT(nam != NULL);
- in6_setpeeraddr(sotoinpcb(so), (struct sockaddr_in6 *)nam);
+ in6pcb_fetch_peeraddr(sotoinpcb(so), (struct sockaddr_in6 *)nam);
return 0;
}
@@ -830,7 +830,7 @@ rip6_sockaddr(struct socket *so, struct
KASSERT(sotoinpcb(so) != NULL);
KASSERT(nam != NULL);
- in6_setsockaddr(sotoinpcb(so), (struct sockaddr_in6 *)nam);
+ in6pcb_fetch_sockaddr(sotoinpcb(so), (struct sockaddr_in6 *)nam);
return 0;
}
@@ -920,7 +920,7 @@ rip6_purgeif(struct socket *so, struct i
{
mutex_enter(softnet_lock);
- in6_pcbpurgeif0(&raw6cbtable, ifp);
+ in6pcb_purgeif0(&raw6cbtable, ifp);
#ifdef NET_MPSAFE
mutex_exit(softnet_lock);
#endif
@@ -928,7 +928,7 @@ rip6_purgeif(struct socket *so, struct i
#ifdef NET_MPSAFE
mutex_enter(softnet_lock);
#endif
- in6_pcbpurgeif(&raw6cbtable, ifp);
+ in6pcb_purgeif(&raw6cbtable, ifp);
mutex_exit(softnet_lock);
return 0;
Index: src/sys/netinet6/sctp6_usrreq.c
diff -u src/sys/netinet6/sctp6_usrreq.c:1.23 src/sys/netinet6/sctp6_usrreq.c:1.24
--- src/sys/netinet6/sctp6_usrreq.c:1.23 Fri Oct 28 05:26:29 2022
+++ src/sys/netinet6/sctp6_usrreq.c Fri Nov 4 09:01:53 2022
@@ -1,5 +1,5 @@
/* $KAME: sctp6_usrreq.c,v 1.38 2005/08/24 08:08:56 suz Exp $ */
-/* $NetBSD: sctp6_usrreq.c,v 1.23 2022/10/28 05:26:29 ozaki-r Exp $ */
+/* $NetBSD: sctp6_usrreq.c,v 1.24 2022/11/04 09:01:53 ozaki-r Exp $ */
/*
* Copyright (c) 2001, 2002, 2003, 2004 Cisco Systems, Inc.
@@ -33,7 +33,7 @@
* SUCH DAMAGE.
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: sctp6_usrreq.c,v 1.23 2022/10/28 05:26:29 ozaki-r Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sctp6_usrreq.c,v 1.24 2022/11/04 09:01:53 ozaki-r Exp $");
#ifdef _KERNEL_OPT
#include "opt_inet.h"
@@ -483,7 +483,7 @@ sctp6_ctlinput(int cmd, const struct soc
}
} else {
if (PRC_IS_REDIRECT(cmd) && inp) {
- in6_rtchange((struct inpcb *)inp, inet6ctlerrmap[cmd]);
+ in6pcb_rtchange((struct inpcb *)inp, inet6ctlerrmap[cmd]);
}
if (inp) {
/* reduce inp's ref-count */
Index: src/sys/netinet6/udp6_usrreq.c
diff -u src/sys/netinet6/udp6_usrreq.c:1.153 src/sys/netinet6/udp6_usrreq.c:1.154
--- src/sys/netinet6/udp6_usrreq.c:1.153 Fri Nov 4 09:00:58 2022
+++ src/sys/netinet6/udp6_usrreq.c Fri Nov 4 09:01:53 2022
@@ -1,4 +1,4 @@
-/* $NetBSD: udp6_usrreq.c,v 1.153 2022/11/04 09:00:58 ozaki-r Exp $ */
+/* $NetBSD: udp6_usrreq.c,v 1.154 2022/11/04 09:01:53 ozaki-r Exp $ */
/* $KAME: udp6_usrreq.c,v 1.86 2001/05/27 17:33:00 itojun Exp $ */
/* $KAME: udp6_output.c,v 1.43 2001/10/15 09:19:52 itojun Exp $ */
@@ -63,7 +63,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: udp6_usrreq.c,v 1.153 2022/11/04 09:00:58 ozaki-r Exp $");
+__KERNEL_RCSID(0, "$NetBSD: udp6_usrreq.c,v 1.154 2022/11/04 09:01:53 ozaki-r Exp $");
#ifdef _KERNEL_OPT
#include "opt_inet.h"
@@ -206,12 +206,12 @@ udp6_ctlinput(int cmd, const struct sock
if ((unsigned)cmd >= PRC_NCMDS)
return NULL;
if (PRC_IS_REDIRECT(cmd))
- notify = in6_rtchange, d = NULL;
+ notify = in6pcb_rtchange, d = NULL;
else if (cmd == PRC_HOSTDEAD)
d = NULL;
else if (cmd == PRC_MSGSIZE) {
/* special code is present, see below */
- notify = in6_rtchange;
+ notify = in6pcb_rtchange;
}
else if (inet6ctlerrmap[cmd] == 0)
return NULL;
@@ -251,7 +251,7 @@ udp6_ctlinput(int cmd, const struct sock
* corresponding to the address in the ICMPv6 message
* payload.
*/
- if (in6_pcblookup_connect(&udbtable, &sa6->sin6_addr,
+ if (in6pcb_lookup(&udbtable, &sa6->sin6_addr,
uh.uh_dport, (const struct in6_addr *)&sa6_src->sin6_addr,
uh.uh_sport, 0, 0))
valid++;
@@ -263,7 +263,7 @@ udp6_ctlinput(int cmd, const struct sock
* We should at least check if the local address (= s)
* is really ours.
*/
- else if (in6_pcblookup_bind(&udbtable, &sa6->sin6_addr,
+ else if (in6pcb_lookup_bound(&udbtable, &sa6->sin6_addr,
uh.uh_dport, 0))
valid++;
#endif
@@ -280,18 +280,18 @@ udp6_ctlinput(int cmd, const struct sock
/*
* regardless of if we called
* icmp6_mtudisc_update(), we need to call
- * in6_pcbnotify(), to notify path MTU change
+ * in6pcb_notify(), to notify path MTU change
* to the userland (RFC3542), because some
* unconnected sockets may share the same
* destination and want to know the path MTU.
*/
}
- (void)in6_pcbnotify(&udbtable, sa, uh.uh_dport,
+ (void)in6pcb_notify(&udbtable, sa, uh.uh_dport,
sin6tocsa(sa6_src), uh.uh_sport, cmd, cmdarg,
notify);
} else {
- (void)in6_pcbnotify(&udbtable, sa, 0,
+ (void)in6pcb_notify(&udbtable, sa, 0,
sin6tocsa(sa6_src), 0, cmd, cmdarg, notify);
}
return NULL;
@@ -512,11 +512,11 @@ udp6_realinput(int af, struct sockaddr_i
/*
* Locate pcb for datagram.
*/
- inp = in6_pcblookup_connect(&udbtable, &src6, sport, dst6,
+ inp = in6pcb_lookup(&udbtable, &src6, sport, dst6,
dport, 0, 0);
if (inp == NULL) {
UDP_STATINC(UDP_STAT_PCBHASHMISS);
- inp = in6_pcblookup_bind(&udbtable, dst6, dport, 0);
+ inp = in6pcb_lookup_bound(&udbtable, dst6, dport, 0);
if (inp == NULL)
return rcvcnt;
}
@@ -798,7 +798,7 @@ udp6_output(struct inpcb * const inp, st
if (sin6) {
/*
* Slightly different than v4 version in that we call
- * in6_selectsrc and in6_pcbsetport to fill in the local
+ * in6_selectsrc and in6pcb_set_port to fill in the local
* address and port rather than inpcb_connect. inpcb_connect
* sets inp_faddr which causes EISCONN below to be hit on
* subsequent sendto.
@@ -925,7 +925,7 @@ udp6_output(struct inpcb * const inp, st
if (error)
goto release;
- error = in6_pcbsetport(&lsin6, inp, l);
+ error = in6pcb_set_port(&lsin6, inp, l);
if (error) {
in6p_laddr(inp) = in6addr_any;
@@ -994,7 +994,7 @@ udp6_output(struct inpcb * const inp, st
ip6->ip6_plen = htons((u_int16_t)plen);
#endif
ip6->ip6_nxt = IPPROTO_UDP;
- ip6->ip6_hlim = in6_selecthlim_rt(inp);
+ ip6->ip6_hlim = in6pcb_selecthlim_rt(inp);
ip6->ip6_src = *laddr;
ip6->ip6_dst = *faddr;
@@ -1032,7 +1032,7 @@ udp6_output(struct inpcb * const inp, st
udp6->uh_sum = 0xffff;
ip->ip_len = htons(hlen + plen);
- ip->ip_ttl = in6_selecthlim(inp, NULL); /* XXX */
+ ip->ip_ttl = in6pcb_selecthlim(inp, NULL); /* XXX */
ip->ip_tos = 0; /* XXX */
UDP_STATINC(UDP_STAT_OPACKETS);
@@ -1124,7 +1124,7 @@ udp6_bind(struct socket *so, struct sock
KASSERT(inp != NULL);
s = splsoftnet();
- error = in6_pcbbind(inp, sin6, l);
+ error = in6pcb_bind(inp, sin6, l);
splx(s);
return error;
}
@@ -1150,7 +1150,7 @@ udp6_connect(struct socket *so, struct s
if (!IN6_IS_ADDR_UNSPECIFIED(&in6p_faddr(inp)))
return EISCONN;
s = splsoftnet();
- error = in6_pcbconnect(inp, (struct sockaddr_in6 *)nam, l);
+ error = in6pcb_connect(inp, (struct sockaddr_in6 *)nam, l);
splx(s);
if (error == 0)
soisconnected(so);
@@ -1179,12 +1179,12 @@ udp6_disconnect(struct socket *so)
return ENOTCONN;
s = splsoftnet();
- in6_pcbdisconnect(inp);
+ in6pcb_disconnect(inp);
memset((void *)&in6p_laddr(inp), 0, sizeof(in6p_laddr(inp)));
splx(s);
so->so_state &= ~SS_ISCONNECTED; /* XXX */
- in6_pcbstate(inp, INP_BOUND); /* XXX */
+ in6pcb_set_state(inp, INP_BOUND); /* XXX */
return 0;
}
@@ -1248,7 +1248,7 @@ udp6_peeraddr(struct socket *so, struct
KASSERT(sotoinpcb(so) != NULL);
KASSERT(nam != NULL);
- in6_setpeeraddr(sotoinpcb(so), (struct sockaddr_in6 *)nam);
+ in6pcb_fetch_peeraddr(sotoinpcb(so), (struct sockaddr_in6 *)nam);
return 0;
}
@@ -1259,7 +1259,7 @@ udp6_sockaddr(struct socket *so, struct
KASSERT(sotoinpcb(so) != NULL);
KASSERT(nam != NULL);
- in6_setsockaddr(sotoinpcb(so), (struct sockaddr_in6 *)nam);
+ in6pcb_fetch_sockaddr(sotoinpcb(so), (struct sockaddr_in6 *)nam);
return 0;
}
@@ -1314,7 +1314,7 @@ udp6_purgeif(struct socket *so, struct i
{
mutex_enter(softnet_lock);
- in6_pcbpurgeif0(&udbtable, ifp);
+ in6pcb_purgeif0(&udbtable, ifp);
#ifdef NET_MPSAFE
mutex_exit(softnet_lock);
#endif
@@ -1322,7 +1322,7 @@ udp6_purgeif(struct socket *so, struct i
#ifdef NET_MPSAFE
mutex_enter(softnet_lock);
#endif
- in6_pcbpurgeif(&udbtable, ifp);
+ in6pcb_purgeif(&udbtable, ifp);
mutex_exit(softnet_lock);
return 0;