#include <salink.h>
Inheritance diagram for SALink:


Definition at line 53 of file salink.h.
Public Member Functions | |
| int | command (int argc, const char *const *argv) |
| virtual void | debug (const char *fmt,...) |
| virtual int | delay_bind_dispatch (const char *varName, const char *localName, TclObject *tracer) |
| virtual void | delay_bind_init_all () |
| virtual void | drop (Packet *p) |
| int | isdebug () const |
| virtual void | recv (Packet *p, const char *s) |
| virtual void | recvOnly (Packet *) |
| SALink () | |
| void | setDropTarget (NsObject *dt) |
| void | target (NsObject *target) |
| NsObject * | target () |
| void | trace (TracedVar *v) |
Protected Member Functions | |
| virtual void | drop (Packet *p, const char *s) |
| int | get_nxt () |
| void | handle (Event *) |
| int | lookup (int) |
| void | recv (Packet *, Handler *) |
| virtual void | reset () |
| void | send (Packet *p, Handler *h) |
Protected Attributes | |
| ADC * | adc_ |
| int | debug_ |
| NsObject * | drop_ |
| int | dst_ |
| int | last_ |
| TracedInt | numfl_ |
| int | onumfl_ |
| pending | pending_ [NFLOWS] |
| int | RTT |
| int | src_ |
| NsObject * | target_ |
| Tcl_Channel | tchan_ |
|
|
Definition at line 59 of file salink.cc. References NFLOWS, pending_, and pending::status. 00059 : adc_(0), numfl_(-1), tchan_(0), onumfl_(0), last_(-1) 00060 { 00061 int i; 00062 for (i=0;i<NFLOWS;i++) { 00063 pending_[i].flowid=-1; 00064 pending_[i].status=0; 00065 } 00066 bind("src_", &src_); 00067 bind("dst_", &dst_); 00068 00069 numfl_.tracer(this); 00070 numfl_.name("\"Admitted Flows\""); 00071 }
|
|
||||||||||||
|
Reimplemented from Connector. Definition at line 143 of file salink.cc. References adc_, Connector::command(), dst_, numfl_, src_, tchan_, and ADC::type(). 00144 { 00145 Tcl& tcl = Tcl::instance(); 00146 char wrk[500]; 00147 00148 if (argc ==3) { 00149 if (strcmp(argv[1],"attach-adc") == 0 ) { 00150 adc_=(ADC *)TclObject::lookup(argv[2]); 00151 if (adc_ ==0 ) { 00152 tcl.resultf("no such node %s", argv[2]); 00153 return(TCL_ERROR); 00154 } 00155 return(TCL_OK); 00156 } 00157 if (strcmp(argv[1], "attach") == 0) { 00158 int mode; 00159 const char* id = argv[2]; 00160 tchan_ = Tcl_GetChannel(tcl.interp(), (char*)id, &mode); 00161 if (tchan_ == 0) { 00162 tcl.resultf("SALink: trace: can't attach %s for writing", id); 00163 return (TCL_ERROR); 00164 } 00165 return (TCL_OK); 00166 } 00167 } 00168 if (argc == 2) { 00169 if (strcmp(argv[1], "add-trace") == 0) { 00170 if (tchan_) { 00171 sprintf(wrk, "a -t * -n %s:%d-%d -s %d", 00172 adc_->type(), src_, dst_, src_); 00173 int n = strlen(wrk); 00174 wrk[n] = '\n'; 00175 wrk[n+1] = 0; 00176 (void)Tcl_Write(tchan_, wrk, n+1); 00177 numfl_ = 0; 00178 } 00179 return (TCL_OK); 00180 } 00181 } 00182 return Connector::command(argc,argv); 00183 }
Here is the call graph for this function: ![]() |
|
||||||||||||
|
Definition at line 102 of file object.cc. References NsObject::debug_. 00103 { 00104 if (!debug_) 00105 return; 00106 va_list ap; 00107 va_start(ap, fmt); 00108 vprintf(fmt, ap); 00109 }
|
|
||||||||||||||||
|
Reimplemented in BayFullTcpAgent, Agent, MPLSAddressClassifier, LDPAgent, 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 }
|
|
|
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().
|
|
||||||||||||
|
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: ![]() |
|
|
|
Definition at line 194 of file salink.cc. References NFLOWS, and pending_. Referenced by recv(). 00195 { 00196 int i; 00197 for (i=0;i<NFLOWS;i++) 00198 { 00199 if (pending_[i].flowid==-1) 00200 return i; 00201 } 00202 printf("Ran out of pending space \n"); 00203 exit(1); 00204 return i; 00205 }
|
|
|
Implements Handler. Reimplemented in LinkDelay, LL, AckRecons, and Snoop. Definition at line 91 of file object.cc. References NsObject::recv().
Here is the call graph for this function: ![]() |
|
|
Definition at line 61 of file object.h. References NsObject::debug_. 00061 { return debug_; }
|
|
|
Definition at line 185 of file salink.cc. References NFLOWS, and pending_. Referenced by recv(). 00186 { 00187 int i; 00188 for (i=0;i<NFLOWS;i++) 00189 if (pending_[i].flowid==flowid) 00190 return i; 00191 return(-1); 00192 }
|
|
||||||||||||
|
Reimplemented in CMUTrace. Definition at line 96 of file object.cc. References Packet::free(). 00097 { 00098 Packet::free(p); 00099 }
Here is the call graph for this function: ![]() |
|
||||||||||||
|
Reimplemented from Connector. Definition at line 74 of file salink.cc. References hdr_resv::access(), hdr_ip::access(), hdr_cmn::access(), adc_, ADC::admit_flow(), hdr_resv::bucket(), Scheduler::clock(), hdr_resv::decision(), dst_, pending::flowid, hdr_ip::flowid(), get_nxt(), Scheduler::instance(), last_, lookup(), numfl_, pending_, PT_ACCEPT, PT_CONFIRM, PT_REJECT, PT_REQUEST, hdr_cmn::ptype(), hdr_resv::rate(), ADC::rej_action(), src_, and tchan_. 00075 { 00076 int decide; 00077 int j; 00078 00079 hdr_cmn *ch=hdr_cmn::access(p); 00080 hdr_ip *iph=hdr_ip::access(p); 00081 hdr_resv *rv=hdr_resv::access(p); 00082 00083 //CLEAN THIS UP 00084 int cl=(iph->flowid())?1:0; 00085 00086 switch(ch->ptype()) { 00087 case PT_REQUEST: 00088 decide=adc_->admit_flow(cl,rv->rate(),rv->bucket()); 00089 if (tchan_) 00090 if (last_ != decide) { 00091 int n; 00092 char wrk[50]; 00093 double t = Scheduler::instance().clock(); 00094 sprintf(wrk, "l -t %g -s %d -d %d -S COLOR -c %s", 00095 t, src_, dst_, decide ? "MediumBlue" : "red" ); 00096 n = strlen(wrk); 00097 wrk[n] = '\n'; 00098 wrk[n+1] = 0; 00099 (void)Tcl_Write(tchan_, wrk, n+1); 00100 last_ = decide; 00101 } 00102 //put decide in the packet 00103 rv->decision() &= decide; 00104 if (decide) { 00105 j=get_nxt(); 00106 pending_[j].flowid=iph->flowid(); 00107 //pending_[j].status=decide; 00108 numfl_++; 00109 } 00110 break; 00111 case PT_ACCEPT: 00112 case PT_REJECT: 00113 break; 00114 case PT_CONFIRM: 00115 { 00116 j=lookup(iph->flowid()); 00117 if (j!=-1) { 00118 if (!rv->decision()) { 00119 //decrease the avload for this class 00120 adc_->rej_action(cl,rv->rate(),rv->bucket()); 00121 numfl_--; 00122 } 00123 pending_[j].flowid=-1; 00124 } 00125 break; 00126 } 00127 case PT_TEARDOWN: 00128 { 00129 adc_->teardown_action(cl,rv->rate(),rv->bucket()); 00130 numfl_--; 00131 break; 00132 } 00133 default: 00134 #ifdef notdef 00135 error("unknown signalling message type : %d",ch->ptype()); 00136 abort(); 00137 #endif 00138 break; 00139 } 00140 send(p,h); 00141 }
Here is the call graph for this function: ![]() |
|
|
Reimplemented in Agent, and Trace. Definition at line 56 of file object.h. Referenced by Trace::recvOnly().
|
|
|
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().
|
|
||||||||||||
|
Reimplemented in Agent, and LinkDelay. Definition at line 56 of file connector.h. References NsObject::recv(), and Connector::target_. Referenced by SessionTTLChecker::recv(), TTLChecker::recv(), Trace::recv(), TraceIpMac::recv(), TraceIp::recv(), SnoopQueueEDrop::recv(), SnoopQueueTagger::recv(), SnoopQueueDrop::recv(), SnoopQueueOut::recv(), SnoopQueueIn::recv(), PktCounter::recv(), NetworkInterface::recv(), MeasureMod::recv(), Filter::recv(), Connector::recv(), CMUTrace::recv(), and AddSR::recv().
Here is the call graph for this function: ![]() |
|
|
Definition at line 51 of file connector.h. References Connector::drop_. Referenced by XCPWrapQ::command(). 00051 {drop_ = dt; }
|
|
|
Definition at line 49 of file connector.h. References Connector::target(), and Connector::target_.
Here is the call graph for this function: ![]() |
|
|
Definition at line 48 of file connector.h. References Connector::target_. Referenced by JoBS::assignRateDropsADC(), FQ::deque(), MIPMHAgent::reg(), MIPBSAgent::send_ads(), and Connector::target(). 00048 { return target_; }
|
|
|
Definition at line 207 of file salink.cc. References adc_, Scheduler::clock(), dst_, Scheduler::instance(), onumfl_, src_, tchan_, and ADC::type(). 00208 { 00209 00210 char wrk[500]; 00211 int *p, newval; 00212 00213 if (strcmp(v->name(), "\"Admitted Flows\"") == 0) { 00214 p = &onumfl_; 00215 } 00216 else { 00217 fprintf(stderr, "SALink: unknown trace var %s\n", v->name()); 00218 return; 00219 } 00220 00221 newval = int(*((TracedInt*)v)); 00222 00223 if (tchan_) { 00224 int n; 00225 double t = Scheduler::instance().clock(); 00226 /* f -t 0.0 -s 1 -a SA -T v -n Num -v 0 -o 0 */ 00227 sprintf(wrk, "f -t %g -s %d -a %s:%d-%d -T v -n %s -v %d -o %d", 00228 t, src_, adc_->type(), src_, dst_, v->name(), newval, *p); 00229 n = strlen(wrk); 00230 wrk[n] = '\n'; 00231 wrk[n+1] = 0; 00232 (void)Tcl_Write(tchan_, wrk, n+1); 00233 00234 } 00235 00236 *p = newval; 00237 00238 return; 00239 }
Here is the call graph for this function: ![]() |
|
|
|
|
|
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(). |
|
|
Definition at line 59 of file connector.h. Referenced by XCPWrapQ::command(), Connector::command(), Connector::drop(), ErrorModel::recv(), and Connector::setDropTarget(). |
|
|
|
|
|
Definition at line 71 of file salink.h. Referenced by recv(). |
|
|
|
|
|
Definition at line 68 of file salink.h. Referenced by trace(). |
|
|
|
|
|
|
|
|
|
|
|
|
|
1.4.6