nim-chronos/api/chronos/transports/ipnet.html

1167 lines
108 KiB
HTML

<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<!-- This file is generated by Nim. -->
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<!-- Favicon -->
<link rel="shortcut icon" href="data:image/x-icon;base64,AAABAAEAEBAAAAEAIABoBAAAFgAAACgAAAAQAAAAIAAAAAEAIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AAAAAAUAAAAF////AP///wD///8A////AP///wD///8A////AP///wD///8A////AAAAAAIAAABbAAAAlQAAAKIAAACbAAAAmwAAAKIAAACVAAAAWwAAAAL///8A////AP///wD///8A////AAAAABQAAADAAAAAYwAAAA3///8A////AP///wD///8AAAAADQAAAGMAAADAAAAAFP///wD///8A////AP///wAAAACdAAAAOv///wD///8A////AP///wD///8A////AP///wD///8AAAAAOgAAAJ3///8A////AP///wAAAAAnAAAAcP///wAAAAAoAAAASv///wD///8A////AP///wAAAABKAAAAKP///wAAAABwAAAAJ////wD///8AAAAAgQAAABwAAACIAAAAkAAAAJMAAACtAAAAFQAAABUAAACtAAAAkwAAAJAAAACIAAAAHAAAAIH///8A////AAAAAKQAAACrAAAAaP///wD///8AAAAARQAAANIAAADSAAAARf///wD///8AAAAAaAAAAKsAAACk////AAAAADMAAACcAAAAnQAAABj///8A////AP///wAAAAAYAAAAGP///wD///8A////AAAAABgAAACdAAAAnAAAADMAAAB1AAAAwwAAAP8AAADpAAAAsQAAAE4AAAAb////AP///wAAAAAbAAAATgAAALEAAADpAAAA/wAAAMMAAAB1AAAAtwAAAOkAAAD/AAAA/wAAAP8AAADvAAAA3gAAAN4AAADeAAAA3gAAAO8AAAD/AAAA/wAAAP8AAADpAAAAtwAAAGUAAAA/AAAA3wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAADfAAAAPwAAAGX///8A////AAAAAEgAAADtAAAAvwAAAL0AAADGAAAA7wAAAO8AAADGAAAAvQAAAL8AAADtAAAASP///wD///8A////AP///wD///8AAAAAO////wD///8A////AAAAAIcAAACH////AP///wD///8AAAAAO////wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A//8AAP//AAD4HwAA7/cAAN/7AAD//wAAoYUAAJ55AACf+QAAh+EAAAAAAADAAwAA4AcAAP5/AAD//wAA//8AAA=="/>
<link rel="icon" type="image/png" sizes="32x32" href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAABmJLR0QA/wD/AP+gvaeTAAAACXBIWXMAAA3XAAAN1wFCKJt4AAAAB3RJTUUH4QQQEwksSS9ZWwAAAk1JREFUWMPtll2ITVEUx39nn/O7Y5qR8f05wtCUUr6ZIS++8pEnkZInPImneaCQ5METNdOkeFBKUhMPRIkHKfEuUZSUlGlKPN2TrgfncpvmnntnmlEyq1Z7t89/rf9a6+y99oZxGZf/XeIq61EdtgKXgdXA0xrYAvBjOIF1AI9zvjcC74BSpndrJPkBWDScTF8Aa4E3wDlgHbASaANmVqlcCnwHvgDvgVfAJ+AikAAvgfVZwLnSVZHZaOuKoQi3ZOMi4NkYkpe1p4J7A8BpYAD49hfIy/oqG0+hLomiKP2L5L+1ubn5115S+3OAn4EnwBlgMzCjyt6ZAnQCJ4A7wOs88iRJHvw50HoujuPBoCKwHWiosy8MdfZnAdcHk8dxXFJ3VQbQlCTJvRBCGdRbD4M6uc5glpY3eAihpN5S5w12diSEcCCEcKUO4ljdr15T76ur1FDDLIQQ3qv71EdDOe3Kxj3leRXyk+pxdWnFWod6Wt2bY3de3aSuUHcPBVimHs7mK9WrmeOF6lR1o9qnzskh2ar2qm1qizpfXaPeVGdlmGN5pb09qMxz1Xb1kLqgzn1RyH7JUXW52lr5e/Kqi9qpto7V1atuUzfnARrV7jEib1T76gG2qxdGmXyiekkt1GswPTtek0aBfJp6YySGBfWg2tPQ0FAYgf1stUfdmdcjarbYJEniKIq6gY/Aw+zWHAC+p2labGpqiorFYgGYCEzN7oQdQClN07O1/EfDyGgC0ALMBdYAi4FyK+4H3gLPsxfR1zRNi+NP7nH5J+QntnXe5B5mpfQAAAAASUVORK5CYII=">
<!-- Google fonts -->
<link href='https://fonts.googleapis.com/css?family=Lato:400,600,900' rel='stylesheet' type='text/css'/>
<link href='https://fonts.googleapis.com/css?family=Source+Code+Pro:400,500,600' rel='stylesheet' type='text/css'/>
<!-- CSS -->
<title>chronos/transports/ipnet</title>
<link rel="stylesheet" type="text/css" href="../../nimdoc.out.css">
<script type="text/javascript" src="../../dochack.js"></script>
<script type="text/javascript">
function main() {
var pragmaDots = document.getElementsByClassName("pragmadots");
for (var i = 0; i < pragmaDots.length; i++) {
pragmaDots[i].onclick = function(event) {
// Hide tease
event.target.parentNode.style.display = "none";
// Show actual
event.target.parentNode.nextElementSibling.style.display = "inline";
}
}
function switchTheme(e) {
if (e.target.checked) {
document.documentElement.setAttribute('data-theme', 'dark');
localStorage.setItem('theme', 'dark');
} else {
document.documentElement.setAttribute('data-theme', 'light');
localStorage.setItem('theme', 'light');
}
}
const toggleSwitch = document.querySelector('.theme-switch input[type="checkbox"]');
if (toggleSwitch !== null) {
toggleSwitch.addEventListener('change', switchTheme, false);
}
var currentTheme = localStorage.getItem('theme');
if (!currentTheme && window.matchMedia('(prefers-color-scheme: dark)').matches) {
currentTheme = 'dark';
}
if (currentTheme) {
document.documentElement.setAttribute('data-theme', currentTheme);
if (currentTheme === 'dark' && toggleSwitch !== null) {
toggleSwitch.checked = true;
}
}
}
window.addEventListener('DOMContentLoaded', main);
</script>
</head>
<body>
<div class="document" id="documentId">
<div class="container">
<h1 class="title">chronos/transports/ipnet</h1>
<div class="row">
<div class="three columns">
<div class="theme-switch-wrapper">
<label class="theme-switch" for="checkbox">
<input type="checkbox" id="checkbox" />
<div class="slider round"></div>
</label>
&nbsp;&nbsp;&nbsp; <em>Dark Mode</em>
</div>
<div id="global-links">
<ul class="simple">
<li>
<a href="../../theindex.html">Index</a>
</li>
</ul>
</div>
<div id="searchInputDiv">
Search: <input type="text" id="searchInput"
onkeyup="search()" />
</div>
<div>
Group by:
<select onchange="groupBy(this.value)">
<option value="section">Section</option>
<option value="type">Type</option>
</select>
</div>
<ul class="simple simple-toc" id="toc-list">
<li>
<a class="reference reference-toplevel" href="#6" id="56">Imports</a>
<ul class="simple simple-toc-section">
</ul>
</li>
<li>
<a class="reference reference-toplevel" href="#7" id="57">Types</a>
<ul class="simple simple-toc-section">
<li><a class="reference" href="#IpMask"
title="IpMask = object
case family*: AddressFamily
of AddressFamily.None, AddressFamily.Unix:
nil
of AddressFamily.IPv4:
mask4*: uint32
of AddressFamily.IPv6:
mask6*: array[2, uint64]">IpMask</a></li>
<li><a class="reference" href="#IpNet"
title="IpNet = object
host*: TransportAddress
mask*: IpMask">IpNet</a></li>
</ul>
</li>
<li>
<a class="reference reference-toplevel" href="#12" id="62">Procs</a>
<ul class="simple simple-toc-section">
<ul class="simple nested-toc-section">$
<li><a class="reference" href="#%24%2CIpMask"
title="`$`(mask: IpMask; include0x = false): string">`$`(mask: IpMask; include0x = false): string</a></li>
<li><a class="reference" href="#%24%2CIpNet"
title="`$`(net: IpNet): string">`$`(net: IpNet): string</a></li>
</ul>
<ul class="simple nested-toc-section">+
<li><a class="reference" href="#%2B%2CTransportAddress%2C"
title="`+`(address: TransportAddress; v: int | uint): TransportAddress">`+`(address: TransportAddress; v: int | uint): TransportAddress</a></li>
</ul>
<ul class="simple nested-toc-section">-
<li><a class="reference" href="#-%2CTransportAddress%2C"
title="`-`(address: TransportAddress; v: int | uint): TransportAddress">`-`(address: TransportAddress; v: int | uint): TransportAddress</a></li>
</ul>
<ul class="simple nested-toc-section">==
<li><a class="reference" href="#%3D%3D%2CIpMask%2CIpMask"
title="`==`(m1, m2: IpMask): bool">`==`(m1, m2: IpMask): bool</a></li>
<li><a class="reference" href="#%3D%3D%2CIpNet%2CIpNet"
title="`==`(n1, n2: IpNet): bool">`==`(n1, n2: IpNet): bool</a></li>
</ul>
<ul class="simple nested-toc-section">and
<li><a class="reference" href="#and%2CTransportAddress%2CTransportAddress"
title="`and`(address1, address2: TransportAddress): TransportAddress">`and`(address1, address2: TransportAddress): TransportAddress</a></li>
</ul>
<ul class="simple nested-toc-section">broadcast
<li><a class="reference" href="#broadcast%2CIpNet"
title="broadcast(net: IpNet): TransportAddress">broadcast(net: IpNet): TransportAddress</a></li>
</ul>
<ul class="simple nested-toc-section">contains
<li><a class="reference" href="#contains%2CIpNet%2CTransportAddress"
title="contains(net: IpNet; address: TransportAddress): bool">contains(net: IpNet; address: TransportAddress): bool</a></li>
</ul>
<ul class="simple nested-toc-section">dec
<li><a class="reference" href="#dec%2CTransportAddress%2Cint"
title="dec(address: var TransportAddress; v: int = 1)">dec(address: var TransportAddress; v: int = 1)</a></li>
</ul>
<ul class="simple nested-toc-section">inc
<li><a class="reference" href="#inc%2CTransportAddress%2Cint"
title="inc(address: var TransportAddress; v: int = 1)">inc(address: var TransportAddress; v: int = 1)</a></li>
</ul>
<ul class="simple nested-toc-section">init
<li><a class="reference" href="#init%2Ctypedesc%5BIpMask%5D%2CAddressFamily%2Cint"
title="init(t: typedesc[IpMask]; family: AddressFamily; prefix: int): IpMask">init(t: typedesc[IpMask]; family: AddressFamily; prefix: int): IpMask</a></li>
<li><a class="reference" href="#init%2Ctypedesc%5BIpMask%5D%2Cstring"
title="init(t: typedesc[IpMask]; netmask: string): IpMask">init(t: typedesc[IpMask]; netmask: string): IpMask</a></li>
<li><a class="reference" href="#init%2Ctypedesc%5BIpMask%5D%2CTransportAddress"
title="init(t: typedesc[IpMask]; netmask: TransportAddress): IpMask">init(t: typedesc[IpMask]; netmask: TransportAddress): IpMask</a></li>
<li><a class="reference" href="#init%2Ctypedesc%5BIpNet%5D%2CTransportAddress%2CTransportAddress"
title="init(t: typedesc[IpNet]; host, mask: TransportAddress): IpNet">init(t: typedesc[IpNet]; host, mask: TransportAddress): IpNet</a></li>
<li><a class="reference" href="#init%2Ctypedesc%5BIpNet%5D%2CTransportAddress%2CIpMask"
title="init(t: typedesc[IpNet]; host: TransportAddress; mask: IpMask): IpNet">init(t: typedesc[IpNet]; host: TransportAddress; mask: IpMask): IpNet</a></li>
<li><a class="reference" href="#init%2Ctypedesc%5BIpNet%5D%2CTransportAddress%2Cint"
title="init(t: typedesc[IpNet]; host: TransportAddress; prefix: int): IpNet">init(t: typedesc[IpNet]; host: TransportAddress; prefix: int): IpNet</a></li>
<li><a class="reference" href="#init%2Ctypedesc%5BIpNet%5D%2Cstring"
title="init(t: typedesc[IpNet]; network: string): IpNet">init(t: typedesc[IpNet]; network: string): IpNet</a></li>
</ul>
<ul class="simple nested-toc-section">initIp
<li><a class="reference" href="#initIp%2Ctypedesc%5BIpMask%5D%2Cstring"
title="initIp(t: typedesc[IpMask]; netmask: string): IpMask">initIp(t: typedesc[IpMask]; netmask: string): IpMask</a></li>
</ul>
<ul class="simple nested-toc-section">ip
<li><a class="reference" href="#ip%2CIpMask"
title="ip(mask: IpMask): string">ip(mask: IpMask): string</a></li>
</ul>
<ul class="simple nested-toc-section">isAnyLocal
<li><a class="reference" href="#isAnyLocal%2CTransportAddress"
title="isAnyLocal(address: TransportAddress): bool">isAnyLocal(address: TransportAddress): bool</a></li>
</ul>
<ul class="simple nested-toc-section">isBenchmarking
<li><a class="reference" href="#isBenchmarking%2CTransportAddress"
title="isBenchmarking(address: TransportAddress): bool">isBenchmarking(address: TransportAddress): bool</a></li>
</ul>
<ul class="simple nested-toc-section">isBroadcast
<li><a class="reference" href="#isBroadcast%2CTransportAddress"
title="isBroadcast(address: TransportAddress): bool">isBroadcast(address: TransportAddress): bool</a></li>
</ul>
<ul class="simple nested-toc-section">isDocumentation
<li><a class="reference" href="#isDocumentation%2CTransportAddress"
title="isDocumentation(address: TransportAddress): bool">isDocumentation(address: TransportAddress): bool</a></li>
</ul>
<ul class="simple nested-toc-section">isGlobal
<li><a class="reference" href="#isGlobal%2CTransportAddress"
title="isGlobal(address: TransportAddress): bool">isGlobal(address: TransportAddress): bool</a></li>
</ul>
<ul class="simple nested-toc-section">isGlobalMulticast
<li><a class="reference" href="#isGlobalMulticast%2CTransportAddress"
title="isGlobalMulticast(address: TransportAddress): bool">isGlobalMulticast(address: TransportAddress): bool</a></li>
</ul>
<ul class="simple nested-toc-section">isInterfaceLocalMulticast
<li><a class="reference" href="#isInterfaceLocalMulticast%2CTransportAddress"
title="isInterfaceLocalMulticast(address: TransportAddress): bool">isInterfaceLocalMulticast(address: TransportAddress): bool</a></li>
</ul>
<ul class="simple nested-toc-section">isLinkLocal
<li><a class="reference" href="#isLinkLocal%2CTransportAddress"
title="isLinkLocal(address: TransportAddress): bool">isLinkLocal(address: TransportAddress): bool</a></li>
</ul>
<ul class="simple nested-toc-section">isLinkLocalMulticast
<li><a class="reference" href="#isLinkLocalMulticast%2CTransportAddress"
title="isLinkLocalMulticast(address: TransportAddress): bool">isLinkLocalMulticast(address: TransportAddress): bool</a></li>
</ul>
<ul class="simple nested-toc-section">isLinkLocalUnicast
<li><a class="reference" href="#isLinkLocalUnicast%2CTransportAddress"
title="isLinkLocalUnicast(address: TransportAddress): bool">isLinkLocalUnicast(address: TransportAddress): bool</a></li>
</ul>
<ul class="simple nested-toc-section">isLoopback
<li><a class="reference" href="#isLoopback%2CTransportAddress"
title="isLoopback(address: TransportAddress): bool">isLoopback(address: TransportAddress): bool</a></li>
</ul>
<ul class="simple nested-toc-section">isMulticast
<li><a class="reference" href="#isMulticast%2CTransportAddress"
title="isMulticast(address: TransportAddress): bool">isMulticast(address: TransportAddress): bool</a></li>
</ul>
<ul class="simple nested-toc-section">isNone
<li><a class="reference" href="#isNone%2CTransportAddress"
title="isNone(address: TransportAddress): bool">isNone(address: TransportAddress): bool</a></li>
</ul>
<ul class="simple nested-toc-section">isPrivate
<li><a class="reference" href="#isPrivate%2CTransportAddress"
title="isPrivate(address: TransportAddress): bool">isPrivate(address: TransportAddress): bool</a></li>
</ul>
<ul class="simple nested-toc-section">isReserved
<li><a class="reference" href="#isReserved%2CTransportAddress"
title="isReserved(address: TransportAddress): bool">isReserved(address: TransportAddress): bool</a></li>
</ul>
<ul class="simple nested-toc-section">isShared
<li><a class="reference" href="#isShared%2CTransportAddress"
title="isShared(address: TransportAddress): bool">isShared(address: TransportAddress): bool</a></li>
</ul>
<ul class="simple nested-toc-section">isSiteLocal
<li><a class="reference" href="#isSiteLocal%2CTransportAddress"
title="isSiteLocal(address: TransportAddress): bool">isSiteLocal(address: TransportAddress): bool</a></li>
</ul>
<ul class="simple nested-toc-section">isUnicast
<li><a class="reference" href="#isUnicast%2CTransportAddress"
title="isUnicast(address: TransportAddress): bool">isUnicast(address: TransportAddress): bool</a></li>
</ul>
<ul class="simple nested-toc-section">isUnicastLinkLocal
<li><a class="reference" href="#isUnicastLinkLocal%2CTransportAddress"
title="isUnicastLinkLocal(address: TransportAddress): bool">isUnicastLinkLocal(address: TransportAddress): bool</a></li>
</ul>
<ul class="simple nested-toc-section">isUniqueLocal
<li><a class="reference" href="#isUniqueLocal%2CTransportAddress"
title="isUniqueLocal(address: TransportAddress): bool">isUniqueLocal(address: TransportAddress): bool</a></li>
</ul>
<ul class="simple nested-toc-section">isUnspecified
<li><a class="reference" href="#isUnspecified%2CTransportAddress"
title="isUnspecified(address: TransportAddress): bool">isUnspecified(address: TransportAddress): bool</a></li>
</ul>
<ul class="simple nested-toc-section">isV4Mapped
<li><a class="reference" href="#isV4Mapped%2CTransportAddress"
title="isV4Mapped(address: TransportAddress): bool">isV4Mapped(address: TransportAddress): bool</a></li>
</ul>
<ul class="simple nested-toc-section">isZero
<li><a class="reference" href="#isZero%2CTransportAddress"
title="isZero(address: TransportAddress): bool">isZero(address: TransportAddress): bool</a></li>
</ul>
<ul class="simple nested-toc-section">mask
<li><a class="reference" href="#mask%2CTransportAddress%2CIpMask"
title="mask(a: TransportAddress; m: IpMask): TransportAddress">mask(a: TransportAddress; m: IpMask): TransportAddress</a></li>
</ul>
<ul class="simple nested-toc-section">network
<li><a class="reference" href="#network%2CIpNet"
title="network(net: IpNet): TransportAddress">network(net: IpNet): TransportAddress</a></li>
</ul>
<ul class="simple nested-toc-section">not
<li><a class="reference" href="#not%2CTransportAddress"
title="`not`(address: TransportAddress): TransportAddress">`not`(address: TransportAddress): TransportAddress</a></li>
</ul>
<ul class="simple nested-toc-section">or
<li><a class="reference" href="#or%2CTransportAddress%2CTransportAddress"
title="`or`(address1, address2: TransportAddress): TransportAddress">`or`(address1, address2: TransportAddress): TransportAddress</a></li>
</ul>
<ul class="simple nested-toc-section">prefix
<li><a class="reference" href="#prefix%2CIpMask"
title="prefix(mask: IpMask): int">prefix(mask: IpMask): int</a></li>
</ul>
<ul class="simple nested-toc-section">subnetMask
<li><a class="reference" href="#subnetMask%2CIpMask"
title="subnetMask(mask: IpMask): TransportAddress">subnetMask(mask: IpMask): TransportAddress</a></li>
<li><a class="reference" href="#subnetMask%2CIpNet"
title="subnetMask(net: IpNet): TransportAddress">subnetMask(net: IpNet): TransportAddress</a></li>
</ul>
<ul class="simple nested-toc-section">toIPv4
<li><a class="reference" href="#toIPv4%2CTransportAddress"
title="toIPv4(address: TransportAddress): TransportAddress">toIPv4(address: TransportAddress): TransportAddress</a></li>
</ul>
<ul class="simple nested-toc-section">toIPv6
<li><a class="reference" href="#toIPv6%2CTransportAddress"
title="toIPv6(address: TransportAddress): TransportAddress">toIPv6(address: TransportAddress): TransportAddress</a></li>
</ul>
</ul>
</li>
<li>
<a class="reference reference-toplevel" href="#19" id="69">Exports</a>
<ul class="simple simple-toc-section">
</ul>
</li>
</ul>
</div>
&nbsp;&nbsp;<a
href="https://github.com/status-im/nim-chronos/tree/master/chronos/transports/ipnet.nim#L1"
class="link-seesrc" target="_blank">Source</a>
&nbsp;&nbsp;<a href="https://github.com/status-im/nim-chronos/edit/devel/chronos/transports/ipnet.nim#L1" class="link-seesrc" target="_blank" >Edit</a>
<div class="nine columns" id="content">
<div id="tocRoot"></div>
<p class="module-desc">This module implements various IP network utility procedures.</p>
<div class="section" id="6">
<h1><a class="toc-backref" href="#6">Imports</a></h1>
<dl class="item">
<a class="reference external" href="common.html">common</a>
</dl></div>
<div class="section" id="7">
<h1><a class="toc-backref" href="#7">Types</a></h1>
<dl class="item">
<div id="IpMask">
<dt><pre><a href="ipnet.html#IpMask"><span class="Identifier">IpMask</span></a> <span class="Other">=</span> <span class="Keyword">object</span>
<span class="Keyword">case</span> <span class="Identifier">family</span><span class="Operator">*</span><span class="Other">:</span> <a href="common.html#AddressFamily"><span class="Identifier">AddressFamily</span></a>
<span class="Keyword">of</span> <span class="Identifier">AddressFamily</span><span class="Other">.</span><span class="Identifier">None</span><span class="Other">,</span> <span class="Identifier">AddressFamily</span><span class="Other">.</span><span class="Identifier">Unix</span><span class="Other">:</span>
<span class="Keyword">nil</span>
<span class="Keyword">of</span> <span class="Identifier">AddressFamily</span><span class="Other">.</span><span class="Identifier">IPv4</span><span class="Other">:</span>
<span class="Identifier">mask4</span><span class="Operator">*</span><span class="Other">:</span> <span class="Identifier">uint32</span>
<span class="Keyword">of</span> <span class="Identifier">AddressFamily</span><span class="Other">.</span><span class="Identifier">IPv6</span><span class="Other">:</span>
<span class="Identifier">mask6</span><span class="Operator">*</span><span class="Other">:</span> <span class="Identifier">array</span><span class="Other">[</span><span class="DecNumber">2</span><span class="Other">,</span> <span class="Identifier">uint64</span><span class="Other">]</span>
</pre></dt>
<dd>
&nbsp;&nbsp;<a
href="https://github.com/status-im/nim-chronos/tree/master/chronos/transports/ipnet.nim#L20"
class="link-seesrc" target="_blank">Source</a>
&nbsp;&nbsp;<a href="https://github.com/status-im/nim-chronos/edit/devel/chronos/transports/ipnet.nim#L20" class="link-seesrc" target="_blank" >Edit</a>
</dd>
</div>
<div id="IpNet">
<dt><pre><a href="ipnet.html#IpNet"><span class="Identifier">IpNet</span></a> <span class="Other">=</span> <span class="Keyword">object</span>
<span class="Identifier">host</span><span class="Operator">*</span><span class="Other">:</span> <a href="common.html#TransportAddress"><span class="Identifier">TransportAddress</span></a>
<span class="Identifier">mask</span><span class="Operator">*</span><span class="Other">:</span> <a href="ipnet.html#IpMask"><span class="Identifier">IpMask</span></a>
</pre></dt>
<dd>
&nbsp;&nbsp;<a
href="https://github.com/status-im/nim-chronos/tree/master/chronos/transports/ipnet.nim#L29"
class="link-seesrc" target="_blank">Source</a>
&nbsp;&nbsp;<a href="https://github.com/status-im/nim-chronos/edit/devel/chronos/transports/ipnet.nim#L29" class="link-seesrc" target="_blank" >Edit</a>
</dd>
</div>
</dl></div>
<div class="section" id="12">
<h1><a class="toc-backref" href="#12">Procs</a></h1>
<dl class="item">
<div id="$,IpMask">
<dt><pre><span class="Keyword">proc</span> <a href="#%24%2CIpMask"><span class="Identifier">`$`</span></a><span class="Other">(</span><span class="Identifier">mask</span><span class="Other">:</span> <a href="ipnet.html#IpMask"><span class="Identifier">IpMask</span></a><span class="Other">;</span> <span class="Identifier">include0x</span> <span class="Other">=</span> <span class="Identifier">false</span><span class="Other">)</span><span class="Other">:</span> <span class="Identifier">string</span> {.<span><span class="Other pragmadots">...</span></span><span class="pragmawrap"><span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span>.}</pre></dt>
<dd>
Returns hexadecimal string representation of IP mask <tt class="docutils literal"><span class="pre">mask</span></tt>.
&nbsp;&nbsp;<a
href="https://github.com/status-im/nim-chronos/tree/master/chronos/transports/ipnet.nim#L320"
class="link-seesrc" target="_blank">Source</a>
&nbsp;&nbsp;<a href="https://github.com/status-im/nim-chronos/edit/devel/chronos/transports/ipnet.nim#L320" class="link-seesrc" target="_blank" >Edit</a>
</dd>
</div>
<div id="$,IpNet">
<dt><pre><span class="Keyword">proc</span> <a href="#%24%2CIpNet"><span class="Identifier">`$`</span></a><span class="Other">(</span><span class="Identifier">net</span><span class="Other">:</span> <a href="ipnet.html#IpNet"><span class="Identifier">IpNet</span></a><span class="Other">)</span><span class="Other">:</span> <span class="Identifier">string</span> {.<span><span class="Other pragmadots">...</span></span><span class="pragmawrap"><span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span>.}</pre></dt>
<dd>
Return string representation of IP network in format: &lt;IPv4 or IPv6 address&gt;/&lt;prefix length&gt;.
&nbsp;&nbsp;<a
href="https://github.com/status-im/nim-chronos/tree/master/chronos/transports/ipnet.nim#L668"
class="link-seesrc" target="_blank">Source</a>
&nbsp;&nbsp;<a href="https://github.com/status-im/nim-chronos/edit/devel/chronos/transports/ipnet.nim#L668" class="link-seesrc" target="_blank" >Edit</a>
</dd>
</div>
<div id="+,TransportAddress,">
<dt><pre><span class="Keyword">proc</span> <a href="#%2B%2CTransportAddress%2C"><span class="Identifier">`+`</span></a><span class="Other">(</span><span class="Identifier">address</span><span class="Other">:</span> <a href="common.html#TransportAddress"><span class="Identifier">TransportAddress</span></a><span class="Other">;</span> <span class="Identifier">v</span><span class="Other">:</span> <span class="Identifier">int</span> <span class="Operator">|</span> <span class="Identifier">uint</span><span class="Other">)</span><span class="Other">:</span> <a href="common.html#TransportAddress"><span class="Identifier">TransportAddress</span></a> {.
<span><span class="Other pragmadots">...</span></span><span class="pragmawrap"><span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span>.}</pre></dt>
<dd>
Add to IPv4/IPv6 transport <tt class="docutils literal"><span class="pre">address</span></tt> integer <tt class="docutils literal"><span class="pre">v</span></tt>.
&nbsp;&nbsp;<a
href="https://github.com/status-im/nim-chronos/tree/master/chronos/transports/ipnet.nim#L560"
class="link-seesrc" target="_blank">Source</a>
&nbsp;&nbsp;<a href="https://github.com/status-im/nim-chronos/edit/devel/chronos/transports/ipnet.nim#L560" class="link-seesrc" target="_blank" >Edit</a>
</dd>
</div>
<div id="-,TransportAddress,">
<dt><pre><span class="Keyword">proc</span> <a href="#-%2CTransportAddress%2C"><span class="Identifier">`-`</span></a><span class="Other">(</span><span class="Identifier">address</span><span class="Other">:</span> <a href="common.html#TransportAddress"><span class="Identifier">TransportAddress</span></a><span class="Other">;</span> <span class="Identifier">v</span><span class="Other">:</span> <span class="Identifier">int</span> <span class="Operator">|</span> <span class="Identifier">uint</span><span class="Other">)</span><span class="Other">:</span> <a href="common.html#TransportAddress"><span class="Identifier">TransportAddress</span></a> {.
<span><span class="Other pragmadots">...</span></span><span class="pragmawrap"><span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span>.}</pre></dt>
<dd>
Sub from IPv4/IPv6 transport <tt class="docutils literal"><span class="pre">address</span></tt> integer <tt class="docutils literal"><span class="pre">v</span></tt>.
&nbsp;&nbsp;<a
href="https://github.com/status-im/nim-chronos/tree/master/chronos/transports/ipnet.nim#L610"
class="link-seesrc" target="_blank">Source</a>
&nbsp;&nbsp;<a href="https://github.com/status-im/nim-chronos/edit/devel/chronos/transports/ipnet.nim#L610" class="link-seesrc" target="_blank" >Edit</a>
</dd>
</div>
<div id="==,IpMask,IpMask">
<dt><pre><span class="Keyword">proc</span> <a href="#%3D%3D%2CIpMask%2CIpMask"><span class="Identifier">`==`</span></a><span class="Other">(</span><span class="Identifier">m1</span><span class="Other">,</span> <span class="Identifier">m2</span><span class="Other">:</span> <a href="ipnet.html#IpMask"><span class="Identifier">IpMask</span></a><span class="Other">)</span><span class="Other">:</span> <span class="Identifier">bool</span> {.<span class="Identifier">inline</span><span class="Other">,</span> <span><span class="Other pragmadots">...</span></span><span class="pragmawrap"><span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span>.}</pre></dt>
<dd>
Returns <tt class="docutils literal"><span class="pre">true</span></tt> if masks <tt class="docutils literal"><span class="pre">m1</span></tt> and <tt class="docutils literal"><span class="pre">m2</span></tt> are equal in IP family and by value.
&nbsp;&nbsp;<a
href="https://github.com/status-im/nim-chronos/tree/master/chronos/transports/ipnet.nim#L33"
class="link-seesrc" target="_blank">Source</a>
&nbsp;&nbsp;<a href="https://github.com/status-im/nim-chronos/edit/devel/chronos/transports/ipnet.nim#L33" class="link-seesrc" target="_blank" >Edit</a>
</dd>
</div>
<div id="==,IpNet,IpNet">
<dt><pre><span class="Keyword">proc</span> <a href="#%3D%3D%2CIpNet%2CIpNet"><span class="Identifier">`==`</span></a><span class="Other">(</span><span class="Identifier">n1</span><span class="Other">,</span> <span class="Identifier">n2</span><span class="Other">:</span> <a href="ipnet.html#IpNet"><span class="Identifier">IpNet</span></a><span class="Other">)</span><span class="Other">:</span> <span class="Identifier">bool</span> {.<span class="Identifier">inline</span><span class="Other">,</span> <span><span class="Other pragmadots">...</span></span><span class="pragmawrap"><span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span>.}</pre></dt>
<dd>
Returns <tt class="docutils literal"><span class="pre">true</span></tt> if networks <tt class="docutils literal"><span class="pre">n1</span></tt> and <tt class="docutils literal"><span class="pre">n2</span></tt> are equal in IP family and by value.
&nbsp;&nbsp;<a
href="https://github.com/status-im/nim-chronos/tree/master/chronos/transports/ipnet.nim#L438"
class="link-seesrc" target="_blank">Source</a>
&nbsp;&nbsp;<a href="https://github.com/status-im/nim-chronos/edit/devel/chronos/transports/ipnet.nim#L438" class="link-seesrc" target="_blank" >Edit</a>
</dd>
</div>
<div id="and,TransportAddress,TransportAddress">
<dt><pre><span class="Keyword">proc</span> <a href="#and%2CTransportAddress%2CTransportAddress"><span class="Identifier">`and`</span></a><span class="Other">(</span><span class="Identifier">address1</span><span class="Other">,</span> <span class="Identifier">address2</span><span class="Other">:</span> <a href="common.html#TransportAddress"><span class="Identifier">TransportAddress</span></a><span class="Other">)</span><span class="Other">:</span> <a href="common.html#TransportAddress"><span class="Identifier">TransportAddress</span></a> {.<span><span class="Other pragmadots">...</span></span><span class="pragmawrap"><span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span>
<span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span>.}</pre></dt>
<dd>
<p>Bitwise <tt class="docutils literal"><span class="pre">and</span></tt> operation for <tt class="docutils literal"><span class="pre">address1 and address2</span></tt>.</p>
<p>Note only IPv4 and IPv6 addresses are supported. <tt class="docutils literal"><span class="pre">address1</span></tt> and <tt class="docutils literal"><span class="pre">address2</span></tt> must be in equal IP family</p>
&nbsp;&nbsp;<a
href="https://github.com/status-im/nim-chronos/tree/master/chronos/transports/ipnet.nim#L491"
class="link-seesrc" target="_blank">Source</a>
&nbsp;&nbsp;<a href="https://github.com/status-im/nim-chronos/edit/devel/chronos/transports/ipnet.nim#L491" class="link-seesrc" target="_blank" >Edit</a>
</dd>
</div>
<div id="not,TransportAddress">
<dt><pre><span class="Keyword">proc</span> <a href="#not%2CTransportAddress"><span class="Identifier">`not`</span></a><span class="Other">(</span><span class="Identifier">address</span><span class="Other">:</span> <a href="common.html#TransportAddress"><span class="Identifier">TransportAddress</span></a><span class="Other">)</span><span class="Other">:</span> <a href="common.html#TransportAddress"><span class="Identifier">TransportAddress</span></a> {.<span><span class="Other pragmadots">...</span></span><span class="pragmawrap"><span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span>.}</pre></dt>
<dd>
Bitwise <tt class="docutils literal"><span class="pre">not</span></tt> operation for <tt class="docutils literal"><span class="pre">address</span></tt>.
&nbsp;&nbsp;<a
href="https://github.com/status-im/nim-chronos/tree/master/chronos/transports/ipnet.nim#L543"
class="link-seesrc" target="_blank">Source</a>
&nbsp;&nbsp;<a href="https://github.com/status-im/nim-chronos/edit/devel/chronos/transports/ipnet.nim#L543" class="link-seesrc" target="_blank" >Edit</a>
</dd>
</div>
<div id="or,TransportAddress,TransportAddress">
<dt><pre><span class="Keyword">proc</span> <a href="#or%2CTransportAddress%2CTransportAddress"><span class="Identifier">`or`</span></a><span class="Other">(</span><span class="Identifier">address1</span><span class="Other">,</span> <span class="Identifier">address2</span><span class="Other">:</span> <a href="common.html#TransportAddress"><span class="Identifier">TransportAddress</span></a><span class="Other">)</span><span class="Other">:</span> <a href="common.html#TransportAddress"><span class="Identifier">TransportAddress</span></a> {.<span><span class="Other pragmadots">...</span></span><span class="pragmawrap"><span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span>
<span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span>.}</pre></dt>
<dd>
<p>Bitwise <tt class="docutils literal"><span class="pre">or</span></tt> operation for <tt class="docutils literal"><span class="pre">address1 or address2</span></tt>.</p>
<p>Note only IPv4 and IPv6 addresses are supported. <tt class="docutils literal"><span class="pre">address1</span></tt> and <tt class="docutils literal"><span class="pre">address2</span></tt> must be in equal IP family</p>
&nbsp;&nbsp;<a
href="https://github.com/status-im/nim-chronos/tree/master/chronos/transports/ipnet.nim#L517"
class="link-seesrc" target="_blank">Source</a>
&nbsp;&nbsp;<a href="https://github.com/status-im/nim-chronos/edit/devel/chronos/transports/ipnet.nim#L517" class="link-seesrc" target="_blank" >Edit</a>
</dd>
</div>
<div id="broadcast,IpNet">
<dt><pre><span class="Keyword">proc</span> <a href="#broadcast%2CIpNet"><span class="Identifier">broadcast</span></a><span class="Other">(</span><span class="Identifier">net</span><span class="Other">:</span> <a href="ipnet.html#IpNet"><span class="Identifier">IpNet</span></a><span class="Other">)</span><span class="Other">:</span> <a href="common.html#TransportAddress"><span class="Identifier">TransportAddress</span></a> {.<span><span class="Other pragmadots">...</span></span><span class="pragmawrap"><span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span>.}</pre></dt>
<dd>
Returns broadcast address for IP Network <tt class="docutils literal"><span class="pre">net</span></tt>.
&nbsp;&nbsp;<a
href="https://github.com/status-im/nim-chronos/tree/master/chronos/transports/ipnet.nim#L460"
class="link-seesrc" target="_blank">Source</a>
&nbsp;&nbsp;<a href="https://github.com/status-im/nim-chronos/edit/devel/chronos/transports/ipnet.nim#L460" class="link-seesrc" target="_blank" >Edit</a>
</dd>
</div>
<div id="contains,IpNet,TransportAddress">
<dt><pre><span class="Keyword">proc</span> <a href="#contains%2CIpNet%2CTransportAddress"><span class="Identifier">contains</span></a><span class="Other">(</span><span class="Identifier">net</span><span class="Other">:</span> <a href="ipnet.html#IpNet"><span class="Identifier">IpNet</span></a><span class="Other">;</span> <span class="Identifier">address</span><span class="Other">:</span> <a href="common.html#TransportAddress"><span class="Identifier">TransportAddress</span></a><span class="Other">)</span><span class="Other">:</span> <span class="Identifier">bool</span> {.<span><span class="Other pragmadots">...</span></span><span class="pragmawrap"><span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span>
<span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span>.}</pre></dt>
<dd>
Returns <tt class="docutils literal"><span class="pre">true</span></tt> if <tt class="docutils literal"><span class="pre">address</span></tt> belongs to IP Network <tt class="docutils literal"><span class="pre">net</span></tt>
&nbsp;&nbsp;<a
href="https://github.com/status-im/nim-chronos/tree/master/chronos/transports/ipnet.nim#L451"
class="link-seesrc" target="_blank">Source</a>
&nbsp;&nbsp;<a href="https://github.com/status-im/nim-chronos/edit/devel/chronos/transports/ipnet.nim#L451" class="link-seesrc" target="_blank" >Edit</a>
</dd>
</div>
<div id="dec,TransportAddress,int">
<dt><pre><span class="Keyword">proc</span> <a href="#dec%2CTransportAddress%2Cint"><span class="Identifier">dec</span></a><span class="Other">(</span><span class="Identifier">address</span><span class="Other">:</span> <span class="Keyword">var</span> <a href="common.html#TransportAddress"><span class="Identifier">TransportAddress</span></a><span class="Other">;</span> <span class="Identifier">v</span><span class="Other">:</span> <span class="Identifier">int</span> <span class="Other">=</span> <span class="DecNumber">1</span><span class="Other">)</span> {.<span><span class="Other pragmadots">...</span></span><span class="pragmawrap"><span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span>.}</pre></dt>
<dd>
Decrement IPv4/IPv6 transport <tt class="docutils literal"><span class="pre">address</span></tt> by integer <tt class="docutils literal"><span class="pre">v</span></tt>.
&nbsp;&nbsp;<a
href="https://github.com/status-im/nim-chronos/tree/master/chronos/transports/ipnet.nim#L664"
class="link-seesrc" target="_blank">Source</a>
&nbsp;&nbsp;<a href="https://github.com/status-im/nim-chronos/edit/devel/chronos/transports/ipnet.nim#L664" class="link-seesrc" target="_blank" >Edit</a>
</dd>
</div>
<div id="inc,TransportAddress,int">
<dt><pre><span class="Keyword">proc</span> <a href="#inc%2CTransportAddress%2Cint"><span class="Identifier">inc</span></a><span class="Other">(</span><span class="Identifier">address</span><span class="Other">:</span> <span class="Keyword">var</span> <a href="common.html#TransportAddress"><span class="Identifier">TransportAddress</span></a><span class="Other">;</span> <span class="Identifier">v</span><span class="Other">:</span> <span class="Identifier">int</span> <span class="Other">=</span> <span class="DecNumber">1</span><span class="Other">)</span> {.<span><span class="Other pragmadots">...</span></span><span class="pragmawrap"><span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span>.}</pre></dt>
<dd>
Increment IPv4/IPv6 transport <tt class="docutils literal"><span class="pre">address</span></tt> by integer <tt class="docutils literal"><span class="pre">v</span></tt>.
&nbsp;&nbsp;<a
href="https://github.com/status-im/nim-chronos/tree/master/chronos/transports/ipnet.nim#L660"
class="link-seesrc" target="_blank">Source</a>
&nbsp;&nbsp;<a href="https://github.com/status-im/nim-chronos/edit/devel/chronos/transports/ipnet.nim#L660" class="link-seesrc" target="_blank" >Edit</a>
</dd>
</div>
<div id="init,typedesc[IpMask],AddressFamily,int">
<dt><pre><span class="Keyword">proc</span> <a href="#init%2Ctypedesc%5BIpMask%5D%2CAddressFamily%2Cint"><span class="Identifier">init</span></a><span class="Other">(</span><span class="Identifier">t</span><span class="Other">:</span> <span class="Identifier">typedesc</span><span class="Other">[</span><a href="ipnet.html#IpMask"><span class="Identifier">IpMask</span></a><span class="Other">]</span><span class="Other">;</span> <span class="Identifier">family</span><span class="Other">:</span> <a href="common.html#AddressFamily"><span class="Identifier">AddressFamily</span></a><span class="Other">;</span> <span class="Identifier">prefix</span><span class="Other">:</span> <span class="Identifier">int</span><span class="Other">)</span><span class="Other">:</span> <a href="ipnet.html#IpMask"><span class="Identifier">IpMask</span></a> {.
<span><span class="Other pragmadots">...</span></span><span class="pragmawrap"><span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span>.}</pre></dt>
<dd>
Initialize mask of IP family <tt class="docutils literal"><span class="pre">family</span></tt> from prefix length <tt class="docutils literal"><span class="pre">prefix</span></tt>.
&nbsp;&nbsp;<a
href="https://github.com/status-im/nim-chronos/tree/master/chronos/transports/ipnet.nim#L47"
class="link-seesrc" target="_blank">Source</a>
&nbsp;&nbsp;<a href="https://github.com/status-im/nim-chronos/edit/devel/chronos/transports/ipnet.nim#L47" class="link-seesrc" target="_blank" >Edit</a>
</dd>
</div>
<div id="init,typedesc[IpMask],string">
<dt><pre><span class="Keyword">proc</span> <a href="#init%2Ctypedesc%5BIpMask%5D%2Cstring"><span class="Identifier">init</span></a><span class="Other">(</span><span class="Identifier">t</span><span class="Other">:</span> <span class="Identifier">typedesc</span><span class="Other">[</span><a href="ipnet.html#IpMask"><span class="Identifier">IpMask</span></a><span class="Other">]</span><span class="Other">;</span> <span class="Identifier">netmask</span><span class="Other">:</span> <span class="Identifier">string</span><span class="Other">)</span><span class="Other">:</span> <a href="ipnet.html#IpMask"><span class="Identifier">IpMask</span></a> {.<span><span class="Other pragmadots">...</span></span><span class="pragmawrap"><span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span>.}</pre></dt>
<dd>
<p>Initialize network mask using hexadecimal string representation <tt class="docutils literal"><span class="pre">netmask</span></tt>.</p>
<p>If <tt class="docutils literal"><span class="pre">netmask</span></tt> mask is invalid, result IpMask.family will be set to <tt class="docutils literal"><span class="pre">AddressFamily.None</span></tt>.</p>
&nbsp;&nbsp;<a
href="https://github.com/status-im/nim-chronos/tree/master/chronos/transports/ipnet.nim#L104"
class="link-seesrc" target="_blank">Source</a>
&nbsp;&nbsp;<a href="https://github.com/status-im/nim-chronos/edit/devel/chronos/transports/ipnet.nim#L104" class="link-seesrc" target="_blank" >Edit</a>
</dd>
</div>
<div id="init,typedesc[IpMask],TransportAddress">
<dt><pre><span class="Keyword">proc</span> <a href="#init%2Ctypedesc%5BIpMask%5D%2CTransportAddress"><span class="Identifier">init</span></a><span class="Other">(</span><span class="Identifier">t</span><span class="Other">:</span> <span class="Identifier">typedesc</span><span class="Other">[</span><a href="ipnet.html#IpMask"><span class="Identifier">IpMask</span></a><span class="Other">]</span><span class="Other">;</span> <span class="Identifier">netmask</span><span class="Other">:</span> <a href="common.html#TransportAddress"><span class="Identifier">TransportAddress</span></a><span class="Other">)</span><span class="Other">:</span> <a href="ipnet.html#IpMask"><span class="Identifier">IpMask</span></a> {.<span><span class="Other pragmadots">...</span></span><span class="pragmawrap"><span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span>.}</pre></dt>
<dd>
Initialize network mask using address <tt class="docutils literal"><span class="pre">netmask</span></tt>.
&nbsp;&nbsp;<a
href="https://github.com/status-im/nim-chronos/tree/master/chronos/transports/ipnet.nim#L78"
class="link-seesrc" target="_blank">Source</a>
&nbsp;&nbsp;<a href="https://github.com/status-im/nim-chronos/edit/devel/chronos/transports/ipnet.nim#L78" class="link-seesrc" target="_blank" >Edit</a>
</dd>
</div>
<div id="init,typedesc[IpNet],TransportAddress,TransportAddress">
<dt><pre><span class="Keyword">proc</span> <a href="#init%2Ctypedesc%5BIpNet%5D%2CTransportAddress%2CTransportAddress"><span class="Identifier">init</span></a><span class="Other">(</span><span class="Identifier">t</span><span class="Other">:</span> <span class="Identifier">typedesc</span><span class="Other">[</span><a href="ipnet.html#IpNet"><span class="Identifier">IpNet</span></a><span class="Other">]</span><span class="Other">;</span> <span class="Identifier">host</span><span class="Other">,</span> <span class="Identifier">mask</span><span class="Other">:</span> <a href="common.html#TransportAddress"><span class="Identifier">TransportAddress</span></a><span class="Other">)</span><span class="Other">:</span> <a href="ipnet.html#IpNet"><span class="Identifier">IpNet</span></a> {.<span class="Identifier">inline</span><span class="Other">,</span>
<span><span class="Other pragmadots">...</span></span><span class="pragmawrap"><span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span>.}</pre></dt>
<dd>
<p>Initialize IP Network using host address <tt class="docutils literal"><span class="pre">host</span></tt> and network mask address <tt class="docutils literal"><span class="pre">mask</span></tt>.</p>
<p>Note that <tt class="docutils literal"><span class="pre">host</span></tt> and <tt class="docutils literal"><span class="pre">mask</span></tt> must be from the same IP family.</p>
&nbsp;&nbsp;<a
href="https://github.com/status-im/nim-chronos/tree/master/chronos/transports/ipnet.nim#L372"
class="link-seesrc" target="_blank">Source</a>
&nbsp;&nbsp;<a href="https://github.com/status-im/nim-chronos/edit/devel/chronos/transports/ipnet.nim#L372" class="link-seesrc" target="_blank" >Edit</a>
</dd>
</div>
<div id="init,typedesc[IpNet],TransportAddress,IpMask">
<dt><pre><span class="Keyword">proc</span> <a href="#init%2Ctypedesc%5BIpNet%5D%2CTransportAddress%2CIpMask"><span class="Identifier">init</span></a><span class="Other">(</span><span class="Identifier">t</span><span class="Other">:</span> <span class="Identifier">typedesc</span><span class="Other">[</span><a href="ipnet.html#IpNet"><span class="Identifier">IpNet</span></a><span class="Other">]</span><span class="Other">;</span> <span class="Identifier">host</span><span class="Other">:</span> <a href="common.html#TransportAddress"><span class="Identifier">TransportAddress</span></a><span class="Other">;</span> <span class="Identifier">mask</span><span class="Other">:</span> <a href="ipnet.html#IpMask"><span class="Identifier">IpMask</span></a><span class="Other">)</span><span class="Other">:</span> <a href="ipnet.html#IpNet"><span class="Identifier">IpNet</span></a> {.
<span class="Identifier">inline</span><span class="Other">,</span> <span><span class="Other pragmadots">...</span></span><span class="pragmawrap"><span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span>.}</pre></dt>
<dd>
Initialize IP Network using host address <tt class="docutils literal"><span class="pre">host</span></tt> and network mask <tt class="docutils literal"><span class="pre">mask</span></tt>.
&nbsp;&nbsp;<a
href="https://github.com/status-im/nim-chronos/tree/master/chronos/transports/ipnet.nim#L380"
class="link-seesrc" target="_blank">Source</a>
&nbsp;&nbsp;<a href="https://github.com/status-im/nim-chronos/edit/devel/chronos/transports/ipnet.nim#L380" class="link-seesrc" target="_blank" >Edit</a>
</dd>
</div>
<div id="init,typedesc[IpNet],TransportAddress,int">
<dt><pre><span class="Keyword">proc</span> <a href="#init%2Ctypedesc%5BIpNet%5D%2CTransportAddress%2Cint"><span class="Identifier">init</span></a><span class="Other">(</span><span class="Identifier">t</span><span class="Other">:</span> <span class="Identifier">typedesc</span><span class="Other">[</span><a href="ipnet.html#IpNet"><span class="Identifier">IpNet</span></a><span class="Other">]</span><span class="Other">;</span> <span class="Identifier">host</span><span class="Other">:</span> <a href="common.html#TransportAddress"><span class="Identifier">TransportAddress</span></a><span class="Other">;</span> <span class="Identifier">prefix</span><span class="Other">:</span> <span class="Identifier">int</span><span class="Other">)</span><span class="Other">:</span> <a href="ipnet.html#IpNet"><span class="Identifier">IpNet</span></a> {.
<span class="Identifier">inline</span><span class="Other">,</span> <span><span class="Other pragmadots">...</span></span><span class="pragmawrap"><span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span>.}</pre></dt>
<dd>
Initialize IP Network using host address <tt class="docutils literal"><span class="pre">host</span></tt> and prefix length <tt class="docutils literal"><span class="pre">prefix</span></tt>.
&nbsp;&nbsp;<a
href="https://github.com/status-im/nim-chronos/tree/master/chronos/transports/ipnet.nim#L366"
class="link-seesrc" target="_blank">Source</a>
&nbsp;&nbsp;<a href="https://github.com/status-im/nim-chronos/edit/devel/chronos/transports/ipnet.nim#L366" class="link-seesrc" target="_blank" >Edit</a>
</dd>
</div>
<div id="init,typedesc[IpNet],string">
<dt><pre><span class="Keyword">proc</span> <a href="#init%2Ctypedesc%5BIpNet%5D%2Cstring"><span class="Identifier">init</span></a><span class="Other">(</span><span class="Identifier">t</span><span class="Other">:</span> <span class="Identifier">typedesc</span><span class="Other">[</span><a href="ipnet.html#IpNet"><span class="Identifier">IpNet</span></a><span class="Other">]</span><span class="Other">;</span> <span class="Identifier">network</span><span class="Other">:</span> <span class="Identifier">string</span><span class="Other">)</span><span class="Other">:</span> <a href="ipnet.html#IpNet"><span class="Identifier">IpNet</span></a> {.
<span><span class="Other pragmadots">...</span></span><span class="pragmawrap"><span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><a href="common.html#TransportAddressError"><span class="Identifier">TransportAddressError</span></a><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span>.}</pre></dt>
<dd>
Initialize IP Network from string representation in format &lt;address&gt;/&lt;prefix length&gt; or &lt;address&gt;/&lt;netmask address&gt;.
&nbsp;&nbsp;<a
href="https://github.com/status-im/nim-chronos/tree/master/chronos/transports/ipnet.nim#L386"
class="link-seesrc" target="_blank">Source</a>
&nbsp;&nbsp;<a href="https://github.com/status-im/nim-chronos/edit/devel/chronos/transports/ipnet.nim#L386" class="link-seesrc" target="_blank" >Edit</a>
</dd>
</div>
<div id="initIp,typedesc[IpMask],string">
<dt><pre><span class="Keyword">proc</span> <a href="#initIp%2Ctypedesc%5BIpMask%5D%2Cstring"><span class="Identifier">initIp</span></a><span class="Other">(</span><span class="Identifier">t</span><span class="Other">:</span> <span class="Identifier">typedesc</span><span class="Other">[</span><a href="ipnet.html#IpMask"><span class="Identifier">IpMask</span></a><span class="Other">]</span><span class="Other">;</span> <span class="Identifier">netmask</span><span class="Other">:</span> <span class="Identifier">string</span><span class="Other">)</span><span class="Other">:</span> <a href="ipnet.html#IpMask"><span class="Identifier">IpMask</span></a> {.<span><span class="Other pragmadots">...</span></span><span class="pragmawrap"><span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span>.}</pre></dt>
<dd>
<p>Initialize network mask using IPv4 or IPv6 address in text representation <tt class="docutils literal"><span class="pre">netmask</span></tt>.</p>
<p>If <tt class="docutils literal"><span class="pre">netmask</span></tt> address string is invalid, result IpMask.family will be set to <tt class="docutils literal"><span class="pre">AddressFamily.None</span></tt>.</p>
&nbsp;&nbsp;<a
href="https://github.com/status-im/nim-chronos/tree/master/chronos/transports/ipnet.nim#L92"
class="link-seesrc" target="_blank">Source</a>
&nbsp;&nbsp;<a href="https://github.com/status-im/nim-chronos/edit/devel/chronos/transports/ipnet.nim#L92" class="link-seesrc" target="_blank" >Edit</a>
</dd>
</div>
<div id="ip,IpMask">
<dt><pre><span class="Keyword">proc</span> <a href="#ip%2CIpMask"><span class="Identifier">ip</span></a><span class="Other">(</span><span class="Identifier">mask</span><span class="Other">:</span> <a href="ipnet.html#IpMask"><span class="Identifier">IpMask</span></a><span class="Other">)</span><span class="Other">:</span> <span class="Identifier">string</span> {.<span><span class="Other pragmadots">...</span></span><span class="pragmawrap"><span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Identifier">ValueError</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span>.}</pre></dt>
<dd>
Returns IP address text representation of IP mask <tt class="docutils literal"><span class="pre">mask</span></tt>.
&nbsp;&nbsp;<a
href="https://github.com/status-im/nim-chronos/tree/master/chronos/transports/ipnet.nim#L353"
class="link-seesrc" target="_blank">Source</a>
&nbsp;&nbsp;<a href="https://github.com/status-im/nim-chronos/edit/devel/chronos/transports/ipnet.nim#L353" class="link-seesrc" target="_blank" >Edit</a>
</dd>
</div>
<div id="isAnyLocal,TransportAddress">
<dt><pre><span class="Keyword">proc</span> <a href="#isAnyLocal%2CTransportAddress"><span class="Identifier">isAnyLocal</span></a><span class="Other">(</span><span class="Identifier">address</span><span class="Other">:</span> <a href="common.html#TransportAddress"><span class="Identifier">TransportAddress</span></a><span class="Other">)</span><span class="Other">:</span> <span class="Identifier">bool</span> {.<span><span class="Other pragmadots">...</span></span><span class="pragmawrap"><span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span>.}</pre></dt>
<dd>
<p>Returns <tt class="docutils literal"><span class="pre">true</span></tt> if <tt class="docutils literal"><span class="pre">address</span></tt> is a wildcard address.</p>
<p><tt class="docutils literal"><span class="pre">IPv4</span></tt>: 0.0.0.0</p>
<p><tt class="docutils literal"><span class="pre">IPv6</span></tt>: ::</p>
&nbsp;&nbsp;<a
href="https://github.com/status-im/nim-chronos/tree/master/chronos/transports/ipnet.nim#L813"
class="link-seesrc" target="_blank">Source</a>
&nbsp;&nbsp;<a href="https://github.com/status-im/nim-chronos/edit/devel/chronos/transports/ipnet.nim#L813" class="link-seesrc" target="_blank" >Edit</a>
</dd>
</div>
<div id="isBenchmarking,TransportAddress">
<dt><pre><span class="Keyword">proc</span> <a href="#isBenchmarking%2CTransportAddress"><span class="Identifier">isBenchmarking</span></a><span class="Other">(</span><span class="Identifier">address</span><span class="Other">:</span> <a href="common.html#TransportAddress"><span class="Identifier">TransportAddress</span></a><span class="Other">)</span><span class="Other">:</span> <span class="Identifier">bool</span> {.<span><span class="Other pragmadots">...</span></span><span class="pragmawrap"><span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span>.}</pre></dt>
<dd>
<p>Returns <tt class="docutils literal"><span class="pre">true</span></tt> if <tt class="docutils literal"><span class="pre">address</span></tt> is part of the <tt class="docutils literal"><span class="pre"><span class="FloatNumber">198.18</span><span class="Operator">.</span><span class="FloatNumber">0.0</span><span class="Operator">/</span><span class="DecNumber">15</span></span></tt> range, which is reserved for network devices benchmarking. This range is defined in [IETF RFC 2544] as <tt class="docutils literal"><span class="pre"><span class="FloatNumber">198.18</span><span class="Operator">.</span><span class="FloatNumber">0.0</span></span></tt> through <tt class="docutils literal"><span class="pre"><span class="FloatNumber">198.19</span><span class="Operator">.</span><span class="FloatNumber">255.255</span></span></tt> but [errata 423] corrects it to <tt class="docutils literal"><span class="pre"><span class="FloatNumber">198.18</span><span class="Operator">.</span><span class="FloatNumber">0.0</span><span class="Operator">/</span><span class="DecNumber">15</span></span></tt>.</p>
<p><tt class="docutils literal"><span class="pre">IPv4</span></tt>: 198.18.0.0/15</p>
<p><tt class="docutils literal"><span class="pre">IPv6</span></tt>: 2001:2::/48</p>
&nbsp;&nbsp;<a
href="https://github.com/status-im/nim-chronos/tree/master/chronos/transports/ipnet.nim#L905"
class="link-seesrc" target="_blank">Source</a>
&nbsp;&nbsp;<a href="https://github.com/status-im/nim-chronos/edit/devel/chronos/transports/ipnet.nim#L905" class="link-seesrc" target="_blank" >Edit</a>
</dd>
</div>
<div id="isBroadcast,TransportAddress">
<dt><pre><span class="Keyword">proc</span> <a href="#isBroadcast%2CTransportAddress"><span class="Identifier">isBroadcast</span></a><span class="Other">(</span><span class="Identifier">address</span><span class="Other">:</span> <a href="common.html#TransportAddress"><span class="Identifier">TransportAddress</span></a><span class="Other">)</span><span class="Other">:</span> <span class="Identifier">bool</span> {.<span><span class="Other pragmadots">...</span></span><span class="pragmawrap"><span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span>.}</pre></dt>
<dd>
<p>Returns <tt class="docutils literal"><span class="pre">true</span></tt> if <tt class="docutils literal"><span class="pre">address</span></tt> is a broadcast address.</p>
<p><tt class="docutils literal"><span class="pre">IPv4</span></tt>: 255.255.255.255</p>
&nbsp;&nbsp;<a
href="https://github.com/status-im/nim-chronos/tree/master/chronos/transports/ipnet.nim#L893"
class="link-seesrc" target="_blank">Source</a>
&nbsp;&nbsp;<a href="https://github.com/status-im/nim-chronos/edit/devel/chronos/transports/ipnet.nim#L893" class="link-seesrc" target="_blank" >Edit</a>
</dd>
</div>
<div id="isDocumentation,TransportAddress">
<dt><pre><span class="Keyword">proc</span> <a href="#isDocumentation%2CTransportAddress"><span class="Identifier">isDocumentation</span></a><span class="Other">(</span><span class="Identifier">address</span><span class="Other">:</span> <a href="common.html#TransportAddress"><span class="Identifier">TransportAddress</span></a><span class="Other">)</span><span class="Other">:</span> <span class="Identifier">bool</span> {.<span><span class="Other pragmadots">...</span></span><span class="pragmawrap"><span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span>.}</pre></dt>
<dd>
Returns <tt class="docutils literal"><span class="pre">true</span></tt> if <tt class="docutils literal"><span class="pre">address</span></tt> is in a range designated for documentation.<dl class="docutils"><dt><tt class="docutils literal"><span class="pre">IPv4</span></tt>: 192.0.2.0/24 (TEST-NET-1)</dt>
<dd>198.51.100.0/24 (TEST-NET-2) 203.0.113.0/24 (TEST-NET-3)</dd>
</dl>
<p><tt class="docutils literal"><span class="pre">IPv6</span></tt>: 2001:DB8::/32</p>
&nbsp;&nbsp;<a
href="https://github.com/status-im/nim-chronos/tree/master/chronos/transports/ipnet.nim#L924"
class="link-seesrc" target="_blank">Source</a>
&nbsp;&nbsp;<a href="https://github.com/status-im/nim-chronos/edit/devel/chronos/transports/ipnet.nim#L924" class="link-seesrc" target="_blank" >Edit</a>
</dd>
</div>
<div id="isGlobal,TransportAddress">
<dt><pre><span class="Keyword">proc</span> <a href="#isGlobal%2CTransportAddress"><span class="Identifier">isGlobal</span></a><span class="Other">(</span><span class="Identifier">address</span><span class="Other">:</span> <a href="common.html#TransportAddress"><span class="Identifier">TransportAddress</span></a><span class="Other">)</span><span class="Other">:</span> <span class="Identifier">bool</span> {.<span><span class="Other pragmadots">...</span></span><span class="pragmawrap"><span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span>.}</pre></dt>
<dd>
Returns <tt class="docutils literal"><span class="pre">true</span></tt> if <tt class="docutils literal"><span class="pre">address</span></tt> appears to be globally reachable as specified by the [IANA IPv4 Special-Purpose Address Registry].
&nbsp;&nbsp;<a
href="https://github.com/status-im/nim-chronos/tree/master/chronos/transports/ipnet.nim#L960"
class="link-seesrc" target="_blank">Source</a>
&nbsp;&nbsp;<a href="https://github.com/status-im/nim-chronos/edit/devel/chronos/transports/ipnet.nim#L960" class="link-seesrc" target="_blank" >Edit</a>
</dd>
</div>
<div id="isGlobalMulticast,TransportAddress">
<dt><pre><span class="Keyword">proc</span> <a href="#isGlobalMulticast%2CTransportAddress"><span class="Identifier">isGlobalMulticast</span></a><span class="Other">(</span><span class="Identifier">address</span><span class="Other">:</span> <a href="common.html#TransportAddress"><span class="Identifier">TransportAddress</span></a><span class="Other">)</span><span class="Other">:</span> <span class="Identifier">bool</span> {.<span><span class="Other pragmadots">...</span></span><span class="pragmawrap"><span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span>.}</pre></dt>
<dd>
<p>Returns <tt class="docutils literal"><span class="pre">true</span></tt> if the multicast address has global scope.</p>
<p><tt class="docutils literal"><span class="pre">IPv4</span></tt>: 224.0.1.0 - 238.255.255.255</p>
<p><tt class="docutils literal"><span class="pre">IPv6</span></tt>: FF0E:: - FFFE:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF</p>
&nbsp;&nbsp;<a
href="https://github.com/status-im/nim-chronos/tree/master/chronos/transports/ipnet.nim#L865"
class="link-seesrc" target="_blank">Source</a>
&nbsp;&nbsp;<a href="https://github.com/status-im/nim-chronos/edit/devel/chronos/transports/ipnet.nim#L865" class="link-seesrc" target="_blank" >Edit</a>
</dd>
</div>
<div id="isInterfaceLocalMulticast,TransportAddress">
<dt><pre><span class="Keyword">proc</span> <a href="#isInterfaceLocalMulticast%2CTransportAddress"><span class="Identifier">isInterfaceLocalMulticast</span></a><span class="Other">(</span><span class="Identifier">address</span><span class="Other">:</span> <a href="common.html#TransportAddress"><span class="Identifier">TransportAddress</span></a><span class="Other">)</span><span class="Other">:</span> <span class="Identifier">bool</span> {.<span><span class="Other pragmadots">...</span></span><span class="pragmawrap"><span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span>
<span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span>.}</pre></dt>
<dd>
<p>Returns <tt class="docutils literal"><span class="pre">true</span></tt> if <tt class="docutils literal"><span class="pre">address</span></tt> is interface local multicast address.</p>
<p><tt class="docutils literal"><span class="pre">IPv4</span></tt>: N/A (always returns <tt class="docutils literal"><span class="pre">false</span></tt>)</p>
&nbsp;&nbsp;<a
href="https://github.com/status-im/nim-chronos/tree/master/chronos/transports/ipnet.nim#L744"
class="link-seesrc" target="_blank">Source</a>
&nbsp;&nbsp;<a href="https://github.com/status-im/nim-chronos/edit/devel/chronos/transports/ipnet.nim#L744" class="link-seesrc" target="_blank" >Edit</a>
</dd>
</div>
<div id="isLinkLocal,TransportAddress">
<dt><pre><span class="Keyword">proc</span> <a href="#isLinkLocal%2CTransportAddress"><span class="Identifier">isLinkLocal</span></a><span class="Other">(</span><span class="Identifier">address</span><span class="Other">:</span> <a href="common.html#TransportAddress"><span class="Identifier">TransportAddress</span></a><span class="Other">)</span><span class="Other">:</span> <span class="Identifier">bool</span> {.<span><span class="Other pragmadots">...</span></span><span class="pragmawrap"><span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span>.}</pre></dt>
<dd>
<p>Returns <tt class="docutils literal"><span class="pre">true</span></tt> if <tt class="docutils literal"><span class="pre">address</span></tt> is link local address.</p>
<p><tt class="docutils literal"><span class="pre">IPv4</span></tt>: 169.254.0.0 - 169.254.255.255</p>
<p><tt class="docutils literal"><span class="pre">IPv6</span></tt>: FE80:: - FEBF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF</p>
&nbsp;&nbsp;<a
href="https://github.com/status-im/nim-chronos/tree/master/chronos/transports/ipnet.nim#L828"
class="link-seesrc" target="_blank">Source</a>
&nbsp;&nbsp;<a href="https://github.com/status-im/nim-chronos/edit/devel/chronos/transports/ipnet.nim#L828" class="link-seesrc" target="_blank" >Edit</a>
</dd>
</div>
<div id="isLinkLocalMulticast,TransportAddress">
<dt><pre><span class="Keyword">proc</span> <a href="#isLinkLocalMulticast%2CTransportAddress"><span class="Identifier">isLinkLocalMulticast</span></a><span class="Other">(</span><span class="Identifier">address</span><span class="Other">:</span> <a href="common.html#TransportAddress"><span class="Identifier">TransportAddress</span></a><span class="Other">)</span><span class="Other">:</span> <span class="Identifier">bool</span> {.<span><span class="Other pragmadots">...</span></span><span class="pragmawrap"><span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span>
<span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span>.}</pre></dt>
<dd>
<p>Returns <tt class="docutils literal"><span class="pre">true</span></tt> if <tt class="docutils literal"><span class="pre">address</span></tt> is link local multicast address.</p>
<p><tt class="docutils literal"><span class="pre">IPv4</span></tt>: 224.0.0.0 - 224.0.0.255</p>
&nbsp;&nbsp;<a
href="https://github.com/status-im/nim-chronos/tree/master/chronos/transports/ipnet.nim#L756"
class="link-seesrc" target="_blank">Source</a>
&nbsp;&nbsp;<a href="https://github.com/status-im/nim-chronos/edit/devel/chronos/transports/ipnet.nim#L756" class="link-seesrc" target="_blank" >Edit</a>
</dd>
</div>
<div id="isLinkLocalUnicast,TransportAddress">
<dt><pre><span class="Keyword">proc</span> <a href="#isLinkLocalUnicast%2CTransportAddress"><span class="Identifier">isLinkLocalUnicast</span></a><span class="Other">(</span><span class="Identifier">address</span><span class="Other">:</span> <a href="common.html#TransportAddress"><span class="Identifier">TransportAddress</span></a><span class="Other">)</span><span class="Other">:</span> <span class="Identifier">bool</span> {.<span class="Identifier">inline</span><span class="Other">,</span> <span><span class="Other pragmadots">...</span></span><span class="pragmawrap"><span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span>
<span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span>.}</pre></dt>
<dd>
&nbsp;&nbsp;<a
href="https://github.com/status-im/nim-chronos/tree/master/chronos/transports/ipnet.nim#L842"
class="link-seesrc" target="_blank">Source</a>
&nbsp;&nbsp;<a href="https://github.com/status-im/nim-chronos/edit/devel/chronos/transports/ipnet.nim#L842" class="link-seesrc" target="_blank" >Edit</a>
</dd>
</div>
<div id="isLoopback,TransportAddress">
<dt><pre><span class="Keyword">proc</span> <a href="#isLoopback%2CTransportAddress"><span class="Identifier">isLoopback</span></a><span class="Other">(</span><span class="Identifier">address</span><span class="Other">:</span> <a href="common.html#TransportAddress"><span class="Identifier">TransportAddress</span></a><span class="Other">)</span><span class="Other">:</span> <span class="Identifier">bool</span> {.<span><span class="Other pragmadots">...</span></span><span class="pragmawrap"><span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span>.}</pre></dt>
<dd>
<p>Returns <tt class="docutils literal"><span class="pre">true</span></tt> if <tt class="docutils literal"><span class="pre">address</span></tt> is loopback address.</p>
<p><tt class="docutils literal"><span class="pre">IPv4</span></tt>: 127.0.0.0 - 127.255.255.255</p>
<p><tt class="docutils literal"><span class="pre">IPv6</span></tt>: ::1</p>
&nbsp;&nbsp;<a
href="https://github.com/status-im/nim-chronos/tree/master/chronos/transports/ipnet.nim#L798"
class="link-seesrc" target="_blank">Source</a>
&nbsp;&nbsp;<a href="https://github.com/status-im/nim-chronos/edit/devel/chronos/transports/ipnet.nim#L798" class="link-seesrc" target="_blank" >Edit</a>
</dd>
</div>
<div id="isMulticast,TransportAddress">
<dt><pre><span class="Keyword">proc</span> <a href="#isMulticast%2CTransportAddress"><span class="Identifier">isMulticast</span></a><span class="Other">(</span><span class="Identifier">address</span><span class="Other">:</span> <a href="common.html#TransportAddress"><span class="Identifier">TransportAddress</span></a><span class="Other">)</span><span class="Other">:</span> <span class="Identifier">bool</span> {.<span><span class="Other pragmadots">...</span></span><span class="pragmawrap"><span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span>.}</pre></dt>
<dd>
<p>Returns <tt class="docutils literal"><span class="pre">true</span></tt> if <tt class="docutils literal"><span class="pre">address</span></tt> is a multicast address.</p>
<p><tt class="docutils literal"><span class="pre">IPv4</span></tt>: 224.0.0.0 - 239.255.255.255</p>
<p><tt class="docutils literal"><span class="pre">IPv6</span></tt>: FF00:: - FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF</p>
&nbsp;&nbsp;<a
href="https://github.com/status-im/nim-chronos/tree/master/chronos/transports/ipnet.nim#L719"
class="link-seesrc" target="_blank">Source</a>
&nbsp;&nbsp;<a href="https://github.com/status-im/nim-chronos/edit/devel/chronos/transports/ipnet.nim#L719" class="link-seesrc" target="_blank" >Edit</a>
</dd>
</div>
<div id="isNone,TransportAddress">
<dt><pre><span class="Keyword">proc</span> <a href="#isNone%2CTransportAddress"><span class="Identifier">isNone</span></a><span class="Other">(</span><span class="Identifier">address</span><span class="Other">:</span> <a href="common.html#TransportAddress"><span class="Identifier">TransportAddress</span></a><span class="Other">)</span><span class="Other">:</span> <span class="Identifier">bool</span> {.<span class="Identifier">inline</span><span class="Other">,</span> <span><span class="Other pragmadots">...</span></span><span class="pragmawrap"><span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span>.}</pre></dt>
<dd>
Returns <tt class="docutils literal"><span class="pre">true</span></tt> if <tt class="docutils literal"><span class="pre">address</span></tt> is not initialized yet, e.g. its <tt class="docutils literal"><span class="pre">family</span></tt> field is not set or equal to <tt class="docutils literal"><span class="pre">AddressFamily.None</span></tt>.
&nbsp;&nbsp;<a
href="https://github.com/status-im/nim-chronos/tree/master/chronos/transports/ipnet.nim#L696"
class="link-seesrc" target="_blank">Source</a>
&nbsp;&nbsp;<a href="https://github.com/status-im/nim-chronos/edit/devel/chronos/transports/ipnet.nim#L696" class="link-seesrc" target="_blank" >Edit</a>
</dd>
</div>
<div id="isPrivate,TransportAddress">
<dt><pre><span class="Keyword">proc</span> <a href="#isPrivate%2CTransportAddress"><span class="Identifier">isPrivate</span></a><span class="Other">(</span><span class="Identifier">address</span><span class="Other">:</span> <a href="common.html#TransportAddress"><span class="Identifier">TransportAddress</span></a><span class="Other">)</span><span class="Other">:</span> <span class="Identifier">bool</span> {.<span><span class="Other pragmadots">...</span></span><span class="pragmawrap"><span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span>.}</pre></dt>
<dd>
Alias for <tt class="docutils literal"><span class="pre">isSiteLocal()</span></tt>.
&nbsp;&nbsp;<a
href="https://github.com/status-im/nim-chronos/tree/master/chronos/transports/ipnet.nim#L861"
class="link-seesrc" target="_blank">Source</a>
&nbsp;&nbsp;<a href="https://github.com/status-im/nim-chronos/edit/devel/chronos/transports/ipnet.nim#L861" class="link-seesrc" target="_blank" >Edit</a>
</dd>
</div>
<div id="isReserved,TransportAddress">
<dt><pre><span class="Keyword">proc</span> <a href="#isReserved%2CTransportAddress"><span class="Identifier">isReserved</span></a><span class="Other">(</span><span class="Identifier">address</span><span class="Other">:</span> <a href="common.html#TransportAddress"><span class="Identifier">TransportAddress</span></a><span class="Other">)</span><span class="Other">:</span> <span class="Identifier">bool</span> {.<span><span class="Other pragmadots">...</span></span><span class="pragmawrap"><span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span>.}</pre></dt>
<dd>
<p>Returns <tt class="docutils literal"><span class="pre">true</span></tt> if <tt class="docutils literal"><span class="pre">address</span></tt> is reserved by IANA for future use. [IETF RFC 1112] defines the block of reserved addresses as <tt class="docutils literal"><span class="pre"><span class="FloatNumber">240.0</span><span class="Operator">.</span><span class="FloatNumber">0.0</span><span class="Operator">/</span><span class="DecNumber">4</span></span></tt>.</p>
<p>NOTE: As IANA assigns new addresses, this procedure will be updated. This may result in non-reserved addresses being treated as reserved in code that relies on an outdated version of this procedure.</p>
<p><tt class="docutils literal"><span class="pre">IPv4</span></tt>: 240.0.0.0/4</p>
&nbsp;&nbsp;<a
href="https://github.com/status-im/nim-chronos/tree/master/chronos/transports/ipnet.nim#L943"
class="link-seesrc" target="_blank">Source</a>
&nbsp;&nbsp;<a href="https://github.com/status-im/nim-chronos/edit/devel/chronos/transports/ipnet.nim#L943" class="link-seesrc" target="_blank" >Edit</a>
</dd>
</div>
<div id="isShared,TransportAddress">
<dt><pre><span class="Keyword">proc</span> <a href="#isShared%2CTransportAddress"><span class="Identifier">isShared</span></a><span class="Other">(</span><span class="Identifier">address</span><span class="Other">:</span> <a href="common.html#TransportAddress"><span class="Identifier">TransportAddress</span></a><span class="Other">)</span><span class="Other">:</span> <span class="Identifier">bool</span> {.<span><span class="Other pragmadots">...</span></span><span class="pragmawrap"><span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span>.}</pre></dt>
<dd>
<p>Returns <tt class="docutils literal"><span class="pre">true</span></tt> if <tt class="docutils literal"><span class="pre">address</span></tt> is part of the Shared Address Space defined in [IETF RFC 6598]</p>
<p><tt class="docutils literal"><span class="pre">IPv4</span></tt>: 100.64.0.0/10</p>
&nbsp;&nbsp;<a
href="https://github.com/status-im/nim-chronos/tree/master/chronos/transports/ipnet.nim#L880"
class="link-seesrc" target="_blank">Source</a>
&nbsp;&nbsp;<a href="https://github.com/status-im/nim-chronos/edit/devel/chronos/transports/ipnet.nim#L880" class="link-seesrc" target="_blank" >Edit</a>
</dd>
</div>
<div id="isSiteLocal,TransportAddress">
<dt><pre><span class="Keyword">proc</span> <a href="#isSiteLocal%2CTransportAddress"><span class="Identifier">isSiteLocal</span></a><span class="Other">(</span><span class="Identifier">address</span><span class="Other">:</span> <a href="common.html#TransportAddress"><span class="Identifier">TransportAddress</span></a><span class="Other">)</span><span class="Other">:</span> <span class="Identifier">bool</span> {.<span><span class="Other pragmadots">...</span></span><span class="pragmawrap"><span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span>.}</pre></dt>
<dd>
Returns <tt class="docutils literal"><span class="pre">true</span></tt> if <tt class="docutils literal"><span class="pre">address</span></tt> is site local address.<dl class="docutils"><dt><tt class="docutils literal"><span class="pre">IPv4</span></tt>: 10.0.0.0 - 10.255.255.255, 172.16.0.0 - 172.31.255.255,</dt>
<dd>192.168.0.0 - 192.168.255.255</dd>
</dl>
<p><tt class="docutils literal"><span class="pre">IPv6</span></tt>: FEC0:: - FEFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF</p>
&nbsp;&nbsp;<a
href="https://github.com/status-im/nim-chronos/tree/master/chronos/transports/ipnet.nim#L845"
class="link-seesrc" target="_blank">Source</a>
&nbsp;&nbsp;<a href="https://github.com/status-im/nim-chronos/edit/devel/chronos/transports/ipnet.nim#L845" class="link-seesrc" target="_blank" >Edit</a>
</dd>
</div>
<div id="isUnicast,TransportAddress">
<dt><pre><span class="Keyword">proc</span> <a href="#isUnicast%2CTransportAddress"><span class="Identifier">isUnicast</span></a><span class="Other">(</span><span class="Identifier">address</span><span class="Other">:</span> <a href="common.html#TransportAddress"><span class="Identifier">TransportAddress</span></a><span class="Other">)</span><span class="Other">:</span> <span class="Identifier">bool</span> {.<span><span class="Other pragmadots">...</span></span><span class="pragmawrap"><span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span>.}</pre></dt>
<dd>
Returns <tt class="docutils literal"><span class="pre">true</span></tt> if <tt class="docutils literal"><span class="pre">address</span></tt> is unicast, as defined by [IETF RFC 4291]. Any address that is not a IPv6 multicast address <tt class="docutils literal"><span class="pre"><span class="Identifier">FF00</span><span class="Punctuation">:</span><span class="Punctuation">:</span><span class="Operator">/</span><span class="DecNumber">8</span></span></tt> is unicast.
&nbsp;&nbsp;<a
href="https://github.com/status-im/nim-chronos/tree/master/chronos/transports/ipnet.nim#L733"
class="link-seesrc" target="_blank">Source</a>
&nbsp;&nbsp;<a href="https://github.com/status-im/nim-chronos/edit/devel/chronos/transports/ipnet.nim#L733" class="link-seesrc" target="_blank" >Edit</a>
</dd>
</div>
<div id="isUnicastLinkLocal,TransportAddress">
<dt><pre><span class="Keyword">proc</span> <a href="#isUnicastLinkLocal%2CTransportAddress"><span class="Identifier">isUnicastLinkLocal</span></a><span class="Other">(</span><span class="Identifier">address</span><span class="Other">:</span> <a href="common.html#TransportAddress"><span class="Identifier">TransportAddress</span></a><span class="Other">)</span><span class="Other">:</span> <span class="Identifier">bool</span> {.<span><span class="Other pragmadots">...</span></span><span class="pragmawrap"><span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span>.}</pre></dt>
<dd>
<p>Returns <tt class="docutils literal"><span class="pre">true</span></tt> if <tt class="docutils literal"><span class="pre">address</span></tt> is a IPv6 unicast address with link-local scope.</p>
<p>NOTE: While [RFC 4291 section 2.5.3] mentions about the [loopback address] <tt class="docutils literal"><span class="pre"><span class="Punctuation">:</span><span class="Punctuation">:</span><span class="DecNumber">1</span></span></tt> that &quot;it is treated as having Link-Local scope&quot;, this does not mean that the loopback address actually has link-local scope and procedure will return <tt class="docutils literal"><span class="pre"><span class="Identifier">false</span></span></tt> on it.</p>
<p><tt class="docutils literal"><span class="pre">IPv6</span></tt>: FE80::/10</p>
&nbsp;&nbsp;<a
href="https://github.com/status-im/nim-chronos/tree/master/chronos/transports/ipnet.nim#L780"
class="link-seesrc" target="_blank">Source</a>
&nbsp;&nbsp;<a href="https://github.com/status-im/nim-chronos/edit/devel/chronos/transports/ipnet.nim#L780" class="link-seesrc" target="_blank" >Edit</a>
</dd>
</div>
<div id="isUniqueLocal,TransportAddress">
<dt><pre><span class="Keyword">proc</span> <a href="#isUniqueLocal%2CTransportAddress"><span class="Identifier">isUniqueLocal</span></a><span class="Other">(</span><span class="Identifier">address</span><span class="Other">:</span> <a href="common.html#TransportAddress"><span class="Identifier">TransportAddress</span></a><span class="Other">)</span><span class="Other">:</span> <span class="Identifier">bool</span> {.<span><span class="Other pragmadots">...</span></span><span class="pragmawrap"><span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span>.}</pre></dt>
<dd>
<p>Returns <tt class="docutils literal"><span class="pre">true</span></tt> if <tt class="docutils literal"><span class="pre">address</span></tt> is a unique local IPv6 unicast address.</p>
<p><tt class="docutils literal"><span class="pre">IPv6</span></tt>: FC00::/7</p>
&nbsp;&nbsp;<a
href="https://github.com/status-im/nim-chronos/tree/master/chronos/transports/ipnet.nim#L768"
class="link-seesrc" target="_blank">Source</a>
&nbsp;&nbsp;<a href="https://github.com/status-im/nim-chronos/edit/devel/chronos/transports/ipnet.nim#L768" class="link-seesrc" target="_blank" >Edit</a>
</dd>
</div>
<div id="isUnspecified,TransportAddress">
<dt><pre><span class="Keyword">proc</span> <a href="#isUnspecified%2CTransportAddress"><span class="Identifier">isUnspecified</span></a><span class="Other">(</span><span class="Identifier">address</span><span class="Other">:</span> <a href="common.html#TransportAddress"><span class="Identifier">TransportAddress</span></a><span class="Other">)</span><span class="Other">:</span> <span class="Identifier">bool</span> {.<span class="Identifier">inline</span><span class="Other">,</span> <span><span class="Other pragmadots">...</span></span><span class="pragmawrap"><span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span>
<span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span>.}</pre></dt>
<dd>
Alias for isZero().
&nbsp;&nbsp;<a
href="https://github.com/status-im/nim-chronos/tree/master/chronos/transports/ipnet.nim#L715"
class="link-seesrc" target="_blank">Source</a>
&nbsp;&nbsp;<a href="https://github.com/status-im/nim-chronos/edit/devel/chronos/transports/ipnet.nim#L715" class="link-seesrc" target="_blank" >Edit</a>
</dd>
</div>
<div id="isV4Mapped,TransportAddress">
<dt><pre><span class="Keyword">proc</span> <a href="#isV4Mapped%2CTransportAddress"><span class="Identifier">isV4Mapped</span></a><span class="Other">(</span><span class="Identifier">address</span><span class="Other">:</span> <a href="common.html#TransportAddress"><span class="Identifier">TransportAddress</span></a><span class="Other">)</span><span class="Other">:</span> <span class="Identifier">bool</span> {.<span><span class="Other pragmadots">...</span></span><span class="pragmawrap"><span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span>.}</pre></dt>
<dd>
<p>Returns <tt class="docutils literal"><span class="pre">true</span></tt> if <tt class="docutils literal"><span class="pre">address</span></tt> is (IPv4 to IPv6) mapped address, e.g. 0000:0000:0000:0000:0000:FFFF:xxxx:xxxx</p>
<p>Procedure returns <tt class="docutils literal"><span class="pre">false</span></tt> if <tt class="docutils literal"><span class="pre">address</span></tt> family is IPv4.</p>
&nbsp;&nbsp;<a
href="https://github.com/status-im/nim-chronos/tree/master/chronos/transports/ipnet.nim#L178"
class="link-seesrc" target="_blank">Source</a>
&nbsp;&nbsp;<a href="https://github.com/status-im/nim-chronos/edit/devel/chronos/transports/ipnet.nim#L178" class="link-seesrc" target="_blank" >Edit</a>
</dd>
</div>
<div id="isZero,TransportAddress">
<dt><pre><span class="Keyword">proc</span> <a href="#isZero%2CTransportAddress"><span class="Identifier">isZero</span></a><span class="Other">(</span><span class="Identifier">address</span><span class="Other">:</span> <a href="common.html#TransportAddress"><span class="Identifier">TransportAddress</span></a><span class="Other">)</span><span class="Other">:</span> <span class="Identifier">bool</span> {.<span class="Identifier">inline</span><span class="Other">,</span> <span><span class="Other pragmadots">...</span></span><span class="pragmawrap"><span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span>.}</pre></dt>
<dd>
Returns <tt class="docutils literal"><span class="pre">true</span></tt> if <tt class="docutils literal"><span class="pre">address</span></tt> is full of zeros, but its <tt class="docutils literal"><span class="pre">family</span></tt> is not <tt class="docutils literal"><span class="pre">AddressFamily.None</span></tt>.
&nbsp;&nbsp;<a
href="https://github.com/status-im/nim-chronos/tree/master/chronos/transports/ipnet.nim#L701"
class="link-seesrc" target="_blank">Source</a>
&nbsp;&nbsp;<a href="https://github.com/status-im/nim-chronos/edit/devel/chronos/transports/ipnet.nim#L701" class="link-seesrc" target="_blank" >Edit</a>
</dd>
</div>
<div id="mask,TransportAddress,IpMask">
<dt><pre><span class="Keyword">proc</span> <a href="#mask%2CTransportAddress%2CIpMask"><span class="Identifier">mask</span></a><span class="Other">(</span><span class="Identifier">a</span><span class="Other">:</span> <a href="common.html#TransportAddress"><span class="Identifier">TransportAddress</span></a><span class="Other">;</span> <span class="Identifier">m</span><span class="Other">:</span> <a href="ipnet.html#IpMask"><span class="Identifier">IpMask</span></a><span class="Other">)</span><span class="Other">:</span> <a href="common.html#TransportAddress"><span class="Identifier">TransportAddress</span></a> {.<span><span class="Other pragmadots">...</span></span><span class="pragmawrap"><span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span>
<span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span>.}</pre></dt>
<dd>
<p>Apply IP mask <tt class="docutils literal"><span class="pre">m</span></tt> to address <tt class="docutils literal"><span class="pre">a</span></tt> and return result address.</p>
<p>If <tt class="docutils literal"><span class="pre">a</span></tt> family is IPv4 and <tt class="docutils literal"><span class="pre">m</span></tt> family is IPv6, masking is still possible when <tt class="docutils literal"><span class="pre">m</span></tt> has <tt class="docutils literal"><span class="pre">FFFF:FFFF:FFFF:FFFF:FFFF:FFFF</span></tt> prefix. Returned value will be IPv4 address.</p>
<p>If <tt class="docutils literal"><span class="pre">a</span></tt> family is IPv6 and <tt class="docutils literal"><span class="pre">m</span></tt> family is IPv4, masking is still possible when <tt class="docutils literal"><span class="pre">a</span></tt> holds (IPv4 to IPv6) mapped address. Returned value will be IPv6 address.</p>
<p>If <tt class="docutils literal"><span class="pre">a</span></tt> family is IPv4 and <tt class="docutils literal"><span class="pre">m</span></tt> family is IPv4, returned value will be IPv4 address.</p>
<p>If <tt class="docutils literal"><span class="pre">a</span></tt> family is IPv6 and <tt class="docutils literal"><span class="pre">m</span></tt> family is IPv6, returned value will be IPv6 address.</p>
<p>In all other cases returned address will have <tt class="docutils literal"><span class="pre">AddressFamily.None</span></tt>.</p>
&nbsp;&nbsp;<a
href="https://github.com/status-im/nim-chronos/tree/master/chronos/transports/ipnet.nim#L213"
class="link-seesrc" target="_blank">Source</a>
&nbsp;&nbsp;<a href="https://github.com/status-im/nim-chronos/edit/devel/chronos/transports/ipnet.nim#L213" class="link-seesrc" target="_blank" >Edit</a>
</dd>
</div>
<div id="network,IpNet">
<dt><pre><span class="Keyword">proc</span> <a href="#network%2CIpNet"><span class="Identifier">network</span></a><span class="Other">(</span><span class="Identifier">net</span><span class="Other">:</span> <a href="ipnet.html#IpNet"><span class="Identifier">IpNet</span></a><span class="Other">)</span><span class="Other">:</span> <a href="common.html#TransportAddress"><span class="Identifier">TransportAddress</span></a> {.<span class="Identifier">inline</span><span class="Other">,</span> <span><span class="Other pragmadots">...</span></span><span class="pragmawrap"><span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span>.}</pre></dt>
<dd>
Returns network address (host address masked with network mask) for IP Network <tt class="docutils literal"><span class="pre">net</span></tt>.
&nbsp;&nbsp;<a
href="https://github.com/status-im/nim-chronos/tree/master/chronos/transports/ipnet.nim#L486"
class="link-seesrc" target="_blank">Source</a>
&nbsp;&nbsp;<a href="https://github.com/status-im/nim-chronos/edit/devel/chronos/transports/ipnet.nim#L486" class="link-seesrc" target="_blank" >Edit</a>
</dd>
</div>
<div id="prefix,IpMask">
<dt><pre><span class="Keyword">proc</span> <a href="#prefix%2CIpMask"><span class="Identifier">prefix</span></a><span class="Other">(</span><span class="Identifier">mask</span><span class="Other">:</span> <a href="ipnet.html#IpMask"><span class="Identifier">IpMask</span></a><span class="Other">)</span><span class="Other">:</span> <span class="Identifier">int</span> {.<span><span class="Other pragmadots">...</span></span><span class="pragmawrap"><span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span>.}</pre></dt>
<dd>
<p>Returns number of bits set <tt class="docutils literal"><span class="pre"><span class="DecNumber">1</span></span></tt> in IP mask <tt class="docutils literal"><span class="pre">mask</span></tt>.</p>
<p>Procedure returns <tt class="docutils literal"><span class="pre">-1</span></tt> if mask is not canonical, e.g. has holes with <tt class="docutils literal"><span class="pre">0</span></tt> bits between <tt class="docutils literal"><span class="pre">1</span></tt> bits.</p>
&nbsp;&nbsp;<a
href="https://github.com/status-im/nim-chronos/tree/master/chronos/transports/ipnet.nim#L266"
class="link-seesrc" target="_blank">Source</a>
&nbsp;&nbsp;<a href="https://github.com/status-im/nim-chronos/edit/devel/chronos/transports/ipnet.nim#L266" class="link-seesrc" target="_blank" >Edit</a>
</dd>
</div>
<div id="subnetMask,IpMask">
<dt><pre><span class="Keyword">proc</span> <a href="#subnetMask%2CIpMask"><span class="Identifier">subnetMask</span></a><span class="Other">(</span><span class="Identifier">mask</span><span class="Other">:</span> <a href="ipnet.html#IpMask"><span class="Identifier">IpMask</span></a><span class="Other">)</span><span class="Other">:</span> <a href="common.html#TransportAddress"><span class="Identifier">TransportAddress</span></a> {.<span><span class="Other pragmadots">...</span></span><span class="pragmawrap"><span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span>.}</pre></dt>
<dd>
Returns TransportAddress representation of IP mask <tt class="docutils literal"><span class="pre">mask</span></tt>.
&nbsp;&nbsp;<a
href="https://github.com/status-im/nim-chronos/tree/master/chronos/transports/ipnet.nim#L306"
class="link-seesrc" target="_blank">Source</a>
&nbsp;&nbsp;<a href="https://github.com/status-im/nim-chronos/edit/devel/chronos/transports/ipnet.nim#L306" class="link-seesrc" target="_blank" >Edit</a>
</dd>
</div>
<div id="subnetMask,IpNet">
<dt><pre><span class="Keyword">proc</span> <a href="#subnetMask%2CIpNet"><span class="Identifier">subnetMask</span></a><span class="Other">(</span><span class="Identifier">net</span><span class="Other">:</span> <a href="ipnet.html#IpNet"><span class="Identifier">IpNet</span></a><span class="Other">)</span><span class="Other">:</span> <a href="common.html#TransportAddress"><span class="Identifier">TransportAddress</span></a> {.<span><span class="Other pragmadots">...</span></span><span class="pragmawrap"><span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span>.}</pre></dt>
<dd>
Returns netmask address for IP Network <tt class="docutils literal"><span class="pre">net</span></tt>.
&nbsp;&nbsp;<a
href="https://github.com/status-im/nim-chronos/tree/master/chronos/transports/ipnet.nim#L482"
class="link-seesrc" target="_blank">Source</a>
&nbsp;&nbsp;<a href="https://github.com/status-im/nim-chronos/edit/devel/chronos/transports/ipnet.nim#L482" class="link-seesrc" target="_blank" >Edit</a>
</dd>
</div>
<div id="toIPv4,TransportAddress">
<dt><pre><span class="Keyword">proc</span> <a href="#toIPv4%2CTransportAddress"><span class="Identifier">toIPv4</span></a><span class="Other">(</span><span class="Identifier">address</span><span class="Other">:</span> <a href="common.html#TransportAddress"><span class="Identifier">TransportAddress</span></a><span class="Other">)</span><span class="Other">:</span> <a href="common.html#TransportAddress"><span class="Identifier">TransportAddress</span></a> {.<span><span class="Other pragmadots">...</span></span><span class="pragmawrap"><span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span>.}</pre></dt>
<dd>
<p>Get IPv4 from (IPv4 to IPv6) mapped address.</p>
<p>If <tt class="docutils literal"><span class="pre">address</span></tt> is IPv4 address it will be returned without any changes.</p>
<p>If <tt class="docutils literal"><span class="pre">address</span></tt> is not IPv4 to IPv6 mapped address, then result family will be set to AddressFamily.None.</p>
&nbsp;&nbsp;<a
href="https://github.com/status-im/nim-chronos/tree/master/chronos/transports/ipnet.nim#L193"
class="link-seesrc" target="_blank">Source</a>
&nbsp;&nbsp;<a href="https://github.com/status-im/nim-chronos/edit/devel/chronos/transports/ipnet.nim#L193" class="link-seesrc" target="_blank" >Edit</a>
</dd>
</div>
<div id="toIPv6,TransportAddress">
<dt><pre><span class="Keyword">proc</span> <a href="#toIPv6%2CTransportAddress"><span class="Identifier">toIPv6</span></a><span class="Other">(</span><span class="Identifier">address</span><span class="Other">:</span> <a href="common.html#TransportAddress"><span class="Identifier">TransportAddress</span></a><span class="Other">)</span><span class="Other">:</span> <a href="common.html#TransportAddress"><span class="Identifier">TransportAddress</span></a> {.<span><span class="Other pragmadots">...</span></span><span class="pragmawrap"><span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span>.}</pre></dt>
<dd>
<p>Map IPv4 <tt class="docutils literal"><span class="pre">address</span></tt> to IPv6 address.</p>
<p>If <tt class="docutils literal"><span class="pre">address</span></tt> is IPv4 address then it will be mapped as: &lt;80 bits of zeros&gt; + &lt;16 bits of ones&gt; + &lt;32-bit IPv4 address&gt;.</p>
<p>If <tt class="docutils literal"><span class="pre">address</span></tt> is IPv6 address it will be returned without any changes.</p>
&nbsp;&nbsp;<a
href="https://github.com/status-im/nim-chronos/tree/master/chronos/transports/ipnet.nim#L158"
class="link-seesrc" target="_blank">Source</a>
&nbsp;&nbsp;<a href="https://github.com/status-im/nim-chronos/edit/devel/chronos/transports/ipnet.nim#L158" class="link-seesrc" target="_blank" >Edit</a>
</dd>
</div>
</dl></div>
<div class="section" id="19">
<h1><a class="toc-backref" href="#19">Exports</a></h1>
<dl class="item">
<a href="../osdefs.html#==,SocketHandle,SocketHandle"><span class="Identifier">==</span></a>, <a href="common.html#DualStackType"><span class="Identifier">DualStackType</span></a>, <a href="common.html#toHex,TransportAddress"><span class="Identifier">toHex</span></a>, <a href="common.html#getAutoAddress,Port"><span class="Identifier">getAutoAddress</span></a>, <a href="common.html#address,TransportAddress"><span class="Identifier">address</span></a>, <a href="common.html#==,TransportAddress,TransportAddress"><span class="Identifier">==</span></a>, <a href="common.html#resolveTAddress,string"><span class="Identifier">resolveTAddress</span></a>, <a href="common.html#TransportAddress"><span class="Identifier">TransportAddress</span></a>, <a href="common.html#TransportIncompleteError"><span class="Identifier">TransportIncompleteError</span></a>, <a href="common.html#getAutoAddresses,Port,Port"><span class="Identifier">getAutoAddresses</span></a>, <a href="../internal/asyncengine.html#==,AsyncFD,AsyncFD"><span class="Identifier">==</span></a>, <a href="common.html#initTAddress,string,int"><span class="Identifier">initTAddress</span></a>, <a href="common.html#AddressFamily"><span class="Identifier">AddressFamily</span></a>, <a href="common.html#ServerStatus"><span class="Identifier">ServerStatus</span></a>, <a href="common.html#host,TransportAddress"><span class="Identifier">host</span></a>, <a href="common.html#getTransportOsError.t,OSErrorCode"><span class="Identifier">getTransportOsError</span></a>, <a href="common.html#getTransportOsError.t,cint"><span class="Identifier">getTransportOsError</span></a>, <a href="../timer.html#$,Duration"><span class="Identifier">$</span></a>, <a href="common.html#getTransportTooManyError.t"><span class="Identifier">getTransportTooManyError</span></a>, <a href="common.html#windowsAnyAddressFix,TransportAddress"><span class="Identifier">windowsAnyAddressFix</span></a>, <a href="common.html#setDualstack,AsyncFD,DualStackType"><span class="Identifier">setDualstack</span></a>, <a href="common.html#toIpAddress,TransportAddress"><span class="Identifier">toIpAddress</span></a>, <a href="common.html#$,TransportAddress"><span class="Identifier">$</span></a>, <a href="../srcloc.html#$,ptr.SrcLoc"><span class="Identifier">$</span></a>, <a href="common.html#TransportNoSupport"><span class="Identifier">TransportNoSupport</span></a>, <a href="common.html#TransportUseClosedError"><span class="Identifier">TransportUseClosedError</span></a>, <a href="common.html#TransportUseEofError"><span class="Identifier">TransportUseEofError</span></a>, <a href="common.html#ServerFlags"><span class="Identifier">ServerFlags</span></a>, <a href="common.html#resolveTAddress,string,Domain"><span class="Identifier">resolveTAddress</span></a>, <a href="common.html#TransportAbortedError"><span class="Identifier">TransportAbortedError</span></a>, <a href="../timer.html#==,Duration,Duration"><span class="Identifier">==</span></a>, <a href="common.html#initTAddress,string,Port"><span class="Identifier">initTAddress</span></a>, <a href="../timer.html#$,Moment"><span class="Identifier">$</span></a>, <a href="common.html#setDualstack,AsyncFD,AddressFamily,DualStackType"><span class="Identifier">setDualstack</span></a>, <a href="common.html#resolveTAddress,string,Port"><span class="Identifier">resolveTAddress</span></a>, <a href="common.html#getConnectionAbortedError.t,OSErrorCode"><span class="Identifier">getConnectionAbortedError</span></a>, <a href="common.html#toSAddr,TransportAddress,Sockaddr_storage,SockLen"><span class="Identifier">toSAddr</span></a>, <a href="common.html#TransportError"><span class="Identifier">TransportError</span></a>, <a href="common.html#AnyAddress"><span class="Identifier">AnyAddress</span></a>, <a href="common.html#resolveTAddress,string,AddressFamily"><span class="Identifier">resolveTAddress</span></a>, <a href="../osdefs.html#==,SocketHandle,int"><span class="Identifier">==</span></a>, <a href="common.html#getDomain,AsyncFD"><span class="Identifier">getDomain</span></a>, <a href="common.html#getServerUseClosedError.t"><span class="Identifier">getServerUseClosedError</span></a>, <a href="common.html#resolveTAddress,string,Port,IpAddressFamily"><span class="Identifier">resolveTAddress</span></a>, <a href="common.html#fromSAddr,ptr.Sockaddr_storage,SockLen,TransportAddress"><span class="Identifier">fromSAddr</span></a>, <a href="common.html#TransportTooManyError"><span class="Identifier">TransportTooManyError</span></a>, <a href="common.html#checkClosed.t,untyped,untyped"><span class="Identifier">checkClosed</span></a>, <a href="common.html#ServerCommand"><span class="Identifier">ServerCommand</span></a>, <a href="common.html#getTransportUseClosedError.t"><span class="Identifier">getTransportUseClosedError</span></a>, <a href="common.html#getTransportError.t,OSErrorCode"><span class="Identifier">getTransportError</span></a>, <a href="common.html#resolveTAddress,string,Port,Domain"><span class="Identifier">resolveTAddress</span></a>, <a href="common.html#initTAddress,string"><span class="Identifier">initTAddress</span></a>, <a href="common.html#raiseTransportOsError,OSErrorCode"><span class="Identifier">raiseTransportOsError</span></a>, <a href="common.html#TransportOsError"><span class="Identifier">TransportOsError</span></a>, <a href="common.html#getDomain,TransportAddress"><span class="Identifier">getDomain</span></a>, <a href="common.html#resolveTAddress,string,Port,AddressFamily"><span class="Identifier">resolveTAddress</span></a>, <a href="common.html#checkWriteEof.t,untyped,untyped"><span class="Identifier">checkWriteEof</span></a>, <a href="common.html#resolveTAddress,string,IpAddressFamily"><span class="Identifier">resolveTAddress</span></a>, <a href="common.html#isAvailable,AddressFamily"><span class="Identifier">isAvailable</span></a>, <a href="common.html#SocketServer"><span class="Identifier">SocketServer</span></a>, <a href="../timer.html#==,Moment,Moment"><span class="Identifier">==</span></a>, <a href="common.html#DefaultDatagramBufferSize"><span class="Identifier">DefaultDatagramBufferSize</span></a>, <a href="common.html#getError.t,untyped"><span class="Identifier">getError</span></a>, <a href="common.html#TransportAddressError"><span class="Identifier">TransportAddressError</span></a>, <a href="common.html#TransportLimitError"><span class="Identifier">TransportLimitError</span></a>, <a href="common.html#DefaultStreamBufferSize"><span class="Identifier">DefaultStreamBufferSize</span></a>, <a href="common.html#getConnectionAbortedError.t,string"><span class="Identifier">getConnectionAbortedError</span></a>, <a href="common.html#raiseTransportError,OSErrorCode"><span class="Identifier">raiseTransportError</span></a>, <a href="common.html#AnyAddress6"><span class="Identifier">AnyAddress6</span></a>, <a href="common.html#checkClosed.t,untyped"><span class="Identifier">checkClosed</span></a>, <a href="common.html#TransportState"><span class="Identifier">TransportState</span></a>, <a href="common.html#initTAddress,IpAddress,Port"><span class="Identifier">initTAddress</span></a>
</dl></div>
</div>
</div>
<div class="row">
<div class="twelve-columns footer">
<span class="nim-sprite"></span>
<br/>
<small style="color: var(--hint);">Made with Nim. Generated: 2024-11-28 08:22:46 UTC</small>
</div>
</div>
</div>
</div>
</body>
</html>