Development discussion of WireGuard
 help / color / mirror / Atom feed
* WINTUN example user space app?
@ 2020-03-10  4:41 Duane Ellis
  2020-03-11  9:55 ` Simon Rozman
  0 siblings, 1 reply; 2+ messages in thread
From: Duane Ellis @ 2020-03-10  4:41 UTC (permalink / raw)
  To: wireguard

Hi - 

I'd like to use WINTUN for a project I'm working on but - I'm a bit stuck.

I know how to make things work on Linux, but I do not know this part of windows .

In my case, I need to take packets - encapsulate them into a serial protocol and send them to a radio,
Then - take packets from the radio and pump them back into the network stack.
It is sort of like SLIP ... but its not... 

For me - the above is trival on Linux, but.. my challenge is this statement:

Site: https://git.zx2c4.com/wintun/about/

>>> After loading the driver and creating a network interface the typical way using SetupAPI, open the NDIS device object associated with the PnPInstanceId, enabling all forms of file sharing:

There are ENDLESS windows rabbit holes, and rat holes to go exploring...  I just don't know the setup api that well.

Is there a "full simple windows example app"  that I can use as a starting point?

Something simplistic to start with, in C, C++ or C# 

a) Given an network interface name on the command line
b) Opens that interface 
c) Prints to stdout the some of the packets it received.
d) Possibly injects a few example packets, ie: send a ping to some address like Yahoo.com or something?

If WINTUN is not the place I should be please let me know...




^ permalink raw reply	[flat|nested] 2+ messages in thread

* RE: WINTUN example user space app?
  2020-03-10  4:41 WINTUN example user space app? Duane Ellis
@ 2020-03-11  9:55 ` Simon Rozman
  0 siblings, 0 replies; 2+ messages in thread
From: Simon Rozman @ 2020-03-11  9:55 UTC (permalink / raw)
  To: Duane Ellis, wireguard

[-- Attachment #1: Type: text/plain, Size: 2207 bytes --]

Hi,

> In my case, I need to take packets - encapsulate them into a serial
> protocol and send them to a radio, Then - take packets from the radio
> and pump them back into the network stack.
> It is sort of like SLIP ... but its not...
>
> For me - the above is trival on Linux, but.. my challenge is this
> statement:
>
> Site: https://git.zx2c4.com/wintun/about/
>
> >>> After loading the driver and creating a network interface the
> typical way using SetupAPI, open the NDIS device object associated with
> the PnPInstanceId, enabling all forms of file sharing:
>
> There are ENDLESS windows rabbit holes, and rat holes to go exploring...
> I just don't know the setup api that well.
>
> Is there a "full simple windows example app"  that I can use as a
> starting point?
>
> Something simplistic to start with, in C, C++ or C#
>
> a) Given an network interface name on the command line
> b) Opens that interface
> c) Prints to stdout the some of the packets it received.
> d) Possibly injects a few example packets, ie: send a ping to some
> address like Yahoo.com or something?

Long story short...

1. Installing the Wintun driver on your computer:
You have some options:
- install WireGuard, even if you don't plan to use it, just to get Wintun 
driver installed
- install WiX Toolset, adapt the sample MSI installer provided in the Wintun 
repo, build your own Wintun driver MSI installer (recommended)

2. Creating/deleting Wintun adapters:
To manage Wintun adapters on your system, checkout the 
https://github.com/Microsoft/Windows-driver-samples and build the setup\devcon 
utility. Invoke as "devcon install Wintun.inf Wintun". Get the Wintun.inf from 
the Wintun repo (ouch, you need colossal WDK installed to build the driver to 
spit out the final Wintun.inf). Once you get familiar with devcon, examine the 
devcon source code how it creates the adapter. You will notice it needs 
Wintun.inf file only to detect that the Wintun device is of the "NET" class.

3. Using Wintun adapters:
See the source snippets in https://git.zx2c4.com/wintun/about/.

This is the general big picture.

Good luck and once you have particular technical details to discuss, feel free 
to ask.

Regards,
Simon

[-- Attachment #2: smime.p7s --]
[-- Type: application/pkcs7-signature, Size: 4919 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-03-11  9:55 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-03-10  4:41 WINTUN example user space app? Duane Ellis
2020-03-11  9:55 ` Simon Rozman

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).