rp-pppoe-server.lua 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. -- Copyright 2015 Daniel Dickinson <openwrt@daniel.thecshore.com>
  2. -- Licensed to the public under the Apache License 2.0.
  3. local m, s, o
  4. local nixio = require "nixio"
  5. m = Map("pppoe", translate("Roaring Penguin PPPoE Server"),
  6. translate("PPPoE Server Configuration"))
  7. s = m:section(TypedSection, "pppoe_server", translate("Server Configuration"))
  8. s.addremove = false
  9. s.anonymous = true
  10. o = s:option(Value, "interface", translate("Interface"), translate("Interface on which to listen."))
  11. o.template = "cbi/network_ifacelist"
  12. o.nocreate = true
  13. o = s:option(Value, "ac_name", translate("Access Concentrator Name"))
  14. o.optional = true
  15. o = s:option(DynamicList, "service_name", translate("Service Name"))
  16. o.optional = true
  17. o = s:option(Value, "maxsessionsperpeer", translate("Maximum sessions per peer"))
  18. o.optional = true
  19. o.datatype = "uinteger"
  20. o = s:option(Value, "localip", translate("IP of listening side"))
  21. o.datetype = "ipaddr"
  22. o = s:option(Value, "firstremoteip", translate("First remote IP"))
  23. o.datatype = "ipaddr"
  24. o = s:option(Value, "maxsessions", translate("Maximum sessions"))
  25. o.datatype = "uinteger"
  26. o.default = 64
  27. o.optional = true
  28. o = s:option(Value, "optionsfile", translate("Options file"))
  29. o.default = "/etc/ppp/pppoe-server-options"
  30. o.optional = true
  31. o = s:option(Flag, "randomsessions", translate("Random session selection"), translate("Instead of starting at beginning and going to end, randomize session number"))
  32. o.optional = true
  33. o = s:option(Value, "unit", translate("Unit"), translate("PPP unit number"))
  34. o.optional = true
  35. o.datatype = "uinteger"
  36. o.default = 0
  37. o = s:option(Value, "offset", translate("Offset"), translate("PPP offset"))
  38. o.optional = true
  39. o.datatype = "uinteger"
  40. o.default = 0
  41. o = s:option(Value, "timeout", translate("Timeout"))
  42. o.optional = true
  43. o.datatype = "uinteger"
  44. o.default = 60
  45. o = s:option(Value, "mss", translate("MSS"))
  46. o.optional = true
  47. o.datatype = "uinteger"
  48. o.default = 1468
  49. o = s:option(Flag, "sync", translate("Sync"))
  50. o.optional = true
  51. o.default = false
  52. return m