MCPcopy Create free account
hub / github.com/attermann/microReticulum / dumpString

Method dumpString

src/microReticulum/Packet.cpp:648–855  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

646 return str;
647}
648std::string Packet::dumpString() const {
649 if (!_object) {
650 return "";
651 }
652 //if (_object->_packed) {
653 // unpack();
654 //}
655 bool encrypted = true;
656 std::string dump;
657 dump = "\n------------------------------------------------------------------------------\n";
658 dump += "hash: " + _object->_packet_hash.toHex() + "\n";
659 dump += "flags: " + hexFromByte(_object->_flags) + "\n";
660 //dump += " header_type: " + std::to_string(_object->_header_type) + "\n";
661 dump += " header_type: ";
662 switch (_object->_header_type) {
663 case HEADER_1:
664 dump += "HEADER_1\n";
665 break;
666 case HEADER_2:
667 encrypted = false;
668 dump += "HEADER_2\n";
669 break;
670 default:
671 std::to_string(_object->_header_type) + "\n";
672 }
673 //dump += " context_flag: " + std::to_string(_object->_context_flag) + "\n";
674 dump += " context_flag: ";
675 switch (_object->_context_flag) {
676 case FLAG_SET:
677 dump += "SET\n";
678 break;
679 case FLAG_UNSET:
680 encrypted = false;
681 dump += "UNSET\n";
682 break;
683 default:
684 std::to_string(_object->_context_flag) + "\n";
685 }
686 //dump += " propagation_type: " + std::to_string(_object->_transport_type) + "\n";
687 dump += " propagation_type: ";
688 switch (_object->_transport_type) {
689 case Type::Transport::BROADCAST:
690 dump += "BROADCAST\n";
691 break;
692 case Type::Transport::TRANSPORT:
693 dump += "TRANSPORT\n";
694 break;
695 case Type::Transport::RELAY:
696 dump += "RELAY\n";
697 break;
698 case Type::Transport::TUNNEL:
699 dump += "TUNNEL\n";
700 break;
701 case Type::Transport::NONE:
702 dump += "NONE\n";
703 break;
704 default:
705 std::to_string(_object->_transport_type) + "\n";

Callers

nothing calls this directly

Calls 6

toHexMethod · 0.80
leftMethod · 0.80
midMethod · 0.80
rightMethod · 0.80
typeMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected