summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Makefile8
-rw-r--r--ipsec-tools-status-html.lsp86
-rw-r--r--ipsectools-controller.lua (renamed from ipsec-tools-controller.lua)0
-rw-r--r--ipsectools-model.lua (renamed from ipsec-tools-model.lua)45
-rw-r--r--ipsectools-status-html.lsp63
-rw-r--r--ipsectools.menu (renamed from ipsec-tools.menu)0
6 files changed, 88 insertions, 114 deletions
diff --git a/Makefile b/Makefile
index 49bde55..d658971 100644
--- a/Makefile
+++ b/Makefile
@@ -3,10 +3,10 @@ PACKAGE=acf-$(APP_NAME)
VERSION=0.1
APP_DIST=\
- ipsec-tools-controller.lua \
- ipsec-tools-model.lua \
- ipsec-tools-status-html.lsp \
- ipsec-tools.menu \
+ ipsectools-controller.lua \
+ ipsectools-model.lua \
+ ipsectools-status-html.lsp \
+ ipsectools.menu \
EXTRA_DIST=README Makefile config.mk
diff --git a/ipsec-tools-status-html.lsp b/ipsec-tools-status-html.lsp
deleted file mode 100644
index 34b1248..0000000
--- a/ipsec-tools-status-html.lsp
+++ /dev/null
@@ -1,86 +0,0 @@
-<? local form = ... ?>
-<?
---[[ DEBUG INFORMATION
-io.write("<H1>DEBUGGING</H1><span style='color:red'><H2>DEBUG INFO: CFE</H2>")
-io.write(html.cfe_unpack(form))
-io.write("</span>")
---]]
-?>
-
-<?
-function informationform(myform,tags)
- for k,v in pairs(tags) do
- if (myform[v]) then
- local val = myform[v]
- io.write("\t<DT")
- if (#val.errtxt > 0) then io.write(" class='error'") end
- io.write(">" .. val.label .. "</DT>\n")
-
- io.write("\t\t<DD>" .. val.value .. "\n")
- if (val.descr) and (#val.descr > 0) then io.write("\t\t<P CLASS='descr'>" .. string.gsub(val.descr, "\n", "<BR>") .. "</P>\n") end
- if (#val.errtxt > 0) then io.write("\t\t<P CLASS='error'>" .. string.gsub(val.errtxt, "\n", "<BR>") .. "</P>\n") end
- io.write("\t\t</DD>\n")
- end
- end
-end
-?>
-
-<H1>SYSTEM INFO</H1>
-<DL>
-<?
-local myform = form.status
-local tags = { "status", "version", "autostart", }
-informationform(myform,tags)
-?>
-</DL>
-
-<H2>PROGRAM SPECIFIC OPTIONS/INFORMATION</H2>
-<DL>
-<?
-local myform = form.status.show_isakmp
-io.write("\t<DT")
-if (#myform.errtxt > 0) then io.write(" class='error'") end
-io.write(">" .. myform.label .. "</DT>\n")
-
-io.write("\t\t<DD><PRE>" .. myform.value .. "</PRE>\n")
-if (myform.descr) and (#myform.descr > 0) then io.write("\t\t<P CLASS='descr'>" .. string.gsub(myform.descr, "\n", "<BR>") .. "</P>\n") end
-if (#myform.errtxt > 0) then io.write("\t\t<P CLASS='error'>" .. string.gsub(myform.errtxt, "\n", "<BR>") .. "</P>\n") end
-io.write("\t\t</DD>\n")
-
-?>
-<?
-local myform = form.status.show_esp
-io.write("\t<DT")
-if (#myform.errtxt > 0) then io.write(" class='error'") end
-io.write(">" .. myform.label .. "</DT>\n")
-
-io.write("\t\t<DD><PRE>" .. myform.value .. "</PRE>\n")
-if (myform.descr) and (#myform.descr > 0) then io.write("\t\t<P CLASS='descr'>" .. string.gsub(myform.descr, "\n", "<BR>") .. "</P>\n") end
-if (#myform.errtxt > 0) then io.write("\t\t<P CLASS='error'>" .. string.gsub(myform.errtxt, "\n", "<BR>") .. "</P>\n") end
-io.write("\t\t</DD>\n")
-
-?>
-<?
-local myform = form.status.show_ah
-io.write("\t<DT")
-if (#myform.errtxt > 0) then io.write(" class='error'") end
-io.write(">" .. myform.label .. "</DT>\n")
-
-io.write("\t\t<DD><PRE>" .. myform.value .. "</PRE>\n")
-if (myform.descr) and (#myform.descr > 0) then io.write("\t\t<P CLASS='descr'>" .. string.gsub(myform.descr, "\n", "<BR>") .. "</P>\n") end
-if (#myform.errtxt > 0) then io.write("\t\t<P CLASS='error'>" .. string.gsub(myform.errtxt, "\n", "<BR>") .. "</P>\n") end
-io.write("\t\t</DD>\n")
-
-?>
-
-</DL>
-
-
-<?
---[[ DEBUG INFORMATION
-io.write("<H1>DEBUGGING</H1><span style='color:red'><H2>DEBUG INFO: CFE</H2>")
-io.write(html.cfe_unpack(form))
-io.write("</span>")
---]]
-?>
-
diff --git a/ipsec-tools-controller.lua b/ipsectools-controller.lua
index 2a31dd6..2a31dd6 100644
--- a/ipsec-tools-controller.lua
+++ b/ipsectools-controller.lua
diff --git a/ipsec-tools-model.lua b/ipsectools-model.lua
index ece5886..5545c78 100644
--- a/ipsec-tools-model.lua
+++ b/ipsectools-model.lua
@@ -27,7 +27,7 @@ local function get_version()
end
local function autostarts()
- local cmd_output_result, cmd_output_error
+ local cmd_output_result
local cmd = "/sbin/rc_status | egrep '^S' | egrep '" .. processname .."' 2>/dev/null"
local f = io.popen( cmd )
local cmdresult = f:read("*a")
@@ -37,23 +37,26 @@ local function autostarts()
cmd_output_error = "Not programmed to autostart"
end
f:close()
- return cmd_output_result,cmd_output_error
+ return cmd_output_result
end
-local function racoonctl(proto)
+local function racoonctl()
local cmd_output_result, cmd_output_error
- local cmd = "/usr/sbin/racoonctl show-sa ".. proto .. " 2>/dev/null"
+ local cmd = "/usr/sbin/racoonctl -lll show-sa isakmp 2>/dev/null"
local f = io.popen( cmd )
- local cmdresult = f:read("*a")
- if (cmdresult) and (#cmdresult > 0) then
- cmd_output_result = cmdresult
- else
- cmd_output_error = "Not programmed to autostart"
- end
+ local cmd_output_result = f:read("*a")
f:close()
return cmd_output_result,cmd_output_error
+end
+local function ip_xfrm(mode)
+ local cmd_output_result
+ local cmd = "/bin/ip xfrm " .. mode .. " 2>/dev/null"
+ local f = io.popen( cmd )
+ local cmd_output_result = f:read("*a")
+ f:close()
+ return cmd_output_result
end
function process_status_text(procname)
@@ -86,25 +89,19 @@ function getstatus()
errtxt=autostart_errtxt,
})
- local racoon_sequense, racoon_errtxt = racoonctl("isakmp")
status.show_isakmp = cfe({ name="show_isakmp",
- label="racoon show-sa isakmp",
- value=racoon_sequense,
- errtxt=racoon_errtxt,
+ label="racoonctl -lll show-sa isakmp",
+ value=racoonctl(),
})
- local racoon_sequense, racoon_errtxt = racoonctl("esp")
- status.show_esp = cfe({ name="show_esp",
- label="racoon show-sa esp",
- value=racoon_sequense,
- errtxt=racoon_errtxt,
+ status.ip_xfrm_state = cfe({ name="show_esp",
+ label="ip xfrm state",
+ value=ip_xfrm("state"),
})
- local racoon_sequense, racoon_errtxt = racoonctl("ah")
- status.show_ah = cfe({ name="show_ah",
- label="racoon show-sa ah",
- value=racoon_sequense,
- errtxt=racoon_errtxt,
+ status.ip_xfrm_policy = cfe({ name="ip_xfrm_policy",
+ label="ip xfrm policy",
+ value=ip_xfrm("policy"),
})
return status
diff --git a/ipsectools-status-html.lsp b/ipsectools-status-html.lsp
new file mode 100644
index 0000000..6215542
--- /dev/null
+++ b/ipsectools-status-html.lsp
@@ -0,0 +1,63 @@
+<? local form = ... ?>
+<?
+--[[ DEBUG INFORMATION
+io.write("<H1>DEBUGGING</H1><span style='color:red'><H2>DEBUG INFO: CFE</H2>")
+io.write(html.cfe_unpack(form))
+io.write("</span>")
+--]]
+?>
+
+<?
+function informationform(myform,tags)
+ for k,v in pairs(tags) do
+ if (myform[v]) then
+ local val = myform[v]
+ io.write("\t<DT")
+ if (#val.errtxt > 0) then io.write(" class='error'") end
+ io.write(">" .. val.label .. "</DT>\n")
+
+ io.write("\t\t<DD>" .. val.value .. "\n")
+ if (val.descr) and (#val.descr > 0) then io.write("\t\t<P CLASS='descr'>" .. string.gsub(val.descr, "\n", "<BR>") .. "</P>\n") end
+ if (#val.errtxt > 0) then io.write("\t\t<P CLASS='error'>" .. string.gsub(val.errtxt, "\n", "<BR>") .. "</P>\n") end
+ io.write("\t\t</DD>\n")
+ end
+ end
+end
+?>
+
+<H1>SYSTEM INFO</H1>
+<DL>
+<?
+local myform = form.status
+local tags = { "status", "version", "autostart", }
+informationform(myform,tags)
+?>
+</DL>
+
+<H2>PROGRAM SPECIFIC OPTIONS/INFORMATION</H2>
+<DL>
+<?
+local myform = form.status.show_isakmp
+io.write("\t\t<P><B>" .. myform.label .. "</B>\n")
+io.write("\t\t<PRE>" .. myform.value .. "</PRE></P>\n")
+
+local myform = form.status.ip_xfrm_state
+io.write("\t\t<P><B>" .. myform.label .. "</B>\n")
+io.write("\t\t<PRE>" .. myform.value .. "</PRE></P>\n")
+
+local myform = form.status.ip_xfrm_policy
+io.write("\t\t<P><B>" .. myform.label .. "</B>\n")
+io.write("\t\t<PRE>" .. myform.value .. "</PRE></P>\n")
+?>
+
+</DL>
+
+
+<?
+--[[ DEBUG INFORMATION
+io.write("<H1>DEBUGGING</H1><span style='color:red'><H2>DEBUG INFO: CFE</H2>")
+io.write(html.cfe_unpack(form))
+io.write("</span>")
+--]]
+?>
+
diff --git a/ipsec-tools.menu b/ipsectools.menu
index 17e5df1..17e5df1 100644
--- a/ipsec-tools.menu
+++ b/ipsectools.menu