aboutsummaryrefslogtreecommitdiff
path: root/tun/tun_windows.go (follow)
Commit message (Collapse)AuthorAgeFilesLines
* 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>
* wintun: Make constants private and adopt Go recommended caseSimon Rozman2019-02-081-29/+29
| | | | Signed-off-by: Simon Rozman <simon@rozman.si>
* wintun: Check for user close in read loop regardless the loadSimon Rozman2019-02-081-24/+22
| | | | | | | | | Do the WaitForSingleObject() always to provide high-load responsiveness. Reorder events so TUN_SIGNAL_CLOSE has priority over TUN_SIGNAL_DATA_AVAIL, to provide high-load responsiveness at all. Signed-off-by: Simon Rozman <simon@rozman.si>
* wintun: Adjust tunRWQueue.left member to match Wintun driverSimon Rozman2019-02-081-2/+2
| | | | Signed-off-by: Simon Rozman <simon@rozman.si>
* wintun: Detect if a foreign interface with the same name existsSimon Rozman2019-02-071-3/+13
| | | | Signed-off-by: Simon Rozman <simon@rozman.si>
* wintun: add FlushInterface stubJason A. Donenfeld2019-02-071-0/+5
|
* wintun: Introduce new package for obscuring Windows bitsJason A. Donenfeld2019-02-071-480/+13
|
* tun_windows: StyleJason A. Donenfeld2019-02-071-11/+13
|
* tun_windows: Introduce preliminary TUN interface creationSimon Rozman2019-02-061-5/+492
| | | | Signed-off-by: Simon Rozman <simon@rozman.si>
* tun_windows: Stop checking minimum size of received TUN packetsSimon Rozman2019-02-061-2/+1
| | | | Signed-off-by: Simon Rozman <simon@rozman.si>
* Fix up errors and pathsJason A. Donenfeld2019-02-051-7/+7
|
* Import windows scafoldingJason A. Donenfeld2019-02-051-0/+286