#include <sa.h>
Inheritance diagram for SA_Agent:


Definition at line 63 of file sa.h.
Public Member Functions | |
| nsaddr_t & | addr () |
| virtual void | attachApp (Application *app) |
| virtual void | close () |
| int | command (int, const char *const *) |
| 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 | recvOnly (Packet *) |
| SA_Agent () | |
| virtual void | send (int nbytes) |
| virtual void | send (int sz, AppData *data) |
| void | send (Packet *p, Handler *h) |
| virtual void | sendmsg (int sz, AppData *, const char *flags=0) |
| virtual void | sendmsg (int nbytes, 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) |
| ~SA_Agent () | |
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) |
| OldValue * | lookupOldValue (TracedVar *v) |
| void | monitorAgentTrace () |
| void | recv (Packet *, Handler *) |
| virtual void | recvBytes (int bytes) |
| virtual void | reset () |
| virtual void | sendpkt () |
| void | sendreq () |
| void | sendteardown () |
| void | start () |
| void | stop () |
| void | stoponidle (const char *) |
| virtual void | trace (TracedVar *v) |
| virtual void | trace_event (char *eventtype) |
Protected Attributes | |
| Application * | app_ |
| int | bucket_ |
| char * | callback_ |
| Tcl_Channel | channel_ |
| NsObject * | ctrl_target_ |
| int | debug_ |
| int | defttl_ |
| NsObject * | drop_ |
| ns_addr_t | dst_ |
| EventTrace * | et_ |
| int | fid_ |
| int | flags_ |
| ns_addr_t | here_ |
| double | nextPkttime_ |
| OldValue * | oldValueList_ |
| int | prio_ |
| double | rate_ |
| int | rtd_ |
| int | running_ |
| SA_Timer | sa_timer_ |
| int | seqno_ |
| int | size_ |
| NsObject * | target_ |
| char * | traceName_ |
| TrafficGenerator * | trafgen_ |
| packet_t | type_ |
Static Protected Attributes | |
| static int | uidcnt_ |
|
|
Definition at line 54 of file sa.cc. References bucket_, rate_, and size_. 00054 : Agent(PT_UDP), trafgen_(0), rtd_(0), callback_(0), 00055 sa_timer_(this), nextPkttime_(-1), running_(0), seqno_(-1) 00056 { 00057 bind_bw("rate_",&rate_); 00058 bind("bucket_",&bucket_); 00059 bind("packetSize_", &size_); 00060 }
|
|
|
Definition at line 62 of file sa.cc. References callback_.
|
|
|
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 78 of file sa.cc. References Agent::command(), ctrl_target_, start(), stop(), stoponidle(), Connector::target_, and trafgen_. 00079 { 00080 Tcl& tcl = Tcl::instance(); 00081 if (argc==3) { 00082 if (strcmp(argv[1], "target") == 0) { 00083 target_ = (NsObject*)TclObject::lookup(argv[2]); 00084 if (target_ == 0) { 00085 tcl.resultf("no such object %s", argv[2]); 00086 return (TCL_ERROR); 00087 } 00088 ctrl_target_=target_; 00089 return (TCL_OK); 00090 } 00091 else if (strcmp(argv[1],"ctrl-target")== 0) { 00092 ctrl_target_=(NsObject*)TclObject::lookup(argv[2]); 00093 if (ctrl_target_ == 0) { 00094 tcl.resultf("no such object %s", argv[2]); 00095 return (TCL_ERROR); 00096 } 00097 return (TCL_OK); 00098 } 00099 if (strcmp(argv[1], "stoponidle") == 0) { 00100 stoponidle(argv[2]); 00101 return(TCL_OK); 00102 } 00103 if (strcmp(argv[1], "attach-traffic") == 0) { 00104 trafgen_ =(TrafficGenerator*)TclObject::lookup(argv[2]); 00105 if (trafgen_ == 0) { 00106 tcl.resultf("no such node %s", argv[2]); 00107 return(TCL_ERROR); 00108 } 00109 return(TCL_OK); 00110 } 00111 00112 } 00113 if (argc == 2) { 00114 if (strcmp(argv[1], "start") == 0) { 00115 start(); 00116 return(TCL_OK); 00117 } else if (strcmp(argv[1], "stop") == 0) { 00118 stop(); 00119 return(TCL_OK); 00120 } 00121 } 00122 return (Agent::command(argc,argv)); 00123 }
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 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(), sendmsg(), RTPAgent::sendmsg(), MessagePassingAgent::sendmsg(), TPAgent::sendto(), and MessagePassingAgent::sendto().
Here is the call graph for this function: ![]() |
|
|
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 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().
|
|
|
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 175 of file sa.cc. References hdr_ip::access(), hdr_resv::access(), hdr_cmn::access(), ctrl_target_, hdr_ip::dst(), PT_ACCEPT, PT_CONFIRM, PT_REJECT, hdr_cmn::ptype(), NsObject::recv(), and hdr_ip::src(). 00176 { 00177 hdr_cmn *ch= hdr_cmn::access(p); 00178 hdr_resv *rv=hdr_resv::access(p); 00179 hdr_ip * iph = hdr_ip::access(p); 00180 if ( ch->ptype() == PT_ACCEPT || ch->ptype() == PT_REJECT ) { 00181 ch->ptype() = PT_CONFIRM; 00182 00183 // turn the packet around by swapping src and dst 00184 // (address and port) 00185 ns_addr_t tmp; 00186 tmp = iph->src(); 00187 iph->src() = iph->dst(); 00188 iph->dst() = tmp; 00189 ctrl_target_->recv(p); 00190 } 00191 00192 // put an additional check here to see if admission was granted 00193 if (rv->decision()) { 00194 //printf("Flow %d accepted @ %f\n",iph->flowid(),Scheduler::instance().clock()); 00195 fflush(stdout); 00196 double t = trafgen_->next_interval(size_); 00197 running_=1; 00198 sa_timer_.resched(t); 00199 } 00200 else { 00201 //printf("Flow %d rejected @ %f\n",iph->flowid(),Scheduler::instance().clock()); 00202 fflush(stdout); 00203 //Currently the flow is stopped if rejected 00204 running_=0; 00205 } 00206 //make an upcall to sched a stoptime for this flow from now 00207 Tcl::instance().evalf("%s sched-stop %d",name(),rv->decision()); 00208 }
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: ![]() |
|
|
Reimplemented from NsObject. Definition at line 78 of file agent.h.
|
|
|
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 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 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 from Agent. Definition at line 272 of file sa.cc. References hdr_rtp::access(), Agent::allocpkt(), Agent::idle(), NsObject::recv(), hdr_rtp::seqno(), seqno_, size_, start(), and Connector::target_. 00273 { 00274 Packet *p; 00275 int n; 00276 00277 assert (size_ > 0); 00278 00279 n = nbytes / size_; 00280 00281 if (nbytes == -1) { 00282 start(); 00283 return; 00284 } 00285 while (n-- > 0) { 00286 p = allocpkt(); 00287 hdr_rtp* rh = hdr_rtp::access(p); 00288 rh->seqno() = seqno_; 00289 target_->recv(p); 00290 } 00291 n = nbytes % size_; 00292 if (n > 0) { 00293 p = allocpkt(); 00294 hdr_rtp* rh = hdr_rtp::access(p); 00295 rh->seqno() = seqno_; 00296 target_->recv(p); 00297 } 00298 idle(); 00299 }
Here is the call graph for this function: ![]() |
|
|
Definition at line 254 of file sa.cc. References hdr_cmn::access(), hdr_rtp::access(), Agent::allocpkt(), Scheduler::clock(), hdr_rtp::flags(), Scheduler::instance(), TrafficGenerator::interval(), nextPkttime_, NsObject::recv(), RTP_M, SAMPLERATE, hdr_rtp::seqno(), seqno_, hdr_cmn::size(), size_, Connector::target_, hdr_cmn::timestamp(), and trafgen_. Referenced by timeout(). 00255 { 00256 Packet* p = allocpkt(); 00257 hdr_rtp* rh = hdr_rtp::access(p); 00258 rh->seqno() = ++seqno_; 00259 rh->flags()=0; 00260 00261 double local_time=Scheduler::instance().clock(); 00262 /*put in "rtp timestamps" and begining of talkspurt labels */ 00263 hdr_cmn* ch = hdr_cmn::access(p); 00264 ch->timestamp()=(u_int32_t)(SAMPLERATE*local_time); 00265 ch->size()=size_; 00266 if ((nextPkttime_ != trafgen_->interval()) || (nextPkttime_ == -1)) 00267 rh->flags() |= RTP_M; 00268 00269 target_->recv(p); 00270 }
Here is the call graph for this function: ![]() |
|
|
Definition at line 146 of file sa.cc. References hdr_resv::access(), hdr_cmn::access(), Agent::allocpkt(), hdr_resv::bucket(), bucket_, ctrl_target_, hdr_resv::decision(), PT_REQUEST, hdr_cmn::ptype(), hdr_resv::rate(), rate_, NsObject::recv(), and hdr_cmn::size(). Referenced by start(). 00147 { 00148 Packet *p = allocpkt(); 00149 hdr_cmn* ch= hdr_cmn::access(p); 00150 ch->ptype()=PT_REQUEST; 00151 ch->size()=20; 00152 //also put in the r,b parameters for the flow in the packet 00153 hdr_resv* rv=hdr_resv::access(p); 00154 rv->decision() =1; 00155 rv->rate()=rate_; 00156 rv->bucket()=bucket_; 00157 ctrl_target_->recv(p); 00158 }
Here is the call graph for this function: ![]() |
|
|
Definition at line 160 of file sa.cc. References hdr_resv::access(), hdr_cmn::access(), Agent::allocpkt(), hdr_resv::bucket(), bucket_, ctrl_target_, hdr_resv::decision(), PT_TEARDOWN, hdr_cmn::ptype(), hdr_resv::rate(), rate_, NsObject::recv(), and hdr_cmn::size(). Referenced by stop(). 00161 { 00162 Packet *p = allocpkt(); 00163 hdr_cmn* ch= hdr_cmn::access(p); 00164 ch->ptype()=PT_TEARDOWN; 00165 ch->size()=20; 00166 //also put in the r,b parameters for the flow in the packet 00167 hdr_resv* rv=hdr_resv::access(p); 00168 rv->decision() =1; 00169 rv->rate()=rate_; 00170 rv->bucket()=bucket_; 00171 ctrl_target_->recv(p); 00172 }
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 126 of file sa.cc. References TrafficGenerator::init(), sendreq(), and trafgen_. Referenced by command(), and sendmsg(). 00127 { 00128 //send the request packet 00129 if (trafgen_) { 00130 trafgen_->init(); 00131 //running_=1; 00132 sendreq(); 00133 } 00134 }
Here is the call graph for this function: ![]() |
|
|
Definition at line 136 of file sa.cc. References TimerHandler::cancel(), running_, sa_timer_, and sendteardown(). Referenced by command(), and timeout(). 00137 { 00138 sendteardown(); 00139 if (running_ != 0) { 00140 sa_timer_.cancel(); 00141 running_ =0; 00142 } 00143 }
Here is the call graph for this function: ![]() |
|
|
Definition at line 210 of file sa.cc. References callback_, TrafficGenerator::on(), rtd_, and trafgen_. Referenced by command(). 00211 { 00212 callback_ = new char[strlen(s)+1]; 00213 strcpy(callback_, s); 00214 00215 if (trafgen_->on()) { 00216 // Tcl::instance().evalf("puts \"%s waiting for burst at %f\"", name(), Scheduler::instance().clock()); 00217 rtd_ = 1; 00218 } 00219 else { 00220 stop(); 00221 Tcl::instance().evalf("%s %s", name(), callback_); 00222 } 00223 00224 }
Here is the call graph for this function: ![]() |
|
|
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 from Agent. Definition at line 230 of file sa.cc. References TrafficGenerator::next_interval(), nextPkttime_, TrafficGenerator::on(), TimerHandler::resched(), rtd_, running_, sa_timer_, sendpkt(), size_, stop(), and trafgen_. Referenced by SA_Timer::expire(). 00231 { 00232 if (running_) { 00233 /* send a packet */ 00234 sendpkt(); 00235 /* figure out when to send the next one */ 00236 nextPkttime_ = trafgen_->next_interval(size_); 00237 /* schedule it */ 00238 sa_timer_.resched(nextPkttime_); 00239 00240 /* hack: if we are waiting for a current burst to end 00241 * before stopping . . . 00242 */ 00243 if (rtd_) { 00244 if (trafgen_->on() == 0) { 00245 stop(); 00246 //Tcl::instance().evalf("puts \"%s burst over at %f\"", 00247 // name(), Scheduler::instance().clock()); 00248 Tcl::instance().evalf("%s sched-stop %d", name(), 0); 00249 } 00250 } 00251 } 00252 }
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: ![]() |
|
|
Reimplemented in TcpAgent. Definition at line 149 of file agent.h.
|
|
|
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(). |
|
|
Definition at line 79 of file sa.h. Referenced by SA_Agent(), sendreq(), and sendteardown(). |
|
|
Definition at line 83 of file sa.h. Referenced by stoponidle(), and ~SA_Agent(). |
|
|
|
Definition at line 80 of file sa.h. Referenced by command(), recv(), sendreq(), and sendteardown(). |
|
|
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 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 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 78 of file sa.h. Referenced by SA_Agent(), sendreq(), and sendteardown(). |
|
|
Definition at line 82 of file sa.h. Referenced by stoponidle(), and timeout(). |
|
|
|
|
|
|
|
|
|
|
|
Reimplemented from Agent. Definition at line 89 of file sa.h. Referenced by SA_Agent(), sendmsg(), sendpkt(), and timeout(). |
|
|
|
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 81 of file sa.h. Referenced by command(), sendpkt(), start(), stoponidle(), and timeout(). |
|
|
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(), toraAgent::sendCLR(), imepAgent::sendHello(), toraAgent::sendQRY(), and toraAgent::sendUPD(). |
1.4.6