aboutsummaryrefslogtreecommitdiffstats
path: root/nsh-plugin/nsh/nsh.c
diff options
context:
space:
mode:
authorVengada <venggovi@cisco.com>2017-03-13 23:43:58 -0700
committerVengada <venggovi@cisco.com>2017-03-14 23:20:32 -0700
commitf126e1c375fb63ba6ae8121dce3ea86bc6cf1809 (patch)
treee790a4586309937f52f265650992c0e63ab7c823 /nsh-plugin/nsh/nsh.c
parenta865240bfc157e06699319e39251e3653ca205f5 (diff)
Add support for iOAM (sub-TLV) over NSH-MD2. iOAM trace
records are carried as MD2 TLV data. Change-Id: Id6fe6c961aa3879df5ae476f13b0e39bcc6c0dfe Signed-off-by: Vengada <venggovi@cisco.com>
Diffstat (limited to 'nsh-plugin/nsh/nsh.c')
-rw-r--r--nsh-plugin/nsh/nsh.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/nsh-plugin/nsh/nsh.c b/nsh-plugin/nsh/nsh.c
index 1699126..4102c15 100644
--- a/nsh-plugin/nsh/nsh.c
+++ b/nsh-plugin/nsh/nsh.c
@@ -583,7 +583,7 @@ nsh_add_del_map_command_fn (vlib_main_t * vm,
next_node = NSH_NODE_NEXT_ENCAP_VXLAN4;
else if (unformat (line_input, "encap-vxlan6-intf %d", &sw_if_index))
next_node = NSH_NODE_NEXT_ENCAP_VXLAN6;
- else if (unformat (line_input, "encap-none"))
+ else if (unformat (line_input, "encap-none %d", &sw_if_index))
next_node = NSH_NODE_NEXT_DECAP_ETH_INPUT;
else
return clib_error_return (0, "parse error: '%U'",
@@ -602,7 +602,7 @@ nsh_add_del_map_command_fn (vlib_main_t * vm,
return clib_error_return (0, "nsh_action required: swap|push|pop.");
if (next_node == ~0)
- return clib_error_return (0, "must specific action: [encap-gre-intf <nn> | encap-vxlan-gpe-intf <nn> | encap-lisp-gpe-intf <nn> | encap-none]");
+ return clib_error_return (0, "must specific action: [encap-gre-intf <nn> | encap-vxlan-gpe-intf <nn> | encap-lisp-gpe-intf <nn> | encap-none <rx_sw_if_index>]");
memset (a, 0, sizeof (*a));
@@ -1611,6 +1611,7 @@ nsh_input_map (vlib_main_t * vm,
/* Manipulate MD2 */
if(PREDICT_FALSE(hdr0->md_type == 2))
{
+ vnet_buffer(b0)->sw_if_index[VLIB_RX] = map0->sw_if_index;
nsh_md2_decap(b0, hdr0, header_len0, &next0, NSH_NODE_NEXT_DROP);
if (PREDICT_FALSE(next0 == NSH_NODE_NEXT_DROP))
{
@@ -1713,6 +1714,7 @@ nsh_input_map (vlib_main_t * vm,
/* Manipulate MD2 */
if(PREDICT_FALSE(hdr1->md_type == 2))
{
+ vnet_buffer(b1)->sw_if_index[VLIB_RX] = map1->sw_if_index;
nsh_md2_decap(b1, hdr1, header_len1, &next1, NSH_NODE_NEXT_DROP);
if (PREDICT_FALSE(next1 == NSH_NODE_NEXT_DROP))
{
@@ -1881,6 +1883,7 @@ nsh_input_map (vlib_main_t * vm,
/* Manipulate MD2 */
if(PREDICT_FALSE(hdr0->md_type == 2))
{
+ vnet_buffer(b0)->sw_if_index[VLIB_RX] = map0->sw_if_index;
nsh_md2_decap(b0, hdr0, header_len0, &next0, NSH_NODE_NEXT_DROP);
if (PREDICT_FALSE(next0 == NSH_NODE_NEXT_DROP))
{