@@ -28,6 +28,7 @@ A single network interface can be associated with the device.
2828| ** Network** | IPv4 Forwarding | Multi-interface routing (optional) | [ RFC 1812] ( https://datatracker.ietf.org/doc/html/rfc1812 ) |
2929| ** Network** | ICMP | Echo request/reply, TTL exceeded | [ RFC 792] ( https://datatracker.ietf.org/doc/html/rfc792 ) |
3030| ** Network** | IPsec | ESP Transport mode | [ RFC 4303] ( https://datatracker.ietf.org/doc/html/rfc4303 ) |
31+ | ** Network** | WolfGuard | VPN tunnel via wolfguard kernel module (SECP256R1, AES-256-GCM, SHA-256) | See ` wolf-sources/wolfssl/wolfguard/README.md ` |
3132| ** Transport** | UDP | Unicast datagrams, checksum | [ RFC 768] ( https://datatracker.ietf.org/doc/html/rfc768 ) |
3233| ** Transport** | TCP | Connection management, reliable delivery | [ RFC 793] ( https://datatracker.ietf.org/doc/html/rfc793 ) , [ RFC 9293] ( https://datatracker.ietf.org/doc/html/rfc9293 ) |
3334| ** Transport** | TCP | Maximum Segment Size negotiation | [ RFC 793] ( https://datatracker.ietf.org/doc/html/rfc793 ) |
@@ -69,6 +70,92 @@ The `-I wtcp0` flag pins the test to the injected interface and `-c5`
6970generates five echo requests. Successful replies confirm the ICMP
7071datagram socket support end-to-end through the tap device.
7172
73+ ## WolfGuard support
74+
75+ wolfIP can use [ WolfGuard] ( wolf-sources/wolfssl/wolfguard/README.md ) as its
76+ link-layer driver, giving every socket opened on the stack transparent
77+ WireGuard-compatible encryption without any changes to application code.
78+
79+ ### How it works
80+
81+ WolfGuard is a kernel module (` wolfguard.ko ` ) that registers a standard Linux
82+ network interface (` ARPHRD_NONE ` , identical in structure to the upstream
83+ WireGuard driver) and performs the handshake and encryption inside the kernel
84+ using wolfSSL's FIPS-ready primitives (SECP256R1, AES-256-GCM, SHA-256).
85+
86+ ` wolfip_wolfguard.c ` is a wolfIP ll_dev driver that bridges the two:
87+
88+ 1 . Creates the wolfguard interface via Netlink (` RTM_NEWLINK type=wolfguard ` ).
89+ 2 . Configures keys and peers via the wolfguard Generic Netlink family
90+ (` WG_CMD_SET_DEVICE ` ).
91+ 3 . Connects to the interface with an ` AF_PACKET/SOCK_DGRAM ` socket, injecting
92+ and receiving raw IP packets that the kernel module encrypts/decrypts
93+ transparently.
94+ 4 . Provides a synthetic ARP proxy so wolfIP's Ethernet layer can resolve peer
95+ IPs without kernel ARP involvement.
96+
97+ ### Prerequisites
98+
99+ Build and load the wolfguard kernel module and its wolfSSL dependency by
100+ following the instructions in
101+ [ wolf-sources/wolfssl/wolfguard/README.md] ( wolf-sources/wolfssl/wolfguard/README.md ) .
102+ Then load the modules before running any wolfguard-enabled binary:
103+
104+ ``` sh
105+ insmod /lib/modules/$( uname -r) /wolfssl/libwolfssl.ko
106+ insmod /path/to/wolfguard.ko
107+ modprobe udp_tunnel
108+ modprobe ip6_udp_tunnel
109+ ```
110+
111+ ### Enabling wolfguard support
112+
113+ Add ` -DWOLFIP_WOLFGUARD ` to your ` CFLAGS ` and link ` wolfip_wolfguard.c ` into
114+ your build. In the wolfIP Makefile the dedicated targets handle this
115+ automatically:
116+
117+ ``` sh
118+ make unit-wolfguard # driver unit tests (no kernel module required)
119+ make build/test-wolfguard # functional test binary
120+ ```
121+
122+ To integrate into your own application, call ` wolfIP_wg_init() ` in place of
123+ ` tap_init() ` :
124+
125+ ``` c
126+ #include " wolfip_wolfguard.h"
127+
128+ struct wolfIP_wg_config cfg = { ... }; /* keys, peers, listen port * /
129+ struct wolfIP * stack;
130+
131+ wolfIP_init_static (&stack);
132+ wolfIP_wg_init (&cfg, wolfIP_getdev(stack));
133+ wolfIP_ipconfig_set (stack, atoip4("10.8.0.1"), atoip4("255.255.255.0"),
134+ atoip4("10.8.0.1"));
135+ /* use wolfIP sockets normally — all traffic is encrypted by wolfguard * /
136+ ```
137+
138+ ### Running the tests
139+
140+ **Unit tests** exercise the driver logic (ARP proxy, L2/L3 bridging) entirely
141+ in userspace with a mock pipe — no kernel module required:
142+
143+ ```sh
144+ make unit-wolfguard
145+ ./build/test/unit-wolfguard
146+ ```
147+
148+ ** Functional test** performs a full loopback: wolfIP sends a UDP packet,
149+ wolfguard encrypts it, a kernel-side peer decrypts and echoes it back, and
150+ wolfIP verifies the payload. Requires the kernel modules to be loaded,
151+ ` wg-fips ` in ` PATH ` , and root (or ` NET_ADMIN ` capability) to create network
152+ interfaces:
153+
154+ ``` sh
155+ make build/test-wolfguard
156+ sudo ./build/test-wolfguard
157+ ```
158+
72159## FreeRTOS Port
73160
74161wolfIP now includes a dedicated FreeRTOS wrapper port at:
0 commit comments