session: track number of tries to alloc lcl port

Track number of tries to alloc local port and report it in stats
segment. Could be used to gauge how busy the port allocator is.

Also add cli to dump trasport sub-layer state.

Type: improvement

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: I3736a48488c491dee85aa2b074b87519a3857057
diff --git a/src/vnet/session/session.h b/src/vnet/session/session.h
index 24150fb..823bdcb 100644
--- a/src/vnet/session/session.h
+++ b/src/vnet/session/session.h
@@ -197,6 +197,11 @@
 #undef _
 } session_rt_engine_type_t;
 
+typedef struct session_stats_seg_indices_
+{
+  u32 tp_port_alloc_max_tries;
+} session_stats_segs_indicies_t;
+
 typedef struct session_main_
 {
   /** Worker contexts */
@@ -294,6 +299,7 @@
 
   /** Query nat44-ed session to get original dst ip4 & dst port. */
   nat44_original_dst_lookup_fn original_dst_lookup;
+  session_stats_segs_indicies_t stats_seg_idx;
 } session_main_t;
 
 extern session_main_t session_main;