luci-proto-ipv6: register further network error codes
authorJo-Philipp Wich <jo@mein.io>
Thu, 12 Jul 2018 15:00:12 +0000 (17:00 +0200)
committerJo-Philipp Wich <jo@mein.io>
Thu, 12 Jul 2018 16:10:59 +0000 (18:10 +0200)
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
protocols/luci-proto-ipv6/luasrc/model/network/proto_4x6.lua

index ad99073ad67fbdce624e68ee26f362b8fb0269af..7508e0d4b00cb622df8a4e8c769df78a7872b2a5 100644 (file)
@@ -52,12 +52,13 @@ for _, p in ipairs({"dslite", "map", "464xlat"}) do
        function proto.contains_interface(self, ifname)
                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"))