+function rename_zone(self, old, new)
+ local r = false
+ if new and #new > 0 and new:match("^[a-zA-Z0-9_]+$") and not self:get_zone(new) then
+ ub.uci:foreach("firewall", "zone",
+ function(s)
+ if n and s.name == old then
+ ub.uci:set("firewall", s['.name'], "name", new)
+ r = true
+ return false
+ end
+ end)
+ if r then
+ ub.uci:foreach("firewall", "rule",
+ function(s)
+ if s.src == old then
+ ub.uci:set("firewall", s['.name'], "src", new)
+ elseif s.dest == old then
+ ub.uci:set("firewall", s['.name'], "dest", new)
+ end
+ end)
+ ub.uci:foreach("firewall", "redirect",
+ function(s)
+ if s.src == old then
+ ub.uci:set("firewall", s['.name'], "src", new)
+ end
+ end)
+ ub.uci:foreach("firewall", "forwarding",
+ function(s)
+ if s.src == old then
+ ub.uci:set("firewall", s['.name'], "src", new)
+ end
+ end)
+ end
+ end
+ return r
+end
+
+function del_network(self, net)