X-Git-Url: http://git.archive.openwrt.org/?a=blobdiff_plain;f=modules%2Fluci-mod-admin-full%2Fluasrc%2Fmodel%2Fcbi%2Fadmin_network%2Fdhcp.lua;h=7141e3c55d1002aa5fef30ecb19ded02ebf44067;hb=af9f09310446b226d25622d6fc63787e49d80e78;hp=bd6f403c53002c9ed32e15d816a14a3a6af37d73;hpb=1bb4822dca6113f73e3bc89e2acf15935e6f8e92;p=project%2Fluci.git diff --git a/modules/luci-mod-admin-full/luasrc/model/cbi/admin_network/dhcp.lua b/modules/luci-mod-admin-full/luasrc/model/cbi/admin_network/dhcp.lua index bd6f403c5..7141e3c55 100644 --- a/modules/luci-mod-admin-full/luasrc/model/cbi/admin_network/dhcp.lua +++ b/modules/luci-mod-admin-full/luasrc/model/cbi/admin_network/dhcp.lua @@ -1,18 +1,7 @@ ---[[ -LuCI - Lua Configuration Interface +-- Copyright 2008 Steven Barth +-- Licensed to the public under the Apache License 2.0. -Copyright 2008 Steven Barth - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -$Id$ -]]-- - -local sys = require "luci.sys" +local ipc = require "luci.ip" m = Map("dhcp", translate("DHCP and DNS"), translate("Dnsmasq is a combined /etc/hosts")).optional = true -hf:depends("nohosts", "") -hf.optional = true +s:taboption("files", DynamicList, "addnhosts", + translate("Additional Hosts files")).optional = true s:taboption("advanced", Flag, "boguspriv", @@ -243,12 +229,11 @@ ip.datatype = "or(ip4addr,'ignore')" hostid = s:option(Value, "hostid", translate("IPv6-Suffix (hex)")) -sys.net.arptable(function(entry) - ip:value(entry["IP address"]) - mac:value( - entry["HW address"], - entry["HW address"] .. " (" .. entry["IP address"] .. ")" - ) +ipc.neighbors({ family = 4 }, function(n) + if n.mac and n.dest then + ip:value(n.dest:string()) + mac:value(n.mac, "%s (%s)" %{ n.mac, n.dest:string() }) + end end) function ip.validate(self, value, section)