summaryrefslogtreecommitdiffhomepage
path: root/documentation/api/modules/luci.ip.html
diff options
context:
space:
mode:
Diffstat (limited to 'documentation/api/modules/luci.ip.html')
-rw-r--r--documentation/api/modules/luci.ip.html1217
1 files changed, 0 insertions, 1217 deletions
diff --git a/documentation/api/modules/luci.ip.html b/documentation/api/modules/luci.ip.html
deleted file mode 100644
index 0599396b6f..0000000000
--- a/documentation/api/modules/luci.ip.html
+++ /dev/null
@@ -1,1217 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-<html>
-<head>
- <title>Reference</title>
- <link rel="stylesheet" href="../luadoc.css" type="text/css" />
- <!--meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/-->
-</head>
-
-<body>
-<div id="container">
-
-<div id="product">
- <div id="product_logo"></div>
- <div id="product_name"><big><b></b></big></div>
- <div id="product_description"></div>
-</div> <!-- id="product" -->
-
-<div id="main">
-
-<div id="navigation">
-
-
-<h1>LuaDoc</h1>
-<ul>
-
- <li><a href="../index.html">Index</a></li>
-
-</ul>
-
-
-<!-- Module list -->
-
-<h1>Modules</h1>
-<ul>
-
- <li>
- <a href="../modules/luci.dispatcher.html">luci.dispatcher</a>
- </li>
-
- <li>
- <a href="../modules/luci.http.html">luci.http</a>
- </li>
-
- <li>
- <a href="../modules/luci.http.conditionals.html">luci.http.conditionals</a>
- </li>
-
- <li>
- <a href="../modules/luci.http.date.html">luci.http.date</a>
- </li>
-
- <li>
- <a href="../modules/luci.http.mime.html">luci.http.mime</a>
- </li>
-
- <li>
- <a href="../modules/luci.i18n.html">luci.i18n</a>
- </li>
-
- <li><strong>luci.ip</strong></li>
-
- <li>
- <a href="../modules/luci.ip.cidr.html">luci.ip.cidr</a>
- </li>
-
- <li>
- <a href="../modules/luci.json.html">luci.json</a>
- </li>
-
- <li>
- <a href="../modules/luci.jsonc.html">luci.jsonc</a>
- </li>
-
- <li>
- <a href="../modules/luci.jsonc.parser.html">luci.jsonc.parser</a>
- </li>
-
- <li>
- <a href="../modules/luci.model.ipkg.html">luci.model.ipkg</a>
- </li>
-
- <li>
- <a href="../modules/luci.model.uci.html">luci.model.uci</a>
- </li>
-
- <li>
- <a href="../modules/luci.rpcc.html">luci.rpcc</a>
- </li>
-
- <li>
- <a href="../modules/luci.rpcc.ruci.html">luci.rpcc.ruci</a>
- </li>
-
- <li>
- <a href="../modules/luci.sys.html">luci.sys</a>
- </li>
-
- <li>
- <a href="../modules/luci.sys.init.html">luci.sys.init</a>
- </li>
-
- <li>
- <a href="../modules/luci.sys.iptparser.html">luci.sys.iptparser</a>
- </li>
-
- <li>
- <a href="../modules/luci.sys.net.html">luci.sys.net</a>
- </li>
-
- <li>
- <a href="../modules/luci.sys.process.html">luci.sys.process</a>
- </li>
-
- <li>
- <a href="../modules/luci.sys.user.html">luci.sys.user</a>
- </li>
-
- <li>
- <a href="../modules/luci.sys.wifi.html">luci.sys.wifi</a>
- </li>
-
- <li>
- <a href="../modules/luci.util.html">luci.util</a>
- </li>
-
- <li>
- <a href="../modules/nixio.html">nixio</a>
- </li>
-
- <li>
- <a href="../modules/nixio.CHANGELOG.html">nixio.CHANGELOG</a>
- </li>
-
- <li>
- <a href="../modules/nixio.CryptoHash.html">nixio.CryptoHash</a>
- </li>
-
- <li>
- <a href="../modules/nixio.File.html">nixio.File</a>
- </li>
-
- <li>
- <a href="../modules/nixio.README.html">nixio.README</a>
- </li>
-
- <li>
- <a href="../modules/nixio.Socket.html">nixio.Socket</a>
- </li>
-
- <li>
- <a href="../modules/nixio.TLSContext.html">nixio.TLSContext</a>
- </li>
-
- <li>
- <a href="../modules/nixio.TLSSocket.html">nixio.TLSSocket</a>
- </li>
-
- <li>
- <a href="../modules/nixio.UnifiedIO.html">nixio.UnifiedIO</a>
- </li>
-
- <li>
- <a href="../modules/nixio.bin.html">nixio.bin</a>
- </li>
-
- <li>
- <a href="../modules/nixio.bit.html">nixio.bit</a>
- </li>
-
- <li>
- <a href="../modules/nixio.crypto.html">nixio.crypto</a>
- </li>
-
- <li>
- <a href="../modules/nixio.fs.html">nixio.fs</a>
- </li>
-
-</ul>
-
-
-
-<!-- File list -->
-
-
-
-
-
-
-
-</div><!-- id="navigation" -->
-
-<div id="content">
-
-<h1>Class <code>luci.ip</code></h1>
-
-<p>
- LuCI IP calculation and netlink access library.</p>
-
-
-
-
-
-
-
-<h2>Functions</h2>
-<table class="function_list">
-
- <tr>
- <td class="name" nowrap><a href="#new">new</a>&nbsp;(address, netmask)</td>
- <td class="summary">
-
-Construct a new luci.ip.cidr instance and autodetect the address family.</td>
- </tr>
-
- <tr>
- <td class="name" nowrap><a href="#IPv4">IPv4</a>&nbsp;(address, netmask)</td>
- <td class="summary">
-
-Construct a new IPv4 luci.ip.cidr instance.</td>
- </tr>
-
- <tr>
- <td class="name" nowrap><a href="#IPv6">IPv6</a>&nbsp;(address, netmask)</td>
- <td class="summary">
-
-Construct a new IPv6 luci.ip.cidr instance.</td>
- </tr>
-
- <tr>
- <td class="name" nowrap><a href="#MAC">MAC</a>&nbsp;(address, netmask)</td>
- <td class="summary">
-
-Construct a new MAC luci.ip.cidr instance.</td>
- </tr>
-
- <tr>
- <td class="name" nowrap><a href="#checkip4">checkip4</a>&nbsp;(address)</td>
- <td class="summary">
-
-Verify an IPv4 address.</td>
- </tr>
-
- <tr>
- <td class="name" nowrap><a href="#checkip6">checkip6</a>&nbsp;(address)</td>
- <td class="summary">
-
-Verify an IPv6 address.</td>
- </tr>
-
- <tr>
- <td class="name" nowrap><a href="#checkmac">checkmac</a>&nbsp;(address)</td>
- <td class="summary">
-
-Verify an ethernet MAC address.</td>
- </tr>
-
- <tr>
- <td class="name" nowrap><a href="#route">route</a>&nbsp;(address, source)</td>
- <td class="summary">
-
-Determine the route leading to the given destination.</td>
- </tr>
-
- <tr>
- <td class="name" nowrap><a href="#routes">routes</a>&nbsp;(filter, callback)</td>
- <td class="summary">
-
-Fetch all routes, optionally matching the given criteria.</td>
- </tr>
-
- <tr>
- <td class="name" nowrap><a href="#neighbors">neighbors</a>&nbsp;(filter, callback)</td>
- <td class="summary">
-
-Fetches entries from the IPv4 ARP and IPv6 neighbour kernel table </td>
- </tr>
-
- <tr>
- <td class="name" nowrap><a href="#link">link</a>&nbsp;(device)</td>
- <td class="summary">
-
-Fetch basic device information </td>
- </tr>
-
-</table>
-
-
-
-
-
-
-<br/>
-<br/>
-
-
-<h2><a name="functions"></a>Functions</h2>
-<dl class="function">
-
-
-
-<dt><a name="new"></a><strong>new</strong>&nbsp;(address, netmask)</dt>
-<dd>
-
-
-Construct a new luci.ip.cidr instance and autodetect the address family.
-Throws an error if the given strings do not represent a valid address or
-if the given optional netmask is of a different family.
-
-
-<h3>Parameters</h3>
-<ul>
-
- <li>
- address: String containing a valid IPv4 or IPv6 address, optionally
-with prefix size (CIDR notation) or netmask separated by slash.
- </li>
-
- <li>
- netmask: String containing a valid IPv4 or IPv6 netmask or number
-containing a prefix size in bits (<code>0..32</code> for IPv4,
-<code>0..128</code> for IPv6). Overrides mask embedded in the first argument
-if specified. (optional)
- </li>
-
-</ul>
-
-
-
-
-<h3>Usage:</h3>
-<pre>addr = luci.ip.new("10.24.0.1/24")
-addr = luci.ip.new("10.24.0.1/255.255.255.0")
-addr = luci.ip.new("10.24.0.1", "255.255.255.0") -- separate netmask
-addr = luci.ip.new("10.24.0.1/24", 16) -- override netmask
-
-addr6 = luci.ip.new("fe80::221:63ff:fe75:aa17/64")
-addr6 = luci.ip.new("fe80::221:63ff:fe75:aa17/ffff:ffff:ffff:ffff::")
-addr6 = luci.ip.new("fe80::221:63ff:fe75:aa17", "ffff:ffff:ffff:ffff::")
-addr6 = luci.ip.new("fe80::221:63ff:fe75:aa17/64", 128) -- override netmask</pre>
-
-
-
-<h3>Return value:</h3>
-A <code>luci.ip.cidr</code> object representing the given
-address/mask range.
-
-
-
-<h3>See also:</h3>
-<ul>
-
- <li><a href="#IPv4">
- IPv4
- </a>
-
- <li><a href="#IPv6">
- IPv6
- </a>
-
- <li><a href="#MAC">
- MAC
- </a>
-
-</ul>
-
-</dd>
-
-
-
-
-<dt><a name="IPv4"></a><strong>IPv4</strong>&nbsp;(address, netmask)</dt>
-<dd>
-
-
-Construct a new IPv4 luci.ip.cidr instance.
-Throws an error if the given string does not represent a valid IPv4 address or
-if the given optional netmask is of a different family.
-
-
-<h3>Parameters</h3>
-<ul>
-
- <li>
- address: String containing a valid IPv4, optionally with prefix size
-(CIDR notation) or netmask separated by slash.
- </li>
-
- <li>
- netmask: String containing a valid IPv4 netmask or number
-containing a prefix size between <code>0</code> and <code>32</code> bit.
-Overrides mask embedded in the first argument if specified. (optional)
- </li>
-
-</ul>
-
-
-
-
-<h3>Usage:</h3>
-<pre>addr = luci.ip.IPv4("10.24.0.1/24")
-addr = luci.ip.IPv4("10.24.0.1/255.255.255.0")
-addr = luci.ip.IPv4("10.24.0.1", "255.255.255.0") -- separate netmask
-addr = luci.ip.IPv4("10.24.0.1/24", 16) -- override netmask</pre>
-
-
-
-<h3>Return value:</h3>
-A <code>luci.ip.cidr</code> object representing the given IPv4 range.
-
-
-
-<h3>See also:</h3>
-<ul>
-
- <li><a href="#IPv6">
- IPv6
- </a>
-
- <li><a href="#MAC">
- MAC
- </a>
-
-</ul>
-
-</dd>
-
-
-
-
-<dt><a name="IPv6"></a><strong>IPv6</strong>&nbsp;(address, netmask)</dt>
-<dd>
-
-
-Construct a new IPv6 luci.ip.cidr instance.
-Throws an error if the given string does not represent a valid IPv6 address or
-if the given optional netmask is of a different family.
-
-
-<h3>Parameters</h3>
-<ul>
-
- <li>
- address: String containing a valid IPv6, optionally with prefix size
-(CIDR notation) or netmask separated by slash.
- </li>
-
- <li>
- netmask: String containing a valid IPv4 netmask or number
-containing a prefix size between <code>0</code> and <code>128</code> bit.
-Overrides mask embedded in the first argument if specified. (optional)
- </li>
-
-</ul>
-
-
-
-
-<h3>Usage:</h3>
-<pre>addr6 = luci.ip.IPv6("fe80::221:63ff:fe75:aa17/64")
-addr6 = luci.ip.IPv6("fe80::221:63ff:fe75:aa17/ffff:ffff:ffff:ffff::")
-addr6 = luci.ip.IPv6("fe80::221:63ff:fe75:aa17", "ffff:ffff:ffff:ffff::")
-addr6 = luci.ip.IPv6("fe80::221:63ff:fe75:aa17/64", 128) -- override netmask</pre>
-
-
-
-<h3>Return value:</h3>
-A <code>luci.ip.cidr</code> object representing the given IPv6 range.
-
-
-
-<h3>See also:</h3>
-<ul>
-
- <li><a href="#IPv4">
- IPv4
- </a>
-
- <li><a href="#MAC">
- MAC
- </a>
-
-</ul>
-
-</dd>
-
-
-
-
-<dt><a name="MAC"></a><strong>MAC</strong>&nbsp;(address, netmask)</dt>
-<dd>
-
-
-Construct a new MAC luci.ip.cidr instance.
-Throws an error if the given string does not represent a valid ethernet MAC
-address or if the given optional mask is of a different family.
-
-
-<h3>Parameters</h3>
-<ul>
-
- <li>
- address: String containing a valid ethernet MAC address, optionally with
-prefix size (CIDR notation) or mask separated by slash.
- </li>
-
- <li>
- netmask: String containing a valid MAC address mask or number
-containing a prefix size between <code>0</code> and <code>48</code> bit.
-Overrides mask embedded in the first argument if specified. (optional)
- </li>
-
-</ul>
-
-
-
-
-<h3>Usage:</h3>
-<pre>intel_macs = luci.ip.MAC("C0:B6:F9:00:00:00/24")
-intel_macs = luci.ip.MAC("C0:B6:F9:00:00:00/FF:FF:FF:0:0:0")
-intel_macs = luci.ip.MAC("C0:B6:F9:00:00:00", "FF:FF:FF:0:0:0")
-intel_macs = luci.ip.MAC("C0:B6:F9:00:00:00/24", 48) -- override mask</pre>
-
-
-
-<h3>Return value:</h3>
-A <code>luci.ip.cidr</code> object representing the given MAC address range.
-
-
-
-<h3>See also:</h3>
-<ul>
-
- <li><a href="#IPv4">
- IPv4
- </a>
-
- <li><a href="#IPv6">
- IPv6
- </a>
-
-</ul>
-
-</dd>
-
-
-
-
-<dt><a name="checkip4"></a><strong>checkip4</strong>&nbsp;(address)</dt>
-<dd>
-
-
-Verify an IPv4 address.
-
-Checks whether given argument is a preexisting luci.ip.cidr IPv4 address
-instance or a string literal convertible to an IPv4 address and returns a
-plain Lua string containing the canonical representation of the address.
-
-If the argument is not a valid address, returns nothing. This function is
-intended to aid in safely verifying address literals without having to deal
-with exceptions.
-
-
-<h3>Parameters</h3>
-<ul>
-
- <li>
- address: String containing a valid IPv4 address or existing
-luci.ip.cidr IPv4 instance.
- </li>
-
-</ul>
-
-
-
-
-<h3>Usage:</h3>
-<pre>ipv4 = luci.ip.checkip4(luci.ip.new("127.0.0.1")) -- "127.0.0.1"
-ipv4 = luci.ip.checkip4("127.0.0.1") -- "127.0.0.1"
-ipv4 = luci.ip.checkip4("nonesense") -- nothing
-ipv4 = luci.ip.checkip4(123) -- nothing
-ipv4 = luci.ip.checkip4(nil) -- nothing
-ipv4 = luci.ip.checkip4() -- nothing</pre>
-
-
-
-<h3>Return value:</h3>
-A string representing the given IPv4 address.
-
-
-
-<h3>See also:</h3>
-<ul>
-
- <li><a href="#checkip6">
- checkip6
- </a>
-
- <li><a href="#checkmac">
- checkmac
- </a>
-
-</ul>
-
-</dd>
-
-
-
-
-<dt><a name="checkip6"></a><strong>checkip6</strong>&nbsp;(address)</dt>
-<dd>
-
-
-Verify an IPv6 address.
-
-Checks whether given argument is a preexisting luci.ip.cidr IPv6 address
-instance or a string literal convertible to an IPv6 address and returns a
-plain Lua string containing the canonical representation of the address.
-
-If the argument is not a valid address, returns nothing. This function is
-intended to aid in safely verifying address literals without having to deal
-with exceptions.
-
-
-<h3>Parameters</h3>
-<ul>
-
- <li>
- address: String containing a valid IPv6 address or existing
-luci.ip.cidr IPv6 instance.
- </li>
-
-</ul>
-
-
-
-
-<h3>Usage:</h3>
-<pre>ipv6 = luci.ip.checkip6(luci.ip.new("0:0:0:0:0:0:0:1")) -- "::1"
-ipv6 = luci.ip.checkip6("0:0:0:0:0:0:0:1") -- "::1"
-ipv6 = luci.ip.checkip6("nonesense") -- nothing
-ipv6 = luci.ip.checkip6(123) -- nothing
-ipv6 = luci.ip.checkip6(nil) -- nothing
-ipv6 = luci.ip.checkip6() -- nothing</pre>
-
-
-
-<h3>Return value:</h3>
-A string representing the given IPv6 address.
-
-
-
-<h3>See also:</h3>
-<ul>
-
- <li><a href="#checkip4">
- checkip4
- </a>
-
- <li><a href="#checkmac">
- checkmac
- </a>
-
-</ul>
-
-</dd>
-
-
-
-
-<dt><a name="checkmac"></a><strong>checkmac</strong>&nbsp;(address)</dt>
-<dd>
-
-
-Verify an ethernet MAC address.
-
-Checks whether given argument is a preexisting luci.ip.cidr MAC address
-instance or a string literal convertible to an ethernet MAC and returns a
-plain Lua string containing the canonical representation of the address.
-
-If the argument is not a valid address, returns nothing. This function is
-intended to aid in safely verifying address literals without having to deal
-with exceptions.
-
-
-<h3>Parameters</h3>
-<ul>
-
- <li>
- address: String containing a valid MAC address or existing luci.ip.cidr
-MAC address instance.
- </li>
-
-</ul>
-
-
-
-
-<h3>Usage:</h3>
-<pre>mac = luci.ip.checkmac(luci.ip.new("00-11-22-cc-dd-ee")) -- "00:11:22:CC:DD:EE"
-mac = luci.ip.checkmac("00:11:22:cc:dd:ee") -- "00:11:22:CC:DD:EE"
-mac = luci.ip.checkmac("nonesense") -- nothing
-mac = luci.ip.checkmac(123) -- nothing
-mac = luci.ip.checkmac(nil) -- nothing
-mac = luci.ip.checkmac() -- nothing</pre>
-
-
-
-<h3>Return value:</h3>
-A string representing the given MAC address.
-
-
-
-<h3>See also:</h3>
-<ul>
-
- <li><a href="#checkip4">
- checkip4
- </a>
-
- <li><a href="#checkip6">
- checkip6
- </a>
-
-</ul>
-
-</dd>
-
-
-
-
-<dt><a name="route"></a><strong>route</strong>&nbsp;(address, source)</dt>
-<dd>
-
-
-Determine the route leading to the given destination.
-
-
-<h3>Parameters</h3>
-<ul>
-
- <li>
- address: A <code>luci.ip.cidr</code> instance or a string containing
-a valid IPv4 or IPv6 range as specified by <code>luci.ip.new()</code>.
- </li>
-
- <li>
- source: A <code>luci.ip.cidr</code> instance or a string containing
-the preferred source address for route selection (optional).
- </li>
-
-</ul>
-
-
-
-
-<h3>Usage:</h3>
-<ul>
-<li>Find default gateway by getting route to Google's public NS server
-<pre>rt = luci.ip.route("8.8.8.8")
-if rt ~= nil then
- print("gateway is", rt.gw)
-end</pre></li>
-<li>Determine IPv6 upstream interface <pre>rt = luci.ip.route("2001::/7")
-if rt ~= nil then
- print("ipv6 upstream device is", rt.dev)
-end</pre></li>
-</ul>
-
-
-
-<h3>Return value:</h3>
-<p>Table containing the fields described below.</p>
-<table id="routetable">
-<tr><th>Field</th><th>Description</th></tr>
-<tr><td><code>type</code><td>
- <p>Route type with one of the following numeric values:</p>
- <table>
- <tr>
- <td><code>1</code></td>
- <td><code>RTN_UNICAST</code> - Gateway or direct route</td>
- </tr>
- <tr>
- <td><code>2</code></td>
- <td><code>RTN_LOCAL</code> - Accept locally</td>
- </tr>
- <tr>
- <td><code>3</code></td>
- <td><code>RTN_BROADCAST</code> -
- Accept locally as broadcast send as broadcast</td>
- </tr>
- <tr>
- <td><code>4</code></td>
- <td><code>RTN_ANYCAST</code> -
- Accept locally as broadcast but send as unicast</td>
- </tr>
- <tr>
- <td><code>5</code></td>
- <td><code>RTN_MULTICAST</code> - Multicast route</td>
- </tr>
- </table>
-</td></tr>
-<tr>
- <td><code>family</code></td>
- <td>Number containing the route family, <code>4</code> for IPv4 or
- <code>6</code> for IPv6</td>
-</tr>
-<tr>
- <td><code>dest</code></td>
- <td>Destination <code>luci.ip.cidr</code> instance</td>
-</tr>
-<tr>
- <td><code>gw</code></td>
- <td>Gateway <code>luci.ip.cidr</code> instance (optional)</td>
-</tr>
-<tr>
- <td><code>from</code></td>
- <td>Source address <code>luci.ip.cidr</code> instance (optional)</td>
-</tr>
-<tr>
- <td><code>src</code></td>
- <td>Preferred source <code>luci.ip.cidr</code> instance (optional)</td>
-</tr>
-<tr>
- <td><code>dev</code></td>
- <td>String containing the name of the outgoing interface</td>
-</tr>
-<tr>
- <td><code>iif</code></td>
- <td>String containing the name of the incoming interface (optional)</td>
-</tr>
-<tr>
- <td><code>table</code></td>
- <td>Number of the associated routing table (<code>0..65535</code>)</td>
-</tr>
-<tr>
- <td><code>proto</code></td>
- <td>Number of the associated routing protocol</td>
-</tr>
-<tr>
- <td><code>scope</code></td>
- <td>Number describing the scope of the route, most commonly
- <code>0</code> for global or <code>253</code> for on-link</td>
-</tr>
-<tr>
- <td><code>metric</code></td>
- <td>Number describing the route metric (optional)</td>
-</tr>
-<tr>
- <td><code>expires</code></td>
- <td>Number of seconds the prefix is valid (IPv6 only, optional)</td>
-</tr>
-<tr>
- <td><code>error</code></td>
- <td>Route destination error code (optional)</td>
-</tr>
-</table>
-
-
-
-<h3>See also:</h3>
-<ul>
-
- <li><a href="#routes">
- routes
- </a>
-
-</ul>
-
-</dd>
-
-
-
-
-<dt><a name="routes"></a><strong>routes</strong>&nbsp;(filter, callback)</dt>
-<dd>
-
-
-Fetch all routes, optionally matching the given criteria.
-
-
-<h3>Parameters</h3>
-<ul>
-
- <li>
- filter: <p>Table containing one or more of the possible filter
-criteria described below (optional)</p><table>
-<tr><th>Field</th><th>Description</th></tr>
-<tr><td><code>family</code></td><td>
- Number describing the address family to return - <code>4</code> selects
- IPv4 routes, <code>6</code> IPv6 ones. Any other value selects both.
-</td></tr>
-<tr><td><code>iif</code></td><td>
- String containing the incoming route interface to match.
-</td></tr>
-<tr><td><code>oif</code></td><td>
- String containing the outgoing route interface to match.
-</td></tr>
-<tr><td><code>type</code></td><td>
- Numeric type to match, e.g. <code>1</code> for unicast.
-</td></tr>
-<tr><td><code>scope</code></td><td>
- Numeric scope to match, e.g. <code>253</code> for onlink.
-</td></tr>
-<tr><td><code>proto</code></td><td>
- Numeric protocol to match, e.g. <code>2</code> for boot.
-</td></tr>
-<tr><td><code>table</code></td><td>
- Numeric routing table to match (<code>0..65535</code>).
-</td></tr>
-<tr><td><code>gw</code></td><td>
- String containing the gateway address to match. Can be in any notation
- specified by <code>luci.ip.new()</code>. Prefix matching is performed when
- comparing the routes, e.g. "192.168.1.0/24" would select routes with gateway
- addresses <code>192.168.1.1 .. 192.168.1.255</code>.
-</td></tr>
-<tr><td><code>dest</code></td><td>
- String containing the destination to match. Prefix matching is performed.
-</td></tr>
-<tr><td><code>from</code></td><td>
- String containing the source address to match. Prefix matching is performed.
-</td></tr>
-<tr><td><code>src</code></td><td>
- String containing the preferred source address to match.
- Prefix matching is performed.
-</td></tr>
-<tr><td><code>dest_exact</code></td><td>
- String containing the destination to match. Exact matching is performed,
- e.g. <code>dest = "0.0.0.0/0"</code> would match <em>any</em> IPv4 route
- while <code>dest_exact = "0.0.0.0/0"</code> will <em>only</em> match the
- default route.
-</td></tr>
-<tr><td><code>from_exact</code></td><td>
- String containing the source address to match. Exact matching is performed.
-</td></tr>
-</table>
- </li>
-
- <li>
- callback: <p>Callback function to invoke for each found route
-instead of returning one table of route objects (optional)</p>
- </li>
-
-</ul>
-
-
-
-
-<h3>Usage:</h3>
-<ul>
-<li>Find all IPv4 default routes:
-<pre>luci.ip.routes({ dest_exact = "0.0.0.0/0" }, function(rt)
- print(rt.type, rt.gw, rt.dev)
-end)</pre></li>
-<li>Find all global IPv6 prefixes on the current system:
-<pre>luci.ip.routes({ from = "2001::/7" }, function(rt)
- print(rt.from)
-end)</pre></li>
-<li>Fetch all IPv4 routes:
-<pre>routes = luci.ip.routes({ family = 4 })
-for _, rt in ipairs(routes) do
- print(rt.dest, rt.gw, rt.dev)
-end</pre></li>
-</ul>
-
-
-
-<h3>Return value:</h3>
-If no callback function is provided, a table of routes
-<a href="#routetable">as specified by <code>luci.ip.route()</code></a>
-is returned. If a callback function is given, it is invoked for each route
-and nothing is returned.
-
-
-
-<h3>See also:</h3>
-<ul>
-
- <li><a href="#route">
- route
- </a>
-
-</ul>
-
-</dd>
-
-
-
-
-<dt><a name="neighbors"></a><strong>neighbors</strong>&nbsp;(filter, callback)</dt>
-<dd>
-
-
-Fetches entries from the IPv4 ARP and IPv6 neighbour kernel table
-
-
-<h3>Parameters</h3>
-<ul>
-
- <li>
- filter: <p>Table containing one or more of the possible filter
-criteria described below (optional)</p><table>
-<tr><th>Field</th><th>Description</th></tr>
-<tr><td><code>family</code></td><td>
- Number describing the address family to return - <code>4</code> selects
- IPv4 ARP, <code>6</code> select IPv6 neighbour entries. Any other value
- selects both.
-</td></tr>
-<tr><td><code>dev</code></td><td>
- String containing the associated interface to match.
-</td></tr>
-<tr><td><code>dest</code></td><td>
- String containing the associated address to match. Can be in any notation
- specified by <code>luci.ip.new()</code>. Prefix matching is performed when
- comparing the addresses, e.g. "192.168.1.0/24" would select ARP entries
- for <code>192.168.1.1 .. 192.168.1.255</code>.
-</td></tr>
-<tr><td><code>mac</code></td><td>
- String containing MAC address to match.
-</td></tr>
-</table>
- </li>
-
- <li>
- callback: <p>Callback function to invoke for each found neighbour
-entry instead of returning one table of neighbour entries (optional)</p>
- </li>
-
-</ul>
-
-
-
-
-<h3>Usage:</h3>
-<ul>
-<li>Find all ARP neighbours in the LAN:
-<pre>luci.ip.neighbors({ dest = "192.168.0.0/16" }, function(n)
- print(n.dest, n.mac)
-end)</pre></li>
-<li>Find all active IPv6 addresses of host with given MAC:
-<pre>luci.ip.neighbors({ family = 6, mac = "00:21:63:75:aa:17" },
- function(n)
- print(n.dest)
- end)</pre></li>
-</ul>
-
-
-
-<h3>Return value:</h3>
-If no callback function is provided, a table of neighbour entries
-is returned. If a callback function is given, it is invoked for each entry
-and nothing is returned.
-
-A neighbour entry is a table containing the following fields:
-
-<table>
-<tr><th>Field</th><th>Description</th></tr>
-<tr>
- <td><code>family</code></td>
- <td>Number containing the neighbour entry family, <code>4</code> for IPv4
- ARP or <code>6</code> for IPv6 NDP</td>
-</tr>
-<tr>
- <td><code>dev</code></td>
- <td>String containing the associated device of the neighbour entry</td>
-</tr>
-<tr>
- <td><code>dest</code></td>
- <td>IP address <code>luci.ip.cidr</code> instance</td>
-</tr>
-<tr>
- <td><code>mac</code></td>
- <td>MAC address <code>luci.ip.cidr</code> instance</td>
-</tr>
-<tr>
- <td><code>router</code></td>
- <td>Boolean "true" if the neighbour entry is a router (IPv6, optional)</td>
-</tr>
-<tr>
- <td><code>proxy</code></td>
- <td>Boolean "true" if this is a proxy entry (optional)</td>
-</tr>
-<tr>
- <td><code>incomplete</code></td>
- <td>Boolean "true" if the entry is in incomplete state (optional)</td>
-</tr>
-<tr>
- <td><code>reachable</code></td>
- <td>Boolean "true" if the entry is in reachable state (optional)</td>
-</tr>
-<tr>
- <td><code>stale</code></td>
- <td>Boolean "true" if the entry is stale (optional)</td>
-</tr>
-<tr>
- <td><code>delay</code></td>
- <td>Boolean "true" if the entry is delayed (optional)</td>
-</tr>
-<tr>
- <td><code>probe</code></td>
- <td>Boolean "true" if the entry is in probe state (optional)</td>
-</tr>
-<tr>
- <td><code>failed</code></td>
- <td>Boolean "true" if the entry is in failed state (optional)</td>
-</tr>
-<tr>
- <td><code>noarp</code></td>
- <td>Boolean "true" if the entry is not caused by NDP or
- ARP (optional)</td>
-</tr>
-<tr>
- <td><code>permanent</code></td>
- <td>Boolean "true" if the entry was statically configured from
- userspace (optional)</td>
-</tr>
-</table>
-
-
-
-</dd>
-
-
-
-
-<dt><a name="link"></a><strong>link</strong>&nbsp;(device)</dt>
-<dd>
-
-
-Fetch basic device information
-
-
-<h3>Parameters</h3>
-<ul>
-
- <li>
- device: String containing the network device to query
- </li>
-
-</ul>
-
-
-
-
-<h3>Usage:</h3>
-<ul>
-<li>Test whether device br-lan exists:
-<pre>print(luci.ip.link("br-lan").name ~= nil)
-</pre></li>
-<li>Query MAC address of eth0:
-<pre>print(luci.ip.link("eth0").mac)
-</pre></li>
-</ul>
-
-
-
-<h3>Return value:</h3>
-If the given interface is found, a table containing the fields
-described below is returned, else an empty table.
-
-<table>
-<tr><th>Field</th><th>Description</th></tr>
-<tr>
- <td><code>up</code></td>
- <td>Boolean indicating whether the device is in IFF_RUNNING state</td>
-</tr>
-<tr>
- <td><code>type</code></td>
- <td>Numeric value indicating the type of the device, e.g. <code>1</code>
- for ethernet.</td>
-</tr>
-<tr>
- <td><code>name</code></td>
- <td>String containing the name of the device</td>
-</tr>
-<tr>
- <td><code>master</code></td>
- <td>If queried device is a bridge port, string containing the name of
- parent bridge device (optional)</td>
-</tr>
-<tr>
- <td><code>mtu</code></td>
- <td>Number containing the current MTU of the device</td>
-</tr>
-<tr>
- <td><code>qlen</code></td>
- <td>Number containing the TX queue length of the device</td>
-</tr>
-<tr>
- <td><code>mac</code></td>
- <td>MAC address <code>luci.ip.cidr</code> instance representing the device ethernet
- address</td>
-</tr>
-</table>
-
-
-
-</dd>
-
-
-</dl>
-
-
-
-
-
-</div> <!-- id="content" -->
-
-</div> <!-- id="main" -->
-
-<div id="about">
- <p><a href="http://validator.w3.org/check?uri=referer"><img src="http://www.w3.org/Icons/valid-xhtml10" alt="Valid XHTML 1.0!" height="31" width="88" /></a></p>
-</div> <!-- id="about" -->
-
-</div> <!-- id="container" -->
-</body>
-</html>