INET Framework for OMNeT++/OMNEST
RIPRouting.cc File Reference

Modul RIPRouting v sobe implementuje protokol RIP a redistribuci z protokolu OSPF do protokolu RIP. Tento modul vznikl v ramci me bakalrske prace. More...

#include "RIPRouting.h"
#include "IPRoute.h"
#include <vector>
#include "IPv4InterfaceData.h"

Go to the source code of this file.

Defines

#define BROADCAST   "255.255.255.255"

Functions

 Define_Module (RIPRouting)
std::ostream & operator<< (std::ostream &os, const RIPinterface &e)
std::ostream & operator<< (std::ostream &os, const RIPRouteTimer &e)
std::ostream & operator<< (std::ostream &os, const RIPRedistribution &e)
IPAddress getMask (IPAddress addr)

Detailed Description

Modul RIPRouting v sobe implementuje protokol RIP a redistribuci z protokolu OSPF do protokolu RIP. Tento modul vznikl v ramci me bakalrske prace.

Zakladni informace:

Module RIPRouting implements protocol RIP and redistribution from protocol OSPF to protocol RIP. This module was created within the scope of my bachelor's thesis.

Definition in file RIPRouting.cc.


Define Documentation

#define BROADCAST   "255.255.255.255"

IP adresa broadcastu.

Definition at line 28 of file RIPRouting.cc.

Referenced by RIPRouting::handleMessage(), RIPRouting::initialize(), and RIPRouting::sendPacket().


Function Documentation

GET MASK Metoda slouzi k urceni masky IP adresy zarazene adresy do tridy A, B nebo C.

Parameters:
addrIP adresa, ke ktere se hleda maska.
Returns:
Maska IP adresy.

Definition at line 88 of file RIPRouting.cc.

Referenced by RIPRouting::fillNetworks(), RIPRouting::processResponse(), and RIPRouting::sendPacket().

{
        IPAddress mask;
        if (addr< "126.255.255.255")
                mask = "255.0.0.0";                     // A
        else if (addr < "191.255.255.255")
                mask = "255.255.0.0";           // B
        else
                mask = "255.255.255.0";         // C
        return mask;
}
std::ostream& operator<< ( std::ostream &  os,
const RIPinterface e 
)

Umoznuje vypis struktury RIPinterface.

Definition at line 35 of file RIPRouting.cc.

{
    os << "ID = " << e.intID << "; addr = " << e.addr << "; mask = " << e.mask << "; pass = " << e.passive << "; broad = " << e.broadcast;
    return os;
};
std::ostream& operator<< ( std::ostream &  os,
const RIPRouteTimer e 
)

Umoznuje vypis struktury RIPRouteTimer.

Definition at line 42 of file RIPRouting.cc.

{
         if (e.timer == NULL)
                 os << "Adresa= " << e.route->getHost() << "; NIC ";
         else
                 os << "Adresa= " << e.route->getHost() << "; " << e.timer->getFullName() << "  ArrivalTime: " << e.timer->getArrivalTime();
    return os;
};
std::ostream& operator<< ( std::ostream &  os,
const RIPRedistribution e 
)

Umoznuje vypis struktury RIPRedistribution.

Definition at line 52 of file RIPRouting.cc.

{
         if (e.redistrinute)
                 os << "Redistribuce: YES; Protokol: " << e.protocol << "; Metrika: " << e.metric;
         else
                 os << "Redistribuce: NO; Protokol: " << e.protocol << "; Metrika: " << e.metric;
    return os;
};