38#ifndef UWMULTI_MULTIPHY_CONTROLLER_H
39#define UWMULTI_MULTIPHY_CONTROLLER_H
60 return "PT_UWMULTIPHY_DATA";
63 return "PT_UWMULTIPHY_PING";
66 return "PT_UWMULTIPHY_PONG";
68 return "Unknown packet";
77 case LINK_OK:
return o <<
"LINK_OK";
79 default:
return o<<
"(invalid value)";
102 os <<
"<LocalConnection(trafficType=" << c.
trafficType <<
"," <<
"localMacID=" << c.
localMacID <<
")>";
126 os <<
"<RemoteConnection(localMacID=" << c.
localMacID <<
"," <<
"remoteIP=" << c.
remoteIP <<
")>";
233 virtual int command(
int,
const char*
const*);
235 void recv(Packet *p);
237 void recv(Packet *p,
int idSrc);
252 virtual void expire(Event *e);
273 if (this->module != NULL && this->module->debug_ >= 3) {
275 <<
"::UwMultiPhyControl::ResilienceTimer::constructor"
276 <<
"::localIP(" << this->
module->localIP << ")"
277 << "::localMAC(" << this->conn.localMacID << ")"
278 << "::remoteIP(" << this->conn.remoteIP << ")"
283 if (this->module != NULL && this->module->debug_ >= 3) {
285 <<
"::UwMultiPhyControl::ResilienceTimer::destructor"
286 <<
"::localMacID(" << this->conn.
localMacID <<
")"
287 <<
"::remoteIP(" << this->conn.
remoteIP <<
")"
288 <<
"::module(" << this->
module << ")"
289 << "::this(" << this << ")"
304 virtual void expire(Event *e);
327 if (this->module != NULL && this->module->debug_ >= 3) {
329 <<
"::UwMultiPhyControl::ProbeTimer::destructor"
330 <<
"::localMacID(" << this->conn.
localMacID <<
")"
331 <<
"::remoteIP(" << this->conn.
remoteIP <<
")"
332 <<
"::module(" << this->
module << ")"
333 << "::this(" << this << ")"
packet_t PT_UWMULTIPHY_PONG
packet_t PT_UWMULTIPHY_PING
packet_t PT_UWMULTIPHY_DATA
friend std::ostream & operator<<(std::ostream &, const PriorityMap &)
std::map< int, int > defaultPriorities
void addCustomPriority(LocalConnection c, int priority)
Set MAC priority for packets coming from a specific traffic type.
int getPriority(LocalConnection c)
Get priority of a certain MAC for packets of given traffic type (using default priority if a custom o...
std::map< LocalConnection, int > customPriorities
void setDefaultPriority(int macID, int priority)
Set MAC default priority regardless of origin traffic type.
ProbeTimer(UwMultiPhyControl *m, RemoteConnection c)
UwMultiPhyControl *RemoteConnection conn
virtual void expire(Event *e)
Timer expire procedure: handles the PROBE timeout.
UwMultiPhyControl *RemoteConnection conn
< Pointer to the module class where the timer is used
virtual void expire(Event *e)
Timer expire procedure: handles the PROBE timeout.
ResilienceTimer(UwMultiPhyControl *m, RemoteConnection c)
Class used to represents the UwMultiPhyControl layer of a node.
std::map< RemoteConnection, ResilienceTimer > resilienceTimers
UwMultiPhyControl()
Constructor of UwMultiPhy class.
std::vector< int > macIDs
std::map< RemoteConnection, int > linkStatuses
std::map< int, double > resilienceTimeouts
std::queue< Packet * > packet_queue
std::map< int, int > macTclIdLayerId
int getBestMacID(int trafficType, int remoteIP)
void updateAvailability(RemoteConnection c, LinkStatus status)
void recvFromUpperLayers(Packet *p)
std::map< RemoteConnection, ProbeTimer > probeTimers
void sendPing(RemoteConnection c)
virtual int command(int, const char *const *)
void recvFromLowerLayers(Packet *p, int macID)
std::map< int, double > probeTimeouts
std::map< int, int > macResilience
<macID, resilience> where resilience score enstablish an order across local MAC layers: if a less rob...
virtual ~UwMultiPhyControl()
Destructor of UwMultiPhy class.
bool operator<(const LocalConnection &o) const
friend std::ostream & operator<<(std::ostream &os, const LocalConnection &c)
bool operator==(const LocalConnection &o) const
friend std::ostream & operator<<(std::ostream &os, const RemoteConnection &c)
bool operator<(const RemoteConnection &o) const
bool operator==(const RemoteConnection &o) const
Provides the UWCBR packets header description and the definition of the class UWCBR.
Provides the UWIP packets header description. Definition of the class that define the network layer.
std::ostream & operator<<(std::ostream &o, LinkStatus s)
std::string printType(packet_t ptype)