aboutsummaryrefslogtreecommitdiffstats
path: root/WireGuard/WireGuard/VPN (follow)
Commit message (Collapse)AuthorAgeFilesLines
...
* TunnelsManager: initialize observer on correct threadJason A. Donenfeld2018-11-031-5/+7
| | | | | | Because of the callback recursion, this function needs to always be called from the right thread Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* TunnelsManager: do not track currentTunnelJason A. Donenfeld2018-11-031-33/+6
| | | | | | It's error prone and does not give us anything. Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* TunnelsManager: do not change back to inactive if we are resolving the endpointJason A. Donenfeld2018-11-031-0/+5
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* TunnelsManager: fix use of arrayslice in addMultipleJason A. Donenfeld2018-11-031-5/+4
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* TunnelsManager: get rid of name setJason A. Donenfeld2018-11-031-16/+4
| | | | | | | Instead, tunnels itself should be a sorted-set. For now it's a list, which is probably fine though. Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* TunnelsManager: get rid of index managementJason A. Donenfeld2018-11-031-47/+27
| | | | | | | No need for premature optimization. There aren't that many tunnels most of the time, and calling sort on a partially sorted array is fast. Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* Global: no periods at the end of error messagesJason A. Donenfeld2018-11-031-5/+5
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* Import: rework addMultiple logicJason A. Donenfeld2018-11-031-13/+10
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* DNSResolver: Bugfix: Always call completion handlerRoopesh Chander2018-11-021-1/+4
| | | | Signed-off-by: Roopesh Chander <roop@roopc.net>
* DNSResolver: getaddrinfo returns a sockaddr and inet_ntop takes strlenJason A. Donenfeld2018-11-021-4/+6
| | | | | | The way this was written before was totally wrong. Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* TunnelsManager: Better errorsRoopesh Chander2018-11-011-4/+4
| | | | Signed-off-by: Roopesh Chander <roop@roopc.net>
* VPN: TunnelsManager: Fix deletion codeRoopesh Chander2018-11-011-1/+1
| | | | Signed-off-by: Roopesh Chander <roop@roopc.net>
* VPN: Restart tunnel after modifying a currently active configurationRoopesh Chander2018-11-011-7/+27
| | | | Signed-off-by: Roopesh Chander <roop@roopc.net>
* VPN: We have to start observing the tunnelContainer before we attempt to activate itRoopesh Chander2018-11-011-1/+1
| | | | Signed-off-by: Roopesh Chander <roop@roopc.net>
* VPN: Introduce an error enum for adding/modifying/removing tunnelsRoopesh Chander2018-11-011-11/+28
| | | | Signed-off-by: Roopesh Chander <roop@roopc.net>
* VPN: TunnelsManager: s/TunnelsManagerError/TunnelActivationError/g;Roopesh Chander2018-11-011-6/+6
| | | | Signed-off-by: Roopesh Chander <roop@roopc.net>
* VPN: TunnelsManager should keep track of tunnel names to prevent duplicate namesRoopesh Chander2018-11-011-0/+17
| | | | Signed-off-by: Roopesh Chander <roop@roopc.net>
* TunnelManager: bound recursion in startActivationJason A. Donenfeld2018-10-311-3/+11
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* VPN: Retry startTunnel based on error conditionsRoopesh Chander2018-10-311-11/+58
| | | | Signed-off-by: Roopesh Chander <roop@roopc.net>
* VPN: Support adding multiple configurations in one shotRoopesh Chander2018-10-311-0/+21
| | | | Signed-off-by: Roopesh Chander <roop@roopc.net>
* VPN: Refactor use of DNS resolution while activating the tunnelRoopesh Chander2018-10-301-40/+56
| | | | Signed-off-by: Roopesh Chander <roop@roopc.net>
* Global: fix up captialization in headersJason A. Donenfeld2018-10-303-3/+3
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* VPN: Better error messagesRoopesh Chander2018-10-301-1/+6
| | | | Signed-off-by: Roopesh Chander <roop@roopc.net>
* VPN: Specify an error when there are no peers with an endpointRoopesh Chander2018-10-291-0/+5
| | | | Signed-off-by: Roopesh Chander <roop@roopc.net>
* VPN: If we don't have to make a DNS request, we shouldn't enter that statusRoopesh Chander2018-10-292-13/+43
| | | | Signed-off-by: Roopesh Chander <roop@roopc.net>
* VPN: Cache DNS resolutions while the app is in memoryRoopesh Chander2018-10-291-6/+22
| | | | Signed-off-by: Roopesh Chander <roop@roopc.net>
* VPN: Reload the tunnel before starting it upRoopesh Chander2018-10-291-9/+12
| | | | | | To avoid errors like this: https://stackoverflow.com/q/47550706 Signed-off-by: Roopesh Chander <roop@roopc.net>
* VPN: Fix deletion of tunnelsRoopesh Chander2018-10-291-1/+3
| | | | Signed-off-by: Roopesh Chander <roop@roopc.net>
* VPN: A tunnel may be already active on app startupRoopesh Chander2018-10-281-9/+21
| | | | Signed-off-by: Roopesh Chander <roop@roopc.net>
* VPN: Remove ability to deactivate the tunnel while resolving DNSRoopesh Chander2018-10-281-13/+7
| | | | Signed-off-by: Roopesh Chander <roop@roopc.net>
* VPN: DNSResolver: Resolve multiple endpoints in parallelRoopesh Chander2018-10-281-21/+32
| | | | Signed-off-by: Roopesh Chander <roop@roopc.net>
* VPN: Save the tunnel name when modifying a tunnelRoopesh Chander2018-10-281-0/+3
| | | | Signed-off-by: Roopesh Chander <roop@roopc.net>
* VPN: Cleaner derivation of subnet mask from CIDR network prefix lengthRoopesh Chander2018-10-281-14/+8
| | | | Signed-off-by: Roopesh Chander <roop@roopc.net>
* VPN: Better error and status handlingRoopesh Chander2018-10-271-73/+49
| | | | Signed-off-by: Roopesh Chander <roop@roopc.net>
* VPN: Bring up the tunnelRoopesh Chander2018-10-272-1/+183
| | | | | | | | | | The app figures out all settings and passes them in the 'options' parameter of startTunnel(). The network extension just takes them as is and just plugs the supplied values into the right places. Signed-off-by: Roopesh Chander <roop@roopc.net>
* VPN: Fix DNS resolution APIRoopesh Chander2018-10-272-9/+25
| | | | Signed-off-by: Roopesh Chander <roop@roopc.net>
* VPN: Perform DNS resolution before starting the tunnelRoopesh Chander2018-10-271-10/+29
| | | | Signed-off-by: Roopesh Chander <roop@roopc.net>
* VPN: DNSResolver: A class that does DNS resolution using getaddrinfoRoopesh Chander2018-10-271-0/+93
| | | | Signed-off-by: Roopesh Chander <roop@roopc.net>
* VPN: Activating, deactivating and tracking the statusRoopesh Chander2018-10-271-14/+159
| | | | Signed-off-by: Roopesh Chander <roop@roopc.net>
* Model: Add a version number to the tunnelRoopesh Chander2018-10-271-1/+2
| | | | Signed-off-by: Roopesh Chander <roop@roopc.net>
* VPN: Adding, modifying and deleting actual NETunnelProviderManager instancesRoopesh Chander2018-10-271-40/+141
| | | | Signed-off-by: Roopesh Chander <roop@roopc.net>
* Model: Allow creating an interface with empty nameRoopesh Chander2018-10-271-0/+1
| | | | | | | | But don't allow such a tunnel to be added to the tunnel manager. (We'll need to create an interface with an empty name when we're reading QR codes.) Signed-off-by: Roopesh Chander <roop@roopc.net>
* VPN: Tunnel container shall provide direct access to the configuration objectRoopesh Chander2018-10-271-1/+4
| | | | Signed-off-by: Roopesh Chander <roop@roopc.net>
* Tunnel creation: After saving the new tunnel, show the detail viewRoopesh Chander2018-10-271-2/+2
| | | | Signed-off-by: Roopesh Chander <roop@roopc.net>
* Smaller copyright headersRoopesh Chander2018-10-271-7/+2
| | | | Signed-off-by: Roopesh Chander <roop@roopc.net>
* Tunnels list: Update when a tunnel is addedRoopesh Chander2018-10-271-0/+6
| | | | Signed-off-by: Roopesh Chander <roop@roopc.net>
* Model: Name should be part of the interface, not the tunnelRoopesh Chander2018-10-271-1/+1
| | | | Signed-off-by: Roopesh Chander <roop@roopc.net>
* VPN: Add TunnelsManager to manage the tunnels in the appRoopesh Chander2018-10-271-0/+82
Signed-off-by: Roopesh Chander <roop@roopc.net>