Sun, Nov 04, 2018 at 08:33:13PM CET, sven@narfation.org wrote:
The batman-adv configuration interface was implemented solely using sysfs. This approach was condemned by non-batadv developers as "huge mistake". Instead a netlink/genl based implementation was suggested.
The different key-value pairs used for the configuration of batman-adv can be split in three classes (sharing most of the setup code):
This is problematic. In general, TLV approach is frowned upon. What is a usual way of exposing options over netlink are well-defined netlink attributes. For example:
BATADV_ATTR_SOME_THING BATADV_ATTR_ANOTHER_THING
The set and get commands usually work with an object. So if and object have multiple options/attributes, it can we set via a single set command. But this is more free. Depends on what makes more sense.
- mesh interface (the batadv device)
- hard interface specific (the enslaved devices)
- vlan specific (vlan on top of the mesh interface)
For all three, genl commands to get, set and dump are specified. The actual modification of datastructures is then trivial and abstracted away from the genl handing via objects with callbacks (get, validate, set). The option infrastructure is handling the actual retrieval of mesh interface object, hard interface object and vlan object. It takes care of validation and issuing netlink mcast messages back to userspace.
TODO add more description here.