summaryrefslogtreecommitdiffstats
path: root/nsh-plugin/nsh/nsh_test.c
diff options
context:
space:
mode:
authorHongjun Ni <hongjun.ni@intel.com>2017-01-22 23:41:33 +0800
committerHongjun Ni <hongjun.ni@intel.com>2017-03-10 23:22:32 +0800
commita865240bfc157e06699319e39251e3653ca205f5 (patch)
tree7a85bd11ce162e2e2ad7220103b01ce207cf14ac /nsh-plugin/nsh/nsh_test.c
parent3f3ac79b962de5c1be97c6fa7a0cd815379b419f (diff)
Restructure code to support both md-type1 and md-type2
Basic support to both MD1 and MD2 MD1 configuration: create nsh entry nsp 185 nsi 255 md-type 1 c1 1 c2 2 c3 3 c4 4 next-ethernet MD2 configuration: create nsh entry nsp 185 nsi 254 md-type 2 pot next-ethernet Change-Id: Ide0fdc122d76cb6a55643a15febd985bd41981b0 Signed-off-by: Hongjun Ni <hongjun.ni@intel.com> Signed-off-by: Vengada <venggovi@cisco.com>
Diffstat (limited to 'nsh-plugin/nsh/nsh_test.c')
-rw-r--r--nsh-plugin/nsh/nsh_test.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/nsh-plugin/nsh/nsh_test.c b/nsh-plugin/nsh/nsh_test.c
index a7b7957..1d0a16c 100644
--- a/nsh-plugin/nsh/nsh_test.c
+++ b/nsh-plugin/nsh/nsh_test.c
@@ -187,12 +187,10 @@ static int api_nsh_add_del_entry (vat_main_t * vam)
if (nsi_set == 0)
return -2; //TODO Error type for this cond:clib_error_return (0, "nsi not specified");
- if (md_type != 1)
- return -3; //TODO Error type for this cond: clib_error_return (0, "md-type 1 only supported at this time");
-
- //TODO sort out TLVS and MD Type2 support
- md_type = 1;
- length = 6;
+ if (md_type == 1)
+ length = 6;
+ else if (md_type == 2)
+ length = 2; /* base header length */
nsp_nsi = (nsp<<8) | nsi;
@@ -201,7 +199,7 @@ static int api_nsh_add_del_entry (vat_main_t * vam)
mp->is_add = is_add;
#define _(x) mp->x = x;
- foreach_copy_nshhdr_field;
+ foreach_copy_nsh_base_hdr_field;
#undef _