3.0.ipv8.messaging.anonymization.payload ======================================== .. py:module:: 3.0.ipv8.messaging.anonymization.payload Attributes ---------- .. autoapisummary:: 3.0.ipv8.messaging.anonymization.payload.NO_CRYPTO_PACKETS Classes ------- .. autoapisummary:: 3.0.ipv8.messaging.anonymization.payload.CellablePayload 3.0.ipv8.messaging.anonymization.payload.ExtraIntroductionPayload 3.0.ipv8.messaging.anonymization.payload.DataPayload 3.0.ipv8.messaging.anonymization.payload.CreatePayload 3.0.ipv8.messaging.anonymization.payload.CreatedPayload 3.0.ipv8.messaging.anonymization.payload.ExtendPayload 3.0.ipv8.messaging.anonymization.payload.ExtendedPayload 3.0.ipv8.messaging.anonymization.payload.PingPayload 3.0.ipv8.messaging.anonymization.payload.PongPayload 3.0.ipv8.messaging.anonymization.payload.DestroyPayload 3.0.ipv8.messaging.anonymization.payload.EstablishIntroPayload 3.0.ipv8.messaging.anonymization.payload.IntroEstablishedPayload 3.0.ipv8.messaging.anonymization.payload.EstablishRendezvousPayload 3.0.ipv8.messaging.anonymization.payload.RendezvousEstablishedPayload 3.0.ipv8.messaging.anonymization.payload.CreateE2EPayload 3.0.ipv8.messaging.anonymization.payload.CreatedE2EPayload 3.0.ipv8.messaging.anonymization.payload.LinkE2EPayload 3.0.ipv8.messaging.anonymization.payload.LinkedE2EPayload 3.0.ipv8.messaging.anonymization.payload.PeersRequestPayload 3.0.ipv8.messaging.anonymization.payload.IntroductionInfo 3.0.ipv8.messaging.anonymization.payload.PeersResponsePayload 3.0.ipv8.messaging.anonymization.payload.RendezvousInfo 3.0.ipv8.messaging.anonymization.payload.TestRequestPayload 3.0.ipv8.messaging.anonymization.payload.TestResponsePayload 3.0.ipv8.messaging.anonymization.payload.Flags 3.0.ipv8.messaging.anonymization.payload.CellPayload Module Contents --------------- .. py:class:: CellablePayload(*args: Any, **kwargs) Bases: :py:obj:`3.0.ipv8.messaging.lazy_payload.VariablePayloadWID` Payloads need a ``msg_id`` and a ``circuit_id`` to be turned into a tunnel-able cell. .. py:attribute:: circuit_id :type: int .. py:class:: ExtraIntroductionPayload(*args: Any, **kwargs) Bases: :py:obj:`3.0.ipv8.messaging.lazy_payload.VariablePayload` Payload to piggyback onto introduction messages. .. py:attribute:: names :value: ['flags'] .. py:attribute:: format_list :value: ['flags'] .. py:attribute:: flags :type: list[int] .. py:class:: DataPayload(*args: Any, **kwargs) Bases: :py:obj:`CellablePayload` Payload to transfer raw data over a circuit. .. py:attribute:: msg_id :value: 1 .. py:attribute:: names :value: ['circuit_id', 'dest_address', 'org_address', 'data'] .. py:attribute:: format_list :value: ['I', 'address', 'address', 'raw'] .. py:attribute:: circuit_id :type: int .. py:attribute:: dest_address :type: 3.0.ipv8.types.Address .. py:attribute:: org_address :type: 3.0.ipv8.types.Address .. py:attribute:: data :type: bytes .. py:class:: CreatePayload(*args: Any, **kwargs) Bases: :py:obj:`CellablePayload` Payload to initiate circuit creation. .. py:attribute:: msg_id :value: 2 .. py:attribute:: names :value: ['circuit_id', 'identifier', 'node_public_key', 'key'] .. py:attribute:: format_list :value: ['I', 'H', 'varlenH', 'varlenH'] .. py:attribute:: circuit_id :type: int .. py:attribute:: identifier :type: int .. py:attribute:: node_public_key :type: bytes .. py:attribute:: key :type: bytes .. py:class:: CreatedPayload(*args: Any, **kwargs) Bases: :py:obj:`CellablePayload` Payload to signal initial circuit first-hop completion. .. py:attribute:: msg_id :value: 3 .. py:attribute:: names :value: ['circuit_id', 'identifier', 'key', 'auth', 'candidates_enc'] .. py:attribute:: format_list :value: ['I', 'H', 'varlenH', '32s', 'raw'] .. py:attribute:: circuit_id :type: int .. py:attribute:: identifier :type: int .. py:attribute:: key :type: bytes .. py:attribute:: auth :type: bytes .. py:attribute:: candidates_enc :type: bytes .. py:class:: ExtendPayload(*args: Any, **kwargs) Bases: :py:obj:`CellablePayload` Payload to initiate circuit extension. .. py:attribute:: msg_id :value: 4 .. py:attribute:: names :value: ['circuit_id', 'identifier', 'node_public_key', 'key', 'node_addr'] .. py:attribute:: format_list :value: ['I', 'H', 'varlenH', 'varlenH', 'ip_address'] .. py:attribute:: circuit_id :type: int .. py:attribute:: identifier :type: int .. py:attribute:: node_public_key :type: bytes .. py:attribute:: key :type: bytes .. py:attribute:: node_addr :type: 3.0.ipv8.types.Address .. py:class:: ExtendedPayload(*args: Any, **kwargs) Bases: :py:obj:`CellablePayload` Payload to signal extension completion. .. py:attribute:: msg_id :value: 5 .. py:attribute:: names :value: ['circuit_id', 'identifier', 'key', 'auth', 'candidates_enc'] .. py:attribute:: format_list :value: ['I', 'H', 'varlenH', '32s', 'raw'] .. py:attribute:: circuit_id :type: int .. py:attribute:: identifier :type: int .. py:attribute:: key :type: bytes .. py:attribute:: auth :type: bytes .. py:attribute:: candidates_enc :type: bytes .. py:class:: PingPayload(*args: Any, **kwargs) Bases: :py:obj:`CellablePayload` Payload to ping over a circuit. .. py:attribute:: msg_id :value: 6 .. py:attribute:: names :value: ['circuit_id', 'identifier'] .. py:attribute:: format_list :value: ['I', 'H'] .. py:attribute:: circuit_id :type: int .. py:attribute:: identifier :type: int .. py:class:: PongPayload(*args: Any, **kwargs) Bases: :py:obj:`CellablePayload` Payload to pong over a circuit. .. py:attribute:: msg_id :value: 7 .. py:attribute:: names :value: ['circuit_id', 'identifier'] .. py:attribute:: format_list :value: ['I', 'H'] .. py:attribute:: circuit_id :type: int .. py:attribute:: identifier :type: int .. py:class:: DestroyPayload(*args: Any, **kwargs) Bases: :py:obj:`CellablePayload` Payload to signal destruction of a circuit. .. py:attribute:: msg_id :value: 8 .. py:attribute:: names :value: ['circuit_id', 'reason'] .. py:attribute:: format_list :value: ['I', 'H'] .. py:attribute:: circuit_id :type: int .. py:attribute:: reason :type: int .. py:class:: EstablishIntroPayload(*args: Any, **kwargs) Bases: :py:obj:`CellablePayload` Payload to initiate establishment of an introduction point. .. py:attribute:: msg_id :value: 9 .. py:attribute:: names :value: ['circuit_id', 'identifier', 'info_hash', 'public_key'] .. py:attribute:: format_list :value: ['I', 'H', '20s', 'varlenH'] .. py:attribute:: circuit_id :type: int .. py:attribute:: identifier :type: int .. py:attribute:: info_hash :type: bytes .. py:attribute:: public_key :type: bytes .. py:class:: IntroEstablishedPayload(*args: Any, **kwargs) Bases: :py:obj:`CellablePayload` Payload to signal completion of introduction point establishment. .. py:attribute:: msg_id :value: 10 .. py:attribute:: names :value: ['circuit_id', 'identifier'] .. py:attribute:: format_list :value: ['I', 'H'] .. py:attribute:: circuit_id :type: int .. py:attribute:: identifier :type: int .. py:class:: EstablishRendezvousPayload(*args: Any, **kwargs) Bases: :py:obj:`CellablePayload` Payload to initiate creation of a rendezvous point. .. py:attribute:: msg_id :value: 11 .. py:attribute:: names :value: ['circuit_id', 'identifier', 'cookie'] .. py:attribute:: format_list :value: ['I', 'H', '20s'] .. py:attribute:: circuit_id :type: int .. py:attribute:: identifier :type: int .. py:attribute:: cookie :type: bytes .. py:class:: RendezvousEstablishedPayload(*args: Any, **kwargs) Bases: :py:obj:`CellablePayload` Payload to signal completion of a rendezvous point. .. py:attribute:: msg_id :value: 12 .. py:attribute:: names :value: ['circuit_id', 'identifier', 'rendezvous_point_addr'] .. py:attribute:: format_list :value: ['I', 'H', 'ip_address'] .. py:attribute:: circuit_id :type: int .. py:attribute:: identifier :type: int .. py:attribute:: rendezvous_point_addr :type: 3.0.ipv8.types.Address .. py:class:: CreateE2EPayload(*args: Any, **kwargs) Bases: :py:obj:`3.0.ipv8.messaging.lazy_payload.VariablePayloadWID` Payload to initiate e2e hookup. .. py:attribute:: msg_id :value: 13 .. py:attribute:: names :value: ['identifier', 'info_hash', 'node_public_key', 'key'] .. py:attribute:: format_list :value: ['H', '20s', 'varlenH', 'varlenH'] .. py:attribute:: identifier :type: int .. py:attribute:: info_hash :type: bytes .. py:attribute:: node_public_key :type: bytes .. py:attribute:: key :type: bytes .. py:class:: CreatedE2EPayload(*args: Any, **kwargs) Bases: :py:obj:`3.0.ipv8.messaging.lazy_payload.VariablePayloadWID` Payload to signal completion of e2e hookup. .. py:attribute:: msg_id :value: 14 .. py:attribute:: names :value: ['identifier', 'key', 'auth', 'rp_info_enc'] .. py:attribute:: format_list :value: ['H', 'varlenH', '32s', 'raw'] .. py:attribute:: identifier :type: int .. py:attribute:: key :type: bytes .. py:attribute:: auth :type: bytes .. py:attribute:: rp_info_enc :type: bytes .. py:class:: LinkE2EPayload(*args: Any, **kwargs) Bases: :py:obj:`CellablePayload` Payload to initiate completion linking of an e2e hookup. .. py:attribute:: msg_id :value: 15 .. py:attribute:: names :value: ['circuit_id', 'identifier', 'cookie'] .. py:attribute:: format_list :value: ['I', 'H', '20s'] .. py:attribute:: circuit_id :type: int .. py:attribute:: identifier :type: int .. py:attribute:: cookie :type: bytes .. py:class:: LinkedE2EPayload(*args: Any, **kwargs) Bases: :py:obj:`CellablePayload` Payload to signal completion of the final linking of the e2e circuit. .. py:attribute:: msg_id :value: 16 .. py:attribute:: names :value: ['circuit_id', 'identifier'] .. py:attribute:: format_list :value: ['I', 'H'] .. py:attribute:: circuit_id :type: int .. py:attribute:: identifier :type: int .. py:class:: PeersRequestPayload(*args: Any, **kwargs) Bases: :py:obj:`CellablePayload` Request for peer lookup for the given info hash. .. py:attribute:: msg_id :value: 17 .. py:attribute:: names :value: ['circuit_id', 'identifier', 'info_hash'] .. py:attribute:: format_list :value: ['I', 'H', '20s'] .. py:attribute:: circuit_id :type: int .. py:attribute:: identifier :type: int .. py:attribute:: info_hash :type: bytes .. py:class:: IntroductionInfo(*args: Any, **kwargs) Bases: :py:obj:`3.0.ipv8.messaging.lazy_payload.VariablePayload` Payload for introduction info. .. py:attribute:: names :value: ['address', 'key', 'seeder_pk', 'source'] .. py:attribute:: format_list :value: ['ip_address', 'varlenH', 'varlenH', 'B'] .. py:attribute:: address :type: 3.0.ipv8.types.Address .. py:attribute:: key :type: bytes .. py:attribute:: seeder_pk :type: bytes .. py:attribute:: source :type: int .. py:class:: PeersResponsePayload(*args: Any, **kwargs) Bases: :py:obj:`CellablePayload` Payload to respond with introduction info of peers for a given info hash. .. py:attribute:: msg_id :value: 18 .. py:attribute:: names :value: ['circuit_id', 'identifier', 'info_hash', 'peers'] .. py:attribute:: format_list .. py:attribute:: circuit_id :type: int .. py:attribute:: identifier :type: int .. py:attribute:: info_hash :type: bytes .. py:attribute:: peers :type: list[IntroductionInfo] .. py:class:: RendezvousInfo(*args: Any, **kwargs) Bases: :py:obj:`3.0.ipv8.messaging.lazy_payload.VariablePayload` Payload for rendezvous info. .. py:attribute:: names :value: ['address', 'key', 'cookie'] .. py:attribute:: format_list :value: ['ip_address', 'varlenH', '20s'] .. py:attribute:: address :type: 3.0.ipv8.types.Address .. py:attribute:: key :type: bytes .. py:attribute:: cookie :type: bytes .. py:class:: TestRequestPayload(*args: Any, **kwargs) Bases: :py:obj:`CellablePayload` Speedtest initiation. .. py:attribute:: msg_id :value: 19 .. py:attribute:: names :value: ['circuit_id', 'identifier', 'response_size', 'data'] .. py:attribute:: format_list :value: ['I', 'H', 'H', 'raw'] .. py:attribute:: circuit_id :type: int .. py:attribute:: identifier :type: int .. py:attribute:: response_size :type: int .. py:attribute:: data :type: bytes .. py:class:: TestResponsePayload(*args: Any, **kwargs) Bases: :py:obj:`CellablePayload` Speedtest response. .. py:attribute:: msg_id :value: 20 .. py:attribute:: names :value: ['circuit_id', 'identifier', 'data'] .. py:attribute:: format_list :value: ['I', 'H', 'raw'] .. py:attribute:: circuit_id :type: int .. py:attribute:: identifier :type: int .. py:attribute:: data :type: bytes .. py:class:: Flags(fmt: str = '>H') Bases: :py:obj:`3.0.ipv8.messaging.serialization.Packer` Packer for flags (default: as a short). .. py:attribute:: format .. py:attribute:: size .. py:method:: pack(data: list[int]) -> bytes Pack the individual flag integer values into a single integer and serialize them. .. py:method:: unpack(data: bytes, offset: int, unpack_list: list, *args: object) -> int Uncompress the flags from their serialized form. .. py:class:: CellPayload(circuit_id: int, message: bytes, plaintext: bool = False, relay_early: bool = False) Raw circuit data. .. py:attribute:: msg_id :value: 0 .. py:attribute:: circuit_id .. py:attribute:: message .. py:attribute:: plaintext .. py:attribute:: relay_early .. py:method:: unwrap(prefix: bytes) -> bytes Reorder the binary format of this cell, injecting its prefix and circuit id. .. py:method:: to_bin(prefix: bytes) -> bytes Reorder the binary format of this cell, injecting its message id, circuit id and flags. .. py:method:: from_bin(packet: bytes) -> CellPayload :classmethod: Reconstruct a CellPayload from the given binary format, ordered using ``to_bin()``. .. py:data:: NO_CRYPTO_PACKETS