412
412
static gint ett_xr_loss_chunk = -1;
413
413
static gint ett_poc1_conn_contents = -1;
415
/* Protocol registration */
416
void proto_register_rtcp(void);
417
void proto_reg_handoff_rtcp(void);
415
419
/* Main dissection function */
416
420
static void dissect_rtcp( tvbuff_t *tvb, packet_info *pinfo,
417
421
proto_tree *tree );
433
437
static void calculate_roundtrip_delay(tvbuff_t *tvb, packet_info *pinfo,
434
438
proto_tree *tree, guint32 lsr, guint32 dlsr);
435
439
static void add_roundtrip_delay_info(tvbuff_t *tvb, packet_info *pinfo,
436
proto_tree *tree, guint frame, guint delay);
440
proto_tree *tree, guint frame, gint delay);
439
443
/* Set up an RTCP conversation using the info given */
862
/* Item length, 8 bits */
863
item_len = tvb_get_guint8( tvb, offset );
864
proto_tree_add_item( PoC1_tree, hf_rtcp_sdes_length, tvb, offset, 1, FALSE );
869
proto_tree_add_item( PoC1_tree, hf_rtcp_app_poc1_sip_uri, tvb, offset, item_len, FALSE );
867
item_len = tvb_get_guint8( tvb, offset );
868
proto_tree_add_item( PoC1_tree, hf_rtcp_app_poc1_sip_uri, tvb, offset, 1, FALSE );
871
870
if (check_col(pinfo->cinfo, COL_INFO))
874
873
tvb_get_ephemeral_string(tvb, offset, item_len));
877
offset = offset + item_len;
878
packet_len = packet_len - item_len;
876
offset = offset + item_len + 1;
877
packet_len = packet_len - item_len - 1;
880
879
/* In the application dependent data, the TBCP Talk Burst Taken message SHALL carry
881
880
* a SSRC field and SDES items, CNAME and MAY carry SDES item NAME to identify the
895
894
proto_tree_add_item( PoC1_tree, hf_rtcp_sdes_type, tvb, offset, 1, FALSE );
899
/* Item length, 8 bits */
900
899
item_len = tvb_get_guint8( tvb, offset );
901
proto_tree_add_item( PoC1_tree, hf_rtcp_sdes_length, tvb, offset, 1, FALSE );
907
proto_tree_add_item( PoC1_tree, hf_rtcp_app_poc1_disp_name, tvb, offset, item_len, FALSE );
908
offset = offset + item_len;
909
packet_len = packet_len - item_len;
902
proto_tree_add_item( PoC1_tree, hf_rtcp_app_poc1_disp_name, tvb, offset, 1, FALSE );
904
offset = offset + item_len + 1;
905
packet_len = packet_len - item_len - 1;
911
907
if (packet_len == 0)
915
913
/* Participants (optional) */
980
978
case TBCP_BURST_RELEASE:
982
980
guint16 last_seq_no;
983
guint8 ignore_last_seq_no;
981
guint16 ignore_last_seq_no;
985
983
/* Sequence number of last RTP packet in burst */
986
984
proto_tree_add_item( PoC1_tree, hf_rtcp_app_poc1_last_pkt_seq_no, tvb, offset, 2, FALSE );
1215
1213
proto_tree_add_item( tree, hf_rtcp_sdes_length, tvb, offset, 1, FALSE );
1218
reason_text = tvb_get_ephemeral_string(tvb, offset, reason_length);
1216
reason_text = (char*)tvb_get_ephemeral_string(tvb, offset, reason_length);
1219
1217
proto_tree_add_string( tree, hf_rtcp_sdes_text, tvb, offset, reason_length, reason_text );
1220
1218
/* Allow for terminating null character */
1221
1219
offset += (reason_length+1);
1509
1507
proto_tree_add_float(content_tree, hf_rtcp_xr_voip_metrics_moslq, tvb, offset, 1,
1510
(gfloat)tvb_get_guint8(tvb, offset) / 10);
1508
(gfloat)(int)(tvb_get_guint8(tvb, offset) / 10));
1514
1512
proto_tree_add_float(content_tree, hf_rtcp_xr_voip_metrics_moscq, tvb, offset, 1,
1515
(gfloat)tvb_get_guint8(tvb, offset) / 10);
1513
(gfloat)(int)(tvb_get_guint8(tvb, offset) / 10));
1518
1516
/* PLC, JB Adaptive, JB Rate */
2106
2103
p_add_proto_data(pinfo->fd, proto_rtcp, p_packet_data);
2109
/* Don't allow match seemingly calculated from same frame! */
2110
if (pinfo->fd->num == p_conv_data->last_received_frame_number)
2106
/* Don't allow match seemingly calculated from same (or later!) frame */
2107
if (pinfo->fd->num <= p_conv_data->last_received_frame_number)
2115
/* Any previous report must match the lsr given here */
2112
/* The previous report must match the lsr given here */
2116
2113
if (p_conv_data->last_received_ts == lsr)
2118
2115
/* Look at time of since original packet was sent */
2124
2121
gint total_gap = (seconds_between_packets*1000) +
2125
2122
(nseconds_between_packets / 1000000);
2126
gint delay = total_gap - (int)(((double)dlsr/(double)65536) * 1000.0);
2128
/* Record that the LSR matches */
2129
p_packet_data->lsr_matched = TRUE;
2123
gint dlsr_ms = (int)(((double)dlsr/(double)65536) * 1000.0);
2126
/* Delay is gap - dlsr (N.B. this is allowed to be -ve) */
2127
delay = total_gap - dlsr_ms;
2129
/* Record that the LSR matches */
2130
p_packet_data->lsr_matched = TRUE;
2131
2132
/* No useful calculation can be done if dlsr not set... */
2144
2145
/* Show the calcaulted roundtrip delay info by adding protocol tree items
2145
2146
and appending text to the info column */
2146
2147
static void add_roundtrip_delay_info(tvbuff_t *tvb, packet_info *pinfo,
2147
proto_tree *tree, guint frame, guint delay)
2148
proto_tree *tree, guint frame, gint delay)
2149
2150
/* 'Last SR' frame used in calculation. Show this even if no delay shown */
2150
2151
proto_item* item = proto_tree_add_uint(tree,
2153
2154
PROTO_ITEM_SET_GENERATED(item);
2155
2156
/* Don't report on calculated delays below the threshold.
2156
Won't report a delay of 0 (which also indicates no valid
2157
calculated value to report) */
2158
if (delay < global_rtcp_show_roundtrip_calculation_minimum)
2157
Will report delays less than -threshold, to highlight
2158
problems with generated reports */
2159
if (abs(delay) < global_rtcp_show_roundtrip_calculation_minimum)
2163
2164
/* Calculated delay in ms */
2164
item = proto_tree_add_uint(tree, hf_rtcp_roundtrip_delay, tvb, 0, 0, delay);
2165
item = proto_tree_add_int(tree, hf_rtcp_roundtrip_delay, tvb, 0, 0, delay);
2165
2166
PROTO_ITEM_SET_GENERATED(item);
2167
2168
/* Add to expert info */
2168
expert_add_info_format(pinfo, item,
2169
PI_SEQUENCE, PI_NOTE,
2170
"RTCP round-trip delay detected (%u ms)",
2171
expert_add_info_format(pinfo, item,
2172
PI_SEQUENCE, PI_NOTE,
2173
"RTCP round-trip delay detected (%d ms)",
2178
expert_add_info_format(pinfo, item,
2179
PI_SEQUENCE, PI_ERROR,
2180
"Negative RTCP round-trip delay detected (%d ms)",
2173
2184
/* Report delay in INFO column */
2174
2185
if (check_col(pinfo->cinfo, COL_INFO))
2178
col_append_fstr(pinfo->cinfo, COL_INFO,
2179
" (roundtrip delay <-> %s = %ums, using frame %u)",
2180
address_to_str(&pinfo->net_src), delay, frame);
2187
col_append_fstr(pinfo->cinfo, COL_INFO,
2188
" (roundtrip delay <-> %s = %dms, using frame %u) ",
2189
address_to_str(&pinfo->net_src), delay, frame);
2203
2211
col_set_str( pinfo->cinfo, COL_PROTOCOL, "RTCP" );
2206
if ( check_col( pinfo->cinfo, COL_INFO) ) {
2207
/* The second octet contains the packet type */
2208
/* switch ( pd[ offset + 1 ] ) { */
2209
switch ( tvb_get_guint8( tvb, 1 ) ) {
2211
col_set_str( pinfo->cinfo, COL_INFO, "Sender Report");
2214
col_set_str( pinfo->cinfo, COL_INFO, "Receiver Report");
2217
col_set_str( pinfo->cinfo, COL_INFO, "Source Description");
2220
col_set_str( pinfo->cinfo, COL_INFO, "Goodbye");
2223
col_set_str( pinfo->cinfo, COL_INFO, "Application");
2226
col_set_str( pinfo->cinfo, COL_INFO, "Extended report");
2229
col_set_str( pinfo->cinfo, COL_INFO, "Full Intra-frame Request (H.261)");
2232
col_set_str( pinfo->cinfo, COL_INFO, "Negative Acknowledgement (H.261)");
2235
col_set_str( pinfo->cinfo, COL_INFO, "Unknown packet type");
2241
2215
* Check if there are at least 4 bytes left in the frame,
2242
2216
* the last 16 bits of those is the length of the current
2255
2229
if ( ( packet_type < 192 ) || ( packet_type > 207 ) )
2232
if (check_col(pinfo->cinfo, COL_INFO))
2234
col_add_fstr(pinfo->cinfo, COL_INFO, "%s ",
2235
val_to_str(packet_type, rtcp_packet_type_vals, "Unknown"));
2259
2239
* get the packet-length for the complete RTCP packet
3856
3838
&global_rtcp_show_roundtrip_calculation);
3858
3840
prefs_register_uint_preference(rtcp_module, "roundtrip_min_threshhold",
3859
"Minimum roundtrip calculations to report (ms)",
3860
"Minimum calculated roundtrip delay time in milliseconds that "
3841
"Minimum roundtrip calculation to report (ms)",
3842
"Minimum (absolute) calculated roundtrip delay time in milliseconds that "
3861
3843
"should be reported",
3862
3844
10, &global_rtcp_show_roundtrip_calculation_minimum);