aboutsummaryrefslogtreecommitdiffstats
path: root/ipc (unfollow)
Commit message (Collapse)AuthorFilesLines
2019-06-14tun: remove TUN prefix from types to reduce stutter elsewhereMatt Layher10-67/+66
Signed-off-by: Matt Layher <mdlayher@gmail.com>
2019-06-11device: update transfer counters correctlyJason A. Donenfeld3-4/+9
The rule is to always update them to the full packet size minus UDP/IP encapsulation for all authenticated packet types.
2019-06-11wintun: increase registry timeoutJason A. Donenfeld1-1/+1
2019-06-10wintun: add helper for cleaning upJason A. Donenfeld1-9/+82
2019-06-10wintun: simplify error matching and remove dumb commentsJason A. Donenfeld1-19/+4
2019-06-10wintun: fix comments and remove hwnd paramJason A. Donenfeld2-124/+55
This now looks more idiomatic.
2019-06-10setupapi: add SetDeviceRegistryPropertyString descriptionSimon Rozman1-1/+2
Signed-off-by: Simon Rozman <simon@rozman.si>
2019-06-10setupapi: unify ERROR_INSUFFICIENT_BUFFER handlingSimon Rozman1-58/+32
Signed-off-by: Simon Rozman <simon@rozman.si>
2019-06-10wintun: allow controlling GUIDJason A. Donenfeld2-2/+29
2019-06-10setupapi: add DeviceInstanceID()Jason A. Donenfeld3-0/+41
2019-06-06global: fixup TODO comment spacingJason A. Donenfeld7-11/+11
2019-06-06wintun: guid functions are upstreamJason A. Donenfeld7-120/+14
2019-06-06wintun: simplify DeleteInterface method signatureSimon Rozman2-58/+79
Signed-off-by: Simon Rozman <simon@rozman.si>
2019-06-05wintun: don't run HrRenameConnection in separate threadJason A. Donenfeld1-3/+2
It's very slow, but unfortunately we haven't a choice. NLA needs this to have completed.
2019-06-05tun: windows: obsolete 256 packets per exchange buffer limitationSimon Rozman1-2/+1
Signed-off-by: Simon Rozman <simon@rozman.si>
2019-06-04setupapi, wintun: replace syscall with golang.org/x/sys/windowsSimon Rozman4-36/+32
Signed-off-by: Simon Rozman <simon@rozman.si>
2019-06-04wintun: set DI_QUIETINSTALL flag for GUI-less device managementSimon Rozman1-3/+26
Signed-off-by: Simon Rozman <simon@rozman.si>
2019-06-04setupapi: define PropChangeParams structSimon Rozman1-1/+20
This structure is required for calling DIF_PROPERTYCHANGE installer class. Signed-off-by: Simon Rozman <simon@rozman.si>
2019-06-04device: remove redundant return statementsMatt Layher1-3/+0
More staticcheck fixes: $ staticcheck ./... | grep S1023 device/noise-helpers.go:45:2: redundant return statement (S1023) device/noise-helpers.go:54:2: redundant return statement (S1023) device/noise-helpers.go:64:2: redundant return statement (S1023) Signed-off-by: Matt Layher <mdlayher@gmail.com>
2019-06-04device: use bytes.Equal for equality check, simplify assertEqualMatt Layher1-2/+2
Signed-off-by: Matt Layher <mdlayher@gmail.com>
2019-06-03device, ratelimiter: replace uses of time.Now().Sub() with time.Since()Matt Layher5-11/+11
Simplification found by staticcheck: $ staticcheck ./... | grep S1012 device/cookie.go:90:5: should use time.Since instead of time.Now().Sub (S1012) device/cookie.go:127:5: should use time.Since instead of time.Now().Sub (S1012) device/cookie.go:242:5: should use time.Since instead of time.Now().Sub (S1012) device/noise-protocol.go:304:13: should use time.Since instead of time.Now().Sub (S1012) device/receive.go:82:46: should use time.Since instead of time.Now().Sub (S1012) device/send.go:132:5: should use time.Since instead of time.Now().Sub (S1012) device/send.go:139:5: should use time.Since instead of time.Now().Sub (S1012) device/send.go:235:59: should use time.Since instead of time.Now().Sub (S1012) device/send.go:393:9: should use time.Since instead of time.Now().Sub (S1012) ratelimiter/ratelimiter.go:79:10: should use time.Since instead of time.Now().Sub (S1012) ratelimiter/ratelimiter.go:87:10: should use time.Since instead of time.Now().Sub (S1012) Change applied using: $ find . -type f -name "*.go" -exec sed -i "s/Now().Sub(/Since(/g" {} \; Signed-off-by: Matt Layher <mdlayher@gmail.com>
2019-06-03ipc/winpipe: go fmtMatt Layher1-1/+1
Signed-off-by: Matt Layher <mdlayher@gmail.com>
2019-05-31tun: windows: mitigate infinite loop in Flush()Jason A. Donenfeld1-29/+35
It's possible that for whatever reason, we keep returning EOF, resulting in repeated close/open/write operations, except with empty packets.
2019-05-30device: add SendKeepalivesToPeersWithCurrentKeypair for handoverJason A. Donenfeld1-0/+17
2019-05-29tai64n: account for whitening in testJason A. Donenfeld1-3/+7
2019-05-29device, tun: rearrange code and fix device testsMatt Layher3-103/+86
Signed-off-by: Matt Layher <mdlayher@gmail.com>
2019-05-26wintun: remove extra /Jason A. Donenfeld1-1/+1
2019-05-25device: darwin actually doesn't need bound interfacesJason A. Donenfeld1-44/+0
2019-05-25device: make initiations per second match kernel implementationJason A. Donenfeld1-1/+1
2019-05-24device: timers: add jitter on ack failure reinitiationJason A. Donenfeld1-1/+1
2019-05-24wintun: revise GetInterface()Simon Rozman2-3/+6
- 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>
2019-05-23wintun: never return nil, nilJason A. Donenfeld1-1/+1
2019-05-23ipc: use simplified fork of winioJason A. Donenfeld8-20/+1162
2019-05-22setupapi: trim "Get" from gettersSimon Rozman5-53/+53
Signed-off-by: Simon Rozman <simon@rozman.si>
2019-05-17wintun: don't try to flush interface, but rather deleteJason A. Donenfeld2-25/+8
2019-05-17device: fail to give bind if it doesn't existJason A. Donenfeld2-2/+13
2019-05-17wintun: make certain methods privateJason A. Donenfeld2-33/+41
2019-05-17version: bump snapshot0.0.20190517Jason A. Donenfeld1-1/+1
2019-05-17makefile: do not show warning on non-linuxJason A. Donenfeld1-1/+1
2019-05-17wintun: change acronyms to uppercaseSimon Rozman1-5/+5
Signed-off-by: Simon Rozman <simon@rozman.si>
2019-05-14global: regroup all importsJason A. Donenfeld27-44/+70
2019-05-11wintun: registry: fix nitsJason A. Donenfeld1-17/+20
2019-05-11wintun: registry: revise value readingSimon Rozman2-67/+82
- Make getStringValueRetry() reusable for reading any value type. This merges code from GetIntegerValueWait(). - expandString() >> toString() and extend to support REG_MULTI_SZ (to return first value of REG_MULTI_SZ). Furthermore, doing our own UTF-16 to UTF-8 conversion works around a bug in windows/registry's GetStringValue() non-zero terminated string handling. - Provide toInteger() analogous to toString() - GetStringValueWait() tolerates and reads REG_MULTI_SZ too now. It returns REG_MULTI_SZ[0], making GetFirstStringValueWait() redundant. Signed-off-by: Simon Rozman <simon@rozman.si>
2019-05-10wintun: call HrRenameConnection in another threadJason A. Donenfeld1-2/+3
2019-05-10wintun: add LUID accessorJason A. Donenfeld1-0/+7
2019-05-10wintun: enumerate faster by using COMPATDRIVER instead of CLASSDRIVERJason A. Donenfeld1-1/+1
2019-05-10wintun: destroy devinfolist after usageJason A. Donenfeld1-0/+1
2019-05-10wintun: registry: replace REG_NOTIFY with NOTIFYSimon Rozman3-13/+9
Signed-off-by: Simon Rozman <simon@rozman.si>
2019-05-10wintun: IpConfig is a MULTI_SZ, and fix errorsJason A. Donenfeld2-49/+72
2019-05-10wintun: poll for device keyJason A. Donenfeld1-9/+10
It's actually pretty hard to guess where it is.