aboutsummaryrefslogtreecommitdiffstats
path: root/src/vnet/lisp-cp
diff options
context:
space:
mode:
authorFlorin Coras <fcoras@cisco.com>2017-02-13 23:55:27 -0800
committerDamjan Marion <dmarion.lists@gmail.com>2017-02-16 16:24:19 +0000
commitb69111e167f5be70b3721ed5c2e5e02b971c3f67 (patch)
treee6bbd56317bb0dfbb2f00adb1b7a6e74d43664a8 /src/vnet/lisp-cp
parent6085e16d924f12d57779d7d7692016ec9fc19a9d (diff)
Add NSH load-balance and drop DPO
Also adds missing gpe nsh address type functions. Change-Id: I3353a23c0518da9ce3b221ddf8c5bd0364930154 Signed-off-by: Florin Coras <fcoras@cisco.com>
Diffstat (limited to 'src/vnet/lisp-cp')
-rw-r--r--src/vnet/lisp-cp/lisp_types.c43
1 files changed, 34 insertions, 9 deletions
diff --git a/src/vnet/lisp-cp/lisp_types.c b/src/vnet/lisp-cp/lisp_types.c
index 4a3d05b70ed..b6466686009 100644
--- a/src/vnet/lisp-cp/lisp_types.c
+++ b/src/vnet/lisp-cp/lisp_types.c
@@ -31,16 +31,16 @@ typedef int (*cmp_fct) (void *, void *);
size_to_write_fct size_to_write_fcts[GID_ADDR_TYPES] =
{ ip_prefix_size_to_write, lcaf_size_to_write, mac_size_to_write,
- sd_size_to_write
+ sd_size_to_write, nsh_size_to_write
};
serdes_fct write_fcts[GID_ADDR_TYPES] =
- { ip_prefix_write, lcaf_write, mac_write, sd_write };
+ { ip_prefix_write, lcaf_write, mac_write, sd_write, nsh_write };
cast_fct cast_fcts[GID_ADDR_TYPES] =
- { ip_prefix_cast, lcaf_cast, mac_cast, sd_cast };
+ { ip_prefix_cast, lcaf_cast, mac_cast, sd_cast, nsh_cast };
addr_len_fct addr_len_fcts[GID_ADDR_TYPES] =
- { ip_prefix_length, lcaf_length, mac_length, sd_length };
+ { ip_prefix_length, lcaf_length, mac_length, sd_length, nsh_length };
copy_fct copy_fcts[GID_ADDR_TYPES] =
- { ip_prefix_copy, lcaf_copy, mac_copy, sd_copy };
+ { ip_prefix_copy, lcaf_copy, mac_copy, sd_copy, nsh_copy };
#define foreach_lcaf_type \
_(1, no_addr) \
@@ -951,15 +951,15 @@ mac_copy (void *dst, void *src)
}
void
-nsh_copy (void *dst, void *src)
+sd_copy (void *dst, void *src)
{
- clib_memcpy (dst, src, sizeof (nsh_t));
+ clib_memcpy (dst, src, sizeof (source_dest_t));
}
void
-sd_copy (void *dst, void *src)
+nsh_copy (void *dst, void *src)
{
- clib_memcpy (dst, src, sizeof (source_dest_t));
+ clib_memcpy (dst, src, sizeof (nsh_t));
}
int
@@ -1031,6 +1031,12 @@ sd_length (void *a)
return 0;
}
+u8
+nsh_length (void *a)
+{
+ return 0;
+}
+
void *
lcaf_cast (gid_address_t * a)
{
@@ -1049,6 +1055,12 @@ sd_cast (gid_address_t * a)
return &gid_address_sd (a);
}
+void *
+nsh_cast (gid_address_t * a)
+{
+ return &gid_address_nsh (a);
+}
+
u8
no_addr_length (void *a)
{
@@ -1168,6 +1180,13 @@ sd_write (u8 * p, void *a)
}
u16
+nsh_write (u8 * p, void *a)
+{
+ clib_warning ("not done");
+ return 0;
+}
+
+u16
vni_write (u8 * p, void *a)
{
lcaf_hdr_t _h, *h = &_h;
@@ -1287,6 +1306,12 @@ mac_size_to_write (void *a)
return sizeof (u16) + 6;
}
+u16
+nsh_size_to_write (void *a)
+{
+ return sizeof (u16) + 4;
+}
+
u8
gid_address_len (gid_address_t * a)
{