KeepAlive: Make sure stop() terminates the background thread

Since KeepAlive is no longer global, end the thread when the connection
finishes so we don't wind up with an ever-increasing number of idle
KeepAlive threads.

Signed-off-by: Kevin Cernekee <cernekee@gmail.com>
Load libopenconnect on application startup

Signed-off-by: Kevin Cernekee <cernekee@gmail.com>
OpenConnectManagementThread: Close the tun fd when finished

This was previously done in libopenconnect, but it needs to be handled
by the library because Java owns the file descriptor.

Also, fix visibility of private members.

Signed-off-by: Kevin Cernekee <cernekee@gmail.com>
KeepAlive: Close socket when finished

This eliminates a resource leak.

Signed-off-by: Kevin Cernekee <cernekee@gmail.com>
external: Add "make refresh" target

This provides a quick way to sync libopenconnect with my development tree.

Signed-off-by: Kevin Cernekee <cernekee@gmail.com>
OpenConnectManagementThread: Update code to reflect new mainloop return codes

Old values were 1 on pause, 0 on completion.  New values are 0 on pause,
<0 on completion (with the error code sometimes indicating the reason for
exiting).

Signed-off-by: Kevin Cernekee <cernekee@gmail.com>
external: Sync with openconnect rev fca39f4

Signed-off-by: Kevin Cernekee <cernekee@gmail.com>
libs: Sync with latest openconnect sources
Run dos2unix on all Java source files

Signed-off-by: Kevin Cernekee <cernekee@gmail.com>
Update licensing info

Add copyright+GPL headers to all Java source files.  Update
doc/LICENSE.txt to reflect the current list of external dependencies.

Signed-off-by: Kevin Cernekee <cernekee@gmail.com>
OpenConnectManagementThread: Implement /dev/tun and tun.ko workarounds

The former workaround (wrong ownership of /dev/tun) is tested.  The
latter workaround (insmod tun.ko before establishing connection) is not.

Signed-off-by: Kevin Cernekee <cernekee@gmail.com>
Disable external app control for now

External app control for OpenConnect isn't currently supported.

Signed-off-by: Kevin Cernekee <cernekee@gmail.com>