proto_pppossh.lua 782 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. -- Copyright 2018 Florian Eckert <fe@dev.tdt.de>
  2. -- Licensed to the public under the Apache License 2.0.
  3. local netmod = luci.model.network
  4. local proto = netmod:register_protocol("pppossh")
  5. function proto.get_i18n(self)
  6. return luci.i18n.translate("PPPoSSH")
  7. end
  8. function proto.ifname(self)
  9. return "pppossh-" .. self.sid
  10. end
  11. function proto.opkg_package(self)
  12. return "pppossh"
  13. end
  14. function proto.is_installed(self)
  15. return nixio.fs.access("/lib/netifd/proto/pppossh.sh")
  16. end
  17. function proto.is_floating(self)
  18. return true
  19. end
  20. function proto.is_virtual(self)
  21. return true
  22. end
  23. function proto.get_interfaces(self)
  24. return nil
  25. end
  26. function proto.contains_interface(self, ifc)
  27. return (netmod:ifnameof(ifc) == self:ifname())
  28. end
  29. netmod:register_pattern_virtual("^pppossh%-%w")