[Olsr-users] multiple domains in olsrv2
Henning Rogge
(spam-protected)
Thu Oct 4 16:53:22 CEST 2018
On Thu, Oct 4, 2018 at 3:58 PM nemesis <(spam-protected)> wrote:
> permit me to step-in in the conversation.
Sure...
> I think it's better to avoid using section names to determine software
> configuration.
> In my understanding the names of UCI section are a kind of ID which is
> designed
> to allow updating specific configuration objects by referring to them
> via this ID.
> That means we shouldn't use the UCI ID in place of the name config
> option because that's
> not how that internal feature of UCI is meant to be used.
> Yes it means to have a bit of redundancy if you want the section to
> have the same name you use,
> for the option name, but it's not a big deal if this redundancy is
> managed by an automated system.
> Non automated systems can do without the UCI name entirely.
Yes, that is the trouble with UCI.
> That said, Henning, why is the code not working if the section is
> named?
Because Olsrd2 uses names sections A LOT... long before I ever wrote
the "read UCI config" glue code to libuci.
Olsrd2 has a three-level key-value map for configuration.
Section types, which includes names ("no name is allowed for some
section), which include keys, which get you the value.
> That doesn't sound like something which is meant to happen and I think
> it would surely help OLSRd2 if this is avoided.
Sorry, this is not possible...
the interface section (as an example) uses the name to specify the interface.
> I am not using the C bindings to manipulate UCI configurations, I'm
> only using lua and shell to do that,
> but in my understanding the lua bindings are using the C library under
> the hood.
> With the lua bindings I am still able to loop over configuration types,
> even if they do have a name.
> Can we do something similar in this case?
You can most likely just loop over them by index and look for the
names yourself.
> Could you share the piece of code that deals with this part so we can
> take a look at it?
https://github.com/OLSR/OONF/blob/master/src/generic/cfg_uciloader/cfg_uciloader.c
this is the glue to libuci that translates the "text blob" into
section-type/section-name/key/value tuples.
Henning
More information about the Olsr-users
mailing list