Developer Reference WinpkFilter 3.6.x

Windows Packet Filter Advanced Examples

Complete engineering sample applications demonstrating raw packet manipulation, custom routing, network simulation, and protocol filtering on Windows using the WinpkFilter SDK.

Reference Sample Applications

Each sample demonstrates core systems networking concepts implemented in user space via the NDISAPI driver interface:

NAT & Routing C++ / MFC

Internet Gateway

A user-mode connection sharing and dynamic Network Address Translation (NAT) reference application. Demonstrates how to intercept packets from an internal LAN interface, translate IPv4 and port headers, recalculate IP/TCP/UDP checksums in software, track connection states, and inject packets onto an external WAN adapter.

Concept Demonstrated: Stateful IPv4 NAT • Checksum Recalculation • LAN/WAN Forwarding
Key APIs: SetAdapterMode, ReadPacket, SendPacketToAdapter
Network Simulation C++ / Win32

WAN Emulator

A network condition simulation utility. Intercepts packets passing through network interfaces and introduces configurable packet latency (delay in milliseconds) and deterministic packet drop patterns, allowing engineers to test application robustness under adverse WAN conditions.

Concept Demonstrated: Packet Delay Queues • Configurable Packet Dropping • Bidirectional Tunnel Mode
Key APIs: SetAdapterMode, ReadPacket, SendPacketToAdapter
Data-Link Layer C++ / Win32

Ethernet Bridge

A software layer-2 MAC bridge. Binds two or more physical or virtual network interfaces into a unified broadcast domain, maintaining dynamic MAC address learning tables and forwarding Ethernet frames directly without operating system routing.

Concept Demonstrated: Promiscuous Filtering • Dynamic MAC Forwarding Database • L2 Bridging
Key APIs: SetHwPacketFilter, ReadPackets, SendPacketsToAdapter