* 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 */
| 527 | * \returns true if successfully parsed the bmp peer down header, false otherwise |
| 528 | */ |
| 529 | bool 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 |