This is merely a historical archive of years 2008-2021, before the migration to mailman3.
A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.
lynxis lazus gerrit-no-reply at lists.osmocom.orglynxis lazus has uploaded this change for review. ( https://gerrit.osmocom.org/10370 Change subject: vty: add cmd "reset sgsn state" ...................................................................... vty: add cmd "reset sgsn state" Reset the SGSN internal state. Useful when testing the SGSN via TTCN3. Change-Id: I92096f3f6ea49e75676e30e9921d00210bac5382 --- M src/gprs/sgsn_vty.c 1 file changed, 32 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-sgsn refs/changes/70/10370/1 diff --git a/src/gprs/sgsn_vty.c b/src/gprs/sgsn_vty.c index 8092158..c48d55c 100644 --- a/src/gprs/sgsn_vty.c +++ b/src/gprs/sgsn_vty.c @@ -34,6 +34,7 @@ #include <osmocom/sgsn/debug.h> #include <osmocom/sgsn/sgsn.h> #include <osmocom/gprs/gprs_ns.h> +#include <osmocom/sgsn/gprs_gmm.h> #include <osmocom/sgsn/gprs_sgsn.h> #include <osmocom/sgsn/vty.h> #include <osmocom/sgsn/gsup_client.h> @@ -44,6 +45,8 @@ #include <osmocom/crypt/gprs_cipher.h> #include <osmocom/abis/ipa.h> +#include <osmocom/gprs/gprs_bssgp.h> + #include <pdp.h> #include <gtp.h> @@ -796,6 +799,34 @@ vty_out(vty, " Use count: %u%s", gsub->use_count, VTY_NEWLINE); } +DEFUN(reset_sgsn_state, + reset_sgsn_state_cmd, + "reset sgsn state", + "Remove all known subscriber, MM ctx and flush BSSGP queues Useful when running tests against the SGSN") +{ + struct gprs_subscr *subscr, *tmp_subscr; + struct sgsn_mm_ctx *mm, *tmp_mm; + + llist_for_each_entry_safe(mm, tmp_mm, &sgsn_mm_ctxts, list) + { + gsm0408_gprs_access_cancelled(mm, SGSN_ERROR_CAUSE_NONE); + } + vty_out(vty, "Cancelled MM Ctx. %s", VTY_NEWLINE); + + llist_for_each_entry_safe(subscr, tmp_subscr, gprs_subscribers, entry) { + gprs_subscr_get(subscr); + gprs_subscr_cancel(subscr); + gprs_subscr_put(subscr); + } + vty_out(vty, "Removed all gprs subscribers.%s", VTY_NEWLINE); + + bssgp_flush_all_queues(); + vty_out(vty, "Flushed all BSSGPs queues.%s", VTY_NEWLINE); + + /* remove all queues to bssgp */ + return CMD_SUCCESS; +} + DEFUN(show_subscr_cache, show_subscr_cache_cmd, "show subscriber cache", @@ -1310,6 +1341,7 @@ install_element(ENABLE_NODE, &update_subscr_cancel_cmd); install_element(ENABLE_NODE, &update_subscr_update_location_result_cmd); install_element(ENABLE_NODE, &update_subscr_update_auth_info_cmd); + install_element(ENABLE_NODE, &reset_sgsn_state_cmd); install_element(CONFIG_NODE, &cfg_sgsn_cmd); install_node(&sgsn_node, config_write_sgsn); -- To view, visit https://gerrit.osmocom.org/10370 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I92096f3f6ea49e75676e30e9921d00210bac5382 Gerrit-Change-Number: 10370 Gerrit-PatchSet: 1 Gerrit-Owner: lynxis lazus <lynxis at fe80.eu> -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20180807/6ffed3f3/attachment.htm>