L2 over MPLS
[vpp.git] / src / vnet / fib / fib_table.c
index d50f17f..6b6cc5c 100644 (file)
@@ -505,7 +505,7 @@ fib_table_entry_path_add (u32 fib_index,
                          const fib_prefix_t *prefix,
                          fib_source_t source,
                          fib_entry_flag_t flags,
-                         fib_protocol_t next_hop_proto,
+                         dpo_proto_t next_hop_proto,
                          const ip46_address_t *next_hop,
                          u32 next_hop_sw_if_index,
                          u32 next_hop_fib_index,
@@ -664,7 +664,7 @@ void
 fib_table_entry_path_remove (u32 fib_index,
                             const fib_prefix_t *prefix,
                             fib_source_t source,
-                            fib_protocol_t next_hop_proto,
+                            dpo_proto_t next_hop_proto,
                             const ip46_address_t *next_hop,
                             u32 next_hop_sw_if_index,
                             u32 next_hop_fib_index,
@@ -755,7 +755,7 @@ fib_table_entry_update_one_path (u32 fib_index,
                                 const fib_prefix_t *prefix,
                                 fib_source_t source,
                                 fib_entry_flag_t flags,
-                                fib_protocol_t next_hop_proto,
+                                dpo_proto_t next_hop_proto,
                                 const ip46_address_t *next_hop,
                                 u32 next_hop_sw_if_index,
                                 u32 next_hop_fib_index,
@@ -951,6 +951,22 @@ fib_table_get_flow_hash_config (u32 fib_index,
 
     return (fib->ft_flow_hash_config);
 }
+flow_hash_config_t
+fib_table_get_default_flow_hash_config (fib_protocol_t proto)
+{
+    switch (proto)
+    {
+    case FIB_PROTOCOL_IP4:
+    case FIB_PROTOCOL_IP6:
+       return (IP_FLOW_HASH_DEFAULT);
+
+    case FIB_PROTOCOL_MPLS:
+       return (MPLS_FLOW_HASH_DEFAULT);
+    }
+
+    ASSERT(0);
+    return (IP_FLOW_HASH_DEFAULT);
+}
 
 /**
  * @brief Table set flow hash config context.