54 TclObject*
create(
int,
const char*
const*)
67 switch_mode_(UW_MANUAL_SWITCH),
82 if(strcasecmp(argv[1],
"setAutomaticSwitch") == 0)
87 else if(strcasecmp(argv[1],
"setManualSwitch") == 0)
95 if(strcasecmp(argv[1],
"setManualLowerlId") == 0)
107 if(strcasecmp(argv[1],
"addLayer") == 0)
109 addLayer(atoi(argv[2]),atoi(argv[3]));
118 if(strcasecmp(argv[1],
"addThreshold") == 0)
120 addThreshold(atoi(argv[2]),atoi(argv[3]),atof(argv[4]));
125 return Module::command(argc, argv);
132 id2order.insert((std::pair<int,int>(
id,order)));
134 order2id.insert((std::pair<int,int>(order,
id)));
144 hdr_cmn *ch = HDR_CMN(p);
145 if(ch->direction() == hdr_cmn::UP)
178 sendSyncClMsgDown(&m);
186 ThresMap::iterator it_thres_ij = thres_i.find(j);
187 if(it_thres_ij != thres_i.end()) {
188 thres_ij = it_thres_ij->second;
201 ThresMap::iterator it_thres_ij = thres_i.find(j);
202 if(it_thres_ij != thres_i.end())
204 if(thres_i.size() == 0)
Class that represents the binding with the tcl configuration script.
TclObject * create(int, const char *const *)
Creates the TCL object needed for the tcl language interpretation.
UwMultiStackControllerClass()
Constructor of the class.
Class used to represents the UwMultiStackController layer of a node.
virtual void addThreshold(int i, int j, double thres_ij)
set the threshold value for the transition from layer i to layer j, checking first whether the layers...
int debug_
Flag to activate debug verbosity.
virtual int getBestLayer(Packet *p)
Return the best layer to forward the packet when the system works in AUTOMATIC_MODE.
@ UW_AUTOMATIC_SWITCH
State to switch-mode automatically.
@ UW_MANUAL_SWITCH
State to switch-mode manually.
std::map< int, int > order2id
Return the layer order given its order in the threshold matrix.
virtual void addLayer(int id, int order)
Add a layer in the layer map.
virtual double getMetricFromSelectedLowerLayer(int id, Packet *p)
return the new metrics value obtained from the selected lower layer, in proactive way via ClMessage
virtual int command(int, const char *const *)
TCL command interpreter.
int lower_id_active_
<Current switch mode (either AUTOMATIC or MANUAL).
virtual void eraseThreshold(int i, int j)
remove the threshold value for the transition from layer i to layer j, checking first whether the lay...
virtual void recv(Packet *p)
recv method.
static int const layer_not_exist
This constant is returned when a searched layer does not exist>
virtual bool isLayerAvailable(int id)
return if the specified layer, identified by id, is available
UwMultiStackController()
Constructor of UwMultiPhy class.
virtual void recvFromUpperLayers(Packet *p)
By default the signaling is not employed, if it is needed, here where to set the signaling packet siz...
ThresMatrix threshold_map
Returns the switch layer theshold given a layer order.
void setThreshold(int i, int j, double thres_ij)
set the threshold value for the transition from layer i to layer j
virtual bool getThreshold(int i, int j, double &thres_ij)
get the threshold value for the transition from layer i to layer j, checking first whether the layers...
std::map< int, int > id2order
Maps each layer id to its order in the threshold matrix.
UwMultiStackControllerClass class_stack_controller
Definition of UwMultiStackController class.
std::map< int, double > ThresMap
Threshoold map <PHY_order, threshold>