52#define DROP_UNKNOWN_PORT_NUMBER \
54#define DROP_RECEIVED_DUPLICATED_PACKET \
57#define HDR_UWUDP(P) (hdr_uwudp::access(P))
128 virtual void recv(Packet *)
override;
136 virtual void recv(Packet *,
int)
override;
148 virtual int command(
int,
const char *
const *)
override;
164 std::cout <<
"UWUDP packets IDs:" << std::endl;
165 std::cout <<
"PT_UWUDP: \t\t" <<
PT_UWUDP << std::endl;
177 std::map<uint16_t, map_packets_el>
UwUdp class is used to manage UWUDP packets, and flows to and from upper modules.
std::map< int, int > port_map
Map application module id to port number (id, port_number).
std::map< int, int > id_map
Map port number to application module id (port_number, id).
virtual int command(int, const char *const *) override
TCL command interpreter.
virtual void recv(Packet *) override
Performs the reception of packets from upper and lower layers.
virtual ~UwUdp()=default
Destructor of UwUdp class.
virtual int assignPort(Module *)
Associates a module with a 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.
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_
Flag to enable or disable the drop of duplicated packets.
int debug_
Flag to enable or disable debug.
void printIdsPkts() const
Prints the IDs of the packet's headers defined by UWUDP.
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.
std::map< uint8_t, std::set< int > > map_packets_el