3.0.ipv8.peerdiscovery.payload ============================== .. py:module:: 3.0.ipv8.peerdiscovery.payload Classes ------- .. autoapisummary:: 3.0.ipv8.peerdiscovery.payload.SimilarityRequestPayload 3.0.ipv8.peerdiscovery.payload.SimilarityResponsePayload 3.0.ipv8.peerdiscovery.payload.PingPayload 3.0.ipv8.peerdiscovery.payload.PongPayload 3.0.ipv8.peerdiscovery.payload.DiscoveryIntroductionRequestPayload Module Contents --------------- .. py:class:: SimilarityRequestPayload(identifier: int, lan_address: 3.0.ipv8.types.Address, wan_address: 3.0.ipv8.types.Address, connection_type: str, preference_list: list[bytes]) Bases: :py:obj:`3.0.ipv8.messaging.payload.Payload` Payload to request overlap with our own Community instances. .. py:attribute:: msg_id :value: 1 .. py:attribute:: format_list :value: ['H', 'ipv4', 'ipv4', 'bits', 'raw'] .. py:attribute:: identifier .. py:attribute:: preference_list .. py:attribute:: lan_address .. py:attribute:: wan_address .. py:attribute:: connection_type .. py:method:: to_pack_list() -> list[tuple] Pack our values. .. py:method:: from_unpack_list(identifier: int, lan_address: 3.0.ipv8.types.Address, wan_address: 3.0.ipv8.types.Address, connection_type_0: int, connection_type_1: int, dflag0: int, dflag1: int, dflag2: int, dflag3: int, dflag4: int, dflag5: int, preference_list: bytes) -> SimilarityRequestPayload :classmethod: Unpack a SimilarityRequestPayload. .. py:class:: SimilarityResponsePayload(identifier: int, preference_list: list[bytes], tb_overlap: list[tuple[bytes, int]]) Bases: :py:obj:`3.0.ipv8.messaging.payload.Payload` Payload to respond with overlap with our own Community instances. .. py:attribute:: msg_id :value: 2 .. py:attribute:: format_list :value: ['H', 'varlenHx20', 'raw'] .. py:attribute:: identifier .. py:attribute:: preference_list .. py:attribute:: tb_overlap .. py:method:: to_pack_list() -> list[tuple] Pack our values. .. py:method:: from_unpack_list(identifier: int, preference_list: bytes, tb_overlap: bytes) -> SimilarityResponsePayload :classmethod: Unpack a SimilarityResponsePayload. .. py:class:: PingPayload(identifier: int) Bases: :py:obj:`3.0.ipv8.messaging.payload.Payload` Payload used to ask for a pong. .. py:attribute:: msg_id :value: 3 .. py:attribute:: format_list :value: ['H'] .. py:attribute:: identifier .. py:method:: to_pack_list() -> list[tuple] Pack our values. .. py:method:: from_unpack_list(identifier: int) -> PingPayload :classmethod: Unpack a PingPayload. .. py:class:: PongPayload(identifier: int) Bases: :py:obj:`PingPayload` Payload used to answer a ping. .. py:attribute:: msg_id :value: 4 .. py:class:: DiscoveryIntroductionRequestPayload(introduce_to: bytes, destination_address: 3.0.ipv8.types.Address, source_lan_address: 3.0.ipv8.types.Address, source_wan_address: 3.0.ipv8.types.Address, advice: bool, connection_type: str, identifier: int, extra_bytes: bytes) Bases: :py:obj:`3.0.ipv8.messaging.payload.IntroductionRequestPayload` Custom introduction request override for Dispersy backward compatibility. .. py:attribute:: format_list :value: ['c20s', 'ipv4', 'ipv4', 'ipv4', 'bits', 'H', 'raw'] .. py:attribute:: introduce_to .. py:method:: to_pack_list() -> list[tuple] Pack our values. .. py:method:: from_unpack_list(introduce_to: bytes, destination_address: 3.0.ipv8.types.Address, source_lan_address: 3.0.ipv8.types.Address, source_wan_address: 3.0.ipv8.types.Address, connection_type_0: int, connection_type_1: int, dflag0: bool, dflag1: bool, dflag2: bool, tunnel: bool, _: bool, advice: bool, identifier: bool, extra_bytes: bytes) -> DiscoveryIntroductionRequestPayload :classmethod: Unpack a DiscoveryIntroductionRequestPayload.