[Nsnam-commits] ns-2/tmix tmixAgent.cc,1.1,1.2
Brought to you by:
heidemann,
tom_henderson
From: Tom H. <tom...@us...> - 2011-08-26 19:31:04
|
Update of /cvsroot/nsnam/ns-2/tmix In directory vz-cvs-3.sog:/tmp/cvs-serv19725/tmix Modified Files: tmixAgent.cc Log Message: - Updated Tmix URL - Modifications to allow the MSS to be set for each TCP agent according to the connection vector (if desired). - Fixes to TmixOneWayAgent::reset() to reset both sides (agent and sink) - Various small changes for code readability (keep lines at 80 columns or less) Index: tmixAgent.cc =================================================================== RCS file: /cvsroot/nsnam/ns-2/tmix/tmixAgent.cc,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** tmixAgent.cc 2 Apr 2010 19:58:25 -0000 1.1 --- tmixAgent.cc 26 Aug 2011 19:31:01 -0000 1.2 *************** *** 34,40 **** * * Contact: Michele Weigle (mw...@cs...) ! * ! * For more information on Tmix and to obtain Tmix tools and ! * connection vectors, see http://netlab.cs.unc.edu/Tmix */ --- 34,38 ---- * * Contact: Michele Weigle (mw...@cs...) ! * http://www.cs.odu.edu/inets/Tmix */ *************** *** 47,54 **** - /******************************** - * OneWayAgent - ********************************/ - void TmixAgent::attachApp(Application * app) { agent->attachApp(app); --- 45,48 ---- *************** *** 56,60 **** } ! TmixOneWayAgent::TmixOneWayAgent(Tmix * t, char* tcptype, char* sinktype) : TmixAgent(t) { // Setup required configuration which is generally done in setup_connection Tcl& tcl = Tcl::instance(); --- 50,59 ---- } ! /******************************** ! * OneWayAgent ! ********************************/ ! ! TmixOneWayAgent::TmixOneWayAgent(Tmix * t, char* tcptype, char* sinktype) : ! TmixAgent(t) { // Setup required configuration which is generally done in setup_connection Tcl& tcl = Tcl::instance(); *************** *** 84,92 **** } ! void TmixOneWayAgent::configureTcp(Tmix* tmixInstance, int window) { Tcl& tcl = Tcl::instance(); ! tcl.evalf ("%s configure-source %s %d %d", tmixInstance->name(), agent->name(), ! tmixInstance->get_total(), window); tcl.evalf ("%s configure-sink %s", tmixInstance->name(), sink->name()); } --- 83,91 ---- } ! void TmixOneWayAgent::configureTcp(Tmix* tmixInstance, int window, int mss) { Tcl& tcl = Tcl::instance(); ! tcl.evalf ("%s configure-source %s %d %d %d", tmixInstance->name(), ! agent->name(), tmixInstance->get_total(), window, mss); tcl.evalf ("%s configure-sink %s", tmixInstance->name(), sink->name()); } *************** *** 97,100 **** --- 96,102 ---- a->reset(); } + if(TcpAgent* s = dynamic_cast<TcpAgent*>(sink)) { + s->reset(); + } } *************** *** 103,107 **** tcl.evalf ("set ns [Simulator instance]"); ! tcl.evalf ("$ns connect %s %s", name(), (dynamic_cast<TmixOneWayAgent*>(peer))->sinkName()); tcl.evalf("$ns connect %s %s", peer->name(), this->sinkName()); } --- 105,110 ---- tcl.evalf ("set ns [Simulator instance]"); ! tcl.evalf ("$ns connect %s %s", name(), ! (dynamic_cast<TmixOneWayAgent*>(peer))->sinkName()); tcl.evalf("$ns connect %s %s", peer->name(), this->sinkName()); } *************** *** 125,129 **** } - // attachToNode void TmixFullAgent::attachToNode(Node * node) { Tcl& tcl = Tcl::instance(); --- 128,131 ---- *************** *** 133,141 **** } ! // configure tcp ! void TmixFullAgent::configureTcp(Tmix* tmixInstance, int window) { Tcl& tcl = Tcl::instance(); ! tcl.evalf ("%s setup-tcp %s %d %d", tmixInstance->name(), agent->name(), tmixInstance->get_total(), window); } --- 135,144 ---- } ! void TmixFullAgent::configureTcp(Tmix* tmixInstance, int window, int mss) { Tcl& tcl = Tcl::instance(); ! // note that for fulltcp init_mss == acc_mss ! tcl.evalf ("%s setup-tcp %s %d %d %d", tmixInstance->name(), agent->name(), ! tmixInstance->get_total(), window, mss); } |