From 95b96ee3a9f50f748b887487055ddacecea290c1 Mon Sep 17 00:00:00 2001 From: Michael Tremer Date: Sun, 25 Jul 2010 18:43:20 +0200 Subject: [PATCH] network: Change configuration variables of hook 'virtual' to make clearer what they do. --- hooks/ports/virtual | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/hooks/ports/virtual b/hooks/ports/virtual index 98786656..a8c7d49e 100755 --- a/hooks/ports/virtual +++ b/hooks/ports/virtual @@ -21,26 +21,26 @@ . /lib/network/header-port -HOOK_SETTINGS="HOOK DEVICE DEVICE_MAC DEVICE_VID" +HOOK_SETTINGS="HOOK ADDRESS PARENT TAG" -PORT_PARENTS_VAR="DEVICE" +PORT_PARENTS_VAR="PARENT" -DEVICE_MAC=$(mac_generate) +ADDRESS=$(mac_generate) function _check() { - assert isset DEVICE - assert ismac DEVICE_MAC - assert isinteger DEVICE_VID + assert isset PARENT + assert ismac ADDRESS + assert isinteger TAG - if [ ${DEVICE_VID} -gt 4096 ]; then - error "DEVICE_VID is greater than 4096." + if [ ${TAG} -gt 4096 ]; then + error "TAG is greater than 4096." exit ${EXIT_ERROR} fi local reserved for reserved in 0 4095; do - if [ "${DEVICE_VID}" = "${reserved}" ]; then - error "DEVICE_VID=${reserved} is reserved." + if [ "${TAG}" = "${reserved}" ]; then + error "TAG=${reserved} is reserved." exit ${EXIT_ERROR} fi done @@ -50,13 +50,13 @@ function _create() { while [ $# -gt 0 ]; do case "${1}" in --device=*) - DEVICE=${1#--device=} + PARENT=${1#--device=} ;; --mac=*) - DEVICE_MAC=${1#--mac=} + ADDRESS=${1#--mac=} ;; --id=*) - DEVICE_VID=${1#--id=} + TAG=${1#--id=} ;; *) warning "Unknown argument '${1}'" @@ -65,7 +65,7 @@ function _create() { shift done - local port="${DEVICE}v${DEVICE_VID}" + local port="${PARENT}v${TAG}" config_write $(port_file ${port}) ${HOOK_SETTINGS} @@ -83,7 +83,7 @@ function _edit() { while [ $# -gt 0 ]; do case "${1}" in --mac=*) - DEVICE_MAC=${1#--mac=} + ADDRESS=${1#--mac=} ;; *) warning "Unknown argument '${1}'" @@ -105,7 +105,7 @@ function _up() { config_read $(port_file ${port}) if ! device_exists ${port}; then - virtual_create ${DEVICE} ${DEVICE_VID} ${DEVICE_MAC} + virtual_create ${PARENT} ${TAG} ${ADDRESS} fi exit ${EXIT_OK} @@ -131,9 +131,9 @@ function _status() { local zone=${1} local port=${2} -config_read $(zone_dir ${zone})/${port} + config_read $(zone_dir ${zone})/${port} - local device=$(devicify ${DEVICE_MAC}) + local device=$(devicify ${ADDRESS}) printf " %-10s - " "${device}" if ! device_is_up ${device}; then -- 2.39.2