| 513 | } |
| 514 | |
| 515 | bool VerticalHandler::parse_message(OpenDDS::RTPS::MessageParser& message_parser, |
| 516 | const OpenDDS::DCPS::Lockable_Message_Block_Ptr& msg, |
| 517 | OpenDDS::DCPS::GUID_t& src_guid, |
| 518 | GuidSet& to, |
| 519 | bool check_submessages, |
| 520 | const OpenDDS::DCPS::MonotonicTimePoint& now) |
| 521 | { |
| 522 | ACE_UNUSED_ARG(msg); |
| 523 | |
| 524 | if (!message_parser.parseHeader()) { |
| 525 | HANDLER_ERROR((LM_ERROR, "(%P|%t) ERROR: VerticalHandler::parse_message %C failed to deserialize RTPS header\n", name_.c_str())); |
| 526 | return false; |
| 527 | } |
| 528 | |
| 529 | const auto& header = message_parser.header(); |
| 530 | std::memcpy(src_guid.guidPrefix, header.guidPrefix, sizeof(OpenDDS::DCPS::GuidPrefix_t)); |
| 531 | src_guid.entityId = OpenDDS::DCPS::ENTITYID_PARTICIPANT; |
| 532 | |
| 533 | bool valid_info_dst = false; |
| 534 | bool all_valid_info_dst = true; |
| 535 | |
| 536 | while (message_parser.parseSubmessageHeader()) { |
| 537 | const auto submessage_header = message_parser.submessageHeader(); |
| 538 | |
| 539 | // Check that every non-info submessage has a "valid" (not unknown) destination. |
| 540 | switch (submessage_header.submessageId) { |
| 541 | case OpenDDS::RTPS::INFO_DST: { |
| 542 | OpenDDS::DCPS::GUID_t dest = OpenDDS::DCPS::GUID_UNKNOWN; |
| 543 | OpenDDS::DCPS::GuidPrefix_t_forany guidPrefix(dest.guidPrefix); |
| 544 | if (!(message_parser >> guidPrefix)) { |
| 545 | HANDLER_ERROR((LM_ERROR, "(%P|%t) ERROR: VerticalHandler::parse_message %C failed to deserialize INFO_DST from %C\n", name_.c_str(), guid_to_string(src_guid).c_str())); |
| 546 | return false; |
| 547 | } |
| 548 | valid_info_dst = dest != OpenDDS::DCPS::GUID_UNKNOWN; |
| 549 | if (valid_info_dst) { |
| 550 | dest.entityId = OpenDDS::DCPS::ENTITYID_PARTICIPANT; |
| 551 | to.insert(dest); |
| 552 | } |
| 553 | break; |
| 554 | } |
| 555 | case OpenDDS::RTPS::INFO_TS: |
| 556 | case OpenDDS::RTPS::INFO_SRC: |
| 557 | case OpenDDS::RTPS::INFO_REPLY_IP4: |
| 558 | case OpenDDS::RTPS::INFO_REPLY: |
| 559 | break; |
| 560 | default: |
| 561 | all_valid_info_dst = all_valid_info_dst && valid_info_dst; |
| 562 | } |
| 563 | |
| 564 | if (check_submessages) { |
| 565 | switch (submessage_header.submessageId) { |
| 566 | case OpenDDS::RTPS::SRTPS_PREFIX: |
| 567 | { |
| 568 | if (application_participant_crypto_handle_ == DDS::HANDLE_NIL) { |
| 569 | HANDLER_ERROR((LM_ERROR, "(%P|%t) ERROR: VerticalHandler::parse_message %C no crypto handle for application participant\n", name_.c_str())); |
| 570 | return false; |
| 571 | } |
| 572 |
nothing calls this directly
no test coverage detected