projects
/
project
/
netifd.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
proto: add an option for specifying external addresses using proto_apply_ip_settings()
[project/netifd.git]
/
dummy
/
netifd-proto.sh
diff --git
a/dummy/netifd-proto.sh
b/dummy/netifd-proto.sh
index
e61de46
..
b04bc89
100755
(executable)
--- a/
dummy/netifd-proto.sh
+++ b/
dummy/netifd-proto.sh
@@
-28,14
+28,14
@@
add_default_handler() {
_proto_do_teardown() {
json_load "$data"
_proto_do_teardown() {
json_load "$data"
- eval "$1_teardown \"$interface\" \"$ifname\""
+ eval "
proto_
$1_teardown \"$interface\" \"$ifname\""
}
_proto_do_setup() {
json_load "$data"
_EXPORT_VAR=0
_EXPORT_VARS=
}
_proto_do_setup() {
json_load "$data"
_EXPORT_VAR=0
_EXPORT_VARS=
- eval "$1_setup \"$interface\" \"$ifname\""
+ eval "
proto_
$1_setup \"$interface\" \"$ifname\""
}
proto_init_update() {
}
proto_init_update() {
@@
-206,6
+206,15
@@
proto_block_restart() {
_proto_notify "$interface"
}
_proto_notify "$interface"
}
+proto_set_available() {
+ local interface="$1"
+ local state="$2"
+ json_init
+ json_add_int action 5
+ json_add_boolean available "$state"
+ _proto_notify "$interface"
+}
+
init_proto() {
proto="$1"; shift
cmd="$1"; shift
init_proto() {
proto="$1"; shift
cmd="$1"; shift
@@
-216,16
+225,15
@@
init_proto() {
no_device=0
available=0
no_device=0
available=0
- add_default_handler "$1_init_config"
+ add_default_handler "
proto_
$1_init_config"
json_init
json_add_string "name" "$1"
json_init
json_add_string "name" "$1"
- eval "$1_init"
- json_add_boolean no-device "$no_device"
- json_add_boolean available "$available"
json_add_array "config"
json_add_array "config"
- eval "$1_init_config"
+ eval "
proto_
$1_init_config"
json_close_array
json_close_array
+ json_add_boolean no-device "$no_device"
+ json_add_boolean available "$available"
json_dump
}
;;
json_dump
}
;;