On Montag, 5. November 2018 11:17:08 CET Jiri Pirko wrote:
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.
Hm, so you first say that I should not do that and then say that it can be done because it operates on the same object? Classes in my description are basically your object.
But let assume for now that you don't want to use this approach, we can also have for example something like:
BATADV_CMD_SET_BRIDGE_LOOP_AVOIDANCE which then receives either one or no flag BATADV_ATTR_BRIDGE_LOOP_AVOIDANCE to enable/disable bridge loop avoidance. And a command BATADV_CMD_GET_BRIDGE_LOOP_AVOIDANCE which tells the client using BATADV_ATTR_BRIDGE_LOOP_AVOIDANCE whether it was enabled or not. A dump functionality for all options for this batadv object/class would then not exist.
Kind regards, Sven