hs-libp2p-0.2.0.0: Haskell implementation of the libp2p networking stack
Safe HaskellNone
LanguageGHC2021

LibP2P.NAT.AutoNAT.V2

Description

AutoNAT v2 address-specific reachability client and server.

Synopsis

Documentation

data AutoNATV2Config Source #

AutoNAT v2 limits and injectable time/randomness.

Constructors

AutoNATV2Config 

Fields

defaultAutoNATV2Config :: AutoNATV2Config Source #

go-libp2p-compatible AutoNAT v2 defaults.

data AutoNATV2ServerOps Source #

Server operations supplied by the Switch integration.

data AutoNATV2Request Source #

One address offered by the client.

data AutoNATV2Result Source #

Address-specific reachability outcome.

handleAutoNATV2DialRequest :: AutoNATV2State -> AutoNATV2ServerOps -> StreamIO -> PeerId -> Multiaddr -> IO () Source #

Serve one dial-request stream and close it on every exit path.

handleAutoNATV2DialBack :: AutoNATV2State -> StreamIO -> Multiaddr -> IO () Source #

Receive a nonce on the dial-back protocol and acknowledge only a pending request. Unknown nonces are discarded without a response.

requestAutoNATV2 :: AutoNATV2State -> StreamIO -> [AutoNATV2Request] -> IO (Either String AutoNATV2Result) Source #

Run one client request over an already-negotiated dial-request stream.

addressesConsistent :: Multiaddr -> Multiaddr -> Bool Source #

Verify that the dial-back connection used the selected transport stack. IP/DNS values and ports may legitimately differ because of NAT mappings.