Merge pull request #1735 from sumpfralle/olsr-jsoninfo-parser-handle-empty-result
[oweals/luci.git] / protocols / luci-proto-ipv6 / luasrc / model / network / proto_4x6.lua
index d876d69ba81d86610dd166310e1cd73935d4b954..0b329d8a92bb08dc387a4cce705e3194140abcc9 100644 (file)
@@ -49,15 +49,16 @@ for _, p in ipairs({"dslite", "map", "464xlat"}) do
                return nil
        end
 
-       function proto.contains_interface(self, ifname)
+       function proto.contains_interface(self, ifc)
                return (netmod:ifnameof(ifc) == self:ifname())
        end
-
-       if p == "dslite" then
-               netmod:register_pattern_virtual("^ds-%w")
-       elseif p == "map" then
-               netmod:register_pattern_virtual("^map-%w")
-       elseif p == "464xlat" then
-               netmod:register_pattern_virtual("^464-%w")
-       end
 end
+
+netmod:register_pattern_virtual("^464%-%w")
+netmod:register_pattern_virtual("^ds%-%w")
+netmod:register_pattern_virtual("^map%-%w")
+
+netmod:register_error_code("AFTR_DNS_FAIL",            luci.i18n.translate("Unable to resolve AFTR host name"))
+netmod:register_error_code("INVALID_MAP_RULE", luci.i18n.translate("MAP rule is invalid"))
+netmod:register_error_code("NO_MATCHING_PD",   luci.i18n.translate("No matching prefix delegation"))
+netmod:register_error_code("UNSUPPORTED_TYPE", luci.i18n.translate("Unsupported MAP type"))