mirror of
https://dev.iopsys.eu/feed/iopsys.git
synced 2025-12-10 07:44:50 +01:00
map-agent: issue topology discovery over vlan interfaces upon port up
This commit is contained in:
parent
abc2c6c233
commit
2778420bcd
1 changed files with 29 additions and 5 deletions
|
|
@ -12,11 +12,35 @@ rc="$?"
|
|||
|
||||
[ "$rc" != 0 ] && exit 1
|
||||
|
||||
res=$(ubus -t5 call ieee1905 buildcmdu "{\"type\":0, \"ifname\":\"$PORT\"}")
|
||||
issue_discovery() {
|
||||
local iface="$1"
|
||||
|
||||
json_load "$res" > /dev/console 2>&1
|
||||
json_get_var data data
|
||||
res=$(ubus -t5 call ieee1905 buildcmdu "{\"type\":0, \"ifname\":\"${iface}\"}")
|
||||
json_load "$res" > /dev/null 2>&1
|
||||
json_get_var data data
|
||||
|
||||
[ "$data" == "" ] && exit 1
|
||||
[ "$data" == "" ] && return
|
||||
|
||||
ubus call ieee1905 cmdu "{\"dst\":\"01:80:c2:00:00:13\", \"type\":0, \"data\":\"${data}\"}"
|
||||
ubus call ieee1905 cmdu "{\"dst\":\"01:80:c2:00:00:13\", \"type\":0, \"data\":\"${data}\"}"
|
||||
}
|
||||
|
||||
process_vlans() {
|
||||
section="$1"
|
||||
|
||||
config_get ifname "$section" ifname
|
||||
config_get name "$section" name
|
||||
|
||||
[ "$2" == "$ifname" ] || return
|
||||
[ "$name" == "" ] && return
|
||||
|
||||
issue_discovery $name
|
||||
|
||||
json_cleanup
|
||||
}
|
||||
|
||||
# find and publish over any vlans
|
||||
config_load network
|
||||
config_foreach process_vlans interface $PORT
|
||||
config_foreach process_vlans device $PORT
|
||||
|
||||
issue_discovery $PORT
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue