the helper for the VPN service. More...
#include "platform.h"
#include "gnunet_util_lib.h"
#include "gnunet_common.h"
#include "gnunet_protocols.h"
Go to the source code of this file.
Data Structures | |
struct | in6_ifreq |
This is in linux/include/net/ipv6.h, but not always exported... More... | |
Macros | |
#define | DEBUG GNUNET_NO |
Need 'struct GNUNET_MessageHeader'. More... | |
#define | MAX_SIZE 65536 |
Maximum size of a GNUnet message (GNUNET_MAX_MESSAGE_SIZE) More... | |
Functions | |
static int | init_tun (char *dev) |
Creates a tun-interface called dev;. More... | |
static void | set_address6 (const char *dev, const char *address, unsigned long prefix_len) |
Sets the IPv6-Address given in address on the interface dev. More... | |
static void | set_address4 (const char *dev, const char *address, const char *mask) |
Sets the IPv4-Address given in address on the interface dev. More... | |
static void | run (int fd_tun) |
Start forwarding to and from the tunnel. More... | |
int | main (int argc, char **argv) |
Open VPN tunnel interface. More... | |
the helper for the VPN service.
Opens a virtual network-interface, sends data received on the if to stdout, sends data received on stdin to the interface
The following list of people have reviewed this code and considered it safe since the last modification (if you reviewed it, please have your name added to the list):
Definition in file gnunet-helper-vpn.c.
#define DEBUG GNUNET_NO |
Need 'struct GNUNET_MessageHeader'.
Need VPN message types. Should we print (interesting|debug) messages that can happen during normal operation?
Definition at line 55 of file gnunet-helper-vpn.c.
#define MAX_SIZE 65536 |
Maximum size of a GNUnet message (GNUNET_MAX_MESSAGE_SIZE)
Definition at line 60 of file gnunet-helper-vpn.c.
|
static |
Creates a tun-interface called dev;.
dev | is assumed to point to a char[IFNAMSIZ] if *dev == '\0', uses the name supplied by the kernel; |
Definition at line 85 of file gnunet-helper-vpn.c.
Referenced by main().
|
static |
Sets the IPv6-Address given in address on the interface dev.
dev | the interface to configure |
address | the IPv6-Address |
prefix_len | the length of the network-prefix |
Definition at line 146 of file gnunet-helper-vpn.c.
References address, in6_ifreq::ifr6_addr, in6_ifreq::ifr6_ifindex, and in6_ifreq::ifr6_prefixlen.
Referenced by main().
|
static |
Sets the IPv4-Address given in address on the interface dev.
dev | the interface to configure |
address | the IPv4-Address |
mask | the netmask |
Definition at line 265 of file gnunet-helper-vpn.c.
References address.
Referenced by main().
|
static |
Start forwarding to and from the tunnel.
fd_tun | tunnel FD |
Definition at line 385 of file gnunet-helper-vpn.c.
References GNUNET_MESSAGE_TYPE_VPN_HELPER, MAX_SIZE, GNUNET_MessageHeader::size, and GNUNET_MessageHeader::type.
Referenced by main().
int main | ( | int | argc, |
char ** | argv | ||
) |
Open VPN tunnel interface.
argc | must be 6 |
argv | 0: binary name (gnunet-helper-vpn) 1: tunnel interface name (gnunet-vpn) 2: IPv6 address (::1), "-" to disable 3: IPv6 netmask length in bits (64), ignored if #2 is "-" 4: IPv4 address (1.2.3.4), "-" to disable 5: IPv4 netmask (255.255.0.0), ignored if #4 is "-" |
Definition at line 620 of file gnunet-helper-vpn.c.
References address, cleanup(), global_ret, init_tun(), run(), set_address4(), and set_address6().