IP_SUPPORTED_PROTOCOLS="${IP_SUPPORTED_PROTOCOLS} ipv6"
-function ipv6_device_autoconf_enable() {
+ipv6_device_autoconf_enable() {
local device="${1}"
assert device_exists "${device}"
ipv6_device_forwarding_disable "${device}"
}
-function ipv6_device_autoconf_disable() {
+ipv6_device_autoconf_disable() {
local device="${1}"
assert device_exists "${device}"
ipv6_device_privacy_extensions_disable "${device}"
}
-function ipv6_device_forwarding_enable() {
+ipv6_device_forwarding_enable() {
local device="${1}"
sysctl_set "net.ipv6.conf.${device}.forwarding" 1
log INFO "Enabled IPv6 forwarding on '${device}'"
}
-function ipv6_device_forwarding_disable() {
+ipv6_device_forwarding_disable() {
local device="${1}"
sysctl_set "net.ipv6.conf.${device}.forwarding" 0
}
# Enable IPv6 RFC3041 privacy extensions if desired
-function ipv6_device_privacy_extensions_enable() {
+ipv6_device_privacy_extensions_enable() {
local device="${1}"
assert device_exists "${device}"
sysctl_set "net.ipv6.conf.${device}.use_tempaddr" 2
}
-function ipv6_device_privacy_extensions_disable() {
+ipv6_device_privacy_extensions_disable() {
local device="${1}"
assert device_exists "${device}"
sysctl_set "net.ipv6.conf.${device}.use_tempaddr" 0
}
-function ipv6_is_valid() {
+ipv6_is_valid() {
ipcalc --ipv6 -c $@ >/dev/null 2>&1
case "$?" in
esac
}
-function ipv6_prefix_is_valid() {
+ipv6_prefix_is_valid() {
local prefix=${1}
assert isset prefix
return ${EXIT_TRUE}
}
-function ipv6_get_prefix() {
+ipv6_get_prefix() {
ip_get_prefix "$@"
}
-function ipv6_split_prefix() {
+ipv6_split_prefix() {
ip_split_prefix "$@"
}
-function ipv6_address_add() {
+ipv6_address_add() {
local address="${1}"
assert isset address
return ${EXIT_OK}
}
-function ipv6_address_del() {
+ipv6_address_del() {
local address="${1}"
local device="${2}"
ip_address_del "${device}" "${address}"
}
-function ipv6_address_flush() {
+ipv6_address_flush() {
local device="${1}"
assert isset device
cmd_quiet ip -6 addr flush dev "${device}" scope global permanent
}
-function ipv6_address_change_lifetime() {
+ipv6_address_change_lifetime() {
local address="${1}"
assert isset address
return ${EXIT_OK}
}
-function ipv6_get_dad_status() {
+ipv6_get_dad_status() {
local address="${1}"
assert isset address
return ${EXIT_DAD_OK}
}
-function ipv6_wait_for_dad() {
+ipv6_wait_for_dad() {
local address="${1}"
assert isset address
return ${EXIT_ERROR}
}
-function ipv6_device_get_addresses() {
+ipv6_device_get_addresses() {
local device="${1}"
assert isset device
shift
list_sort ${addresses}
}
-function ipv6_implode() {
+ipv6_implode() {
local address=${1}
assert isset address
print "${ADDRESS6_IMPL}"
}
-function ipv6_explode() {
+ipv6_explode() {
local address=${1}
assert isset address
print "${ADDRESS6_EXPL}"
}
-function ipv6_addr_eq() {
+ipv6_addr_eq() {
local addr1=${1}
assert isset addr1
&& return ${EXIT_TRUE} || return ${EXIT_FALSE}
}
-function ipv6_addr_gt() {
+ipv6_addr_gt() {
local addr1=${1}
assert isset addr1
return ${EXIT_FALSE}
}
-function ipv6_hash() {
+ipv6_hash() {
local address=${1}
assert isset address
echo "${address//:/}"
}
-function ipv6_get_network() {
+ipv6_get_network() {
local addr=${1}
assert isset addr
print "${PREFIX6}/${prefix}"
}
-function ipv6_6rd_format_address() {
+ipv6_6rd_format_address() {
local isp_prefix="${1}"
assert ipv6_is_valid "${isp_prefix}"
print "${formatted_address}/${prefix}"
}
-function ipv6_6rd_format_client_address() {
+ipv6_6rd_format_client_address() {
local address="${1}"
assert isset address