Inheritance diagram for VirtualClassifier:


Definition at line 51 of file classifier-virtual.cc.
Public Types | |
| enum | classify_ret { ONCE = -2, TWICE = -1 } |
Public Member Functions | |
| int | allocPort (NsObject *) |
| virtual void | clear (int slot) |
| virtual void | debug (const char *fmt,...) |
| virtual int | delay_bind_dispatch (const char *varName, const char *localName, TclObject *tracer) |
| virtual void | delay_bind_init_all () |
| virtual void | do_install (char *dst, NsObject *target) |
| virtual NsObject * | find (Packet *) |
| virtual void | install (int slot, NsObject *) |
| int | install_next (NsObject *node) |
| int | isdebug () const |
| int | maxslot () const |
| int | mshift (int val) |
| virtual void | recv (Packet *p, const char *s) |
| virtual void | recvOnly (Packet *) |
| void | set_default_target (NsObject *obj) |
| virtual void | set_table_size (int level, int nn) |
| void | set_table_size (int nn) |
| NsObject * | slot (int slot) |
| VirtualClassifier () | |
| ~VirtualClassifier () | |
Protected Member Functions | |
| void | alloc (int) |
| int | classify (Packet *const p) |
| int | command (int argc, const char *const *argv) |
| virtual int | getnxt (NsObject *) |
| void | handle (Event *) |
| void | recv (Packet *p, Handler *h) |
| virtual void | reset () |
Protected Attributes | |
| int | debug_ |
| NsObject * | default_target_ |
| bool | enableHrouting_ |
| Tcl_HashTable | ht_ |
| int | mask_ |
| int | maxslot_ |
| NsObject * | next_ |
| char | nodeaddr_ [SMALL_LEN] |
| int | nsize_ |
| int | nslot_ |
| int | offset_ |
| RouteLogic * | routelogic_ |
| int | shift_ |
| NsObject ** | slot_ |
| NsObject * | target_ |
|
|
Definition at line 64 of file classifier.h.
|
|
|
Definition at line 53 of file classifier-virtual.cc. References ht_. 00053 : routelogic_(0) { 00054 Tcl_InitHashTable(&ht_, TCL_ONE_WORD_KEYS); 00055 }
|
|
|
Definition at line 56 of file classifier-virtual.cc. References ht_. 00056 { 00057 Tcl_DeleteHashTable(&ht_); 00058 }
|
|
|
Definition at line 79 of file classifier.cc. References Classifier::nsize_, Classifier::nslot_, and Classifier::slot_. Referenced by ReservePortClassifier::command(), ReserveAddressClassifier::command(), Classifier::getnxt(), ReservePortClassifier::getnxt(), ReserveAddressClassifier::getnxt(), and Classifier::install(). 00080 { 00081 NsObject** old = slot_; 00082 int n = nslot_; 00083 if (old == 0) 00084 if (nsize_ != 0) { 00085 //printf("classifier %x set to %d....%dth visit\n", this, nsize_, i++); 00086 nslot_ = nsize_; 00087 } 00088 else { 00089 //printf("classifier %x set to 32....%dth visit\n", this, j++); 00090 nslot_ = 32; 00091 } 00092 while (nslot_ <= slot) 00093 nslot_ <<= 1; 00094 slot_ = new NsObject*[nslot_]; 00095 memset(slot_, 0, nslot_ * sizeof(NsObject*)); 00096 for (int i = 0; i < n; ++i) 00097 slot_[i] = old[i]; 00098 delete [] old; 00099 }
|
|
|
Definition at line 120 of file classifier.cc. References Classifier::getnxt(). 00121 { 00122 return getnxt (nullagent); 00123 }
Here is the call graph for this function: ![]() |
|
|
Reimplemented from Classifier. Definition at line 68 of file classifier-virtual.cc. References hdr_ip::access(), hdr_ip::daddr(), and Classifier::mshift(). 00068 { 00069 hdr_ip* iph = hdr_ip::access(p); 00070 return mshift(iph->daddr()); 00071 }
Here is the call graph for this function: ![]() |
|
|
Reimplemented in ReserveAddressClassifier, and ReservePortClassifier. Definition at line 111 of file classifier.cc. References Classifier::maxslot_, and Classifier::slot_. Referenced by Classifier::command(), and HierClassifier::command(). 00112 { 00113 slot_[slot] = 0; 00114 if (slot == maxslot_) { 00115 while (--maxslot_ >= 0 && slot_[maxslot_] == 0) 00116 ; 00117 } 00118 }
|
|
||||||||||||
|
Reimplemented from Classifier. Definition at line 115 of file classifier-virtual.cc. References NsObject::command(), and nodeaddr_. 00115 { 00116 if (argc == 3) { 00117 if (strcmp(argv[1], "nodeaddr") == 0) { 00118 strcpy(nodeaddr_, argv[2]); 00119 return(TCL_OK); 00120 } 00121 } 00122 return (NsObject::command(argc, argv)); 00123 }
Here is the call graph for this function: ![]() |
|
||||||||||||
|
Definition at line 102 of file object.cc. References NsObject::debug_. 00103 { 00104 if (!debug_) 00105 return; 00106 va_list ap; 00107 va_start(ap, fmt); 00108 vprintf(fmt, ap); 00109 }
|
|
||||||||||||||||
|
Reimplemented in BayFullTcpAgent, Agent, MPLSAddressClassifier, LDPAgent, HbAfterRtoSctpAgent, MfrHbAfterRtoSctpAgent, MfrTimestampSctpAgent, MultipleFastRtxSctpAgent, NewRenoSctpAgent, TimestampSctpAgent, SctpAgent, FullTcpAgent, SackFullTcpAgent, RFC793eduTcpAgent, TcpSink, TcpAgent, VegasTcpAgent, XcpAgent, and XcpSink. Definition at line 63 of file object.cc. References NsObject::debug_. Referenced by MPLSAddressClassifier::delay_bind_dispatch(), and Agent::delay_bind_dispatch(). 00064 { 00065 if (delay_bind_bool(varName, localName, "debug_", &debug_, tracer)) 00066 return TCL_OK; 00067 return TclObject::delay_bind_dispatch(varName, localName, tracer); 00068 }
|
|
|
Reimplemented in BayFullTcpAgent, Agent, MPLSAddressClassifier, LDPAgent, HbAfterRtoSctpAgent, MfrHbAfterRtoSctpAgent, MfrTimestampSctpAgent, MultipleFastRtxSctpAgent, NewRenoSctpAgent, TimestampSctpAgent, SctpAgent, FullTcpAgent, SackFullTcpAgent, RFC793eduTcpAgent, TcpSink, TcpAgent, VegasTcpAgent, XcpAgent, and XcpSink. Definition at line 57 of file object.cc. Referenced by MPLSAddressClassifier::delay_bind_init_all(), and Agent::delay_bind_init_all().
|
|
||||||||||||
|
Reimplemented from Classifier. Definition at line 59 of file classifier-virtual.cc.
|
|
|
Reimplemented in BcastAddressClassifier, QSClassifier, NixClassifier, and SRClassifier. Definition at line 159 of file classifier.cc. References Classifier::classify(), Classifier::default_target_, Classifier::nslot_, Classifier::slot_, and Classifier::TWICE. Referenced by FlowMon::drop(), FlowMon::edrop(), FlowMon::find(), FlowMon::in(), Tagger::in(), FlowMon::mon_edrop(), FlowMon::out(), MIPDecapsulator::recv(), Classifier::recv(), MacClassifier::recv(), MCastBSTClassifier::recv(), and SctpAgent::SetSource(). 00160 { 00161 NsObject* node = NULL; 00162 int cl = classify(p); 00163 if (cl < 0 || cl >= nslot_ || (node = slot_[cl]) == 0) { 00164 if (default_target_) 00165 return default_target_; 00166 /* 00167 * Sigh. Can't pass the pkt out to tcl because it's 00168 * not an object. 00169 */ 00170 Tcl::instance().evalf("%s no-slot %ld", name(), cl); 00171 if (cl == TWICE) { 00172 /* 00173 * Try again. Maybe callback patched up the table. 00174 */ 00175 cl = classify(p); 00176 if (cl < 0 || cl >= nslot_ || (node = slot_[cl]) == 0) 00177 return (NULL); 00178 } 00179 } 00180 return (node); 00181 }
Here is the call graph for this function: ![]() |
|
|
Reimplemented in ReserveAddressClassifier, and ReservePortClassifier. Definition at line 125 of file classifier.cc. References Classifier::alloc(), Classifier::nslot_, and Classifier::slot_. Referenced by Classifier::allocPort(), Classifier::command(), and DestHashClassifier::do_install(). 00126 { 00127 int i; 00128 for (i=0; i < nslot_; i++) 00129 if (slot_[i]==0 || slot_[i]==nullagent) 00130 return i; 00131 i=nslot_; 00132 alloc(nslot_); 00133 return i; 00134 }
Here is the call graph for this function: ![]() |
|
|
Implements Handler. Reimplemented in LinkDelay, LL, AckRecons, and Snoop. Definition at line 91 of file object.cc. References NsObject::recv().
Here is the call graph for this function: ![]() |
|
||||||||||||
|
Reimplemented in MPLSAddressClassifier. Definition at line 102 of file classifier.cc. References Classifier::alloc(), Classifier::maxslot_, Classifier::nslot_, and Classifier::slot_. Referenced by Classifier::command(), Classifier::do_install(), HierClassifier::do_install(), DestHashClassifier::do_install(), MPLSAddressClassifier::install(), and Classifier::install_next(). 00103 { 00104 if (slot >= nslot_) 00105 alloc(slot); 00106 slot_[slot] = p; 00107 if (slot >= maxslot_) 00108 maxslot_ = slot; 00109 }
Here is the call graph for this function: ![]() |
|
|
Definition at line 183 of file classifier.cc. References Classifier::install(), Classifier::maxslot_, and Classifier::slot(). Referenced by ManualRoutingModule::add_route(), and Classifier::command().
Here is the call graph for this function: ![]() |
|
|
Definition at line 61 of file object.h. References NsObject::debug_. 00061 { return debug_; }
|
|
|
Definition at line 49 of file classifier.h. References Classifier::maxslot_. Referenced by FlowMon::dumpflows(), Tagger::dumpflows(), FlowMon::flow_list(), and Tagger::flow_list(). 00049 { return maxslot_; }
|
|
|
Definition at line 55 of file classifier.h. References Classifier::mask_, and Classifier::shift_. Referenced by Classifier::classify(), classify(), AddressClassifier::classify(), DestHashClassifier::hashkey(), SrcDestHashClassifier::hashkey(), SrcDestFidHashClassifier::hashkey(), and HashClassifier::lookup().
|
|
||||||||||||
|
Reimplemented in CMUTrace. Definition at line 96 of file object.cc. References Packet::free(). 00097 { 00098 Packet::free(p); 00099 }
Here is the call graph for this function: ![]() |
|
||||||||||||
|
Reimplemented from Classifier. Definition at line 73 of file classifier-virtual.cc. References hdr_ip::access(), hdr_ip::daddr(), Packet::free(), ht_, Address::instance(), RouteLogic::lookup_flat(), nodeaddr_, Address::print_nodeaddr(), NsObject::recv(), routelogic_, and target_. 00073 { 00074 if (!routelogic_) { 00075 Tcl &tcl = Tcl::instance(); 00076 tcl.evalc("[Simulator instance] get-routelogic"); 00077 routelogic_= (RouteLogic*) TclObject::lookup(tcl.result()); 00078 //tcl.evalf("%s info class", tcl.result()); 00079 } 00080 /* first we find the next hop by asking routelogic 00081 * then we use a hash next_hop -> target_object 00082 * thus, the size of the table is at most N-1 00083 */ 00084 Tcl &tcl = Tcl::instance(); 00085 hdr_ip* iph = hdr_ip::access(p); 00086 char* adst= Address::instance().print_nodeaddr(iph->daddr()); 00087 //adst[strlen(adst)-1]= 0; 00088 target_= 0; 00089 00090 int next_hopIP; 00091 routelogic_->lookup_flat(nodeaddr_, adst, next_hopIP); 00092 delete [] adst; 00093 00094 int newEntry; 00095 long key = next_hopIP; 00096 Tcl_HashEntry *ep= Tcl_CreateHashEntry(&ht_, (const char*)key, 00097 &newEntry); 00098 if (newEntry) { 00099 tcl.evalf("%s find %d", name(), next_hopIP); 00100 Tcl_SetHashValue(ep, target_= (NsObject*)tcl.lookup(tcl.result())); 00101 } else { 00102 target_= (NsObject*)Tcl_GetHashValue(ep); 00103 } 00104 00105 if (!target_) { 00106 /* 00107 * XXX this should be "dropped" somehow. Right now, 00108 * these events aren't traced. 00109 */ 00110 Packet::free(p); 00111 return; 00112 } 00113 target_->recv(p,h); 00114 }
Here is the call graph for this function: ![]() |
|
|
Reimplemented in Agent, and Trace. Definition at line 56 of file object.h. Referenced by Trace::recvOnly().
|
|
|
Reimplemented in BayFullTcpAgent, HashClassifier, IvsSource, dsREDQueue, DiffusionRate, SinkAgent, DiffusionAgent, FloodingAgent, OmniMcastAgent, LinkDelay, CBQueue, DropTail, ErrorModel, PIQueue, Queue< T >, RedPDQueue, REDQueue, REMQueue, RIOQueue, Snoop, FackTcpAgent, FullTcpAgent, SackFullTcpAgent, RFC793eduTcpAgent, Sack1TcpAgent, TcpSink, DelAckSink, TcpAgent, VegasTcpAgent, toraAgent, Queue< T >, and XcpSink. Definition at line 70 of file object.cc. Referenced by NsObject::command().
|
|
|
Definition at line 56 of file classifier.h. References Classifier::default_target_. Referenced by HierClassifier::command(). 00056 { 00057 default_target_ = obj; 00058 }
|
|
||||||||||||
|
Reimplemented in HierClassifier. Definition at line 75 of file classifier.h.
|
|
|
Reimplemented in HashClassifier. Definition at line 74 of file classifier.cc. References Classifier::nsize_. Referenced by RoutingModule::set_table_size(), and HierClassifier::set_table_size(). 00075 { 00076 nsize_ = nn; 00077 }
|
|
|
|
Reimplemented in FECModel, FloodAgent, and LandmarkAgent. Definition at line 66 of file object.h. Referenced by REDQueue::command(), RedPDQueue::command(), PushbackQueue::command(), NsObject::debug(), NsObject::delay_bind_dispatch(), PushbackQueue::enque(), NsObject::isdebug(), NsObject::NsObject(), TfrcAgent::recv(), PushbackQueue::reportDrop(), SctpAgent::Reset(), REDQueue::reset(), DropTail::shrink_queue(), and Delayer::try_send(). |
|
|
Definition at line 88 of file classifier.h. Referenced by Classifier::Classifier(), Classifier::command(), Classifier::find(), BcastAddressClassifier::find(), and Classifier::set_default_target(). |
|
|
Definition at line 65 of file classifier-virtual.cc. |
|
|
Definition at line 62 of file classifier-virtual.cc. Referenced by recv(), VirtualClassifier(), and ~VirtualClassifier(). |
|
|
Definition at line 87 of file classifier.h. Referenced by Classifier::Classifier(), and Classifier::mshift(). |
|
|
|
Definition at line 61 of file classifier-virtual.cc. |
|
|
Definition at line 66 of file classifier-virtual.cc. |
|
|
Definition at line 89 of file classifier.h. Referenced by Classifier::alloc(), and Classifier::set_table_size(). |
|
|
|
Definition at line 85 of file classifier.h. Referenced by Classifier::Classifier(), and Classifier::classify(). |
|
|
Definition at line 63 of file classifier-virtual.cc. Referenced by recv(). |
|
|
Definition at line 86 of file classifier.h. Referenced by Classifier::Classifier(), and Classifier::mshift(). |
|
|
|
Definition at line 64 of file classifier-virtual.cc. Referenced by recv(). |
1.4.6