latest.ipv8.messaging.payload

Module Contents

Classes

IntroductionRequestPayload

Payload sent to peers that we are not connected to yet but have been punctured for us.

NewIntroductionRequestPayload

New introduction request that supports non-IPv4 addresses.

IntroductionResponsePayload

Response to introduction requests.

NewIntroductionResponsePayload

New introduction response that supports non-IPv4 addresses.

PunctureRequestPayload

Payload to ask someone to puncture a third party for us.

NewPunctureRequestPayload

New puncture request that supports non-IPv4 addresses.

PuncturePayload

Attempt to puncture a NAT layer.

NewPuncturePayload

New puncture payload that supports non-IPv4 addresses.

Functions

encode_connection_type(→ tuple[int, int])

Convert a type string to a tuple.

decode_connection_type(→ str)

Convert connection type flags to a type string.

latest.ipv8.messaging.payload.encode_connection_type(type: str) tuple[int, int]

Convert a type string to a tuple.

latest.ipv8.messaging.payload.decode_connection_type(bit_0: int, bit_1: int) str

Convert connection type flags to a type string.

class latest.ipv8.messaging.payload.IntroductionRequestPayload(destination_address: latest.ipv8.types.Address, source_lan_address: latest.ipv8.types.Address, source_wan_address: latest.ipv8.types.Address, advice: bool, connection_type: str, identifier: int, extra_bytes: bytes, supports_new_style: bool = True)

Bases: latest.ipv8.messaging.serialization.Payload

Payload sent to peers that we are not connected to yet but have been punctured for us.

msg_id = 246
format_list = ['ipv4', 'ipv4', 'ipv4', 'bits', 'H', 'raw']
to_pack_list() list[tuple]

Convert this payload to a pack list.

classmethod from_unpack_list(destination_address: latest.ipv8.types.Address, source_lan_address: latest.ipv8.types.Address, source_wan_address: latest.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

Unpack a payload from the given data.

class latest.ipv8.messaging.payload.NewIntroductionRequestPayload(*args: Any, **kwargs)

Bases: latest.ipv8.messaging.lazy_payload.VariablePayloadWID

New introduction request that supports non-IPv4 addresses.

msg_id = 234
format_list = ['ip_address', 'ip_address', 'ip_address', 'H', 'bits', 'raw']
names = ['destination_address', 'source_lan_address', 'source_wan_address', 'identifier',...
destination_address: latest.ipv8.types.Address
source_lan_address: latest.ipv8.types.Address
source_wan_address: latest.ipv8.types.Address
identifier: int
connection_type_0: int
connection_type_1: int
supports_new_style: int
dflag1: int
dflag2: int
tunnel: int
sync: int
advice: int
extra_bytes: bytes
class latest.ipv8.messaging.payload.IntroductionResponsePayload(destination_address: latest.ipv8.types.Address, source_lan_address: latest.ipv8.types.Address, source_wan_address: latest.ipv8.types.Address, lan_introduction_address: latest.ipv8.types.Address, wan_introduction_address: latest.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: latest.ipv8.messaging.serialization.Payload

Response to introduction requests.

msg_id = 245
format_list = ['ipv4', 'ipv4', 'ipv4', 'ipv4', 'ipv4', 'bits', 'H', 'raw']
to_pack_list() list[tuple]

Convert this payload to a pack list.

classmethod from_unpack_list(destination_address: latest.ipv8.types.Address, source_lan_address: latest.ipv8.types.Address, source_wan_address: latest.ipv8.types.Address, introduction_lan_address: latest.ipv8.types.Address, introduction_wan_address: latest.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

Convert the raw data to a payload.

class latest.ipv8.messaging.payload.NewIntroductionResponsePayload(*args: Any, **kwargs)

Bases: latest.ipv8.messaging.lazy_payload.VariablePayloadWID

New introduction response that supports non-IPv4 addresses.

msg_id = 233
format_list = ['ip_address', 'ip_address', 'ip_address', 'ip_address', 'ip_address', 'H', 'bits', 'raw']
names = ['destination_address', 'source_lan_address', 'source_wan_address', 'lan_introduction_address',...
destination_address: latest.ipv8.types.Address
source_lan_address: latest.ipv8.types.Address
source_wan_address: latest.ipv8.types.Address
lan_introduction_address: latest.ipv8.types.Address
wan_introduction_address: latest.ipv8.types.Address
identifier: int
intro_supports_new_style: bool
flag1: int
flag2: int
flag3: int
flag4: int
flag5: int
flag6: int
flag7: int
extra_bytes: bytes
class latest.ipv8.messaging.payload.PunctureRequestPayload(lan_walker_address: latest.ipv8.types.Address, wan_walker_address: latest.ipv8.types.Address, identifier: int)

Bases: latest.ipv8.messaging.serialization.Payload

Payload to ask someone to puncture a third party for us.

msg_id = 250
format_list = ['ipv4', 'ipv4', 'H']
to_pack_list() list[tuple]

Convert this payload to a pack list.

classmethod from_unpack_list(lan_walker_address: latest.ipv8.types.Address, wan_walker_address: latest.ipv8.types.Address, identifier: int) PunctureRequestPayload

Create a payload from the given data.

class latest.ipv8.messaging.payload.NewPunctureRequestPayload(*args: Any, **kwargs)

Bases: latest.ipv8.messaging.lazy_payload.VariablePayloadWID

New puncture request that supports non-IPv4 addresses.

msg_id = 232
format_list = ['ip_address', 'ip_address', 'H']
names = ['lan_walker_address', 'wan_walker_address', 'identifier']
lan_walker_address: latest.ipv8.types.Address
wan_walker_address: latest.ipv8.types.Address
identifier: int
class latest.ipv8.messaging.payload.PuncturePayload(source_lan_address: latest.ipv8.types.Address, source_wan_address: latest.ipv8.types.Address, identifier: int)

Bases: latest.ipv8.messaging.serialization.Payload

Attempt to puncture a NAT layer.

msg_id = 249
format_list = ['ipv4', 'ipv4', 'H']
to_pack_list() list[tuple]

Convert this payload to a pack list.

classmethod from_unpack_list(lan_walker_address: latest.ipv8.types.Address, wan_walker_address: latest.ipv8.types.Address, identifier: int) PuncturePayload

Conver the given data to a payload.

class latest.ipv8.messaging.payload.NewPuncturePayload(*args: Any, **kwargs)

Bases: latest.ipv8.messaging.lazy_payload.VariablePayloadWID

New puncture payload that supports non-IPv4 addresses.

msg_id = 231
format_list = ['ip_address', 'ip_address', 'H']
names = ['source_lan_address', 'source_wan_address', 'identifier']
source_lan_address: latest.ipv8.types.Address
source_wan_address: latest.ipv8.types.Address
identifier: int