luci-mod-admin-full: canonicalize configured static lease MAC
[project/luci.git] / modules / luci-mod-admin-full / luasrc / model / cbi / admin_network / iface_add.lua
index 92026b1..e48e3b4 100644 (file)
@@ -1,17 +1,5 @@
---[[
-LuCI - Lua Configuration Interface
-
-Copyright 2009-2010 Jo-Philipp Wich <xm@subsignal.org>
-
-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$
-
-]]--
+-- Copyright 2009-2010 Jo-Philipp Wich <jow@openwrt.org>
+-- Licensed to the public under the Apache License 2.0.
 
 local nw  = require "luci.model.network".init()
 local fw  = require "luci.model.firewall".init()
@@ -29,7 +17,12 @@ newnet = m:field(Value, "_netname", translate("Name of the new interface"),
 
 newnet:depends("_attach", "")
 newnet.default = arg[1] and "net_" .. arg[1]:gsub("[^%w_]+", "_")
-newnet.datatype = "uciname"
+newnet.datatype = "and(uciname,maxlength(15))"
+
+advice = m:field(DummyValue, "d1", translate("Note: interface name length"),
+        translate("Maximum length of the name is 15 characters including " ..
+               "the automatic protocol/bridge prefix (br-, 6in4-, pppoe- etc.)"
+       ))
 
 newproto = m:field(ListValue, "_netproto", translate("Protocol of the new interface"))