show RTP TX/RX stats in 'mgcp show stats' output

Make the 'mgcp show stats' VTY command display TX/RX counters
for an RTP stream. This command was already showing the counter
for dropped packets from the same counter group, so it seems
natural to display other relevant counters in the group as well.

Change-Id: I1313e64d7d8b49964f21fc8d213cba6c9fb6c7cf
Related: OS#2660
This commit is contained in:
Stefan Sperling
2018-10-29 13:22:00 +01:00
parent 1e174875bf
commit b7974e2fa4

View File

@@ -162,11 +162,19 @@ static void dump_rtp_end(struct vty *vty, struct mgcp_conn_rtp *conn)
struct mgcp_rtp_state *state = &conn->state;
struct mgcp_rtp_end *end = &conn->end;
struct mgcp_rtp_codec *codec = end->codec;
struct rate_ctr *tx_packets, *tx_bytes;
struct rate_ctr *rx_packets, *rx_bytes;
struct rate_ctr *dropped_packets;
tx_packets = &conn->rate_ctr_group->ctr[RTP_PACKETS_TX_CTR];
tx_bytes = &conn->rate_ctr_group->ctr[RTP_OCTETS_TX_CTR];
rx_packets = &conn->rate_ctr_group->ctr[RTP_PACKETS_RX_CTR];
rx_bytes = &conn->rate_ctr_group->ctr[RTP_OCTETS_RX_CTR];
dropped_packets = &conn->rate_ctr_group->ctr[RTP_DROPPED_PACKETS_CTR];
vty_out(vty,
" Packets Sent: %" PRIu64 " (%" PRIu64 " bytes total)%s"
" Packets Received: %" PRIu64 " (%" PRIu64 " bytes total)%s"
" Timestamp Errs: %" PRIu64 "->%" PRIu64 "%s"
" Dropped Packets: %" PRIu64 "%s"
" Payload Type: %d Rate: %u Channels: %d %s"
@@ -174,6 +182,8 @@ static void dump_rtp_end(struct vty *vty, struct mgcp_conn_rtp *conn)
" FPP: %d Packet Duration: %u%s"
" FMTP-Extra: %s Audio-Name: %s Sub-Type: %s%s"
" Output-Enabled: %d Force-PTIME: %d%s",
tx_packets->current, tx_bytes->current, VTY_NEWLINE,
rx_packets->current, rx_bytes->current, VTY_NEWLINE,
state->in_stream.err_ts_ctr->current,
state->out_stream.err_ts_ctr->current,
VTY_NEWLINE,