From: Michael Tremer Date: Sat, 2 May 2015 20:06:03 +0000 (+0000) Subject: Replace routing_db_* by db_* X-Git-Tag: 007~31^2~3 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=c041b631fc6b58e9f9559559d8768856c8825dce;p=network.git Replace routing_db_* by db_* db_* is an extremely simple and volatile key-value database that can be used to store things at runtime. --- diff --git a/src/dhclient-script b/src/dhclient-script index 5a6e8a39..5c22539f 100644 --- a/src/dhclient-script +++ b/src/dhclient-script @@ -60,15 +60,15 @@ case "${reason}" in --valid-lifetime="${new_max_life}" --preferred-lifetime="${new_preferred_life}" # Save configuration - routing_db_set "${interface}" "ipv6" "local-ip-address" "${new_ip6_address}/${new_ip6_prefixlen}" - routing_db_set "${interface}" "ipv6" "active" 1 - #routing_db_set "${interface}" "ipv6" "domain-name" "${new_ + db_set "${interface}/ipv6/local-ip-address" "${new_ip6_address}/${new_ip6_prefixlen}" + db_set "${interface}/ipv6/active" 1 + #db_set "${interface}/ipv6/domain-name" "${new_ exit 0 # Handle Prefix Delegation elif isset new_ip6_prefix; then - routing_db_set "${interface}" "ipv6" "delegated-prefix" "${new_ip6_prefix}" + db_set "${interface}/ipv6/delegated-prefix" "${new_ip6_prefix}" exit 0 fi @@ -80,7 +80,7 @@ case "${reason}" in if isset new_ip6_address && isset new_ip6_prefixlen; then # Update nameservers if those have changed if [[ "${old_dhcp6_name_servers}" != "${new_dhcp6_name_servers}" ]]; then - routing_db_set "${interface}" "ipv6" "domain-name-servers" "${new_dhcp6_name_servers}" + db_set "${interface}/ipv6/domain-name-servers" "${new_dhcp6_name_servers}" dns_generate_resolvconf fi @@ -97,6 +97,10 @@ case "${reason}" in ipv6_address_del "${old_ip6_address}/${old_ip6_prefixlen}" "${interface}" fi + # Update the database + db_set "${interface}/ipv6/local-ip-address" \ + "${new_ip6_address}/${new_ip6_prefixlen}" + # Add the new one ipv6_address_add "${new_ip6_address}/${new_ip6_prefixlen}" "${interface}" \ --valid-lifetime="${new_max_life}" --preferred-lifetime="${new_preferred_life}" @@ -111,7 +115,7 @@ case "${reason}" in fi log DEBUG "The delegated prefix has changed from ${old_ip6_prefix} to ${new_ip6_prefix}" - routing_db_set "${interface}" "ipv6" "delegated-prefix" "${new_ip6_prefix}" + db_set "${interface}/ipv6/delegated-prefix" "${new_ip6_prefix}" exit ${EXIT_OK} fi @@ -202,13 +206,16 @@ case "${reason}" in fi # Save configuration - routing_db_set ${interface} ipv4 type "ipv4-dhcp" - routing_db_set ${interface} ipv4 local-ip-address "${new_ip_address}/${new_prefix}" - routing_db_set ${interface} ipv4 remote-ip-address "${new_routers}" - routing_db_set ${interface} ipv4 active 1 - routing_db_set ${interface} ipv4 domain-name "${new_domain_name}" - routing_db_set ${interface} ipv4 domain-name-servers "${new_domain_name_servers}" - routing_db_set ${interface} ipv4 domain-name-servers-priority "${DNS_SERVER_DYNAMIC_PRIORITY}" + db_set "${interface}/ipv4/type" "ipv4-dhcp" + db_set "${interface}/ipv4/local-ip-address" \ + "${new_ip_address}/${new_prefix}" + db_set "${interface}/ipv4/remote-ip-address" "${new_routers}" + db_set "${interface}/ipv4/active" 1 + db_set "${interface}/ipv4/domain-name" "${new_domain_name}" + db_set "${interface}/ipv4/domain-name-servers" \ + "${new_domain_name_servers}" + db_set "${interface}/ipv4/domain-name-servers-priority" \ + "${DNS_SERVER_DYNAMIC_PRIORITY}" # Update the routing tables. routing_update ${interface} ipv4 @@ -229,7 +236,7 @@ case "${reason}" in ipv4_flush_device ${interface} fi - routing_db_remove ${interface} ipv4 + db_delete "${interface}/ipv4" routing_default_update exit 0 diff --git a/src/functions/functions.constants b/src/functions/functions.constants index 4233f76f..eb7fe7d4 100644 --- a/src/functions/functions.constants +++ b/src/functions/functions.constants @@ -30,6 +30,7 @@ PPP_SECRETS=/etc/ppp/secrets # Network directory configuration. NETWORK_CONFIG_DIR="/etc/network" +NETWORK_DB_DIR="${RUN_DIR}/db" NETWORK_ZONE_DIR="${NETWORK_CONFIG_DIR}" NETWORK_HOOKS_DIR=/usr/lib/network/hooks diff --git a/src/functions/functions.db b/src/functions/functions.db index 251832cf..16f38626 100644 --- a/src/functions/functions.db +++ b/src/functions/functions.db @@ -19,6 +19,111 @@ # # ############################################################################### +_db_key2path() { + local key="${1}" + assert isset key + + print "${NETWORK_DB_DIR}/${key}" +} + +db_exists() { + local key="${1}" + + local path="$(_db_key2path "${key}")" + + if [ -e "${path}" ]; then + return ${EXIT_TRUE} + fi + + return ${EXIT_FALSE} +} + +db_get() { + local key="${1}" + + local path="$(_db_key2path "${key}")" + fread "${path}" +} + +db_set() { + local key="${1}" + shift + + local value="$@" + local path="$(_db_key2path "${key}")" + + if [ -r "${path}" ]; then + log DEBUG "Setting '${key}' = '${value}'" + else + log DEBUG "Adding '${key}' = '${value}'" + fi + + make_parent_dir "${path}" + print "${value}" > "${path}" +} + +db_delete() { + local key="${1}" + + local path="$(_db_key2path "${key}")" + + log DEBUG "Deleting key = '${key}'" + + if [ -d "${path}" ]; then + _db_delete_recursive "${path}" + fi + + rm -f - "${path}" +} + +_db_delete_recursive() { + local path="${1}" + + local key + for key in $(_db_list_path "${path}"); do + db_delete "${key}" + done + + rmdir "${path}" +} + +db_dump() { + _db_dump_recursive "${NETWORK_DB_DIR}" +} + +_db_dump_key() { + local key="${1}" + local val="$(db_get "${key}")" + + printf "%-38s = %s\n" "${key}" "${val}" +} + +_db_dump_recursive() { + local path="${1}" + + local key + for key in $(_db_list_path "${path}"); do + path="$(_db_key2path "${key}")" + + if [ -d "${path}" ]; then + _db_dump_recursive "${path}" + else + _db_dump_key "${key}" + fi + done +} + +_db_list_path() { + local path="${1}" + + local element + for element in ${path}/*; do + [ -e "${element}" ] || continue + + print "${element#${NETWORK_DB_DIR}/}" + done +} + db_connection_init() { if [ -e "${DB_CONNECTION_FILE}" ]; then return ${EXIT_OK} diff --git a/src/functions/functions.dhcpd b/src/functions/functions.dhcpd index a3fd9060..05e79522 100644 --- a/src/functions/functions.dhcpd +++ b/src/functions/functions.dhcpd @@ -1032,7 +1032,7 @@ _dhcpd_search_routers() { local zone addr for zone in $(zones_get_all); do - addr=$(routing_db_get ${zone} ${proto} local-ip-address) + addr="$(db_get "${zone}/${proto}/local-ip-address")" isset addr || continue if ipv4_in_subnet ${addr} ${subnet}; then diff --git a/src/functions/functions.dns b/src/functions/functions.dns index b3f42fd0..de08c4c7 100644 --- a/src/functions/functions.dns +++ b/src/functions/functions.dns @@ -269,7 +269,7 @@ dns_get_search_domains() { for zone in $(zones_get_all); do for proto in ${IP_SUPPORTED_PROTOCOLS}; do - domain=$(routing_db_get ${zone} ${proto} domain-name) + domain="$(db_get "${zone}/${proto}/domain-name")" isset domain || continue list_append search_domains "${domainname}" @@ -285,10 +285,10 @@ dns_server_get_zone_name_servers() { for zone in $(zones_get_all); do for proto in ${IP_SUPPORTED_PROTOCOLS}; do - priority=$(routing_db_get ${zone} ${proto} domain-name-servers-priority) + priority="$(db_get "${zone}/${proto}/domain-name-servers-priority")" isset priority || priority="${DNS_SERVER_DYNAMIC_PRIORITY}" - servers=$(routing_db_get ${zone} ${proto} domain-name-servers) + servers="$(db_get "${zone}/${proto}/domain-name-servers")" for server in ${servers}; do print "${priority} ${server}" done diff --git a/src/functions/functions.ppp b/src/functions/functions.ppp index 92ff3536..0840467c 100644 --- a/src/functions/functions.ppp +++ b/src/functions/functions.ppp @@ -275,7 +275,8 @@ ppp_common_ipv4_up() { return ${EXIT_ERROR} fi - routing_db_set ${zone} ipv4 active 1 + db_set "${zone}/ipv4/active" 1 + routing_update ${zone} ipv4 routing_default_update @@ -293,7 +294,8 @@ ppp_common_ipv4_down() { # Remove the information about this zone from the routing database # and update the routing table. - routing_db_remove ${zone} ipv4 + db_delete "${zone}/ipv4" + routing_update ${zone} ipv4 routing_default_update @@ -315,7 +317,8 @@ ppp_common_ipv6_up() { # Add information about this zone to the routing database. routing_db_from_ppp ${zone} ipv6 - routing_db_set ${zone} ipv6 active 1 + db_set "${zone}/ipv6/active" 1 + routing_update ${zone} ipv6 routing_default_update @@ -333,7 +336,8 @@ ppp_common_ipv6_down() { # Remove the information about this zone from the routing database # and update the routing table. - routing_db_remove ${zone} ipv6 + db_delete "${zone}/ipv6" + routing_update ${zone} ipv6 routing_default_update diff --git a/src/functions/functions.radvd b/src/functions/functions.radvd index 21fd1e47..1a47b758 100644 --- a/src/functions/functions.radvd +++ b/src/functions/functions.radvd @@ -50,16 +50,16 @@ __radvd_config_interface() { # If the interface does not provide any routing information, # we can skip this whole stuff. - if ! routing_db_exists ${zone} ipv6; then + if ! db_exists "${zone}/ipv6"; then return ${EXIT_OK} fi # Skip if zone is not active. - local active=$(routing_db_get ${zone} ipv6 active) + local active="$(db_get "${zone}/ipv6/active")" [ "${active}" = "0" ] && return ${EXIT_OK} # Skip if there is no prefix or prefix is link-local. - local addr=$(routing_db_get ${zone} ipv6 local-ip-address) + local addr="$(db_get "${zone}/ipv6/local-ip-address")" if [ -z "${addr}" ] || [ "${addr:0:5}" = "fe80:" ]; then return ${EXIT_OK} fi diff --git a/src/functions/functions.routing b/src/functions/functions.routing index d65506aa..0674cbd2 100644 --- a/src/functions/functions.routing +++ b/src/functions/functions.routing @@ -45,10 +45,10 @@ routing_default_update() { for zone in ${zones}; do # Skip if zone is not up - routing_db_exists ${zone} ${proto} || continue + db_exists "${zone}/${proto}" || continue - if [ "$(routing_db_get ${zone} ${proto} active)" = "1" ]; then - gateway=$(routing_db_get ${zone} ${proto} remote-ip-address) + if [ "$(db_get "${zone}/${proto}/active")" = "1" ]; then + gateway="$(db_get "${zone}/${proto}/remote-ip-address")" # Go on if the device is not there anymore. device_exists ${zone} || continue @@ -68,7 +68,7 @@ routing_default_update() { fi # Apply weight. - weight=$(routing_db_get ${zone} ${proto} weight) + weight="$(db_get "${zone}/${proto}/weight")" if isinteger ${weight}; then routes="${routes} weight ${weight}" fi @@ -114,55 +114,6 @@ routing_table_create() { route_table_create $@ } -routing_db_path() { - local zone=${1} - local proto=${2} - - assert isset zone - assert isset proto - assert isoneof proto ${IP_SUPPORTED_PROTOCOLS} - - echo "${ROUTING_DB_DIR}/${zone}/${proto}" -} - -routing_db_exists() { - [ -d "$(routing_db_path $@)" ] -} - -routing_db_create() { - routing_db_exists $@ && return ${EXIT_OK} - - mkdir -p $(routing_db_path $@) -} - -routing_db_remove() { - rm -rf $(routing_db_path $@) -} - -routing_db_set() { - local zone=${1} - local proto=${2} - local parameter=${3} - shift 3 - - local value="$@" - - log INFO "Updating database (${zone} - ${proto}): ${parameter} = ${value}" - - routing_db_create ${zone} ${proto} - - echo "${value}" > $(routing_db_path ${zone} ${proto})/${parameter} -} - -routing_db_get() { - local zone=${1} - local proto=${2} - local parameter=${3} - shift 3 - - cat $(routing_db_path ${zone} ${proto})/${parameter} 2>/dev/null -} - routing_db_from_ppp() { local zone=${1} local proto=${2} @@ -171,19 +122,27 @@ routing_db_from_ppp() { assert isset proto # Save ppp configuration - routing_db_set ${zone} ${proto} type "ppp" + db_set "${zone}/${proto}/type" "ppp" if [ "${proto}" = "ipv6" ]; then - routing_db_set ${zone} ${proto} local-ip-address ${PPP_LLLOCAL} - routing_db_set ${zone} ${proto} remote-ip-address ${PPP_LLREMOTE} + db_set "${zone}/${proto}/local-ip-address" "${PPP_LLLOCAL}" + db_set "${zone}/${proto}/remote-ip-address" "${PPP_LLREMOTE}" elif [ "${proto}" = "ipv4" ]; then - routing_db_set ${zone} ${proto} local-ip-address ${PPP_IPLOCAL} - routing_db_set ${zone} ${proto} remote-ip-address ${PPP_IPREMOTE} + db_set "${zone}/${proto}/local-ip-address" "${PPP_IPLOCAL}" + db_set "${zone}/${proto}/remote-ip-address" "${PPP_IPREMOTE}" fi - routing_db_set ${zone} ${proto} dns ${PPP_DNS1} ${PPP_DNS2} + # Save the transmitted DNS servers + if isset PPP_DNS1 || isset PPP_DNS2; then + db_set "${zone}/${proto}/domain-name-servers" "${PPP_DNS1} ${PPP_DNS2}" + else + db_set "${zone}/${proto}/domain-name-servers" + fi - routing_db_set ${zone} ${proto} remote-address ${PPP_MACREMOTE,,} + # Save the MAC address of the remote DSLAM + if isset PPP_MACREMOTE; then + db_set "${zone}/${proto}/remote-address" "${PPP_MACREMOTE,,}" + fi } routing_update() { @@ -211,12 +170,12 @@ routing_update() { cmd ${ip_cmd} route flush table ${table} # Exit here if there is no routing information. - if ! routing_db_exists ${zone} ${proto}; then + if ! db_exists "${zone}/${proto}"; then return ${EXIT_OK} fi - local local_ip_address=$(routing_db_get ${zone} ${proto} local-ip-address) - local remote_ip_address=$(routing_db_get ${zone} ${proto} remote-ip-address) + local local_ip_address="$(db_get "${zone}/${proto}/local-ip-address")" + local remote_ip_address="$(db_get "${zone}/${proto}/remote-ip-address")" case "${proto}" in ipv4) diff --git a/src/functions/functions.util b/src/functions/functions.util index aff803a9..d26f519f 100644 --- a/src/functions/functions.util +++ b/src/functions/functions.util @@ -143,6 +143,13 @@ fwrite() { print "%s" "$@" >> ${file} 2>/dev/null } +make_parent_dir() { + local path="${1}" + + local dirname="$(dirname "${path}")" + mkdir -p "${dirname}" +} + enabled() { local param=${1} diff --git a/src/hooks/configs/ipv4-dhcp b/src/hooks/configs/ipv4-dhcp index ea78d096..c3fa5008 100644 --- a/src/hooks/configs/ipv4-dhcp +++ b/src/hooks/configs/ipv4-dhcp @@ -101,8 +101,8 @@ hook_status() { fi cli_statusline 3 "${HOOK}" "${status}" - cli_print_fmt1 3 "IPv4 address" "$(routing_db_get ${zone} ipv4 local-ip-address)" - local gateway=$(routing_db_get ${zone} ipv4 remote-ip-address) + cli_print_fmt1 3 "IPv4 address" "$(db_get "${zone}/ipv4/local-ip-address")" + local gateway="$(db_get "${zone}/ipv4/remote-ip-address")" if isset gateway; then cli_print_fmt1 3 "Gateway" "${gateway}" fi diff --git a/src/hooks/configs/ipv4-static b/src/hooks/configs/ipv4-static index f8a21b83..7c9d94f9 100644 --- a/src/hooks/configs/ipv4-static +++ b/src/hooks/configs/ipv4-static @@ -127,10 +127,10 @@ hook_up() { ip_address_add ${zone} ${ADDRESS}/${PREFIX} # Save configuration - routing_db_set ${zone} ipv4 type "${HOOK}" - routing_db_set ${zone} ipv4 local-ip-address "${ADDRESS}/${PREFIX}" - routing_db_set ${zone} ipv4 remote-ip-address "${GATEWAY}" - routing_db_set ${zone} ipv4 active 1 + db_set "${zone}/ipv4/type" "${HOOK}" + db_set "${zone}/ipv4/local-ip-address" "${ADDRESS}/${PREFIX}" + db_set "${zone}/ipv4/remote-ip-address" "${GATEWAY}" + db_set "${zone}/ipv4/active" 1 routing_update ${zone} ipv4 routing_default_update diff --git a/src/hooks/configs/ipv6-dhcp b/src/hooks/configs/ipv6-dhcp index 29a5f792..1ea78b54 100644 --- a/src/hooks/configs/ipv6-dhcp +++ b/src/hooks/configs/ipv6-dhcp @@ -84,8 +84,8 @@ hook_status() { fi cli_statusline 3 "${HOOK}" "${status}" - cli_print_fmt1 3 "IPv6 address" "$(routing_db_get "${zone}" "ipv6" "local-ip-address")" - local gateway=$(routing_db_get ${zone} ipv6 remote-ip-address) + cli_print_fmt1 3 "IPv6 address" "$(db_get "${zone}/ipv6/local-ip-address")" + local gateway="$(db_get "${zone}/ipv6/remote-ip-address")" if isset gateway; then cli_print_fmt1 3 "Gateway" "${gateway}" fi diff --git a/src/hooks/configs/ipv6-static b/src/hooks/configs/ipv6-static index f4f9ddf4..adb4ddf6 100644 --- a/src/hooks/configs/ipv6-static +++ b/src/hooks/configs/ipv6-static @@ -78,9 +78,10 @@ hook_up() { ip_address_add ${zone} ${ADDRESS}/${PREFIX} - routing_db_set ${zone} ipv6 local-ip-address ${ADDRESS}/${PREFIX} - routing_db_set ${zone} ipv6 remote-ip-address ${GATEWAY} - routing_db_set ${zone} ipv6 active 1 + db_set "${zone}/ipv6/local-ip-address" "${ADDRESS}/${PREFIX}" + db_set "${zone}/ipv6/remote-ip-address" "${GATEWAY}" + db_set "${zone}/ipv6/active" 1 + routing_default_update exit ${EXIT_OK} @@ -97,7 +98,7 @@ hook_down() { fi # Remove routing information from database. - routing_db_remove ${zone} ipv6 + db_delete "${zone}/ipv6" zone_config_settings_read "${zone}" "${config}" ${HOOK_SETTINGS} diff --git a/src/hooks/zones/6rd b/src/hooks/zones/6rd index 6ab94ad9..c8509f3a 100644 --- a/src/hooks/zones/6rd +++ b/src/hooks/zones/6rd @@ -117,10 +117,10 @@ hook_up() { device_set_up "${zone}" # Update routing information. - routing_db_set "${zone}" ipv6 "type" "${HOOK}" - routing_db_set "${zone}" ipv6 "local-ip-address" "::${LOCAL_ADDRESS}" - routing_db_set "${zone}" ipv6 "remote-ip-address" "::${SERVER_ADDRESS}" - routing_db_set "${zone}" ipv6 "active" 1 + db_set "${zone}/ipv6/type" "${HOOK}" + db_set "${zone}/ipv6/local-ip-address" "::${LOCAL_ADDRESS}" + db_set "${zone}/ipv6/remote-ip-address" "::${SERVER_ADDRESS}" + db_set "${zone}/ipv6/active" 1 # Update the routing database. routing_update ${zone} ipv6 @@ -134,7 +134,8 @@ hook_down() { assert isset zone # Remove everything from the routing db. - routing_db_remove ${zone} ipv6 + db_delete "${zone}/ipv6" + routing_update ${zone} ipv6 routing_default_update diff --git a/src/hooks/zones/6to4-tunnel b/src/hooks/zones/6to4-tunnel index fb8c449b..2a200e05 100644 --- a/src/hooks/zones/6to4-tunnel +++ b/src/hooks/zones/6to4-tunnel @@ -124,9 +124,9 @@ hook_up() { ip_address_add ${zone} ${LOCAL_ADDRESS6} # Update routing information. - routing_db_set ${zone} ipv6 type "${HOOK}" - routing_db_set ${zone} ipv6 local-ip-address "${LOCAL_ADDRESS6}" - routing_db_set ${zone} ipv6 active 1 + db_set "${zone}/ipv6/type" "${HOOK}" + db_set "${zone}/ipv6/local-ip-address" "${LOCAL_ADDRESS6}" + db_set "${zone}/ipv6/active" 1 # Update the routing database. routing_update ${zone} ipv6 @@ -140,7 +140,8 @@ hook_down() { assert isset zone # Remove everything from the routing db. - routing_db_remove ${zone} ipv6 + db_delete "${zone}/ipv6" + routing_update ${zone} ipv6 routing_default_update diff --git a/src/hooks/zones/modem b/src/hooks/zones/modem index db5e309d..0223767d 100644 --- a/src/hooks/zones/modem +++ b/src/hooks/zones/modem @@ -239,7 +239,7 @@ hook_status() { cli_headline 2 "Point-to-Point-over-Ethernet protocol" local proto for proto in ${IP_SUPPORTED_PROTOCOLS}; do - routing_db_exists ${zone} ${proto} || continue + db_exists "${zone}/${proto}" || continue local headline case "${proto}" in @@ -255,9 +255,9 @@ hook_status() { esac cli_headline 3 "${headline}" - cli_print_fmt1 3 "IP address" "$(routing_db_get ${zone} ${proto} local-ip-address)" - cli_print_fmt1 3 "Gateway" "$(routing_db_get ${zone} ${proto} remote-ip-address)" - cli_print_fmt1 3 "DNS servers" "$(routing_db_get ${zone} ${proto} dns)" + cli_print_fmt1 3 "IP address" "$(db_get "${zone}/${proto}/local-ip-address")" + cli_print_fmt1 3 "Gateway" "$(db_get "${zone}/${proto}/remote-ip-address")" + cli_print_fmt1 3 "DNS servers" "$(db_get "${zone}/${proto}/domain-name-servers")" cli_space done diff --git a/src/hooks/zones/pppoe b/src/hooks/zones/pppoe index b2d0a950..717d4b1c 100644 --- a/src/hooks/zones/pppoe +++ b/src/hooks/zones/pppoe @@ -228,7 +228,7 @@ hook_status() { cli_headline 2 "Point-to-Point-over-Ethernet protocol" local proto for proto in ${IP_SUPPORTED_PROTOCOLS}; do - routing_db_exists ${zone} ${proto} || continue + db_exists "${zone}/${proto}" || continue local headline case "${proto}" in @@ -244,11 +244,11 @@ hook_status() { esac cli_headline 3 "${headline}" - cli_print_fmt1 3 "IP address" "$(routing_db_get ${zone} ${proto} local-ip-address)" - cli_print_fmt1 3 "Gateway" "$(routing_db_get ${zone} ${proto} remote-ip-address)" - cli_print_fmt1 3 "DNS servers" "$(routing_db_get ${zone} ${proto} dns)" + cli_print_fmt1 3 "IP address" "$(db_get "${zone}/${proto}/local-ip-address")" + cli_print_fmt1 3 "Gateway" "$(db_get "${zone}/${proto}/remote-ip-address")" + cli_print_fmt1 3 "DNS servers" "$(db_get "${zone}/${proto}/dns")" cli_space - cli_print_fmt1 3 "MAC-Remote" "$(routing_db_get ${zone} ${proto} remote-address)" + cli_print_fmt1 3 "MAC-Remote" "$(db_get "${zone}/${proto}/remote-address")" cli_space done diff --git a/src/network b/src/network index e5a71db9..b7c7444a 100644 --- a/src/network +++ b/src/network @@ -1248,6 +1248,9 @@ cli_raw() { shift case "${cmd}" in + db-dump) + db_dump + ;; list-devices) device_list ;;