diff options
author | bryanv <bryanv@FreeBSD.org> | 2014-10-10 06:08:59 +0000 |
---|---|---|
committer | bryanv <bryanv@FreeBSD.org> | 2014-10-10 06:08:59 +0000 |
commit | ed3bbe0a299b69a67b8e314db42d3fd49eb78b98 (patch) | |
tree | 42cfffd82364faa255dc0fcee6b4f0c1a17e1803 /sys/netinet/udp_var.h | |
parent | 855894fab050627beb596386d77c68fdab1f4d79 (diff) | |
download | FreeBSD-src-ed3bbe0a299b69a67b8e314db42d3fd49eb78b98.zip FreeBSD-src-ed3bbe0a299b69a67b8e314db42d3fd49eb78b98.tar.gz |
Add context pointer and source address to the UDP tunnel callback
These are needed for the forthcoming vxlan implementation. The context
pointer means we do not have to use a spare pointer field in the inpcb,
and the source address is required to populate vxlan's forwarding table.
While I highly doubt there is an out of tree consumer of the UDP
tunneling callback, this change may be a difficult to eventually MFC.
Phabricator: https://reviews.freebsd.org/D383
Reviewed by: gnn
Diffstat (limited to 'sys/netinet/udp_var.h')
-rw-r--r-- | sys/netinet/udp_var.h | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/sys/netinet/udp_var.h b/sys/netinet/udp_var.h index 04b4dbb..2e0a4f8 100644 --- a/sys/netinet/udp_var.h +++ b/sys/netinet/udp_var.h @@ -55,7 +55,8 @@ struct udpiphdr { struct inpcb; struct mbuf; -typedef void(*udp_tun_func_t)(struct mbuf *, int off, struct inpcb *); +typedef void(*udp_tun_func_t)(struct mbuf *, int off, struct inpcb *, + const struct sockaddr *, void *); /* * UDP control block; one per udp. @@ -65,6 +66,7 @@ struct udpcb { u_int u_flags; /* Generic UDP flags. */ uint16_t u_rxcslen; /* Coverage for incoming datagrams. */ uint16_t u_txcslen; /* Coverage for outgoing datagrams. */ + void *u_tun_ctx; /* Tunneling callback context. */ }; #define intoudpcb(ip) ((struct udpcb *)(ip)->inp_ppcb) @@ -176,7 +178,8 @@ void udplite_input(struct mbuf *, int); struct inpcb *udp_notify(struct inpcb *inp, int errno); int udp_shutdown(struct socket *so); -int udp_set_kernel_tunneling(struct socket *so, udp_tun_func_t f); +int udp_set_kernel_tunneling(struct socket *so, udp_tun_func_t f, + void *ctx); #endif /* _KERNEL */ |