#include <unistd.h>
#include <string>
#include <iostream>
#include <iomanip>
#include <sstream>
#include <stdlib.h>
#include <errno.h>
#include <sys/socket.h>
#include <sys/un.h>
#include <sys/ioctl.h>
#include <net/ethernet.h>
#include <net/if.h>
#include <netinet/in.h>
#include <netpacket/packet.h>
#include <arpa/inet.h>
#include "emu-encode-decode.h"
Go to the source code of this file.
Defines | |
#define | EMU_MAGIC 65867 |
#define | LOG(msg) |
#define | ABORT(msg, printErrno) |
#define | ABORT_IF(cond, msg, printErrno) |
Functions | |
static void | SendSocket (const char *path, int fd) |
Send the socket file descriptor we created back to the emu device, which will read it as soon as we're done. | |
int | main (int argc, char *argv[]) |
Variables | |
static int | gVerbose = 0 |
#define ABORT | ( | msg, | |||
printErrno | ) |
std::cout << __FILE__ << ": fatal error at line " << __LINE__ << ": " << __FUNCTION__ << "(): " << msg << std::endl; \ if (printErrno) \ { \ std::cout << " errno = " << errno << " (" << strerror (errno) << ")" << std::endl; \ } \ exit (-1);
Definition at line 48 of file emu-sock-creator.cc.
#define ABORT_IF | ( | cond, | |||
msg, | |||||
printErrno | ) |
if (cond) \ { \ ABORT(msg, printErrno); \ }
Definition at line 56 of file emu-sock-creator.cc.
Referenced by main(), and SendSocket().
#define EMU_MAGIC 65867 |
Definition at line 38 of file emu-sock-creator.cc.
#define LOG | ( | msg | ) |
if (gVerbose) \ { \ std::cout << __FUNCTION__ << "(): " << msg << std::endl; \ }
Definition at line 42 of file emu-sock-creator.cc.
Referenced by main(), and SendSocket().
int main | ( | int | argc, | |
char * | argv[] | |||
) |
Definition at line 195 of file emu-sock-creator.cc.
References ABORT_IF, gVerbose, LOG, and SendSocket().
static void SendSocket | ( | const char * | path, | |
int | fd | |||
) | [static] |
Send the socket file descriptor we created back to the emu device, which will read it as soon as we're done.
path | The socket address information from the Unix socket we use to send the created socket back to. | |
fd | The socket we're going to send. |
Definition at line 71 of file emu-sock-creator.cc.
References ABORT_IF, EMU_MAGIC, ns3::EmuStringToBuffer(), and LOG.
Referenced by main().
int gVerbose = 0 [static] |
Definition at line 40 of file emu-sock-creator.cc.
Referenced by main().