MCPcopy Create free account
hub / github.com/SNAS/openbmp / parsePeerDownEventHdr

Method parsePeerDownEventHdr

Server/src/bmp/parseBMP.cpp:529–547  ·  view source on GitHub ↗

* Parse the v3 peer down BMP header * * \details This method will update the db peer_down_event struct with BMP header info. * * \param [in] sock Socket to read the message from * \param [out] down_event Reference to the peer down event storage (will be updated with bmp info) * * \returns true if successfully parsed the bmp peer down header, false otherwise */

Source from the content-addressed store, hash-verified

527 * \returns true if successfully parsed the bmp peer down header, false otherwise
528 */
529bool parseBMP::parsePeerDownEventHdr(int sock, MsgBusInterface::obj_peer_down_event &down_event) {
530 char reason;
531
532 if (Recv(sock, &reason, 1, 0) == 1) {
533 LOG_NOTICE("sock=%d : %s: BGP peer down notification with reason code: %d",
534 sock, p_entry->peer_addr, reason);
535
536 // Indicate that data has been read
537 bmp_len--;
538
539 // Initialize the down_event struct
540 down_event.bmp_reason = reason;
541
542 } else {
543 return false;
544 }
545
546 return true;
547}
548
549/**
550 * Buffer remaining BMP message

Callers 1

ReadIncomingMsgMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected