haskell-tor-0.1.1: A Haskell Tor Node

Safe HaskellNone
LanguageHaskell2010

Tor.Link

Description

Low-level interface for establishing links between Tor nodes.

Synopsis

Documentation

data TorLink Source

A direct link between us and another Tor node.

initLink :: HasBackend s => TorNetworkStack ls s -> Credentials -> MVar TorRNG -> (String -> IO ()) -> RouterDesc -> IO TorLink Source

Create a direct link to the given tor node. note that this routine performs some internal certificate checking, but you should verify that the certificate you expected from the connection is what you expected it to be. YOU SHOULD PROBABLY NOT USE THIS ROUTINE. Instead, use newLinkCircuit, elsewhere.

acceptLink :: HasBackend s => Credentials -> RouterDB -> MVar TorRNG -> (String -> IO ()) -> s -> TorAddress -> IO TorLink Source

Given an incoming socket, accept a formal Tor link from the incoming party. Or throw an error. Whatever.

linkInitiatedRemotely :: TorLink -> Bool Source

Whether the link was initiated here (False) or elsewhere (True)

linkRouterDesc :: TorLink -> Maybe RouterDesc Source

The RouterDesc associated with this link, if we have one. (It will not always be possible to find incoming links in the database.)

linkRead :: TorLink -> Word32 -> IO TorCell Source

Read the next incoming cell from the given circuit identifier on the given link. This will throw an exception if the circuit has been appropriately registered.

linkWrite :: TorLink -> TorCell -> IO () Source

Write a cell to the link.

linkClose :: TorLink -> IO () Source

Close the link

linkNewCircuitId :: DRG g => TorLink -> g -> IO (g, Word32) Source

Generate a random new circuit id for a link.