From 5bbd32aaefa1baacdd8edd90efd4f8b609cbbc87 Mon Sep 17 00:00:00 2001 From: Tushar Pankaj Date: Tue, 6 Nov 2018 23:12:56 -0600 Subject: Write basic main Signed-off-by: Tushar Pankaj --- .gitignore | 4 ++++ wg-dynamic-client.c | 29 +++++++++++++++++++++++++++++ wg-dynamic-server.c | 29 +++++++++++++++++++++++++++++ 3 files changed, 62 insertions(+) diff --git a/.gitignore b/.gitignore index 9755cc7..841b8d5 100644 --- a/.gitignore +++ b/.gitignore @@ -53,3 +53,7 @@ dkms.conf # Editor temporaries *~ + +# Binaries +wg-dynamic-client +wg-dynamic-server diff --git a/wg-dynamic-client.c b/wg-dynamic-client.c index 87e3946..a8399ff 100644 --- a/wg-dynamic-client.c +++ b/wg-dynamic-client.c @@ -2,3 +2,32 @@ /* * Copyright (C) 2018 Wireguard LLC */ + +#include +#include + +const char *PROG_NAME; + +/* TODO: break this function out into another file when it gets big */ +static void connect_to_server(char *interface) +{ +} + +static void show_usage() +{ + fprintf(stderr, "Usage: %s \n\n", PROG_NAME); +} + +int main(int argc, char *argv[]) +{ + PROG_NAME = argv[0]; + + if (argc == 1) { + show_usage(); + return EXIT_FAILURE; + } + + connect_to_server(argv[1]); + + return EXIT_SUCCESS; +} diff --git a/wg-dynamic-server.c b/wg-dynamic-server.c index 87e3946..a8e2924 100644 --- a/wg-dynamic-server.c +++ b/wg-dynamic-server.c @@ -2,3 +2,32 @@ /* * Copyright (C) 2018 Wireguard LLC */ + +#include +#include + +const char *PROG_NAME; + +/* TODO: break this function out into another file when it gets big */ +static void setup_server(char *interface) +{ +} + +static void show_usage() +{ + fprintf(stderr, "Usage: %s \n\n", PROG_NAME); +} + +int main(int argc, char *argv[]) +{ + PROG_NAME = argv[0]; + + if (argc == 1) { + show_usage(); + return EXIT_FAILURE; + } + + setup_server(argv[1]); + + return EXIT_SUCCESS; +} -- cgit v1.2.3-59-g8ed1b