Main Page | Namespace List | Class Hierarchy | Alphabetical List | Compound List | File List | Compound Members | File Members

SourceRoutingModule Class Reference

#include <rtmodule.h>

Inheritance diagram for SourceRoutingModule:

Inheritance graph
[legend]
Collaboration diagram for SourceRoutingModule:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 SourceRoutingModule ()
virtual const char * module_name () const
virtual int command (int argc, const char *const *argv)
Nodenode ()
virtual int attach (Node *n)
void route_notify (RoutingModule *rtm)
void unreg_route_notify (RoutingModule *rtm)
virtual void add_route (char *dst, NsObject *target)
virtual void delete_route (char *dst, NsObject *nullagent)
void set_table_size (int nn)
void set_table_size (int level, int csize)

Public Attributes

RoutingModulenext_rtm_

Protected Attributes

Noden_
Classifierclassifier_

Constructor & Destructor Documentation

SourceRoutingModule::SourceRoutingModule  )  [inline]
 

Definition at line 116 of file rtmodule.h.

00116 : RoutingModule() {}


Member Function Documentation

void RoutingModule::add_route char *  dst,
NsObject target
[virtual, inherited]
 

Reimplemented in MPLSModule, ManualRoutingModule, VcRoutingModule, and LmsRoutingModule.

Definition at line 417 of file rtmodule.cc.

References RoutingModule::classifier_, Classifier::do_install(), and RoutingModule::next_rtm_.

Referenced by ManualRoutingModule::add_route(), Node::add_route(), MPLSModule::add_route(), and RoutingModule::delete_route().

00418 {
00419         if (classifier_) 
00420                 classifier_->do_install(dst,target); 
00421         if (next_rtm_ != NULL)
00422                 next_rtm_->add_route(dst, target); 
00423 }

Here is the call graph for this function:

virtual int RoutingModule::attach Node n  )  [inline, virtual, inherited]
 

Definition at line 59 of file rtmodule.h.

References RoutingModule::n_.

00059 { n_ = n; return TCL_OK; }

int SourceRoutingModule::command int  argc,
const char *const *  argv
[virtual]
 

Reimplemented from RoutingModule.

Definition at line 187 of file rtmodule.cc.

References RoutingModule::command(), RoutingModule::n_, RoutingModule::node(), Node::route_notify(), and Node::unreg_route_notify().

00187                                                                  {
00188         Tcl& tcl = Tcl::instance();
00189         if (argc == 3) {
00190                 if (strcmp(argv[1] , "route-notify") == 0) {
00191                         Node *node = (Node *)(TclObject::lookup(argv[2]));
00192                         if (node == NULL) {
00193                                 tcl.add_errorf("Invalid node object %s", argv[2]);
00194                                 return TCL_ERROR;
00195                         }
00196                         if (node != n_) {
00197                                 tcl.add_errorf("Node object %s different from n_", argv[2]);
00198                                 return TCL_ERROR;
00199                         }
00200                         n_->route_notify(this);
00201                         return TCL_OK;
00202                 }
00203                 if (strcmp(argv[1] , "unreg-route-notify") == 0) {
00204                         Node *node = (Node *)(TclObject::lookup(argv[2]));
00205                         if (node == NULL) {
00206                                 tcl.add_errorf("Invalid node object %s", argv[2]);
00207                                 return TCL_ERROR;
00208                         }
00209                         if (node != n_) {
00210                                 tcl.add_errorf("Node object %s different from n_", argv[2]);
00211                                 return TCL_ERROR;
00212                         }
00213                         n_->unreg_route_notify(this);
00214                         return TCL_OK;
00215                 }
00216         }
00217         return (RoutingModule::command(argc, argv));
00218 }

Here is the call graph for this function:

void RoutingModule::delete_route char *  dst,
NsObject nullagent
[virtual, inherited]
 

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:

virtual const char* SourceRoutingModule::module_name  )  const [inline, virtual]
 

Reimplemented from RoutingModule.

Definition at line 117 of file rtmodule.h.

00117 { return "Source"; }

Node* RoutingModule::node void   )  [inline, inherited]
 

Definition at line 49 of file rtmodule.h.

References RoutingModule::n_.

Referenced by VcRoutingModule::command(), ManualRoutingModule::command(), HierRoutingModule::command(), McastRoutingModule::command(), QSRoutingModule::command(), command(), BaseRoutingModule::command(), and MPLSModule::command().

00049 { return n_; }

void RoutingModule::route_notify RoutingModule rtm  )  [inherited]
 

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 }

void RoutingModule::set_table_size int  level,
int  csize
[inherited]
 

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:

void RoutingModule::set_table_size int  nn  )  [inherited]
 

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:

void RoutingModule::unreg_route_notify RoutingModule rtm  )  [inherited]
 

Definition at line 404 of file rtmodule.cc.

References RoutingModule::next_rtm_.

Referenced by Node::unreg_route_notify().

00404                                                          {
00405         if (next_rtm_) {
00406                 if (next_rtm_ == rtm) {
00407                         //RoutingModule *tmp = next_rtm_;
00408                         next_rtm_ = next_rtm_->next_rtm_;
00409                         //free (tmp);
00410                 }
00411                 else {
00412                         next_rtm_->unreg_route_notify(rtm);
00413                 }
00414         }
00415 }


Member Data Documentation

Classifier* RoutingModule::classifier_ [protected, inherited]
 

Reimplemented in BaseRoutingModule, McastRoutingModule, HierRoutingModule, and ManualRoutingModule.

Definition at line 74 of file rtmodule.h.

Referenced by RoutingModule::add_route(), MPLSModule::add_route(), MPLSModule::command(), RoutingModule::delete_route(), RoutingModule::RoutingModule(), and RoutingModule::set_table_size().

Node* RoutingModule::n_ [protected, inherited]
 

Definition at line 73 of file rtmodule.h.

Referenced by RoutingModule::attach(), VcRoutingModule::command(), ManualRoutingModule::command(), HierRoutingModule::command(), McastRoutingModule::command(), QSRoutingModule::command(), command(), BaseRoutingModule::command(), RoutingModule::command(), MPLSModule::command(), and RoutingModule::node().

RoutingModule* RoutingModule::next_rtm_ [inherited]
 

Definition at line 70 of file rtmodule.h.

Referenced by ManualRoutingModule::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().


The documentation for this class was generated from the following files:
Generated on Tue Apr 20 13:25:11 2004 for NS2.26SourcesOriginal by doxygen 1.3.3