]> git.ipfire.org Git - people/stevee/network.git/blobdiff - src/hooks/ports/ethernet
Split port hooks in to (create|remove|up|down) actions
[people/stevee/network.git] / src / hooks / ports / ethernet
index d02884667325bc441f9b169a6870eec95e1a5416..fca74ae71ed272bccf201d437e79b988e04ba722 100644 (file)
@@ -34,7 +34,7 @@ function hook_check() {
        fi
 }
 
-function hook_create() {
+function hook_new() {
        local port=${1}
        assert isset port
        shift
@@ -47,36 +47,13 @@ function hook_create() {
        exit ${EXIT_OK}
 }
 
-function hook_up() {
-       local port=${1}
-       assert isset port
-
-       if ! device_exists "${port}"; then
-               log WARNING "Cannot bring up port '${port}' which does not exist"
-               exit ${EXIT_OK}
-       fi
-
-       # Read in the confguration file.
-       port_settings_read "${port}" ${HOOK_SETTINGS}
-
-       # Check if the MAC address is the right one.
-       if isset ADDRESS; then
-               device_set_address "${device}" "${ADDRESS}"
-       fi
-
-       # Bring up the device.
-       device_set_up "${port}"
-
+function hook_create() {
+       # Nothing to do here. Real ethernet devices cannot
+       # be created. They are just there.
        exit ${EXIT_OK}
 }
 
-function hook_down() {
-       local port=${1}
-       assert isset port
-
-       # Set down the device.
-       device_set_down ${port}
-
+function hook_remove() {
        exit ${EXIT_OK}
 }