From 303a6f2294ef018acfa08ac2737bea7b4f865e7b Mon Sep 17 00:00:00 2001 From: Sapan Bhatia Date: Thu, 2 Sep 2010 16:07:49 -0400 Subject: [PATCH] Create tun devices in addition to tap devices --- support/tap_test.c | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 support/tap_test.c diff --git a/support/tap_test.c b/support/tap_test.c new file mode 100644 index 0000000..947019f --- /dev/null +++ b/support/tap_test.c @@ -0,0 +1,26 @@ +#include +#include +#include +#include +#include + +#include "tunalloc.h" + +int main(void) +{ + printf("Allocating tap device via VSYS\n"); + + char if_name[IFNAMSIZ]; + + int tun_fd = tun_alloc(IFF_TAP, if_name); + + printf("Allocated tap device: %s fd=%d\n", if_name, tun_fd); + + printf("Sleeping for 120 secs...\n"); + + sleep(120); + + printf("Closing\n"); + + return 0; +} -- 2.43.0