fixeria has submitted this change. ( https://gerrit.osmocom.org/c/libosmo-abis/+/36342?usp=email )
Change subject: e1line_dump_vty(): dump keepalive state and params ...................................................................... e1line_dump_vty(): dump keepalive state and params There is currently no obvious way to know if the keepalive is enabled and which parameters are in use. Executing 'show running-config' command in the VTY would not always reveal the current configuration, because it tends to omit parameters with default values. Let's print the keepalive state and params in the output of the 'show e1_line' command. Below is a few examples: ! keepalive is disabled OsmoBSC# show e1_line E1 Line Number 0, Name , Driver ipa Keepalive: disabled IPA Keepalive: disabled ! TCP Keepalive is enabled (default) OsmoBSC# show e1_line E1 Line Number 0, Name , Driver ipa Keepalive: enabled Number of probes: (driver's default) Idle timeout: (driver's default) Probe interval: (driver's default) IPA Keepalive: disabled ! TCP and IPA keepalive enabled (custom params) OsmoBSC# show e1_line E1 Line Number 0, Name , Driver ipa Keepalive: enabled Number of probes: 2 Idle timeout: 1s Probe interval: 3s IPA Keepalive: enabled Interval: 2s Timeout: 10s Note that in the case of TCP keepalive with default parameters we cannot retrieve the actual defaults because that would be a layering violation. Thus we say "(driver's default)". Change-Id: I17bd991850333ee794ab216f474b5e045fb01fa3 Related: OS#6375, SYS#6801 --- M src/e1_input_vty.c 1 file changed, 95 insertions(+), 0 deletions(-) Approvals: osmith: Looks good to me, approved pespin: Looks good to me, but someone else must approve Jenkins Builder: Verified diff --git a/src/e1_input_vty.c b/src/e1_input_vty.c index ca45f93..b1898dd 100644 --- a/src/e1_input_vty.c +++ b/src/e1_input_vty.c @@ -457,12 +457,59 @@ return CMD_SUCCESS; } +static void e1line_ka_dump_vty(struct vty *vty, const struct e1inp_line *line) +{ + if (line->keepalive_num_probes == 0) { + vty_out(vty, "Keepalive: disabled%s", VTY_NEWLINE); + return; + } + + vty_out(vty, "Keepalive: enabled%s", VTY_NEWLINE); + + vty_out(vty, " Number of probes: "); + if (line->keepalive_num_probes != E1INP_USE_DEFAULT) + vty_out(vty, "%d", line->keepalive_num_probes); + else + vty_out(vty, "(driver's default)"); + vty_out(vty, "%s", VTY_NEWLINE); + + vty_out(vty, " Idle timeout: "); + if (line->keepalive_idle_timeout != E1INP_USE_DEFAULT) + vty_out(vty, "%ds", line->keepalive_idle_timeout); + else + vty_out(vty, "(driver's default)"); + vty_out(vty, "%s", VTY_NEWLINE); + + vty_out(vty, " Probe interval: "); + if (line->keepalive_probe_interval != E1INP_USE_DEFAULT) + vty_out(vty, "%ds", line->keepalive_probe_interval); + else + vty_out(vty, "(driver's default)"); + vty_out(vty, "%s", VTY_NEWLINE); +} + +static void e1line_ipa_ka_dump_vty(struct vty *vty, const struct e1inp_line *line) +{ + if (line->ipa_kap == NULL) { + vty_out(vty, "IPA Keepalive: disabled%s", VTY_NEWLINE); + return; + } + + vty_out(vty, "IPA Keepalive: enabled%s", VTY_NEWLINE); + vty_out(vty, " Interval: %us%s", line->ipa_kap->interval, VTY_NEWLINE); + vty_out(vty, " Timeout: %us%s", line->ipa_kap->wait_for_resp, VTY_NEWLINE); +} + static void e1line_dump_vty(struct vty *vty, struct e1inp_line *line, int stats) { vty_out(vty, "E1 Line Number %u, Name %s, Driver %s%s", line->num, line->name ? line->name : "", line->driver->name, VTY_NEWLINE); + if (line->driver->has_keepalive) + e1line_ka_dump_vty(vty, line); + if (!strcmp(line->driver->name, "ipa")) + e1line_ipa_ka_dump_vty(vty, line); if (line->pcap_file) vty_out(vty, "PCAP %s%s", line->pcap_file, VTY_NEWLINE); if (line->driver->vty_show) -- To view, visit https://gerrit.osmocom.org/c/libosmo-abis/+/36342?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmo-abis Gerrit-Branch: master Gerrit-Change-Id: I17bd991850333ee794ab216f474b5e045fb01fa3 Gerrit-Change-Number: 36342 Gerrit-PatchSet: 1 Gerrit-Owner: fixeria <vyanits...@sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: fixeria <vyanits...@sysmocom.de> Gerrit-Reviewer: osmith <osm...@sysmocom.de> Gerrit-Reviewer: pespin <pes...@sysmocom.de> Gerrit-MessageType: merged