#include <rtmodule.h>
Inheritance diagram for ManualRoutingModule:


Public Member Functions | |
| ManualRoutingModule () | |
| virtual const char * | module_name () const |
| virtual int | command (int argc, const char *const *argv) |
| void | add_route (char *dst, NsObject *target) |
| Node * | node () |
| virtual int | attach (Node *n) |
| void | route_notify (RoutingModule *rtm) |
| void | unreg_route_notify (RoutingModule *rtm) |
| virtual void | delete_route (char *dst, NsObject *nullagent) |
| void | set_table_size (int nn) |
| void | set_table_size (int level, int csize) |
Public Attributes | |
| RoutingModule * | next_rtm_ |
Protected Attributes | |
| DestHashClassifier * | classifier_ |
| Node * | n_ |
|
|
Definition at line 106 of file rtmodule.h.
00106 : RoutingModule() {} |
|
||||||||||||
|
Reimplemented from RoutingModule. Definition at line 470 of file rtmodule.cc. References RoutingModule::add_route(), classifier_, HashClassifier::do_set_hash(), Classifier::install_next(), AddrParamsClass::instance(), RoutingModule::next_rtm_, AddrParamsClass::node_shift(), and HashClassifier::set_default().
00470 {
00471 int slot = classifier_->install_next(target);
00472 if (strcmp(dst, "default") == 0) {
00473 classifier_->set_default(slot);
00474 } else {
00475 int encoded_dst_address =
00476 (atoi(dst)) << (AddrParamsClass::instance().node_shift(1));
00477 if (0 > (classifier_->do_set_hash(0, encoded_dst_address, 0, slot))) {
00478 fprintf(stderr, "HashClassifier::set_hash() return value less than 0\n"); }
00479 }
00480 if (next_rtm_ != NULL)
00481 next_rtm_->add_route(dst, target);
00482 }
|
Here is the call graph for this function:

|
|
Definition at line 59 of file rtmodule.h. References RoutingModule::n_.
00059 { n_ = n; return TCL_OK; }
|
|
||||||||||||
|
Reimplemented from RoutingModule. Definition at line 328 of file rtmodule.cc. References RoutingModule::command(), RoutingModule::n_, RoutingModule::node(), Node::route_notify(), and Node::unreg_route_notify().
00328 {
00329 Tcl& tcl = Tcl::instance();
00330 if (argc == 3) {
00331 if (strcmp(argv[1] , "route-notify") == 0) {
00332 Node *node = (Node *)(TclObject::lookup(argv[2]));
00333 if (node == NULL) {
00334 tcl.add_errorf("Invalid node object %s", argv[2]);
00335 return TCL_ERROR;
00336 }
00337 if (node != n_) {
00338 tcl.add_errorf("Node object %s different from node_", argv[2]);
00339 return TCL_ERROR;
00340 }
00341 n_->route_notify(this);
00342 return TCL_OK;
00343 }
00344 if (strcmp(argv[1] , "unreg-route-notify") == 0) {
00345 Node *node = (Node *)(TclObject::lookup(argv[2]));
00346 if (node == NULL) {
00347 tcl.add_errorf("Invalid node object %s", argv[2]);
00348 return TCL_ERROR;
00349 }
00350 if (node != n_) {
00351 tcl.add_errorf("Node object %s different from n_", argv[2]);
00352 return TCL_ERROR;
00353 }
00354 n_->unreg_route_notify(this);
00355 return TCL_OK;
00356 }
00357 }
00358 return (RoutingModule::command(argc, argv));
00359 }
|
Here is the call graph for this function:

|
||||||||||||
|
Definition at line 425 of file rtmodule.cc. References RoutingModule::add_route(), RoutingModule::classifier_, Classifier::do_install(), and RoutingModule::next_rtm_. Referenced by Node::delete_route().
00426 {
00427 if (classifier_)
00428 classifier_->do_install(dst, nullagent);
00429 if (next_rtm_)
00430 next_rtm_->add_route(dst, nullagent);
00431 }
|
Here is the call graph for this function:

|
|
Reimplemented from RoutingModule. Definition at line 107 of file rtmodule.h.
00107 { return "Manual"; }
|
|
|
Definition at line 49 of file rtmodule.h. References RoutingModule::n_. Referenced by VcRoutingModule::command(), command(), HierRoutingModule::command(), McastRoutingModule::command(), QSRoutingModule::command(), SourceRoutingModule::command(), BaseRoutingModule::command(), and MPLSModule::command().
00049 { return n_; }
|
|
|
Definition at line 397 of file rtmodule.cc. References RoutingModule::next_rtm_. Referenced by Node::route_notify().
00397 {
00398 if (next_rtm_ != NULL)
00399 next_rtm_->route_notify(rtm);
00400 else
00401 next_rtm_ = rtm;
00402 }
|
|
||||||||||||
|
Definition at line 441 of file rtmodule.cc. References RoutingModule::classifier_, RoutingModule::next_rtm_, RoutingModule::set_table_size(), and Classifier::set_table_size().
00442 {
00443 if (classifier_)
00444 classifier_->set_table_size(level, size);
00445 if (next_rtm_)
00446 next_rtm_->set_table_size(level, size);
00447 }
|
Here is the call graph for this function:

|
|
Definition at line 433 of file rtmodule.cc. References RoutingModule::classifier_, RoutingModule::next_rtm_, and Classifier::set_table_size(). Referenced by RoutingModule::set_table_size(), and Node::set_table_size().
00434 {
00435 if (classifier_)
00436 classifier_->set_table_size(nn);
00437 if (next_rtm_)
00438 next_rtm_->set_table_size(nn);
00439 }
|
Here is the call graph for this function:

|
|
Definition at line 404 of file rtmodule.cc. References RoutingModule::next_rtm_. Referenced by Node::unreg_route_notify().
|
|
|
Reimplemented from RoutingModule. Definition at line 111 of file rtmodule.h. Referenced by add_route(). |
|
|
|
Definition at line 70 of file rtmodule.h. Referenced by add_route(), RoutingModule::add_route(), MPLSModule::add_route(), RoutingModule::delete_route(), RoutingModule::route_notify(), RoutingModule::set_table_size(), RoutingModule::unreg_route_notify(), and Node::unreg_route_notify(). |
1.3.3