INET Framework for OMNeT++/OMNEST
ansaOspfRouter6.h File Reference
#include "IPAddress.h"
#include "ansaMessageHandler6.h"
#include "ansaOspfArea6.h"
#include "ansaOspfCommon6.h"
#include "ansaOspfStat6.h"

Go to the source code of this file.

Classes

class  AnsaOspf6::Router

Namespaces

namespace  AnsaOspf6

Functions

std::ostream & operator<< (std::ostream &os, AnsaOspf6::Router &r)

Function Documentation

std::ostream& operator<< ( std::ostream &  os,
AnsaOspf6::Router r 
) [inline]

Definition at line 91 of file ansaOspfRouter6.h.

                                                                 {
   // TODO: sem přijde zhruba obsah metody add watches
   // ale taky bych mohl prozkoumat, jak funguje to rozklikávání do dalších
   // oken jako je třeba v modulu interface table

   os << "Router-ID: " << IPAddress(r.GetRouterID());

   int areaCount = r.GetAreaCount();
   for (int i = 0; i < areaCount; i++){
      os << endl << "Interfaces in area " << r.GetAreaByIndex(i)->GetAreaID() << ":";
      int ifaces = r.GetAreaByIndex(i)->GetNumberOfInterfaces();
      for (int j = 0; j < ifaces; j++){
         AnsaOspf6::Interface *iface = r.GetAreaByIndex(i)->GetInterfaceByIndex(j);
         os << endl << "- " << iface->GetIfName();
         os << " (" << iface->GetTypeString(iface->GetType()) << ")";
         //os << ", inst: " << iface->GetInstanceID();
         os << ", cost: " << iface->GetOutputCost();
         os << ", pri: " << iface->GetRouterPriority();
         os << ", hello: " << iface->GetHelloInterval() << "s";
         os << ", dead:" << iface->GetRouterDeadInterval() << "s";

         os << endl << "  * state: " << iface->GetStateString(iface->GetState());
         os << ", DR: " << IPAddress(iface->GetDesignatedRouter());
         os << ", BDR: " << IPAddress(iface->GetBackupDesignatedRouter());

         os << endl << "  * " << "prefixes: ";
         int prefixes = iface->GetAddressPrefixCount();
         for (int k = 0; k < prefixes; k++){
            if (k != 0){
               os << ", ";
            }
            os << iface->GetAddressPrefix(k).address << "/" << iface->GetAddressPrefix(k).prefixLen;
         }

         for (int l = 0; l < iface->GetNeighborCount(); l++){
            os << endl << "  * neighbor ";
            os << IPAddress(iface->GetNeighbor(l)->GetNeighborID());
            os << " (" << iface->GetNeighbor(l)->GetStateString(iface->GetNeighbor(l)->GetState()) << ")";
            os << ", pri: " << iface->GetNeighbor(l)->GetPriority();
            if (iface->GetNeighbor(l)->GetDesignatedRouter() != 0){
               os << endl << "    DR: " << IPAddress(iface->GetNeighbor(l)->GetDesignatedRouter());
            }

            if (iface->GetNeighbor(l)->GetBackupDesignatedRouter() != 0){
               os << ", BDR:" << IPAddress(iface->GetNeighbor(l)->GetBackupDesignatedRouter());
            }
         }
      }
   }


   return os;
}