You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

61 lines
1.4 KiB

  1. --[[
  2. LuCI - Network model - dhcpv6 protocol extension
  3. Copyright 2012 David Woodhouse
  4. Licensed under the Apache License, Version 2.0 (the "License");
  5. you may not use this file except in compliance with the License.
  6. You may obtain a copy of the License at
  7. http://www.apache.org/licenses/LICENSE-2.0
  8. Unless required by applicable law or agreed to in writing, software
  9. distributed under the License is distributed on an "AS IS" BASIS,
  10. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  11. See the License for the specific language governing permissions and
  12. limitations under the License.
  13. ]]--
  14. local netmod = luci.model.network
  15. local interface = luci.model.network.interface
  16. local proto = netmod:register_protocol("openconnect")
  17. function proto.get_i18n(self)
  18. return luci.i18n.translate("OpenConnect (CISCO AnyConnect)")
  19. end
  20. function proto.ifname(self)
  21. return "vpn-" .. self.sid
  22. end
  23. function proto.get_interface(self)
  24. return interface(self:ifname(), self)
  25. end
  26. function proto.opkg_package(self)
  27. return "openconnect"
  28. end
  29. function proto.is_installed(self)
  30. return nixio.fs.access("/lib/netifd/proto/openconnect.sh")
  31. end
  32. function proto.is_floating(self)
  33. return true
  34. end
  35. function proto.is_virtual(self)
  36. return true
  37. end
  38. function proto.get_interfaces(self)
  39. return nil
  40. end
  41. function proto.contains_interface(self, ifc)
  42. return (netmod:ifnameof(ifc) == self:ifname())
  43. end
  44. netmod:register_pattern_virtual("^vpn-%w")