3.0.ipv8.messaging.anonymization.exit_socket
Classes
Module Contents
- class 3.0.ipv8.messaging.anonymization.exit_socket.DataChecker
Class to verify that only IPv8-allowed traffic is being forwarded.
- static could_be_utp(data: bytes) bool
Check if this data could be uTP (see also https://www.bittorrent.org/beps/bep_0029.html).
Packets should be 20 bytes or larger.
- The type should be 0..4:
0: ST_DATA
1: ST_FIN
2: ST_STATE
3: ST_RESET
4: ST_SYN
The version should be 1.
- The extension should be 0..3:
0: No extension
1: Selective ACK
2: Deprecated
3: Close reason
- class 3.0.ipv8.messaging.anonymization.exit_socket.TunnelProtocol(received_cb: Callable, local_addr: ipv8.types.Address)
Bases:
asyncio.DatagramProtocolProtocol used by TunnelExitSocket.
- received_cb
- local_addr
- logger
- async open() asyncio.DatagramTransport
Opens a datagram endpoint and returns the Transport.
- class 3.0.ipv8.messaging.anonymization.exit_socket.TunnelExitSocket(circuit_id: int, hop: 3.0.ipv8.messaging.anonymization.tunnel.Hop, overlay: ipv8.messaging.anonymization.community.TunnelCommunity)
Bases:
3.0.ipv8.messaging.anonymization.tunnel.RoutingObject,3.0.ipv8.taskmanager.TaskManagerSocket for exit nodes that communicates with the outside world.
- hop
- overlay
- transport_ipv4: asyncio.DatagramTransport | None = None
- transport_ipv6: asyncio.DatagramTransport | None = None
- queue: collections.deque[tuple[bytes, ipv8.types.Address]]
- enabled = False
- enable() None
Allow data to be sent.
This creates the datagram endpoints that allows us to send messages.
- sendto(data: bytes, destination: ipv8.types.Address) None
Send o message over our datagram transporter.
- async resolve(address: ipv8.types.Address) ipv8.types.Address
Using asyncio’s getaddrinfo since the aiodns resolver seems to have issues. Returns [(family, type, proto, canonname, sockaddr)].
- datagram_received_ipv4(data: bytes, source: ipv8.types.Address) None
Callback for when data is received by the IPv4 socket.
- datagram_received_ipv6(data: bytes, source: ipv8.types.Address) None
Callback for when data is received by the IPv6 socket.
- datagram_received(data: bytes, source: ipv8.types.Address) None
Callback for when data is received by a IPv4/IPv6 socket.