libp2p/protocols/connectivity/relay/messages

    Dark Mode
Search:
Group by:
  Source   Edit

Types

HopMessage = object
  msgType*: HopMessageType
  peer*: Opt[Peer]
  reservation*: Opt[Reservation]
  limit*: Limit
  status*: Opt[StatusV2]
  Source   Edit
HopMessageType {.pure.} = enum
  Reserve = 0, Connect = 1, Status = 2
  Source   Edit
Limit = object
  duration*: uint32
  data*: uint64
  Source   Edit
Peer = object
  peerId*: PeerId
  addrs*: seq[MultiAddress]
  Source   Edit
RelayMessage = object
  msgType*: Opt[RelayType]
  srcPeer*: Opt[RelayPeer]
  dstPeer*: Opt[RelayPeer]
  status*: Opt[StatusV1]
  Source   Edit
RelayPeer = object
  peerId*: PeerId
  addrs*: seq[MultiAddress]
  Source   Edit
RelayType {.pure.} = enum
  Hop = 1, Stop = 2, Status = 3, CanHop = 4
  Source   Edit
Reservation = object
  expire*: uint64
  addrs*: seq[MultiAddress]
  svoucher*: Opt[seq[byte]]
  Source   Edit
StatusV1 {.pure.} = enum
  Success = 100, HopSrcAddrTooLong = 220, HopDstAddrTooLong = 221,
  HopSrcMultiaddrInvalid = 250, HopDstMultiaddrInvalid = 251,
  HopNoConnToDst = 260, HopCantDialDst = 261, HopCantOpenDstStream = 262,
  HopCantSpeakRelay = 270, HopCantRelayToSelf = 280, StopSrcAddrTooLong = 320,
  StopDstAddrTooLong = 321, StopSrcMultiaddrInvalid = 350,
  StopDstMultiaddrInvalid = 351, StopRelayRefused = 390, MalformedMessage = 400
  Source   Edit
StatusV2 = enum
  Ok = 100, ReservationRefused = 200, ResourceLimitExceeded = 201,
  PermissionDenied = 202, ConnectionFailed = 203, NoReservation = 204,
  MalformedMessage = 400, UnexpectedMessage = 401
  Source   Edit
StopMessage = object
  msgType*: StopMessageType
  peer*: Opt[Peer]
  limit*: Limit
  status*: Opt[StatusV2]
  Source   Edit
StopMessageType {.pure.} = enum
  Connect = 0, Status = 1
  Source   Edit
Voucher = object
  relayPeerId*: PeerId
  reservingPeerId*: PeerId
  expiration*: uint64
  Source   Edit

Procs

proc checkValid(spr: SignedVoucher): Result[void, EnvelopeError] {....raises: [],
    tags: [RootEffect].}
  Source   Edit
proc decode(_: typedesc[HopMessage]; buf: seq[byte]): Opt[HopMessage] {.
    ...raises: [].}
  Source   Edit
proc decode(_: typedesc[RelayMessage]; buf: seq[byte]): Opt[RelayMessage] {.
    ...raises: [].}
  Source   Edit
proc decode(_: typedesc[StopMessage]; buf: seq[byte]): Opt[StopMessage] {.
    ...raises: [].}
  Source   Edit
proc decode(_: typedesc[Voucher]; buf: seq[byte]): Result[Voucher, ProtoError] {.
    ...raises: [].}
  Source   Edit
proc encode(msg: HopMessage): ProtoBuffer {....raises: [], tags: [].}
  Source   Edit
proc encode(msg: RelayMessage): ProtoBuffer {....raises: [], tags: [].}
  Source   Edit
proc encode(msg: StopMessage): ProtoBuffer {....raises: [], tags: [].}
  Source   Edit
proc encode(v: Voucher): seq[byte] {....raises: [], tags: [].}
  Source   Edit
proc init(T: typedesc[Voucher]; relayPeerId: PeerId; reservingPeerId: PeerId;
          expiration: uint64): T:type {....raises: [].}
  Source   Edit
proc payloadDomain(_: typedesc[Voucher]): string {....raises: [].}
  Source   Edit
proc payloadType(_: typedesc[Voucher]): seq[byte] {....raises: [].}
  Source   Edit