49#define NOT_FOR_ME_REASON \
51#define DESTINATION_ADDR_UNSET \
53#define ORIGINATED_BY_ME \
55#define INVALID_DESTINATION_ADDR \
58#define HDR_UWIP(P) (hdr_uwip::access(P))
134 virtual void recv(Packet *p);
146 virtual int command(
int argc,
const char *
const *argv);
164 static const string printIP(
const nsaddr_t &);
173 static const string printIP(
const uint8_t &);
181 std::cout <<
"UWIP packets IDs:" << std::endl;
182 std::cout <<
"PT_UWIP: \t\t" <<
PT_UWIP << std::endl;
UWIPModule class is used to define the Internet Protocol (IP) layer of a node.
bool addr_type_inet
true if the addressing type is INET, false if it is ILINK.
int debug_
Flag to enable or disable dirrefent levels of debug.
static const string printIP(const nsaddr_t &)
Returns a string with an IP in the classic form "x.x.x.x" converting an ns2 nsaddr_t address.
virtual void recv(Packet *p)
Performs the reception of packets from upper and lower layers.
static uint8_t lastIP
Used to set a default IP address.
static int getIpHeaderSize()
Returns the size in byte of a hdr_sun_data packet header.
virtual ~UWIPModule()
Destructor of UWIPModule class.
virtual int command(int argc, const char *const *argv)
TCL command interpreter.
UWIPModule()
Constructor of UWIPModule class.
virtual int recvSyncClMsg(ClMessage *m)
Cross-Layer messages synchronous interpreter.
void printIdsPkts() const
Prints the IDs of the packet's headers defined by UWIP.
uint8_t ipAddr_
IP address of the node.
hdr_uwip describes UWIP packets.
uint8_t & daddr()
Reference to the daddr_ variable.
uint8_t daddr_
IP of the destination.
static int & offset()
Reference to the offset_ variable.
uint8_t & saddr()
Reference to the saddr_ variable.
static int offset_
Required by the PacketHeaderManager.
static hdr_uwip * access(const Packet *p)
uint8_t saddr_
IP of the source.
static const uint8_t UWIP_BROADCAST
Variable used to represent a broadcast UWIP.