| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Tox.Onion.Path
Synopsis
- class (MonadState OnionPathState m, Timed m, MonadRandomBytes m, Keyed m) => OnionPathMonad m
- maxPaths :: Int
- pathLifetime :: TimeDiff
- unconfirmedPathTimeout :: TimeDiff
- confirmedPathTimeout :: TimeDiff
- data OnionPath = OnionPath {
- pathNodes :: [NodeInfo]
- pathKeys :: [KeyPair]
- pathConfirmed :: Bool
- pathTries :: Int
- pathExpires :: Timestamp
- pathLastAttempt :: Maybe Timestamp
- pathNum :: Word32
- isPathAlive :: Timestamp -> OnionPath -> Bool
- data OnionPathState = OnionPathState {
- announcePaths :: [OnionPath]
- searchPaths :: [OnionPath]
- lastPathNum :: Word32
- createPath :: MonadRandomBytes m => [NodeInfo] -> Word32 -> Timestamp -> m OnionPath
- maintainPaths :: OnionPathMonad m => [NodeInfo] -> m ()
- selectPath :: OnionPathMonad m => Bool -> m (Maybe OnionPath)
- pickNodes :: MonadRandomBytes m => [NodeInfo] -> m [NodeInfo]
- wrapPath :: Keyed m => KeyPair -> OnionPath -> SocketAddress -> Nonce -> CipherText -> m OnionRequest0
Documentation
class (MonadState OnionPathState m, Timed m, MonadRandomBytes m, Keyed m) => OnionPathMonad m Source #
Constructors
| OnionPath | |
Fields
| |
Instances
data OnionPathState Source #
Constructors
| OnionPathState | |
Fields
| |
Instances
createPath :: MonadRandomBytes m => [NodeInfo] -> Word32 -> Timestamp -> m OnionPath Source #
maintainPaths :: OnionPathMonad m => [NodeInfo] -> m () Source #
Maintain the set of onion paths.
selectPath :: OnionPathMonad m => Bool -> m (Maybe OnionPath) Source #
Select a random path for sending.
pickNodes :: MonadRandomBytes m => [NodeInfo] -> m [NodeInfo] Source #
Pick 3 random nodes for a path. Returns empty list if not enough nodes.
Arguments
| :: Keyed m | |
| => KeyPair | Our DHT KeyPair |
| -> OnionPath | The path to follow (A, B, C) |
| -> SocketAddress | Final destination Node D |
| -> Nonce | Nonce for all layers |
| -> CipherText | Final encrypted payload for Node D |
| -> m OnionRequest0 |
Wrap data into a nested Onion Request payload.