Compare commits

...

32 Commits

Author SHA1 Message Date
Markus Gothe
af41f9d6d1 mcastmngr: Support hybrid proxying/snooping.
Support running mcproxy and snooping simultanous.
2024-10-17 16:23:43 +02:00
Lwithwma Brahma
ff7ec89ede mcastmngr: correct stats output
Corrected the read_mcast_stats function, to display
"ubus call mcast stats" correct output for multiple iptv bridges

Test:
"ubus call mcast stats" showing correct output for both single and multiple bridge.
2024-10-08 15:10:17 +02:00
Markus Gothe
b66ee7f63d Revert "R#34183 TR181: ubus call mcast stats not showing correct output for multiple snooping bridges"
This reverts commit d9c30a8e87.
2024-10-08 15:09:43 +02:00
Markus Gothe
5fa44e8d7d Reapply "iop: Enable support for capital characters in version."
This reverts commit e9f811f1ad.
2024-09-02 13:55:54 +02:00
Markus Gothe
bf90a6cd94 Revert "change qos queue section name"
This reverts commit e4be368914.
2024-09-01 19:33:15 +02:00
Markus Gothe
25bba31fba Revert "tree-wide: use OpenWrt way to define LAN/WAN ports"
This reverts commit 75ebeb9012.
2024-09-01 19:33:09 +02:00
Markus Gothe
75fb63a021 Revert "R#43734 - Increase max number of controllers in obuspa"
This reverts commit d5e6639aa2.
2024-08-30 15:58:08 +02:00
Markus Gothe
e9f811f1ad Revert "iop: Enable support for capital characters in version."
This reverts commit 4ab2f04b73.
2024-08-30 15:42:48 +02:00
Markus Gothe
abc771fa3e Revert "iop/Config.in: Add global CONFIG_VERSION_WITH_DATE."
This reverts commit 9477208611.
2024-08-30 15:41:46 +02:00
Markus Gothe
ccbd61c01e Revert "RM#32352 - LED Behaviour and verification"
This reverts commit a0a88c5265.
2024-08-30 15:25:56 +02:00
Markus Gothe
aae3025278 Revert "RM#34062 - wps never gives exit status if wpasupplicant is restarted"
This reverts commit 3b84a3c547.
2024-08-30 15:25:44 +02:00
Markus Gothe
413817fc9d libethernet: Improve counter logic on Airoha. 2024-08-22 22:09:58 +02:00
Markus Gothe
f565ac8144 qosmngr: Solve issue with L3 HW NAT for DSCP.
When doing classification on DSCP values we need
to ensure that the values are correctly hashed
for the L3 HW NAT, otherwise identical flows
with different DSCP values will end up with
the same QoS priority and queue.
2024-08-16 12:39:50 +02:00
Markus Gothe
8273a96de8 qosmngr: Handle L3 flows with different p-bits correctly.
The L3 HW NAT will match the flows based on an IP header 5-tuple.
However if we are doing classification based on p-bits at the
same time and we want to use this for QoS we need to make sure
to add a VIP packet matcher to send this info to the PPE for
hashing the flow.
2024-08-16 12:39:42 +02:00
Mohd Husaam Mehdi
2c4376abee R37976 TR181/069: Unable To Add Multiple Downstream Interfaces To Proxy Object
Changes duplicacy check for interfaces of proxy object, so that
multiple interfaces can be added in downstream/upstream direction.

Change-Id: Id71f77ea4c538250e4fe8455bb2defbcfef82b67
2024-07-31 20:45:23 +02:00
Markus Gothe
c7928d3a6d Update fix for iop 2024-07-31 19:02:05 +02:00
Markus Gothe
07ab330524 Integrate obuspa 8.0.1.9. 2024-07-31 18:38:53 +02:00
Markus Gothe
0fcc3f8612 mcastmngr: Fix L2 snooping hotplug events. 2024-07-31 18:36:25 +02:00
Markus Gothe
01c1b0d832 libethernet: Fix stats for unbound interface. 2024-07-31 18:36:25 +02:00
Markus Gothe
75ebeb9012 tree-wide: use OpenWrt way to define LAN/WAN ports 2024-07-31 18:36:25 +02:00
Markus Gothe
c22ff2c6bc iop genconfig: Don't print out error. 2024-07-31 18:36:25 +02:00
Markus Gothe
4ab2f04b73 iop: Enable support for capital characters in version. 2024-07-31 18:36:25 +02:00
Markus Gothe
9477208611 iop/Config.in: Add global CONFIG_VERSION_WITH_DATE.
Add a global parameter for all vendors.

Change-Id: I55f6c24c807bb971a9a2bd35b8ab5836a39f39c9
2024-07-31 18:36:25 +02:00
Markus Gothe
98cbdf50fc iop: Add support for ./feeds/customerprofiles. 2024-07-31 18:36:25 +02:00
Meng
210cf3cab6 Add "Device.NAT.InterfaceSetting." to dmcaching_exclude.json
For issue https://project.iopsys.eu/issues/8950

Change-Id: Ifc4dc38285e79b2c795c00c493604f07421e639f
2024-07-31 18:36:25 +02:00
Meng
e4be368914 change qos queue section name
q_1_eth1 ==> LAN1_q1

Change-Id: Ibb7a2a495c0f32945419e38376acd155ec507cbe
2024-07-31 18:36:25 +02:00
Lwithwma Brahma
d9c30a8e87 R#34183 TR181: ubus call mcast stats not showing correct output for multiple snooping bridges
Corrected the read_mcast_stats function, to display
"ubus call mcast stats" correct output for multiple iptv bridges

Test:
"ubus call mcast stats" showing correct output for both single and multiple bridge.

Change-Id: Icbcb489a4edb441d04adc7df6e466cf8a57642f2
2024-07-31 18:36:25 +02:00
Mohd Husaam Mehdi
d2f5a51510 R#34880 mcast stats shows 0.0.0.0 for group
Fixes mcast stats showing 0.0.0.0 for group address.

Change-Id: I2034cf212527f260a3eb26e2ecc46c4259c2b739
2024-07-31 18:36:25 +02:00
Lwithwma Brahma
8944abb486 R#33747 DUT reboot when configured multiple IPTV network
setting the lookup method to group_ip_src_ip_vid, to avoid reboot
while using multiple IPTV network.

Testing done:
- by configuring multiple IPTV network, as tag on WAN and untagged on LAN.
- by configuring network as untagged on both WAN and LAN.
- by sending join and leave to upstream server on both the above scenarios.

Change-Id: I806363ccde7336548d2321c2f247f709de379245
2024-07-31 18:36:25 +02:00
Orr Mazor
d5e6639aa2 R#43734 - Increase max number of controllers in obuspa
Since we have 6 controllers.
Also increase related numbers.

Signed-off-by: Orr Mazor <o.mazor@genexis.eu>
Change-Id: Idb11fe4e7899a57e49de2e16d97b5ce7e1c01292
2024-07-31 15:52:05 +02:00
Erik Karlsson
3b84a3c547 RM#34062 - wps never gives exit status if wpasupplicant is restarted
Turn WPS LED off when hostapd or wpa_supplicant exits. This avoids
issue with WPS LED blinking forever in case network configuration is
committed to UCI by for example mapagent, resulting in restart of
hostapd and wpa_supplicant, while WPS is in progress.

Change-Id: Ia5786e4dc53a9dee780d550e981c95d3f19be97e
2024-07-31 15:52:05 +02:00
Erik Karlsson
a0a88c5265 RM#32352 - LED Behaviour and verification
Do not use undefined error state on WPS overlap. Just turn LED off
immediately instead.

Change-Id: Iae2030dd8789113c15c56ae55587e45ad8158aa0
2024-07-31 15:52:05 +02:00
14 changed files with 357 additions and 68 deletions

View File

@@ -13,7 +13,8 @@ function genconfig {
target_script="./scripts/gen_config.py"
# First convert all to lowercase
args=$(to_lowercase "$@")
#args=$(to_lowercase "$@")
args="$@"
# Check if an option is provided
if [[ ${args[0]} == -* ]]; then
@@ -24,6 +25,10 @@ function genconfig {
fi
${target_script} ${args[@]}
if [ "$?" != "0" ]; then
echo "Testing ./feeds/customerprofiles"
PROFILES="./feeds/customerprofiles,profiles" ${target_script} ${args[@]}
fi
}
register_command "genconfig" "Generate configuration for board and customer"

View File

@@ -0,0 +1,36 @@
From be00aa9bd064d1defd94e78835249d0ca04c0440 Mon Sep 17 00:00:00 2001
From: Markus Gothe <markus.gothe@genexis.eu>
Date: Sun, 21 Apr 2024 15:30:18 +0200
Subject: [PATCH] econet: Handle unbound HSGMII LAN interfaces.
---
econet/ecnt_prvt.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/econet/ecnt_prvt.c b/econet/ecnt_prvt.c
index 12c537f..a37fb49 100644
--- a/econet/ecnt_prvt.c
+++ b/econet/ecnt_prvt.c
@@ -212,6 +212,7 @@ int hsgmii_lan_prvt_get_port_statistics(char *ifname, struct eth_stats *stats, s
if (!strncmp(driver_name, DRIVER_NAME, DRIVER_NAME_LEN)) {
int i = 0, hsgmii_index = -1;
const char *hsgmii_iftype;
+ char cmdbuf[512] = {0};
for (; i < ARRAY_SIZE(hsgmii_lookup_tbl); i++) {
int j = 0;
@@ -235,6 +236,11 @@ int hsgmii_lan_prvt_get_port_statistics(char *ifname, struct eth_stats *stats, s
memset(&tx_stats, 0, sizeof(ECNT_FEMGR_GDMA2_TX_STATISTICS));
memset(&rx_stats, 0, sizeof(ECNT_FEMGR_GDMA2_RX_STATISTICS));
+ /* Handle unbound interface statistics */
+ chrCmd(cmdbuf, sizeof(cmdbuf), "cat /proc/tc3162/%s_rebind | awk '{ print $3 }'", ifname);
+ if (cmdbuf[0] != '\0' && strtoul(cmdbuf, NULL, 0) == 1)
+ return 0;
+
if (!fe_lib_get_hsgmii_tx_statistics(&tx_stats, hsgmii_index)) {
fill_stats_tx_from_gdma(stats, rstats, &tx_stats);
}
--
2.43.2

View File

@@ -0,0 +1,162 @@
From 6e7216e657dfb59e869e393ef58e6b4593c16fc7 Mon Sep 17 00:00:00 2001
From: Markus Gothe <markus.gothe@genexis.eu>
Date: Thu, 22 Aug 2024 22:00:25 +0200
Subject: [PATCH] libethernet: Improve counter logic for Airoha.
Improve the counter logic to support 64-bit counters
for internal switch and different MACs for 'ae_wan'.
Also add support for represeting TX/RX bytes and errors.
Fix calculation of unicast packets.
---
econet/ecnt_prvt.c | 76 +++++++++++++++++++++++++++++++---------------
1 file changed, 51 insertions(+), 25 deletions(-)
diff --git a/econet/ecnt_prvt.c b/econet/ecnt_prvt.c
index a37fb49..2c42a03 100644
--- a/econet/ecnt_prvt.c
+++ b/econet/ecnt_prvt.c
@@ -143,10 +143,10 @@ static void fill_stats_tx_from_gdma(struct eth_stats *stats, struct eth_rmon_sta
return;
if (stats != NULL) {
- stats->tx_bytes = 0;
+ stats->tx_bytes = tx_stats->frame_len;
stats->tx_packets = tx_stats->frame_cnt;
stats->tx_errors = 0;
- stats->tx_ucast_packets = 0;
+ stats->tx_ucast_packets = tx_stats->frame_cnt - (tx_stats->broadcast + tx_stats->multicast);
stats->tx_mcast_packets = tx_stats->broadcast;
stats->tx_bcast_packets = tx_stats->multicast;
stats->tx_discard_packets = tx_stats->drop_cnt;
@@ -154,7 +154,7 @@ static void fill_stats_tx_from_gdma(struct eth_stats *stats, struct eth_rmon_sta
if (rstats != NULL) {
rstats->tx.packets = tx_stats->frame_cnt;
- rstats->tx.bytes = 0;
+ rstats->tx.bytes = tx_stats->frame_len;
rstats->tx.bcast_packets = tx_stats->broadcast;
rstats->tx.mcast_packets = tx_stats->multicast;
rstats->tx.crc_err_packets = 0;
@@ -175,10 +175,10 @@ static void fill_stats_rx_from_gdma(struct eth_stats *stats, struct eth_rmon_sta
return;
if (stats != NULL) {
- stats->rx_bytes = 0;
+ stats->rx_bytes = rx_stats->frame_len;
stats->rx_packets = rx_stats->frame_cnt;
- stats->rx_errors = 0;
- stats->rx_ucast_packets = 0;
+ stats->rx_errors = rx_stats->crc + rx_stats->jabber + rx_stats->fragment + rx_stats->undersize + rx_stats->oversize;
+ stats->rx_ucast_packets = rx_stats->frame_cnt - (rx_stats->broadcast + rx_stats->multicast);
stats->rx_mcast_packets = rx_stats->broadcast;
stats->rx_bcast_packets = rx_stats->multicast;
stats->rx_discard_packets = rx_stats->drop_cnt;
@@ -187,12 +187,12 @@ static void fill_stats_rx_from_gdma(struct eth_stats *stats, struct eth_rmon_sta
if (rstats != NULL) {
rstats->rx.packets = rx_stats->frame_cnt;
- rstats->rx.bytes = 0;
+ rstats->rx.bytes = rx_stats->frame_len;
rstats->rx.bcast_packets = rx_stats->broadcast;
rstats->rx.mcast_packets = rx_stats->multicast;
- rstats->rx.crc_err_packets = 0;
- rstats->rx.under_sz_packets = 0;
- rstats->rx.over_sz_packets = 0;
+ rstats->rx.crc_err_packets = rx_stats->crc;
+ rstats->rx.under_sz_packets = rx_stats->undersize;
+ rstats->rx.over_sz_packets = rx_stats->oversize;
rstats->rx.packets_64bytes = rx_stats->eq_64;
rstats->rx.packets_65to127bytes = rx_stats->from_65_to_127;
rstats->rx.packets_256to511bytes = rx_stats->from_256_to_511;
@@ -259,23 +259,50 @@ int hsgmii_lan_prvt_get_port_statistics(char *ifname, struct eth_stats *stats, s
}
int ae_wan_prvt_get_port_statistics(struct eth_stats *stats, struct eth_rmon_stats *rstats) {
+ char cmdbuf[512] = {0};
ECNT_FEMGR_GDMA2_TX_STATISTICS tx_stats;
ECNT_FEMGR_GDMA2_RX_STATISTICS rx_stats;
memset(&tx_stats, 0, sizeof(ECNT_FEMGR_GDMA2_TX_STATISTICS));
memset(&rx_stats, 0, sizeof(ECNT_FEMGR_GDMA2_RX_STATISTICS));
- if (!fe_lib_get_gdma2_tx_statistics(&tx_stats)) {
- fill_stats_tx_from_gdma(stats, rstats, &tx_stats);
- }
+ chrCmd(cmdbuf, sizeof(cmdbuf), "cat /proc/tc3162/ae_wan_switch_hsgmii_lan");
+ if (cmdbuf[0] != '\0' && strcmp(cmdbuf, "pon") != 0) {
+ int i = 0, hsgmii_index = -1;
+ for (; i < ARRAY_SIZE(hsgmii_lookup_tbl); i++) {
+ if (!strcmp(cmdbuf, hsgmii_lookup_tbl[i].iftype)) {
+ hsgmii_index = hsgmii_lookup_tbl[i].idx;
+ break;
+ }
+ }
- if (!fe_lib_get_gdma2_rx_statistics(&rx_stats)) {
- fill_stats_rx_from_gdma(stats, rstats, &rx_stats);
- }
+ if (hsgmii_index == -1)
+ return -1;
- if (rstats != NULL) {
- get_pause_stats_from_proc("", "ae_wan", &rstats->rx.pause_packets,
- &rstats->tx.pause_packets);
+ if (!fe_lib_get_hsgmii_tx_statistics(&tx_stats, hsgmii_index)) {
+ fill_stats_tx_from_gdma(stats, rstats, &tx_stats);
+ }
+ if (!fe_lib_get_hsgmii_rx_statistics(&rx_stats, hsgmii_index)) {
+ fill_stats_rx_from_gdma(stats, rstats, &rx_stats);
+ }
+
+ if (rstats != NULL) {
+ get_pause_stats_from_proc("hsgmii_", cmdbuf, &rstats->rx.pause_packets,
+ &rstats->tx.pause_packets);
+ }
+ } else {
+ if (!fe_lib_get_gdma2_tx_statistics(&tx_stats)) {
+ fill_stats_tx_from_gdma(stats, rstats, &tx_stats);
+ }
+
+ if (!fe_lib_get_gdma2_rx_statistics(&rx_stats)) {
+ fill_stats_rx_from_gdma(stats, rstats, &rx_stats);
+ }
+
+ if (rstats != NULL) {
+ get_pause_stats_from_proc("", "ae_wan", &rstats->rx.pause_packets,
+ &rstats->tx.pause_packets);
+ }
}
return 0;
@@ -305,14 +332,12 @@ int ecnt_prvt_get_port_statistics(uint32_t port,
}
if (stats != NULL) {
- stats->tx_bytes =
- portcnt.TxBytesCnt_Lo;
- stats->rx_bytes =
- portcnt.RxBytesCnt_Lo;
+ stats->tx_bytes = (((uint64_t)portcnt.TxBytesCnt_Hi) << 32) + portcnt.TxBytesCnt_Lo;
+ stats->rx_bytes = (((uint64_t)portcnt.RxBytesCnt_Hi) << 32) + portcnt.RxBytesCnt_Lo;
stats->tx_packets = portcnt.TxPktsCnt;
stats->rx_packets = portcnt.RxPktsCnt;
stats->tx_errors = 0;
- stats->rx_errors = 0;
+ stats->rx_errors = portcnt.RxAlignmentErrorCnt + portcnt.RxCRCFramesCnt + portcnt.RxUnderSizePktsCnt + portcnt.RxFragmentErrorCnt + portcnt.RxOverSizePktsCnt;
stats->tx_ucast_packets = portcnt.TxUniPktsCnt;
stats->rx_ucast_packets = portcnt.RxUniPktsCnt;
stats->tx_mcast_packets = portcnt.TxMultiPktsCnt;
@@ -330,7 +355,8 @@ int ecnt_prvt_get_port_statistics(uint32_t port,
rstats->__rmon_field.drop_events = \
portcnt.__ecnt_prefix ## DropFramesCnt; \
rstats->__rmon_field.bytes = \
- portcnt.__ecnt_prefix ## BytesCnt_Lo; \
+ (((uint64_t)portcnt.__ecnt_prefix ## BytesCnt_Hi) << 32) \
+ + portcnt.__ecnt_prefix ## BytesCnt_Lo; \
rstats->__rmon_field.packets = portcnt.__ecnt_prefix ## PktsCnt;\
rstats->__rmon_field.bcast_packets = \
portcnt.__ecnt_prefix ## BroadPktsCnt; \
--
2.46.0

View File

@@ -128,14 +128,14 @@ configure_mcpd_snooping() {
config_snooping_common_params $protocol $igmp_s_version $igmp_s_robustness $igmp_s_mode
config_mcast_querier_params $protocol $igmp_s_query_interval $igmp_s_q_resp_interval $igmp_s_last_mem_q_int
config_snooping_upstream_interface "$igmp_s_iface"
config_snooping_on_bridge $protocol $igmp_s_iface $igmp_s_mode
config_snooping_on_bridge $protocol "$igmp_s_iface" $igmp_s_mode
exceptions=$igmp_s_exceptions
fast_leave=$igmp_s_fast_leave
elif [ "$protocol" == "mld" ]; then
config_snooping_common_params $protocol $mld_s_version $mld_s_robustness $mld_s_mode
config_mcast_querier_params $protocol $mld_s_query_interval $mld_s_q_resp_interval $mld_s_last_mem_q_int
config_snooping_upstream_interface "$mld_s_iface"
config_snooping_on_bridge $protocol $mld_s_iface $mld_s_mode
config_snooping_on_bridge $protocol "$mld_s_iface" $mld_s_mode
exceptions=$mld_s_exceptions
fast_leave=$mld_s_fast_leave
fi
@@ -171,14 +171,14 @@ configure_mcpd_proxy() {
config_snooping_common_params $protocol $igmp_p_version $igmp_p_robustness $igmp_p_mode
config_mcast_querier_params $protocol $igmp_query_interval $igmp_q_resp_interval $igmp_last_mem_q_int
config_mcast_proxy_interface $protocol "$igmp_p_up_interfaces"
config_snooping_on_bridge $protocol $igmp_p_down_interfaces $igmp_p_mode
config_snooping_on_bridge $protocol "$igmp_p_down_interfaces" $igmp_p_mode
fast_leave=$igmp_fast_leave
exceptions=$igmp_p_exceptions
elif [ "$protocol" == "mld" ]; then
config_snooping_common_params $protocol $mld_p_version $mld_p_robustness $mld_p_mode
config_mcast_querier_params $protocol $mld_query_interval $mld_q_resp_interval $mld_last_mem_q_int
config_mcast_proxy_interface $protocol "$mld_p_up_interfaces"
config_snooping_on_bridge $protocol $mld_p_down_interfaces $mld_p_mode
config_snooping_on_bridge $protocol "$mld_p_down_interfaces" $mld_p_mode
fast_leave=$mld_fast_leave
exceptions=$mld_p_exceptions
fi
@@ -236,7 +236,7 @@ configure_mcpd() {
setup_mcast_mode() {
# set the mode at chip to allow both tagged and untagged multicast forwarding
bs /b/c iptv lookup_method=group_ip_src_ip
bs /b/c iptv lookup_method=group_ip_src_ip_vid
}
configure_mcast() {

View File

@@ -64,23 +64,11 @@ read_mcast_stats() {
json_init
json_add_array "snooping"
json_add_object ""
IFS=" "
for intf in $ifaces; do
while read line; do
# reading each line
case $line in
br-*)
snoop_iface="$(echo $line | awk -F ' ' '{ print $1 }')"
if [ "$snoop_iface" != "$intf" ]; then
continue
fi
json_add_string "interface" "$intf"
json_add_array "groups"
break
;;
esac
done < /tmp/igmp_stats
json_add_object ""
json_add_string "interface" "$intf"
json_add_array "groups"
IFS=" "
for gip_addr in $mcast_addrs; do
grp_obj_added=0
@@ -116,12 +104,14 @@ read_mcast_stats() {
;;
esac
done < /tmp/igmp_stats
json_close_array #close the associated devices array
json_close_object # close the groups object
if [ $grp_obj_added -eq 1 ]; then
json_close_array #close the associated devices array
json_close_object # close the groups object
fi
done # close the loop for group addresses
json_close_array #close the groups array
json_close_object # close the snooping object
done # close the loop for interfaces
json_close_object # close the snooping object
json_close_array # close the snooping array
json_dump

View File

@@ -0,0 +1,24 @@
#!/bin/sh
[ "$LINK" = "up" -a -n "$PORT" ] || exit 0
compare_mcast_snooping_interface() {
local interface dev running
config_get interface "$1" interface
for dev in $interface; do
if [ "$PORT" = "$dev" ]; then
running=$(ubus call service list '{"name": "mcast"}' | jsonfilter -e '@.mcast.instances')
if [ -z "${running}" ]; then
/etc/init.d/mcast start
else
ubus call uci commit '{"config":"mcast"}'
fi
exit
fi
done
}
config_load mcast
config_foreach compare_mcast_snooping_interface "snooping"

View File

@@ -1,27 +1,22 @@
#!/bin/sh
[ "$ACTION" = ifup ] || exit 0
[ "$ACTION" = "ifup" -a -n "$INTERFACE" ] || exit 0
. /lib/functions/network.sh
network_get_device l3device $INTERFACE
network_get_device l3device "$INTERFACE"
[ -n "$l3device" ] || exit 0
compare_mcast_proxy_upstream() {
local upstream
local mode="$2"
local upstream dev running
if [ "$mode" == "proxy" ]; then
config_get upstream $1 upstream_interface
else
config_get upstream $1 interface
fi
config_get upstream "$1" upstream_interface
for dev in $upstream; do
if [ "$l3device" == "$dev" ]; then
if [ "$l3device" = "$dev" ]; then
running=$(ubus call service list '{"name": "mcast"}' | jsonfilter -e '@.mcast.instances')
if [ -z "${running}" ];then
if [ -z "${running}" ]; then
/etc/init.d/mcast start
else
ubus call uci commit '{"config":"mcast"}'
@@ -32,5 +27,4 @@ compare_mcast_proxy_upstream() {
}
config_load mcast
config_foreach compare_mcast_proxy_upstream "proxy" "proxy"
config_foreach compare_mcast_proxy_upstream "snooping" "snooping"
config_foreach compare_mcast_proxy_upstream "proxy"

View File

@@ -395,13 +395,15 @@ config_mcproxy() {
disable_snooping
if [ "$igmp_p_enable" == "1" ]; then
config_mcproxy_instance igmp "$igmp_p_version"
elif [ "$igmp_s_enable" == "1" ]; then
fi
if [ "$igmp_s_enable" == "1" ]; then
config_snooping igmp "$igmp_s_version"
fi
if [ "$mld_p_enable" == "1" ]; then
config_mcproxy_instance mld "$mld_p_version"
elif [ "$mld_s_enable" == "1" ]; then
fi
if [ "$mld_s_enable" == "1" ]; then
config_snooping mld "$mld_s_version"
fi
}

View File

@@ -85,23 +85,11 @@ read_mcast_stats() {
json_init
json_add_array "snooping"
json_add_object ""
IFS=" "
for intf in $ifaces; do
while read line; do
# reading each line
case $line in
br-*)
snoop_iface="$(echo $line | awk -F ' ' '{ print $1 }')"
if [ "$snoop_iface" != "$intf" ]; then
continue
fi
json_add_string "interface" "$intf"
json_add_array "groups"
break
;;
esac
done < "$temp_igmp_file"
json_add_object ""
json_add_string "interface" "$intf"
json_add_array "groups"
IFS=" "
for gip_addr in $mcast_addrs; do
grp_obj_added=0
@@ -137,12 +125,14 @@ read_mcast_stats() {
;;
esac
done < "$temp_igmp_file"
json_close_array #close the associated devices array
json_close_object # close the groups object
if [ $grp_obj_added -eq 1 ]; then
json_close_array #close the associated devices array
json_close_object # close the groups object
fi
done # close the loop for group addresses
json_close_array #close the groups array
json_close_object # close the snooping object
done # close the loop for interfaces
json_close_object # close the snooping object
json_close_array # close the snooping array
json_dump

View File

@@ -0,0 +1,40 @@
diff --git a/bbf_plugin/x_iopsys_eu_igmp.c b/bbf_plugin/x_iopsys_eu_igmp.c
index 576099c..a6b0e5e 100644
--- a/bbf_plugin/x_iopsys_eu_igmp.c
+++ b/bbf_plugin/x_iopsys_eu_igmp.c
@@ -60,7 +60,7 @@ static void sync_mcast_dmmap_iface_sec(struct uci_list *proxy_iface, char *s_mod
struct uci_section *d_sec;
int found = 0;
char key[1024] = "";
- char *s_name;
+ char *s_name, *intf_dir, *intf_smode;
uci_foreach_element(proxy_iface, e) {
char *p_ifname = dmstrdup(e->name);
@@ -75,7 +75,12 @@ static void sync_mcast_dmmap_iface_sec(struct uci_list *proxy_iface, char *s_mod
// file corresponding to this interface
uci_path_foreach_option_eq(bbfdm, dmmap_package, dmmap_sec, "ifname", key, d_sec) {
dmuci_get_value_by_section_string(d_sec, "section_name", &s_name);
- if (strcmp(s_name, section_name(s)) == 0) {
+ dmuci_get_value_by_section_string(d_sec, "upstream", &intf_dir);
+ dmuci_get_value_by_section_string(d_sec, "snooping_mode", &intf_smode);
+
+ if (strcmp(s_name, section_name(s)) == 0 &&
+ strcmp(intf_dir, up_iface) == 0 &&
+ strcmp(intf_smode, s_mode) == 0) {
add_dmmap_config_dup_list(dup_list, s, d_sec);
found = 1;
break;
@@ -1640,12 +1645,6 @@ static void sync_proxy_interface_sections(struct uci_section *s, char *section,
val = dmstrdup(e->name);
if (DM_STRCMP(val, pch) == 0) {
found = 1;
- if (!up_iface) {
- // if entry is found and upstream was set to
- // false, then, remove this entry
- dmuci_del_list_value_by_section(s, section, val);
- }
-
// Further action is not required
break;
}

View File

@@ -2,6 +2,7 @@
"dmcaching_exclude": [
"Device.Hosts.Host.",
"Device.IEEE1905.",
"Device.WiFi.DataElements."
"Device.WiFi.DataElements.",
"Device.NAT.InterfaceSetting."
]
}

View File

@@ -7,7 +7,7 @@ index 5e367b7..db154a5 100644
char *DEVICE_CONTROLLER_GetControllerTopic(int mqtt_instance);
+#ifdef OBUSPA_CONTROLLER_MTP_VERIFY
+bool DEVICE_CONTROLLER_IsMTPAllowed(char *endpoint_id, mtp_reply_to_t *mrt);
+bool DEVICE_CONTROLLER_IsMTPAllowed(char *endpoint_id, mtp_conn_t *mpc);
+#endif
+
#ifndef REMOVE_USP_BROKER
@@ -30,12 +30,12 @@ index 97ca11d..19c91f1 100644
+** This function is used by ValidateUspRecord() to determine whether to process a received USP message
+**
+** \param endpoint_id - Endpoint ID of controller that sent a USP message
+** \param mrt - pointer to structure specifying on which MTP the message was received
+** \param mpc - pointer to structure specifying on which MTP the message was received
+**
+** \return true if the MTP is allowed, false otherwise
+**
+**************************************************************************/
+bool DEVICE_CONTROLLER_IsMTPAllowed(char *endpoint_id, mtp_reply_to_t *mrt)
+bool DEVICE_CONTROLLER_IsMTPAllowed(char *endpoint_id, mtp_conn_t *mpc)
+{
+ controller_t *cont = FindEnabledControllerByEndpointId(endpoint_id);
+ controller_mtp_t *mtp;
@@ -46,18 +46,18 @@ index 97ca11d..19c91f1 100644
+ return false;
+ }
+
+ mtp = FindFirstEnabledMtp(cont, mrt->protocol);
+ mtp = FindFirstEnabledMtp(cont, mpc->protocol);
+
+#ifdef ENABLE_WEBSOCKETS
+ // Allow websocket server if no other MTP is configured
+ if ((mrt->protocol == kMtpProtocol_WebSockets) && (mrt->wsserv_conn_id != INVALID))
+ if ((mpc->protocol == kMtpProtocol_WebSockets) && (mpc->ws.serv_conn_id != INVALID))
+ {
+ return mtp == NULL;
+ }
+#endif
+
+ // Disallow if there is no MTP configured with matching protocol
+ if ((mtp == NULL) || (mtp->protocol != mrt->protocol))
+ if ((mtp == NULL) || (mtp->protocol != mpc->protocol))
+ {
+ return false;
+ }
@@ -67,7 +67,7 @@ index 97ca11d..19c91f1 100644
+ {
+#ifndef DISABLE_STOMP
+ case kMtpProtocol_STOMP:
+ return mtp->stomp_connection_instance == mrt->stomp_instance;
+ return mtp->stomp_connection_instance == mpc->stomp.instance;
+#endif
+
+#ifdef ENABLE_COAP
@@ -77,12 +77,12 @@ index 97ca11d..19c91f1 100644
+
+#ifdef ENABLE_MQTT
+ case kMtpProtocol_MQTT:
+ return mtp->mqtt_connection_instance == mrt->mqtt_instance;
+ return mtp->mqtt_connection_instance == mpc->mqtt.instance;
+#endif
+
+#ifdef ENABLE_WEBSOCKETS
+ case kMtpProtocol_WebSockets:
+ return (mrt->wsclient_cont_instance == cont->instance) && (mrt->wsclient_mtp_instance == mtp->instance);
+ return (mpc->ws.client_cont_instance == cont->instance) && (mpc->ws.client_mtp_instance == mtp->instance);
+#endif
+ default:
+ TERMINATE_BAD_CASE(mtp->protocol);
@@ -106,7 +106,7 @@ index 2a04d39..0b3074b 100644
+#ifdef OBUSPA_CONTROLLER_MTP_VERIFY
+ // Exit if the controller is not allowed to use the MTP on which the message was received
+ if (DEVICE_CONTROLLER_IsMTPAllowed(rec->from_id, mrt) == false)
+ if (DEVICE_CONTROLLER_IsMTPAllowed(rec->from_id, mtpc) == false)
+ {
+ USP_ERR_SetMessage("%s: Ignoring message from endpoint_id=%s (unauthorized MTP)", __FUNCTION__, rec->from_id);
+ return USP_ERR_PERMISSION_DENIED;

View File

@@ -26,7 +26,17 @@ hw_intf_init() {
# Initialize the hardware setup library
hw_init_all() {
local tc=0
export TMP_HW_QUEUE_LIST=""
echo clear > /proc/ifc_debug
echo reinit > /proc/ifc_debug
for tc in $(seq 0 7); do
rm -rf "/tmp/qos/dscp_values_${tc}_4"
rm -rf "/tmp/qos/dscp_values_${tc}_6"
done
return 0
}
@@ -150,6 +160,8 @@ hw_commit_all() {
local shape_rate="$TMP_HW_SHAPE_RATE"
local q_count="0"
local mac_qos_flag=""
local pbit=0
local tc=0
# Reorder queues
for q in ${sorted_list} ; do
@@ -205,4 +217,33 @@ hw_commit_all() {
else
/userfs/bin/qosrule discpline Enable 0
fi
if [ -x /userfs/bin/blapi_cmd ]; then
echo 1 > /proc/ifc_send_to_ppe
for tc in $(seq 0 7); do
if [ -s "/tmp/qos/dscp_values_${tc}_4" ]; then
sort -un "/tmp/qos/dscp_values_${tc}_4" | awk 'NR==1{first=$1;last=$1;next}
$1 == last+1 {last=$1;next}
{system("/userfs/bin/blapi_cmd traffic set_traffic_class DSCP " first*4 " " or(last*4, 0x3) " 1");first=$1;last=first}
END{system("/userfs/bin/blapi_cmd traffic set_traffic_class DSCP " first*4 " " or(last*4, 0x3) " 1")}'
fi
if [ -s "/tmp/qos/dscp_values_${tc}_6" ]; then
[ -s "/tmp/qos/dscp_values_${tc}_4" ] && sort -un "/tmp/qos/dscp_values_${tc}_6" | awk 'NR==1{first=$1;last=$1;next}
$1 == last+1 {last=$1;next}
{system("/userfs/bin/blapi_cmd traffic set_traffic_class DSCP " first*4 " " or(last*4, 0x3) " 0");first=$1;last=first}
END{system("/userfs/bin/blapi_cmd traffic set_traffic_class DSCP " first*4 " " or(last*4, 0x3) " 0")}'
sort -un "/tmp/qos/dscp_values_${tc}_6" | awk 'NR==1{first=$1;last=$1;next}
$1 == last+1 {last=$1;next}
{system("/userfs/bin/blapi_cmd traffic set_traffic_class DSCP " first*4 " " or(last*4, 0x3) " 1");first=$1;last=first}
END{system("/userfs/bin/blapi_cmd traffic set_traffic_class DSCP " first*4 " " or(last*4, 0x3) " 1")}'
fi
done
fi
if [ -x /userfs/bin/ifc ]; then
echo 1 > /proc/ifc_send_to_ppe
for pbit in $(seq 0 7); do
/userfs/bin/ifc add vip pbit $pbit
done
fi
}

View File

@@ -26,6 +26,7 @@ broute_ipv4_rule_options()
config_get protocol "$cid" "proto"
config_get dscp_filter "$cid" "dscp_filter"
config_get icmp_type "$cid" "icmp_type"
config_get traffic_class "$cid" "traffic_class"
set_ip_addr "$cid" ebt_match_src_ip ebt_match_dst_ip
@@ -36,6 +37,7 @@ broute_ipv4_rule_options()
tos_val=$((dscp_filter<<2))
tos_hex=$(printf "%x" $tos_val)
broute_filter_on_dscp "$tos_hex"
[ -n "$traffic_class" -a "$dscp_filter" != "0" ] && echo "$((dscp_filter))" >> "/tmp/qos/dscp_values_${traffic_class}_4"
fi
if [ -n "$protocol" ]; then
@@ -57,6 +59,7 @@ broute_ipv6_rule_options()
config_get protocol "$cid" "proto"
config_get dscp_filter "$cid" "dscp_filter"
config_get icmp_type "$cid" "icmp_type"
config_get traffic_class "$cid" "traffic_class"
set_ip_addr "$cid" ebt_match_ipv6_src_ip ebt_match_ipv6_dst_ip
@@ -67,6 +70,7 @@ broute_ipv6_rule_options()
tos_val=$((dscp_filter<<2))
tos_hex=$(printf "%x" $tos_val)
ebt_match_ipv6_dscp "$tos_hex"
[ -n "$traffic_class" -a "$dscp_filter" != "0" ] && echo "$((dscp_filter))" >> "/tmp/qos/dscp_values_${traffic_class}_6"
fi
if [ -n "$protocol" ]; then