Packages

This is an implementation of Mark Qvist's Reticulum Network Stack, a 'cryptography-based networking stack for building local and wide-area networks with readily available hardware.'

Current section

Files

Jump to
reticulum lib rns packet_context.ex
Raw

lib/rns/packet_context.ex

defmodule RNS.PacketContext do
@moduledoc "A list of packet contexts reserved for Reticulum."
@doc "The packet is a generic data packet."
@spec none() :: RNS.Packet.context()
def none(), do: 0x00
@doc "The packet is part of a resource."
@spec resource() :: RNS.Packet.context()
def resource(), do: 0x01
@doc "The packet is a resource advertisement."
@spec resource_advertise() :: RNS.Packet.context()
def resource_advertise(), do: 0x02
@doc "The packet is a resource part request."
@spec resource_request() :: RNS.Packet.context()
def resource_request(), do: 0x03
@doc "The packet is a resource hashmap update."
@spec resource_hashmap_update() :: RNS.Packet.context()
def resource_hashmap_update(), do: 0x04
@doc "The packet is a resource proof."
@spec resource_proof() :: RNS.Packet.context()
def resource_proof(), do: 0x05
@doc "The packet is a resource initiator cancel message."
@spec resource_icl() :: RNS.Packet.context()
def resource_icl(), do: 0x06
@doc "The packet is a resource receiver cancel message."
@spec resource_rcl() :: RNS.Packet.context()
def resource_rcl(), do: 0x07
@doc "The packet is a cache request."
@spec cache_request() :: RNS.Packet.context()
def cache_request(), do: 0x08
@doc "The packet is a request."
@spec request() :: RNS.Packet.context()
def request(), do: 0x09
@doc "The packet is a response to a request."
@spec response() :: RNS.Packet.context()
def response(), do: 0x0A
@doc "The packet is a response to a path request."
@spec path_response() :: RNS.Packet.context()
def path_response(), do: 0x0B
@doc "The packet is a command."
@spec command() :: RNS.Packet.context()
def command(), do: 0x0C
@doc "The packet is a status of an executed command."
@spec command_status() :: RNS.Packet.context()
def command_status(), do: 0x00
@doc "The packet contains link channel data."
@spec channel() :: RNS.Packet.context()
def channel(), do: 0x0E
@doc "The packet is a keepalive packet."
@spec keepalive() :: RNS.Packet.context()
def keepalive(), do: 0xFA
@doc "The packet is a link peer identification proof."
@spec link_identity() :: RNS.Packet.context()
def link_identity(), do: 0xFB
@doc "The packet is a link close message."
@spec link_close() :: RNS.Packet.context()
def link_close(), do: 0xFC
@doc "The packet is a link packet proof."
@spec link_proof() :: RNS.Packet.context()
def link_proof(), do: 0xFD
@doc "The packet is a link request round-trip time measurement."
@spec lrrtt() :: RNS.Packet.context()
def lrrtt(), do: 0xFE
@doc "The packet is a link request proof."
@spec link_request_proof() :: RNS.Packet.context()
def link_request_proof(), do: 0xFF
end