INET Framework for OMNeT++/OMNEST
stpi.h File Reference
#include "MACAddress.h"
#include "macTable.h"
#include "STPBPDU_m.h"
#include "STPTCN_m.h"

Go to the source code of this file.

Classes

class  stpi
struct  stpi::tMsg
struct  stpi::tPortFlags
struct  stpi::tPort

Functions

std::ostream & operator<< (std::ostream &os, const stpi::tPortRole r)
std::ostream & operator<< (std::ostream &os, const stpi::tPortState s)
std::ostream & operator<< (std::ostream &os, const stpi::tPortFlags f)
std::ostream & operator<< (std::ostream &os, const stpi::tPort p)
std::ostream & operator<< (std::ostream &os, const stpi i)

Function Documentation

std::ostream& operator<< ( std::ostream &  os,
const stpi::tPortRole  r 
) [inline]

Definition at line 192 of file stpi.h.

                                                                     {

        switch (r){
        case stpi::RUNKNOWN:
                os << "Unkn";
                break;
        case stpi::RALTERNATE:
                os << "Altr";
                break;
        case stpi::RDESIGNATED:
                os << "Desg";
                break;
        case stpi::RROOT:
                os << "Root";
                break;
        default:
                os << "<?>";
                break;
        }

        return os;
}
std::ostream& operator<< ( std::ostream &  os,
const stpi::tPortState  s 
) [inline]

Definition at line 215 of file stpi.h.

                                                                      {

        switch (s){
        case stpi::SDISABLED:
                os << "---";
                break;
        case stpi::SDISCARDING:
                os << "DIS";
                break;
        case stpi::SLEARNING:
                os << "LRN";
                break;
        case stpi::SFORWARDING:
                os << "FWD";
                break;
        default:
                os << "<?>";
                break;
        }

        return os;
}
std::ostream& operator<< ( std::ostream &  os,
const stpi::tPortFlags  f 
) [inline]

Definition at line 238 of file stpi.h.

                                                                      {
        os << "[";
        if (f.Learning) {
                os << "L";
        } else {
                os << "_";
        }
        if (f.Forwarding) {
                os << "F";
        } else {
                os << "_";
        }
        os << "]";
        return os;
}
std::ostream& operator<< ( std::ostream &  os,
const stpi::tPort  p 
) [inline]

Definition at line 254 of file stpi.h.

                                                                 {
        /*
        if (p.enabled) {
                os << " + ";
        } else {
                os << " - ";
        }
        */



        os << p.flags  << " " << p.role << " " << p.state << " ";
        os << p.linkCost << " ";
        os <<  p.priority  << " ";
/*
        os << p.age << " ";
        os << p.fdWhile << " ";
*/
        /* DEBUG
          os << " "
           << p.rootPathCost << " " << p.priority << " :: ";

        os << p.rootPriority << "/" << p.rootID << ";"
           << p.bridgePriority << "/" << p.bridgeID << ";"
           << p.portPriority << "/" << p.portID ;
   */
        return os;
}
std::ostream& operator<< ( std::ostream &  os,
const stpi  i 
) [inline]

Definition at line 283 of file stpi.h.

                                                            {
        os << "VLAN " << i.vlan << " \n";

        //os << "TC:" << i.topologyChange << " TCN:" << i.topologyChangeNotification <<
        //      " TCR:" << i.topologyChangeRecvd << " \n";


        os << "RootID Priority: " << i.rootPriority << " \n";
        os << "  Address: " << i.rootID << " \n";
        if (i.isRoot) {
                os << "  This bridge is the Root. \n";
        } else {
                os << "  Cost: " << i.rootPathCost << " \n";
                os << "  Port: " << i.rootPort << " \n";
        }
        os << "  Hello Time: " << i.cHelloTime << " \n";
        os << "  Max Age: " << i.cMaxAge << " \n";
        os << "  Forward Delay: " << i.cFwdDelay << " \n";

        os << "BridgeID Priority: " << i.bridgePriority << "\n";
        os << "  Address: " << i.bridgeAddress << " \n";
        //os << "\n";
        os << "  Hello Time: " << i.helloTime << " \n";
        os << "  Max Age: " << i.maxAge << " \n";
        os << "  Forward Delay: " << i.fwdDelay << " \n";
        os << "Port Flag Role State Cost Priority \n";
        os << "-----------------------------------------\n";

        for (unsigned int x = 0; x < i.portCount; x++) {
                os << x << "  " << i.portTable.at(x) << " \n";
        }


        return os;
}