3.0.ipv8.messaging.anonymization.tunnel
Attributes
Classes
Module Contents
- 3.0.ipv8.messaging.anonymization.tunnel.FORWARD = 0
- 3.0.ipv8.messaging.anonymization.tunnel.BACKWARD = 1
- 3.0.ipv8.messaging.anonymization.tunnel.PEER_SOURCE_UNKNOWN = 0
- 3.0.ipv8.messaging.anonymization.tunnel.PEER_SOURCE_DHT = 1
- 3.0.ipv8.messaging.anonymization.tunnel.PEER_SOURCE_PEX = 2
- 3.0.ipv8.messaging.anonymization.tunnel.PEER_FLAG_RELAY = 1
- 3.0.ipv8.messaging.anonymization.tunnel.PEER_FLAG_EXIT_BT = 2
- 3.0.ipv8.messaging.anonymization.tunnel.PEER_FLAG_EXIT_IPV8 = 4
- 3.0.ipv8.messaging.anonymization.tunnel.PEER_FLAG_SPEED_TEST = 8
- 3.0.ipv8.messaging.anonymization.tunnel.CIRCUIT_TYPE_DATA = 'DATA'
- 3.0.ipv8.messaging.anonymization.tunnel.CIRCUIT_TYPE_IP_SEEDER = 'IP_SEEDER'
- 3.0.ipv8.messaging.anonymization.tunnel.CIRCUIT_TYPE_RP_SEEDER = 'RP_SEEDER'
- 3.0.ipv8.messaging.anonymization.tunnel.CIRCUIT_TYPE_RP_DOWNLOADER = 'RP_DOWNLOADER'
- 3.0.ipv8.messaging.anonymization.tunnel.CIRCUIT_STATE_READY = 'READY'
- 3.0.ipv8.messaging.anonymization.tunnel.CIRCUIT_STATE_EXTENDING = 'EXTENDING'
- 3.0.ipv8.messaging.anonymization.tunnel.CIRCUIT_STATE_CLOSING = 'CLOSING'
- 3.0.ipv8.messaging.anonymization.tunnel.CIRCUIT_ID_PORT = 1024
- 3.0.ipv8.messaging.anonymization.tunnel.PING_INTERVAL = 7.5
- 3.0.ipv8.messaging.anonymization.tunnel.DESTROY_REASON_UNKNOWN = 1
- 3.0.ipv8.messaging.anonymization.tunnel.DESTROY_REASON_SHUTDOWN = 2
- 3.0.ipv8.messaging.anonymization.tunnel.DESTROY_REASON_UNNEEDED = 4
- class 3.0.ipv8.messaging.anonymization.tunnel.Hop
Hop contains all information needed to add/remove a single layer of onion encryption and send it to the next target.
- peer: 3.0.ipv8.peer.Peer
- keys: 3.0.ipv8.messaging.anonymization.crypto.SessionKeys | None = None
- dh_first_part: 3.0.ipv8.keyvault.public.libnaclkey.LibNaCLPK | None = None
- dh_secret: 3.0.ipv8.keyvault.private.libnaclkey.LibNaCLSK | None = None
- property address: 3.0.ipv8.types.Address
Get the address of this hop.
- property public_key: 3.0.ipv8.keyvault.public.libnaclkey.LibNaCLPK
Get the public key instance of the hop.
- class 3.0.ipv8.messaging.anonymization.tunnel.RoutingObject(circuit_id: int)
Statistics for a tunnel to a peer over a circuit (base class for circuits, exit sockets, and relay routes).
- circuit_id
- creation_time
- last_activity
- logger
- class 3.0.ipv8.messaging.anonymization.tunnel.Circuit(circuit_id: int, goal_hops: int = 0, ctype: str = CIRCUIT_TYPE_DATA, required_exit: 3.0.ipv8.peer.Peer | None = None, info_hash: bytes | None = None)
Bases:
RoutingObjectA peer-to-peer encrypted communication channel, consisting of 0 or more hops (intermediate peers).
- goal_hops
- ctype
- required_exit
- info_hash
- ready: asyncio.Future[Circuit | None]
- closing_info = ''
- _closing = False
- _hs_session_keys: 3.0.ipv8.messaging.anonymization.crypto.SessionKeys | None = None
- e2e = False
- relay_early_count = 0
- dirty = False
- property hs_session_keys: 3.0.ipv8.messaging.anonymization.crypto.SessionKeys | None
Get the session keys for hidden services (if any).
- property hops: collections.abc.Sequence[Hop]
Return a read only tuple version of the hop-list of this circuit.
- class 3.0.ipv8.messaging.anonymization.tunnel.RelayRoute(circuit_id: int, hop: Hop, direction: int, rendezvous_relay: bool = False)
Bases:
RoutingObjectRelay object containing the destination circuit, socket address and whether it is online or not.
- hop
- direction
- rendezvous_relay
- relay_early_count = 1
- class 3.0.ipv8.messaging.anonymization.tunnel.RendezvousPoint(circuit: Circuit, cookie: bytes)
Rendezvous for circuits to link up.
- circuit
- cookie
- ready: asyncio.Future[RendezvousPoint | None]
- class 3.0.ipv8.messaging.anonymization.tunnel.IntroductionPoint(peer: 3.0.ipv8.peer.Peer, seeder_pk: bytes, source: int = PEER_SOURCE_UNKNOWN, last_seen: float | None = None)
A point of introduction, available for linking up.
- peer
- seeder_pk
- source
- last_seen
- class 3.0.ipv8.messaging.anonymization.tunnel.Swarm(info_hash: bytes, hops: int, lookup_func: Callable[[bytes, IntroductionPoint | None, int], asyncio.Future[list[IntroductionPoint]]], seeder_sk: 3.0.ipv8.keyvault.private.libnaclkey.LibNaCLSK | None = None, max_ip_age: float = 180.0, min_dht_lookup_interval: float = 300.0, max_dht_lookup_interval: float = 120.0)
A group of circuit exits that organizes around an SHA-1.
- info_hash
- hops
- lookup_func
- seeder_sk
- max_ip_age
- min_dht_lookup_interval
- max_dht_lookup_interval
- intro_points: list[IntroductionPoint] = []
- transfer_history = [0, 0]
- logger
- add_connection(rp_circuit: Circuit, intro_point_used: IntroductionPoint) None
Add a newly known circuit to this swarm.
- remove_connection(rp_circuit: Circuit) bool
Remove the given circuit from this swarm, if we manage it.
This does not close the circuit.
- get_num_connections_incomplete() int
Get the number of circuits we don’t have yet, but know of, in this swarm.
- add_intro_point(ip: IntroductionPoint) IntroductionPoint
Add an available introduction point to this swarm.
Returns the introduction point we should use (not necessarily the one we just added).
- remove_intro_point(ip: IntroductionPoint) None
Remove the given introduction point from this swarm.
- async lookup(target: IntroductionPoint | None = None) list[IntroductionPoint] | None
Lookup introduction points, possibly those that match the given introduction point.