OpenVPN / tap-windows6

Windows TAP driver (NDIS 6)
Other
785 stars 237 forks source link

hlk7: Add TapDiag interface to support testing #82

Closed sgstair closed 5 years ago

sgstair commented 5 years ago

HLK tests require two things that are not supported in OpenVPN currently.

  1. 2c_Priority test requires the priority feature to be enabled (no priority tagging is sent by default)
  2. LinkCheck test requires that the ethernet cable be removed and reattached

To support these, when enabled by a registry key, a "TapDiag" device is created alongside the "Tap" device. This can be opened while OpenVPN is using the main tap device, and allows a side application to reach in and send some specific IOCTLs to modify the device state.

A hacky side tool has been written to serve these purposes and is available here https://github.com/sgstair/tapdiag

cron2 commented 5 years ago

The code looks fairly straightforward. So, ACK, and I'll proceed to merge.

I'm missing a registry-for-dummies comment or commit note where "the magic registry key" can be found - it's called "TapDiag" and needs to have a a value "!= 0", but where would I find it?

sgstair commented 5 years ago

the TapDiag registry key is REG_DWORD and lives in HKLM:SYSTEM\CurrentControlSet\Services\tap0901 (the driver's registry path) - the tapdiag tool configures it and so is an okayish reference.