# Functions for static routing.
#
-function route_init() {
+route_init() {
# Apply configured static routes.
route_apply
}
init_register route_init
-function route_add() {
+route_add() {
local ${NETWORK_CONFIG_ROUTES_PARAMS}
while [ $# -gt 0 ]; do
return ${EXIT_OK}
}
-function route_remove() {
+route_remove() {
local _network=${1}
assert isset _network
return ${EXIT_OK}
}
-function route_list() {
+route_list() {
local protocol
while [ $# -gt 0 ]; do
done < ${NETWORK_CONFIG_ROUTES}
}
-function route_find_duplicate() {
+route_find_duplicate() {
local _network=${1}
[ -r "${NETWORK_CONFIG_ROUTES}" ] || return ${EXIT_FALSE}
return ${EXIT_FALSE}
}
-function route_parse_line() {
+route_parse_line() {
local arg
# Reset all possible settings.
return ${EXIT_OK}
}
-function route_apply() {
+route_apply() {
local table="static"
local type
route_rule_add --lookup="static" --priority=1000
}
-function route_entry_add() {
+route_entry_add() {
local gateway
local network
local proto
cmd_quiet "${command}"
}
-function route_table_create() {
+route_table_create() {
local table=${1}
assert isset table
return ${EXIT_OK}
}
-function _route_table_next_id() {
+_route_table_next_id() {
# The Linux kernel is able to manage 255 routing tables (1-255).
# This function returns the next free id, starting from 255.
local next_id
return ${EXIT_FALSE}
}
-function route_table_flush() {
+route_table_flush() {
local protocol
local table
return ${EXIT_OK}
}
-function route_table_exists() {
+route_table_exists() {
local _id _table
while [ $# -gt 0 ]; do
return ${EXIT_FALSE}
}
-function route_rule_add() {
+route_rule_add() {
local priority
local protocols=${IP_SUPPORTED_PROTOCOLS}
local lookup
done
}
-function route_rule_exists() {
+route_rule_exists() {
local from
local lookup
local proto
return ${EXIT_FALSE}
}
-function _route_rule_exists_parse() {
+_route_rule_exists_parse() {
# Reset all variables.
_lookup=
_from=