aboutsummaryrefslogtreecommitdiffstats
path: root/vnet/vnet/ip/lookup.h
diff options
context:
space:
mode:
authorDamjan Marion <damarion@cisco.com>2016-03-29 13:18:17 +0200
committerGerrit Code Review <gerrit@fd.io>2016-04-01 10:38:42 +0000
commit102ec52bc41c630f011884250e0f20ea49ac6d33 (patch)
tree089e710419690fb4714d765ba4dc8f3288a67d4d /vnet/vnet/ip/lookup.h
parentb02e49c4be32c5092f6948d40f84a9e2aeae66e6 (diff)
Add support for installing ipv4 routes via unresolved next hop
Change-Id: I71f3ba0c8192fe0ac3b5b81fb1275b64ec02876a Signed-off-by: Damjan Marion <damarion@cisco.com>
Diffstat (limited to 'vnet/vnet/ip/lookup.h')
-rw-r--r--vnet/vnet/ip/lookup.h29
1 files changed, 29 insertions, 0 deletions
diff --git a/vnet/vnet/ip/lookup.h b/vnet/vnet/ip/lookup.h
index ba242ef5de4..fcac675d899 100644
--- a/vnet/vnet/ip/lookup.h
+++ b/vnet/vnet/ip/lookup.h
@@ -42,6 +42,7 @@
#include <vnet/vnet.h>
#include <vlib/buffer.h>
+#include <vnet/ip/ip4_packet.h>
/* Next index stored in adjacency. */
typedef enum {
@@ -133,6 +134,13 @@ typedef struct {
u16 saved_lookup_next_index;
union {
+ /* IP_LOOKUP_NEXT_ARP only */
+ struct {
+ union {
+ ip4_address_t ip4;
+ } next_hop;
+ u32 next_adj_index_with_same_next_hop;
+ } arp;
/* IP_LOOKUP_NEXT_CLASSIFY only */
struct {
u16 table_index;
@@ -391,6 +399,13 @@ do { \
CLIB_PREFETCH (_adj, sizeof (_adj[0]), type); \
} while (0)
+static inline void
+ip_register_add_del_adjacency_callback(ip_lookup_main_t * lm,
+ ip_add_del_adjacency_callback_t cb)
+{
+ vec_add1(lm->add_del_adjacency_callbacks, cb);
+}
+
always_inline void
ip_call_add_del_adjacency_callbacks (ip_lookup_main_t * lm, u32 adj_index, u32 is_del)
{
@@ -409,6 +424,20 @@ ip_add_adjacency (ip_lookup_main_t * lm,
u32 * adj_index_result);
void ip_del_adjacency (ip_lookup_main_t * lm, u32 adj_index);
+void
+ip_update_adjacency (ip_lookup_main_t * lm,
+ u32 adj_index,
+ ip_adjacency_t * copy_adj);
+
+static inline int
+ip_adjacency_is_multipath(ip_lookup_main_t * lm, u32 adj_index)
+{
+ if (vec_len(lm->multipath_adjacencies) < adj_index - 1)
+ return 0;
+
+ return (lm->multipath_adjacencies[adj_index].adj_index == adj_index &&
+ lm->multipath_adjacencies[adj_index].n_adj_in_block > 0);
+}
void
ip_multipath_adjacency_free (ip_lookup_main_t * lm,