What about specifying the routing algorithm directly on "soft-iface creation" and deny any further change?
Emails crossed in the post....
- specify the soft-iface name => create the interface and allocate all the
structure (that are not dependant on the routing algo)
1.1) the interface is in ALGO-WAITING state, any action that tries to enable it is denied and EBUSY (?) is returned.
We should try to keep backwards compatibility. So rather than having ALGO-WAITING, i would suggest using the first available routing algorithm as the default.
So the backwards compatible way would be:
1) Add a hard interface, which automagically creates the soft interface with the first available routing algorithm.
For those who want to play with new routing algorithms:
1) Create the soft interface 2) Change the routing algorithm away from the default 3) Add the first hard interface.
batctl could be extended to hide some of this, eg.
batctl if add -a ix eth1 eth42
i.e. use routing algorithm ix while adding interfaces eth1 and eth42. batctl could check if the soft interface already exists and throw an error if -a is passed, or at least, if the algorithm is different to the one currently in use.
Andrew