luci.ip = require "luci.ip"
local tonumber, ipairs, pairs, pcall, type, next =
luci.ip = require "luci.ip"
local tonumber, ipairs, pairs, pcall, type, next =
-- @return String containing the system hostname
function hostname(newname)
if type(newname) == "string" and #newname > 0 then
-- @return String containing the system hostname
function hostname(newname)
if type(newname) == "string" and #newname > 0 then
-- @return String containing the memory used for buffering in kB
-- @return String containing the free memory amount in kB
function sysinfo()
-- @return String containing the memory used for buffering in kB
-- @return String containing the free memory amount in kB
function sysinfo()
for line in io.lines("/proc/net/nf_conntrack") do
line = line:match "^(.-( [^ =]+=).-)%2"
local entry, flags = _parse_mixed_record(line, " +")
for line in io.lines("/proc/net/nf_conntrack") do
line = line:match "^(.-( [^ =]+=).-)%2"
local entry, flags = _parse_mixed_record(line, " +")
for line in io.lines("/proc/net/ip_conntrack") do
line = line:match "^(.-( [^ =]+=).-)%2"
local entry, flags = _parse_mixed_record(line, " +")
for line in io.lines("/proc/net/ip_conntrack") do
line = line:match "^(.-( [^ =]+=).-)%2"
local entry, flags = _parse_mixed_record(line, " +")
-
- for i, l in ipairs(net.arptable()) do
- if l["IP address"] == ip then
- mac = l["HW address"]
+ net.arptable(function(e)
+ if e["IP address"] == ip then
+ mac = e["HW address"]
-- { "source", "dest", "nexthop", "metric", "refcount", "usecount",
-- "flags", "device" }
function net.routes6(callback)
-- { "source", "dest", "nexthop", "metric", "refcount", "usecount",
-- "flags", "device" }
function net.routes6(callback)
- for _, name in ipairs(luci.fs.glob(init.dir.."*")) do
- names[#names+1] = luci.fs.basename(name)
+ for name in fs.glob(init.dir.."*") do
+ names[#names+1] = fs.basename(name)
-- @param name Name of the init script
-- @return Boolean indicating whether init is enabled
function init.enabled(name)
-- @param name Name of the init script
-- @return Boolean indicating whether init is enabled
function init.enabled(name)
-- @param name Name of the init script
-- @return Numeric index value
function init.index(name)
-- @param name Name of the init script
-- @return Numeric index value
function init.index(name)
-- @param name Name of the init script
-- @return Boolean indicating success
function init.enable(name)
-- @param name Name of the init script
-- @return Boolean indicating success
function init.enable(name)
-- @param name Name of the init script
-- @return Boolean indicating success
function init.disable(name)
-- @param name Name of the init script
-- @return Boolean indicating success
function init.disable(name)