#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>
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) |
#define TAP_MAGIC 95549 |
Definition at line 30 of file tap-device-creator.cc.
Referenced by ns3::TapFdNetDeviceHelper::CreateFileDescriptor(), and ns3::TapBridge::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().
void SetIpv4 | ( | const char * | deviceName, |
const char * | ip, | ||
const char * | netmask ) |
Definition at line 45 of file tap-device-creator.cc.
Referenced by CreateTap().
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().
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().
void SetUp | ( | char * | deviceName | ) |
Definition at line 129 of file tap-device-creator.cc.
Referenced by CreateTap().