#include <tora.h>
Inheritance diagram for toraAgent:


Definition at line 73 of file tora.h.
Public Member Functions | |
| nsaddr_t & | addr () |
| virtual void | attachApp (Application *app) |
| virtual void | close () |
| int | command (int argc, const char *const *argv) |
| virtual void | connect (nsaddr_t dst) |
| nsaddr_t & | daddr () |
| virtual void | debug (const char *fmt,...) |
| nsaddr_t & | dport () |
| virtual void | drop (Packet *p) |
| packet_t | get_pkttype () |
| int | isdebug () const |
| virtual void | listen () |
| nsaddr_t & | port () |
| virtual void | recv (Packet *p, const char *s) |
| void | recv (Packet *p, Handler *) |
| void | recvOnly (Packet *) |
| void | rtNotifyLinkDN (nsaddr_t index) |
| void | rtNotifyLinkStatus (nsaddr_t index, u_int32_t status) |
| void | rtNotifyLinkUP (nsaddr_t index) |
| void | rtRoutePacket (Packet *p) |
| virtual void | send (int nbytes) |
| virtual void | send (int sz, AppData *data) |
| void | send (Packet *p, Handler *h) |
| virtual void | sendmsg (int nbytes, const char *flags=0) |
| virtual void | sendmsg (int sz, AppData *, const char *flags=0) |
| virtual void | sendto (int nbytes, const char *flags, ns_addr_t dst) |
| virtual void | sendto (int nbytes, const char *flags, nsaddr_t dst) |
| virtual void | sendto (int sz, AppData *, const char *flags, ns_addr_t dst) |
| virtual void | sendto (int sz, AppData *, const char *flags, nsaddr_t dst) |
| void | set_pkttype (packet_t pkttype) |
| void | setDropTarget (NsObject *dt) |
| virtual int & | size () |
| void | target (NsObject *target) |
| NsObject * | target () |
| virtual void | timeout (int tno) |
| toraAgent (nsaddr_t id) | |
Protected Member Functions | |
| void | addAgentTrace (const char *name) |
| Packet * | allocpkt (int) const |
| Packet * | allocpkt () const |
| virtual int | delay_bind_dispatch (const char *varName, const char *localName, TclObject *tracer) |
| virtual void | delay_bind_init_all () |
| void | deleteAgentTrace () |
| virtual void | drop (Packet *p, const char *s) |
| void | dumpTracedVars () |
| void | handle (Event *) |
| virtual void | idle () |
| void | initpkt (Packet *) const |
| void | insertOldValue (TracedVar *v, const char *value) |
| nsaddr_t & | ipaddr () |
| OldValue * | lookupOldValue (TracedVar *v) |
| void | monitorAgentTrace () |
| virtual void | recvBytes (int bytes) |
| virtual void | trace (TracedVar *v) |
| virtual void | trace_event (char *eventtype) |
Protected Attributes | |
| Application * | app_ |
| Tcl_Channel | channel_ |
| int | debug_ |
| int | defttl_ |
| NsObject * | drop_ |
| ns_addr_t | dst_ |
| EventTrace * | et_ |
| int | fid_ |
| int | flags_ |
| ns_addr_t | here_ |
| OldValue * | oldValueList_ |
| int | prio_ |
| int | size_ |
| NsObject * | target_ |
| char * | traceName_ |
| packet_t | type_ |
Static Protected Attributes | |
| static int | uidcnt_ |
Private Member Functions | |
| Packet * | deque (TORADest *td) |
| TORADest * | dst_add (nsaddr_t id) |
| void | dst_dump (void) |
| TORADest * | dst_find (nsaddr_t id) |
| void | enque (TORADest *td, Packet *p) |
| void | forward (Packet *p, nsaddr_t nexthop, Time delay=0.0) |
| int | initialized () |
| void | log_dst_state_change (TORADest *td) |
| void | log_link_layer_feedback (Packet *p) |
| void | log_link_layer_recycle (Packet *p) |
| void | log_lnk_del (nsaddr_t dst) |
| void | log_lnk_kept (nsaddr_t dst) |
| void | log_nb_del (nsaddr_t dst, nsaddr_t id) |
| void | log_recv_clr (Packet *p) |
| void | log_recv_qry (Packet *p) |
| void | log_recv_upd (Packet *p) |
| void | log_route_loop (nsaddr_t prev, nsaddr_t next) |
| void | log_route_table (void) |
| void | logNbDeletedLastDN (TORADest *td) |
| void | logNextHopChange (TORADest *td) |
| void | logToraDest (TORADest *td) |
| void | logToraNeighbor (TORANeighbor *tn) |
| void | purge_queue (void) |
| void | recvCLR (Packet *p) |
| void | recvQRY (Packet *p) |
| void | recvTORA (Packet *p) |
| void | recvUPD (Packet *p) |
| virtual void | reset () |
| void | rt_resolve (Packet *p) |
| void | sendCLR (nsaddr_t id, double tau, nsaddr_t oid) |
| void | sendQRY (nsaddr_t id) |
| void | sendUPD (nsaddr_t id) |
| void | tora_output (Packet *p) |
| void | trace (char *fmt,...) |
Private Attributes | |
| td_head | dstlist |
| PriQueue * | ifqueue |
| imepAgent * | imepagent |
| nsaddr_t | index |
| Trace * | logtarget |
| rtqueue | rqueue |
Friends | |
| class | TORADest |
| class | TORANeighbor |
|
|
Definition at line 86 of file tora.cc. References dstlist, imepagent, LIST_INIT, and logtarget. 00086 : 00087 rtAgent(id, PT_TORA), 00088 rqueue() 00089 { 00090 LIST_INIT(&dstlist); 00091 imepagent = 0; 00092 logtarget = 0; 00093 ifqueue = 0; 00094 }
|
|
|
Definition at line 326 of file agent.cc. References ns_addr_t::addr_, Agent::channel_, Scheduler::clock(), Agent::dst_, Agent::here_, Scheduler::instance(), TIME_FORMAT, and Agent::traceName_. Referenced by Agent::command(). 00327 { 00328 char wrk[256]; 00329 int n; 00330 double curTime = (&Scheduler::instance() == NULL ? 0 : 00331 Scheduler::instance().clock()); 00332 00333 sprintf(wrk, "a -t "TIME_FORMAT" -s %d -d %d -n %s", 00334 curTime, here_.addr_, dst_.addr_, name); 00335 n = strlen(wrk); 00336 wrk[n] = '\n'; 00337 wrk[n+1] = 0; 00338 if (channel_) 00339 (void)Tcl_Write(channel_, wrk, n+1); 00340 // keep agent trace name 00341 if (traceName_ != NULL) 00342 delete[] traceName_; 00343 traceName_ = new char[strlen(name)+1]; 00344 strcpy(traceName_, name); 00345 }
Here is the call graph for this function: ![]() |
|
|
|
Definition at line 528 of file agent.cc. References Packet::allocdata(), and Agent::allocpkt(). 00529 { 00530 Packet* p = allocpkt(); 00531 00532 if (n > 0) 00533 p->allocdata(n); 00534 00535 return(p); 00536 }
Here is the call graph for this function: ![]() |
|
|
|
Definition at line 372 of file agent.cc. References Agent::app_. Referenced by WormApp::command(), HttpMInvalCache::command(), Application::command(), TcpApp::TcpApp(), and TcpApp::~TcpApp(). 00373 { 00374 app_ = app; 00375 }
|
|
|
Reimplemented in FullTcpAgent. Definition at line 377 of file agent.cc. Referenced by Agent::command().
|
|
||||||||||||
|
Reimplemented from Agent. Definition at line 106 of file tora.cc. References Agent::command(), rtqueue::command(), imepagent, imepAgent::imepRegister(), index, logtarget, and rqueue. 00107 { 00108 if(argc == 2) { 00109 Tcl& tcl = Tcl::instance(); 00110 00111 if(strncasecmp(argv[1], "id", 2) == 0) { 00112 tcl.resultf("%d", index); 00113 return TCL_OK; 00114 } 00115 } 00116 else if(argc == 3) { 00117 00118 if(strcmp(argv[1], "log-target") == 0 || strcmp(argv[1], "tracetarget") == 0 ) { 00119 logtarget = (Trace*) TclObject::lookup(argv[2]); 00120 if(logtarget == 0) 00121 return TCL_ERROR; 00122 return TCL_OK; 00123 } 00124 else if(strcmp(argv[1], "drop-target") == 0) { 00125 int stat = rqueue.command(argc,argv); 00126 if (stat != TCL_OK) return stat; 00127 return Agent::command(argc, argv); 00128 } 00129 else if(strcmp(argv[1], "if-queue") == 0) { 00130 ifqueue = (PriQueue*) TclObject::lookup(argv[2]); 00131 if(ifqueue == 0) 00132 return TCL_ERROR; 00133 return TCL_OK; 00134 } 00135 else if(strcmp(argv[1], "imep-agent") == 0) { 00136 imepagent = (imepAgent*) TclObject::lookup(argv[2]); 00137 if(imepagent == 0) 00138 return TCL_ERROR; 00139 imepagent->imepRegister((rtAgent*) this); 00140 return TCL_OK; 00141 } 00142 } 00143 return Agent::command(argc, argv); 00144 }
Here is the call graph for this function: ![]() |
|
|
Definition at line 389 of file agent.cc. Referenced by Agent::command().
|
|
|
||||||||||||
|
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 from NsObject. Reimplemented in BayFullTcpAgent, LDPAgent, HbAfterRtoSctpAgent, MfrHbAfterRtoSctpAgent, MfrTimestampSctpAgent, MultipleFastRtxSctpAgent, NewRenoSctpAgent, TimestampSctpAgent, SctpAgent, FullTcpAgent, SackFullTcpAgent, RFC793eduTcpAgent, TcpSink, TcpAgent, VegasTcpAgent, XcpAgent, and XcpSink. Definition at line 93 of file agent.cc. References ns_addr_t::addr_, Agent::defttl_, NsObject::delay_bind_dispatch(), Agent::dst_, Agent::fid_, Agent::flags_, Agent::here_, ns_addr_t::port_, and Agent::prio_. Referenced by XcpSink::delay_bind_dispatch(), TcpAgent::delay_bind_dispatch(), TcpSink::delay_bind_dispatch(), SctpAgent::delay_bind_dispatch(), and LDPAgent::delay_bind_dispatch(). 00094 { 00095 if (delay_bind(varName, localName, "agent_addr_", (int*)&(here_.addr_), tracer)) return TCL_OK; 00096 if (delay_bind(varName, localName, "agent_port_", (int*)&(here_.port_), tracer)) return TCL_OK; 00097 if (delay_bind(varName, localName, "dst_addr_", (int*)&(dst_.addr_), tracer)) return TCL_OK; 00098 if (delay_bind(varName, localName, "dst_port_", (int*)&(dst_.port_), tracer)) return TCL_OK; 00099 if (delay_bind(varName, localName, "fid_", (int*)&fid_, tracer)) return TCL_OK; 00100 if (delay_bind(varName, localName, "prio_", (int*)&prio_, tracer)) return TCL_OK; 00101 if (delay_bind(varName, localName, "flags_", (int*)&flags_, tracer)) return TCL_OK; 00102 if (delay_bind(varName, localName, "ttl_", &defttl_, tracer)) return TCL_OK; 00103 if (delay_bind(varName, localName, "class_", (int*)&fid_, tracer)) return TCL_OK; 00104 return Connector::delay_bind_dispatch(varName, localName, tracer); 00105 }
Here is the call graph for this function: ![]() |
|
|
Reimplemented from NsObject. Reimplemented in BayFullTcpAgent, LDPAgent, HbAfterRtoSctpAgent, MfrHbAfterRtoSctpAgent, MfrTimestampSctpAgent, MultipleFastRtxSctpAgent, NewRenoSctpAgent, TimestampSctpAgent, SctpAgent, FullTcpAgent, SackFullTcpAgent, RFC793eduTcpAgent, TcpSink, TcpAgent, VegasTcpAgent, XcpAgent, and XcpSink. Definition at line 78 of file agent.cc. References NsObject::delay_bind_init_all(). Referenced by XcpSink::delay_bind_init_all(), TcpAgent::delay_bind_init_all(), TcpSink::delay_bind_init_all(), SctpAgent::delay_bind_init_all(), and LDPAgent::delay_bind_init_all(). 00079 { 00080 delay_bind_init_one("agent_addr_"); 00081 delay_bind_init_one("agent_port_"); 00082 delay_bind_init_one("dst_addr_"); 00083 delay_bind_init_one("dst_port_"); 00084 delay_bind_init_one("fid_"); 00085 delay_bind_init_one("prio_"); 00086 delay_bind_init_one("flags_"); 00087 delay_bind_init_one("ttl_"); 00088 delay_bind_init_one("class_"); 00089 Connector::delay_bind_init_all(); 00090 }
Here is the call graph for this function: ![]() |
|
|
Definition at line 222 of file agent.cc. References ns_addr_t::addr_, Agent::dst_, Agent::flushAVar(), Agent::here_, Scheduler::instance(), TIME_FORMAT, and Agent::traceName_. Referenced by Agent::command(). 00223 { 00224 char wrk[256]; 00225 00226 // XXX we don't know InstVar outside of Tcl! Is there any 00227 // tracedvars hidden in InstVar? If so, shall we have a tclclInt.h? 00228 TracedVar* var = tracedvar_; 00229 for ( ; var != 0; var = var->next_) 00230 flushAVar(var); 00231 00232 // we need to flush all var values to trace file, 00233 // so nam can do backtracing 00234 sprintf(wrk, "a -t "TIME_FORMAT" -s %d -d %d -n %s -x", 00235 Scheduler::instance().clock(), here_.addr_, 00236 dst_.addr_, traceName_); 00237 if (traceName_ != NULL) 00238 delete[] traceName_; 00239 traceName_ = NULL; 00240 }
Here is the call graph for this function: ![]() |
|
|
|
|
|
||||||||||||
|
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 162 of file tora.cc. References dstlist, imepagent, imepAgent::imepGetBiLinks(), LIST_INSERT_HEAD, TORADest::nb_add(), and TORADest. Referenced by recvCLR(), recvQRY(), recvUPD(), and rt_resolve(). 00163 { 00164 TORADest *td = new TORADest(id, this); 00165 assert(td); 00166 00167 LIST_INSERT_HEAD(&dstlist, td, link); 00168 00169 int *nblist = 0, nbcnt = 0; 00170 imepagent->imepGetBiLinks(nblist, nbcnt); 00171 00172 for(int i = 0; i < nbcnt; i++) 00173 (void) td->nb_add(nblist[i]); 00174 00175 if(nblist) delete[] nblist; 00176 00177 return td; 00178 }
Here is the call graph for this function: ![]() |
|
|
Definition at line 181 of file tora.cc. References dstlist, and TORADest::dump(). 00182 { 00183 TORADest *td = dstlist.lh_first; 00184 00185 for( ; td; td = td->link.le_next) 00186 td->dump(); 00187 }
Here is the call graph for this function: ![]() |
|
|
Definition at line 151 of file tora.cc. References dstlist, and TORADest::index. Referenced by recvCLR(), recvQRY(), recvTORA(), recvUPD(), rt_resolve(), and sendUPD(). 00152 { 00153 TORADest* td = dstlist.lh_first; 00154 for( ; td; td = td->link.le_next) { 00155 if(td->index == id) 00156 return td; 00157 } 00158 return 0; 00159 }
|
|
|
|
|
||||||||||||
|
|
|
||||||||||||||||
|
Definition at line 194 of file tora.cc. References hdr_cmn::addr_type(), hdr_cmn::direction(), hdr_cmn::DOWN, Connector::drop(), DROP_RTR_ROUTE_LOOP, HDR_CMN, Scheduler::instance(), rtAgent::ipaddr(), log_route_loop(), hdr_cmn::next_hop(), NS_AF_INET, hdr_cmn::prev_hop_, Scheduler::schedule(), Connector::target_, and tora_output(). Referenced by recvTORA(), and rt_resolve(). 00195 { 00196 struct hdr_cmn *ch = HDR_CMN(p); 00197 00198 #ifdef TORA_DISALLOW_ROUTE_LOOP 00199 if(nexthop == ch->prev_hop_) { 00200 log_route_loop(ch->prev_hop_, nexthop); 00201 drop(p, DROP_RTR_ROUTE_LOOP); 00202 return; 00203 } 00204 #endif 00205 ch->next_hop() = nexthop; 00206 ch->prev_hop_ = ipaddr(); 00207 ch->addr_type() = NS_AF_INET; 00208 00209 // change the packet direction to DOWN 00210 ch->direction() = hdr_cmn::DOWN; 00211 00212 if (0.0 == delay) { 00213 tora_output(p); 00214 } else { 00215 Scheduler::instance().schedule(target_, p, delay); 00216 } 00217 }
Here is the call graph for this function: ![]() |
|
|
Definition at line 104 of file agent.h. References Agent::type_. 00104 { return type_; }
|
|
|
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 363 of file agent.cc. References Agent::app_, and Application::resume(). Referenced by FullTcpAgent::foutput(), XcpAgent::output(), TcpAgent::output(), RFC793eduTcpAgent::output(), QSNewRenoTcpAgent::output(), IntTcpAgent::output(), BayFullTcpAgent::output(), UdpAgent::sendmsg(), SA_Agent::sendmsg(), RTPAgent::sendmsg(), MessagePassingAgent::sendmsg(), TPAgent::sendto(), and MessagePassingAgent::sendto().
Here is the call graph for this function: ![]() |
|
|
Implements rtAgent. Definition at line 127 of file tora.h. References imepagent, and logtarget. Referenced by recv().
|
|
|
Definition at line 456 of file agent.cc. References hdr_nv::access(), hdr_flags::access(), hdr_ip::access(), hdr_cmn::access(), ns_addr_t::addr_, Scheduler::clock(), hdr_flags::cong_action_, hdr_ip::daddr(), Agent::defttl_, hdr_cmn::direction(), hdr_ip::dport(), Agent::dst_, hdr_flags::ecn_, hdr_flags::ecn_capable_, hdr_flags::ecn_to_echo_, hdr_flags::eln_, hdr_cmn::error(), Agent::fid_, hdr_ip::flowid(), hdr_flags::fs_, NixNode::GetNixVector(), NixNode::GetNodeObject(), hdr_nv::h_used, Agent::here_, hdr_cmn::iface(), Scheduler::instance(), hdr_flags::no_ts_, hdr_cmn::NONE, hdr_nv::nv(), hdr_ip::offset(), hdr_nv::offset(), ns_addr_t::port_, hdr_flags::pri_, hdr_ip::prio(), Agent::prio_, hdr_cmn::ptype(), hdr_flags::qs_, NixVec::Reset(), hdr_ip::saddr(), hdr_cmn::size(), Agent::size_, hdr_ip::sport(), hdr_cmn::timestamp(), hdr_ip::ttl(), Agent::type_, hdr_cmn::uid(), Agent::uidcnt_, UNKN_IFACE, and iface_literal::value(). Referenced by Agent::allocpkt(), and PingResponder::recv(). 00457 { 00458 hdr_cmn* ch = hdr_cmn::access(p); 00459 ch->uid() = uidcnt_++; 00460 ch->ptype() = type_; 00461 ch->size() = size_; 00462 ch->timestamp() = Scheduler::instance().clock(); 00463 ch->iface() = UNKN_IFACE.value(); // from packet.h (agent is local) 00464 ch->direction() = hdr_cmn::NONE; 00465 00466 ch->error() = 0; /* pkt not corrupt to start with */ 00467 00468 hdr_ip* iph = hdr_ip::access(p); 00469 iph->saddr() = here_.addr_; 00470 iph->sport() = here_.port_; 00471 iph->daddr() = dst_.addr_; 00472 iph->dport() = dst_.port_; 00473 00474 //DEBUG 00475 //if (dst_ != -1) 00476 // printf("pl break\n"); 00477 00478 iph->flowid() = fid_; 00479 iph->prio() = prio_; 00480 iph->ttl() = defttl_; 00481 00482 hdr_flags* hf = hdr_flags::access(p); 00483 hf->ecn_capable_ = 0; 00484 hf->ecn_ = 0; 00485 hf->eln_ = 0; 00486 hf->ecn_to_echo_ = 0; 00487 hf->fs_ = 0; 00488 hf->no_ts_ = 0; 00489 hf->pri_ = 0; 00490 hf->cong_action_ = 0; 00491 hf->qs_ = 0; 00492 #ifdef HAVE_STL 00493 00494 hdr_nv* nv = hdr_nv::access(p); 00495 if (0) 00496 printf("Off hdr_nv %d, ip_hdr %d myaddr %d\n", 00497 hdr_nv::offset(), hdr_ip::offset(), here_.addr_); 00498 NixNode* pNixNode = NixNode::GetNodeObject(here_.addr_); 00499 if (0) 00500 printf("Node Object %p\n", pNixNode); 00501 if (pNixNode) { 00502 // If we get non-null, indicates nixvector routing in use 00503 // Delete any left over nv in the packet 00504 // Get a nixvector to the target (may create new) 00505 NixVec* pNv = pNixNode->GetNixVector(dst_.addr_); 00506 pNv->Reset(); 00507 nv->nv() = pNv; // And set the nixvec in the packet 00508 nv->h_used = 0; // And reset used portion to 0 00509 } 00510 #endif //HAVE_STL 00511 }
Here is the call graph for this function: ![]() |
|
||||||||||||
|
Definition at line 250 of file agent.cc. References min, OldValue::next_, Agent::oldValueList_, TRACEVAR_MAXVALUELENGTH, OldValue::val_, and OldValue::var_. Referenced by Agent::trace(). 00251 { 00252 OldValue *p = new OldValue; 00253 assert(p != NULL); 00254 strncpy(p->val_, value, min(strlen(value)+1, TRACEVAR_MAXVALUELENGTH)); 00255 p->var_ = v; 00256 p->next_ = NULL; 00257 if (oldValueList_ == NULL) 00258 oldValueList_ = p; 00259 else { 00260 p->next_ = oldValueList_; 00261 oldValueList_ = p; 00262 } 00263 }
|
|
|
Definition at line 26 of file rtproto.h. References rtAgent::ipaddr_. Referenced by forward(), log_link_layer_feedback(), log_link_layer_recycle(), log_lnk_del(), log_lnk_kept(), log_nb_del(), log_recv_clr(), log_recv_qry(), log_recv_upd(), log_route_loop(), log_route_table(), logNbDeletedLastDN(), logNextHopChange(), logToraDest(), logToraNeighbor(), recvCLR(), recvQRY(), recvUPD(), rt_resolve(), sendCLR(), sendQRY(), and sendUPD(). 00026 { return ipaddr_; }
|
|
|
Definition at line 61 of file object.h. References NsObject::debug_. 00061 { return debug_; }
|
|
|
Reimplemented in BayFullTcpAgent, RapAgent, and FullTcpAgent. Definition at line 381 of file agent.cc. Referenced by Agent::command().
|
|
|
Referenced by TORADest::update_height(). |
|
|
Definition at line 33 of file tora_logs.cc. References BaseTrace::buffer(), CURRENT_TIME, BaseTrace::dump(), HDR_CMN, rtAgent::ipaddr(), logtarget, hdr_cmn::next_hop_, Trace::pt_, hdr_cmn::uid_, verbose, and hdr_cmn::xmit_reason_. 00034 { 00035 static int link_layer_feedback = 0; 00036 struct hdr_cmn *ch = HDR_CMN(p); 00037 00038 if(! logtarget || ! verbose) return; 00039 00040 sprintf(logtarget->pt_->buffer(), 00041 "T %.9f _%d_ LL unable to deliver packet %d to %d (%d) (reason = %d, ifqlen = %d)", 00042 CURRENT_TIME, 00043 ipaddr(), 00044 ch->uid_, 00045 ch->next_hop_, 00046 ++link_layer_feedback, 00047 ch->xmit_reason_, 00048 ifqueue->length()); 00049 00050 logtarget->pt_->dump(); 00051 }
Here is the call graph for this function: ![]() |
|
|
Definition at line 55 of file tora_logs.cc. References BaseTrace::buffer(), CURRENT_TIME, hdr_ip::daddr(), BaseTrace::dump(), HDR_CMN, HDR_IP, rtAgent::ipaddr(), logtarget, hdr_cmn::next_hop_, hdr_cmn::prev_hop_, Trace::pt_, hdr_ip::saddr(), hdr_cmn::uid_, and verbose. 00056 { 00057 struct hdr_cmn *ch = HDR_CMN(p); 00058 struct hdr_ip *ih = HDR_IP(p); 00059 00060 if(! logtarget || ! verbose) return; 00061 00062 sprintf(logtarget->pt_->buffer(), 00063 "T %.9f _%d_ recycling packet %d (src = %d, dst = %d, prev = %d, next = %d)", 00064 CURRENT_TIME, 00065 ipaddr(), 00066 ch->uid_, 00067 // ih->src_, ih->dst_, 00068 ih->saddr(),ih->daddr(), 00069 ch->prev_hop_, ch->next_hop_); 00070 logtarget->pt_->dump(); 00071 }
Here is the call graph for this function: ![]() |
|
|
Definition at line 74 of file tora_logs.cc. References BaseTrace::buffer(), CURRENT_TIME, BaseTrace::dump(), God::hops(), God::instance(), rtAgent::ipaddr(), logtarget, Trace::pt_, and verbose. 00075 { 00076 static int link_del = 0; 00077 00078 if(! logtarget || ! verbose) return; 00079 00080 /* 00081 * If "god" thinks that these two nodes are still 00082 * reachable then this is an erroneous deletion. 00083 */ 00084 sprintf(logtarget->pt_->buffer(), 00085 "T %.9f _%d_ deleting LL hop to %d (delete %d is %s)", 00086 CURRENT_TIME, 00087 ipaddr(), 00088 dst, 00089 ++link_del, 00090 God::instance()->hops(ipaddr(), dst) != 1 ? "VALID" : "INVALID"); 00091 logtarget->pt_->dump(); 00092 }
Here is the call graph for this function: ![]() |
|
|
Definition at line 95 of file tora_logs.cc. References BaseTrace::buffer(), CURRENT_TIME, BaseTrace::dump(), God::hops(), God::instance(), rtAgent::ipaddr(), logtarget, Trace::pt_, and verbose. 00096 { 00097 static int link_kept = 0; 00098 00099 if(! logtarget || ! verbose) return; 00100 00101 /* 00102 * If "god" thinks that these two nodes are now 00103 * unreachable, then we are erroneously keeping 00104 * a bad route. 00105 */ 00106 sprintf(logtarget->pt_->buffer(), 00107 "T %.9f _%d_ keeping LL hop to %d (keep %d is %s)", 00108 CURRENT_TIME, 00109 ipaddr(), 00110 dst, 00111 ++link_kept, 00112 God::instance()->hops(ipaddr(), dst) == 1 ? "VALID" : "INVALID"); 00113 logtarget->pt_->dump(); 00114 }
Here is the call graph for this function: ![]() |
|
||||||||||||
|
Definition at line 117 of file tora_logs.cc. References BaseTrace::buffer(), CURRENT_TIME, BaseTrace::dump(), rtAgent::ipaddr(), logtarget, Trace::pt_, and verbose. 00118 { 00119 if(! logtarget || ! verbose) return; 00120 00121 sprintf(logtarget->pt_->buffer(), 00122 "T %.9f _%d_ destination %d removing neighbor %d", 00123 CURRENT_TIME, 00124 ipaddr(), 00125 dst, id); 00126 logtarget->pt_->dump(); 00127 }
Here is the call graph for this function: ![]() |
|
|
Definition at line 162 of file tora_logs.cc. References BaseTrace::buffer(), CURRENT_TIME, BaseTrace::dump(), HDR_IP, HDR_TORA_CLR, rtAgent::ipaddr(), logtarget, Trace::pt_, hdr_ip::saddr(), hdr_tora_clr::tc_dst, hdr_tora_clr::tc_oid, hdr_tora_clr::tc_tau, and verbose. Referenced by recvTORA(). 00163 { 00164 struct hdr_ip *ih = HDR_IP(p); 00165 struct hdr_tora_clr *ch = HDR_TORA_CLR(p); 00166 00167 if(! logtarget || ! verbose) return; 00168 00169 sprintf(logtarget->pt_->buffer(), 00170 "T %.9f _%d_ received `CLR` from %d --- %d (%f %d)", 00171 CURRENT_TIME, 00172 ipaddr(), 00173 // ih->src_, 00174 ih->saddr(), 00175 ch->tc_dst, ch->tc_tau, ch->tc_oid); 00176 logtarget->pt_->dump(); 00177 }
Here is the call graph for this function: ![]() |
|
|
Definition at line 130 of file tora_logs.cc. References BaseTrace::buffer(), CURRENT_TIME, BaseTrace::dump(), HDR_IP, HDR_TORA_QRY, rtAgent::ipaddr(), logtarget, Trace::pt_, hdr_ip::saddr(), hdr_tora_qry::tq_dst, and verbose. 00131 { 00132 struct hdr_ip *ih = HDR_IP(p); 00133 struct hdr_tora_qry *qh = HDR_TORA_QRY(p); 00134 00135 if(! logtarget || ! verbose) return; 00136 00137 sprintf(logtarget->pt_->buffer(), 00138 "T %.9f %d received `QRY` from %d --- %d", 00139 CURRENT_TIME, ipaddr(), ih->saddr(), qh->tq_dst); 00140 logtarget->pt_->dump(); 00141 }
Here is the call graph for this function: ![]() |
|
|
Definition at line 144 of file tora_logs.cc. References BaseTrace::buffer(), CURRENT_TIME, BaseTrace::dump(), HDR_IP, HDR_TORA_UPD, rtAgent::ipaddr(), logtarget, Trace::pt_, hdr_ip::saddr(), hdr_tora_upd::tu_delta, hdr_tora_upd::tu_dst, hdr_tora_upd::tu_id, hdr_tora_upd::tu_oid, hdr_tora_upd::tu_r, hdr_tora_upd::tu_tau, and verbose. Referenced by recvTORA(). 00145 { 00146 struct hdr_ip *ih = HDR_IP(p); 00147 struct hdr_tora_upd *uh = HDR_TORA_UPD(p); 00148 00149 if(! logtarget || ! verbose) return; 00150 00151 sprintf(logtarget->pt_->buffer(), 00152 "T %.9f _%d_ received `UPD` from %d --- %d (%f %d %d %d %d)", 00153 CURRENT_TIME, 00154 ipaddr(), 00155 // ih->src_, uh->tu_dst, 00156 ih->saddr(), uh->tu_dst, 00157 uh->tu_tau, uh->tu_oid, uh->tu_r, uh->tu_delta, uh->tu_id); 00158 logtarget->pt_->dump(); 00159 }
Here is the call graph for this function: ![]() |
|
||||||||||||
|
Definition at line 22 of file tora_logs.cc. References BaseTrace::buffer(), CURRENT_TIME, BaseTrace::dump(), rtAgent::ipaddr(), logtarget, Trace::pt_, and verbose. Referenced by forward(). 00023 { 00024 if(! logtarget || ! verbose ) return; 00025 00026 sprintf(logtarget->pt_->buffer(), 00027 "T %.9f _%d_ routing loop (%d --> %d --> %d)", 00028 CURRENT_TIME, ipaddr(), prev, ipaddr(), next); 00029 logtarget->pt_->dump(); 00030 }
Here is the call graph for this function: ![]() |
|
|
Definition at line 181 of file tora_logs.cc. References BaseTrace::buffer(), CURRENT_TIME, Height::delta, dstlist, BaseTrace::dump(), TORANeighbor::height, TORADest::height, Height::id, TORANeighbor::index, TORADest::index, rtAgent::ipaddr(), TORANeighbor::lnk_stat, logtarget, TORADest::nb_find_next_hop(), TORADest::num_active, TORADest::num_down, TORADest::num_up, Height::oid, Trace::pt_, Height::r, TORADest::rt_req, Height::tau, TORANeighbor::time_act, TORADest::time_upd, and verbose. 00182 { 00183 TORADest *td; 00184 TORANeighbor *tn; 00185 00186 if (!logtarget || ! verbose) return; 00187 00188 for(td = dstlist.lh_first; td; td = td->link.le_next) { 00189 tn = td->nb_find_next_hop(); 00190 00191 sprintf(logtarget->pt_->buffer(), 00192 "T %.9f _%d_ %2d (%9f %2d %2d %2d %2d) ---> %2d (%9f %2d %2d %2d %2d) %d %.9f --- (%2d a, %2d d, %2d u) %d %9f", 00193 CURRENT_TIME, 00194 ipaddr(), 00195 td->index, 00196 td->height.tau, td->height.oid, td->height.r, 00197 td->height.delta, td->height.id, 00198 tn ? tn->index : -1, 00199 tn ? tn->height.tau : -1.0, 00200 tn ? tn->height.oid : -1, 00201 tn ? tn->height.r : -1, 00202 tn ? tn->height.delta : -1, 00203 tn ? tn->height.id: -1, 00204 tn ? tn->lnk_stat : -1, 00205 tn ? tn->time_act : -1.0, 00206 td->num_active, td->num_down, td->num_up, 00207 td->rt_req, td->time_upd); 00208 00209 logtarget->pt_->dump(); 00210 } 00211 00212 sprintf(logtarget->pt_->buffer(), 00213 "T --------------------------------------------------"); 00214 logtarget->pt_->dump(); 00215 }
Here is the call graph for this function: ![]() |
|
|
Definition at line 291 of file tora_logs.cc. References BaseTrace::buffer(), CURRENT_TIME, BaseTrace::dump(), TORADest::index, rtAgent::ipaddr(), logNextHopChange(), logtarget, Trace::pt_, and verbose. 00292 { 00293 if(! verbose) return; 00294 00295 sprintf(logtarget->pt_->buffer(), "T %.9f _%d_ lost last downstream link for destination %d", 00296 CURRENT_TIME, 00297 ipaddr(), 00298 td->index); 00299 logtarget->pt_->dump(); 00300 00301 logNextHopChange(td); 00302 }
Here is the call graph for this function: ![]() |
|
|
Definition at line 263 of file tora_logs.cc. References BaseTrace::buffer(), CURRENT_TIME, BaseTrace::dump(), TORANeighbor::index, TORADest::index, rtAgent::ipaddr(), logtarget, logToraDest(), logToraNeighbor(), TORADest::nb_find_next_hop(), TORADest::nblist, Trace::pt_, and verbose. Referenced by logNbDeletedLastDN(), and recvTORA(). 00264 { 00265 if(! verbose) return; 00266 00267 TORANeighbor *n; 00268 00269 assert(td); 00270 00271 logToraDest(td); 00272 00273 for(n = td->nblist.lh_first; n; n = n->link.le_next) 00274 logToraNeighbor(n); 00275 00276 n = td->nb_find_next_hop(); 00277 if(n) { 00278 sprintf(logtarget->pt_->buffer(), "T %.9f _%d_ nexthop for %d is %d", 00279 CURRENT_TIME, ipaddr(), td->index, n->index); 00280 logtarget->pt_->dump(); 00281 } 00282 00283 sprintf(logtarget->pt_->buffer(), 00284 "T %.9f _%d_ --------------------------------------------------", 00285 CURRENT_TIME, 00286 ipaddr()); 00287 logtarget->pt_->dump(); 00288 }
Here is the call graph for this function: ![]() |
|
|
Definition at line 221 of file tora_logs.cc. References BaseTrace::buffer(), CURRENT_TIME, Height::delta, BaseTrace::dump(), TORADest::height, Height::id, TORADest::index, rtAgent::ipaddr(), logtarget, TORADest::num_active, TORADest::num_down, TORADest::num_up, Height::oid, Trace::pt_, Height::r, TORADest::rt_req, Height::tau, TORADest::time_upd, and verbose. Referenced by logNextHopChange(). 00222 { 00223 if(! verbose) return; 00224 00225 assert(td); 00226 00227 sprintf(logtarget->pt_->buffer(), 00228 "T %.9f _%d_ TD %2d (%9f %2d %2d %2d %2d) --- (%2d a, %2d d, %2d u) %d %9f", 00229 CURRENT_TIME, 00230 ipaddr(), 00231 td->index, 00232 td->height.tau, td->height.oid, td->height.r, 00233 td->height.delta, td->height.id, 00234 td->num_active, td->num_down, td->num_up, 00235 td->rt_req, td->time_upd); 00236 logtarget->pt_->dump(); 00237 }
Here is the call graph for this function: ![]() |
|
|
Definition at line 241 of file tora_logs.cc. References BaseTrace::buffer(), CURRENT_TIME, Height::delta, BaseTrace::dump(), TORANeighbor::height, Height::id, TORANeighbor::index, rtAgent::ipaddr(), TORANeighbor::lnk_stat, logtarget, Height::oid, Trace::pt_, Height::r, Height::tau, TORANeighbor::time_act, and verbose. Referenced by logNextHopChange(). 00242 { 00243 if(! verbose) return; 00244 00245 assert(tn); 00246 00247 sprintf(logtarget->pt_->buffer(), 00248 "T %.9f _%d_ TN %2d (%.9f %2d %2d %2d %2d) %d %.9f", 00249 CURRENT_TIME, 00250 ipaddr(), 00251 tn->index, 00252 tn->height.tau, 00253 tn->height.oid, 00254 tn->height.r, 00255 tn->height.delta, 00256 tn->height.id, 00257 tn->lnk_stat, 00258 tn->time_act); 00259 logtarget->pt_->dump(); 00260 }
Here is the call graph for this function: ![]() |
|
|
Definition at line 242 of file agent.cc. References OldValue::next_, Agent::oldValueList_, and OldValue::var_. Referenced by Agent::trace(). 00243 { 00244 OldValue *p = oldValueList_; 00245 while ((p != NULL) && (p->var_ != v)) 00246 p = p->next_; 00247 return p; 00248 }
|
|
|
Definition at line 310 of file agent.cc. References ns_addr_t::addr_, Agent::channel_, Scheduler::clock(), Agent::here_, Scheduler::instance(), TIME_FORMAT, and Agent::traceName_. Referenced by Agent::command(). 00311 { 00312 char wrk[256]; 00313 int n; 00314 double curTime = (&Scheduler::instance() == NULL ? 0 : 00315 Scheduler::instance().clock()); 00316 00317 sprintf(wrk, "v -t "TIME_FORMAT" -e monitor_agent %d %s", 00318 curTime, here_.addr_, traceName_); 00319 n = strlen(wrk); 00320 wrk[n] = '\n'; 00321 wrk[n+1] = 0; 00322 if (channel_) 00323 (void)Tcl_Write(channel_, wrk, n+1); 00324 }
Here is the call graph for this function: ![]() |
|
|
|
|
|
||||||||||||
|
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 Agent. Definition at line 257 of file tora.cc. References HDR_CMN, HDR_IP, initialized(), PT_TORA, hdr_cmn::ptype(), and recvTORA(). 00258 { 00259 struct hdr_cmn *ch = HDR_CMN(p); 00260 struct hdr_ip *ih = HDR_IP(p); 00261 00262 assert(initialized()); 00263 00264 if(ch->ptype() == PT_TORA) { 00265 recvTORA(p); 00266 return; 00267 } 00268 00269 /* 00270 * Must be a packet I'm originating... 00271 */ 00272 if(ih->saddr() == ipaddr() && ch->num_forwards() == 0) { 00273 /* 00274 * Add the IP Header. 00275 */ 00276 ch->size() += IP_HDR_LEN; 00277 00278 ih->ttl_ = IP_DEF_TTL; 00279 } 00280 00281 #ifdef TORA_DISALLOW_ROUTE_LOOP 00282 /* 00283 * I received a packet that I sent. Probably 00284 * a routing loop. 00285 */ 00286 else if(ih->saddr() == ipaddr()) { 00287 drop(p, DROP_RTR_ROUTE_LOOP); 00288 return; 00289 } 00290 #endif 00291 /* 00292 * Packet I'm forwarding... 00293 */ 00294 else { 00295 /* 00296 * Check the TTL. If it is zero, then discard. 00297 */ 00298 if(--ih->ttl_ == 0) { 00299 drop(p, DROP_RTR_TTL); 00300 return; 00301 } 00302 } 00303 00304 rt_resolve(p); 00305 }
Here is the call graph for this function: ![]() |
|
|
Definition at line 354 of file agent.cc. References Agent::app_, and Application::recv(). Referenced by TcpAsymSink::recv(). 00355 { 00356 if (app_) 00357 app_->recv(nbytes); 00358 }
Here is the call graph for this function: ![]() |
|
|
Definition at line 598 of file tora.cc. References Scheduler::clock(), CURRENT_TIME, dst_add(), dst_find(), HDR_IP, HDR_TORA_CLR, TORANeighbor::height, TORADest::height, index, TORADest::index, TORANeighbor::index, Scheduler::instance(), rtAgent::ipaddr(), Height::isNull(), LINK_DN, LINK_UN, TORANeighbor::lnk_stat, TORADest::nb_find(), TORADest::nblist, Height::Null(), TORADest::num_active, TORADest::num_down, TORADest::num_up, Height::oid, Height::r, TORADest::rt_req, hdr_ip::saddr(), sendCLR(), sendUPD(), hdr_ip::src_, Height::tau, hdr_tora_clr::tc_dst, hdr_tora_clr::tc_oid, hdr_tora_clr::tc_tau, TORADest::time_upd, trace(), TORADest::update_height(), and Height::Zero(). Referenced by recvTORA(). 00599 { 00600 struct hdr_ip *ih = HDR_IP(p); 00601 struct hdr_tora_clr *th = HDR_TORA_CLR(p); 00602 TORADest *td; 00603 TORANeighbor *tn; 00604 00605 if(th->tc_dst == ipaddr()) { 00606 return; 00607 } 00608 00609 td = dst_find(th->tc_dst); 00610 if(td == 0) 00611 td = dst_add(th->tc_dst); 00612 assert(td); 00613 00614 if(td->height.tau == th->tc_tau && 00615 td->height.oid == th->tc_oid && 00616 td->height.r == 1) { // I 00617 double temp_tau = td->height.tau; 00618 nsaddr_t temp_oid = td->height.oid; 00619 00620 td->height.Null(); 00621 td->num_up = 0; 00622 td->num_down = 0; 00623 00624 for(tn = td->nblist.lh_first; tn; tn = tn->link.le_next) { 00625 if(tn->index == td->index) { 00626 tn->height.Zero(); 00627 tn->lnk_stat = LINK_DN; 00628 } 00629 else { 00630 tn->height.Null(); 00631 tn->lnk_stat = LINK_UN; 00632 } 00633 } 00634 if(td->num_active > 1) { // I, A 00635 sendCLR(td->index, temp_tau, temp_oid); 00636 } 00637 else { // I, B 00638 } 00639 } 00640 else { 00641 tn = td->nb_find(ih->saddr()); // II 00642 if(tn == 0) { 00643 /* 00644 * XXX - update link status? 00645 */ 00646 trace("T %.9f _%d_ received `CLR` from non-neighbor %d", 00647 CURRENT_TIME, index, ih->saddr()); 00648 #ifdef DEBUG 00649 fprintf(stderr, 00650 "node %d received `CLR` from non-neighbor %d\n", 00651 index, ih->src_); 00652 #endif 00653 return; 00654 } 00655 00656 tn->height.Null(); 00657 tn->lnk_stat = LINK_UN; 00658 00659 for(tn = td->nblist.lh_first; tn; tn = tn->link.le_next) { 00660 if(tn->height.tau == th->tc_tau && 00661 tn->height.oid == th->tc_oid && 00662 tn->height.r == 1) { 00663 tn->height.Null(); 00664 tn->lnk_stat = LINK_UN; 00665 } 00666 } 00667 if(td->num_down == 0) { // II, A 00668 if(td->num_up == 0) { // II, A, 1 00669 if(td->height.isNull()) { // II, A, 1, a 00670 } 00671 else { 00672 td->height.Null(); 00673 td->time_upd = Scheduler::instance().clock(); 00674 sendUPD(td->index); 00675 } 00676 } 00677 else { 00678 td->update_height(Scheduler::instance().clock(), 00679 ipaddr(), 00680 0, 00681 0, 00682 ipaddr()); 00683 td->rt_req = 0; 00684 td->time_upd = Scheduler::instance().clock(); 00685 sendUPD(td->index); 00686 } 00687 } 00688 else { 00689 // II, B 00690 } 00691 } 00692 }
Here is the call graph for this function: ![]() |
|
|
Reimplemented from NsObject. Definition at line 78 of file agent.h.
|
|
|
Definition at line 371 of file tora.cc. References Scheduler::clock(), CURRENT_TIME, Height::delta, dst_add(), dst_find(), HDR_IP, HDR_TORA_QRY, TORANeighbor::height, TORADest::height, TORADest::index, index, Scheduler::instance(), rtAgent::ipaddr(), TORADest::nb_find(), TORADest::nb_find_min_height(), TORADest::num_active, Height::oid, Height::r, TORADest::rt_req, hdr_ip::saddr(), sendQRY(), sendUPD(), Height::tau, TORANeighbor::time_act, TORADest::time_rt_req, TORADest::time_upd, hdr_tora_qry::tq_dst, and TORADest::update_height(). Referenced by recvTORA(). 00372 { 00373 struct hdr_ip *ih = HDR_IP(p); 00374 struct hdr_tora_qry *qh = HDR_TORA_QRY(p); 00375 TORADest *td; 00376 TORANeighbor *tn; 00377 00378 if(qh->tq_dst == ipaddr()) { 00379 #ifdef DEBUG 00380 fprintf(stderr, "node %d received `QRY` for itself.\n", index); 00381 #endif 00382 return; 00383 } 00384 00385 td = dst_find(qh->tq_dst); 00386 if(td == 0) 00387 td = dst_add(qh->tq_dst); 00388 00389 if(td->rt_req) { 00390 return; 00391 } 00392 00393 if(td->height.r == 0) { // II, A 00394 tn = td->nb_find(ih->saddr()); 00395 00396 if(tn && tn->time_act > td->time_upd) { // II, A, 1 00397 td->time_upd = Scheduler::instance().clock(); 00398 sendUPD(td->index); 00399 } 00400 else { // II, A, 2 00401 } 00402 } 00403 else { 00404 tn = td->nb_find_min_height(0); 00405 00406 if(tn) { // II, B, 1 00407 td->update_height(tn->height.tau, 00408 tn->height.oid, 00409 tn->height.r, 00410 tn->height.delta + 1, 00411 ipaddr()); 00412 00413 td->time_upd = Scheduler::instance().clock(); 00414 00415 sendUPD(td->index); 00416 } 00417 else { 00418 td->rt_req = 1; 00419 td->time_rt_req = CURRENT_TIME; 00420 00421 if(td->num_active > 1) { // II, B, 1, a 00422 sendQRY(td->index); 00423 } 00424 else { // II, B, 1, b 00425 00426 } 00427 } 00428 } 00429 }
Here is the call graph for this function: ![]() |
|
|
Definition at line 308 of file tora.cc. References __PRETTY_FUNCTION__, ARP_SEPARATION_DELAY, rtqueue::deque(), Agent::dport(), dst_find(), forward(), Packet::free(), HDR_IP, HDR_TORA, TORANeighbor::index, TORADest::index, log_recv_clr(), log_recv_upd(), logNextHopChange(), TORADest::nb_find_next_hop(), recvCLR(), recvQRY(), recvUPD(), rqueue, RT_PORT, hdr_tora::th_dst, hdr_tora::th_type, TORATYPE_CLR, TORATYPE_QRY, and TORATYPE_UPD. Referenced by recv(). 00309 { 00310 struct hdr_tora *th = HDR_TORA(p); 00311 TORADest *td; 00312 TORANeighbor *tn; 00313 00314 /* 00315 * Fix the source IP address. 00316 */ 00317 assert(HDR_IP (p)->sport() == RT_PORT); 00318 assert(HDR_IP (p)->dport() == RT_PORT); 00319 00320 /* 00321 * Incoming Packets. 00322 */ 00323 switch(th->th_type) { 00324 case TORATYPE_QRY: 00325 recvQRY(p); 00326 Packet::free(p); 00327 return; // don't add/change routing state 00328 00329 case TORATYPE_UPD: 00330 log_recv_upd(p); 00331 recvUPD(p); 00332 break; 00333 00334 case TORATYPE_CLR: 00335 log_recv_clr(p); 00336 recvCLR(p); 00337 break; 00338 00339 default: 00340 fprintf(stderr, 00341 "%s: Invalid TORA type (%x)\n", 00342 __PRETTY_FUNCTION__, th->th_type); 00343 exit(1); 00344 } 00345 00346 if((td = dst_find(th->th_dst)) == 0) { 00347 Packet::free(p); 00348 return; 00349 } 00350 00351 logNextHopChange(td); 00352 00353 if((tn = td->nb_find_next_hop())) { 00354 Packet *p0; 00355 Time delay = 0.0; 00356 00357 while((p0 = rqueue.deque(td->index))) { 00358 forward(p0, tn->index, delay); 00359 delay += ARP_SEPARATION_DELAY; 00360 } 00361 } 00362 Packet::free(p); 00363 }
Here is the call graph for this function: ![]() |
|
|
Definition at line 436 of file tora.cc. References BaseTrace::buffer(), Scheduler::clock(), CURRENT_TIME, Height::delta, dst_add(), dst_find(), BaseTrace::dump(), HDR_IP, HDR_TORA_UPD, TORADest::height, TORANeighbor::height, TORANeighbor::index, TORADest::index, index, Scheduler::instance(), rtAgent::ipaddr(), Height::isNull(), LINK_DN, LINK_UN, TORANeighbor::lnk_stat, logtarget, TORADest::nb_check_same_ref(), TORADest::nb_find(), TORADest::nb_find_max_height(), TORADest::nb_find_min_height(), TORADest::nb_find_min_nonnull_height(), TORADest::nblist, Height::Null(), TORADest::num_down, TORADest::num_up, Height::oid, Trace::pt_, Height::r, TORADest::rt_req, hdr_ip::saddr(), sendCLR(), sendUPD(), hdr_ip::src_, Height::tau, TORADest::time_upd, trace(), hdr_tora_upd::tu_dst, TORADest::update_height(), TORADest::update_height_nb(), and Height::Zero(). Referenced by recvTORA(). 00437 { 00438 struct hdr_ip *ih = HDR_IP(p); 00439 struct hdr_tora_upd *uh = HDR_TORA_UPD(p); 00440 TORADest *td; 00441 TORANeighbor *tn; 00442 00443 if(uh->tu_dst == ipaddr()) { 00444 return; 00445 } 00446 00447 td = dst_find(uh->tu_dst); 00448 if(td == 0) 00449 td = dst_add(uh->tu_dst); 00450 00451 tn = td->nb_find(ih->saddr()); 00452 if(tn == 0) { 00453 /* 00454 * update link status? -josh 00455 */ 00456 00457 // No, don't update linkstatus: it may be an update 00458 // that was delayed in the IMEP layer for sequencing -dam 00459 // no way at the TORA level to tell if we're connected... 00460 trace("T %.9f _%d_ received `UPD` from non-neighbor %d", 00461 CURRENT_TIME, ipaddr(), ih->saddr()); 00462 #ifdef DEBUG 00463 fprintf(stderr, 00464 "node %d received `UPD` from non-neighbor %d\n", 00465 index, ih->src_); 00466 #endif 00467 return; 00468 } 00469 00470 /* 00471 * Update height and link status for neighbor [j][k]. 00472 */ 00473 td->update_height_nb(tn, uh); 00474 00475 if(td->rt_req && tn->height.r == 0) { // I 00476 00477 td->update_height(tn->height.tau, 00478 tn->height.oid, 00479 tn->height.r, 00480 tn->height.delta + 1, 00481 ipaddr()); 00482 00483 td->rt_req = 0; 00484 00485 td->time_upd = Scheduler::instance().clock(); 00486 00487 sendUPD(td->index); 00488 } 00489 else if(td->num_down == 0) { // II 00490 if(td->num_up == 0) { // II, A 00491 if(td->height.isNull()) // II, A, 1 00492 return; // II, A, 1, a 00493 else { 00494 td->height.Null(); // II, A, 1, b 00495 00496 td->time_upd = Scheduler::instance().clock(); 00497 00498 sendUPD(td->index); 00499 } 00500 } 00501 else { 00502 if(td->nb_check_same_ref()) { // II, A, 2 00503 TORANeighbor *tn; 00504 00505 if( (tn = td->nb_find_min_height(0)) ) { // II, A, 2, a 00506 td->update_height(tn->height.tau, // II, A, 2, a, i 00507 tn->height.oid, 00508 1, 00509 0, 00510 ipaddr()); 00511 td->time_upd = Scheduler::instance().clock(); 00512 00513 sendUPD(td->index); 00514 } 00515 else { 00516 if(td->height.oid == ipaddr()) { // II, A, 2, a, ii 00517 double temp_tau = td->height.tau; // II, A, 2, a, ii, x 00518 nsaddr_t temp_oid = td->height.oid; 00519 00520 td->height.Null(); 00521 td->num_down = 0; 00522 td->num_up = 0; 00523 00524 /* 00525 * For every active link n, if the neighbor connected 00526 * via link n is the destination j, set HT_NEIGH[j][n]=ZERO 00527 * and LNK_STAT[j][n] = DN. 00528 * Otherwise, set HT_NEIGH[j][n] = NULL and LNK_STAT[j][n] = UN. 00529 */ 00530 for(tn = td->nblist.lh_first; tn; tn = tn->link.le_next) { 00531 if(tn->index == td->index) { 00532 tn->height.Zero(); 00533 tn->lnk_stat = LINK_DN; 00534 00535 } 00536 else { 00537 tn->height.Null(); 00538 tn->lnk_stat = LINK_UN; 00539 } 00540 } 00541 00542 sendCLR(td->index, temp_tau, temp_oid); 00543 } 00544 else { 00545 td->update_height(Scheduler::instance().clock(), // II, A, 2, a, ii, y 00546 ipaddr(), 00547 0, 00548 0, 00549 ipaddr()); 00550 td->rt_req = 0; 00551 td->time_upd = Scheduler::instance().clock(); 00552 00553 #ifdef DEBUG 00554 // under what circumstances does this rule fire? 00555 // seems like it will prevent the detection of 00556 // partitions...??? -dam 8/24/98 00557 00558 if (logtarget) 00559 { 00560 sprintf(logtarget->pt_->buffer(), "T %.9f _%d_ rule IIA2a(ii)x fires %d", 00561 Scheduler::instance().clock(), ipaddr(), td->index); 00562 logtarget->pt_->dump(); 00563 } 00564 #endif 00565 sendUPD(td->index); 00566 } 00567 } 00568 00569 } 00570 else { 00571 TORANeighbor *n = td->nb_find_max_height(); // II, A, 2, b 00572 assert(n); 00573 TORANeighbor *m = td->nb_find_min_nonnull_height(&n->height); 00574 assert(m); 00575 00576 td->update_height(m->height.tau, 00577 m->height.oid, 00578 m->height.r, 00579 m->height.delta - 1, 00580 ipaddr()); 00581 00582 td->time_upd = Scheduler::instance().clock(); 00583 00584 sendUPD(td->index); 00585 } 00586 } 00587 } 00588 else { // II, B 00589 00590 } 00591 }
Here is the call graph for this function: ![]() |
|
|
Reimplemented from NsObject. Definition at line 97 of file tora.cc. References rtqueue::deque(), Connector::drop(), DROP_END_OF_SIMULATION, and rqueue. 00098 { 00099 Packet *p; 00100 while((p = rqueue.deque())) { 00101 drop(p,DROP_END_OF_SIMULATION); 00102 } 00103 }
Here is the call graph for this function: ![]() |
|
|
Definition at line 221 of file tora.cc. References CURRENT_TIME, hdr_ip::daddr(), dst_add(), dst_find(), rtqueue::enque(), forward(), HDR_IP, Scheduler::instance(), rtAgent::ipaddr(), TORADest::nb_find_next_hop(), rqueue, TORADest::rt_req, hdr_ip::saddr(), sendQRY(), TORADest::time_tx_qry, and trace(). Referenced by rtRoutePacket(). 00222 { 00223 struct hdr_ip *ih = HDR_IP(p); 00224 TORADest *td; 00225 TORANeighbor *tn; 00226 00227 td = dst_find(ih->daddr()); 00228 if(td == 0) { 00229 td = dst_add(ih->daddr()); 00230 } 00231 00232 tn = td->nb_find_next_hop(); 00233 if(tn == 0) { 00234 rqueue.enque(p); 00235 00236 trace("T %.9f _%d_ tora enq %d->%d", 00237 Scheduler::instance().clock(), ipaddr(), 00238 ih->saddr(), ih->daddr()); 00239 00240 if(!td->rt_req) 00241 { // if no QRY pending, then send one 00242 sendQRY(ih->daddr()); 00243 td->time_tx_qry = CURRENT_TIME; 00244 td->rt_req = 1; 00245 } 00246 } 00247 else { 00248 forward(p, tn->index); 00249 } 00250 }
Here is the call graph for this function: ![]() |
|
|
Implements rtAgent. Definition at line 76 of file tora_api.cc. References dstlist, TORADest::index, TORADest::nb_del(), and sendUPD(). 00077 { 00078 TORADest *td = dstlist.lh_first; 00079 00080 /* 00081 * Purge each Destination's Neighbor List 00082 */ 00083 for( ; td; td = td->link.le_next) { 00084 if(td->nb_del(index)) { 00085 /* 00086 * Send an UPD packet if you've lost the last 00087 * downstream link. 00088 */ 00089 sendUPD(td->index); 00090 } 00091 } 00092 00093 /* 00094 * Now purge the Network Interface queues that 00095 * may have packets destined for this broken 00096 * neighbor. 00097 */ 00098 { 00099 Packet *head = 0; 00100 Packet *p; 00101 Packet *np = 0; 00102 00103 while((p = ifqueue->filter(index))) { 00104 p->next_ = head; 00105 head = p; 00106 } 00107 00108 for(p = head; p; p = np) { 00109 np = p->next_; 00110 /* 00111 * This make a lot of sense for TORA since we 00112 * will almost always have multiple routes to 00113 * a destination. 00114 */ 00115 log_link_layer_recycle(p); 00116 rt_resolve(p); 00117 } 00118 } 00119 }
Here is the call graph for this function: ![]() |
|
||||||||||||
|
Implements rtAgent. Definition at line 123 of file tora_api.cc. References abort(). 00124 { 00125 abort(); 00126 }
Here is the call graph for this function: ![]() |
|
|
Implements rtAgent. Definition at line 48 of file tora_api.cc. References dstlist, TORADest::nb_add(), and TORADest::nb_find(). 00049 { 00050 TORADest *td = dstlist.lh_first; 00051 00052 /* 00053 * Update the destination lists... 00054 */ 00055 for( ; td; td = td->link.le_next) { 00056 if(td->nb_find(index) == 0) { 00057 (void) td->nb_add(index); 00058 } 00059 if (td->rt_req) 00060 { // must send a new query for this dest so the new 00061 // neighbor can hear it 00062 // IMEP will take care of aggregating all these into 00063 // one physical pkt 00064 00065 trace("T %.9f _%d_ QRY %d for %d (rtreq set)", 00066 Scheduler::instance().clock(), ipaddr(), 00067 td->index, index); 00068 00069 sendQRY(td->index); 00070 td->time_tx_qry = CURRENT_TIME; 00071 } 00072 } 00073 }
Here is the call graph for this function: ![]() |
|
|
Implements rtAgent. Definition at line 129 of file tora_api.cc. References hdr_ip::daddr(), DATA_PACKET, Connector::drop(), DROP_RTR_MAC_CALLBACK, HDR_CMN, HDR_IP, IP_BROADCAST, hdr_cmn::ptype(), and rt_resolve(). 00130 { 00131 struct hdr_cmn *ch = HDR_CMN(p); 00132 struct hdr_ip *ip = HDR_IP(p); 00133 00134 // Non-data packets and BROADCAST packets can be dropped. 00135 if(DATA_PACKET(ch->ptype()) == 0 || 00136 ip->daddr() == (nsaddr_t) IP_BROADCAST) { 00137 drop(p, DROP_RTR_MAC_CALLBACK); 00138 return; 00139 } 00140 00141 rt_resolve(p); 00142 }
Here is the call graph for this function: ![]() |
|
|
Reimplemented in SRMAgent. Definition at line 91 of file agent.h. References Agent::sendmsg(). 00091 { sendmsg(nbytes); }
Here is the call graph for this function: ![]() |
|
||||||||||||
|
Reimplemented in HttpInvalAgent. Definition at line 84 of file agent.h. References Agent::sendmsg(). 00084 { sendmsg(sz, data, 0); }
Here is the call graph for this function: ![]() |
|
||||||||||||
|
||||||||||||||||
|
||||||||||||
|
Reimplemented in SA_Agent, RTPAgent, UdpAgent, MessagePassingAgent, LmsSender, SRMAgent, SctpAgent, FullTcpAgent, TcpAgent, TfrcAgent, and SimpleTcpAgent. Definition at line 407 of file agent.cc.
|
|
||||||||||||||||
|
Reimplemented in UdpAgent, and MessagePassingAgent. Definition at line 400 of file agent.cc. References abort(). Referenced by Agent::command(), Application::send(), Agent::send(), TrafficTrace::timeout(), TelnetApp::timeout(), SctpApp1::timeout(), EXPOO_Traffic::timeout(), and CBR_PP_Traffic::timeout(). 00401 { 00402 fprintf(stderr, 00403 "Agent::sendmsg(int, AppData*, const char*) not implemented\n"); 00404 abort(); 00405 }
Here is the call graph for this function: ![]() |
|
|
||||||||||||||||
|
Reimplemented in MessagePassingAgent. |
|
||||||||||||||||
|
|
|
||||||||||||||||||||
|
Reimplemented in MessagePassingAgent. Definition at line 420 of file agent.cc.
|
|
||||||||||||||||||||
|
Definition at line 411 of file agent.cc. References abort(). Referenced by Agent::command(), AnWormApp::probe(), and DnhWormApp::send_probe(). 00413 { 00414 fprintf(stderr, 00415 "Agent::sendmsg(int, AppData*, const char*) not implemented\n"); 00416 abort(); 00417 }
Here is the call graph for this function: ![]() |
|
|
|
Definition at line 103 of file agent.h. References Agent::type_. Referenced by Agent::command(), RA_Traffic::init(), POO_Traffic::init(), EXPOO_Traffic::init(), and CBR_PP_Traffic::init(). 00103 { type_ = pkttype; }
|
|
|
Definition at line 51 of file connector.h. References Connector::drop_. Referenced by XCPWrapQ::command(). 00051 {drop_ = dt; }
|
|
|
Reimplemented in FullTcpAgent. Definition at line 98 of file agent.h. References Agent::size_. Referenced by rtProtoDV::command(), RLM_Sender::command(), imepAgent::getResponseListSize(), LandmarkAgent::makeUpdate(), Agent::recv(), SSMSRMAgent::send_glb_sess(), SSMSRMAgent::send_loc_sess(), SSMSRMAgent::send_rep_sess(), SRMAgent::send_sess(), TelnetApp::timeout(), and SctpApp1::timeout(). 00098 { return size_; }
|
|
|
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 SA_Agent, RTPAgent, FtpClientAgent, BayFullTcpAgent, SinkAgent, RLM_Sender, MIPBSAgent, MIPMHAgent, RapAgent, RTCPAgent, TcpAsymSink, FackTcpAgent, FullTcpAgent, QSNewRenoTcpAgent, RBPVegasTcpAgent, RBPRenoTcpAgent, SackRHTcpAgent, Sack1TcpAgent, TcpSessionAgent, DelAckSink, TcpAgent, RenoTcpAgent, VegasTcpAgent, and SimpleTcpAgent. Definition at line 347 of file agent.cc. Referenced by SimpleTimer::expire().
|
|
|
Definition at line 149 of file tora_io.cc. References NsObject::recv(), and Connector::target_. Referenced by forward(), sendCLR(), sendQRY(), and sendUPD().
Here is the call graph for this function: ![]() |
|
|
Reimplemented in SctpAgent, and TcpAgent. Definition at line 266 of file agent.cc. References ns_addr_t::addr_, Agent::channel_, Agent::dst_, Agent::here_, Agent::insertOldValue(), Scheduler::instance(), Agent::lookupOldValue(), min, TIME_FORMAT, Agent::traceName_, TRACEVAR_MAXVALUELENGTH, and OldValue::val_. Referenced by TcpAgent::trace(). 00267 { 00268 if (channel_ == 0) 00269 return; 00270 char wrk[256], value[128]; 00271 int n; 00272 00273 // XXX we need to keep track of old values. What's the best way? 00274 v->value(value, 128); 00275 00276 // XXX hack: how do I know ns has not started yet? 00277 // if there's nothing in value, return 00278 static int started = 0; 00279 if (!started) { 00280 Tcl::instance().evalc("[Simulator instance] is-started"); 00281 if (Tcl::instance().result()[0] == '0') 00282 // Simulator not started, do nothing 00283 return; 00284 // remember for next time (so we don't always have to call to tcl) 00285 started = 1; 00286 }; 00287 00288 OldValue *ov = lookupOldValue(v); 00289 if (ov != NULL) { 00290 sprintf(wrk, 00291 "f -t "TIME_FORMAT" -s %d -d %d -n %s -a %s -v %s -o %s -T v", 00292 Scheduler::instance().clock(), here_.addr_, 00293 dst_.addr_, v->name(), traceName_, value, ov->val_); 00294 strncpy(ov->val_, 00295 value, 00296 min(strlen(value)+1, TRACEVAR_MAXVALUELENGTH)); 00297 } else { 00298 // if there is value, insert it into old value list 00299 sprintf(wrk, "f -t "TIME_FORMAT" -s %d -d %d -n %s -a %s -v %s -T v", 00300 Scheduler::instance().clock(), here_.addr_, 00301 dst_.addr_, v->name(), traceName_, value); 00302 insertOldValue(v, value); 00303 } 00304 n = strlen(wrk); 00305 wrk[n] = '\n'; 00306 wrk[n+1] = 0; 00307 (void)Tcl_Write(channel_, wrk, n+1); 00308 }
Here is the call graph for this function: ![]() |
|
||||||||||||
|
Definition at line 695 of file tora.cc. References BaseTrace::buffer(), BaseTrace::dump(), logtarget, and Trace::pt_. Referenced by recvCLR(), recvUPD(), rt_resolve(), and sendQRY(). 00696 { 00697 va_list ap; 00698 00699 if (!logtarget) return; 00700 00701 va_start(ap, fmt); 00702 vsprintf(logtarget->pt_->buffer(), fmt, ap); 00703 logtarget->pt_->dump(); 00704 va_end(ap); 00705 }
Here is the call graph for this function: ![]() |
|
|
Reimplemented in TcpAgent. Definition at line 149 of file agent.h.
|
|
|
Definition at line 75 of file tora.h. Referenced by dst_add(). |
|
|
|
|
|
Reimplemented in BayFullTcpAgent. Definition at line 137 of file agent.h. Referenced by Agent::attachApp(), Agent::idle(), RapAgent::IpgTimeout(), UdpAgent::recv(), TPAgent::recv(), SimpleTcpAgent::recv(), RapAgent::recv(), MessagePassingAgent::recv(), HttpInvalAgent::recv(), Agent::recv(), and Agent::recvBytes(). |
|
|
|
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 124 of file agent.h. Referenced by Agent::delay_bind_dispatch(), and Agent::initpkt(). |
|
|
Definition at line 59 of file connector.h. Referenced by XCPWrapQ::command(), Connector::command(), Connector::drop(), ErrorModel::recv(), and Connector::setDropTarget(). |
|
|
Reimplemented in AckRecons. Definition at line 118 of file agent.h. Referenced by Agent::addAgentTrace(), Agent::daddr(), Agent::delay_bind_dispatch(), Agent::deleteAgentTrace(), Agent::dport(), DSRProto::DSRProto(), Agent::flushAVar(), Agent::initpkt(), SRMAgent::recv(), SSMSRMAgent::recv(), NatAgent::recv(), SRMAgent::sendmsg(), PushbackAgent::sendMsg(), and Agent::trace(). |
|
|
Definition at line 131 of file tora.h. Referenced by dst_add(), dst_dump(), dst_find(), log_route_table(), rtNotifyLinkDN(), rtNotifyLinkUP(), and toraAgent(). |
|
|
Definition at line 148 of file agent.h. Referenced by TcpAgent::command(), and TcpAgent::trace_event(). |
|
|
Definition at line 121 of file agent.h. Referenced by Agent::delay_bind_dispatch(), AbsTcpAgent::flowid(), Agent::initpkt(), CtrMcastEncap::recv(), Sack1TcpAgent::timeout(), and TcpAgent::trace_event(). |
|
|
Reimplemented in BayFullTcpAgent, RapAgent, and FullTcpAgent. Definition at line 123 of file agent.h. Referenced by Agent::delay_bind_dispatch(). |
|
|
|
|
|
|
Definition at line 133 of file tora.h. Referenced by command(), dst_add(), initialized(), and toraAgent(). |
|
|
Definition at line 93 of file tora.h. Referenced by command(), recvCLR(), recvQRY(), and recvUPD(). |
|
|
Definition at line 140 of file tora.h. Referenced by command(), initialized(), log_link_layer_feedback(), log_link_layer_recycle(), log_lnk_del(), log_lnk_kept(), log_nb_del(), log_recv_clr(), log_recv_qry(), log_recv_upd(), log_route_loop(), log_route_table(), logNbDeletedLastDN(), logNextHopChange(), logToraDest(), logToraNeighbor(), recvUPD(), toraAgent(), and trace(). |
|
|
Definition at line 135 of file agent.h. Referenced by Agent::insertOldValue(), Agent::lookupOldValue(), and Agent::~Agent(). |
|
|
Definition at line 122 of file agent.h. Referenced by Agent::delay_bind_dispatch(), and Agent::initpkt(). |
|
|
Definition at line 148 of file tora.h. Referenced by command(), recvTORA(), reset(), and rt_resolve(). |
|
|
|
|
Definition at line 134 of file agent.h. Referenced by Agent::addAgentTrace(), Agent::command(), Agent::deleteAgentTrace(), Agent::flushAVar(), Agent::monitorAgentTrace(), and Agent::trace(). |
|
|
Definition at line 120 of file agent.h. Referenced by Agent::get_pkttype(), Agent::initpkt(), FullTcpAgent::listen(), BayFullTcpAgent::listen(), RapAgent::SendAck(), SRMAgent::sendmsg(), RapAgent::SendPacket(), Agent::set_pkttype(), and XcpAgent::XcpAgent(). |
|
|
Definition at line 131 of file agent.h. Referenced by imepAgent::handlerControlTimer(), Agent::initpkt(), imepAgent::sendAck(), imepAgent::sendBeacon(), sendCLR(), imepAgent::sendHello(), sendQRY(), and sendUPD(). |
1.4.6