aboutsummaryrefslogtreecommitdiffstats
path: root/package/network/ipv6/odhcp6c/files/.svn/text-base/dhcpv6.sh.svn-base
diff options
context:
space:
mode:
authorJames <>2013-03-17 12:16:37 +0000
committerJames <>2013-03-17 12:16:37 +0000
commit27b76ab0671089c47506615a796a261e993896a7 (patch)
tree61213d67e7fa87b20356b23798558e2c4212c42f /package/network/ipv6/odhcp6c/files/.svn/text-base/dhcpv6.sh.svn-base
downloadtrunk-36060-master.tar.gz
trunk-36060-master.tar.bz2
trunk-36060-master.zip
Diffstat (limited to 'package/network/ipv6/odhcp6c/files/.svn/text-base/dhcpv6.sh.svn-base')
-rw-r--r--package/network/ipv6/odhcp6c/files/.svn/text-base/dhcpv6.sh.svn-base56
1 files changed, 56 insertions, 0 deletions
diff --git a/package/network/ipv6/odhcp6c/files/.svn/text-base/dhcpv6.sh.svn-base b/package/network/ipv6/odhcp6c/files/.svn/text-base/dhcpv6.sh.svn-base
new file mode 100644
index 0000000..6cf7521
--- /dev/null
+++ b/package/network/ipv6/odhcp6c/files/.svn/text-base/dhcpv6.sh.svn-base
@@ -0,0 +1,56 @@
+#!/bin/sh
+
+. /lib/functions.sh
+. ../netifd-proto.sh
+init_proto "$@"
+
+proto_dhcpv6_init_config() {
+ proto_config_add_string "reqaddress"
+ proto_config_add_string "reqprefix"
+ proto_config_add_string "clientid"
+ proto_config_add_string "reqopts"
+ proto_config_add_string "noslaaconly"
+ proto_config_add_string "norelease"
+ proto_config_add_string "ip6prefix"
+}
+
+proto_dhcpv6_setup() {
+ local config="$1"
+ local iface="$2"
+
+ local reqaddress reqprefix clientid reqopts noslaaconly norelease ip6prefix
+ json_get_vars reqaddress reqprefix clientid reqopts noslaaconly norelease ip6prefix
+
+
+ # Configure
+ local opts=""
+ [ -n "$reqaddress" ] && append opts "-N$reqaddress"
+
+ [ -z "$reqprefix" -o "$reqprefix" = "auto" ] && reqprefix=0
+ [ "$reqprefix" != "no" ] && append opts "-P$reqprefix"
+
+ [ -n "$clientid" ] && append opts "-c$clientid"
+
+ [ "$noslaaconly" = "1" ] && append opts "-S"
+
+ [ "$norelease" = "1" ] && append opts "-k"
+
+ for opt in $reqopts; do
+ append opts "-r$opt"
+ done
+
+ [ -n "$ip6prefix" ] && proto_export "USERPREFIX=$ip6prefix"
+
+ proto_export "INTERFACE=$config"
+ proto_run_command "$config" odhcp6c \
+ -s /lib/netifd/dhcpv6.script \
+ $opts $iface
+}
+
+proto_dhcpv6_teardown() {
+ local interface="$1"
+ proto_kill_command "$interface"
+}
+
+add_protocol dhcpv6
+