diff options
author | Florin Coras <fcoras@cisco.com> | 2018-10-24 22:18:58 -0700 |
---|---|---|
committer | Marco Varlese <marco.varlese@suse.de> | 2018-10-25 11:35:54 +0000 |
commit | de9a849a18514f0b09bb5f57a73f6a57ee425c76 (patch) | |
tree | 54e30a9f89dfa3570ec6d4faa8d5d0c485cf81b1 /src/vnet/session/transport.c | |
parent | fe7740e6613e065658dd43e4b8a81504ee7bb2ea (diff) |
session/tcp: improve cli
Change-Id: I91c9d040fc9b9b63f7109eeaac334c47fb1226cf
Signed-off-by: Florin Coras <fcoras@cisco.com>
Diffstat (limited to 'src/vnet/session/transport.c')
-rw-r--r-- | src/vnet/session/transport.c | 57 |
1 files changed, 57 insertions, 0 deletions
diff --git a/src/vnet/session/transport.c b/src/vnet/session/transport.c index c333c4161d4..8cbad0d397f 100644 --- a/src/vnet/session/transport.c +++ b/src/vnet/session/transport.c @@ -93,6 +93,63 @@ format_transport_proto_short (u8 * s, va_list * args) return s; } +u8 * +format_transport_connection (u8 * s, va_list * args) +{ + u32 transport_proto = va_arg (*args, u32); + u32 conn_index = va_arg (*args, u32); + u32 thread_index = va_arg (*args, u32); + u32 verbose = va_arg (*args, u32); + transport_proto_vft_t *tp_vft; + transport_connection_t *tc; + u32 indent; + + tp_vft = transport_protocol_get_vft (transport_proto); + if (!tp_vft) + return s; + + s = format (s, "%U", tp_vft->format_connection, conn_index, thread_index, + verbose); + tc = tp_vft->get_connection (conn_index, thread_index); + if (tc && transport_connection_is_tx_paced (tc) && verbose > 1) + { + indent = format_get_indent (s) + 1; + s = format (s, "%Upacer: %U\n", format_white_space, indent, + format_transport_pacer, &tc->pacer); + } + return s; +} + +u8 * +format_transport_listen_connection (u8 * s, va_list * args) +{ + u32 transport_proto = va_arg (*args, u32); + u32 listen_index = va_arg (*args, u32); + transport_proto_vft_t *tp_vft; + + tp_vft = transport_protocol_get_vft (transport_proto); + if (!tp_vft) + return s; + + s = format (s, "%U", tp_vft->format_listener, listen_index); + return s; +} + +u8 * +format_transport_half_open_connection (u8 * s, va_list * args) +{ + u32 transport_proto = va_arg (*args, u32); + u32 listen_index = va_arg (*args, u32); + transport_proto_vft_t *tp_vft; + + tp_vft = transport_protocol_get_vft (transport_proto); + if (!tp_vft) + return s; + + s = format (s, "%U", tp_vft->format_half_open, listen_index); + return s; +} + uword unformat_transport_proto (unformat_input_t * input, va_list * args) { |