summaryrefslogtreecommitdiffstats
path: root/opennhrp-model.lua
diff options
context:
space:
mode:
Diffstat (limited to 'opennhrp-model.lua')
-rw-r--r--opennhrp-model.lua12
1 files changed, 6 insertions, 6 deletions
diff --git a/opennhrp-model.lua b/opennhrp-model.lua
index 1fa81bd..c179b6a 100644
--- a/opennhrp-model.lua
+++ b/opennhrp-model.lua
@@ -47,7 +47,7 @@ local function list_interfaces(self)
reverseinterfaceslist[int.value.name.value] = #interfaceslist
end
interfaces:destroy()
- end
+ end
return interfaceslist, reverseinterfaceslist
end
@@ -70,7 +70,7 @@ local function parseconfigfile(configfilecontent)
if word == "interface" then
i = i+1
currentinterface = words[i]
- if config[currentinterface] then
+ if config[currentinterface] then
config[currentinterface].errtxt = "Syntax error - interface defined multiple times"
else
config[currentinterface] = {}
@@ -151,8 +151,8 @@ local function validateinterfacedetails(interfacedetails)
for i,map in ipairs(interfacedetails.value.map.value) do
local words = {}
for word in string.gmatch(map, "%S+") do words[#words+1] = word end
- if not words[1] or not words[2] or
- (words[3] and words[3] ~= "register" and words[3] ~= "cicso") or
+ if not words[1] or not words[2] or
+ (words[3] and words[3] ~= "register" and words[3] ~= "cicso") or
(words[4] and words[4] ~= "register" and words[4] ~= "cisco") or words[5] then
interfacedetails.value.map.errtxt = "Syntax error on line "..i
success = false
@@ -184,7 +184,7 @@ function mymodule.get_startstop(self, clientdata)
end
function mymodule.startstop_service(self, startstop, action)
- return modelfunctions.startstop_service(startstop, action)
+ return modelfunctions.startstop_service(startstop, action)
end
function mymodule.getstatus()
@@ -224,7 +224,7 @@ function mymodule.getinterfacedetails(interface)
details.type = cfe({ type="select", value="Unused", label="Interface type", option={"Unused", "NHRP Enabled", "Shortcut Destination"}, seq=2 })
details.map = cfe({ type="list", value={}, label="Static Peers", descr="List of static peer mappings of protocol-address to nbma-address. Optional 'register' parameter specifies Registration Request sent to this peer on startup. If the statically mapped peer is running Cisco IOS, specify the cisco keyword. (protocol-address[/prefix] nbma-address [register] [cisco])", seq=3 })
details["dynamic-map"] = cfe({ type="list", value={}, label="Dynamic Peers", descr="List of dynamic peer mappings of protocol-address to nbma-domain-name. For each A record in the domain nbma-domain-name, opennhrp creates a dynamic NHS entry. (protocol-address/prefix nbma-domain-name)", seq=4 })
-
+
configfilecontent = configfilecontent or fs.read_file(configfile) or ""
config = config or parseconfigfile(configfilecontent)
if config and config[interface] then