parse ipv6-packets for the vpn-functionality
[oweals/gnunet.git] / src / vpn / test.c
1 #include <stdio.h>
2 #include <stdlib.h>
3 #include <sys/socket.h>
4
5 #include <linux/if.h>
6
7 #include "packet.h"
8 #include "tun.h"
9 #include "debug.h"
10
11 int main(int c, char** v) {
12         //char* dev = (char*) malloc(IFNAMSIZ);
13         char dev[IFNAMSIZ];
14         int fd = init_tun(dev);
15
16         debug(1, 0, "Initialized the interface %s.\n", dev);
17
18         struct pkt_tun* pkt;
19
20         printf("read %d bytes from socket, now to parse'em\n", recv_pkt(fd, &pkt));
21
22         struct ip6_pkt* pkt6 = parse_ip6(pkt);
23
24         pkt_printf(pkt6);
25 }