Teonet library  0.4.7
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
tuntap-unix.c File Reference
#include <sys/types.h>
#include <sys/ioctl.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <net/if.h>
#include <net/if_tun.h>
#include <netinet/if_ether.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
#include <unistd.h>
#include "tuntap.h"

Functions

int tuntap_start (struct device *dev, int mode, int tun)
 
void tuntap_release (struct device *dev)
 
int tuntap_set_descr (struct device *dev, const char *descr)
 
int tuntap_set_ifname (struct device *dev, const char *ifname)
 
char * tuntap_get_hwaddr (struct device *dev)
 
int tuntap_set_hwaddr (struct device *dev, const char *hwaddr)
 
int tuntap_up (struct device *dev)
 
int tuntap_down (struct device *dev)
 
int tuntap_get_mtu (struct device *dev)
 
int tuntap_set_mtu (struct device *dev, int mtu)
 
int tuntap_read (struct device *dev, void *buf, size_t size)
 
int tuntap_write (struct device *dev, void *buf, size_t size)
 
int tuntap_get_readable (struct device *dev)
 
int tuntap_set_nonblocking (struct device *dev, int set)
 
int tuntap_set_debug (struct device *dev, int set)
 

Function Documentation

int tuntap_down ( struct device dev)
char* tuntap_get_hwaddr ( struct device dev)

Referenced by main().

int tuntap_get_mtu ( struct device dev)

Referenced by main(), and tuntap_get_readable().

int tuntap_get_readable ( struct device dev)
int tuntap_read ( struct device dev,
void *  buf,
size_t  size 
)
void tuntap_release ( struct device dev)

Referenced by main(), and tuntap_destroy().

int tuntap_set_debug ( struct device dev,
int  set 
)

Referenced by main(), and tuntap_start().

int tuntap_set_descr ( struct device dev,
const char *  descr 
)

Referenced by main().

int tuntap_set_hwaddr ( struct device dev,
const char *  hwaddr 
)

Referenced by main().

int tuntap_set_ifname ( struct device dev,
const char *  ifname 
)

Referenced by main().

int tuntap_set_mtu ( struct device dev,
int  mtu 
)

Referenced by main().

int tuntap_set_nonblocking ( struct device dev,
int  set 
)
int tuntap_start ( struct device dev,
int  mode,
int  tun 
)

Referenced by main().

int tuntap_up ( struct device dev)

Referenced by main().

int tuntap_write ( struct device dev,
void *  buf,
size_t  size 
)