diff options
Diffstat (limited to 'main.c')
| -rw-r--r-- | main.c | 31 |
1 files changed, 31 insertions, 0 deletions
@@ -0,0 +1,31 @@ +#include <stdlib.h> +#include <unistd.h> +#include <stdio.h> +#include <err.h> + +#include "tunnel.h" +#include "macro.h" + +int main(int argc __unused, char *argv[] __unused) +{ +#if 0 + if (geteuid() != 0) + errx(EXIT_FAILURE, "running as root required"); +#endif + + int sock = tunnel_client(); + if (sock < 0) + errx(EXIT_FAILURE, "tunnel_connect failed"); + + char buf[512]; + + int n = read(sock, buf, sizeof(buf)); + if (n < 0) + err(EXIT_FAILURE, "read"); + + printf("%.*s\n", n, buf); + + close(sock); + + return 0; +} |
