udp: typedef udp tunneling functions to functions, not pointers

With this change one can make a forward declaration of a function
that is of UDP tunneling type.

Reviewed by:		melifaro
Differential revision:	https://reviews.freebsd.org/D36724
This commit is contained in:
Gleb Smirnoff 2022-10-03 20:53:04 -07:00
parent 24b96f35b9
commit bb77f0c204
2 changed files with 6 additions and 6 deletions

View File

@ -785,7 +785,7 @@ udp_common_ctlinput(int cmd, struct sockaddr *sa, void *vip,
if (inp != NULL) {
struct udpcb *up;
void *ctx;
udp_tun_icmp_t func;
udp_tun_icmp_t *func;
up = intoudpcb(inp);
ctx = up->u_tun_ctx;

View File

@ -62,16 +62,16 @@ struct inpcb;
struct mbuf;
#ifdef _KERNEL
typedef bool(*udp_tun_func_t)(struct mbuf *, int, struct inpcb *,
const struct sockaddr *, void *);
typedef void(*udp_tun_icmp_t)(int, struct sockaddr *, void *, void *);
typedef bool udp_tun_func_t(struct mbuf *, int, struct inpcb *,
const struct sockaddr *, void *);
typedef void udp_tun_icmp_t(int, struct sockaddr *, void *, void *);
/*
* UDP control block; one per udp.
*/
struct udpcb {
udp_tun_func_t u_tun_func; /* UDP kernel tunneling callback. */
udp_tun_icmp_t u_icmp_func; /* UDP kernel tunneling icmp callback */
udp_tun_func_t *u_tun_func; /* UDP kernel tunneling callback. */
udp_tun_icmp_t *u_icmp_func; /* UDP kernel tunneling icmp callback */
u_int u_flags; /* Generic UDP flags. */
uint16_t u_rxcslen; /* Coverage for incoming datagrams. */
uint16_t u_txcslen; /* Coverage for outgoing datagrams. */