toxcore-0.2.12: A Tox protocol implementation in Haskell
Safe HaskellNone
LanguageHaskell2010

Tox.Onion.Path

Synopsis

Documentation

data OnionPath Source #

Instances

Instances details
Eq OnionPath Source # 
Instance details

Defined in Tox.Onion.Path

Read OnionPath Source # 
Instance details

Defined in Tox.Onion.Path

Show OnionPath Source # 
Instance details

Defined in Tox.Onion.Path

Generic OnionPath Source # 
Instance details

Defined in Tox.Onion.Path

Associated Types

type Rep OnionPath :: Type -> Type #

Arbitrary OnionPath Source # 
Instance details

Defined in Tox.Onion.Path

type Rep OnionPath Source # 
Instance details

Defined in Tox.Onion.Path

data OnionPathState Source #

Instances

Instances details
Eq OnionPathState Source # 
Instance details

Defined in Tox.Onion.Path

Read OnionPathState Source # 
Instance details

Defined in Tox.Onion.Path

Show OnionPathState Source # 
Instance details

Defined in Tox.Onion.Path

Generic OnionPathState Source # 
Instance details

Defined in Tox.Onion.Path

Associated Types

type Rep OnionPathState :: Type -> Type #

Arbitrary OnionPathState Source # 
Instance details

Defined in Tox.Onion.Path

type Rep OnionPathState Source # 
Instance details

Defined in Tox.Onion.Path

type Rep OnionPathState = D1 ('MetaData "OnionPathState" "Tox.Onion.Path" "toxcore-0.2.12-inplace" 'False) (C1 ('MetaCons "OnionPathState" 'PrefixI 'True) (S1 ('MetaSel ('Just "announcePaths") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 [OnionPath]) :*: (S1 ('MetaSel ('Just "searchPaths") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 [OnionPath]) :*: S1 ('MetaSel ('Just "lastPathNum") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Word32))))

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.

wrapPath Source #

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.