RFC: generic CTRL interface for VTY config settings

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/.

Pau Espin Pedrol pespin at sysmocom.de
Wed Feb 17 21:30:25 UTC 2021


Hi,

 >    SET network|bts.0|trx.1|timeslot.0|training_sequence_code 3
 > or
 >    SET network#bts.0#trx.1#timeslot.0#training_sequence_code 3

I'd probably go for this one from all the ones you proposed. This way, 
you keep the usual CTRL structure ("." separating/slitting parameters), 
while you simply add a new character to specify "levels" or "nodes" (as 
per VTY terminology).

Hence, each node is parsed the same way as the final command, and you 
can "easily" feed that into navigating the existing VTY tree. Example in 
pythonic way:

str = "network|bts.0|trx.1|timeslot.0|training_sequence_code 3"
nodes = str.split('|')
for node in nodes:
   argv = node.split('.')
   if attempt_to_match_vty_node_or_command(argv) < 0:
    return cmd_reply_error;
return

The question here is how to define information in code to apply 
getter/setters for CTRL commands...

I also find that the CTRL format in general is a bit restraining, both 
in specifying parameters, etc. as well as in reply content.
Somebody may not like the idea, (and may be not directly related to the 
topic at hand), but perhaps looking at something similar to a REST 
interface which provides json output and which can easily be interacted 
using python or even curl directly.
REST interface provides already way to provide levels/nodes (URL 
directories)as well as parameters "?foo=bar&hello=bye").
So using HTTP may not be needed, but it may make sense to reuse some 
REST related ideas, like URLs and json output (with C implementation in 
1 file like cjson).

Regards,
Pau

-- 
- Pau Espin Pedrol <pespin at sysmocom.de>         http://www.sysmocom.de/
=======================================================================
* sysmocom - systems for mobile communications GmbH
* Alt-Moabit 93
* 10559 Berlin, Germany
* Sitz / Registered office: Berlin, HRB 134158 B
* Geschaeftsfuehrer / Managing Director: Harald Welte



More information about the OpenBSC mailing list