3.0.ipv8.dht.payload ==================== .. py:module:: 3.0.ipv8.dht.payload Classes ------- .. autoapisummary:: 3.0.ipv8.dht.payload.PingRequestPayload 3.0.ipv8.dht.payload.PingResponsePayload 3.0.ipv8.dht.payload.StoreRequestPayload 3.0.ipv8.dht.payload.StoreResponsePayload 3.0.ipv8.dht.payload.FindRequestPayload 3.0.ipv8.dht.payload.FindResponsePayload 3.0.ipv8.dht.payload.StorePeerRequestPayload 3.0.ipv8.dht.payload.StorePeerResponsePayload 3.0.ipv8.dht.payload.ConnectPeerRequestPayload 3.0.ipv8.dht.payload.ConnectPeerResponsePayload 3.0.ipv8.dht.payload.StrPayload 3.0.ipv8.dht.payload.SignedStrPayload 3.0.ipv8.dht.payload.NodePacker Module Contents --------------- .. py:class:: PingRequestPayload Bases: :py:obj:`3.0.ipv8.messaging.lazy_payload.VariablePayloadWID` Payload to send ping messages with a given identifier nonce. .. py:attribute:: msg_id :value: 1 .. py:attribute:: names :value: ['identifier'] .. py:attribute:: format_list :value: ['I'] .. py:attribute:: identifier :type: int .. py:class:: PingResponsePayload Bases: :py:obj:`3.0.ipv8.messaging.lazy_payload.VariablePayloadWID` Payload to respond to pings with a given identifier. .. py:attribute:: msg_id :value: 2 .. py:attribute:: names :value: ['identifier'] .. py:attribute:: format_list :value: ['I'] .. py:attribute:: identifier :type: int .. py:class:: StoreRequestPayload Bases: :py:obj:`3.0.ipv8.messaging.lazy_payload.VariablePayloadWID` Payload for a token-holder to send a target certain values to store, with a given identifier nonce. .. py:attribute:: msg_id :value: 3 .. py:attribute:: names :value: ['identifier', 'token', 'target', 'values'] .. py:attribute:: format_list :value: ['I', '20s', '20s', 'varlenH-list'] .. py:attribute:: identifier :type: int .. py:attribute:: token :type: bytes .. py:attribute:: target :type: bytes .. py:attribute:: values :type: list[bytes] .. py:class:: StoreResponsePayload Bases: :py:obj:`3.0.ipv8.messaging.lazy_payload.VariablePayloadWID` Response that the previously-given values have been stored. .. py:attribute:: msg_id :value: 4 .. py:attribute:: names :value: ['identifier'] .. py:attribute:: format_list :value: ['I'] .. py:attribute:: identifier :type: int .. py:class:: FindRequestPayload Bases: :py:obj:`3.0.ipv8.messaging.lazy_payload.VariablePayloadWID` Attempt for our lan address to have the given target fetch values and nodes for us from a given starting offset, potentially with a request to force new node connections even if some are already known. .. py:attribute:: msg_id :value: 5 .. py:attribute:: names :value: ['identifier', 'lan_address', 'target', 'offset', 'force_nodes'] .. py:attribute:: format_list :value: ['I', 'ip_address', '20s', 'I', '?'] .. py:attribute:: identifier :type: int .. py:attribute:: lan_address :type: 3.0.ipv8.types.Address .. py:attribute:: target :type: bytes .. py:attribute:: offset :type: int .. py:attribute:: force_nodes :type: bool .. py:class:: FindResponsePayload Bases: :py:obj:`3.0.ipv8.messaging.lazy_payload.VariablePayloadWID` Response to a find request with the known values and nodes for the queried starting offset. .. py:attribute:: msg_id :value: 6 .. py:attribute:: names :value: ['identifier', 'token', 'values', 'nodes'] .. py:attribute:: format_list :value: ['I', '20s', 'varlenH-list', 'node-list'] .. py:attribute:: identifier :type: int .. py:attribute:: token :type: bytes .. py:attribute:: values :type: list[bytes] .. py:attribute:: nodes :type: list[3.0.ipv8.dht.routing.Node] .. py:class:: StorePeerRequestPayload Bases: :py:obj:`3.0.ipv8.messaging.lazy_payload.VariablePayloadWID` Request to another node to register our own node (id) as a server of the given target. .. py:attribute:: msg_id :value: 7 .. py:attribute:: names :value: ['identifier', 'token', 'target'] .. py:attribute:: format_list :value: ['I', '20s', '20s'] .. py:attribute:: identifier :type: int .. py:attribute:: token :type: bytes .. py:attribute:: target :type: bytes .. py:class:: StorePeerResponsePayload Bases: :py:obj:`3.0.ipv8.messaging.lazy_payload.VariablePayloadWID` Confirmation that a node (id) has been stored as part of our tree. .. py:attribute:: msg_id :value: 8 .. py:attribute:: names :value: ['identifier'] .. py:attribute:: format_list :value: ['I'] .. py:attribute:: identifier :type: int .. py:class:: ConnectPeerRequestPayload Bases: :py:obj:`3.0.ipv8.messaging.lazy_payload.VariablePayloadWID` Request for our lan address to be introduced to peers in the target range. .. py:attribute:: msg_id :value: 9 .. py:attribute:: names :value: ['identifier', 'lan_address', 'target'] .. py:attribute:: format_list :value: ['I', 'ip_address', '20s'] .. py:attribute:: identifier :type: int .. py:attribute:: lan_address :type: 3.0.ipv8.types.Address .. py:attribute:: target :type: bytes .. py:class:: ConnectPeerResponsePayload Bases: :py:obj:`3.0.ipv8.messaging.lazy_payload.VariablePayloadWID` A response to a connection request, with the nodes that have been punctured (and are hopefully connectable). .. py:attribute:: msg_id :value: 10 .. py:attribute:: names :value: ['identifier', 'nodes'] .. py:attribute:: format_list :value: ['I', 'node-list'] .. py:attribute:: identifier :type: int .. py:attribute:: nodes :type: list[3.0.ipv8.dht.routing.Node] .. py:class:: StrPayload Bases: :py:obj:`3.0.ipv8.messaging.lazy_payload.VariablePayload` Paylaod to pack bytes. .. py:attribute:: names :value: ['data'] .. py:attribute:: format_list :value: ['raw'] .. py:attribute:: data :type: bytes .. py:class:: SignedStrPayload Bases: :py:obj:`3.0.ipv8.messaging.lazy_payload.VariablePayload` Payload to pack bytes with a version and a public key. .. py:attribute:: names :value: ['data', 'version', 'public_key'] .. py:attribute:: format_list :value: ['varlenH', 'I', 'varlenH'] .. py:attribute:: data :type: bytes .. py:attribute:: version :type: int .. py:attribute:: public_key :type: bytes .. py:class:: NodePacker(serializer: 3.0.ipv8.messaging.serialization.Serializer) Bases: :py:obj:`3.0.ipv8.messaging.serialization.Packer` Serialization packing format for DHT nodes. .. py:attribute:: serializer .. py:method:: pack(node: 3.0.ipv8.dht.routing.Node) -> bytes Pack the given node to bytes. .. py:method:: unpack(data: bytes, offset: int, unpack_list: list, *args: object) -> int Unpack the node format from the given offset in the data and add the unpacked object to the list.