src/devices/emu/emu-sock-creator.cc File Reference

#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"
Include dependency graph for emu-sock-creator.cc:

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 Documentation

#define ABORT ( msg,
printErrno   ) 
Value:
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   ) 
Value:
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   ) 
Value:
if (gVerbose) \
    { \
      std::cout << __FUNCTION__ << "(): " << msg << std::endl;   \
    }

Definition at line 42 of file emu-sock-creator.cc.

Referenced by main(), and SendSocket().


Function Documentation

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.

Parameters:
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().


Variable Documentation

int gVerbose = 0 [static]

Definition at line 40 of file emu-sock-creator.cc.

Referenced by main().

Generated on Thu Dec 3 14:06:59 2009 for NS-3 by  doxygen 1.6.3