hpimdm/packet/PacketHPIMSync.py
def parse_bytes(data: bytes):
        """
        Parse received Protocol Sync Packet and all its entries from JSON format
        and convert it into ProtocolSync object and PacketProtocolSyncEntries
        """
        trees = []
        for entry in data["TREES"]:
            trees.append(PacketHPIMSyncEntryJson.parse_bytes(entry))

        sync_sn = data["SYNC_SN"]
        my_snapshot_sn = data["MY_SNAPSHOT_SN"]
        neighbor_snapshot_sn = data["NEIGHBOR_SNAPSHOT_SN"]
        neighbor_boot_time = data["NEIGHBOR_BOOT_TIME"]
        master_flag = data["MASTER_FLAG"]
        more_flag = data["MORE_FLAG"]
        hello_options = data["HELLO_OPTIONS"]
        sync_msg = PacketHPIMSyncJson(my_snapshot_sn, neighbor_snapshot_sn, sync_sn, trees, master_flag,
                                      more_flag, neighbor_boot_time)
        for (key, value) in hello_options.items():
            option = PacketHPIMHelloOptionsJson.parse_bytes((key, value))
            sync_msg.add_hello_option(option)

        return sync_msg

        Parse received Protocol Sync Packet and all its entries from JSON format
        and convert it into ProtocolSync object and PacketProtocolSyncEntries
        
Parse received Protocol Sync Packet and all its entries from JSON format
and convert it into ProtocolSync object and PacketProtocolSyncEntries
Parse received Protocol Sync Packet and all its entries from JSON format and convert it into ProtocolSync object and PacketProtocolSyncEntries
def parse_bytes(data: bytes):
        trees = []
        for entry in data["TREES"]:
            trees.append(PacketHPIMSyncEntryJson.parse_bytes(entry))
        sync_sn = data["SYNC_SN"]
        my_snapshot_sn = data["MY_SNAPSHOT_SN"]
        neighbor_snapshot_sn = data["NEIGHBOR_SNAPSHOT_SN"]
        neighbor_boot_time = data["NEIGHBOR_BOOT_TIME"]
        master_flag = data["MASTER_FLAG"]
        more_flag = data["MORE_FLAG"]
        hello_options = data["HELLO_OPTIONS"]
        sync_msg = PacketHPIMSyncJson(my_snapshot_sn, neighbor_snapshot_sn, sync_sn, trees, master_flag,
                                      more_flag, neighbor_boot_time)
        for (key, value) in hello_options.items():
            option = PacketHPIMHelloOptionsJson.parse_bytes((key, value))
            sync_msg.add_hello_option(option)
        return sync_msg
def parse_bytes ( data : bytes ) : trees = [ ] for entry in data [ "TREES" ] : trees . append ( PacketHPIMSyncEntryJson . parse_bytes ( entry ) ) sync_sn = data [ "SYNC_SN" ] my_snapshot_sn = data [ "MY_SNAPSHOT_SN" ] neighbor_snapshot_sn = data [ "NEIGHBOR_SNAPSHOT_SN" ] neighbor_boot_time = data [ "NEIGHBOR_BOOT_TIME" ] master_flag = data [ "MASTER_FLAG" ] more_flag = data [ "MORE_FLAG" ] hello_options = data [ "HELLO_OPTIONS" ] sync_msg = PacketHPIMSyncJson ( my_snapshot_sn , neighbor_snapshot_sn , sync_sn , trees , master_flag , more_flag , neighbor_boot_time ) for ( key , value ) in hello_options . items ( ) : option = PacketHPIMHelloOptionsJson . parse_bytes ( ( key , value ) ) sync_msg . add_hello_option ( option ) return sync_msg
Parse received Protocol Sync Packet and all its entries from JSON format
and convert it into ProtocolSync object and PacketProtocolSyncEntries
Parse received Protocol Sync Packet and all its entries from JSON format and convert it into ProtocolSync object and PacketProtocolSyncEntries
"""
        Parse received Protocol Sync Packet and all its entries from JSON format
        and convert it into ProtocolSync object and PacketProtocolSyncEntries
        """
data
bytes