clumsy icon indicating copy to clipboard operation
clumsy copied to clipboard

Adding the support for WINDIVERT_LAYER_NETWORK_FORWARD

Open cyberclau opened this issue 1 year ago • 2 comments

Hi,

In the officiel/actual version, only the WINDIVERT_LAYER_NETWORK is supported/used. That restricts the utilization of Clumsy when only forwarding the packet (layer: WINDIVERT_LAYER_NETWORK_FORWARD) on the machine (ex: Internet Connection Sharing in Windows).

My need was to use a Windows PC to simulate a WAN link to a physical firewall. The Windows PC was sharing an Internet connexion with the use of Windows ICS functionality.

The only modification I needed in Clumsy to make it work was: int divertStart(const char *filter, char buf[]) { int ix; //divertHandle = WinDivertOpen(filter, WINDIVERT_LAYER_NETWORK, DIVERT_PRIORITY, 0); divertHandle = WinDivertOpen(filter, WINDIVERT_LAYER_NETWORK_FORWARD, DIVERT_PRIORITY, 0);

I think a "nice" combo BOX can be added to the Clumsy GUI for choosing between both layer. What do you think?

Regards,

Claude-Olivier

cyberclau avatar Nov 13 '23 17:11 cyberclau

I forgot to mention two points:

  1. The code modification is only mandatory in \clumsy-master\src\divert.c line 83.
  2. I used the filter “true” when testing. I did the same as what is shown when running “\clumsy-master\external\WinDivert-2.2.0-C\x64\flowtrack.exe”

Regards,

Claude-Olivier

cyberclau avatar Nov 13 '23 18:11 cyberclau

Hi! You're welcome to file for a pull request. See build instructions here: https://jagt.github.io/clumsy/download.html

jagt avatar Nov 19 '23 12:11 jagt