aboutsummaryrefslogtreecommitdiffstats
path: root/src/vnet/fib/fib_entry.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/vnet/fib/fib_entry.c')
-rw-r--r--src/vnet/fib/fib_entry.c50
1 files changed, 34 insertions, 16 deletions
diff --git a/src/vnet/fib/fib_entry.c b/src/vnet/fib/fib_entry.c
index 6ac5461d76c..dac1fce995f 100644
--- a/src/vnet/fib/fib_entry.c
+++ b/src/vnet/fib/fib_entry.c
@@ -99,7 +99,6 @@ format_fib_entry (u8 * s, va_list * args)
fib_entry_src_t *src;
fib_node_index_t fei;
fib_source_t source;
- u32 n_covered;
int level;
fei = va_arg (*args, fib_node_index_t);
@@ -143,14 +142,6 @@ format_fib_entry (u8 * s, va_list * args)
}
}));
- n_covered = fib_entry_cover_get_size(fib_entry);
- if (n_covered > 0) {
- s = format(s, "\n tracking %d covered: ", n_covered);
- s = fib_entry_cover_list_format(fib_entry, s);
- }
- s = fib_ae_import_format(fib_entry, s);
- s = fib_ae_export_format(fib_entry, s);
-
s = format (s, "\n forwarding: ");
}
else
@@ -179,20 +170,17 @@ format_fib_entry (u8 * s, va_list * args)
fib_entry_delegate_type_t fdt;
fib_entry_delegate_t *fed;
- FOR_EACH_DELEGATE_CHAIN(fib_entry, fdt, fed,
+ s = format (s, " Delegates:\n");
+ FOR_EACH_DELEGATE(fib_entry, fdt, fed,
{
- s = format(s, " %U-chain\n %U",
- format_fib_forw_chain_type,
- fib_entry_delegate_type_to_chain_type(fdt),
- format_dpo_id, &fed->fd_dpo, 2);
- s = format(s, "\n");
+ s = format(s, " %U\n", format_fib_entry_deletegate, fed);
});
}
}
if (level >= FIB_ENTRY_FORMAT_DETAIL2)
{
- s = format(s, "\nchildren:");
+ s = format(s, " Children:");
s = fib_node_children_format(fib_entry->fe_node.fn_children, s);
}
@@ -1339,6 +1327,36 @@ fib_entry_get_best_source (fib_node_index_t entry_index)
return (fib_entry_src_get_source(bsrc));
}
+/**
+ * Return !0 is the entry is reoslved, i.e. will return a valid forwarding
+ * chain
+ */
+int
+fib_entry_is_resolved (fib_node_index_t fib_entry_index)
+{
+ fib_entry_delegate_t *fed;
+ fib_entry_t *fib_entry;
+
+ fib_entry = fib_entry_get(fib_entry_index);
+
+ fed = fib_entry_delegate_get(fib_entry, FIB_ENTRY_DELEGATE_BFD);
+
+ if (NULL == fed)
+ {
+ /*
+ * no BFD tracking - resolved
+ */
+ return (!0);
+ }
+ else
+ {
+ /*
+ * defer to the state of the BFD tracking
+ */
+ return (FIB_BFD_STATE_UP == fed->fd_bfd_state);
+ }
+}
+
static int
fib_ip4_address_compare (const ip4_address_t * a1,
const ip4_address_t * a2)