A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
tap-device-creator.cc File Reference
#include "creator-utils.h"
#include "ns3/mac48-address.h"
#include <arpa/inet.h>
#include <cstring>
#include <errno.h>
#include <fcntl.h>
#include <iomanip>
#include <iostream>
#include <linux/if_tun.h>
#include <net/if.h>
#include <net/route.h>
#include <netinet/in.h>
#include <sstream>
#include <stdint.h>
#include <stdlib.h>
#include <sys/ioctl.h>
#include <sys/socket.h>
#include <sys/types.h>
#include <sys/un.h>
#include <unistd.h>
+ Include dependency graph for tap-device-creator.cc:

Go to the source code of this file.

Classes

struct  in6_ifreq
 Struct holding IPv6 address data. More...
 

Macros

#define TAP_MAGIC   95549
 

Functions

int CreateTap (char *deviceName, const char *mac, bool ifftap, bool iffpi, const char *ip4, const char *netmask, const char *ip6, const int netprefix)
 
void SetIpv4 (const char *deviceName, const char *ip, const char *netmask)
 
void SetIpv6 (const char *deviceName, const char *ip, int netprefix)
 
void SetMacAddress (int fd, const char *mac)
 
void SetUp (char *deviceName)
 

Macro Definition Documentation

◆ TAP_MAGIC

#define TAP_MAGIC   95549

Function Documentation

◆ CreateTap()

int CreateTap ( char * deviceName,
const char * mac,
bool ifftap,
bool iffpi,
const char * ip4,
const char * netmask,
const char * ip6,
const int netprefix )

Definition at line 148 of file tap-device-creator.cc.

References ABORT_IF, LOG, SetIpv4(), SetIpv6(), SetMacAddress(), and SetUp().

+ Here is the call graph for this function:

◆ SetIpv4()

void SetIpv4 ( const char * deviceName,
const char * ip,
const char * netmask )

Definition at line 45 of file tap-device-creator.cc.

References ABORT_IF, and LOG.

Referenced by CreateTap().

+ Here is the caller graph for this function:

◆ SetIpv6()

void SetIpv6 ( const char * deviceName,
const char * ip,
int netprefix )

Definition at line 83 of file tap-device-creator.cc.

References ABORT_IF, in6_ifreq::ifr6_addr, in6_ifreq::ifr6_ifindex, in6_ifreq::ifr6_prefixlen, and LOG.

Referenced by CreateTap().

+ Here is the caller graph for this function:

◆ SetMacAddress()

void SetMacAddress ( int fd,
const char * mac )

Definition at line 117 of file tap-device-creator.cc.

References ABORT_IF, ns3::Mac48Address::CopyTo(), and LOG.

Referenced by CreateTap().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ SetUp()

void SetUp ( char * deviceName)

Definition at line 129 of file tap-device-creator.cc.

References ABORT_IF, and LOG.

Referenced by CreateTap().

+ Here is the caller graph for this function: