aboutsummaryrefslogtreecommitdiffstats
path: root/tun/tun_windows.go (follow)
Commit message (Collapse)AuthorAgeFilesLines
* global: fixup TODO comment spacingJason A. Donenfeld2019-06-061-1/+1
|
* wintun: simplify DeleteInterface method signatureSimon Rozman2019-06-061-2/+2
| | | | Signed-off-by: Simon Rozman <simon@rozman.si>
* tun: windows: obsolete 256 packets per exchange buffer limitationSimon Rozman2019-06-051-2/+1
| | | | Signed-off-by: Simon Rozman <simon@rozman.si>
* tun: windows: mitigate infinite loop in Flush()Jason A. Donenfeld2019-05-311-29/+35
| | | | | It's possible that for whatever reason, we keep returning EOF, resulting in repeated close/open/write operations, except with empty packets.
* wintun: remove extra /Jason A. Donenfeld2019-05-261-1/+1
|
* wintun: revise GetInterface()Simon Rozman2019-05-241-0/+2
| | | | | | | | | | | - Make foreign interface found error numeric to ease condition detection. - Update GetInterface() documentation. - Make tun.CreateTUN() quit when foreign interface found before attempting to create a Wintun interface with a duplicate name. Creation is futile. Signed-off-by: Simon Rozman <simon@rozman.si>
* setupapi: trim "Get" from gettersSimon Rozman2019-05-221-1/+1
| | | | Signed-off-by: Simon Rozman <simon@rozman.si>
* wintun: don't try to flush interface, but rather deleteJason A. Donenfeld2019-05-171-16/+8
|
* wintun: make certain methods privateJason A. Donenfeld2019-05-171-10/+3
|
* wintun: change acronyms to uppercaseSimon Rozman2019-05-171-5/+5
| | | | Signed-off-by: Simon Rozman <simon@rozman.si>
* wintun: add LUID accessorJason A. Donenfeld2019-05-101-0/+7
|
* wintun: wait for interface registry key on device creationSimon Rozman2019-05-101-24/+16
| | | | | | By using RegNotifyChangeKeyValue(). Also disable dead gateway detection. Signed-off-by: Simon Rozman <simon@rozman.si>
* wintun: work around GetInterface staleness bugJason A. Donenfeld2019-05-031-16/+28
|
* tun: windows: Adopt new error codes returned by WintunSimon Rozman2019-04-111-3/+2
| | | | Signed-off-by: Simon Rozman <simon@rozman.si>
* tun: windows: do not sleep after OPERATION_ABORTED on writeSimon Rozman2019-04-111-2/+1
| | | | Signed-off-by: Simon Rozman <simon@rozman.si>
* tun: windows: do not sleep after OPERATION_ABORTEDJason A. Donenfeld2019-04-091-2/+1
|
* tun: windows: Retry R/W on ERROR_OPERATION_ABORTEDSimon Rozman2019-04-041-18/+44
| | | | Signed-off-by: Simon Rozman <simon@rozman.si>
* tun: windows: Attempt to reopen handle on all errorsSimon Rozman2019-04-031-15/+9
| | | | Signed-off-by: Simon Rozman <simon@rozman.si>
* wintun: add more retry loopsJason A. Donenfeld2019-04-011-12/+5
|
* tun: windows: cancel ongoing reads on closing and delete after closeJason A. Donenfeld2019-03-261-4/+11
| | | | | This reverts commit 52ec440d7977fad966002c3710ed9df957943407 and adds some spice.
* tun: windows: delete interface before deleting file handlesJason A. Donenfeld2019-03-221-9/+4
|
* tun: windows: Make adapter rename asynchronousSimon Rozman2019-03-221-5/+12
| | | | Signed-off-by: Simon Rozman <simon@rozman.si>
* tun: windows: Adapter devices renamed to WINTUN<LUID Index>Simon Rozman2019-03-221-1/+1
| | | | Signed-off-by: Simon Rozman <simon@rozman.si>
* tun: windows: Increase unavailable adapter timeout to 30secSimon Rozman2019-03-221-1/+1
| | | | | | 5 seconds was too short when debugging. Signed-off-by: Simon Rozman <simon@rozman.si>
* tun: windows: Make writing persistent tooSimon Rozman2019-03-221-15/+17
| | | | Signed-off-by: Simon Rozman <simon@rozman.si>
* tun: windows: Fix paused adapter testSimon Rozman2019-03-221-1/+1
| | | | Signed-off-by: Simon Rozman <simon@rozman.si>
* tun: windows: just open two file handlesJason A. Donenfeld2019-03-211-93/+83
|
* receive: implement flush semanticsJason A. Donenfeld2019-03-211-5/+7
|
* tun: windows: add dummy overlapped events backJason A. Donenfeld2019-03-211-2/+21
| | | | These seem basically wrong to me, but we get crashes without them.
* tun: windows: use new constants in sysJason A. Donenfeld2019-03-201-1/+1
|
* wintun: Use native Win32 API for I/OSimon Rozman2019-03-211-25/+80
| | | | Signed-off-by: Simon Rozman <simon@rozman.si>
* tun: windows: wintun does iocpJason A. Donenfeld2019-03-181-135/+49
|
* tun: windows: temporary hack for forcing MTUJason A. Donenfeld2019-03-131-1/+8
|
* wintun: Resolve some of golint warningsSimon Rozman2019-03-041-0/+7
| | | | Signed-off-by: Simon Rozman <simon@rozman.si>
* Elaborate the failing step when forwarding errors on returnSimon Rozman2019-03-041-3/+3
| | | | Signed-off-by: Simon Rozman <simon@rozman.si>
* global: begin modularizationJason A. Donenfeld2019-03-031-1/+1
|
* tun: windows: expose GUIDJason A. Donenfeld2019-03-011-0/+4
|
* tun: allow special methods in NativeTunJason A. Donenfeld2019-03-011-14/+14
|
* wintun: Read/write packet size from/to exchange buffer directlySimon Rozman2019-02-221-3/+3
| | | | | | Driver <-> user-space communication is local and using native endian. Signed-off-by: Simon Rozman <simon@rozman.si>
* wintun: Make two-step slicing a one stepSimon Rozman2019-02-221-3/+3
| | | | | | | Stop relying to Go compiler optimizations and calculate the end offset directly. Signed-off-by: Simon Rozman <simon@rozman.si>
* wintun: Write exchange buffer increased back to 1MiBSimon Rozman2019-02-201-5/+4
| | | | Signed-off-by: Simon Rozman <simon@rozman.si>
* wintun: Migrate from unsafe buffer handling to encoding/binarySimon Rozman2019-02-201-5/+8
| | | | Signed-off-by: Simon Rozman <simon@rozman.si>
* wintun: Adopt new packet data alignmentSimon Rozman2019-02-201-10/+10
| | | | Signed-off-by: Simon Rozman <simon@rozman.si>
* wintun: CleanupSimon Rozman2019-02-201-2/+2
| | | | Signed-off-by: Simon Rozman <simon@rozman.si>
* wintun: Add TUN device lockingSimon Rozman2019-02-201-40/+64
| | | | | | | | | | | | In case reading from TUN device detected TUN device was closed, it closed the file handle and set tunFile to nil. The tunFile is automatically reopened on retry, but... If another packet comes in the WireGuard calls Write() method. With tunFile set to nil, this will cause access violation. Therefore, locking was introduced. Signed-off-by: Simon Rozman <simon@rozman.si>
* wintun: Move exchange buffer in separate struct on heapSimon Rozman2019-02-201-33/+44
| | | | | | | | | This allows buffer alignment and keeps it together with its meta-data. Furthermore, the write buffer has been reduced - as long as we flush after _every_ write, we don't need a 1MiB write buffer. Signed-off-by: Simon Rozman <simon@rozman.si>
* wintun: Switch to dynamic packet sizesSimon Rozman2019-02-191-50/+46
| | | | Signed-off-by: Simon Rozman <simon@rozman.si>
* Change package pathJason A. Donenfeld2019-02-181-1/+1
|
* wintun: Auto-calculate TUN exchange buffer sizeSimon Rozman2019-02-081-8/+7
| | | | Signed-off-by: Simon Rozman <simon@rozman.si>
* wintun: Simplify Read method()Simon Rozman2019-02-081-51/+51
| | | | Signed-off-by: Simon Rozman <simon@rozman.si>