|
INET Framework for OMNeT++/OMNEST
|
#include <LinkStateRequestHandler.h>
◆ LinkStateRequestHandler()
| inet::ospfv2::LinkStateRequestHandler::LinkStateRequestHandler |
( |
Router * |
containingRouter | ) |
|
◆ processPacket()
Implements inet::ospfv2::IMessageHandler.
33 const auto& lsRequestPacket = packet->peekAtFront<Ospfv2LinkStateRequestPacket>();
35 unsigned long requestCount = lsRequestPacket->getRequestsArraySize();
37 std::vector<Ospfv2Lsa *> lsas;
39 EV_INFO <<
" Processing packet contents:\n";
41 for (
unsigned long i = 0; i < requestCount; i++) {
42 const auto& request = lsRequestPacket->getRequests(i);
45 EV_INFO <<
" LsaRequest: type=" << request.lsType
46 <<
", LSID=" << request.linkStateID
47 <<
", advertisingRouter=" << request.advertisingRouter
50 lsaKey.linkStateID = request.linkStateID;
51 lsaKey.advertisingRouter = request.advertisingRouter;
55 if (lsaInDatabase !=
nullptr) {
56 lsas.push_back(lsaInDatabase);
66 int updatesCount = lsas.size();
70 for (
int j = 0; j < updatesCount; j++) {
71 Packet *updatePacket = intf->createUpdatePacket(lsas[j]);
72 if (updatePacket !=
nullptr) {
89 messageHandler->sendPacket(updatePacket, neighbor->getAddress(), intf, ttl);
Referenced by inet::ospfv2::MessageHandler::processPacket().
The documentation for this class was generated from the following files:
#define VIRTUAL_LINK_TTL
Definition: Ospfv2Common.h:36
@ FULL_STATE
Definition: Ospfv2Neighbor.h:57
void printEvent(const char *eventString, const Ospfv2Interface *onInterface=nullptr, const Neighbor *forNeighbor=nullptr) const
Definition: MessageHandler.cc:380
@ POINTTOPOINT
Definition: Ospfv2Interface.h:32
NeighborStateType
Definition: Ospfv2Neighbor.h:49
@ DESIGNATED_ROUTER_STATE
Definition: Ospfv2Interface.h:58
Ospfv2LsaType
Enum generated from inet/routing/ospfv2/Ospfv2Packet.msg:78 by opp_msgtool.
Definition: Ospfv2Packet_m.h:282
MessageHandler * getMessageHandler()
Definition: Ospfv2Router.h:66
const DesignatedRouterId NULL_DESIGNATEDROUTERID
Definition: Ospfv2Common.h:156
@ BAD_LINK_STATE_REQUEST
Definition: Ospfv2Neighbor.h:35
@ VIRTUAL
Definition: Ospfv2Interface.h:36
static const Ipv4Address ALL_OSPF_DESIGNATED_ROUTERS_MCAST
224.0.0.6 All OSPF Designated Routers
Definition: Ipv4Address.h:100
void sendPacket(Packet *packet, Ipv4Address destination, Ospfv2Interface *outputIf, short ttl=1)
Definition: MessageHandler.cc:303
@ EXCHANGE_STATE
Definition: Ospfv2Neighbor.h:55
Ospfv2Lsa * findLSA(Ospfv2LsaType lsaType, LsaKeyType lsaKey, AreaId areaID)
Find the LSA identified by the input lsaKey in the database.
Definition: Ospfv2Router.cc:226
IMessageHandler(Router *containingRouter)
Definition: IMessageHandler.h:27
@ LOADING_STATE
Definition: Ospfv2Neighbor.h:56
@ BROADCAST
Definition: Ospfv2Interface.h:33
Router * router
Definition: IMessageHandler.h:24
@ BACKUP_STATE
Definition: Ospfv2Interface.h:57
static const Ipv4Address ALL_OSPF_ROUTERS_MCAST
224.0.0.5 All OSPF routers (DR Others)
Definition: Ipv4Address.h:99