Message ID | 1459776656-31929-2-git-send-email-msuraev@sysmocom.de |
---|---|
State | Superseded |
Headers | show |
> On 04 Apr 2016, at 15:30, msuraev@sysmocom.de wrote: > > From: Max <msuraev@sysmocom.de> > > Add command 'show nat bsc' to display number of configured BSCs. Thank you for moving this to a separate patch. > +DEFUN(show_nat_bsc, show_nat_bsc_cmd, "show nat bsc", > + SHOW_STR "Display NAT configuration details\n" > + "BSCs-related\n") > +{ > + vty_out(vty, "%d BSCs configured%s", _nat->num_bsc, VTY_NEWLINE); > + return CMD_SUCCESS; > +} If somebody asked me what "show nat bsc" would do, I would not have guessed it prints a number. Can you think of a better name? "show nat configured-bsc-count"? "show nat bscs-configured"? "show nat num-bscs-configured"? kind regards holger
diff --git a/openbsc/src/osmo-bsc_nat/bsc_nat_vty.c b/openbsc/src/osmo-bsc_nat/bsc_nat_vty.c index cd8293c..96559b0 100644 --- a/openbsc/src/osmo-bsc_nat/bsc_nat_vty.c +++ b/openbsc/src/osmo-bsc_nat/bsc_nat_vty.c @@ -204,6 +204,14 @@ DEFUN(show_sccp, show_sccp_cmd, "show sccp connections", return CMD_SUCCESS; } +DEFUN(show_nat_bsc, show_nat_bsc_cmd, "show nat bsc", + SHOW_STR "Display NAT configuration details\n" + "BSCs-related\n") +{ + vty_out(vty, "%d BSCs configured%s", _nat->num_bsc, VTY_NEWLINE); + return CMD_SUCCESS; +} + DEFUN(show_bsc, show_bsc_cmd, "show bsc connections", SHOW_STR BSC_STR "All active connections\n") @@ -1169,6 +1177,7 @@ int bsc_nat_vty_init(struct bsc_nat *nat) /* show commands */ install_element_ve(&show_sccp_cmd); install_element_ve(&show_bsc_cmd); + install_element_ve(&show_nat_bsc_cmd); install_element_ve(&show_bsc_cfg_cmd); install_element_ve(&show_stats_cmd); install_element_ve(&show_stats_lac_cmd);
From: Max <msuraev@sysmocom.de> Add command 'show nat bsc' to display number of configured BSCs. Sponsored-by: On-Waves ehf --- openbsc/src/osmo-bsc_nat/bsc_nat_vty.c | 9 +++++++++ 1 file changed, 9 insertions(+)