summaryrefslogtreecommitdiffstats
path: root/openvpn.c
diff options
context:
space:
mode:
authorDavid Sommerseth <dazo@users.sourceforge.net>2011-07-28 23:56:24 +0200
committerDavid Sommerseth <dazo@users.sourceforge.net>2011-07-28 23:56:24 +0200
commit98619012e242176bcbdc3215fa462fa2cf882e36 (patch)
tree0b5178b62a70fb162a1afe44b0608018a4d92c52 /openvpn.c
parent15bd346ca01806bea3f697bbc93a979e4b4035f1 (diff)
downloadopenvpn-98619012e242176bcbdc3215fa462fa2cf882e36.tar.gz
openvpn-98619012e242176bcbdc3215fa462fa2cf882e36.tar.xz
openvpn-98619012e242176bcbdc3215fa462fa2cf882e36.zip
Added main/control docs
Signed-off-by: Adriaan de Jong <dejong@fox-it.com> Acked-by: James Yonan <james@openvpn.net> Signed-off-by: David Sommerseth <dazo@users.sourceforge.net>
Diffstat (limited to 'openvpn.c')
-rw-r--r--openvpn.c31
1 files changed, 31 insertions, 0 deletions
diff --git a/openvpn.c b/openvpn.c
index 99b343b..520fda1 100644
--- a/openvpn.c
+++ b/openvpn.c
@@ -42,6 +42,16 @@ process_signal_p2p (struct context *c)
return process_signal (c);
}
+
+
+/**************************************************************************/
+/**
+ * Main event loop for OpenVPN in client mode, where only one VPN tunnel
+ * is active.
+ * @ingroup eventloop
+ *
+ * @param c - The context structure of the single active VPN tunnel.
+ */
static void
tunnel_point_to_point (struct context *c)
{
@@ -90,6 +100,27 @@ tunnel_point_to_point (struct context *c)
#undef PROCESS_SIGNAL_P2P
+
+/**************************************************************************/
+/**
+ * OpenVPN's main init-run-cleanup loop.
+ * @ingroup eventloop
+ *
+ * This function contains the two outer OpenVPN loops. Its structure is
+ * as follows:
+ * - Once-per-process initialization.
+ * - Outer loop, run at startup and then once per \c SIGHUP:
+ * - Level 1 initialization
+ * - Inner loop, run at startup and then once per \c SIGUSR1:
+ * - Call event loop function depending on client or server mode:
+ * - \c tunnel_point_to_point()
+ * - \c tunnel_server()
+ * - Level 1 cleanup
+ * - Once-per-process cleanup.
+ *
+ * @param argc - Commandline argument count.
+ * @param argv - Commandline argument values.
+ */
int
main (int argc, char *argv[])
{