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

DSDV_Agent Class Reference

#include <dsdv.h>

Inheritance diagram for DSDV_Agent:

Inheritance graph
[legend]
Collaboration diagram for DSDV_Agent:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 DSDV_Agent ()
virtual int command (int argc, const char *const *argv)
void lost_link (Packet *p)
virtual void recv (Packet *p, const char *s)
void recvOnly (Packet *)
void send (Packet *p, Handler *h)
virtual void send (int sz, AppData *data)
virtual void send (int nbytes)
virtual void timeout (int tno)
virtual void sendmsg (int sz, AppData *, const char *flags=0)
virtual void sendmsg (int nbytes, const char *flags=0)
virtual void sendto (int sz, AppData *, const char *flags, nsaddr_t dst)
virtual void sendto (int nbytes, const char *flags, nsaddr_t dst)
virtual void connect (nsaddr_t dst)
virtual void close ()
virtual void listen ()
virtual void attachApp (Application *app)
virtual int & size ()
nsaddr_taddr ()
nsaddr_tport ()
nsaddr_tdaddr ()
nsaddr_tdport ()
void set_pkttype (packet_t pkttype)
packet_t get_pkttype ()
NsObjecttarget ()
virtual void drop (Packet *p)
int isdebug () const
virtual void debug (const char *fmt,...)

Protected Member Functions

void helper_callback (Event *e)
Packetrtable (int)
virtual void recv (Packet *, Handler *)
void trace (char *fmt,...)
void tracepkt (Packet *, double, int, const char *)
void needTriggeredUpdate (rtable_ent *prte, Time t)
void cancelTriggersBefore (Time t)
PacketmakeUpdate (int &periodic)
void updateRoute (rtable_ent *old_rte, rtable_ent *new_rte)
void processUpdate (Packet *p)
void forwardPacket (Packet *p)
void startUp ()
int diff_subnet (int dst)
void sendOutBCastPkt (Packet *p)
void output_rte (const char *prefix, rtable_ent *prte, DSDV_Agent *a)
virtual void delay_bind_init_all ()
virtual int delay_bind_dispatch (const char *varName, const char *localName, TclObject *tracer)
virtual void recvBytes (int bytes)
virtual void idle ()
Packetallocpkt () const
Packetallocpkt (int) const
void initpkt (Packet *) const
virtual void trace (TracedVar *v)
void deleteAgentTrace ()
void addAgentTrace (const char *name)
void monitorAgentTrace ()
OldValuelookupOldValue (TracedVar *v)
void insertOldValue (TracedVar *v, const char *value)
void dumpTracedVars ()
virtual void trace_event (char *eventtype)
virtual void drop (Packet *p, const char *s)
virtual void reset ()
void handle (Event *)

Protected Attributes

Tracetracetarget
DSDV_Helperhelper_
DSDVTriggerHandlertrigger_handler
RoutingTabletable_
PriQueuell_queue
int seqno_
int myaddr_
char * subnet_
MobileNodenode_
char * address
NsObjectport_dmux_
Eventperiodic_callback_
int be_random_
int use_mac_
int verbose_
int trace_wst_
double lasttup_
double next_tup
double alpha_
double wst0_
double perup_
int min_update_periods_
ns_addr_t here_
ns_addr_t dst_
int size_
packet_t type_
int fid_
int prio_
int flags_
int defttl_
Tcl_Channel channel_
char * traceName_
OldValueoldValueList_
Applicationapp_
EventTraceet_
NsObjecttarget_
NsObjectdrop_
int debug_

Static Protected Attributes

int uidcnt_

Friends

class DSDV_Helper
class DSDVTriggerHandler

Constructor & Destructor Documentation

DSDV_Agent::DSDV_Agent  ) 
 

Definition at line 1080 of file dsdv.cc.

References address, alpha_, be_random_, DSDV_Helper, DSDVTriggerHandler, helper_, min_update_periods_, perup_, PT_MESSAGE, RoutingTable, table_, trace_wst_, trigger_handler, use_mac_, verbose_, and wst0_.

01080                        : Agent (PT_MESSAGE), ll_queue (0), seqno_ (0), 
01081   myaddr_ (0), subnet_ (0), node_ (0), port_dmux_(0),
01082   periodic_callback_ (0), be_random_ (1), 
01083   use_mac_ (0), verbose_ (1), trace_wst_ (0), lasttup_ (-10), 
01084   alpha_ (0.875),  wst0_ (6), perup_ (15), 
01085   min_update_periods_ (3)       // constants
01086  {
01087   table_ = new RoutingTable ();
01088   helper_ = new DSDV_Helper (this);
01089   trigger_handler = new DSDVTriggerHandler(this);
01090 
01091   bind_time ("wst0_", &wst0_);
01092   bind_time ("perup_", &perup_);
01093 
01094   bind ("use_mac_", &use_mac_);
01095   bind ("be_random_", &be_random_);
01096   bind ("alpha_", &alpha_);
01097   bind ("min_update_periods_", &min_update_periods_);
01098   bind ("verbose_", &verbose_);
01099   bind ("trace_wst_", &trace_wst_);
01100   //DEBUG
01101   address = 0;
01102  
01103 }


Member Function Documentation

void Agent::addAgentTrace const char *  name  )  [protected, inherited]
 

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:

nsaddr_t& Agent::addr  )  [inline, inherited]
 

Definition at line 96 of file agent.h.

References ns_addr_t::addr_, Agent::here_, and nsaddr_t.

Referenced by LandmarkAgent::assign_lmaddress(), SSMSRMAgent::command(), IntTcpAgent::createTcpSession(), Agent::flushAVar(), LmsSender::handle_lms_pkt(), SSMSRMAgent::is_active(), QSNewRenoTcpAgent::recv(), TcpAsymSink::recv(), SRMAgent::recv(), SSMSRMAgent::recv(), QSAgent::recv(), MIPBSAgent::recv(), LmsAgent::recv(), HttpInvalAgent::recv(), CtrMcastEncap::recv(), SSMSRMAgent::recv_glb_sess(), SSMSRMAgent::recv_loc_sess(), SSMSRMAgent::recv_rep_sess(), SRMAgent::recv_sess(), TapAgent::recvpkt(), MIPMHAgent::reg(), MIPBSAgent::send_ads(), LmsSender::send_dmcast(), LmsReceiver::send_dmcast(), LmsAgent::send_downstream(), SSMSRMAgent::send_glb_sess(), LmsSender::send_lms_pkt(), SSMSRMAgent::send_loc_sess(), LmsReceiver::send_nak(), LmsReceiver::send_refresh(), SSMSRMAgent::send_rep_sess(), SRMAgent::send_sess(), MIPMHAgent::send_sols(), LmsSender::send_spm(), LmsAgent::send_upstream(), SRMAgent::sendmsg(), LmsSender::solicit_naks(), SRMAgent::start(), TcpAgent::trace_event(), TcpAgent::traceAll(), TcpAsymAgent::traceAll(), TcpAgent::traceVar(), TcpSessionAgent::traceVar(), and TcpAsymAgent::traceVar().

00096 { return here_.addr_; }

Packet * Agent::allocpkt int   )  const [protected, inherited]
 

Definition at line 517 of file agent.cc.

References Packet::allocdata(), and Agent::allocpkt().

00518 {
00519         Packet* p = allocpkt();
00520 
00521         if (n > 0)
00522                 p->allocdata(n);
00523 
00524         return(p);
00525 }

Here is the call graph for this function:

Packet * Agent::allocpkt  )  const [protected, inherited]
 

Definition at line 506 of file agent.cc.

References Packet::alloc(), and Agent::initpkt().

Referenced by TcpSink::ack(), QSTcpSink::ack(), Agent::allocpkt(), PingAgent::command(), MessageAgent::command(), mcastControlAgent::command(), LmsAgent::command(), LDPAgent::command(), LandmarkAgent::command(), IvsReceiver::command(), command(), OmniMcastAgent::create_packet(), FloodingAgent::create_packet(), DiffusionAgent::create_packet(), SinkAgent::create_packet(), SensorQueryAgent::generate_query(), DSRAgent::getRouteForPacket(), LandmarkAgent::makeUpdate(), makeUpdate(), TcpAgent::output(), VegasTcpAgent::output(), RFC793eduTcpAgent::output(), QSNewRenoTcpAgent::output(), IntTcpAgent::output(), AbsTcpAgent::output(), TCPTapAgent::processpkt(), AbsDelAckSink::recv(), AbsTcpSink::recv(), SAack_Agent::recv(), PingAgent::recv(), Encapsulator::recv(), TapAgent::recvpkt(), MIPMHAgent::reg(), DSRAgent::replyFromRouteCache(), DSRAgent::returnSrcRouteToRequestor(), HttpInvalAgent::send(), MIPBSAgent::send_ads(), SRMAgent::send_ctrl(), SSMSRMAgent::send_ctrl(), MFTPSndAgent::send_data(), GAFAgent::send_discovery(), LmsSender::send_dmcast(), LmsReceiver::send_dmcast(), 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(), RapAgent::SendAck(), UdpAgent::sendmsg(), SimpleTcpAgent::sendmsg(), SRMAgent::sendmsg(), SA_Agent::sendmsg(), RTPAgent::sendmsg(), PushbackAgent::sendMsg(), LmsSender::sendmsg(), FullTcpAgent::sendpacket(), BayFullTcpAgent::sendpacket(), RapAgent::SendPacket(), TfrcAgent::sendpkt(), TfrcSinkAgent::sendpkt(), SA_Agent::sendpkt(), rtProtoDV::sendpkt(), RTPAgent::sendpkt(), RTCPAgent::sendpkt(), RLM_Sender::sendpkt(), IvsSource::sendpkt(), IcmpAgent::sendredirect(), SA_Agent::sendreq(), DSRAgent::sendRouteShortening(), SA_Agent::sendteardown(), LmsSender::solicit_naks(), and AbsDelAckSink::timeout().

00507 {
00508         Packet* p = Packet::alloc();
00509         initpkt(p);
00510         return (p);
00511 }

Here is the call graph for this function:

void Agent::attachApp Application app  )  [virtual, inherited]
 

Definition at line 372 of file agent.cc.

References Agent::app_.

Referenced by HttpMInvalCache::command(), Application::command(), TcpApp::TcpApp(), and TcpApp::~TcpApp().

00373 {
00374         app_ = app;
00375 }

void DSDV_Agent::cancelTriggersBefore Time  t  )  [protected]
 

Definition at line 213 of file dsdv.cc.

References Scheduler::cancel(), Scheduler::instance(), table_, Event::time_, and rtable_ent::trigger_event.

Referenced by DSDVTriggerHandler::handle().

00216 {
00217   rtable_ent *prte;
00218   Scheduler & s = Scheduler::instance ();
00219 
00220   for (table_->InitLoop (); (prte = table_->NextLoop ());)
00221     if (prte->trigger_event && prte->trigger_event->time_ < t)
00222       {
00223               //DEBUG
00224               //printf("(%d) cancel event %x\n",myaddr_,prte->trigger_event);
00225         s.cancel(prte->trigger_event);
00226         delete prte->trigger_event;
00227         prte->trigger_event = 0;
00228       }
00229 }

Here is the call graph for this function:

void Agent::close  )  [virtual, inherited]
 

Reimplemented in FullTcpAgent.

Definition at line 377 of file agent.cc.

Referenced by Agent::command().

00378 {
00379 }

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

Reimplemented from Agent.

Definition at line 1144 of file dsdv.cc.

References Agent::allocpkt(), Agent::command(), Packet::free(), HDR_IP, Address::instance(), Scheduler::instance(), ll_queue, myaddr_, node_, output_rte(), p2, port_dmux_, hdr_ip::saddr(), hdr_ip::sport(), startUp(), Address::str2addr(), table_, trace(), and tracetarget.

01145 {
01146   if (argc == 2)
01147     {
01148       if (strcmp (argv[1], "start-dsdv") == 0)
01149         {
01150           startUp();
01151           return (TCL_OK);
01152         }
01153       else if (strcmp (argv[1], "dumprtab") == 0)
01154         {
01155           Packet *p2 = allocpkt ();
01156           hdr_ip *iph2 = HDR_IP(p2);
01157           rtable_ent *prte;
01158 
01159           printf ("Table Dump %d[%d]\n----------------------------------\n",
01160                   iph2->saddr(), iph2->sport());
01161         trace ("VTD %.5f %d:%d\n", Scheduler::instance ().clock (),
01162                  iph2->saddr(), iph2->sport());
01163 
01164           /*
01165            * Freeing a routing layer packet --> don't need to
01166            * call drop here.
01167            */
01168         Packet::free (p2);
01169 
01170           for (table_->InitLoop (); (prte = table_->NextLoop ());)
01171             output_rte ("\t", prte, this);
01172 
01173           printf ("\n");
01174 
01175           return (TCL_OK);
01176         }
01177       else if (strcasecmp (argv[1], "ll-queue") == 0)
01178         {
01179         if (!(ll_queue = (PriQueue *) TclObject::lookup (argv[2])))
01180             {
01181               fprintf (stderr, "DSDV_Agent: ll-queue lookup of %s failed\n", argv[2]);
01182               return TCL_ERROR;
01183             }
01184 
01185           return TCL_OK;
01186         }
01187 
01188     }
01189   else if (argc == 3)
01190     {
01191       if (strcasecmp (argv[1], "addr") == 0) {
01192          int temp;
01193          temp = Address::instance().str2addr(argv[2]);
01194          myaddr_ = temp;
01195          return TCL_OK;
01196       }
01197       TclObject *obj;
01198       if ((obj = TclObject::lookup (argv[2])) == 0)
01199         {
01200           fprintf (stderr, "%s: %s lookup of %s failed\n", __FILE__, argv[1],
01201                    argv[2]);
01202           return TCL_ERROR;
01203         }
01204       if (strcasecmp (argv[1], "tracetarget") == 0)
01205         {
01206           
01207           tracetarget = (Trace *) obj;
01208           return TCL_OK;
01209         }
01210       else if (strcasecmp (argv[1], "node") == 0) {
01211               node_ = (MobileNode*) obj;
01212               return TCL_OK;
01213       }
01214       else if (strcasecmp (argv[1], "port-dmux") == 0) {
01215               port_dmux_ = (NsObject *) obj;
01216               return TCL_OK;
01217       }
01218     }
01219   
01220   return (Agent::command (argc, argv));
01221 }

Here is the call graph for this function:

void Agent::connect nsaddr_t  dst  )  [virtual, inherited]
 

Definition at line 389 of file agent.cc.

Referenced by Agent::command().

00390 {
00391 /*
00392         dst_ = dst;
00393 */
00394 }

nsaddr_t& Agent::daddr  )  [inline, inherited]
 

Definition at line 98 of file agent.h.

References ns_addr_t::addr_, Agent::dst_, and nsaddr_t.

Referenced by IntTcpAgent::createTcpSession(), lost_link(), TcpAsymSink::recv(), CtrMcastEncap::recv(), PingResponder::reflect(), IntTcpAgent::rxmit_last(), LmsSender::send_dmcast(), LmsSender::send_lms_pkt(), IntTcpAgent::send_one(), rtProtoDV::sendpkt(), LmsSender::solicit_naks(), TcpAgent::trace_event(), TcpAgent::traceAll(), TcpAsymAgent::traceAll(), TcpAgent::traceVar(), TcpSessionAgent::traceVar(), and TcpAsymAgent::traceVar().

00098 { return dst_.addr_; }

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 Agent::delay_bind_dispatch const char *  varName,
const char *  localName,
TclObject tracer
[protected, virtual, inherited]
 

Reimplemented from NsObject.

Reimplemented in BayFullTcpAgent, LDPAgent, FullTcpAgent, SackFullTcpAgent, RFC793eduTcpAgent, TcpSink, TcpAgent, and VegasTcpAgent.

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 TcpAgent::delay_bind_dispatch(), TcpSink::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:

void Agent::delay_bind_init_all  )  [protected, virtual, inherited]
 

Reimplemented from NsObject.

Reimplemented in BayFullTcpAgent, LDPAgent, FullTcpAgent, SackFullTcpAgent, RFC793eduTcpAgent, TcpSink, TcpAgent, and VegasTcpAgent.

Definition at line 78 of file agent.cc.

References NsObject::delay_bind_init_all().

Referenced by TcpAgent::delay_bind_init_all(), TcpSink::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:

void Agent::deleteAgentTrace  )  [protected, inherited]
 

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:

int DSDV_Agent::diff_subnet int  dst  )  [protected]
 

Definition at line 853 of file dsdv.cc.

References Address::get_subnetaddr(), Address::instance(), and subnet_.

Referenced by forwardPacket().

00854 {
00855         char* dstnet = Address::instance().get_subnetaddr(dst);
00856         if (subnet_ != NULL) {
00857                 if (dstnet != NULL) {
00858                         if (strcmp(dstnet, subnet_) != 0) {
00859                                 delete [] dstnet;
00860                                 return 1;
00861                         }
00862                         delete [] dstnet;
00863                 }
00864         }
00865         //assert(dstnet == NULL);
00866         return 0;
00867 }

Here is the call graph for this function:

nsaddr_t& Agent::dport  )  [inline, inherited]
 

Definition at line 99 of file agent.h.

References Agent::dst_, nsaddr_t, and ns_addr_t::port_.

Referenced by lost_link(), TcpAsymSink::recv(), CtrMcastEncap::recv(), IntTcpAgent::rxmit_last(), IntTcpAgent::send_one(), rtProtoDV::sendpkt(), TcpAgent::trace_event(), TcpAgent::traceAll(), TcpAsymAgent::traceAll(), TcpAgent::traceVar(), TcpSessionAgent::traceVar(), and TcpAsymAgent::traceVar().

00099 { return dst_.port_; }

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(), forwardPacket(), DSRAgent::getRouteForPacket(), Snoop::handle(), DSRAgent::handleFlowForwarding(), DSRAgent::handleForwarding(), 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(), 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 Agent::dumpTracedVars  )  [protected, inherited]
 

void DSDV_Agent::forwardPacket Packet p  )  [protected]
 

Definition at line 872 of file dsdv.cc.

References hdr_cmn::addr_type_, rtable_ent::advertise_ok_at, MobileNode::base_stn(), BIG, rtable_ent::changed_at, Scheduler::clock(), hdr_ip::daddr(), PacketQueue::deque(), diff_subnet(), hdr_cmn::direction(), hdr_cmn::DOWN, hdr_ip::dport(), Connector::drop(), DROP_RTR_QFULL, rtable_ent::dst, PacketQueue::enque(), Packet::free(), Address::get_nodeaddr(), HDR_CMN, HDR_IP, rtable_ent::hop, Address::instance(), Scheduler::instance(), PacketQueue::length(), mac_callback(), MAX_QUEUE_LENGTH, rtable_ent::metric, myaddr_, rtable_ent::new_seqnum_at, hdr_cmn::next_hop_, node_, NS_AF_INET, rtable_ent::q, NsObject::recv(), hdr_ip::saddr(), Agent::send(), rtable_ent::seqnum, hdr_ip::sport(), table_, Connector::target_, rtable_ent::timeout_event, trace(), verbose_, rtable_ent::wst, wst0_, hdr_cmn::xmit_failure_, and hdr_cmn::xmit_failure_data_.

Referenced by recv().

00873 {
00874   hdr_ip *iph = HDR_IP(p);
00875   Scheduler & s = Scheduler::instance ();
00876   double now = s.clock ();
00877   hdr_cmn *hdrc = HDR_CMN (p);
00878   int dst;
00879   rtable_ent *prte;
00880   
00881   // We should route it.
00882   //printf("(%d)-->forwardig pkt\n",myaddr_);
00883   // set direction of pkt to -1 , i.e downward
00884   hdrc->direction() = hdr_cmn::DOWN;
00885 
00886   // if the destination is outside mobilenode's domain
00887   // forward it to base_stn node
00888   // Note: pkt is not buffered if route to base_stn is unknown
00889 
00890   dst = Address::instance().get_nodeaddr(iph->daddr());  
00891   if (diff_subnet(iph->daddr())) {
00892            prte = table_->GetEntry (dst);
00893           if (prte && prte->metric != BIG) 
00894                   goto send;
00895           
00896           //int dst = (node_->base_stn())->address();
00897           dst = node_->base_stn();
00898           prte = table_->GetEntry (dst);
00899           if (prte && prte->metric != BIG) 
00900                   goto send;
00901           
00902           else {
00903                   //drop pkt with warning
00904                   fprintf(stderr, "warning: Route to base_stn not known: dropping pkt\n");
00905                   Packet::free(p);
00906                   return;
00907           }
00908   }
00909   
00910   prte = table_->GetEntry (dst);
00911   
00912   //  trace("VDEBUG-RX %d %d->%d %d %d 0x%08x 0x%08x %d %d", 
00913   //  myaddr_, iph->src(), iph->dst(), hdrc->next_hop_, hdrc->addr_type_,
00914   //  hdrc->xmit_failure_, hdrc->xmit_failure_data_,
00915   //  hdrc->num_forwards_, hdrc->opt_num_forwards);
00916 
00917   if (prte && prte->metric != BIG)
00918     {
00919        //printf("(%d)-have route for dst\n",myaddr_);
00920        goto send;
00921     }
00922   else if (prte)
00923     { /* must queue the packet */
00924             //printf("(%d)-no route, queue pkt\n",myaddr_);
00925       if (!prte->q)
00926         {
00927           prte->q = new PacketQueue ();
00928         }
00929 
00930       prte->q->enque(p);
00931 
00932       if (verbose_)
00933         trace ("VBP %.5f _%d_ %d:%d -> %d:%d", now, myaddr_, iph->saddr(),
00934                iph->sport(), iph->daddr(), iph->dport());
00935 
00936       while (prte->q->length () > MAX_QUEUE_LENGTH)
00937               drop (prte->q->deque (), DROP_RTR_QFULL);
00938       return;
00939     }
00940   else
00941     { // Brand new destination
00942       rtable_ent rte;
00943       double now = s.clock();
00944       
00945       bzero(&rte, sizeof(rte));
00946       rte.dst = dst;
00947       rte.hop = dst;
00948       rte.metric = BIG;
00949       rte.seqnum = 0;
00950 
00951       rte.advertise_ok_at = now + 604800;       // check back next week... :)
00952       rte.changed_at = now;
00953       rte.new_seqnum_at = now;  // was now + wst0_, why??? XXX -dam
00954       rte.wst = wst0_;
00955       rte.timeout_event = 0;
00956 
00957       rte.q = new PacketQueue();
00958       rte.q->enque(p);
00959           
00960       assert (rte.q->length() == 1 && 1 <= MAX_QUEUE_LENGTH);
00961       table_->AddEntry(rte);
00962       
00963       if (verbose_)
00964               trace ("VBP %.5f _%d_ %d:%d -> %d:%d", now, myaddr_,
00965                      iph->saddr(), iph->sport(), iph->daddr(), iph->dport());
00966       return;
00967     }
00968 
00969 
00970  send:
00971   hdrc->addr_type_ = NS_AF_INET;
00972   hdrc->xmit_failure_ = mac_callback;
00973   hdrc->xmit_failure_data_ = this;
00974   if (prte->metric > 1)
00975           hdrc->next_hop_ = prte->hop;
00976   else
00977           hdrc->next_hop_ = dst;
00978   if (verbose_)
00979           trace ("Routing pkts outside domain: \
00980 VFP %.5f _%d_ %d:%d -> %d:%d", now, myaddr_, iph->saddr(),
00981                  iph->sport(), iph->daddr(), iph->dport());  
00982 
00983   assert (!HDR_CMN (p)->xmit_failure_ ||
00984           HDR_CMN (p)->xmit_failure_ == mac_callback);
00985   target_->recv(p, (Handler *)0);
00986   return;
00987   
00988 }

Here is the call graph for this function:

packet_t Agent::get_pkttype  )  [inline, inherited]
 

Definition at line 101 of file agent.h.

References packet_t, and Agent::type_.

Referenced by CBR_Traffic::init().

00101 { return type_; }

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:

void DSDV_Agent::helper_callback Event e  )  [protected]
 

Definition at line 250 of file dsdv.cc.

References abort(), rtable_ent::advert_metric, rtable_ent::advert_seqnum, rtable_ent::advertise_ok_at, be_random_, BIG, Scheduler::clock(), DSDV_BROADCAST_JITTER, rtable_ent::dst, HDR_CMN, helper_, rtable_ent::hop, Scheduler::instance(), jitter(), lasttup_, makeUpdate(), rtable_ent::metric, myaddr_, needTriggeredUpdate(), periodic_callback_, perup_, Scheduler::schedule(), rtable_ent::seqnum, table_, Connector::target_, rtable_ent::timeout_event, trace(), tracepkt(), and verbose_.

Referenced by DSDV_Helper::handle(), and lost_link().

00251 {
00252   Scheduler & s = Scheduler::instance ();
00253   double now = s.clock ();
00254   rtable_ent *prte;
00255   rtable_ent *pr2;
00256   int update_type;       // we want periodic (=1) or triggered (=0) update?
00257   //DEBUG
00258   //printf("Triggered handler on 0x%08x\n", e);
00259 
00260   // Check for periodic callback
00261   if (periodic_callback_ && e == periodic_callback_)
00262     {
00263       update_type = 1;
00264       Packet *p = makeUpdate(/*in-out*/update_type);
00265       if (verbose_)
00266         {
00267           trace ("VPC %.5f _%d_", now, myaddr_);
00268           tracepkt (p, now, myaddr_, "PU");
00269         }
00270 
00271       
00272       if (p) {
00273               assert (!HDR_CMN (p)->xmit_failure_);     // DEBUG 0x2
00274               // send out update packet jitter to avoid sync
00275               //DEBUG
00276               //printf("(%d)..sendout update pkt (periodic=%d)\n",myaddr_,update_type);
00277               s.schedule (target_, p, jitter(DSDV_BROADCAST_JITTER, be_random_));
00278       }
00279       
00280       // put the periodic update sending callback back onto the 
00281       // the scheduler queue for next time....
00282       s.schedule (helper_, periodic_callback_, 
00283                   perup_ * (0.75 + jitter (0.25, be_random_)));
00284 
00285       // this will take the place of any planned triggered updates
00286       lasttup_ = now;
00287       return;
00288     }
00289 
00290   // Check for timeout
00291   // If it was a timeout, fix the routing table.
00292   for (table_->InitLoop (); (prte = table_->NextLoop ());)
00293     if (prte->timeout_event && (prte->timeout_event == e))
00294       break;
00295 
00296   // If it was a timeout, prte will be non-NULL
00297   // Note that in the if we don't touch the changed_at time, so that when
00298   // wst is computed, it doesn't consider the infinte metric the best
00299   // one at that sequence number.
00300   if (prte)
00301           {
00302       if (verbose_)
00303         {
00304           trace ("VTO %.5f _%d_ %d->%d", now, myaddr_, myaddr_, prte->dst);
00305           /*      trace ("VTO %.5f _%d_ trg_sch %x on sched %x time %f", now, myaddr_, 
00306                  trigupd_scheduled, 
00307                  trigupd_scheduled ? s.lookup(trigupd_scheduled->uid_) : 0,
00308                  trigupd_scheduled ? trigupd_scheduled->time_ : 0); */
00309         }
00310       
00311       for (table_->InitLoop (); (pr2 = table_->NextLoop ()); )
00312         {
00313           if (pr2->hop == prte->dst && pr2->metric != BIG)
00314             {
00315               if (verbose_)
00316                 trace ("VTO %.5f _%d_ marking %d", now, myaddr_, pr2->dst);
00317               pr2->metric = BIG;
00318               pr2->advertise_ok_at = now;
00319               pr2->advert_metric = true;
00320               pr2->advert_seqnum = true;
00321               pr2->seqnum++;
00322               // And we have routing info to propogate.
00323               //DEBUG
00324               //printf("(%d)..we have routing info to propagate..trigger update for dst %d\n",myaddr_,pr2->dst);
00325               needTriggeredUpdate(pr2, now);
00326             }
00327         }
00328 
00329       // OK the timeout expired, so we'll free it. No dangling pointers.
00330       prte->timeout_event = 0;    
00331     }
00332   else 
00333     { // unknown event on  queue
00334       fprintf(stderr,"DFU: unknown queue event\n");
00335      abort();
00336     }
00337 
00338   if (e)
00339     delete e;
00340 }

Here is the call graph for this function:

void Agent::idle  )  [protected, virtual, inherited]
 

Definition at line 363 of file agent.cc.

References Agent::app_, and Application::resume().

Referenced by FullTcpAgent::foutput(), TcpAgent::output(), VegasTcpAgent::output(), RFC793eduTcpAgent::output(), QSNewRenoTcpAgent::output(), IntTcpAgent::output(), BayFullTcpAgent::output(), UdpAgent::sendmsg(), SA_Agent::sendmsg(), and RTPAgent::sendmsg().

00364 {
00365         if (app_)
00366                 app_->resume();
00367 }

Here is the call graph for this function:

void Agent::initpkt Packet  )  const [protected, inherited]
 

Definition at line 446 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(), NixVec::Reset(), hdr_ip::saddr(), hdr_cmn::size(), Agent::size_, hdr_ip::sport(), hdr_cmn::timestamp(), hdr_ip::ttl(), Agent::type_, hdr_cmn::uid(), and Agent::uidcnt_.

Referenced by Agent::allocpkt(), and PingResponder::recv().

00447 {
00448         hdr_cmn* ch = hdr_cmn::access(p);
00449         ch->uid() = uidcnt_++;
00450         ch->ptype() = type_;
00451         ch->size() = size_;
00452         ch->timestamp() = Scheduler::instance().clock();
00453         ch->iface() = UNKN_IFACE.value(); // from packet.h (agent is local)
00454         ch->direction() = hdr_cmn::NONE;
00455 
00456         ch->error() = 0;        /* pkt not corrupt to start with */
00457 
00458         hdr_ip* iph = hdr_ip::access(p);
00459         iph->saddr() = here_.addr_;
00460         iph->sport() = here_.port_;
00461         iph->daddr() = dst_.addr_;
00462         iph->dport() = dst_.port_;
00463         
00464         //DEBUG
00465         //if (dst_ != -1)
00466         //  printf("pl break\n");
00467         
00468         iph->flowid() = fid_;
00469         iph->prio() = prio_;
00470         iph->ttl() = defttl_;
00471 
00472         hdr_flags* hf = hdr_flags::access(p);
00473         hf->ecn_capable_ = 0;
00474         hf->ecn_ = 0;
00475         hf->eln_ = 0;
00476         hf->ecn_to_echo_ = 0;
00477         hf->fs_ = 0;
00478         hf->no_ts_ = 0;
00479         hf->pri_ = 0;
00480         hf->cong_action_ = 0;
00481 #ifdef HAVE_STL
00482 
00483         hdr_nv* nv = hdr_nv::access(p);
00484         if (0)
00485                 printf("Off hdr_nv %d, ip_hdr %d myaddr %ld\n",
00486                        hdr_nv::offset(), hdr_ip::offset(), here_.addr_);
00487         NixNode* pNixNode = NixNode::GetNodeObject(here_.addr_);
00488         if (0)
00489                 printf("Node Object %p\n", pNixNode);
00490         if (pNixNode) { 
00491                 // If we get non-null, indicates nixvector routing in use
00492                 // Delete any left over nv in the packet
00493                 // Get a nixvector to the target (may create new)
00494                 NixVec* pNv = pNixNode->GetNixVector(dst_.addr_);
00495                 pNv->Reset();
00496                 nv->nv() = pNv; // And set the nixvec in the packet
00497                 nv->h_used = 0; // And reset used portion to 0
00498         }
00499 #endif //HAVE_STL
00500 }

Here is the call graph for this function:

void Agent::insertOldValue TracedVar *  v,
const char *  value
[protected, inherited]
 

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 }

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

Definition at line 61 of file object.h.

References NsObject::debug_.

00061 { return debug_; }

void Agent::listen  )  [virtual, inherited]
 

Reimplemented in BayFullTcpAgent, RapAgent, and FullTcpAgent.

Definition at line 381 of file agent.cc.

Referenced by Agent::command().

00382 {
00383 }

OldValue * Agent::lookupOldValue TracedVar *  v  )  [protected, inherited]
 

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 }

void DSDV_Agent::lost_link Packet p  ) 
 

Definition at line 343 of file dsdv.cc.

References hdr_ip::access(), hdr_cmn::addr_type_, BIG, Scheduler::cancel(), Agent::daddr(), Agent::dport(), Connector::drop(), DROP_RTR_MAC_CALLBACK, rtable_ent::dst, PriQueue::filter(), HDR_CMN, helper_callback(), Scheduler::instance(), ll_queue, rtable_ent::metric, myaddr_, hdr_cmn::next_hop_, NS_AF_INET, p2, recv(), table_, Connector::target_, rtable_ent::timeout_event, trace(), use_mac_, and verbose_.

00344 {
00345   hdr_cmn *hdrc = HDR_CMN (p);
00346   rtable_ent *prte = table_->GetEntry (hdrc->next_hop_);
00347 
00348   if(use_mac_ == 0) {
00349           drop(p, DROP_RTR_MAC_CALLBACK);
00350           return;
00351   }
00352 
00353   //DEBUG
00354   //printf("(%d)..Lost link..\n",myaddr_);
00355   if (verbose_ && hdrc->addr_type_ == NS_AF_INET)
00356     trace("VLL %.8f %d->%d lost at %d",
00357     Scheduler::instance().clock(),
00358            hdr_ip::access(p)->saddr(), hdr_ip::access(p)->daddr(),
00359            myaddr_);
00360 
00361   if (!use_mac_ || !prte || hdrc->addr_type_ != NS_AF_INET)
00362     return;
00363 
00364   if (verbose_)
00365     trace ("VLP %.5f %d:%d->%d:%d lost at %d [hop %d]",
00366   Scheduler::instance ().clock (),
00367            hdr_ip::access (p)->saddr(),
00368            hdr_ip::access (p)->sport(),
00369            hdr_ip::access (p)->daddr(),
00370            hdr_ip::access (p)->dport(),
00371            myaddr_, prte->dst);
00372 
00373   if (prte->timeout_event)
00374     {
00375       Scheduler::instance ().cancel (prte->timeout_event);
00376       helper_callback (prte->timeout_event);
00377     }
00378   else if (prte->metric != BIG)
00379     {
00380       assert(prte->timeout_event == 0);
00381       prte->timeout_event = new Event ();
00382       helper_callback (prte->timeout_event);
00383     }
00384 
00385   // Queue these packets up...
00386   recv(p, 0);
00387 
00388 #if 0
00389   while (p2 = ((PriQueue *) target_)->filter (prte->dst))
00390     {
00391       if (verbose_)
00392       trace ("VRS %.5f %d:%d->%d:%d lost at %d", Scheduler::instance ().clock (),
00393                hdr_ip::access (p2)->saddr(),
00394                hdr_ip::access (p2)->sport(),
00395                hdr_ip::access (p2)->daddr(),
00396                hdr_ip::access (p2)->dport(), myaddr_);
00397 
00398       recv(p2, 0);
00399     }
00400 
00401   while (p2 = ll_queue->filter (prte->dst))
00402     {
00403       if (verbose_)
00404       trace ("VRS %.5f %d:%d->%d:%d lost at %d", Scheduler::instance ().clock (),
00405                hdr_ip::access (p2)->saddr(),
00406                hdr_ip::access (p2)->sport(),
00407                hdr_ip::access (p2)->daddr(),
00408                hdr_ip::access (p2)->dport(), myaddr_);
00409 
00410       recv (p2, 0);
00411     }
00412 #endif
00413 }

Here is the call graph for this function:

Packet * DSDV_Agent::makeUpdate int &  periodic  )  [protected]
 

Definition at line 422 of file dsdv.cc.

References hdr_ip::access(), Packet::accessdata(), hdr_cmn::addr_type_, rtable_ent::advert_metric, rtable_ent::advert_seqnum, rtable_ent::advertise_ok_at, Packet::allocdata(), Agent::allocpkt(), rtable_ent::changed_at, Scheduler::clock(), hdr_ip::daddr(), hdr_ip::dport(), rtable_ent::dst, Packet::free(), Address::get_nodeaddr(), HDR_CMN, rtable_ent::hop, Address::instance(), Scheduler::instance(), IP_BROADCAST, IP_HDR_LEN, rtable_ent::last_advertised_metric, rtable_ent::metric, myaddr_, rtable_ent::new_seqnum_at, hdr_cmn::next_hop_, Address::nodeshift(), NS_AF_INET, rtable_ent::q, ROUTER_PORT, hdr_ip::saddr(), seqno_, rtable_ent::seqnum, hdr_cmn::size_, table_, rtable_ent::timeout_event, trace(), verbose_, and rtable_ent::wst.

Referenced by DSDVTriggerHandler::handle(), and helper_callback().

00429 {
00430         //DEBUG
00431         //printf("(%d)-->Making update pkt\n",myaddr_);
00432         
00433   Packet *p = allocpkt ();
00434   hdr_ip *iph = hdr_ip::access(p);
00435   hdr_cmn *hdrc = HDR_CMN (p);
00436   double now = Scheduler::instance ().clock ();
00437   rtable_ent *prte;
00438   unsigned char *walk;
00439 
00440   int change_count;             // count of entries to go in this update
00441   int rtbl_sz;                  // counts total entries in rt table
00442   int unadvertiseable;          // number of routes we can't advertise yet
00443 
00444   //printf("Update packet from %d [per=%d]\n", myaddr_, periodic);
00445 
00446   // The packet we send wants to be broadcast
00447   hdrc->next_hop_ = IP_BROADCAST;
00448   hdrc->addr_type_ = NS_AF_INET;
00449   iph->daddr() = IP_BROADCAST << Address::instance().nodeshift();
00450   iph->dport() = ROUTER_PORT;
00451 
00452   change_count = 0;
00453   rtbl_sz = 0;
00454   unadvertiseable = 0;
00455   for (table_->InitLoop (); 
00456        (prte = table_->NextLoop ()); )
00457     {
00458       rtbl_sz++;
00459       if ((prte->advert_seqnum || prte->advert_metric) 
00460           && prte->advertise_ok_at <= now) 
00461         change_count++;
00462 
00463       if (prte->advertise_ok_at > now) unadvertiseable++;
00464     }
00465   //printf("change_count = %d\n",change_count);
00466   if (change_count * 3 > rtbl_sz && change_count > 3)
00467     { // much of the table has changed, just do a periodic update now
00468       periodic = 1;
00469     }
00470 
00471   // Periodic update... increment the sequence number...
00472   if (periodic)
00473     {
00474       change_count = rtbl_sz - unadvertiseable;
00475       //printf("rtbsize-%d, unadvert-%d\n",rtbl_sz,unadvertiseable);
00476       rtable_ent rte;
00477       bzero(&rte, sizeof(rte));
00478 
00479       /* inc sequence number on any periodic update, even if we started
00480          off wanting to do a triggered update, b/c we're doing a real
00481          live periodic update now that'll take the place of our next
00482          periodic update */
00483       seqno_ += 2;
00484 
00485       rte.dst = myaddr_;
00486       //rte.hop = iph->src();
00487       rte.hop = Address::instance().get_nodeaddr(iph->saddr());
00488       rte.metric = 0;
00489       rte.seqnum = seqno_;
00490 
00491       rte.advertise_ok_at = 0.0; // can always advert ourselves
00492       rte.advert_seqnum = true;  // always include ourselves in Triggered Upds
00493       rte.changed_at = now;
00494       rte.new_seqnum_at = now;
00495       rte.wst = 0;
00496       rte.timeout_event = 0;            // Don't time out our localhost :)
00497 
00498       rte.q = 0;                // Don't buffer pkts for self!
00499 
00500       table_->AddEntry (rte);
00501     }
00502 
00503   if (change_count == 0) 
00504     {
00505       Packet::free(p); // allocated by us, no drop needed
00506 
00507       return NULL; // nothing to advertise
00508     }
00509 
00510   /* ****** make the update packet.... ***********
00511      with less than 100+ nodes, an update for all nodes is less than the
00512      MTU, so don't bother worrying about splitting the update over
00513      multiple packets -dam 4/26/98 */
00514   assert(rtbl_sz <= (1500 / 12));
00515 
00516   p->allocdata((change_count * 9) + 1);
00517   walk = p->accessdata ();
00518   *(walk++) = change_count;
00519 
00520   // hdrc->size_ = change_count * 12 + 20;      // DSDV + IP
00521   hdrc->size_ = change_count * 12 + IP_HDR_LEN; // DSDV + IP
00522 
00523   for (table_->InitLoop (); (prte = table_->NextLoop ());)
00524     {
00525 
00526       if (periodic && prte->advertise_ok_at > now)
00527         { // don't send out routes that shouldn't be advertised
00528           // even in periodic updates
00529           continue;
00530         }
00531 
00532       if (periodic || 
00533           ((prte->advert_seqnum || prte->advert_metric) 
00534            && prte->advertise_ok_at <= now))
00535         { // include this rte in the advert
00536           if (!periodic && verbose_)
00537             trace ("VCT %.5f _%d_ %d", now, myaddr_, prte->dst);
00538 
00539           //assert (prte->dst < 256 && prte->metric < 256);
00540           //*(walk++) = prte->dst;
00541           *(walk++) = prte->dst >> 24;
00542           *(walk++) = (prte->dst >> 16) & 0xFF;
00543           *(walk++) = (prte->dst >> 8) & 0xFF;
00544           *(walk++) = (prte->dst >> 0) & 0xFF;
00545           *(walk++) = prte->metric;
00546           *(walk++) = (prte->seqnum) >> 24;
00547           *(walk++) = ((prte->seqnum) >> 16) & 0xFF;
00548           *(walk++) = ((prte->seqnum) >> 8) & 0xFF;
00549           *(walk++) = (prte->seqnum) & 0xFF;
00550 
00551           prte->last_advertised_metric = prte->metric;
00552 
00553           // seqnum's only need to be advertised once after they change
00554           prte->advert_seqnum = false; // don't need to advert seqnum again
00555 
00556           if (periodic) 
00557             { // a full advert means we don't have to re-advert either 
00558               // metrics or seqnums again until they change
00559               prte->advert_seqnum = false;
00560               prte->advert_metric = false;
00561             }
00562           change_count--;
00563         }
00564     }  
00565   assert(change_count == 0);
00566   return p;
00567 }

Here is the call graph for this function:

void Agent::monitorAgentTrace  )  [protected, inherited]
 

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:

void DSDV_Agent::needTriggeredUpdate rtable_ent prte,
Time  t
[protected]
 

Definition at line 232 of file dsdv.cc.

References Scheduler::cancel(), Scheduler::clock(), Scheduler::instance(), Scheduler::schedule(), Time, rtable_ent::trigger_event, and trigger_handler.

Referenced by helper_callback(), and processUpdate().

00234 {
00235   Scheduler & s = Scheduler::instance();
00236   Time now = Scheduler::instance().clock();
00237 
00238   assert(t >= now);
00239 
00240   if (prte->trigger_event) 
00241     s.cancel(prte->trigger_event);
00242   else
00243     prte->trigger_event = new Event;
00244   //DEBUG
00245   //printf("(%d)..scheduling trigger-update with event %x\n",myaddr_,prte->trigger_event);
00246   s.schedule(trigger_handler, prte->trigger_event, t - now);
00247 }

Here is the call graph for this function:

void DSDV_Agent::output_rte const char *  prefix,
rtable_ent prte,
DSDV_Agent a
[protected]
 

Definition at line 122 of file dsdv.cc.

References rtable_ent::changed_at, rtable_ent::dst, rtable_ent::hop, Scheduler::instance(), rtable_ent::metric, rtable_ent::new_seqnum_at, rtable_ent::seqnum, rtable_ent::timeout_event, trace(), and rtable_ent::wst.

Referenced by command().

00123 {
00124   a->trace("DFU: deimplemented");
00125   printf("DFU: deimplemented");
00126 
00127   prte = 0;
00128   prefix = 0;
00129 #if 0
00130   printf ("%s%d %d %d %d %f %f %f %f 0x%08x\n",
00131           prefix, prte->dst, prte->hop, prte->metric, prte->seqnum,
00132           prte->udtime, prte->new_seqnum_at, prte->wst, prte->changed_at,
00133           (unsigned int) prte->timeout_event);
00134   a->trace ("VTE %.5f %d %d %d %d %f %f %f %f 0x%08x",
00135           Scheduler::instance ().clock (), prte->dst, prte->hop, prte->metric,
00136           prte->seqnum, prte->udtime, prte->new_seqnum_at, prte->wst, prte->changed_at,
00137             prte->timeout_event);
00138 #endif
00139 }

Here is the call graph for this function:

nsaddr_t& Agent::port  )  [inline, inherited]
 

Definition at line 97 of file agent.h.

References Agent::here_, nsaddr_t, and ns_addr_t::port_.

Referenced by LmsAgent::pkt2agent(), TcpAsymSink::recv(), MIPBSAgent::recv(), LmsAgent::recv(), HttpInvalAgent::recv(), CtrMcastEncap::recv(), IntTcpAgent::rxmit_last(), IntTcpAgent::send_one(), LmsReceiver::send_refresh(), IcmpAgent::sendredirect(), TcpAgent::trace_event(), TcpAgent::traceAll(), TcpAsymAgent::traceAll(), TcpAgent::traceVar(), TcpSessionAgent::traceVar(), and TcpAsymAgent::traceVar().

00097 { return here_.port_; }

void DSDV_Agent::processUpdate Packet p  )  [protected]
 

Definition at line 599 of file dsdv.cc.

References abort(), Packet::accessdata(), rtable_ent::advert_metric, rtable_ent::advert_seqnum, rtable_ent::advertise_ok_at, alpha_, BIG, Scheduler::cancel(), rtable_ent::changed_at, Scheduler::clock(), PacketQueue::deque(), rtable_ent::dst, Packet::free(), Address::get_nodeaddr(), HDR_IP, helper_, rtable_ent::hop, Address::instance(), Scheduler::instance(), rtable_ent::last_advertised_metric, rtable_ent::metric, min_update_periods_, myaddr_, needTriggeredUpdate(), rtable_ent::new_seqnum_at, nsaddr_t, periodic_callback_, perup_, rtable_ent::q, recv(), hdr_ip::saddr(), Scheduler::schedule(), rtable_ent::seqnum, table_, rtable_ent::timeout_event, updateRoute(), rtable_ent::wst, and wst0_.

Referenced by recv().

00600 {
00601   hdr_ip *iph = HDR_IP(p);
00602   Scheduler & s = Scheduler::instance ();
00603   double now = s.clock ();
00604   
00605   // it's a dsdv packet
00606   int i;
00607   unsigned char *d = p->accessdata ();
00608   unsigned char *w = d + 1;
00609   rtable_ent rte;               // new rte learned from update being processed
00610   rtable_ent *prte;             // ptr to entry *in* routing tbl
00611 
00612   //DEBUG
00613   //int src, dst;
00614   //src = Address::instance().get_nodeaddr(iph->src());
00615   //dst = Address::instance().get_nodeaddr(iph->dst());
00616   //printf("Received DSDV packet from %d(%d) to %d(%d) [%d)]\n", src, iph->sport(), dst, iph->dport(), myaddr_);
00617 
00618   for (i = *d; i > 0; i--)
00619     {
00620       bool trigger_update = false;  // do we need to do a triggered update?
00621       nsaddr_t dst;
00622       prte = NULL;
00623 
00624       dst = *(w++);
00625       dst = dst << 8 | *(w++);
00626       dst = dst << 8 | *(w++);
00627       dst = dst << 8 | *(w++);
00628 
00629       if ((prte = table_->GetEntry (dst)))
00630         {
00631           bcopy(prte, &rte, sizeof(rte));
00632         }
00633       else
00634         {
00635           bzero(&rte, sizeof(rte));
00636         }
00637 
00638       rte.dst = dst;
00639       //rte.hop = iph->src();
00640       rte.hop = Address::instance().get_nodeaddr(iph->saddr());
00641       rte.metric = *(w++);
00642       rte.seqnum = *(w++);
00643       rte.seqnum = rte.seqnum << 8 | *(w++);
00644       rte.seqnum = rte.seqnum << 8 | *(w++);
00645       rte.seqnum = rte.seqnum << 8 | *(w++);
00646       rte.changed_at = now;
00647       if (rte.metric != BIG) rte.metric += 1;
00648 
00649       if (rte.dst == myaddr_)
00650         {
00651           if (rte.metric == BIG && periodic_callback_)
00652             {
00653               // You have the last word on yourself...
00654               // Tell the world right now that I'm still here....
00655               // This is a CMU Monarch optimiziation to fix the 
00656               // the problem of other nodes telling you and your neighbors
00657               // that you don't exist described in the paper.
00658               s.cancel (periodic_callback_);
00659               s.schedule (helper_, periodic_callback_, 0);
00660             }
00661           continue;             // don't corrupt your own routing table.
00662 
00663         }
00664 
00665       /**********  fill in meta data for new route ***********/
00666       // If it's in the table, make it the same timeout and queue.
00667       if (prte)
00668         { // we already have a route to this dst
00669           if (prte->seqnum == rte.seqnum)
00670             { // we've got an update with out a new squenece number
00671               // this update must have come along a different path
00672               // than the previous one, and is just the kind of thing
00673               // the weighted settling time is supposed to track.
00674 
00675               // this code is now a no-op left here for clarity -dam XXX
00676               rte.wst = prte->wst;
00677               rte.new_seqnum_at = prte->new_seqnum_at;
00678             }
00679           else 
00680             { // we've got a new seq number, end the measurement period
00681               // for wst over the course of the old sequence number
00682               // and update wst with the difference between the last
00683               // time we changed the route (which would be when the 
00684               // best route metric arrives) and the first time we heard
00685               // the sequence number that started the measurement period
00686 
00687               // do we care if we've missed a sequence number, such
00688               // that we have a wst measurement period that streches over
00689               // more than a single sequence number??? XXX -dam 4/20/98
00690               rte.wst = alpha_ * prte->wst + 
00691                 (1.0 - alpha_) * (prte->changed_at - prte->new_seqnum_at);
00692               rte.new_seqnum_at = now;
00693             }
00694         }
00695       else
00696         { // inititallize the wst for the new route
00697           rte.wst = wst0_;
00698           rte.new_seqnum_at = now;
00699         }
00700           
00701       // Now that we know the wst_, we know when to update...
00702       if (rte.metric != BIG && (!prte || prte->metric != BIG))
00703         rte.advertise_ok_at = now + (rte.wst * 2);
00704       else
00705         rte.advertise_ok_at = now;
00706 
00707       /*********** decide whether to update our routing table *********/
00708       if (!prte)
00709         { // we've heard from a brand new destination
00710           if (rte.metric < BIG) 
00711             {
00712               rte.advert_metric = true;
00713               trigger_update = true;
00714             }
00715           updateRoute(prte,&rte);
00716         }
00717       else if ( prte->seqnum == rte.seqnum )
00718         { // stnd dist vector case
00719           if (rte.metric < prte->metric) 
00720             { // a shorter route!
00721               if (rte.metric == prte->last_advertised_metric)
00722                 { // we've just gone back to a metric we've already advertised
00723                   rte.advert_metric = false;
00724                   trigger_update = false;
00725                 }
00726               else
00727                 { // we're changing away from the last metric we announced
00728                   rte.advert_metric = true;
00729                   trigger_update = true;
00730                 }
00731               updateRoute(prte,&rte);
00732             }
00733           else
00734             { // ignore the longer route
00735             }
00736         }
00737       else if ( prte->seqnum < rte.seqnum )
00738         { // we've heard a fresher sequence number
00739           // we *must* believe its rt metric
00740           rte.advert_seqnum = true;     // we've got a new seqnum to advert
00741           if (rte.metric == prte->last_advertised_metric)
00742             { // we've just gone back to our old metric
00743               rte.advert_metric = false;
00744             }
00745           else
00746             { // we're using a metric different from our last advert
00747               rte.advert_metric = true;
00748             }
00749 
00750           updateRoute(prte,&rte);
00751 
00752 #ifdef TRIGGER_UPDATE_ON_FRESH_SEQNUM
00753           trigger_update = true;
00754 #else
00755           trigger_update = false;
00756 #endif
00757         }
00758       else if ( prte->seqnum > rte.seqnum )
00759         { // our neighbor has older sequnum info than we do
00760           if (rte.metric == BIG && prte->metric != BIG)
00761             { // we must go forth and educate this ignorant fellow
00762               // about our more glorious and happy metric
00763               prte->advertise_ok_at = now;
00764               prte->advert_metric = true;
00765               // directly schedule a triggered update now for 
00766               // prte, since the other logic only works with rte.*
00767               needTriggeredUpdate(prte,now);
00768             }
00769           else
00770             { // we don't care about their stale info
00771             }
00772         }
00773       else
00774         {
00775           fprintf(stderr,
00776                   "%s DFU: unhandled adding a route entry?\n", __FILE__);
00777           abort();
00778         }
00779       
00780       if (trigger_update)
00781         {
00782           prte = table_->GetEntry (rte.dst);
00783           assert(prte != NULL && prte->advertise_ok_at == rte.advertise_ok_at);
00784           needTriggeredUpdate(prte, prte->advertise_ok_at);
00785         }
00786 
00787       // see if we can send off any packets we've got queued
00788       if (rte.q && rte.metric != BIG)
00789         {
00790           Packet *queued_p;
00791           while ((queued_p = rte.q->deque()))
00792           // XXX possible loop here  
00793           // while ((queued_p = rte.q->deque()))
00794           // Only retry once to avoid looping
00795           // for (int jj = 0; jj < rte.q->length(); jj++){
00796           //  queued_p = rte.q->deque();
00797             recv(queued_p, 0); // give the packets to ourselves to forward
00798           // }
00799           delete rte.q;
00800           rte.q = 0;
00801           table_->AddEntry(rte); // record the now zero'd queue
00802         }
00803     } // end of all destination mentioned in routing update packet
00804 
00805   // Reschedule the timeout for this neighbor
00806   prte = table_->GetEntry(Address::instance().get_nodeaddr(iph->saddr()));
00807   if (prte)
00808     {
00809       if (prte->timeout_event)
00810         s.cancel (prte->timeout_event);
00811       else
00812         {
00813           prte->timeout_event = new Event ();
00814         }
00815       
00816       s.schedule (helper_, prte->timeout_event, min_update_periods_ * perup_);
00817     }
00818   else
00819     { // If the first thing we hear from a node is a triggered update
00820       // that doesn't list the node sending the update as the first
00821       // thing in the packet (which is disrecommended by the paper)
00822       // we won't have a route to that node already.  In order to timeout
00823       // the routes we just learned, we need a harmless route to keep the
00824       // timeout metadata straight.
00825       
00826       // Hi there, nice to meet you. I'll make a fake advertisement
00827       bzero(&rte, sizeof(rte));
00828       rte.dst = Address::instance().get_nodeaddr(iph->saddr());
00829       rte.hop = Address::instance().get_nodeaddr(iph->saddr());
00830       rte.metric = 1;
00831       rte.seqnum = 0;
00832       rte.advertise_ok_at = now + 604800;       // check back next week... :)
00833       
00834       rte.changed_at = now;
00835       rte.new_seqnum_at = now;
00836       rte.wst = wst0_;
00837       rte.timeout_event = new Event ();
00838       rte.q = 0;
00839       
00840       updateRoute(NULL, &rte);
00841       s.schedule(helper_, rte.timeout_event, min_update_periods_ * perup_);
00842     }
00843   
00844   /*
00845    * Freeing a routing layer packet --> don't need to
00846    * call drop here.
00847    */
00848   Packet::free (p);
00849 
00850 }

Here is the call graph for this function:

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 DSDV_Agent::recv Packet ,
Handler
[protected, virtual]
 

Reimplemented from Agent.

Definition at line 1000 of file dsdv.cc.

References hdr_ip::dport(), Connector::drop(), DROP_RTR_ROUTE_LOOP, DROP_RTR_TTL, forwardPacket(), Address::get_nodeaddr(), HDR_CMN, HDR_IP, Address::instance(), IP_BROADCAST, IP_DEF_TTL, IP_HDR_LEN, myaddr_, hdr_cmn::next_hop(), hdr_cmn::num_forwards(), port_dmux_, processUpdate(), NsObject::recv(), ROUTER_PORT, hdr_ip::saddr(), sendOutBCastPkt(), hdr_cmn::size(), hdr_ip::ttl_, and u_int32_t.

Referenced by lost_link(), and processUpdate().

01001 {
01002   hdr_ip *iph = HDR_IP(p);
01003   hdr_cmn *cmh = HDR_CMN(p);
01004   int src = Address::instance().get_nodeaddr(iph->saddr());
01005   int dst = cmh->next_hop();
01006   /*
01007    *  Must be a packet I'm originating...
01008    */
01009   if(src == myaddr_ && cmh->num_forwards() == 0) {
01010     /*
01011      * Add the IP Header
01012      */
01013     cmh->size() += IP_HDR_LEN;    
01014     iph->ttl_ = IP_DEF_TTL;
01015   }
01016   /*
01017    *  I received a packet that I sent.  Probably
01018    *  a routing loop.
01019    */
01020   else if(src == myaddr_) {
01021     drop(p, DROP_RTR_ROUTE_LOOP);
01022     return;
01023   }
01024   /*
01025    *  Packet I'm forwarding...
01026    */
01027   else {
01028     /*
01029      *  Check the TTL.  If it is zero, then discard.
01030      */
01031     if(--iph->ttl_ == 0) {
01032       drop(p, DROP_RTR_TTL);
01033       return;
01034     }
01035   }
01036   
01037   if ((src != myaddr_) && (iph->dport() == ROUTER_PORT))
01038     {
01039             // XXX disable this feature for mobileIP where
01040             // the MH and FA (belonging to diff domains)
01041             // communicate with each other.
01042 
01043             // Drop pkt if rtg update from some other domain:
01044             // if (diff_subnet(iph->src())) 
01045             // drop(p, DROP_OUTSIDE_SUBNET);
01046             //else    
01047             processUpdate(p);
01048     }
01049   else if ((u_int32_t) dst == IP_BROADCAST && 
01050            (iph->dport() != ROUTER_PORT)) 
01051           {
01052              if (src == myaddr_) {
01053                      // handle brdcast pkt
01054                      sendOutBCastPkt(p);
01055              }
01056              else {
01057                      // hand it over to the port-demux
01058                     
01059                     port_dmux_->recv(p, (Handler*)0);
01060              }
01061           }
01062   else 
01063     {
01064             forwardPacket(p);
01065     }
01066 }

Here is the call graph for this function:

void Agent::recvBytes int  bytes  )  [protected, virtual, inherited]
 

Definition at line 354 of file agent.cc.

References Agent::app_, and Application::recv().

Referenced by DelAckSink::recv(), TcpSink::recv(), QSTcpSink::recv(), FullTcpAgent::recv(), and TcpAsymSink::recv().

00355 {
00356         if (app_)
00357                 app_->recv(nbytes);     
00358 }

Here is the call graph for this function:

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

Reimplemented from NsObject.

Definition at line 78 of file agent.h.

00078 {};

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 }

Packet* DSDV_Agent::rtable int   )  [protected]
 

virtual void Agent::send int  nbytes  )  [inline, virtual, inherited]
 

Reimplemented in SRMAgent.

Definition at line 89 of file agent.h.

References Agent::sendmsg().

00089 { sendmsg(nbytes); }

Here is the call graph for this function:

virtual void Agent::send int  sz,
AppData data
[inline, virtual, inherited]
 

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:

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

Reimplemented from Connector.

Definition at line 80 of file agent.h.

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

Referenced by TcpSink::ack(), QSTcpSink::ack(), SinkAgent::bcast_interest(), PingAgent::command(), MessageAgent::command(), mcastControlAgent::command(), LmsAgent::command(), LDPAgent::command(), SinkAgent::data_ready(), forwardPacket(), FullTcpAgent::foutput(), TcpAgent::output(), VegasTcpAgent::output(), RFC793eduTcpAgent::output(), QSNewRenoTcpAgent::output(), IntTcpAgent::output(), BayFullTcpAgent::output(), AbsTcpAgent::output(), AbsDelAckSink::recv(), AbsTcpSink::recv(), SRAgent::recv(), PingAgent::recv(), NatAgent::recv(), MIPBSAgent::recv(), Encapsulator::recv(), Decapsulator::recv(), MIPMHAgent::reg(), HttpInvalAgent::send(), GAFAgent::send_discovery(), RapAgent::SendAck(), SimpleTcpAgent::sendmsg(), PushbackAgent::sendMsg(), FullTcpAgent::sendpacket(), BayFullTcpAgent::sendpacket(), RapAgent::SendPacket(), TfrcAgent::sendpkt(), TfrcSinkAgent::sendpkt(), SinkAgent::sendpkt(), IcmpAgent::sendredirect(), and AbsDelAckSink::timeout().

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

Here is the call graph for this function:

void Agent::sendmsg int  nbytes,
const char *  flags = 0
[virtual, inherited]
 

Reimplemented in SA_Agent, RTPAgent, UdpAgent, LmsSender, SRMAgent, FullTcpAgent, TcpAgent, TfrcAgent, and SimpleTcpAgent.

Definition at line 415 of file agent.cc.

00416 {
00417 }

void Agent::sendmsg int  sz,
AppData ,
const char *  flags = 0
[virtual, inherited]
 

Reimplemented in UdpAgent.

Definition at line 400 of file agent.cc.

References abort().

Referenced by Agent::command(), Application::send(), Agent::send(), TrafficTrace::timeout(), TelnetApp::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:

void DSDV_Agent::sendOutBCastPkt Packet p  )  [protected]
 

Definition at line 991 of file dsdv.cc.

References be_random_, DSDV_BROADCAST_JITTER, Scheduler::instance(), jitter(), Scheduler::schedule(), and Connector::target_.

Referenced by recv().

00992 {
00993   Scheduler & s = Scheduler::instance ();
00994   // send out bcast pkt with jitter to avoid sync
00995   s.schedule (target_, p, jitter(DSDV_BROADCAST_JITTER, be_random_));
00996 }

Here is the call graph for this function:

virtual void Agent::sendto int  nbytes,
const char *  flags,
nsaddr_t  dst
[virtual, inherited]
 

void Agent::sendto int  sz,
AppData ,
const char *  flags,
nsaddr_t  dst
[virtual, inherited]
 

Definition at line 407 of file agent.cc.

References abort().

Referenced by Agent::command().

00409 {
00410         fprintf(stderr, 
00411         "Agent::sendmsg(int, AppData*, const char*) not implemented\n");
00412         abort();
00413 }

Here is the call graph for this function:

void Agent::set_pkttype packet_t  pkttype  )  [inline, inherited]
 

Definition at line 100 of file agent.h.

References Agent::type_.

Referenced by Agent::command(), HttpUInvalClass::create(), RA_Traffic::init(), POO_Traffic::init(), EXPOO_Traffic::init(), CBR_Traffic::init(), and CBR_PP_Traffic::init().

00100 { type_ = pkttype; }

virtual int& Agent::size  )  [inline, virtual, inherited]
 

Reimplemented in FullTcpAgent.

Definition at line 95 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(), and TelnetApp::timeout().

00095 { return size_; }

void DSDV_Agent::startUp  )  [protected]
 

Definition at line 1106 of file dsdv.cc.

References address, rtable_ent::advert_metric, rtable_ent::advert_seqnum, rtable_ent::advertise_ok_at, be_random_, rtable_ent::changed_at, Scheduler::clock(), DSDV_STARTUP_JITTER, rtable_ent::dst, Address::get_subnetaddr(), helper_, rtable_ent::hop, Address::instance(), Scheduler::instance(), jitter(), rtable_ent::metric, myaddr_, rtable_ent::new_seqnum_at, periodic_callback_, Address::print_nodeaddr(), rtable_ent::q, Scheduler::schedule(), seqno_, rtable_ent::seqnum, subnet_, table_, Time, rtable_ent::timeout_event, and rtable_ent::wst.

Referenced by command().

01107 {
01108  Time now = Scheduler::instance().clock();
01109 
01110   subnet_ = Address::instance().get_subnetaddr(myaddr_);
01111   //DEBUG
01112   address = Address::instance().print_nodeaddr(myaddr_);
01113   //printf("myaddress: %d -> %s\n",myaddr_,address);
01114   
01115   rtable_ent rte;
01116   bzero(&rte, sizeof(rte));
01117 
01118   rte.dst = myaddr_;
01119   rte.hop = myaddr_;
01120   rte.metric = 0;
01121   rte.seqnum = seqno_;
01122   seqno_ += 2;
01123 
01124   rte.advertise_ok_at = 0.0; // can always advert ourselves
01125   rte.advert_seqnum = true;
01126   rte.advert_metric = true;
01127   rte.changed_at = now;
01128   rte.new_seqnum_at = now;
01129   rte.wst = 0;
01130   rte.timeout_event = 0;                // Don't time out our localhost :)
01131   
01132   rte.q = 0;            // Don't buffer pkts for self!
01133   
01134   table_->AddEntry (rte);
01135 
01136   // kick off periodic advertisments
01137   periodic_callback_ = new Event ();
01138   Scheduler::instance ().schedule (helper_, 
01139                                    periodic_callback_,
01140                                    jitter (DSDV_STARTUP_JITTER, be_random_));
01141 }

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

void Agent::timeout int  tno  )  [virtual, inherited]
 

Reimplemented in SA_Agent, RTPAgent, FtpClientAgent, BayFullTcpAgent, SinkAgent, RLM_Sender, MIPBSAgent, MIPMHAgent, RapAgent, RTCPAgent, TcpAsymSink, FackTcpAgent, FullTcpAgent, QSNewRenoTcpAgent, RBPVegasTcpAgent, RBPRenoTcpAgent, SackRHTcpAgent, Sack1TcpAgent, TcpSessionAgent, DelAckSink, TcpAgent, RenoTcpAgent, VegasTcpAgent, and SimpleTcpAgent.

Definition at line 347 of file agent.cc.

Referenced by SimpleTimer::expire().

00348 {
00349 }

void Agent::trace TracedVar *  v  )  [protected, virtual, inherited]
 

Reimplemented in 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:

void DSDV_Agent::trace char *  fmt,
... 
[protected]
 

Definition at line 77 of file dsdv.cc.

References BaseTrace::buffer(), BaseTrace::dump(), Trace::pt_, and tracetarget.

Referenced by command(), forwardPacket(), helper_callback(), lost_link(), makeUpdate(), output_rte(), tracepkt(), and updateRoute().

00078 {
00079   va_list ap;
00080 
00081   if (!tracetarget)
00082     return;
00083 
00084   va_start (ap, fmt);
00085   vsprintf (tracetarget->pt_->buffer (), fmt, ap);
00086   tracetarget->pt_->dump ();
00087   va_end (ap);
00088 }

Here is the call graph for this function:

virtual void Agent::trace_event char *  eventtype  )  [inline, protected, virtual, inherited]
 

Reimplemented in TcpAgent.

Definition at line 146 of file agent.h.

00146 {}

void DSDV_Agent::tracepkt Packet ,
double  ,
int  ,
const char * 
[protected]
 

Definition at line 91 of file dsdv.cc.

References Packet::accessdata(), trace(), and verbose_.

Referenced by DSDVTriggerHandler::handle(), and helper_callback().

00092 {
00093   char buf[1024];
00094 
00095   unsigned char *walk = p->accessdata ();
00096 
00097   int ct = *(walk++);
00098   int seq, dst, met;
00099 
00100   snprintf (buf, 1024, "V%s %.5f _%d_ [%d]:", type, now, me, ct);
00101   while (ct--)
00102     {
00103       dst = *(walk++);
00104       dst = dst << 8 | *(walk++);
00105       dst = dst << 8 | *(walk++);
00106       dst = dst << 8 | *(walk++);
00107       met = *(walk++);
00108       seq = *(walk++);
00109       seq = seq << 8 | *(walk++);
00110       seq = seq << 8 | *(walk++);
00111       seq = seq << 8 | *(walk++);
00112       snprintf (buf, 1024, "%s (%d,%d,%d)", buf, dst, met, seq);
00113     }
00114   // Now do trigger handling.
00115   //trace("VTU %.5f %d", now, me);
00116   if (verbose_)
00117     trace ("%s", buf);
00118 }

Here is the call graph for this function:

void DSDV_Agent::updateRoute rtable_ent old_rte,
rtable_ent new_rte
[protected]
 

Definition at line 570 of file dsdv.cc.

References rtable_ent::advertise_ok_at, BIG, Scheduler::clock(), rtable_ent::dst, rtable_ent::hop, Scheduler::instance(), rtable_ent::metric, myaddr_, rtable_ent::seqnum, table_, Time, trace(), trace_wst_, verbose_, and rtable_ent::wst.

Referenced by processUpdate().

00571 {
00572   int negvalue = -1;
00573   assert(new_rte);
00574 
00575   Time now = Scheduler::instance().clock();
00576 
00577   char buf[1024];
00578   //  snprintf (buf, 1024, "%c %.5f _%d_ (%d,%d->%d,%d->%d,%d->%d,%lf)",
00579   snprintf (buf, 1024, "%c %.5f _%d_ (%d,%d->%d,%d->%d,%d->%d,%f)",
00580             (new_rte->metric != BIG 
00581              && (!old_rte || old_rte->metric != BIG)) ? 'D' : 'U', 
00582             now, myaddr_, new_rte->dst, 
00583             old_rte ? old_rte->metric : negvalue, new_rte->metric, 
00584             old_rte ? old_rte->seqnum : negvalue,  new_rte->seqnum,
00585             old_rte ? old_rte->hop : -1,  new_rte->hop, 
00586             new_rte->advertise_ok_at);
00587 
00588   table_->AddEntry (*new_rte);
00589   //printf("(%d),Route table updated..\n",myaddr_);
00590   if (trace_wst_)
00591     trace ("VWST %.12lf frm %d to %d wst %.12lf nxthp %d [of %d]",
00592            now, myaddr_, new_rte->dst, new_rte->wst, new_rte->hop, 
00593            new_rte->metric);
00594   if (verbose_)
00595     trace ("VS%s", buf);
00596 }

Here is the call graph for this function:


Friends And Related Function Documentation

friend class DSDV_Helper [friend]
 

Definition at line 71 of file dsdv.h.

Referenced by DSDV_Agent().

friend class DSDVTriggerHandler [friend]
 

Definition at line 72 of file dsdv.h.

Referenced by DSDV_Agent().


Member Data Documentation

char* DSDV_Agent::address [protected]
 

Definition at line 117 of file dsdv.h.

Referenced by DSDV_Agent(), and startUp().

double DSDV_Agent::alpha_ [protected]
 

Definition at line 134 of file dsdv.h.

Referenced by DSDV_Agent(), and processUpdate().

Application* Agent::app_ [protected, inherited]
 

Reimplemented in BayFullTcpAgent.

Definition at line 134 of file agent.h.

Referenced by Agent::attachApp(), Agent::idle(), RapAgent::IpgTimeout(), UdpAgent::recv(), SimpleTcpAgent::recv(), RapAgent::recv(), HttpInvalAgent::recv(), Agent::recv(), and Agent::recvBytes().

int DSDV_Agent::be_random_ [protected]
 

Definition at line 123 of file dsdv.h.

Referenced by DSDV_Agent(), DSDVTriggerHandler::handle(), helper_callback(), sendOutBCastPkt(), and startUp().

Tcl_Channel Agent::channel_ [protected, inherited]
 

Definition at line 130 of file agent.h.

Referenced by Agent::addAgentTrace(), Agent::command(), Agent::flushAVar(), Agent::monitorAgentTrace(), TcpAsymSink::recv(), Agent::trace(), TcpAgent::traceAll(), TcpAsymAgent::traceAll(), TcpAgent::traceVar(), TcpSessionAgent::traceVar(), and TcpAsymAgent::traceVar().

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

int Agent::defttl_ [protected, inherited]
 

Definition at line 121 of file agent.h.

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

NsObject* Connector::drop_ [protected, inherited]
 

Definition at line 57 of file connector.h.

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

ns_addr_t Agent::dst_ [protected, inherited]
 

Reimplemented in AckRecons.

Definition at line 115 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().

EventTrace* Agent::et_ [protected, inherited]
 

Definition at line 145 of file agent.h.

Referenced by TcpAgent::command(), and TcpAgent::trace_event().

int Agent::fid_ [protected, inherited]
 

Definition at line 118 of file agent.h.

Referenced by Agent::delay_bind_dispatch(), AbsTcpAgent::flowid(), Agent::initpkt(), FullTcpAgent::recv(), CtrMcastEncap::recv(), AbsTcpAgent::send_batch(), Sack1TcpAgent::timeout(), and TcpAgent::trace_event().

int Agent::flags_ [protected, inherited]
 

Reimplemented in BayFullTcpAgent, RapAgent, and FullTcpAgent.

Definition at line 120 of file agent.h.

Referenced by Agent::delay_bind_dispatch().

DSDV_Helper* DSDV_Agent::helper_ [protected]
 

Definition at line 105 of file dsdv.h.

Referenced by DSDV_Agent(), DSDVTriggerHandler::handle(), helper_callback(), processUpdate(), and startUp().

ns_addr_t Agent::here_ [protected, inherited]
 

Definition at line 114 of file agent.h.

Referenced by Agent::addAgentTrace(), Agent::addr(), SinkAgent::bcast_interest(), SinkAgent::data_ready(), OmniMcastAgent::DataForSink(), FloodingAgent::DataForSink(), DiffusionAgent::DataForSink(), Agent::delay_bind_dispatch(), Agent::deleteAgentTrace(), DiffusionProb::ForwardData(), DiffusionProb::ForwardTxFailed(), DiffusionRate::FwdOriginal(), DiffusionProb::FwdPosReinf(), DiffusionRate::FwdSubsample(), OmniMcastAgent::GodForwardData(), Agent::initpkt(), OmniMcastAgent::MACprepare(), FloodingAgent::MACprepare(), DiffusionAgent::MACprepare(), Agent::monitorAgentTrace(), Agent::port(), OmniMcastAgent::prepare_message(), FloodingAgent::prepare_message(), DiffusionAgent::prepare_message(), SSMSRMAgent::recv(), PingAgent::recv(), NatAgent::recv(), DumbAgent::recv(), SinkAgent::sendpkt(), SinkAgent::set_addr(), SinkAgent::Terminate(), and Agent::trace().

double DSDV_Agent::lasttup_ [protected]
 

Definition at line 129 of file dsdv.h.

Referenced by DSDVTriggerHandler::handle(), and helper_callback().

PriQueue* DSDV_Agent::ll_queue [protected]
 

Definition at line 108 of file dsdv.h.

Referenced by command(), and lost_link().

int DSDV_Agent::min_update_periods_ [protected]
 

Definition at line 137 of file dsdv.h.

Referenced by DSDV_Agent(), and processUpdate().

int DSDV_Agent::myaddr_ [protected]
 

Definition at line 110 of file dsdv.h.

Referenced by command(), forwardPacket(), DSDVTriggerHandler::handle(), helper_callback(), lost_link(), makeUpdate(), processUpdate(), recv(), startUp(), and updateRoute().

double DSDV_Agent::next_tup [protected]
 

Definition at line 130 of file dsdv.h.

MobileNode* DSDV_Agent::node_ [protected]
 

Definition at line 115 of file dsdv.h.

Referenced by command(), and forwardPacket().

OldValue* Agent::oldValueList_ [protected, inherited]
 

Definition at line 132 of file agent.h.

Referenced by Agent::insertOldValue(), Agent::lookupOldValue(), and Agent::~Agent().

Event* DSDV_Agent::periodic_callback_ [protected]
 

Definition at line 120 of file dsdv.h.

Referenced by DSDVTriggerHandler::handle(), helper_callback(), processUpdate(), and startUp().

double DSDV_Agent::perup_ [protected]
 

Definition at line 136 of file dsdv.h.

Referenced by DSDV_Agent(), DSDVTriggerHandler::handle(), helper_callback(), and processUpdate().

NsObject* DSDV_Agent::port_dmux_ [protected]
 

Definition at line 118 of file dsdv.h.

Referenced by command(), and recv().

int Agent::prio_ [protected, inherited]
 

Definition at line 119 of file agent.h.

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

int DSDV_Agent::seqno_ [protected]
 

Definition at line 109 of file dsdv.h.

Referenced by makeUpdate(), and startUp().

int Agent::size_ [protected, inherited]
 

Reimplemented in SA_Agent, and AckRecons.

Definition at line 116 of file agent.h.

Referenced by AbsDelAckSink::AbsDelAckSink(), AbsTcpAgent::AbsTcpAgent(), AbsTcpRenoAckAgent::AbsTcpRenoAckAgent(), AbsTcpRenoDelAckAgent::AbsTcpRenoDelAckAgent(), AbsTcpSink::AbsTcpSink(), AbsTcpTahoeAckAgent::AbsTcpTahoeAckAgent(), AbsTcpTahoeDelAckAgent::AbsTcpTahoeDelAckAgent(), RTCPAgent::command(), LDPAgent::command(), SinkAgent::command(), IntTcpAgent::createTcpSession(), TfrcAgent::decrease_rate(), TcpAgent::delay_bind_dispatch(), TcpSink::delay_bind_dispatch(), FullTcpAgent::foutput(), DSRAgent::getRouteForPacket(), TfrcAgent::increase_rate(), TcpAgent::initial_window(), Agent::initpkt(), RapAgent::IpgTimeout(), IvsReceiver::IvsReceiver(), LmsAgent::LmsAgent(), LmsReceiver::LmsReceiver(), mcastControlAgent::mcastControlAgent(), MessageAgent::MessageAgent(), MIPBSAgent::MIPBSAgent(), MIPMHAgent::MIPMHAgent(), TfrcAgent::nextpkt(), IntTcpAgent::opencwnd(), PingAgent::PingAgent(), RapAgent::RapAgent(), TfrcAgent::recv(), TcpSessionAgent::recv(), NewRenoTcpAgent::recv(), TfrcAgent::reduce_rate_on_no_feedback(), RLM_Sender::RLM_Sender(), RTCPAgent::RTCPAgent(), RTPAgent::RTPAgent(), IntTcpAgent::rxmit_last(), LmsSender::send_lms_pkt(), TcpSessionAgent::send_much(), LmsReceiver::send_nak(), IntTcpAgent::send_one(), LmsReceiver::send_refresh(), UdpAgent::sendmsg(), TfrcAgent::sendmsg(), TcpAgent::sendmsg(), SRMAgent::sendmsg(), RTPAgent::sendmsg(), RapAgent::SendPacket(), TfrcAgent::sendpkt(), rtProtoDV::sendpkt(), SinkAgent::sendpkt(), SinkAgent::SinkAgent(), Agent::size(), TfrcAgent::slowstart(), TfrcAgent::start(), TfrcAgent::TfrcAgent(), TfrcSinkAgent::TfrcSinkAgent(), RTPAgent::timeout(), RTCPAgent::timeout(), and UdpAgent::UdpAgent().

char* DSDV_Agent::subnet_ [protected]
 

Definition at line 114 of file dsdv.h.

Referenced by diff_subnet(), and startUp().

RoutingTable* DSDV_Agent::table_ [protected]
 

Definition at line 107 of file dsdv.h.

Referenced by cancelTriggersBefore(), command(), DSDV_Agent(), forwardPacket(), DSDVTriggerHandler::handle(), helper_callback(), lost_link(), makeUpdate(), processUpdate(), startUp(), and updateRoute().

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(), forwardPacket(), SensorQueryAgent::generate_query(), DSDVTriggerHandler::handle(), AckRecons::handle(), DSRAgent::handlePacketReceipt(), helper_callback(), AODV::initialized(), 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(), 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().

int DSDV_Agent::trace_wst_ [protected]
 

Definition at line 126 of file dsdv.h.

Referenced by DSDV_Agent(), and updateRoute().

char* Agent::traceName_ [protected, inherited]
 

Definition at line 131 of file agent.h.

Referenced by Agent::addAgentTrace(), Agent::command(), Agent::deleteAgentTrace(), Agent::flushAVar(), Agent::monitorAgentTrace(), and Agent::trace().

Trace* DSDV_Agent::tracetarget [protected]
 

Definition at line 104 of file dsdv.h.

Referenced by command(), and trace().

DSDVTriggerHandler* DSDV_Agent::trigger_handler [protected]
 

Definition at line 106 of file dsdv.h.

Referenced by DSDV_Agent(), DSDVTriggerHandler::handle(), and needTriggeredUpdate().

packet_t Agent::type_ [protected, inherited]
 

Definition at line 117 of file agent.h.

Referenced by Agent::get_pkttype(), Agent::initpkt(), FullTcpAgent::listen(), BayFullTcpAgent::listen(), RapAgent::SendAck(), SRMAgent::sendmsg(), RapAgent::SendPacket(), and Agent::set_pkttype().

int Agent::uidcnt_ [static, protected, inherited]
 

Definition at line 68 of file agent.cc.

Referenced by imepAgent::handlerControlTimer(), imepAgent::handlerReXmitTimer(), Agent::initpkt(), imepAgent::sendAck(), imepAgent::sendBeacon(), toraAgent::sendCLR(), imepAgent::sendHello(), toraAgent::sendQRY(), DSRAgent::sendUnknownFlow(), toraAgent::sendUPD(), and DSRAgent::xmitFailed().

int DSDV_Agent::use_mac_ [protected]
 

Definition at line 124 of file dsdv.h.

Referenced by DSDV_Agent(), and lost_link().

int DSDV_Agent::verbose_ [protected]
 

Definition at line 125 of file dsdv.h.

Referenced by DSDV_Agent(), forwardPacket(), DSDVTriggerHandler::handle(), helper_callback(), lost_link(), makeUpdate(), tracepkt(), and updateRoute().

double DSDV_Agent::wst0_ [protected]
 

Definition at line 135 of file dsdv.h.

Referenced by DSDV_Agent(), forwardPacket(), and processUpdate().


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