pespin has uploaded this change for review. (
https://gerrit.osmocom.org/c/libosmo-sigtran/+/39917?usp=email )
Change subject: vty: Introduce AS node cmd 'binding-table reset'
......................................................................
vty: Introduce AS node cmd 'binding-table reset'
This is useful when reconfiguring a deployed osmo-stp where new ASPs are
added/removed to the config, or when changing the binding seed
calculation to improve distribution based on current traffic.
This will also be used by tests validating loadshare feature, to start
with a clean state every time.
Change-Id: I56c34072a9ded42c13dbfc105a0ab3353ca353ec
---
M src/osmo_ss7_as.c
M src/osmo_ss7_vty.c
M src/ss7_as.h
3 files changed, 22 insertions(+), 0 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/libosmo-sigtran refs/changes/17/39917/1
diff --git a/src/osmo_ss7_as.c b/src/osmo_ss7_as.c
index 525f394..e84a36d 100644
--- a/src/osmo_ss7_as.c
+++ b/src/osmo_ss7_as.c
@@ -350,6 +350,15 @@
return asp;
}
+/* Reset loadshare bindings table. It will be filled in as needed.
+ * This is useful for instance when user changes the ASP set inside an AS, or
+ * changes the way the binding seed (eSLS) is calculated. */
+void ss7_as_loadshare_binding_table_reset(struct osmo_ss7_as *as)
+{
+ memset(&as->aesls_table[0], 0, sizeof(as->aesls_table));
+ as->cfg.last_asp_idx_assigned = 0;
+}
+
static as_ext_sls_t osmo_ss7_instance_calc_itu_as_ext_sls(const struct osmo_ss7_as *as,
uint32_t opc, uint8_t sls)
{
uint16_t opc12;
diff --git a/src/osmo_ss7_vty.c b/src/osmo_ss7_vty.c
index bcf3ffe..bf3bec2 100644
--- a/src/osmo_ss7_vty.c
+++ b/src/osmo_ss7_vty.c
@@ -2185,6 +2185,17 @@
return CMD_SUCCESS;
}
+DEFUN_ATTR(as_bindingtable_reset, as_bindingtable_reset_cmd,
+ "binding-table reset",
+ "AS Loadshare binding table operations\n"
+ "Reset loadshare binding table\n",
+ CMD_ATTR_IMMEDIATE)
+{
+ struct osmo_ss7_as *as = vty->index;
+ ss7_as_loadshare_binding_table_reset(as);
+ return CMD_SUCCESS;
+}
+
DEFUN_ATTR(as_recov_tout, as_recov_tout_cmd,
"recovery-timeout <1-2000>",
"Specifies the recovery timeout value in milliseconds\n"
@@ -3440,6 +3451,7 @@
install_lib_element(L_CS7_AS_NODE, &as_traf_mode_loadshare_cmd);
install_lib_element(L_CS7_AS_NODE, &as_no_traf_mode_cmd);
install_lib_element(L_CS7_AS_NODE, &as_sls_shift_cmd);
+ install_lib_element(L_CS7_AS_NODE, &as_bindingtable_reset_cmd);
install_lib_element(L_CS7_AS_NODE, &as_recov_tout_cmd);
install_lib_element(L_CS7_AS_NODE, &as_qos_class_cmd);
install_lib_element(L_CS7_AS_NODE, &as_rout_key_cmd);
diff --git a/src/ss7_as.h b/src/ss7_as.h
index 13592e9..bc17726 100644
--- a/src/ss7_as.h
+++ b/src/ss7_as.h
@@ -131,6 +131,7 @@
unsigned int osmo_ss7_as_count_asp(const struct osmo_ss7_as *as);
int ss7_as_add_asp(struct osmo_ss7_as *as, struct osmo_ss7_asp *asp);
+void ss7_as_loadshare_binding_table_reset(struct osmo_ss7_as *as);
#define LOGPAS(as, subsys, level, fmt, args ...) \
_LOGSS7((as)->inst, subsys, level, "AS(%s) " fmt, (as)->cfg.name, ##
args)
--
To view, visit
https://gerrit.osmocom.org/c/libosmo-sigtran/+/39917?usp=email
To unsubscribe, or for help writing mail filters, visit
https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: newchange
Gerrit-Project: libosmo-sigtran
Gerrit-Branch: master
Gerrit-Change-Id: I56c34072a9ded42c13dbfc105a0ab3353ca353ec
Gerrit-Change-Number: 39917
Gerrit-PatchSet: 1
Gerrit-Owner: pespin <pespin(a)sysmocom.de>