Module Name: src Committed By: knakahara Date: Wed Dec 7 08:27:03 UTC 2022
Modified Files: src/sys/netinet: ip_encap.c ip_encap.h Log Message: refactor: use typedef for ip_encap priority function To generate a diff of this commit: cvs rdiff -u -r1.74 -r1.75 src/sys/netinet/ip_encap.c cvs rdiff -u -r1.25 -r1.26 src/sys/netinet/ip_encap.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/sys/netinet/ip_encap.c diff -u src/sys/netinet/ip_encap.c:1.74 src/sys/netinet/ip_encap.c:1.75 --- src/sys/netinet/ip_encap.c:1.74 Sat Aug 22 01:43:07 2020 +++ src/sys/netinet/ip_encap.c Wed Dec 7 08:27:03 2022 @@ -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 @@ fail: 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; Index: src/sys/netinet/ip_encap.h diff -u src/sys/netinet/ip_encap.h:1.25 src/sys/netinet/ip_encap.h:1.26 --- src/sys/netinet/ip_encap.h:1.25 Fri Sep 14 05:09:51 2018 +++ src/sys/netinet/ip_encap.h Wed Dec 7 08:27:03 2022 @@ -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 @@ struct encapsw { #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 encaptab { 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 encaptab *encap_attach(int, 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 *);