@@ -287,7 +287,7 @@ void BgpRouter::setRedistributeOspf(std::string str)
287287 }
288288}
289289
290- void BgpRouter::processMessageFromTCP (cMessage *msg)
290+ void BgpRouter::processMessageFromTcp (cMessage *msg)
291291{
292292 TcpSocket *socket = check_and_cast_nullable<TcpSocket *>(_socketMap.findSocketFor (msg));
293293 if (!socket) {
@@ -340,7 +340,7 @@ void BgpRouter::processMessageFromTCP(cMessage *msg)
340340void BgpRouter::listenConnectionFromPeer (SessionId sessionID)
341341{
342342 // Ensure the single shared listening socket is up. One wildcard listener per router
343- // accepts all incoming BGP connections on TCP_PORT; processMessageFromTCP () demuxes
343+ // accepts all incoming BGP connections on TCP_PORT; processMessageFromTcp () demuxes
344344 // accepted connections to the right session by peer address. This replaces the former
345345 // per-session listeners, which collided on the shared wildcard port when several
346346 // sessions reconnected at once (see plan §4 Phase 0 result).
@@ -364,7 +364,7 @@ void BgpRouter::listenConnectionFromPeer(SessionId sessionID)
364364 }
365365}
366366
367- void BgpRouter::openTCPConnectionToPeer (SessionId sessionID)
367+ void BgpRouter::openTcpConnectionToPeer (SessionId sessionID)
368368{
369369 EV_DEBUG << " Opening a TCP connection to "
370370 << _BGPSessions[sessionID]->getPeerAddr ()
@@ -423,10 +423,10 @@ void BgpRouter::socketEstablished(TcpSocket *socket)
423423 if (_BGPSessions[_currSessionId]->getType () == IGP &&
424424 this ->findNextSession (EGP ) != static_cast <SessionId>(-1 ))
425425 {
426- _BGPSessions[_currSessionId]->getFSM ()->TcpConnectionFails ();
426+ _BGPSessions[_currSessionId]->getFsm ()->TcpConnectionFails ();
427427 }
428428 else {
429- _BGPSessions[_currSessionId]->getFSM ()->TcpConnectionConfirmed ();
429+ _BGPSessions[_currSessionId]->getFsm ()->TcpConnectionConfirmed ();
430430 }
431431 // Note: the shared listening socket is intentionally left listening (it is not a
432432 // per-session resource and must stay up to accept connections for other sessions).
@@ -437,7 +437,7 @@ void BgpRouter::socketFailure(TcpSocket *socket, int code)
437437 int connId = socket->getSocketId ();
438438 _currSessionId = findIdFromSocketConnId (_BGPSessions, connId);
439439 if (_currSessionId != static_cast <SessionId>(-1 )) {
440- _BGPSessions[_currSessionId]->getFSM ()->TcpConnectionFails ();
440+ _BGPSessions[_currSessionId]->getFsm ()->TcpConnectionFails ();
441441 }
442442}
443443
@@ -447,7 +447,7 @@ void BgpRouter::socketPeerClosed(TcpSocket *socket)
447447 int connId = socket->getSocketId ();
448448 _currSessionId = findIdFromSocketConnId (_BGPSessions, connId);
449449 if (_currSessionId != static_cast <SessionId>(-1 ))
450- _BGPSessions[_currSessionId]->getFSM ()->TcpConnectionFails ();
450+ _BGPSessions[_currSessionId]->getFsm ()->TcpConnectionFails ();
451451}
452452
453453void BgpRouter::socketDataArrived (TcpSocket *socket)
@@ -495,7 +495,7 @@ void BgpRouter::processMessage(const BgpOpenMessage& msg)
495495 << session->getPeerAddr ().str (false )
496496 << " with contents: \n " ;
497497 printOpenMessage (msg);
498- session->getFSM ()->OpenMsgEvent ();
498+ session->getFsm ()->OpenMsgEvent ();
499499}
500500
501501void BgpRouter::processMessage (const BgpKeepAliveMessage& msg)
@@ -505,7 +505,7 @@ void BgpRouter::processMessage(const BgpKeepAliveMessage& msg)
505505 << session->getPeerAddr ().str (false )
506506 << " with contents: \n " ;
507507 printKeepAliveMessage (msg);
508- session->getFSM ()->KeepAliveMsgEvent ();
508+ session->getFsm ()->KeepAliveMsgEvent ();
509509}
510510
511511void BgpRouter::processMessage (const BgpUpdateMessage& msg)
@@ -515,14 +515,14 @@ void BgpRouter::processMessage(const BgpUpdateMessage& msg)
515515 << session->getPeerAddr ().str (false )
516516 << " with contents: \n " ;
517517 printUpdateMessage (msg);
518- session->getFSM ()->UpdateMsgEvent ();
518+ session->getFsm ()->UpdateMsgEvent ();
519519
520520 BgpRoutingTableEntry *entry = new BgpRoutingTableEntry ();
521521 entry->setLocalPreference (bgpModule->par (" localPreference" ).intValue ());
522- entry->setDestination (msg.getNLRI (0 ).prefix );
522+ entry->setDestination (msg.getNlri (0 ).prefix );
523523
524524 Ipv4Address netMask (Ipv4Address::ALLONES_ADDRESS );
525- netMask = Ipv4Address::makeNetmask (msg.getNLRI (0 ).length );
525+ netMask = Ipv4Address::makeNetmask (msg.getNlri (0 ).length );
526526 entry->setNetmask (netMask);
527527
528528 for (size_t i = 0 ; i < msg.getPathAttributesArraySize (); i++) {
@@ -688,22 +688,22 @@ BgpProcessResult BgpRouter::decisionProcess(const BgpUpdateMessage& msg, BgpRout
688688bool BgpRouter::tieBreakingProcess (BgpRoutingTableEntry *oldEntry, BgpRoutingTableEntry *entry)
689689{
690690 if (entry->getLocalPreference () > oldEntry->getLocalPreference ()) {
691- deleteBGPRoutingEntry (oldEntry);
691+ deleteBgpRoutingEntry (oldEntry);
692692 return false ;
693693 }
694694
695695 /* Remove from consideration all routes that are not tied for
696696 having the smallest number of AS numbers present in their
697697 AS_PATH attributes.*/
698698 if (entry->getASCount () < oldEntry->getASCount ()) {
699- deleteBGPRoutingEntry (oldEntry);
699+ deleteBgpRoutingEntry (oldEntry);
700700 return false ;
701701 }
702702
703703 /* Remove from consideration all routes that are not tied for
704704 having the lowest Origin number in their Origin attribute.*/
705705 if (entry->getPathType () < oldEntry->getPathType ()) {
706- deleteBGPRoutingEntry (oldEntry);
706+ deleteBgpRoutingEntry (oldEntry);
707707 return false ;
708708 }
709709
@@ -745,7 +745,7 @@ void BgpRouter::updateSendProcess(BgpProcessResult type, SessionId sessionIndex,
745745 type == ROUTE_DESTINATION_CHANGED ||
746746 type == NEW_SESSION_ESTABLISHED )
747747 {
748- BgpUpdateNlri NLRI ;
748+ BgpUpdateNlri nlri ;
749749 std::vector<BgpUpdatePathAttributes *> content;
750750
751751 unsigned int nbAS = entry->getASCount ();
@@ -798,10 +798,10 @@ void BgpRouter::updateSendProcess(BgpProcessResult type, SessionId sessionIndex,
798798 originAttr->setValue ((BgpSessionType)entry->getPathType ());
799799
800800 Ipv4Address netMask = entry->getNetmask ();
801- NLRI .prefix = entry->getDestination ().doAnd (netMask);
802- NLRI .length = (unsigned char )netMask.getNetmaskLength ();
801+ nlri .prefix = entry->getDestination ().doAnd (netMask);
802+ nlri .length = (unsigned char )netMask.getNetmaskLength ();
803803
804- (elem).second ->sendUpdateMessage (content, NLRI );
804+ (elem).second ->sendUpdateMessage (content, nlri );
805805 }
806806 }
807807}
@@ -811,7 +811,7 @@ void BgpRouter::updateSendProcess(BgpProcessResult type, SessionId sessionIndex,
811811 * Side effects when returns true:
812812 * bgpRoutingTable changed, iterators on bgpRoutingTable will be invalid.
813813 */
814- bool BgpRouter::deleteBGPRoutingEntry (BgpRoutingTableEntry *entry)
814+ bool BgpRouter::deleteBgpRoutingEntry (BgpRoutingTableEntry *entry)
815815{
816816 for (auto it = bgpRoutingTable.begin ();
817817 it != bgpRoutingTable.end (); it++)
@@ -927,7 +927,7 @@ void BgpRouter::printOpenMessage(const BgpOpenMessage& openMsg)
927927{
928928 EV_INFO << " My AS: " << openMsg.getMyAS () << " \n " ;
929929 EV_INFO << " Hold time: " << openMsg.getHoldTime () << " s \n " ;
930- EV_INFO << " BGP Id: " << openMsg.getBGPIdentifier () << " \n " ;
930+ EV_INFO << " BGP Id: " << openMsg.getBgpIdentifier () << " \n " ;
931931 if (openMsg.getOptionalParameterArraySize () == 0 )
932932 EV_INFO << " Optional parameters: empty \n " ;
933933 for (size_t i = 0 ; i < openMsg.getOptionalParameterArraySize (); i++) {
@@ -1000,11 +1000,11 @@ void BgpRouter::printUpdateMessage(const BgpUpdateMessage& updateMsg)
10001000 }
10011001 }
10021002
1003- if (updateMsg.getNLRIArraySize () > 0 ) {
1004- auto NLRI_Base = updateMsg.getNLRI (0 );
1003+ if (updateMsg.getNlriArraySize () > 0 ) {
1004+ auto nlriBase = updateMsg.getNlri (0 );
10051005 EV_INFO << " Network Layer Reachability Information (NLRI): \n " ;
1006- EV_INFO << " NLRI length: " << (int )NLRI_Base .length << " \n " ;
1007- EV_INFO << " NLRI prefix: " << NLRI_Base .prefix << " \n " ;
1006+ EV_INFO << " NLRI length: " << (int )nlriBase .length << " \n " ;
1007+ EV_INFO << " NLRI prefix: " << nlriBase .prefix << " \n " ;
10081008 }
10091009}
10101010
0 commit comments