Inheritance diagram for SessionHelper:


Definition at line 106 of file sessionhelper.cc.
Public Member Functions | |
| int | command (int, const char *const *) |
| 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 | drop (Packet *p) |
| int | isdebug () const |
| virtual void | recv (Packet *p, const char *s) |
| void | recv (Packet *, Handler *) |
| virtual void | recvOnly (Packet *) |
| SessionHelper () | |
| void | setDropTarget (NsObject *dt) |
| void | target (NsObject *target) |
| NsObject * | target () |
Protected Member Functions | |
| void | clear_dropped () |
| void | delete_dstobj (NsObject *) |
| virtual void | drop (Packet *p, const char *s) |
| dstobj * | find_dstobj (NsObject *) |
| loss_depobj * | find_loss_depobj (ErrorModel *) |
| void | get_dropped (loss_depobj *, Packet *) |
| void | handle (Event *) |
| void | mark_dropped (loss_depobj *) |
| virtual void | reset () |
| void | send (Packet *p, Handler *h) |
| void | show_dstobj () |
| void | show_loss_depobj (loss_depobj *) |
Protected Attributes | |
| int | debug_ |
| NsObject * | drop_ |
| dstobj * | dstobj_ |
| loss_depobj * | loss_dependency_ |
| int | ndst_ |
| int | rc_ |
| nsaddr_t | src_ |
| NsObject * | target_ |
|
|
Definition at line 135 of file sessionhelper.cc. References loss_depobj::loss_dep, loss_dependency_, loss_depobj::next, loss_depobj::obj, rc_, and loss_depobj::rcv_dep. 00135 : dstobj_(0), ndst_(0), rc_(0) 00136 { 00137 bind("rc_", &rc_); 00138 loss_dependency_ = new loss_depobj; 00139 loss_dependency_->obj = 0; 00140 loss_dependency_->loss_dep = 0; 00141 loss_dependency_->rcv_dep = 0; 00142 loss_dependency_->next = 0; 00143 }
|
|
|
Definition at line 222 of file sessionhelper.cc. References dstobj::dropped, dstobj_, and dstobj::next. Referenced by recv(). 00223 { 00224 dstobj *tmpdst = dstobj_; 00225 while (tmpdst != 0) { 00226 tmpdst->dropped = 0; 00227 tmpdst = tmpdst->next; 00228 } 00229 }
|
|
||||||||||||
|
Reimplemented from Connector. Definition at line 324 of file sessionhelper.cc. References dstobj::addr, dstobj::bw, Connector::command(), dstobj::delay, dstobj_, find_dstobj(), find_loss_depobj(), loss_depobj::loss_dep, loss_dependency_, ndst_, rcv_depobj::next, loss_depobj::next, dstobj::next, rcv_depobj::obj, loss_depobj::obj, dstobj::obj, dstobj::prev_arrival, loss_depobj::rcv_dep, show_dstobj(), show_loss_depobj(), src_, and dstobj::ttl. 00325 { 00326 Tcl& tcl = Tcl::instance(); 00327 if (argc == 2) { 00328 if (strcmp(argv[1], "list-mbr") == 0) { 00329 dstobj *tmp = dstobj_; 00330 while (tmp != 0) { 00331 tcl.resultf("%s %s", tcl.result(), 00332 tmp->obj->name()); 00333 tmp = tmp->next; 00334 } 00335 return (TCL_OK); 00336 } 00337 if (strcmp(argv[1], "show-loss-depobj") == 0) { 00338 show_loss_depobj(loss_dependency_); 00339 return (TCL_OK); 00340 } 00341 if (strcmp(argv[1], "show-dstobj") == 0) { 00342 show_dstobj(); 00343 return (TCL_OK); 00344 } 00345 } else if (argc == 3) { 00346 if (strcmp(argv[1], "set-node") == 0) { 00347 int src = atoi(argv[2]); 00348 src_ = src; 00349 //printf("set node %d\n", src_); 00350 return (TCL_OK); 00351 } 00352 if (strcmp(argv[1], "update-loss-top") == 0) { 00353 loss_depobj *tmploss = (loss_depobj*)(atol(argv[2])); 00354 tmploss->next = loss_dependency_->loss_dep; 00355 loss_dependency_->loss_dep = tmploss; 00356 return (TCL_OK); 00357 } 00358 } else if (argc == 4) { 00359 if (strcmp(argv[1], "update-loss-rcv") == 0) { 00360 ErrorModel *tmperr = (ErrorModel*)TclObject::lookup(argv[2]); 00361 NsObject *tmpobj = (NsObject*)TclObject::lookup(argv[3]); 00362 //printf("errmodel %s, agent %s\n", tmperr->name(), tmpobj->name()); 00363 loss_depobj *tmploss = find_loss_depobj(tmperr); 00364 //printf ("%d, loss_dependency_ %d\n", tmploss, loss_dependency_); 00365 if (!tmploss) { 00366 tmploss = new loss_depobj; 00367 tmploss->obj = tmperr; 00368 tmploss->next = 0; 00369 tmploss->rcv_dep = 0; 00370 tmploss->loss_dep = 0; 00371 tcl.resultf("%ld", tmploss); 00372 } else { 00373 tcl.result("0"); 00374 } 00375 rcv_depobj *tmprcv = new rcv_depobj; 00376 tmprcv->obj = find_dstobj(tmpobj); 00377 tmprcv->next = tmploss->rcv_dep; 00378 tmploss->rcv_dep = tmprcv; 00379 return (TCL_OK); 00380 } 00381 if (strcmp(argv[1], "update-loss-loss") == 0) { 00382 ErrorModel *tmperrparent = (ErrorModel*)TclObject::lookup(argv[2]); 00383 loss_depobj *tmplossparent = find_loss_depobj(tmperrparent); 00384 loss_depobj *tmplosschild = (loss_depobj*)(atol(argv[3])); 00385 if (!tmplossparent) { 00386 tmplossparent = new loss_depobj; 00387 tmplossparent->obj = tmperrparent; 00388 tmplossparent->next = 0; 00389 tmplossparent->loss_dep = 0; 00390 tmplossparent->rcv_dep = 0; 00391 tcl.resultf("%ld", tmplossparent); 00392 } else { 00393 tcl.result("0"); 00394 } 00395 tmplosschild->next = tmplossparent->loss_dep; 00396 tmplossparent->loss_dep = tmplosschild; 00397 return (TCL_OK); 00398 } 00399 if (strcmp(argv[1], "delete-dst") == 0) { 00400 int tmpaddr = atoi(argv[2]); 00401 //NsObject *tmpobj = (NsObject*)TclObject::lookup(argv[3]); 00402 printf ("addr = %d\n", tmpaddr); 00403 return (TCL_OK); 00404 } 00405 } else if (argc == 7) { 00406 if (strcmp(argv[1], "add-dst") == 0) { 00407 dstobj *tmp = new dstobj; 00408 tmp->bw = atof(argv[2]); 00409 tmp->delay = atof(argv[3]); 00410 tmp->prev_arrival = 0; 00411 tmp->ttl = atoi(argv[4]); 00412 tmp->addr = atoi(argv[5]); 00413 tmp->obj = (NsObject*)TclObject::lookup(argv[6]); 00414 //printf ("addr = %d, argv3 = %s, obj = %d, ttl=%d\n", tmp->addr, argv[3], tmp->obj, tmp->ttl); 00415 tmp->next = dstobj_; 00416 dstobj_ = tmp; 00417 ndst_ += 1; 00418 return (TCL_OK); 00419 } 00420 } 00421 return (Connector::command(argc, argv)); 00422 }
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().
|
|
|
Definition at line 285 of file sessionhelper.cc. References dstobj_, dstobj::next, and dstobj::obj. 00285 { 00286 dstobj *tmpdst = dstobj_; 00287 dstobj *tmpprev = 0; 00288 00289 while (tmpdst != 0) { 00290 if (tmpdst->obj == obj) { 00291 if (tmpprev == 0) dstobj_ = tmpdst->next; 00292 else tmpprev->next = tmpdst->next; 00293 free(tmpdst); 00294 return; 00295 } 00296 tmpprev = tmpdst; 00297 tmpdst = tmpdst->next; 00298 } 00299 }
|
|
||||||||||||
|
Definition at line 114 of file connector.cc. References Connector::drop_, Packet::free(), and NsObject::recv(). 00115 { 00116 if (drop_ != 0) 00117 drop_->recv(p, s); 00118 else 00119 Packet::free(p); 00120 }
Here is the call graph for this function: ![]() |
|
|
|
Definition at line 231 of file sessionhelper.cc. References dstobj_, dstobj::next, and dstobj::obj. Referenced by command(). 00231 { 00232 dstobj *tmpdst = dstobj_; 00233 while (tmpdst != 0) { 00234 if (tmpdst->obj == obj) return (tmpdst); 00235 tmpdst = tmpdst->next; 00236 } 00237 return 0; 00238 }
|
|
|
Definition at line 240 of file sessionhelper.cc. References loss_dependency_, and loss_depobj::next. Referenced by command(). 00240 { 00241 struct stackobj { 00242 loss_depobj *loss_obj; 00243 stackobj *next; 00244 }; 00245 00246 if (!loss_dependency_) return 0; 00247 00248 stackobj *top = new stackobj; 00249 top->loss_obj = loss_dependency_; 00250 top->next = 0; 00251 00252 while (top != 0) { 00253 if (top->loss_obj->obj == err) { 00254 loss_depobj *tmp_loss_obj = top->loss_obj; 00255 while (top != 0) { 00256 stackobj *befreed = top; 00257 top = top->next; 00258 free(befreed); 00259 } 00260 return (tmp_loss_obj); 00261 } 00262 loss_depobj *tmploss = top->loss_obj->loss_dep; 00263 stackobj *befreed = top; 00264 top = top->next; 00265 free(befreed); 00266 while (tmploss != 0) { 00267 stackobj *new_element = new stackobj; 00268 new_element->loss_obj = tmploss; 00269 new_element->next = top; 00270 top = new_element; 00271 tmploss = tmploss->next; 00272 } 00273 } 00274 return 0; 00275 }
|
|
||||||||||||
|
Definition at line 191 of file sessionhelper.cc. References ErrorModel::corrupt(), loss_depobj::loss_dep, mark_dropped(), loss_depobj::next, and loss_depobj::obj. Referenced by recv(). 00192 { 00193 if (loss_dep != 0) 00194 if (loss_dep->obj != 0) { 00195 if (loss_dep->obj->corrupt(pkt)) { 00196 mark_dropped(loss_dep); 00197 } else { 00198 get_dropped(loss_dep->loss_dep, pkt); 00199 } 00200 get_dropped(loss_dep->next, pkt); 00201 } 00202 }
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: ![]() |
|
|
Definition at line 61 of file object.h. References NsObject::debug_. 00061 { return debug_; }
|
|
|
Definition at line 204 of file sessionhelper.cc. References dstobj::dropped, loss_depobj::loss_dep, loss_depobj::next, rcv_depobj::next, rcv_depobj::obj, and loss_depobj::rcv_dep. Referenced by get_dropped(). 00205 { 00206 if (loss_dep != 0) { 00207 rcv_depobj *tmprcv_dep = loss_dep->rcv_dep; 00208 loss_depobj *tmploss_dep = loss_dep->loss_dep; 00209 00210 while (tmprcv_dep != 0) { 00211 tmprcv_dep->obj->dropped = 1; 00212 tmprcv_dep = tmprcv_dep->next; 00213 } 00214 00215 while (tmploss_dep != 0) { 00216 mark_dropped(tmploss_dep); 00217 tmploss_dep = tmploss_dep->next; 00218 } 00219 } 00220 }
|
|
||||||||||||
|
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 Connector. Definition at line 145 of file sessionhelper.cc. References hdr_ip::access(), hdr_cmn::access(), clear_dropped(), Packet::copy(), dstobj_, get_dropped(), Scheduler::instance(), loss_depobj::loss_dep, loss_dependency_, dstobj::next, rc, rc_, rc_handler, Packet::refcopy(), Scheduler::schedule(), hdr_cmn::size(), and hdr_ip::ttl(). 00146 { 00147 Scheduler& s = Scheduler::instance(); 00148 hdr_cmn* th = hdr_cmn::access(pkt); 00149 hdr_ip* iph = hdr_ip::access(pkt); 00150 double tmp_arrival; 00151 00152 //printf ("src %d, size %d, iface %d\n", src_, th->size(), th->iface()); 00153 clear_dropped(); 00154 00155 get_dropped(loss_dependency_->loss_dep, pkt); 00156 00157 for (dstobj *tmpdst = dstobj_; tmpdst; tmpdst = tmpdst->next) { 00158 int ttl; 00159 if (tmpdst->dropped 00160 || (ttl = iph->ttl() - tmpdst->ttl) <= 0) 00161 continue; 00162 00163 if (tmpdst->bw == 0) { 00164 tmp_arrival = tmpdst->delay; 00165 } else { 00166 tmp_arrival = th->size()*8/tmpdst->bw + tmpdst->delay; 00167 } 00168 if (tmpdst->prev_arrival >= tmp_arrival) { 00169 tmp_arrival = tmpdst->prev_arrival + 0.000001; 00170 /* Assume 1 ns process delay; just to maintain the causality */ 00171 } 00172 tmpdst->prev_arrival = tmp_arrival; 00173 if (rc_) { 00174 // reference count 00175 //s.rc_schedule(tmpdst->obj, pkt, tmp_arrival); 00176 RcEvent* rc = new RcEvent; 00177 rc->packet_ = pkt->refcopy(); 00178 rc->real_handler_ = tmpdst->obj; 00179 s.schedule(&rc_handler, rc, tmp_arrival); 00180 } else { 00181 Packet* tmppkt = pkt->copy(); 00182 hdr_ip* tmpiph = hdr_ip::access(tmppkt); 00183 tmpiph->ttl() = ttl; 00184 s.schedule(tmpdst->obj, tmppkt, tmp_arrival); 00185 } 00186 } 00187 00188 Packet::free(pkt); 00189 }
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().
|
|
||||||||||||
|
Reimplemented in Agent, and LinkDelay. Definition at line 56 of file connector.h. References NsObject::recv(), and Connector::target_. Referenced by SessionTTLChecker::recv(), TTLChecker::recv(), Trace::recv(), TraceIpMac::recv(), TraceIp::recv(), SnoopQueueEDrop::recv(), SnoopQueueTagger::recv(), SnoopQueueDrop::recv(), SnoopQueueOut::recv(), SnoopQueueIn::recv(), PktCounter::recv(), NetworkInterface::recv(), MeasureMod::recv(), Filter::recv(), Connector::recv(), CMUTrace::recv(), and AddSR::recv().
Here is the call graph for this function: ![]() |
|
|
Definition at line 51 of file connector.h. References Connector::drop_. Referenced by XCPWrapQ::command(). 00051 {drop_ = dt; }
|
|
|
Definition at line 277 of file sessionhelper.cc. References dstobj::addr, dstobj::bw, dstobj::delay, dstobj::dropped, dstobj_, dstobj::next, dstobj::obj, and dstobj::ttl. Referenced by command(). 00277 { 00278 dstobj *tmpdst = dstobj_; 00279 while (tmpdst != 0) { 00280 printf("bw:%.2f, delay:%.2f, ttl:%d, dropped:%d, addr:%d, obj:%s\n", tmpdst->bw, tmpdst->delay, tmpdst->ttl, tmpdst->dropped, tmpdst->addr, tmpdst->obj->name()); 00281 tmpdst = tmpdst->next; 00282 } 00283 }
|
|
|
Definition at line 301 of file sessionhelper.cc. References dstobj::addr, loss_depobj::loss_dep, loss_dependency_, loss_depobj::next, rcv_depobj::next, loss_depobj::obj, rcv_depobj::obj, and loss_depobj::rcv_dep. Referenced by command(). 00301 { 00302 00303 loss_depobj *tmploss = loss_obj->loss_dep; 00304 rcv_depobj *tmprcv = loss_obj->rcv_dep; 00305 00306 while (tmprcv != 0) { 00307 printf("%d ", tmprcv->obj->addr); 00308 tmprcv = tmprcv->next; 00309 } 00310 while (tmploss != 0) { 00311 printf("(%s: ", tmploss->obj->name()); 00312 show_loss_depobj(tmploss); 00313 tmploss = tmploss->next; 00314 } 00315 00316 if (loss_obj == loss_dependency_) { 00317 printf("\n"); 00318 } else { 00319 printf(")"); 00320 } 00321 }
|
|
|
Definition at line 49 of file connector.h. References Connector::target(), and Connector::target_.
Here is the call graph for this function: ![]() |
|
|
Definition at line 48 of file connector.h. References Connector::target_. Referenced by JoBS::assignRateDropsADC(), FQ::deque(), MIPMHAgent::reg(), MIPBSAgent::send_ads(), and Connector::target(). 00048 { return target_; }
|
|
|
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 59 of file connector.h. Referenced by XCPWrapQ::command(), Connector::command(), Connector::drop(), ErrorModel::recv(), and Connector::setDropTarget(). |
|
|
Definition at line 121 of file sessionhelper.cc. Referenced by clear_dropped(), command(), delete_dstobj(), find_dstobj(), recv(), and show_dstobj(). |
|
|
Definition at line 122 of file sessionhelper.cc. Referenced by command(), find_loss_depobj(), recv(), SessionHelper(), and show_loss_depobj(). |
|
|
Definition at line 123 of file sessionhelper.cc. Referenced by command(). |
|
|
Definition at line 124 of file sessionhelper.cc. Referenced by recv(), and SessionHelper(). |
|
|
Definition at line 120 of file sessionhelper.cc. Referenced by command(). |
|
1.4.6