From 08c542cf6f1ced20ef44f22dc23c670162626e63 Mon Sep 17 00:00:00 2001 From: Rahul Date: Sun, 14 Jun 2020 14:34:50 +0530 Subject: [PATCH] mcastmngr: update stats param names, config l2l mcast - The parameters used for stats are updated. - Configuration support for lan to lan multicast via UCI added. --- .../etc/uci-defaults/61-mcast_config_generate | 1 + mcastmngr/files/lib/mcast/broadcom.sh | 16 +++++++++++----- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/mcastmngr/files/etc/uci-defaults/61-mcast_config_generate b/mcastmngr/files/etc/uci-defaults/61-mcast_config_generate index b43ae0d4d..0730235be 100644 --- a/mcastmngr/files/etc/uci-defaults/61-mcast_config_generate +++ b/mcastmngr/files/etc/uci-defaults/61-mcast_config_generate @@ -35,6 +35,7 @@ generate_mcast_config(){ uci set mcast.@proxy[-1].last_member_query_interval="10" uci set mcast.@proxy[-1].fast_leave="1" uci set mcast.@proxy[-1].snooping_mode="2" + uci set mcast.@proxy[-1].lan_to_lan="0" uci add_list mcast.@proxy[-1].downstream_interface="br-lan" IFS=" " diff --git a/mcastmngr/files/lib/mcast/broadcom.sh b/mcastmngr/files/lib/mcast/broadcom.sh index bceabdf0e..dc831de3f 100755 --- a/mcastmngr/files/lib/mcast/broadcom.sh +++ b/mcastmngr/files/lib/mcast/broadcom.sh @@ -81,6 +81,7 @@ read_snooping() { config_get igmp_s_mode "$config" snooping_mode 0 config_get igmp_s_iface "$config" interface config_get igmp_s_exceptions "$config" filter + config_get l_2_l_mcast "$config" lan_to_lan return fi @@ -91,6 +92,7 @@ read_snooping() { config_get mld_s_mode "$config" snooping_mode 0 config_get mld_s_iface "$config" interface config_get mld_s_exceptions "$config" filter + config_get l_2_l_mcast "$config" lan_to_lan return fi } @@ -119,6 +121,7 @@ read_proxy() { config_get igmp_p_up_interfaces "$config" upstream_interface config_get igmp_p_down_interfaces "$config" downstream_interface config_get igmp_p_exceptions "$config" filter + config_get l_2_l_mcast "$config" lan_to_lan return fi @@ -134,6 +137,7 @@ read_proxy() { config_get mld_p_up_interfaces "$config" upstream_interface config_get mld_p_down_interfaces "$config" downstream_interface config_get mld_p_exceptions "$config" filter + config_get l_2_l_mcast "$config" lan_to_lan return fi } @@ -499,19 +503,19 @@ read_mcast_stats() { if [ $grp_obj_added -eq 0 ]; then json_add_object "" gip="$(ipcalc.sh $gip_addr | grep IP | awk '{print substr($0,4)}')" - json_add_string "group_address" "$gip" - json_add_array "associated_devices" + json_add_string "groupaddr" "$gip" + json_add_array "clients" grp_obj_added=1 fi json_add_object "" host_ip="$(echo $line | awk -F ' ' '{ print $13 }')" h_ip="$(ipcalc.sh $host_ip | grep IP | awk '{print substr($0,4)}')" - json_add_string "host_address" "$h_ip" + json_add_string "ipaddr" "$h_ip" src_port="$(echo $line | awk -F ' ' '{ print $2 }')" - json_add_string "source_interface" "$src_port" + json_add_string "device" "$src_port" timeout="$(echo $line | awk -F ' ' '{ print $14 }')" - json_add_string "timeout" "$timeout" + json_add_int "timeout" "$timeout" json_close_object #close the associated device object ;; esac @@ -524,4 +528,6 @@ read_mcast_stats() { json_close_object # close the snooping object json_close_array # close the snooping array json_dump + + rm -f /tmp/igmp_stats }