$(INSTALL_BIN) $(PKG_BUILD_DIR)/contrib/ffluci $(1)/www/cgi-bin
$(INSTALL_BIN) $(PKG_BUILD_DIR)/contrib/index.cgi $(1)/www/cgi-bin
$(INSTALL_BIN) $(PKG_BUILD_DIR)/contrib/index.html $(1)/www
- $(CP) $(PKG_BUILD_DIR)/contrib/ffluci.uci $(1)/etc/config/luci
+ $(CP) $(PKG_BUILD_DIR)/contrib/uci/luci $(1)/etc/config/luci
+ $(CP) $(PKG_BUILD_DIR)/contrib/uci/luci_fw $(1)/etc/config/luci_fw
$(CP) -a ./ipkg/ffluci.postinst $(1)/CONTROL/postinst
$(CP) -a ./ipkg/conffiles $(1)/CONTROL/conffiles
endef
--- /dev/null
+-- ToDo: Translate, Add descriptions and help texts
+m = Map("luci_fw", "Firewall")
+
+s = m:section(TypedSection, "rule")
+s.addremove = true
+
+chain = s:option(ListValue, "chain", "Kette")
+chain:value("forward", "Forward")
+chain:value("input", "Input")
+chain:value("output", "Output")
+chain:value("prerouting", "Prerouting")
+chain:value("postrouting", "Postrouting")
+
+s:option(Value, "iface", "Eingangsschnittstelle").optional = true
+s:option(Value, "oface", "Ausgangsschnittstelle").optional = true
+s:option(Value, "proto", "Protokoll").optional = true
+s:option(Value, "source", "Quelladresse").optional = true
+s:option(Value, "destination", "Zieladresse").optional = true
+s:option(Value, "sport", "Quellports").optional = true
+s:option(Value, "dport", "Zielports").optional = true
+s:option(Value, "to", "Neues Ziel").optional = true
+
+state = s:option(MultiValue, "state", "Status")
+state.optional = true
+state.delimiter = ","
+state:value("NEW", "neu")
+state:value("ESTABLISHED", "etabliert")
+state:value("RELATED", "zugehörig")
+state:value("INVALID", "ungültig")
+
+s:option(Value, "jump", "Aktion", "ACCEPT, REJECT, DROP, MASQUERADE, DNAT, SNAT, ...").optional = true
+
+
+add = s:option(Value, "command", "Befehl")
+add.size = 50
+
+return m
\ No newline at end of file
--- /dev/null
+-- ToDo: Translate, Add descriptions and help texts
+m = Map("luci_fw", "Portweiterleitung")
+
+s = m:section(TypedSection, "portfw")
+s.addremove = true
+s.anonymous = true
+
+iface = s:option(Value, "in_interface", "Externes Interface")
+
+proto = s:option(ListValue, "proto", "Protokoll")
+proto:value("tcp", "TCP")
+proto:value("udp", "UDP")
+
+dport = s:option(Value, "dport", "Externer Port", "Port[:Endport]")
+
+to = s:option(Value, "to", "Interne Adresse", "IP-Adresse[:Zielport[-Zielendport]]")
+
+return m
\ No newline at end of file
function Session._uci3(self, cmd)
local res = ffluci.sys.execl(self.ucicmd .. " 2>&1 " .. cmd)
- if res[1]:sub(1, ucicmd:len() + 1) == ucicmd .. ":" then
+ if res[1] and res[1]:sub(1, self.ucicmd:len()+1) == self.ucicmd..":" then
return nil, res[1]
end
table = {}
-
+
for k,line in pairs(res) do
c, s, t = line:match("^([^.]-)%.([^.]-)=(.-)$")
if c then