json_select ..
}
+ucidef_set_compat_version() {
+ json_select_object system
+ json_add_string compat_version "${1:-1.0}"
+ json_select ..
+}
+
ucidef_set_interface_lan() {
ucidef_set_interface "lan" ifname "$1" protocol "${2:-static}"
}
ucidef_set_interface_wan "$wan_if"
}
+ucidef_set_bridge_device() {
+ json_add_string bridge "${1:switch0}"
+}
+
_ucidef_add_switch_port() {
# inherited: $num $device $need_tag $want_untag $role $index $prev_role
# inherited: $n_cpu $n_ports $n_vlan $cpu0 $cpu1 $cpu2 $cpu3 $cpu4 $cpu5
done
}
+ucidef_set_ar8xxx_switch_mib() {
+ local name="$1"
+ local type="$2"
+ local interval="$3"
+
+ json_select_object switch
+ json_select_object "$name"
+ json_add_int ar8xxx_mib_type $type
+ json_add_int ar8xxx_mib_poll_interval $interval
+ json_select ..
+ json_select ..
+}
+
ucidef_add_switch() {
local name="$1"; shift
local port num role device index need_tag prev_role
ucidef_set_interface "$network" macaddr "$macaddr"
}
+ucidef_set_label_macaddr() {
+ local macaddr="$1"
+
+ json_select_object system
+ json_add_string label_macaddr "$macaddr"
+ json_select ..
+}
+
ucidef_add_atm_bridge() {
local vpi="$1"
local vci="$2"
}
ucidef_set_led_ide() {
- _ucidef_set_led_trigger "$1" "$2" "$3" ide-disk
+ _ucidef_set_led_trigger "$1" "$2" "$3" disk-activity
}
ucidef_set_led_netdev() {
local trigger_name="$4"
local port_mask="$5"
local speed_mask="$6"
+ local mode="$7"
_ucidef_set_led_common "$1" "$2" "$3"
json_add_string trigger "$trigger_name"
json_add_string type switch
+ json_add_string mode "$mode"
json_add_string port_mask "$port_mask"
json_add_string speed_mask "$speed_mask"
json_select ..
_ucidef_set_led_common "$1" "$2" "$3"
+ json_add_string type "$trigger_name"
json_add_string trigger "$trigger_name"
json_add_int delayon "$delayon"
json_add_int delayoff "$delayoff"
json_select_object gpioswitch
json_select_object "$cfg"
json_add_string name "$name"
- json_add_int pin "$pin"
+ json_add_string pin "$pin"
json_add_int default "$default"
json_select ..
json_select ..
}
board_config_flush() {
- json_dump -i > /tmp/.board.json
- mv /tmp/.board.json ${CFG}
+ json_dump -i -o ${CFG}
}