aboutsummaryrefslogtreecommitdiffstats
path: root/nsh-plugin/nsh/nsh.c
diff options
context:
space:
mode:
Diffstat (limited to 'nsh-plugin/nsh/nsh.c')
-rw-r--r--nsh-plugin/nsh/nsh.c32
1 files changed, 32 insertions, 0 deletions
diff --git a/nsh-plugin/nsh/nsh.c b/nsh-plugin/nsh/nsh.c
index 603570b..2f500b2 100644
--- a/nsh-plugin/nsh/nsh.c
+++ b/nsh-plugin/nsh/nsh.c
@@ -1628,6 +1628,8 @@ nsh_input_map (vlib_main_t * vm,
nsh_proxy_session_by_key_t key0, key1;
uword *p0, *p1;
nsh_proxy_session_t *proxy0, *proxy1;
+ u32 sw_if_index0 = 0, sw_if_index1 = 0;
+ ethernet_header_t dummy_eth0, dummy_eth1;
/* Prefetch next iteration. */
{
@@ -1667,6 +1669,21 @@ nsh_input_map (vlib_main_t * vm,
{
nsp_nsi0 = clib_host_to_net_u32(vnet_buffer(b0)->l2_classify.opaque_index);
}
+ else if(node_type == NSH_AWARE_VNF_PROXY_TYPE)
+ {
+ /* Push dummy Eth header */
+ memset(&dummy_eth0.dst_address[0], 0x11223344, 4);
+ memset(&dummy_eth0.dst_address[4], 0x5566, 2);
+ memset(&dummy_eth0.src_address[0], 0x778899aa, 4);
+ memset(&dummy_eth0.src_address[4], 0xbbcc, 2);
+ dummy_eth0.type = 0x0800;
+ vlib_buffer_advance(b0, -(word)sizeof(ethernet_header_t));
+ hdr0 = vlib_buffer_get_current(b0);
+ clib_memcpy(hdr0, &dummy_eth0, (word)sizeof(ethernet_header_t));
+
+ sw_if_index0 = vnet_buffer(b0)->sw_if_index[VLIB_TX];
+ nsp_nsi0 = nm->tunnel_index_by_sw_if_index[sw_if_index0];
+ }
else
{
memset (&key0, 0, sizeof(key0));
@@ -1699,6 +1716,21 @@ nsh_input_map (vlib_main_t * vm,
{
nsp_nsi1 = clib_host_to_net_u32(vnet_buffer(b1)->l2_classify.opaque_index);
}
+ else if(node_type == NSH_AWARE_VNF_PROXY_TYPE)
+ {
+ /* Push dummy Eth header */
+ memset(&dummy_eth1.dst_address[0], 0x11223344, 4);
+ memset(&dummy_eth1.dst_address[4], 0x5566, 2);
+ memset(&dummy_eth1.src_address[0], 0x778899aa, 4);
+ memset(&dummy_eth1.src_address[4], 0xbbcc, 2);
+ dummy_eth1.type = 0x0800;
+ vlib_buffer_advance(b1, -(word)sizeof(ethernet_header_t));
+ hdr1 = vlib_buffer_get_current(b1);
+ clib_memcpy(hdr1, &dummy_eth1, (word)sizeof(ethernet_header_t));
+
+ sw_if_index1 = vnet_buffer(b1)->sw_if_index[VLIB_TX];
+ nsp_nsi1 = nm->tunnel_index_by_sw_if_index[sw_if_index1];
+ }
else
{
memset (&key1, 0, sizeof(key1));