1 L.NetworkModel.Protocol.extend({
3 description: L.tr('IPv6-in-IPv4 (RFC4213)'),
7 populateForm: function(section, iface)
9 var wan = L.NetworkModel.findWAN();
11 section.taboption('general', L.cbi.InputValue, 'ipaddr', {
12 caption: L.tr('Local IPv4 address'),
13 description: L.tr('Leave empty to use the current WAN address'),
15 placeholder: wan ? wan.getIPv4Addrs()[0] : undefined,
19 section.taboption('general', L.cbi.InputValue, 'peeraddr', {
20 caption: L.tr('Remote IPv4 address'),
21 description: L.tr('This is usually the address of the nearest PoP optional by the tunnel broker'),
26 section.taboption('general', L.cbi.InputValue, 'ip6addr', {
27 caption: L.tr('Local IPv6 address'),
28 description: L.tr('This is the local endpoint address assigned by the tunnel broker, it usually ends with :2'),
33 section.taboption('general', L.cbi.InputValue, 'ip6prefix', {
34 caption: L.tr('IPv6 routed prefix'),
35 description: L.tr('This is the prefix routed to you by the tunnel broker for use by clients'),
40 var update = section.taboption('general', L.cbi.CheckboxValue, '_update', {
41 caption: L.tr('Dynamic tunnel'),
42 description: L.tr('Enable HE.net dynamic endpoint update'),
47 update.save = function(sid) { };
48 update.ucivalue = function(sid) {
49 var n = parseInt(this.map.get('network', sid, 'tunnelid'));
53 section.taboption('general', L.cbi.InputValue, 'tunnelid', {
54 caption: L.tr('Tunnel ID'),
58 }).depends('_update', true);
60 section.taboption('general', L.cbi.InputValue, 'username', {
61 caption: L.tr('HE.net user ID'),
62 description: L.tr('This is the 32 byte hex encoded user ID, not the login name'),
63 datatype: 'rangelength(32, 32)',
66 }).depends('_update', true);
68 section.taboption('general', L.cbi.PasswordValue, 'password', {
69 caption: L.tr('HE.net password'),
72 }).depends('_update', true);
74 section.taboption('advanced', L.cbi.CheckboxValue, 'defaultroute', {
75 caption: L.tr('Default route'),
76 description: L.tr('Create IPv6 default route via tunnel'),
81 section.taboption('advanced', L.cbi.InputValue, 'ttl', {
82 caption: L.tr('Override TTL'),
83 description: L.tr('Specifies the Time-to-Live on the tunnel interface'),
84 datatype: 'range(1,255)',