o.depends({ proto: 'tcp', '!contains': true });
o.depends({ proto: 'udp', '!contains': true });
+ var have_fw4 = L.hasSystemFeature('firewall4')
+ if (!have_fw4) {
+ o = s.taboption('advanced', form.Value, 'ipset', _('Use ipset'));
+ uci.sections('firewall', 'ipset', function(s) {
+ if (typeof(s.name) == 'string')
+ this.value(s.name, s.comment ? '%s (%s)'.format(s.name, s.comment) : s.name);
+ });
+ o.modalonly = true;
+ o.rmempty = true;
+ }
+
o = s.taboption('advanced', widgets.DeviceSelect, 'device', _('Outbound device'),
_('Matches forwarded traffic using the specified outbound network device.'));
o.noaliases = true;
fwtool.addLimitOption(s);
fwtool.addLimitBurstOption(s);
- if (!L.hasSystemFeature('firewall4')) {
+ if (!have_fw4) {
o = s.taboption('advanced', form.Value, 'extra', _('Extra arguments'),
_('Passes additional arguments to iptables. Use with care!'));
o.modalonly = true;