#include <diff_sink.h>
Inheritance diagram for SinkAgent:


Definition at line 102 of file diff_sink.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) |
| Packet * | create_packet () |
| nsaddr_t & | daddr () |
| virtual void | debug (const char *fmt,...) |
| nsaddr_t & | dport () |
| virtual void | drop (Packet *p) |
| int | get_pk_count () |
| packet_t | get_pkttype () |
| void | incr_pk_count () |
| int | isdebug () const |
| virtual void | listen () |
| nsaddr_t & | port () |
| virtual void | recv (Packet *p, const char *s) |
| void | recv (Packet *, Handler *) |
| void | recvOnly (Packet *) |
| void | report () |
| void | reset () |
| 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_addr (ns_addr_t) |
| void | set_pkttype (packet_t pkttype) |
| void | setDropTarget (NsObject *dt) |
| SinkAgent () | |
| virtual int & | size () |
| void | target (NsObject *target) |
| NsObject * | target () |
| virtual void | timeout (int) |
Protected Member Functions | |
| void | addAgentTrace (const char *name) |
| Packet * | allocpkt (int) const |
| Packet * | allocpkt () const |
| void | bcast_interest () |
| void | data_ready () |
| 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 () |
| virtual void | recvBytes (int bytes) |
| virtual void | sendpkt () |
| void | start () |
| void | stop () |
| void | Terminate () |
| virtual void | trace (TracedVar *v) |
| virtual void | trace_event (char *eventtype) |
Protected Attributes | |
| bool | always_max_rate_ |
| Application * | app_ |
| bool | APP_DUP_ |
| Tcl_Channel | channel_ |
| double | cum_delay |
| int | data_counter |
| unsigned int | data_type_ |
| Data_Hash_Table | DataTable |
| int | debug_ |
| int | defttl_ |
| NsObject * | drop_ |
| ns_addr_t | dst_ |
| EventTrace * | et_ |
| int | fid_ |
| int | flags_ |
| ns_addr_t | here_ |
| double | interval_ |
| double | last_arrival_time |
| int | maxpkts_ |
| int | num_recv |
| int | num_send |
| OldValue * | oldValueList_ |
| bool | periodic_ |
| Periodic_Timer | periodic_timer_ |
| int | pk_count |
| int | prio_ |
| int | random_ |
| int | RecvPerSec |
| Report_Timer | report_timer_ |
| int | running_ |
| int | simple_report_rate |
| Sink_Timer | sink_timer_ |
| int | size_ |
| NsObject * | target_ |
| char * | traceName_ |
| packet_t | type_ |
Static Protected Attributes | |
| static int | uidcnt_ |
Friends | |
| class | Periodic_Timer |
|
|
Definition at line 88 of file diff_sink.cc. References always_max_rate_, APP_DUP_, cum_delay, data_counter, data_type_, interval_, last_arrival_time, maxpkts_, num_recv, num_send, ORIGINAL, periodic_, pk_count, random_, RecvPerSec, simple_report_rate, and Agent::size_. 00088 : Agent(PT_DIFF), data_type_(0), 00089 running_(0), random_(0), sink_timer_(this), periodic_timer_(this), 00090 report_timer_(this) 00091 { 00092 // set option first. 00093 00094 APP_DUP_ = true; 00095 00096 periodic_ = true; 00097 always_max_rate_ = false; 00098 00099 // Bind Tcl and C++ Variables 00100 00101 bind("data_type_", &data_type_); 00102 bind_time("interval_", &interval_); 00103 bind("packetSize_", &size_); 00104 bind("random_", &random_); 00105 bind("maxpkts_", &maxpkts_); 00106 00107 // Initialize variables. 00108 00109 // maxpkts_ = 2; 00110 pk_count=0; 00111 num_recv=0; 00112 num_send=0; 00113 RecvPerSec=0; 00114 00115 cum_delay=0.0; 00116 00117 data_counter = 0; 00118 simple_report_rate = ORIGINAL; 00119 00120 last_arrival_time = -1.0; 00121 }
|
|
|
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 }
|
|
|
Definition at line 224 of file diff_sink.cc. References ns_addr_t::addr_, create_packet(), hdr_cdiff::data_type, data_type_, hdr_ip::dst_, hdr_cdiff::forward_agent_id, HDR_CDIFF, HDR_IP, Agent::here_, INTEREST, INTEREST_PERIODIC, hdr_cdiff::mess_type, hdr_cdiff::next_nodes, hdr_cdiff::num_next, periodic_, periodic_timer_, pk_count, hdr_cdiff::pk_num, ns_addr_t::port_, hdr_cdiff::report_rate, TimerHandler::resched(), ROUTING_PORT, Agent::send(), hdr_cdiff::sender_id, hdr_ip::src_, and SUB_SAMPLED. Referenced by command(), and Periodic_Timer::expire(). 00225 { 00226 Packet* pkt = create_packet(); 00227 hdr_cdiff* dfh = HDR_CDIFF(pkt); 00228 hdr_ip* iph = HDR_IP(pkt); 00229 00230 // Set message type, packet number and sender ID 00231 dfh->mess_type = INTEREST; 00232 dfh->pk_num = pk_count; 00233 pk_count++; 00234 dfh->sender_id = here_; 00235 dfh->data_type = data_type_; 00236 dfh->forward_agent_id = here_; 00237 00238 dfh->report_rate = SUB_SAMPLED; 00239 dfh->num_next = 1; 00240 dfh->next_nodes[0] = here_.addr_; 00241 00242 iph->src_ = here_; 00243 iph->dst_.addr_ = here_.addr_; 00244 iph->dst_.port_ = ROUTING_PORT; 00245 00246 00247 00248 // Send the packet 00249 00250 // printf("Sink %s send packet (%x, %d) at %f to %x.\n", 00251 // name_, dfh->sender_id, 00252 // dfh->pk_num, 00253 // NOW, 00254 // iph->dst_); 00255 00256 send(pkt, 0); 00257 if (periodic_ == true) 00258 periodic_timer_.resched(INTEREST_PERIODIC); 00259 }
Here is the call graph for this function: ![]() |
|
|
Reimplemented in FullTcpAgent. Definition at line 377 of file agent.cc. Referenced by Agent::command().
|
|
||||||||||||
|
Reimplemented from Agent. Definition at line 299 of file diff_sink.cc. References always_max_rate_, APP_DUP_, bcast_interest(), Agent::command(), God::data_pkt_size, data_ready(), data_type_, TimerHandler::force_cancel(), God::instance(), REPORT_PERIOD, report_timer_, TimerHandler::resched(), sendpkt(), Agent::size_, start(), stop(), and Terminate(). 00300 { 00301 if (argc == 2) { 00302 00303 if (strcmp(argv[1], "enable-duplicate") == 0) { 00304 APP_DUP_ = true; 00305 return TCL_OK; 00306 } 00307 00308 if (strcmp(argv[1], "disable-duplicate") == 0) { 00309 APP_DUP_ = false; 00310 return TCL_OK; 00311 } 00312 00313 if (strcmp(argv[1], "always-max-rate") == 0) { 00314 always_max_rate_ = true; 00315 return TCL_OK; 00316 } 00317 00318 if (strcmp(argv[1], "terminate") == 0) { 00319 Terminate(); 00320 return TCL_OK; 00321 } 00322 00323 if (strcmp(argv[1], "announce") == 0) { 00324 bcast_interest(); 00325 report_timer_.resched(REPORT_PERIOD); 00326 00327 return (TCL_OK); 00328 } 00329 00330 if (strcmp(argv[1], "ready") == 0) { 00331 God::instance()->data_pkt_size = size_; 00332 data_ready(); 00333 return (TCL_OK); 00334 } 00335 00336 if (strcmp(argv[1], "send") == 0) { 00337 sendpkt(); 00338 return (TCL_OK); 00339 } 00340 00341 if (strcmp(argv[1], "cbr-start") == 0) { 00342 start(); 00343 return (TCL_OK); 00344 } 00345 00346 if (strcmp(argv[1], "stop") == 0) { 00347 stop(); 00348 report_timer_.force_cancel(); 00349 return (TCL_OK); 00350 } 00351 00352 } 00353 00354 if (argc == 3) { 00355 if (strcmp(argv[1], "data-type") == 0) { 00356 data_type_ = atoi(argv[2]); 00357 return (TCL_OK); 00358 } 00359 } 00360 00361 return (Agent::command(argc, argv)); 00362 }
Here is the call graph for this function: ![]() |
|
|
Definition at line 389 of file agent.cc. Referenced by Agent::command().
|
|
|
Definition at line 458 of file diff_sink.cc. References Agent::allocpkt(), HDR_CDIFF, HDR_CMN, NOW, hdr_cmn::size(), and hdr_cdiff::ts_. Referenced by bcast_interest(), data_ready(), and sendpkt(). 00459 { 00460 Packet *pkt = allocpkt(); 00461 00462 if (pkt==NULL) return NULL; 00463 00464 hdr_cmn* cmh = HDR_CMN(pkt); 00465 00466 cmh->size() = 36; 00467 00468 hdr_cdiff* dfh = HDR_CDIFF(pkt); 00469 dfh->ts_ = NOW; 00470 00471 return pkt; 00472 }
Here is the call graph for this function: ![]() |
|
|
|
Definition at line 262 of file diff_sink.cc. References ns_addr_t::addr_, create_packet(), DATA_READY, hdr_cdiff::data_type, data_type_, hdr_ip::dst_, hdr_cdiff::forward_agent_id, HDR_CDIFF, HDR_IP, Agent::here_, hdr_cdiff::mess_type, hdr_cdiff::next_nodes, hdr_cdiff::num_next, pk_count, hdr_cdiff::pk_num, ns_addr_t::port_, ROUTING_PORT, Agent::send(), hdr_cdiff::sender_id, and hdr_ip::src_. Referenced by command(). 00263 { 00264 // Create a new packet 00265 Packet* pkt = create_packet(); 00266 00267 // Access the Sink header for the new packet: 00268 hdr_cdiff* dfh = HDR_CDIFF(pkt); 00269 hdr_ip* iph = HDR_IP(pkt); 00270 00271 // Set message type, packet number and sender ID 00272 dfh->mess_type = DATA_READY; 00273 dfh->pk_num = pk_count; 00274 pk_count++; 00275 dfh->sender_id = here_; 00276 dfh->data_type = data_type_; 00277 dfh->forward_agent_id = here_; 00278 00279 dfh->num_next = 1; 00280 dfh->next_nodes[0] = here_.addr_; 00281 00282 iph->src_ = here_; 00283 iph->dst_.addr_ = here_.addr_; 00284 iph->dst_.port_ = ROUTING_PORT; 00285 00286 send(pkt, 0); 00287 }
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 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 446 of file diff_sink.cc. References pk_count. 00447 { 00448 return pk_count; 00449 }
|
|
|
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: ![]() |
|
|
Definition at line 452 of file diff_sink.cc. References pk_count. 00453 { 00454 pk_count++; 00455 }
|
|
|
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 365 of file diff_sink.cc. References always_max_rate_, APP_DUP_, hdr_cdiff::attr, cum_delay, DATA, DATA_REQUEST, DATA_STOP, hdr_cdiff::data_type, data_type_, DataTable, Packet::free(), Data_Hash_Table::GetHash(), HDR_CDIFF, God::IncrRecv(), God::instance(), last_arrival_time, hdr_cdiff::mess_type, NOW, num_recv, Data_Hash_Table::PutInHash(), RecvPerSec, hdr_cdiff::report_rate, running_, simple_report_rate, start(), stop(), and hdr_cdiff::ts_. 00366 { 00367 hdr_cdiff* dfh = HDR_CDIFF(pkt); 00368 00369 /* 00370 printf("SK %d recv (%x, %x, %d) %s size %d at time %lf\n", here_.addr_, 00371 (dfh->sender_id).addr_, (dfh->sender_id).port_, 00372 dfh->pk_num, MsgStr[dfh->mess_type], cmh->size(), NOW); 00373 */ 00374 00375 if (data_type_ != dfh->data_type) { 00376 printf("Hey, What are you doing? I am not a sink for %d. I'm a sink for %d. \n", dfh->data_type, data_type_); 00377 Packet::free(pkt); 00378 return; 00379 } 00380 00381 00382 switch(dfh->mess_type) { 00383 case DATA_REQUEST : 00384 00385 if (always_max_rate_ == false) 00386 simple_report_rate = dfh->report_rate; 00387 00388 if (!running_) start(); 00389 00390 // printf("I got a data request for data rate %d at %lf. Will send it right away.\n", 00391 // simple_report_rate, NOW); 00392 00393 break; 00394 00395 case DATA_STOP : 00396 00397 if (running_) stop(); 00398 break; 00399 00400 case DATA : 00401 00402 if (APP_DUP_ == true) { 00403 if (DataTable.GetHash(dfh->attr) != NULL) { 00404 Packet::free(pkt); 00405 return; 00406 } else { 00407 DataTable.PutInHash(dfh->attr); 00408 } 00409 } 00410 00411 cum_delay = cum_delay + (NOW - dfh->ts_); 00412 num_recv++; 00413 RecvPerSec++; 00414 God::instance()->IncrRecv(); 00415 00416 /* 00417 if (last_arrival_time > 0.0) { 00418 printf("SK %d: Num_Recv %d, InterArrival %lf\n", here_.addr_, 00419 num_recv, (NOW)-last_arrival_time); 00420 } 00421 */ 00422 last_arrival_time = NOW; 00423 00424 break; 00425 00426 default: 00427 00428 break; 00429 } 00430 00431 Packet::free(pkt); 00432 }
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.
|
|
|
Definition at line 143 of file diff_sink.cc. References RecvPerSec, REPORT_PERIOD, report_timer_, and TimerHandler::resched(). Referenced by Report_Timer::expire(). 00144 { 00145 // printf("SK %d: RecvPerSec %d at time %lf\n", here_.addr_, RecvPerSec, NOW); 00146 report_timer_.resched(REPORT_PERIOD); 00147 RecvPerSec = 0; 00148 }
Here is the call graph for this function: ![]() |
|
|
Reimplemented from NsObject. Definition at line 435 of file diff_sink.cc.
|
|
|
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: ![]() |
|
|
Definition at line 164 of file diff_sink.cc. References ns_addr_t::addr_, APP_DUP_, hdr_cdiff::attr, God::CountNewData(), create_packet(), DATA, data_counter, hdr_cdiff::data_type, data_type_, hdr_ip::dst_, hdr_cdiff::forward_agent_id, Packet::free(), HDR_CDIFF, HDR_CMN, HDR_IP, Agent::here_, God::instance(), maxpkts_, hdr_cdiff::mess_type, hdr_cdiff::next_nodes, hdr_cdiff::num_next, num_send, ORIGINAL, pk_count, hdr_cdiff::pk_num, ns_addr_t::port_, hdr_cdiff::report_rate, ROUTING_PORT, running_, Agent::send(), hdr_cdiff::sender_id, hdr_cmn::size(), Agent::size_, hdr_ip::src_, and SUB_SAMPLED. Referenced by command(), start(), and timeout(). 00165 { 00166 if (pk_count >= maxpkts_) { 00167 running_ = 0; 00168 return; 00169 } 00170 00171 Packet* pkt = create_packet(); 00172 hdr_cdiff* dfh = HDR_CDIFF(pkt); 00173 hdr_ip* iph = HDR_IP(pkt); 00174 hdr_cmn* cmh = HDR_CMN(pkt); 00175 00176 00177 data_counter = (data_counter + SUB_SAMPLED)% ORIGINAL; 00178 if (data_counter == SUB_SAMPLED) { 00179 dfh->report_rate = SUB_SAMPLED; 00180 } else { 00181 dfh->report_rate = ORIGINAL; 00182 } 00183 if (simple_report_rate < dfh->report_rate) { 00184 Packet::free(pkt); 00185 return; 00186 } 00187 00188 cmh->size() = size_; 00189 dfh->mess_type = DATA; 00190 dfh->pk_num = pk_count; 00191 00192 pk_count++; 00193 00194 dfh->sender_id = here_; 00195 dfh->data_type = data_type_; 00196 dfh->forward_agent_id = here_; 00197 00198 dfh->num_next = 1; 00199 dfh->next_nodes[0] = here_.addr_; 00200 00201 iph->src_ = here_; 00202 iph->dst_.addr_ = here_.addr_; 00203 iph->dst_.port_ = ROUTING_PORT; 00204 00205 // Send the packet 00206 // printf("Source %s send packet (%x, %d) at %lf.\n", name(), 00207 // dfh->sender_id, dfh->pk_num, NOW); 00208 00209 00210 num_send++; 00211 dfh->attr[0] = data_type_; 00212 00213 if (APP_DUP_ == true) 00214 dfh->attr[1] = 0; // Represent detection of the same animal 00215 else 00216 dfh->attr[1] = here_.addr_; // Detect a different animal. 00217 00218 dfh->attr[2] = num_send; 00219 God::instance()->CountNewData(dfh->attr); 00220 send(pkt, 0); 00221 }
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 440 of file diff_sink.cc. References Agent::here_. 00441 { 00442 here_=address; 00443 }
|
|
|
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 123 of file diff_sink.cc. References interval_, TimerHandler::resched(), running_, sendpkt(), and sink_timer_. Referenced by command(), and recv(). 00124 { 00125 running_ = 1; 00126 sendpkt(); 00127 sink_timer_.resched(interval_); 00128 }
Here is the call graph for this function: ![]() |
|
|
Definition at line 130 of file diff_sink.cc. References TimerHandler::force_cancel(), periodic_, periodic_timer_, and running_. Referenced by command(), and recv(). 00131 { 00132 if (running_) { 00133 running_ = 0; 00134 } 00135 00136 if (periodic_ == true) { 00137 periodic_ = false; 00138 periodic_timer_.force_cancel(); 00139 } 00140 }
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_; }
|
|
|
Definition at line 290 of file diff_sink.cc. References ns_addr_t::addr_, cum_delay, data_type_, Agent::here_, num_recv, and num_send. Referenced by command(). 00291 { 00292 #ifdef DEBUG_OUTPUT 00293 printf("SINK %d : TYPE %d : terminates (send %d, recv %d, cum_delay %f)\n", 00294 here_.addr_, data_type_, num_send, num_recv, cum_delay); 00295 #endif 00296 }
|
|
|
Reimplemented from Agent. Definition at line 151 of file diff_sink.cc. References interval_, random_, TimerHandler::resched(), running_, sendpkt(), sink_timer_, and Random::uniform(). Referenced by Sink_Timer::expire(). 00152 { 00153 if (running_) { 00154 sendpkt(); 00155 double t = interval_; 00156 if (random_) 00157 /* add some zero-mean white noise */ 00158 t += interval_ * Random::uniform(-0.5, 0.5); 00159 sink_timer_.resched(t); 00160 } 00161 }
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.
|
|
|
Definition at line 152 of file diff_sink.h. |
|
|
Definition at line 121 of file diff_sink.h. Referenced by command(), recv(), and SinkAgent(). |
|
|
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 118 of file diff_sink.h. Referenced by command(), recv(), sendpkt(), and SinkAgent(). |
|
|
|
Definition at line 128 of file diff_sink.h. Referenced by recv(), SinkAgent(), and Terminate(). |
|
|
Definition at line 146 of file diff_sink.h. Referenced by sendpkt(), and SinkAgent(). |
|
|
Definition at line 123 of file diff_sink.h. Referenced by bcast_interest(), command(), data_ready(), recv(), sendpkt(), SinkAgent(), and Terminate(). |
|
|
Definition at line 131 of file diff_sink.h. Referenced by recv(). |
|
|
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 143 of file diff_sink.h. Referenced by SinkAgent(), start(), and timeout(). |
|
|
Definition at line 129 of file diff_sink.h. Referenced by recv(), and SinkAgent(). |
|
|
Definition at line 142 of file diff_sink.h. Referenced by sendpkt(), and SinkAgent(). |
|
|
Definition at line 124 of file diff_sink.h. Referenced by recv(), SinkAgent(), and Terminate(). |
|
|
Definition at line 125 of file diff_sink.h. Referenced by sendpkt(), SinkAgent(), and Terminate(). |
|
|
Definition at line 135 of file agent.h. Referenced by Agent::insertOldValue(), Agent::lookupOldValue(), and Agent::~Agent(). |
|
|
Definition at line 120 of file diff_sink.h. Referenced by bcast_interest(), SinkAgent(), and stop(). |
|
|
Definition at line 149 of file diff_sink.h. Referenced by bcast_interest(), and stop(). |
|
|
Definition at line 122 of file diff_sink.h. Referenced by bcast_interest(), data_ready(), get_pk_count(), incr_pk_count(), sendpkt(), and SinkAgent(). |
|
|
Definition at line 122 of file agent.h. Referenced by Agent::delay_bind_dispatch(), and Agent::initpkt(). |
|
|
Definition at line 141 of file diff_sink.h. Referenced by SinkAgent(), and timeout(). |
|
|
Definition at line 126 of file diff_sink.h. Referenced by recv(), report(), and SinkAgent(). |
|
|
Definition at line 150 of file diff_sink.h. |
|
|
Definition at line 140 of file diff_sink.h. Referenced by recv(), sendpkt(), start(), stop(), and timeout(). |
|
|
Definition at line 145 of file diff_sink.h. Referenced by recv(), and SinkAgent(). |
|
|
Definition at line 148 of file diff_sink.h. |
|
|
|
|
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(), toraAgent::sendCLR(), imepAgent::sendHello(), toraAgent::sendQRY(), and toraAgent::sendUPD(). |
1.4.6