51#define DROP_UNKNOWN_PORT_NUMBER \
53#define DROP_RECEIVED_DUPLICATED_PACKET \
56#define HDR_UWUDP(P) (hdr_uwudp::access(P))
125 virtual void recv(Packet *);
133 virtual void recv(Packet *,
int);
145 virtual int command(
int,
const char *
const *);
161 std::cout <<
"UWUDP packets IDs:" << std::endl;
162 std::cout <<
"PT_UWUDP: \t\t" <<
PT_UWUDP << std::endl;
172 map<uint16_t, map_packets_el>
UwUdp class is used to manage UWUDP packets, and flows to and from upper modules.
virtual int command(int, const char *const *)
TCL command interpreter.
map< int, int > port_map
Map: value = port; key = id.
virtual int assignPort(Module *)
Associates a module with a port.
map< int, int > id_map
Map: value = id; key = port.
uint16_t portcounter
Counter used to generate new port numbers.
UwUdp()
Constructor of UwUdp class.
static int getUdpHeaderSize()
Returns the size in byte of a hdr_uwudp packet header.
virtual void recv(Packet *)
Performs the reception of packets from upper and lower layers.
std::map< uint8_t, std::set< int > > map_packets_el
std::map< uint16_t, map_packets_el > map_packets
Map used to keep track of the packets received by each port.
int drop_duplicated_packets_
Flat to enable or disable the drop of duplicated packets.
int debug_
Flag to enable or disable dirrefent levels of debug.
void printIdsPkts() const
Prints the IDs of the packet's headers defined by UWUDP.
virtual ~UwUdp()
Destructor of UwUdp class.
hdr_uwudp describes UWUDP packets.
static int offset_
Required by the PacketHeaderManager.
uint8_t dport_
Destination port number.
static struct hdr_uwudp * access(const Packet *p)
uint8_t & sport()
Reference to the sport_ variable.
uint8_t sport_
Source port number.
uint8_t & dport()
Reference to the dport_ variable.
static int & offset()
Reference to the offset_ variable.
Provides the UWIP packets header description. Definition of the class that define the network layer.