3 * Routines for RDT dissection
4 * RDT = Real Data Transport
7 * Written by Martin Mathieson and Tom Marshall
9 * Wireshark - Network traffic analyzer
10 * By Gerald Combs <gerald@wireshark.org>
11 * Copyright 1998 Gerald Combs
13 * SPDX-License-Identifier: GPL-2.0-or-later
16 /* Information sources:
17 * helixcommunity.org sources, in particular
18 * server/protocol/transport/rdt/pub/tngpkt.pm
23 #include <epan/packet.h>
24 #include <epan/expert.h>
25 #include <epan/conversation.h>
26 #include <epan/prefs.h>
27 #include <epan/proto_data.h>
28 #include "packet-rdt.h"
30 static dissector_handle_t rdt_handle
;
35 static int hf_rdt_packet
;
38 static int hf_rdt_len_included
;
40 /* flags1: data packet */
41 static int hf_rdt_data_flags1
;
42 static int hf_rdt_data_need_reliable
;
43 static int hf_rdt_data_stream_id
;
44 static int hf_rdt_data_is_reliable
;
46 /* flags2: data packet */
47 static int hf_rdt_data_flags2
;
48 static int hf_rdt_data_backtoback
;
49 static int hf_rdt_data_slowdata
;
50 static int hf_rdt_data_asmrule
;
52 /* flags1: asm action packet */
53 static int hf_rdt_aact_flags
;
54 static int hf_rdt_aact_stream_id
;
56 /* flags1: ack packet */
57 static int hf_rdt_ack_flags
;
58 static int hf_rdt_ack_lost_high
;
60 /* flags1: latency report packet */
61 static int hf_rdt_latency_report_flags
;
63 /* flags1: bandwidth report packet */
64 static int hf_rdt_bandwidth_report_flags
;
66 /* flags1: stream end packet */
67 static int hf_rdt_stre_flags
;
68 static int hf_rdt_stre_need_reliable
;
69 static int hf_rdt_stre_stream_id
;
70 static int hf_rdt_stre_packet_sent
;
71 static int hf_rdt_stre_ext_flag
;
73 /* static int hf_rdt_rtt_request_flags; */
74 /* static int hf_rdt_rtt_response_flags; */
75 /* static int hf_rdt_congestion_flags; */
76 static int hf_rdt_report_flags
;
77 /* static int hf_rdt_tirq_flags; */
78 static int hf_rdt_tirp_flags
;
79 static int hf_rdt_bw_probing_flags
;
81 /* Octets 1-2: sequence number or packet type */
82 static int hf_rdt_sequence_number
;
83 static int hf_rdt_packet_type
;
85 /* Only present if length_included */
86 static int hf_rdt_packet_length
;
88 /* General shared fields */
89 static int hf_rdt_timestamp
;
90 static int hf_rdt_stream_id_ex
;
91 static int hf_rdt_asmrule_ex
;
92 static int hf_rdt_total_reliable
;
93 static int hf_rdt_data
;
95 /* Special use fields */
96 static int hf_rdt_aact_reliable_seqno
;
97 static int hf_rdt_brpt_interval
;
98 static int hf_rdt_brpt_bandwidth
;
99 static int hf_rdt_brpt_sequence
;
100 static int hf_rdt_rtrp_ts_sec
;
101 static int hf_rdt_rtrp_ts_usec
;
102 static int hf_rdt_cong_xmit_mult
;
103 static int hf_rdt_cong_recv_mult
;
104 static int hf_rdt_stre_seqno
;
105 static int hf_rdt_stre_dummy_flags1
;
106 static int hf_rdt_stre_dummy_type
;
107 static int hf_rdt_stre_reason_code
;
108 static int hf_rdt_lrpt_server_out_time
;
109 static int hf_rdt_tirq_request_rtt_info
;
110 static int hf_rdt_tirq_request_buffer_info
;
111 static int hf_rdt_tirq_request_time_msec
;
112 static int hf_rdt_tirp_has_rtt_info
;
113 static int hf_rdt_tirp_is_delayed
;
114 static int hf_rdt_tirp_has_buffer_info
;
115 static int hf_rdt_tirp_request_time_msec
;
116 static int hf_rdt_tirp_response_time_msec
;
117 static int hf_rdt_tirp_buffer_info
;
118 static int hf_rdt_tirp_buffer_info_count
;
119 static int hf_rdt_tirp_buffer_info_stream_id
;
120 static int hf_rdt_tirp_buffer_info_lowest_timestamp
;
121 static int hf_rdt_tirp_buffer_info_highest_timestamp
;
122 static int hf_rdt_tirp_buffer_info_bytes_buffered
;
123 static int hf_rdt_bwpp_seqno
;
124 static int hf_rdt_unk_flags1
;
126 /* RDT setup fields */
127 static int hf_rdt_setup
;
128 static int hf_rdt_setup_frame
;
129 static int hf_rdt_setup_method
;
130 static int hf_rdt_feature_level
;
132 /* RDT fields defining a sub tree */
134 static int ett_rdt_packet
;
135 static int ett_rdt_setup
;
136 static int ett_rdt_data_flags1
;
137 static int ett_rdt_data_flags2
;
138 static int ett_rdt_aact_flags
;
139 static int ett_rdt_ack_flags
;
140 static int ett_rdt_latency_report_flags
;
141 static int ett_rdt_bandwidth_report_flags
;
142 static int ett_rdt_stre_flags
;
143 static int ett_rdt_rtt_request_flags
;
144 static int ett_rdt_rtt_response_flags
;
145 static int ett_rdt_congestion_flags
;
146 static int ett_rdt_report_flags
;
147 static int ett_rdt_tirq_flags
;
148 static int ett_rdt_tirp_flags
;
149 static int ett_rdt_tirp_buffer_info
;
150 static int ett_rdt_bw_probing_flags
;
152 static expert_field ei_rdt_packet_length
;
154 #define RDT_UDP_PORT 6970
156 void proto_register_rdt(void);
157 void proto_reg_handoff_rdt(void);
159 /* Parse individual packet types */
160 static unsigned dissect_rdt_data_packet(tvbuff_t
*tvb
, packet_info
*pinfo
, proto_tree
*tree
, unsigned offset
);
161 static unsigned dissect_rdt_asm_action_packet(tvbuff_t
*tvb
, packet_info
*pinfo
, proto_tree
*tree
, unsigned offset
);
162 static unsigned dissect_rdt_bandwidth_report_packet(tvbuff_t
*tvb
, packet_info
*pinfo
, proto_tree
*tree
, unsigned offset
);
163 static unsigned dissect_rdt_ack_packet(tvbuff_t
*tvb
, packet_info
*pinfo
, proto_tree
*tree
, unsigned offset
);
164 static unsigned dissect_rdt_rtt_request_packet(tvbuff_t
*tvb
, packet_info
*pinfo
, proto_tree
*tree
, unsigned offset
);
165 static unsigned dissect_rdt_rtt_response_packet(tvbuff_t
*tvb
, packet_info
*pinfo
, proto_tree
*tree
, unsigned offset
);
166 static unsigned dissect_rdt_congestion_packet(tvbuff_t
*tvb
, packet_info
*pinfo
, proto_tree
*tree
, unsigned offset
);
167 static unsigned dissect_rdt_stream_end_packet(tvbuff_t
*tvb
, packet_info
*pinfo
, proto_tree
*tree
, unsigned offset
);
168 static unsigned dissect_rdt_report_packet(tvbuff_t
*tvb
, packet_info
*pinfo
, proto_tree
*tree
, unsigned offset
);
169 static unsigned dissect_rdt_latency_report_packet(tvbuff_t
*tvb
, packet_info
*pinfo
, proto_tree
*tree
, unsigned offset
);
170 static unsigned dissect_rdt_transport_info_request_packet(tvbuff_t
*tvb
, packet_info
*pinfo
, proto_tree
*tree
, unsigned offset
);
171 static unsigned dissect_rdt_transport_info_response_packet(tvbuff_t
*tvb
, packet_info
*pinfo
, proto_tree
*tree
, unsigned offset
);
172 static unsigned dissect_rdt_bw_probing_packet(tvbuff_t
*tvb
, packet_info
*pinfo
, proto_tree
*tree
, unsigned offset
);
173 static unsigned dissect_rdt_unknown_control(tvbuff_t
*tvb
, packet_info
*pinfo
, proto_tree
*tree
, unsigned offset
);
175 static void show_setup_info(tvbuff_t
*tvb
, packet_info
*pinfo
, proto_tree
*tree
);
177 /* Preferences bool to control whether or not setup info should be shown */
178 static bool global_rdt_show_setup_info
= true;
181 #define RDT_ASMACTIION_PACKET 0xff00
182 #define RDT_BANDWIDTHREPORT_PACKET 0xff01
183 #define RDT_ACK_PACKET 0xff02
184 #define RDT_RTTREQUEST_PACKET 0xff03
185 #define RDT_RTTRESPONSE_PACKET 0xff04
186 #define RDT_CONGESTION_PACKET 0xff05
187 #define RDT_STREAMEND_PACKET 0xff06
188 #define RDT_REPORT_PACKET 0xff07
189 #define RDT_LATENCYREPORT_PACKET 0xff08
190 #define RDT_TRANSPORTINFO_PACKET 0xff09
191 #define RDT_TRANSPORTINFORESPONSE_PACKET 0xff0a
192 #define RDT_BWPROBING_PACKET 0xff0b
194 static const value_string packet_type_vals
[] =
196 { RDT_ASMACTIION_PACKET
, "Asm action" },
197 { RDT_BANDWIDTHREPORT_PACKET
, "Bandwidth report" },
198 { RDT_ACK_PACKET
, "Ack" },
199 { RDT_RTTREQUEST_PACKET
, "RTT request" },
200 { RDT_RTTRESPONSE_PACKET
, "RTT response" },
201 { RDT_CONGESTION_PACKET
, "Congestion" },
202 { RDT_STREAMEND_PACKET
, "Stream end" },
203 { RDT_REPORT_PACKET
, "Report" },
204 { RDT_LATENCYREPORT_PACKET
, "Latency report" },
205 { RDT_TRANSPORTINFO_PACKET
, "Transport info" },
206 { RDT_TRANSPORTINFORESPONSE_PACKET
, "Transport info response" },
207 { RDT_BWPROBING_PACKET
, "BW probing" },
212 /* Set up an RDT conversation */
213 void rdt_add_address(packet_info
*pinfo
,
214 address
*addr
, int port
,
216 const char *setup_method
,
217 int rdt_feature_level
)
220 conversation_t
* p_conv
;
221 struct _rdt_conversation_info
*p_conv_data
;
223 /* If this isn't the first time this packet has been processed,
224 we've already done this work, so we don't need to do it
226 if (pinfo
->fd
->visited
)
231 clear_address(&null_addr
);
233 /* Check if the ip address and port combination is not already registered
234 as a conversation. */
235 p_conv
= find_conversation(pinfo
->num
, addr
, &null_addr
, CONVERSATION_UDP
, port
, other_port
,
236 NO_ADDR_B
| (!other_port
? NO_PORT_B
: 0));
238 /* If not, create a new conversation. */
239 if ( !p_conv
|| p_conv
->setup_frame
!= pinfo
->num
)
241 p_conv
= conversation_new(pinfo
->num
, addr
, &null_addr
, CONVERSATION_UDP
,
242 (uint32_t)port
, (uint32_t)other_port
,
243 NO_ADDR2
| (!other_port
? NO_PORT2
: 0));
247 conversation_set_dissector(p_conv
, rdt_handle
);
249 /* Check if the conversation has data associated with it. */
250 p_conv_data
= (struct _rdt_conversation_info
*)conversation_get_proto_data(p_conv
, proto_rdt
);
252 /* If not, add a new data item. */
255 /* Create conversation data */
256 p_conv_data
= wmem_new(wmem_file_scope(), struct _rdt_conversation_info
);
257 conversation_add_proto_data(p_conv
, proto_rdt
, p_conv_data
);
260 /* Update the conversation data. */
261 (void) g_strlcpy(p_conv_data
->method
, setup_method
, MAX_RDT_SETUP_METHOD_SIZE
);
262 p_conv_data
->frame_number
= pinfo
->num
;
263 p_conv_data
->feature_level
= rdt_feature_level
;
268 /****************************************************************************/
269 /* Main dissection function */
270 /****************************************************************************/
271 static int dissect_rdt(tvbuff_t
*tvb
, packet_info
*pinfo
, proto_tree
*tree
, void* data _U_
)
273 unsigned previous_offset
= 0;
276 proto_tree
*rdt_tree
= NULL
;
277 proto_tree
*rdt_packet_tree
;
278 uint16_t packet_type
;
280 /* Set/clear columns */
281 col_set_str(pinfo
->cinfo
, COL_PROTOCOL
, "RDT");
282 col_clear(pinfo
->cinfo
, COL_INFO
);
284 /* Create RDT protocol tree */
285 ti
= proto_tree_add_item(tree
, proto_rdt
, tvb
, offset
, -1, ENC_NA
);
286 rdt_tree
= proto_item_add_subtree(ti
, ett_rdt
);
288 /* Conversation setup info */
289 if (global_rdt_show_setup_info
)
291 show_setup_info(tvb
, pinfo
, rdt_tree
);
294 /* Parse all RDT packets found in the frame */
295 while (offset
!= -1 && tvb_reported_length_remaining(tvb
, offset
))
297 /* Every packet type should have at least 3 bytes */
298 tvb_ensure_bytes_exist(tvb
, offset
, 3);
300 /* 2nd & 3rd bytes determine packet type */
301 packet_type
= tvb_get_ntohs(tvb
, offset
+1);
303 /* Add a tree for the next individual packet */
304 ti
= proto_tree_add_string_format(rdt_tree
, hf_rdt_packet
, tvb
, offset
, -1,
307 packet_type
< 0xff00 ? "Data" :
308 val_to_str_const(packet_type
, packet_type_vals
, "Unknown"));
309 rdt_packet_tree
= proto_item_add_subtree(ti
, ett_rdt_packet
);
311 /* Dissect the details of the next packet in this frame */
312 if (packet_type
< 0xff00)
314 offset
= dissect_rdt_data_packet(tvb
, pinfo
, rdt_packet_tree
, offset
);
320 case RDT_ASMACTIION_PACKET
:
321 offset
= dissect_rdt_asm_action_packet(tvb
, pinfo
, rdt_packet_tree
, offset
);
323 case RDT_BANDWIDTHREPORT_PACKET
:
324 offset
= dissect_rdt_bandwidth_report_packet(tvb
, pinfo
, rdt_packet_tree
, offset
);
327 offset
= dissect_rdt_ack_packet(tvb
, pinfo
, rdt_packet_tree
, offset
);
329 case RDT_RTTREQUEST_PACKET
:
330 offset
= dissect_rdt_rtt_request_packet(tvb
, pinfo
, rdt_packet_tree
, offset
);
332 case RDT_RTTRESPONSE_PACKET
:
333 offset
= dissect_rdt_rtt_response_packet(tvb
, pinfo
, rdt_packet_tree
, offset
);
335 case RDT_CONGESTION_PACKET
:
336 offset
= dissect_rdt_congestion_packet(tvb
, pinfo
, rdt_packet_tree
, offset
);
338 case RDT_STREAMEND_PACKET
:
339 offset
= dissect_rdt_stream_end_packet(tvb
, pinfo
, rdt_packet_tree
, offset
);
341 case RDT_REPORT_PACKET
:
342 offset
= dissect_rdt_report_packet(tvb
, pinfo
, rdt_packet_tree
, offset
);
344 case RDT_LATENCYREPORT_PACKET
:
345 offset
= dissect_rdt_latency_report_packet(tvb
, pinfo
, rdt_packet_tree
, offset
);
347 case RDT_TRANSPORTINFO_PACKET
:
348 offset
= dissect_rdt_transport_info_request_packet(tvb
, pinfo
, rdt_packet_tree
, offset
);
350 case RDT_TRANSPORTINFORESPONSE_PACKET
:
351 offset
= dissect_rdt_transport_info_response_packet(tvb
, pinfo
, rdt_packet_tree
, offset
);
353 case RDT_BWPROBING_PACKET
:
354 offset
= dissect_rdt_bw_probing_packet(tvb
, pinfo
, rdt_packet_tree
, offset
);
358 /* Unknown control packet */
359 offset
= dissect_rdt_unknown_control(tvb
, pinfo
, rdt_packet_tree
, offset
);
364 /* Select correct number of bytes for the tree showing this packet */
367 proto_item_set_len(rdt_packet_tree
, offset
-previous_offset
);
369 previous_offset
= offset
;
372 return tvb_captured_length(tvb
);
377 /************************************************/
378 /* Functions to dissect individual packet types */
379 /************************************************/
381 /* Dissect a data packet */
382 unsigned dissect_rdt_data_packet(tvbuff_t
*tvb
, packet_info
*pinfo
, proto_tree
*tree
, unsigned offset
)
384 unsigned start_offset
= offset
;
385 uint16_t packet_length
;
387 uint8_t length_included_flag
;
388 uint8_t need_reliable_flag
;
390 uint16_t sequence_number
;
391 uint8_t is_reliable_flag
;
394 uint16_t asm_rule_number
;
395 uint8_t back_to_back
;
397 proto_tree
*flags_tree1
;
398 proto_tree
*flags_tree2
;
401 /* Flags in first byte */
402 flags1
= tvb_get_uint8(tvb
, offset
);
403 length_included_flag
= (flags1
& 0x80) >> 7;
404 need_reliable_flag
= (flags1
& 0x40) >> 6;
405 stream_id
= (flags1
& 0x3e) >> 1;
406 is_reliable_flag
= flags1
& 0x01;
408 /* Create subtree for flags1 fields */
409 ti
= proto_tree_add_string_format(tree
, hf_rdt_data_flags1
, tvb
, offset
, 1,
411 "Length-included=%u, need-reliable=%u, stream-id=%u, is-reliable=%u",
412 length_included_flag
,
416 flags_tree1
= proto_item_add_subtree(ti
, ett_rdt_data_flags1
);
418 proto_tree_add_item(flags_tree1
, hf_rdt_len_included
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
419 proto_tree_add_item(flags_tree1
, hf_rdt_data_need_reliable
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
420 proto_tree_add_item(flags_tree1
, hf_rdt_data_stream_id
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
421 proto_tree_add_item(flags_tree1
, hf_rdt_data_is_reliable
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
424 /* Sequence number */
425 sequence_number
= tvb_get_ntohs(tvb
, offset
);
426 proto_tree_add_item(tree
, hf_rdt_sequence_number
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
429 /* Length field is optional */
430 if (length_included_flag
)
432 packet_length
= tvb_get_ntohs(tvb
, offset
);
433 proto_tree_add_item(tree
, hf_rdt_packet_length
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
436 /* Check that there are as many bytes as reported */
437 tvb_ensure_bytes_exist(tvb
, start_offset
, packet_length
);
441 packet_length
= tvb_captured_length_remaining(tvb
, start_offset
);
445 flags2
= tvb_get_uint8(tvb
, offset
);
446 back_to_back
= (flags2
& 0x80) >> 7;
447 slow_data
= (flags2
& 0x40) >> 6;
448 asm_rule_number
= flags2
& 0x3f;
451 /* Create subtree for flags2 fields */
452 ti
= proto_tree_add_string_format(tree
, hf_rdt_data_flags2
, tvb
, offset
, 1,
454 "Back-to-back=%u, slow-data=%u, asm-rule=%u",
459 /* Create subtree for flags and add fields */
460 flags_tree2
= proto_item_add_subtree(ti
, ett_rdt_data_flags2
);
462 proto_tree_add_item(flags_tree2
, hf_rdt_data_backtoback
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
463 proto_tree_add_item(flags_tree2
, hf_rdt_data_slowdata
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
464 proto_tree_add_item(flags_tree2
, hf_rdt_data_asmrule
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
468 timestamp
= tvb_get_ntohl(tvb
, offset
);
469 proto_tree_add_item(tree
, hf_rdt_timestamp
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
472 /* Stream ID expansion */
475 stream_id
= tvb_get_ntohs(tvb
, offset
);
476 proto_tree_add_item(tree
, hf_rdt_stream_id_ex
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
481 if (need_reliable_flag
)
483 proto_tree_add_item(tree
, hf_rdt_total_reliable
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
487 /* Asm rule number */
488 if (asm_rule_number
== 63)
490 asm_rule_number
= tvb_get_ntohs(tvb
, offset
);
491 proto_tree_add_item(tree
, hf_rdt_asmrule_ex
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
495 col_append_fstr(pinfo
->cinfo
, COL_INFO
,
496 "DATA: stream-id=%02u asm-rule=%02u seq=%05u ts=%05u ",
497 stream_id
, asm_rule_number
, sequence_number
, timestamp
);
499 /* The remaining data is unparsed. */
500 proto_tree_add_item(tree
, hf_rdt_data
, tvb
, offset
, -1, ENC_NA
);
501 offset
+= tvb_captured_length_remaining(tvb
, offset
);
503 if (packet_length
< (offset
- start_offset
) ||
504 packet_length
> tvb_reported_length_remaining(tvb
, start_offset
))
506 proto_tree_add_expert(tree
, pinfo
, &ei_rdt_packet_length
, tvb
, 0, 0);
507 packet_length
= tvb_captured_length_remaining(tvb
, start_offset
);
510 return start_offset
+ packet_length
;
513 /* Dissect an asm-action packet */
514 unsigned dissect_rdt_asm_action_packet(tvbuff_t
*tvb
, packet_info
*pinfo
, proto_tree
*tree
, unsigned offset
)
516 unsigned start_offset
= offset
;
517 uint16_t packet_length
;
519 uint8_t length_included_flag
;
522 proto_tree
*flags_tree
;
525 /* Flags in first byte */
526 flags1
= tvb_get_uint8(tvb
, offset
);
527 length_included_flag
= (flags1
& 0x80) >> 7;
528 stream_id
= (flags1
& 0x7c) >> 2;
530 /* Create subtree for flags fields */
531 proto_tree_add_item(tree
, proto_rdt
, tvb
, offset
, -1, ENC_NA
);
532 ti
= proto_tree_add_string_format(tree
, hf_rdt_aact_flags
, tvb
, offset
, 1,
534 "Length-included=%u, stream_id=%u",
535 length_included_flag
,
537 flags_tree
= proto_item_add_subtree(ti
, ett_rdt_aact_flags
);
539 proto_tree_add_item(flags_tree
, hf_rdt_len_included
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
540 proto_tree_add_item(flags_tree
, hf_rdt_aact_stream_id
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
544 proto_tree_add_item(tree
, hf_rdt_packet_type
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
547 rel_seqno
= tvb_get_ntohs(tvb
, offset
);
548 proto_tree_add_item(tree
, hf_rdt_aact_reliable_seqno
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
551 /* Length field is optional */
552 if (length_included_flag
)
554 packet_length
= tvb_get_ntohs(tvb
, offset
);
555 proto_tree_add_item(tree
, hf_rdt_packet_length
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
558 /* Check that there are as many bytes as reported */
559 tvb_ensure_bytes_exist(tvb
, start_offset
, packet_length
);
563 packet_length
= tvb_captured_length_remaining(tvb
, start_offset
);
566 /* Stream ID expansion */
569 stream_id
= tvb_get_ntohs(tvb
, offset
);
570 proto_tree_add_item(tree
, hf_rdt_stream_id_ex
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
574 col_append_fstr(pinfo
->cinfo
, COL_INFO
,
575 "ASM-ACTION: stream-id=%02u rel-seqno=%05u ",
576 stream_id
, rel_seqno
);
578 /* The remaining data is unparsed. */
579 proto_tree_add_item(tree
, hf_rdt_data
, tvb
, offset
, -1, ENC_NA
);
581 if (packet_length
< (offset
- start_offset
) ||
582 packet_length
> tvb_reported_length_remaining(tvb
, start_offset
))
584 proto_tree_add_expert(tree
, pinfo
, &ei_rdt_packet_length
, tvb
, 0, 0);
585 packet_length
= tvb_captured_length_remaining(tvb
, start_offset
);
588 return start_offset
+ packet_length
;
591 /* Dissect an bandwidth-report packet */
592 unsigned dissect_rdt_bandwidth_report_packet(tvbuff_t
*tvb
, packet_info
*pinfo
, proto_tree
*tree
, unsigned offset
)
594 unsigned start_offset
= offset
;
595 uint16_t packet_length
;
597 uint8_t length_included_flag
;
598 proto_tree
*flags_tree
;
601 /* Flags in first byte */
602 flags1
= tvb_get_uint8(tvb
, offset
);
603 length_included_flag
= (flags1
& 0x80) >> 7;
605 /* Create subtree for flags fields */
606 ti
= proto_tree_add_string_format(tree
, hf_rdt_bandwidth_report_flags
, tvb
, offset
, 1,
608 "Length-included=%u",
609 length_included_flag
);
610 flags_tree
= proto_item_add_subtree(ti
, ett_rdt_bandwidth_report_flags
);
612 proto_tree_add_item(flags_tree
, hf_rdt_len_included
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
616 proto_tree_add_item(tree
, hf_rdt_packet_type
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
619 /* Length field is optional */
620 if (length_included_flag
)
622 packet_length
= tvb_get_ntohs(tvb
, offset
);
623 proto_tree_add_item(tree
, hf_rdt_packet_length
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
626 /* Check that there are as many bytes as reported */
627 tvb_ensure_bytes_exist(tvb
, start_offset
, packet_length
);
631 packet_length
= tvb_captured_length_remaining(tvb
, start_offset
);
634 proto_tree_add_item(tree
, hf_rdt_brpt_interval
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
636 proto_tree_add_item(tree
, hf_rdt_brpt_bandwidth
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
638 proto_tree_add_item(tree
, hf_rdt_brpt_sequence
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
641 col_append_str(pinfo
->cinfo
, COL_INFO
, "BANDWIDTH-REPORT: ");
643 if (packet_length
< (offset
- start_offset
) ||
644 packet_length
> tvb_reported_length_remaining(tvb
, start_offset
))
646 proto_tree_add_expert(tree
, pinfo
, &ei_rdt_packet_length
, tvb
, 0, 0);
647 packet_length
= tvb_captured_length_remaining(tvb
, start_offset
);
650 return start_offset
+ packet_length
;
653 /* Dissect an ack packet */
654 unsigned dissect_rdt_ack_packet(tvbuff_t
*tvb
, packet_info
*pinfo
, proto_tree
*tree
, unsigned offset
)
656 unsigned start_offset
= offset
;
657 uint16_t packet_length
;
659 uint8_t length_included_flag
;
660 uint8_t lost_high_flag
;
661 proto_tree
*flags_tree
;
664 /* Flags in first byte */
665 flags1
= tvb_get_uint8(tvb
, offset
);
666 length_included_flag
= (flags1
& 0x80) >> 7;
667 lost_high_flag
= (flags1
& 0x40) >> 6;
669 /* Create subtree for flags fields */
670 ti
= proto_tree_add_string_format(tree
, hf_rdt_ack_flags
, tvb
, offset
, 1,
672 "Length-included=%u, lost-high=%u",
673 length_included_flag
,
675 flags_tree
= proto_item_add_subtree(ti
, ett_rdt_ack_flags
);
677 proto_tree_add_item(flags_tree
, hf_rdt_len_included
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
678 proto_tree_add_item(flags_tree
, hf_rdt_ack_lost_high
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
682 proto_tree_add_item(tree
, hf_rdt_packet_type
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
685 /* Length field is optional */
686 if (length_included_flag
)
688 packet_length
= tvb_get_ntohs(tvb
, offset
);
689 proto_tree_add_item(tree
, hf_rdt_packet_length
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
692 /* Check that there are as many bytes as reported */
693 tvb_ensure_bytes_exist(tvb
, start_offset
, packet_length
);
697 packet_length
= tvb_captured_length_remaining(tvb
, start_offset
);
700 /* XXX: The remaining data is unparsed. */
701 proto_tree_add_item(tree
, hf_rdt_data
, tvb
, offset
, -1, ENC_NA
);
703 col_append_fstr(pinfo
->cinfo
, COL_INFO
, "ACK: lh=%u ", lost_high_flag
);
705 if (packet_length
< (offset
- start_offset
) ||
706 packet_length
> tvb_reported_length_remaining(tvb
, start_offset
))
708 proto_tree_add_expert(tree
, pinfo
, &ei_rdt_packet_length
, tvb
, 0, 0);
709 packet_length
= tvb_captured_length_remaining(tvb
, start_offset
);
712 return start_offset
+ packet_length
;
715 /* Dissect an att-request packet */
716 unsigned dissect_rdt_rtt_request_packet(tvbuff_t
*tvb
, packet_info
*pinfo
, proto_tree
*tree
, unsigned offset
)
718 /* Flags in first byte */
722 proto_tree_add_item(tree
, hf_rdt_packet_type
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
725 col_append_str(pinfo
->cinfo
, COL_INFO
, "RTT-REQUEST: ");
730 /* Dissect an att-response packet */
731 unsigned dissect_rdt_rtt_response_packet(tvbuff_t
*tvb
, packet_info
*pinfo
, proto_tree
*tree
, unsigned offset
)
733 /* Flags in first byte */
737 proto_tree_add_item(tree
, hf_rdt_packet_type
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
740 proto_tree_add_item(tree
, hf_rdt_rtrp_ts_sec
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
742 proto_tree_add_item(tree
, hf_rdt_rtrp_ts_usec
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
745 col_append_str(pinfo
->cinfo
, COL_INFO
, "RTT-RESPONSE: ");
750 /* Dissect an congestion packet */
751 unsigned dissect_rdt_congestion_packet(tvbuff_t
*tvb
, packet_info
*pinfo
, proto_tree
*tree
, unsigned offset
)
753 /* Flags in first byte */
757 proto_tree_add_item(tree
, hf_rdt_packet_type
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
760 proto_tree_add_item(tree
, hf_rdt_cong_xmit_mult
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
762 proto_tree_add_item(tree
, hf_rdt_cong_recv_mult
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
765 col_append_str(pinfo
->cinfo
, COL_INFO
, "CONGESTION: ");
770 /* Dissect an stream-end packet */
771 unsigned dissect_rdt_stream_end_packet(tvbuff_t
*tvb
, packet_info
*pinfo
, proto_tree
*tree
, unsigned offset
)
774 uint8_t need_reliable
;
778 proto_tree
*flags_tree
;
781 /* Flags in first byte */
782 flags1
= tvb_get_uint8(tvb
, offset
);
783 need_reliable
= (flags1
& 0x80) >> 7;
784 stream_id
= (flags1
& 0x7c) >> 2;
785 packet_sent
= (flags1
& 0x2) >> 1;
786 ext_flag
= flags1
& 0x1;
788 /* Create subtree for flags fields */
789 ti
= proto_tree_add_string_format(tree
, hf_rdt_stre_flags
, tvb
, offset
, 1,
791 "Need-reliable=%u, stream-id=%u, packet-sent=%u, ext-flag=%u",
796 flags_tree
= proto_item_add_subtree(ti
, ett_rdt_stre_flags
);
798 proto_tree_add_item(flags_tree
, hf_rdt_stre_need_reliable
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
799 proto_tree_add_item(flags_tree
, hf_rdt_stre_stream_id
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
800 proto_tree_add_item(flags_tree
, hf_rdt_stre_packet_sent
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
801 proto_tree_add_item(flags_tree
, hf_rdt_stre_ext_flag
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
805 proto_tree_add_item(tree
, hf_rdt_packet_type
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
808 proto_tree_add_item(tree
, hf_rdt_stre_seqno
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
810 proto_tree_add_item(tree
, hf_rdt_timestamp
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
813 /* Stream ID expansion */
816 stream_id
= tvb_get_ntohs(tvb
, offset
);
817 proto_tree_add_item(tree
, hf_rdt_stream_id_ex
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
824 proto_tree_add_item(tree
, hf_rdt_total_reliable
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
830 proto_tree_add_item(tree
, hf_rdt_stre_dummy_flags1
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
832 proto_tree_add_item(tree
, hf_rdt_stre_dummy_type
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
834 proto_tree_add_item(tree
, hf_rdt_stre_reason_code
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
836 /* XXX: Remainder is reason_text */
837 offset
+= tvb_captured_length_remaining(tvb
, offset
);
840 col_append_fstr(pinfo
->cinfo
, COL_INFO
, "STREAM-END: stream-id=%02u ", stream_id
);
845 /* Dissect an report packet */
846 unsigned dissect_rdt_report_packet(tvbuff_t
*tvb
, packet_info
*pinfo
, proto_tree
*tree
, unsigned offset
)
848 unsigned start_offset
= offset
;
849 uint16_t packet_length
;
851 uint8_t length_included_flag
;
852 proto_tree
*flags_tree
;
855 /* Flags in first byte */
856 flags1
= tvb_get_uint8(tvb
, offset
);
857 length_included_flag
= (flags1
& 0x80) >> 7;
859 /* Create subtree for flags fields */
860 ti
= proto_tree_add_string_format(tree
, hf_rdt_report_flags
, tvb
, offset
, 1,
862 "Length-included=%u",
863 length_included_flag
);
864 flags_tree
= proto_item_add_subtree(ti
, ett_rdt_report_flags
);
866 proto_tree_add_item(flags_tree
, hf_rdt_len_included
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
870 proto_tree_add_item(tree
, hf_rdt_packet_type
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
873 /* Length field is optional */
874 if (length_included_flag
)
876 packet_length
= tvb_get_ntohs(tvb
, offset
);
877 proto_tree_add_item(tree
, hf_rdt_packet_length
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
880 /* Check that there are as many bytes as reported */
881 tvb_ensure_bytes_exist(tvb
, start_offset
, packet_length
);
885 packet_length
= tvb_captured_length_remaining(tvb
, start_offset
);
888 col_append_str(pinfo
->cinfo
, COL_INFO
, "REPORT: ");
890 /* The remaining data is unparsed. */
891 proto_tree_add_item(tree
, hf_rdt_data
, tvb
, offset
, -1, ENC_NA
);
893 if (packet_length
< (offset
- start_offset
) ||
894 packet_length
> tvb_reported_length_remaining(tvb
, start_offset
))
896 proto_tree_add_expert(tree
, pinfo
, &ei_rdt_packet_length
, tvb
, 0, 0);
897 packet_length
= tvb_captured_length_remaining(tvb
, start_offset
);
900 return start_offset
+ packet_length
;
903 /* Dissect an latency-report packet */
904 unsigned dissect_rdt_latency_report_packet(tvbuff_t
*tvb
, packet_info
*pinfo
, proto_tree
*tree
, unsigned offset
)
906 unsigned start_offset
= offset
;
907 uint16_t packet_length
;
909 uint8_t length_included_flag
;
910 uint32_t server_out_time
;
911 proto_tree
*flags_tree
;
914 /* Flags in first byte */
915 flags1
= tvb_get_uint8(tvb
, offset
);
916 length_included_flag
= (flags1
& 0x80) >> 7;
918 /* Create subtree for flags fields */
919 ti
= proto_tree_add_string_format(tree
, hf_rdt_latency_report_flags
, tvb
, offset
, 1,
921 "Length-included=%u",
922 length_included_flag
);
923 flags_tree
= proto_item_add_subtree(ti
, ett_rdt_latency_report_flags
);
925 proto_tree_add_item(flags_tree
, hf_rdt_len_included
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
929 proto_tree_add_item(tree
, hf_rdt_packet_type
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
932 /* Length field is optional */
933 if (length_included_flag
)
935 packet_length
= tvb_get_ntohs(tvb
, offset
);
936 proto_tree_add_item(tree
, hf_rdt_packet_length
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
939 /* Check that there are as many bytes as reported */
940 tvb_ensure_bytes_exist(tvb
, start_offset
, packet_length
);
944 packet_length
= tvb_captured_length_remaining(tvb
, start_offset
);
947 server_out_time
= tvb_get_ntohl(tvb
, offset
);
948 proto_tree_add_item(tree
, hf_rdt_lrpt_server_out_time
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
951 col_append_fstr(pinfo
->cinfo
, COL_INFO
, "LATENCY-REPORT: t=%u ", server_out_time
);
953 if (packet_length
< (offset
- start_offset
) ||
954 packet_length
> tvb_reported_length_remaining(tvb
, start_offset
))
956 proto_tree_add_expert(tree
, pinfo
, &ei_rdt_packet_length
, tvb
, 0, 0);
957 packet_length
= tvb_captured_length_remaining(tvb
, start_offset
);
960 return start_offset
+ packet_length
;
963 /* Dissect a transport-info packet */
964 unsigned dissect_rdt_transport_info_request_packet(tvbuff_t
*tvb
, packet_info
*pinfo
, proto_tree
*tree
, unsigned offset
)
967 uint8_t request_rtt_info_flag
;
968 uint8_t request_buffer_info_flag
;
969 proto_tree
*flags_tree
;
972 /* Flags in first byte */
973 flags1
= tvb_get_uint8(tvb
, offset
);
974 request_rtt_info_flag
= (flags1
& 0x2) >> 1;
975 request_buffer_info_flag
= (flags1
& 0x01);
977 /* Create subtree for flags fields */
978 ti
= proto_tree_add_string_format(tree
, hf_rdt_ack_flags
, tvb
, offset
, 1,
980 "Request-rtt-info=%u, request-buffer-info=%u",
981 request_rtt_info_flag
,
982 request_buffer_info_flag
);
983 flags_tree
= proto_item_add_subtree(ti
, ett_rdt_tirq_flags
);
985 proto_tree_add_item(flags_tree
, hf_rdt_tirq_request_rtt_info
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
986 proto_tree_add_item(flags_tree
, hf_rdt_tirq_request_buffer_info
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
990 proto_tree_add_item(tree
, hf_rdt_packet_type
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
993 if (request_rtt_info_flag
)
995 proto_tree_add_item(tree
, hf_rdt_tirq_request_time_msec
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
999 col_append_str(pinfo
->cinfo
, COL_INFO
, "TRANSPORT-INFO-REQUEST: ");
1004 /* Dissect an transport-info-response packet */
1005 unsigned dissect_rdt_transport_info_response_packet(tvbuff_t
*tvb
, packet_info
*pinfo
, proto_tree
*tree
, unsigned offset
)
1008 uint8_t has_rtt_info
;
1010 uint8_t has_buffer_info
;
1011 proto_tree
*flags_tree
;
1014 /* Flags in first byte */
1015 flags1
= tvb_get_uint8(tvb
, offset
);
1016 has_rtt_info
= (flags1
& 0x4) >> 2;
1017 is_delayed
= (flags1
& 0x2) >> 1;
1018 has_buffer_info
= (flags1
& 0x1);
1020 /* Create subtree for flags fields */
1021 ti
= proto_tree_add_string_format(tree
, hf_rdt_tirp_flags
, tvb
, offset
, 1,
1023 "Has-rtt-info=%u, is-delayed=%u, has-buffer-info=%u",
1027 flags_tree
= proto_item_add_subtree(ti
, ett_rdt_tirp_flags
);
1029 proto_tree_add_item(flags_tree
, hf_rdt_tirp_has_rtt_info
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1030 proto_tree_add_item(flags_tree
, hf_rdt_tirp_is_delayed
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1031 proto_tree_add_item(flags_tree
, hf_rdt_tirp_has_buffer_info
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1035 proto_tree_add_item(tree
, hf_rdt_packet_type
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
1041 proto_tree_add_item(tree
, hf_rdt_tirp_request_time_msec
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
1046 proto_tree_add_item(tree
, hf_rdt_tirp_response_time_msec
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
1052 if (has_buffer_info
)
1056 /* Read number of buffers */
1057 uint16_t buffer_info_count
= tvb_get_ntohs(tvb
, offset
);
1058 proto_tree_add_item(tree
, hf_rdt_tirp_buffer_info_count
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
1061 for (n
=0; n
< buffer_info_count
; n
++)
1063 proto_tree
*buffer_info_tree
;
1066 /* Each buffer info in a new subtree */
1067 ti2
= proto_tree_add_string_format(tree
, hf_rdt_tirp_buffer_info
, tvb
, offset
, 14,
1071 buffer_info_tree
= proto_item_add_subtree(ti2
, ett_rdt_tirp_buffer_info
);
1073 /* Read individual buffer info */
1074 proto_tree_add_item(buffer_info_tree
, hf_rdt_tirp_buffer_info_stream_id
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
1076 proto_tree_add_item(buffer_info_tree
, hf_rdt_tirp_buffer_info_lowest_timestamp
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
1078 proto_tree_add_item(buffer_info_tree
, hf_rdt_tirp_buffer_info_highest_timestamp
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
1080 proto_tree_add_item(buffer_info_tree
, hf_rdt_tirp_buffer_info_bytes_buffered
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
1085 /* Report what is left */
1086 offset
+= tvb_captured_length_remaining(tvb
, offset
);
1088 col_append_str(pinfo
->cinfo
, COL_INFO
, "RESPONSE: ");
1093 /* Dissect a bw-probing packet */
1094 unsigned dissect_rdt_bw_probing_packet(tvbuff_t
*tvb
, packet_info
*pinfo
, proto_tree
*tree
, unsigned offset
)
1096 unsigned start_offset
= offset
;
1097 uint16_t packet_length
;
1099 uint8_t length_included_flag
;
1100 proto_tree
*flags_tree
;
1103 /* Flags in first byte */
1104 flags1
= tvb_get_uint8(tvb
, offset
);
1105 length_included_flag
= (flags1
& 0x80) >> 7;
1107 /* Create subtree for flags fields */
1108 ti
= proto_tree_add_string_format(tree
, hf_rdt_bw_probing_flags
, tvb
, offset
, 1,
1110 "Length-included=%u",
1111 length_included_flag
);
1112 flags_tree
= proto_item_add_subtree(ti
, ett_rdt_bw_probing_flags
);
1114 proto_tree_add_item(flags_tree
, hf_rdt_len_included
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1118 proto_tree_add_item(tree
, hf_rdt_packet_type
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
1121 /* Length field is optional */
1122 if (length_included_flag
)
1124 packet_length
= tvb_get_ntohs(tvb
, offset
);
1125 proto_tree_add_item(tree
, hf_rdt_packet_length
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
1128 /* Check that there are as many bytes as reported */
1129 tvb_ensure_bytes_exist(tvb
, start_offset
, packet_length
);
1133 packet_length
= tvb_captured_length_remaining(tvb
, start_offset
);
1136 proto_tree_add_item(tree
, hf_rdt_bwpp_seqno
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1138 proto_tree_add_item(tree
, hf_rdt_timestamp
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1141 col_append_str(pinfo
->cinfo
, COL_INFO
, "BW-PROBING: ");
1143 if (packet_length
< (offset
- start_offset
) ||
1144 packet_length
> tvb_reported_length_remaining(tvb
, start_offset
))
1146 proto_tree_add_expert(tree
, pinfo
, &ei_rdt_packet_length
, tvb
, 0, 0);
1147 packet_length
= tvb_captured_length_remaining(tvb
, start_offset
);
1150 return start_offset
+ packet_length
;
1153 /* Dissect an unknown control packet */
1154 unsigned dissect_rdt_unknown_control(tvbuff_t
*tvb
, packet_info
*pinfo
, proto_tree
*tree
, unsigned offset
)
1156 /* Flags in first byte */
1157 proto_tree_add_item(tree
, hf_rdt_unk_flags1
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1161 proto_tree_add_item(tree
, hf_rdt_packet_type
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
1164 /* The remaining data is unparsed. */
1165 proto_tree_add_item(tree
, hf_rdt_data
, tvb
, offset
, -1, ENC_NA
);
1166 offset
+= tvb_captured_length_remaining(tvb
, offset
);
1168 col_append_str(pinfo
->cinfo
, COL_INFO
, "UNKNOWN-CTL: ");
1173 /* Look for conversation info and display any setup info found */
1174 static void show_setup_info(tvbuff_t
*tvb
, packet_info
*pinfo
, proto_tree
*tree
)
1176 /* Conversation and current data */
1177 conversation_t
*p_conv
;
1178 struct _rdt_conversation_info
*p_conv_data
;
1180 /* Use existing packet info if available */
1181 p_conv_data
= (struct _rdt_conversation_info
*)p_get_proto_data(wmem_file_scope(), pinfo
, proto_rdt
, 0);
1185 /* First time, get info from conversation */
1186 p_conv
= find_conversation(pinfo
->num
, &pinfo
->net_dst
, &pinfo
->net_src
,
1187 conversation_pt_to_conversation_type(pinfo
->ptype
),
1188 pinfo
->destport
, pinfo
->srcport
, NO_ADDR_B
);
1191 /* Create space for conversation info */
1192 struct _rdt_conversation_info
*p_conv_packet_data
;
1193 p_conv_data
= (struct _rdt_conversation_info
*)conversation_get_proto_data(p_conv
, proto_rdt
);
1197 /* Save this conversation info into packet info */
1198 p_conv_packet_data
= wmem_new(wmem_file_scope(), struct _rdt_conversation_info
);
1199 (void) g_strlcpy(p_conv_packet_data
->method
, p_conv_data
->method
, MAX_RDT_SETUP_METHOD_SIZE
);
1200 p_conv_packet_data
->frame_number
= p_conv_data
->frame_number
;
1201 p_conv_packet_data
->feature_level
= p_conv_data
->feature_level
;
1202 p_add_proto_data(wmem_file_scope(), pinfo
, proto_rdt
, 0, p_conv_packet_data
);
1207 /* Create setup info subtree with summary info. */
1210 proto_tree
*rdt_setup_tree
;
1211 proto_item
*ti
= proto_tree_add_string_format(tree
, hf_rdt_setup
, tvb
, 0, 0,
1213 "Stream setup by %s (frame %u), feature level %d",
1214 p_conv_data
->method
,
1215 p_conv_data
->frame_number
,
1216 p_conv_data
->feature_level
);
1217 proto_item_set_generated(ti
);
1218 rdt_setup_tree
= proto_item_add_subtree(ti
, ett_rdt_setup
);
1221 /* Add details into subtree */
1222 proto_item
* item
= proto_tree_add_uint(rdt_setup_tree
, hf_rdt_setup_frame
,
1223 tvb
, 0, 0, p_conv_data
->frame_number
);
1224 proto_item_set_generated(item
);
1225 item
= proto_tree_add_string(rdt_setup_tree
, hf_rdt_setup_method
,
1226 tvb
, 0, 0, p_conv_data
->method
);
1227 proto_item_set_generated(item
);
1228 item
= proto_tree_add_int(rdt_setup_tree
, hf_rdt_feature_level
,
1229 tvb
, 0, 0, p_conv_data
->feature_level
);
1230 proto_item_set_generated(item
);
1236 void proto_register_rdt(void)
1238 static hf_register_info hf
[] =
1253 &hf_rdt_data_flags1
,
1265 &hf_rdt_len_included
,
1268 "rdt.length-included",
1277 &hf_rdt_data_need_reliable
,
1280 "rdt.need-reliable",
1289 &hf_rdt_data_stream_id
,
1301 &hf_rdt_data_is_reliable
,
1313 &hf_rdt_data_flags2
,
1321 "RDT data flags2", HFILL
1325 &hf_rdt_data_backtoback
,
1337 &hf_rdt_data_slowdata
,
1349 &hf_rdt_data_asmrule
,
1363 "RDT asm-action flags 1",
1369 "RDT aact flags", HFILL
1373 &hf_rdt_aact_stream_id
,
1385 &hf_rdt_sequence_number
,
1388 "rdt.sequence-number",
1397 &hf_rdt_packet_type
,
1403 VALS(packet_type_vals
),
1421 &hf_rdt_ack_lost_high
,
1433 &hf_rdt_latency_report_flags
,
1435 "RDT latency report flags",
1436 "rdt.latency-report-flags",
1445 &hf_rdt_bandwidth_report_flags
,
1447 "RDT bandwidth report flags",
1448 "rdt.bandwidth-report-flags",
1459 "RDT stream end flags",
1460 "rdt.stream-end-flags",
1470 &hf_rdt_rtt_request_flags
,
1472 "RDT rtt request flags",
1473 "rdt.rtt-request-flags",
1484 &hf_rdt_rtt_response_flags
,
1486 "RDT rtt response flags",
1487 "rdt.rtt-response-flags",
1498 &hf_rdt_congestion_flags
,
1500 "RDT congestion flags",
1501 "rdt.congestion-flags",
1511 &hf_rdt_report_flags
,
1526 "RDT transport info request flags",
1527 "rdt.transport-info-request-flags",
1539 "RDT transport info response flags",
1540 "rdt.transport-info-response-flags",
1549 &hf_rdt_bw_probing_flags
,
1551 "RDT bw probing flags",
1552 "rdt.bw-probing-flags",
1561 &hf_rdt_packet_length
,
1564 "rdt.packet-length",
1585 &hf_rdt_stream_id_ex
,
1587 "Stream-id expansion",
1588 "rdt.stream-id-expansion",
1599 "Asm rule expansion",
1600 "rdt.asm-rule-expansion",
1609 &hf_rdt_total_reliable
,
1612 "rdt.total-reliable",
1633 &hf_rdt_aact_reliable_seqno
,
1635 "Reliable sequence number",
1636 "rdt.reliable-seq-no",
1645 &hf_rdt_brpt_interval
,
1647 "Bandwidth report interval",
1648 "rdt.bwid-report-interval",
1657 &hf_rdt_brpt_bandwidth
,
1659 "Bandwidth report bandwidth",
1660 "rdt.bwid-report-bandwidth",
1669 &hf_rdt_brpt_sequence
,
1671 "Bandwidth report sequence",
1672 "rdt.bwid-report-sequence",
1681 &hf_rdt_rtrp_ts_sec
,
1683 "Round trip response timestamp seconds",
1693 &hf_rdt_rtrp_ts_usec
,
1695 "Round trip response timestamp microseconds",
1705 &hf_rdt_cong_xmit_mult
,
1707 "Congestion transmit multiplier",
1708 "rdt.cong-xmit-mult",
1717 &hf_rdt_cong_recv_mult
,
1719 "Congestion receive multiplier",
1720 "rdt.cong-recv-mult",
1729 &hf_rdt_stre_need_reliable
,
1732 "rdt.stre-need-reliable",
1741 &hf_rdt_stre_stream_id
,
1744 "rdt.stre-stream-id",
1753 &hf_rdt_stre_packet_sent
,
1756 "rdt.stre-packet-sent",
1765 &hf_rdt_stre_ext_flag
,
1768 "rdt.stre-ext-flag",
1780 "Stream end sequence number",
1790 &hf_rdt_stre_dummy_flags1
,
1792 "Stream end reason dummy flags1",
1793 "rdt.stre-reason-dummy-flags1",
1802 &hf_rdt_stre_dummy_type
,
1804 "Stream end reason dummy type",
1805 "rdt.stre-reason-dummy-type",
1814 &hf_rdt_stre_reason_code
,
1816 "Stream end reason code",
1817 "rdt.stre-reason-code",
1826 &hf_rdt_lrpt_server_out_time
,
1828 "Latency report server out time",
1829 "rdt.lrpt-server-out-time",
1838 &hf_rdt_tirq_request_rtt_info
,
1840 "Transport info request rtt info flag",
1841 "rdt.tirq-request-rtt-info",
1850 &hf_rdt_tirq_request_buffer_info
,
1852 "Transport info request buffer info flag",
1853 "rdt.tirq-request-buffer-info",
1862 &hf_rdt_tirq_request_time_msec
,
1864 "Transport info request time msec",
1865 "rdt.tirq-request-time-msec",
1874 &hf_rdt_tirp_has_rtt_info
,
1876 "Transport info response has rtt info flag",
1877 "rdt.tirp-has-rtt-info",
1886 &hf_rdt_tirp_is_delayed
,
1888 "Transport info response is delayed",
1889 "rdt.tirp-is-delayed",
1898 &hf_rdt_tirp_has_buffer_info
,
1900 "Transport info response has buffer info",
1901 "rdt.tirp-has-buffer-info",
1910 &hf_rdt_tirp_request_time_msec
,
1912 "Transport info request time msec",
1913 "rdt.tirp-request-time-msec",
1922 &hf_rdt_tirp_response_time_msec
,
1924 "Transport info response time msec",
1925 "rdt.tirp-response-time-msec",
1934 &hf_rdt_tirp_buffer_info_count
,
1936 "Transport info buffer into count",
1937 "rdt.tirp-buffer-info-count",
1946 &hf_rdt_tirp_buffer_info
,
1949 "rdt.tirp-buffer-info",
1958 &hf_rdt_tirp_buffer_info_stream_id
,
1960 "Buffer info stream-id",
1961 "rdt.tirp-buffer-info-stream-id",
1970 &hf_rdt_tirp_buffer_info_lowest_timestamp
,
1973 "rdt.tirp-buffer-info-lowest-timestamp",
1982 &hf_rdt_tirp_buffer_info_highest_timestamp
,
1984 "Highest timestamp",
1985 "rdt.tirp-buffer-info-highest-timestamp",
1994 &hf_rdt_tirp_buffer_info_bytes_buffered
,
1997 "rdt.tirp-buffer-info-bytes-buffered",
2008 "Bandwidth probing packet seqno",
2020 "Unknown packet flags",
2038 "Stream setup, method and frame number", HFILL
2042 &hf_rdt_setup_frame
,
2050 "Frame that set up this stream", HFILL
2054 &hf_rdt_setup_method
,
2062 "Method used to set up this stream", HFILL
2066 &hf_rdt_feature_level
,
2068 "RDT feature level",
2069 "rdt.feature-level",
2084 &ett_rdt_data_flags1
,
2085 &ett_rdt_data_flags2
,
2086 &ett_rdt_aact_flags
,
2088 &ett_rdt_latency_report_flags
,
2089 &ett_rdt_bandwidth_report_flags
,
2090 &ett_rdt_stre_flags
,
2091 &ett_rdt_rtt_request_flags
,
2092 &ett_rdt_rtt_response_flags
,
2093 &ett_rdt_congestion_flags
,
2094 &ett_rdt_report_flags
,
2095 &ett_rdt_tirq_flags
,
2096 &ett_rdt_tirp_flags
,
2097 &ett_rdt_tirp_buffer_info
,
2098 &ett_rdt_bw_probing_flags
2101 static ei_register_info ei
[] = {
2102 { &ei_rdt_packet_length
, { "rdt.invalid_packet_length", PI_MALFORMED
, PI_ERROR
, "Packet length invalid", EXPFILL
}},
2105 module_t
*rdt_module
;
2106 expert_module_t
* expert_rdt
;
2108 /* Register protocol and fields */
2109 proto_rdt
= proto_register_protocol("Real Data Transport", "RDT", "rdt");
2110 proto_register_field_array(proto_rdt
, hf
, array_length(hf
));
2111 proto_register_subtree_array(ett
, array_length(ett
));
2112 expert_rdt
= expert_register_protocol(proto_rdt
);
2113 expert_register_field_array(expert_rdt
, ei
, array_length(ei
));
2114 rdt_handle
= register_dissector("rdt", dissect_rdt
, proto_rdt
);
2116 /* Preference settings */
2117 rdt_module
= prefs_register_protocol(proto_rdt
, NULL
);
2118 prefs_register_bool_preference(rdt_module
, "show_setup_info",
2119 "Show stream setup information",
2120 "Where available, show which protocol and frame caused "
2121 "this RDT stream to be created",
2122 &global_rdt_show_setup_info
);
2124 prefs_register_obsolete_preference(rdt_module
, "register_udp_port");
2127 void proto_reg_handoff_rdt(void)
2129 dissector_add_uint_with_preference("udp.port", RDT_UDP_PORT
, rdt_handle
);
2133 * Editor modelines - https://www.wireshark.org/tools/modelines.html
2138 * indent-tabs-mode: nil
2141 * vi: set shiftwidth=4 tabstop=8 expandtab:
2142 * :indentSize=4:tabSize=8:noTabs=true: