IBR-DTNSuite  0.10
dtntunnel.cpp File Reference
#include "config.h"
#include <iostream>
#include <iomanip>
#include <stdlib.h>
#include <libdaemon/daemon.h>
#include "ibrdtn/api/Client.h"
#include <ibrcommon/net/socket.h>
#include "ibrcommon/thread/Mutex.h"
#include "ibrcommon/thread/MutexLock.h"
#include <ibrcommon/Logger.h>
#include <queue>
#include <csignal>
#include <unistd.h>
#include <fcntl.h>
#include <stdio.h>
#include <string.h>
#include <errno.h>
#include <sys/ioctl.h>
#include <sys/socket.h>
#include <linux/if.h>
#include <linux/if_tun.h>
Include dependency graph for dtntunnel.cpp:

Go to the source code of this file.

Functions

int tun_alloc (char *dev, short int flags)
 
void add_throughput_data (ssize_t amount, int updown)
 
void timer_display_throughput (int)
 
void term (int signal)
 
void print_help (const char *argv0)
 
int main (int argc, char *argv[])
 

Variables

size_t throughput_data_up [5] = { 0, 0, 0, 0, 0 }
 
size_t throughput_data_down [5] = { 0, 0, 0, 0, 0 }
 
int throughput_pos = 0
 
bool m_running = true
 
TUN2BundleGateway * _gateway = NULL
 

Function Documentation

void add_throughput_data ( ssize_t  amount,
int  updown 
)

Definition at line 114 of file dtntunnel.cpp.

References throughput_data_down, throughput_data_up, and throughput_pos.

void print_help ( const char *  argv0)

Definition at line 259 of file dtntunnel.cpp.

void term ( int  signal)

Definition at line 249 of file dtntunnel.cpp.

void timer_display_throughput ( int  )

Definition at line 122 of file dtntunnel.cpp.

References throughput_data_down, throughput_data_up, and throughput_pos.

Referenced by main().

int tun_alloc ( char *  dev,
short int  flags 
)

Definition at line 63 of file dtntunnel.cpp.

Variable Documentation

TUN2BundleGateway* _gateway = NULL

Definition at line 247 of file dtntunnel.cpp.

bool m_running = true

Definition at line 246 of file dtntunnel.cpp.

size_t throughput_data_down[5] = { 0, 0, 0, 0, 0 }

Definition at line 111 of file dtntunnel.cpp.

Referenced by add_throughput_data(), and timer_display_throughput().

size_t throughput_data_up[5] = { 0, 0, 0, 0, 0 }

Definition at line 110 of file dtntunnel.cpp.

Referenced by add_throughput_data(), and timer_display_throughput().

int throughput_pos = 0

Definition at line 112 of file dtntunnel.cpp.

Referenced by add_throughput_data(), and timer_display_throughput().