Skip to content

Commit

Permalink
Merge pull request #70 from openwrtdiy/openwrt-23.05
Browse files Browse the repository at this point in the history
Synchronize official source code
  • Loading branch information
openwrtdiy authored Oct 10, 2024
2 parents 27cd552 + c344ad0 commit 33735fe
Show file tree
Hide file tree
Showing 46 changed files with 6,649 additions and 1,152 deletions.
5 changes: 4 additions & 1 deletion applications/luci-app-rp-pppoe-server/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,10 @@
include $(TOPDIR)/rules.mk

LUCI_TITLE:=Roaring Penguin PPPoE Server
LUCI_DEPENDS:=+luci-compat +rp-pppoe-server
LUCI_DEPENDS:=+luci-base +luci-compat +rp-pppoe-server

PKG_LICENSE:=Apache-2.0
PKG_MAINTAINER:=Paul Donald <[email protected]>

include ../../luci.mk

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
'use strict';
'require form';
'require network';
'require tools.widgets as widgets';
'require view';

return view.extend({
load: function() {
return Promise.all([
network.getNetworks(),
]);
},

render: function (loaded_promises) {
var m, s, o;
const networks = loaded_promises[0];

m = new form.Map('pppoe', _('Roaring Penguin PPPoE Relay'),
_('PPPoE Relay Configuration'));

s = m.section(form.TypedSection, 'pppoe_relay', _('Relay Configuration'));
s.anonymous = true;
s.addremove = true;

o = s.option(form.Flag, 'enabled', _('Enabled'));

o = s.option(widgets.DeviceSelect, 'server_interface', _('Server Interface'), _('Interface on which to listen. Only PPPoE servers may be connected to this interface.'));
o.multiple = true;
o.optional = true;
o.nocreate = true;
o.rmempty = true;
o.depends({ enabled: '1' });

o = s.option(widgets.DeviceSelect, 'client_interface', _('Client Interface'), _('Interface from which to relay. Only PPPoE clients may be connected to this interface.'));
o.multiple = true;
o.optional = true;
o.nocreate = true;
o.rmempty = true;
o.depends({ enabled: '1' });

o = s.option(widgets.DeviceSelect, 'both_interface', _('Both Interface'), _('Interface upon which to listen and to relay. Both PPPoE clients and servers may be connected to this interface.'));
o.multiple = true;
o.optional = true;
o.nocreate = true;
o.rmempty = true;
o.depends({ enabled: '1' });

o = s.option(form.Flag, 'use_non_uci_config', _('Use Non-UCI Config'), '<code>/etc/default/pppoe-relay</code>');
o.optional = true;
o.rmempty = true;
o.depends({ enabled: '1' });

o = s.option(form.Value, 'maxsessions', _('Maximum Sessions'));
o.datatype = 'range(1,65534)';
o.placeholder = 5000;
o.value('', _('Default: 5000'));
o.optional = true;
o.rmempty = true;
o.depends({ enabled: '1' });

o = s.option(form.Value, 'timeout', _('Timeout'));
o.optional = true;
o.datatype = 'uinteger';
o.placeholder = 600;
o.value('0', _('No timeout'));
o.value('', _('Default: 600'));
o.rmempty = true;
o.depends({ enabled: '1' });

return m.render();
}
});
Original file line number Diff line number Diff line change
@@ -0,0 +1,129 @@
'use strict';
'require form';
'require network';
'require tools.widgets as widgets';
'require view';

return view.extend({
load: function() {
return Promise.all([
network.getNetworks(),
]);
},

render: function (loaded_promises) {
var m, s, o;
const networks = loaded_promises[0];

m = new form.Map('pppoe', _('Roaring Penguin PPPoE Server'),
_('PPPoE Server Configuration'));

s = m.section(form.TypedSection, 'pppoe_server', _('Server Configuration'));
s.anonymous = true;
s.addremove = true;

o = s.option(form.Flag, 'enabled', _('Enabled'));

o = s.option(widgets.DeviceSelect, 'interface', _('Interface'), _('Interface on which to listen.'));
o.optional = true;
o.nocreate = true;
o.rmempty = true;
o.depends({ enabled: '1' });

o = s.option(form.Value, 'localip', _('IP of listening side'), _('If specified as <code>0.0.0.0</code> the selection of local IP address is delegated to <code>pppd</code>'));
o.datatype = 'ipaddr';
o.placeholder = '10.0.0.1';
o.value('10.0.0.1');
o.value('0.0.0.0');
o.depends({ enabled: '1' });

o = s.option(form.Value, 'firstremoteip', _('First remote IP'), _('If specified as <code>0.0.0.0</code> remote IP allocation will be delegated to <code>pppd</code>'));
o.datatype = 'ipaddr';
o.placeholder = '10.67.15.1';
o.value('10.67.15.1');
o.value('0.0.0.0');
o.rmempty = true;
o.depends({ enabled: '1' });

o = s.option(form.Value, 'ac_name', _('Access Concentrator Name'));
o.rmempty = true;
o.value('', _('Default: hostname'));
o.depends({ enabled: '1' });

o = s.option(form.DynamicList, 'service_name', _('Service Name'), _('Each one causes the named service to be advertised in a Service-Name tag in the PADO frame. The first one specifies the default service, and is used if the PPPoE client requests a Service-Name of length zero.'));
o.optional = true;
o.rmempty = true;
o.depends({ enabled: '1' });

o = s.option(form.Value, 'maxsessions', _('Maximum Sessions'), _('Maximum concurrent sessions'));
o.datatype = 'range(1,65534)';
o.placeholder = 64;
o.value('', _('Default: 64'));
o.optional = true;
o.rmempty = true;
o.depends({ enabled: '1' });

o = s.option(form.Value, 'maxsessionsperpeer', _('Maximum sessions per peer'));
o.optional = true
o.datatype = 'range(0,65534)';
o.placeholder = 0;
o.value('0', _('No limit'));
o.value('10');
o.value('100');
o.rmempty = true;
o.depends({ enabled: '1' });

o = s.option(form.Flag, 'use_non_uci_config', _('Use Non-UCI Config'), '<code>/etc/default/pppoe-server</code>');
o.optional = true;
o.rmempty = true;
o.depends({ enabled: '1' });

o = s.option(form.Value, 'optionsfile', _('Options file'));
o.placeholder = '/etc/ppp/pppoe-server-options';
o.value('/etc/ppp/options');
o.value('/etc/ppp/pppoe-server-options');
o.optional = true;
o.rmempty = true;
o.depends({ enabled: '1' });

o = s.option(form.Flag, 'randomsessions', _('Random session selection'), _('Tells the PPPoE server to randomly permute session numbers.'));
o.optional = true;
o.rmempty = true;
o.depends({ enabled: '1' });

o = s.option(form.Flag, 'unit', _('Unit'), _('Invokes <code>pppd</code> with the unit flag'));
o.optional = true;
o.rmempty = true;
o.depends({ enabled: '1' });

o = s.option(form.Value, 'offset', _('Offset'), _('PPP Offset'), _('Instead of numbering PPPoE sessions starting at 1, numbering starts at %s'.format('<code>offset</code>+1')));
o.optional = true;
o.datatype = 'uinteger';
o.placeholder = 0;
o.value('0');
o.depends({ enabled: '1' });

o = s.option(form.Value, 'timeout', _('Timeout'), _('Causes <code>pppoe</code> to exit if no session traffic is detected for %s seconds.'.format('<code>timeout</code>')));
// no default timeout is assumed
o.optional = true;
o.datatype = 'uinteger';
o.value('0', _('No timeout'));
o.value('60');
o.rmempty = true;
o.depends({ enabled: '1' });

o = s.option(form.Value, 'mss', _('MSS'), _('Max Segment Size'));
o.optional = true;
o.datatype = 'uinteger';
o.placeholder = 1468;
o.value('1412');
o.value('1468');
o.rmempty = true;
o.depends({ enabled: '1' });

o = s.option(form.Flag, 'sync', _('Synchronous PPP encapsulation'), _('Reduces CPU usage, but may cause a race condition on slow CPUs'));
o.depends({ enabled: '1' });

return m.render();
}
});
Original file line number Diff line number Diff line change
@@ -1,72 +0,0 @@
-- Copyright 2015 Daniel Dickinson <[email protected]>
-- Licensed to the public under the Apache License 2.0.

local m, s, o

local nixio = require "nixio"

m = Map("pppoe", translate("Roaring Penguin PPPoE Server"),
translate("PPPoE Server Configuration"))

s = m:section(TypedSection, "pppoe_server", translate("Server Configuration"))
s.addremove = true
s.anonymous = true

o = s:option(Value, "interface", translate("Interface"), translate("Interface on which to listen."))
o.template = "cbi/network_netlist"
o.nocreate = true

o = s:option(Value, "ac_name", translate("Access Concentrator Name"))
o.optional = true

o = s:option(DynamicList, "service_name", translate("Service Name"))
o.optional = true

o = s:option(Value, "maxsessionsperpeer", translate("Maximum sessions per peer"))
o.optional = true
o.datatype = "uinteger"

o = s:option(Value, "localip", translate("IP of listening side"))
o.datatype = "ipaddr"

o = s:option(Value, "firstremoteip", translate("First remote IP"))
o.datatype = "ipaddr"

o = s:option(Value, "maxsessions", translate("Maximum sessions"))
o.datatype = "uinteger"
o.default = 64
o.optional = true

o = s:option(Value, "optionsfile", translate("Options file"))
o.default = "/etc/ppp/pppoe-server-options"
o.optional = true

o = s:option(Flag, "randomsessions", translate("Random session selection"), translate("Instead of starting at beginning and going to end, randomize session number"))
o.optional = true

o = s:option(Value, "unit", translate("Unit"), translate("PPP unit number"))
o.optional = true
o.datatype = "uinteger"
o.default = 0

o = s:option(Value, "offset", translate("Offset"), translate("PPP offset"))
o.optional = true
o.datatype = "uinteger"
o.default = 0

o = s:option(Value, "timeout", translate("Timeout"))
o.optional = true
o.datatype = "uinteger"
o.default = 60

o = s:option(Value, "mss", translate("MSS"))
o.optional = true
o.datatype = "uinteger"
o.default = 1468


o = s:option(Flag, "sync", translate("Sync"))
o.optional = true
o.default = false

return m
Loading

0 comments on commit 33735fe

Please sign in to comment.