haskell-tor-0.1.1: A Haskell Tor Node

Safe HaskellNone
LanguageHaskell2010

Tor.State.LinkManager

Description

A module for managing the collection of links held by the Tor node.

Synopsis

Documentation

data HasBackend s => LinkManager ls s Source

The LinkManager, as you'd guess, serves as a unique management point for holding all the links the current Tor node is operating on. The goal of this module is to allow maximal re-use of incoming and outgoing links while also maintaining enough links to provide anonymity guarantees.

newLinkManager :: HasBackend s => TorOptions -> TorNetworkStack ls s -> RouterDB -> Credentials -> IO (LinkManager ls s) Source

Create a new link manager with the given options, network stack, router database and credentials.

newLinkCircuit :: HasBackend s => LinkManager ls s -> [RouterRestriction] -> IO (TorLink, RouterDesc, Word32) Source

Generate the first link in a new circuit, where the first hop meets the given restrictions. The result is the new link, the router description of that link, and a new circuit id to use when creating the circuit.

setIncomingLinkHandler :: HasBackend s => LinkManager ls s -> (TorLink -> IO ()) -> IO () Source

Set a callback that will fire any time a new link is added to the system.