diff options
author | James <> | 2013-03-17 12:16:37 +0000 |
---|---|---|
committer | James <> | 2013-03-17 12:16:37 +0000 |
commit | 27b76ab0671089c47506615a796a261e993896a7 (patch) | |
tree | 61213d67e7fa87b20356b23798558e2c4212c42f /package/network/ipv6/odhcp6c/files/.svn/text-base/dhcpv6.sh.svn-base | |
download | trunk-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-base | 56 |
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 + |