Hello Vadim,
it's just an implementation detail that should not
affect the process of
adding attributes. I came up with the implementation, maybe it would be
easier to understand looking at the code:
Thanks for pointing at the code. I have read through and I think I
understand it now. I have uploaded a patch on how I would add a new
attribute:
https://gerrit.osmocom.org/c/libosmocore/+/20460
There is also still the open question on how we should tag commands that
perform a node change, like this one here:
https://gerrit.osmocom.org/c/osmo-trx/+/20319/1/CommonLibs/trx_vty.c#100
While going through all the commands of osmo-bsc, osmo-mgw, osmo-bts,
osmo-trx and osmo-pcu I have always CMD_ATTR_IMMEDIATE on commands that
change the VTY node, even when the command does nothing except changing
the VTY node (which indeed applies immediately).
In my opinion the VTY commands that change the nodes should be excluded
from the attributes, maybe by puting a CMD_ATTR_EXCLUDE on them. The
reason for this is because those commands are used to walk through the
VTY, they do not set any config value. This is comparable to a tree
structure, where only the leafs are actually of interest.
When looking deeper into this one can find that the things are not as
simple as they may seem. There are VTY commands out there that change
the node and at the same time they allocate an object. Like the trunk
command in osmo-mgw. What should we do with those. If the trunk already
exists, then it is put in the VTY context and the node is changed,
basically nothing happens. There may be commands behind the node where
some apply immediately and where some do require a full restart. What
kind of attribute would we assign the the trunk command? Als here I
would argue to exclude it. In the end the commands perform the
configuration and even if the object is allocated immediately, it still
requires to get configured by the commands and here the final decision
is made whether a full restart is required or not.
best regards.
Philipp
--
Philipp Maier <pmaier(a)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