Main Page | Namespace List | Class Hierarchy | Alphabetical List | Compound List | File List | Compound Members | File Members

AddSR Class Reference

Inheritance diagram for AddSR:

Inheritance graph
[legend]
Collaboration diagram for AddSR:

Collaboration graph
[legend]
List of all members.

Public Member Functions

void recv (Packet *, Handler *callback=0)
 AddSR ()
NsObjecttarget ()
virtual void drop (Packet *p)
virtual void recv (Packet *p, const char *s)
virtual void recvOnly (Packet *)
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,...)

Protected Member Functions

virtual void drop (Packet *p, const char *s)
int command (int argc, const char *const *argv)
void send (Packet *p, Handler *h)
virtual void reset ()
void handle (Event *)

Protected Attributes

NsObjecttarget_
NsObjectdrop_
int debug_

Private Attributes

int off_ip_
int off_sr_
int off_ll_
int off_mac_

Constructor & Destructor Documentation

AddSR::AddSR  ) 
 

Definition at line 58 of file add_sr.cc.

References off_ip_, off_ll_, off_mac_, and off_sr_.

00059 {
00060   bind("off_sr_", &off_sr_);
00061   bind("off_ll_", &off_ll_);
00062   bind("off_mac_", &off_mac_);
00063   bind("off_ip_", &off_ip_);
00064 }


Member Function Documentation

int Connector::command int  argc,
const char *const *  argv
[protected, virtual, inherited]
 

Reimplemented from NsObject.

Reimplemented in SA_Agent, SALink, AODV, aodv_rqueue, MFTPRcvAgent, MFTPSndAgent, PingAgent, RTPAgent, UdpAgent, FtpClientAgent, FtpSrvrAgent, BayFullTcpAgent, Filter, MultiFieldFilter, Agent, Encapsulator, IvsReceiver, MessageAgent, NetworkInterface, LinkHead, PktCounter, SessionHelper, TTLChecker, SessionTTLChecker, coreQueue, edgeQueue, dsREDQueue, DiffusionRate, SinkAgent, DiffusionAgent, FloodingAgent, OmniMcastAgent, DSDV_Agent, DSRProto, DSRAgent, IcmpAgent, NatAgent, TCPDestNat, TCPSrcNat, TCPSrcDestNat, TapAgent, TCPTapAgent, GAFAgent, GAFPartner, imepAgent, LinkDelay, DynamicLink, HackLossyLink, rtProtoLS, ARPTable, LL, CtrMcastEncap, CtrMcastDecap, LmsAgent, LmsReceiver, LmsSender, mcastControlAgent, RLM_Sender, RLM_Receiver, SSMSRMAgent, SRMAgent, DumbAgent, MIPBSAgent, MIPMHAgent, LDPAgent, PingAgent, PushbackQueue, PushbackAgent, QSAgent, CBQClass, CBQueue, WRR_CBQueue, DelayModel, Demarker, DropTail, DRR, CMUPriQueue, SRMErrorModel, ErrorModel, TwoStateErrorModel, MultiStateErrorModel, ListErrorModel, SelectErrorModel, MrouteErrorModel, ErrorModule, LMSErrorModel, FQ, GK, JoBS, Marker, PIQueue, PriQueue, RedPDQueue, REDQueue, REMQueue, rtqueue, SFQ, SRR, Vq, RapAgent, rtProtoDV, SatLL, SatLinkHead, SatRouteAgent, FloodAgent, LandmarkAgent, SensorQueryAgent, SRAgent, AckRecons, RTCPAgent, SAack_Agent, AbsTcpAgent, FullTcpAgent, IntTcpAgent, TcpSessionAgent, TcpSink, TcpAgent, TfrcSinkAgent, TfrcAgent, LossMonitor, SnoopQueue, toraAgent, CMUTrace, Trace, and SimpleTcpAgent.

Definition at line 56 of file connector.cc.

References NsObject::command(), Connector::drop_, and Connector::target_.

Referenced by Vq::command(), SessionTTLChecker::command(), TTLChecker::command(), Trace::command(), SRR::command(), SFQ::command(), SessionHelper::command(), SALink::command(), rtqueue::command(), REMQueue::command(), REDQueue::command(), SnoopQueue::command(), PktCounter::command(), PIQueue::command(), LinkHead::command(), NetworkInterface::command(), Marker::command(), JoBS::command(), HackLossyLink::command(), GK::command(), GAFPartner::command(), FQ::command(), MultiFieldFilter::command(), Filter::command(), ErrorModule::command(), ErrorModel::command(), DynamicLink::command(), dsREDQueue::command(), CMUPriQueue::command(), DRR::command(), DropTail::command(), Demarker::command(), DelayModel::command(), LinkDelay::command(), CBQClass::command(), CBQueue::command(), aodv_rqueue::command(), and Agent::command().

00057 {
00058         Tcl& tcl = Tcl::instance();
00059         /*XXX*/
00060         if (argc == 2) {
00061                 if (strcmp(argv[1], "target") == 0) {
00062                         if (target_ != 0)
00063                                 tcl.result(target_->name());
00064                         return (TCL_OK);
00065                 }
00066                 if (strcmp(argv[1], "drop-target") == 0) {
00067                         if (drop_ != 0)
00068                                 tcl.resultf("%s", drop_->name());
00069                         return (TCL_OK);
00070                 }
00071                 if (strcmp(argv[1], "isDynamic") == 0) {
00072                         return TCL_OK;
00073                 }
00074         }
00075 
00076         else if (argc == 3) {
00077                 if (strcmp(argv[1], "target") == 0) {
00078                         if (*argv[2] == '0') {
00079                                 target_ = 0;
00080                                 return (TCL_OK);
00081                         }
00082                         target_ = (NsObject*)TclObject::lookup(argv[2]);
00083                         if (target_ == 0) {
00084                                 tcl.resultf("no such object %s", argv[2]);
00085                                 return (TCL_ERROR);
00086                         }
00087                         return (TCL_OK);
00088                 }
00089                 if (strcmp(argv[1], "drop-target") == 0) {
00090                         drop_ = (NsObject*)TclObject::lookup(argv[2]);
00091                         if (drop_ == 0) {
00092                                 tcl.resultf("no object %s", argv[2]);
00093                                 return (TCL_ERROR);
00094                         }
00095                         return (TCL_OK);
00096                 }
00097         }
00098         return (NsObject::command(argc, argv));
00099 }

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, 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 }

void NsObject::delay_bind_init_all  )  [virtual, inherited]
 

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 }

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]
 

Definition at line 106 of file connector.cc.

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

Referenced by DSRAgent::acceptRouteReply(), ARPTable::arpresolve(), 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(), LandmarkAgent::ForwardPacket(), DSDV_Agent::forwardPacket(), DSRAgent::getRouteForPacket(), Snoop::handle(), DSRAgent::handleFlowForwarding(), DSRAgent::handleForwarding(), DSDV_Agent::lost_link(), TCPTapAgent::processpkt(), CMUPriQueue::prq_enqueue(), rtqueue::purge(), imepAgent::purgeReXmitQ(), SessionTTLChecker::recv(), TTLChecker::recv(), toraAgent::recv(), FullTcpAgent::recv(), BayFullTcpAgent::recv(), TBF::recv(), SatLL::recv(), LL::recv(), GAFPartner::recv(), FloodAgent::recv(), Filter::recv(), DynamicLink::recv(), DSDV_Agent::recv(), AODV::recv(), AODV::recvError(), PriQueue::recvHighPriority(), AODV::recvReply(), toraAgent::reset(), Queue< T >::reset(), LinkDelay::reset(), AODV::rt_ll_failed(), AODV::rt_purge(), AODV::rt_resolve(), toraAgent::rtRoutePacket(), TCPTapAgent::sendpkt(), TapAgent::sendpkt(), IPTapAgent::sendpkt(), AODV::sendRequest(), SatLL::sendUp(), LL::sendUp(), 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 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 AddSR::recv Packet ,
Handler callback = 0
[virtual]
 

Reimplemented from Connector.

Definition at line 67 of file add_sr.cc.

References hdr_sr::access(), hdr_sr::append_addr(), hdr_sr::cur_addr(), hdr_sr::dump(), NS_AF_INET, hdr_sr::num_addrs(), hdr_sr::route_request(), Connector::send(), and hdr_sr::valid().

00068 {
00069   hdr_sr *srh =  hdr_sr::access(p);
00070 
00071   srh->route_request() = 0;
00072   srh->num_addrs() = 0;
00073   srh->cur_addr() = 0;
00074   srh->valid() = 1;
00075   srh->append_addr( 1<<8, NS_AF_INET );
00076   srh->append_addr( 2<<8, NS_AF_INET );
00077   srh->append_addr( 3<<8, NS_AF_INET );
00078   printf(" added sr %s\n",srh->dump());
00079   send(p,0);
00080 }

Here is the call graph for this function:

virtual void NsObject::recvOnly Packet  )  [inline, virtual, inherited]
 

Reimplemented in Agent, and Trace.

Definition at line 56 of file object.h.

Referenced by Trace::recvOnly().

00056 {};

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, and Queue< T >.

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 54 of file connector.h.

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

Referenced by SessionTTLChecker::recv(), TTLChecker::recv(), DequeTrace::recv(), Trace::recv(), TraceIpMac::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 recv().

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

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(), QSAgent::recv(), and MIPMHAgent::reg().

00048 { return target_; }


Member Data Documentation

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(), RedPDQueue::enque(), PushbackQueue::enque(), NsObject::isdebug(), NsObject::NsObject(), TfrcAgent::recv(), PushbackQueue::reportDrop(), and REDQueue::reset().

NsObject* Connector::drop_ [protected, inherited]
 

Definition at line 57 of file connector.h.

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

int AddSR::off_ip_ [private]
 

Definition at line 44 of file add_sr.cc.

Referenced by AddSR().

int AddSR::off_ll_ [private]
 

Definition at line 46 of file add_sr.cc.

Referenced by AddSR().

int AddSR::off_mac_ [private]
 

Definition at line 47 of file add_sr.cc.

Referenced by AddSR().

int AddSR::off_sr_ [private]
 

Definition at line 45 of file add_sr.cc.

Referenced by AddSR().

NsObject* Connector::target_ [protected, inherited]
 

Definition at line 56 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(), toraAgent::forward(), AODV::forward(), LandmarkAgent::ForwardPacket(), DSDV_Agent::forwardPacket(), SensorQueryAgent::generate_query(), DSDVTriggerHandler::handle(), AckRecons::handle(), DSRAgent::handlePacketReceipt(), DSDV_Agent::helper_callback(), AODV::initialized(), DSDV_Agent::lost_link(), OmniMcastAgent::OmniMcastAgent(), LandmarkAgent::periodic_callback(), LandmarkAgent::ProcessHierUpdate(), TCPTapAgent::processpkt(), IPTapAgent::processpkt(), CMUPriQueue::prq_enqueue(), CMUPriQueue::prq_resume(), DequeTrace::recv(), Trace::recv(), TraceIpMac::recv(), TraceIp::recv(), TBF::recv(), SRMAgent::recv(), SSMSRMAgent::recv(), SatDequeTrace::recv(), SAack_Agent::recv(), Queue< T >::recv(), PingResponder::recv(), MIPEncapsulator::recv(), LmsAgent::recv(), HackLossyLink::recv(), GAFPartner::recv(), FQ::recv(), FloodAgent::recv(), ErrorModel::recv(), DynamicLink::recv(), DumbAgent::recv(), DSRAgent::recv(), DelayModel::recv(), LinkDelay::recv(), CtrMcastDecap::recv(), CtrMcastEncap::recv(), CMUTrace::recv(), PriQueue::recvHighPriority(), Trace::recvOnly(), TapAgent::recvpkt(), Queue< T >::resume(), LinkDelay::send(), Connector::send(), Agent::send(), MIPBSAgent::send_ads(), SRMAgent::send_ctrl(), SSMSRMAgent::send_ctrl(), MFTPSndAgent::send_data(), LmsSender::send_dmcast(), LmsReceiver::send_dmcast(), LmsAgent::send_downstream(), SSMSRMAgent::send_glb_sess(), LmsSender::send_lms_pkt(), SSMSRMAgent::send_loc_sess(), MFTPRcvAgent::send_nak(), LmsReceiver::send_nak(), LmsReceiver::send_refresh(), SSMSRMAgent::send_rep_sess(), SRMAgent::send_sess(), MIPMHAgent::send_sols(), LmsSender::send_spm(), MFTPSndAgent::send_status_request(), LmsAgent::send_upstream(), LandmarkAgent::SendChangedTagListUpdate(), AODV::sendError(), AODV::sendHello(), UdpAgent::sendmsg(), SRMAgent::sendmsg(), SA_Agent::sendmsg(), RTPAgent::sendmsg(), LmsSender::sendmsg(), DSDV_Agent::sendOutBCastPkt(), SA_Agent::sendpkt(), rtProtoDV::sendpkt(), RTPAgent::sendpkt(), RTCPAgent::sendpkt(), IvsSource::sendpkt(), AODV::sendReply(), AODV::sendRequest(), LmsSender::solicit_naks(), Connector::target(), TBF::timeout(), and toraAgent::tora_output().


The documentation for this class was generated from the following file:
Generated on Tue Apr 20 12:32:14 2004 for NS2.26SourcesOriginal by doxygen 1.3.3