Fix tlv[0] issue of nsh_entry 53/2153/2
authorHongjun Ni <[email protected]>
Mon, 1 Aug 2016 17:33:51 +0000 (01:33 +0800)
committerHongjun Ni <[email protected]>
Mon, 1 Aug 2016 17:43:40 +0000 (01:43 +0800)
PatchSet 2: delete tlv

Change-Id: I19131a8dfc441be1d7cbb92c817a3f7e583f9189
Signed-off-by: Hongjun Ni <[email protected]>
nsh-plugin/build.sh
nsh-plugin/nsh/nsh.api
nsh-plugin/nsh/nsh.c
nsh-plugin/nsh/nsh_test.c

index 4a8c3d1..aae99c9 100755 (executable)
@@ -1,6 +1,6 @@
 #!/usr/bin/env bash
 NSH_PLUGIN_DIR=$(dirname $0)
-NSH_INSTALL_PREFIX=${NSH_INSTALL_PREFIX:-/usr}
+NSH_INSTALL_PREFIX=${NSH_INSTALL_PREFIX:-/usr/local}
 cd ${NSH_PLUGIN_DIR}
 autoreconf -i -f
 [ -d build ] ||  mkdir build
index 0f9e13d..01292d1 100644 (file)
@@ -24,11 +24,10 @@ define nsh_add_del_entry {
     u8 ver_o_c;
     u8 length;
     u8 next_protocol;
-    u32 c1; 
+    u32 c1;
     u32 c2;
-    u32 c3; 
+    u32 c3;
     u32 c4;
-    u32 tlvs[0];
 };
 
 /** \brief Reply from adding NSH entry (nsh_add_del_entry)
@@ -53,19 +52,18 @@ define nsh_entry_details {
     u8 ver_o_c;
     u8 length;
     u8 next_protocol;
-    u32 c1; 
+    u32 c1;
     u32 c2;
-    u32 c3; 
+    u32 c3;
     u32 c4;
-    u32 tlvs[0];
 };
 
 /** \brief Set or delete a mapping from one NSH header to another and its egress (decap to inner packet, encap NSH with outer header)
     @param client_index - opaque cookie to identify the sender
     @param context - sender context, to match reply w/ request
     @param is_add - add address if non-zero, else delete
-    @param nsh_nsi - Key for nsh_header_t entry to map to. : 24bit NSP 8bit NSI 
-    @param mapped_nsp_nsi - Key for nsh_header_t entry to map to. : 24bit NSP 8bit NSI this may be ~0 
+    @param nsh_nsi - Key for nsh_header_t entry to map to. : 24bit NSP 8bit NSI
+    @param mapped_nsp_nsi - Key for nsh_header_t entry to map to. : 24bit NSP 8bit NSI this may be ~0
        if next action is to decap to NSH next protocol
        Note the following heuristic:
                    - if nsp_nsi == mapped_nsp_nsi then use-case is like SFC SFF
index 21a972e..19c8fa7 100644 (file)
@@ -469,7 +469,6 @@ nsh_add_del_entry_command_fn (vlib_main_t * vm,
   u32 c2 = 0;
   u32 c3 = 0;
   u32 c4 = 0;
-  u32 *tlvs = 0;
   u32 tmp;
   int rv;
   nsh_add_del_entry_args_t _a, * a = &_a;
@@ -507,8 +506,6 @@ nsh_add_del_entry_command_fn (vlib_main_t * vm,
       nsp_set = 1;
     else if (unformat (line_input, "nsi %d", &nsi))
       nsi_set = 1;
-    else if (unformat (line_input, "tlv %x"))
-      vec_add1 (tlvs, tmp);
     else
       return clib_error_return (0, "parse error: '%U'",
                                 format_unformat_error, line_input);
@@ -538,8 +535,6 @@ nsh_add_del_entry_command_fn (vlib_main_t * vm,
   foreach_copy_nshhdr_field;
 #undef _
 
-  a->nsh.tlvs[0] = 0 ; // TODO FIXME this shouldn't be set 0 - in NSH_SFC project
-
   rv = nsh_add_del_entry (a);
 
   switch(rv)
index dc3c4d0..d3dabee 100644 (file)
@@ -143,7 +143,6 @@ static int api_nsh_add_del_entry (vat_main_t * vam)
     u32 c2 = 0;
     u32 c3 = 0;
     u32 c4 = 0;
-    u32 *tlvs = 0;
     u32 tmp;
     vl_api_nsh_add_del_entry_t * mp;
 
@@ -176,8 +175,6 @@ static int api_nsh_add_del_entry (vat_main_t * vam)
        nsp_set = 1;
       else if (unformat (line_input, "nsi %d", &nsi))
        nsi_set = 1;
-      else if (unformat (line_input, "tlv %x"))
-        vec_add1 (tlvs, tmp);
       else
        return -99; // PARSE ERROR;
     }
@@ -207,7 +204,6 @@ static int api_nsh_add_del_entry (vat_main_t * vam)
     foreach_copy_nshhdr_field;
 #undef _
 
-    mp->tlvs[0] = 0 ; // TODO FIXME this shouldn't be set 0 - in NSH_SFC project
 
     /* send it... */
     S;