

Public Member Functions | |
| TraceIpMac (int type) | |
| void | recv (Packet *, Handler *) |
| virtual void | recv (Packet *p, const char *s) |
| int | command (int argc, const char *const *argv) |
| void | recvOnly (Packet *p) |
| virtual void | write_nam_trace (const char *s) |
| void | trace (TracedVar *var) |
| NsObject * | target () |
| virtual void | drop (Packet *p) |
| virtual void | delay_bind_init_all () |
| virtual int | delay_bind_dispatch (const char *varName, const char *localName, TclObject *tracer) |
| int | isdebug () const |
| virtual void | debug (const char *fmt,...) |
Static Public Member Functions | |
| int | get_seqno (Packet *p) |
Public Attributes | |
| BaseTrace * | pt_ |
| int | type_ |
Protected Member Functions | |
| virtual void | format (int tt, int s, int d, Packet *p) |
| void | annotate (const char *s) |
| void | callback () |
| virtual void | drop (Packet *p, const char *s) |
| void | send (Packet *p, Handler *h) |
| virtual void | reset () |
| void | handle (Event *) |
Protected Attributes | |
| int | mask_ |
| int | shift_ |
| nsaddr_t | src_ |
| nsaddr_t | dst_ |
| int | callback_ |
| int | show_tcphdr_ |
| NsObject * | target_ |
| NsObject * | drop_ |
| int | debug_ |
|
|
Definition at line 57 of file trace-ip.cc.
00057 : TraceIp(type) {} |
|
|
Definition at line 160 of file trace.cc. References BaseTrace::buffer(), Trace::callback(), Scheduler::clock(), BaseTrace::dump(), Scheduler::instance(), BaseTrace::namdump(), BaseTrace::nbuffer(), Trace::pt_, BaseTrace::round(), BaseTrace::tagged(), and TIME_FORMAT. Referenced by Trace::command().
00161 {
00162 if (pt_->tagged()) {
00163 sprintf(pt_->buffer(),
00164 "v "TIME_FORMAT" -e {sim_annotation %g %s}",
00165 Scheduler::instance().clock(),
00166 Scheduler::instance().clock(), s);
00167 } else {
00168 sprintf(pt_->buffer(),
00169 "v "TIME_FORMAT" eval {set sim_annotation {%s}}",
00170 pt_->round(Scheduler::instance().clock()), s);
00171 }
00172 pt_->dump();
00173 callback();
00174 sprintf(pt_->nbuffer(), "v -t "TIME_FORMAT" -e sim_annotation %g %s",
00175 Scheduler::instance().clock(),
00176 Scheduler::instance().clock(), s);
00177 pt_->namdump();
00178 }
|
Here is the call graph for this function:

|
|
Definition at line 401 of file trace.cc. References BaseTrace::buffer(), Trace::callback_, and Trace::pt_. Referenced by Trace::annotate(), DequeTrace::recv(), Trace::recv(), Trace::recvOnly(), and Trace::trace().
|
Here is the call graph for this function:

|
||||||||||||
|
Reimplemented from Connector. Reimplemented in CMUTrace. Definition at line 83 of file trace.cc. References Trace::annotate(), BaseTrace::channel(), Connector::command(), BaseTrace::flush(), BaseTrace::namchannel(), Trace::pt_, BaseTrace::tagged(), and Trace::write_nam_trace(). Referenced by CMUTrace::command().
00084 {
00085 Tcl& tcl = Tcl::instance();
00086 if (argc == 2) {
00087 if (strcmp(argv[1], "detach") == 0) {
00088 pt_->channel(0) ;
00089 pt_->namchannel(0) ;
00090 return (TCL_OK);
00091 }
00092 if (strcmp(argv[1], "flush") == 0) {
00093 Tcl_Channel ch = pt_->channel();
00094 Tcl_Channel namch = pt_->namchannel();
00095 if (ch != 0)
00096 pt_->flush(ch);
00097 //Tcl_Flush(pt_.channel());
00098 if (namch != 0)
00099 //Tcl_Flush(pt_->namchannel());
00100 pt_->flush(namch);
00101 return (TCL_OK);
00102 }
00103 if (strcmp(argv[1], "tagged") == 0) {
00104 tcl.resultf("%d", pt_->tagged());
00105 return (TCL_OK);
00106 }
00107 } else if (argc == 3) {
00108 if (strcmp(argv[1], "annotate") == 0) {
00109 if (pt_->channel() != 0)
00110 annotate(argv[2]);
00111 return (TCL_OK);
00112 }
00113 if (strcmp(argv[1], "attach") == 0) {
00114 int mode;
00115 const char* id = argv[2];
00116 Tcl_Channel ch = Tcl_GetChannel(tcl.interp(), (char*)id,
00117 &mode);
00118 pt_->channel(ch);
00119 if (pt_->channel() == 0) {
00120 tcl.resultf("trace: can't attach %s for writing", id);
00121 return (TCL_ERROR);
00122 }
00123 return (TCL_OK);
00124 }
00125 if (strcmp(argv[1], "namattach") == 0) {
00126 int mode;
00127 const char* id = argv[2];
00128 Tcl_Channel namch = Tcl_GetChannel(tcl.interp(),
00129 (char*)id, &mode);
00130 pt_->namchannel(namch);
00131 if (pt_->namchannel() == 0) {
00132 tcl.resultf("trace: can't attach %s for writing", id);
00133 return (TCL_ERROR);
00134 }
00135 return (TCL_OK);
00136 }
00137 if (strcmp(argv[1], "ntrace") == 0) {
00138 if (pt_->namchannel() != 0)
00139 write_nam_trace(argv[2]);
00140 return (TCL_OK);
00141 }
00142 if (strcmp(argv[1], "tagged") == 0) {
00143 int tag;
00144 if (Tcl_GetBoolean(tcl.interp(),
00145 (char*)argv[2], &tag) == TCL_OK) {
00146 pt_->tagged(tag);
00147 return (TCL_OK);
00148 } else return (TCL_ERROR);
00149 }
00150 }
00151 return (Connector::command(argc, argv));
00152 }
|
Here is the call graph for this function:

|
||||||||||||
|
Definition at line 102 of file object.cc. References NsObject::debug_.
00103 {
00104 if (!debug_)
00105 return;
00106 va_list ap;
00107 va_start(ap, fmt);
00108 vprintf(fmt, ap);
00109 }
|
|
||||||||||||||||
|
Reimplemented in BayFullTcpAgent, Agent, MPLSAddressClassifier, LDPAgent, FullTcpAgent, SackFullTcpAgent, RFC793eduTcpAgent, TcpSink, TcpAgent, and VegasTcpAgent. Definition at line 63 of file object.cc. References NsObject::debug_. Referenced by MPLSAddressClassifier::delay_bind_dispatch(), and Agent::delay_bind_dispatch().
00064 {
00065 if (delay_bind_bool(varName, localName, "debug_", &debug_, tracer))
00066 return TCL_OK;
00067 return TclObject::delay_bind_dispatch(varName, localName, tracer);
00068 }
|
|
|
Reimplemented in BayFullTcpAgent, Agent, MPLSAddressClassifier, LDPAgent, FullTcpAgent, SackFullTcpAgent, RFC793eduTcpAgent, TcpSink, TcpAgent, and VegasTcpAgent. Definition at line 57 of file object.cc. Referenced by MPLSAddressClassifier::delay_bind_init_all(), and Agent::delay_bind_init_all().
00058 {
00059 delay_bind_init_one("debug_");
00060 }
|
|
||||||||||||
|
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:

|
Here is the call graph for this function:

|
||||||||||||||||||||
|
Reimplemented in SatTrace. Definition at line 214 of file trace.cc. References abort(), hdr_flags::access(), hdr_srm::access(), hdr_tcp::access(), hdr_ip::access(), hdr_cmn::access(), hdr_tcp::ackno(), BaseTrace::buffer(), Scheduler::clock(), hdr_flags::cong_action_, hdr_ip::daddr(), hdr_ip::dport(), hdr_flags::ecn_, hdr_flags::ecn_capable_, hdr_flags::ecn_to_echo_, hdr_tcp::flags(), hdr_ip::flowid(), hdr_flags::fs_, Trace::get_seqno(), hdr_tcp::hlen(), Scheduler::instance(), Address::instance(), BaseTrace::namchannel(), p_info::name(), BaseTrace::nbuffer(), NUMFLAGS, packet_info, packet_t, hdr_flags::pri_, Address::print_nodeaddr(), Address::print_portaddr(), Trace::pt_, hdr_cmn::ptype(), BaseTrace::round(), hdr_tcp::sa_length(), hdr_ip::saddr(), sh, Trace::show_tcphdr_, hdr_cmn::size(), hdr_ip::sport(), srm_names, BaseTrace::tagged(), TIME_FORMAT, and hdr_cmn::uid(). Referenced by DequeTrace::recv(), Trace::recv(), recv(), TraceIp::recv(), and Trace::recvOnly().
00215 {
00216 hdr_cmn *th = hdr_cmn::access(p);
00217 hdr_ip *iph = hdr_ip::access(p);
00218 hdr_tcp *tcph = hdr_tcp::access(p);
00219 hdr_srm *sh = hdr_srm::access(p);
00220
00221 const char* sname = "null";
00222
00223 packet_t t = th->ptype();
00224 const char* name = packet_info.name(t);
00225
00226 /* SRM-specific */
00227 if (strcmp(name,"SRM") == 0 || strcmp(name,"cbr") == 0 || strcmp(name,"udp") == 0) {
00228 if ( sh->type() < 5 && sh->type() > 0 ) {
00229 sname = srm_names[sh->type()];
00230 }
00231 }
00232
00233 if (name == 0)
00234 abort();
00235
00236 int seqno = get_seqno(p);
00237 /*
00238 * When new flags are added, make sure to change NUMFLAGS
00239 * in trace.h
00240 */
00241 char flags[NUMFLAGS+1];
00242 for (int i = 0; i < NUMFLAGS; i++)
00243 flags[i] = '-';
00244 flags[NUMFLAGS] = 0;
00245
00246 hdr_flags* hf = hdr_flags::access(p);
00247 flags[0] = hf->ecn_ ? 'C' : '-'; // Ecn Echo
00248 flags[1] = hf->pri_ ? 'P' : '-';
00249 flags[2] = '-';
00250 flags[3] = hf->cong_action_ ? 'A' : '-'; // Congestion Action
00251 flags[4] = hf->ecn_to_echo_ ? 'E' : '-'; // Congestion Experienced
00252 flags[5] = hf->fs_ ? 'F' : '-'; // Fast start: see tcp-fs and tcp-int
00253 flags[6] = hf->ecn_capable_ ? 'N' : '-';
00254
00255 #ifdef notdef
00256 flags[1] = (iph->flags() & PF_PRI) ? 'P' : '-';
00257 flags[2] = (iph->flags() & PF_USR1) ? '1' : '-';
00258 flags[3] = (iph->flags() & PF_USR2) ? '2' : '-';
00259 flags[5] = 0;
00260 #endif
00261 char *src_nodeaddr = Address::instance().print_nodeaddr(iph->saddr());
00262 char *src_portaddr = Address::instance().print_portaddr(iph->sport());
00263 char *dst_nodeaddr = Address::instance().print_nodeaddr(iph->daddr());
00264 char *dst_portaddr = Address::instance().print_portaddr(iph->dport());
00265
00266 if (pt_->tagged()) {
00267 sprintf(pt_->buffer(),
00268 "%c "TIME_FORMAT" -s %d -d %d -p %s -e %d -c %d -i %d -a %d -x {%s.%s %s.%s %d %s %s}",
00269 tt,
00270 Scheduler::instance().clock(),
00271 s,
00272 d,
00273 name,
00274 th->size(),
00275 iph->flowid(),
00276 th->uid(),
00277 iph->flowid(),
00278 src_nodeaddr,
00279 src_portaddr,
00280 dst_nodeaddr,
00281 dst_portaddr,
00282 seqno,flags,sname);
00283 } else if (!show_tcphdr_) {
00284 sprintf(pt_->buffer(), "%c "TIME_FORMAT" %d %d %s %d %s %d %s.%s %s.%s %d %d",
00285 tt,
00286 pt_->round(Scheduler::instance().clock()),
00287 s,
00288 d,
00289 name,
00290 th->size(),
00291 flags,
00292 iph->flowid() /* was p->class_ */,
00293 // iph->src() >> (Address::instance().NodeShift_[1]),
00294 // iph->src() & (Address::instance().PortMask_),
00295 // iph->dst() >> (Address::instance().NodeShift_[1]),
00296 // iph->dst() & (Address::instance().PortMask_),
00297 src_nodeaddr,
00298 src_portaddr,
00299 dst_nodeaddr,
00300 dst_portaddr,
00301 seqno,
00302 th->uid() /* was p->uid_ */);
00303 } else {
00304 sprintf(pt_->buffer(),
00305 "%c "TIME_FORMAT" %d %d %s %d %s %d %s.%s %s.%s %d %d %d 0x%x %d %d",
00306 tt,
00307 pt_->round(Scheduler::instance().clock()),
00308 s,
00309 d,
00310 name,
00311 th->size(),
00312 flags,
00313 iph->flowid(), /* was p->class_ */
00314 // iph->src() >> (Address::instance().NodeShift_[1]),
00315 // iph->src() & (Address::instance().PortMask_),
00316 // iph->dst() >> (Address::instance().NodeShift_[1]),
00317 // iph->dst() & (Address::instance().PortMask_),
00318 src_nodeaddr,
00319 src_portaddr,
00320 dst_nodeaddr,
00321 dst_portaddr,
00322 seqno,
00323 th->uid(), /* was p->uid_ */
00324 tcph->ackno(),
00325 tcph->flags(),
00326 tcph->hlen(),
00327 tcph->sa_length());
00328 }
00329 if (pt_->namchannel() != 0)
00330 sprintf(pt_->nbuffer(),
00331 "%c -t "TIME_FORMAT" -s %d -d %d -p %s -e %d -c %d -i %d -a %d -x {%s.%s %s.%s %d %s %s}",
00332 tt,
00333 Scheduler::instance().clock(),
00334 s,
00335 d,
00336 name,
00337 th->size(),
00338 iph->flowid(),
00339 th->uid(),
00340 iph->flowid(),
00341 src_nodeaddr,
00342 src_portaddr,
00343 dst_nodeaddr,
00344 dst_portaddr,
00345 seqno,flags,sname);
00346 delete [] src_nodeaddr;
00347 delete [] src_portaddr;
00348 delete [] dst_nodeaddr;
00349 delete [] dst_portaddr;
00350 }
|
Here is the call graph for this function:

|
|
Definition at line 186 of file trace.cc. References hdr_tfrc::access(), hdr_rap::access(), hdr_rtp::access(), hdr_tcp::access(), hdr_cmn::access(), packet_t, PT_ACK, PT_CBR, PT_EXP, PT_FTP, PT_HTTP, PT_PARETO, PT_RAP_ACK, PT_RAP_DATA, PT_RTP, PT_TCP, PT_TELNET, PT_TFRC, PT_UDP, hdr_cmn::ptype(), hdr_tfrc::seqno, hdr_tcp::seqno(), hdr_rap::seqno(), and hdr_rtp::seqno(). Referenced by Trace::format().
00187 {
00188 hdr_cmn *th = hdr_cmn::access(p);
00189 hdr_tcp *tcph = hdr_tcp::access(p);
00190 hdr_rtp *rh = hdr_rtp::access(p);
00191 hdr_rap *raph = hdr_rap::access(p);
00192 hdr_tfrc *tfrch = hdr_tfrc::access(p);
00193 packet_t t = th->ptype();
00194 int seqno;
00195
00196 /* UDP's now have seqno's too */
00197 if (t == PT_RTP || t == PT_CBR || t == PT_UDP || t == PT_EXP ||
00198 t == PT_PARETO)
00199 seqno = rh->seqno();
00200 else if (t == PT_RAP_DATA || t == PT_RAP_ACK)
00201 seqno = raph->seqno();
00202 else if (t == PT_TCP || t == PT_ACK || t == PT_HTTP || t == PT_FTP ||
00203 t == PT_TELNET)
00204 seqno = tcph->seqno();
00205 else if (t == PT_TFRC)
00206 seqno = tfrch->seqno;
00207 else
00208 seqno = -1;
00209 return seqno;
00210 }
|
Here is the call graph for this function:

|
|
Implements Handler. Reimplemented in LinkDelay, LL, AckRecons, and Snoop. Definition at line 91 of file object.cc. References NsObject::recv().
|
Here is the call graph for this function:

|
|
Definition at line 61 of file object.h. References NsObject::debug_.
00061 { return debug_; }
|
|
||||||||||||
|
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 TraceIp. Definition at line 97 of file trace-ip.cc. References hdr_ip::daddr(), BaseTrace::dump(), Trace::format(), Packet::free(), hdr_mac::ftype(), HDR_IP, HDR_MAC, TraceIp::mask_, MF_ACK, MF_CTS, Trace::pt_, hdr_ip::saddr(), Connector::send(), TraceIp::shift_, Trace::src_, Connector::target_, and Trace::type_.
00098 {
00099 // XXX: convert IP address to node number
00100 // hdr_ip *iph = hdr_ip::access(p);
00101
00102 hdr_ip *iph = HDR_IP(p);
00103
00104 int src = (src_ >= 0) ? src_ : (iph->saddr() >> shift_) & mask_;
00105 int dst = (iph->daddr() >> shift_) & mask_;
00106
00107 hdr_mac* mh = HDR_MAC(p);
00108
00109 if (mh->ftype() == MF_ACK || mh->ftype() == MF_CTS)
00110 format(type_, dst, src , p);
00111 else
00112 format(type_, src, dst , p);
00113 pt_->dump();
00114 target_ ? send(p, h) : Packet::free(p);
00115 }
|
Here is the call graph for this function:

|
|
Reimplemented from NsObject. Definition at line 365 of file trace.cc. References Trace::callback(), Trace::dst_, BaseTrace::dump(), Trace::format(), BaseTrace::namdump(), Trace::pt_, NsObject::recvOnly(), Trace::src_, Connector::target_, and Trace::type_.
|
Here is the call graph for this function:

|
|
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, and Queue< T >. Definition at line 70 of file object.cc. Referenced by NsObject::command().
00071 {
00072 }
|
|
||||||||||||
|
Reimplemented in Agent, and LinkDelay. Definition at line 54 of file connector.h. References NsObject::recv(), and Connector::target_. Referenced by SessionTTLChecker::recv(), TTLChecker::recv(), DequeTrace::recv(), Trace::recv(), recv(), TraceIp::recv(), SatDequeTrace::recv(), SALink::recv(), SnoopQueueEDrop::recv(), SnoopQueueTagger::recv(), SnoopQueueDrop::recv(), SnoopQueueOut::recv(), SnoopQueueIn::recv(), PktCounter::recv(), NetworkInterface::recv(), MeasureMod::recv(), Filter::recv(), Connector::recv(), CMUTrace::recv(), CBQClass::recv(), and AddSR::recv().
|
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(), QSAgent::recv(), and MIPMHAgent::reg().
00048 { return target_; }
|
|
|
Definition at line 374 of file trace.cc. References BaseTrace::buffer(), Trace::callback(), Scheduler::clock(), BaseTrace::dump(), Scheduler::instance(), Trace::pt_, BaseTrace::round(), BaseTrace::tagged(), TIME_FORMAT, and Trace::type_.
00375 {
00376 char tmp[256] = "";
00377 Scheduler& s = Scheduler::instance();
00378 if (&s == 0)
00379 return;
00380
00381 if (pt_->tagged()) {
00382 sprintf(pt_->buffer(), "%c "TIME_FORMAT" -a %s -n %s -v %s",
00383 type_,
00384 pt_->round(s.clock()),
00385 var->owner()->name(),
00386 var->name(),
00387 var->value(tmp, 256));
00388 } else {
00389 // format: use Mark's nam feature code without the '-' prefix
00390 sprintf(pt_->buffer(), "%c t"TIME_FORMAT" a%s n%s v%s",
00391 type_,
00392 pt_->round(s.clock()),
00393 var->owner()->name(),
00394 var->name(),
00395 var->value(tmp, 256));
00396 }
00397 pt_->dump();
00398 callback();
00399 }
|
Here is the call graph for this function:

|
|
Definition at line 154 of file trace.cc. References BaseTrace::namdump(), BaseTrace::nbuffer(), and Trace::pt_. Referenced by Trace::command().
|
Here is the call graph for this function:

|
|
Definition at line 59 of file trace.h. Referenced by Trace::callback(), and Trace::Trace(). |
|
|
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(), RedPDQueue::enque(), PushbackQueue::enque(), NsObject::isdebug(), NsObject::NsObject(), TfrcAgent::recv(), PushbackQueue::reportDrop(), and REDQueue::reset(). |
|
|
Definition at line 57 of file connector.h. Referenced by Connector::command(), Connector::drop(), and ErrorModel::recv(). |
|
|
Definition at line 58 of file trace.h. Referenced by DequeTrace::recv(), Trace::recv(), SatDequeTrace::recv(), Trace::recvOnly(), Trace::Trace(), and SatTrace::traceonly(). |
|
|
Definition at line 51 of file trace-ip.cc. Referenced by recv(), TraceIp::recv(), and TraceIp::TraceIp(). |
|
|
|
Definition at line 52 of file trace-ip.cc. Referenced by recv(), TraceIp::recv(), and TraceIp::TraceIp(). |
|
|
Definition at line 63 of file trace.h. Referenced by Trace::format(), SatTrace::format(), and Trace::Trace(). |
|
|
Definition at line 57 of file trace.h. Referenced by CMUTrace::format_mac(), CMUTrace::format_rtp(), CMUTrace::nam_format(), CMUTrace::node_energy(), DequeTrace::recv(), Trace::recv(), recv(), TraceIp::recv(), SatDequeTrace::recv(), CMUTrace::recv(), Trace::recvOnly(), Trace::Trace(), and SatTrace::traceonly(). |
|
|
|
Definition at line 71 of file trace.h. Referenced by CMUTrace::CMUTrace(), CMUTrace::format_mac(), CMUTrace::nam_format(), DequeTrace::recv(), Trace::recv(), recv(), TraceIp::recv(), SatDequeTrace::recv(), CMUTrace::recv(), Trace::recvOnly(), Trace::trace(), and SatTrace::traceonly(). |
1.3.3