| Safe Haskell | None |
|---|---|
| Language | GHC2021 |
Network.LibP2P.Multiaddr.Protocol
Description
Protocol definitions for multiaddr.
Each protocol has a numeric code and an address format. See: https://github.com/multiformats/multicodec/blob/master/table.csv
Synopsis
- data Protocol
- = IP4 !Word32
- | IP6 !ByteString
- | TCP !Word16
- | UDP !Word16
- | P2P !ByteString
- | QuicV1
- | WS
- | WSS
- | DNS !Text
- | DNS4 !Text
- | DNS6 !Text
- | DNSAddr !Text
- | P2PCircuit
- | WebTransport
- | NoiseProto
- | YamuxProto
- protocolCode :: Protocol -> Word64
- protocolName :: Protocol -> Text
- data AddressSize
- = Fixed !Int
- | VarIntPrefixed
- | NoAddress
- protocolAddressSize :: Word64 -> Maybe AddressSize
- codeToProtocolName :: Word64 -> Maybe Text
Documentation
A single protocol component within a multiaddr.
Constructors
| IP4 !Word32 | IPv4 address (4 bytes big-endian) |
| IP6 !ByteString | IPv6 address (16 bytes) |
| TCP !Word16 | TCP port |
| UDP !Word16 | UDP port |
| P2P !ByteString | Peer ID as multihash bytes |
| QuicV1 | QUIC v1 (no address) |
| WS | WebSocket (no address) |
| WSS | WebSocket Secure (no address) |
| DNS !Text | DNS hostname |
| DNS4 !Text | DNS4 hostname |
| DNS6 !Text | DNS6 hostname |
| DNSAddr !Text | DNSAddr hostname |
| P2PCircuit | Circuit relay marker (no address) |
| WebTransport | WebTransport (no address) |
| NoiseProto | Noise protocol marker (no address) |
| YamuxProto | Yamux protocol marker (no address) |
protocolCode :: Protocol -> Word64 Source #
Get the multicodec code for a protocol.
protocolName :: Protocol -> Text Source #
Get the human-readable name for a protocol.
data AddressSize Source #
Address size specification for a protocol.
Constructors
| Fixed !Int | Fixed number of bytes |
| VarIntPrefixed | Varint-length-prefixed bytes |
| NoAddress | No address bytes |
Instances
| Show AddressSize Source # | |
Defined in Network.LibP2P.Multiaddr.Protocol Methods showsPrec :: Int -> AddressSize -> ShowS # show :: AddressSize -> String # showList :: [AddressSize] -> ShowS # | |
| Eq AddressSize Source # | |
Defined in Network.LibP2P.Multiaddr.Protocol | |
protocolAddressSize :: Word64 -> Maybe AddressSize Source #
Get the address size specification for a protocol code.