Trace Class Reference

#include <trace.h>

Inheritance diagram for Trace:

Connector NsObject TclObject Handler CMUTrace DequeTrace SatTrace TraceIp SatDequeTrace TraceIpMac Collaboration diagram for Trace:

Collaboration graph
[legend]

Detailed Description

Definition at line 55 of file trace.h.

Public Member Functions

int command (int argc, const char *const *argv)
virtual void debug (const char *fmt,...)
virtual int delay_bind_dispatch (const char *varName, const char *localName, TclObject *tracer)
virtual void delay_bind_init_all ()
virtual void drop (Packet *p)
int isdebug () const
virtual void recv (Packet *p, const char *s)
void recv (Packet *p, Handler *)
void recvOnly (Packet *p)
void setDropTarget (NsObject *dt)
void target (NsObject *target)
NsObjecttarget ()
void trace (TracedVar *var)
 Trace (int type)
virtual void write_nam_trace (const char *s)
 ~Trace ()

Static Public Member Functions

static int get_seqno (Packet *p)

Data Fields

BaseTracept_
int type_

Protected Member Functions

void annotate (const char *s)
void callback ()
virtual void drop (Packet *p, const char *s)
virtual void format (int tt, int s, int d, Packet *p)
void handle (Event *)
virtual void reset ()
void send (Packet *p, Handler *h)

Protected Attributes

int callback_
int debug_
NsObjectdrop_
nsaddr_t dst_
int show_sctphdr_
int show_tcphdr_
nsaddr_t src_
NsObjecttarget_


Constructor & Destructor Documentation

Trace::Trace int  type  ) 
 

Definition at line 65 of file trace.cc.

References callback_, dst_, pt_, show_sctphdr_, show_tcphdr_, and src_.

00066     : Connector(), callback_(0), pt_(0), type_(type)
00067 {
00068     bind("src_", (int*)&src_);
00069     bind("dst_", (int*)&dst_);
00070     bind("callback_", &callback_);
00071     bind("show_tcphdr_", &show_tcphdr_);
00072     bind("show_sctphdr_", &show_sctphdr_);
00073     pt_ = new BaseTrace;
00074 }

Trace::~Trace  ) 
 

Definition at line 76 of file trace.cc.

00077 {
00078 }


Member Function Documentation

void Trace::annotate const char *  s  )  [protected]
 

Definition at line 162 of file trace.cc.

References BaseTrace::buffer(), Scheduler::clock(), Scheduler::instance(), pt_, BaseTrace::tagged(), and TIME_FORMAT.

Referenced by command().

00163 {
00164     if (pt_->tagged()) {
00165         sprintf(pt_->buffer(),
00166             "v "TIME_FORMAT" -e {sim_annotation %g %s}",
00167             Scheduler::instance().clock(), 
00168             Scheduler::instance().clock(), s);
00169     } else {
00170         sprintf(pt_->buffer(),
00171             "v "TIME_FORMAT" eval {set sim_annotation {%s}}", 
00172             pt_->round(Scheduler::instance().clock()), s);
00173     }
00174     pt_->dump();
00175     callback();
00176     sprintf(pt_->nbuffer(), "v -t "TIME_FORMAT" -e sim_annotation %g %s", 
00177         Scheduler::instance().clock(), 
00178         Scheduler::instance().clock(), s);
00179     pt_->namdump();
00180 }

Here is the call graph for this function:

void Trace::callback  )  [protected]
 

Definition at line 471 of file trace.cc.

References BaseTrace::buffer(), callback_, and pt_.

Referenced by DequeTrace::recv(), recv(), and recvOnly().

00472 {
00473     if (callback_) {
00474         Tcl& tcl = Tcl::instance();
00475         tcl.evalf("%s handle { %s }", name(), pt_->buffer());
00476     }
00477 }

Here is the call graph for this function:

int Trace::command int  argc,
const char *const *  argv
[virtual]
 

Reimplemented from Connector.

Reimplemented in CMUTrace.

Definition at line 85 of file trace.cc.

References annotate(), BaseTrace::channel(), BaseTrace::flush(), BaseTrace::namchannel(), pt_, and BaseTrace::tagged().

Referenced by CMUTrace::command().

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

Here is the call graph for this function:

void NsObject::debug const char *  fmt,
  ...
[virtual, inherited]
 

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 }

int NsObject::delay_bind_dispatch const char *  varName,
const char *  localName,
TclObject tracer
[virtual, inherited]
 

Reimplemented in BayFullTcpAgent, Agent, MPLSAddressClassifier, LDPAgent, HbAfterRtoSctpAgent, MfrHbAfterRtoSctpAgent, MfrTimestampSctpAgent, MultipleFastRtxSctpAgent, NewRenoSctpAgent, TimestampSctpAgent, SctpAgent, FullTcpAgent, SackFullTcpAgent, RFC793eduTcpAgent, TcpSink, TcpAgent, VegasTcpAgent, XcpAgent, and XcpSink.

Definition at line 63 of file object.cc.

References NsObject::debug_.

Referenced by MPLSAddressClassifier::delay_bind_dispatch(), and Agent::delay_bind_dispatch().

00064 {
00065     if (delay_bind_bool(varName, localName, "debug_", &debug_, tracer)) 
00066         return TCL_OK;
00067     return TclObject::delay_bind_dispatch(varName, localName, tracer);
00068 }

void NsObject::delay_bind_init_all  )  [virtual, inherited]
 

Reimplemented in BayFullTcpAgent, Agent, MPLSAddressClassifier, LDPAgent, HbAfterRtoSctpAgent, MfrHbAfterRtoSctpAgent, MfrTimestampSctpAgent, MultipleFastRtxSctpAgent, NewRenoSctpAgent, TimestampSctpAgent, SctpAgent, FullTcpAgent, SackFullTcpAgent, RFC793eduTcpAgent, TcpSink, TcpAgent, VegasTcpAgent, XcpAgent, and XcpSink.

Definition at line 57 of file object.cc.

Referenced by MPLSAddressClassifier::delay_bind_init_all(), and Agent::delay_bind_init_all().

00058 {
00059     delay_bind_init_one("debug_");
00060 }

void Connector::drop Packet p,
const char *  s
[protected, virtual, inherited]
 

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:

void Connector::drop Packet p  )  [virtual, inherited]
 

Reimplemented in XCPQueue.

Definition at line 106 of file connector.cc.

References Connector::drop_, Packet::free(), and NsObject::recv().

Referenced by ARPTable::arpresolve(), XCPQueue::drop(), JoBS::dropFront(), Vq::dropPacketForECN(), DSRAgent::dropSendBuff(), JoBS::dropTail(), dsREDQueue::edrop(), Vq::enque(), SRR::enque(), SimpleIntServ::enque(), SFQ::enque(), rtqueue::enque(), RIOQueue::enque(), REMQueue::enque(), REDQueue::enque(), RedPDQueue::enque(), PIQueue::enque(), Marker::enque(), GK::enque(), dsREDQueue::enque(), DRR::enque(), DropTail::enque(), Demarker::enque(), aodv_rqueue::enque(), toraAgent::forward(), AODV::forward(), DSDV_Agent::forwardPacket(), DSRAgent::getRouteForPacket(), HDLC::goBackNMode(), Snoop::handle(), DSRAgent::handleFlowForwarding(), DSRAgent::handleForwarding(), HDLC::handleRR(), DSDV_Agent::lost_link(), TCPTapAgent::processpkt(), CMUPriQueue::prq_enqueue(), rtqueue::purge(), SessionTTLChecker::recv(), TTLChecker::recv(), FullTcpAgent::recv(), BayFullTcpAgent::recv(), SatLL::recv(), LL::recv(), GAFPartner::recv(), Filter::recv(), DynamicLink::recv(), AODV::recvError(), PriQueue::recvHighPriority(), HDLC::recvIncoming(), toraAgent::reset(), HDLC::reset(), Queue< T >::reset(), LinkDelay::reset(), AODV::rt_ll_failed(), AODV::rt_purge(), toraAgent::rtRoutePacket(), HDLC::selectiveRepeatMode(), AODV::sendRequest(), SatLL::sendUp(), LL::sendUp(), DropTail::shrink_queue(), PriQueue::Terminate(), DSRAgent::Terminate(), CMUPriQueue::Terminate(), ARPTable::Terminate(), and DSRAgent::undeliverablePkt().

00107 {
00108     if (drop_ != 0)
00109         drop_->recv(p);
00110     else
00111         Packet::free(p);
00112 }

Here is the call graph for this function:

void Trace::format int  tt,
int  s,
int  d,
Packet p
[protected, virtual]
 

Reimplemented in SatTrace.

Definition at line 219 of file trace.cc.

References hdr_srm::access(), hdr_sctp::access(), hdr_tcp::access(), hdr_ip::access(), hdr_cmn::access(), p_info::name(), packet_info, hdr_cmn::ptype(), and sh.

Referenced by DequeTrace::recv(), recv(), TraceIpMac::recv(), TraceIp::recv(), and recvOnly().

00220 {
00221     hdr_cmn *th = hdr_cmn::access(p);
00222     hdr_ip *iph = hdr_ip::access(p);
00223     hdr_tcp *tcph = hdr_tcp::access(p);
00224     hdr_sctp *sctph = hdr_sctp::access(p);
00225     hdr_srm *sh = hdr_srm::access(p); 
00226 
00227     const char* sname = "null";
00228 
00229     packet_t t = th->ptype();
00230     const char* name = packet_info.name(t);
00231 
00232         /* SRM-specific */
00233     if (strcmp(name,"SRM") == 0 || strcmp(name,"cbr") == 0 || strcmp(name,"udp") == 0) {
00234             if ( sh->type() < 5 && sh->type() > 0 ) {
00235             sname = srm_names[sh->type()];
00236         }
00237     }
00238 
00239     if (name == 0)
00240         abort();
00241 
00242     int seqno = get_seqno(p);
00243         /* 
00244          * When new flags are added, make sure to change NUMFLAGS
00245          * in trace.h
00246          */
00247         char flags[NUMFLAGS+1];
00248         for (int i = 0; i < NUMFLAGS; i++)
00249         flags[i] = '-';
00250         flags[NUMFLAGS] = 0;
00251 
00252     hdr_flags* hf = hdr_flags::access(p);
00253     flags[0] = hf->ecn_ ? 'C' : '-';          // Ecn Echo
00254     flags[1] = hf->pri_ ? 'P' : '-'; 
00255     flags[2] = '-';
00256     flags[3] = hf->cong_action_ ? 'A' : '-';   // Congestion Action
00257     flags[4] = hf->ecn_to_echo_ ? 'E' : '-';   // Congestion Experienced
00258     flags[5] = hf->fs_ ? 'F' : '-';        // Fast start: see tcp-fs and tcp-int
00259     flags[6] = hf->ecn_capable_ ? 'N' : '-';
00260     flags[7] = 0; // only for SCTP  
00261 
00262 #ifdef notdef
00263     flags[1] = (iph->flags() & PF_PRI) ? 'P' : '-';
00264     flags[2] = (iph->flags() & PF_USR1) ? '1' : '-';
00265     flags[3] = (iph->flags() & PF_USR2) ? '2' : '-';
00266     flags[5] = 0;
00267 #endif
00268     char *src_nodeaddr = Address::instance().print_nodeaddr(iph->saddr());
00269     char *src_portaddr = Address::instance().print_portaddr(iph->sport());
00270     char *dst_nodeaddr = Address::instance().print_nodeaddr(iph->daddr());
00271     char *dst_portaddr = Address::instance().print_portaddr(iph->dport());
00272 
00273     if (pt_->tagged()) {
00274         sprintf(pt_->buffer(), 
00275             "%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}",
00276             tt,
00277             Scheduler::instance().clock(),
00278             s,
00279             d,
00280             name,
00281             th->size(),
00282             iph->flowid(),
00283             th->uid(),
00284             iph->flowid(),
00285             src_nodeaddr,
00286             src_portaddr,
00287             dst_nodeaddr,
00288             dst_portaddr,
00289             seqno,flags,sname);
00290     } else if (show_sctphdr_ && t == PT_SCTP) {
00291         double timestamp;
00292         timestamp = Scheduler::instance().clock();
00293         
00294         for(unsigned int i = 0; i < sctph->NumChunks(); i++) {
00295             switch(sctph->SctpTrace()[i].eType) {
00296             case SCTP_CHUNK_INIT:
00297             case SCTP_CHUNK_INIT_ACK:
00298             case SCTP_CHUNK_COOKIE_ECHO:
00299             case SCTP_CHUNK_COOKIE_ACK:
00300                 flags[7] = 'I';     // connection initialization
00301                 break;
00302                 
00303             case SCTP_CHUNK_DATA:
00304                 flags[7] = 'D';
00305                 break;
00306 
00307             case SCTP_CHUNK_SACK:
00308                 flags[7] = 'S';
00309                 break;
00310                 
00311             case SCTP_CHUNK_FORWARD_TSN:
00312                 flags[7] = 'R';
00313                 break;
00314                 
00315             case SCTP_CHUNK_HB:
00316                 flags[7] = 'H';
00317                 break;
00318 
00319             case SCTP_CHUNK_HB_ACK:
00320                 flags[7] = 'B';
00321                 break;
00322             default:
00323                 assert (false);
00324             }
00325             sprintf(pt_->buffer(),
00326                 "%c "TIME_FORMAT" %d %d %s %d %s %d %s.%s %s.%s %d %d %d %d %d",
00327                 tt,
00328                 pt_->round(timestamp),
00329                 s,
00330                 d,
00331                 name,
00332                 th->size(),
00333                 flags,
00334                 iph->flowid(), /* was p->class_ */
00335                 src_nodeaddr,
00336                 src_portaddr,
00337                 dst_nodeaddr,
00338                 dst_portaddr,
00339                 sctph->NumChunks(),
00340                 sctph->SctpTrace()[i].uiTsn,
00341                 th->uid(), /* was p->uid_ */
00342                 sctph->SctpTrace()[i].usStreamId,
00343                 sctph->SctpTrace()[i].usStreamSeqNum);       
00344 
00345             /* The caller already calls pt_->dump() for us,
00346              * but since SCTP needs to dump once per chunk, we
00347              * call dump ourselves for all but the last chunk.
00348              */
00349             assert (sctph->NumChunks() >= 1);
00350             if(i < sctph->NumChunks() - 1)
00351                 pt_->dump();
00352         }
00353     } else if (!show_tcphdr_) {
00354         sprintf(pt_->buffer(), "%c "TIME_FORMAT" %d %d %s %d %s %d %s.%s %s.%s %d %d",
00355             tt,
00356             pt_->round(Scheduler::instance().clock()),
00357             s,
00358             d,
00359             name,
00360             th->size(),
00361             flags,
00362             iph->flowid() /* was p->class_ */,
00363             // iph->src() >> (Address::instance().NodeShift_[1]), 
00364                         // iph->src() & (Address::instance().PortMask_), 
00365                         // iph->dst() >> (Address::instance().NodeShift_[1]), 
00366                         // iph->dst() & (Address::instance().PortMask_),
00367             src_nodeaddr,
00368             src_portaddr,
00369             dst_nodeaddr,
00370             dst_portaddr,
00371             seqno,
00372             th->uid() /* was p->uid_ */);
00373     } else {
00374         sprintf(pt_->buffer(), 
00375             "%c "TIME_FORMAT" %d %d %s %d %s %d %s.%s %s.%s %d %d %d 0x%x %d %d",
00376             tt,
00377             pt_->round(Scheduler::instance().clock()),
00378             s,
00379             d,
00380             name,
00381             th->size(),
00382             flags,
00383             iph->flowid(), /* was p->class_ */
00384                 // iph->src() >> (Address::instance().NodeShift_[1]), 
00385             // iph->src() & (Address::instance().PortMask_), 
00386                 // iph->dst() >> (Address::instance().NodeShift_[1]), 
00387                 // iph->dst() & (Address::instance().PortMask_),
00388             src_nodeaddr,
00389             src_portaddr,
00390             dst_nodeaddr,
00391             dst_portaddr,
00392             seqno,
00393             th->uid(), /* was p->uid_ */
00394             tcph->ackno(),
00395             tcph->flags(),
00396             tcph->hlen(),
00397             tcph->sa_length());
00398     }
00399     if (pt_->namchannel() != 0)
00400         sprintf(pt_->nbuffer(), 
00401             "%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}",
00402             tt,
00403             Scheduler::instance().clock(),
00404             s,
00405             d,
00406             name,
00407             th->size(),
00408             iph->flowid(),
00409             th->uid(),
00410             iph->flowid(),
00411             src_nodeaddr,
00412             src_portaddr,
00413             dst_nodeaddr,
00414             dst_portaddr,
00415             seqno,flags,sname);
00416     delete [] src_nodeaddr;
00417     delete [] src_portaddr;
00418     delete [] dst_nodeaddr;
00419     delete [] dst_portaddr;
00420 }

Here is the call graph for this function:

int Trace::get_seqno Packet p  )  [static]
 

Definition at line 188 of file trace.cc.

References hdr_tfrc_ack::access(), hdr_tfrc::access(), hdr_rap::access(), hdr_rtp::access(), hdr_tcp::access(), hdr_cmn::access(), 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_TFRC_ACK, PT_UDP, PT_XCP, hdr_cmn::ptype(), hdr_tfrc_ack::seqno, hdr_tfrc::seqno, hdr_tcp::seqno(), hdr_rap::seqno(), and hdr_rtp::seqno().

00189 {
00190     hdr_cmn *th = hdr_cmn::access(p);
00191     hdr_tcp *tcph = hdr_tcp::access(p);
00192     hdr_rtp *rh = hdr_rtp::access(p);
00193         hdr_rap *raph = hdr_rap::access(p);
00194     hdr_tfrc *tfrch = hdr_tfrc::access(p);
00195     hdr_tfrc_ack *tfrch_ack = hdr_tfrc_ack::access(p);
00196     packet_t t = th->ptype();
00197     int seqno;
00198 
00199     /* UDP's now have seqno's too */
00200     if (t == PT_RTP || t == PT_CBR || t == PT_UDP || t == PT_EXP ||
00201         t == PT_PARETO)
00202         seqno = rh->seqno();
00203         else if (t == PT_RAP_DATA || t == PT_RAP_ACK)
00204                 seqno = raph->seqno();
00205     else if (t == PT_TCP || t == PT_ACK || t == PT_HTTP || t == PT_FTP ||
00206         t == PT_TELNET || t == PT_XCP)
00207         seqno = tcph->seqno();
00208     else if (t == PT_TFRC)
00209         seqno = tfrch->seqno;
00210     else if (t == PT_TFRC_ACK)
00211                 seqno = tfrch_ack->seqno;
00212     else
00213         seqno = -1;
00214     return seqno;
00215 }

Here is the call graph for this function:

void NsObject::handle Event  )  [protected, virtual, inherited]
 

Implements Handler.

Reimplemented in LinkDelay, LL, AckRecons, and Snoop.

Definition at line 91 of file object.cc.

References NsObject::recv().

00092 {
00093     recv((Packet*)e);
00094 }

Here is the call graph for this function:

int NsObject::isdebug  )  const [inline, inherited]
 

Definition at line 61 of file object.h.

References NsObject::debug_.

00061 { return debug_; }

void NsObject::recv Packet p,
const char *  s
[virtual, inherited]
 

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:

void Trace::recv Packet p,
Handler
[virtual]
 

Reimplemented from Connector.

Reimplemented in SatDequeTrace, CMUTrace, TraceIp, TraceIpMac, and DequeTrace.

Definition at line 422 of file trace.cc.

References callback(), dst_, BaseTrace::dump(), format(), Packet::free(), BaseTrace::namdump(), pt_, Connector::send(), src_, Connector::target_, and type_.

00423 {
00424     format(type_, src_, dst_, p);
00425     pt_->dump();
00426     callback();
00427     pt_->namdump();
00428     /* hack: if trace object not attached to anything free packet */
00429     if (target_ == 0)
00430         Packet::free(p);
00431     else
00432         send(p, h);
00433 }

Here is the call graph for this function:

void Trace::recvOnly Packet p  )  [virtual]
 

Reimplemented from NsObject.

Definition at line 435 of file trace.cc.

References callback(), dst_, BaseTrace::dump(), format(), BaseTrace::namdump(), pt_, NsObject::recvOnly(), src_, Connector::target_, and type_.

00436 {
00437     format(type_, src_, dst_, p);
00438     pt_->dump();
00439     callback();
00440     pt_->namdump(); 
00441     target_->recvOnly(p);
00442 }

Here is the call graph for this function:

void NsObject::reset  )  [protected, virtual, inherited]
 

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().

00071 {
00072 }

void Connector::send Packet p,
Handler h
[inline, protected, inherited]
 

Reimplemented in Agent, and LinkDelay.

Definition at line 56 of file connector.h.

References NsObject::recv(), and Connector::target_.

Referenced by SessionTTLChecker::recv(), TTLChecker::recv(), recv(), TraceIpMac::recv(), TraceIp::recv(), SnoopQueueEDrop::recv(), SnoopQueueTagger::recv(), SnoopQueueDrop::recv(), SnoopQueueOut::recv(), SnoopQueueIn::recv(), PktCounter::recv(), NetworkInterface::recv(), MeasureMod::recv(), Filter::recv(), Connector::recv(), CMUTrace::recv(), and AddSR::recv().

00056 { target_->recv(p, h); }

Here is the call graph for this function:

void Connector::setDropTarget NsObject dt  )  [inline, inherited]
 

Definition at line 51 of file connector.h.

References Connector::drop_.

Referenced by XCPWrapQ::command().

00051 {drop_ = dt; } 

void Connector::target NsObject target  )  [inline, inherited]
 

Definition at line 49 of file connector.h.

References Connector::target(), and Connector::target_.

00049 { target_ = target; }

Here is the call graph for this function:

NsObject* Connector::target  )  [inline, inherited]
 

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_; }

void Trace::trace TracedVar *  var  ) 
 

Definition at line 444 of file trace.cc.

References BaseTrace::buffer(), Scheduler::clock(), Scheduler::instance(), pt_, BaseTrace::round(), BaseTrace::tagged(), TIME_FORMAT, and type_.

00445 {
00446     char tmp[256] = "";
00447     Scheduler& s = Scheduler::instance();
00448     if (&s == 0)
00449         return;
00450 
00451     if (pt_->tagged()) {
00452         sprintf(pt_->buffer(), "%c "TIME_FORMAT" -a %s -n %s -v %s",
00453             type_,
00454             pt_->round(s.clock()),
00455             var->owner()->name(),
00456             var->name(),
00457             var->value(tmp, 256));
00458     } else {
00459         // format: use Mark's nam feature code without the '-' prefix
00460         sprintf(pt_->buffer(), "%c t"TIME_FORMAT" a%s n%s v%s",
00461             type_,
00462             pt_->round(s.clock()),
00463             var->owner()->name(),
00464             var->name(),
00465             var->value(tmp, 256));
00466     }
00467     pt_->dump();
00468     callback();
00469 }

Here is the call graph for this function:

void Trace::write_nam_trace const char *  s  )  [virtual]
 

Definition at line 156 of file trace.cc.

References BaseTrace::namdump(), BaseTrace::nbuffer(), and pt_.

00157 {
00158     sprintf(pt_->nbuffer(), "%s", s);
00159     pt_->namdump();
00160 }

Here is the call graph for this function:


Field Documentation

int Trace::callback_ [protected]
 

Definition at line 59 of file trace.h.

Referenced by callback(), and Trace().

int NsObject::debug_ [protected, inherited]
 

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().

NsObject* Connector::drop_ [protected, inherited]
 

Definition at line 59 of file connector.h.

Referenced by XCPWrapQ::command(), Connector::command(), Connector::drop(), ErrorModel::recv(), and Connector::setDropTarget().

nsaddr_t Trace::dst_ [protected]
 

Definition at line 58 of file trace.h.

Referenced by DequeTrace::recv(), recv(), SatDequeTrace::recv(), recvOnly(), Trace(), and SatTrace::traceonly().

BaseTrace* Trace::pt_
 

Definition at line 70 of file trace.h.

Referenced by annotate(), callback(), command(), CMUTrace::format(), CMUTrace::format_aodv(), CMUTrace::format_arp(), CMUTrace::format_dsr(), SatTrace::format_hdlc(), CMUTrace::format_imep(), CMUTrace::format_ip(), CMUTrace::format_mac(), CMUTrace::format_smac(), CMUTrace::format_tcp(), CMUTrace::format_tora(), SRForwarder::handlePktWithoutSR(), MobileNode::log_energy(), AODV::log_link_broke(), AODV::log_link_del(), AODV::log_link_kept(), toraAgent::log_link_layer_feedback(), toraAgent::log_link_layer_recycle(), toraAgent::log_lnk_del(), toraAgent::log_lnk_kept(), MobileNode::log_movement(), toraAgent::log_nb_del(), imepAgent::log_neighbor_list(), toraAgent::log_recv_clr(), toraAgent::log_recv_qry(), toraAgent::log_recv_upd(), toraAgent::log_route_loop(), toraAgent::log_route_table(), toraAgent::logNbDeletedLastDN(), toraAgent::logNextHopChange(), toraAgent::logToraDest(), toraAgent::logToraNeighbor(), DequeTrace::recv(), recv(), TraceIpMac::recv(), TraceIp::recv(), SatDequeTrace::recv(), CMUTrace::recv(), recvOnly(), toraAgent::recvUPD(), trace(), Trace(), toraAgent::trace(), RouteCache::trace(), OmniMcastAgent::trace(), imepAgent::trace(), FloodingAgent::trace(), DumbAgent::trace(), DSRAgent::trace(), CMUPriQueue::trace(), DSDV_Agent::trace(), DiffusionAgent::trace(), SatTrace::traceonly(), and write_nam_trace().

int Trace::show_sctphdr_ [protected]
 

Definition at line 64 of file trace.h.

Referenced by Trace().

int Trace::show_tcphdr_ [protected]
 

Definition at line 63 of file trace.h.

Referenced by Trace().

nsaddr_t Trace::src_ [protected]
 

Definition at line 57 of file trace.h.

Referenced by CMUTrace::format_mac_common(), CMUTrace::format_rtp(), CMUTrace::nam_format(), CMUTrace::node_energy(), DequeTrace::recv(), recv(), TraceIpMac::recv(), TraceIp::recv(), SatDequeTrace::recv(), CMUTrace::recv(), recvOnly(), Trace(), and SatTrace::traceonly().

NsObject* Connector::target_ [protected, inherited]
 

Definition at line 58 of file connector.h.

Referenced by SRAgent::command(), SA_Agent::command(), IvsReceiver::command(), MultiFieldFilter::command(), Filter::command(), Connector::command(), DiffusionAgent::DiffusionAgent(), DSRAgent::DSRAgent(), PromotionTimer::expire(), FloodingAgent::FloodingAgent(), SctpAgent::ForceSource(), toraAgent::forward(), AODV::forward(), DSDV_Agent::forwardPacket(), SensorQueryAgent::generate_query(), DSDVTriggerHandler::handle(), AckRecons::handle(), DSDV_Agent::helper_callback(), DSDV_Agent::lost_link(), OmniMcastAgent::OmniMcastAgent(), LandmarkAgent::periodic_callback(), TCPTapAgent::processpkt(), IPTapAgent::processpkt(), CMUPriQueue::prq_enqueue(), CMUPriQueue::prq_resume(), recv(), TraceIpMac::recv(), TraceIp::recv(), SRMAgent::recv(), SSMSRMAgent::recv(), SAack_Agent::recv(), Queue< T >::recv(), PingResponder::recv(), MIPEncapsulator::recv(), LmsAgent::recv(), HackLossyLink::recv(), FQ::recv(), ErrorModel::recv(), DynamicLink::recv(), DSRAgent::recv(), DelayModel::recv(), LinkDelay::recv(), CtrMcastDecap::recv(), CtrMcastEncap::recv(), CMUTrace::recv(), recvOnly(), Queue< T >::resume(), LinkDelay::send(), Connector::send(), Agent::send(), MIPBSAgent::send_ads(), SRMAgent::send_ctrl(), SSMSRMAgent::send_ctrl(), LmsSender::send_dmcast(), LmsReceiver::send_dmcast(), LmsAgent::send_downstream(), LmsSender::send_lms_pkt(), LmsReceiver::send_nak(), LmsReceiver::send_refresh(), MIPMHAgent::send_sols(), LmsSender::send_spm(), LmsAgent::send_upstream(), LandmarkAgent::SendChangedTagListUpdate(), AODV::sendError(), AODV::sendHello(), UdpAgent::sendmsg(), SRMAgent::sendmsg(), SA_Agent::sendmsg(), RTPAgent::sendmsg(), MessagePassingAgent::sendmsg(), LmsSender::sendmsg(), DSDV_Agent::sendOutBCastPkt(), SA_Agent::sendpkt(), rtProtoDV::sendpkt(), RTPAgent::sendpkt(), RTCPAgent::sendpkt(), IvsSource::sendpkt(), AODV::sendReply(), AODV::sendRequest(), TPAgent::sendto(), MessagePassingAgent::sendto(), SctpAgent::SetSource(), LmsSender::solicit_naks(), Connector::target(), toraAgent::tora_output(), and Delayer::try_send().

int Trace::type_
 

Definition at line 72 of file trace.h.

Referenced by CMUTrace::CMUTrace(), CMUTrace::format_mac_common(), CMUTrace::nam_format(), recv(), TraceIpMac::recv(), TraceIp::recv(), SatDequeTrace::recv(), CMUTrace::recv(), recvOnly(), trace(), and SatTrace::traceonly().


The documentation for this class was generated from the following files:
Generated on Tue Mar 6 17:34:50 2007 for ns2 Network Simulator 2.29 by  doxygen 1.4.6