summaryrefslogtreecommitdiffhomepage
path: root/protocols/luci-proto-tayga/luasrc/model
diff options
context:
space:
mode:
Diffstat (limited to 'protocols/luci-proto-tayga/luasrc/model')
-rw-r--r--protocols/luci-proto-tayga/luasrc/model/cbi/admin_network/proto_tayga.lua31
-rw-r--r--protocols/luci-proto-tayga/luasrc/model/network/proto_tayga.lua27
2 files changed, 58 insertions, 0 deletions
diff --git a/protocols/luci-proto-tayga/luasrc/model/cbi/admin_network/proto_tayga.lua b/protocols/luci-proto-tayga/luasrc/model/cbi/admin_network/proto_tayga.lua
new file mode 100644
index 000000000..862516d55
--- /dev/null
+++ b/protocols/luci-proto-tayga/luasrc/model/cbi/admin_network/proto_tayga.lua
@@ -0,0 +1,31 @@
+-- Licensed to the public under the Apache License 2.0.
+
+local map, section, net = ...
+
+local o = section:taboption("general", Value, "ipv4_addr",
+ translate("IPv4 address"))
+o.datatype = "ip4addr"
+o.rmempty = false
+
+o = section:taboption("general", Value, "dynamic_pool",
+ translate("IPv4 pool"))
+o.datatype = "ipmask4"
+o.rmempty = false
+
+o = section:taboption("general", Value, "prefix",
+ translate("Translation prefix"),
+ translate("Note: traffic between IPv6 hosts and private IPv4 addresses (i.e. to/from 64:ff9b::10.0.0.0/104, 64:ff9b::192.168.0.0/112, etc) will be dropped.\
+Use a translation prefix within your organization's IPv6 address space instead of 64:ff9b::/96 if you need your IPv6 hosts to communicate with private IPv4 addresses"))
+o.datatype = "ipmask6"
+o.default = "64:ff9b::/96"
+o.rmempty = false
+
+o = section:taboption("general", Value, "ipv6_addr",
+ translate("IPv6 address"))
+o.datatype = "ip6addr"
+o.rmempty = true
+
+o = section:taboption("general", Flag, "noroutes",
+ translate("No routes"), translate("Don't create routes for the IPv4 pool, IPv6 prefix and IPv6 address."))
+o.datatype = "boolean"
+
diff --git a/protocols/luci-proto-tayga/luasrc/model/network/proto_tayga.lua b/protocols/luci-proto-tayga/luasrc/model/network/proto_tayga.lua
new file mode 100644
index 000000000..9f6bb14c9
--- /dev/null
+++ b/protocols/luci-proto-tayga/luasrc/model/network/proto_tayga.lua
@@ -0,0 +1,27 @@
+-- Licensed to the public under the Apache License 2.0.
+
+local proto = luci.model.network:register_protocol("tayga")
+
+function proto.get_i18n(self)
+ return luci.i18n.translate("NAT64 (TAYGA)")
+end
+
+function proto.opkg_package(self)
+ return "tayga"
+end
+
+function proto.is_installed(self)
+ return nixio.fs.access("/lib/netifd/proto/tayga.sh")
+end
+
+function proto.is_floating(self)
+ return true
+end
+
+function proto.is_virtual(self)
+ return true
+end
+
+function proto.get_interfaces(self)
+ return nil
+end