⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 print2.ps

📁 obs网络试验平台
💻 PS
📖 第 1 页 / 共 5 页
字号:
(        /*) N(         * $iagent dumpburstdefaults) N(         */) N(        if\( strcmp\( argv[1], "dumpburstdefaults" \) == 0 \) {) N(            char s[100];) N(            sprintf\( s, "maxburstsize: %d", BurstManager::maxburstsize\(\) \);) N(            Debug::debug\( s \);) N(            sprintf\( s, "pcntguard: %d", BurstManager::pcntguard\(\) \);) N(            Debug::debug\( s \);) N(            sprintf\( s, "burst-time-out: %lf", BurstManager::burst_timeout\(\) \);) N(            Debug::debug\( s \);) N(            sprintf\( s, "offset-time: %lf", BurstManager::offsettime\(\) \);) N(            Debug::debug\( s \);) N(            sprintf\( s, "delta: %lf", BurstManager::delta\(\) \);) N(            Debug::debug\( s \);) N(            return \(TCL_OK\);) N(        }) N(    }) N(    else if \( argc == 3 \) {) N(        /*) N(         * $iagent initiagent $numEdgenodes) N(         */) N(        if\(strcasecmp\(argv[1],"initiagent"\) == 0 \) {) N(            maxindx_ = atoi\(argv[2]\);) N(            BM_ = new BurstManager[maxindx_];) N() N(            for \( int i = 0; i < maxindx_ ; i++ \)) N(                BM_[i].init\(this,i\);) N(            return\(TCL_OK\);) N(        }) N(    }) N() N(    return\(Agent::command\(argc, argv\)\);) N(}) N() N(// Expire event in the burst timer) N(void BurstTimer::expire\(Event* e\)) N({) N(    bm_->timeout\(\);) N(}) N() N(// Definition of the IPKT header class) N(static class IPKTHeaderClass :  public PacketHeaderClass) N({) N(    public:) N() N(stdin) (Page 12/30) (Feb 21, 04 14:03) titlebordergrestore(Printed by U-GMGPC2\\Geoffrey M. Garner) rhead(stdin) (6/15) (Saturday February 21, 2004) footerend % of iso1dictpagesave restoreshowpage%%Page: (13-14) 7%%BeginPageSetup/pagesave save defsh 0 translate 90 rotate%%EndPageSetupiso1dict begingsavellx lly 12 add translate/v 0 store/x0 x v get 3.362408 add sx cw mul add store/y0 y v get bfs th add sub storex0 y0 moveto(integrated_agent.cc) K(  Feb 20 15:49 2004                      Page:   9) p n() N(        IPKTHeaderClass\(\) : PacketHeaderClass\("PacketHeader/IPKT",) N(            sizeof\(hdr_IPKT\)\)) N() N(    {) N(        bind_offset\(&hdr_IPKT::offset_ipkt_\);) N(    }) N(}class_IPKThdr;) N() N(// Defintion of the IPKT Class) N(static class IPKTClass : public TclClass) N({) N(public:) N(    IPKTClass\(\) :  TclClass\("Agent/IPKT"\){}) N(    TclObject * create \(int, const char*const*\)    {) N(        return \( new IPKTAgent \);) N(    }) N(}class_IPKT;) N() N(/*=====================================================================*) N( *                                                                     *) N( *           Implementation of the Burst-Manager class                 *) N( *                                                                     *) N( *    Definition and Implementation of the Burst manager class.        *) N( *    derived from the TclClass so that a TCL interface \(or TCL        *) N( *    instantiation\) of the BurstManager is available.                 *) N( *    Note: the bind and method methods are overriden so as to         *) N( *    provide tcl access to the static variables.                      *) N( *    ref section 3.0 of the ns-2 manual on more details               *) N( *                                                                     *) N( *=====================================================================*/) N(static class BurstManagerClass : public TclClass) N({) N(    public:) N(    BurstManagerClass\(\) : TclClass\( "BurstManager" \) {}) N(    TclObject *create\( int, const char*const* \) {) N(        return \( new BurstManager \);) N(    }) N() N(    virtual void bind\(\);) N(    virtual int  method\( int argc, const char*const* argv \);) S 64 T () S 72 T () N(}class_burstmanagerclass;) N() N(// bind) N(void BurstManagerClass::bind\(\) {) N() S 8 T () S 16 T (TclClass::bind\(\);) N(  ) S 8 T (add_method\( "maxburstsize" \);) N() N(    add_method\( "pcntguard" \);) N(    add_method\( "offsettime" \);) N(    add_method\( "delta" \);) N(    add_method\( "bursttimeout" \);) N() N(}) N() N(// method) N(int BurstManagerClass::method\( int ac, const char*const* av \) {) N() N(stdin) (Page 13/30) (Feb 21, 04 14:03) titleborder/v 1 store/x0 x v get 3.362408 add sx cw mul add store/y0 y v get bfs th add sub storex0 y0 moveto(integrated_agent.cc) K(  Feb 20 15:49 2004                      Page:  10) p n() N() S 8 T (  Tcl& tcl = Tcl::instance\(\);) N() N(    int argc = ac-2;) N(    const char*const* argv = av + 2;) N() N(    if\( argc == 2 \) {) N(        if\( strcmp\( argv[1], "maxburstsize" \) == 0 \) {) N() S 8 T () S 16 T (    tcl.resultf\( "%d", BurstManager::maxburstsize\(\) \);) N(       ) S 8 T () S 16 T (return \(TCL_OK\);) S 40 T () N(        } else if\( strcmp\( argv[1], "pcntguard" \) == 0 \) {) N(            tcl.resultf\( "%d", BurstManager::pcntguard\(\) \);) N(            return \(TCL_OK\);) N(        } else if\( strcmp\( argv[1], "offsettime" \) == 0 \) {) N(            tcl.resultf\( "%lf", BurstManager::offsettime\(\) \);) N(            return \(TCL_OK\);) N(        } else if\( strcmp\( argv[1], "delta" \) == 0 \) {) N(            tcl.resultf\( "%lf", BurstManager::delta\(\) \);) N(            return \(TCL_OK\);) N(        } else if\( strcmp\( argv[1], "bursttimeout" \) == 0 \) {) N(            tcl.resultf\( "%lf", BurstManager::burst_timeout\(\) \);) N(            return \(TCL_OK\);) N(        }) N(    } else if\( argc == 3 \) {) N(        if\( strcmp\( argv[1], "maxburstsize" \) == 0 \) {) N(            BurstManager::setMaxburstsize\( atoi\( argv[2] \) \);) N(            return \(TCL_OK\);) N(        } else if\( strcmp\( argv[1], "pcntguard" \) == 0 \) {) N(            BurstManager::setPcntguard\( atoi\( argv[2] \) \);) N(            return \(TCL_OK\);) N(        } else if\( strcmp\( argv[1], "offsettime" \) == 0 \){) N(            BurstManager::offsettime\(\) = atof\( argv[2] \);) N(            return \(TCL_OK\);) N(        } else if\( strcmp\( argv[1], "delta" \) == 0 \) {) N(            BurstManager::setDelta\( atof\( argv[2] \) \);) N(            return \(TCL_OK\);) N(        } else if\( strcmp\( argv[1], "bursttimeout" \) == 0 \) {) N(            BurstManager::setBursttimeout\( atof\( argv[2] \) \);) N(            return \(TCL_OK\);) N(        }       ) S 24 T (    ) S 32 T () S 40 T () S 48 T () S 56 T () N() N(    }) N(    return TclClass::method\( ac, av \);) N(}) N() N() N() N() N() N() N() N() N() N() N() N() N() N() N(stdin) (Page 14/30) (Feb 21, 04 14:03) titlebordergrestore(Printed by U-GMGPC2\\Geoffrey M. Garner) rhead(stdin) (7/15) (Saturday February 21, 2004) footerend % of iso1dictpagesave restoreshowpage%%Page: (15-16) 8%%BeginPageSetup/pagesave save defsh 0 translate 90 rotate%%EndPageSetupiso1dict begingsavellx lly 12 add translate/v 0 store/x0 x v get 3.362408 add sx cw mul add store/y0 y v get bfs th add sub storex0 y0 moveto(integrated_agent.cc) K(  Feb 20 15:49 2004                      Page:  11) p n() N() N() N() N() N() N() N() N() N() N() N() N() N() N(stdin) (Page 15/30) (Feb 21, 04 14:03) titleborder/v 1 store/x0 x v get 3.362408 add sx cw mul add store/y0 y v get bfs th add sub storex0 y0 moveto(common/stat-collector.cc) K(  Feb 20 15:46 2004                 Page:  12) p n() N(/* Copyright \(c\) University of Maryland, Baltimore County, 2003.) N( * Original Authors: Ramakrishna Shenai, Sunil Gowda and Krishna Sivalingam.) N( *) N( * This software is developed at the University of Maryland, Baltimore County un) N(der) N( * grants from Cisco Systems Inc and the University of Maryland, Baltimore Count) N(y.) N( *) N( * Permission to use, copy, modify, and distribute this software and its) N( * documentation in source and binary forms for non-commercial purposes) N( * and without fee is hereby granted, provided that the above copyright) N( * notice appear in all copies and that both the copyright notice and) N( * this permission notice appear in supporting documentation. and that) N( * any documentation, advertising materials, and other materials related) N( * to such distribution and use acknowledge that the software was) N( * developed by the University of Maryland, Baltimore County.  The name of) N( * the University may not be used to endorse or promote products derived from) N( * this software without specific prior written permission.) N( *) N( * Copyright \(C\) 2000-2003 Washington State University. All rights reserved.) N( * This software was originally developed at Alcatel USA and subsequently modifi) N(ed) N( * at Washington State University, Pullman, WA  through research work which was) N( * supported by Alcatel USA, Inc and Cisco Systems Inc.) N() N( * The  following notice is in adherence to the Washington State University) N( * copyright policy follows.) N( *) N( * License is granted to copy, to use, and to make and to use derivative) N( * works for research and evaluation purposes, provided that Washington) N( * State University is acknowledged in all documentation pertaining to any such) N( * copy or derivative work. Washington State University grants no other) N( * licenses expressed or implied. The Washington State University name) N( * should not be used in any advertising without its written permission.) N( *) N( * WASHINGTON STATE UNIVERSITY MAKES NO REPRESENTATIONS CONCERNING EITHER) N( * THE MERCHANTABILITY OF THIS SOFTWARE OR THE SUITABILITY OF THIS SOFTWARE) N( * FOR ANY PARTICULAR PURPOSE.  The software is provided "as is") N( *  without express or implied warranty of any kind. These notices must) N( * be retained in any copies of any part of this software.) N( */) N() N(#include "stat-collector.h") N() N(StatCollector *StatCollector::instance__ =  NULL;) N(map<string, StatEntry> StatEntry::mapList__;) N(/* Base info list is essentially a string representation of the) N( * 11 base statistics */) N(// string StatEntry::baseInfoList[12]  = {) N(//    "TCPSND", "TCPRCV", "BURSTSND", "BURSTDROP", "BURSTRCV", "BHPDROP",) N(//    "BHPSND", "BHPRCV", "TCPDROP", "ACKDROP", "PERFLOW", "OTHER") N(// };) N(// GMG -- New statistics added) N(/* Base info list is essentially a string representation of the) N( * 14 base statistics */) N(string StatEntry::baseInfoList[44]  = {) N( "TCPSND", "TCPBYTESSND", "TCPRCV", "TCPBYTESRCV", "TCPDLY", "BURSTSND",) N( "BURSTDROP", "BURSTRCV", "BHPDROP", "BHPSND", "BHPRCV", "TCPDROP",) N() N(stdin) (Page 16/30) (Feb 21, 04 14:03) titlebordergrestore(Printed by U-GMGPC2\\Geoffrey M. Garner) rhead(stdin) (8/15) (Saturday February 21, 2004) footerend % of iso1dictpagesave restoreshowpage%%Page: (17-18) 9%%BeginPageSetup/pagesave save defsh 0 translate 90 rotate%%EndPageSetupiso1dict begingsavellx lly 12 add translate/v 0 store/x0 x v get 3.362408 add sx cw mul add store/y0 y v get bfs th add sub storex0 y0 moveto(common/stat-collector.cc) K(  Feb 20 15:46 2004                 Page:  13) p n() N( "ACKDROP", "PERFLOW", "UDPSND", "UDPBYTESSND", "UDPRCV", "UDPBYTESRCV",) N( "UDPDLY", "ACKSND", "ACKRCV",) N( "CBRSND", "CBRBYTESSND", "CBRRCV", "CBRBYTESRCV", "CBRDLY",) N( "EXPSND", "EXPBYTESSND", "EXPRCV", "EXPBYTESRCV", "EXPDLY",) N( "PARSND", "PARBYTESSND", "PARRCV", "PARBYTESRCV", "PARDLY",) N( "SSIMSND", "SSIMBYTESSND", "SSIMRCV", "SSIMBYTESRCV", "SSIMDLY",) N( "BURSTDLY", "BHPDLY",) N( "OTHER") N(};) N() N() N(/* Add an Entry to the list of entries maintained */) N(bool StatEntry::addStatEntry\( StatEntry se \) {) N(    mapList__[se.infoStr\(\)] = se;) N(    return true;) N(}) N() N(/* Add an Entry to the list of entries maintained */) N(bool StatEntry::addStatEntry\( statType st, string s, double value \) {) N(    StatEntry se\( st, s, value \);) N(    return \( addStatEntry\( se \) \);) N(}) N() N(/* Add an Entry to the list of entries maintained */) N(bool StatEntry::addStatEntry\( string s, double value \) {) N(    return \( addStatEntry\( OTHER, s, value \) \);) N(}) N() N(/* Get the stat entry correspondign to key Str */) N(StatEntry& StatEntry::getStatEntry\( string keyStr \) {) N(    map<string, StatEntry>::iterator result = mapList__.find\( keyStr \);) N(    return \(*result\).second;) N(}) N() N( /* Diagnostic display -content method */) N(void StatEntry::displayEntry\( StatEntry se \) {) N(    char s[100];) N() N(//GMG -- added switch/case so that, for TCPDLY, average delay over all tcp pkts ) N(can) N(//       be calculated; must divide by total number of TCP pkts; note - ACKs not) N(//       included) N(    double pktrcv1;) N() N(    switch \(se.type\(\) \)) N(    {) N(       case TCPDLY:) N(          pktrcv1 = StatEntry::getStatEntry\("TCPRCV"\).value\(\);) N(          sprintf\( s, "Type: %d Str: %s Value: %lf ", se.type\(\),) N(                        se.infoStr\(\).c_str\(\),) N(                        \(pktrcv1 != 0.0 ? se.value\(\)/pktrcv1 : 0.0\)  \);) N(          break;) N() N(       case UDPDLY:) N(          pktrcv1 = StatEntry::getStatEntry\("UDPRCV"\).value\(\);) N(          sprintf\( s, "Type: %d Str: %s Value: %lf ", se.type\(\),) N(                        se.infoStr\(\).c_str\(\),) N() N(stdin) (Page 17/30) (Feb 21, 04 14:03) titleborder/v 1 store/x0 x v get 3.362408 add sx cw mul add store/y0 y v get bfs th add sub storex0 y0 moveto(common/stat-collector.cc) K(  Feb 20 15:46 2004                 Page:  14) p n() N(                        \(pktrcv1 != 0.0 ? se.value\(\)/pktrcv1 : 0.0\)  \);) N(          break;) N() N(       case CBRDLY:) N(          pktrcv1 = StatEntry::getStatEntry\("CBRRCV"\).value\(\);) N(          sprintf\( s, "Type: %d Str: %s Value: %lf ", se.type\(\),) N(                        se.infoStr\(\).c_str\(\),) N(                        \(pktrcv1 != 0.0 ? se.value\(\)/pktrcv1 : 0.0\)  \);) N(          break;) N() N(       case EXPDLY:) N(          pktrcv1 = StatEntry::getStatEntry\("EXPRCV"\).value\(\);) N(          sprintf\( s, "Type: %d Str: %s Value: %lf ", se.type\(\),) N(                        se.infoStr\(\).c_str\(\),) N(                        \(pktrcv1 != 0.0 ? se.value\(\)/pktrcv1 : 0.0\)  \);) N(          break;) N() N(       case PARDLY:) N(          pktrcv1 = StatEntry::getStatEntry\("PARRCV"\).value\(\);) N(          sprintf\( s, "Type: %d Str: %s Value: %lf ", se.type\(\),) N(                        se.infoStr\(\).c_str\(\),) N(                        \(pktrcv1 != 0.0 ? se.value\(\)/pktrcv1 : 0.0\)  \);) N(          break;) N() N

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -