MCastClassifier Class Reference

#include <classifier-mcast.h>

Inheritance diagram for MCastClassifier:

Classifier NsObject TclObject Handler MCastBSTClassifier Collaboration diagram for MCastClassifier:

Collaboration graph
[legend]

Detailed Description

Definition at line 56 of file classifier-mcast.h.

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 NsObjectfind (Packet *)
virtual void install (int slot, NsObject *)
int install_next (NsObject *node)
int isdebug () const
int maxslot () const
 MCastClassifier ()
int mshift (int val)
virtual void recv (Packet *p, const char *s)
virtual void recv (Packet *p, Handler *h)
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)
NsObjectslot (int slot)
 ~MCastClassifier ()

Static Public Attributes

static const char STARSYM [] = "x"

Protected Types

enum  { HASHSIZE = 256 }

Protected Member Functions

void alloc (int)
void change_iface (nsaddr_t dst, int oldiface, int newiface)
void change_iface (nsaddr_t src, nsaddr_t dst, int oldiface, int newiface)
virtual int classify (Packet *p)
void clearAll ()
void clearHash (hashnode *h[], int size)
virtual int command (int argc, const char *const *argv)
int findslot ()
virtual int getnxt (NsObject *)
void handle (Event *)
int hash (nsaddr_t src, nsaddr_t dst) const
hashnodelookup (nsaddr_t src, nsaddr_t dst, int iface=iface_literal::ANY_IFACE) const
hashnodelookup_star (nsaddr_t dst, int iface=iface_literal::ANY_IFACE) const
virtual void reset ()
void set_hash (hashnode *ht[], nsaddr_t src, nsaddr_t dst, int slot, int iface)

Protected Attributes

int debug_
NsObjectdefault_target_
hashnodeht_ [HASHSIZE]
hashnodeht_star_ [HASHSIZE]
int mask_
int maxslot_
int nsize_
int nslot_
int offset_
int shift_
NsObject ** slot_

Data Structures

struct  hashnode


Member Enumeration Documentation

anonymous enum [protected]
 

Enumerator:
HASHSIZE 

Definition at line 65 of file classifier-mcast.h.

00065 {HASHSIZE = 256};

enum Classifier::classify_ret [inherited]
 

Enumerator:
ONCE 
TWICE 

Definition at line 64 of file classifier.h.

00064 {ONCE= -2, TWICE= -1};


Constructor & Destructor Documentation

MCastClassifier::MCastClassifier  ) 
 

Definition at line 57 of file classifier-mcast.cc.

References ht_, and ht_star_.

00058 {
00059     memset(ht_, 0, sizeof(ht_));
00060     memset(ht_star_, 0, sizeof(ht_star_));
00061 }

MCastClassifier::~MCastClassifier  ) 
 

Definition at line 63 of file classifier-mcast.cc.

References clearAll().

00064 {
00065     clearAll();
00066 }

Here is the call graph for this function:


Member Function Documentation

void Classifier::alloc int   )  [protected, inherited]
 

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 }

int Classifier::allocPort NsObject  )  [inherited]
 

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:

void MCastClassifier::change_iface nsaddr_t  dst,
int  oldiface,
int  newiface
[protected]
 

Definition at line 266 of file classifier-mcast.cc.

References MCastClassifier::hashnode::iif, and lookup_star().

00267 {
00268     hashnode* p = lookup_star(dst, oldiface);
00269     if (p) p->iif = newiface;
00270 }

Here is the call graph for this function:

void MCastClassifier::change_iface nsaddr_t  src,
nsaddr_t  dst,
int  oldiface,
int  newiface
[protected]
 

Definition at line 259 of file classifier-mcast.cc.

References MCastClassifier::hashnode::iif, and lookup().

Referenced by command().

00260 {
00261 
00262     hashnode* p = lookup(src, dst, oldiface);
00263     if (p) p->iif = newiface;
00264 }

Here is the call graph for this function:

int MCastClassifier::classify Packet p  )  [protected, virtual]
 

Reimplemented from Classifier.

Reimplemented in MCastBSTClassifier.

Definition at line 115 of file classifier-mcast.cc.

References hdr_ip::access(), hdr_cmn::access(), ANY_IFACE, hdr_ip::daddr(), hdr_cmn::iface(), MCastClassifier::hashnode::iif, lookup(), lookup_star(), Classifier::ONCE, hdr_ip::saddr(), MCastClassifier::hashnode::slot, Classifier::TWICE, and iface_literal::value().

00116 {
00117     hdr_cmn* h = hdr_cmn::access(pkt);
00118     hdr_ip* ih = hdr_ip::access(pkt);
00119 
00120     nsaddr_t src = ih->saddr();
00121     nsaddr_t dst = ih->daddr();
00122 
00123     int iface = h->iface();
00124     Tcl& tcl = Tcl::instance();
00125 
00126     hashnode* p = lookup(src, dst, iface);
00127     //printf("%s, src %d, dst %d, iface %d, p %d\n", name(), src, dst, iface, p);
00128     if (p == 0)
00129             p = lookup_star(dst, iface);
00130         
00131     if (p == 0) {
00132         if ((p = lookup(src, dst)) == 0)
00133             p = lookup_star(dst);
00134         if (p == 0) {
00135             // Didn't find an entry.
00136             tcl.evalf("%s new-group %d %d %d cache-miss", 
00137                   name(), src, dst, iface);
00138             // XXX see McastProto.tcl for the return values 0 -
00139             // once, 1 - twice 
00140             //printf("cache-miss result= %s\n", tcl.result());
00141             int res= atoi(tcl.result());
00142 
00143             return (res)? Classifier::TWICE : Classifier::ONCE;
00144         }
00145         if (p->iif == ANY_IFACE.value()) // || iface == UNKN_IFACE.value())
00146             return p->slot;
00147 
00148         tcl.evalf("%s new-group %d %d %d wrong-iif", 
00149               name(), src, dst, iface);
00150         //printf("wrong-iif result= %s\n", tcl.result());
00151         int res= atoi(tcl.result());
00152         return (res)? Classifier::TWICE : Classifier::ONCE;
00153     }
00154     return p->slot;
00155 }

Here is the call graph for this function:

void Classifier::clear int  slot  )  [virtual, inherited]
 

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 }

void MCastClassifier::clearAll  )  [protected]
 

Definition at line 81 of file classifier-mcast.cc.

References clearHash(), HASHSIZE, ht_, and ht_star_.

Referenced by command(), MCastBSTClassifier::~MCastBSTClassifier(), and ~MCastClassifier().

00082 {
00083     clearHash(ht_, HASHSIZE);
00084     clearHash(ht_star_, HASHSIZE);
00085 }

Here is the call graph for this function:

void MCastClassifier::clearHash hashnode h[],
int  size
[protected]
 

Definition at line 68 of file classifier-mcast.cc.

References MCastClassifier::hashnode::next.

Referenced by clearAll().

00069 {
00070     for (int i = 0; i < size; ++i) {
00071         hashnode* p = h[i];
00072         while (p != 0) {
00073             hashnode* n = p->next;
00074             delete p;
00075             p = n;
00076         }
00077     }
00078     memset(h, 0, size * sizeof(hashnode*));
00079 }

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

Reimplemented from Classifier.

Definition at line 179 of file classifier-mcast.cc.

References ANY_IFACE, change_iface(), clearAll(), Classifier::command(), ht_, ht_star_, MCastClassifier::hashnode::iif, lookup(), lookup_star(), iface_literal::name(), set_hash(), MCastClassifier::hashnode::slot, Classifier::slot(), Classifier::slot_, STARSYM, UNKN_IFACE, and iface_literal::value().

00180 {
00181     if (argc == 6) {
00182         if (strcmp(argv[1], "set-hash") == 0) {
00183             // $classifier set-hash $src $group $slot $iif
00184             //      $iif can be:(1) <number>
00185             //                  (2) "*" - matches any interface
00186             //                  (3) "?" - interface is unknown (usually this means that
00187             //                 the packet came from a local agent)
00188             nsaddr_t src = strtol(argv[2], (char**)0, 0);
00189             nsaddr_t dst = strtol(argv[3], (char**)0, 0);
00190             int slot = atoi(argv[4]);
00191                         int iface = (strcmp(argv[5], ANY_IFACE.name())==0) ? ANY_IFACE.value() 
00192                 : (strcmp(argv[5], UNKN_IFACE.name())==0) ? UNKN_IFACE.value() 
00193                 : atoi(argv[5]); 
00194             if (strcmp(STARSYM, argv[2]) == 0) {
00195                 // install a <x,G> entry: give 0 as src, but can be anything
00196                 set_hash(ht_star_, 0, dst, slot, iface);
00197             } else {
00198                 //install a <S,G> entry
00199                 set_hash(ht_, src, dst, slot, iface);
00200             }
00201             return (TCL_OK);
00202         }
00203         if (strcmp(argv[1], "change-iface") == 0) {
00204             // $classifier change-iface $src $dst $olfiif $newiif
00205             nsaddr_t src = strtol(argv[2], (char**)0, 0);
00206             nsaddr_t dst = strtol(argv[3], (char**)0, 0);
00207             int oldiface = atoi(argv[4]);
00208             int newiface = atoi(argv[5]);
00209             if (strcmp(STARSYM, argv[2]) == 0) {
00210                 change_iface(dst, oldiface, newiface);
00211             } else {
00212                 change_iface(src, dst, oldiface, newiface);
00213             }
00214             return (TCL_OK);
00215         }
00216     } else if (argc == 5) {
00217         if (strcmp(argv[1], "lookup") == 0) {
00218             // $classifier lookup $src $group $iface
00219             // returns name of the object (replicator)
00220             Tcl &tcl = Tcl::instance();
00221             nsaddr_t src = strtol(argv[2], (char**)0, 0);
00222             nsaddr_t dst = strtol(argv[3], (char**)0, 0);
00223             int iface = atoi(argv[4]);
00224             
00225             hashnode* p= (strcmp(STARSYM, argv[2]) == 0) ? lookup_star(dst, iface)
00226                 : lookup(src, dst, iface);
00227             if ((p == 0) || (slot_[p->slot] == 0))
00228                 tcl.resultf("");
00229             else 
00230                 tcl.resultf("%s", slot_[p->slot]->name());
00231             return (TCL_OK);
00232         }
00233     } else if (argc == 4) {
00234         if (strcmp(argv[1], "lookup-iface") == 0) {
00235             // $classifier lookup-iface $src $group 
00236             // returns incoming iface
00237             Tcl &tcl = Tcl::instance();
00238             nsaddr_t src = strtol(argv[2], (char**)0, 0);
00239             nsaddr_t dst = strtol(argv[3], (char**)0, 0);
00240             hashnode* p= (strcmp(argv[2], STARSYM) == 0) ? lookup_star(dst)
00241                 : lookup(src, dst);
00242             if (p == 0)
00243                 tcl.resultf("");
00244             else 
00245                 tcl.resultf("%d", p->iif);
00246             return (TCL_OK);
00247         }
00248     } else if (argc == 2) {
00249         if (strcmp(argv[1], "clearAll") == 0) {
00250             clearAll();
00251             return (TCL_OK);
00252         }
00253     }
00254     return (Classifier::command(argc, argv));
00255 }

Here is the call graph for this function:

void NsObject::debug const char *  fmt,
  ...
[virtual, inherited]
 

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 }

int NsObject::delay_bind_dispatch const char *  varName,
const char *  localName,
TclObject tracer
[virtual, inherited]
 

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 }

void NsObject::delay_bind_init_all  )  [virtual, inherited]
 

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().

00058 {
00059     delay_bind_init_one("debug_");
00060 }

virtual void Classifier::do_install char *  dst,
NsObject target
[inline, virtual, inherited]
 

Reimplemented in DestHashClassifier, HierClassifier, and VirtualClassifier.

Definition at line 66 of file classifier.h.

References Classifier::install(), and Classifier::slot().

Referenced by RoutingModule::add_route(), BroadcastNode::add_route(), RoutingModule::delete_route(), and BroadcastNode::delete_route().

00066                                                          {
00067         int slot = atoi(dst);
00068         install(slot, target); }

Here is the call graph for this function:

NsObject * Classifier::find Packet  )  [virtual, inherited]
 

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:

int MCastClassifier::findslot  )  [protected]
 

Definition at line 157 of file classifier-mcast.cc.

References Classifier::nslot_, and Classifier::slot_.

00158 {
00159     int i;
00160     for (i = 0; i < nslot_; ++i)
00161         if (slot_[i] == 0)
00162             break;
00163     return (i);
00164 }

int Classifier::getnxt NsObject  )  [protected, virtual, inherited]
 

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:

void NsObject::handle Event  )  [protected, virtual, inherited]
 

Implements Handler.

Reimplemented in LinkDelay, LL, AckRecons, and Snoop.

Definition at line 91 of file object.cc.

References NsObject::recv().

00092 {
00093     recv((Packet*)e);
00094 }

Here is the call graph for this function:

int MCastClassifier::hash nsaddr_t  src,
nsaddr_t  dst
const [inline, protected]
 

Definition at line 73 of file classifier-mcast.h.

Referenced by lookup(), lookup_star(), and set_hash().

00073                                                {
00074         u_int32_t s = src ^ dst;
00075         s ^= s >> 16;
00076         s ^= s >> 8;
00077         return (s & 0xff);
00078     }

void Classifier::install int  slot,
NsObject
[virtual, inherited]
 

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:

int Classifier::install_next NsObject node  )  [inherited]
 

Definition at line 183 of file classifier.cc.

References Classifier::install(), Classifier::maxslot_, and Classifier::slot().

Referenced by ManualRoutingModule::add_route(), and Classifier::command().

00183                                            {
00184     int slot = maxslot_ + 1;
00185     install(slot, node);
00186     return (slot);
00187 }

Here is the call graph for this function:

int NsObject::isdebug  )  const [inline, inherited]
 

Definition at line 61 of file object.h.

References NsObject::debug_.

00061 { return debug_; }

MCastClassifier::hashnode * MCastClassifier::lookup nsaddr_t  src,
nsaddr_t  dst,
int  iface = iface_literal::ANY_IFACE
const [protected]
 

Definition at line 88 of file classifier-mcast.cc.

References ANY_IFACE, MCastClassifier::hashnode::dst, hash(), ht_, MCastClassifier::hashnode::iif, MCastClassifier::hashnode::next, MCastClassifier::hashnode::src, and iface_literal::value().

Referenced by change_iface(), classify(), MCastBSTClassifier::classify(), and command().

00089 {
00090     int h = hash(src, dst);
00091     hashnode* p;
00092     for (p = ht_[h]; p != 0; p = p->next) {
00093         if (p->src == src && p->dst == dst)
00094             if (p->iif == iface ||
00095                 //p->iif == UNKN_IFACE.value() ||
00096                 iface == ANY_IFACE.value())
00097             break;
00098     }
00099     return (p);
00100 }

Here is the call graph for this function:

MCastClassifier::hashnode * MCastClassifier::lookup_star nsaddr_t  dst,
int  iface = iface_literal::ANY_IFACE
const [protected]
 

Definition at line 103 of file classifier-mcast.cc.

References ANY_IFACE, MCastClassifier::hashnode::dst, hash(), ht_star_, MCastClassifier::hashnode::iif, MCastClassifier::hashnode::next, and iface_literal::value().

Referenced by change_iface(), classify(), MCastBSTClassifier::classify(), and command().

00104 {
00105     int h = hash(0, dst);
00106     hashnode* p;
00107     for (p = ht_star_[h]; p != 0; p = p->next) {
00108         if (p->dst == dst && 
00109             (iface == ANY_IFACE.value() || p->iif == iface))
00110                break;
00111     }
00112     return (p);
00113 }

Here is the call graph for this function:

int Classifier::maxslot  )  const [inline, inherited]
 

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_; }

int Classifier::mshift int  val  )  [inline, inherited]
 

Definition at line 55 of file classifier.h.

References Classifier::mask_, and Classifier::shift_.

Referenced by Classifier::classify(), VirtualClassifier::classify(), AddressClassifier::classify(), DestHashClassifier::hashkey(), SrcDestHashClassifier::hashkey(), SrcDestFidHashClassifier::hashkey(), and HashClassifier::lookup().

00055 { return ((val >> shift_) & mask_); }

void NsObject::recv Packet p,
const char *  s
[virtual, inherited]
 

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:

void Classifier::recv Packet p,
Handler h
[virtual, inherited]
 

Implements NsObject.

Reimplemented in MCastBSTClassifier, HierClassifier, MacClassifier, VirtualClassifier, Replicator, and MIPDecapsulator.

Definition at line 140 of file classifier.cc.

References Classifier::find(), Packet::free(), and NsObject::recv().

Referenced by AODV::forward(), ErrorModule::recv(), DumbAgent::recv(), and HierClassifier::recv().

00141 {
00142     NsObject* node = find(p);
00143     if (node == NULL) {
00144         /*
00145          * XXX this should be "dropped" somehow.  Right now,
00146          * these events aren't traced.
00147          */
00148         Packet::free(p);
00149         return;
00150     }
00151     node->recv(p,h);
00152 }

Here is the call graph for this function:

virtual void NsObject::recvOnly Packet  )  [inline, virtual, inherited]
 

Reimplemented in Agent, and Trace.

Definition at line 56 of file object.h.

Referenced by Trace::recvOnly().

00056 {};

void NsObject::reset  )  [protected, virtual, inherited]
 

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().

00071 {
00072 }

void Classifier::set_default_target NsObject obj  )  [inline, inherited]
 

Definition at line 56 of file classifier.h.

References Classifier::default_target_.

Referenced by HierClassifier::command().

00056                                                   { 
00057         default_target_ = obj;
00058     }

void MCastClassifier::set_hash hashnode ht[],
nsaddr_t  src,
nsaddr_t  dst,
int  slot,
int  iface
[protected]
 

Definition at line 166 of file classifier-mcast.cc.

References MCastClassifier::hashnode::dst, hash(), MCastClassifier::hashnode::iif, MCastClassifier::hashnode::next, MCastClassifier::hashnode::slot, and MCastClassifier::hashnode::src.

Referenced by command().

00168 {
00169     int h = hash(src, dst);
00170     hashnode* p = new hashnode;
00171     p->src = src;
00172     p->dst = dst;
00173     p->slot = slot;
00174     p->iif = iface;
00175     p->next = ht[h];
00176     ht[h] = p;
00177 }

Here is the call graph for this function:

virtual void Classifier::set_table_size int  level,
int  nn
[inline, virtual, inherited]
 

Reimplemented in HierClassifier.

Definition at line 75 of file classifier.h.

00075 {}

void Classifier::set_table_size int  nn  )  [inherited]
 

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 }

NsObject* Classifier::slot int  slot  )  [inline, inherited]
 

Definition at line 50 of file classifier.h.

References Classifier::nslot_, and Classifier::slot_.

Referenced by DestHashClassifier::classify(), HashClassifier::classify(), Classifier::command(), command(), HierClassifier::command(), HashClassifier::command(), MPLSAddressClassifier::command(), Classifier::do_install(), DestHashClassifier::do_install(), FlowMon::dumpflows(), Tagger::dumpflows(), FlowMon::flow_list(), Tagger::flow_list(), and Classifier::install_next().

00050                                     {
00051         if ((slot >= 0) && (slot < nslot_))
00052             return slot_[slot];
00053         return 0;
00054     }


Field Documentation

int NsObject::debug_ [protected, inherited]
 

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().

NsObject* Classifier::default_target_ [protected, inherited]
 

Definition at line 88 of file classifier.h.

Referenced by Classifier::Classifier(), Classifier::command(), Classifier::find(), BcastAddressClassifier::find(), and Classifier::set_default_target().

hashnode* MCastClassifier::ht_[HASHSIZE] [protected]
 

Definition at line 79 of file classifier-mcast.h.

Referenced by clearAll(), command(), lookup(), and MCastClassifier().

hashnode* MCastClassifier::ht_star_[HASHSIZE] [protected]
 

Definition at line 80 of file classifier-mcast.h.

Referenced by clearAll(), command(), lookup_star(), and MCastClassifier().

int Classifier::mask_ [protected, inherited]
 

Definition at line 87 of file classifier.h.

Referenced by Classifier::Classifier(), and Classifier::mshift().

int Classifier::maxslot_ [protected, inherited]
 

Definition at line 84 of file classifier.h.

Referenced by MultiPathForwarder::classify(), DestHashClassifier::classify(), HashClassifier::classify(), Classifier::clear(), ReservePortClassifier::clear(), ReserveAddressClassifier::clear(), Replicator::command(), ReservePortClassifier::command(), HashClassifier::command(), ReserveAddressClassifier::command(), Classifier::install(), Classifier::install_next(), Classifier::maxslot(), Replicator::recv(), and MacClassifier::recv().

int Classifier::nsize_ [protected, inherited]
 

Definition at line 89 of file classifier.h.

Referenced by Classifier::alloc(), and Classifier::set_table_size().

int Classifier::nslot_ [protected, inherited]
 

Definition at line 83 of file classifier.h.

Referenced by Classifier::alloc(), Classifier::command(), Classifier::find(), BcastAddressClassifier::find(), findslot(), Classifier::getnxt(), ReservePortClassifier::getnxt(), ReserveAddressClassifier::getnxt(), Classifier::install(), MPLSAddressClassifier::install(), and Classifier::slot().

int Classifier::offset_ [protected, inherited]
 

Definition at line 85 of file classifier.h.

Referenced by Classifier::Classifier(), and Classifier::classify().

int Classifier::shift_ [protected, inherited]
 

Definition at line 86 of file classifier.h.

Referenced by Classifier::Classifier(), and Classifier::mshift().

NsObject** Classifier::slot_ [protected, inherited]
 

Definition at line 82 of file classifier.h.

Referenced by Classifier::alloc(), MultiPathForwarder::classify(), Classifier::clear(), ReservePortClassifier::clear(), ReserveAddressClassifier::clear(), Replicator::command(), Classifier::command(), command(), HashClassifier::command(), Classifier::find(), SRClassifier::find(), QSClassifier::find(), BcastAddressClassifier::find(), findslot(), Classifier::getnxt(), ReservePortClassifier::getnxt(), ReserveAddressClassifier::getnxt(), Classifier::install(), MPLSAddressClassifier::install(), Replicator::recv(), MacClassifier::recv(), Classifier::slot(), and Classifier::~Classifier().

const char MCastClassifier::STARSYM = "x" [static]
 

Reimplemented in MCastBSTClassifier.

Definition at line 60 of file classifier-mcast.h.

Referenced by command().


The documentation for this class was generated from the following files:
Generated on Tue Mar 6 17:19:54 2007 for ns2 Network Simulator 2.29 by  doxygen 1.4.6