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/.
Max gerrit-no-reply at lists.osmocom.orgReview at https://gerrit.osmocom.org/274 Fix retrieving rate_ctr over control interface Allow getting either particular counter (e. g. rate_ctr.per_hour.e1inp.0.hdlc.abort) or entire rate counter group for a given index (e. g. rate_ctr.per_hour.e1inp.0). Change-Id: I2b0109536170f7b5388d3236df30b98f457aa98d Fixes: OS#1730 --- M src/ctrl/control_if.c 1 file changed, 7 insertions(+), 13 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/74/274/1 diff --git a/src/ctrl/control_if.c b/src/ctrl/control_if.c index bde245d..6d9a9fb 100644 --- a/src/ctrl/control_if.c +++ b/src/ctrl/control_if.c @@ -552,35 +552,29 @@ } ctr_group = strtok_r(NULL, ".", &saveptr); - tmp = strtok_r(NULL, ".", &saveptr); - if (!ctr_group || !tmp) { + ctr_idx = strtok_r(NULL, ".", &saveptr); + if (!ctr_group || !ctr_idx) { talloc_free(dup); - cmd->reply = "Counter group must be of form a.b"; + cmd->reply = "Counter group must be of name.index form e. g. " + "e1inp.0"; goto err; } - ctr_group[strlen(ctr_group)] = '.'; - ctr_idx = strtok_r(NULL, ".", &saveptr); - if (!ctr_idx) { - talloc_free(dup); - return get_rate_ctr_group(ctr_group, intv, cmd); - } idx = atoi(ctr_idx); ctrg = rate_ctr_get_group_by_name_idx(ctr_group, idx); if (!ctrg) { talloc_free(dup); - cmd->reply = "Counter group not found."; + cmd->reply = "Counter group with given name and index not found"; goto err; } - ctr_name = strtok_r(NULL, "\0", &saveptr); - if (!ctr_name) { + if (!strlen(saveptr)) { talloc_free(dup); return get_rate_ctr_group_idx(ctrg, intv, cmd); } - ctr = rate_ctr_get_by_name(ctrg, ctr_name); + ctr = rate_ctr_get_by_name(ctrg, saveptr); if (!ctr) { cmd->reply = "Counter name not found."; talloc_free(dup); -- To view, visit https://gerrit.osmocom.org/274 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I2b0109536170f7b5388d3236df30b98f457aa98d Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Max <msuraev at sysmocom.de>