ADC Class Reference

#include <adc.h>

Inheritance diagram for ADC:

NsObject TclObject Handler ACTO_ADC ACTP_ADC HB_ADC MS_ADC Param_ADC MSPK_ADC Collaboration diagram for ADC:

Collaboration graph
[legend]

Detailed Description

Definition at line 50 of file adc.h.

Public Member Functions

 ADC ()
virtual int admit_flow (int cl, double r, int b)=0
int command (int, const char *const *)
virtual void debug (const char *fmt,...)
virtual int delay_bind_dispatch (const char *varName, const char *localName, TclObject *tracer)
virtual void delay_bind_init_all ()
int isdebug () const
double peak_rate (int cl, double r, int b)
virtual void recv (Packet *p, const char *s)
void recv (Packet *, Handler *)
virtual void recvOnly (Packet *)
virtual void rej_action (int, double, int)
void setest (int cl, Estimator *est)
virtual void teardown_action (int, double, int)
char * type ()

Protected Member Functions

void handle (Event *)
virtual void reset ()

Protected Attributes

int backoff_
double bandwidth_
int debug_
int dobump_
int dst_
Estimatorest_ [CLASS]
int src_
Tcl_Channel tchan_
char * type_


Constructor & Destructor Documentation

ADC::ADC  ) 
 

Definition at line 49 of file adc.cc.

References backoff_, bandwidth_, dobump_, dst_, and src_.

00049          :bandwidth_(0), tchan_(0)
00050 {
00051     bind_bw("bandwidth_",&bandwidth_);
00052     bind_bool("backoff_",&backoff_);
00053     bind("src_", &src_);
00054     bind("dst_", &dst_);
00055     bind_bool("dobump_", &dobump_);
00056 }


Member Function Documentation

virtual int ADC::admit_flow int  cl,
double  r,
int  b
[pure virtual]
 

Implemented in ACTO_ADC, ACTP_ADC, HB_ADC, MS_ADC, and Param_ADC.

Referenced by SALink::recv().

int ADC::command int  ,
const char *const * 
[virtual]
 

Reimplemented from NsObject.

Definition at line 58 of file adc.cc.

References NsObject::command(), est_, setest(), Estimator::setmeasmod(), Estimator::start(), and tchan_.

00059 {
00060     
00061     Tcl& tcl = Tcl::instance();
00062     if (argc==2) {
00063         if (strcmp(argv[1],"start") ==0) {
00064             /* $adc start */
00065             est_[1]->start();
00066             return (TCL_OK);
00067         }
00068     } else if (argc==4) {
00069         if (strcmp(argv[1],"attach-measmod") == 0) {
00070             /* $adc attach-measmod $meas $cl */
00071             MeasureMod *meas_mod = (MeasureMod *)TclObject::lookup(argv[2]);
00072             if (meas_mod== 0) {
00073                 tcl.resultf("no measuremod found");
00074                 return(TCL_ERROR);
00075             }
00076             int cl=atoi(argv[3]);
00077             est_[cl]->setmeasmod(meas_mod);
00078             return(TCL_OK);
00079         } else if (strcmp(argv[1],"attach-est") == 0 ) {
00080             /* $adc attach-est $est $cl */
00081             Estimator *est_mod = (Estimator *)TclObject::lookup(argv[2]);
00082             if (est_mod== 0) {
00083                 tcl.resultf("no estmod found");
00084                 return(TCL_ERROR);
00085             }
00086             int cl=atoi(argv[3]);
00087             setest(cl,est_mod);
00088             return(TCL_OK);
00089         }
00090     }
00091     else if (argc == 3) {
00092         if (strcmp(argv[1], "attach") == 0) {
00093             int mode;
00094             const char* id = argv[2];
00095             tchan_ = Tcl_GetChannel(tcl.interp(), (char*)id, &mode);
00096             if (tchan_ == 0) {
00097                 tcl.resultf("ADC: trace: can't attach %s for writing", id);
00098                 return (TCL_ERROR);
00099             }
00100             return (TCL_OK);
00101             
00102         }
00103         if (strcmp(argv[1], "setbuf") == 0) {
00104             /* some sub classes actually do something here */
00105             return(TCL_OK);
00106         }
00107 
00108 
00109     }
00110     return (NsObject::command(argc,argv));
00111 }

Here is the call graph for this function:

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

Definition at line 102 of file object.cc.

References NsObject::debug_.

00103 {
00104     if (!debug_)
00105         return;
00106     va_list ap;
00107     va_start(ap, fmt);
00108     vprintf(fmt, ap);
00109 }

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

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

Definition at line 63 of file object.cc.

References NsObject::debug_.

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

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

void NsObject::delay_bind_init_all  )  [virtual, inherited]
 

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

Definition at line 57 of file object.cc.

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

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

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

double ADC::peak_rate int  cl,
double  r,
int  b
[inline]
 

Definition at line 60 of file adc.h.

References est_, and Estimator::period().

Referenced by HB_ADC::admit_flow(), ACTP_ADC::admit_flow(), ACTO_ADC::admit_flow(), MSPK_ADC::get_rate(), HB_ADC::rej_action(), ACTP_ADC::rej_action(), HB_ADC::teardown_action(), and ACTP_ADC::teardown_action().

00060 {return r+b/est_[cl]->period();}

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

Implements NsObject.

Definition at line 57 of file adc.h.

00057 {} 

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

virtual void ADC::rej_action int  ,
double  ,
int 
[inline, virtual]
 

Reimplemented in ACTP_ADC, HB_ADC, MS_ADC, and Param_ADC.

Definition at line 55 of file adc.h.

Referenced by SALink::recv().

00055 {}; 

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

Reimplemented in BayFullTcpAgent, HashClassifier, IvsSource, dsREDQueue, DiffusionRate, SinkAgent, DiffusionAgent, FloodingAgent, OmniMcastAgent, LinkDelay, CBQueue, DropTail, ErrorModel, PIQueue, Queue< T >, RedPDQueue, REDQueue, REMQueue, RIOQueue, Snoop, FackTcpAgent, FullTcpAgent, SackFullTcpAgent, RFC793eduTcpAgent, Sack1TcpAgent, TcpSink, DelAckSink, TcpAgent, VegasTcpAgent, toraAgent, Queue< T >, and XcpSink.

Definition at line 70 of file object.cc.

Referenced by NsObject::command().

00071 {
00072 }

void ADC::setest int  cl,
Estimator est
[inline]
 

Definition at line 58 of file adc.h.

References est_, Estimator::setactype(), and type_.

Referenced by command().

00058                                               {est_[cl]=est;
00059                          est_[cl]->setactype(type_);}

Here is the call graph for this function:

virtual void ADC::teardown_action int  ,
double  ,
int 
[inline, virtual]
 

Reimplemented in ACTO_ADC, ACTP_ADC, HB_ADC, and Param_ADC.

Definition at line 56 of file adc.h.

00056 {}; 

char* ADC::type  )  [inline]
 

Definition at line 61 of file adc.h.

References type_.

Referenced by SALink::command(), and SALink::trace().

00061 {return type_;}


Field Documentation

int ADC::backoff_ [protected]
 

Definition at line 69 of file adc.h.

Referenced by ADC(), HB_ADC::admit_flow(), ACTP_ADC::admit_flow(), and ACTO_ADC::admit_flow().

double ADC::bandwidth_ [protected]
 

Definition at line 64 of file adc.h.

Referenced by ADC(), Param_ADC::admit_flow(), MS_ADC::admit_flow(), HB_ADC::admit_flow(), ACTP_ADC::admit_flow(), and ACTO_ADC::admit_flow().

int NsObject::debug_ [protected, inherited]
 

Reimplemented in FECModel, FloodAgent, and LandmarkAgent.

Definition at line 66 of file object.h.

Referenced by REDQueue::command(), RedPDQueue::command(), PushbackQueue::command(), NsObject::debug(), NsObject::delay_bind_dispatch(), PushbackQueue::enque(), NsObject::isdebug(), NsObject::NsObject(), TfrcAgent::recv(), PushbackQueue::reportDrop(), SctpAgent::Reset(), REDQueue::reset(), DropTail::shrink_queue(), and Delayer::try_send().

int ADC::dobump_ [protected]
 

Definition at line 70 of file adc.h.

Referenced by ADC(), ACTP_ADC::admit_flow(), and ACTO_ADC::admit_flow().

int ADC::dst_ [protected]
 

Definition at line 68 of file adc.h.

Referenced by ADC(), and Param_ADC::trace().

Estimator* ADC::est_[CLASS] [protected]
 

Definition at line 63 of file adc.h.

Referenced by MS_ADC::admit_flow(), HB_ADC::admit_flow(), ACTP_ADC::admit_flow(), ACTO_ADC::admit_flow(), command(), peak_rate(), MS_ADC::rej_action(), and setest().

int ADC::src_ [protected]
 

Definition at line 67 of file adc.h.

Referenced by ADC(), and Param_ADC::trace().

Tcl_Channel ADC::tchan_ [protected]
 

Definition at line 66 of file adc.h.

Referenced by command(), and Param_ADC::trace().

char* ADC::type_ [protected]
 

Definition at line 65 of file adc.h.

Referenced by ACTO_ADC::ACTO_ADC(), ACTP_ADC::ACTP_ADC(), HB_ADC::HB_ADC(), MS_ADC::MS_ADC(), Param_ADC::Param_ADC(), setest(), Param_ADC::trace(), and type().


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