luci-mod-network: remove unused `iface_down` endpoint
[project/luci.git] / protocols / luci-proto-3g / luasrc / model / network / proto_3g.lua
1 -- Copyright 2018 Florian Eckert <fe@dev.tdt.de>
2 -- Licensed to the public under the Apache License 2.0.
3
4 local netmod = luci.model.network
5 local interface = luci.model.network.interface
6
7 local proto = netmod:register_protocol("3g")
8
9 function proto.get_i18n(self)
10 return luci.i18n.translate("UMTS/GPRS/EV-DO")
11 end
12
13 function proto.ifname(self)
14 return "3g-" .. self.sid
15 end
16
17 function proto.get_interface(self)
18 return interface(self:ifname(), self)
19 end
20
21 function proto.is_installed(self)
22 return nixio.fs.access("/lib/netifd/proto/3g.sh")
23 end
24
25 function proto.opkg_package(self)
26 return "comgt"
27 end
28
29 function proto.is_floating(self)
30 return true
31 end
32
33 function proto.is_virtual(self)
34 return true
35 end
36
37 function proto.get_interfaces(self)
38 return nil
39 end
40
41 function proto.contains_interface(self, ifc)
42 if self:is_floating() then
43 return (netmod:ifnameof(ifc) == self:ifname())
44 else
45 return netmod.protocol.contains_interface(self, ifc)
46 end
47 end
48
49 netmod:register_pattern_virtual("^3g%-%w")