Hello list,
After two iterations of this patchset as RFC, I'm here sending the first real PATCH series :)
This patchset is introducing a new set of routing API functions meant to improve the routing protocol abstraction.
Also the orig_node and the neigh_node structure have been heavily modified in order to split their generic members from those which are metric related.
(the rest of the message is what you already had in the RFC cover letter).
This changes have been written while developing batman V. The latter helped me in understanding what batman iv and v have in common and what not.
The main problem was the metric: the two protocols use different metric domains and different semantics. Therefore all the functions handling/printing the metric needed to be generalised and rearranged to let the protocols decide what to do.
Another issue was the way routing protocols handle the orig and neigh node structures. Also these two have been changed and some small APIs have been provided as well.
Moreover, after Simon's RFC about the new multi-interface optimisation, we saw the need for a better abstraction so that mechanisms like that could easily be re-used by new algorithms (like batman v) with little effort.
This is the second version of this RFC where I introduced some changes to the names of some functions and some other minor changes discussed in the previous RFC thread.
+ metric related: - bat_metric_get - bat_metric_is_equiv_or_better - bat_metric_compare
+ orig_node related: - bat_orig_print: print the originator table - bat_orig_free - bat_orig_add_if - bat_orig_del_if
Cheers,
Antonio Quartulli (10): batman-adv: make struct batadv_neigh_node algorithm agnostic batman-adv: make struct batadv_orig_node algorithm agnostic batman-adv: add bat_orig_print function API batman-adv: add bat_metric_get API function batman-adv: add bat_metric_is_equiv_or_better API function batman-adv: add bat_metric_compare API function batman-adv: adapt bonding to use the new API functions batman-adv: adapt the neighbor purging routine to use the new API functions batman-adv: provide orig_node routing API batman-adv: adapt the TT component to use the new API functions
bat_iv_ogm.c | 358 +++++++++++++++++++++++++++++++++++++++++++--------- gateway_client.c | 16 +-- main.c | 5 +- main.h | 6 + network-coding.c | 8 +- originator.c | 230 +++++++-------------------------- originator.h | 5 +- routing.c | 35 +++-- routing.h | 3 +- translation-table.c | 31 +++-- types.h | 85 +++++++++---- 11 files changed, 476 insertions(+), 306 deletions(-)