VPP-659 TCP improvements

- builtin test echo server
- fix SYN-ACK retransmit canceling
- avoid sending spurious ACK if in LAST_ACK
- improved client dummy test app
- renamed tx fifo dequeuing and sending functions to avoid confusion
- improved RST handling

Change-Id: Ia14aad3df319540dcf6e6a4e18a9f8d423a4b83b
Signed-off-by: Florin Coras <fcoras@cisco.com>
Signed-off-by: Dave Barach <dave@barachs.net>
diff --git a/src/vnet/udp/udp_input.c b/src/vnet/udp/udp_input.c
index 4d50933..8827873 100644
--- a/src/vnet/udp/udp_input.c
+++ b/src/vnet/udp/udp_input.c
@@ -244,19 +244,19 @@
       /* Get session's server */
       server0 = application_get (s0->app_index);
 
-      /* Built-in server? Deliver the goods... */
-      if (server0->cb_fns.builtin_server_rx_callback)
-	{
-	  server0->cb_fns.builtin_server_rx_callback (s0);
-	  continue;
-	}
-
       /* Fabricate event */
       evt.fifo = s0->server_rx_fifo;
       evt.event_type = FIFO_EVENT_SERVER_RX;
       evt.event_id = serial_number++;
       evt.enqueue_length = svm_fifo_max_dequeue (s0->server_rx_fifo);
 
+      /* Built-in server? Deliver the goods... */
+      if (server0->cb_fns.builtin_server_rx_callback)
+	{
+	  server0->cb_fns.builtin_server_rx_callback (s0, &evt);
+	  continue;
+	}
+
       /* Add event to server's event queue */
       q = server0->event_queue;