38#ifndef UWMULTI_DESTINATION_H
39#define UWMULTI_DESTINATION_H
134 virtual int command(
int,
const char *
const *);
151 virtual void recv(Packet *p);
Class used to represents the UwMultiDestination layer of a node.
UwMultiDestination()
Constructor of UwMultiDestination class.
int default_lower_id
Maps a layer id into an IP_range.
std::list< layer_IPrange > layer_list
int lower_id_active_
Id of the current lower layer active.
@ UW_AUTOMATIC_SWITCH
State to switch-mode automatically.
@ UW_MANUAL_SWITCH
State to switch-mode manually.
virtual void recvFromUpperLayers(Packet *p)
Default lower id to use if dest adress is not found in the considered IP ranges.
static int const layer_not_exist
This constant is returned when a searched layer does not exist>
int debug_
Flag to activate debug verbosity.
virtual bool checkNotOverlap(IP_range range)
return true if there is not overlap between the new range and the previous rnage in the list
virtual ~UwMultiDestination()
Destructor of UwMultiDestination class.
Mode switch_mode_
Current switch mode (either AUTOMATIC or MANUAL).
virtual int command(int, const char *const *)
TCL command interpreter.
virtual void recv(Packet *p)
recv method.
virtual bool addLayer(IP_range range, int id)
Add a layer in the layer map if the IP range is valide, i.e., if the range doesn't overlap with an ex...
virtual int getDestinationLayer(Packet *p)
Return the best layer to forward the packet when the system works in AUTOMATIC_MODE.
IP_range(int min, int max)
bool isInRange(int addr)
Check if the given IP addr is in the range.
int max_IP
Maximum IP address of the range.
int min_IP
Minimum IP address of the range.
bool overlappingRange(IP_range range)
Return true if the 2 ranges are not overlapped.
bool overlappingRange(int min, int max)
Return true if the 2 ranges are overlapped.
Provides the UWIP packets header description. Definition of the class that define the network layer.
std::pair< int, IP_range > layer_IPrange