hpimdm/packet/PacketHPIMSync.py
def bytes(self) -> bytes:
        """
        Obtain Protocol Sync Packet in a format to be transmitted (JSON)
        """
        trees = []
        for entry in self.upstream_trees:
            trees.append(entry.bytes())

        msg = {"SYNC_SN": self.sync_sequence_number,
               "MY_SNAPSHOT_SN": self.my_snapshot_sn,
               "NEIGHBOR_SNAPSHOT_SN": self.neighbor_snapshot_sn,
               "NEIGHBOR_BOOT_TIME": self.neighbor_boot_time,
               "TREES": trees,
               "MASTER_FLAG": self.master_flag,
               "MORE_FLAG": self.more_flag,
               "HELLO_OPTIONS": {}
              }
        for hello_option in self.options.values():
            msg["HELLO_OPTIONS"].update(hello_option.bytes())

        return msg

        Obtain Protocol Sync Packet in a format to be transmitted (JSON)
        
Obtain Protocol Sync Packet in a format to be transmitted (JSON)
Obtain Protocol Sync Packet in a format to be transmitted ( JSON )
def bytes(self) -> bytes:
        trees = []
        for entry in self.upstream_trees:
            trees.append(entry.bytes())
        msg = {"SYNC_SN": self.sync_sequence_number,
               "MY_SNAPSHOT_SN": self.my_snapshot_sn,
               "NEIGHBOR_SNAPSHOT_SN": self.neighbor_snapshot_sn,
               "NEIGHBOR_BOOT_TIME": self.neighbor_boot_time,
               "TREES": trees,
               "MASTER_FLAG": self.master_flag,
               "MORE_FLAG": self.more_flag,
               "HELLO_OPTIONS": {}
              }
        for hello_option in self.options.values():
            msg["HELLO_OPTIONS"].update(hello_option.bytes())
        return msg
def bytes ( self ) -> bytes : trees = [ ] for entry in self . upstream_trees : trees . append ( entry . bytes ( ) ) msg = { "SYNC_SN" : self . sync_sequence_number , "MY_SNAPSHOT_SN" : self . my_snapshot_sn , "NEIGHBOR_SNAPSHOT_SN" : self . neighbor_snapshot_sn , "NEIGHBOR_BOOT_TIME" : self . neighbor_boot_time , "TREES" : trees , "MASTER_FLAG" : self . master_flag , "MORE_FLAG" : self . more_flag , "HELLO_OPTIONS" : { } } for hello_option in self . options . values ( ) : msg [ "HELLO_OPTIONS" ] . update ( hello_option . bytes ( ) ) return msg
Obtain Protocol Sync Packet in a format to be transmitted (JSON)
Obtain Protocol Sync Packet in a format to be transmitted ( JSON )
"""
        Obtain Protocol Sync Packet in a format to be transmitted (JSON)
        """
self