From dd782ec31501c837b0adb1f98b4d5f1fed0f84e3 Mon Sep 17 00:00:00 2001 From: David Gwynne Date: Sun, 21 Jun 2020 05:12:07 +0000 Subject: add a inp_upcall function pointer and inp_upcall_arg to struct in_pcb. this is so protocols (eg, udp) can let things (eg, kernel support for wireguard or vxlan or geneve) look at and possibly steal packets before they get added to a socket buffer. i wrote the original version of this, but it was tweaked by Matt Dunwoodie and Jason A. Donenfeld for use with wireguard. --- sys/netinet/in_pcb.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'sys') diff --git a/sys/netinet/in_pcb.h b/sys/netinet/in_pcb.h index 7a27b3f45e9..36212bd332a 100644 --- a/sys/netinet/in_pcb.h +++ b/sys/netinet/in_pcb.h @@ -1,4 +1,4 @@ -/* $OpenBSD: in_pcb.h,v 1.118 2019/11/13 17:36:02 deraadt Exp $ */ +/* $OpenBSD: in_pcb.h,v 1.119 2020/06/21 05:12:06 dlg Exp $ */ /* $NetBSD: in_pcb.h,v 1.14 1996/02/13 23:42:00 christos Exp $ */ /* @@ -143,6 +143,8 @@ struct inpcb { #endif struct icmp6_filter *inp_icmp6filt; struct pf_state_key *inp_pf_sk; + struct mbuf *(*inp_upcall)(void *, struct mbuf *, struct ip *, struct ip6_hdr *, void *, int); + void *inp_upcall_arg; u_int inp_rtableid; int inp_pipex; /* pipex indication */ }; -- cgit v1.2.3