Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/netipsec inpcb: rename functions to inpcb_*



details:   https://anonhg.NetBSD.org/src/rev/8f00a996d175
branches:  trunk
changeset: 372251:8f00a996d175
user:      ozaki-r <ozaki-r%NetBSD.org@localhost>
date:      Fri Nov 04 09:00:58 2022 +0000

description:
inpcb: rename functions to inpcb_*

Inspired by rmind-smpnet patches.

diffstat:

 sys/dist/pf/net/pf.c       |  10 ++--
 sys/net/if_wg.c            |   6 +-
 sys/netcan/can.c           |   8 +-
 sys/netinet/dccp_usrreq.c  |  50 +++++++++++-----------
 sys/netinet/in_pcb.c       |  98 +++++++++++++++++++++++-----------------------
 sys/netinet/in_pcb.h       |  46 ++++++++++----------
 sys/netinet/ip_output.c    |   6 +-
 sys/netinet/portalgo.c     |  12 ++--
 sys/netinet/raw_ip.c       |  24 +++++-----
 sys/netinet/sctp_usrreq.c  |   6 +-
 sys/netinet/tcp_input.c    |   8 +-
 sys/netinet/tcp_output.c   |  12 ++--
 sys/netinet/tcp_subr.c     |  40 +++++++++---------
 sys/netinet/tcp_syncache.c |  12 ++--
 sys/netinet/tcp_timer.c    |   8 +-
 sys/netinet/tcp_usrreq.c   |  30 +++++++-------
 sys/netinet/tcp_vtw.c      |   6 +-
 sys/netinet/udp_usrreq.c   |  42 +++++++++---------
 sys/netinet6/in6_pcb.c     |  16 +++---
 sys/netinet6/raw_ip6.c     |   8 +-
 sys/netinet6/udp6_usrreq.c |  12 ++--
 sys/netipsec/ipsec.c       |   6 +-
 22 files changed, 233 insertions(+), 233 deletions(-)

diffs (truncated from 1848 to 300 lines):

diff -r 22621744b154 -r 8f00a996d175 sys/dist/pf/net/pf.c
--- a/sys/dist/pf/net/pf.c      Fri Nov 04 08:01:42 2022 +0000
+++ b/sys/dist/pf/net/pf.c      Fri Nov 04 09:00:58 2022 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: pf.c,v 1.85 2022/10/28 05:20:08 ozaki-r Exp $  */
+/*     $NetBSD: pf.c,v 1.86 2022/11/04 09:00:58 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.85 2022/10/28 05:20:08 ozaki-r Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pf.c,v 1.86 2022/11/04 09:00:58 ozaki-r Exp $");
 
 #include "pflog.h"
 
@@ -2455,7 +2455,7 @@
 
                /*
                 * port search; start random, step;
-                * similar 2 portloop in in_pcbbind
+                * similar 2 portloop in inpcb_bind
                 */
                if (!(proto == IPPROTO_TCP || proto == IPPROTO_UDP ||
                    proto == IPPROTO_ICMP)) {
@@ -2800,11 +2800,11 @@
 
 #ifdef __NetBSD__
 #define in_pcbhashlookup(tbl, saddr, sport, daddr, dport) \
-    in_pcblookup_connect(tbl, saddr, sport, daddr, dport, NULL)
+    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)
 #define in_pcblookup_listen(tbl, addr, port, zero) \
-    in_pcblookup_bind(tbl, addr, port)
+    inpcb_lookup_bound(tbl, addr, port)
 #define in6_pcblookup_listen(tbl, addr, port, zero) \
     in6_pcblookup_bind(tbl, addr, port, zero)
 #endif
diff -r 22621744b154 -r 8f00a996d175 sys/net/if_wg.c
--- a/sys/net/if_wg.c   Fri Nov 04 08:01:42 2022 +0000
+++ b/sys/net/if_wg.c   Fri Nov 04 09:00:58 2022 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_wg.c,v 1.70 2022/10/28 05:20:08 ozaki-r Exp $       */
+/*     $NetBSD: if_wg.c,v 1.71 2022/11/04 09:00:58 ozaki-r Exp $       */
 
 /*
  * Copyright (C) Ryota Ozaki <ozaki.ryota%gmail.com@localhost>
@@ -41,7 +41,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_wg.c,v 1.70 2022/10/28 05:20:08 ozaki-r Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_wg.c,v 1.71 2022/11/04 09:00:58 ozaki-r Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_altq_enabled.h"
@@ -3266,7 +3266,7 @@
        so->so_upcallarg = wg;
        so->so_upcall = wg_so_upcall;
        so->so_rcv.sb_flags |= SB_UPCALL;
-       in_pcb_register_overudp_cb(sotoinpcb(so), wg_overudp_cb, wg);
+       inpcb_register_overudp_cb(sotoinpcb(so), wg_overudp_cb, wg);
        sounlock(so);
 
        *sop = so;
diff -r 22621744b154 -r 8f00a996d175 sys/netcan/can.c
--- a/sys/netcan/can.c  Fri Nov 04 08:01:42 2022 +0000
+++ b/sys/netcan/can.c  Fri Nov 04 09:00:58 2022 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: can.c,v 1.12 2022/09/03 02:07:32 thorpej Exp $ */
+/*     $NetBSD: can.c,v 1.13 2022/11/04 09:00:58 ozaki-r Exp $ */
 
 /*-
  * Copyright (c) 2003, 2017 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: can.c,v 1.12 2022/09/03 02:07:32 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: can.c,v 1.13 2022/11/04 09:00:58 ozaki-r Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -840,14 +840,14 @@
                return NULL;
        errno = inetctlerrmap[cmd];
        if (PRC_IS_REDIRECT(cmd))
-               notify = in_rtchange, ip = 0;
+               notify = inpcb_rtchange, ip = 0;
        else if (cmd == PRC_HOSTDEAD)
                ip = 0;
        else if (errno == 0)
                return NULL;
        if (ip) {
                uh = (struct canhdr *)((caddr_t)ip + (ip->ip_hl << 2));
-               in_pcbnotify(&udbtable, satosin(sa)->sin_addr, uh->uh_dport,
+               inpcb_notify(&udbtable, satosin(sa)->sin_addr, uh->uh_dport,
                    ip->ip_src, uh->uh_sport, errno, notify);
 
                /* XXX mapped address case */
diff -r 22621744b154 -r 8f00a996d175 sys/netinet/dccp_usrreq.c
--- a/sys/netinet/dccp_usrreq.c Fri Nov 04 08:01:42 2022 +0000
+++ b/sys/netinet/dccp_usrreq.c Fri Nov 04 09:00:58 2022 +0000
@@ -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.24 2022/10/28 05:26:29 ozaki-r Exp $ */
+/*     $NetBSD: dccp_usrreq.c,v 1.25 2022/11/04 09:00:58 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.24 2022/10/28 05:26:29 ozaki-r Exp $");
+__KERNEL_RCSID(0, "$NetBSD: dccp_usrreq.c,v 1.25 2022/11/04 09:00:58 ozaki-r Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_inet.h"
@@ -177,7 +177,7 @@
        pool_init(&dccpcb_pool, sizeof(struct dccpcb), 0, 0, 0, "dccpcbpl",
                  NULL, IPL_SOFTNET);
 
-       in_pcbinit(&dccpbtable, DCCPBHASHSIZE, DCCPBHASHSIZE);
+       inpcb_init(&dccpbtable, DCCPBHASHSIZE, DCCPBHASHSIZE);
 }
 
 void
@@ -347,11 +347,11 @@
        } else
 #endif
        {
-               inp = in_pcblookup_connect(&dccpbtable, ip->ip_src,
+               inp = inpcb_lookup(&dccpbtable, ip->ip_src,
                    dh->dh_sport, ip->ip_dst, dh->dh_dport, 0);
                if (inp == NULL) {
                        /* XXX stats increment? */
-                       inp = in_pcblookup_bind(&dccpbtable, ip->ip_dst,
+                       inp = inpcb_lookup_bound(&dccpbtable, ip->ip_dst,
                            dh->dh_dport);
                }
        }
@@ -447,7 +447,7 @@
                        in6p_faddr(inp) = ip6->ip6_src;
                        inp->inp_lport = dh->dh_dport;
                        inp->inp_fport = dh->dh_sport;
-                       in_pcbstate(inp, INP_CONNECTED);
+                       inpcb_set_state(inp, INP_CONNECTED);
                } else 
 #endif
                {
@@ -459,7 +459,7 @@
                }
 
                if (!isipv6)
-                       in_pcbstate(inp, INP_BOUND);
+                       inpcb_set_state(inp, INP_BOUND);
 
                dp = inp->inp_ppcb;
 
@@ -944,7 +944,7 @@
 
        if (PRC_IS_REDIRECT(cmd)) {
                ip = 0;
-               notify = in_rtchange;
+               notify = inpcb_rtchange;
        } else if (cmd == PRC_HOSTDEAD)
                ip = 0;
        else if ((unsigned)cmd >= PRC_NCMDS || inetctlerrmap[cmd] == 0)
@@ -953,7 +953,7 @@
                /*s = splsoftnet();*/
                dh = (struct dccphdr *)((vaddr_t)ip + (ip->ip_hl << 2));
                INP_INFO_RLOCK(&dccpbinfo);
-               in_pcbnotify(&dccpbtable, faddr, dh->dh_dport,
+               inpcb_notify(&dccpbtable, faddr, dh->dh_dport,
                    ip->ip_src, dh->dh_sport, inetctlerrmap[cmd], notify);
                if (inp != NULL) {
                        INP_LOCK(inp);
@@ -965,7 +965,7 @@
                INP_INFO_RUNLOCK(&dccpbinfo);
                /*splx(s);*/
        } else
-               in_pcbnotifyall(&dccpbtable, faddr, inetctlerrmap[cmd], notify);
+               inpcb_notifyall(&dccpbtable, faddr, inetctlerrmap[cmd], notify);
 
        return NULL;
 }
@@ -1593,7 +1593,7 @@
        pool_put(&dccpcb_pool, dp);
        inp->inp_ppcb = NULL;
        soisdisconnected(so);
-       in_pcbdetach(inp);
+       inpcb_destroy(inp);
        return ((struct dccpcb *)0);
 }
 
@@ -1621,7 +1621,7 @@
        error = soreserve(so, dccp_sendspace, dccp_recvspace);
        if (error)
                goto out;
-       error = in_pcballoc(so, &dccpbtable);
+       error = inpcb_create(so, &dccpbtable);
        if (error)
                goto out;
        inp = sotoinpcb(so);
@@ -1630,7 +1630,7 @@
        if (dp == 0) {
                int nofd = so->so_state & SS_NOFDREF;
                so->so_state &= ~SS_NOFDREF;
-               in_pcbdetach(inp);
+               inpcb_destroy(inp);
                so->so_state |= nofd;
                error = ENOBUFS;
                goto out;
@@ -1676,7 +1676,7 @@
        }
        INP_LOCK(inp);
        s = splsoftnet();
-       error = in_pcbbind(inp, sin, l);
+       error = inpcb_bind(inp, sin, l);
        splx(s);
        INP_UNLOCK(inp);
        INP_INFO_WUNLOCK(&dccpbinfo);
@@ -1784,10 +1784,10 @@
                } else
 #endif /* INET6 */
                {
-                       error = in_pcbbind(inp, NULL, l);
+                       error = inpcb_bind(inp, NULL, l);
                }
                if (error) {
-                       DCCP_DEBUG((LOG_INFO, "in_pcbbind=%d\n",error));
+                       DCCP_DEBUG((LOG_INFO, "inpcb_bind=%d\n",error));
                        return error;
                }
        }
@@ -1798,9 +1798,9 @@
                DCCP_DEBUG((LOG_INFO, "in6_pcbconnect=%d\n",error));
        } else
 #endif
-               error = in_pcbconnect(inp, (struct sockaddr_in *)nam, l);
+               error = inpcb_connect(inp, (struct sockaddr_in *)nam, l);
        if (error) {
-               DCCP_DEBUG((LOG_INFO, "in_pcbconnect=%d\n",error));
+               DCCP_DEBUG((LOG_INFO, "inpcb_connect=%d\n",error));
                return error;
        }
 
@@ -2034,7 +2034,7 @@
        INP_INFO_RUNLOCK(&dccpbinfo);
        dp = (struct dccpcb *)inp->inp_ppcb;
        if (inp->inp_lport == 0)
-               error = in_pcbbind(inp, NULL, td);
+               error = inpcb_bind(inp, NULL, td);
        if (error == 0) {
                dp->state = DCCPS_LISTEN;
                dp->who = DCCP_LISTENER;
@@ -2070,14 +2070,14 @@
        }
        INP_LOCK(inp);
        INP_INFO_RUNLOCK(&dccpbinfo);
-       in_setpeeraddr(inp, (struct sockaddr_in *)nam);
+       inpcb_fetch_peeraddr(inp, (struct sockaddr_in *)nam);
 
        return error;
 }
 
 /*
  * Initializes a new DCCP control block
- * (in_pcballoc in attach has already allocated memory for it)
+ * (inpcb_create in attach has already allocated memory for it)
  */
 struct dccpcb *
 dccp_newdccpcb(int family, void *aux)
@@ -2688,7 +2688,7 @@
        KASSERT(sotoinpcb(so) != NULL);
        KASSERT(nam != NULL);
 
-       in_setpeeraddr(sotoinpcb(so), (struct sockaddr_in *)nam);
+       inpcb_fetch_peeraddr(sotoinpcb(so), (struct sockaddr_in *)nam);
        return 0;
 }
 
@@ -2700,7 +2700,7 @@
        KASSERT(sotoinpcb(so) != NULL);
        KASSERT(nam != NULL);
 
-       in_setsockaddr(sotoinpcb(so), (struct sockaddr_in *)nam);
+       inpcb_fetch_sockaddr(sotoinpcb(so), (struct sockaddr_in *)nam);
        return 0;
 }
 
@@ -2738,9 +2738,9 @@
 
        s = splsoftnet();
        mutex_enter(softnet_lock);
-       in_pcbpurgeif0(&dccpbtable, ifp);



Home | Main Index | Thread Index | Old Index