latest.ipv8.messaging.anonymization.exit_socket
Module Contents
Classes
Class to verify that only IPv8-allowed traffic is being forwarded. |
|
Protocol used by TunnelExitSocket. |
|
Socket for exit nodes that communicates with the outside world. |
- class latest.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 latest.ipv8.messaging.anonymization.exit_socket.TunnelProtocol(received_cb: Callable, local_addr: ipv8.types.Address)
Bases:
asyncio.DatagramProtocol
Protocol used by TunnelExitSocket.
- async open() asyncio.DatagramTransport
Opens a datagram endpoint and returns the Transport.
- class latest.ipv8.messaging.anonymization.exit_socket.TunnelExitSocket(circuit_id: int, hop: latest.ipv8.messaging.anonymization.tunnel.Hop, overlay: ipv8.messaging.anonymization.community.TunnelCommunity)
Bases:
latest.ipv8.messaging.anonymization.tunnel.RoutingObject
,latest.ipv8.taskmanager.TaskManager
Socket for exit nodes that communicates with the outside world.
- 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.