|
INET Framework for OMNeT++/OMNEST
|
#include <Ospfv3Instance.h>
◆ Ospfv3Instance()
| inet::ospfv3::Ospfv3Instance::Ospfv3Instance |
( |
int |
instanceId, |
|
|
Ospfv3Process * |
parentProcess, |
|
|
int |
addressFamily |
|
) |
| |
15 this->
ift = check_and_cast<IInterfaceTable *>(
containingModule->getSubmodule(
"interfaceTable"));
◆ ~Ospfv3Instance()
| inet::ospfv3::Ospfv3Instance::~Ospfv3Instance |
( |
| ) |
|
|
virtual |
20 long areaCount =
areas.size();
21 for (
long i = 0; i < areaCount; i++) {
◆ addArea()
| void inet::ospfv3::Ospfv3Instance::addArea |
( |
Ospfv3Area * |
newArea | ) |
|
◆ debugDump()
| void inet::ospfv3::Ospfv3Instance::debugDump |
( |
| ) |
|
162 for (
auto it = this->
areas.begin(); it != this->areas.end(); it++) {
163 EV_DEBUG <<
"\tArea id " << (*it)->getAreaID() <<
" has these interfaces:\n";
◆ detailedInfo()
| std::string inet::ospfv3::Ospfv3Instance::detailedInfo |
( |
| ) |
const |
185 std::stringstream out;
188 out <<
"Ospfv3 " << processID <<
" address-family ";
191 out <<
"IPv4 (router-id " << routerID <<
")\n\n";
193 out <<
"IPv6 (router-id " << routerID <<
")\n\n";
195 out <<
"Neighbor ID\tPri\tState\t\tDead Time\tInterface ID\tInterface\n";
196 for (
auto it = this->
areas.begin(); it != this->areas.end(); it++) {
197 int intfCount = (*it)->getInterfaceCount();
198 for (
int i = 0; i < intfCount; i++) {
199 Ospfv3Interface *intf = (*it)->getInterface(i);
200 int neiCount = intf->getNeighborCount();
201 for (
int n = 0; n < neiCount; n++) {
202 Ospfv3Neighbor *neighbor = intf->getNeighbor(n);
203 out << neighbor->getNeighborID() <<
"\t";
204 out << neighbor->getNeighborPriority() <<
"\t";
205 switch (neighbor->getState()) {
211 out <<
"ATTEMPT\t\t";
222 out <<
"2WAY/DROTHER\t";
226 out <<
"EXSTART\t\t";
230 out <<
"EXCHANGE\t\t";
234 out <<
"LOADING\t\t";
238 if (neighbor->getNeighborID() == intf->getDesignatedID())
239 out <<
"FULL/DR\t\t";
240 else if (neighbor->getNeighborID() == intf->getBackupID())
241 out <<
"FULL/BDR\t\t";
243 out <<
"FULL/DROTHER\t";
247 int dead = intf->getDeadInterval() - ((int)simTime().dbl() - neighbor->getLastHelloTime());
250 out << dead <<
"\t\t";
251 out << neighbor->getNeighborInterfaceID() <<
"\t\t";
252 out << intf->getIntName() <<
"\n";
Referenced by inet::ospfv3::operator<<().
◆ getAddressFamily()
| int inet::ospfv3::Ospfv3Instance::getAddressFamily |
( |
| ) |
|
|
inline |
◆ getArea()
| Ospfv3Area* inet::ospfv3::Ospfv3Instance::getArea |
( |
int |
i | ) |
|
|
inline |
◆ getAreaById()
◆ getAreaCount()
| int inet::ospfv3::Ospfv3Instance::getAreaCount |
( |
| ) |
|
|
inline |
◆ getInstanceID()
| int inet::ospfv3::Ospfv3Instance::getInstanceID |
( |
| ) |
|
|
inline |
◆ getNewInterAreaPrefixLinkStateID()
| Ipv4Address inet::ospfv3::Ospfv3Instance::getNewInterAreaPrefixLinkStateID |
( |
| ) |
|
◆ getProcess()
| Ospfv3Process* inet::ospfv3::Ospfv3Instance::getProcess |
( |
| ) |
const |
|
inline |
Referenced by inet::ospfv3::Ospfv3Interface::acknowledgeLSA(), inet::ospfv3::Ospfv3Interface::addDelayedAcknowledgement(), inet::ospfv3::Ospfv3Interface::ageDatabase(), inet::ospfv3::Ospfv3InterfaceState::calculateDesignatedRouter(), inet::ospfv3::Ospfv3NeighborState::changeState(), inet::ospfv3::Ospfv3InterfaceState::changeState(), inet::ospfv3::Ospfv3Neighbor::clearRequestRetransmissionTimer(), inet::ospfv3::Ospfv3Neighbor::clearUpdateRetransmissionTimer(), detailedInfo(), inet::ospfv3::Ospfv3Interface::detailedInfo(), inet::ospfv3::Ospfv3Interface::floodLSA(), inet::ospfv3::Ospfv3Neighbor::needAdjacency(), inet::ospfv3::Ospfv3Interface::originateLinkLSA(), inet::ospfv3::Ospfv3Interface::processDDPacket(), inet::ospfv3::Ospfv3InterfaceStateDown::processEvent(), inet::ospfv3::Ospfv3NeighborStateAttempt::processEvent(), inet::ospfv3::Ospfv3NeighborStateFull::processEvent(), inet::ospfv3::Ospfv3NeighborStateLoading::processEvent(), inet::ospfv3::Ospfv3NeighborState2Way::processEvent(), inet::ospfv3::Ospfv3NeighborStateDown::processEvent(), inet::ospfv3::Ospfv3NeighborStateExchange::processEvent(), inet::ospfv3::Ospfv3NeighborStateInit::processEvent(), inet::ospfv3::Ospfv3InterfaceStateDrOther::processEvent(), inet::ospfv3::Ospfv3NeighborStateExStart::processEvent(), inet::ospfv3::Ospfv3InterfaceStateDr::processEvent(), inet::ospfv3::Ospfv3InterfaceStateWaiting::processEvent(), inet::ospfv3::Ospfv3InterfaceStatePointToPoint::processEvent(), inet::ospfv3::Ospfv3InterfaceStateBackup::processEvent(), inet::ospfv3::Ospfv3Interface::processHelloPacket(), inet::ospfv3::Ospfv3Interface::processLSR(), inet::ospfv3::Ospfv3Interface::processLSU(), inet::ospfv3::Ospfv3Neighbor::reset(), inet::ospfv3::Ospfv3Neighbor::retransmitDatabaseDescriptionPacket(), inet::ospfv3::Ospfv3Neighbor::retransmitUpdatePacket(), inet::ospfv3::Ospfv3Neighbor::sendDDPacket(), inet::ospfv3::Ospfv3Interface::sendDelayedAcknowledgements(), inet::ospfv3::Ospfv3Neighbor::sendLinkStateRequestPacket(), inet::ospfv3::Ospfv3Interface::sendLSAcknowledgement(), inet::ospfv3::Ospfv3Neighbor::startRequestRetransmissionTimer(), inet::ospfv3::Ospfv3Neighbor::startUpdateRetransmissionTimer(), inet::ospfv3::Ospfv3Interface::~Ospfv3Interface(), and inet::ospfv3::Ospfv3Neighbor::~Ospfv3Neighbor().
◆ getUniqueId()
| int inet::ospfv3::Ospfv3Instance::getUniqueId |
( |
| ) |
|
|
inline |
◆ hasArea()
| bool inet::ospfv3::Ospfv3Instance::hasArea |
( |
Ipv4Address |
areaId | ) |
|
◆ init()
| void inet::ospfv3::Ospfv3Instance::init |
( |
| ) |
|
153 for (
auto it = this->
areas.begin(); it != this->areas.end(); it++)
156 WATCH_PTRVECTOR(this->
areas);
◆ processPacket()
| void inet::ospfv3::Ospfv3Instance::processPacket |
( |
Packet * |
pk | ) |
|
45 const auto& packet = pk->peekAtFront<Ospfv3Packet>();
46 EV_INFO <<
"Process " << this->
containingProcess->
getProcessID() <<
" received packet: (" << packet->getClassName() <<
")" << packet->getName() <<
"\n";
47 if (packet->getVersion() != 3) {
52 int intfId = pk->getTag<InterfaceInd>()->getInterfaceId();
53 Ipv4Address areaId = packet->getAreaID();
54 Ospfv3Area *area = this->
getAreaById(packet->getAreaID());
55 if (area !=
nullptr) {
56 Ospfv3Interface *intf = area->getInterfaceById(intfId);
58 if (intf ==
nullptr) {
59 EV_DEBUG <<
"Interface is null in instance::processPacket\n";
64 intf = area->findVirtualLink(packet->getRouterID());
66 if (intf !=
nullptr) {
67 Ospfv3Area *virtualLinkTransitArea = this->
getAreaById(intf->getTransitAreaID());
68 if (virtualLinkTransitArea !=
nullptr) {
70 Ospfv3Interface *virtualLinkInterface = virtualLinkTransitArea->getInterfaceById(intfId);
72 if (virtualLinkInterface ==
nullptr) {
83 if (intf !=
nullptr) {
84 Ipv6Address destinationAddress = pk->getTag<
L3AddressInd>()->getDestAddress().toIpv6();
89 if (((destinationAddress == allDRouters) &&
92 (destinationAddress != allDRouters))
96 Ospfv3Neighbor *neighbor =
nullptr;
100 neighbor = intf->getNeighborById(packet->getRouterID());
102 switch (packetType) {
104 intf->processHelloPacket(pk);
108 if (neighbor !=
nullptr) {
109 EV_DEBUG <<
"Instance is sending packet to interface\n";
110 intf->processDDPacket(pk);
115 if (neighbor !=
nullptr) {
116 intf->processLSR(pk, neighbor);
121 if (neighbor !=
nullptr) {
122 intf->processLSU(pk, neighbor);
127 if (neighbor !=
nullptr) {
128 intf->processLSAck(pk, neighbor);
Referenced by inet::ospfv3::Ospfv3Process::handleMessage().
◆ removeFromAllRetransmissionLists()
| void inet::ospfv3::Ospfv3Instance::removeFromAllRetransmissionLists |
( |
LSAKeyType |
lsaKey | ) |
|
◆ subtractInterAreaPrefixLinkStateID()
| void inet::ospfv3::Ospfv3Instance::subtractInterAreaPrefixLinkStateID |
( |
| ) |
|
179 int newIP = currIP.
getInt() - 1;
◆ addressFamily
| int inet::ospfv3::Ospfv3Instance::addressFamily |
|
private |
◆ areas
| std::vector<Ospfv3Area *> inet::ospfv3::Ospfv3Instance::areas |
|
private |
◆ areasById
◆ containingModule
| cModule* inet::ospfv3::Ospfv3Instance::containingModule = nullptr |
|
private |
◆ containingProcess
◆ ift
◆ instanceID
| int inet::ospfv3::Ospfv3Instance::instanceID |
|
private |
◆ interAreaPrefixLsID
◆ ospfv3IfIndex
| int inet::ospfv3::Ospfv3Instance::ospfv3IfIndex = 0 |
|
private |
The documentation for this class was generated from the following files:
cModule * findContainingNode(const cModule *from)
Find the node containing the given module.
Definition: ModuleAccess.cc:31
@ TWOWAY_STATE
Definition: Ospfv3Neighbor.h:46
@ LINKSTATE_ACKNOWLEDGEMENT_PACKET
Definition: OspfPacketBase_m.h:69
uint32_t getInt() const
Returns the address as an uint32_t in host byte order (e.g.
Definition: Ipv4Address.h:186
@ FULL_STATE
Definition: Ospfv3Neighbor.h:50
std::map< Ipv4Address, Ospfv3Area * > areasById
Definition: Ospfv3Instance.h:56
int ospfv3IfIndex
Definition: Ospfv3Instance.h:57
@ DOWN_STATE
Definition: Ospfv3Neighbor.h:43
Ospfv3Process * getProcess() const
Definition: Ospfv3Instance.h:32
@ LINKSTATE_REQUEST_PACKET
Definition: OspfPacketBase_m.h:67
int getAreaCount()
Definition: Ospfv3Instance.h:43
Ospfv3Area * getAreaById(Ipv4Address areaId)
Definition: Ospfv3Instance.cc:37
@ EXCHANGE_START_STATE
Definition: Ospfv3Neighbor.h:47
@ ATTEMPT_STATE
Definition: Ospfv3Neighbor.h:44
removed DscpReq Ipv4ControlInfo Ipv6ControlInfo up L3AddressInd L3AddressInd
Definition: IUdp-gates.txt:20
Ospfv3InterfaceFaState
Definition: Ospfv3Interface.h:26
@ HELLO_PACKET
Definition: OspfPacketBase_m.h:65
int getProcessID() const
Definition: Ospfv3Process.h:39
@ LINKSTATE_UPDATE_PACKET
Definition: OspfPacketBase_m.h:68
#define IPV4INSTANCE
Definition: Ospfv3Common.h:20
cModule * containingModule
Definition: Ospfv3Instance.h:55
Ipv4Address getRouterID()
Definition: Ospfv3Process.h:40
int instanceID
Definition: Ospfv3Instance.h:52
@ DATABASE_DESCRIPTION_PACKET
Definition: OspfPacketBase_m.h:66
OspfPacketType
Enum generated from inet/routing/ospf_common/OspfPacketBase.msg:15 by opp_msgtool.
Definition: OspfPacketBase_m.h:64
IInterfaceTable * ift
Definition: Ospfv3Instance.h:48
Ipv4Address interAreaPrefixLsID
Definition: Ospfv3Instance.h:58
Ospfv3Process * containingProcess
Definition: Ospfv3Instance.h:53
static const Ipv4Address UNSPECIFIED_ADDRESS
0.0.0.0
Definition: Ipv4Address.h:91
int getInstanceID()
Definition: Ospfv3Instance.h:30
@ EXCHANGE_STATE
Definition: Ospfv3Neighbor.h:48
@ INIT_STATE
Definition: Ospfv3Neighbor.h:45
std::vector< Ospfv3Area * > areas
Definition: Ospfv3Instance.h:54
int addressFamily
Definition: Ospfv3Instance.h:51
static const Ipv6Address ALL_OSPF_DESIGNATED_ROUTERS_MCAST
OSPF designated routers.
Definition: Ipv6Address.h:87
bool containsKey(const std::map< K, V, _C > &m, const Tk &a)
Definition: stlutils.h:80
@ LOADING_STATE
Definition: Ospfv3Neighbor.h:49
@ INTERFACE_STATE_BACKUP
Definition: Ospfv3Interface.h:32
@ INTERFACE_STATE_DESIGNATED
Definition: Ospfv3Interface.h:33