]> git.ipfire.org Git - people/stevee/network.git/commitdiff
ports: Drop HOOK_SETTINGS variable
authorMichael Tremer <michael.tremer@ipfire.org>
Sat, 30 Mar 2019 13:14:56 +0000 (14:14 +0100)
committerMichael Tremer <michael.tremer@ipfire.org>
Sat, 30 Mar 2019 13:14:56 +0000 (14:14 +0100)
This does not need to be passed to the port_settings_* functions
any more which makes them more easy to use

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/hooks/ports/bonding
src/hooks/ports/dummy
src/hooks/ports/ethernet
src/hooks/ports/ip-tunnel
src/hooks/ports/vlan
src/hooks/ports/wireless-ap
src/hooks/ports/wireless-mesh

index 09fb74f0ad541c072ddbd5afb6e1e766a5acfe37..a0cf5c0bc5e1937495b2e0d5c6e4ad862f7ddd9a 100644 (file)
@@ -116,7 +116,7 @@ hook_new() {
        assert isset port
 
        # Save configuration
-       if port_settings_write "${port}" ${HOOK_SETTINGS[*]}; then
+       if port_settings_write "${port}"; then
                log INFO "New port ${port} has been created"
        else
                error "Could not save configuration for ${port}"
@@ -168,7 +168,7 @@ hook_create() {
        # Exit silently if the device already exists
        device_exists "${port}" && exit ${EXIT_OK}
 
-       port_settings_read "${port}" ${HOOK_SETTINGS[*]}
+       port_settings_read "${port}"
 
        # Create the bonding devices
        bonding_create "${port}" \
@@ -184,7 +184,7 @@ hook_remove() {
        local port="${1}"
        assert isset port
 
-       port_settings_read "${port}" ${HOOK_SETTINGS[*]}
+       port_settings_read "${port}"
 
        # Remove the bonding device
        if device_exists "${port}"; then
@@ -196,7 +196,7 @@ hook_up() {
        local port="${1}"
        assert isset port
 
-       port_settings_read "${port}" ${HOOK_SETTINGS[*]}
+       port_settings_read "${port}"
 
        # Auto-enable or disable hardware offloading
        if ! isset OFFLOADING || enabled OFFLOADING; then
@@ -219,7 +219,7 @@ hook_down() {
        local port="${1}"
        assert isset port
 
-       port_settings_read "${port}" ${HOOK_SETTINGS[*]}
+       port_settings_read "${port}"
 
        # Bring down all slaves
        local slave
@@ -240,7 +240,7 @@ hook_hotplug() {
                        # Handle events of the same interface
                        if hotplug_event_port_is_interface "${port}"; then
                                # Read configuration
-                               port_settings_read "${port}" ${HOOK_SETTINGS[*]}
+                               port_settings_read "${port}"
 
                                # Bring up all slaves
                                # Attach those which already exist and try to create
index 1c4b3c9fdd21260472f7c68b043645b9ea094532..387c88b560b3459f412ac9efbd3d1390fc3420e9 100644 (file)
@@ -62,7 +62,7 @@ hook_new() {
        local port=$(port_find_free ${DUMMY_PORT_PATTERN})
        assert isset port
 
-       if port_settings_write "${port}" ${HOOK_SETTINGS[*]}; then
+       if port_settings_write "${port}"; then
                log INFO "New dummy port '${port}' has been created"
        fi
 
@@ -74,7 +74,7 @@ hook_create() {
        assert isset port
 
        # Read configuration
-       port_settings_read "${port}" ${HOOK_SETTINGS[*]}
+       port_settings_read "${port}"
 
        # Create the dummy device
        dummy_create "${port}" "${ADDRESS}"
@@ -117,7 +117,7 @@ hook_hotplug_rename() {
        local device=${2}
        assert isset device
 
-       port_settings_read "${port}" ${HOOK_SETTINGS[*]}
+       port_settings_read "${port}"
 
        if [ "${ADDRESS}" = "$(device_get_address ${device})" ]; then
                log DEBUG "Device '${device}' equals port '${port}'."
index f3e3f9fdf9baade9c92284e17318b424671fd0ad..5f76e1588baf1ed80a6dae1e8bed8ff4bd87dd43 100644 (file)
@@ -117,7 +117,7 @@ hook_new() {
 
        local DEVICE="$(device_get_address "${device}")"
 
-       if ! port_settings_write "${port}" ${HOOK_SETTINGS[*]}; then
+       if ! port_settings_write "${port}"; then
                log ERROR "Could not write settings for port ${port}"
                return ${EXIT_ERROR}
        fi
@@ -133,7 +133,7 @@ hook_up() {
        local port="${1}"
 
        local ${HOOK_SETTINGS[*]}
-       if ! port_settings_read "${port}" ${HOOK_SETTINGS[*]}; then
+       if ! port_settings_read "${port}"; then
                log ERROR "Could not read settings for port ${port}"
                return ${EXIT_ERROR}
        fi
@@ -180,7 +180,7 @@ hook_hotplug_rename() {
        assert isset device
 
        # Read in the conifguration file.
-       port_settings_read "${port}" ${HOOK_SETTINGS[*]}
+       port_settings_read "${port}"
 
        # Get the current MAC address of the device.
        local address=$(device_get_address ${device})
index b4269636814d6f78cb6c8f8bff5f01d8c75e056f..fa7193ca1566b92513032e6d05e94d5a5e05dfe0 100644 (file)
@@ -115,7 +115,7 @@ hook_create() {
        assert isset port
 
        local ${HOOK_SETTINGS[*]}
-       if ! port_settings_read "${port}" ${HOOK_SETTINGS[*]}; then
+       if ! port_settings_read "${port}"; then
                log ERROR "Could not read settings for port ${port}"
                return ${EXIT_ERROR}
        fi
@@ -153,7 +153,7 @@ hook_hotplug_rename() {
        assert isset device
 
        local ${HOOK_SETTINGS[*]}
-       if ! port_settings_read "${port}" ${HOOK_SETTINGS[*]}; then
+       if ! port_settings_read "${port}"; then
                log ERROR "Could not read settings for port ${port}"
                return ${EXIT_ERROR}
        fi
index e9aa5454848dc2e2ece6b8f97ab31954a2d0e54e..f5119864131d89e2ea5c1c91dbe8064fcb7e9031 100644 (file)
@@ -72,7 +72,7 @@ hook_new() {
 
        local port="${PARENT_DEVICE}${VLAN_PORT_INTERFIX}${TAG}"
 
-       port_settings_write "${port}" ${HOOK_SETTINGS[*]}
+       port_settings_write "${port}"
 
        exit ${EXIT_OK}
 }
@@ -82,7 +82,7 @@ hook_edit() {
        assert isset port
        shift
 
-       port_settings_read "${port}" ${HOOK_SETTINGS[*]}
+       port_settings_read "${port}"
 
        while [ $# -gt 0 ]; do
                case "${1}" in
@@ -96,7 +96,7 @@ hook_edit() {
                shift
        done
 
-       port_settings_write "${port}" ${HOOK_SETTINGS[*]}
+       port_settings_write "${port}"
 
        exit ${EXIT_OK} 
 }
@@ -108,7 +108,7 @@ hook_create() {
        device_exists "${port}" && exit ${EXIT_OK}
 
        # Read configruation
-       port_settings_read "${port}" ${HOOK_SETTINGS[*]}
+       port_settings_read "${port}"
 
        # Create the VLAN device
        vlan_create "${port}" "${PARENT_DEVICE}" "${TAG}" "${ADDRESS}"
index 8d495d2863c94f09ee58e0f64b44e2adba49e0ac..e393f5f763959f256ad5d985a033ad841b790f01 100644 (file)
@@ -197,7 +197,7 @@ hook_create() {
 
        device_exists "${port}" && exit ${EXIT_OK}
 
-       port_settings_read "${port}" ${HOOK_SETTINGS[*]}
+       port_settings_read "${port}"
 
        # Check if the PHY is present.
        local phy=$(phy_get ${PHY})
index 306263dc7a9ecb657b8d0b52178b903cd01e7a2c..35f0950bce37ef84fd90830a0f4440587add3876 100644 (file)
@@ -90,7 +90,7 @@ hook_create() {
        assert isset port
 
        # Read settings
-       port_settings_read "${port}" ${HOOK_SETTINGS[*]}
+       port_settings_read "${port}"
 
        # Check if the PHY is present.
        local phy="$(phy_get "${PHY}")"
@@ -149,7 +149,7 @@ hook_hotplug() {
        local port="${1}"
        assert isset port
 
-       port_settings_read "${port}" ${HOOK_SETTINGS[*]}
+       port_settings_read "${port}"
 
        case "$(hotplug_action)" in
                add)