#include <arpa/inet.h>
#include <unistd.h>
#include <stdint.h>
#include <iostream>
#include <iomanip>
#include <sstream>
#include <stdlib.h>
#include <errno.h>
#include <fcntl.h>
#include <sys/ioctl.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <sys/un.h>
#include <net/if.h>
#include <linux/if_tun.h>
#include <net/route.h>
#include <netinet/in.h>
#include "creator-utils.h"
Go to the source code of this file.
Classes | |
struct | in6_ifreq |
Struct holding IPv6 address data. More... | |
Macros | |
#define | ASCII_a (0x41) |
#define | ASCII_A (0x61) |
#define | ASCII_COLON (0x3a) |
#define | ASCII_DOT (0x2e) |
#define | ASCII_z (0x5a) |
#define | ASCII_Z (0x7a) |
#define | ASCII_ZERO (0x30) |
#define | ASCII_ZERO (0x30) |
#define | TAP_MAGIC 95549 |
Functions | |
char | AsciiToLowCase (char c) |
void | AsciiToMac48 (const char *str, uint8_t addr[6]) |
int | CreateTap (char *deviceName, const char *mac, const int ifftap, const int 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 ASCII_a (0x41) |
Definition at line 46 of file tap-device-creator.cc.
Referenced by AsciiToLowCase(), and AsciiToMac48().
#define ASCII_A (0x61) |
Definition at line 48 of file tap-device-creator.cc.
Referenced by AsciiToLowCase().
#define ASCII_COLON (0x3a) |
Definition at line 50 of file tap-device-creator.cc.
Referenced by AsciiToMac48().
#define ASCII_DOT (0x2e) |
Definition at line 44 of file tap-device-creator.cc.
#define ASCII_z (0x5a) |
Definition at line 47 of file tap-device-creator.cc.
Referenced by AsciiToLowCase().
#define ASCII_Z (0x7a) |
Definition at line 49 of file tap-device-creator.cc.
Referenced by AsciiToLowCase().
#define ASCII_ZERO (0x30) |
Definition at line 51 of file tap-device-creator.cc.
Referenced by AsciiToMac48().
#define ASCII_ZERO (0x30) |
Definition at line 51 of file tap-device-creator.cc.
#define TAP_MAGIC 95549 |
Definition at line 39 of file tap-device-creator.cc.
char AsciiToLowCase | ( | char | c | ) |
void AsciiToMac48 | ( | const char * | str, |
uint8_t | addr[6] | ||
) |
Definition at line 82 of file tap-device-creator.cc.
References ASCII_a, ASCII_COLON, ASCII_ZERO, and ns3::AsciiToLowCase().
Referenced by SetMacAddress().
int CreateTap | ( | char * | deviceName, |
const char * | mac, | ||
const int | ifftap, | ||
const int | iffpi, | ||
const char * | ip4, | ||
const char * | netmask, | ||
const char * | ip6, | ||
const int | netprefix | ||
) |
Definition at line 223 of file tap-device-creator.cc.
References ABORT_IF, LOG, third::mac, SetIpv4(), SetIpv6(), SetMacAddress(), and SetUp().
void SetIpv4 | ( | const char * | deviceName, |
const char * | ip, | ||
const char * | netmask | ||
) |
Definition at line 113 of file tap-device-creator.cc.
Referenced by CreateTap().
void SetIpv6 | ( | const char * | deviceName, |
const char * | ip, | ||
int | netprefix | ||
) |
Definition at line 153 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 190 of file tap-device-creator.cc.
References ABORT_IF, AsciiToMac48(), LOG, and third::mac.
Referenced by CreateTap().
void SetUp | ( | char * | deviceName | ) |
Definition at line 202 of file tap-device-creator.cc.
Referenced by CreateTap(), and Ipv4DynamicGlobalRoutingTestCase::DoRun().