I have a TCP/IP stack running within a Windows userspace program. The stack is based on a Windows-port of LwIP: https://github.com/yarrick/lwip-contrib/tree/master/ports/win32
The userspace stack interfaces with an ethernet interface at layer 2 using the npcap library/driver: https://nmap.org/npcap/
ncap is used to send and capture raw ethernet packets, which are passed from/to the userspace LwIP stack.
The problem: Let's say I listen on TCP port 5000 within the userspace stack. The Windows kernel does not know anything about the userspace stack and treats 5000 as closed port. This interferes with the userspace stack. For example, the kernel might response to incoming SYN packets with RESET packets (rejecting the TCP connection).
The question: How can I shut down the Windows kernel TCP/IP stack for a specified ethernet interface? I want the userspace stack via ncap to be the only one who is sending out packets.