aboutsummaryrefslogtreecommitdiffstats
path: root/wg_dynamic_client.c
diff options
context:
space:
mode:
authorTushar Pankaj <tushar.s.pankaj@gmail.com>2018-11-07 10:59:13 -0600
committerTushar Pankaj <tushar.s.pankaj@gmail.com>2018-11-07 10:59:13 -0600
commit1f73168641d92917dc942c3d6cc200fb7f557674 (patch)
tree6d3116a873b4b9d6cd06cc3cb4781204133950c8 /wg_dynamic_client.c
parentAdd Makefile library includes for capnp (diff)
parentWrite basic mains so project compiles (diff)
downloadwg-dynamic-1f73168641d92917dc942c3d6cc200fb7f557674.tar.xz
wg-dynamic-1f73168641d92917dc942c3d6cc200fb7f557674.zip
Merge branch 'master' into tp/protocol_draft
Diffstat (limited to 'wg_dynamic_client.c')
-rw-r--r--wg_dynamic_client.c33
1 files changed, 33 insertions, 0 deletions
diff --git a/wg_dynamic_client.c b/wg_dynamic_client.c
new file mode 100644
index 0000000..318714d
--- /dev/null
+++ b/wg_dynamic_client.c
@@ -0,0 +1,33 @@
+/* SPDX-License-Identifier: MIT */
+/*
+ * Copyright (C) 2018 Wireguard LLC
+ */
+
+#include "client.h"
+
+#include <stdlib.h>
+#include <stdio.h>
+
+const char *PROG_NAME;
+
+static void show_usage()
+{
+ fprintf(stderr, "Usage: %s <interface>\n\n", PROG_NAME);
+}
+
+int main(int argc, char *argv[])
+{
+ PROG_NAME = argv[0];
+
+ if (argc == 1) {
+ show_usage();
+ return EXIT_FAILURE;
+ }
+
+ if (connect_to_server(argv[1]) < 0) {
+ perror("error connecting to server");
+ return EXIT_FAILURE;
+ }
+
+ return EXIT_SUCCESS;
+}