mirror of
https://github.com/markqvist/Reticulum.git
synced 2026-07-30 11:28:10 -07:00
1250 lines
86 KiB
HTML
1250 lines
86 KiB
HTML
|
||
<!DOCTYPE html>
|
||
|
||
<html>
|
||
<head>
|
||
<meta charset="utf-8" />
|
||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||
<title>API Reference — Reticulum Network Stack 0.3.1 beta documentation</title>
|
||
<link rel="stylesheet" type="text/css" href="_static/pygments.css" />
|
||
<link rel="stylesheet" type="text/css" href="_static/classic.css" />
|
||
|
||
<script data-url_root="./" id="documentation_options" src="_static/documentation_options.js"></script>
|
||
<script src="_static/jquery.js"></script>
|
||
<script src="_static/underscore.js"></script>
|
||
<script src="_static/doctools.js"></script>
|
||
|
||
<link rel="index" title="Index" href="genindex.html" />
|
||
<link rel="search" title="Search" href="search.html" />
|
||
<link rel="next" title="Code Examples" href="examples.html" />
|
||
<link rel="prev" title="Understanding Reticulum" href="understanding.html" />
|
||
</head><body>
|
||
<div class="related" role="navigation" aria-label="related navigation">
|
||
<h3>Navigation</h3>
|
||
<ul>
|
||
<li class="right" style="margin-right: 10px">
|
||
<a href="genindex.html" title="General Index"
|
||
accesskey="I">index</a></li>
|
||
<li class="right" >
|
||
<a href="examples.html" title="Code Examples"
|
||
accesskey="N">next</a> |</li>
|
||
<li class="right" >
|
||
<a href="understanding.html" title="Understanding Reticulum"
|
||
accesskey="P">previous</a> |</li>
|
||
<li class="nav-item nav-item-0"><a href="index.html">Reticulum Network Stack 0.3.1 beta documentation</a> »</li>
|
||
<li class="nav-item nav-item-this"><a href="">API Reference</a></li>
|
||
</ul>
|
||
</div>
|
||
|
||
<div class="document">
|
||
<div class="documentwrapper">
|
||
<div class="bodywrapper">
|
||
<div class="body" role="main">
|
||
|
||
<div class="section" id="api-reference">
|
||
<span id="api-main"></span><h1>API Reference<a class="headerlink" href="#api-reference" title="Permalink to this headline">¶</a></h1>
|
||
<p>This reference guide lists and explains all classes exposed by the RNS API.</p>
|
||
<div class="section" id="classes">
|
||
<h2>Classes<a class="headerlink" href="#classes" title="Permalink to this headline">¶</a></h2>
|
||
<p>Communication over a Reticulum network is achieved using a set of classes exposed by RNS.</p>
|
||
<div class="section" id="reticulum">
|
||
<span id="api-reticulum"></span><h3>Reticulum<a class="headerlink" href="#reticulum" title="Permalink to this headline">¶</a></h3>
|
||
<dl class="py class">
|
||
<dt class="sig sig-object py" id="RNS.Reticulum">
|
||
<em class="property"><span class="pre">class</span> </em><span class="sig-prename descclassname"><span class="pre">RNS.</span></span><span class="sig-name descname"><span class="pre">Reticulum</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">configdir</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">loglevel</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#RNS.Reticulum" title="Permalink to this definition">¶</a></dt>
|
||
<dd><p>This class is used to initialise access to Reticulum within a
|
||
program. You must create exactly one instance of this class before
|
||
carrying out any other RNS operations, such as creating destinations
|
||
or sending traffic. Every independently executed program must create
|
||
their own instance of the Reticulum class, but Reticulum will
|
||
automatically handle inter-program communication on the same system,
|
||
and expose all connected programs to external interfaces as well.</p>
|
||
<p>As soon as an instance of this class is created, Reticulum will start
|
||
opening and configuring any hardware devices specified in the supplied
|
||
configuration.</p>
|
||
<p>Currently the first running instance must be kept running while other
|
||
local instances are connected, as the first created instance will
|
||
act as a master instance that directly communicates with external
|
||
hardware such as modems, TNCs and radios. If a master instance is
|
||
asked to exit, it will not exit until all client processes have
|
||
terminated (unless killed forcibly).</p>
|
||
<p>If you are running Reticulum on a system with several different
|
||
programs that use RNS starting and terminating at different times,
|
||
it will be advantageous to run a master RNS instance as a daemon for
|
||
other programs to use on demand.</p>
|
||
<dl class="py attribute">
|
||
<dt class="sig sig-object py" id="RNS.Reticulum.MTU">
|
||
<span class="sig-name descname"><span class="pre">MTU</span></span><em class="property"> <span class="pre">=</span> <span class="pre">500</span></em><a class="headerlink" href="#RNS.Reticulum.MTU" title="Permalink to this definition">¶</a></dt>
|
||
<dd><p>The MTU that Reticulum adheres to, and will expect other peers to
|
||
adhere to. By default, the MTU is 500 bytes. In custom RNS network
|
||
implementations, it is possible to change this value, but doing so will
|
||
completely break compatibility with all other RNS networks. An identical
|
||
MTU is a prerequisite for peers to communicate in the same network.</p>
|
||
<p>Unless you really know what you are doing, the MTU should be left at
|
||
the default value.</p>
|
||
</dd></dl>
|
||
|
||
<dl class="py method">
|
||
<dt class="sig sig-object py" id="RNS.Reticulum.should_use_implicit_proof">
|
||
<em class="property"><span class="pre">static</span> </em><span class="sig-name descname"><span class="pre">should_use_implicit_proof</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#RNS.Reticulum.should_use_implicit_proof" title="Permalink to this definition">¶</a></dt>
|
||
<dd><p>Returns whether proofs sent are explicit or implicit.</p>
|
||
<dl class="field-list simple">
|
||
<dt class="field-odd">Returns</dt>
|
||
<dd class="field-odd"><p>True if the current running configuration specifies to use implicit proofs. False if not.</p>
|
||
</dd>
|
||
</dl>
|
||
</dd></dl>
|
||
|
||
<dl class="py method">
|
||
<dt class="sig sig-object py" id="RNS.Reticulum.transport_enabled">
|
||
<em class="property"><span class="pre">static</span> </em><span class="sig-name descname"><span class="pre">transport_enabled</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#RNS.Reticulum.transport_enabled" title="Permalink to this definition">¶</a></dt>
|
||
<dd><p>Returns whether Transport is enabled for the running
|
||
instance.</p>
|
||
<p>When Transport is enabled, Reticulum will
|
||
route traffic for other peers, respond to path requests
|
||
and pass announces over the network.</p>
|
||
<dl class="field-list simple">
|
||
<dt class="field-odd">Returns</dt>
|
||
<dd class="field-odd"><p>True if Transport is enabled, False if not.</p>
|
||
</dd>
|
||
</dl>
|
||
</dd></dl>
|
||
|
||
</dd></dl>
|
||
|
||
</div>
|
||
<div class="section" id="api-identity">
|
||
<span id="identity"></span><h3>Identity<a class="headerlink" href="#api-identity" title="Permalink to this headline">¶</a></h3>
|
||
<dl class="py class">
|
||
<dt class="sig sig-object py" id="RNS.Identity">
|
||
<em class="property"><span class="pre">class</span> </em><span class="sig-prename descclassname"><span class="pre">RNS.</span></span><span class="sig-name descname"><span class="pre">Identity</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">create_keys</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">True</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#RNS.Identity" title="Permalink to this definition">¶</a></dt>
|
||
<dd><p>This class is used to manage identities in Reticulum. It provides methods
|
||
for encryption, decryption, signatures and verification, and is the basis
|
||
for all encrypted communication over Reticulum networks.</p>
|
||
<dl class="field-list simple">
|
||
<dt class="field-odd">Parameters</dt>
|
||
<dd class="field-odd"><p><strong>create_keys</strong> – Specifies whether new encryption and signing keys should be generated.</p>
|
||
</dd>
|
||
</dl>
|
||
<dl class="py attribute">
|
||
<dt class="sig sig-object py" id="RNS.Identity.CURVE">
|
||
<span class="sig-name descname"><span class="pre">CURVE</span></span><em class="property"> <span class="pre">=</span> <span class="pre">'Curve25519'</span></em><a class="headerlink" href="#RNS.Identity.CURVE" title="Permalink to this definition">¶</a></dt>
|
||
<dd><p>The curve used for Elliptic Curve DH key exchanges</p>
|
||
</dd></dl>
|
||
|
||
<dl class="py attribute">
|
||
<dt class="sig sig-object py" id="RNS.Identity.KEYSIZE">
|
||
<span class="sig-name descname"><span class="pre">KEYSIZE</span></span><em class="property"> <span class="pre">=</span> <span class="pre">512</span></em><a class="headerlink" href="#RNS.Identity.KEYSIZE" title="Permalink to this definition">¶</a></dt>
|
||
<dd><p>X25519 key size in bits. A complete key is the concatenation of a 256 bit encryption key, and a 256 bit signing key.</p>
|
||
</dd></dl>
|
||
|
||
<dl class="py attribute">
|
||
<dt class="sig sig-object py" id="RNS.Identity.TRUNCATED_HASHLENGTH">
|
||
<span class="sig-name descname"><span class="pre">TRUNCATED_HASHLENGTH</span></span><em class="property"> <span class="pre">=</span> <span class="pre">80</span></em><a class="headerlink" href="#RNS.Identity.TRUNCATED_HASHLENGTH" title="Permalink to this definition">¶</a></dt>
|
||
<dd><p>Constant specifying the truncated hash length (in bits) used by Reticulum
|
||
for addressable hashes and other purposes. Non-configurable.</p>
|
||
</dd></dl>
|
||
|
||
<dl class="py method">
|
||
<dt class="sig sig-object py" id="RNS.Identity.recall">
|
||
<em class="property"><span class="pre">static</span> </em><span class="sig-name descname"><span class="pre">recall</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">destination_hash</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#RNS.Identity.recall" title="Permalink to this definition">¶</a></dt>
|
||
<dd><p>Recall identity for a destination hash.</p>
|
||
<dl class="field-list simple">
|
||
<dt class="field-odd">Parameters</dt>
|
||
<dd class="field-odd"><p><strong>destination_hash</strong> – Destination hash as <em>bytes</em>.</p>
|
||
</dd>
|
||
<dt class="field-even">Returns</dt>
|
||
<dd class="field-even"><p>An <a class="reference internal" href="#api-identity"><span class="std std-ref">RNS.Identity</span></a> instance that can be used to create an outgoing <a class="reference internal" href="#api-destination"><span class="std std-ref">RNS.Destination</span></a>, or <em>None</em> if the destination is unknown.</p>
|
||
</dd>
|
||
</dl>
|
||
</dd></dl>
|
||
|
||
<dl class="py method">
|
||
<dt class="sig sig-object py" id="RNS.Identity.recall_app_data">
|
||
<em class="property"><span class="pre">static</span> </em><span class="sig-name descname"><span class="pre">recall_app_data</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">destination_hash</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#RNS.Identity.recall_app_data" title="Permalink to this definition">¶</a></dt>
|
||
<dd><p>Recall last heard app_data for a destination hash.</p>
|
||
<dl class="field-list simple">
|
||
<dt class="field-odd">Parameters</dt>
|
||
<dd class="field-odd"><p><strong>destination_hash</strong> – Destination hash as <em>bytes</em>.</p>
|
||
</dd>
|
||
<dt class="field-even">Returns</dt>
|
||
<dd class="field-even"><p><em>Bytes</em> containing app_data, or <em>None</em> if the destination is unknown.</p>
|
||
</dd>
|
||
</dl>
|
||
</dd></dl>
|
||
|
||
<dl class="py method">
|
||
<dt class="sig sig-object py" id="RNS.Identity.full_hash">
|
||
<em class="property"><span class="pre">static</span> </em><span class="sig-name descname"><span class="pre">full_hash</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">data</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#RNS.Identity.full_hash" title="Permalink to this definition">¶</a></dt>
|
||
<dd><p>Get a SHA-256 hash of passed data.</p>
|
||
<dl class="field-list simple">
|
||
<dt class="field-odd">Parameters</dt>
|
||
<dd class="field-odd"><p><strong>data</strong> – Data to be hashed as <em>bytes</em |