3.0.ipv8.messaging.payload ========================== .. py:module:: 3.0.ipv8.messaging.payload Classes ------- .. autoapisummary:: 3.0.ipv8.messaging.payload.IntroductionRequestPayload 3.0.ipv8.messaging.payload.NewIntroductionRequestPayload 3.0.ipv8.messaging.payload.IntroductionResponsePayload 3.0.ipv8.messaging.payload.NewIntroductionResponsePayload 3.0.ipv8.messaging.payload.PunctureRequestPayload 3.0.ipv8.messaging.payload.NewPunctureRequestPayload 3.0.ipv8.messaging.payload.PuncturePayload 3.0.ipv8.messaging.payload.NewPuncturePayload Functions --------- .. autoapisummary:: 3.0.ipv8.messaging.payload.encode_connection_type 3.0.ipv8.messaging.payload.decode_connection_type Module Contents --------------- .. py:function:: encode_connection_type(type: str) -> tuple[int, int] Convert a type string to a tuple. .. py:function:: decode_connection_type(bit_0: int, bit_1: int) -> str Convert connection type flags to a type string. .. py:class:: IntroductionRequestPayload(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, supports_new_style: bool = True) Bases: :py:obj:`3.0.ipv8.messaging.serialization.Payload` Payload sent to peers that we are not connected to yet but have been punctured for us. .. py:attribute:: msg_id :value: 246 .. py:attribute:: format_list :value: ['ipv4', 'ipv4', 'ipv4', 'bits', 'H', 'raw'] .. py:attribute:: destination_address .. py:attribute:: source_lan_address .. py:attribute:: source_wan_address .. py:attribute:: advice .. py:attribute:: supports_new_style .. py:attribute:: connection_type .. py:attribute:: identifier .. py:attribute:: extra_bytes .. py:method:: to_pack_list() -> list[tuple] Convert this payload to a pack list. .. py:method:: from_unpack_list(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: bool, connection_type_1: bool, supports_new_style: bool, dflag1: bool, dflag2: bool, tunnel: bool, sync: bool, advice: bool, identifier: int, extra_bytes: bytes) -> IntroductionRequestPayload :classmethod: Unpack a payload from the given data. .. py:class:: NewIntroductionRequestPayload(*args: Any, **kwargs) Bases: :py:obj:`3.0.ipv8.messaging.lazy_payload.VariablePayloadWID` New introduction request that supports non-IPv4 addresses. .. py:attribute:: msg_id :value: 234 .. py:attribute:: format_list :value: ['ip_address', 'ip_address', 'ip_address', 'H', 'bits', 'raw'] .. py:attribute:: names :value: ['destination_address', 'source_lan_address', 'source_wan_address', 'identifier',... .. py:attribute:: destination_address :type: 3.0.ipv8.types.Address .. py:attribute:: source_lan_address :type: 3.0.ipv8.types.Address .. py:attribute:: source_wan_address :type: 3.0.ipv8.types.Address .. py:attribute:: identifier :type: int .. py:attribute:: connection_type_0 :type: int .. py:attribute:: connection_type_1 :type: int .. py:attribute:: supports_new_style :type: int .. py:attribute:: dflag1 :type: int .. py:attribute:: dflag2 :type: int .. py:attribute:: tunnel :type: int .. py:attribute:: sync :type: int .. py:attribute:: advice :type: int .. py:attribute:: extra_bytes :type: bytes .. py:class:: IntroductionResponsePayload(destination_address: 3.0.ipv8.types.Address, source_lan_address: 3.0.ipv8.types.Address, source_wan_address: 3.0.ipv8.types.Address, lan_introduction_address: 3.0.ipv8.types.Address, wan_introduction_address: 3.0.ipv8.types.Address, connection_type: str, identifier: int, extra_bytes: bytes, supports_new_style: bool = True, intro_supports_new_style: bool = False, peer_limit_reached: bool = False) Bases: :py:obj:`3.0.ipv8.messaging.serialization.Payload` Response to introduction requests. .. py:attribute:: msg_id :value: 245 .. py:attribute:: format_list :value: ['ipv4', 'ipv4', 'ipv4', 'ipv4', 'ipv4', 'bits', 'H', 'raw'] .. py:attribute:: destination_address .. py:attribute:: source_lan_address .. py:attribute:: source_wan_address .. py:attribute:: lan_introduction_address .. py:attribute:: wan_introduction_address .. py:attribute:: connection_type .. py:attribute:: supports_new_style .. py:attribute:: intro_supports_new_style .. py:attribute:: peer_limit_reached .. py:attribute:: identifier .. py:attribute:: extra_bytes .. py:method:: to_pack_list() -> list[tuple] Convert this payload to a pack list. .. py:method:: from_unpack_list(destination_address: 3.0.ipv8.types.Address, source_lan_address: 3.0.ipv8.types.Address, source_wan_address: 3.0.ipv8.types.Address, introduction_lan_address: 3.0.ipv8.types.Address, introduction_wan_address: 3.0.ipv8.types.Address, connection_type_0: bool, connection_type_1: bool, dflag0: bool, supports_new_style: bool, intro_supports_new_style: bool, peer_limit_reached: bool, dflag4: bool, dflag5: bool, identifier: int, extra_bytes: bytes) -> IntroductionResponsePayload :classmethod: Convert the raw data to a payload. .. py:class:: NewIntroductionResponsePayload(*args: Any, **kwargs) Bases: :py:obj:`3.0.ipv8.messaging.lazy_payload.VariablePayloadWID` New introduction response that supports non-IPv4 addresses. .. py:attribute:: msg_id :value: 233 .. py:attribute:: format_list :value: ['ip_address', 'ip_address', 'ip_address', 'ip_address', 'ip_address', 'H', 'bits', 'raw'] .. py:attribute:: names :value: ['destination_address', 'source_lan_address', 'source_wan_address', 'lan_introduction_address',... .. py:attribute:: destination_address :type: 3.0.ipv8.types.Address .. py:attribute:: source_lan_address :type: 3.0.ipv8.types.Address .. py:attribute:: source_wan_address :type: 3.0.ipv8.types.Address .. py:attribute:: lan_introduction_address :type: 3.0.ipv8.types.Address .. py:attribute:: wan_introduction_address :type: 3.0.ipv8.types.Address .. py:attribute:: identifier :type: int .. py:attribute:: intro_supports_new_style :type: bool .. py:attribute:: flag1 :type: int .. py:attribute:: flag2 :type: int .. py:attribute:: flag3 :type: int .. py:attribute:: flag4 :type: int .. py:attribute:: flag5 :type: int .. py:attribute:: flag6 :type: int .. py:attribute:: flag7 :type: int .. py:attribute:: extra_bytes :type: bytes .. py:class:: PunctureRequestPayload(lan_walker_address: 3.0.ipv8.types.Address, wan_walker_address: 3.0.ipv8.types.Address, identifier: int) Bases: :py:obj:`3.0.ipv8.messaging.serialization.Payload` Payload to ask someone to puncture a third party for us. .. py:attribute:: msg_id :value: 250 .. py:attribute:: format_list :value: ['ipv4', 'ipv4', 'H'] .. py:attribute:: lan_walker_address .. py:attribute:: wan_walker_address .. py:attribute:: identifier .. py:method:: to_pack_list() -> list[tuple] Convert this payload to a pack list. .. py:method:: from_unpack_list(lan_walker_address: 3.0.ipv8.types.Address, wan_walker_address: 3.0.ipv8.types.Address, identifier: int) -> PunctureRequestPayload :classmethod: Create a payload from the given data. .. py:class:: NewPunctureRequestPayload(*args: Any, **kwargs) Bases: :py:obj:`3.0.ipv8.messaging.lazy_payload.VariablePayloadWID` New puncture request that supports non-IPv4 addresses. .. py:attribute:: msg_id :value: 232 .. py:attribute:: format_list :value: ['ip_address', 'ip_address', 'H'] .. py:attribute:: names :value: ['lan_walker_address', 'wan_walker_address', 'identifier'] .. py:attribute:: lan_walker_address :type: 3.0.ipv8.types.Address .. py:attribute:: wan_walker_address :type: 3.0.ipv8.types.Address .. py:attribute:: identifier :type: int .. py:class:: PuncturePayload(source_lan_address: 3.0.ipv8.types.Address, source_wan_address: 3.0.ipv8.types.Address, identifier: int) Bases: :py:obj:`3.0.ipv8.messaging.serialization.Payload` Attempt to puncture a NAT layer. .. py:attribute:: msg_id :value: 249 .. py:attribute:: format_list :value: ['ipv4', 'ipv4', 'H'] .. py:attribute:: source_lan_address .. py:attribute:: source_wan_address .. py:attribute:: identifier .. py:method:: to_pack_list() -> list[tuple] Convert this payload to a pack list. .. py:method:: from_unpack_list(lan_walker_address: 3.0.ipv8.types.Address, wan_walker_address: 3.0.ipv8.types.Address, identifier: int) -> PuncturePayload :classmethod: Conver the given data to a payload. .. py:class:: NewPuncturePayload(*args: Any, **kwargs) Bases: :py:obj:`3.0.ipv8.messaging.lazy_payload.VariablePayloadWID` New puncture payload that supports non-IPv4 addresses. .. py:attribute:: msg_id :value: 231 .. py:attribute:: format_list :value: ['ip_address', 'ip_address', 'H'] .. py:attribute:: names :value: ['source_lan_address', 'source_wan_address', 'identifier'] .. py:attribute:: source_lan_address :type: 3.0.ipv8.types.Address .. py:attribute:: source_wan_address :type: 3.0.ipv8.types.Address .. py:attribute:: identifier :type: int