#include <addr-params.h>
Inheritance diagram for AddrParamsClass:


Public Member Functions | |
| AddrParamsClass () | |
| virtual TclObject * | create (int, const char *const *) |
| virtual void | bind () |
| virtual int | method (int ac, const char *const *av) |
| int | mcast_shift () |
| int | mcast_mask () |
| int | port_shift () |
| int | port_mask () |
| int | node_shift (int n) |
| int | node_mask (int n) |
| int | hlevel () |
| int | nodebits () |
Static Public Member Functions | |
| AddrParamsClass & | instance () |
Private Attributes | |
| int | McastShift_ |
| int | McastMask_ |
| int | PortShift_ |
| int | PortMask_ |
| int | hlevel_ |
| int * | NodeMask_ |
| int * | NodeShift_ |
| int | nodebits_ |
Static Private Attributes | |
| AddrParamsClass * | instance_ = NULL |
|
|
Definition at line 41 of file addr-params.h. References hlevel_, instance_, NodeMask_, and NodeShift_.
00041 : TclClass("AddrParams"), 00042 hlevel_(1), NodeMask_(NULL), 00043 NodeShift_(NULL) { 00044 instance_ = this; 00045 } |
|
|
Definition at line 42 of file addr-params.cc.
00043 {
00044 TclClass::bind();
00045 add_method("McastShift");
00046 add_method("McastMask");
00047 add_method("NodeShift");
00048 add_method("NodeMask");
00049 add_method("PortMask");
00050 add_method("PortShift");
00051 add_method("hlevel");
00052 add_method("nodebits");
00053 }
|
|
||||||||||||
|
Definition at line 46 of file addr-params.h.
00046 {
00047 Tcl::instance().add_errorf("Cannot create instance of "
00048 "AddrParamsClass");
00049 return NULL;
00050 }
|
|
|
Definition at line 62 of file addr-params.h. References hlevel_. Referenced by HierClassifier::command(), and HierClassifier::HierClassifier().
00062 { return hlevel_; }
|
|
|
Definition at line 54 of file addr-params.h. References instance_. Referenced by ManualRoutingModule::add_route(), HierClassifier::command(), and HierClassifier::HierClassifier().
00054 { return *instance_; }
|
|
|
Definition at line 57 of file addr-params.h. References McastMask_.
00057 { return McastMask_; }
|
|
|
Definition at line 56 of file addr-params.h. References McastShift_.
00056 { return McastShift_; }
|
|
||||||||||||
|
Definition at line 55 of file addr-params.cc. References hlevel_, McastMask_, McastShift_, node_mask(), node_shift(), nodebits_, NodeMask_, NodeShift_, PortMask_, and PortShift_.
00056 {
00057 Tcl& tcl = Tcl::instance();
00058 int argc = ac - 2;
00059 const char*const* argv = av + 2;
00060
00061 if (argc == 2) {
00062 if (strcmp(argv[1], "McastShift") == 0) {
00063 tcl.resultf("%d", McastShift_);
00064 return (TCL_OK);
00065 } else if (strcmp(argv[1], "McastMask") == 0) {
00066 tcl.resultf("%d", McastMask_);
00067 return (TCL_OK);
00068 } else if (strcmp(argv[1], "PortShift") == 0) {
00069 tcl.resultf("%d", PortShift_);
00070 return (TCL_OK);
00071 } else if (strcmp(argv[1], "PortMask") == 0) {
00072 tcl.resultf("%d", PortMask_);
00073 return (TCL_OK);
00074 } else if (strcmp(argv[1], "hlevel") == 0) {
00075 tcl.resultf("%d", hlevel_);
00076 return (TCL_OK);
00077 } else if (strcmp(argv[1], "nodebits") == 0) {
00078 tcl.resultf("%d", nodebits_);
00079 return (TCL_OK);
00080 }
00081 } else if (argc == 3) {
00082 if (strcmp(argv[1], "McastShift") == 0) {
00083 McastShift_ = atoi(argv[2]);
00084 return (TCL_OK);
00085 } else if (strcmp(argv[1], "McastMask") == 0) {
00086 McastMask_ = atoi(argv[2]);
00087 return (TCL_OK);
00088 } else if (strcmp(argv[1], "PortShift") == 0) {
00089 PortShift_ = atoi(argv[2]);
00090 return (TCL_OK);
00091 } else if (strcmp(argv[1], "PortMask") == 0) {
00092 PortMask_ = atoi(argv[2]);
00093 return (TCL_OK);
00094 } else if (strcmp(argv[1], "hlevel") == 0) {
00095 hlevel_ = atoi(argv[2]);
00096 if (NodeMask_ != NULL)
00097 delete []NodeMask_;
00098 if (NodeShift_ != NULL)
00099 delete []NodeShift_;
00100 NodeMask_ = new int[hlevel_];
00101 NodeShift_ = new int[hlevel_];
00102 return (TCL_OK);
00103 } else if (strcmp(argv[1], "nodebits") == 0) {
00104 nodebits_ = atoi(argv[2]);
00105 return (TCL_OK);
00106 } else if (strcmp(argv[1], "NodeShift") == 0) {
00107 tcl.resultf("%d", node_shift(atoi(argv[2])-1));
00108 return (TCL_OK);
00109 } else if (strcmp(argv[1], "NodeMask") == 0) {
00110 tcl.resultf("%d", node_mask(atoi(argv[2])-1));
00111 return (TCL_OK);
00112 }
00113 } else if (argc == 4) {
00114 if (strcmp(argv[1], "NodeShift") == 0) {
00115 NodeShift_[atoi(argv[2])-1] = atoi(argv[3]);
00116 return (TCL_OK);
00117 } else if (strcmp(argv[1], "NodeMask") == 0) {
00118 NodeMask_[atoi(argv[2])-1] = atoi(argv[3]);
00119 return (TCL_OK);
00120 }
00121 }
00122 return TclClass::method(ac, av);
00123 }
|
Here is the call graph for this function:

|
|
Definition at line 61 of file addr-params.h. References NodeMask_. Referenced by method().
00061 { return NodeMask_[n]; }
|
|
|
Definition at line 60 of file addr-params.h. References NodeShift_. Referenced by ManualRoutingModule::add_route(), and method().
00060 { return NodeShift_[n]; }
|
|
|
Definition at line 63 of file addr-params.h. References nodebits_.
00063 { return nodebits_; }
|
|
|
Definition at line 59 of file addr-params.h. References PortMask_.
00059 { return PortMask_; }
|
|
|
Definition at line 58 of file addr-params.h. References PortShift_.
00058 { return PortShift_; }
|
|
|
Definition at line 70 of file addr-params.h. Referenced by AddrParamsClass(), hlevel(), and method(). |
|
|
Definition at line 38 of file addr-params.cc. Referenced by AddrParamsClass(), and instance(). |
|
|
Definition at line 67 of file addr-params.h. Referenced by mcast_mask(), and method(). |
|
|
Definition at line 66 of file addr-params.h. Referenced by mcast_shift(), and method(). |
|
|
Definition at line 73 of file addr-params.h. Referenced by method(), and nodebits(). |
|
|
Definition at line 71 of file addr-params.h. Referenced by AddrParamsClass(), method(), and node_mask(). |
|
|
Definition at line 72 of file addr-params.h. Referenced by AddrParamsClass(), method(), and node_shift(). |
|
|
Definition at line 69 of file addr-params.h. Referenced by method(), and port_mask(). |
|
|
Definition at line 68 of file addr-params.h. Referenced by method(), and port_shift(). |
1.3.3