Feature #5631

Updated by pespin 2 months ago

Some time ago, I submitted a patch to allow submitting number ranges not only as decimal, but also as hexadecimal or octal: 
 However, it was never merged. 

 Today a similar topic was raised again due to SMSCB Message IDs being printed in the vty "show messages" command as hexadecimal (and without 0x prefix) while the "show message ID" only accepted decimal numbers, which makes the user experience really confusing (I even spent some time debugging why "show message ID" was saying no message existing and I was seeing it in the list). 

 It was also raised that cisco console seems to also support hex numbers, see for instance "lac" in 
 Supporting ranges in hexadecimal would also us to set stuff like lac as hexadecimal, and even store the config that way, because the vty would be able to read it back. 

 Similary, supporting octal would allow us to easily specify file permissions bitmaks in the VTY. 

 I see 2 main options to support those: 
 1- Specify range parameters as decimal ranges (ex: <0-200>) but allowing passing any format of integer (dec, hex, oct) by specifying the format prefix. That's what the libosmocore patch above adds support for. 
 For instance: 
 * cmd definition: "lac <0-6534324>" 
 * cmd write: "lac 0x30" 

 2- Specify accepted range formats explicitly. This means each param needs to be more detailed but also allows accepting specific formats on specific parameters. For instance, one would allow only decimal and hex in lac cmd: "lac (<0-6534324>|<0x0-0x4352>), or only accept hex: "lac <0x0-0x4352>" 

 I'm happy with any of the two above. Let's see what others want to say about it.


Add picture from clipboard (Maximum size: 48.8 MB)