1 -- Copyright 2011 Jo-Philipp Wich <jow@openwrt.org>
2 -- Licensed to the public under the Apache License 2.0.
4 local netmod = luci.model.network
7 for _, p in ipairs({"6in4", "6to4", "6rd"}) do
9 local proto = netmod:register_protocol(p)
11 function proto.get_i18n(self)
13 return luci.i18n.translate("IPv6-in-IPv4 (RFC4213)")
14 elseif p == "6to4" then
15 return luci.i18n.translate("IPv6-over-IPv4 (6to4)")
16 elseif p == "6rd" then
17 return luci.i18n.translate("IPv6-over-IPv4 (6rd)")
21 function proto.ifname(self)
22 return p .. "-" .. self.sid
25 function proto.opkg_package(self)
29 function proto.is_installed(self)
30 return nixio.fs.access("/lib/netifd/proto/" .. p .. ".sh")
33 function proto.is_floating(self)
37 function proto.is_virtual(self)
41 function proto.get_interfaces(self)
45 function proto.contains_interface(self, ifname)
46 return (netmod:ifnameof(ifc) == self:ifname())
49 netmod:register_pattern_virtual("^%s%%-%%w" % p)