summaryrefslogtreecommitdiffhomepage
path: root/documentation
diff options
context:
space:
mode:
Diffstat (limited to 'documentation')
-rw-r--r--documentation/api/index.html21
-rw-r--r--documentation/api/modules/luci.dispatcher.html54
-rw-r--r--documentation/api/modules/luci.http.html437
-rw-r--r--documentation/api/modules/luci.http.protocol.html4
-rw-r--r--documentation/api/modules/luci.i18n.html10
-rw-r--r--documentation/api/modules/luci.ip.cidr.html340
-rw-r--r--documentation/api/modules/luci.ip.html298
-rw-r--r--documentation/api/modules/luci.json.html10
-rw-r--r--documentation/api/modules/luci.jsonc.html10
-rw-r--r--documentation/api/modules/luci.jsonc.parser.html10
-rw-r--r--documentation/api/modules/luci.model.ipkg.html10
-rw-r--r--documentation/api/modules/luci.model.uci.html97
-rw-r--r--documentation/api/modules/luci.rpcc.html10
-rw-r--r--documentation/api/modules/luci.rpcc.ruci.html10
-rw-r--r--documentation/api/modules/luci.sys.html10
-rw-r--r--documentation/api/modules/luci.sys.init.html10
-rw-r--r--documentation/api/modules/luci.sys.iptparser.html10
-rw-r--r--documentation/api/modules/luci.sys.net.html10
-rw-r--r--documentation/api/modules/luci.sys.process.html10
-rw-r--r--documentation/api/modules/luci.sys.user.html10
-rw-r--r--documentation/api/modules/luci.sys.wifi.html10
-rw-r--r--documentation/api/modules/luci.util.html257
-rw-r--r--documentation/api/modules/nixio.CHANGELOG.html10
-rw-r--r--documentation/api/modules/nixio.CryptoHash.html10
-rw-r--r--documentation/api/modules/nixio.File.html10
-rw-r--r--documentation/api/modules/nixio.README.html16
-rw-r--r--documentation/api/modules/nixio.Socket.html10
-rw-r--r--documentation/api/modules/nixio.TLSContext.html10
-rw-r--r--documentation/api/modules/nixio.TLSSocket.html10
-rw-r--r--documentation/api/modules/nixio.UnifiedIO.html20
-rw-r--r--documentation/api/modules/nixio.bin.html10
-rw-r--r--documentation/api/modules/nixio.bit.html10
-rw-r--r--documentation/api/modules/nixio.crypto.html10
-rw-r--r--documentation/api/modules/nixio.fs.html12
-rw-r--r--documentation/api/modules/nixio.html10
35 files changed, 1413 insertions, 383 deletions
diff --git a/documentation/api/index.html b/documentation/api/index.html
index c762b9b0e3..5e3f3c211a 100644
--- a/documentation/api/index.html
+++ b/documentation/api/index.html
@@ -43,19 +43,15 @@
</li>
<li>
- <a href="modules/luci.http.protocol.html">luci.http.protocol</a>
+ <a href="modules/luci.http.conditionals.html">luci.http.conditionals</a>
</li>
<li>
- <a href="modules/luci.http.protocol.conditionals.html">luci.http.protocol.conditionals</a>
+ <a href="modules/luci.http.date.html">luci.http.date</a>
</li>
<li>
- <a href="modules/luci.http.protocol.date.html">luci.http.protocol.date</a>
- </li>
-
- <li>
- <a href="modules/luci.http.protocol.mime.html">luci.http.protocol.mime</a>
+ <a href="modules/luci.http.mime.html">luci.http.mime</a>
</li>
<li>
@@ -214,22 +210,17 @@
</tr>
<tr>
- <td class="name"><a href="modules/luci.http.protocol.html">luci.http.protocol</a></td>
- <td class="summary"></td>
- </tr>
-
- <tr>
- <td class="name"><a href="modules/luci.http.protocol.conditionals.html">luci.http.protocol.conditionals</a></td>
+ <td class="name"><a href="modules/luci.http.conditionals.html">luci.http.conditionals</a></td>
<td class="summary"></td>
</tr>
<tr>
- <td class="name"><a href="modules/luci.http.protocol.date.html">luci.http.protocol.date</a></td>
+ <td class="name"><a href="modules/luci.http.date.html">luci.http.date</a></td>
<td class="summary"></td>
</tr>
<tr>
- <td class="name"><a href="modules/luci.http.protocol.mime.html">luci.http.protocol.mime</a></td>
+ <td class="name"><a href="modules/luci.http.mime.html">luci.http.mime</a></td>
<td class="summary"></td>
</tr>
diff --git a/documentation/api/modules/luci.dispatcher.html b/documentation/api/modules/luci.dispatcher.html
index 4ae88fe612..e4b12e676e 100644
--- a/documentation/api/modules/luci.dispatcher.html
+++ b/documentation/api/modules/luci.dispatcher.html
@@ -41,19 +41,15 @@
</li>
<li>
- <a href="../modules/luci.http.protocol.html">luci.http.protocol</a>
+ <a href="../modules/luci.http.conditionals.html">luci.http.conditionals</a>
</li>
<li>
- <a href="../modules/luci.http.protocol.conditionals.html">luci.http.protocol.conditionals</a>
+ <a href="../modules/luci.http.date.html">luci.http.date</a>
</li>
<li>
- <a href="../modules/luci.http.protocol.date.html">luci.http.protocol.date</a>
- </li>
-
- <li>
- <a href="../modules/luci.http.protocol.mime.html">luci.http.protocol.mime</a>
+ <a href="../modules/luci.http.mime.html">luci.http.mime</a>
</li>
<li>
@@ -321,7 +317,6 @@ Create a CBI form model dispatching target.</td>
<td class="summary">
Fetch or create a dispatching node without setting the target module or
-
enabling the node.</td>
</tr>
@@ -333,6 +328,13 @@ Dispatch an HTTP request.</td>
</tr>
<tr>
+ <td class="name" nowrap><a href="#lookup">lookup</a>&nbsp;(...)</td>
+ <td class="summary">
+
+Lookup node in dispatching tree.</td>
+ </tr>
+
+ <tr>
<td class="name" nowrap><a href="#modifier">modifier</a>&nbsp;(func, order)</td>
<td class="summary">
@@ -857,8 +859,8 @@ Create a CBI form model dispatching target.
Fetch or create a dispatching node without setting the target module or
-
-enabling the node.
+enabling the node.
+
<h3>Parameters</h3>
@@ -914,6 +916,38 @@ Dispatch an HTTP request.
+<dt><a name="lookup"></a><strong>lookup</strong>&nbsp;(...)</dt>
+<dd>
+
+
+Lookup node in dispatching tree.
+
+
+
+<h3>Parameters</h3>
+<ul>
+
+ <li>
+ ...: Virtual path
+ </li>
+
+</ul>
+
+
+
+
+
+
+<h3>Return value:</h3>
+Node object, canonical url or nil if the path was not found.
+
+
+
+</dd>
+
+
+
+
<dt><a name="modifier"></a><strong>modifier</strong>&nbsp;(func, order)</dt>
<dd>
diff --git a/documentation/api/modules/luci.http.html b/documentation/api/modules/luci.http.html
index ea04fc236e..d75863fa6e 100644
--- a/documentation/api/modules/luci.http.html
+++ b/documentation/api/modules/luci.http.html
@@ -41,19 +41,15 @@
<li><strong>luci.http</strong></li>
<li>
- <a href="../modules/luci.http.protocol.html">luci.http.protocol</a>
+ <a href="../modules/luci.http.conditionals.html">luci.http.conditionals</a>
</li>
<li>
- <a href="../modules/luci.http.protocol.conditionals.html">luci.http.protocol.conditionals</a>
+ <a href="../modules/luci.http.date.html">luci.http.date</a>
</li>
<li>
- <a href="../modules/luci.http.protocol.date.html">luci.http.protocol.date</a>
- </li>
-
- <li>
- <a href="../modules/luci.http.protocol.mime.html">luci.http.protocol.mime</a>
+ <a href="../modules/luci.http.mime.html">luci.http.mime</a>
</li>
<li>
@@ -256,7 +252,6 @@ Get the value of a certain HTTP-Cookie.</td>
<td class="summary">
Get the value of a certain HTTP environment variable
-
or the environment table itself.</td>
</tr>
@@ -268,6 +263,20 @@ Send a HTTP-Header.</td>
</tr>
<tr>
+ <td class="name" nowrap><a href="#mimedecode_message_body">mimedecode_message_body</a>&nbsp;(src, msg, filecb)</td>
+ <td class="summary">
+
+Decode a mime encoded http message body with multipart/form-data Content-Type.</td>
+ </tr>
+
+ <tr>
+ <td class="name" nowrap><a href="#parse_message_body">parse_message_body</a>&nbsp;(src, msg, filecb)</td>
+ <td class="summary">
+
+Try to extract and decode a http message body from the given ltn12 source.</td>
+ </tr>
+
+ <tr>
<td class="name" nowrap><a href="#prepare_content">prepare_content</a>&nbsp;(mime)</td>
<td class="summary">
@@ -311,6 +320,44 @@ Set the HTTP status code and status message.</td>
</tr>
<tr>
+ <td class="name" nowrap><a href="#urldecode">urldecode</a>&nbsp;(str, no_plus)</td>
+ <td class="summary">
+
+Return the URL-decoded equivalent of a string.</td>
+ </tr>
+
+ <tr>
+ <td class="name" nowrap><a href="#urldecode_message_body">urldecode_message_body</a>&nbsp;(src, msg)</td>
+ <td class="summary">
+
+Decode an urlencoded http message body with application/x-www-urlencoded
+Content-Type.</td>
+ </tr>
+
+ <tr>
+ <td class="name" nowrap><a href="#urldecode_params">urldecode_params</a>&nbsp;(url, tbl)</td>
+ <td class="summary">
+
+Extract and split urlencoded data pairs, separated bei either "&" or ";"
+from given url or string.</td>
+ </tr>
+
+ <tr>
+ <td class="name" nowrap><a href="#urlencode">urlencode</a>&nbsp;(str)</td>
+ <td class="summary">
+
+Return the URL-encoded equivalent of a string.</td>
+ </tr>
+
+ <tr>
+ <td class="name" nowrap><a href="#urlencode_params">urlencode_params</a>&nbsp;(tbl)</td>
+ <td class="summary">
+
+Encode each key-value-pair in given table to x-www-urlencoded format,
+separated by "&".</td>
+ </tr>
+
+ <tr>
<td class="name" nowrap><a href="#write">write</a>&nbsp;(content, src_err)</td>
<td class="summary">
@@ -377,7 +424,6 @@ Encoded HTTP query string
Close the HTTP-Connection.
-
@@ -527,8 +573,8 @@ String containing cookie data
Get the value of a certain HTTP environment variable
-
-or the environment table itself.
+or the environment table itself.
+
<h3>Parameters</h3>
@@ -588,6 +634,135 @@ Send a HTTP-Header.
+<dt><a name="mimedecode_message_body"></a><strong>mimedecode_message_body</strong>&nbsp;(src, msg, filecb)</dt>
+<dd>
+
+
+Decode a mime encoded http message body with multipart/form-data Content-Type.
+
+Stores all extracted data associated with its parameter name
+in the params table within the given message object. Multiple parameter
+values are stored as tables, ordinary ones as strings.
+
+If an optional file callback function is given then it is feeded with the
+file contents chunk by chunk and only the extracted file name is stored
+within the params table. The callback function will be called subsequently
+with three arguments:
+ o Table containing decoded (name, file) and raw (headers) mime header data
+ o String value containing a chunk of the file data
+ o Boolean which indicates wheather the current chunk is the last one (eof)
+
+
+
+<h3>Parameters</h3>
+<ul>
+
+ <li>
+ src: Ltn12 source function
+ </li>
+
+ <li>
+ msg: HTTP message object
+ </li>
+
+ <li>
+ filecb: File callback function (optional)
+ </li>
+
+</ul>
+
+
+
+
+
+
+<h3>Return values:</h3>
+<ol>
+
+ <li>Value indicating successful operation (not nil means "ok")
+
+ <li>String containing the error if unsuccessful
+
+</ol>
+
+
+
+<h3>See also:</h3>
+<ul>
+
+ <li><a href="">
+ parse_message_header
+ </a>
+
+</ul>
+
+</dd>
+
+
+
+
+<dt><a name="parse_message_body"></a><strong>parse_message_body</strong>&nbsp;(src, msg, filecb)</dt>
+<dd>
+
+
+Try to extract and decode a http message body from the given ltn12 source.
+This function will examine the Content-Type within the given message object
+to select the appropriate content decoder.
+
+Currently the application/x-www-urlencoded and application/form-data
+mime types are supported. If the encountered content encoding can't be
+handled then the whole message body will be stored unaltered as "content"
+property within the given message object.
+
+
+
+<h3>Parameters</h3>
+<ul>
+
+ <li>
+ src: Ltn12 source function
+ </li>
+
+ <li>
+ msg: HTTP message object
+ </li>
+
+ <li>
+ filecb: File data callback (optional, see mimedecode_message_body())
+ </li>
+
+</ul>
+
+
+
+
+
+
+<h3>Return values:</h3>
+<ol>
+
+ <li>Value indicating successful operation (not nil means "ok")
+
+ <li>String containing the error if unsuccessful
+
+</ol>
+
+
+
+<h3>See also:</h3>
+<ul>
+
+ <li><a href="">
+ parse_message_header
+ </a>
+
+</ul>
+
+</dd>
+
+
+
+
<dt><a name="prepare_content"></a><strong>prepare_content</strong>&nbsp;(mime)</dt>
<dd>
@@ -764,6 +939,243 @@ Set the HTTP status code and status message.
+<dt><a name="urldecode"></a><strong>urldecode</strong>&nbsp;(str, no_plus)</dt>
+<dd>
+
+
+Return the URL-decoded equivalent of a string.
+
+
+
+<h3>Parameters</h3>
+<ul>
+
+ <li>
+ str: URL-encoded string
+ </li>
+
+ <li>
+ no_plus: Don't decode + to " "
+ </li>
+
+</ul>
+
+
+
+
+
+
+<h3>Return value:</h3>
+URL-decoded string
+
+
+
+<h3>See also:</h3>
+<ul>
+
+ <li><a href="#urlencode">
+ urlencode
+ </a>
+
+</ul>
+
+</dd>
+
+
+
+
+<dt><a name="urldecode_message_body"></a><strong>urldecode_message_body</strong>&nbsp;(src, msg)</dt>
+<dd>
+
+
+Decode an urlencoded http message body with application/x-www-urlencoded
+Content-Type.
+
+Stores all extracted data associated with its parameter name in the params
+table within the given message object. Multiple parameter values are stored
+as tables, ordinary ones as strings.
+
+
+
+<h3>Parameters</h3>
+<ul>
+
+ <li>
+ src: Ltn12 source function
+ </li>
+
+ <li>
+ msg: HTTP message object
+ </li>
+
+</ul>
+
+
+
+
+
+
+<h3>Return values:</h3>
+<ol>
+
+ <li>Value indicating successful operation (not nil means "ok")
+
+ <li>String containing the error if unsuccessful
+
+</ol>
+
+
+
+<h3>See also:</h3>
+<ul>
+
+ <li><a href="">
+ parse_message_header
+ </a>
+
+</ul>
+
+</dd>
+
+
+
+
+<dt><a name="urldecode_params"></a><strong>urldecode_params</strong>&nbsp;(url, tbl)</dt>
+<dd>
+
+
+Extract and split urlencoded data pairs, separated bei either "&" or ";"
+from given url or string. Returns a table with urldecoded values.
+
+Simple parameters are stored as string values associated with the parameter
+name within the table. Parameters with multiple values are stored as array
+containing the corresponding values.
+
+
+
+<h3>Parameters</h3>
+<ul>
+
+ <li>
+ url: The url or string which contains x-www-urlencoded form data
+ </li>
+
+ <li>
+ tbl: Use the given table for storing values (optional)
+ </li>
+
+</ul>
+
+
+
+
+
+
+<h3>Return value:</h3>
+Table containing the urldecoded parameters
+
+
+
+<h3>See also:</h3>
+<ul>
+
+ <li><a href="#urlencode_params">
+ urlencode_params
+ </a>
+
+</ul>
+
+</dd>
+
+
+
+
+<dt><a name="urlencode"></a><strong>urlencode</strong>&nbsp;(str)</dt>
+<dd>
+
+
+Return the URL-encoded equivalent of a string.
+
+
+
+<h3>Parameters</h3>
+<ul>
+
+ <li>
+ str: Source string
+ </li>
+
+</ul>
+
+
+
+
+
+
+<h3>Return value:</h3>
+URL-encoded string
+
+
+
+<h3>See also:</h3>
+<ul>
+
+ <li><a href="#urldecode">
+ urldecode
+ </a>
+
+</ul>
+
+</dd>
+
+
+
+
+<dt><a name="urlencode_params"></a><strong>urlencode_params</strong>&nbsp;(tbl)</dt>
+<dd>
+
+
+Encode each key-value-pair in given table to x-www-urlencoded format,
+separated by "&".
+
+Tables are encoded as parameters with multiple values by repeating the
+parameter name with each value.
+
+
+
+<h3>Parameters</h3>
+<ul>
+
+ <li>
+ tbl: Table with the values
+ </li>
+
+</ul>
+
+
+
+
+
+
+<h3>Return value:</h3>
+String containing encoded values
+
+
+
+<h3>See also:</h3>
+<ul>
+
+ <li><a href="#urldecode_params">
+ urldecode_params
+ </a>
+
+</ul>
+
+</dd>
+
+
+
+
<dt><a name="write"></a><strong>write</strong>&nbsp;(content, src_err)</dt>
<dd>
@@ -771,7 +1183,8 @@ Set the HTTP status code and status message.
Send a chunk of content data to the client.
This function is as a valid LTN12 sink.
-If the content chunk is nil this function will automatically invoke close.
+If the content chunk is nil this function will automatically invoke close.
+
<h3>Parameters</h3>
diff --git a/documentation/api/modules/luci.http.protocol.html b/documentation/api/modules/luci.http.protocol.html
index 57063bbcf9..e6e93ad3d6 100644
--- a/documentation/api/modules/luci.http.protocol.html
+++ b/documentation/api/modules/luci.http.protocol.html
@@ -341,7 +341,7 @@ Ltn12 source function
Decode a mime encoded http message body with multipart/form-data
Content-Type. Stores all extracted data associated with its parameter name
-in the params table within the given message object. Multiple parameter
+in the params table within the given message object. Multiple parameter
values are stored as tables, ordinary ones as strings.
If an optional file callback function is given then it is feeded with the
file contents chunk by chunk and only the extracted file name is stored
@@ -556,7 +556,7 @@ The decoded string
Decode an urlencoded http message body with application/x-www-urlencoded
Content-Type. Stores all extracted data associated with its parameter name
-in the params table within the given message object. Multiple parameter
+in the params table within the given message object. Multiple parameter
values are stored as tables, ordinary ones as strings.
diff --git a/documentation/api/modules/luci.i18n.html b/documentation/api/modules/luci.i18n.html
index 0111cb200f..3f0738bf18 100644
--- a/documentation/api/modules/luci.i18n.html
+++ b/documentation/api/modules/luci.i18n.html
@@ -43,19 +43,15 @@
</li>
<li>
- <a href="../modules/luci.http.protocol.html">luci.http.protocol</a>
+ <a href="../modules/luci.http.conditionals.html">luci.http.conditionals</a>
</li>
<li>
- <a href="../modules/luci.http.protocol.conditionals.html">luci.http.protocol.conditionals</a>
+ <a href="../modules/luci.http.date.html">luci.http.date</a>
</li>
<li>
- <a href="../modules/luci.http.protocol.date.html">luci.http.protocol.date</a>
- </li>
-
- <li>
- <a href="../modules/luci.http.protocol.mime.html">luci.http.protocol.mime</a>
+ <a href="../modules/luci.http.mime.html">luci.http.mime</a>
</li>
<li><strong>luci.i18n</strong></li>
diff --git a/documentation/api/modules/luci.ip.cidr.html b/documentation/api/modules/luci.ip.cidr.html
index ce8c567952..50633a7735 100644
--- a/documentation/api/modules/luci.ip.cidr.html
+++ b/documentation/api/modules/luci.ip.cidr.html
@@ -43,19 +43,15 @@
</li>
<li>
- <a href="../modules/luci.http.protocol.html">luci.http.protocol</a>
+ <a href="../modules/luci.http.conditionals.html">luci.http.conditionals</a>
</li>
<li>
- <a href="../modules/luci.http.protocol.conditionals.html">luci.http.protocol.conditionals</a>
+ <a href="../modules/luci.http.date.html">luci.http.date</a>
</li>
<li>
- <a href="../modules/luci.http.protocol.date.html">luci.http.protocol.date</a>
- </li>
-
- <li>
- <a href="../modules/luci.http.protocol.mime.html">luci.http.protocol.mime</a>
+ <a href="../modules/luci.http.mime.html">luci.http.mime</a>
</li>
<li>
@@ -260,6 +256,30 @@ Checks whether the CIDR instance is an IPv6 mapped IPv4 address
</tr>
<tr>
+ <td class="name" nowrap><a href="#cidr.ismac">cidr:ismac</a>&nbsp;()</td>
+ <td class="summary">
+
+Checks whether the CIDR instance is an ethernet MAC address range
+ </td>
+ </tr>
+
+ <tr>
+ <td class="name" nowrap><a href="#cidr.ismaclocal">cidr:ismaclocal</a>&nbsp;()</td>
+ <td class="summary">
+
+Checks whether the CIDR instance is a locally administered (LAA) MAC address
+ </td>
+ </tr>
+
+ <tr>
+ <td class="name" nowrap><a href="#cidr.ismacmcast">cidr:ismacmcast</a>&nbsp;()</td>
+ <td class="summary">
+
+Checks whether the CIDR instance is a multicast MAC address
+ </td>
+ </tr>
+
+ <tr>
<td class="name" nowrap><a href="#cidr.lower">cidr:lower</a>&nbsp;(addr)</td>
<td class="summary">
@@ -323,6 +343,20 @@ Derive mapped IPv4 address of CIDR instance.</td>
</tr>
<tr>
+ <td class="name" nowrap><a href="#cidr.tomac">cidr:tomac</a>&nbsp;()</td>
+ <td class="summary">
+
+Derive MAC address of IPv6 link local CIDR instance.</td>
+ </tr>
+
+ <tr>
+ <td class="name" nowrap><a href="#cidr.tolinklocal">cidr:tolinklocal</a>&nbsp;()</td>
+ <td class="summary">
+
+Derive IPv6 link local address from MAC address CIDR instance.</td>
+ </tr>
+
+ <tr>
<td class="name" nowrap><a href="#cidr.contains">cidr:contains</a>&nbsp;(addr)</td>
<td class="summary">
@@ -405,6 +439,10 @@ Checks whether the CIDR instance is an IPv4 address range
cidr:is6
</a>
+ <li><a href="#cidr.ismac">
+ cidr:ismac
+ </a>
+
</ul>
</dd>
@@ -499,6 +537,10 @@ Checks whether the CIDR instance is an IPv6 address range
cidr:is4
</a>
+ <li><a href="#cidr.ismac">
+ cidr:ismac
+ </a>
+
</ul>
</dd>
@@ -566,13 +608,108 @@ end</pre>
+<dt><a name="cidr.ismac"></a><strong>cidr:ismac</strong>&nbsp;()</dt>
+<dd>
+
+
+Checks whether the CIDR instance is an ethernet MAC address range
+
+
+
+
+
+
+
+
+<h3>Return value:</h3>
+<code>true</code> if the CIDR is a MAC address range, else <code>false</code>
+
+
+
+<h3>See also:</h3>
+<ul>
+
+ <li><a href="#cidr.is4">
+ cidr:is4
+ </a>
+
+ <li><a href="#cidr.is6">
+ cidr:is6
+ </a>
+
+</ul>
+
+</dd>
+
+
+
+
+<dt><a name="cidr.ismaclocal"></a><strong>cidr:ismaclocal</strong>&nbsp;()</dt>
+<dd>
+
+
+Checks whether the CIDR instance is a locally administered (LAA) MAC address
+
+
+
+
+
+
+<h3>Usage:</h3>
+<pre>local mac = luci.ip.new("02:C0:FF:EE:00:01")
+if mac:ismaclocal() then
+ print("Is an LAA MAC address")
+end</pre>
+
+
+
+<h3>Return value:</h3>
+<code>true</code> if the MAC address sets the locally administered bit.
+
+
+
+</dd>
+
+
+
+
+<dt><a name="cidr.ismacmcast"></a><strong>cidr:ismacmcast</strong>&nbsp;()</dt>
+<dd>
+
+
+Checks whether the CIDR instance is a multicast MAC address
+
+
+
+
+
+
+<h3>Usage:</h3>
+<pre>local mac = luci.ip.new("01:00:5E:7F:00:10")
+if addr:ismacmcast() then
+ print("Is a multicast MAC address")
+end</pre>
+
+
+
+<h3>Return value:</h3>
+<code>true</code> if the MAC address sets the multicast bit.
+
+
+
+</dd>
+
+
+
+
<dt><a name="cidr.lower"></a><strong>cidr:lower</strong>&nbsp;(addr)</dt>
<dd>
Checks whether this CIDR instance is lower than the given argument.
The comparisation follows these rules:
-<ul><li>An IPv4 address is always lower than an IPv6 address</li>
+<ul><li>An IPv4 address is always lower than an IPv6 address and IPv6 addresses
+are considered lower than MAC addresses</li>
<li>Prefix sizes are ignored</li></ul>
@@ -595,7 +732,8 @@ The comparisation follows these rules:
print(addr:lower(addr)) -- false
print(addr:lower("10.10.10.10/24")) -- false
print(addr:lower(luci.ip.new("::1"))) -- true
-print(addr:lower(luci.ip.new("192.168.200.1"))) -- true</pre>
+print(addr:lower(luci.ip.new("192.168.200.1"))) -- true
+print(addr:lower(luci.ip.new("00:14:22:01:23:45"))) -- true</pre>
@@ -629,7 +767,8 @@ print(addr:lower(luci.ip.new("192.168.200.1"))) -- true</pre>
Checks whether this CIDR instance is higher than the given argument.
The comparisation follows these rules:
-<ul><li>An IPv4 address is always lower than an IPv6 address</li>
+<ul><li>An IPv4 address is always lower than an IPv6 address and IPv6 addresses
+are considered lower than MAC addresses</li>
<li>Prefix sizes are ignored</li></ul>
@@ -652,7 +791,8 @@ The comparisation follows these rules:
print(addr:higher(addr)) -- false
print(addr:higher("10.10.10.10/24")) -- true
print(addr:higher(luci.ip.new("::1"))) -- false
-print(addr:higher(luci.ip.new("192.168.200.1"))) -- false</pre>
+print(addr:higher(luci.ip.new("192.168.200.1"))) -- false
+print(addr:higher(luci.ip.new("00:14:22:01:23:45"))) -- false</pre>
@@ -709,7 +849,11 @@ print(addr:equal(luci.ip.new("::1"))) -- false
local addr6 = luci.ip.new("::1")
print(addr6:equal("0:0:0:0:0:0:0:1/64")) -- true
-print(addr6:equal(luci.ip.new("fe80::221:63ff:fe75:aa17"))) -- false</pre>
+print(addr6:equal(luci.ip.new("fe80::221:63ff:fe75:aa17"))) -- false
+
+local mac = luci.ip.new("00:14:22:01:23:45")
+print(mac:equal("0:14:22:1:23:45")) -- true
+print(mac:equal(luci.ip.new("01:23:45:67:89:AB")) -- false</pre>
@@ -752,8 +896,8 @@ else the current prefix size is returned.
<li>
mask: Either a number containing the number of bits (<code>0..32</code>
- for IPv4, <code>0..128</code> for IPv6) or a string containing a valid
- netmask (optional)
+ for IPv4, <code>0..128</code> for IPv6 or <code>0..48</code> for MAC addresses) or a string
+ containing a valid netmask (optional)
</li>
</ul>
@@ -800,8 +944,8 @@ optional mask parameter.
<li>
mask: Either a number containing the number of bits (<code>0..32</code>
- for IPv4, <code>0..128</code> for IPv6) or a string containing a valid
- netmask (optional)
+ for IPv4, <code>0..128</code> for IPv6 or <code>0..48</code> for MAC addresses) or a string
+ containing a valid netmask (optional)
</li>
</ul>
@@ -837,7 +981,7 @@ CIDR instance representing the network address
Derive host address of CIDR instance.
This function essentially constructs a copy of this CIDR with the prefix size
-set to <code>32</code> for IPv4 and <code>128</code> for IPv6.
+set to <code>32</code> for IPv4, <code>128</code> for IPv6 or <code>48</code> for MAC addresses.
@@ -877,8 +1021,8 @@ prefix size can be overridden by the optional mask parameter.
<li>
mask: Either a number containing the number of bits (<code>0..32</code>
- for IPv4, <code>0..128</code> for IPv6) or a string containing a valid
- netmask (optional)
+ for IPv4, <code>0..128</code> for IPv6 or <code>0..48</code> for MAC addresses) or a string
+ containing a valid netmask (optional)
</li>
</ul>
@@ -913,8 +1057,8 @@ Derive broadcast address of CIDR instance.
Constructs a CIDR instance representing the broadcast address of this instance.
The used prefix size can be overridden by the optional mask parameter.
-This function has no effect on IPv6 instances, it will return nothing in this
-case.
+This function has no effect on IPv6 or MAC address instances, it will return
+nothing in this case.
@@ -922,9 +1066,8 @@ case.
<ul>
<li>
- mask: Either a number containing the number of bits (<code>0..32</code>
- for IPv4, <code>0..128</code> for IPv6) or a string containing a valid
- netmask (optional)
+ mask: Either a number containing the number of bits (<code>0..32</code> for IPv4) or
+ a string containing a valid netmask (optional)
</li>
</ul>
@@ -960,8 +1103,8 @@ Derive mapped IPv4 address of CIDR instance.
Constructs a CIDR instance representing the IPv4 address of the IPv6 mapped
IPv4 address in this instance.
-This function has no effect on IPv4 instances or IPv6 instances which are not a
-mapped address, it will return nothing in this case.
+This function has no effect on IPv4 instances, MAC address instances or IPv6
+instances which are not a mapped address, it will return nothing in this case.
@@ -985,6 +1128,74 @@ Return a new CIDR instance representing the IPv4 address if this
+<dt><a name="cidr.tomac"></a><strong>cidr:tomac</strong>&nbsp;()</dt>
+<dd>
+
+
+Derive MAC address of IPv6 link local CIDR instance.
+
+Constructs a CIDR instance representing the MAC address contained in the IPv6
+link local address of this instance.
+
+This function has no effect on IPv4 instances, MAC address instances or IPv6
+instances which are not a link local address, it will return nothing in this
+case.
+
+
+
+
+
+
+<h3>Usage:</h3>
+<pre>local addr = luci.ip.new("fe80::6666:b3ff:fe47:e1b9")
+print(addr:tomac()) -- "64:66:B3:47:E1:B9"</pre>
+
+
+
+<h3>Return value:</h3>
+Return a new CIDR instance representing the MAC address if this
+ instance is an IPv6 link local address, else return nothing.
+
+
+
+</dd>
+
+
+
+
+<dt><a name="cidr.tolinklocal"></a><strong>cidr:tolinklocal</strong>&nbsp;()</dt>
+<dd>
+
+
+Derive IPv6 link local address from MAC address CIDR instance.
+
+Constructs a CIDR instance representing the IPv6 link local address of the
+MAC address represented by this instance.
+
+This function has no effect on IPv4 instances or IPv6 instances, it will return
+nothing in this case.
+
+
+
+
+
+
+<h3>Usage:</h3>
+<pre>local mac = luci.ip.new("64:66:B3:47:E1:B9")
+print(mac:tolinklocal()) -- "fe80::6666:b3ff:fe47:e1b9"</pre>
+
+
+
+<h3>Return value:</h3>
+Return a new CIDR instance representing the IPv6 link local address.
+
+
+
+</dd>
+
+
+
+
<dt><a name="cidr.contains"></a><strong>cidr:contains</strong>&nbsp;(addr)</dt>
<dd>
@@ -1014,7 +1225,11 @@ print(range:contains("10.0.0.0/8")) -- false
local range6 = luci.ip.new("fe80::/10")
print(range6:contains("fe80::221:63f:fe75:aa17/64")) -- true
-print(range6:contains("fd9b:6b3:c5:0:221:63f:fe75:aa17/64")) -- false</pre>
+print(range6:contains("fd9b:6b3:c5:0:221:63f:fe75:aa17/64")) -- false
+
+local intel_macs = luci.ip.MAC("C0:B6:F9:00:00:00/24")
+print(intel_macs:contains("C0:B6:F9:A3:C:11")) -- true
+print(intel_macs:contains("64:66:B3:47:E1:B9")) -- false</pre>
@@ -1059,30 +1274,40 @@ address space, the result is set to the highest possible address.
<h3>Usage:</h3>
<pre>local addr = luci.ip.new("192.168.1.1/24")
-print(addr:add(250)) -- "192.168.1.251/24"
-print(addr:add("0.0.99.0")) -- "192.168.100.1/24"
+print(addr:add(250)) -- "192.168.1.251/24"
+print(addr:add("0.0.99.0")) -- "192.168.100.1/24"
-addr:add(256, true) -- true
-print(addr) -- "192.168.2.1/24
+addr:add(256, true) -- true
+print(addr) -- "192.168.2.1/24
-addr:add("255.0.0.0", true) -- false (overflow)
-print(addr) -- "255.255.255.255/24
+addr:add("255.0.0.0", true) -- false (overflow)
+print(addr) -- "255.255.255.255/24
local addr6 = luci.ip.new("fe80::221:63f:fe75:aa17/64")
-print(addr6:add(256)) -- "fe80::221:63f:fe75:ab17/64"
-print(addr6:add("::ffff:0")) -- "fe80::221:640:fe74:aa17/64"
+print(addr6:add(256)) -- "fe80::221:63f:fe75:ab17/64"
+print(addr6:add("::ffff:0")) -- "fe80::221:640:fe74:aa17/64"
+
+addr6:add(256, true) -- true
+print(addr6) -- "fe80::221:63f:fe75:ab17/64
+
+addr6:add("ffff::", true) -- false (overflow)
+print(addr6) -- "ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff/64"
+
+local mac = luci.ip.new("00:14:22:01:23:45")
+print(mac:add(256)) -- "00:14:22:01:24:45"
+print(mac:add("0:0:0:0:FF:0") -- "00:14:22:02:22:45"
-addr:add(256, true) -- true
-print(addr) -- "fe80::221:63f:fe75:ab17/64
+mac:add(256, true) -- true
+print(mac) -- "00:14:22:01:24:45"
-addr:add("ffff::", true) -- false (overflow)
-print(addr) -- "ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff/64"</pre>
+mac:add("FF:FF:0:0:0:0", true) -- false (overflow)
+print(mac) -- "FF:FF:FF:FF:FF:FF"</pre>
<h3>Return value:</h3>
<ul>
- <li>When adding inplace: Return <code>true</code> if the addition succeeded
+ <li>When adding inplace: Return <code>true</code> if the addition succeded
or <code>false</code> when the addition overflowed.</li>
<li>When deriving new CIDR: Return new instance representing the value of
this instance plus the added amount or the highest possible address if
@@ -1099,7 +1324,7 @@ print(addr) -- "ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff/64"</pr
<dd>
-Subtract given amount from CIDR instance. If the result would under, the lowest
+Subtract given amount from CIDR instance. If the result would under, the lowest
possible address is returned.
@@ -1142,16 +1367,26 @@ addr:sub(256, true) -- true
print(addr) -- "fe80::221:63f:fe75:a917/64"
addr:sub("ffff::", true) -- false (underflow)
-print(addr) -- "::/64"</pre>
+print(addr) -- "::/64"
+
+local mac = luci.ip.new("00:14:22:01:23:45")
+print(mac:sub(256)) -- "00:14:22:01:22:45"
+print(mac:sub("0:0:0:0:FF:0") -- "00:14:22:00:24:45"
+
+mac:sub(256, true) -- true
+print(mac) -- "00:14:22:01:22:45"
+
+mac:sub("FF:FF:0:0:0:0", true) -- false (overflow)
+print(mac) -- "00:00:00:00:00:00"</pre>
<h3>Return value:</h3>
<ul>
- <li>When subtracting inplace: Return <code>true</code> if the subtraction
- succeeded or <code>false</code> when the subtraction underflowed.</li>
+ <li>When subtracting inplace: Return <code>true</code> if the subtraction
+ succeeded or <code>false</code> when the subtraction underflowed.</li>
<li>When deriving new CIDR: Return new instance representing the value of
- this instance minus the subtracted amount or the lowest address if
+ this instance minus the subtracted amount or the lowest address if
the subtraction underflowed.</li></ul>
@@ -1177,7 +1412,10 @@ Calculate the lowest possible host address within this CIDR instance.
print(addr:minhost()) -- "192.168.123.1"
local addr6 = luci.ip.new("fd9b:62b3:9cc5:0:221:63ff:fe75:aa17/64")
-print(addr6:minhost()) -- "fd9b:62b3:9cc5::1"</pre>
+print(addr6:minhost()) -- "fd9b:62b3:9cc5::1"
+
+local mac = luci.ip.new("00:14:22:01:22:45/32")
+print(mac:minhost()) -- "00:14:22:01:00:01"</pre>
@@ -1208,7 +1446,10 @@ Calculate the highest possible host address within this CIDR instance.
print(addr:maxhost()) -- "192.168.123.254" (.255 is broadcast)
local addr6 = luci.ip.new("fd9b:62b3:9cc5:0:221:63ff:fe75:aa17/64")
-print(addr6:maxhost()) -- "fd9b:62b3:9cc5:0:ffff:ffff:ffff:ffff"</pre>
+print(addr6:maxhost()) -- "fd9b:62b3:9cc5:0:ffff:ffff:ffff:ffff"
+
+local mac = luci.ip.new("00:14:22:01:22:45/32")
+print(mac:maxhost()) -- "00:14:22:01:FF:FF"</pre>
@@ -1229,8 +1470,9 @@ Returns a new CIDR instance representing the highest host address
Convert CIDR instance into string representation.
-If the prefix size of instance is less than 32 for IPv4 or 128 for IPv6, the
-address is returned in the form "address/prefix" otherwise just "address".
+If the prefix size of instance is less than 32 for IPv4, 128 for IPv6 or 48 for
+MACs, the address is returned in the form "address/prefix" otherwise just
+"address".
It is usually not required to call this function directly as CIDR objects
define it as __tostring function in the associated metatable.
diff --git a/documentation/api/modules/luci.ip.html b/documentation/api/modules/luci.ip.html
index 549a55307e..fc13e31e58 100644
--- a/documentation/api/modules/luci.ip.html
+++ b/documentation/api/modules/luci.ip.html
@@ -43,19 +43,15 @@
</li>
<li>
- <a href="../modules/luci.http.protocol.html">luci.http.protocol</a>
+ <a href="../modules/luci.http.conditionals.html">luci.http.conditionals</a>
</li>
<li>
- <a href="../modules/luci.http.protocol.conditionals.html">luci.http.protocol.conditionals</a>
+ <a href="../modules/luci.http.date.html">luci.http.date</a>
</li>
<li>
- <a href="../modules/luci.http.protocol.date.html">luci.http.protocol.date</a>
- </li>
-
- <li>
- <a href="../modules/luci.http.protocol.mime.html">luci.http.protocol.mime</a>
+ <a href="../modules/luci.http.mime.html">luci.http.mime</a>
</li>
<li>
@@ -232,6 +228,34 @@ 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)</td>
<td class="summary">
@@ -334,6 +358,10 @@ address/mask range.
IPv6
</a>
+ <li><a href="#MAC">
+ MAC
+ </a>
+
</ul>
</dd>
@@ -389,6 +417,10 @@ A <code>luci.ip.cidr</code> object representing the given IPv4 range.
IPv6
</a>
+ <li><a href="#MAC">
+ MAC
+ </a>
+
</ul>
</dd>
@@ -444,6 +476,252 @@ A <code>luci.ip.cidr</code> object representing the given IPv6 range.
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>
@@ -787,7 +1065,7 @@ A neighbour entry is a table containing the following fields:
</tr>
<tr>
<td><code>mac</code></td>
- <td>String containing the associated MAC address</td>
+ <td>MAC address <code>luci.ip.cidr</code> instance</td>
</tr>
<tr>
<td><code>router</code></td>
@@ -905,8 +1183,8 @@ described below is returned, else an empty table.
</tr>
<tr>
<td><code>mac</code></td>
- <td>String containing the link local address of the device in
- dotted hex notation</td>
+ <td>MAC address <code>luci.ip.cidr</code> instance representing the device ethernet
+ address</td>
</tr>
</table>
diff --git a/documentation/api/modules/luci.json.html b/documentation/api/modules/luci.json.html
index 761bd6e7ea..db2d1da3f4 100644
--- a/documentation/api/modules/luci.json.html
+++ b/documentation/api/modules/luci.json.html
@@ -43,19 +43,15 @@
</li>
<li>
- <a href="../modules/luci.http.protocol.html">luci.http.protocol</a>
+ <a href="../modules/luci.http.conditionals.html">luci.http.conditionals</a>
</li>
<li>
- <a href="../modules/luci.http.protocol.conditionals.html">luci.http.protocol.conditionals</a>
+ <a href="../modules/luci.http.date.html">luci.http.date</a>
</li>
<li>
- <a href="../modules/luci.http.protocol.date.html">luci.http.protocol.date</a>
- </li>
-
- <li>
- <a href="../modules/luci.http.protocol.mime.html">luci.http.protocol.mime</a>
+ <a href="../modules/luci.http.mime.html">luci.http.mime</a>
</li>
<li>
diff --git a/documentation/api/modules/luci.jsonc.html b/documentation/api/modules/luci.jsonc.html
index f82eb406c7..79deb933d7 100644
--- a/documentation/api/modules/luci.jsonc.html
+++ b/documentation/api/modules/luci.jsonc.html
@@ -43,19 +43,15 @@
</li>
<li>
- <a href="../modules/luci.http.protocol.html">luci.http.protocol</a>
+ <a href="../modules/luci.http.conditionals.html">luci.http.conditionals</a>
</li>
<li>
- <a href="../modules/luci.http.protocol.conditionals.html">luci.http.protocol.conditionals</a>
+ <a href="../modules/luci.http.date.html">luci.http.date</a>
</li>
<li>
- <a href="../modules/luci.http.protocol.date.html">luci.http.protocol.date</a>
- </li>
-
- <li>
- <a href="../modules/luci.http.protocol.mime.html">luci.http.protocol.mime</a>
+ <a href="../modules/luci.http.mime.html">luci.http.mime</a>
</li>
<li>
diff --git a/documentation/api/modules/luci.jsonc.parser.html b/documentation/api/modules/luci.jsonc.parser.html
index e8e145f437..709cb9afc5 100644
--- a/documentation/api/modules/luci.jsonc.parser.html
+++ b/documentation/api/modules/luci.jsonc.parser.html
@@ -43,19 +43,15 @@
</li>
<li>
- <a href="../modules/luci.http.protocol.html">luci.http.protocol</a>
+ <a href="../modules/luci.http.conditionals.html">luci.http.conditionals</a>
</li>
<li>
- <a href="../modules/luci.http.protocol.conditionals.html">luci.http.protocol.conditionals</a>
+ <a href="../modules/luci.http.date.html">luci.http.date</a>
</li>
<li>
- <a href="../modules/luci.http.protocol.date.html">luci.http.protocol.date</a>
- </li>
-
- <li>
- <a href="../modules/luci.http.protocol.mime.html">luci.http.protocol.mime</a>
+ <a href="../modules/luci.http.mime.html">luci.http.mime</a>
</li>
<li>
diff --git a/documentation/api/modules/luci.model.ipkg.html b/documentation/api/modules/luci.model.ipkg.html
index 921153c987..a0af3187b7 100644
--- a/documentation/api/modules/luci.model.ipkg.html
+++ b/documentation/api/modules/luci.model.ipkg.html
@@ -43,19 +43,15 @@
</li>
<li>
- <a href="../modules/luci.http.protocol.html">luci.http.protocol</a>
+ <a href="../modules/luci.http.conditionals.html">luci.http.conditionals</a>
</li>
<li>
- <a href="../modules/luci.http.protocol.conditionals.html">luci.http.protocol.conditionals</a>
+ <a href="../modules/luci.http.date.html">luci.http.date</a>
</li>
<li>
- <a href="../modules/luci.http.protocol.date.html">luci.http.protocol.date</a>
- </li>
-
- <li>
- <a href="../modules/luci.http.protocol.mime.html">luci.http.protocol.mime</a>
+ <a href="../modules/luci.http.mime.html">luci.http.mime</a>
</li>
<li>
diff --git a/documentation/api/modules/luci.model.uci.html b/documentation/api/modules/luci.model.uci.html
index c84d1eb0eb..77a81fd468 100644
--- a/documentation/api/modules/luci.model.uci.html
+++ b/documentation/api/modules/luci.model.uci.html
@@ -43,19 +43,15 @@
</li>
<li>
- <a href="../modules/luci.http.protocol.html">luci.http.protocol</a>
+ <a href="../modules/luci.http.conditionals.html">luci.http.conditionals</a>
</li>
<li>
- <a href="../modules/luci.http.protocol.conditionals.html">luci.http.protocol.conditionals</a>
+ <a href="../modules/luci.http.date.html">luci.http.date</a>
</li>
<li>
- <a href="../modules/luci.http.protocol.date.html">luci.http.protocol.date</a>
- </li>
-
- <li>
- <a href="../modules/luci.http.protocol.mime.html">luci.http.protocol.mime</a>
+ <a href="../modules/luci.http.mime.html">luci.http.mime</a>
</li>
<li>
@@ -310,6 +306,13 @@ Get the directory for uncomitted changes.</td>
</tr>
<tr>
+ <td class="name" nowrap><a href="#Cursor.get_session_id">Cursor:get_session_id</a>&nbsp;()</td>
+ <td class="summary">
+
+Get the effective session ID.</td>
+ </tr>
+
+ <tr>
<td class="name" nowrap><a href="#Cursor.load">Cursor:load</a>&nbsp;(config)</td>
<td class="summary">
@@ -366,6 +369,13 @@ Set the directory for uncommited changes.</td>
</tr>
<tr>
+ <td class="name" nowrap><a href="#Cursor.set_session_id">Cursor:set_session_id</a>&nbsp;(id)</td>
+ <td class="summary">
+
+Set the effective session ID.</td>
+ </tr>
+
+ <tr>
<td class="name" nowrap><a href="#Cursor.substate">Cursor:substate</a>&nbsp;()</td>
<td class="summary">
@@ -631,8 +641,8 @@ Delete all sections of a given type that match certain criteria.
</li>
<li>
- comparator: Function that will be called for each section and
-returns a boolean whether to delete the current section (optional)
+ comparator: Function that will be called for each section and returns
+ a boolean whether to delete the current section (optional)
</li>
</ul>
@@ -903,8 +913,8 @@ Get an option or list and return values as table.
<h3>Return value:</h3>
-table. If the option was not found, you will simply get
- an empty table.
+table. If the option was not found, you will simply get an empty
+ table.
@@ -936,6 +946,29 @@ Save directory
+<dt><a name="Cursor.get_session_id"></a><strong>Cursor:get_session_id</strong>&nbsp;()</dt>
+<dd>
+
+
+Get the effective session ID.
+
+
+
+
+
+
+
+
+<h3>Return value:</h3>
+String containing the session ID
+
+
+
+</dd>
+
+
+
+
<dt><a name="Cursor.load"></a><strong>Cursor:load</strong>&nbsp;(config)</dt>
<dd>
@@ -1222,7 +1255,8 @@ has the same effect as deleting the option.
</li>
<li>
- value: value or table. Raw values will become a single item table.
+ value: Value or table. Non-table values will be set as single
+ item UCI list.
</li>
</ul>
@@ -1274,14 +1308,47 @@ Boolean whether operation succeeded
+<dt><a name="Cursor.set_session_id"></a><strong>Cursor:set_session_id</strong>&nbsp;(id)</dt>
+<dd>
+
+
+Set the effective session ID.
+
+
+
+<h3>Parameters</h3>
+<ul>
+
+ <li>
+ id: String containing the session ID to set
+ </li>
+
+</ul>
+
+
+
+
+
+
+<h3>Return value:</h3>
+Boolean whether operation succeeded
+
+
+
+</dd>
+
+
+
+
<dt><a name="Cursor.substate"></a><strong>Cursor:substate</strong>&nbsp;()</dt>
<dd>
-Create a sub-state of this cursor. The sub-state is tied to the parent
+Create a sub-state of this cursor.
-curser, means it the parent unloads or loads configs, the sub state will
-do so as well.
+The sub-state is tied to the parent curser, means it the parent unloads or
+loads configs, the sub state will do so as well.
+
diff --git a/documentation/api/modules/luci.rpcc.html b/documentation/api/modules/luci.rpcc.html
index f7cb020482..18065788bd 100644
--- a/documentation/api/modules/luci.rpcc.html
+++ b/documentation/api/modules/luci.rpcc.html
@@ -43,19 +43,15 @@
</li>
<li>
- <a href="../modules/luci.http.protocol.html">luci.http.protocol</a>
+ <a href="../modules/luci.http.conditionals.html">luci.http.conditionals</a>
</li>
<li>
- <a href="../modules/luci.http.protocol.conditionals.html">luci.http.protocol.conditionals</a>
+ <a href="../modules/luci.http.date.html">luci.http.date</a>
</li>
<li>
- <a href="../modules/luci.http.protocol.date.html">luci.http.protocol.date</a>
- </li>
-
- <li>
- <a href="../modules/luci.http.protocol.mime.html">luci.http.protocol.mime</a>
+ <a href="../modules/luci.http.mime.html">luci.http.mime</a>
</li>
<li>
diff --git a/documentation/api/modules/luci.rpcc.ruci.html b/documentation/api/modules/luci.rpcc.ruci.html
index 203779ce7a..7348f1932b 100644
--- a/documentation/api/modules/luci.rpcc.ruci.html
+++ b/documentation/api/modules/luci.rpcc.ruci.html
@@ -43,19 +43,15 @@
</li>
<li>
- <a href="../modules/luci.http.protocol.html">luci.http.protocol</a>
+ <a href="../modules/luci.http.conditionals.html">luci.http.conditionals</a>
</li>
<li>
- <a href="../modules/luci.http.protocol.conditionals.html">luci.http.protocol.conditionals</a>
+ <a href="../modules/luci.http.date.html">luci.http.date</a>
</li>
<li>
- <a href="../modules/luci.http.protocol.date.html">luci.http.protocol.date</a>
- </li>
-
- <li>
- <a href="../modules/luci.http.protocol.mime.html">luci.http.protocol.mime</a>
+ <a href="../modules/luci.http.mime.html">luci.http.mime</a>
</li>
<li>
diff --git a/documentation/api/modules/luci.sys.html b/documentation/api/modules/luci.sys.html
index 860c5fba26..6342a51d57 100644
--- a/documentation/api/modules/luci.sys.html
+++ b/documentation/api/modules/luci.sys.html
@@ -43,19 +43,15 @@
</li>
<li>
- <a href="../modules/luci.http.protocol.html">luci.http.protocol</a>
+ <a href="../modules/luci.http.conditionals.html">luci.http.conditionals</a>
</li>
<li>
- <a href="../modules/luci.http.protocol.conditionals.html">luci.http.protocol.conditionals</a>
+ <a href="../modules/luci.http.date.html">luci.http.date</a>
</li>
<li>
- <a href="../modules/luci.http.protocol.date.html">luci.http.protocol.date</a>
- </li>
-
- <li>
- <a href="../modules/luci.http.protocol.mime.html">luci.http.protocol.mime</a>
+ <a href="../modules/luci.http.mime.html">luci.http.mime</a>
</li>
<li>
diff --git a/documentation/api/modules/luci.sys.init.html b/documentation/api/modules/luci.sys.init.html
index 596fb7cd1e..e2c51f9531 100644
--- a/documentation/api/modules/luci.sys.init.html
+++ b/documentation/api/modules/luci.sys.init.html
@@ -43,19 +43,15 @@
</li>
<li>
- <a href="../modules/luci.http.protocol.html">luci.http.protocol</a>
+ <a href="../modules/luci.http.conditionals.html">luci.http.conditionals</a>
</li>
<li>
- <a href="../modules/luci.http.protocol.conditionals.html">luci.http.protocol.conditionals</a>
+ <a href="../modules/luci.http.date.html">luci.http.date</a>
</li>
<li>
- <a href="../modules/luci.http.protocol.date.html">luci.http.protocol.date</a>
- </li>
-
- <li>
- <a href="../modules/luci.http.protocol.mime.html">luci.http.protocol.mime</a>
+ <a href="../modules/luci.http.mime.html">luci.http.mime</a>
</li>
<li>
diff --git a/documentation/api/modules/luci.sys.iptparser.html b/documentation/api/modules/luci.sys.iptparser.html
index 122afcc2a9..5928281cf4 100644
--- a/documentation/api/modules/luci.sys.iptparser.html
+++ b/documentation/api/modules/luci.sys.iptparser.html
@@ -43,19 +43,15 @@
</li>
<li>
- <a href="../modules/luci.http.protocol.html">luci.http.protocol</a>
+ <a href="../modules/luci.http.conditionals.html">luci.http.conditionals</a>
</li>
<li>
- <a href="../modules/luci.http.protocol.conditionals.html">luci.http.protocol.conditionals</a>
+ <a href="../modules/luci.http.date.html">luci.http.date</a>
</li>
<li>
- <a href="../modules/luci.http.protocol.date.html">luci.http.protocol.date</a>
- </li>
-
- <li>
- <a href="../modules/luci.http.protocol.mime.html">luci.http.protocol.mime</a>
+ <a href="../modules/luci.http.mime.html">luci.http.mime</a>
</li>
<li>
diff --git a/documentation/api/modules/luci.sys.net.html b/documentation/api/modules/luci.sys.net.html
index 09cef175f9..e7802bb244 100644
--- a/documentation/api/modules/luci.sys.net.html
+++ b/documentation/api/modules/luci.sys.net.html
@@ -43,19 +43,15 @@
</li>
<li>
- <a href="../modules/luci.http.protocol.html">luci.http.protocol</a>
+ <a href="../modules/luci.http.conditionals.html">luci.http.conditionals</a>
</li>
<li>
- <a href="../modules/luci.http.protocol.conditionals.html">luci.http.protocol.conditionals</a>
+ <a href="../modules/luci.http.date.html">luci.http.date</a>
</li>
<li>
- <a href="../modules/luci.http.protocol.date.html">luci.http.protocol.date</a>
- </li>
-
- <li>
- <a href="../modules/luci.http.protocol.mime.html">luci.http.protocol.mime</a>
+ <a href="../modules/luci.http.mime.html">luci.http.mime</a>
</li>
<li>
diff --git a/documentation/api/modules/luci.sys.process.html b/documentation/api/modules/luci.sys.process.html
index 9c4f0a5401..ffe09bdc20 100644
--- a/documentation/api/modules/luci.sys.process.html
+++ b/documentation/api/modules/luci.sys.process.html
@@ -43,19 +43,15 @@
</li>
<li>
- <a href="../modules/luci.http.protocol.html">luci.http.protocol</a>
+ <a href="../modules/luci.http.conditionals.html">luci.http.conditionals</a>
</li>
<li>
- <a href="../modules/luci.http.protocol.conditionals.html">luci.http.protocol.conditionals</a>
+ <a href="../modules/luci.http.date.html">luci.http.date</a>
</li>
<li>
- <a href="../modules/luci.http.protocol.date.html">luci.http.protocol.date</a>
- </li>
-
- <li>
- <a href="../modules/luci.http.protocol.mime.html">luci.http.protocol.mime</a>
+ <a href="../modules/luci.http.mime.html">luci.http.mime</a>
</li>
<li>
diff --git a/documentation/api/modules/luci.sys.user.html b/documentation/api/modules/luci.sys.user.html
index 37126dd924..04f8bf02b2 100644
--- a/documentation/api/modules/luci.sys.user.html
+++ b/documentation/api/modules/luci.sys.user.html
@@ -43,19 +43,15 @@
</li>
<li>
- <a href="../modules/luci.http.protocol.html">luci.http.protocol</a>
+ <a href="../modules/luci.http.conditionals.html">luci.http.conditionals</a>
</li>
<li>
- <a href="../modules/luci.http.protocol.conditionals.html">luci.http.protocol.conditionals</a>
+ <a href="../modules/luci.http.date.html">luci.http.date</a>
</li>
<li>
- <a href="../modules/luci.http.protocol.date.html">luci.http.protocol.date</a>
- </li>
-
- <li>
- <a href="../modules/luci.http.protocol.mime.html">luci.http.protocol.mime</a>
+ <a href="../modules/luci.http.mime.html">luci.http.mime</a>
</li>
<li>
diff --git a/documentation/api/modules/luci.sys.wifi.html b/documentation/api/modules/luci.sys.wifi.html
index eb1f6b31d7..6c893244c1 100644
--- a/documentation/api/modules/luci.sys.wifi.html
+++ b/documentation/api/modules/luci.sys.wifi.html
@@ -43,19 +43,15 @@
</li>
<li>
- <a href="../modules/luci.http.protocol.html">luci.http.protocol</a>
+ <a href="../modules/luci.http.conditionals.html">luci.http.conditionals</a>
</li>
<li>
- <a href="../modules/luci.http.protocol.conditionals.html">luci.http.protocol.conditionals</a>
+ <a href="../modules/luci.http.date.html">luci.http.date</a>
</li>
<li>
- <a href="../modules/luci.http.protocol.date.html">luci.http.protocol.date</a>
- </li>
-
- <li>
- <a href="../modules/luci.http.protocol.mime.html">luci.http.protocol.mime</a>
+ <a href="../modules/luci.http.mime.html">luci.http.mime</a>
</li>
<li>
diff --git a/documentation/api/modules/luci.util.html b/documentation/api/modules/luci.util.html
index 847230bbbd..d3d45a1800 100644
--- a/documentation/api/modules/luci.util.html
+++ b/documentation/api/modules/luci.util.html
@@ -43,19 +43,15 @@
</li>
<li>
- <a href="../modules/luci.http.protocol.html">luci.http.protocol</a>
+ <a href="../modules/luci.http.conditionals.html">luci.http.conditionals</a>
</li>
<li>
- <a href="../modules/luci.http.protocol.conditionals.html">luci.http.protocol.conditionals</a>
+ <a href="../modules/luci.http.date.html">luci.http.date</a>
</li>
<li>
- <a href="../modules/luci.http.protocol.date.html">luci.http.protocol.date</a>
- </li>
-
- <li>
- <a href="../modules/luci.http.protocol.mime.html">luci.http.protocol.mime</a>
+ <a href="../modules/luci.http.mime.html">luci.http.mime</a>
</li>
<li>
@@ -275,13 +271,6 @@ This is a coroutine-safe drop-in replacement for Lua's "xpcall"-function
</tr>
<tr>
- <td class="name" nowrap><a href="#dtable">dtable</a>&nbsp;()</td>
- <td class="summary">
-
-Create a dynamic table which automatically creates subtables.</td>
- </tr>
-
- <tr>
<td class="name" nowrap><a href="#dumptable">dumptable</a>&nbsp;(t, maxdepth)</td>
<td class="summary">
@@ -349,7 +338,6 @@ Returns the absolute path to LuCI base directory.</td>
<td class="summary">
Parse certain units from the given string and return the canonical integer
-
value or 0 if the unit is unknown.</td>
</tr>
@@ -379,7 +367,6 @@ Restore data previously serialized with serialize_data().</td>
<td class="summary">
Recursively serialize given data to lua code, suitable for restoring
-
with loadstring().</td>
</tr>
@@ -392,11 +379,17 @@ Convert data structure to JSON
</tr>
<tr>
+ <td class="name" nowrap><a href="#shellquote">shellquote</a>&nbsp;(value)</td>
+ <td class="summary">
+
+Safely quote value for use in shell commands.</td>
+ </tr>
+
+ <tr>
<td class="name" nowrap><a href="#spairs">spairs</a>&nbsp;(t, f)</td>
<td class="summary">
Return a key, value iterator which returns the values sorted according to
-
the provided callback function.</td>
</tr>
@@ -405,7 +398,6 @@ the provided callback function.</td>
<td class="summary">
Splits given string on a defined separator sequence and return a table
-
containing the resulting substrings.</td>
</tr>
@@ -428,7 +420,6 @@ Strip HTML tags from given string.</td>
<td class="summary">
Create a new or get an already existing thread local store associated with
-
the current active coroutine.</td>
</tr>
@@ -454,6 +445,20 @@ Update values in given table with the values from the second given table.</td>
</tr>
<tr>
+ <td class="name" nowrap><a href="#urldecode">urldecode</a>&nbsp;(str, decode_plus)</td>
+ <td class="summary">
+
+Decode an URL-encoded string - optionally decoding the "+" sign to space.</td>
+ </tr>
+
+ <tr>
+ <td class="name" nowrap><a href="#urlencode">urlencode</a>&nbsp;(str)</td>
+ <td class="summary">
+
+URL-encode given string.</td>
+ </tr>
+
+ <tr>
<td class="name" nowrap><a href="#vspairs">vspairs</a>&nbsp;(t)</td>
<td class="summary">
@@ -549,7 +554,8 @@ Classes can inherit member functions and values from a base class.
Class can be instantiated by calling them. All parameters will be passed
to the __init__ function of this class - if such a function exists.
The __init__ function must be used to set any object parameters that are not shared
-with other objects of this class. Any return values will be ignored.
+with other objects of this class. Any return values will be ignored.
+
<h3>Parameters</h3>
@@ -629,7 +635,7 @@ Cloned table value
<dd>
-Count the occurrences of given substring in given string.
+Count the occurrences of given substring in given string.
@@ -728,8 +734,8 @@ Checks whether the given table contains the given value.
<h3>Return value:</h3>
-number indicating the first index at which the given value occurs
- within table or false.
+Number indicating the first index at which the given value occurs
+ within table or false.
@@ -766,7 +772,7 @@ This is a coroutine-safe drop-in replacement for Lua's "pcall"-function
<h3>Return value:</h3>
A boolean whether the function call succeeded and the returns
- values of the function or the error object
+ values of the function or the error object
@@ -807,30 +813,7 @@ This is a coroutine-safe drop-in replacement for Lua's "xpcall"-function
<h3>Return value:</h3>
A boolean whether the function call succeeded and the return
- values of either the function or the error handler
-
-
-
-</dd>
-
-
-
-
-<dt><a name="dtable"></a><strong>dtable</strong>&nbsp;()</dt>
-<dd>
-
-
-Create a dynamic table which automatically creates subtables.
-
-
-
-
-
-
-
-
-<h3>Return value:</h3>
-Dynamic Table
+ values of either the function or the error handler
@@ -944,8 +927,8 @@ Iterator
Return the current runtime bytecode of the given data. The byte code
-
-will be stripped before it is returned.
+will be stripped before it is returned.
+
<h3>Parameters</h3>
@@ -976,11 +959,12 @@ String value containing the bytecode of the given data
<dd>
-Return a matching iterator for the given value. The iterator will return
+Return a matching iterator for the given value.
-one token per invocation, the tokens are separated by whitespace. If the
-input value is a table, it is transformed into a string first. A nil value
-will result in a valid interator which aborts with the first invocation.
+The iterator will return one token per invocation, the tokens are separated by
+whitespace. If the input value is a table, it is transformed into a string first.
+A nil value will result in a valid interator which aborts with the first invocation.
+
<h3>Parameters</h3>
@@ -1094,7 +1078,8 @@ Sorted table containing the keys
Return a key, value iterator for the given table.
-The table pairs are sorted by key.
+The table pairs are sorted by key.
+
<h3>Parameters</h3>
@@ -1149,9 +1134,11 @@ String containing the directory path
Parse certain units from the given string and return the canonical integer
+value or 0 if the unit is unknown.
-value or 0 if the unit is unknown. Upper- or lower case is irrelevant.
+Upper- or lower case is irrelevant.
Recognized units are:
+
o "y" - one year (60*60*24*366)
o "m" - one month (60*60*24*31)
o "w" - one week (60*60*24*7)
@@ -1163,7 +1150,8 @@ Recognized units are:
o "gb" - one gigabyte (1024*1024*1024)
o "kib" - one si kilobyte (1000)
o "mib" - one si megabyte (1000*1000)
- o "gib" - one si gigabyte (1000*1000*1000)
+ o "gib" - one si gigabyte (1000*1000*1000)
+
<h3>Parameters</h3>
@@ -1304,8 +1292,8 @@ Value containing the restored data structure
Recursively serialize given data to lua code, suitable for restoring
-
-with loadstring().
+with loadstring().
+
<h3>Parameters</h3>
@@ -1381,13 +1369,45 @@ String containing the JSON if called without write callback
+<dt><a name="shellquote"></a><strong>shellquote</strong>&nbsp;(value)</dt>
+<dd>
+
+
+Safely quote value for use in shell commands.
+
+
+
+<h3>Parameters</h3>
+<ul>
+
+ <li>
+ value: String containing the value to quote
+ </li>
+
+</ul>
+
+
+
+
+
+
+<h3>Return value:</h3>
+Single-quote enclosed string with embedded quotes escaped
+
+
+
+</dd>
+
+
+
+
<dt><a name="spairs"></a><strong>spairs</strong>&nbsp;(t, f)</dt>
<dd>
Return a key, value iterator which returns the values sorted according to
-
-the provided callback function.
+the provided callback function.
+
<h3>Parameters</h3>
@@ -1423,11 +1443,13 @@ Function value containing the corresponding iterator
Splits given string on a defined separator sequence and return a table
+containing the resulting substrings.
-containing the resulting substrings. The optional max parameter specifies
-the number of bytes to process, regardless of the actual length of the given
-string. The optional last parameter, regex, specifies whether the separator
-sequence is interpreted as regular expression.
+The optional max parameter specifies the number of bytes to process,
+regardless of the actual length of the given string. The optional last
+parameter, regex, specifies whether the separator sequence is
+nterpreted as regular expression.
+
<h3>Parameters</h3>
@@ -1471,10 +1493,11 @@ Table containing the resulting substrings
<dd>
-Strips unnescessary lua bytecode from given string. Information like line
+Strips unnescessary lua bytecode from given string.
-numbers and debugging numbers will be discarded. Original version by
-Peter Cawley (http://lua-users.org/lists/lua-l/2008-02/msg01158.html)
+Information like line numbers and debugging numbers will be discarded.
+Original version by Peter Cawley (http://lua-users.org/lists/lua-l/2008-02/msg01158.html)
+
<h3>Parameters</h3>
@@ -1538,9 +1561,11 @@ String with HTML tags stripped of
Create a new or get an already existing thread local store associated with
+the current active coroutine.
-the current active coroutine. A thread local store is private a table object
-whose values can't be accessed from outside of the running coroutine.
+A thread local store is private a table object
+whose values can't be accessed from outside of the running coroutine.
+
@@ -1636,7 +1661,8 @@ Table containin the ubus result
Update values in given table with the values from the second given table.
-Both table are - in fact - merged together.
+Both table are - in fact - merged together.
+
<h3>Parameters</h3>
@@ -1667,13 +1693,100 @@ Always nil
+<dt><a name="urldecode"></a><strong>urldecode</strong>&nbsp;(str, decode_plus)</dt>
+<dd>
+
+
+Decode an URL-encoded string - optionally decoding the "+" sign to space.
+
+
+
+<h3>Parameters</h3>
+<ul>
+
+ <li>
+ str: Input string in x-www-urlencoded format
+ </li>
+
+ <li>
+ decode_plus: Decode "+" signs to spaces if true (optional)
+ </li>
+
+</ul>
+
+
+
+
+
+
+<h3>Return value:</h3>
+The decoded string
+
+
+
+<h3>See also:</h3>
+<ul>
+
+ <li><a href="#urlencode">
+ urlencode
+ </a>
+
+</ul>
+
+</dd>
+
+
+
+
+<dt><a name="urlencode"></a><strong>urlencode</strong>&nbsp;(str)</dt>
+<dd>
+
+
+URL-encode given string.
+
+
+
+<h3>Parameters</h3>
+<ul>
+
+ <li>
+ str: String to encode
+ </li>
+
+</ul>
+
+
+
+
+
+
+<h3>Return value:</h3>
+String containing the encoded data
+
+
+
+<h3>See also:</h3>
+<ul>
+
+ <li><a href="#urldecode">
+ urldecode
+ </a>
+
+</ul>
+
+</dd>
+
+
+
+
<dt><a name="vspairs"></a><strong>vspairs</strong>&nbsp;(t)</dt>
<dd>
Return a key, value iterator for the given table.
-The table pairs are sorted by value.
+The table pairs are sorted by value.
+
<h3>Parameters</h3>
diff --git a/documentation/api/modules/nixio.CHANGELOG.html b/documentation/api/modules/nixio.CHANGELOG.html
index 48bedc80af..7d98747c2f 100644
--- a/documentation/api/modules/nixio.CHANGELOG.html
+++ b/documentation/api/modules/nixio.CHANGELOG.html
@@ -43,19 +43,15 @@
</li>
<li>
- <a href="../modules/luci.http.protocol.html">luci.http.protocol</a>
+ <a href="../modules/luci.http.conditionals.html">luci.http.conditionals</a>
</li>
<li>
- <a href="../modules/luci.http.protocol.conditionals.html">luci.http.protocol.conditionals</a>
+ <a href="../modules/luci.http.date.html">luci.http.date</a>
</li>
<li>
- <a href="../modules/luci.http.protocol.date.html">luci.http.protocol.date</a>
- </li>
-
- <li>
- <a href="../modules/luci.http.protocol.mime.html">luci.http.protocol.mime</a>
+ <a href="../modules/luci.http.mime.html">luci.http.mime</a>
</li>
<li>
diff --git a/documentation/api/modules/nixio.CryptoHash.html b/documentation/api/modules/nixio.CryptoHash.html
index 6158a77b60..7d2f48b1e5 100644
--- a/documentation/api/modules/nixio.CryptoHash.html
+++ b/documentation/api/modules/nixio.CryptoHash.html
@@ -43,19 +43,15 @@
</li>
<li>
- <a href="../modules/luci.http.protocol.html">luci.http.protocol</a>
+ <a href="../modules/luci.http.conditionals.html">luci.http.conditionals</a>
</li>
<li>
- <a href="../modules/luci.http.protocol.conditionals.html">luci.http.protocol.conditionals</a>
+ <a href="../modules/luci.http.date.html">luci.http.date</a>
</li>
<li>
- <a href="../modules/luci.http.protocol.date.html">luci.http.protocol.date</a>
- </li>
-
- <li>
- <a href="../modules/luci.http.protocol.mime.html">luci.http.protocol.mime</a>
+ <a href="../modules/luci.http.mime.html">luci.http.mime</a>
</li>
<li>
diff --git a/documentation/api/modules/nixio.File.html b/documentation/api/modules/nixio.File.html
index d9e67ea5b3..7a7500a773 100644
--- a/documentation/api/modules/nixio.File.html
+++ b/documentation/api/modules/nixio.File.html
@@ -43,19 +43,15 @@
</li>
<li>
- <a href="../modules/luci.http.protocol.html">luci.http.protocol</a>
+ <a href="../modules/luci.http.conditionals.html">luci.http.conditionals</a>
</li>
<li>
- <a href="../modules/luci.http.protocol.conditionals.html">luci.http.protocol.conditionals</a>
+ <a href="../modules/luci.http.date.html">luci.http.date</a>
</li>
<li>
- <a href="../modules/luci.http.protocol.date.html">luci.http.protocol.date</a>
- </li>
-
- <li>
- <a href="../modules/luci.http.protocol.mime.html">luci.http.protocol.mime</a>
+ <a href="../modules/luci.http.mime.html">luci.http.mime</a>
</li>
<li>
diff --git a/documentation/api/modules/nixio.README.html b/documentation/api/modules/nixio.README.html
index d8a17f78b4..22dd793491 100644
--- a/documentation/api/modules/nixio.README.html
+++ b/documentation/api/modules/nixio.README.html
@@ -43,19 +43,15 @@
</li>
<li>
- <a href="../modules/luci.http.protocol.html">luci.http.protocol</a>
+ <a href="../modules/luci.http.conditionals.html">luci.http.conditionals</a>
</li>
<li>
- <a href="../modules/luci.http.protocol.conditionals.html">luci.http.protocol.conditionals</a>
+ <a href="../modules/luci.http.date.html">luci.http.date</a>
</li>
<li>
- <a href="../modules/luci.http.protocol.date.html">luci.http.protocol.date</a>
- </li>
-
- <li>
- <a href="../modules/luci.http.protocol.mime.html">luci.http.protocol.mime</a>
+ <a href="../modules/luci.http.mime.html">luci.http.mime</a>
</li>
<li>
@@ -288,7 +284,7 @@
<br />In general all functions are namend and behave like their POSIX API
counterparts - where applicable - applying the following rules:
<ul>
- <li>Functions should be named like the underlying POSIX API function omitting
+ <li>Functions should be named like the underlying POSIX API function omitting
prefixes or suffixes - especially when placed in an object-context (
lockf -> File:lock, fsync -> File:sync, dup2 -> dup, ...)</li>
<li>If you are unclear about the behaviour of a function you should consult
@@ -296,10 +292,10 @@
<li>If the name is significantly different from the POSIX-function, the
underlying function(s) are stated in the documentation.</li>
<li>Parameters should reflect those of the C-API, buffer length arguments and
- by-reference parameters should be omitted for pratical purposes.</li>
+ by-reference parameters should be omitted for practical purposes.</li>
<li>If a C function accepts a bitfield as parameter, it should be translated
into lower case string flags representing the flags if the bitfield is the
- last parameter and also omitting prefixes or suffixes. (e.g. waitpid
+ last parameter and also omitting prefixes or suffixes. (e.g. waitpid
(pid, &s, WNOHANG | WUNTRACED) -> waitpid(pid, "nohang", "untraced"),
getsockopt(fd, SOL_SOCKET, SO_REUSEADDR, &opt, sizeof(opt)) ->
Socket:getopt("socket", "reuseaddr"), etc.) </li>
diff --git a/documentation/api/modules/nixio.Socket.html b/documentation/api/modules/nixio.Socket.html
index 7d258fc195..185099125d 100644
--- a/documentation/api/modules/nixio.Socket.html
+++ b/documentation/api/modules/nixio.Socket.html
@@ -43,19 +43,15 @@
</li>
<li>
- <a href="../modules/luci.http.protocol.html">luci.http.protocol</a>
+ <a href="../modules/luci.http.conditionals.html">luci.http.conditionals</a>
</li>
<li>
- <a href="../modules/luci.http.protocol.conditionals.html">luci.http.protocol.conditionals</a>
+ <a href="../modules/luci.http.date.html">luci.http.date</a>
</li>
<li>
- <a href="../modules/luci.http.protocol.date.html">luci.http.protocol.date</a>
- </li>
-
- <li>
- <a href="../modules/luci.http.protocol.mime.html">luci.http.protocol.mime</a>
+ <a href="../modules/luci.http.mime.html">luci.http.mime</a>
</li>
<li>
diff --git a/documentation/api/modules/nixio.TLSContext.html b/documentation/api/modules/nixio.TLSContext.html
index a91b1eec4d..c84d318955 100644
--- a/documentation/api/modules/nixio.TLSContext.html
+++ b/documentation/api/modules/nixio.TLSContext.html
@@ -43,19 +43,15 @@
</li>
<li>
- <a href="../modules/luci.http.protocol.html">luci.http.protocol</a>
+ <a href="../modules/luci.http.conditionals.html">luci.http.conditionals</a>
</li>
<li>
- <a href="../modules/luci.http.protocol.conditionals.html">luci.http.protocol.conditionals</a>
+ <a href="../modules/luci.http.date.html">luci.http.date</a>
</li>
<li>
- <a href="../modules/luci.http.protocol.date.html">luci.http.protocol.date</a>
- </li>
-
- <li>
- <a href="../modules/luci.http.protocol.mime.html">luci.http.protocol.mime</a>
+ <a href="../modules/luci.http.mime.html">luci.http.mime</a>
</li>
<li>
diff --git a/documentation/api/modules/nixio.TLSSocket.html b/documentation/api/modules/nixio.TLSSocket.html
index 3d99a6482f..5d6098a9f5 100644
--- a/documentation/api/modules/nixio.TLSSocket.html
+++ b/documentation/api/modules/nixio.TLSSocket.html
@@ -43,19 +43,15 @@
</li>
<li>
- <a href="../modules/luci.http.protocol.html">luci.http.protocol</a>
+ <a href="../modules/luci.http.conditionals.html">luci.http.conditionals</a>
</li>
<li>
- <a href="../modules/luci.http.protocol.conditionals.html">luci.http.protocol.conditionals</a>
+ <a href="../modules/luci.http.date.html">luci.http.date</a>
</li>
<li>
- <a href="../modules/luci.http.protocol.date.html">luci.http.protocol.date</a>
- </li>
-
- <li>
- <a href="../modules/luci.http.protocol.mime.html">luci.http.protocol.mime</a>
+ <a href="../modules/luci.http.mime.html">luci.http.mime</a>
</li>
<li>
diff --git a/documentation/api/modules/nixio.UnifiedIO.html b/documentation/api/modules/nixio.UnifiedIO.html
index 1717980841..6410ffb42e 100644
--- a/documentation/api/modules/nixio.UnifiedIO.html
+++ b/documentation/api/modules/nixio.UnifiedIO.html
@@ -43,19 +43,15 @@
</li>
<li>
- <a href="../modules/luci.http.protocol.html">luci.http.protocol</a>
+ <a href="../modules/luci.http.conditionals.html">luci.http.conditionals</a>
</li>
<li>
- <a href="../modules/luci.http.protocol.conditionals.html">luci.http.protocol.conditionals</a>
+ <a href="../modules/luci.http.date.html">luci.http.date</a>
</li>
<li>
- <a href="../modules/luci.http.protocol.date.html">luci.http.protocol.date</a>
- </li>
-
- <li>
- <a href="../modules/luci.http.protocol.mime.html">luci.http.protocol.mime</a>
+ <a href="../modules/luci.http.mime.html">luci.http.mime</a>
</li>
<li>
@@ -326,7 +322,7 @@
<li>The blocksize given is only advisory and to be seen as an upper limit,
if an underlying read returns less bytes the chunk is nevertheless returned.
- <li>If the limit parameter is omitted, the iterator returns data
+ <li>If the limit parameter is omitted, the iterator returns data
until an end-of-file, end-of-stream, connection shutdown or similar happens.
<li>The iterator will not buffer so it is safe to mix with calls to read.
@@ -402,7 +398,7 @@ true
<li>This function uses the blocksource function of the source descriptor
and the sink function of the target descriptor.
- <li>If the limit parameter is omitted, data is copied
+ <li>If the limit parameter is omitted, data is copied
until an end-of-file, end-of-stream, connection shutdown or similar happens.
<li>If the descriptor is non-blocking the function may fail with EAGAIN.
@@ -461,7 +457,7 @@ true
blocksource function of the source descriptor and the sink function
of the target descriptor as a fallback mechanism.
- <li>If the limit parameter is omitted, data is copied
+ <li>If the limit parameter is omitted, data is copied
until an end-of-file, end-of-stream, connection shutdown or similar happens.
<li>If the descriptor is non-blocking the function may fail with EAGAIN.
@@ -584,7 +580,7 @@ boolean
you can pass "true" to the iterator which will flush the buffer
and return the bufferd data.
- <li>If the limit parameter is omitted, this function uses the nixio
+ <li>If the limit parameter is omitted, this function uses the nixio
buffersize (8192B by default).
<li>If the descriptor is non-blocking the iterator may fail with EAGAIN.
@@ -628,7 +624,7 @@ Line-based Iterator
<li>This function uses the low-level read function of the descriptor.
- <li>If the length parameter is omitted, this function returns all data
+ <li>If the length parameter is omitted, this function returns all data
that can be read before an end-of-file, end-of-stream, connection shutdown
or similar happens.
diff --git a/documentation/api/modules/nixio.bin.html b/documentation/api/modules/nixio.bin.html
index fd82879129..48e6fcd8b8 100644
--- a/documentation/api/modules/nixio.bin.html
+++ b/documentation/api/modules/nixio.bin.html
@@ -43,19 +43,15 @@
</li>
<li>
- <a href="../modules/luci.http.protocol.html">luci.http.protocol</a>
+ <a href="../modules/luci.http.conditionals.html">luci.http.conditionals</a>
</li>
<li>
- <a href="../modules/luci.http.protocol.conditionals.html">luci.http.protocol.conditionals</a>
+ <a href="../modules/luci.http.date.html">luci.http.date</a>
</li>
<li>
- <a href="../modules/luci.http.protocol.date.html">luci.http.protocol.date</a>
- </li>
-
- <li>
- <a href="../modules/luci.http.protocol.mime.html">luci.http.protocol.mime</a>
+ <a href="../modules/luci.http.mime.html">luci.http.mime</a>
</li>
<li>
diff --git a/documentation/api/modules/nixio.bit.html b/documentation/api/modules/nixio.bit.html
index b29c29d335..419736363c 100644
--- a/documentation/api/modules/nixio.bit.html
+++ b/documentation/api/modules/nixio.bit.html
@@ -43,19 +43,15 @@
</li>
<li>
- <a href="../modules/luci.http.protocol.html">luci.http.protocol</a>
+ <a href="../modules/luci.http.conditionals.html">luci.http.conditionals</a>
</li>
<li>
- <a href="../modules/luci.http.protocol.conditionals.html">luci.http.protocol.conditionals</a>
+ <a href="../modules/luci.http.date.html">luci.http.date</a>
</li>
<li>
- <a href="../modules/luci.http.protocol.date.html">luci.http.protocol.date</a>
- </li>
-
- <li>
- <a href="../modules/luci.http.protocol.mime.html">luci.http.protocol.mime</a>
+ <a href="../modules/luci.http.mime.html">luci.http.mime</a>
</li>
<li>
diff --git a/documentation/api/modules/nixio.crypto.html b/documentation/api/modules/nixio.crypto.html
index 79a74584d4..b91fe28c1d 100644
--- a/documentation/api/modules/nixio.crypto.html
+++ b/documentation/api/modules/nixio.crypto.html
@@ -43,19 +43,15 @@
</li>
<li>
- <a href="../modules/luci.http.protocol.html">luci.http.protocol</a>
+ <a href="../modules/luci.http.conditionals.html">luci.http.conditionals</a>
</li>
<li>
- <a href="../modules/luci.http.protocol.conditionals.html">luci.http.protocol.conditionals</a>
+ <a href="../modules/luci.http.date.html">luci.http.date</a>
</li>
<li>
- <a href="../modules/luci.http.protocol.date.html">luci.http.protocol.date</a>
- </li>
-
- <li>
- <a href="../modules/luci.http.protocol.mime.html">luci.http.protocol.mime</a>
+ <a href="../modules/luci.http.mime.html">luci.http.mime</a>
</li>
<li>
diff --git a/documentation/api/modules/nixio.fs.html b/documentation/api/modules/nixio.fs.html
index 40d0a0636e..c9d34591c2 100644
--- a/documentation/api/modules/nixio.fs.html
+++ b/documentation/api/modules/nixio.fs.html
@@ -43,19 +43,15 @@
</li>
<li>
- <a href="../modules/luci.http.protocol.html">luci.http.protocol</a>
+ <a href="../modules/luci.http.conditionals.html">luci.http.conditionals</a>
</li>
<li>
- <a href="../modules/luci.http.protocol.conditionals.html">luci.http.protocol.conditionals</a>
+ <a href="../modules/luci.http.date.html">luci.http.date</a>
</li>
<li>
- <a href="../modules/luci.http.protocol.date.html">luci.http.protocol.date</a>
- </li>
-
- <li>
- <a href="../modules/luci.http.protocol.mime.html">luci.http.protocol.mime</a>
+ <a href="../modules/luci.http.mime.html">luci.http.mime</a>
</li>
<li>
@@ -1274,7 +1270,7 @@ true
<h3>Usage:</h3>
-It is normally not possible to rename files across fileystems.
+It is normally not possible to rename files across filesystems.
diff --git a/documentation/api/modules/nixio.html b/documentation/api/modules/nixio.html
index 8ee0f62dc7..65294a6582 100644
--- a/documentation/api/modules/nixio.html
+++ b/documentation/api/modules/nixio.html
@@ -43,19 +43,15 @@
</li>
<li>
- <a href="../modules/luci.http.protocol.html">luci.http.protocol</a>
+ <a href="../modules/luci.http.conditionals.html">luci.http.conditionals</a>
</li>
<li>
- <a href="../modules/luci.http.protocol.conditionals.html">luci.http.protocol.conditionals</a>
+ <a href="../modules/luci.http.date.html">luci.http.date</a>
</li>
<li>
- <a href="../modules/luci.http.protocol.date.html">luci.http.protocol.date</a>
- </li>
-
- <li>
- <a href="../modules/luci.http.protocol.mime.html">luci.http.protocol.mime</a>
+ <a href="../modules/luci.http.mime.html">luci.http.mime</a>
</li>
<li>