mirror of
https://dev.iopsys.eu/feed/iopsys.git
synced 2026-01-07 09:02:36 +08:00
Compare commits
22 Commits
ebtables-b
...
genexos-12
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f2ab11a91f | ||
|
|
f8c3251781 | ||
|
|
f565ac8144 | ||
|
|
8273a96de8 | ||
|
|
2c4376abee | ||
|
|
c7928d3a6d | ||
|
|
07ab330524 | ||
|
|
0fcc3f8612 | ||
|
|
01c1b0d832 | ||
|
|
75ebeb9012 | ||
|
|
c22ff2c6bc | ||
|
|
4ab2f04b73 | ||
|
|
9477208611 | ||
|
|
98cbdf50fc | ||
|
|
210cf3cab6 | ||
|
|
e4be368914 | ||
|
|
d9c30a8e87 | ||
|
|
d2f5a51510 | ||
|
|
8944abb486 | ||
|
|
d5e6639aa2 | ||
|
|
3b84a3c547 | ||
|
|
a0a88c5265 |
@@ -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"
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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() {
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
24
mcastmngr/files/common/etc/hotplug.d/ethernet/mcast.hotplug
Executable file
24
mcastmngr/files/common/etc/hotplug.d/ethernet/mcast.hotplug
Executable 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"
|
||||
20
mcastmngr/files/common/etc/hotplug.d/iface/mcast.hotplug
Normal file → Executable file
20
mcastmngr/files/common/etc/hotplug.d/iface/mcast.hotplug
Normal file → Executable 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"
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
@@ -2,6 +2,7 @@
|
||||
"dmcaching_exclude": [
|
||||
"Device.Hosts.Host.",
|
||||
"Device.IEEE1905.",
|
||||
"Device.WiFi.DataElements."
|
||||
"Device.WiFi.DataElements.",
|
||||
"Device.NAT.InterfaceSetting."
|
||||
]
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
|
||||
62
obuspa/patches/011-increase_max_num_of_controllers.patch
Normal file
62
obuspa/patches/011-increase_max_num_of_controllers.patch
Normal 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.
|
||||
@@ -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
|
||||
}
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -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
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user