opnsense-src/sys/dev/wg
Mark Johnston 160e7a4c16 wg: Add netmap support
When in netmap (emulated) mode, wireguard interfaces prepend or strip a
dummy ethernet header when interfacing with netmap.  The netmap
application thus sees unencrypted, de-encapsulated frames with a fixed
header.

In this mode, netmap hooks the if_input and if_transmit routines of the
ifnet.  Packets from the host TX ring are handled by wg_if_input(),
which simply hands them to the netisr layer; packets which would
otherwise be tunneled are intercepted in wg_output() and placed in the
host RX ring.

The "physical" TX ring is processed by wg_transmit(), which behaves
identically to wg_output() when netmap is not enabled, and packets
appear in the "physical" RX ring by hooking wg_deliver_in().

Reviewed by:	vmaffione
MFC after:	1 month
Sponsored by:	Klara, Inc.
Sponsored by:	Zenarmor
Differential Revision:	https://reviews.freebsd.org/D43460

(cherry picked from commit bf454ca88bdf4acfa873386e876ff5e772e6a830)
2024-05-20 09:42:35 -04:00
..
compat.h wg: Drop the compat shim for sbcreatecontrol(). 2022-11-11 14:18:48 -08:00
crypto.h wg: Trim compat shims for versions older than current stable/13. 2022-10-28 13:36:13 -07:00
if_wg.c wg: Add netmap support 2024-05-20 09:42:35 -04:00
if_wg.h sys: Remove $FreeBSD$: two-line .h pattern 2023-08-16 11:54:11 -06:00
version.h
wg_cookie.c wg: uma_zcreate() does not fail 2024-05-02 09:25:08 -04:00
wg_cookie.h
wg_crypto.c wg: Trim compat shims for versions older than current stable/13. 2022-10-28 13:36:13 -07:00
wg_noise.c if_wg: fix access to noise_local->l_has_identity and l_private 2024-01-29 23:37:33 -06:00
wg_noise.h