Source-Changes-HG archive

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

[src/trunk]: src/sys/netinet refactor: use typedef for ip_encap priority func...



details:   https://anonhg.NetBSD.org/src/rev/24af5559d4bc
branches:  trunk
changeset: 372550:24af5559d4bc
user:      knakahara <knakahara%NetBSD.org@localhost>
date:      Wed Dec 07 08:27:03 2022 +0000

description:
refactor: use typedef for ip_encap priority function

diffstat:

 sys/netinet/ip_encap.c |  6 +++---
 sys/netinet/ip_encap.h |  8 +++++---
 2 files changed, 8 insertions(+), 6 deletions(-)

diffs (63 lines):

diff -r a589bc7dfa1d -r 24af5559d4bc sys/netinet/ip_encap.c
--- a/sys/netinet/ip_encap.c    Wed Dec 07 08:11:49 2022 +0000
+++ b/sys/netinet/ip_encap.c    Wed Dec 07 08:27:03 2022 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ip_encap.c,v 1.74 2020/08/22 01:43:07 riastradh Exp $  */
+/*     $NetBSD: ip_encap.c,v 1.75 2022/12/07 08:27:03 knakahara Exp $  */
 /*     $KAME: ip_encap.c,v 1.73 2001/10/02 08:30:58 itojun Exp $       */
 
 /*
@@ -68,7 +68,7 @@
 #define USE_RADIX
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ip_encap.c,v 1.74 2020/08/22 01:43:07 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ip_encap.c,v 1.75 2022/12/07 08:27:03 knakahara Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_mrouting.h"
@@ -750,7 +750,7 @@
 
 const struct encaptab *
 encap_attach_func(int af, int proto,
-    int (*func)(struct mbuf *, int, int, void *),
+    encap_priofunc_t *func,
     const struct encapsw *esw, void *arg)
 {
        struct encaptab *ep;
diff -r a589bc7dfa1d -r 24af5559d4bc sys/netinet/ip_encap.h
--- a/sys/netinet/ip_encap.h    Wed Dec 07 08:11:49 2022 +0000
+++ b/sys/netinet/ip_encap.h    Wed Dec 07 08:27:03 2022 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ip_encap.h,v 1.25 2018/09/14 05:09:51 maxv Exp $       */
+/*     $NetBSD: ip_encap.h,v 1.26 2022/12/07 08:27:03 knakahara Exp $  */
 /*     $KAME: ip_encap.h,v 1.7 2000/03/25 07:23:37 sumikawa Exp $      */
 
 /*
@@ -62,6 +62,8 @@
 #define encapsw4 encapsw46._encapsw4
 #define encapsw6 encapsw46._encapsw6
 
+typedef        int encap_priofunc_t(struct mbuf *, int, int, void *);
+
 struct encaptab {
        struct radix_node nodes[2];
        struct pslist_entry chain;
@@ -73,7 +75,7 @@
        struct sockaddr *srcmask;
        struct sockaddr *dst;           /* remote addr */
        struct sockaddr *dstmask;
-       int (*func) (struct mbuf *, int, int, void *);
+       encap_priofunc_t *func;
        const struct encapsw *esw;
        void *arg;
        struct psref_target     psref;
@@ -106,7 +108,7 @@
        const struct sockaddr *, const struct sockaddr *,
        const struct sockaddr *, const struct encapsw *, void *);
 const struct encaptab *encap_attach_func(int, int,
-       int (*)(struct mbuf *, int, int, void *),
+       encap_priofunc_t *,
        const struct encapsw *, void *);
 void   *encap6_ctlinput(int, const struct sockaddr *, void *);
 int    encap_detach(const struct encaptab *);



Home | Main Index | Thread Index | Old Index