Adjacency walk more scalable
When walking all adjacencies for a given {next-hop,interface} instead of
walking all the adjacencies on that interface and matching the next-hop
(which is O(n) in the number of adjacencies on that link, find all instances
of an adjacency with any link-type and wtih that {next-hop,interfacE} pair:
this is O(1).
Change-Id: Ic80399fc9e93c8df111379c039e592d8cafbab18
Signed-off-by: Neale Ranns <nranns@cisco.com>
diff --git a/src/vnet/interface.h b/src/vnet/interface.h
index 7556bc5..b7b350f 100644
--- a/src/vnet/interface.h
+++ b/src/vnet/interface.h
@@ -296,6 +296,11 @@
[VNET_LINK_NSH] = "nsh", \
}
+#define FOR_EACH_VNET_LINK(_link) \
+ for (_link = VNET_LINK_IP4; \
+ _link <= VNET_LINK_NSH; \
+ _link++)
+
/**
* @brief Number of link types. Not part of the enum so it does not have to be included in
* switch statements