7311 lines
367 KiB
HTML
7311 lines
367 KiB
HTML
<!DOCTYPE html>
|
||
<html class="no-js" lang="ru" data-content_root="./">
|
||
<head>
|
||
<meta charset="utf-8" />
|
||
<meta name="viewport" content="width=device-width,initial-scale=1" />
|
||
<meta name="color-scheme" content="light dark" />
|
||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||
<link rel="index" title="Index" href="genindex.html" />
|
||
<link rel="search" title="Search" href="search.html" />
|
||
<link rel="prev" title="Code Examples" href="examples.html" />
|
||
<link rel="prefetch" href="_static/rns_logo_512.png" as="image" />
|
||
|
||
<!-- Generated with Sphinx 8.2.3 and Furo 2025.09.25.dev1 -->
|
||
<title>API Reference - Reticulum Network Stack 1.0.5 documentation</title>
|
||
<link rel="stylesheet" type="text/css" href="_static/pygments.css" />
|
||
<link rel="stylesheet" type="text/css" href="_static/styles/furo.css" />
|
||
<link rel="stylesheet" type="text/css" href="_static/copybutton.css" />
|
||
<link rel="stylesheet" type="text/css" href="_static/styles/furo-extensions.css" />
|
||
<link rel="stylesheet" type="text/css" href="_static/custom.css" />
|
||
<link rel="icon" href="../favicon-512x512.svg" type="image/x-icon">
|
||
<style>
|
||
body {
|
||
--color-code-background: #f2f2f2;
|
||
--color-code-foreground: #1e1e1e;
|
||
}
|
||
@media not print {
|
||
body[data-theme="dark"] {
|
||
--color-code-background: #202020;
|
||
--color-code-foreground: #d0d0d0;
|
||
--color-background-primary: #202b38;
|
||
--color-background-secondary: #161f27;
|
||
--color-foreground-primary: #dbdbdb;
|
||
--color-foreground-secondary: #a9b1ba;
|
||
--color-brand-primary: #41adff;
|
||
--color-background-hover: #161f27;
|
||
--color-api-name: #ffbe85;
|
||
--color-api-pre-name: #efae75;
|
||
}
|
||
@media (prefers-color-scheme: dark) {
|
||
body:not([data-theme="light"]) {
|
||
--color-code-background: #202020;
|
||
--color-code-foreground: #d0d0d0;
|
||
--color-background-primary: #202b38;
|
||
--color-background-secondary: #161f27;
|
||
--color-foreground-primary: #dbdbdb;
|
||
--color-foreground-secondary: #a9b1ba;
|
||
--color-brand-primary: #41adff;
|
||
--color-background-hover: #161f27;
|
||
--color-api-name: #ffbe85;
|
||
--color-api-pre-name: #efae75;
|
||
}
|
||
}
|
||
}
|
||
</style>
|
||
</head>
|
||
<body>
|
||
<script>
|
||
document.body.dataset.theme = localStorage.getItem("theme") || "auto";
|
||
</script>
|
||
|
||
<svg xmlns="http://www.w3.org/2000/svg" style="display: none">
|
||
<symbol id="svg-toc" viewBox="0 0 24 24">
|
||
<title>Contents</title>
|
||
<svg stroke="currentColor" fill="currentColor" stroke-width="0" viewBox="0 0 1024 1024">
|
||
<path
|
||
d="M408 442h480c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8H408c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8zm-8 204c0 4.4 3.6 8 8 8h480c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8H408c-4.4 0-8 3.6-8 8v56zm504-486H120c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h784c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zm0 632H120c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h784c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zM115.4 518.9L271.7 642c5.8 4.6 14.4.5 14.4-6.9V388.9c0-7.4-8.5-11.5-14.4-6.9L115.4 505.1a8.74 8.74 0 0 0 0 13.8z"
|
||
></path>
|
||
</svg>
|
||
</symbol>
|
||
<symbol id="svg-menu" viewBox="0 0 24 24">
|
||
<title>Menu</title>
|
||
<svg
|
||
xmlns="http://www.w3.org/2000/svg"
|
||
viewBox="0 0 24 24"
|
||
fill="none"
|
||
stroke="currentColor"
|
||
stroke-width="2"
|
||
stroke-linecap="round"
|
||
stroke-linejoin="round"
|
||
class="feather-menu"
|
||
>
|
||
<line x1="3" y1="12" x2="21" y2="12"></line>
|
||
<line x1="3" y1="6" x2="21" y2="6"></line>
|
||
<line x1="3" y1="18" x2="21" y2="18"></line>
|
||
</svg>
|
||
</symbol>
|
||
<symbol id="svg-arrow-right" viewBox="0 0 24 24">
|
||
<title>Expand</title>
|
||
<svg
|
||
xmlns="http://www.w3.org/2000/svg"
|
||
viewBox="0 0 24 24"
|
||
fill="none"
|
||
stroke="currentColor"
|
||
stroke-width="2"
|
||
stroke-linecap="round"
|
||
stroke-linejoin="round"
|
||
class="feather-chevron-right"
|
||
>
|
||
<polyline points="9 18 15 12 9 6"></polyline>
|
||
</svg>
|
||
</symbol>
|
||
<symbol id="svg-sun" viewBox="0 0 24 24">
|
||
<title>Light mode</title>
|
||
<svg
|
||
xmlns="http://www.w3.org/2000/svg"
|
||
viewBox="0 0 24 24"
|
||
fill="none"
|
||
stroke="currentColor"
|
||
stroke-width="1"
|
||
stroke-linecap="round"
|
||
stroke-linejoin="round"
|
||
class="feather-sun"
|
||
>
|
||
<circle cx="12" cy="12" r="5"></circle>
|
||
<line x1="12" y1="1" x2="12" y2="3"></line>
|
||
<line x1="12" y1="21" x2="12" y2="23"></line>
|
||
<line x1="4.22" y1="4.22" x2="5.64" y2="5.64"></line>
|
||
<line x1="18.36" y1="18.36" x2="19.78" y2="19.78"></line>
|
||
<line x1="1" y1="12" x2="3" y2="12"></line>
|
||
<line x1="21" y1="12" x2="23" y2="12"></line>
|
||
<line x1="4.22" y1="19.78" x2="5.64" y2="18.36"></line>
|
||
<line x1="18.36" y1="5.64" x2="19.78" y2="4.22"></line>
|
||
</svg>
|
||
</symbol>
|
||
<symbol id="svg-moon" viewBox="0 0 24 24">
|
||
<title>Dark mode</title>
|
||
<svg
|
||
xmlns="http://www.w3.org/2000/svg"
|
||
viewBox="0 0 24 24"
|
||
fill="none"
|
||
stroke="currentColor"
|
||
stroke-width="1"
|
||
stroke-linecap="round"
|
||
stroke-linejoin="round"
|
||
class="icon-tabler-moon"
|
||
>
|
||
<path stroke="none" d="M0 0h24v24H0z" fill="none"></path>
|
||
<path
|
||
d="M12 3c.132 0 .263 0 .393 0a7.5 7.5 0 0 0 7.92 12.446a9 9 0 1 1 -8.313 -12.454z"
|
||
></path>
|
||
</svg>
|
||
</symbol>
|
||
<symbol id="svg-sun-with-moon" viewBox="0 0 24 24">
|
||
<title>Auto light/dark, in light mode</title>
|
||
<svg
|
||
xmlns="http://www.w3.org/2000/svg"
|
||
viewBox="0 0 24 24"
|
||
fill="none"
|
||
stroke="currentColor"
|
||
stroke-width="1"
|
||
stroke-linecap="round"
|
||
stroke-linejoin="round"
|
||
class="icon-custom-derived-from-feather-sun-and-tabler-moon"
|
||
>
|
||
<path
|
||
style="opacity: 50%"
|
||
d="M 5.411 14.504 C 5.471 14.504 5.532 14.504 5.591 14.504 C 3.639 16.319 4.383 19.569 6.931 20.352 C 7.693 20.586 8.512 20.551 9.25 20.252 C 8.023 23.207 4.056 23.725 2.11 21.184 C 0.166 18.642 1.702 14.949 4.874 14.536 C 5.051 14.512 5.231 14.5 5.411 14.5 L 5.411 14.504 Z"
|
||
></path>
|
||
<line x1="14.5" y1="3.25" x2="14.5" y2="1.25"></line>
|
||
<line x1="14.5" y1="15.85" x2="14.5" y2="17.85"></line>
|
||
<line x1="10.044" y1="5.094" x2="8.63" y2="3.68"></line>
|
||
<line x1="19" y1="14.05" x2="20.414" y2="15.464"></line>
|
||
<line x1="8.2" y1="9.55" x2="6.2" y2="9.55"></line>
|
||
<line x1="20.8" y1="9.55" x2="22.8" y2="9.55"></line>
|
||
<line x1="10.044" y1="14.006" x2="8.63" y2="15.42"></line>
|
||
<line x1="19" y1="5.05" x2="20.414" y2="3.636"></line>
|
||
<circle cx="14.5" cy="9.55" r="3.6"></circle>
|
||
</svg>
|
||
</symbol>
|
||
<symbol id="svg-moon-with-sun" viewBox="0 0 24 24">
|
||
<title>Auto light/dark, in dark mode</title>
|
||
<svg
|
||
xmlns="http://www.w3.org/2000/svg"
|
||
viewBox="0 0 24 24"
|
||
fill="none"
|
||
stroke="currentColor"
|
||
stroke-width="1"
|
||
stroke-linecap="round"
|
||
stroke-linejoin="round"
|
||
class="icon-custom-derived-from-feather-sun-and-tabler-moon"
|
||
>
|
||
<path
|
||
d="M 8.282 7.007 C 8.385 7.007 8.494 7.007 8.595 7.007 C 5.18 10.184 6.481 15.869 10.942 17.24 C 12.275 17.648 13.706 17.589 15 17.066 C 12.851 22.236 5.91 23.143 2.505 18.696 C -0.897 14.249 1.791 7.786 7.342 7.063 C 7.652 7.021 7.965 7 8.282 7 L 8.282 7.007 Z"
|
||
></path>
|
||
<line style="opacity: 50%" x1="18" y1="3.705" x2="18" y2="2.5"></line>
|
||
<line style="opacity: 50%" x1="18" y1="11.295" x2="18" y2="12.5"></line>
|
||
<line style="opacity: 50%" x1="15.316" y1="4.816" x2="14.464" y2="3.964"></line>
|
||
<line style="opacity: 50%" x1="20.711" y1="10.212" x2="21.563" y2="11.063"></line>
|
||
<line style="opacity: 50%" x1="14.205" y1="7.5" x2="13.001" y2="7.5"></line>
|
||
<line style="opacity: 50%" x1="21.795" y1="7.5" x2="23" y2="7.5"></line>
|
||
<line style="opacity: 50%" x1="15.316" y1="10.184" x2="14.464" y2="11.036"></line>
|
||
<line style="opacity: 50%" x1="20.711" y1="4.789" x2="21.563" y2="3.937"></line>
|
||
<circle style="opacity: 50%" cx="18" cy="7.5" r="2.169"></circle>
|
||
</svg>
|
||
</symbol>
|
||
<symbol id="svg-pencil" viewBox="0 0 24 24">
|
||
<svg
|
||
xmlns="http://www.w3.org/2000/svg"
|
||
viewBox="0 0 24 24"
|
||
fill="none"
|
||
stroke="currentColor"
|
||
stroke-width="1"
|
||
stroke-linecap="round"
|
||
stroke-linejoin="round"
|
||
class="icon-tabler-pencil-code"
|
||
>
|
||
<path d="M4 20h4l10.5 -10.5a2.828 2.828 0 1 0 -4 -4l-10.5 10.5v4"></path>
|
||
<path d="M13.5 6.5l4 4"></path>
|
||
<path d="M20 21l2 -2l-2 -2"></path>
|
||
<path d="M17 17l-2 2l2 2"></path>
|
||
</svg>
|
||
</symbol>
|
||
<symbol id="svg-eye" viewBox="0 0 24 24">
|
||
<svg
|
||
xmlns="http://www.w3.org/2000/svg"
|
||
viewBox="0 0 24 24"
|
||
fill="none"
|
||
stroke="currentColor"
|
||
stroke-width="1"
|
||
stroke-linecap="round"
|
||
stroke-linejoin="round"
|
||
class="icon-tabler-eye-code"
|
||
>
|
||
<path stroke="none" d="M0 0h24v24H0z" fill="none"></path>
|
||
<path d="M10 12a2 2 0 1 0 4 0a2 2 0 0 0 -4 0"></path>
|
||
<path
|
||
d="M11.11 17.958c-3.209 -.307 -5.91 -2.293 -8.11 -5.958c2.4 -4 5.4 -6 9 -6c3.6 0 6.6 2 9 6c-.21 .352 -.427 .688 -.647 1.008"
|
||
></path>
|
||
<path d="M20 21l2 -2l-2 -2"></path>
|
||
<path d="M17 17l-2 2l2 2"></path>
|
||
</svg>
|
||
</symbol>
|
||
</svg>
|
||
|
||
<input
|
||
type="checkbox"
|
||
class="sidebar-toggle"
|
||
name="__navigation"
|
||
id="__navigation"
|
||
aria-label="Toggle site navigation sidebar"
|
||
/>
|
||
<input
|
||
type="checkbox"
|
||
class="sidebar-toggle"
|
||
name="__toc"
|
||
id="__toc"
|
||
aria-label="Toggle table of contents sidebar"
|
||
/>
|
||
<label class="overlay sidebar-overlay" for="__navigation"></label>
|
||
<label class="overlay toc-overlay" for="__toc"></label>
|
||
|
||
<a class="skip-to-content muted-link" href="#furo-main-content">Skip to content</a>
|
||
|
||
<div class="page">
|
||
<header class="mobile-header">
|
||
<div class="header-left">
|
||
<label class="nav-overlay-icon" for="__navigation">
|
||
<span class="icon"
|
||
><svg><use href="#svg-menu"></use></svg
|
||
></span>
|
||
</label>
|
||
</div>
|
||
<div class="header-center">
|
||
<a href="index.html"
|
||
><div class="brand">Reticulum Network Stack 1.0.5 documentation</div></a
|
||
>
|
||
</div>
|
||
<div class="header-right">
|
||
<div class="theme-toggle-container theme-toggle-header">
|
||
<button class="theme-toggle" aria-label="Toggle Light / Dark / Auto color theme">
|
||
<svg class="theme-icon-when-auto-light"><use href="#svg-sun-with-moon"></use></svg>
|
||
<svg class="theme-icon-when-auto-dark"><use href="#svg-moon-with-sun"></use></svg>
|
||
<svg class="theme-icon-when-dark"><use href="#svg-moon"></use></svg>
|
||
<svg class="theme-icon-when-light"><use href="#svg-sun"></use></svg>
|
||
</button>
|
||
</div>
|
||
<label class="toc-overlay-icon toc-header-icon" for="__toc">
|
||
<span class="icon"
|
||
><svg><use href="#svg-toc"></use></svg
|
||
></span>
|
||
</label>
|
||
</div>
|
||
</header>
|
||
<aside class="sidebar-drawer">
|
||
<div class="sidebar-container">
|
||
<div class="sidebar-sticky">
|
||
<a class="sidebar-brand" href="index.html">
|
||
<div class="sidebar-logo-container">
|
||
<img class="sidebar-logo" src="_static/rns_logo_512.png" alt="Logo" />
|
||
</div>
|
||
|
||
<span class="sidebar-brand-text">Reticulum Network Stack 1.0.5 documentation</span>
|
||
</a>
|
||
<form class="sidebar-search-container" method="get" action="search.html" role="search">
|
||
<input class="sidebar-search" placeholder="Search" name="q" aria-label="Search" />
|
||
<input type="hidden" name="check_keywords" value="yes" />
|
||
<input type="hidden" name="area" value="default" />
|
||
</form>
|
||
<div id="searchbox"></div>
|
||
<div class="sidebar-scroll">
|
||
<div class="sidebar-tree">
|
||
<ul>
|
||
<li class="toctree-l1">
|
||
<a class="reference internal" href="whatis.html">Что такое Reticulum?</a>
|
||
</li>
|
||
<li class="toctree-l1">
|
||
<a class="reference internal" href="gettingstartedfast.html"
|
||
>Быстрый старт</a
|
||
>
|
||
</li>
|
||
<li class="toctree-l1">
|
||
<a class="reference internal" href="using.html"
|
||
>Использование Reticulum на вашей системе</a
|
||
>
|
||
</li>
|
||
<li class="toctree-l1">
|
||
<a class="reference internal" href="understanding.html"
|
||
>Понимание Reticulum</a
|
||
>
|
||
</li>
|
||
<li class="toctree-l1">
|
||
<a class="reference internal" href="hardware.html">Коммуникационное оборудование</a>
|
||
</li>
|
||
<li class="toctree-l1">
|
||
<a class="reference internal" href="interfaces.html">Настройка интерфейсов</a>
|
||
</li>
|
||
<li class="toctree-l1">
|
||
<a class="reference internal" href="networks.html">Создание сетей</a>
|
||
</li>
|
||
<li class="toctree-l1">
|
||
<a class="reference internal" href="support.html">Поддержка Reticulum</a>
|
||
</li>
|
||
<li class="toctree-l1">
|
||
<a class="reference internal" href="examples.html">Примеры кода</a>
|
||
</li>
|
||
</ul>
|
||
<ul class="current">
|
||
<li class="toctree-l1 current current-page">
|
||
<a class="current reference internal" href="#">Справочник API</a>
|
||
</li>
|
||
</ul><br>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</aside>
|
||
<div class="main">
|
||
<div class="content">
|
||
<div class="article-container">
|
||
<a href="#" class="back-to-top muted-link">
|
||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">
|
||
<path
|
||
d="M13 20h-2V8l-5.5 5.5-1.42-1.42L12 4.16l7.92 7.92-1.42 1.42L13 8v12z"
|
||
></path>
|
||
</svg>
|
||
<span>Back to top</span>
|
||
</a>
|
||
<div class="content-icon-container">
|
||
<div class="theme-toggle-container theme-toggle-content">
|
||
<button class="theme-toggle" aria-label="Toggle Light / Dark / Auto color theme">
|
||
<svg class="theme-icon-when-auto-light">
|
||
<use href="#svg-sun-with-moon"></use>
|
||
</svg>
|
||
<svg class="theme-icon-when-auto-dark"><use href="#svg-moon-with-sun"></use></svg>
|
||
<svg class="theme-icon-when-dark"><use href="#svg-moon"></use></svg>
|
||
<svg class="theme-icon-when-light"><use href="#svg-sun"></use></svg>
|
||
</button>
|
||
</div>
|
||
<label class="toc-overlay-icon toc-content-icon" for="__toc">
|
||
<span class="icon"
|
||
><svg><use href="#svg-toc"></use></svg
|
||
></span>
|
||
</label>
|
||
</div>
|
||
<article role="main" id="furo-main-content">
|
||
<section id="api-reference">
|
||
<span id="api-main"></span>
|
||
<h1>
|
||
API Reference<a
|
||
class="headerlink"
|
||
href="#api-reference"
|
||
title="Link to this heading"
|
||
>¶</a
|
||
>
|
||
</h1>
|
||
<p>
|
||
Communication over Reticulum networks is achieved by using a simple set of classes
|
||
exposed by the RNS API. This chapter lists and explains all classes exposed by the
|
||
Reticulum Network Stack API, along with their method signatures and usage. It can
|
||
be used as a reference while writing applications that utilise Reticulum, or it
|
||
can be read in entirity to gain an understanding of the complete functionality of
|
||
RNS from a developers perspective.
|
||
</p>
|
||
<p id="api-reticulum"></p>
|
||
<h3>Reticulum</h3>
|
||
<p></p>
|
||
<dl class="py class">
|
||
<dt class="sig sig-object py" id="RNS.Reticulum">
|
||
<em class="property"
|
||
><span class="k"><span class="pre">class</span></span
|
||
><span class="w"> </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
|
||
>,
|
||
<em class="sig-param"
|
||
><span class="n"><span class="pre">logdest</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">verbosity</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">require_shared_instance</span></span
|
||
><span class="o"><span class="pre">=</span></span
|
||
><span class="default_value"><span class="pre">False</span></span></em
|
||
>,
|
||
<em class="sig-param"
|
||
><span class="n"><span class="pre">shared_instance_type</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="Link 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="w"> </span><span class="p"><span class="pre">=</span></span
|
||
><span class="w"> </span><span class="pre">500</span></em
|
||
><a
|
||
class="headerlink"
|
||
href="#RNS.Reticulum.MTU"
|
||
title="Link 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 attribute">
|
||
<dt class="sig sig-object py" id="RNS.Reticulum.LINK_MTU_DISCOVERY">
|
||
<span class="sig-name descname"
|
||
><span class="pre">LINK_MTU_DISCOVERY</span></span
|
||
><em class="property"
|
||
><span class="w"> </span><span class="p"><span class="pre">=</span></span
|
||
><span class="w"> </span><span class="pre">True</span></em
|
||
><a
|
||
class="headerlink"
|
||
href="#RNS.Reticulum.LINK_MTU_DISCOVERY"
|
||
title="Link to this definition"
|
||
>¶</a
|
||
>
|
||
</dt>
|
||
<dd>
|
||
<p>
|
||
Whether automatic link MTU discovery is enabled by default in this
|
||
release. Link MTU discovery significantly increases throughput over fast
|
||
links, but requires all intermediary hops to also support it. Support for
|
||
this feature was added in RNS version 0.9.0. This option will become
|
||
enabled by default in the near future. Please update your RNS instances.
|
||
</p>
|
||
</dd>
|
||
</dl>
|
||
|
||
<dl class="py attribute">
|
||
<dt class="sig sig-object py" id="RNS.Reticulum.ANNOUNCE_CAP">
|
||
<span class="sig-name descname"><span class="pre">ANNOUNCE_CAP</span></span
|
||
><em class="property"
|
||
><span class="w"> </span><span class="p"><span class="pre">=</span></span
|
||
><span class="w"> </span><span class="pre">2</span></em
|
||
><a
|
||
class="headerlink"
|
||
href="#RNS.Reticulum.ANNOUNCE_CAP"
|
||
title="Link to this definition"
|
||
>¶</a
|
||
>
|
||
</dt>
|
||
<dd>
|
||
<p>
|
||
The maximum percentage of interface bandwidth that, at any given time, may
|
||
be used to propagate announces. If an announce was scheduled for
|
||
broadcasting on an interface, but doing so would exceed the allowed
|
||
bandwidth allocation, the announce will be queued for transmission when
|
||
there is bandwidth available.
|
||
</p>
|
||
<p>
|
||
Reticulum will always prioritise propagating announces with fewer hops,
|
||
ensuring that distant, large networks with many peers on fast links don’t
|
||
overwhelm the capacity of smaller networks on slower mediums. If an
|
||
announce remains queued for an extended amount of time, it will eventually
|
||
be dropped.
|
||
</p>
|
||
<p>
|
||
This value will be applied by default to all created interfaces, but it
|
||
can be configured individually on a per-interface basis. In general, the
|
||
global default setting should not be changed, and any alterations should
|
||
be made on a per-interface basis instead.
|
||
</p>
|
||
</dd>
|
||
</dl>
|
||
|
||
<dl class="py attribute">
|
||
<dt class="sig sig-object py" id="RNS.Reticulum.MINIMUM_BITRATE">
|
||
<span class="sig-name descname"
|
||
><span class="pre">MINIMUM_BITRATE</span></span
|
||
><em class="property"
|
||
><span class="w"> </span><span class="p"><span class="pre">=</span></span
|
||
><span class="w"> </span><span class="pre">5</span></em
|
||
><a
|
||
class="headerlink"
|
||
href="#RNS.Reticulum.MINIMUM_BITRATE"
|
||
title="Link to this definition"
|
||
>¶</a
|
||
>
|
||
</dt>
|
||
<dd>
|
||
<p>
|
||
Minimum bitrate required across a medium for Reticulum to be able to
|
||
successfully establish links. Currently 5 bits per second.
|
||
</p>
|
||
</dd>
|
||
</dl>
|
||
|
||
<dl class="py method">
|
||
<dt class="sig sig-object py" id="RNS.Reticulum.get_instance">
|
||
<em class="property"
|
||
><span class="k"><span class="pre">static</span></span
|
||
><span class="w"> </span></em
|
||
><span class="sig-name descname"><span class="pre">get_instance</span></span
|
||
><span class="sig-paren">(</span><span class="sig-paren">)</span
|
||
><a
|
||
class="headerlink"
|
||
href="#RNS.Reticulum.get_instance"
|
||
title="Link to this definition"
|
||
>¶</a
|
||
>
|
||
</dt>
|
||
<dd><p>Return the currently running Reticulum instance</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="k"><span class="pre">static</span></span
|
||
><span class="w"> </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="Link 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<span class="colon">:</span></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="k"><span class="pre">static</span></span
|
||
><span class="w"> </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="Link 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<span class="colon">:</span></dt>
|
||
<dd class="field-odd">
|
||
<p>True if Transport is enabled, False if not.</p>
|
||
</dd>
|
||
</dl>
|
||
</dd>
|
||
</dl>
|
||
|
||
<dl class="py method">
|
||
<dt class="sig sig-object py" id="RNS.Reticulum.link_mtu_discovery">
|
||
<em class="property"
|
||
><span class="k"><span class="pre">static</span></span
|
||
><span class="w"> </span></em
|
||
><span class="sig-name descname"
|
||
><span class="pre">link_mtu_discovery</span></span
|
||
><span class="sig-paren">(</span><span class="sig-paren">)</span
|
||
><a
|
||
class="headerlink"
|
||
href="#RNS.Reticulum.link_mtu_discovery"
|
||
title="Link to this definition"
|
||
>¶</a
|
||
>
|
||
</dt>
|
||
<dd>
|
||
<p>
|
||
Returns whether link MTU discovery is enabled for the running instance.
|
||
</p>
|
||
<p>
|
||
When link MTU discovery is enabled, Reticulum will automatically upgrade
|
||
link MTUs to the highest supported value, increasing transfer speed and
|
||
efficiency.
|
||
</p>
|
||
<dl class="field-list simple">
|
||
<dt class="field-odd">Returns<span class="colon">:</span></dt>
|
||
<dd class="field-odd">
|
||
<p>True if link MTU discovery is enabled, False if not.</p>
|
||
</dd>
|
||
</dl>
|
||
</dd>
|
||
</dl>
|
||
|
||
<dl class="py method">
|
||
<dt class="sig sig-object py" id="RNS.Reticulum.remote_management_enabled">
|
||
<em class="property"
|
||
><span class="k"><span class="pre">static</span></span
|
||
><span class="w"> </span></em
|
||
><span class="sig-name descname"
|
||
><span class="pre">remote_management_enabled</span></span
|
||
><span class="sig-paren">(</span><span class="sig-paren">)</span
|
||
><a
|
||
class="headerlink"
|
||
href="#RNS.Reticulum.remote_management_enabled"
|
||
title="Link to this definition"
|
||
>¶</a
|
||
>
|
||
</dt>
|
||
<dd>
|
||
<p>
|
||
Returns whether remote management is enabled for the running instance.
|
||
</p>
|
||
<p>
|
||
When remote management is enabled, authenticated peers can remotely query
|
||
and manage this instance.
|
||
</p>
|
||
<dl class="field-list simple">
|
||
<dt class="field-odd">Returns<span class="colon">:</span></dt>
|
||
<dd class="field-odd">
|
||
<p>True if remote management is enabled, False if not.</p>
|
||
</dd>
|
||
</dl>
|
||
</dd>
|
||
</dl>
|
||
</dd>
|
||
</dl>
|
||
|
||
<p id="api-identity"></p>
|
||
<h3>Identity</h3>
|
||
<p></p>
|
||
<dl class="py class">
|
||
<dt class="sig sig-object py" id="RNS.Identity">
|
||
<em class="property"
|
||
><span class="k"><span class="pre">class</span></span
|
||
><span class="w"> </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="Link 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<span class="colon">:</span></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="w"> </span><span class="p"><span class="pre">=</span></span
|
||
><span class="w"> </span><span class="pre">'Curve25519'</span></em
|
||
><a
|
||
class="headerlink"
|
||
href="#RNS.Identity.CURVE"
|
||
title="Link 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="w"> </span><span class="p"><span class="pre">=</span></span
|
||
><span class="w"> </span><span class="pre">512</span></em
|
||
><a
|
||
class="headerlink"
|
||
href="#RNS.Identity.KEYSIZE"
|
||
title="Link to this definition"
|
||
>¶</a
|
||
>
|
||
</dt>
|
||
<dd>
|
||
<p>
|
||
X.25519 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.RATCHETSIZE">
|
||
<span class="sig-name descname"><span class="pre">RATCHETSIZE</span></span
|
||
><em class="property"
|
||
><span class="w"> </span><span class="p"><span class="pre">=</span></span
|
||
><span class="w"> </span><span class="pre">256</span></em
|
||
><a
|
||
class="headerlink"
|
||
href="#RNS.Identity.RATCHETSIZE"
|
||
title="Link to this definition"
|
||
>¶</a
|
||
>
|
||
</dt>
|
||
<dd><p>X.25519 ratchet key size in bits.</p></dd>
|
||
</dl>
|
||
|
||
<dl class="py attribute">
|
||
<dt class="sig sig-object py" id="RNS.Identity.RATCHET_EXPIRY">
|
||
<span class="sig-name descname"
|
||
><span class="pre">RATCHET_EXPIRY</span></span
|
||
><em class="property"
|
||
><span class="w"> </span><span class="p"><span class="pre">=</span></span
|
||
><span class="w"> </span><span class="pre">2592000</span></em
|
||
><a
|
||
class="headerlink"
|
||
href="#RNS.Identity.RATCHET_EXPIRY"
|
||
title="Link to this definition"
|
||
>¶</a
|
||
>
|
||
</dt>
|
||
<dd>
|
||
<p>
|
||
The expiry time for received ratchets in seconds, defaults to 30 days.
|
||
Reticulum will always use the most recently announced ratchet, and
|
||
remember it for up to
|
||
<code class="docutils literal notranslate"
|
||
><span class="pre">RATCHET_EXPIRY</span></code
|
||
>
|
||
since receiving it, after which it will be discarded. If a newer ratchet
|
||
is announced in the meantime, it will be replace the already known
|
||
ratchet.
|
||
</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="w"> </span><span class="p"><span class="pre">=</span></span
|
||
><span class="w"> </span><span class="pre">128</span></em
|
||
><a
|
||
class="headerlink"
|
||
href="#RNS.Identity.TRUNCATED_HASHLENGTH"
|
||
title="Link 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="k"><span class="pre">static</span></span
|
||
><span class="w"> </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">target_hash</span></span></em
|
||
>,
|
||
<em class="sig-param"
|
||
><span class="n"><span class="pre">from_identity_hash</span></span
|
||
><span class="o"><span class="pre">=</span></span
|
||
><span class="default_value"><span class="pre">False</span></span></em
|
||
><span class="sig-paren">)</span
|
||
><a
|
||
class="headerlink"
|
||
href="#RNS.Identity.recall"
|
||
title="Link to this definition"
|
||
>¶</a
|
||
>
|
||
</dt>
|
||
<dd>
|
||
<p>
|
||
Recall identity for a destination or identity hash. By default, this
|
||
function will return the identity associated with a given
|
||
<em>destination</em> hash. As an example, if you know the
|
||
<code class="docutils literal notranslate"
|
||
><span class="pre">lxmf.delivery</span></code
|
||
>
|
||
destination hash of an endpoint, this function will return the associated
|
||
underlying identity. You can also search for an identity from a known
|
||
<em>identity hash</em>, by setting the
|
||
<code class="docutils literal notranslate"
|
||
><span class="pre">from_identity_hash</span></code
|
||
>
|
||
argument.
|
||
</p>
|
||
<dl class="field-list simple">
|
||
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
|
||
<dd class="field-odd">
|
||
<ul class="simple">
|
||
<li>
|
||
<p>
|
||
<strong>target_hash</strong> – Destination or identity hash as
|
||
<em>bytes</em>.
|
||
</p>
|
||
</li>
|
||
<li>
|
||
<p>
|
||
<strong>from_identity_hash</strong> – Whether to search based on
|
||
identity hash instead of destination hash as <em>bool</em>.
|
||
</p>
|
||
</li>
|
||
</ul>
|
||
</dd>
|
||
<dt class="field-even">Returns<span class="colon">:</span></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="k"><span class="pre">static</span></span
|
||
><span class="w"> </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="Link 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<span class="colon">:</span></dt>
|
||
<dd class="field-odd">
|
||
<p>
|
||
<strong>destination_hash</strong> – Destination hash as
|
||
<em>bytes</em>.
|
||
</p>
|
||
</dd>
|
||
<dt class="field-even">Returns<span class="colon">:</span></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="k"><span class="pre">static</span></span
|
||
><span class="w"> </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="Link 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<span class="colon">:</span></dt>
|
||
<dd class="field-odd">
|
||
<p><strong>data</strong> – Data to be hashed as <em>bytes</em>.</p>
|
||
</dd>
|
||
<dt class="field-even">Returns<span class="colon">:</span></dt>
|
||
<dd class="field-even">
|
||
<p>SHA-256 hash as <em>bytes</em>.</p>
|
||
</dd>
|
||
</dl>
|
||
</dd>
|
||
</dl>
|
||
|
||
<dl class="py method">
|
||
<dt class="sig sig-object py" id="RNS.Identity.truncated_hash">
|
||
<em class="property"
|
||
><span class="k"><span class="pre">static</span></span
|
||
><span class="w"> </span></em
|
||
><span class="sig-name descname"
|
||
><span class="pre">truncated_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.truncated_hash"
|
||
title="Link to this definition"
|
||
>¶</a
|
||
>
|
||
</dt>
|
||
<dd>
|
||
<p>Get a truncated SHA-256 hash of passed data.</p>
|
||
<dl class="field-list simple">
|
||
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
|
||
<dd class="field-odd">
|
||
<p><strong>data</strong> – Data to be hashed as <em>bytes</em>.</p>
|
||
</dd>
|
||
<dt class="field-even">Returns<span class="colon">:</span></dt>
|
||
<dd class="field-even">
|
||
<p>Truncated SHA-256 hash as <em>bytes</em>.</p>
|
||
</dd>
|
||
</dl>
|
||
</dd>
|
||
</dl>
|
||
|
||
<dl class="py method">
|
||
<dt class="sig sig-object py" id="RNS.Identity.get_random_hash">
|
||
<em class="property"
|
||
><span class="k"><span class="pre">static</span></span
|
||
><span class="w"> </span></em
|
||
><span class="sig-name descname"
|
||
><span class="pre">get_random_hash</span></span
|
||
><span class="sig-paren">(</span><span class="sig-paren">)</span
|
||
><a
|
||
class="headerlink"
|
||
href="#RNS.Identity.get_random_hash"
|
||
title="Link to this definition"
|
||
>¶</a
|
||
>
|
||
</dt>
|
||
<dd>
|
||
<p>Get a random SHA-256 hash.</p>
|
||
<dl class="field-list simple">
|
||
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
|
||
<dd class="field-odd">
|
||
<p><strong>data</strong> – Data to be hashed as <em>bytes</em>.</p>
|
||
</dd>
|
||
<dt class="field-even">Returns<span class="colon">:</span></dt>
|
||
<dd class="field-even">
|
||
<p>Truncated SHA-256 hash of random data as <em>bytes</em>.</p>
|
||
</dd>
|
||
</dl>
|
||
</dd>
|
||
</dl>
|
||
|
||
<dl class="py method">
|
||
<dt class="sig sig-object py" id="RNS.Identity.current_ratchet_id">
|
||
<em class="property"
|
||
><span class="k"><span class="pre">static</span></span
|
||
><span class="w"> </span></em
|
||
><span class="sig-name descname"
|
||
><span class="pre">current_ratchet_id</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.current_ratchet_id"
|
||
title="Link to this definition"
|
||
>¶</a
|
||
>
|
||
</dt>
|
||
<dd>
|
||
<p>
|
||
Get the ID of the currently used ratchet key for a given destination hash
|
||
</p>
|
||
<dl class="field-list simple">
|
||
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
|
||
<dd class="field-odd">
|
||
<p>
|
||
<strong>destination_hash</strong> – A destination hash as
|
||
<em>bytes</em>.
|
||
</p>
|
||
</dd>
|
||
<dt class="field-even">Returns<span class="colon">:</span></dt>
|
||
<dd class="field-even">
|
||
<p>A ratchet ID as <em>bytes</em> or <em>None</em>.</p>
|
||
</dd>
|
||
</dl>
|
||
</dd>
|
||
</dl>
|
||
|
||
<dl class="py method">
|
||
<dt class="sig sig-object py" id="RNS.Identity.from_bytes">
|
||
<em class="property"
|
||
><span class="k"><span class="pre">static</span></span
|
||
><span class="w"> </span></em
|
||
><span class="sig-name descname"><span class="pre">from_bytes</span></span
|
||
><span class="sig-paren">(</span
|
||
><em class="sig-param"
|
||
><span class="n"><span class="pre">prv_bytes</span></span></em
|
||
><span class="sig-paren">)</span
|
||
><a
|
||
class="headerlink"
|
||
href="#RNS.Identity.from_bytes"
|
||
title="Link to this definition"
|
||
>¶</a
|
||
>
|
||
</dt>
|
||
<dd>
|
||
<p>
|
||
Create a new
|
||
<a class="reference internal" href="#api-identity"
|
||
><span class="std std-ref">RNS.Identity</span></a
|
||
>
|
||
instance from <em>bytes</em> of private key. Can be used to load
|
||
previously created and saved identities into Reticulum.
|
||
</p>
|
||
<dl class="field-list simple">
|
||
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
|
||
<dd class="field-odd">
|
||
<p>
|
||
<strong>prv_bytes</strong> – The <em>bytes</em> of private a saved
|
||
private key. <strong>HAZARD!</strong> Never use this to generate a new
|
||
key by feeding random data in prv_bytes.
|
||
</p>
|
||
</dd>
|
||
<dt class="field-even">Returns<span class="colon">:</span></dt>
|
||
<dd class="field-even">
|
||
<p>
|
||
A
|
||
<a class="reference internal" href="#api-identity"
|
||
><span class="std std-ref">RNS.Identity</span></a
|
||
>
|
||
instance, or <em>None</em> if the <em>bytes</em> data was invalid.
|
||
</p>
|
||
</dd>
|
||
</dl>
|
||
</dd>
|
||
</dl>
|
||
|
||
<dl class="py method">
|
||
<dt class="sig sig-object py" id="RNS.Identity.from_file">
|
||
<em class="property"
|
||
><span class="k"><span class="pre">static</span></span
|
||
><span class="w"> </span></em
|
||
><span class="sig-name descname"><span class="pre">from_file</span></span
|
||
><span class="sig-paren">(</span
|
||
><em class="sig-param"
|
||
><span class="n"><span class="pre">path</span></span></em
|
||
><span class="sig-paren">)</span
|
||
><a
|
||
class="headerlink"
|
||
href="#RNS.Identity.from_file"
|
||
title="Link to this definition"
|
||
>¶</a
|
||
>
|
||
</dt>
|
||
<dd>
|
||
<p>
|
||
Create a new
|
||
<a class="reference internal" href="#api-identity"
|
||
><span class="std std-ref">RNS.Identity</span></a
|
||
>
|
||
instance from a file. Can be used to load previously created and saved
|
||
identities into Reticulum.
|
||
</p>
|
||
<dl class="field-list simple">
|
||
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
|
||
<dd class="field-odd">
|
||
<p>
|
||
<strong>path</strong> – The full path to the saved
|
||
<a class="reference internal" href="#api-identity"
|
||
><span class="std std-ref">RNS.Identity</span></a
|
||
>
|
||
data
|
||
</p>
|
||
</dd>
|
||
<dt class="field-even">Returns<span class="colon">:</span></dt>
|
||
<dd class="field-even">
|
||
<p>
|
||
A
|
||
<a class="reference internal" href="#api-identity"
|
||
><span class="std std-ref">RNS.Identity</span></a
|
||
>
|
||
instance, or <em>None</em> if the loaded data was invalid.
|
||
</p>
|
||
</dd>
|
||
</dl>
|
||
</dd>
|
||
</dl>
|
||
|
||
<dl class="py method">
|
||
<dt class="sig sig-object py" id="RNS.Identity.to_file">
|
||
<span class="sig-name descname"><span class="pre">to_file</span></span
|
||
><span class="sig-paren">(</span
|
||
><em class="sig-param"
|
||
><span class="n"><span class="pre">path</span></span></em
|
||
><span class="sig-paren">)</span
|
||
><a
|
||
class="headerlink"
|
||
href="#RNS.Identity.to_file"
|
||
title="Link to this definition"
|
||
>¶</a
|
||
>
|
||
</dt>
|
||
<dd>
|
||
<p>
|
||
Saves the identity to a file. This will write the private key to disk, and
|
||
anyone with access to this file will be able to decrypt all communication
|
||
for the identity. Be very careful with this method.
|
||
</p>
|
||
<dl class="field-list simple">
|
||
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
|
||
<dd class="field-odd">
|
||
<p>
|
||
<strong>path</strong> – The full path specifying where to save the
|
||
identity.
|
||
</p>
|
||
</dd>
|
||
<dt class="field-even">Returns<span class="colon">:</span></dt>
|
||
<dd class="field-even">
|
||
<p>True if the file was saved, otherwise False.</p>
|
||
</dd>
|
||
</dl>
|
||
</dd>
|
||
</dl>
|
||
|
||
<dl class="py method">
|
||
<dt class="sig sig-object py" id="RNS.Identity.get_private_key">
|
||
<span class="sig-name descname"
|
||
><span class="pre">get_private_key</span></span
|
||
><span class="sig-paren">(</span><span class="sig-paren">)</span
|
||
><a
|
||
class="headerlink"
|
||
href="#RNS.Identity.get_private_key"
|
||
title="Link to this definition"
|
||
>¶</a
|
||
>
|
||
</dt>
|
||
<dd>
|
||
<dl class="field-list simple">
|
||
<dt class="field-odd">Returns<span class="colon">:</span></dt>
|
||
<dd class="field-odd">
|
||
<p>The private key as <em>bytes</em></p>
|
||
</dd>
|
||
</dl>
|
||
</dd>
|
||
</dl>
|
||
|
||
<dl class="py method">
|
||
<dt class="sig sig-object py" id="RNS.Identity.get_public_key">
|
||
<span class="sig-name descname"
|
||
><span class="pre">get_public_key</span></span
|
||
><span class="sig-paren">(</span><span class="sig-paren">)</span
|
||
><a
|
||
class="headerlink"
|
||
href="#RNS.Identity.get_public_key"
|
||
title="Link to this definition"
|
||
>¶</a
|
||
>
|
||
</dt>
|
||
<dd>
|
||
<dl class="field-list simple">
|
||
<dt class="field-odd">Returns<span class="colon">:</span></dt>
|
||
<dd class="field-odd">
|
||
<p>The public key as <em>bytes</em></p>
|
||
</dd>
|
||
</dl>
|
||
</dd>
|
||
</dl>
|
||
|
||
<dl class="py method">
|
||
<dt class="sig sig-object py" id="RNS.Identity.load_private_key">
|
||
<span class="sig-name descname"
|
||
><span class="pre">load_private_key</span></span
|
||
><span class="sig-paren">(</span
|
||
><em class="sig-param"
|
||
><span class="n"><span class="pre">prv_bytes</span></span></em
|
||
><span class="sig-paren">)</span
|
||
><a
|
||
class="headerlink"
|
||
href="#RNS.Identity.load_private_key"
|
||
title="Link to this definition"
|
||
>¶</a
|
||
>
|
||
</dt>
|
||
<dd>
|
||
<p>Load a private key into the instance.</p>
|
||
<dl class="field-list simple">
|
||
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
|
||
<dd class="field-odd">
|
||
<p><strong>prv_bytes</strong> – The private key as <em>bytes</em>.</p>
|
||
</dd>
|
||
<dt class="field-even">Returns<span class="colon">:</span></dt>
|
||
<dd class="field-even">
|
||
<p>True if the key was loaded, otherwise False.</p>
|
||
</dd>
|
||
</dl>
|
||
</dd>
|
||
</dl>
|
||
|
||
<dl class="py method">
|
||
<dt class="sig sig-object py" id="RNS.Identity.load_public_key">
|
||
<span class="sig-name descname"
|
||
><span class="pre">load_public_key</span></span
|
||
><span class="sig-paren">(</span
|
||
><em class="sig-param"
|
||
><span class="n"><span class="pre">pub_bytes</span></span></em
|
||
><span class="sig-paren">)</span
|
||
><a
|
||
class="headerlink"
|
||
href="#RNS.Identity.load_public_key"
|
||
title="Link to this definition"
|
||
>¶</a
|
||
>
|
||
</dt>
|
||
<dd>
|
||
<p>Load a public key into the instance.</p>
|
||
<dl class="field-list simple">
|
||
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
|
||
<dd class="field-odd">
|
||
<p><strong>pub_bytes</strong> – The public key as <em>bytes</em>.</p>
|
||
</dd>
|
||
<dt class="field-even">Returns<span class="colon">:</span></dt>
|
||
<dd class="field-even">
|
||
<p>True if the key was loaded, otherwise False.</p>
|
||
</dd>
|
||
</dl>
|
||
</dd>
|
||
</dl>
|
||
|
||
<dl class="py method">
|
||
<dt class="sig sig-object py" id="RNS.Identity.encrypt">
|
||
<span class="sig-name descname"><span class="pre">encrypt</span></span
|
||
><span class="sig-paren">(</span
|
||
><em class="sig-param"
|
||
><span class="n"><span class="pre">plaintext</span></span></em
|
||
>,
|
||
<em class="sig-param"
|
||
><span class="n"><span class="pre">ratchet</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.Identity.encrypt"
|
||
title="Link to this definition"
|
||
>¶</a
|
||
>
|
||
</dt>
|
||
<dd>
|
||
<p>Encrypts information for the identity.</p>
|
||
<dl class="field-list simple">
|
||
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
|
||
<dd class="field-odd">
|
||
<p>
|
||
<strong>plaintext</strong> – The plaintext to be encrypted as
|
||
<em>bytes</em>.
|
||
</p>
|
||
</dd>
|
||
<dt class="field-even">Returns<span class="colon">:</span></dt>
|
||
<dd class="field-even">
|
||
<p>Ciphertext token as <em>bytes</em>.</p>
|
||
</dd>
|
||
<dt class="field-odd">Raises<span class="colon">:</span></dt>
|
||
<dd class="field-odd">
|
||
<p><em>KeyError</em> if the instance does not hold a public key.</p>
|
||
</dd>
|
||
</dl>
|
||
</dd>
|
||
</dl>
|
||
|
||
<dl class="py method">
|
||
<dt class="sig sig-object py" id="RNS.Identity.decrypt">
|
||
<span class="sig-name descname"><span class="pre">decrypt</span></span
|
||
><span class="sig-paren">(</span
|
||
><em class="sig-param"
|
||
><span class="n"><span class="pre">ciphertext_token</span></span></em
|
||
>,
|
||
<em class="sig-param"
|
||
><span class="n"><span class="pre">ratchets</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">enforce_ratchets</span></span
|
||
><span class="o"><span class="pre">=</span></span
|
||
><span class="default_value"><span class="pre">False</span></span></em
|
||
>,
|
||
<em class="sig-param"
|
||
><span class="n"><span class="pre">ratchet_id_receiver</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.Identity.decrypt"
|
||
title="Link to this definition"
|
||
>¶</a
|
||
>
|
||
</dt>
|
||
<dd>
|
||
<p>Decrypts information for the identity.</p>
|
||
<dl class="field-list simple">
|
||
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
|
||
<dd class="field-odd">
|
||
<p>
|
||
<strong>ciphertext</strong> – The ciphertext to be decrypted as
|
||
<em>bytes</em>.
|
||
</p>
|
||
</dd>
|
||
<dt class="field-even">Returns<span class="colon">:</span></dt>
|
||
<dd class="field-even">
|
||
<p>
|
||
Plaintext as <em>bytes</em>, or <em>None</em> if decryption fails.
|
||
</p>
|
||
</dd>
|
||
<dt class="field-odd">Raises<span class="colon">:</span></dt>
|
||
<dd class="field-odd">
|
||
<p><em>KeyError</em> if the instance does not hold a private key.</p>
|
||
</dd>
|
||
</dl>
|
||
</dd>
|
||
</dl>
|
||
|
||
<dl class="py method">
|
||
<dt class="sig sig-object py" id="RNS.Identity.sign">
|
||
<span class="sig-name descname"><span class="pre">sign</span></span
|
||
><span class="sig-paren">(</span
|
||
><em class="sig-param"
|
||
><span class="n"><span class="pre">message</span></span></em
|
||
><span class="sig-paren">)</span
|
||
><a
|
||
class="headerlink"
|
||
href="#RNS.Identity.sign"
|
||
title="Link to this definition"
|
||
>¶</a
|
||
>
|
||
</dt>
|
||
<dd>
|
||
<p>Signs information by the identity.</p>
|
||
<dl class="field-list simple">
|
||
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
|
||
<dd class="field-odd">
|
||
<p>
|
||
<strong>message</strong> – The message to be signed as <em>bytes</em>.
|
||
</p>
|
||
</dd>
|
||
<dt class="field-even">Returns<span class="colon">:</span></dt>
|
||
<dd class="field-even">
|
||
<p>Signature as <em>bytes</em>.</p>
|
||
</dd>
|
||
<dt class="field-odd">Raises<span class="colon">:</span></dt>
|
||
<dd class="field-odd">
|
||
<p><em>KeyError</em> if the instance does not hold a private key.</p>
|
||
</dd>
|
||
</dl>
|
||
</dd>
|
||
</dl>
|
||
|
||
<dl class="py method">
|
||
<dt class="sig sig-object py" id="RNS.Identity.validate">
|
||
<span class="sig-name descname"><span class="pre">validate</span></span
|
||
><span class="sig-paren">(</span
|
||
><em class="sig-param"
|
||
><span class="n"><span class="pre">signature</span></span></em
|
||
>,
|
||
<em class="sig-param"
|
||
><span class="n"><span class="pre">message</span></span></em
|
||
><span class="sig-paren">)</span
|
||
><a
|
||
class="headerlink"
|
||
href="#RNS.Identity.validate"
|
||
title="Link to this definition"
|
||
>¶</a
|
||
>
|
||
</dt>
|
||
<dd>
|
||
<p>Validates the signature of a signed message.</p>
|
||
<dl class="field-list simple">
|
||
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
|
||
<dd class="field-odd">
|
||
<ul class="simple">
|
||
<li>
|
||
<p>
|
||
<strong>signature</strong> – The signature to be validated as
|
||
<em>bytes</em>.
|
||
</p>
|
||
</li>
|
||
<li>
|
||
<p>
|
||
<strong>message</strong> – The message to be validated as
|
||
<em>bytes</em>.
|
||
</p>
|
||
</li>
|
||
</ul>
|
||
</dd>
|
||
<dt class="field-even">Returns<span class="colon">:</span></dt>
|
||
<dd class="field-even">
|
||
<p>True if the signature is valid, otherwise False.</p>
|
||
</dd>
|
||
<dt class="field-odd">Raises<span class="colon">:</span></dt>
|
||
<dd class="field-odd">
|
||
<p><em>KeyError</em> if the instance does not hold a public key.</p>
|
||
</dd>
|
||
</dl>
|
||
</dd>
|
||
</dl>
|
||
</dd>
|
||
</dl>
|
||
|
||
<p id="api-destination"></p>
|
||
<h3>Destination</h3>
|
||
<p></p>
|
||
<dl class="py class">
|
||
<dt class="sig sig-object py" id="RNS.Destination">
|
||
<em class="property"
|
||
><span class="k"><span class="pre">class</span></span
|
||
><span class="w"> </span></em
|
||
><span class="sig-prename descclassname"><span class="pre">RNS.</span></span
|
||
><span class="sig-name descname"><span class="pre">Destination</span></span
|
||
><span class="sig-paren">(</span
|
||
><em class="sig-param"
|
||
><span class="n"><span class="pre">identity</span></span></em
|
||
>,
|
||
<em class="sig-param"
|
||
><span class="n"><span class="pre">direction</span></span></em
|
||
>,
|
||
<em class="sig-param"
|
||
><span class="n"><span class="pre">type</span></span></em
|
||
>,
|
||
<em class="sig-param"
|
||
><span class="n"><span class="pre">app_name</span></span></em
|
||
>,
|
||
<em class="sig-param"
|
||
><span class="o"><span class="pre">*</span></span
|
||
><span class="n"><span class="pre">aspects</span></span></em
|
||
><span class="sig-paren">)</span
|
||
><a class="headerlink" href="#RNS.Destination" title="Link to this definition"
|
||
>¶</a
|
||
>
|
||
</dt>
|
||
<dd>
|
||
<p>
|
||
A class used to describe endpoints in a Reticulum Network. Destination
|
||
instances are used both to create outgoing and incoming endpoints. The
|
||
destination type will decide if encryption, and what type, is used in
|
||
communication with the endpoint. A destination can also announce its presence
|
||
on the network, which will distribute necessary keys for encrypted
|
||
communication with it.
|
||
</p>
|
||
<dl class="field-list simple">
|
||
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
|
||
<dd class="field-odd">
|
||
<ul class="simple">
|
||
<li>
|
||
<p>
|
||
<strong>identity</strong> – An instance of
|
||
<a class="reference internal" href="#api-identity"
|
||
><span class="std std-ref">RNS.Identity</span></a
|
||
>. Can hold only public keys for an outgoing destination, or holding
|
||
private keys for an ingoing.
|
||
</p>
|
||
</li>
|
||
<li>
|
||
<p>
|
||
<strong>direction</strong> –
|
||
<code class="docutils literal notranslate"
|
||
><span class="pre">RNS.Destination.IN</span></code
|
||
>
|
||
or
|
||
<code class="docutils literal notranslate"
|
||
><span class="pre">RNS.Destination.OUT</span></code
|
||
>.
|
||
</p>
|
||
</li>
|
||
<li>
|
||
<p>
|
||
<strong>type</strong> –
|
||
<code class="docutils literal notranslate"
|
||
><span class="pre">RNS.Destination.SINGLE</span></code
|
||
>,
|
||
<code class="docutils literal notranslate"
|
||
><span class="pre">RNS.Destination.GROUP</span></code
|
||
>
|
||
or
|
||
<code class="docutils literal notranslate"
|
||
><span class="pre">RNS.Destination.PLAIN</span></code
|
||
>.
|
||
</p>
|
||
</li>
|
||
<li>
|
||
<p><strong>app_name</strong> – A string specifying the app name.</p>
|
||
</li>
|
||
<li>
|
||
<p>
|
||
<strong>*aspects</strong> – Any non-zero number of string arguments.
|
||
</p>
|
||
</li>
|
||
</ul>
|
||
</dd>
|
||
</dl>
|
||
<dl class="py attribute">
|
||
<dt class="sig sig-object py" id="RNS.Destination.RATCHET_COUNT">
|
||
<span class="sig-name descname"><span class="pre">RATCHET_COUNT</span></span
|
||
><em class="property"
|
||
><span class="w"> </span><span class="p"><span class="pre">=</span></span
|
||
><span class="w"> </span><span class="pre">512</span></em
|
||
><a
|
||
class="headerlink"
|
||
href="#RNS.Destination.RATCHET_COUNT"
|
||
title="Link to this definition"
|
||
>¶</a
|
||
>
|
||
</dt>
|
||
<dd>
|
||
<p>
|
||
The default number of generated ratchet keys a destination will retain, if
|
||
it has ratchets enabled.
|
||
</p>
|
||
</dd>
|
||
</dl>
|
||
|
||
<dl class="py attribute">
|
||
<dt class="sig sig-object py" id="RNS.Destination.RATCHET_INTERVAL">
|
||
<span class="sig-name descname"
|
||
><span class="pre">RATCHET_INTERVAL</span></span
|
||
><em class="property"
|
||
><span class="w"> </span><span class="p"><span class="pre">=</span></span
|
||
><span class="w"> </span><span class="pre">1800</span></em
|
||
><a
|
||
class="headerlink"
|
||
href="#RNS.Destination.RATCHET_INTERVAL"
|
||
title="Link to this definition"
|
||
>¶</a
|
||
>
|
||
</dt>
|
||
<dd>
|
||
<p>The minimum interval between rotating ratchet keys, in seconds.</p>
|
||
</dd>
|
||
</dl>
|
||
|
||
<dl class="py method">
|
||
<dt class="sig sig-object py" id="RNS.Destination.expand_name">
|
||
<em class="property"
|
||
><span class="k"><span class="pre">static</span></span
|
||
><span class="w"> </span></em
|
||
><span class="sig-name descname"><span class="pre">expand_name</span></span
|
||
><span class="sig-paren">(</span
|
||
><em class="sig-param"
|
||
><span class="n"><span class="pre">identity</span></span></em
|
||
>,
|
||
<em class="sig-param"
|
||
><span class="n"><span class="pre">app_name</span></span></em
|
||
>,
|
||
<em class="sig-param"
|
||
><span class="o"><span class="pre">*</span></span
|
||
><span class="n"><span class="pre">aspects</span></span></em
|
||
><span class="sig-paren">)</span
|
||
><a
|
||
class="headerlink"
|
||
href="#RNS.Destination.expand_name"
|
||
title="Link to this definition"
|
||
>¶</a
|
||
>
|
||
</dt>
|
||
<dd>
|
||
<dl class="field-list simple">
|
||
<dt class="field-odd">Returns<span class="colon">:</span></dt>
|
||
<dd class="field-odd">
|
||
<p>
|
||
A string containing the full human-readable name of the destination,
|
||
for an app_name and a number of aspects.
|
||
</p>
|
||
</dd>
|
||
</dl>
|
||
</dd>
|
||
</dl>
|
||
|
||
<dl class="py method">
|
||
<dt class="sig sig-object py" id="RNS.Destination.app_and_aspects_from_name">
|
||
<em class="property"
|
||
><span class="k"><span class="pre">static</span></span
|
||
><span class="w"> </span></em
|
||
><span class="sig-name descname"
|
||
><span class="pre">app_and_aspects_from_name</span></span
|
||
><span class="sig-paren">(</span
|
||
><em class="sig-param"
|
||
><span class="n"><span class="pre">full_name</span></span></em
|
||
><span class="sig-paren">)</span
|
||
><a
|
||
class="headerlink"
|
||
href="#RNS.Destination.app_and_aspects_from_name"
|
||
title="Link to this definition"
|
||
>¶</a
|
||
>
|
||
</dt>
|
||
<dd>
|
||
<dl class="field-list simple">
|
||
<dt class="field-odd">Returns<span class="colon">:</span></dt>
|
||
<dd class="field-odd">
|
||
<p>
|
||
A tuple containing the app name and a list of aspects, for a full-name
|
||
string.
|
||
</p>
|
||
</dd>
|
||
</dl>
|
||
</dd>
|
||
</dl>
|
||
|
||
<dl class="py method">
|
||
<dt
|
||
class="sig sig-object py"
|
||
id="RNS.Destination.hash_from_name_and_identity"
|
||
>
|
||
<em class="property"
|
||
><span class="k"><span class="pre">static</span></span
|
||
><span class="w"> </span></em
|
||
><span class="sig-name descname"
|
||
><span class="pre">hash_from_name_and_identity</span></span
|
||
><span class="sig-paren">(</span
|
||
><em class="sig-param"
|
||
><span class="n"><span class="pre">full_name</span></span></em
|
||
>,
|
||
<em class="sig-param"
|
||
><span class="n"><span class="pre">identity</span></span></em
|
||
><span class="sig-paren">)</span
|
||
><a
|
||
class="headerlink"
|
||
href="#RNS.Destination.hash_from_name_and_identity"
|
||
title="Link to this definition"
|
||
>¶</a
|
||
>
|
||
</dt>
|
||
<dd>
|
||
<dl class="field-list simple">
|
||
<dt class="field-odd">Returns<span class="colon">:</span></dt>
|
||
<dd class="field-odd">
|
||
<p>
|
||
A destination name in adressable hash form, for a full name string and
|
||
Identity instance.
|
||
</p>
|
||
</dd>
|
||
</dl>
|
||
</dd>
|
||
</dl>
|
||
|
||
<dl class="py method">
|
||
<dt class="sig sig-object py" id="RNS.Destination.hash">
|
||
<em class="property"
|
||
><span class="k"><span class="pre">static</span></span
|
||
><span class="w"> </span></em
|
||
><span class="sig-name descname"><span class="pre">hash</span></span
|
||
><span class="sig-paren">(</span
|
||
><em class="sig-param"
|
||
><span class="n"><span class="pre">identity</span></span></em
|
||
>,
|
||
<em class="sig-param"
|
||
><span class="n"><span class="pre">app_name</span></span></em
|
||
>,
|
||
<em class="sig-param"
|
||
><span class="o"><span class="pre">*</span></span
|
||
><span class="n"><span class="pre">aspects</span></span></em
|
||
><span class="sig-paren">)</span
|
||
><a
|
||
class="headerlink"
|
||
href="#RNS.Destination.hash"
|
||
title="Link to this definition"
|
||
>¶</a
|
||
>
|
||
</dt>
|
||
<dd>
|
||
<dl class="field-list simple">
|
||
<dt class="field-odd">Returns<span class="colon">:</span></dt>
|
||
<dd class="field-odd">
|
||
<p>
|
||
A destination name in adressable hash form, for an app_name and a
|
||
number of aspects.
|
||
</p>
|
||
</dd>
|
||
</dl>
|
||
</dd>
|
||
</dl>
|
||
|
||
<dl class="py method">
|
||
<dt class="sig sig-object py" id="RNS.Destination.announce">
|
||
<span class="sig-name descname"><span class="pre">announce</span></span
|
||
><span class="sig-paren">(</span
|
||
><em class="sig-param"
|
||
><span class="n"><span class="pre">app_data</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">path_response</span></span
|
||
><span class="o"><span class="pre">=</span></span
|
||
><span class="default_value"><span class="pre">False</span></span></em
|
||
>,
|
||
<em class="sig-param"
|
||
><span class="n"><span class="pre">attached_interface</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">tag</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">send</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.Destination.announce"
|
||
title="Link to this definition"
|
||
>¶</a
|
||
>
|
||
</dt>
|
||
<dd>
|
||
<p>
|
||
Creates an announce packet for this destination and broadcasts it on all
|
||
relevant interfaces. Application specific data can be added to the
|
||
announce.
|
||
</p>
|
||
<dl class="field-list simple">
|
||
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
|
||
<dd class="field-odd">
|
||
<ul class="simple">
|
||
<li>
|
||
<p>
|
||
<strong>app_data</strong> – <em>bytes</em> containing the
|
||
app_data.
|
||
</p>
|
||
</li>
|
||
<li>
|
||
<p>
|
||
<strong>path_response</strong> – Internal flag used by
|
||
<a class="reference internal" href="#api-transport"
|
||
><span class="std std-ref">RNS.Transport</span></a
|
||
>. Ignore.
|
||
</p>
|
||
</li>
|
||
</ul>
|
||
</dd>
|
||
</dl>
|
||
</dd>
|
||
</dl>
|
||
|
||
<dl class="py method">
|
||
<dt class="sig sig-object py" id="RNS.Destination.accepts_links">
|
||
<span class="sig-name descname"><span class="pre">accepts_links</span></span
|
||
><span class="sig-paren">(</span
|
||
><em class="sig-param"
|
||
><span class="n"><span class="pre">accepts</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.Destination.accepts_links"
|
||
title="Link to this definition"
|
||
>¶</a
|
||
>
|
||
</dt>
|
||
<dd>
|
||
<p>Set or query whether the destination accepts incoming link requests.</p>
|
||
<dl class="field-list simple">
|
||
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
|
||
<dd class="field-odd">
|
||
<p>
|
||
<strong>accepts</strong> – If
|
||
<code class="docutils literal notranslate"
|
||
><span class="pre">True</span></code
|
||
>
|
||
or
|
||
<code class="docutils literal notranslate"
|
||
><span class="pre">False</span></code
|
||
>, this method sets whether the destination accepts incoming link
|
||
requests. If not provided or
|
||
<code class="docutils literal notranslate"
|
||
><span class="pre">None</span></code
|
||
>, the method returns whether the destination currently accepts link
|
||
requests.
|
||
</p>
|
||
</dd>
|
||
<dt class="field-even">Returns<span class="colon">:</span></dt>
|
||
<dd class="field-even">
|
||
<p>
|
||
<code class="docutils literal notranslate"
|
||
><span class="pre">True</span></code
|
||
>
|
||
or
|
||
<code class="docutils literal notranslate"
|
||
><span class="pre">False</span></code
|
||
>
|
||
depending on whether the destination accepts incoming link requests,
|
||
if the <em>accepts</em> parameter is not provided or
|
||
<code class="docutils literal notranslate"
|
||
><span class="pre">None</span></code
|
||
>.
|
||
</p>
|
||
</dd>
|
||
</dl>
|
||
</dd>
|
||
</dl>
|
||
|
||
<dl class="py method">
|
||
<dt
|
||
class="sig sig-object py"
|
||
id="RNS.Destination.set_link_established_callback"
|
||
>
|
||
<span class="sig-name descname"
|
||
><span class="pre">set_link_established_callback</span></span
|
||
><span class="sig-paren">(</span
|
||
><em class="sig-param"
|
||
><span class="n"><span class="pre">callback</span></span></em
|
||
><span class="sig-paren">)</span
|
||
><a
|
||
class="headerlink"
|
||
href="#RNS.Destination.set_link_established_callback"
|
||
title="Link to this definition"
|
||
>¶</a
|
||
>
|
||
</dt>
|
||
<dd>
|
||
<p>
|
||
Registers a function to be called when a link has been established to this
|
||
destination.
|
||
</p>
|
||
<dl class="field-list simple">
|
||
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
|
||
<dd class="field-odd">
|
||
<p>
|
||
<strong>callback</strong> – A function or method with the signature
|
||
<em>callback(link)</em> to be called when a new link is established
|
||
with this destination.
|
||
</p>
|
||
</dd>
|
||
</dl>
|
||
</dd>
|
||
</dl>
|
||
|
||
<dl class="py method">
|
||
<dt class="sig sig-object py" id="RNS.Destination.set_packet_callback">
|
||
<span class="sig-name descname"
|
||
><span class="pre">set_packet_callback</span></span
|
||
><span class="sig-paren">(</span
|
||
><em class="sig-param"
|
||
><span class="n"><span class="pre">callback</span></span></em
|
||
><span class="sig-paren">)</span
|
||
><a
|
||
class="headerlink"
|
||
href="#RNS.Destination.set_packet_callback"
|
||
title="Link to this definition"
|
||
>¶</a
|
||
>
|
||
</dt>
|
||
<dd>
|
||
<p>
|
||
Registers a function to be called when a packet has been received by this
|
||
destination.
|
||
</p>
|
||
<dl class="field-list simple">
|
||
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
|
||
<dd class="field-odd">
|
||
<p>
|
||
<strong>callback</strong> – A function or method with the signature
|
||
<em>callback(data, packet)</em> to be called when this destination
|
||
receives a packet.
|
||
</p>
|
||
</dd>
|
||
</dl>
|
||
</dd>
|
||
</dl>
|
||
|
||
<dl class="py method">
|
||
<dt
|
||
class="sig sig-object py"
|
||
id="RNS.Destination.set_proof_requested_callback"
|
||
>
|
||
<span class="sig-name descname"
|
||
><span class="pre">set_proof_requested_callback</span></span
|
||
><span class="sig-paren">(</span
|
||
><em class="sig-param"
|
||
><span class="n"><span class="pre">callback</span></span></em
|
||
><span class="sig-paren">)</span
|
||
><a
|
||
class="headerlink"
|
||
href="#RNS.Destination.set_proof_requested_callback"
|
||
title="Link to this definition"
|
||
>¶</a
|
||
>
|
||
</dt>
|
||
<dd>
|
||
<p>
|
||
Registers a function to be called when a proof has been requested for a
|
||
packet sent to this destination. Allows control over when and if proofs
|
||
should be returned for received packets.
|
||
</p>
|
||
<dl class="field-list simple">
|
||
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
|
||
<dd class="field-odd">
|
||
<p>
|
||
<strong>callback</strong> – A function or method to with the signature
|
||
<em>callback(packet)</em> be called when a packet that requests a
|
||
proof is received. The callback must return one of True or False. If
|
||
the callback returns True, a proof will be sent. If it returns False,
|
||
a proof will not be sent.
|
||
</p>
|
||
</dd>
|
||
</dl>
|
||
</dd>
|
||
</dl>
|
||
|
||
<dl class="py method">
|
||
<dt class="sig sig-object py" id="RNS.Destination.set_proof_strategy">
|
||
<span class="sig-name descname"
|
||
><span class="pre">set_proof_strategy</span></span
|
||
><span class="sig-paren">(</span
|
||
><em class="sig-param"
|
||
><span class="n"><span class="pre">proof_strategy</span></span></em
|
||
><span class="sig-paren">)</span
|
||
><a
|
||
class="headerlink"
|
||
href="#RNS.Destination.set_proof_strategy"
|
||
title="Link to this definition"
|
||
>¶</a
|
||
>
|
||
</dt>
|
||
<dd>
|
||
<p>Sets the destinations proof strategy.</p>
|
||
<dl class="field-list simple">
|
||
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
|
||
<dd class="field-odd">
|
||
<p>
|
||
<strong>proof_strategy</strong> – One of
|
||
<code class="docutils literal notranslate"
|
||
><span class="pre">RNS.Destination.PROVE_NONE</span></code
|
||
>,
|
||
<code class="docutils literal notranslate"
|
||
><span class="pre">RNS.Destination.PROVE_ALL</span></code
|
||
>
|
||
or
|
||
<code class="docutils literal notranslate"
|
||
><span class="pre">RNS.Destination.PROVE_APP</span></code
|
||
>. If
|
||
<code class="docutils literal notranslate"
|
||
><span class="pre">RNS.Destination.PROVE_APP</span></code
|
||
>
|
||
is set, the <cite>proof_requested_callback</cite> will be called to
|
||
determine whether a proof should be sent or not.
|
||
</p>
|
||
</dd>
|
||
</dl>
|
||
</dd>
|
||
</dl>
|
||
|
||
<dl class="py method">
|
||
<dt class="sig sig-object py" id="RNS.Destination.register_request_handler">
|
||
<span class="sig-name descname"
|
||
><span class="pre">register_request_handler</span></span
|
||
><span class="sig-paren">(</span
|
||
><em class="sig-param"
|
||
><span class="n"><span class="pre">path</span></span></em
|
||
>,
|
||
<em class="sig-param"
|
||
><span class="n"><span class="pre">response_generator</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">allow</span></span
|
||
><span class="o"><span class="pre">=</span></span
|
||
><span class="default_value"
|
||
><span class="pre">ALLOW_NONE</span></span
|
||
></em
|
||
>,
|
||
<em class="sig-param"
|
||
><span class="n"><span class="pre">allowed_list</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">auto_compress</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.Destination.register_request_handler"
|
||
title="Link to this definition"
|
||
>¶</a
|
||
>
|
||
</dt>
|
||
<dd>
|
||
<p>Registers a request handler.</p>
|
||
<dl class="field-list simple">
|
||
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
|
||
<dd class="field-odd">
|
||
<ul class="simple">
|
||
<li>
|
||
<p>
|
||
<strong>path</strong> – The path for the request handler to be
|
||
registered.
|
||
</p>
|
||
</li>
|
||
<li>
|
||
<p>
|
||
<strong>response_generator</strong> – A function or method with
|
||
the signature
|
||
<em
|
||
>response_generator(path, data, request_id, link_id,
|
||
remote_identity, requested_at)</em
|
||
>
|
||
to be called. Whatever this funcion returns will be sent as a
|
||
response to the requester. If the function returns
|
||
<code class="docutils literal notranslate"
|
||
><span class="pre">None</span></code
|
||
>, no response will be sent.
|
||
</p>
|
||
</li>
|
||
<li>
|
||
<p>
|
||
<strong>allow</strong> – One of
|
||
<code class="docutils literal notranslate"
|
||
><span class="pre">RNS.Destination.ALLOW_NONE</span></code
|
||
>,
|
||
<code class="docutils literal notranslate"
|
||
><span class="pre">RNS.Destination.ALLOW_ALL</span></code
|
||
>
|
||
or
|
||
<code class="docutils literal notranslate"
|
||
><span class="pre">RNS.Destination.ALLOW_LIST</span></code
|
||
>. If
|
||
<code class="docutils literal notranslate"
|
||
><span class="pre">RNS.Destination.ALLOW_LIST</span></code
|
||
>
|
||
is set, the request handler will only respond to requests for
|
||
identified peers in the supplied list.
|
||
</p>
|
||
</li>
|
||
<li>
|
||
<p>
|
||
<strong>allowed_list</strong> – A list of <em>bytes-like</em>
|
||
<a class="reference internal" href="#api-identity"
|
||
><span class="std std-ref">RNS.Identity</span></a
|
||
>
|
||
hashes.
|
||
</p>
|
||
</li>
|
||
<li>
|
||
<p>
|
||
<strong>auto_compress</strong> – If
|
||
<code class="docutils literal notranslate"
|
||
><span class="pre">True</span></code
|
||
>
|
||
or
|
||
<code class="docutils literal notranslate"
|
||
><span class="pre">False</span></code
|
||
>, determines whether automatic compression of responses should be
|
||
carried out. If set to an integer value, responses will only be
|
||
auto-compressed if under this size in bytes. If omitted, the
|
||
default compression settings will be followed.
|
||
</p>
|
||
</li>
|
||
</ul>
|
||
</dd>
|
||
<dt class="field-even">Raises<span class="colon">:</span></dt>
|
||
<dd class="field-even">
|
||
<p>
|
||
<code class="docutils literal notranslate"
|
||
><span class="pre">ValueError</span></code
|
||
>
|
||
if any of the supplied arguments are invalid.
|
||
</p>
|
||
</dd>
|
||
</dl>
|
||
</dd>
|
||
</dl>
|
||
|
||
<dl class="py method">
|
||
<dt class="sig sig-object py" id="RNS.Destination.deregister_request_handler">
|
||
<span class="sig-name descname"
|
||
><span class="pre">deregister_request_handler</span></span
|
||
><span class="sig-paren">(</span
|
||
><em class="sig-param"
|
||
><span class="n"><span class="pre">path</span></span></em
|
||
><span class="sig-paren">)</span
|
||
><a
|
||
class="headerlink"
|
||
href="#RNS.Destination.deregister_request_handler"
|
||
title="Link to this definition"
|
||
>¶</a
|
||
>
|
||
</dt>
|
||
<dd>
|
||
<p>Deregisters a request handler.</p>
|
||
<dl class="field-list simple">
|
||
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
|
||
<dd class="field-odd">
|
||
<p>
|
||
<strong>path</strong> – The path for the request handler to be
|
||
deregistered.
|
||
</p>
|
||
</dd>
|
||
<dt class="field-even">Returns<span class="colon">:</span></dt>
|
||
<dd class="field-even">
|
||
<p>True if the handler was deregistered, otherwise False.</p>
|
||
</dd>
|
||
</dl>
|
||
</dd>
|
||
</dl>
|
||
|
||
<dl class="py method">
|
||
<dt class="sig sig-object py" id="RNS.Destination.enable_ratchets">
|
||
<span class="sig-name descname"
|
||
><span class="pre">enable_ratchets</span></span
|
||
><span class="sig-paren">(</span
|
||
><em class="sig-param"
|
||
><span class="n"><span class="pre">ratchets_path</span></span></em
|
||
><span class="sig-paren">)</span
|
||
><a
|
||
class="headerlink"
|
||
href="#RNS.Destination.enable_ratchets"
|
||
title="Link to this definition"
|
||
>¶</a
|
||
>
|
||
</dt>
|
||
<dd>
|
||
<p>
|
||
Enables ratchets on the destination. When ratchets are enabled, Reticulum
|
||
will automatically rotate the keys used to encrypt packets to this
|
||
destination, and include the latest ratchet key in announces.
|
||
</p>
|
||
<p>
|
||
Enabling ratchets on a destination will provide forward secrecy for
|
||
packets sent to that destination, even when sent outside a
|
||
<code class="docutils literal notranslate"
|
||
><span class="pre">Link</span></code
|
||
>. The normal Reticulum
|
||
<code class="docutils literal notranslate"
|
||
><span class="pre">Link</span></code
|
||
>
|
||
establishment procedure already performs its own ephemeral key exchange
|
||
for each link establishment, which means that ratchets are not necessary
|
||
to provide forward secrecy for links.
|
||
</p>
|
||
<p>
|
||
Enabling ratchets will have a small impact on announce size, adding 32
|
||
bytes to every sent announce.
|
||
</p>
|
||
<dl class="field-list simple">
|
||
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
|
||
<dd class="field-odd">
|
||
<p>
|
||
<strong>ratchets_path</strong> – The path to a file to store ratchet
|
||
data in.
|
||
</p>
|
||
</dd>
|
||
<dt class="field-even">Returns<span class="colon">:</span></dt>
|
||
<dd class="field-even">
|
||
<p>True if the operation succeeded, otherwise False.</p>
|
||
</dd>
|
||
</dl>
|
||
</dd>
|
||
</dl>
|
||
|
||
<dl class="py method">
|
||
<dt class="sig sig-object py" id="RNS.Destination.enforce_ratchets">
|
||
<span class="sig-name descname"
|
||
><span class="pre">enforce_ratchets</span></span
|
||
><span class="sig-paren">(</span><span class="sig-paren">)</span
|
||
><a
|
||
class="headerlink"
|
||
href="#RNS.Destination.enforce_ratchets"
|
||
title="Link to this definition"
|
||
>¶</a
|
||
>
|
||
</dt>
|
||
<dd>
|
||
<p>
|
||
When ratchet enforcement is enabled, this destination will never accept
|
||
packets that use its base Identity key for encryption, but only accept
|
||
packets encrypted with one of the retained ratchet keys.
|
||
</p>
|
||
</dd>
|
||
</dl>
|
||
|
||
<dl class="py method">
|
||
<dt class="sig sig-object py" id="RNS.Destination.set_retained_ratchets">
|
||
<span class="sig-name descname"
|
||
><span class="pre">set_retained_ratchets</span></span
|
||
><span class="sig-paren">(</span
|
||
><em class="sig-param"
|
||
><span class="n"><span class="pre">retained_ratchets</span></span></em
|
||
><span class="sig-paren">)</span
|
||
><a
|
||
class="headerlink"
|
||
href="#RNS.Destination.set_retained_ratchets"
|
||
title="Link to this definition"
|
||
>¶</a
|
||
>
|
||
</dt>
|
||
<dd>
|
||
<p>
|
||
Sets the number of previously generated ratchet keys this destination will
|
||
retain, and try to use when decrypting incoming packets. Defaults to
|
||
<code class="docutils literal notranslate"
|
||
><span class="pre">Destination.RATCHET_COUNT</span></code
|
||
>.
|
||
</p>
|
||
<dl class="field-list simple">
|
||
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
|
||
<dd class="field-odd">
|
||
<p>
|
||
<strong>retained_ratchets</strong> – The number of generated ratchets
|
||
to retain.
|
||
</p>
|
||
</dd>
|
||
<dt class="field-even">Returns<span class="colon">:</span></dt>
|
||
<dd class="field-even">
|
||
<p>True if the operation succeeded, False if not.</p>
|
||
</dd>
|
||
</dl>
|
||
</dd>
|
||
</dl>
|
||
|
||
<dl class="py method">
|
||
<dt class="sig sig-object py" id="RNS.Destination.set_ratchet_interval">
|
||
<span class="sig-name descname"
|
||
><span class="pre">set_ratchet_interval</span></span
|
||
><span class="sig-paren">(</span
|
||
><em class="sig-param"
|
||
><span class="n"><span class="pre">interval</span></span></em
|
||
><span class="sig-paren">)</span
|
||
><a
|
||
class="headerlink"
|
||
href="#RNS.Destination.set_ratchet_interval"
|
||
title="Link to this definition"
|
||
>¶</a
|
||
>
|
||
</dt>
|
||
<dd>
|
||
<p>
|
||
Sets the minimum interval in seconds between ratchet key rotation.
|
||
Defaults to
|
||
<code class="docutils literal notranslate"
|
||
><span class="pre">Destination.RATCHET_INTERVAL</span></code
|
||
>.
|
||
</p>
|
||
<dl class="field-list simple">
|
||
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
|
||
<dd class="field-odd">
|
||
<p><strong>interval</strong> – The minimum interval in seconds.</p>
|
||
</dd>
|
||
<dt class="field-even">Returns<span class="colon">:</span></dt>
|
||
<dd class="field-even">
|
||
<p>True if the operation succeeded, False if not.</p>
|
||
</dd>
|
||
</dl>
|
||
</dd>
|
||
</dl>
|
||
|
||
<dl class="py method">
|
||
<dt class="sig sig-object py" id="RNS.Destination.create_keys">
|
||
<span class="sig-name descname"><span class="pre">create_keys</span></span
|
||
><span class="sig-paren">(</span><span class="sig-paren">)</span
|
||
><a
|
||
class="headerlink"
|
||
href="#RNS.Destination.create_keys"
|
||
title="Link to this definition"
|
||
>¶</a
|
||
>
|
||
</dt>
|
||
<dd>
|
||
<p>
|
||
For a
|
||
<code class="docutils literal notranslate"
|
||
><span class="pre">RNS.Destination.GROUP</span></code
|
||
>
|
||
type destination, creates a new symmetric key.
|
||
</p>
|
||
<dl class="field-list simple">
|
||
<dt class="field-odd">Raises<span class="colon">:</span></dt>
|
||
<dd class="field-odd">
|
||
<p>
|
||
<code class="docutils literal notranslate"
|
||
><span class="pre">TypeError</span></code
|
||
>
|
||
if called on an incompatible type of destination.
|
||
</p>
|
||
</dd>
|
||
</dl>
|
||
</dd>
|
||
</dl>
|
||
|
||
<dl class="py method">
|
||
<dt class="sig sig-object py" id="RNS.Destination.get_private_key">
|
||
<span class="sig-name descname"
|
||
><span class="pre">get_private_key</span></span
|
||
><span class="sig-paren">(</span><span class="sig-paren">)</span
|
||
><a
|
||
class="headerlink"
|
||
href="#RNS.Destination.get_private_key"
|
||
title="Link to this definition"
|
||
>¶</a
|
||
>
|
||
</dt>
|
||
<dd>
|
||
<p>
|
||
For a
|
||
<code class="docutils literal notranslate"
|
||
><span class="pre">RNS.Destination.GROUP</span></code
|
||
>
|
||
type destination, returns the symmetric private key.
|
||
</p>
|
||
<dl class="field-list simple">
|
||
<dt class="field-odd">Raises<span class="colon">:</span></dt>
|
||
<dd class="field-odd">
|
||
<p>
|
||
<code class="docutils literal notranslate"
|
||
><span class="pre">TypeError</span></code
|
||
>
|
||
if called on an incompatible type of destination.
|
||
</p>
|
||
</dd>
|
||
</dl>
|
||
</dd>
|
||
</dl>
|
||
|
||
<dl class="py method">
|
||
<dt class="sig sig-object py" id="RNS.Destination.load_private_key">
|
||
<span class="sig-name descname"
|
||
><span class="pre">load_private_key</span></span
|
||
><span class="sig-paren">(</span
|
||
><em class="sig-param"
|
||
><span class="n"><span class="pre">key</span></span></em
|
||
><span class="sig-paren">)</span
|
||
><a
|
||
class="headerlink"
|
||
href="#RNS.Destination.load_private_key"
|
||
title="Link to this definition"
|
||
>¶</a
|
||
>
|
||
</dt>
|
||
<dd>
|
||
<p>
|
||
For a
|
||
<code class="docutils literal notranslate"
|
||
><span class="pre">RNS.Destination.GROUP</span></code
|
||
>
|
||
type destination, loads a symmetric private key.
|
||
</p>
|
||
<dl class="field-list simple">
|
||
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
|
||
<dd class="field-odd">
|
||
<p>
|
||
<strong>key</strong> – A <em>bytes-like</em> containing the symmetric
|
||
key.
|
||
</p>
|
||
</dd>
|
||
<dt class="field-even">Raises<span class="colon">:</span></dt>
|
||
<dd class="field-even">
|
||
<p>
|
||
<code class="docutils literal notranslate"
|
||
><span class="pre">TypeError</span></code
|
||
>
|
||
if called on an incompatible type of destination.
|
||
</p>
|
||
</dd>
|
||
</dl>
|
||
</dd>
|
||
</dl>
|
||
|
||
<dl class="py method">
|
||
<dt class="sig sig-object py" id="RNS.Destination.encrypt">
|
||
<span class="sig-name descname"><span class="pre">encrypt</span></span
|
||
><span class="sig-paren">(</span
|
||
><em class="sig-param"
|
||
><span class="n"><span class="pre">plaintext</span></span></em
|
||
><span class="sig-paren">)</span
|
||
><a
|
||
class="headerlink"
|
||
href="#RNS.Destination.encrypt"
|
||
title="Link to this definition"
|
||
>¶</a
|
||
>
|
||
</dt>
|
||
<dd>
|
||
<p>
|
||
Encrypts information for
|
||
<code class="docutils literal notranslate"
|
||
><span class="pre">RNS.Destination.SINGLE</span></code
|
||
>
|
||
or
|
||
<code class="docutils literal notranslate"
|
||
><span class="pre">RNS.Destination.GROUP</span></code
|
||
>
|
||
type destination.
|
||
</p>
|
||
<dl class="field-list simple">
|
||
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
|
||
<dd class="field-odd">
|
||
<p>
|
||
<strong>plaintext</strong> – A <em>bytes-like</em> containing the
|
||
plaintext to be encrypted.
|
||
</p>
|
||
</dd>
|
||
<dt class="field-even">Raises<span class="colon">:</span></dt>
|
||
<dd class="field-even">
|
||
<p>
|
||
<code class="docutils literal notranslate"
|
||
><span class="pre">ValueError</span></code
|
||
>
|
||
if destination does not hold a necessary key for encryption.
|
||
</p>
|
||
</dd>
|
||
</dl>
|
||
</dd>
|
||
</dl>
|
||
|
||
<dl class="py method">
|
||
<dt class="sig sig-object py" id="RNS.Destination.decrypt">
|
||
<span class="sig-name descname"><span class="pre">decrypt</span></span
|
||
><span class="sig-paren">(</span
|
||
><em class="sig-param"
|
||
><span class="n"><span class="pre">ciphertext</span></span></em
|
||
><span class="sig-paren">)</span
|
||
><a
|
||
class="headerlink"
|
||
href="#RNS.Destination.decrypt"
|
||
title="Link to this definition"
|
||
>¶</a
|
||
>
|
||
</dt>
|
||
<dd>
|
||
<p>
|
||
Decrypts information for
|
||
<code class="docutils literal notranslate"
|
||
><span class="pre">RNS.Destination.SINGLE</span></code
|
||
>
|
||
or
|
||
<code class="docutils literal notranslate"
|
||
><span class="pre">RNS.Destination.GROUP</span></code
|
||
>
|
||
type destination.
|
||
</p>
|
||
<dl class="field-list simple">
|
||
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
|
||
<dd class="field-odd">
|
||
<p>
|
||
<strong>ciphertext</strong> – <em>Bytes</em> containing the ciphertext
|
||
to be decrypted.
|
||
</p>
|
||
</dd>
|
||
<dt class="field-even">Raises<span class="colon">:</span></dt>
|
||
<dd class="field-even">
|
||
<p>
|
||
<code class="docutils literal notranslate"
|
||
><span class="pre">ValueError</span></code
|
||
>
|
||
if destination does not hold a necessary key for decryption.
|
||
</p>
|
||
</dd>
|
||
</dl>
|
||
</dd>
|
||
</dl>
|
||
|
||
<dl class="py method">
|
||
<dt class="sig sig-object py" id="RNS.Destination.sign">
|
||
<span class="sig-name descname"><span class="pre">sign</span></span
|
||
><span class="sig-paren">(</span
|
||
><em class="sig-param"
|
||
><span class="n"><span class="pre">message</span></span></em
|
||
><span class="sig-paren">)</span
|
||
><a
|
||
class="headerlink"
|
||
href="#RNS.Destination.sign"
|
||
title="Link to this definition"
|
||
>¶</a
|
||
>
|
||
</dt>
|
||
<dd>
|
||
<p>
|
||
Signs information for
|
||
<code class="docutils literal notranslate"
|
||
><span class="pre">RNS.Destination.SINGLE</span></code
|
||
>
|
||
type destination.
|
||
</p>
|
||
<dl class="field-list simple">
|
||
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
|
||
<dd class="field-odd">
|
||
<p>
|
||
<strong>message</strong> – <em>Bytes</em> containing the message to be
|
||
signed.
|
||
</p>
|
||
</dd>
|
||
<dt class="field-even">Returns<span class="colon">:</span></dt>
|
||
<dd class="field-even">
|
||
<p>
|
||
A <em>bytes-like</em> containing the message signature, or
|
||
<em>None</em> if the destination could not sign the message.
|
||
</p>
|
||
</dd>
|
||
</dl>
|
||
</dd>
|
||
</dl>
|
||
|
||
<dl class="py method">
|
||
<dt class="sig sig-object py" id="RNS.Destination.set_default_app_data">
|
||
<span class="sig-name descname"
|
||
><span class="pre">set_default_app_data</span></span
|
||
><span class="sig-paren">(</span
|
||
><em class="sig-param"
|
||
><span class="n"><span class="pre">app_data</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.Destination.set_default_app_data"
|
||
title="Link to this definition"
|
||
>¶</a
|
||
>
|
||
</dt>
|
||
<dd>
|
||
<p>
|
||
Sets the default app_data for the destination. If set, the default
|
||
app_data will be included in every announce sent by the destination,
|
||
unless other app_data is specified in the <em>announce</em> method.
|
||
</p>
|
||
<dl class="field-list simple">
|
||
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
|
||
<dd class="field-odd">
|
||
<p>
|
||
<strong>app_data</strong> – A <em>bytes-like</em> containing the
|
||
default app_data, or a <em>callable</em> returning a
|
||
<em>bytes-like</em> containing the app_data.
|
||
</p>
|
||
</dd>
|
||
</dl>
|
||
</dd>
|
||
</dl>
|
||
|
||
<dl class="py method">
|
||
<dt class="sig sig-object py" id="RNS.Destination.clear_default_app_data">
|
||
<span class="sig-name descname"
|
||
><span class="pre">clear_default_app_data</span></span
|
||
><span class="sig-paren">(</span><span class="sig-paren">)</span
|
||
><a
|
||
class="headerlink"
|
||
href="#RNS.Destination.clear_default_app_data"
|
||
title="Link to this definition"
|
||
>¶</a
|
||
>
|
||
</dt>
|
||
<dd><p>Clears default app_data previously set for the destination.</p></dd>
|
||
</dl>
|
||
</dd>
|
||
</dl>
|
||
|
||
<p id="api-packet"></p>
|
||
<h3>Packet</h3>
|
||
<p></p>
|
||
<dl class="py class">
|
||
<dt class="sig sig-object py" id="RNS.Packet">
|
||
<em class="property"
|
||
><span class="k"><span class="pre">class</span></span
|
||
><span class="w"> </span></em
|
||
><span class="sig-prename descclassname"><span class="pre">RNS.</span></span
|
||
><span class="sig-name descname"><span class="pre">Packet</span></span
|
||
><span class="sig-paren">(</span
|
||
><em class="sig-param"
|
||
><span class="n"><span class="pre">destination</span></span></em
|
||
>,
|
||
<em class="sig-param"
|
||
><span class="n"><span class="pre">data</span></span></em
|
||
>,
|
||
<em class="sig-param"
|
||
><span class="n"><span class="pre">create_receipt</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.Packet" title="Link to this definition">¶</a>
|
||
</dt>
|
||
<dd>
|
||
<p>
|
||
The Packet class is used to create packet instances that can be sent over a
|
||
Reticulum network. Packets will automatically be encrypted if they are
|
||
addressed to a
|
||
<code class="docutils literal notranslate"
|
||
><span class="pre">RNS.Destination.SINGLE</span></code
|
||
>
|
||
destination,
|
||
<code class="docutils literal notranslate"
|
||
><span class="pre">RNS.Destination.GROUP</span></code
|
||
>
|
||
destination or a
|
||
<a class="reference internal" href="#api-link"
|
||
><span class="std std-ref">RNS.Link</span></a
|
||
>.
|
||
</p>
|
||
<p>
|
||
For
|
||
<code class="docutils literal notranslate"
|
||
><span class="pre">RNS.Destination.GROUP</span></code
|
||
>
|
||
destinations, Reticulum will use the pre-shared key configured for the
|
||
destination. All packets to group destinations are encrypted with the same
|
||
AES-256 key.
|
||
</p>
|
||
<p>
|
||
For
|
||
<code class="docutils literal notranslate"
|
||
><span class="pre">RNS.Destination.SINGLE</span></code
|
||
>
|
||
destinations, Reticulum will use a newly derived ephemeral AES-256 key for
|
||
every packet.
|
||
</p>
|
||
<p>
|
||
For
|
||
<a class="reference internal" href="#api-link"
|
||
><span class="std std-ref">RNS.Link</span></a
|
||
>
|
||
destinations, Reticulum will use per-link ephemeral keys, and offers
|
||
<strong>Forward Secrecy</strong>.
|
||
</p>
|
||
<dl class="field-list simple">
|
||
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
|
||
<dd class="field-odd">
|
||
<ul class="simple">
|
||
<li>
|
||
<p>
|
||
<strong>destination</strong> – A
|
||
<a class="reference internal" href="#api-destination"
|
||
><span class="std std-ref">RNS.Destination</span></a
|
||
>
|
||
instance to which the packet will be sent.
|
||
</p>
|
||
</li>
|
||
<li>
|
||
<p>
|
||
<strong>data</strong> – The data payload to be included in the packet
|
||
as <em>bytes</em>.
|
||
</p>
|
||
</li>
|
||
<li>
|
||
<p>
|
||
<strong>create_receipt</strong> – Specifies whether a
|
||
<a class="reference internal" href="#api-packetreceipt"
|
||
><span class="std std-ref">RNS.PacketReceipt</span></a
|
||
>
|
||
should be created when instantiating the packet.
|
||
</p>
|
||
</li>
|
||
</ul>
|
||
</dd>
|
||
</dl>
|
||
<dl class="py attribute">
|
||
<dt class="sig sig-object py" id="RNS.Packet.ENCRYPTED_MDU">
|
||
<span class="sig-name descname"><span class="pre">ENCRYPTED_MDU</span></span
|
||
><em class="property"
|
||
><span class="w"> </span><span class="p"><span class="pre">=</span></span
|
||
><span class="w"> </span><span class="pre">383</span></em
|
||
><a
|
||
class="headerlink"
|
||
href="#RNS.Packet.ENCRYPTED_MDU"
|
||
title="Link to this definition"
|
||
>¶</a
|
||
>
|
||
</dt>
|
||
<dd>
|
||
<p>The maximum size of the payload data in a single encrypted packet</p>
|
||
</dd>
|
||
</dl>
|
||
|
||
<dl class="py attribute">
|
||
<dt class="sig sig-object py" id="RNS.Packet.PLAIN_MDU">
|
||
<span class="sig-name descname"><span class="pre">PLAIN_MDU</span></span
|
||
><em class="property"
|
||
><span class="w"> </span><span class="p"><span class="pre">=</span></span
|
||
><span class="w"> </span><span class="pre">464</span></em
|
||
><a
|
||
class="headerlink"
|
||
href="#RNS.Packet.PLAIN_MDU"
|
||
title="Link to this definition"
|
||
>¶</a
|
||
>
|
||
</dt>
|
||
<dd>
|
||
<p>The maximum size of the payload data in a single unencrypted packet</p>
|
||
</dd>
|
||
</dl>
|
||
|
||
<dl class="py method">
|
||
<dt class="sig sig-object py" id="RNS.Packet.send">
|
||
<span class="sig-name descname"><span class="pre">send</span></span
|
||
><span class="sig-paren">(</span><span class="sig-paren">)</span
|
||
><a
|
||
class="headerlink"
|
||
href="#RNS.Packet.send"
|
||
title="Link to this definition"
|
||
>¶</a
|
||
>
|
||
</dt>
|
||
<dd>
|
||
<p>Sends the packet.</p>
|
||
<dl class="field-list simple">
|
||
<dt class="field-odd">Returns<span class="colon">:</span></dt>
|
||
<dd class="field-odd">
|
||
<p>
|
||
A
|
||
<a class="reference internal" href="#api-packetreceipt"
|
||
><span class="std std-ref">RNS.PacketReceipt</span></a
|
||
>
|
||
instance if <em>create_receipt</em> was set to <em>True</em> when the
|
||
packet was instantiated, if not returns <em>None</em>. If the packet
|
||
could not be sent <em>False</em> is returned.
|
||
</p>
|
||
</dd>
|
||
</dl>
|
||
</dd>
|
||
</dl>
|
||
|
||
<dl class="py method">
|
||
<dt class="sig sig-object py" id="RNS.Packet.resend">
|
||
<span class="sig-name descname"><span class="pre">resend</span></span
|
||
><span class="sig-paren">(</span><span class="sig-paren">)</span
|
||
><a
|
||
class="headerlink"
|
||
href="#RNS.Packet.resend"
|
||
title="Link to this definition"
|
||
>¶</a
|
||
>
|
||
</dt>
|
||
<dd>
|
||
<p>Re-sends the packet.</p>
|
||
<dl class="field-list simple">
|
||
<dt class="field-odd">Returns<span class="colon">:</span></dt>
|
||
<dd class="field-odd">
|
||
<p>
|
||
A
|
||
<a class="reference internal" href="#api-packetreceipt"
|
||
><span class="std std-ref">RNS.PacketReceipt</span></a
|
||
>
|
||
instance if <em>create_receipt</em> was set to <em>True</em> when the
|
||
packet was instantiated, if not returns <em>None</em>. If the packet
|
||
could not be sent <em>False</em> is returned.
|
||
</p>
|
||
</dd>
|
||
</dl>
|
||
</dd>
|
||
</dl>
|
||
|
||
<dl class="py method">
|
||
<dt class="sig sig-object py" id="RNS.Packet.get_rssi">
|
||
<span class="sig-name descname"><span class="pre">get_rssi</span></span
|
||
><span class="sig-paren">(</span><span class="sig-paren">)</span
|
||
><a
|
||
class="headerlink"
|
||
href="#RNS.Packet.get_rssi"
|
||
title="Link to this definition"
|
||
>¶</a
|
||
>
|
||
</dt>
|
||
<dd>
|
||
<dl class="field-list simple">
|
||
<dt class="field-odd">Returns<span class="colon">:</span></dt>
|
||
<dd class="field-odd">
|
||
<p>
|
||
The physical layer <em>Received Signal Strength Indication</em> if
|
||
available, otherwise
|
||
<code class="docutils literal notranslate"
|
||
><span class="pre">None</span></code
|
||
>.
|
||
</p>
|
||
</dd>
|
||
</dl>
|
||
</dd>
|
||
</dl>
|
||
|
||
<dl class="py method">
|
||
<dt class="sig sig-object py" id="RNS.Packet.get_snr">
|
||
<span class="sig-name descname"><span class="pre">get_snr</span></span
|
||
><span class="sig-paren">(</span><span class="sig-paren">)</span
|
||
><a
|
||
class="headerlink"
|
||
href="#RNS.Packet.get_snr"
|
||
title="Link to this definition"
|
||
>¶</a
|
||
>
|
||
</dt>
|
||
<dd>
|
||
<dl class="field-list simple">
|
||
<dt class="field-odd">Returns<span class="colon">:</span></dt>
|
||
<dd class="field-odd">
|
||
<p>
|
||
The physical layer <em>Signal-to-Noise Ratio</em> if available,
|
||
otherwise
|
||
<code class="docutils literal notranslate"
|
||
><span class="pre">None</span></code
|
||
>.
|
||
</p>
|
||
</dd>
|
||
</dl>
|
||
</dd>
|
||
</dl>
|
||
|
||
<dl class="py method">
|
||
<dt class="sig sig-object py" id="RNS.Packet.get_q">
|
||
<span class="sig-name descname"><span class="pre">get_q</span></span
|
||
><span class="sig-paren">(</span><span class="sig-paren">)</span
|
||
><a
|
||
class="headerlink"
|
||
href="#RNS.Packet.get_q"
|
||
title="Link to this definition"
|
||
>¶</a
|
||
>
|
||
</dt>
|
||
<dd>
|
||
<dl class="field-list simple">
|
||
<dt class="field-odd">Returns<span class="colon">:</span></dt>
|
||
<dd class="field-odd">
|
||
<p>
|
||
The physical layer <em>Link Quality</em> if available, otherwise
|
||
<code class="docutils literal notranslate"
|
||
><span class="pre">None</span></code
|
||
>.
|
||
</p>
|
||
</dd>
|
||
</dl>
|
||
</dd>
|
||
</dl>
|
||
</dd>
|
||
</dl>
|
||
|
||
<p id="api-packetreceipt"></p>
|
||
<h3>Packet Receipt</h3>
|
||
<p></p>
|
||
<dl class="py class">
|
||
<dt class="sig sig-object py" id="RNS.PacketReceipt">
|
||
<em class="property"
|
||
><span class="k"><span class="pre">class</span></span
|
||
><span class="w"> </span></em
|
||
><span class="sig-prename descclassname"><span class="pre">RNS.</span></span
|
||
><span class="sig-name descname"><span class="pre">PacketReceipt</span></span
|
||
><a class="headerlink" href="#RNS.PacketReceipt" title="Link to this definition"
|
||
>¶</a
|
||
>
|
||
</dt>
|
||
<dd>
|
||
<p>
|
||
The PacketReceipt class is used to receive notifications about
|
||
<a class="reference internal" href="#api-packet"
|
||
><span class="std std-ref">RNS.Packet</span></a
|
||
>
|
||
instances sent over the network. Instances of this class are never created
|
||
manually, but always returned from the <em>send()</em> method of a
|
||
<a class="reference internal" href="#api-packet"
|
||
><span class="std std-ref">RNS.Packet</span></a
|
||
>
|
||
instance.
|
||
</p>
|
||
<dl class="py method">
|
||
<dt class="sig sig-object py" id="RNS.PacketReceipt.get_status">
|
||
<span class="sig-name descname"><span class="pre">get_status</span></span
|
||
><span class="sig-paren">(</span><span class="sig-paren">)</span
|
||
><a
|
||
class="headerlink"
|
||
href="#RNS.PacketReceipt.get_status"
|
||
title="Link to this definition"
|
||
>¶</a
|
||
>
|
||
</dt>
|
||
<dd>
|
||
<dl class="field-list simple">
|
||
<dt class="field-odd">Returns<span class="colon">:</span></dt>
|
||
<dd class="field-odd">
|
||
<p>
|
||
The status of the associated
|
||
<a class="reference internal" href="#api-packet"
|
||
><span class="std std-ref">RNS.Packet</span></a
|
||
>
|
||
instance. Can be one of
|
||
<code class="docutils literal notranslate"
|
||
><span class="pre">RNS.PacketReceipt.SENT</span></code
|
||
>,
|
||
<code class="docutils literal notranslate"
|
||
><span class="pre">RNS.PacketReceipt.DELIVERED</span></code
|
||
>,
|
||
<code class="docutils literal notranslate"
|
||
><span class="pre">RNS.PacketReceipt.FAILED</span></code
|
||
>
|
||
or
|
||
<code class="docutils literal notranslate"
|
||
><span class="pre">RNS.PacketReceipt.CULLED</span></code
|
||
>.
|
||
</p>
|
||
</dd>
|
||
</dl>
|
||
</dd>
|
||
</dl>
|
||
|
||
<dl class="py method">
|
||
<dt class="sig sig-object py" id="RNS.PacketReceipt.get_rtt">
|
||
<span class="sig-name descname"><span class="pre">get_rtt</span></span
|
||
><span class="sig-paren">(</span><span class="sig-paren">)</span
|
||
><a
|
||
class="headerlink"
|
||
href="#RNS.PacketReceipt.get_rtt"
|
||
title="Link to this definition"
|
||
>¶</a
|
||
>
|
||
</dt>
|
||
<dd>
|
||
<dl class="field-list simple">
|
||
<dt class="field-odd">Returns<span class="colon">:</span></dt>
|
||
<dd class="field-odd"><p>The round-trip-time in seconds</p></dd>
|
||
</dl>
|
||
</dd>
|
||
</dl>
|
||
|
||
<dl class="py method">
|
||
<dt class="sig sig-object py" id="RNS.PacketReceipt.set_timeout">
|
||
<span class="sig-name descname"><span class="pre">set_timeout</span></span
|
||
><span class="sig-paren">(</span
|
||
><em class="sig-param"
|
||
><span class="n"><span class="pre">timeout</span></span></em
|
||
><span class="sig-paren">)</span
|
||
><a
|
||
class="headerlink"
|
||
href="#RNS.PacketReceipt.set_timeout"
|
||
title="Link to this definition"
|
||
>¶</a
|
||
>
|
||
</dt>
|
||
<dd>
|
||
<p>Sets a timeout in seconds</p>
|
||
<dl class="field-list simple">
|
||
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
|
||
<dd class="field-odd">
|
||
<p><strong>timeout</strong> – The timeout in seconds.</p>
|
||
</dd>
|
||
</dl>
|
||
</dd>
|
||
</dl>
|
||
|
||
<dl class="py method">
|
||
<dt class="sig sig-object py" id="RNS.PacketReceipt.set_delivery_callback">
|
||
<span class="sig-name descname"
|
||
><span class="pre">set_delivery_callback</span></span
|
||
><span class="sig-paren">(</span
|
||
><em class="sig-param"
|
||
><span class="n"><span class="pre">callback</span></span></em
|
||
><span class="sig-paren">)</span
|
||
><a
|
||
class="headerlink"
|
||
href="#RNS.PacketReceipt.set_delivery_callback"
|
||
title="Link to this definition"
|
||
>¶</a
|
||
>
|
||
</dt>
|
||
<dd>
|
||
<p>
|
||
Sets a function that gets called if a successfull delivery has been
|
||
proven.
|
||
</p>
|
||
<dl class="field-list simple">
|
||
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
|
||
<dd class="field-odd">
|
||
<p>
|
||
<strong>callback</strong> – A <em>callable</em> with the signature
|
||
<em>callback(packet_receipt)</em>
|
||
</p>
|
||
</dd>
|
||
</dl>
|
||
</dd>
|
||
</dl>
|
||
|
||
<dl class="py method">
|
||
<dt class="sig sig-object py" id="RNS.PacketReceipt.set_timeout_callback">
|
||
<span class="sig-name descname"
|
||
><span class="pre">set_timeout_callback</span></span
|
||
><span class="sig-paren">(</span
|
||
><em class="sig-param"
|
||
><span class="n"><span class="pre">callback</span></span></em
|
||
><span class="sig-paren">)</span
|
||
><a
|
||
class="headerlink"
|
||
href="#RNS.PacketReceipt.set_timeout_callback"
|
||
title="Link to this definition"
|
||
>¶</a
|
||
>
|
||
</dt>
|
||
<dd>
|
||
<p>Sets a function that gets called if the delivery times out.</p>
|
||
<dl class="field-list simple">
|
||
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
|
||
<dd class="field-odd">
|
||
<p>
|
||
<strong>callback</strong> – A <em>callable</em> with the signature
|
||
<em>callback(packet_receipt)</em>
|
||
</p>
|
||
</dd>
|
||
</dl>
|
||
</dd>
|
||
</dl>
|
||
</dd>
|
||
</dl>
|
||
|
||
<p id="api-link"></p>
|
||
<h3>Link</h3>
|
||
<p></p>
|
||
<dl class="py class">
|
||
<dt class="sig sig-object py" id="RNS.Link">
|
||
<em class="property"
|
||
><span class="k"><span class="pre">class</span></span
|
||
><span class="w"> </span></em
|
||
><span class="sig-prename descclassname"><span class="pre">RNS.</span></span
|
||
><span class="sig-name descname"><span class="pre">Link</span></span
|
||
><span class="sig-paren">(</span
|
||
><em class="sig-param"
|
||
><span class="n"><span class="pre">destination</span></span></em
|
||
>,
|
||
<em class="sig-param"
|
||
><span class="n"><span class="pre">established_callback</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">closed_callback</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.Link" title="Link to this definition">¶</a>
|
||
</dt>
|
||
<dd>
|
||
<p>
|
||
This class is used to establish and manage links to other peers. When a link
|
||
instance is created, Reticulum will attempt to establish verified and
|
||
encrypted connectivity with the specified destination.
|
||
</p>
|
||
<dl class="field-list simple">
|
||
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
|
||
<dd class="field-odd">
|
||
<ul class="simple">
|
||
<li>
|
||
<p>
|
||
<strong>destination</strong> – A
|
||
<a class="reference internal" href="#api-destination"
|
||
><span class="std std-ref">RNS.Destination</span></a
|
||
>
|
||
instance which to establish a link to.
|
||
</p>
|
||
</li>
|
||
<li>
|
||
<p>
|
||
<strong>established_callback</strong> – An optional function or method
|
||
with the signature <em>callback(link)</em> to be called when the link
|
||
has been established.
|
||
</p>
|
||
</li>
|
||
<li>
|
||
<p>
|
||
<strong>closed_callback</strong> – An optional function or method with
|
||
the signature <em>callback(link)</em> to be called when the link is
|
||
closed.
|
||
</p>
|
||
</li>
|
||
</ul>
|
||
</dd>
|
||
</dl>
|
||
<dl class="py attribute">
|
||
<dt class="sig sig-object py" id="RNS.Link.CURVE">
|
||
<span class="sig-name descname"><span class="pre">CURVE</span></span
|
||
><em class="property"
|
||
><span class="w"> </span><span class="p"><span class="pre">=</span></span
|
||
><span class="w"> </span><span class="pre">'Curve25519'</span></em
|
||
><a
|
||
class="headerlink"
|
||
href="#RNS.Link.CURVE"
|
||
title="Link 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.Link.ESTABLISHMENT_TIMEOUT_PER_HOP">
|
||
<span class="sig-name descname"
|
||
><span class="pre">ESTABLISHMENT_TIMEOUT_PER_HOP</span></span
|
||
><em class="property"
|
||
><span class="w"> </span><span class="p"><span class="pre">=</span></span
|
||
><span class="w"> </span><span class="pre">6</span></em
|
||
><a
|
||
class="headerlink"
|
||
href="#RNS.Link.ESTABLISHMENT_TIMEOUT_PER_HOP"
|
||
title="Link to this definition"
|
||
>¶</a
|
||
>
|
||
</dt>
|
||
<dd>
|
||
<p>Timeout for link establishment in seconds per hop to destination.</p>
|
||
</dd>
|
||
</dl>
|
||
|
||
<dl class="py attribute">
|
||
<dt class="sig sig-object py" id="RNS.Link.KEEPALIVE_TIMEOUT_FACTOR">
|
||
<span class="sig-name descname"
|
||
><span class="pre">KEEPALIVE_TIMEOUT_FACTOR</span></span
|
||
><em class="property"
|
||
><span class="w"> </span><span class="p"><span class="pre">=</span></span
|
||
><span class="w"> </span><span class="pre">4</span></em
|
||
><a
|
||
class="headerlink"
|
||
href="#RNS.Link.KEEPALIVE_TIMEOUT_FACTOR"
|
||
title="Link to this definition"
|
||
>¶</a
|
||
>
|
||
</dt>
|
||
<dd><p>RTT timeout factor used in link timeout calculation.</p></dd>
|
||
</dl>
|
||
|
||
<dl class="py attribute">
|
||
<dt class="sig sig-object py" id="RNS.Link.STALE_GRACE">
|
||
<span class="sig-name descname"><span class="pre">STALE_GRACE</span></span
|
||
><em class="property"
|
||
><span class="w"> </span><span class="p"><span class="pre">=</span></span
|
||
><span class="w"> </span><span class="pre">5</span></em
|
||
><a
|
||
class="headerlink"
|
||
href="#RNS.Link.STALE_GRACE"
|
||
title="Link to this definition"
|
||
>¶</a
|
||
>
|
||
</dt>
|
||
<dd><p>Grace period in seconds used in link timeout calculation.</p></dd>
|
||
</dl>
|
||
|
||
<dl class="py attribute">
|
||
<dt class="sig sig-object py" id="RNS.Link.KEEPALIVE">
|
||
<span class="sig-name descname"><span class="pre">KEEPALIVE</span></span
|
||
><em class="property"
|
||
><span class="w"> </span><span class="p"><span class="pre">=</span></span
|
||
><span class="w"> </span><span class="pre">360</span></em
|
||
><a
|
||
class="headerlink"
|
||
href="#RNS.Link.KEEPALIVE"
|
||
title="Link to this definition"
|
||
>¶</a
|
||
>
|
||
</dt>
|
||
<dd>
|
||
<p>
|
||
Default interval for sending keep-alive packets on established links in
|
||
seconds.
|
||
</p>
|
||
</dd>
|
||
</dl>
|
||
|
||
<dl class="py attribute">
|
||
<dt class="sig sig-object py" id="RNS.Link.STALE_TIME">
|
||
<span class="sig-name descname"><span class="pre">STALE_TIME</span></span
|
||
><em class="property"
|
||
><span class="w"> </span><span class="p"><span class="pre">=</span></span
|
||
><span class="w"> </span><span class="pre">720</span></em
|
||
><a
|
||
class="headerlink"
|
||
href="#RNS.Link.STALE_TIME"
|
||
title="Link to this definition"
|
||
>¶</a
|
||
>
|
||
</dt>
|
||
<dd>
|
||
<p>
|
||
If no traffic or keep-alive packets are received within this period, the
|
||
link will be marked as stale, and a final keep-alive packet will be sent.
|
||
If after this no traffic or keep-alive packets are received within
|
||
<code class="docutils literal notranslate"
|
||
><span class="pre">RTT</span></code
|
||
>
|
||
*
|
||
<code class="docutils literal notranslate"
|
||
><span class="pre">KEEPALIVE_TIMEOUT_FACTOR</span></code
|
||
>
|
||
+
|
||
<code class="docutils literal notranslate"
|
||
><span class="pre">STALE_GRACE</span></code
|
||
>, the link is considered timed out, and will be torn down.
|
||
</p>
|
||
</dd>
|
||
</dl>
|
||
|
||
<dl class="py method">
|
||
<dt class="sig sig-object py" id="RNS.Link.identify">
|
||
<span class="sig-name descname"><span class="pre">identify</span></span
|
||
><span class="sig-paren">(</span
|
||
><em class="sig-param"
|
||
><span class="n"><span class="pre">identity</span></span></em
|
||
><span class="sig-paren">)</span
|
||
><a
|
||
class="headerlink"
|
||
href="#RNS.Link.identify"
|
||
title="Link to this definition"
|
||
>¶</a
|
||
>
|
||
</dt>
|
||
<dd>
|
||
<p>
|
||
Identifies the initiator of the link to the remote peer. This can only
|
||
happen once the link has been established, and is carried out over the
|
||
encrypted link. The identity is only revealed to the remote peer, and
|
||
initiator anonymity is thus preserved. This method can be used for
|
||
authentication.
|
||
</p>
|
||
<dl class="field-list simple">
|
||
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
|
||
<dd class="field-odd">
|
||
<p>
|
||
<strong>identity</strong> – An RNS.Identity instance to identify as.
|
||
</p>
|
||
</dd>
|
||
</dl>
|
||
</dd>
|
||
</dl>
|
||
|
||
<dl class="py method">
|
||
<dt class="sig sig-object py" id="RNS.Link.request">
|
||
<span class="sig-name descname"><span class="pre">request</span></span
|
||
><span class="sig-paren">(</span
|
||
><em class="sig-param"
|
||
><span class="n"><span class="pre">path</span></span></em
|
||
>,
|
||
<em class="sig-param"
|
||
><span class="n"><span class="pre">data</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">response_callback</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">failed_callback</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">progress_callback</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">timeout</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.Link.request"
|
||
title="Link to this definition"
|
||
>¶</a
|
||
>
|
||
</dt>
|
||
<dd>
|
||
<p>Sends a request to the remote peer.</p>
|
||
<dl class="field-list simple">
|
||
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
|
||
<dd class="field-odd">
|
||
<ul class="simple">
|
||
<li>
|
||
<p><strong>path</strong> – The request path.</p>
|
||
</li>
|
||
<li>
|
||
<p>
|
||
<strong>response_callback</strong> – An optional function or
|
||
method with the signature
|
||
<em>response_callback(request_receipt)</em> to be called when a
|
||
response is received. See the
|
||
<a class="reference internal" href="examples.html#example-request"
|
||
><span class="std std-ref">Request Example</span></a
|
||
>
|
||
for more info.
|
||
</p>
|
||
</li>
|
||
<li>
|
||
<p>
|
||
<strong>failed_callback</strong> – An optional function or method
|
||
with the signature <em>failed_callback(request_receipt)</em> to be
|
||
called when a request fails. See the
|
||
<a class="reference internal" href="examples.html#example-request"
|
||
><span class="std std-ref">Request Example</span></a
|
||
>
|
||
for more info.
|
||
</p>
|
||
</li>
|
||
<li>
|
||
<p>
|
||
<strong>progress_callback</strong> – An optional function or
|
||
method with the signature
|
||
<em>progress_callback(request_receipt)</em> to be called when
|
||
progress is made receiving the response. Progress can be accessed
|
||
as a float between 0.0 and 1.0 by the
|
||
<em>request_receipt.progress</em> property.
|
||
</p>
|
||
</li>
|
||
<li>
|
||
<p>
|
||
<strong>timeout</strong> – An optional timeout in seconds for the
|
||
request. If <em>None</em> is supplied it will be calculated based
|
||
on link RTT.
|
||
</p>
|
||
</li>
|
||
</ul>
|
||
</dd>
|
||
<dt class="field-even">Returns<span class="colon">:</span></dt>
|
||
<dd class="field-even">
|
||
<p>
|
||
A
|
||
<a class="reference internal" href="#api-requestreceipt"
|
||
><span class="std std-ref">RNS.RequestReceipt</span></a
|
||
>
|
||
instance if the request was sent, or <em>False</em> if it was not.
|
||
</p>
|
||
</dd>
|
||
</dl>
|
||
</dd>
|
||
</dl>
|
||
|
||
<dl class="py method">
|
||
<dt class="sig sig-object py" id="RNS.Link.track_phy_stats">
|
||
<span class="sig-name descname"
|
||
><span class="pre">track_phy_stats</span></span
|
||
><span class="sig-paren">(</span
|
||
><em class="sig-param"
|
||
><span class="n"><span class="pre">track</span></span></em
|
||
><span class="sig-paren">)</span
|
||
><a
|
||
class="headerlink"
|
||
href="#RNS.Link.track_phy_stats"
|
||
title="Link to this definition"
|
||
>¶</a
|
||
>
|
||
</dt>
|
||
<dd>
|
||
<p>
|
||
You can enable physical layer statistics on a per-link basis. If this is
|
||
enabled, and the link is running over an interface that supports reporting
|
||
physical layer statistics, you will be able to retrieve stats such as
|
||
<em>RSSI</em>, <em>SNR</em> and physical <em>Link Quality</em> for the
|
||
link.
|
||
</p>
|
||
<dl class="field-list simple">
|
||
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
|
||
<dd class="field-odd">
|
||
<p>
|
||
<strong>track</strong> – Whether or not to keep track of physical
|
||
layer statistics. Value must be
|
||
<code class="docutils literal notranslate"
|
||
><span class="pre">True</span></code
|
||
>
|
||
or
|
||
<code class="docutils literal notranslate"
|
||
><span class="pre">False</span></code
|
||
>.
|
||
</p>
|
||
</dd>
|
||
</dl>
|
||
</dd>
|
||
</dl>
|
||
|
||
<dl class="py method">
|
||
<dt class="sig sig-object py" id="RNS.Link.get_rssi">
|
||
<span class="sig-name descname"><span class="pre">get_rssi</span></span
|
||
><span class="sig-paren">(</span><span class="sig-paren">)</span
|
||
><a
|
||
class="headerlink"
|
||
href="#RNS.Link.get_rssi"
|
||
title="Link to this definition"
|
||
>¶</a
|
||
>
|
||
</dt>
|
||
<dd>
|
||
<dl class="field-list simple">
|
||
<dt class="field-odd">Returns<span class="colon">:</span></dt>
|
||
<dd class="field-odd">
|
||
<p>
|
||
The physical layer <em>Received Signal Strength Indication</em> if
|
||
available, otherwise
|
||
<code class="docutils literal notranslate"
|
||
><span class="pre">None</span></code
|
||
>. Physical layer statistics must be enabled on the link for this
|
||
method to return a value.
|
||
</p>
|
||
</dd>
|
||
</dl>
|
||
</dd>
|
||
</dl>
|
||
|
||
<dl class="py method">
|
||
<dt class="sig sig-object py" id="RNS.Link.get_snr">
|
||
<span class="sig-name descname"><span class="pre">get_snr</span></span
|
||
><span class="sig-paren">(</span><span class="sig-paren">)</span
|
||
><a
|
||
class="headerlink"
|
||
href="#RNS.Link.get_snr"
|
||
title="Link to this definition"
|
||
>¶</a
|
||
>
|
||
</dt>
|
||
<dd>
|
||
<dl class="field-list simple">
|
||
<dt class="field-odd">Returns<span class="colon">:</span></dt>
|
||
<dd class="field-odd">
|
||
<p>
|
||
The physical layer <em>Signal-to-Noise Ratio</em> if available,
|
||
otherwise
|
||
<code class="docutils literal notranslate"
|
||
><span class="pre">None</span></code
|
||
>. Physical layer statistics must be enabled on the link for this
|
||
method to return a value.
|
||
</p>
|
||
</dd>
|
||
</dl>
|
||
</dd>
|
||
</dl>
|
||
|
||
<dl class="py method">
|
||
<dt class="sig sig-object py" id="RNS.Link.get_q">
|
||
<span class="sig-name descname"><span class="pre">get_q</span></span
|
||
><span class="sig-paren">(</span><span class="sig-paren">)</span
|
||
><a
|
||
class="headerlink"
|
||
href="#RNS.Link.get_q"
|
||
title="Link to this definition"
|
||
>¶</a
|
||
>
|
||
</dt>
|
||
<dd>
|
||
<dl class="field-list simple">
|
||
<dt class="field-odd">Returns<span class="colon">:</span></dt>
|
||
<dd class="field-odd">
|
||
<p>
|
||
The physical layer <em>Link Quality</em> if available, otherwise
|
||
<code class="docutils literal notranslate"
|
||
><span class="pre">None</span></code
|
||
>. Physical layer statistics must be enabled on the link for this
|
||
method to return a value.
|
||
</p>
|
||
</dd>
|
||
</dl>
|
||
</dd>
|
||
</dl>
|
||
|
||
<dl class="py method">
|
||
<dt class="sig sig-object py" id="RNS.Link.get_establishment_rate">
|
||
<span class="sig-name descname"
|
||
><span class="pre">get_establishment_rate</span></span
|
||
><span class="sig-paren">(</span><span class="sig-paren">)</span
|
||
><a
|
||
class="headerlink"
|
||
href="#RNS.Link.get_establishment_rate"
|
||
title="Link to this definition"
|
||
>¶</a
|
||
>
|
||
</dt>
|
||
<dd>
|
||
<dl class="field-list simple">
|
||
<dt class="field-odd">Returns<span class="colon">:</span></dt>
|
||
<dd class="field-odd">
|
||
<p>
|
||
The data transfer rate at which the link establishment procedure
|
||
ocurred, in bits per second.
|
||
</p>
|
||
</dd>
|
||
</dl>
|
||
</dd>
|
||
</dl>
|
||
|
||
<dl class="py method">
|
||
<dt class="sig sig-object py" id="RNS.Link.get_mtu">
|
||
<span class="sig-name descname"><span class="pre">get_mtu</span></span
|
||
><span class="sig-paren">(</span><span class="sig-paren">)</span
|
||
><a
|
||
class="headerlink"
|
||
href="#RNS.Link.get_mtu"
|
||
title="Link to this definition"
|
||
>¶</a
|
||
>
|
||
</dt>
|
||
<dd>
|
||
<dl class="field-list simple">
|
||
<dt class="field-odd">Returns<span class="colon">:</span></dt>
|
||
<dd class="field-odd"><p>The MTU of an established link.</p></dd>
|
||
</dl>
|
||
</dd>
|
||
</dl>
|
||
|
||
<dl class="py method">
|
||
<dt class="sig sig-object py" id="RNS.Link.get_mdu">
|
||
<span class="sig-name descname"><span class="pre">get_mdu</span></span
|
||
><span class="sig-paren">(</span><span class="sig-paren">)</span
|
||
><a
|
||
class="headerlink"
|
||
href="#RNS.Link.get_mdu"
|
||
title="Link to this definition"
|
||
>¶</a
|
||
>
|
||
</dt>
|
||
<dd>
|
||
<dl class="field-list simple">
|
||
<dt class="field-odd">Returns<span class="colon">:</span></dt>
|
||
<dd class="field-odd"><p>The packet MDU of an established link.</p></dd>
|
||
</dl>
|
||
</dd>
|
||
</dl>
|
||
|
||
<dl class="py method">
|
||
<dt class="sig sig-object py" id="RNS.Link.get_expected_rate">
|
||
<span class="sig-name descname"
|
||
><span class="pre">get_expected_rate</span></span
|
||
><span class="sig-paren">(</span><span class="sig-paren">)</span
|
||
><a
|
||
class="headerlink"
|
||
href="#RNS.Link.get_expected_rate"
|
||
title="Link to this definition"
|
||
>¶</a
|
||
>
|
||
</dt>
|
||
<dd>
|
||
<dl class="field-list simple">
|
||
<dt class="field-odd">Returns<span class="colon">:</span></dt>
|
||
<dd class="field-odd">
|
||
<p>The packet expected in-flight data rate of an established link.</p>
|
||
</dd>
|
||
</dl>
|
||
</dd>
|
||
</dl>
|
||
|
||
<dl class="py method">
|
||
<dt class="sig sig-object py" id="RNS.Link.get_mode">
|
||
<span class="sig-name descname"><span class="pre">get_mode</span></span
|
||
><span class="sig-paren">(</span><span class="sig-paren">)</span
|
||
><a
|
||
class="headerlink"
|
||
href="#RNS.Link.get_mode"
|
||
title="Link to this definition"
|
||
>¶</a
|
||
>
|
||
</dt>
|
||
<dd>
|
||
<dl class="field-list simple">
|
||
<dt class="field-odd">Returns<span class="colon">:</span></dt>
|
||
<dd class="field-odd"><p>The mode of an established link.</p></dd>
|
||
</dl>
|
||
</dd>
|
||
</dl>
|
||
|
||
<dl class="py method">
|
||
<dt class="sig sig-object py" id="RNS.Link.get_age">
|
||
<span class="sig-name descname"><span class="pre">get_age</span></span
|
||
><span class="sig-paren">(</span><span class="sig-paren">)</span
|
||
><a
|
||
class="headerlink"
|
||
href="#RNS.Link.get_age"
|
||
title="Link to this definition"
|
||
>¶</a
|
||
>
|
||
</dt>
|
||
<dd>
|
||
<dl class="field-list simple">
|
||
<dt class="field-odd">Returns<span class="colon">:</span></dt>
|
||
<dd class="field-odd">
|
||
<p>The time in seconds since this link was established.</p>
|
||
</dd>
|
||
</dl>
|
||
</dd>
|
||
</dl>
|
||
|
||
<dl class="py method">
|
||
<dt class="sig sig-object py" id="RNS.Link.no_inbound_for">
|
||
<span class="sig-name descname"
|
||
><span class="pre">no_inbound_for</span></span
|
||
><span class="sig-paren">(</span><span class="sig-paren">)</span
|
||
><a
|
||
class="headerlink"
|
||
href="#RNS.Link.no_inbound_for"
|
||
title="Link to this definition"
|
||
>¶</a
|
||
>
|
||
</dt>
|
||
<dd>
|
||
<dl class="field-list simple">
|
||
<dt class="field-odd">Returns<span class="colon">:</span></dt>
|
||
<dd class="field-odd">
|
||
<p>
|
||
The time in seconds since last inbound packet on the link. This
|
||
includes keepalive packets.
|
||
</p>
|
||
</dd>
|
||
</dl>
|
||
</dd>
|
||
</dl>
|
||
|
||
<dl class="py method">
|
||
<dt class="sig sig-object py" id="RNS.Link.no_outbound_for">
|
||
<span class="sig-name descname"
|
||
><span class="pre">no_outbound_for</span></span
|
||
><span class="sig-paren">(</span><span class="sig-paren">)</span
|
||
><a
|
||
class="headerlink"
|
||
href="#RNS.Link.no_outbound_for"
|
||
title="Link to this definition"
|
||
>¶</a
|
||
>
|
||
</dt>
|
||
<dd>
|
||
<dl class="field-list simple">
|
||
<dt class="field-odd">Returns<span class="colon">:</span></dt>
|
||
<dd class="field-odd">
|
||
<p>
|
||
The time in seconds since last outbound packet on the link. This
|
||
includes keepalive packets.
|
||
</p>
|
||
</dd>
|
||
</dl>
|
||
</dd>
|
||
</dl>
|
||
|
||
<dl class="py method">
|
||
<dt class="sig sig-object py" id="RNS.Link.no_data_for">
|
||
<span class="sig-name descname"><span class="pre">no_data_for</span></span
|
||
><span class="sig-paren">(</span><span class="sig-paren">)</span
|
||
><a
|
||
class="headerlink"
|
||
href="#RNS.Link.no_data_for"
|
||
title="Link to this definition"
|
||
>¶</a
|
||
>
|
||
</dt>
|
||
<dd>
|
||
<dl class="field-list simple">
|
||
<dt class="field-odd">Returns<span class="colon">:</span></dt>
|
||
<dd class="field-odd">
|
||
<p>
|
||
The time in seconds since payload data traversed the link. This
|
||
excludes keepalive packets.
|
||
</p>
|
||
</dd>
|
||
</dl>
|
||
</dd>
|
||
</dl>
|
||
|
||
<dl class="py method">
|
||
<dt class="sig sig-object py" id="RNS.Link.inactive_for">
|
||
<span class="sig-name descname"><span class="pre">inactive_for</span></span
|
||
><span class="sig-paren">(</span><span class="sig-paren">)</span
|
||
><a
|
||
class="headerlink"
|
||
href="#RNS.Link.inactive_for"
|
||
title="Link to this definition"
|
||
>¶</a
|
||
>
|
||
</dt>
|
||
<dd>
|
||
<dl class="field-list simple">
|
||
<dt class="field-odd">Returns<span class="colon">:</span></dt>
|
||
<dd class="field-odd">
|
||
<p>
|
||
The time in seconds since activity on the link. This includes
|
||
keepalive packets.
|
||
</p>
|
||
</dd>
|
||
</dl>
|
||
</dd>
|
||
</dl>
|
||
|
||
<dl class="py method">
|
||
<dt class="sig sig-object py" id="RNS.Link.get_remote_identity">
|
||
<span class="sig-name descname"
|
||
><span class="pre">get_remote_identity</span></span
|
||
><span class="sig-paren">(</span><span class="sig-paren">)</span
|
||
><a
|
||
class="headerlink"
|
||
href="#RNS.Link.get_remote_identity"
|
||
title="Link to this definition"
|
||
>¶</a
|
||
>
|
||
</dt>
|
||
<dd>
|
||
<dl class="field-list simple">
|
||
<dt class="field-odd">Returns<span class="colon">:</span></dt>
|
||
<dd class="field-odd">
|
||
<p>
|
||
The identity of the remote peer, if it is known. Calling this method
|
||
will not query the remote initiator to reveal its identity. Returns
|
||
<code class="docutils literal notranslate"
|
||
><span class="pre">None</span></code
|
||
>
|
||
if the link initiator has not already independently called the
|
||
<code class="docutils literal notranslate"
|
||
><span class="pre">identify(identity)</span></code
|
||
>
|
||
method.
|
||
</p>
|
||
</dd>
|
||
</dl>
|
||
</dd>
|
||
</dl>
|
||
|
||
<dl class="py method">
|
||
<dt class="sig sig-object py" id="RNS.Link.teardown">
|
||
<span class="sig-name descname"><span class="pre">teardown</span></span
|
||
><span class="sig-paren">(</span><span class="sig-paren">)</span
|
||
><a
|
||
class="headerlink"
|
||
href="#RNS.Link.teardown"
|
||
title="Link to this definition"
|
||
>¶</a
|
||
>
|
||
</dt>
|
||
<dd>
|
||
<p>
|
||
Closes the link and purges encryption keys. New keys will be used if a new
|
||
link to the same destination is established.
|
||
</p>
|
||
</dd>
|
||
</dl>
|
||
|
||
<dl class="py method">
|
||
<dt class="sig sig-object py" id="RNS.Link.get_channel">
|
||
<span class="sig-name descname"><span class="pre">get_channel</span></span
|
||
><span class="sig-paren">(</span><span class="sig-paren">)</span
|
||
><a
|
||
class="headerlink"
|
||
href="#RNS.Link.get_channel"
|
||
title="Link to this definition"
|
||
>¶</a
|
||
>
|
||
</dt>
|
||
<dd>
|
||
<p>
|
||
Get the
|
||
<code class="docutils literal notranslate"
|
||
><span class="pre">Channel</span></code
|
||
>
|
||
for this link.
|
||
</p>
|
||
<dl class="field-list simple">
|
||
<dt class="field-odd">Returns<span class="colon">:</span></dt>
|
||
<dd class="field-odd">
|
||
<p>
|
||
<code class="docutils literal notranslate"
|
||
><span class="pre">Channel</span></code
|
||
>
|
||
object
|
||
</p>
|
||
</dd>
|
||
</dl>
|
||
</dd>
|
||
</dl>
|
||
|
||
<dl class="py method">
|
||
<dt class="sig sig-object py" id="RNS.Link.set_link_closed_callback">
|
||
<span class="sig-name descname"
|
||
><span class="pre">set_link_closed_callback</span></span
|
||
><span class="sig-paren">(</span
|
||
><em class="sig-param"
|
||
><span class="n"><span class="pre">callback</span></span></em
|
||
><span class="sig-paren">)</span
|
||
><a
|
||
class="headerlink"
|
||
href="#RNS.Link.set_link_closed_callback"
|
||
title="Link to this definition"
|
||
>¶</a
|
||
>
|
||
</dt>
|
||
<dd>
|
||
<p>Registers a function to be called when a link has been torn down.</p>
|
||
<dl class="field-list simple">
|
||
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
|
||
<dd class="field-odd">
|
||
<p>
|
||
<strong>callback</strong> – A function or method with the signature
|
||
<em>callback(link)</em> to be called.
|
||
</p>
|
||
</dd>
|
||
</dl>
|
||
</dd>
|
||
</dl>
|
||
|
||
<dl class="py method">
|
||
<dt class="sig sig-object py" id="RNS.Link.set_packet_callback">
|
||
<span class="sig-name descname"
|
||
><span class="pre">set_packet_callback</span></span
|
||
><span class="sig-paren">(</span
|
||
><em class="sig-param"
|
||
><span class="n"><span class="pre">callback</span></span></em
|
||
><span class="sig-paren">)</span
|
||
><a
|
||
class="headerlink"
|
||
href="#RNS.Link.set_packet_callback"
|
||
title="Link to this definition"
|
||
>¶</a
|
||
>
|
||
</dt>
|
||
<dd>
|
||
<p>
|
||
Registers a function to be called when a packet has been received over
|
||
this link.
|
||
</p>
|
||
<dl class="field-list simple">
|
||
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
|
||
<dd class="field-odd">
|
||
<p>
|
||
<strong>callback</strong> – A function or method with the signature
|
||
<em>callback(message, packet)</em> to be called.
|
||
</p>
|
||
</dd>
|
||
</dl>
|
||
</dd>
|
||
</dl>
|
||
|
||
<dl class="py method">
|
||
<dt class="sig sig-object py" id="RNS.Link.set_resource_callback">
|
||
<span class="sig-name descname"
|
||
><span class="pre">set_resource_callback</span></span
|
||
><span class="sig-paren">(</span
|
||
><em class="sig-param"
|
||
><span class="n"><span class="pre">callback</span></span></em
|
||
><span class="sig-paren">)</span
|
||
><a
|
||
class="headerlink"
|
||
href="#RNS.Link.set_resource_callback"
|
||
title="Link to this definition"
|
||
>¶</a
|
||
>
|
||
</dt>
|
||
<dd>
|
||
<p>
|
||
Registers a function to be called when a resource has been advertised over
|
||
this link. If the function returns <em>True</em> the resource will be
|
||
accepted. If it returns <em>False</em> it will be ignored.
|
||
</p>
|
||
<dl class="field-list simple">
|
||
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
|
||
<dd class="field-odd">
|
||
<p>
|
||
<strong>callback</strong> – A function or method with the signature
|
||
<em>callback(resource)</em> to be called. Please note that only the
|
||
basic information of the resource is available at this time, such as
|
||
<em>get_transfer_size()</em>, <em>get_data_size()</em>,
|
||
<em>get_parts()</em> and <em>is_compressed()</em>.
|
||
</p>
|
||
</dd>
|
||
</dl>
|
||
</dd>
|
||
</dl>
|
||
|
||
<dl class="py method">
|
||
<dt class="sig sig-object py" id="RNS.Link.set_resource_started_callback">
|
||
<span class="sig-name descname"
|
||
><span class="pre">set_resource_started_callback</span></span
|
||
><span class="sig-paren">(</span
|
||
><em class="sig-param"
|
||
><span class="n"><span class="pre">callback</span></span></em
|
||
><span class="sig-paren">)</span
|
||
><a
|
||
class="headerlink"
|
||
href="#RNS.Link.set_resource_started_callback"
|
||
title="Link to this definition"
|
||
>¶</a
|
||
>
|
||
</dt>
|
||
<dd>
|
||
<p>
|
||
Registers a function to be called when a resource has begun transferring
|
||
over this link.
|
||
</p>
|
||
<dl class="field-list simple">
|
||
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
|
||
<dd class="field-odd">
|
||
<p>
|
||
<strong>callback</strong> – A function or method with the signature
|
||
<em>callback(resource)</em> to be called.
|
||
</p>
|
||
</dd>
|
||
</dl>
|
||
</dd>
|
||
</dl>
|
||
|
||
<dl class="py method">
|
||
<dt class="sig sig-object py" id="RNS.Link.set_resource_concluded_callback">
|
||
<span class="sig-name descname"
|
||
><span class="pre">set_resource_concluded_callback</span></span
|
||
><span class="sig-paren">(</span
|
||
><em class="sig-param"
|
||
><span class="n"><span class="pre">callback</span></span></em
|
||
><span class="sig-paren">)</span
|
||
><a
|
||
class="headerlink"
|
||
href="#RNS.Link.set_resource_concluded_callback"
|
||
title="Link to this definition"
|
||
>¶</a
|
||
>
|
||
</dt>
|
||
<dd>
|
||
<p>
|
||
Registers a function to be called when a resource has concluded
|
||
transferring over this link.
|
||
</p>
|
||
<dl class="field-list simple">
|
||
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
|
||
<dd class="field-odd">
|
||
<p>
|
||
<strong>callback</strong> – A function or method with the signature
|
||
<em>callback(resource)</em> to be called.
|
||
</p>
|
||
</dd>
|
||
</dl>
|
||
</dd>
|
||
</dl>
|
||
|
||
<dl class="py method">
|
||
<dt class="sig sig-object py" id="RNS.Link.set_remote_identified_callback">
|
||
<span class="sig-name descname"
|
||
><span class="pre">set_remote_identified_callback</span></span
|
||
><span class="sig-paren">(</span
|
||
><em class="sig-param"
|
||
><span class="n"><span class="pre">callback</span></span></em
|
||
><span class="sig-paren">)</span
|
||
><a
|
||
class="headerlink"
|
||
href="#RNS.Link.set_remote_identified_callback"
|
||
title="Link to this definition"
|
||
>¶</a
|
||
>
|
||
</dt>
|
||
<dd>
|
||
<p>
|
||
Registers a function to be called when an initiating peer has identified
|
||
over this link.
|
||
</p>
|
||
<dl class="field-list simple">
|
||
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
|
||
<dd class="field-odd">
|
||
<p>
|
||
<strong>callback</strong> – A function or method with the signature
|
||
<em>callback(link, identity)</em> to be called.
|
||
</p>
|
||
</dd>
|
||
</dl>
|
||
</dd>
|
||
</dl>
|
||
|
||
<dl class="py method">
|
||
<dt class="sig sig-object py" id="RNS.Link.set_resource_strategy">
|
||
<span class="sig-name descname"
|
||
><span class="pre">set_resource_strategy</span></span
|
||
><span class="sig-paren">(</span
|
||
><em class="sig-param"
|
||
><span class="n"><span class="pre">resource_strategy</span></span></em
|
||
><span class="sig-paren">)</span
|
||
><a
|
||
class="headerlink"
|
||
href="#RNS.Link.set_resource_strategy"
|
||
title="Link to this definition"
|
||
>¶</a
|
||
>
|
||
</dt>
|
||
<dd>
|
||
<p>Sets the resource strategy for the link.</p>
|
||
<dl class="field-list simple">
|
||
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
|
||
<dd class="field-odd">
|
||
<p>
|
||
<strong>resource_strategy</strong> – One of
|
||
<code class="docutils literal notranslate"
|
||
><span class="pre">RNS.Link.ACCEPT_NONE</span></code
|
||
>,
|
||
<code class="docutils literal notranslate"
|
||
><span class="pre">RNS.Link.ACCEPT_ALL</span></code
|
||
>
|
||
or
|
||
<code class="docutils literal notranslate"
|
||
><span class="pre">RNS.Link.ACCEPT_APP</span></code
|
||
>. If
|
||
<code class="docutils literal notranslate"
|
||
><span class="pre">RNS.Link.ACCEPT_APP</span></code
|
||
>
|
||
is set, the <cite>resource_callback</cite> will be called to determine
|
||
whether the resource should be accepted or not.
|
||
</p>
|
||
</dd>
|
||
<dt class="field-even">Raises<span class="colon">:</span></dt>
|
||
<dd class="field-even">
|
||
<p><em>TypeError</em> if the resource strategy is unsupported.</p>
|
||
</dd>
|
||
</dl>
|
||
</dd>
|
||
</dl>
|
||
</dd>
|
||
</dl>
|
||
|
||
<p id="api-requestreceipt"></p>
|
||
<h3>Request Receipt</h3>
|
||
<p></p>
|
||
<dl class="py class">
|
||
<dt class="sig sig-object py" id="RNS.RequestReceipt">
|
||
<em class="property"
|
||
><span class="k"><span class="pre">class</span></span
|
||
><span class="w"> </span></em
|
||
><span class="sig-prename descclassname"><span class="pre">RNS.</span></span
|
||
><span class="sig-name descname"><span class="pre">RequestReceipt</span></span
|
||
><a
|
||
class="headerlink"
|
||
href="#RNS.RequestReceipt"
|
||
title="Link to this definition"
|
||
>¶</a
|
||
>
|
||
</dt>
|
||
<dd>
|
||
<p>
|
||
An instance of this class is returned by the
|
||
<code class="docutils literal notranslate"
|
||
><span class="pre">request</span></code
|
||
>
|
||
method of
|
||
<code class="docutils literal notranslate"
|
||
><span class="pre">RNS.Link</span></code
|
||
>
|
||
instances. It should never be instantiated manually. It provides methods to
|
||
check status, response time and response data when the request concludes.
|
||
</p>
|
||
<dl class="py method">
|
||
<dt class="sig sig-object py" id="RNS.RequestReceipt.get_request_id">
|
||
<span class="sig-name descname"
|
||
><span class="pre">get_request_id</span></span
|
||
><span class="sig-paren">(</span><span class="sig-paren">)</span
|
||
><a
|
||
class="headerlink"
|
||
href="#RNS.RequestReceipt.get_request_id"
|
||
title="Link to this definition"
|
||
>¶</a
|
||
>
|
||
</dt>
|
||
<dd>
|
||
<dl class="field-list simple">
|
||
<dt class="field-odd">Returns<span class="colon">:</span></dt>
|
||
<dd class="field-odd">
|
||
<p>The request ID as <em>bytes</em>.</p>
|
||
</dd>
|
||
</dl>
|
||
</dd>
|
||
</dl>
|
||
|
||
<dl class="py method">
|
||
<dt class="sig sig-object py" id="RNS.RequestReceipt.get_status">
|
||
<span class="sig-name descname"><span class="pre">get_status</span></span
|
||
><span class="sig-paren">(</span><span class="sig-paren">)</span
|
||
><a
|
||
class="headerlink"
|
||
href="#RNS.RequestReceipt.get_status"
|
||
title="Link to this definition"
|
||
>¶</a
|
||
>
|
||
</dt>
|
||
<dd>
|
||
<dl class="field-list simple">
|
||
<dt class="field-odd">Returns<span class="colon">:</span></dt>
|
||
<dd class="field-odd">
|
||
<p>
|
||
The current status of the request, one of
|
||
<code class="docutils literal notranslate"
|
||
><span class="pre">RNS.RequestReceipt.FAILED</span></code
|
||
>,
|
||
<code class="docutils literal notranslate"
|
||
><span class="pre">RNS.RequestReceipt.SENT</span></code
|
||
>,
|
||
<code class="docutils literal notranslate"
|
||
><span class="pre">RNS.RequestReceipt.DELIVERED</span></code
|
||
>,
|
||
<code class="docutils literal notranslate"
|
||
><span class="pre">RNS.RequestReceipt.READY</span></code
|
||
>.
|
||
</p>
|
||
</dd>
|
||
</dl>
|
||
</dd>
|
||
</dl>
|
||
|
||
<dl class="py method">
|
||
<dt class="sig sig-object py" id="RNS.RequestReceipt.get_progress">
|
||
<span class="sig-name descname"><span class="pre">get_progress</span></span
|
||
><span class="sig-paren">(</span><span class="sig-paren">)</span
|
||
><a
|
||
class="headerlink"
|
||
href="#RNS.RequestReceipt.get_progress"
|
||
title="Link to this definition"
|
||
>¶</a
|
||
>
|
||
</dt>
|
||
<dd>
|
||
<dl class="field-list simple">
|
||
<dt class="field-odd">Returns<span class="colon">:</span></dt>
|
||
<dd class="field-odd">
|
||
<p>
|
||
The progress of a response being received as a <em>float</em> between
|
||
0.0 and 1.0.
|
||
</p>
|
||
</dd>
|
||
</dl>
|
||
</dd>
|
||
</dl>
|
||
|
||
<dl class="py method">
|
||
<dt class="sig sig-object py" id="RNS.RequestReceipt.get_response">
|
||
<span class="sig-name descname"><span class="pre">get_response</span></span
|
||
><span class="sig-paren">(</span><span class="sig-paren">)</span
|
||
><a
|
||
class="headerlink"
|
||
href="#RNS.RequestReceipt.get_response"
|
||
title="Link to this definition"
|
||
>¶</a
|
||
>
|
||
</dt>
|
||
<dd>
|
||
<dl class="field-list simple">
|
||
<dt class="field-odd">Returns<span class="colon">:</span></dt>
|
||
<dd class="field-odd">
|
||
<p>
|
||
The response as <em>bytes</em> if it is ready, otherwise
|
||
<em>None</em>.
|
||
</p>
|
||
</dd>
|
||
</dl>
|
||
</dd>
|
||
</dl>
|
||
|
||
<dl class="py method">
|
||
<dt class="sig sig-object py" id="RNS.RequestReceipt.get_response_time">
|
||
<span class="sig-name descname"
|
||
><span class="pre">get_response_time</span></span
|
||
><span class="sig-paren">(</span><span class="sig-paren">)</span
|
||
><a
|
||
class="headerlink"
|
||
href="#RNS.RequestReceipt.get_response_time"
|
||
title="Link to this definition"
|
||
>¶</a
|
||
>
|
||
</dt>
|
||
<dd>
|
||
<dl class="field-list simple">
|
||
<dt class="field-odd">Returns<span class="colon">:</span></dt>
|
||
<dd class="field-odd">
|
||
<p>The response time of the request in seconds.</p>
|
||
</dd>
|
||
</dl>
|
||
</dd>
|
||
</dl>
|
||
|
||
<dl class="py method">
|
||
<dt class="sig sig-object py" id="RNS.RequestReceipt.concluded">
|
||
<span class="sig-name descname"><span class="pre">concluded</span></span
|
||
><span class="sig-paren">(</span><span class="sig-paren">)</span
|
||
><a
|
||
class="headerlink"
|
||
href="#RNS.RequestReceipt.concluded"
|
||
title="Link to this definition"
|
||
>¶</a
|
||
>
|
||
</dt>
|
||
<dd>
|
||
<dl class="field-list simple">
|
||
<dt class="field-odd">Returns<span class="colon">:</span></dt>
|
||
<dd class="field-odd">
|
||
<p>
|
||
True if the associated request has concluded (successfully or with a
|
||
failure), otherwise False.
|
||
</p>
|
||
</dd>
|
||
</dl>
|
||
</dd>
|
||
</dl>
|
||
</dd>
|
||
</dl>
|
||
|
||
<p id="api-resource"></p>
|
||
<h3>Resource</h3>
|
||
<p></p>
|
||
<dl class="py class">
|
||
<dt class="sig sig-object py" id="RNS.Resource">
|
||
<em class="property"
|
||
><span class="k"><span class="pre">class</span></span
|
||
><span class="w"> </span></em
|
||
><span class="sig-prename descclassname"><span class="pre">RNS.</span></span
|
||
><span class="sig-name descname"><span class="pre">Resource</span></span
|
||
><span class="sig-paren">(</span
|
||
><em class="sig-param"
|
||
><span class="n"><span class="pre">data</span></span></em
|
||
>,
|
||
<em class="sig-param"
|
||
><span class="n"><span class="pre">link</span></span></em
|
||
>,
|
||
<em class="sig-param"
|
||
><span class="n"><span class="pre">advertise</span></span
|
||
><span class="o"><span class="pre">=</span></span
|
||
><span class="default_value"><span class="pre">True</span></span></em
|
||
>,
|
||
<em class="sig-param"
|
||
><span class="n"><span class="pre">auto_compress</span></span
|
||
><span class="o"><span class="pre">=</span></span
|
||
><span class="default_value"><span class="pre">True</span></span></em
|
||
>,
|
||
<em class="sig-param"
|
||
><span class="n"><span class="pre">callback</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">progress_callback</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">timeout</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.Resource" title="Link to this definition"
|
||
>¶</a
|
||
>
|
||
</dt>
|
||
<dd>
|
||
<p>
|
||
The Resource class allows transferring arbitrary amounts of data over a link.
|
||
It will automatically handle sequencing, compression, coordination and
|
||
checksumming.
|
||
</p>
|
||
<dl class="field-list simple">
|
||
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
|
||
<dd class="field-odd">
|
||
<ul class="simple">
|
||
<li>
|
||
<p>
|
||
<strong>data</strong> – The data to be transferred. Can be
|
||
<em>bytes</em> or an open <em>file handle</em>. See the
|
||
<a
|
||
class="reference internal"
|
||
href="examples.html#example-filetransfer"
|
||
><span class="std std-ref">Filetransfer Example</span></a
|
||
>
|
||
for details.
|
||
</p>
|
||
</li>
|
||
<li>
|
||
<p>
|
||
<strong>link</strong> – The
|
||
<a class="reference internal" href="#api-link"
|
||
><span class="std std-ref">RNS.Link</span></a
|
||
>
|
||
instance on which to transfer the data.
|
||
</p>
|
||
</li>
|
||
<li>
|
||
<p>
|
||
<strong>advertise</strong> – Optional. Whether to automatically
|
||
advertise the resource. Can be <em>True</em> or <em>False</em>.
|
||
</p>
|
||
</li>
|
||
<li>
|
||
<p>
|
||
<strong>auto_compress</strong> – Optional. Whether to auto-compress
|
||
the resource. Can be <em>True</em> or <em>False</em>.
|
||
</p>
|
||
</li>
|
||
<li>
|
||
<p>
|
||
<strong>callback</strong> – An optional <em>callable</em> with the
|
||
signature <em>callback(resource)</em>. Will be called when the
|
||
resource transfer concludes.
|
||
</p>
|
||
</li>
|
||
<li>
|
||
<p>
|
||
<strong>progress_callback</strong> – An optional
|
||
<em>callable</em> with the signature <em>callback(resource)</em>. Will
|
||
be called whenever the resource transfer progress is updated.
|
||
</p>
|
||
</li>
|
||
</ul>
|
||
</dd>
|
||
</dl>
|
||
<dl class="py method">
|
||
<dt class="sig sig-object py" id="RNS.Resource.advertise">
|
||
<span class="sig-name descname"><span class="pre">advertise</span></span
|
||
><span class="sig-paren">(</span><span class="sig-paren">)</span
|
||
><a
|
||
class="headerlink"
|
||
href="#RNS.Resource.advertise"
|
||
title="Link to this definition"
|
||
>¶</a
|
||
>
|
||
</dt>
|
||
<dd>
|
||
<p>
|
||
Advertise the resource. If the other end of the link accepts the resource
|
||
advertisement it will begin transferring.
|
||
</p>
|
||
</dd>
|
||
</dl>
|
||
|
||
<dl class="py method">
|
||
<dt class="sig sig-object py" id="RNS.Resource.cancel">
|
||
<span class="sig-name descname"><span class="pre">cancel</span></span
|
||
><span class="sig-paren">(</span><span class="sig-paren">)</span
|
||
><a
|
||
class="headerlink"
|
||
href="#RNS.Resource.cancel"
|
||
title="Link to this definition"
|
||
>¶</a
|
||
>
|
||
</dt>
|
||
<dd><p>Cancels transferring the resource.</p></dd>
|
||
</dl>
|
||
|
||
<dl class="py method">
|
||
<dt class="sig sig-object py" id="RNS.Resource.get_progress">
|
||
<span class="sig-name descname"><span class="pre">get_progress</span></span
|
||
><span class="sig-paren">(</span><span class="sig-paren">)</span
|
||
><a
|
||
class="headerlink"
|
||
href="#RNS.Resource.get_progress"
|
||
title="Link to this definition"
|
||
>¶</a
|
||
>
|
||
</dt>
|
||
<dd>
|
||
<dl class="field-list simple">
|
||
<dt class="field-odd">Returns<span class="colon">:</span></dt>
|
||
<dd class="field-odd">
|
||
<p>
|
||
The current progress of the resource transfer as a
|
||
<em>float</em> between 0.0 and 1.0.
|
||
</p>
|
||
</dd>
|
||
</dl>
|
||
</dd>
|
||
</dl>
|
||
|
||
<dl class="py method">
|
||
<dt class="sig sig-object py" id="RNS.Resource.get_transfer_size">
|
||
<span class="sig-name descname"
|
||
><span class="pre">get_transfer_size</span></span
|
||
><span class="sig-paren">(</span><span class="sig-paren">)</span
|
||
><a
|
||
class="headerlink"
|
||
href="#RNS.Resource.get_transfer_size"
|
||
title="Link to this definition"
|
||
>¶</a
|
||
>
|
||
</dt>
|
||
<dd>
|
||
<dl class="field-list simple">
|
||
<dt class="field-odd">Returns<span class="colon">:</span></dt>
|
||
<dd class="field-odd">
|
||
<p>The number of bytes needed to transfer the resource.</p>
|
||
</dd>
|
||
</dl>
|
||
</dd>
|
||
</dl>
|
||
|
||
<dl class="py method">
|
||
<dt class="sig sig-object py" id="RNS.Resource.get_data_size">
|
||
<span class="sig-name descname"><span class="pre">get_data_size</span></span
|
||
><span class="sig-paren">(</span><span class="sig-paren">)</span
|
||
><a
|
||
class="headerlink"
|
||
href="#RNS.Resource.get_data_size"
|
||
title="Link to this definition"
|
||
>¶</a
|
||
>
|
||
</dt>
|
||
<dd>
|
||
<dl class="field-list simple">
|
||
<dt class="field-odd">Returns<span class="colon">:</span></dt>
|
||
<dd class="field-odd"><p>The total data size of the resource.</p></dd>
|
||
</dl>
|
||
</dd>
|
||
</dl>
|
||
|
||
<dl class="py method">
|
||
<dt class="sig sig-object py" id="RNS.Resource.get_parts">
|
||
<span class="sig-name descname"><span class="pre">get_parts</span></span
|
||
><span class="sig-paren">(</span><span class="sig-paren">)</span
|
||
><a
|
||
class="headerlink"
|
||
href="#RNS.Resource.get_parts"
|
||
title="Link to this definition"
|
||
>¶</a
|
||
>
|
||
</dt>
|
||
<dd>
|
||
<dl class="field-list simple">
|
||
<dt class="field-odd">Returns<span class="colon">:</span></dt>
|
||
<dd class="field-odd">
|
||
<p>The number of parts the resource will be transferred in.</p>
|
||
</dd>
|
||
</dl>
|
||
</dd>
|
||
</dl>
|
||
|
||
<dl class="py method">
|
||
<dt class="sig sig-object py" id="RNS.Resource.get_segments">
|
||
<span class="sig-name descname"><span class="pre">get_segments</span></span
|
||
><span class="sig-paren">(</span><span class="sig-paren">)</span
|
||
><a
|
||
class="headerlink"
|
||
href="#RNS.Resource.get_segments"
|
||
title="Link to this definition"
|
||
>¶</a
|
||
>
|
||
</dt>
|
||
<dd>
|
||
<dl class="field-list simple">
|
||
<dt class="field-odd">Returns<span class="colon">:</span></dt>
|
||
<dd class="field-odd">
|
||
<p>The number of segments the resource is divided into.</p>
|
||
</dd>
|
||
</dl>
|
||
</dd>
|
||
</dl>
|
||
|
||
<dl class="py method">
|
||
<dt class="sig sig-object py" id="RNS.Resource.get_hash">
|
||
<span class="sig-name descname"><span class="pre">get_hash</span></span
|
||
><span class="sig-paren">(</span><span class="sig-paren">)</span
|
||
><a
|
||
class="headerlink"
|
||
href="#RNS.Resource.get_hash"
|
||
title="Link to this definition"
|
||
>¶</a
|
||
>
|
||
</dt>
|
||
<dd>
|
||
<dl class="field-list simple">
|
||
<dt class="field-odd">Returns<span class="colon">:</span></dt>
|
||
<dd class="field-odd"><p>The hash of the resource.</p></dd>
|
||
</dl>
|
||
</dd>
|
||
</dl>
|
||
|
||
<dl class="py method">
|
||
<dt class="sig sig-object py" id="RNS.Resource.is_compressed">
|
||
<span class="sig-name descname"><span class="pre">is_compressed</span></span
|
||
><span class="sig-paren">(</span><span class="sig-paren">)</span
|
||
><a
|
||
class="headerlink"
|
||
href="#RNS.Resource.is_compressed"
|
||
title="Link to this definition"
|
||
>¶</a
|
||
>
|
||
</dt>
|
||
<dd>
|
||
<dl class="field-list simple">
|
||
<dt class="field-odd">Returns<span class="colon">:</span></dt>
|
||
<dd class="field-odd"><p>Whether the resource is compressed.</p></dd>
|
||
</dl>
|
||
</dd>
|
||
</dl>
|
||
</dd>
|
||
</dl>
|
||
|
||
<p id="api-channel"></p>
|
||
<h3>Channel</h3>
|
||
<p></p>
|
||
<dl class="py class">
|
||
<dt class="sig sig-object py" id="RNS.Channel.Channel">
|
||
<em class="property"
|
||
><span class="k"><span class="pre">class</span></span
|
||
><span class="w"> </span></em
|
||
><span class="sig-prename descclassname"
|
||
><span class="pre">RNS.Channel.</span></span
|
||
><span class="sig-name descname"><span class="pre">Channel</span></span
|
||
><a
|
||
class="headerlink"
|
||
href="#RNS.Channel.Channel"
|
||
title="Link to this definition"
|
||
>¶</a
|
||
>
|
||
</dt>
|
||
<dd>
|
||
<p>Provides reliable delivery of messages over a link.</p>
|
||
<p>
|
||
<code class="docutils literal notranslate"
|
||
><span class="pre">Channel</span></code
|
||
>
|
||
differs from
|
||
<code class="docutils literal notranslate"
|
||
><span class="pre">Request</span></code
|
||
>
|
||
and
|
||
<code class="docutils literal notranslate"
|
||
><span class="pre">Resource</span></code
|
||
>
|
||
in some important ways:
|
||
</p>
|
||
<blockquote>
|
||
<div>
|
||
<dl class="simple">
|
||
<dt><strong>Continuous</strong></dt>
|
||
<dd>
|
||
<p>
|
||
Messages can be sent or received as long as the
|
||
<code class="docutils literal notranslate"
|
||
><span class="pre">Link</span></code
|
||
>
|
||
is open.
|
||
</p>
|
||
</dd>
|
||
<dt><strong>Bi-directional</strong></dt>
|
||
<dd>
|
||
<p>
|
||
Messages can be sent in either direction on the
|
||
<code class="docutils literal notranslate"
|
||
><span class="pre">Link</span></code
|
||
>; neither end is the client or server.
|
||
</p>
|
||
</dd>
|
||
<dt><strong>Size-constrained</strong></dt>
|
||
<dd><p>Messages must be encoded into a single packet.</p></dd>
|
||
</dl>
|
||
</div>
|
||
</blockquote>
|
||
<p>
|
||
<code class="docutils literal notranslate"
|
||
><span class="pre">Channel</span></code
|
||
>
|
||
is similar to
|
||
<code class="docutils literal notranslate"
|
||
><span class="pre">Packet</span></code
|
||
>, except that it provides reliable delivery (automatic retries) as well as a
|
||
structure for exchanging several types of messages over the
|
||
<code class="docutils literal notranslate"><span class="pre">Link</span></code
|
||
>.
|
||
</p>
|
||
<p>
|
||
<code class="docutils literal notranslate"
|
||
><span class="pre">Channel</span></code
|
||
>
|
||
is not instantiated directly, but rather obtained from a
|
||
<code class="docutils literal notranslate"
|
||
><span class="pre">Link</span></code
|
||
>
|
||
with
|
||
<code class="docutils literal notranslate"
|
||
><span class="pre">get_channel()</span></code
|
||
>.
|
||
</p>
|
||
<dl class="py method">
|
||
<dt class="sig sig-object py" id="RNS.Channel.Channel.register_message_type">
|
||
<span class="sig-name descname"
|
||
><span class="pre">register_message_type</span></span
|
||
><span class="sig-paren">(</span
|
||
><em class="sig-param"
|
||
><span class="n"><span class="pre">message_class</span></span
|
||
><span class="p"><span class="pre">:</span></span
|
||
><span class="w"> </span
|
||
><span class="n"
|
||
><span class="pre">Type</span
|
||
><span class="p"><span class="pre">[</span></span
|
||
><a
|
||
class="reference internal"
|
||
href="#RNS.MessageBase"
|
||
title="RNS.Channel.MessageBase"
|
||
><span class="pre">MessageBase</span></a
|
||
><span class="p"><span class="pre">]</span></span></span
|
||
></em
|
||
><span class="sig-paren">)</span
|
||
><a
|
||
class="headerlink"
|
||
href="#RNS.Channel.Channel.register_message_type"
|
||
title="Link to this definition"
|
||
>¶</a
|
||
>
|
||
</dt>
|
||
<dd>
|
||
<p>
|
||
Register a message class for reception over a
|
||
<code class="docutils literal notranslate"
|
||
><span class="pre">Channel</span></code
|
||
>.
|
||
</p>
|
||
<p>
|
||
Message classes must extend
|
||
<code class="docutils literal notranslate"
|
||
><span class="pre">MessageBase</span></code
|
||
>.
|
||
</p>
|
||
<dl class="field-list simple">
|
||
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
|
||
<dd class="field-odd">
|
||
<p><strong>message_class</strong> – Class to register</p>
|
||
</dd>
|
||
</dl>
|
||
</dd>
|
||
</dl>
|
||
|
||
<dl class="py method">
|
||
<dt class="sig sig-object py" id="RNS.Channel.Channel.add_message_handler">
|
||
<span class="sig-name descname"
|
||
><span class="pre">add_message_handler</span></span
|
||
><span class="sig-paren">(</span
|
||
><em class="sig-param"
|
||
><span class="n"><span class="pre">callback</span></span
|
||
><span class="p"><span class="pre">:</span></span
|
||
><span class="w"> </span
|
||
><span class="n"><span class="pre">MessageCallbackType</span></span></em
|
||
><span class="sig-paren">)</span
|
||
><a
|
||
class="headerlink"
|
||
href="#RNS.Channel.Channel.add_message_handler"
|
||
title="Link to this definition"
|
||
>¶</a
|
||
>
|
||
</dt>
|
||
<dd>
|
||
<p>
|
||
Add a handler for incoming messages. A handler has the following
|
||
signature:
|
||
</p>
|
||
<p>
|
||
<code class="docutils literal notranslate"
|
||
><span class="pre">(message:</span>
|
||
<span class="pre">MessageBase)</span> <span class="pre">-></span>
|
||
<span class="pre">bool</span></code
|
||
>
|
||
</p>
|
||
<p>
|
||
Handlers are processed in the order they are added. If any handler returns
|
||
True, processing of the message stops; handlers after the returning
|
||
handler will not be called.
|
||
</p>
|
||
<dl class="field-list simple">
|
||
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
|
||
<dd class="field-odd">
|
||
<p><strong>callback</strong> – Function to call</p>
|
||
</dd>
|
||
</dl>
|
||
</dd>
|
||
</dl>
|
||
|
||
<dl class="py method">
|
||
<dt class="sig sig-object py" id="RNS.Channel.Channel.remove_message_handler">
|
||
<span class="sig-name descname"
|
||
><span class="pre">remove_message_handler</span></span
|
||
><span class="sig-paren">(</span
|
||
><em class="sig-param"
|
||
><span class="n"><span class="pre">callback</span></span
|
||
><span class="p"><span class="pre">:</span></span
|
||
><span class="w"> </span
|
||
><span class="n"><span class="pre">MessageCallbackType</span></span></em
|
||
><span class="sig-paren">)</span
|
||
><a
|
||
class="headerlink"
|
||
href="#RNS.Channel.Channel.remove_message_handler"
|
||
title="Link to this definition"
|
||
>¶</a
|
||
>
|
||
</dt>
|
||
<dd>
|
||
<p>
|
||
Remove a handler added with
|
||
<code class="docutils literal notranslate"
|
||
><span class="pre">add_message_handler</span></code
|
||
>.
|
||
</p>
|
||
<dl class="field-list simple">
|
||
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
|
||
<dd class="field-odd">
|
||
<p><strong>callback</strong> – handler to remove</p>
|
||
</dd>
|
||
</dl>
|
||
</dd>
|
||
</dl>
|
||
|
||
<dl class="py method">
|
||
<dt class="sig sig-object py" id="RNS.Channel.Channel.is_ready_to_send">
|
||
<span class="sig-name descname"
|
||
><span class="pre">is_ready_to_send</span></span
|
||
><span class="sig-paren">(</span><span class="sig-paren">)</span>
|
||
<span class="sig-return"
|
||
><span class="sig-return-icon">�</span>
|
||
<span class="sig-return-typehint"
|
||
><span class="pre">bool</span></span
|
||
></span
|
||
><a
|
||
class="headerlink"
|
||
href="#RNS.Channel.Channel.is_ready_to_send"
|
||
title="Link to this definition"
|
||
>¶</a
|
||
>
|
||
</dt>
|
||
<dd>
|
||
<p>
|
||
Check if
|
||
<code class="docutils literal notranslate"
|
||
><span class="pre">Channel</span></code
|
||
>
|
||
is ready to send.
|
||
</p>
|
||
<dl class="field-list simple">
|
||
<dt class="field-odd">Returns<span class="colon">:</span></dt>
|
||
<dd class="field-odd"><p>True if ready</p></dd>
|
||
</dl>
|
||
</dd>
|
||
</dl>
|
||
|
||
<dl class="py method">
|
||
<dt class="sig sig-object py" id="RNS.Channel.Channel.send">
|
||
<span class="sig-name descname"><span class="pre">send</span></span
|
||
><span class="sig-paren">(</span
|
||
><em class="sig-param"
|
||
><span class="n"><span class="pre">message</span></span
|
||
><span class="p"><span class="pre">:</span></span
|
||
><span class="w"> </span
|
||
><span class="n"
|
||
><a
|
||
class="reference internal"
|
||
href="#RNS.MessageBase"
|
||
title="RNS.Channel.MessageBase"
|
||
><span class="pre">MessageBase</span></a
|
||
></span
|
||
></em
|
||
><span class="sig-paren">)</span>
|
||
<span class="sig-return"
|
||
><span class="sig-return-icon">�</span>
|
||
<span class="sig-return-typehint"
|
||
><span class="pre">Envelope</span></span
|
||
></span
|
||
><a
|
||
class="headerlink"
|
||
href="#RNS.Channel.Channel.send"
|
||
title="Link to this definition"
|
||
>¶</a
|
||
>
|
||
</dt>
|
||
<dd>
|
||
<p>
|
||
Send a message. If a message send is attempted and
|
||
<code class="docutils literal notranslate"
|
||
><span class="pre">Channel</span></code
|
||
>
|
||
is not ready, an exception is thrown.
|
||
</p>
|
||
<dl class="field-list simple">
|
||
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
|
||
<dd class="field-odd">
|
||
<p>
|
||
<strong>message</strong> – an instance of a
|
||
<code class="docutils literal notranslate"
|
||
><span class="pre">MessageBase</span></code
|
||
>
|
||
subclass
|
||
</p>
|
||
</dd>
|
||
</dl>
|
||
</dd>
|
||
</dl>
|
||
|
||
<dl class="py property">
|
||
<dt class="sig sig-object py" id="RNS.Channel.Channel.mdu">
|
||
<em class="property"
|
||
><span class="k"><span class="pre">property</span></span
|
||
><span class="w"> </span></em
|
||
><span class="sig-name descname"><span class="pre">mdu</span></span
|
||
><a
|
||
class="headerlink"
|
||
href="#RNS.Channel.Channel.mdu"
|
||
title="Link to this definition"
|
||
>¶</a
|
||
>
|
||
</dt>
|
||
<dd>
|
||
<p>
|
||
Maximum Data Unit: the number of bytes available for a message to consume
|
||
in a single send. This value is adjusted from the
|
||
<code class="docutils literal notranslate"
|
||
><span class="pre">Link</span></code
|
||
>
|
||
MDU to accommodate message header information.
|
||
</p>
|
||
<dl class="field-list simple">
|
||
<dt class="field-odd">Returns<span class="colon">:</span></dt>
|
||
<dd class="field-odd"><p>number of bytes available</p></dd>
|
||
</dl>
|
||
</dd>
|
||
</dl>
|
||
</dd>
|
||
</dl>
|
||
|
||
<p id="api-messsagebase"></p>
|
||
<h3>MessageBase</h3>
|
||
<p></p>
|
||
<dl class="py class">
|
||
<dt class="sig sig-object py" id="RNS.MessageBase">
|
||
<em class="property"
|
||
><span class="k"><span class="pre">class</span></span
|
||
><span class="w"> </span></em
|
||
><span class="sig-prename descclassname"><span class="pre">RNS.</span></span
|
||
><span class="sig-name descname"><span class="pre">MessageBase</span></span
|
||
><a class="headerlink" href="#RNS.MessageBase" title="Link to this definition"
|
||
>¶</a
|
||
>
|
||
</dt>
|
||
<dd>
|
||
<p>
|
||
Base type for any messages sent or received on a Channel. Subclasses must
|
||
define the two abstract methods as well as the
|
||
<code class="docutils literal notranslate"
|
||
><span class="pre">MSGTYPE</span></code
|
||
>
|
||
class variable.
|
||
</p>
|
||
<dl class="py attribute">
|
||
<dt class="sig sig-object py" id="RNS.MessageBase.MSGTYPE">
|
||
<span class="sig-name descname"><span class="pre">MSGTYPE</span></span
|
||
><em class="property"
|
||
><span class="w"> </span><span class="p"><span class="pre">=</span></span
|
||
><span class="w"> </span><span class="pre">None</span></em
|
||
><a
|
||
class="headerlink"
|
||
href="#RNS.MessageBase.MSGTYPE"
|
||
title="Link to this definition"
|
||
>¶</a
|
||
>
|
||
</dt>
|
||
<dd>
|
||
<p>Defines a unique identifier for a message class.</p>
|
||
<ul class="simple">
|
||
<li>
|
||
<p>
|
||
Must be unique within all classes registered with a
|
||
<code class="docutils literal notranslate"
|
||
><span class="pre">Channel</span></code
|
||
>
|
||
</p>
|
||
</li>
|
||
<li>
|
||
<p>
|
||
Must be less than
|
||
<code class="docutils literal notranslate"
|
||
><span class="pre">0xf000</span></code
|
||
>. Values greater than or equal to
|
||
<code class="docutils literal notranslate"
|
||
><span class="pre">0xf000</span></code
|
||
>
|
||
are reserved.
|
||
</p>
|
||
</li>
|
||
</ul>
|
||
</dd>
|
||
</dl>
|
||
|
||
<dl class="py method">
|
||
<dt class="sig sig-object py" id="RNS.MessageBase.pack">
|
||
<em class="property"
|
||
><span class="k"><span class="pre">abstractmethod</span></span
|
||
><span class="w"> </span></em
|
||
><span class="sig-name descname"><span class="pre">pack</span></span
|
||
><span class="sig-paren">(</span><span class="sig-paren">)</span>
|
||
<span class="sig-return"
|
||
><span class="sig-return-icon">�</span>
|
||
<span class="sig-return-typehint"
|
||
><span class="pre">bytes</span></span
|
||
></span
|
||
><a
|
||
class="headerlink"
|
||
href="#RNS.MessageBase.pack"
|
||
title="Link to this definition"
|
||
>¶</a
|
||
>
|
||
</dt>
|
||
<dd>
|
||
<p>Create and return the binary representation of the message</p>
|
||
<dl class="field-list simple">
|
||
<dt class="field-odd">Returns<span class="colon">:</span></dt>
|
||
<dd class="field-odd"><p>binary representation of message</p></dd>
|
||
</dl>
|
||
</dd>
|
||
</dl>
|
||
|
||
<dl class="py method">
|
||
<dt class="sig sig-object py" id="RNS.MessageBase.unpack">
|
||
<em class="property"
|
||
><span class="k"><span class="pre">abstractmethod</span></span
|
||
><span class="w"> </span></em
|
||
><span class="sig-name descname"><span class="pre">unpack</span></span
|
||
><span class="sig-paren">(</span
|
||
><em class="sig-param"
|
||
><span class="n"><span class="pre">raw</span></span
|
||
><span class="p"><span class="pre">:</span></span
|
||
><span class="w"> </span
|
||
><span class="n"><span class="pre">bytes</span></span></em
|
||
><span class="sig-paren">)</span
|
||
><a
|
||
class="headerlink"
|
||
href="#RNS.MessageBase.unpack"
|
||
title="Link to this definition"
|
||
>¶</a
|
||
>
|
||
</dt>
|
||
<dd>
|
||
<p>Populate message from binary representation</p>
|
||
<dl class="field-list simple">
|
||
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
|
||
<dd class="field-odd">
|
||
<p><strong>raw</strong> – binary representation</p>
|
||
</dd>
|
||
</dl>
|
||
</dd>
|
||
</dl>
|
||
</dd>
|
||
</dl>
|
||
|
||
<p id="api-buffer"></p>
|
||
<h3>Buffer</h3>
|
||
<p></p>
|
||
<dl class="py class">
|
||
<dt class="sig sig-object py" id="RNS.Buffer">
|
||
<em class="property"
|
||
><span class="k"><span class="pre">class</span></span
|
||
><span class="w"> </span></em
|
||
><span class="sig-prename descclassname"><span class="pre">RNS.</span></span
|
||
><span class="sig-name descname"><span class="pre">Buffer</span></span
|
||
><a class="headerlink" href="#RNS.Buffer" title="Link to this definition">¶</a>
|
||
</dt>
|
||
<dd>
|
||
<p>
|
||
Static functions for creating buffered streams that send and receive over a
|
||
<code class="docutils literal notranslate"
|
||
><span class="pre">Channel</span></code
|
||
>.
|
||
</p>
|
||
<p>
|
||
These functions use
|
||
<code class="docutils literal notranslate"
|
||
><span class="pre">BufferedReader</span></code
|
||
>,
|
||
<code class="docutils literal notranslate"
|
||
><span class="pre">BufferedWriter</span></code
|
||
>, and
|
||
<code class="docutils literal notranslate"
|
||
><span class="pre">BufferedRWPair</span></code
|
||
>
|
||
to add buffering to
|
||
<code class="docutils literal notranslate"
|
||
><span class="pre">RawChannelReader</span></code
|
||
>
|
||
and
|
||
<code class="docutils literal notranslate"
|
||
><span class="pre">RawChannelWriter</span></code
|
||
>.
|
||
</p>
|
||
<dl class="py method">
|
||
<dt class="sig sig-object py" id="RNS.Buffer.create_reader">
|
||
<em class="property"
|
||
><span class="k"><span class="pre">static</span></span
|
||
><span class="w"> </span></em
|
||
><span class="sig-name descname"
|
||
><span class="pre">create_reader</span></span
|
||
><span class="sig-paren">(</span
|
||
><em class="sig-param"
|
||
><span class="n"><span class="pre">stream_id</span></span
|
||
><span class="p"><span class="pre">:</span></span
|
||
><span class="w"> </span
|
||
><span class="n"><span class="pre">int</span></span></em
|
||
>,
|
||
<em class="sig-param"
|
||
><span class="n"><span class="pre">channel</span></span
|
||
><span class="p"><span class="pre">:</span></span
|
||
><span class="w"> </span
|
||
><span class="n"
|
||
><a
|
||
class="reference internal"
|
||
href="#RNS.Channel.Channel"
|
||
title="RNS.Channel.Channel"
|
||
><span class="pre">Channel</span></a
|
||
></span
|
||
></em
|
||
>,
|
||
<em class="sig-param"
|
||
><span class="n"><span class="pre">ready_callback</span></span
|
||
><span class="p"><span class="pre">:</span></span
|
||
><span class="w"> </span
|
||
><span class="n"
|
||
><span class="pre">Callable</span
|
||
><span class="p"><span class="pre">[</span></span
|
||
><span class="p"><span class="pre">[</span></span
|
||
><span class="pre">int</span
|
||
><span class="p"><span class="pre">]</span></span
|
||
><span class="p"><span class="pre">,</span></span
|
||
><span class="w"> </span><span class="pre">None</span
|
||
><span class="p"><span class="pre">]</span></span
|
||
><span class="w"> </span
|
||
><span class="p"><span class="pre">|</span></span
|
||
><span class="w"> </span><span class="pre">None</span></span
|
||
><span class="w"> </span><span class="o"><span class="pre">=</span></span
|
||
><span class="w"> </span
|
||
><span class="default_value"><span class="pre">None</span></span></em
|
||
><span class="sig-paren">)</span>
|
||
<span class="sig-return"
|
||
><span class="sig-return-icon">�</span>
|
||
<span class="sig-return-typehint"
|
||
><span class="pre">BufferedReader</span></span
|
||
></span
|
||
><a
|
||
class="headerlink"
|
||
href="#RNS.Buffer.create_reader"
|
||
title="Link to this definition"
|
||
>¶</a
|
||
>
|
||
</dt>
|
||
<dd>
|
||
<p>
|
||
Create a buffered reader that reads binary data sent over a
|
||
<code class="docutils literal notranslate"
|
||
><span class="pre">Channel</span></code
|
||
>, with an optional callback when new data is available.
|
||
</p>
|
||
<p>
|
||
Callback signature:
|
||
<code class="docutils literal notranslate"
|
||
><span class="pre">(ready_bytes:</span> <span class="pre">int)</span>
|
||
<span class="pre">-></span> <span class="pre">None</span></code
|
||
>
|
||
</p>
|
||
<p>
|
||
For more information on the reader-specific functions of this object, see
|
||
the Python documentation for
|
||
<code class="docutils literal notranslate"
|
||
><span class="pre">BufferedReader</span></code
|
||
>
|
||
</p>
|
||
<dl class="field-list simple">
|
||
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
|
||
<dd class="field-odd">
|
||
<ul class="simple">
|
||
<li>
|
||
<p>
|
||
<strong>stream_id</strong> – the local stream id to receive from
|
||
</p>
|
||
</li>
|
||
<li>
|
||
<p><strong>channel</strong> – the channel to receive on</p>
|
||
</li>
|
||
<li>
|
||
<p>
|
||
<strong>ready_callback</strong> – function to call when new data
|
||
is available
|
||
</p>
|
||
</li>
|
||
</ul>
|
||
</dd>
|
||
<dt class="field-even">Returns<span class="colon">:</span></dt>
|
||
<dd class="field-even"><p>a BufferedReader object</p></dd>
|
||
</dl>
|
||
</dd>
|
||
</dl>
|
||
|
||
<dl class="py method">
|
||
<dt class="sig sig-object py" id="RNS.Buffer.create_writer">
|
||
<em class="property"
|
||
><span class="k"><span class="pre">static</span></span
|
||
><span class="w"> </span></em
|
||
><span class="sig-name descname"
|
||
><span class="pre">create_writer</span></span
|
||
><span class="sig-paren">(</span
|
||
><em class="sig-param"
|
||
><span class="n"><span class="pre">stream_id</span></span
|
||
><span class="p"><span class="pre">:</span></span
|
||
><span class="w"> </span
|
||
><span class="n"><span class="pre">int</span></span></em
|
||
>,
|
||
<em class="sig-param"
|
||
><span class="n"><span class="pre">channel</span></span
|
||
><span class="p"><span class="pre">:</span></span
|
||
><span class="w"> </span
|
||
><span class="n"
|
||
><a
|
||
class="reference internal"
|
||
href="#RNS.Channel.Channel"
|
||
title="RNS.Channel.Channel"
|
||
><span class="pre">Channel</span></a
|
||
></span
|
||
></em
|
||
><span class="sig-paren">)</span>
|
||
<span class="sig-return"
|
||
><span class="sig-return-icon">�</span>
|
||
<span class="sig-return-typehint"
|
||
><span class="pre">BufferedWriter</span></span
|
||
></span
|
||
><a
|
||
class="headerlink"
|
||
href="#RNS.Buffer.create_writer"
|
||
title="Link to this definition"
|
||
>¶</a
|
||
>
|
||
</dt>
|
||
<dd>
|
||
<p>
|
||
Create a buffered writer that writes binary data over a
|
||
<code class="docutils literal notranslate"
|
||
><span class="pre">Channel</span></code
|
||
>.
|
||
</p>
|
||
<p>
|
||
For more information on the writer-specific functions of this object, see
|
||
the Python documentation for
|
||
<code class="docutils literal notranslate"
|
||
><span class="pre">BufferedWriter</span></code
|
||
>
|
||
</p>
|
||
<dl class="field-list simple">
|
||
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
|
||
<dd class="field-odd">
|
||
<ul class="simple">
|
||
<li>
|
||
<p><strong>stream_id</strong> – the remote stream id to send to</p>
|
||
</li>
|
||
<li>
|
||
<p><strong>channel</strong> – the channel to send on</p>
|
||
</li>
|
||
</ul>
|
||
</dd>
|
||
<dt class="field-even">Returns<span class="colon">:</span></dt>
|
||
<dd class="field-even"><p>a BufferedWriter object</p></dd>
|
||
</dl>
|
||
</dd>
|
||
</dl>
|
||
|
||
<dl class="py method">
|
||
<dt class="sig sig-object py" id="RNS.Buffer.create_bidirectional_buffer">
|
||
<em class="property"
|
||
><span class="k"><span class="pre">static</span></span
|
||
><span class="w"> </span></em
|
||
><span class="sig-name descname"
|
||
><span class="pre">create_bidirectional_buffer</span></span
|
||
><span class="sig-paren">(</span
|
||
><em class="sig-param"
|
||
><span class="n"><span class="pre">receive_stream_id</span></span
|
||
><span class="p"><span class="pre">:</span></span
|
||
><span class="w"> </span
|
||
><span class="n"><span class="pre">int</span></span></em
|
||
>,
|
||
<em class="sig-param"
|
||
><span class="n"><span class="pre">send_stream_id</span></span
|
||
><span class="p"><span class="pre">:</span></span
|
||
><span class="w"> </span
|
||
><span class="n"><span class="pre">int</span></span></em
|
||
>,
|
||
<em class="sig-param"
|
||
><span class="n"><span class="pre">channel</span></span
|
||
><span class="p"><span class="pre">:</span></span
|
||
><span class="w"> </span
|
||
><span class="n"
|
||
><a
|
||
class="reference internal"
|
||
href="#RNS.Channel.Channel"
|
||
title="RNS.Channel.Channel"
|
||
><span class="pre">Channel</span></a
|
||
></span
|
||
></em
|
||
>,
|
||
<em class="sig-param"
|
||
><span class="n"><span class="pre">ready_callback</span></span
|
||
><span class="p"><span class="pre">:</span></span
|
||
><span class="w"> </span
|
||
><span class="n"
|
||
><span class="pre">Callable</span
|
||
><span class="p"><span class="pre">[</span></span
|
||
><span class="p"><span class="pre">[</span></span
|
||
><span class="pre">int</span
|
||
><span class="p"><span class="pre">]</span></span
|
||
><span class="p"><span class="pre">,</span></span
|
||
><span class="w"> </span><span class="pre">None</span
|
||
><span class="p"><span class="pre">]</span></span
|
||
><span class="w"> </span
|
||
><span class="p"><span class="pre">|</span></span
|
||
><span class="w"> </span><span class="pre">None</span></span
|
||
><span class="w"> </span><span class="o"><span class="pre">=</span></span
|
||
><span class="w"> </span
|
||
><span class="default_value"><span class="pre">None</span></span></em
|
||
><span class="sig-paren">)</span>
|
||
<span class="sig-return"
|
||
><span class="sig-return-icon">�</span>
|
||
<span class="sig-return-typehint"
|
||
><span class="pre">BufferedRWPair</span></span
|
||
></span
|
||
><a
|
||
class="headerlink"
|
||
href="#RNS.Buffer.create_bidirectional_buffer"
|
||
title="Link to this definition"
|
||
>¶</a
|
||
>
|
||
</dt>
|
||
<dd>
|
||
<p>
|
||
Create a buffered reader/writer pair that reads and writes binary data
|
||
over a
|
||
<code class="docutils literal notranslate"
|
||
><span class="pre">Channel</span></code
|
||
>, with an optional callback when new data is available.
|
||
</p>
|
||
<p>
|
||
Callback signature:
|
||
<code class="docutils literal notranslate"
|
||
><span class="pre">(ready_bytes:</span> <span class="pre">int)</span>
|
||
<span class="pre">-></span> <span class="pre">None</span></code
|
||
>
|
||
</p>
|
||
<p>
|
||
For more information on the reader-specific functions of this object, see
|
||
the Python documentation for
|
||
<code class="docutils literal notranslate"
|
||
><span class="pre">BufferedRWPair</span></code
|
||
>
|
||
</p>
|
||
<dl class="field-list simple">
|
||
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
|
||
<dd class="field-odd">
|
||
<ul class="simple">
|
||
<li>
|
||
<p>
|
||
<strong>receive_stream_id</strong> – the local stream id to
|
||
receive at
|
||
</p>
|
||
</li>
|
||
<li>
|
||
<p>
|
||
<strong>send_stream_id</strong> – the remote stream id to send to
|
||
</p>
|
||
</li>
|
||
<li>
|
||
<p><strong>channel</strong> – the channel to send and receive on</p>
|
||
</li>
|
||
<li>
|
||
<p>
|
||
<strong>ready_callback</strong> – function to call when new data
|
||
is available
|
||
</p>
|
||
</li>
|
||
</ul>
|
||
</dd>
|
||
<dt class="field-even">Returns<span class="colon">:</span></dt>
|
||
<dd class="field-even"><p>a BufferedRWPair object</p></dd>
|
||
</dl>
|
||
</dd>
|
||
</dl>
|
||
</dd>
|
||
</dl>
|
||
|
||
<p id="api-rawchannelreader"></p>
|
||
<h3>RawChannelReader</h3>
|
||
<p></p>
|
||
<dl class="py class">
|
||
<dt class="sig sig-object py" id="RNS.RawChannelReader">
|
||
<em class="property"
|
||
><span class="k"><span class="pre">class</span></span
|
||
><span class="w"> </span></em
|
||
><span class="sig-prename descclassname"><span class="pre">RNS.</span></span
|
||
><span class="sig-name descname"><span class="pre">RawChannelReader</span></span
|
||
><span class="sig-paren">(</span
|
||
><em class="sig-param"
|
||
><span class="n"><span class="pre">stream_id</span></span
|
||
><span class="p"><span class="pre">:</span></span
|
||
><span class="w"> </span
|
||
><span class="n"><span class="pre">int</span></span></em
|
||
>,
|
||
<em class="sig-param"
|
||
><span class="n"><span class="pre">channel</span></span
|
||
><span class="p"><span class="pre">:</span></span
|
||
><span class="w"> </span
|
||
><span class="n"
|
||
><a
|
||
class="reference internal"
|
||
href="#RNS.Channel.Channel"
|
||
title="RNS.Channel.Channel"
|
||
><span class="pre">Channel</span></a
|
||
></span
|
||
></em
|
||
><span class="sig-paren">)</span
|
||
><a
|
||
class="headerlink"
|
||
href="#RNS.RawChannelReader"
|
||
title="Link to this definition"
|
||
>¶</a
|
||
>
|
||
</dt>
|
||
<dd>
|
||
<p>
|
||
An implementation of RawIOBase that receives binary stream data sent over a
|
||
<code class="docutils literal notranslate"
|
||
><span class="pre">Channel</span></code
|
||
>.
|
||
</p>
|
||
<blockquote>
|
||
<div>
|
||
<p>
|
||
This class generally need not be instantiated directly. Use
|
||
<a
|
||
class="reference internal"
|
||
href="#RNS.Buffer.create_reader"
|
||
title="RNS.Buffer.create_reader"
|
||
><code class="xref py py-func docutils literal notranslate"
|
||
><span class="pre">RNS.Buffer.create_reader()</span></code
|
||
></a
|
||
>,
|
||
<a
|
||
class="reference internal"
|
||
href="#RNS.Buffer.create_writer"
|
||
title="RNS.Buffer.create_writer"
|
||
><code class="xref py py-func docutils literal notranslate"
|
||
><span class="pre">RNS.Buffer.create_writer()</span></code
|
||
></a
|
||
>, and
|
||
<a
|
||
class="reference internal"
|
||
href="#RNS.Buffer.create_bidirectional_buffer"
|
||
title="RNS.Buffer.create_bidirectional_buffer"
|
||
><code class="xref py py-func docutils literal notranslate"
|
||
><span class="pre"
|
||
>RNS.Buffer.create_bidirectional_buffer()</span
|
||
></code
|
||
></a
|
||
>
|
||
functions to create buffered streams with optional callbacks.
|
||
</p>
|
||
<p>
|
||
For additional information on the API of this object, see the Python
|
||
documentation for
|
||
<code class="docutils literal notranslate"
|
||
><span class="pre">RawIOBase</span></code
|
||
>.
|
||
</p>
|
||
</div>
|
||
</blockquote>
|
||
<dl class="py method">
|
||
<dt class="sig sig-object py" id="RNS.RawChannelReader.__init__">
|
||
<span class="sig-name descname"><span class="pre">__init__</span></span
|
||
><span class="sig-paren">(</span
|
||
><em class="sig-param"
|
||
><span class="n"><span class="pre">stream_id</span></span
|
||
><span class="p"><span class="pre">:</span></span
|
||
><span class="w"> </span
|
||
><span class="n"><span class="pre">int</span></span></em
|
||
>,
|
||
<em class="sig-param"
|
||
><span class="n"><span class="pre">channel</span></span
|
||
><span class="p"><span class="pre">:</span></span
|
||
><span class="w"> </span
|
||
><span class="n"
|
||
><a
|
||
class="reference internal"
|
||
href="#RNS.Channel.Channel"
|
||
title="RNS.Channel.Channel"
|
||
><span class="pre">Channel</span></a
|
||
></span
|
||
></em
|
||
><span class="sig-paren">)</span
|
||
><a
|
||
class="headerlink"
|
||
href="#RNS.RawChannelReader.__init__"
|
||
title="Link to this definition"
|
||
>¶</a
|
||
>
|
||
</dt>
|
||
<dd>
|
||
<p>Create a raw channel reader.</p>
|
||
<dl class="field-list simple">
|
||
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
|
||
<dd class="field-odd">
|
||
<ul class="simple">
|
||
<li>
|
||
<p><strong>stream_id</strong> – local stream id to receive at</p>
|
||
</li>
|
||
<li>
|
||
<p>
|
||
<strong>channel</strong> –
|
||
<code class="docutils literal notranslate"
|
||
><span class="pre">Channel</span></code
|
||
>
|
||
object to receive from
|
||
</p>
|
||
</li>
|
||
</ul>
|
||
</dd>
|
||
</dl>
|
||
</dd>
|
||
</dl>
|
||
|
||
<dl class="py method">
|
||
<dt class="sig sig-object py" id="RNS.RawChannelReader.add_ready_callback">
|
||
<span class="sig-name descname"
|
||
><span class="pre">add_ready_callback</span></span
|
||
><span class="sig-paren">(</span
|
||
><em class="sig-param"
|
||
><span class="n"><span class="pre">cb</span></span
|
||
><span class="p"><span class="pre">:</span></span
|
||
><span class="w"> </span
|
||
><span class="n"
|
||
><span class="pre">Callable</span
|
||
><span class="p"><span class="pre">[</span></span
|
||
><span class="p"><span class="pre">[</span></span
|
||
><span class="pre">int</span
|
||
><span class="p"><span class="pre">]</span></span
|
||
><span class="p"><span class="pre">,</span></span
|
||
><span class="w"> </span><span class="pre">None</span
|
||
><span class="p"><span class="pre">]</span></span></span
|
||
></em
|
||
><span class="sig-paren">)</span
|
||
><a
|
||
class="headerlink"
|
||
href="#RNS.RawChannelReader.add_ready_callback"
|
||
title="Link to this definition"
|
||
>¶</a
|
||
>
|
||
</dt>
|
||
<dd>
|
||
<p>
|
||
Add a function to be called when new data is available. The function
|
||
should have the signature
|
||
<code class="docutils literal notranslate"
|
||
><span class="pre">(ready_bytes:</span> <span class="pre">int)</span>
|
||
<span class="pre">-></span> <span class="pre">None</span></code
|
||
>
|
||
</p>
|
||
<dl class="field-list simple">
|
||
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
|
||
<dd class="field-odd">
|
||
<p><strong>cb</strong> – function to call</p>
|
||
</dd>
|
||
</dl>
|
||
</dd>
|
||
</dl>
|
||
|
||
<dl class="py method">
|
||
<dt class="sig sig-object py" id="RNS.RawChannelReader.remove_ready_callback">
|
||
<span class="sig-name descname"
|
||
><span class="pre">remove_ready_callback</span></span
|
||
><span class="sig-paren">(</span
|
||
><em class="sig-param"
|
||
><span class="n"><span class="pre">cb</span></span
|
||
><span class="p"><span class="pre">:</span></span
|
||
><span class="w"> </span
|
||
><span class="n"
|
||
><span class="pre">Callable</span
|
||
><span class="p"><span class="pre">[</span></span
|
||
><span class="p"><span class="pre">[</span></span
|
||
><span class="pre">int</span
|
||
><span class="p"><span class="pre">]</span></span
|
||
><span class="p"><span class="pre">,</span></span
|
||
><span class="w"> </span><span class="pre">None</span
|
||
><span class="p"><span class="pre">]</span></span></span
|
||
></em
|
||
><span class="sig-paren">)</span
|
||
><a
|
||
class="headerlink"
|
||
href="#RNS.RawChannelReader.remove_ready_callback"
|
||
title="Link to this definition"
|
||
>¶</a
|
||
>
|
||
</dt>
|
||
<dd>
|
||
<p>
|
||
Remove a function added with
|
||
<a
|
||
class="reference internal"
|
||
href="#RNS.RawChannelReader.add_ready_callback"
|
||
title="RNS.RawChannelReader.add_ready_callback"
|
||
><code class="xref py py-func docutils literal notranslate"
|
||
><span class="pre"
|
||
>RNS.RawChannelReader.add_ready_callback()</span
|
||
></code
|
||
></a
|
||
>
|
||
</p>
|
||
<dl class="field-list simple">
|
||
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
|
||
<dd class="field-odd">
|
||
<p><strong>cb</strong> – function to remove</p>
|
||
</dd>
|
||
</dl>
|
||
</dd>
|
||
</dl>
|
||
</dd>
|
||
</dl>
|
||
|
||
<p id="api-rawchannelwriter"></p>
|
||
<h3>RawChannelWriter</h3>
|
||
<p></p>
|
||
<dl class="py class">
|
||
<dt class="sig sig-object py" id="RNS.RawChannelWriter">
|
||
<em class="property"
|
||
><span class="k"><span class="pre">class</span></span
|
||
><span class="w"> </span></em
|
||
><span class="sig-prename descclassname"><span class="pre">RNS.</span></span
|
||
><span class="sig-name descname"><span class="pre">RawChannelWriter</span></span
|
||
><span class="sig-paren">(</span
|
||
><em class="sig-param"
|
||
><span class="n"><span class="pre">stream_id</span></span
|
||
><span class="p"><span class="pre">:</span></span
|
||
><span class="w"> </span
|
||
><span class="n"><span class="pre">int</span></span></em
|
||
>,
|
||
<em class="sig-param"
|
||
><span class="n"><span class="pre">channel</span></span
|
||
><span class="p"><span class="pre">:</span></span
|
||
><span class="w"> </span
|
||
><span class="n"
|
||
><a
|
||
class="reference internal"
|
||
href="#RNS.Channel.Channel"
|
||
title="RNS.Channel.Channel"
|
||
><span class="pre">Channel</span></a
|
||
></span
|
||
></em
|
||
><span class="sig-paren">)</span
|
||
><a
|
||
class="headerlink"
|
||
href="#RNS.RawChannelWriter"
|
||
title="Link to this definition"
|
||
>¶</a
|
||
>
|
||
</dt>
|
||
<dd>
|
||
<p>
|
||
An implementation of RawIOBase that receives binary stream data sent over a
|
||
channel.
|
||
</p>
|
||
<blockquote>
|
||
<div>
|
||
<p>
|
||
This class generally need not be instantiated directly. Use
|
||
<a
|
||
class="reference internal"
|
||
href="#RNS.Buffer.create_reader"
|
||
title="RNS.Buffer.create_reader"
|
||
><code class="xref py py-func docutils literal notranslate"
|
||
><span class="pre">RNS.Buffer.create_reader()</span></code
|
||
></a
|
||
>,
|
||
<a
|
||
class="reference internal"
|
||
href="#RNS.Buffer.create_writer"
|
||
title="RNS.Buffer.create_writer"
|
||
><code class="xref py py-func docutils literal notranslate"
|
||
><span class="pre">RNS.Buffer.create_writer()</span></code
|
||
></a
|
||
>, and
|
||
<a
|
||
class="reference internal"
|
||
href="#RNS.Buffer.create_bidirectional_buffer"
|
||
title="RNS.Buffer.create_bidirectional_buffer"
|
||
><code class="xref py py-func docutils literal notranslate"
|
||
><span class="pre"
|
||
>RNS.Buffer.create_bidirectional_buffer()</span
|
||
></code
|
||
></a
|
||
>
|
||
functions to create buffered streams with optional callbacks.
|
||
</p>
|
||
<p>
|
||
For additional information on the API of this object, see the Python
|
||
documentation for
|
||
<code class="docutils literal notranslate"
|
||
><span class="pre">RawIOBase</span></code
|
||
>.
|
||
</p>
|
||
</div>
|
||
</blockquote>
|
||
<dl class="py method">
|
||
<dt class="sig sig-object py" id="RNS.RawChannelWriter.__init__">
|
||
<span class="sig-name descname"><span class="pre">__init__</span></span
|
||
><span class="sig-paren">(</span
|
||
><em class="sig-param"
|
||
><span class="n"><span class="pre">stream_id</span></span
|
||
><span class="p"><span class="pre">:</span></span
|
||
><span class="w"> </span
|
||
><span class="n"><span class="pre">int</span></span></em
|
||
>,
|
||
<em class="sig-param"
|
||
><span class="n"><span class="pre">channel</span></span
|
||
><span class="p"><span class="pre">:</span></span
|
||
><span class="w"> </span
|
||
><span class="n"
|
||
><a
|
||
class="reference internal"
|
||
href="#RNS.Channel.Channel"
|
||
title="RNS.Channel.Channel"
|
||
><span class="pre">Channel</span></a
|
||
></span
|
||
></em
|
||
><span class="sig-paren">)</span
|
||
><a
|
||
class="headerlink"
|
||
href="#RNS.RawChannelWriter.__init__"
|
||
title="Link to this definition"
|
||
>¶</a
|
||
>
|
||
</dt>
|
||
<dd>
|
||
<p>Create a raw channel writer.</p>
|
||
<dl class="field-list simple">
|
||
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
|
||
<dd class="field-odd">
|
||
<ul class="simple">
|
||
<li>
|
||
<p><strong>stream_id</strong> – remote stream id to sent do</p>
|
||
</li>
|
||
<li>
|
||
<p>
|
||
<strong>channel</strong> –
|
||
<code class="docutils literal notranslate"
|
||
><span class="pre">Channel</span></code
|
||
>
|
||
object to send on
|
||
</p>
|
||
</li>
|
||
</ul>
|
||
</dd>
|
||
</dl>
|
||
</dd>
|
||
</dl>
|
||
</dd>
|
||
</dl>
|
||
|
||
<p id="api-transport"></p>
|
||
<h3>Transport</h3>
|
||
<p></p>
|
||
<dl class="py class">
|
||
<dt class="sig sig-object py" id="RNS.Transport">
|
||
<em class="property"
|
||
><span class="k"><span class="pre">class</span></span
|
||
><span class="w"> </span></em
|
||
><span class="sig-prename descclassname"><span class="pre">RNS.</span></span
|
||
><span class="sig-name descname"><span class="pre">Transport</span></span
|
||
><a class="headerlink" href="#RNS.Transport" title="Link to this definition"
|
||
>¶</a
|
||
>
|
||
</dt>
|
||
<dd>
|
||
<p>
|
||
Through static methods of this class you can interact with the Transport
|
||
system of Reticulum.
|
||
</p>
|
||
<dl class="py attribute">
|
||
<dt class="sig sig-object py" id="RNS.Transport.PATHFINDER_M">
|
||
<span class="sig-name descname"><span class="pre">PATHFINDER_M</span></span
|
||
><em class="property"
|
||
><span class="w"> </span><span class="p"><span class="pre">=</span></span
|
||
><span class="w"> </span><span class="pre">128</span></em
|
||
><a
|
||
class="headerlink"
|
||
href="#RNS.Transport.PATHFINDER_M"
|
||
title="Link to this definition"
|
||
>¶</a
|
||
>
|
||
</dt>
|
||
<dd><p>Maximum amount of hops that Reticulum will transport a packet.</p></dd>
|
||
</dl>
|
||
|
||
<dl class="py method">
|
||
<dt class="sig sig-object py" id="RNS.Transport.register_announce_handler">
|
||
<em class="property"
|
||
><span class="k"><span class="pre">static</span></span
|
||
><span class="w"> </span></em
|
||
><span class="sig-name descname"
|
||
><span class="pre">register_announce_handler</span></span
|
||
><span class="sig-paren">(</span
|
||
><em class="sig-param"
|
||
><span class="n"><span class="pre">handler</span></span></em
|
||
><span class="sig-paren">)</span
|
||
><a
|
||
class="headerlink"
|
||
href="#RNS.Transport.register_announce_handler"
|
||
title="Link to this definition"
|
||
>¶</a
|
||
>
|
||
</dt>
|
||
<dd>
|
||
<p>Registers an announce handler.</p>
|
||
<dl class="field-list simple">
|
||
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
|
||
<dd class="field-odd">
|
||
<p>
|
||
<strong>handler</strong> – Must be an object with an
|
||
<em>aspect_filter</em> attribute and a
|
||
<em
|
||
>received_announce(destination_hash, announced_identity,
|
||
app_data)</em
|
||
>
|
||
or
|
||
<em
|
||
>received_announce(destination_hash, announced_identity, app_data,
|
||
announce_packet_hash)</em
|
||
>
|
||
or
|
||
<em
|
||
>received_announce(destination_hash, announced_identity, app_data,
|
||
announce_packet_hash, is_path_response)</em
|
||
>
|
||
callable. Can optionally have a
|
||
<em>receive_path_responses</em> attribute set to
|
||
<code class="docutils literal notranslate"
|
||
><span class="pre">True</span></code
|
||
>, to also receive all path responses, in addition to live announces.
|
||
See the
|
||
<a class="reference internal" href="examples.html#example-announce"
|
||
><span class="std std-ref">Announce Example</span></a
|
||
>
|
||
for more info.
|
||
</p>
|
||
</dd>
|
||
</dl>
|
||
</dd>
|
||
</dl>
|
||
|
||
<dl class="py method">
|
||
<dt class="sig sig-object py" id="RNS.Transport.deregister_announce_handler">
|
||
<em class="property"
|
||
><span class="k"><span class="pre">static</span></span
|
||
><span class="w"> </span></em
|
||
><span class="sig-name descname"
|
||
><span class="pre">deregister_announce_handler</span></span
|
||
><span class="sig-paren">(</span
|
||
><em class="sig-param"
|
||
><span class="n"><span class="pre">handler</span></span></em
|
||
><span class="sig-paren">)</span
|
||
><a
|
||
class="headerlink"
|
||
href="#RNS.Transport.deregister_announce_handler"
|
||
title="Link to this definition"
|
||
>¶</a
|
||
>
|
||
</dt>
|
||
<dd>
|
||
<p>Deregisters an announce handler.</p>
|
||
<dl class="field-list simple">
|
||
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
|
||
<dd class="field-odd">
|
||
<p>
|
||
<strong>handler</strong> – The announce handler to be deregistered.
|
||
</p>
|
||
</dd>
|
||
</dl>
|
||
</dd>
|
||
</dl>
|
||
|
||
<dl class="py method">
|
||
<dt class="sig sig-object py" id="RNS.Transport.has_path">
|
||
<em class="property"
|
||
><span class="k"><span class="pre">static</span></span
|
||
><span class="w"> </span></em
|
||
><span class="sig-name descname"><span class="pre">has_path</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.Transport.has_path"
|
||
title="Link to this definition"
|
||
>¶</a
|
||
>
|
||
</dt>
|
||
<dd>
|
||
<dl class="field-list simple">
|
||
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
|
||
<dd class="field-odd">
|
||
<p>
|
||
<strong>destination_hash</strong> – A destination hash as
|
||
<em>bytes</em>.
|
||
</p>
|
||
</dd>
|
||
<dt class="field-even">Returns<span class="colon">:</span></dt>
|
||
<dd class="field-even">
|
||
<p>
|
||
<em>True</em> if a path to the destination is known, otherwise
|
||
<em>False</em>.
|
||
</p>
|
||
</dd>
|
||
</dl>
|
||
</dd>
|
||
</dl>
|
||
|
||
<dl class="py method">
|
||
<dt class="sig sig-object py" id="RNS.Transport.hops_to">
|
||
<em class="property"
|
||
><span class="k"><span class="pre">static</span></span
|
||
><span class="w"> </span></em
|
||
><span class="sig-name descname"><span class="pre">hops_to</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.Transport.hops_to"
|
||
title="Link to this definition"
|
||
>¶</a
|
||
>
|
||
</dt>
|
||
<dd>
|
||
<dl class="field-list simple">
|
||
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
|
||
<dd class="field-odd">
|
||
<p>
|
||
<strong>destination_hash</strong> – A destination hash as
|
||
<em>bytes</em>.
|
||
</p>
|
||
</dd>
|
||
<dt class="field-even">Returns<span class="colon">:</span></dt>
|
||
<dd class="field-even">
|
||
<p>
|
||
The number of hops to the specified destination, or
|
||
<code class="docutils literal notranslate"
|
||
><span class="pre">RNS.Transport.PATHFINDER_M</span></code
|
||
>
|
||
if the number of hops is unknown.
|
||
</p>
|
||
</dd>
|
||
</dl>
|
||
</dd>
|
||
</dl>
|
||
|
||
<dl class="py method">
|
||
<dt class="sig sig-object py" id="RNS.Transport.next_hop">
|
||
<em class="property"
|
||
><span class="k"><span class="pre">static</span></span
|
||
><span class="w"> </span></em
|
||
><span class="sig-name descname"><span class="pre">next_hop</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.Transport.next_hop"
|
||
title="Link to this definition"
|
||
>¶</a
|
||
>
|
||
</dt>
|
||
<dd>
|
||
<dl class="field-list simple">
|
||
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
|
||
<dd class="field-odd">
|
||
<p>
|
||
<strong>destination_hash</strong> – A destination hash as
|
||
<em>bytes</em>.
|
||
</p>
|
||
</dd>
|
||
<dt class="field-even">Returns<span class="colon">:</span></dt>
|
||
<dd class="field-even">
|
||
<p>
|
||
The destination hash as <em>bytes</em> for the next hop to the
|
||
specified destination, or <em>None</em> if the next hop is unknown.
|
||
</p>
|
||
</dd>
|
||
</dl>
|
||
</dd>
|
||
</dl>
|
||
|
||
<dl class="py method">
|
||
<dt class="sig sig-object py" id="RNS.Transport.next_hop_interface">
|
||
<em class="property"
|
||
><span class="k"><span class="pre">static</span></span
|
||
><span class="w"> </span></em
|
||
><span class="sig-name descname"
|
||
><span class="pre">next_hop_interface</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.Transport.next_hop_interface"
|
||
title="Link to this definition"
|
||
>¶</a
|
||
>
|
||
</dt>
|
||
<dd>
|
||
<dl class="field-list simple">
|
||
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
|
||
<dd class="field-odd">
|
||
<p>
|
||
<strong>destination_hash</strong> – A destination hash as
|
||
<em>bytes</em>.
|
||
</p>
|
||
</dd>
|
||
<dt class="field-even">Returns<span class="colon">:</span></dt>
|
||
<dd class="field-even">
|
||
<p>
|
||
The interface for the next hop to the specified destination, or
|
||
<em>None</em> if the interface is unknown.
|
||
</p>
|
||
</dd>
|
||
</dl>
|
||
</dd>
|
||
</dl>
|
||
|
||
<dl class="py method">
|
||
<dt class="sig sig-object py" id="RNS.Transport.request_path">
|
||
<em class="property"
|
||
><span class="k"><span class="pre">static</span></span
|
||
><span class="w"> </span></em
|
||
><span class="sig-name descname"><span class="pre">request_path</span></span
|
||
><span class="sig-paren">(</span
|
||
><em class="sig-param"
|
||
><span class="n"><span class="pre">destination_hash</span></span></em
|
||
>,
|
||
<em class="sig-param"
|
||
><span class="n"><span class="pre">on_interface</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">tag</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">recursive</span></span
|
||
><span class="o"><span class="pre">=</span></span
|
||
><span class="default_value"><span class="pre">False</span></span></em
|
||
><span class="sig-paren">)</span
|
||
><a
|
||
class="headerlink"
|
||
href="#RNS.Transport.request_path"
|
||
title="Link to this definition"
|
||
>¶</a
|
||
>
|
||
</dt>
|
||
<dd>
|
||
<p>
|
||
Requests a path to the destination from the network. If another reachable
|
||
peer on the network knows a path, it will announce it.
|
||
</p>
|
||
<dl class="field-list simple">
|
||
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
|
||
<dd class="field-odd">
|
||
<ul class="simple">
|
||
<li>
|
||
<p>
|
||
<strong>destination_hash</strong> – A destination hash as
|
||
<em>bytes</em>.
|
||
</p>
|
||
</li>
|
||
<li>
|
||
<p>
|
||
<strong>on_interface</strong> – If specified, the path request
|
||
will only be sent on this interface. In normal use, Reticulum
|
||
handles this automatically, and this parameter should not be used.
|
||
</p>
|
||
</li>
|
||
</ul>
|
||
</dd>
|
||
</dl>
|
||
</dd>
|
||
</dl>
|
||
</dd>
|
||
</dl>
|
||
</section>
|
||
</article>
|
||
</div>
|
||
<footer>
|
||
<div class="related-pages">
|
||
<a class="prev-page" href="examples.html">
|
||
<svg class="furo-related-icon"><use href="#svg-arrow-right"></use></svg>
|
||
<div class="page-info">
|
||
<div class="context">
|
||
<span>Previous</span>
|
||
</div>
|
||
|
||
<div class="title">Code Examples</div>
|
||
</div>
|
||
</a>
|
||
</div>
|
||
<div class="bottom-of-page">
|
||
<div class="left-details">
|
||
<div class="copyright">Copyright © 2025, Mark Qvist</div>
|
||
Официальный сайт проекта <a href="https://reticulum.network" target="_blank" rel="noopener">Reticulum.network</a><br>
|
||
Официальный репозиторий на <a href="https://github.com/markqvist/reticulum" target="_blank" rel="noopener">GitHub</a>
|
||
</div>
|
||
<div class="right-details"></div>
|
||
</div>
|
||
</footer>
|
||
</div>
|
||
<aside class="toc-drawer">
|
||
<div class="toc-sticky toc-scroll">
|
||
<div class="toc-title-container">
|
||
<a class="toc-title" href="../index.html"> 🌏 HOME </a>
|
||
</div>
|
||
<div class="toc-title-container">
|
||
<span class="toc-title"> On this page </span>
|
||
</div>
|
||
<div class="toc-tree-container">
|
||
<div class="toc-tree">
|
||
<ul>
|
||
<li>
|
||
<a class="reference internal" href="#">API Reference</a>
|
||
<ul>
|
||
<li>
|
||
<a class="reference internal" href="#RNS.Reticulum"
|
||
><code class="docutils literal notranslate"
|
||
><span class="pre">Reticulum</span></code
|
||
></a
|
||
>
|
||
<ul>
|
||
<li>
|
||
<a class="reference internal" href="#RNS.Reticulum.MTU"
|
||
><code class="docutils literal notranslate"
|
||
><span class="pre">MTU</span></code
|
||
></a
|
||
>
|
||
</li>
|
||
<li>
|
||
<a class="reference internal" href="#RNS.Reticulum.LINK_MTU_DISCOVERY"
|
||
><code class="docutils literal notranslate"
|
||
><span class="pre">LINK_MTU_DISCOVERY</span></code
|
||
></a
|
||
>
|
||
</li>
|
||
<li>
|
||
<a class="reference internal" href="#RNS.Reticulum.ANNOUNCE_CAP"
|
||
><code class="docutils literal notranslate"
|
||
><span class="pre">ANNOUNCE_CAP</span></code
|
||
></a
|
||
>
|
||
</li>
|
||
<li>
|
||
<a class="reference internal" href="#RNS.Reticulum.MINIMUM_BITRATE"
|
||
><code class="docutils literal notranslate"
|
||
><span class="pre">MINIMUM_BITRATE</span></code
|
||
></a
|
||
>
|
||
</li>
|
||
<li>
|
||
<a class="reference internal" href="#RNS.Reticulum.get_instance"
|
||
><code class="docutils literal notranslate"
|
||
><span class="pre">get_instance()</span></code
|
||
></a
|
||
>
|
||
</li>
|
||
<li>
|
||
<a
|
||
class="reference internal"
|
||
href="#RNS.Reticulum.should_use_implicit_proof"
|
||
><code class="docutils literal notranslate"
|
||
><span class="pre">should_use_implicit_proof()</span></code
|
||
></a
|
||
>
|
||
</li>
|
||
<li>
|
||
<a class="reference internal" href="#RNS.Reticulum.transport_enabled"
|
||
><code class="docutils literal notranslate"
|
||
><span class="pre">transport_enabled()</span></code
|
||
></a
|
||
>
|
||
</li>
|
||
<li>
|
||
<a class="reference internal" href="#RNS.Reticulum.link_mtu_discovery"
|
||
><code class="docutils literal notranslate"
|
||
><span class="pre">link_mtu_discovery()</span></code
|
||
></a
|
||
>
|
||
</li>
|
||
<li>
|
||
<a
|
||
class="reference internal"
|
||
href="#RNS.Reticulum.remote_management_enabled"
|
||
><code class="docutils literal notranslate"
|
||
><span class="pre">remote_management_enabled()</span></code
|
||
></a
|
||
>
|
||
</li>
|
||
</ul>
|
||
</li>
|
||
<li>
|
||
<a class="reference internal" href="#RNS.Identity"
|
||
><code class="docutils literal notranslate"
|
||
><span class="pre">Identity</span></code
|
||
></a
|
||
>
|
||
<ul>
|
||
<li>
|
||
<a class="reference internal" href="#RNS.Identity.CURVE"
|
||
><code class="docutils literal notranslate"
|
||
><span class="pre">CURVE</span></code
|
||
></a
|
||
>
|
||
</li>
|
||
<li>
|
||
<a class="reference internal" href="#RNS.Identity.KEYSIZE"
|
||
><code class="docutils literal notranslate"
|
||
><span class="pre">KEYSIZE</span></code
|
||
></a
|
||
>
|
||
</li>
|
||
<li>
|
||
<a class="reference internal" href="#RNS.Identity.RATCHETSIZE"
|
||
><code class="docutils literal notranslate"
|
||
><span class="pre">RATCHETSIZE</span></code
|
||
></a
|
||
>
|
||
</li>
|
||
<li>
|
||
<a class="reference internal" href="#RNS.Identity.RATCHET_EXPIRY"
|
||
><code class="docutils literal notranslate"
|
||
><span class="pre">RATCHET_EXPIRY</span></code
|
||
></a
|
||
>
|
||
</li>
|
||
<li>
|
||
<a class="reference internal" href="#RNS.Identity.TRUNCATED_HASHLENGTH"
|
||
><code class="docutils literal notranslate"
|
||
><span class="pre">TRUNCATED_HASHLENGTH</span></code
|
||
></a
|
||
>
|
||
</li>
|
||
<li>
|
||
<a class="reference internal" href="#RNS.Identity.recall"
|
||
><code class="docutils literal notranslate"
|
||
><span class="pre">recall()</span></code
|
||
></a
|
||
>
|
||
</li>
|
||
<li>
|
||
<a class="reference internal" href="#RNS.Identity.recall_app_data"
|
||
><code class="docutils literal notranslate"
|
||
><span class="pre">recall_app_data()</span></code
|
||
></a
|
||
>
|
||
</li>
|
||
<li>
|
||
<a class="reference internal" href="#RNS.Identity.full_hash"
|
||
><code class="docutils literal notranslate"
|
||
><span class="pre">full_hash()</span></code
|
||
></a
|
||
>
|
||
</li>
|
||
<li>
|
||
<a class="reference internal" href="#RNS.Identity.truncated_hash"
|
||
><code class="docutils literal notranslate"
|
||
><span class="pre">truncated_hash()</span></code
|
||
></a
|
||
>
|
||
</li>
|
||
<li>
|
||
<a class="reference internal" href="#RNS.Identity.get_random_hash"
|
||
><code class="docutils literal notranslate"
|
||
><span class="pre">get_random_hash()</span></code
|
||
></a
|
||
>
|
||
</li>
|
||
<li>
|
||
<a class="reference internal" href="#RNS.Identity.current_ratchet_id"
|
||
><code class="docutils literal notranslate"
|
||
><span class="pre">current_ratchet_id()</span></code
|
||
></a
|
||
>
|
||
</li>
|
||
<li>
|
||
<a class="reference internal" href="#RNS.Identity.from_bytes"
|
||
><code class="docutils literal notranslate"
|
||
><span class="pre">from_bytes()</span></code
|
||
></a
|
||
>
|
||
</li>
|
||
<li>
|
||
<a class="reference internal" href="#RNS.Identity.from_file"
|
||
><code class="docutils literal notranslate"
|
||
><span class="pre">from_file()</span></code
|
||
></a
|
||
>
|
||
</li>
|
||
<li>
|
||
<a class="reference internal" href="#RNS.Identity.to_file"
|
||
><code class="docutils literal notranslate"
|
||
><span class="pre">to_file()</span></code
|
||
></a
|
||
>
|
||
</li>
|
||
<li>
|
||
<a class="reference internal" href="#RNS.Identity.get_private_key"
|
||
><code class="docutils literal notranslate"
|
||
><span class="pre">get_private_key()</span></code
|
||
></a
|
||
>
|
||
</li>
|
||
<li>
|
||
<a class="reference internal" href="#RNS.Identity.get_public_key"
|
||
><code class="docutils literal notranslate"
|
||
><span class="pre">get_public_key()</span></code
|
||
></a
|
||
>
|
||
</li>
|
||
<li>
|
||
<a class="reference internal" href="#RNS.Identity.load_private_key"
|
||
><code class="docutils literal notranslate"
|
||
><span class="pre">load_private_key()</span></code
|
||
></a
|
||
>
|
||
</li>
|
||
<li>
|
||
<a class="reference internal" href="#RNS.Identity.load_public_key"
|
||
><code class="docutils literal notranslate"
|
||
><span class="pre">load_public_key()</span></code
|
||
></a
|
||
>
|
||
</li>
|
||
<li>
|
||
<a class="reference internal" href="#RNS.Identity.encrypt"
|
||
><code class="docutils literal notranslate"
|
||
><span class="pre">encrypt()</span></code
|
||
></a
|
||
>
|
||
</li>
|
||
<li>
|
||
<a class="reference internal" href="#RNS.Identity.decrypt"
|
||
><code class="docutils literal notranslate"
|
||
><span class="pre">decrypt()</span></code
|
||
></a
|
||
>
|
||
</li>
|
||
<li>
|
||
<a class="reference internal" href="#RNS.Identity.sign"
|
||
><code class="docutils literal notranslate"
|
||
><span class="pre">sign()</span></code
|
||
></a
|
||
>
|
||
</li>
|
||
<li>
|
||
<a class="reference internal" href="#RNS.Identity.validate"
|
||
><code class="docutils literal notranslate"
|
||
><span class="pre">validate()</span></code
|
||
></a
|
||
>
|
||
</li>
|
||
</ul>
|
||
</li>
|
||
<li>
|
||
<a class="reference internal" href="#RNS.Destination"
|
||
><code class="docutils literal notranslate"
|
||
><span class="pre">Destination</span></code
|
||
></a
|
||
>
|
||
<ul>
|
||
<li>
|
||
<a class="reference internal" href="#RNS.Destination.RATCHET_COUNT"
|
||
><code class="docutils literal notranslate"
|
||
><span class="pre">RATCHET_COUNT</span></code
|
||
></a
|
||
>
|
||
</li>
|
||
<li>
|
||
<a class="reference internal" href="#RNS.Destination.RATCHET_INTERVAL"
|
||
><code class="docutils literal notranslate"
|
||
><span class="pre">RATCHET_INTERVAL</span></code
|
||
></a
|
||
>
|
||
</li>
|
||
<li>
|
||
<a class="reference internal" href="#RNS.Destination.expand_name"
|
||
><code class="docutils literal notranslate"
|
||
><span class="pre">expand_name()</span></code
|
||
></a
|
||
>
|
||
</li>
|
||
<li>
|
||
<a
|
||
class="reference internal"
|
||
href="#RNS.Destination.app_and_aspects_from_name"
|
||
><code class="docutils literal notranslate"
|
||
><span class="pre">app_and_aspects_from_name()</span></code
|
||
></a
|
||
>
|
||
</li>
|
||
<li>
|
||
<a
|
||
class="reference internal"
|
||
href="#RNS.Destination.hash_from_name_and_identity"
|
||
><code class="docutils literal notranslate"
|
||
><span class="pre">hash_from_name_and_identity()</span></code
|
||
></a
|
||
>
|
||
</li>
|
||
<li>
|
||
<a class="reference internal" href="#RNS.Destination.hash"
|
||
><code class="docutils literal notranslate"
|
||
><span class="pre">hash()</span></code
|
||
></a
|
||
>
|
||
</li>
|
||
<li>
|
||
<a class="reference internal" href="#RNS.Destination.announce"
|
||
><code class="docutils literal notranslate"
|
||
><span class="pre">announce()</span></code
|
||
></a
|
||
>
|
||
</li>
|
||
<li>
|
||
<a class="reference internal" href="#RNS.Destination.accepts_links"
|
||
><code class="docutils literal notranslate"
|
||
><span class="pre">accepts_links()</span></code
|
||
></a
|
||
>
|
||
</li>
|
||
<li>
|
||
<a
|
||
class="reference internal"
|
||
href="#RNS.Destination.set_link_established_callback"
|
||
><code class="docutils literal notranslate"
|
||
><span class="pre">set_link_established_callback()</span></code
|
||
></a
|
||
>
|
||
</li>
|
||
<li>
|
||
<a
|
||
class="reference internal"
|
||
href="#RNS.Destination.set_packet_callback"
|
||
><code class="docutils literal notranslate"
|
||
><span class="pre">set_packet_callback()</span></code
|
||
></a
|
||
>
|
||
</li>
|
||
<li>
|
||
<a
|
||
class="reference internal"
|
||
href="#RNS.Destination.set_proof_requested_callback"
|
||
><code class="docutils literal notranslate"
|
||
><span class="pre">set_proof_requested_callback()</span></code
|
||
></a
|
||
>
|
||
</li>
|
||
<li>
|
||
<a class="reference internal" href="#RNS.Destination.set_proof_strategy"
|
||
><code class="docutils literal notranslate"
|
||
><span class="pre">set_proof_strategy()</span></code
|
||
></a
|
||
>
|
||
</li>
|
||
<li>
|
||
<a
|
||
class="reference internal"
|
||
href="#RNS.Destination.register_request_handler"
|
||
><code class="docutils literal notranslate"
|
||
><span class="pre">register_request_handler()</span></code
|
||
></a
|
||
>
|
||
</li>
|
||
<li>
|
||
<a
|
||
class="reference internal"
|
||
href="#RNS.Destination.deregister_request_handler"
|
||
><code class="docutils literal notranslate"
|
||
><span class="pre">deregister_request_handler()</span></code
|
||
></a
|
||
>
|
||
</li>
|
||
<li>
|
||
<a class="reference internal" href="#RNS.Destination.enable_ratchets"
|
||
><code class="docutils literal notranslate"
|
||
><span class="pre">enable_ratchets()</span></code
|
||
></a
|
||
>
|
||
</li>
|
||
<li>
|
||
<a class="reference internal" href="#RNS.Destination.enforce_ratchets"
|
||
><code class="docutils literal notranslate"
|
||
><span class="pre">enforce_ratchets()</span></code
|
||
></a
|
||
>
|
||
</li>
|
||
<li>
|
||
<a
|
||
class="reference internal"
|
||
href="#RNS.Destination.set_retained_ratchets"
|
||
><code class="docutils literal notranslate"
|
||
><span class="pre">set_retained_ratchets()</span></code
|
||
></a
|
||
>
|
||
</li>
|
||
<li>
|
||
<a
|
||
class="reference internal"
|
||
href="#RNS.Destination.set_ratchet_interval"
|
||
><code class="docutils literal notranslate"
|
||
><span class="pre">set_ratchet_interval()</span></code
|
||
></a
|
||
>
|
||
</li>
|
||
<li>
|
||
<a class="reference internal" href="#RNS.Destination.create_keys"
|
||
><code class="docutils literal notranslate"
|
||
><span class="pre">create_keys()</span></code
|
||
></a
|
||
>
|
||
</li>
|
||
<li>
|
||
<a class="reference internal" href="#RNS.Destination.get_private_key"
|
||
><code class="docutils literal notranslate"
|
||
><span class="pre">get_private_key()</span></code
|
||
></a
|
||
>
|
||
</li>
|
||
<li>
|
||
<a class="reference internal" href="#RNS.Destination.load_private_key"
|
||
><code class="docutils literal notranslate"
|
||
><span class="pre">load_private_key()</span></code
|
||
></a
|
||
>
|
||
</li>
|
||
<li>
|
||
<a class="reference internal" href="#RNS.Destination.encrypt"
|
||
><code class="docutils literal notranslate"
|
||
><span class="pre">encrypt()</span></code
|
||
></a
|
||
>
|
||
</li>
|
||
<li>
|
||
<a class="reference internal" href="#RNS.Destination.decrypt"
|
||
><code class="docutils literal notranslate"
|
||
><span class="pre">decrypt()</span></code
|
||
></a
|
||
>
|
||
</li>
|
||
<li>
|
||
<a class="reference internal" href="#RNS.Destination.sign"
|
||
><code class="docutils literal notranslate"
|
||
><span class="pre">sign()</span></code
|
||
></a
|
||
>
|
||
</li>
|
||
<li>
|
||
<a
|
||
class="reference internal"
|
||
href="#RNS.Destination.set_default_app_data"
|
||
><code class="docutils literal notranslate"
|
||
><span class="pre">set_default_app_data()</span></code
|
||
></a
|
||
>
|
||
</li>
|
||
<li>
|
||
<a
|
||
class="reference internal"
|
||
href="#RNS.Destination.clear_default_app_data"
|
||
><code class="docutils literal notranslate"
|
||
><span class="pre">clear_default_app_data()</span></code
|
||
></a
|
||
>
|
||
</li>
|
||
</ul>
|
||
</li>
|
||
<li>
|
||
<a class="reference internal" href="#RNS.Packet"
|
||
><code class="docutils literal notranslate"
|
||
><span class="pre">Packet</span></code
|
||
></a
|
||
>
|
||
<ul>
|
||
<li>
|
||
<a class="reference internal" href="#RNS.Packet.ENCRYPTED_MDU"
|
||
><code class="docutils literal notranslate"
|
||
><span class="pre">ENCRYPTED_MDU</span></code
|
||
></a
|
||
>
|
||
</li>
|
||
<li>
|
||
<a class="reference internal" href="#RNS.Packet.PLAIN_MDU"
|
||
><code class="docutils literal notranslate"
|
||
><span class="pre">PLAIN_MDU</span></code
|
||
></a
|
||
>
|
||
</li>
|
||
<li>
|
||
<a class="reference internal" href="#RNS.Packet.send"
|
||
><code class="docutils literal notranslate"
|
||
><span class="pre">send()</span></code
|
||
></a
|
||
>
|
||
</li>
|
||
<li>
|
||
<a class="reference internal" href="#RNS.Packet.resend"
|
||
><code class="docutils literal notranslate"
|
||
><span class="pre">resend()</span></code
|
||
></a
|
||
>
|
||
</li>
|
||
<li>
|
||
<a class="reference internal" href="#RNS.Packet.get_rssi"
|
||
><code class="docutils literal notranslate"
|
||
><span class="pre">get_rssi()</span></code
|
||
></a
|
||
>
|
||
</li>
|
||
<li>
|
||
<a class="reference internal" href="#RNS.Packet.get_snr"
|
||
><code class="docutils literal notranslate"
|
||
><span class="pre">get_snr()</span></code
|
||
></a
|
||
>
|
||
</li>
|
||
<li>
|
||
<a class="reference internal" href="#RNS.Packet.get_q"
|
||
><code class="docutils literal notranslate"
|
||
><span class="pre">get_q()</span></code
|
||
></a
|
||
>
|
||
</li>
|
||
</ul>
|
||
</li>
|
||
<li>
|
||
<a class="reference internal" href="#RNS.PacketReceipt"
|
||
><code class="docutils literal notranslate"
|
||
><span class="pre">PacketReceipt</span></code
|
||
></a
|
||
>
|
||
<ul>
|
||
<li>
|
||
<a class="reference internal" href="#RNS.PacketReceipt.get_status"
|
||
><code class="docutils literal notranslate"
|
||
><span class="pre">get_status()</span></code
|
||
></a
|
||
>
|
||
</li>
|
||
<li>
|
||
<a class="reference internal" href="#RNS.PacketReceipt.get_rtt"
|
||
><code class="docutils literal notranslate"
|
||
><span class="pre">get_rtt()</span></code
|
||
></a
|
||
>
|
||
</li>
|
||
<li>
|
||
<a class="reference internal" href="#RNS.PacketReceipt.set_timeout"
|
||
><code class="docutils literal notranslate"
|
||
><span class="pre">set_timeout()</span></code
|
||
></a
|
||
>
|
||
</li>
|
||
<li>
|
||
<a
|
||
class="reference internal"
|
||
href="#RNS.PacketReceipt.set_delivery_callback"
|
||
><code class="docutils literal notranslate"
|
||
><span class="pre">set_delivery_callback()</span></code
|
||
></a
|
||
>
|
||
</li>
|
||
<li>
|
||
<a
|
||
class="reference internal"
|
||
href="#RNS.PacketReceipt.set_timeout_callback"
|
||
><code class="docutils literal notranslate"
|
||
><span class="pre">set_timeout_callback()</span></code
|
||
></a
|
||
>
|
||
</li>
|
||
</ul>
|
||
</li>
|
||
<li>
|
||
<a class="reference internal" href="#RNS.Link"
|
||
><code class="docutils literal notranslate"
|
||
><span class="pre">Link</span></code
|
||
></a
|
||
>
|
||
<ul>
|
||
<li>
|
||
<a class="reference internal" href="#RNS.Link.CURVE"
|
||
><code class="docutils literal notranslate"
|
||
><span class="pre">CURVE</span></code
|
||
></a
|
||
>
|
||
</li>
|
||
<li>
|
||
<a
|
||
class="reference internal"
|
||
href="#RNS.Link.ESTABLISHMENT_TIMEOUT_PER_HOP"
|
||
><code class="docutils literal notranslate"
|
||
><span class="pre">ESTABLISHMENT_TIMEOUT_PER_HOP</span></code
|
||
></a
|
||
>
|
||
</li>
|
||
<li>
|
||
<a class="reference internal" href="#RNS.Link.KEEPALIVE_TIMEOUT_FACTOR"
|
||
><code class="docutils literal notranslate"
|
||
><span class="pre">KEEPALIVE_TIMEOUT_FACTOR</span></code
|
||
></a
|
||
>
|
||
</li>
|
||
<li>
|
||
<a class="reference internal" href="#RNS.Link.STALE_GRACE"
|
||
><code class="docutils literal notranslate"
|
||
><span class="pre">STALE_GRACE</span></code
|
||
></a
|
||
>
|
||
</li>
|
||
<li>
|
||
<a class="reference internal" href="#RNS.Link.KEEPALIVE"
|
||
><code class="docutils literal notranslate"
|
||
><span class="pre">KEEPALIVE</span></code
|
||
></a
|
||
>
|
||
</li>
|
||
<li>
|
||
<a class="reference internal" href="#RNS.Link.STALE_TIME"
|
||
><code class="docutils literal notranslate"
|
||
><span class="pre">STALE_TIME</span></code
|
||
></a
|
||
>
|
||
</li>
|
||
<li>
|
||
<a class="reference internal" href="#RNS.Link.identify"
|
||
><code class="docutils literal notranslate"
|
||
><span class="pre">identify()</span></code
|
||
></a
|
||
>
|
||
</li>
|
||
<li>
|
||
<a class="reference internal" href="#RNS.Link.request"
|
||
><code class="docutils literal notranslate"
|
||
><span class="pre">request()</span></code
|
||
></a
|
||
>
|
||
</li>
|
||
<li>
|
||
<a class="reference internal" href="#RNS.Link.track_phy_stats"
|
||
><code class="docutils literal notranslate"
|
||
><span class="pre">track_phy_stats()</span></code
|
||
></a
|
||
>
|
||
</li>
|
||
<li>
|
||
<a class="reference internal" href="#RNS.Link.get_rssi"
|
||
><code class="docutils literal notranslate"
|
||
><span class="pre">get_rssi()</span></code
|
||
></a
|
||
>
|
||
</li>
|
||
<li>
|
||
<a class="reference internal" href="#RNS.Link.get_snr"
|
||
><code class="docutils literal notranslate"
|
||
><span class="pre">get_snr()</span></code
|
||
></a
|
||
>
|
||
</li>
|
||
<li>
|
||
<a class="reference internal" href="#RNS.Link.get_q"
|
||
><code class="docutils literal notranslate"
|
||
><span class="pre">get_q()</span></code
|
||
></a
|
||
>
|
||
</li>
|
||
<li>
|
||
<a class="reference internal" href="#RNS.Link.get_establishment_rate"
|
||
><code class="docutils literal notranslate"
|
||
><span class="pre">get_establishment_rate()</span></code
|
||
></a
|
||
>
|
||
</li>
|
||
<li>
|
||
<a class="reference internal" href="#RNS.Link.get_mtu"
|
||
><code class="docutils literal notranslate"
|
||
><span class="pre">get_mtu()</span></code
|
||
></a
|
||
>
|
||
</li>
|
||
<li>
|
||
<a class="reference internal" href="#RNS.Link.get_mdu"
|
||
><code class="docutils literal notranslate"
|
||
><span class="pre">get_mdu()</span></code
|
||
></a
|
||
>
|
||
</li>
|
||
<li>
|
||
<a class="reference internal" href="#RNS.Link.get_expected_rate"
|
||
><code class="docutils literal notranslate"
|
||
><span class="pre">get_expected_rate()</span></code
|
||
></a
|
||
>
|
||
</li>
|
||
<li>
|
||
<a class="reference internal" href="#RNS.Link.get_mode"
|
||
><code class="docutils literal notranslate"
|
||
><span class="pre">get_mode()</span></code
|
||
></a
|
||
>
|
||
</li>
|
||
<li>
|
||
<a class="reference internal" href="#RNS.Link.get_age"
|
||
><code class="docutils literal notranslate"
|
||
><span class="pre">get_age()</span></code
|
||
></a
|
||
>
|
||
</li>
|
||
<li>
|
||
<a class="reference internal" href="#RNS.Link.no_inbound_for"
|
||
><code class="docutils literal notranslate"
|
||
><span class="pre">no_inbound_for()</span></code
|
||
></a
|
||
>
|
||
</li>
|
||
<li>
|
||
<a class="reference internal" href="#RNS.Link.no_outbound_for"
|
||
><code class="docutils literal notranslate"
|
||
><span class="pre">no_outbound_for()</span></code
|
||
></a
|
||
>
|
||
</li>
|
||
<li>
|
||
<a class="reference internal" href="#RNS.Link.no_data_for"
|
||
><code class="docutils literal notranslate"
|
||
><span class="pre">no_data_for()</span></code
|
||
></a
|
||
>
|
||
</li>
|
||
<li>
|
||
<a class="reference internal" href="#RNS.Link.inactive_for"
|
||
><code class="docutils literal notranslate"
|
||
><span class="pre">inactive_for()</span></code
|
||
></a
|
||
>
|
||
</li>
|
||
<li>
|
||
<a class="reference internal" href="#RNS.Link.get_remote_identity"
|
||
><code class="docutils literal notranslate"
|
||
><span class="pre">get_remote_identity()</span></code
|
||
></a
|
||
>
|
||
</li>
|
||
<li>
|
||
<a class="reference internal" href="#RNS.Link.teardown"
|
||
><code class="docutils literal notranslate"
|
||
><span class="pre">teardown()</span></code
|
||
></a
|
||
>
|
||
</li>
|
||
<li>
|
||
<a class="reference internal" href="#RNS.Link.get_channel"
|
||
><code class="docutils literal notranslate"
|
||
><span class="pre">get_channel()</span></code
|
||
></a
|
||
>
|
||
</li>
|
||
<li>
|
||
<a class="reference internal" href="#RNS.Link.set_link_closed_callback"
|
||
><code class="docutils literal notranslate"
|
||
><span class="pre">set_link_closed_callback()</span></code
|
||
></a
|
||
>
|
||
</li>
|
||
<li>
|
||
<a class="reference internal" href="#RNS.Link.set_packet_callback"
|
||
><code class="docutils literal notranslate"
|
||
><span class="pre">set_packet_callback()</span></code
|
||
></a
|
||
>
|
||
</li>
|
||
<li>
|
||
<a class="reference internal" href="#RNS.Link.set_resource_callback"
|
||
><code class="docutils literal notranslate"
|
||
><span class="pre">set_resource_callback()</span></code
|
||
></a
|
||
>
|
||
</li>
|
||
<li>
|
||
<a
|
||
class="reference internal"
|
||
href="#RNS.Link.set_resource_started_callback"
|
||
><code class="docutils literal notranslate"
|
||
><span class="pre">set_resource_started_callback()</span></code
|
||
></a
|
||
>
|
||
</li>
|
||
<li>
|
||
<a
|
||
class="reference internal"
|
||
href="#RNS.Link.set_resource_concluded_callback"
|
||
><code class="docutils literal notranslate"
|
||
><span class="pre">set_resource_concluded_callback()</span></code
|
||
></a
|
||
>
|
||
</li>
|
||
<li>
|
||
<a
|
||
class="reference internal"
|
||
href="#RNS.Link.set_remote_identified_callback"
|
||
><code class="docutils literal notranslate"
|
||
><span class="pre">set_remote_identified_callback()</span></code
|
||
></a
|
||
>
|
||
</li>
|
||
<li>
|
||
<a class="reference internal" href="#RNS.Link.set_resource_strategy"
|
||
><code class="docutils literal notranslate"
|
||
><span class="pre">set_resource_strategy()</span></code
|
||
></a
|
||
>
|
||
</li>
|
||
</ul>
|
||
</li>
|
||
<li>
|
||
<a class="reference internal" href="#RNS.RequestReceipt"
|
||
><code class="docutils literal notranslate"
|
||
><span class="pre">RequestReceipt</span></code
|
||
></a
|
||
>
|
||
<ul>
|
||
<li>
|
||
<a class="reference internal" href="#RNS.RequestReceipt.get_request_id"
|
||
><code class="docutils literal notranslate"
|
||
><span class="pre">get_request_id()</span></code
|
||
></a
|
||
>
|
||
</li>
|
||
<li>
|
||
<a class="reference internal" href="#RNS.RequestReceipt.get_status"
|
||
><code class="docutils literal notranslate"
|
||
><span class="pre">get_status()</span></code
|
||
></a
|
||
>
|
||
</li>
|
||
<li>
|
||
<a class="reference internal" href="#RNS.RequestReceipt.get_progress"
|
||
><code class="docutils literal notranslate"
|
||
><span class="pre">get_progress()</span></code
|
||
></a
|
||
>
|
||
</li>
|
||
<li>
|
||
<a class="reference internal" href="#RNS.RequestReceipt.get_response"
|
||
><code class="docutils literal notranslate"
|
||
><span class="pre">get_response()</span></code
|
||
></a
|
||
>
|
||
</li>
|
||
<li>
|
||
<a
|
||
class="reference internal"
|
||
href="#RNS.RequestReceipt.get_response_time"
|
||
><code class="docutils literal notranslate"
|
||
><span class="pre">get_response_time()</span></code
|
||
></a
|
||
>
|
||
</li>
|
||
<li>
|
||
<a class="reference internal" href="#RNS.RequestReceipt.concluded"
|
||
><code class="docutils literal notranslate"
|
||
><span class="pre">concluded()</span></code
|
||
></a
|
||
>
|
||
</li>
|
||
</ul>
|
||
</li>
|
||
<li>
|
||
<a class="reference internal" href="#RNS.Resource"
|
||
><code class="docutils literal notranslate"
|
||
><span class="pre">Resource</span></code
|
||
></a
|
||
>
|
||
<ul>
|
||
<li>
|
||
<a class="reference internal" href="#RNS.Resource.advertise"
|
||
><code class="docutils literal notranslate"
|
||
><span class="pre">advertise()</span></code
|
||
></a
|
||
>
|
||
</li>
|
||
<li>
|
||
<a class="reference internal" href="#RNS.Resource.cancel"
|
||
><code class="docutils literal notranslate"
|
||
><span class="pre">cancel()</span></code
|
||
></a
|
||
>
|
||
</li>
|
||
<li>
|
||
<a class="reference internal" href="#RNS.Resource.get_progress"
|
||
><code class="docutils literal notranslate"
|
||
><span class="pre">get_progress()</span></code
|
||
></a
|
||
>
|
||
</li>
|
||
<li>
|
||
<a class="reference internal" href="#RNS.Resource.get_transfer_size"
|
||
><code class="docutils literal notranslate"
|
||
><span class="pre">get_transfer_size()</span></code
|
||
></a
|
||
>
|
||
</li>
|
||
<li>
|
||
<a class="reference internal" href="#RNS.Resource.get_data_size"
|
||
><code class="docutils literal notranslate"
|
||
><span class="pre">get_data_size()</span></code
|
||
></a
|
||
>
|
||
</li>
|
||
<li>
|
||
<a class="reference internal" href="#RNS.Resource.get_parts"
|
||
><code class="docutils literal notranslate"
|
||
><span class="pre">get_parts()</span></code
|
||
></a
|
||
>
|
||
</li>
|
||
<li>
|
||
<a class="reference internal" href="#RNS.Resource.get_segments"
|
||
><code class="docutils literal notranslate"
|
||
><span class="pre">get_segments()</span></code
|
||
></a
|
||
>
|
||
</li>
|
||
<li>
|
||
<a class="reference internal" href="#RNS.Resource.get_hash"
|
||
><code class="docutils literal notranslate"
|
||
><span class="pre">get_hash()</span></code
|
||
></a
|
||
>
|
||
</li>
|
||
<li>
|
||
<a class="reference internal" href="#RNS.Resource.is_compressed"
|
||
><code class="docutils literal notranslate"
|
||
><span class="pre">is_compressed()</span></code
|
||
></a
|
||
>
|
||
</li>
|
||
</ul>
|
||
</li>
|
||
<li>
|
||
<a class="reference internal" href="#RNS.Channel.Channel"
|
||
><code class="docutils literal notranslate"
|
||
><span class="pre">Channel</span></code
|
||
></a
|
||
>
|
||
<ul>
|
||
<li>
|
||
<a
|
||
class="reference internal"
|
||
href="#RNS.Channel.Channel.register_message_type"
|
||
><code class="docutils literal notranslate"
|
||
><span class="pre">register_message_type()</span></code
|
||
></a
|
||
>
|
||
</li>
|
||
<li>
|
||
<a
|
||
class="reference internal"
|
||
href="#RNS.Channel.Channel.add_message_handler"
|
||
><code class="docutils literal notranslate"
|
||
><span class="pre">add_message_handler()</span></code
|
||
></a
|
||
>
|
||
</li>
|
||
<li>
|
||
<a
|
||
class="reference internal"
|
||
href="#RNS.Channel.Channel.remove_message_handler"
|
||
><code class="docutils literal notranslate"
|
||
><span class="pre">remove_message_handler()</span></code
|
||
></a
|
||
>
|
||
</li>
|
||
<li>
|
||
<a
|
||
class="reference internal"
|
||
href="#RNS.Channel.Channel.is_ready_to_send"
|
||
><code class="docutils literal notranslate"
|
||
><span class="pre">is_ready_to_send()</span></code
|
||
></a
|
||
>
|
||
</li>
|
||
<li>
|
||
<a class="reference internal" href="#RNS.Channel.Channel.send"
|
||
><code class="docutils literal notranslate"
|
||
><span class="pre">send()</span></code
|
||
></a
|
||
>
|
||
</li>
|
||
<li>
|
||
<a class="reference internal" href="#RNS.Channel.Channel.mdu"
|
||
><code class="docutils literal notranslate"
|
||
><span class="pre">mdu</span></code
|
||
></a
|
||
>
|
||
</li>
|
||
</ul>
|
||
</li>
|
||
<li>
|
||
<a class="reference internal" href="#RNS.MessageBase"
|
||
><code class="docutils literal notranslate"
|
||
><span class="pre">MessageBase</span></code
|
||
></a
|
||
>
|
||
<ul>
|
||
<li>
|
||
<a class="reference internal" href="#RNS.MessageBase.MSGTYPE"
|
||
><code class="docutils literal notranslate"
|
||
><span class="pre">MSGTYPE</span></code
|
||
></a
|
||
>
|
||
</li>
|
||
<li>
|
||
<a class="reference internal" href="#RNS.MessageBase.pack"
|
||
><code class="docutils literal notranslate"
|
||
><span class="pre">pack()</span></code
|
||
></a
|
||
>
|
||
</li>
|
||
<li>
|
||
<a class="reference internal" href="#RNS.MessageBase.unpack"
|
||
><code class="docutils literal notranslate"
|
||
><span class="pre">unpack()</span></code
|
||
></a
|
||
>
|
||
</li>
|
||
</ul>
|
||
</li>
|
||
<li>
|
||
<a class="reference internal" href="#RNS.Buffer"
|
||
><code class="docutils literal notranslate"
|
||
><span class="pre">Buffer</span></code
|
||
></a
|
||
>
|
||
<ul>
|
||
<li>
|
||
<a class="reference internal" href="#RNS.Buffer.create_reader"
|
||
><code class="docutils literal notranslate"
|
||
><span class="pre">create_reader()</span></code
|
||
></a
|
||
>
|
||
</li>
|
||
<li>
|
||
<a class="reference internal" href="#RNS.Buffer.create_writer"
|
||
><code class="docutils literal notranslate"
|
||
><span class="pre">create_writer()</span></code
|
||
></a
|
||
>
|
||
</li>
|
||
<li>
|
||
<a
|
||
class="reference internal"
|
||
href="#RNS.Buffer.create_bidirectional_buffer"
|
||
><code class="docutils literal notranslate"
|
||
><span class="pre">create_bidirectional_buffer()</span></code
|
||
></a
|
||
>
|
||
</li>
|
||
</ul>
|
||
</li>
|
||
<li>
|
||
<a class="reference internal" href="#RNS.RawChannelReader"
|
||
><code class="docutils literal notranslate"
|
||
><span class="pre">RawChannelReader</span></code
|
||
></a
|
||
>
|
||
<ul>
|
||
<li>
|
||
<a class="reference internal" href="#RNS.RawChannelReader.__init__"
|
||
><code class="docutils literal notranslate"
|
||
><span class="pre">__init__()</span></code
|
||
></a
|
||
>
|
||
</li>
|
||
<li>
|
||
<a
|
||
class="reference internal"
|
||
href="#RNS.RawChannelReader.add_ready_callback"
|
||
><code class="docutils literal notranslate"
|
||
><span class="pre">add_ready_callback()</span></code
|
||
></a
|
||
>
|
||
</li>
|
||
<li>
|
||
<a
|
||
class="reference internal"
|
||
href="#RNS.RawChannelReader.remove_ready_callback"
|
||
><code class="docutils literal notranslate"
|
||
><span class="pre">remove_ready_callback()</span></code
|
||
></a
|
||
>
|
||
</li>
|
||
</ul>
|
||
</li>
|
||
<li>
|
||
<a class="reference internal" href="#RNS.RawChannelWriter"
|
||
><code class="docutils literal notranslate"
|
||
><span class="pre">RawChannelWriter</span></code
|
||
></a
|
||
>
|
||
<ul>
|
||
<li>
|
||
<a class="reference internal" href="#RNS.RawChannelWriter.__init__"
|
||
><code class="docutils literal notranslate"
|
||
><span class="pre">__init__()</span></code
|
||
></a
|
||
>
|
||
</li>
|
||
</ul>
|
||
</li>
|
||
<li>
|
||
<a class="reference internal" href="#RNS.Transport"
|
||
><code class="docutils literal notranslate"
|
||
><span class="pre">Transport</span></code
|
||
></a
|
||
>
|
||
<ul>
|
||
<li>
|
||
<a class="reference internal" href="#RNS.Transport.PATHFINDER_M"
|
||
><code class="docutils literal notranslate"
|
||
><span class="pre">PATHFINDER_M</span></code
|
||
></a
|
||
>
|
||
</li>
|
||
<li>
|
||
<a
|
||
class="reference internal"
|
||
href="#RNS.Transport.register_announce_handler"
|
||
><code class="docutils literal notranslate"
|
||
><span class="pre">register_announce_handler()</span></code
|
||
></a
|
||
>
|
||
</li>
|
||
<li>
|
||
<a
|
||
class="reference internal"
|
||
href="#RNS.Transport.deregister_announce_handler"
|
||
><code class="docutils literal notranslate"
|
||
><span class="pre">deregister_announce_handler()</span></code
|
||
></a
|
||
>
|
||
</li>
|
||
<li>
|
||
<a class="reference internal" href="#RNS.Transport.has_path"
|
||
><code class="docutils literal notranslate"
|
||
><span class="pre">has_path()</span></code
|
||
></a
|
||
>
|
||
</li>
|
||
<li>
|
||
<a class="reference internal" href="#RNS.Transport.hops_to"
|
||
><code class="docutils literal notranslate"
|
||
><span class="pre">hops_to()</span></code
|
||
></a
|
||
>
|
||
</li>
|
||
<li>
|
||
<a class="reference internal" href="#RNS.Transport.next_hop"
|
||
><code class="docutils literal notranslate"
|
||
><span class="pre">next_hop()</span></code
|
||
></a
|
||
>
|
||
</li>
|
||
<li>
|
||
<a class="reference internal" href="#RNS.Transport.next_hop_interface"
|
||
><code class="docutils literal notranslate"
|
||
><span class="pre">next_hop_interface()</span></code
|
||
></a
|
||
>
|
||
</li>
|
||
<li>
|
||
<a class="reference internal" href="#RNS.Transport.request_path"
|
||
><code class="docutils literal notranslate"
|
||
><span class="pre">request_path()</span></code
|
||
></a
|
||
>
|
||
</li>
|
||
</ul>
|
||
</li>
|
||
</ul>
|
||
</li>
|
||
</ul>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</aside>
|
||
</div>
|
||
</div>
|
||
<script src="_static/documentation_options.js"></script>
|
||
<script src="_static/doctools.js"></script>
|
||
<script src="_static/sphinx_highlight.js"></script>
|
||
<script src="_static/scripts/furo.js"></script>
|
||
<script src="_static/clipboard.min.js"></script>
|
||
<script src="_static/copybutton.js"></script>
|
||
</body>
|
||
</html>
|