5 network
.registerPatternVirtual(/^6rd-.+$/);
7 return network
.registerProtocol('6rd', {
9 return _('IPv6-over-IPv4 (6rd)');
12 getIfname: function() {
13 return this._ubus('l3_device') || '6rd-%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
) {
39 o
= s
.taboption('general', form
.Value
, 'ipaddr', _('Local IPv4 address'), _('Leave empty to use the current WAN address'));
40 o
.datatype
= 'ip4addr("nomask")';
41 o
.load = function(section_id
) {
42 return network
.getWANNetworks().then(L
.bind(function(nets
) {
44 this.placeholder
= nets
[0].getIPAddr();
45 return form
.Value
.prototype.load
.apply(this, [section_id
]);
49 o
= s
.taboption('general', form
.Value
, 'peeraddr', _('Remote IPv4 address'), _('This IPv4 address of the relay'));
51 o
.datatype
= 'ip4addr("nomask")';
53 o
= s
.taboption('general', form
.Value
, 'ip6prefix', _('IPv6 prefix'), _('The IPv6 prefix assigned to the provider, usually ends with <code>::</code>'));
55 o
.datatype
= 'ip6addr';
57 o
= s
.taboption('general', form
.Value
, 'ip6prefixlen', _('IPv6 prefix length'), _('The length of the IPv6 prefix in bits'));
59 o
.datatype
= 'range(0,128)';
61 o
= s
.taboption('general', form
.Value
, 'ip4prefixlen', _('IPv4 prefix length'), _('The length of the IPv4 prefix in bits, the remainder is used in the IPv6 addresses.'));
63 o
.datatype
= 'range(0,32)';
65 o
= s
.taboption('advanced', form
.Value
, 'ttl', _('Use TTL on tunnel interface'));
67 o
.datatype
= 'range(1,255)';
69 o
= s
.taboption('advanced', form
.Value
, 'mtu', _('Use MTU on tunnel interface'));
70 o
.placeholder
= '1280';
71 o
.datatype
= 'max(9200)';