Change in ...osmo-ggsn[master]: ggsn: vty: Require ggsn param in cmd
Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/c/osmo-ggsn/+/14298 ) Change subject: ggsn: vty: Require ggsn param in cmd .. ggsn: vty: Require ggsn param in cmd Other similar commands already do it. This way we also get rid of deprecated APIs, supporting search when more than one GSN is set up. Related: OS#2873 Change-Id: I8357e20076348c8ded5e9f5b8e7252566b0fbfea --- M doc/manuals/vty/ggsn_vty_reference.xml M ggsn/ggsn_vty.c 2 files changed, 22 insertions(+), 8 deletions(-) Approvals: Jenkins Builder: Verified Harald Welte: Looks good to me, approved diff --git a/doc/manuals/vty/ggsn_vty_reference.xml b/doc/manuals/vty/ggsn_vty_reference.xml index a226f8f..a395b23 100644 --- a/doc/manuals/vty/ggsn_vty_reference.xml +++ b/doc/manuals/vty/ggsn_vty_reference.xml @@ -351,10 +351,12 @@ - + + + @@ -709,10 +711,12 @@ - + + + diff --git a/ggsn/ggsn_vty.c b/ggsn/ggsn_vty.c index 9101361..eb7cca7 100644 --- a/ggsn/ggsn_vty.c +++ b/ggsn/ggsn_vty.c @@ -764,25 +764,35 @@ } DEFUN(show_pdpctx_imsi, show_pdpctx_imsi_cmd, - "show pdp-context imsi IMSI [<0-15>]", + "show pdp-context ggsn NAME imsi IMSI [<0-15>]", SHOW_STR "Display information on PDP Context\n" + GGSN_STR "GGSN Name\n" "PDP contexts for given IMSI\n" "PDP context for given NSAPI\n") { - uint64_t imsi = strtoull(argv[0], NULL, 10); + struct ggsn_ctx *ggsn; + uint64_t imsi; unsigned int nsapi; struct pdp_t *pdp; int num_found = 0; - if (argc > 1) { - nsapi = atoi(argv[1]); - if (pdp_getimsi(, imsi, nsapi)) { + ggsn = ggsn_find(argv[0]); + if (!ggsn) { + vty_out(vty, "%% No such GGSN '%s'%s", argv[0], VTY_NEWLINE); + return CMD_WARNING; + } + + imsi = strtoull(argv[1], NULL, 10); + + if (argc > 2) { + nsapi = atoi(argv[2]); + if (gtp_pdp_getimsi(ggsn->gsn, , imsi, nsapi)) { show_one_pdp(vty, pdp); num_found++; } } else { for (nsapi = 0; nsapi < PDP_MAXNSAPI; nsapi++) { - if (pdp_getimsi(, imsi, nsapi)) + if (gtp_pdp_getimsi(ggsn->gsn, , imsi, nsapi)) continue; show_one_pdp(vty, pdp); num_found++; -- To view, visit https://gerrit.osmocom.org/c/osmo-ggsn/+/14298 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-Change-Id: I8357e20076348c8ded5e9f5b8e7252566b0fbfea Gerrit-Change-Number: 14298 Gerrit-PatchSet: 4 Gerrit-Owner: pespin Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: fixeria Gerrit-Reviewer: pespin Gerrit-MessageType: merged
Change in ...osmo-ggsn[master]: ggsn: vty: Require ggsn param in cmd
Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/c/osmo-ggsn/+/14298 ) Change subject: ggsn: vty: Require ggsn param in cmd .. Patch Set 4: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/c/osmo-ggsn/+/14298 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-Change-Id: I8357e20076348c8ded5e9f5b8e7252566b0fbfea Gerrit-Change-Number: 14298 Gerrit-PatchSet: 4 Gerrit-Owner: pespin Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: fixeria Gerrit-Reviewer: pespin Gerrit-Comment-Date: Tue, 04 Jun 2019 18:46:51 + Gerrit-HasComments: No Gerrit-Has-Labels: Yes Gerrit-MessageType: comment
Change in ...osmo-ggsn[master]: ggsn: vty: Require ggsn param in cmd
Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/c/osmo-ggsn/+/14298 ) Change subject: ggsn: vty: Require ggsn param in cmd .. Patch Set 3: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/c/osmo-ggsn/+/14298 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-Change-Id: I8357e20076348c8ded5e9f5b8e7252566b0fbfea Gerrit-Change-Number: 14298 Gerrit-PatchSet: 3 Gerrit-Owner: pespin Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: fixeria Gerrit-Reviewer: pespin Gerrit-Comment-Date: Tue, 04 Jun 2019 08:37:31 + Gerrit-HasComments: No Gerrit-Has-Labels: Yes Gerrit-MessageType: comment
Change in ...osmo-ggsn[master]: ggsn: vty: Require ggsn param in cmd
Hello fixeria, Harald Welte, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/c/osmo-ggsn/+/14298 to look at the new patch set (#3). Change subject: ggsn: vty: Require ggsn param in cmd .. ggsn: vty: Require ggsn param in cmd Other similar commands already do it. This way we also get rid of deprecated APIs, supporting search when more than one GSN is set up. Related: OS#2873 Change-Id: I8357e20076348c8ded5e9f5b8e7252566b0fbfea --- M doc/manuals/vty/ggsn_vty_reference.xml M ggsn/ggsn_vty.c 2 files changed, 22 insertions(+), 8 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ggsn refs/changes/98/14298/3 -- To view, visit https://gerrit.osmocom.org/c/osmo-ggsn/+/14298 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-Change-Id: I8357e20076348c8ded5e9f5b8e7252566b0fbfea Gerrit-Change-Number: 14298 Gerrit-PatchSet: 3 Gerrit-Owner: pespin Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: fixeria Gerrit-Reviewer: pespin Gerrit-MessageType: newpatchset
Change in ...osmo-ggsn[master]: ggsn: vty: Require ggsn param in cmd
pespin has posted comments on this change. ( https://gerrit.osmocom.org/c/osmo-ggsn/+/14298 ) Change subject: ggsn: vty: Require ggsn param in cmd .. Patch Set 2: (1 comment) https://gerrit.osmocom.org/#/c/14298/2/ggsn/ggsn_vty.c File ggsn/ggsn_vty.c: https://gerrit.osmocom.org/#/c/14298/2/ggsn/ggsn_vty.c@767 PS2, Line 767: ggsn NAME > I think we should add a hidden / deprecated alias, because this change breaks > backward compatibility […] Indeed it does, but this type of command is not expected to be in VTY cfg files, since it's used to show information, and we don't use it in any TTCN3 test. So it does make sense to me in this case to make more mess in the code by adding a global ggsn variable and assign it to first created ggsn. Still, it seems I need to update doc/manuals/vty/ggsn_vty_reference.xml (first find how to do it). -- To view, visit https://gerrit.osmocom.org/c/osmo-ggsn/+/14298 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-Change-Id: I8357e20076348c8ded5e9f5b8e7252566b0fbfea Gerrit-Change-Number: 14298 Gerrit-PatchSet: 2 Gerrit-Owner: pespin Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: fixeria Gerrit-Reviewer: pespin Gerrit-Comment-Date: Mon, 03 Jun 2019 10:44:02 + Gerrit-HasComments: Yes Gerrit-Has-Labels: No Comment-In-Reply-To: fixeria Gerrit-MessageType: comment
Change in ...osmo-ggsn[master]: ggsn: vty: Require ggsn param in cmd
Vadim Yanitskiy has posted comments on this change. ( https://gerrit.osmocom.org/c/osmo-ggsn/+/14298 ) Change subject: ggsn: vty: Require ggsn param in cmd .. Patch Set 2: Code-Review-1 (1 comment) https://gerrit.osmocom.org/#/c/14298/2/ggsn/ggsn_vty.c File ggsn/ggsn_vty.c: https://gerrit.osmocom.org/#/c/14298/2/ggsn/ggsn_vty.c@767 PS2, Line 767: ggsn NAME I think we should add a hidden / deprecated alias, because this change breaks backward compatibility. -- To view, visit https://gerrit.osmocom.org/c/osmo-ggsn/+/14298 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-Change-Id: I8357e20076348c8ded5e9f5b8e7252566b0fbfea Gerrit-Change-Number: 14298 Gerrit-PatchSet: 2 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Vadim Yanitskiy Gerrit-Comment-Date: Sat, 01 Jun 2019 12:31:15 + Gerrit-HasComments: Yes Gerrit-Has-Labels: Yes Gerrit-MessageType: comment
Change in osmo-ggsn[master]: ggsn: vty: Require ggsn param in cmd
Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/14298 ) Change subject: ggsn: vty: Require ggsn param in cmd .. Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/14298 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I8357e20076348c8ded5e9f5b8e7252566b0fbfea Gerrit-Change-Number: 14298 Gerrit-PatchSet: 2 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (102) Gerrit-Comment-Date: Fri, 31 May 2019 20:45:58 + Gerrit-HasComments: No Gerrit-HasLabels: Yes
Change in osmo-ggsn[master]: ggsn: vty: Require ggsn param in cmd
Pau Espin Pedrol has uploaded this change for review. ( https://gerrit.osmocom.org/14298 Change subject: ggsn: vty: Require ggsn param in cmd .. ggsn: vty: Require ggsn param in cmd Other similar commands already do it. This way we also get rid of deprecated APIs, supporting search when more than one GSN is set up. Related: OS#2873 Change-Id: I8357e20076348c8ded5e9f5b8e7252566b0fbfea --- M ggsn/ggsn_vty.c 1 file changed, 16 insertions(+), 6 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ggsn refs/changes/98/14298/1 diff --git a/ggsn/ggsn_vty.c b/ggsn/ggsn_vty.c index 3f012d2..456f6cb 100644 --- a/ggsn/ggsn_vty.c +++ b/ggsn/ggsn_vty.c @@ -764,25 +764,35 @@ } DEFUN(show_pdpctx_imsi, show_pdpctx_imsi_cmd, - "show pdp-context imsi IMSI [<0-15>]", + "show pdp-context ggsn NAME imsi IMSI [<0-15>]", SHOW_STR "Display information on PDP Context\n" + GGSN_STR "GGSN Name\n" "PDP contexts for given IMSI\n" "PDP context for given NSAPI\n") { - uint64_t imsi = strtoull(argv[0], NULL, 10); + struct ggsn_ctx *ggsn; + uint64_t imsi; unsigned int nsapi; struct pdp_t *pdp; int num_found = 0; - if (argc > 1) { - nsapi = atoi(argv[1]); - if (pdp_getimsi(, imsi, nsapi)) { + ggsn = ggsn_find(argv[0]); + if (!ggsn) { + vty_out(vty, "%% No such GGSN '%s'%s", argv[0], VTY_NEWLINE); + return CMD_WARNING; + } + + imsi = strtoull(argv[1], NULL, 10); + + if (argc > 2) { + nsapi = atoi(argv[2]); + if (gtp_pdp_getimsi(ggsn->gsn, , imsi, nsapi)) { show_one_pdp(vty, pdp); num_found++; } } else { for (nsapi = 0; nsapi < PDP_MAXNSAPI; nsapi++) { - if (pdp_getimsi(, imsi, nsapi)) + if (gtp_pdp_getimsi(ggsn->gsn, , imsi, nsapi)) continue; show_one_pdp(vty, pdp); num_found++; -- To view, visit https://gerrit.osmocom.org/14298 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I8357e20076348c8ded5e9f5b8e7252566b0fbfea Gerrit-Change-Number: 14298 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol