tcp: allow custom output next node 16/20216/2
authorFlorin Coras <fcoras@cisco.com>
Tue, 18 Jun 2019 15:55:14 +0000 (08:55 -0700)
committerFlorin Coras <florin.coras@gmail.com>
Tue, 18 Jun 2019 19:18:53 +0000 (19:18 +0000)
Type: feature

Change-Id: If9804d3685d2a52efa06e412ae1ebb39c6a44b8b
Signed-off-by: Florin Coras <fcoras@cisco.com>
src/vnet/tcp/tcp.h
src/vnet/tcp/tcp_output.c

index aeae57c..132ec13 100644 (file)
@@ -323,6 +323,7 @@ typedef struct _tcp_connection
   u32 tx_fifo_size;    /**< Tx fifo size. Used to constrain cwnd */
 
   u32 psh_seq;         /**< Add psh header for seg that includes this */
+  u32 out_next_index;  /**< Can be used to control next node in output */
 } tcp_connection_t;
 
 /* *INDENT-OFF* */
index 77065cd..abd674d 100644 (file)
@@ -2062,6 +2062,9 @@ tcp_output_handle_packet (tcp_connection_t * tc0, vlib_buffer_t * b0,
       return;
     }
 
+  /* If next_index is not drop use it */
+  *next0 = tc0->out_next_index ? tc0->out_next_index : *next0;
+
   vnet_buffer (b0)->sw_if_index[VLIB_TX] = tc0->c_fib_index;
   vnet_buffer (b0)->sw_if_index[VLIB_RX] = 0;