#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"
Include dependency graph for tap-device-creator.cc:Go to the source code of this file.
Classes | |
| struct | in6_ifreq |
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 79 of file tap-device-creator.cc.
References ASCII_a, ASCII_COLON, ASCII_ZERO, and ns3::AsciiToLowCase().
Referenced by SetMacAddress().
Here is the call graph for this function:
Here is the caller graph for this function:| 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 220 of file tap-device-creator.cc.
References ABORT_IF, LOG, SetIpv4(), SetIpv6(), SetMacAddress(), and SetUp().
Here is the call graph for this function:| void SetIpv4 | ( | const char * | deviceName, |
| const char * | ip, | ||
| const char * | netmask | ||
| ) |
Definition at line 110 of file tap-device-creator.cc.
Referenced by CreateTap().
Here is the caller graph for this function:| void SetIpv6 | ( | const char * | deviceName, |
| const char * | ip, | ||
| int | netprefix | ||
| ) |
Definition at line 150 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:| void SetMacAddress | ( | int | fd, |
| const char * | mac | ||
| ) |
Definition at line 187 of file tap-device-creator.cc.
References ABORT_IF, AsciiToMac48(), and LOG.
Referenced by CreateTap().
Here is the call graph for this function:
Here is the caller graph for this function:| void SetUp | ( | char * | deviceName | ) |
Definition at line 199 of file tap-device-creator.cc.
Referenced by CreateTap(), and Ipv4DynamicGlobalRoutingTestCase::DoRun().
Here is the caller graph for this function: