Safe Haskell | None |
---|---|
Language | Haskell2010 |
Low-level interface for establishing links between Tor nodes.
- data TorLink
- initLink :: HasBackend s => TorNetworkStack ls s -> Credentials -> MVar TorRNG -> (String -> IO ()) -> RouterDesc -> IO TorLink
- acceptLink :: HasBackend s => Credentials -> RouterDB -> MVar TorRNG -> (String -> IO ()) -> s -> TorAddress -> IO TorLink
- linkInitiatedRemotely :: TorLink -> Bool
- linkRouterDesc :: TorLink -> Maybe RouterDesc
- linkRead :: TorLink -> Word32 -> IO TorCell
- linkWrite :: TorLink -> TorCell -> IO ()
- linkClose :: TorLink -> IO ()
- linkNewCircuitId :: DRG g => TorLink -> g -> IO (g, Word32)
Documentation
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.)