This is the *seventh* version of the "improved routing abstraction" patchset.
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.
****** API functions changed starting from v4 ******
+ neigh comparison related:
+ orig_node related:
- bat_orig_print: print the originator table
Changes from v1:
- removed bat_metric_compare() API. This is not really useful since we are
assuming all the metrics are in the same domain (uint32_t) so a simple
comparison is more than enough.
Changes from v2:
- initialise best_metric in the neighbor purging routine
- don't optimise ntohs. Will be done in a separate patch
Changes from v3:
- bat_metric_is_equiv_or_better is now called bat_neigh_is_equiv_or_better and
now directly takes two neigh_node as parameters. This allows to do not export
the metric at all: all the metric magic is handled inside the function.
- bat_metric_compare has been re-introduced again with the bat_neigh_cmp name. As
for bat_neigh_is_equiv_or_better it also takes two neigh_node as parameters
and the metric is handled inside only.
- as result of the two changes above bat_metric_get has been removed. The
metric is always handled inside the routing protocol code and there is no need
to export it to the rest of the module. This simplified the code and reduced
code duplication. (Thanks Marek for the hint!)
Changes from v4:
- fixed typ0 in 9/9
Changes from v5:
- add neigh_node to the neighbor list only after having completed the whole
initialisation phase (in 1/9)
Changes from v6:
- remove misplaced hlist_add_head_rcu() in batadv_neigh_node_new()
- add a newly created orig_node to the originator hash at the end of
batadv_iv_ogm_orig_get() rather than inside of batadv_orig_node_new(). In this
way the originator is added only after having been completely initialised.
- fix bat_neigh_is_equiv_or_better doc
- fix bat_neigh_is_equiv_or_better implementation in bat_iv: the comparison was
not done in the correct way.
Antonio Quartulli (9):
batman-adv: make struct batadv_neigh_node algorithm agnostic
batman-adv: make struct batadv_orig_node algorithm agnostic
batman-adv: add bat_orig_print API function
batman-adv: add bat_neigh_cmp API function
batman-adv: add bat_neigh_is_equiv_or_better API function
batman-adv: adapt bonding to use the new API functions
batman-adv: adapt the neighbor purging routine to use the new API
batman-adv: provide orig_node routing API
batman-adv: adapt the TT component to use the new API functions
bat_iv_ogm.c | 399 ++++++++++++++++++++++++++++++++++++++++++++--------
gateway_client.c | 16 +--
main.c | 4 +-
main.h | 6 +
network-coding.c | 8 +-
originator.c | 220 +++++++++--------------------
originator.h | 6 +-
routing.c | 39 +++--
routing.h | 3 +-
translation-table.c | 35 +++--
types.h | 92 ++++++++----
11 files changed, 559 insertions(+), 269 deletions(-)