Compare commits

...

22 Commits

Author SHA1 Message Date
Markus Gothe
f2ab11a91f Revert "iop/Config.in: Add global CONFIG_VERSION_WITH_DATE."
This reverts commit 9477208611.
2024-08-20 13:37:10 +02:00
Markus Gothe
f8c3251781 Revert "iop: Enable support for capital characters in version."
This reverts commit 4ab2f04b73.
2024-08-20 13:36: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 290 additions and 52 deletions

View File

@@ -24,6 +24,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

@@ -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

@@ -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

@@ -0,0 +1,62 @@
diff --git a/src/core/mqtt.c b/src/core/mqtt.c
index 8cb2ad7..b7be65f 100644
--- a/src/core/mqtt.c
+++ b/src/core/mqtt.c
@@ -251,6 +251,16 @@ DEFINE_MQTT_TrustCertVerifyCallbackIndex(6);
DEFINE_MQTT_TrustCertVerifyCallbackIndex(7);
DEFINE_MQTT_TrustCertVerifyCallbackIndex(8);
DEFINE_MQTT_TrustCertVerifyCallbackIndex(9);
+DEFINE_MQTT_TrustCertVerifyCallbackIndex(10);
+DEFINE_MQTT_TrustCertVerifyCallbackIndex(11);
+DEFINE_MQTT_TrustCertVerifyCallbackIndex(12);
+DEFINE_MQTT_TrustCertVerifyCallbackIndex(13);
+DEFINE_MQTT_TrustCertVerifyCallbackIndex(14);
+DEFINE_MQTT_TrustCertVerifyCallbackIndex(15);
+DEFINE_MQTT_TrustCertVerifyCallbackIndex(16);
+DEFINE_MQTT_TrustCertVerifyCallbackIndex(17);
+DEFINE_MQTT_TrustCertVerifyCallbackIndex(18);
+DEFINE_MQTT_TrustCertVerifyCallbackIndex(19);
// Add more, with incrementing indexes here, if you change MAX_MQTT_CLIENTS
//------------------------------------------------------------------------------------
@@ -266,6 +276,16 @@ ssl_verify_callback_t* mqtt_verify_callbacks[] = {
MQTT_TrustCertVerifyCallbackIndex(7),
MQTT_TrustCertVerifyCallbackIndex(8),
MQTT_TrustCertVerifyCallbackIndex(9),
+ MQTT_TrustCertVerifyCallbackIndex(10),
+ MQTT_TrustCertVerifyCallbackIndex(11),
+ MQTT_TrustCertVerifyCallbackIndex(12),
+ MQTT_TrustCertVerifyCallbackIndex(13),
+ MQTT_TrustCertVerifyCallbackIndex(14),
+ MQTT_TrustCertVerifyCallbackIndex(15),
+ MQTT_TrustCertVerifyCallbackIndex(16),
+ MQTT_TrustCertVerifyCallbackIndex(17),
+ MQTT_TrustCertVerifyCallbackIndex(18),
+ MQTT_TrustCertVerifyCallbackIndex(19),
// Add more, with incrementing indexes here, if you change MAX_MQTT_CLIENTS
};
diff --git a/src/vendor/vendor_defs.h b/src/vendor/vendor_defs.h
index 315bea3..50fa750 100755
--- a/src/vendor/vendor_defs.h
+++ b/src/vendor/vendor_defs.h
@@ -47,7 +47,7 @@
//------------------------------------------------------------------------------
// Definitions used to size static arrays
// You are unlikely to need to change these
-#define MAX_DM_INSTANCE_ORDER 6 // Maximum number of instance numbers in a data model schema path (ie number of '{i}' in the schema path)
+#define MAX_DM_INSTANCE_ORDER 21 // Maximum number of instance numbers in a data model schema path (ie number of '{i}' in the schema path)
#define MAX_DM_PATH (256) // Maximum number of characters in a data model path
#define MAX_DM_VALUE_LEN (4096) // Maximum number of characters in a data model parameter value
#define MAX_DM_SHORT_VALUE_LEN (MAX_DM_PATH) // Maximum number of characters in an (expected to be) short data model parameter value
@@ -76,8 +76,8 @@
// Maximum number of MQTT Client Connections (Device.MQTT.Client.{i})
#define MAX_MQTT_CLIENTS (OBUSPA_MAX_CONTROLLERS_NUM)
#else
-#define MAX_CONTROLLERS 5
-#define MAX_MQTT_CLIENTS (5)
+#define MAX_CONTROLLERS 20
+#define MAX_MQTT_CLIENTS (20)
#endif
// Maximum number of bytes allowed in a USP protobuf message.

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

View File

@@ -3,6 +3,23 @@
. /lib/qos/qos.sh
. /usr/share/libubox/jshn.sh
ethnames="$(portorder.sh)"
ports="$(portnames.sh)"
get_port_by_ifname(){
local name i n
name="$1"
i=1
for n in $ethnames; do
[ "$n" = "$name" ] && break
i=$((i+1))
done
# set the ports as input arguments
# and echo the i:th argument
set -- $ports
eval echo \$$i
}
cpu_model="$(cat /proc/socinfo | grep 'SoC Name' | cut -d':' -f2)"
queue_num=8
@@ -20,13 +37,14 @@ populate_no_of_queue(){
generate_queue(){
local ifname="$1"
local no_of_q="$2"
local port=$(get_port_by_ifname "$ifname")
local i=0
local total_q=$((${no_of_q##* } + 1))
for i in $no_of_q; do
for i in $no_of_q; do
local order=$((total_q - i))
uci add qos queue
uci rename qos.@queue[-1]="q_${i}_${ifname}"
uci rename qos.@queue[-1]="${port}_q${order}"
uci set qos.@queue[-1].enable="1"
uci set qos.@queue[-1].ifname="$ifname"
uci set qos.@queue[-1].precedence="$order"

View File

@@ -48,7 +48,7 @@
"method":"set",
"args" : {
"state": "ok",
"timeout": 120
"timeout": 5
},
"timeout": 1
}
@@ -102,11 +102,35 @@
"object": "led.wps",
"method":"set",
"args" : {
"state": "error",
"timeout": 120
"state": "off"
},
"timeout": 1
}
]
},
"wps_off": {
"if_operator" : "OR",
"if" : [
{
"event": "ubus.object.remove",
"regex": true,
"match": {
"path":"^hostapd\\."
}
},
{
"event": "ubus.object.remove",
"regex": true,
"match": {
"path":"^wpa_supplicant\\."
}
}
],
"then" : [
{
"cli": "ubus -S call led.wps status | jsonfilter -e @.state | grep -qxF notice && ubus -S call led.wps set '{\"state\": \"off\"}'",
"timeout": 1
}
]
}
}