[PATCH 2/2] Add vty command to explicitly reset given BVCI

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/OpenBSC@lists.osmocom.org/.

Neels Hofmeyr nhofmeyr at sysmocom.de
Fri Mar 18 10:17:39 UTC 2016


On Thu, Mar 17, 2016 at 04:54:58PM +0100, Harald Welte wrote:
> Hi Max,
> 
> On Thu, Mar 17, 2016 at 03:42:27PM +0100, msuraev at sysmocom.de wrote:
> > +DEFUN(bvc_reset, bvc_reset_cmd,
> > +	"bvc reset nsei <0-65535> bvci <0-65535>",
> 
> [...]
> 
> > +	if (!strcmp(argv[0], "reset"))
> > +		return CMD_WARNING;
> 
> no need to do this.  the generic vty parser code will make sure that you
> don't end up here if the command doesn't match the synfax above.
> 
> > +	if (argc != 2)
> > +		return CMD_WARNING;
> 
> same here.  If the number of arguments is not the number of mandatory
> arguments, you will never get called.

I used to do the same kind of checking for my first VTY commands, until I
figured out that all of the formatting is already checked ;)
Quite handy.

~Neels

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.osmocom.org/pipermail/openbsc/attachments/20160318/75745ec6/attachment.bin>


More information about the OpenBSC mailing list