diff options
author | Jo-Philipp Wich <jow@openwrt.org> | 2014-02-01 18:35:42 +0000 |
---|---|---|
committer | Jo-Philipp Wich <jow@openwrt.org> | 2014-02-01 18:35:42 +0000 |
commit | e6523658e2e2aa60d85b88cd4634bb2917d030cc (patch) | |
tree | ff91abd42289ef1f4a636fa8e6a151669b1a25e1 /luci2/htdocs/luci2/proto/6rd.js | |
parent | f90935da6e6d84e5f98a90c02a63a45ffea613a1 (diff) | |
download | luci2-ui-e6523658e2e2aa60d85b88cd4634bb2917d030cc.tar.gz |
luci2: add network protocol support extensions
Diffstat (limited to 'luci2/htdocs/luci2/proto/6rd.js')
-rw-r--r-- | luci2/htdocs/luci2/proto/6rd.js | 63 |
1 files changed, 63 insertions, 0 deletions
diff --git a/luci2/htdocs/luci2/proto/6rd.js b/luci2/htdocs/luci2/proto/6rd.js new file mode 100644 index 0000000..47f6d29 --- /dev/null +++ b/luci2/htdocs/luci2/proto/6rd.js @@ -0,0 +1,63 @@ +L.NetworkModel.Protocol.extend({ + protocol: '6rd', + description: L.tr('IPv6-over-IPv4 (6rd)'), + tunnel: true, + virtual: true, + + populateForm: function(section, iface) + { + var wan = L.NetworkModel.findWAN(); + + section.taboption('general', L.cbi.InputValue, 'peeraddr', { + caption: L.tr('6RD Gateway'), + datatype: 'ip4addr', + optional: false + }); + + section.taboption('general', L.cbi.InputValue, 'ipaddr', { + caption: L.tr('Local IPv4 address'), + description: L.tr('Leave empty to use the current WAN address'), + datatype: 'ip4addr', + placeholder: wan ? wan.getIPv4Addrs()[0] : undefined, + optional: true + }); + + section.taboption('general', L.cbi.InputValue, 'ip4prefixlen', { + caption: L.tr('IPv4 prefix length'), + description: L.tr('The length of the IPv4 prefix in bits, the remainder is used in the IPv6 addresses'), + datatype: 'range(0, 32)', + placeholder: 0, + optional: true + }); + + section.taboption('general', L.cbi.InputValue, 'ip6prefix', { + caption: L.tr('IPv6 prefix'), + description: L.tr('The IPv6 prefix assigned to the provider, usually ends with "::"'), + datatype: 'ip6addr', + optional: false + }); + + section.taboption('general', L.cbi.InputValue, 'ip6prefixlen', { + caption: L.tr('IPv6 prefix length'), + description: L.tr('The length of the IPv6 prefix in bits'), + datatype: 'range(0, 128)', + placeholder: 16, + optional: true + }); + + section.taboption('advanced', L.cbi.CheckboxValue, 'defaultroute', { + caption: L.tr('Default route'), + description: L.tr('Create IPv6 default route via tunnel'), + optional: true, + initial: true + }); + + section.taboption('advanced', L.cbi.InputValue, 'ttl', { + caption: L.tr('Override TTL'), + description: L.tr('Specifies the Time-to-Live on the tunnel interface'), + datatype: 'range(1,255)', + placeholder: 64, + optional: true + }); + } +}); |