#include <unistd.h>
#include <stdint.h>
#include <string>
#include <cstring>
#include <iostream>
#include <iomanip>
#include <sstream>
#include <cstdlib>
#include <cerrno>
#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 "tap-encode-decode.h"
Go to the source code of this file.
Macros | |
#define | ABORT(msg, printErrno) |
#define | ABORT_IF(cond, msg, printErrno) |
#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 | LOG(msg) |
#define | TAP_MAGIC 95549 |
Functions | |
static uint32_t | AsciiToIpv4 (const char *address) |
static char | AsciiToLowCase (char c) |
static void | AsciiToMac48 (const char *str, uint8_t addr[6]) |
static sockaddr | CreateInetAddress (uint32_t networkOrder) |
static int | CreateTap (const char *dev, const char *gw, const char *ip, const char *mac, const char *mode, const char *netmask) |
static void | SendSocket (const char *path, int fd) |
Variables | |
static int | gVerbose = 0 |
#define ABORT | ( | msg, | |
printErrno | |||
) |
Definition at line 50 of file tap-creator.cc.
#define ABORT_IF | ( | cond, | |
msg, | |||
printErrno | |||
) |
Definition at line 58 of file tap-creator.cc.
#define ASCII_a (0x41) |
Definition at line 69 of file tap-creator.cc.
#define ASCII_A (0x61) |
Definition at line 71 of file tap-creator.cc.
#define ASCII_COLON (0x3a) |
Definition at line 73 of file tap-creator.cc.
#define ASCII_DOT (0x2e) |
Definition at line 67 of file tap-creator.cc.
#define ASCII_z (0x5a) |
Definition at line 70 of file tap-creator.cc.
#define ASCII_Z (0x7a) |
Definition at line 72 of file tap-creator.cc.
#define ASCII_ZERO (0x30) |
Definition at line 74 of file tap-creator.cc.
#define ASCII_ZERO (0x30) |
Definition at line 74 of file tap-creator.cc.
#define LOG | ( | msg | ) |
Definition at line 44 of file tap-creator.cc.
#define TAP_MAGIC 95549 |
Definition at line 40 of file tap-creator.cc.
|
static |
Definition at line 89 of file tap-creator.cc.
References first::address, ASCII_DOT, and ASCII_ZERO.
Referenced by CreateTap().
|
static |
Definition at line 77 of file tap-creator.cc.
References ASCII_a, ASCII_A, ASCII_z, and ASCII_Z.
Referenced by AsciiToMac48().
|
static |
Definition at line 111 of file tap-creator.cc.
References ASCII_a, ASCII_COLON, ASCII_ZERO, and AsciiToLowCase().
Referenced by CreateTap().
|
static |
Definition at line 142 of file tap-creator.cc.
Referenced by CreateTap().
|
static |
Definition at line 277 of file tap-creator.cc.
References ABORT_IF, AsciiToIpv4(), AsciiToMac48(), CreateInetAddress(), LOG, and third::mac.
|
static |
Definition at line 155 of file tap-creator.cc.
References ABORT_IF, LOG, TAP_MAGIC, and ns3::TapStringToBuffer().
|
static |
Definition at line 42 of file tap-creator.cc.