5 network
.registerPatternVirtual(/^sstp-.+$/);
7 return network
.registerProtocol('sstp', {
12 getIfname: function() {
13 return this._ubus('l3_device') || 'sstp-%s'.format(this.sid
);
16 getOpkgPackage: function() {
20 isFloating: function() {
24 isVirtual: function() {
28 getDevices: function() {
32 containsDevice: function(ifname
) {
33 return (network
.getIfnameOf(ifname
) == this.getIfname());
36 renderFormOptions: function(s
) {
37 var dev
= this.getL3Device() || this.getDevice(), o
;
39 // -- general ---------------------------------------------------------------------
41 o
= s
.taboption('general', form
.Value
, 'server', _('SSTP Server'));
44 o
= s
.taboption('general', form
.Value
, 'username', _('PAP/CHAP username'));
46 o
= s
.taboption('general', form
.Value
, 'password', _('PAP/CHAP password'));
49 // -- advanced --------------------------------------------------------------------
51 o
= s
.taboption('advanced', form
.Flag
, 'ppp_ipv6', _('IPv6 support'), _('If checked, adds "+ipv6" to the pppd options'));
54 o
= s
.taboption('advanced', form
.ListValue
, 'log_level', _('sstpc Log-level'));
55 o
.value('0', _('0', 'sstp log level value'));
56 o
.value('1', _('1', 'sstp log level value'));
57 o
.value('2', _('2', 'sstp log level value'));
58 o
.value('3', _('3', 'sstp log level value'));
59 o
.value('4', _('4', 'sstp log level value'));
62 o
= s
.taboption('advanced', form
.Value
, 'mtu', _('Override MTU'));
63 o
.placeholder
= dev
? (dev
.getMTU() || '1500') : '1500';
64 o
.datatype
= 'max(9200)';
66 o
= s
.taboption('advanced', form
.Value
, 'sstp_options', _('Extra sstpc options'), _('e.g: --proxy 10.10.10.10'));
68 o
= s
.taboption('advanced', form
.Value
, 'pppd_options', _('Extra pppd options'), _('e.g: dump'));