Code Review
/
vpp.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
review
|
tree
raw
|
inline
| side by side
ip: Protocol Independent IP Neighbors
[vpp.git]
/
src
/
vnet
/
fib
/
fib_types.c
diff --git
a/src/vnet/fib/fib_types.c
b/src/vnet/fib/fib_types.c
index
386aece
..
c859913
100644
(file)
--- a/
src/vnet/fib/fib_types.c
+++ b/
src/vnet/fib/fib_types.c
@@
-18,6
+18,7
@@
#include <vnet/fib/fib_types.h>
#include <vnet/fib/fib_internal.h>
#include <vnet/fib/fib_table.h>
#include <vnet/fib/fib_types.h>
#include <vnet/fib/fib_internal.h>
#include <vnet/fib/fib_table.h>
+#include <vnet/mfib/mfib_types.h>
#include <vnet/mpls/mpls.h>
/*
#include <vnet/mpls/mpls.h>
/*
@@
-101,6
+102,13
@@
fib_prefix_from_mpls_label (mpls_label_t label,
pfx->fp_eos = eos;
}
pfx->fp_eos = eos;
}
+void
+fib_prefix_copy (fib_prefix_t *dst,
+ const fib_prefix_t *src)
+{
+ memcpy(dst, src, sizeof(*dst));
+}
+
int
fib_prefix_cmp (const fib_prefix_t *p1,
const fib_prefix_t *p2)
int
fib_prefix_cmp (const fib_prefix_t *p1,
const fib_prefix_t *p2)
@@
-158,6
+166,21
@@
fib_prefix_is_cover (const fib_prefix_t *p1,
return (0);
}
return (0);
}
+u8
+fib_prefix_get_host_length (fib_protocol_t proto)
+{
+ switch (proto)
+ {
+ case FIB_PROTOCOL_IP4:
+ return (32);
+ case FIB_PROTOCOL_IP6:
+ return (128);
+ case FIB_PROTOCOL_MPLS:
+ return (21);
+ }
+ return (0);
+}
+
int
fib_prefix_is_host (const fib_prefix_t *prefix)
{
int
fib_prefix_is_host (const fib_prefix_t *prefix)
{
@@
-434,7
+457,7
@@
uword
unformat_fib_route_path (unformat_input_t * input, va_list * args)
{
fib_route_path_t *rpath = va_arg (*args, fib_route_path_t *);
unformat_fib_route_path (unformat_input_t * input, va_list * args)
{
fib_route_path_t *rpath = va_arg (*args, fib_route_path_t *);
-
u32 *payload_proto = va_arg (*args, u32
*);
+
dpo_proto_t *payload_proto = va_arg (*args, void
*);
u32 weight, preference, udp_encap_id, fi;
mpls_label_t out_label;
vnet_main_t *vnm;
u32 weight, preference, udp_encap_id, fi;
mpls_label_t out_label;
vnet_main_t *vnm;
@@
-609,6
+632,9
@@
unformat_fib_route_path (unformat_input_t * input, va_list * args)
rpath->frp_weight = 1;
rpath->frp_flags |= FIB_ROUTE_PATH_LOCAL;
}
rpath->frp_weight = 1;
rpath->frp_flags |= FIB_ROUTE_PATH_LOCAL;
}
+ else if (unformat (input, "%U",
+ unformat_mfib_itf_flags, &rpath->frp_mitf_flags))
+ ;
else if (unformat (input, "out-labels"))
{
while (unformat (input, "%U",
else if (unformat (input, "out-labels"))
{
while (unformat (input, "%U",