diff options
Diffstat (limited to 'wg_dynamic_client.c')
-rw-r--r-- | wg_dynamic_client.c | 33 |
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..cf136a5 --- /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 wg-dynamic server: "); + return EXIT_FAILURE; + } + + return EXIT_SUCCESS; +} |