pespin has uploaded this change for review. ( 
https://gerrit.osmocom.org/c/osmo-sgsn/+/29970 )


Change subject: vty: Make new libgtp tdefs configurable through VTY
......................................................................

vty: Make new libgtp tdefs configurable through VTY

Related: OS#5485
Depends: osmo-ggsn.git Change-Id I10bc8e2e197c0e8753b23b684b5ae41025672bf7
Change-Id: I46e9cd158a9f2f721c69f807beb7bb67a459f4a4
---
M TODO-RELEASE
M include/osmocom/sgsn/sgsn.h
M src/sgsn/sgsn_vty.c
3 files changed, 28 insertions(+), 0 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-sgsn refs/changes/70/29970/1

diff --git a/TODO-RELEASE b/TODO-RELEASE
index 1c5d61f..21bfa66 100644
--- a/TODO-RELEASE
+++ b/TODO-RELEASE
@@ -1 +1,2 @@
 #component     what            description / commit summary line
+libgtp          >1.9.0          gtp_T_defs
\ No newline at end of file
diff --git a/include/osmocom/sgsn/sgsn.h b/include/osmocom/sgsn/sgsn.h
index f0eda98..f08037a 100644
--- a/include/osmocom/sgsn/sgsn.h
+++ b/include/osmocom/sgsn/sgsn.h
@@ -93,6 +93,7 @@

        /* Timer defintions */
        struct osmo_tdef *T_defs;
+       struct osmo_tdef *T_defs_gtp;

        int dynamic_lookup;

diff --git a/src/sgsn/sgsn_vty.c b/src/sgsn/sgsn_vty.c
index a394c41..e2ec380 100644
--- a/src/sgsn/sgsn_vty.c
+++ b/src/sgsn/sgsn_vty.c
@@ -136,6 +136,26 @@
        return osmo_tdef_vty_set_cmd(vty, g_cfg->T_defs, argv);
 }

+DEFUN(show_timer_gtp, show_timer_gtp_cmd,
+      "show timer gtp " OSMO_TDEF_VTY_ARG_T_OPTIONAL,
+      SHOW_STR "Show GTP (libgtp) timers\n"
+      OSMO_TDEF_VTY_DOC_T)
+{
+       const char *T_arg = argc > 0 ? argv[0] : NULL;
+       return osmo_tdef_vty_show_cmd(vty, g_cfg->T_defs_gtp, T_arg, NULL);
+}
+
+DEFUN(cfg_sgsn_timer_gtp, cfg_sgsn_timer_gtp_cmd,
+      "timer gtp " OSMO_TDEF_VTY_ARG_SET_OPTIONAL,
+      "Configure or show GTP (libgtp) timers\n"
+      OSMO_TDEF_VTY_DOC_SET)
+{
+       /* If any arguments are missing, redirect to 'show' */
+       if (argc < 2)
+               return show_timer(self, vty, argc, argv);
+       return osmo_tdef_vty_set_cmd(vty, g_cfg->T_defs_gtp, argv);
+}
+
 char *gprs_pdpaddr2str(uint8_t *pdpa, uint8_t len, bool return_ipv6)
 {
        static char str[INET6_ADDRSTRLEN + 10];
@@ -312,6 +332,7 @@
        vty_out(vty, " cdr interval %d%s", g_cfg->cdr.interval, VTY_NEWLINE);

        osmo_tdef_vty_write(vty, g_cfg->T_defs, " timer ");
+       osmo_tdef_vty_write(vty, g_cfg->T_defs_gtp, " timer gtp ");

        if (g_cfg->pcomp_rfc1144.active) {
                vty_out(vty, " compression rfc1144 active slots %d%s",
@@ -1719,6 +1740,9 @@
        g_cfg->T_defs = sgsn_T_defs;
        osmo_tdefs_reset(g_cfg->T_defs);

+       g_cfg->T_defs_gtp = gtp_T_defs;
+       osmo_tdefs_reset(g_cfg->T_defs_gtp);
+
        install_element_ve(&show_sgsn_cmd);
        //install_element_ve(&show_mmctx_tlli_cmd);
        install_element_ve(&show_mmctx_imsi_cmd);
@@ -1726,6 +1750,7 @@
        install_element_ve(&show_pdpctx_all_cmd);
        install_element_ve(&show_subscr_cache_cmd);
        install_element_ve(&show_timer_cmd);
+       install_element_ve(&show_timer_gtp_cmd);

        install_element(ENABLE_NODE, &update_subscr_insert_auth_triplet_cmd);
        install_element(ENABLE_NODE, &update_subscr_create_cmd);
@@ -1773,6 +1798,7 @@
        install_element(SGSN_NODE, &cfg_grx_ggsn_cmd);

        install_element(SGSN_NODE, &cfg_sgsn_timer_cmd);
+       install_element(SGSN_NODE, &cfg_sgsn_timer_gtp_cmd);

        install_element(SGSN_NODE, &cfg_no_comp_rfc1144_cmd);
        install_element(SGSN_NODE, &cfg_comp_rfc1144_cmd);

--
To view, visit https://gerrit.osmocom.org/c/osmo-sgsn/+/29970
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-sgsn
Gerrit-Branch: master
Gerrit-Change-Id: I46e9cd158a9f2f721c69f807beb7bb67a459f4a4
Gerrit-Change-Number: 29970
Gerrit-PatchSet: 1
Gerrit-Owner: pespin <pes...@sysmocom.de>
Gerrit-MessageType: newchange

Reply via email to