3 * Routines for RDT dissection
4 * RDT = Real Data Transport
7 * Written by Martin Mathieson and Tom Marshall
11 * Wireshark - Network traffic analyzer
12 * By Gerald Combs <gerald@wireshark.org>
13 * Copyright 1998 Gerald Combs
15 * This program is free software; you can redistribute it and/or
16 * modify it under the terms of the GNU General Public License
17 * as published by the Free Software Foundation; either version 2
18 * of the License, or (at your option) any later version.
20 * This program is distributed in the hope that it will be useful,
21 * but WITHOUT ANY WARRANTY; without even the implied warranty of
22 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
23 * GNU General Public License for more details.
25 * You should have received a copy of the GNU General Public License
26 * along with this program; if not, write to the Free Software
27 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
30 /* Information sources:
31 * helixcommunity.org sources, in particular
32 * server/protocol/transport/rdt/pub/tngpkt.pm
43 #include <epan/packet.h>
44 #include <epan/conversation.h>
45 #include <epan/prefs.h>
46 #include <epan/emem.h>
47 #include <epan/strutil.h>
49 #include "packet-rdt.h"
51 static dissector_handle_t rdt_handle;
53 static gint proto_rdt = -1;
56 static gint hf_rdt_packet = -1;
59 static gint hf_rdt_len_included = -1;
61 /* flags1: data packet */
62 static gint hf_rdt_data_flags1 = -1;
63 static gint hf_rdt_data_need_reliable = -1;
64 static gint hf_rdt_data_stream_id = -1;
65 static gint hf_rdt_data_is_reliable = -1;
67 /* flags2: data packet */
68 static gint hf_rdt_data_flags2 = -1;
69 static gint hf_rdt_data_backtoback = -1;
70 static gint hf_rdt_data_slowdata = -1;
71 static gint hf_rdt_data_asmrule = -1;
73 /* flags1: asm action packet */
74 static gint hf_rdt_aact_flags = -1;
75 static gint hf_rdt_aact_stream_id = -1;
77 /* flags1: ack packet */
78 static gint hf_rdt_ack_flags = -1;
79 static gint hf_rdt_ack_lost_high = -1;
81 /* flags1: latency report packet */
82 static gint hf_rdt_latency_report_flags = -1;
84 /* flags1: bandwidth report packet */
85 static gint hf_rdt_bandwidth_report_flags = -1;
87 /* flags1: stream end packet */
88 static gint hf_rdt_stre_flags = -1;
89 static gint hf_rdt_stre_need_reliable = -1;
90 static gint hf_rdt_stre_stream_id = -1;
91 static gint hf_rdt_stre_packet_sent = -1;
92 static gint hf_rdt_stre_ext_flag = -1;
94 static gint hf_rdt_rtt_request_flags = -1;
95 static gint hf_rdt_rtt_response_flags = -1;
96 static gint hf_rdt_congestion_flags = -1;
97 static gint hf_rdt_report_flags = -1;
98 static gint hf_rdt_tirq_flags = -1;
99 static gint hf_rdt_tirp_flags = -1;
100 static gint hf_rdt_bw_probing_flags = -1;
102 /* Octets 1-2: sequence number or packet type */
103 static gint hf_rdt_sequence_number = -1;
104 static gint hf_rdt_packet_type = -1;
106 /* Only present if length_included */
107 static gint hf_rdt_packet_length = -1;
109 /* General shared fields */
110 static gint hf_rdt_timestamp = -1;
111 static gint hf_rdt_stream_id_ex = -1;
112 static gint hf_rdt_asmrule_ex = -1;
113 static gint hf_rdt_total_reliable = -1;
114 static gint hf_rdt_data = -1;
116 /* Special use fields */
117 static gint hf_rdt_aact_reliable_seqno = -1;
118 static gint hf_rdt_brpt_interval = -1;
119 static gint hf_rdt_brpt_bandwidth = -1;
120 static gint hf_rdt_brpt_sequence = -1;
121 static gint hf_rdt_rtrp_ts_sec = -1;
122 static gint hf_rdt_rtrp_ts_usec = -1;
123 static gint hf_rdt_cong_xmit_mult = -1;
124 static gint hf_rdt_cong_recv_mult = -1;
125 static gint hf_rdt_stre_seqno = -1;
126 static gint hf_rdt_stre_dummy_flags1 = -1;
127 static gint hf_rdt_stre_dummy_type = -1;
128 static gint hf_rdt_stre_reason_code = -1;
129 static gint hf_rdt_lrpt_server_out_time = -1;
130 static gint hf_rdt_tirq_request_rtt_info = -1;
131 static gint hf_rdt_tirq_request_buffer_info = -1;
132 static gint hf_rdt_tirq_request_time_msec = -1;
133 static gint hf_rdt_tirp_has_rtt_info = -1;
134 static gint hf_rdt_tirp_is_delayed = -1;
135 static gint hf_rdt_tirp_has_buffer_info = -1;
136 static gint hf_rdt_tirp_request_time_msec = -1;
137 static gint hf_rdt_tirp_response_time_msec = -1;
138 static gint hf_rdt_tirp_buffer_info = -1;
139 static gint hf_rdt_tirp_buffer_info_count = -1;
140 static gint hf_rdt_tirp_buffer_info_stream_id = -1;
141 static gint hf_rdt_tirp_buffer_info_lowest_timestamp = -1;
142 static gint hf_rdt_tirp_buffer_info_highest_timestamp = -1;
143 static gint hf_rdt_tirp_buffer_info_bytes_buffered = -1;
144 static gint hf_rdt_bwpp_seqno = -1;
145 static gint hf_rdt_unk_flags1 = -1;
147 /* RDT setup fields */
148 static gint hf_rdt_setup = -1;
149 static gint hf_rdt_setup_frame = -1;
150 static gint hf_rdt_setup_method = -1;
151 static gint hf_rdt_feature_level = -1;
153 /* RDT fields defining a sub tree */
154 static gint ett_rdt = -1;
155 static gint ett_rdt_packet = -1;
156 static gint ett_rdt_setup = -1;
157 static gint ett_rdt_data_flags1 = -1;
158 static gint ett_rdt_data_flags2 = -1;
159 static gint ett_rdt_aact_flags = -1;
160 static gint ett_rdt_ack_flags = -1;
161 static gint ett_rdt_latency_report_flags = -1;
162 static gint ett_rdt_bandwidth_report_flags = -1;
163 static gint ett_rdt_stre_flags = -1;
164 static gint ett_rdt_rtt_request_flags = -1;
165 static gint ett_rdt_rtt_response_flags = -1;
166 static gint ett_rdt_congestion_flags = -1;
167 static gint ett_rdt_report_flags = -1;
168 static gint ett_rdt_tirq_flags = -1;
169 static gint ett_rdt_tirp_flags = -1;
170 static gint ett_rdt_tirp_buffer_info = -1;
171 static gint ett_rdt_bw_probing_flags = -1;
173 /* Port preference settings */
174 static gboolean global_rdt_register_udp_port = FALSE;
175 static guint global_rdt_udp_port = 6970;
177 void proto_register_rdt(void);
178 void proto_reg_handoff_rdt(void);
180 /* Main dissection function */
181 static void dissect_rdt(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree);
183 /* Parse individual packet types */
184 static guint dissect_rdt_data_packet(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset);
185 static guint dissect_rdt_asm_action_packet(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset);
186 static guint dissect_rdt_bandwidth_report_packet(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset);
187 static guint dissect_rdt_ack_packet(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset);
188 static guint dissect_rdt_rtt_request_packet(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset);
189 static guint dissect_rdt_rtt_response_packet(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset);
190 static guint dissect_rdt_congestion_packet(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset);
191 static guint dissect_rdt_stream_end_packet(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset);
192 static guint dissect_rdt_report_packet(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset);
193 static guint dissect_rdt_latency_report_packet(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset);
194 static guint dissect_rdt_transport_info_request_packet(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset);
195 static guint dissect_rdt_transport_info_response_packet(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset);
196 static guint dissect_rdt_bw_probing_packet(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset);
197 static guint dissect_rdt_unknown_control(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset);
199 static void show_setup_info(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree);
201 /* Preferences bool to control whether or not setup info should be shown */
202 static gboolean global_rdt_show_setup_info = TRUE;
205 #define RDT_ASMACTIION_PACKET 0xff00
206 #define RDT_BANDWIDTHREPORT_PACKET 0xff01
207 #define RDT_ACK_PACKET 0xff02
208 #define RDT_RTTREQUEST_PACKET 0xff03
209 #define RDT_RTTRESPONSE_PACKET 0xff04
210 #define RDT_CONGESTION_PACKET 0xff05
211 #define RDT_STREAMEND_PACKET 0xff06
212 #define RDT_REPORT_PACKET 0xff07
213 #define RDT_LATENCYREPORT_PACKET 0xff08
214 #define RDT_TRANSPORTINFO_PACKET 0xff09
215 #define RDT_TRANSPORTINFORESPONSE_PACKET 0xff0a
216 #define RDT_BWPROBING_PACKET 0xff0b
218 static const value_string packet_type_vals[] =
220 { RDT_ASMACTIION_PACKET, "Asm action" },
221 { RDT_BANDWIDTHREPORT_PACKET, "Bandwidth report" },
222 { RDT_ACK_PACKET, "Ack" },
223 { RDT_RTTREQUEST_PACKET, "RTT request" },
224 { RDT_RTTRESPONSE_PACKET, "RTT response" },
225 { RDT_CONGESTION_PACKET, "Congestion" },
226 { RDT_STREAMEND_PACKET, "Stream end" },
227 { RDT_REPORT_PACKET, "Report" },
228 { RDT_LATENCYREPORT_PACKET, "Latency report" },
229 { RDT_TRANSPORTINFO_PACKET, "Transport info" },
230 { RDT_TRANSPORTINFORESPONSE_PACKET, "Transport info response" },
231 { RDT_BWPROBING_PACKET, "BW probing" },
236 /* Set up an RDT conversation */
237 void rdt_add_address(packet_info *pinfo,
238 address *addr, int port,
240 const gchar *setup_method,
241 gint rdt_feature_level)
244 conversation_t* p_conv;
245 struct _rdt_conversation_info *p_conv_data = NULL;
247 /* If this isn't the first time this packet has been processed,
248 we've already done this work, so we don't need to do it
250 if (pinfo->fd->flags.visited)
255 SET_ADDRESS(&null_addr, AT_NONE, 0, NULL);
257 /* Check if the ip address and port combination is not already registered
258 as a conversation. */
259 p_conv = find_conversation(pinfo->fd->num, addr, &null_addr, PT_UDP, port, other_port,
260 NO_ADDR_B | (!other_port ? NO_PORT_B : 0));
262 /* If not, create a new conversation. */
263 if ( !p_conv || p_conv->setup_frame != pinfo->fd->num)
265 p_conv = conversation_new(pinfo->fd->num, addr, &null_addr, PT_UDP,
266 (guint32)port, (guint32)other_port,
267 NO_ADDR2 | (!other_port ? NO_PORT2 : 0));
271 conversation_set_dissector(p_conv, rdt_handle);
273 /* Check if the conversation has data associated with it. */
274 p_conv_data = conversation_get_proto_data(p_conv, proto_rdt);
276 /* If not, add a new data item. */
279 /* Create conversation data */
280 p_conv_data = se_alloc(sizeof(struct _rdt_conversation_info));
281 conversation_add_proto_data(p_conv, proto_rdt, p_conv_data);
284 /* Update the conversation data. */
285 g_strlcpy(p_conv_data->method, setup_method, MAX_RDT_SETUP_METHOD_SIZE);
286 p_conv_data->frame_number = pinfo->fd->num;
287 p_conv_data->feature_level = rdt_feature_level;
292 /****************************************************************************/
293 /* Main dissection function */
294 /****************************************************************************/
295 static void dissect_rdt(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
297 guint previous_offset = 0;
299 proto_item *ti = NULL;
300 proto_tree *rdt_tree = NULL;
301 proto_tree *rdt_packet_tree = NULL;
304 /* Set/clear columns */
305 col_set_str(pinfo->cinfo, COL_PROTOCOL, "RDT");
306 col_clear(pinfo->cinfo, COL_INFO);
308 /* Create RDT protocol tree */
311 ti = proto_tree_add_item(tree, proto_rdt, tvb, offset, -1, FALSE);
312 rdt_tree = proto_item_add_subtree(ti, ett_rdt);
315 /* Conversation setup info */
316 if (global_rdt_show_setup_info)
318 show_setup_info(tvb, pinfo, rdt_tree);
321 /* Parse all RDT packets found in the frame */
322 while (offset != -1 && tvb_length_remaining(tvb, offset))
324 /* Every packet type should have at least 3 bytes */
325 tvb_ensure_bytes_exist(tvb, offset, 3);
327 /* 2nd & 3rd bytes determine packet type */
328 packet_type = tvb_get_ntohs(tvb, offset+1);
330 /* Add a tree for the next individual packet */
331 ti = proto_tree_add_string_format(rdt_tree, hf_rdt_packet, tvb, offset, -1,
334 packet_type < 0xff00 ? "Data" :
335 val_to_str(packet_type, packet_type_vals, "Unknown"));
336 rdt_packet_tree = proto_item_add_subtree(ti, ett_rdt_packet);
338 /* Dissect the details of the next packet in this frame */
339 if (packet_type < 0xff00)
341 offset = dissect_rdt_data_packet(tvb, pinfo, rdt_packet_tree, offset);
347 case RDT_ASMACTIION_PACKET:
348 offset = dissect_rdt_asm_action_packet(tvb, pinfo, rdt_packet_tree, offset);
350 case RDT_BANDWIDTHREPORT_PACKET:
351 offset = dissect_rdt_bandwidth_report_packet(tvb, pinfo, rdt_packet_tree, offset);
354 offset = dissect_rdt_ack_packet(tvb, pinfo, rdt_packet_tree, offset);
356 case RDT_RTTREQUEST_PACKET:
357 offset = dissect_rdt_rtt_request_packet(tvb, pinfo, rdt_packet_tree, offset);
359 case RDT_RTTRESPONSE_PACKET:
360 offset = dissect_rdt_rtt_response_packet(tvb, pinfo, rdt_packet_tree, offset);
362 case RDT_CONGESTION_PACKET:
363 offset = dissect_rdt_congestion_packet(tvb, pinfo, rdt_packet_tree, offset);
365 case RDT_STREAMEND_PACKET:
366 offset = dissect_rdt_stream_end_packet(tvb, pinfo, rdt_packet_tree, offset);
368 case RDT_REPORT_PACKET:
369 offset = dissect_rdt_report_packet(tvb, pinfo, rdt_packet_tree, offset);
371 case RDT_LATENCYREPORT_PACKET:
372 offset = dissect_rdt_latency_report_packet(tvb, pinfo, rdt_packet_tree, offset);
374 case RDT_TRANSPORTINFO_PACKET:
375 offset = dissect_rdt_transport_info_request_packet(tvb, pinfo, rdt_packet_tree, offset);
377 case RDT_TRANSPORTINFORESPONSE_PACKET:
378 offset = dissect_rdt_transport_info_response_packet(tvb, pinfo, rdt_packet_tree, offset);
380 case RDT_BWPROBING_PACKET:
381 offset = dissect_rdt_bw_probing_packet(tvb, pinfo, rdt_packet_tree, offset);
385 /* Unknown control packet */
386 offset = dissect_rdt_unknown_control(tvb, pinfo, rdt_packet_tree, offset);
391 /* Select correct number of bytes for the tree showing this packet */
394 proto_item_set_len(rdt_packet_tree, offset-previous_offset);
396 previous_offset = offset;
402 /************************************************/
403 /* Functions to dissect individual packet types */
404 /************************************************/
406 /* Dissect a data packet */
407 guint dissect_rdt_data_packet(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset)
409 guint start_offset = offset;
410 guint16 packet_length;
412 guint8 length_included_flag;
413 guint8 need_reliable_flag;
415 guint16 sequence_number;
416 guint8 is_reliable_flag;
419 guint16 asm_rule_number;
422 proto_tree *flags_tree1 = NULL;
423 proto_tree *flags_tree2 = NULL;
424 proto_item *ti = NULL;
426 /* Flags in first byte */
427 flags1 = tvb_get_guint8(tvb, offset);
428 length_included_flag = (flags1 & 0x80) >> 7;
429 need_reliable_flag = (flags1 & 0x40) >> 6;
430 stream_id = (flags1 & 0x3e) >> 1;
431 is_reliable_flag = flags1 & 0x01;
433 /* Create subtree for flags1 fields */
436 ti = proto_tree_add_string_format(tree, hf_rdt_data_flags1, tvb, offset, 1,
438 "Length-included=%u, need-reliable=%u, stream-id=%u, is-reliable=%u",
439 length_included_flag,
443 flags_tree1 = proto_item_add_subtree(ti, ett_rdt_data_flags1);
445 proto_tree_add_item(flags_tree1, hf_rdt_len_included, tvb, offset, 1, FALSE);
446 proto_tree_add_item(flags_tree1, hf_rdt_data_need_reliable, tvb, offset, 1, FALSE);
447 proto_tree_add_item(flags_tree1, hf_rdt_data_stream_id, tvb, offset, 1, FALSE);
448 proto_tree_add_item(flags_tree1, hf_rdt_data_is_reliable, tvb, offset, 1, FALSE);
453 /* Sequence number */
454 sequence_number = tvb_get_ntohs(tvb, offset);
455 proto_tree_add_item(tree, hf_rdt_sequence_number, tvb, offset, 2, FALSE);
458 /* Length field is optional */
459 if (length_included_flag)
461 packet_length = tvb_get_ntohs(tvb, offset);
462 proto_tree_add_item(tree, hf_rdt_packet_length, tvb, offset, 2, FALSE);
465 /* Check that there are as many bytes as reported */
466 tvb_ensure_bytes_exist(tvb, start_offset, packet_length);
470 packet_length = tvb_length_remaining(tvb, start_offset);
474 flags2 = tvb_get_guint8(tvb, offset);
475 back_to_back = (flags2 & 0x80) >> 7;
476 slow_data = (flags2 & 0x40) >> 6;
477 asm_rule_number = flags2 & 0x3f;
480 /* Create subtree for flags2 fields */
483 ti = proto_tree_add_string_format(tree, hf_rdt_data_flags2, tvb, offset, 1,
485 "Back-to-back=%u, slow-data=%u, asm-rule=%u",
490 /* Create subtree for flags and add fields */
491 flags_tree2 = proto_item_add_subtree(ti, ett_rdt_data_flags2);
493 proto_tree_add_item(flags_tree2, hf_rdt_data_backtoback, tvb, offset, 1, FALSE);
494 proto_tree_add_item(flags_tree2, hf_rdt_data_slowdata, tvb, offset, 1, FALSE);
495 proto_tree_add_item(flags_tree2, hf_rdt_data_asmrule, tvb, offset, 1, FALSE);
500 timestamp = tvb_get_ntohl(tvb, offset);
501 proto_tree_add_item(tree, hf_rdt_timestamp, tvb, offset, 4, FALSE);
504 /* Stream ID expansion */
507 stream_id = tvb_get_ntohs(tvb, offset);
508 proto_tree_add_item(tree, hf_rdt_stream_id_ex, tvb, offset, 2, FALSE);
513 if (need_reliable_flag)
515 proto_tree_add_item(tree, hf_rdt_total_reliable, tvb, offset, 2, FALSE);
519 /* Asm rule number */
520 if (asm_rule_number == 63)
522 asm_rule_number = tvb_get_ntohs(tvb, offset);
523 proto_tree_add_item(tree, hf_rdt_asmrule_ex, tvb, offset, 2, FALSE);
527 if (check_col(pinfo->cinfo, COL_INFO))
529 col_append_fstr(pinfo->cinfo, COL_INFO,
530 "DATA: stream-id=%02u asm-rule=%02u seq=%05u ts=%05u ",
531 stream_id, asm_rule_number, sequence_number, timestamp);
534 /* The remaining data is unparsed. */
535 proto_tree_add_item(tree, hf_rdt_data, tvb, offset, -1, FALSE);
536 offset += tvb_length_remaining(tvb, offset);
538 if (packet_length < (offset - start_offset) ||
539 packet_length > tvb_length_remaining(tvb, start_offset))
541 proto_tree_add_text(tree, tvb, 0, 0, "Packet length invalid");
542 packet_length = tvb_length_remaining(tvb, start_offset);
545 return start_offset + packet_length;
548 /* Dissect an asm-action packet */
549 guint dissect_rdt_asm_action_packet(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset)
551 guint start_offset = offset;
552 guint16 packet_length;
554 guint8 length_included_flag;
557 proto_tree *flags_tree = NULL;
558 proto_item *ti = NULL;
560 /* Flags in first byte */
561 flags1 = tvb_get_guint8(tvb, offset);
562 length_included_flag = (flags1 & 0x80) >> 7;
563 stream_id = (flags1 & 0x7c) >> 2;
565 /* Create subtree for flags fields */
568 ti = proto_tree_add_item(tree, proto_rdt, tvb, offset, -1, FALSE);
569 ti = proto_tree_add_string_format(tree, hf_rdt_aact_flags, tvb, offset, 1,
571 "Length-included=%u, stream_id=%u",
572 length_included_flag,
574 flags_tree = proto_item_add_subtree(ti, ett_rdt_aact_flags);
576 proto_tree_add_item(flags_tree, hf_rdt_len_included, tvb, offset, 1, FALSE);
577 proto_tree_add_item(flags_tree, hf_rdt_aact_stream_id, tvb, offset, 1, FALSE);
582 proto_tree_add_item(tree, hf_rdt_packet_type, tvb, offset, 2, FALSE);
585 rel_seqno = tvb_get_ntohs(tvb, offset);
586 proto_tree_add_item(tree, hf_rdt_aact_reliable_seqno, tvb, offset, 2, FALSE);
589 /* Length field is optional */
590 if (length_included_flag)
592 packet_length = tvb_get_ntohs(tvb, offset);
593 proto_tree_add_item(tree, hf_rdt_packet_length, tvb, offset, 2, FALSE);
596 /* Check that there are as many bytes as reported */
597 tvb_ensure_bytes_exist(tvb, start_offset, packet_length);
601 packet_length = tvb_length_remaining(tvb, start_offset);
604 /* Stream ID expansion */
607 stream_id = tvb_get_ntohs(tvb, offset);
608 proto_tree_add_item(tree, hf_rdt_stream_id_ex, tvb, offset, 2, FALSE);
612 if (check_col(pinfo->cinfo, COL_INFO))
614 col_append_fstr(pinfo->cinfo, COL_INFO,
615 "ASM-ACTION: stream-id=%02u rel-seqno=%05u ",
616 stream_id, rel_seqno);
619 /* The remaining data is unparsed. */
620 proto_tree_add_item(tree, hf_rdt_data, tvb, offset, -1, FALSE);
622 if (packet_length < (offset - start_offset) ||
623 packet_length > tvb_length_remaining(tvb, start_offset))
625 proto_tree_add_text(tree, tvb, 0, 0, "Packet length invalid");
626 packet_length = tvb_length_remaining(tvb, start_offset);
629 return start_offset + packet_length;
632 /* Dissect an bandwidth-report packet */
633 guint dissect_rdt_bandwidth_report_packet(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset)
635 guint start_offset = offset;
636 guint16 packet_length;
638 guint8 length_included_flag;
639 proto_tree *flags_tree = NULL;
640 proto_item *ti = NULL;
642 /* Flags in first byte */
643 flags1 = tvb_get_guint8(tvb, offset);
644 length_included_flag = (flags1 & 0x80) >> 7;
646 /* Create subtree for flags fields */
649 ti = proto_tree_add_string_format(tree, hf_rdt_bandwidth_report_flags, tvb, offset, 1,
651 "Length-included=%u",
652 length_included_flag);
653 flags_tree = proto_item_add_subtree(ti, ett_rdt_bandwidth_report_flags);
655 proto_tree_add_item(flags_tree, hf_rdt_len_included, tvb, offset, 1, FALSE);
660 proto_tree_add_item(tree, hf_rdt_packet_type, tvb, offset, 2, FALSE);
663 /* Length field is optional */
664 if (length_included_flag)
666 packet_length = tvb_get_ntohs(tvb, offset);
667 proto_tree_add_item(tree, hf_rdt_packet_length, tvb, offset, 2, FALSE);
670 /* Check that there are as many bytes as reported */
671 tvb_ensure_bytes_exist(tvb, start_offset, packet_length);
675 packet_length = tvb_length_remaining(tvb, start_offset);
678 proto_tree_add_item(tree, hf_rdt_brpt_interval, tvb, offset, 2, FALSE);
680 proto_tree_add_item(tree, hf_rdt_brpt_bandwidth, tvb, offset, 4, FALSE);
682 proto_tree_add_item(tree, hf_rdt_brpt_sequence, tvb, offset, 1, FALSE);
685 col_append_str(pinfo->cinfo, COL_INFO, "BANDWIDTH-REPORT: ");
687 if (packet_length < (offset - start_offset) ||
688 packet_length > tvb_length_remaining(tvb, start_offset))
690 proto_tree_add_text(tree, tvb, 0, 0, "Packet length invalid");
691 packet_length = tvb_length_remaining(tvb, start_offset);
694 return start_offset + packet_length;
697 /* Dissect an ack packet */
698 guint dissect_rdt_ack_packet(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset)
700 guint start_offset = offset;
701 guint16 packet_length;
703 guint8 length_included_flag;
704 guint8 lost_high_flag;
705 proto_tree *flags_tree = NULL;
706 proto_item *ti = NULL;
708 /* Flags in first byte */
709 flags1 = tvb_get_guint8(tvb, offset);
710 length_included_flag = (flags1 & 0x80) >> 7;
711 lost_high_flag = (flags1 & 0x40) >> 6;
713 /* Create subtree for flags fields */
716 ti = proto_tree_add_string_format(tree, hf_rdt_ack_flags, tvb, offset, 1,
718 "Length-included=%u, lost-high=%u",
719 length_included_flag,
721 flags_tree = proto_item_add_subtree(ti, ett_rdt_ack_flags);
723 proto_tree_add_item(flags_tree, hf_rdt_len_included, tvb, offset, 1, FALSE);
724 proto_tree_add_item(flags_tree, hf_rdt_ack_lost_high, tvb, offset, 1, FALSE);
729 proto_tree_add_item(tree, hf_rdt_packet_type, tvb, offset, 2, FALSE);
732 /* Length field is optional */
733 if (length_included_flag)
735 packet_length = tvb_get_ntohs(tvb, offset);
736 proto_tree_add_item(tree, hf_rdt_packet_length, tvb, offset, 2, FALSE);
739 /* Check that there are as many bytes as reported */
740 tvb_ensure_bytes_exist(tvb, start_offset, packet_length);
744 packet_length = tvb_length_remaining(tvb, start_offset);
747 /* XXX: The remaining data is unparsed. */
748 proto_tree_add_item(tree, hf_rdt_data, tvb, offset, -1, FALSE);
750 if (check_col(pinfo->cinfo, COL_INFO))
752 col_append_fstr(pinfo->cinfo, COL_INFO, "ACK: lh=%u ", lost_high_flag);
755 if (packet_length < (offset - start_offset) ||
756 packet_length > tvb_length_remaining(tvb, start_offset))
758 proto_tree_add_text(tree, tvb, 0, 0, "Packet length invalid");
759 packet_length = tvb_length_remaining(tvb, start_offset);
762 return start_offset + packet_length;
765 /* Dissect an att-request packet */
766 guint dissect_rdt_rtt_request_packet(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset)
770 /* Flags in first byte */
771 flags1 = tvb_get_guint8(tvb, offset);
775 proto_tree_add_item(tree, hf_rdt_packet_type, tvb, offset, 2, FALSE);
778 col_append_str(pinfo->cinfo, COL_INFO, "RTT-REQUEST: ");
783 /* Dissect an att-response packet */
784 guint dissect_rdt_rtt_response_packet(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset)
788 /* Flags in first byte */
789 flags1 = tvb_get_guint8(tvb, offset);
793 proto_tree_add_item(tree, hf_rdt_packet_type, tvb, offset, 2, FALSE);
796 proto_tree_add_item(tree, hf_rdt_rtrp_ts_sec, tvb, offset, 4, FALSE);
798 proto_tree_add_item(tree, hf_rdt_rtrp_ts_usec, tvb, offset, 4, FALSE);
801 col_append_str(pinfo->cinfo, COL_INFO, "RTT-RESPONSE: ");
806 /* Dissect an congestion packet */
807 guint dissect_rdt_congestion_packet(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset)
811 /* Flags in first byte */
812 flags1 = tvb_get_guint8(tvb, offset);
816 proto_tree_add_item(tree, hf_rdt_packet_type, tvb, offset, 2, FALSE);
819 proto_tree_add_item(tree, hf_rdt_cong_xmit_mult, tvb, offset, 4, FALSE);
821 proto_tree_add_item(tree, hf_rdt_cong_recv_mult, tvb, offset, 4, FALSE);
824 col_append_str(pinfo->cinfo, COL_INFO, "CONGESTION: ");
829 /* Dissect an stream-end packet */
830 guint dissect_rdt_stream_end_packet(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset)
833 guint8 need_reliable;
837 proto_tree *flags_tree = NULL;
838 proto_item *ti = NULL;
840 /* Flags in first byte */
841 flags1 = tvb_get_guint8(tvb, offset);
842 need_reliable = (flags1 & 0x80) >> 7;
843 stream_id = (flags1 & 0x7c) >> 2;
844 packet_sent = (flags1 & 0x2) >> 1;
845 ext_flag = flags1 & 0x1;
847 /* Create subtree for flags fields */
850 ti = proto_tree_add_string_format(tree, hf_rdt_stre_flags, tvb, offset, 1,
852 "Need-reliable=%u, stream-id=%u, packet-sent=%u, ext-flag=%u",
857 flags_tree = proto_item_add_subtree(ti, ett_rdt_stre_flags);
859 proto_tree_add_item(flags_tree, hf_rdt_stre_need_reliable, tvb, offset, 1, FALSE);
860 proto_tree_add_item(flags_tree, hf_rdt_stre_stream_id, tvb, offset, 1, FALSE);
861 proto_tree_add_item(flags_tree, hf_rdt_stre_packet_sent, tvb, offset, 1, FALSE);
862 proto_tree_add_item(flags_tree, hf_rdt_stre_ext_flag, tvb, offset, 1, FALSE);
867 proto_tree_add_item(tree, hf_rdt_packet_type, tvb, offset, 2, FALSE);
870 proto_tree_add_item(tree, hf_rdt_stre_seqno, tvb, offset, 2, FALSE);
872 proto_tree_add_item(tree, hf_rdt_timestamp, tvb, offset, 4, FALSE);
875 /* Stream ID expansion */
878 stream_id = tvb_get_ntohs(tvb, offset);
879 proto_tree_add_item(tree, hf_rdt_stream_id_ex, tvb, offset, 2, FALSE);
886 proto_tree_add_item(tree, hf_rdt_total_reliable, tvb, offset, 2, FALSE);
892 proto_tree_add_item(tree, hf_rdt_stre_dummy_flags1, tvb, offset, 1, FALSE);
894 proto_tree_add_item(tree, hf_rdt_stre_dummy_type, tvb, offset, 2, FALSE);
896 proto_tree_add_item(tree, hf_rdt_stre_reason_code, tvb, offset, 4, FALSE);
898 /* XXX: Remainder is reason_text */
899 offset += tvb_length_remaining(tvb, offset);
902 if (check_col(pinfo->cinfo, COL_INFO))
904 col_append_fstr(pinfo->cinfo, COL_INFO, "STREAM-END: stream-id=%02u ", stream_id);
910 /* Dissect an report packet */
911 guint dissect_rdt_report_packet(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset)
913 guint start_offset = offset;
914 guint16 packet_length;
916 guint8 length_included_flag;
917 proto_tree *flags_tree = NULL;
918 proto_item *ti = NULL;
920 /* Flags in first byte */
921 flags1 = tvb_get_guint8(tvb, offset);
922 length_included_flag = (flags1 & 0x80) >> 7;
924 /* Create subtree for flags fields */
927 ti = proto_tree_add_string_format(tree, hf_rdt_report_flags, tvb, offset, 1,
929 "Length-included=%u",
930 length_included_flag);
931 flags_tree = proto_item_add_subtree(ti, ett_rdt_report_flags);
933 proto_tree_add_item(flags_tree, hf_rdt_len_included, tvb, offset, 1, FALSE);
938 proto_tree_add_item(tree, hf_rdt_packet_type, tvb, offset, 2, FALSE);
941 /* Length field is optional */
942 if (length_included_flag)
944 packet_length = tvb_get_ntohs(tvb, offset);
945 proto_tree_add_item(tree, hf_rdt_packet_length, tvb, offset, 2, FALSE);
948 /* Check that there are as many bytes as reported */
949 tvb_ensure_bytes_exist(tvb, start_offset, packet_length);
953 packet_length = tvb_length_remaining(tvb, start_offset);
956 col_append_str(pinfo->cinfo, COL_INFO, "REPORT: ");
958 /* The remaining data is unparsed. */
959 proto_tree_add_item(tree, hf_rdt_data, tvb, offset, -1, FALSE);
961 if (packet_length < (offset - start_offset) ||
962 packet_length > tvb_length_remaining(tvb, start_offset))
964 proto_tree_add_text(tree, tvb, 0, 0, "Packet length invalid");
965 packet_length = tvb_length_remaining(tvb, start_offset);
968 return start_offset + packet_length;
971 /* Dissect an latency-report packet */
972 guint dissect_rdt_latency_report_packet(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset)
974 guint start_offset = offset;
975 guint16 packet_length;
977 guint8 length_included_flag;
978 guint32 server_out_time;
979 proto_tree *flags_tree = NULL;
980 proto_item *ti = NULL;
982 /* Flags in first byte */
983 flags1 = tvb_get_guint8(tvb, offset);
984 length_included_flag = (flags1 & 0x80) >> 7;
986 /* Create subtree for flags fields */
989 ti = proto_tree_add_string_format(tree, hf_rdt_latency_report_flags, tvb, offset, 1,
991 "Length-included=%u",
992 length_included_flag);
993 flags_tree = proto_item_add_subtree(ti, ett_rdt_latency_report_flags);
995 proto_tree_add_item(flags_tree, hf_rdt_len_included, tvb, offset, 1, FALSE);
1000 proto_tree_add_item(tree, hf_rdt_packet_type, tvb, offset, 2, FALSE);
1003 /* Length field is optional */
1004 if (length_included_flag)
1006 packet_length = tvb_get_ntohs(tvb, offset);
1007 proto_tree_add_item(tree, hf_rdt_packet_length, tvb, offset, 2, FALSE);
1010 /* Check that there are as many bytes as reported */
1011 tvb_ensure_bytes_exist(tvb, start_offset, packet_length);
1015 packet_length = tvb_length_remaining(tvb, start_offset);
1018 server_out_time = tvb_get_ntohl(tvb, offset);
1019 proto_tree_add_item(tree, hf_rdt_lrpt_server_out_time, tvb, offset, 4, FALSE);
1022 if (check_col(pinfo->cinfo, COL_INFO))
1024 col_append_fstr(pinfo->cinfo, COL_INFO, "LATENCY-REPORT: t=%u ", server_out_time);
1027 if (packet_length < (offset - start_offset) ||
1028 packet_length > tvb_length_remaining(tvb, start_offset))
1030 proto_tree_add_text(tree, tvb, 0, 0, "Packet length invalid");
1031 packet_length = tvb_length_remaining(tvb, start_offset);
1034 return start_offset + packet_length;
1037 /* Dissect a transport-info packet */
1038 guint dissect_rdt_transport_info_request_packet(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset)
1041 guint8 request_rtt_info_flag;
1042 guint8 request_buffer_info_flag;
1043 guint32 request_time_msec;
1044 proto_tree *flags_tree = NULL;
1045 proto_item *ti = NULL;
1047 /* Flags in first byte */
1048 flags1 = tvb_get_guint8(tvb, offset);
1049 request_rtt_info_flag = (flags1 & 0x2) >> 1;
1050 request_buffer_info_flag = (flags1 & 0x01);
1052 /* Create subtree for flags fields */
1055 ti = proto_tree_add_string_format(tree, hf_rdt_ack_flags, tvb, offset, 1,
1057 "Request-rtt-info=%u, request-buffer-info=%u",
1058 request_rtt_info_flag,
1059 request_buffer_info_flag);
1060 flags_tree = proto_item_add_subtree(ti, ett_rdt_tirq_flags);
1062 proto_tree_add_item(flags_tree, hf_rdt_tirq_request_rtt_info, tvb, offset, 1, FALSE);
1063 proto_tree_add_item(flags_tree, hf_rdt_tirq_request_buffer_info, tvb, offset, 1, FALSE);
1068 proto_tree_add_item(tree, hf_rdt_packet_type, tvb, offset, 2, FALSE);
1071 if (request_rtt_info_flag)
1073 request_time_msec = tvb_get_ntohl(tvb, offset);
1074 proto_tree_add_item(tree, hf_rdt_tirq_request_time_msec, tvb, offset, 4, FALSE);
1078 col_append_str(pinfo->cinfo, COL_INFO, "TRANSPORT-INFO-REQUEST: ");
1083 /* Dissect an transport-info-response packet */
1084 guint dissect_rdt_transport_info_response_packet(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset)
1087 guint8 has_rtt_info;
1089 guint8 has_buffer_info;
1090 guint32 request_time_msec;
1091 guint32 response_time_msec;
1092 proto_tree *flags_tree = NULL;
1093 proto_item *ti = NULL;
1095 /* Flags in first byte */
1096 flags1 = tvb_get_guint8(tvb, offset);
1097 has_rtt_info = (flags1 & 0x4) >> 2;
1098 is_delayed = (flags1 & 0x2) >> 1;
1099 has_buffer_info = (flags1 & 0x1);
1101 /* Create subtree for flags fields */
1104 ti = proto_tree_add_string_format(tree, hf_rdt_tirp_flags, tvb, offset, 1,
1106 "Has-rtt-info=%u, is-delayed=%u, has-buffer-info=%u",
1110 flags_tree = proto_item_add_subtree(ti, ett_rdt_tirp_flags);
1112 proto_tree_add_item(flags_tree, hf_rdt_tirp_has_rtt_info, tvb, offset, 1, FALSE);
1113 proto_tree_add_item(flags_tree, hf_rdt_tirp_is_delayed, tvb, offset, 1, FALSE);
1114 proto_tree_add_item(flags_tree, hf_rdt_tirp_has_buffer_info, tvb, offset, 1, FALSE);
1119 proto_tree_add_item(tree, hf_rdt_packet_type, tvb, offset, 2, FALSE);
1125 request_time_msec = tvb_get_ntohl(tvb, offset);
1126 proto_tree_add_item(tree, hf_rdt_tirp_request_time_msec, tvb, offset, 4, FALSE);
1131 response_time_msec = tvb_get_ntohl(tvb, offset);
1132 proto_tree_add_item(tree, hf_rdt_tirp_response_time_msec, tvb, offset, 4, FALSE);
1138 if (has_buffer_info)
1142 /* Read number of buffers */
1143 guint16 buffer_info_count = tvb_get_ntohs(tvb, offset);
1144 proto_tree_add_item(tree, hf_rdt_tirp_buffer_info_count, tvb, offset, 2, FALSE);
1147 for (n=0; n < buffer_info_count; n++)
1149 proto_tree *buffer_info_tree = NULL;
1150 proto_item *ti = NULL;
1152 /* Each buffer info in a new subtree */
1153 ti = proto_tree_add_string_format(tree, hf_rdt_tirp_buffer_info, tvb, offset, 14,
1157 buffer_info_tree = proto_item_add_subtree(ti, ett_rdt_tirp_buffer_info);
1159 /* Read individual buffer info */
1160 proto_tree_add_item(buffer_info_tree, hf_rdt_tirp_buffer_info_stream_id, tvb, offset, 2, FALSE);
1162 proto_tree_add_item(buffer_info_tree, hf_rdt_tirp_buffer_info_lowest_timestamp, tvb, offset, 4, FALSE);
1164 proto_tree_add_item(buffer_info_tree, hf_rdt_tirp_buffer_info_highest_timestamp, tvb, offset, 4, FALSE);
1166 proto_tree_add_item(buffer_info_tree, hf_rdt_tirp_buffer_info_bytes_buffered, tvb, offset, 4, FALSE);
1171 /* Report what is left */
1172 offset += tvb_length_remaining(tvb, offset);
1174 col_append_str(pinfo->cinfo, COL_INFO, "RESPONSE: ");
1179 /* Dissect a bw-probing packet */
1180 guint dissect_rdt_bw_probing_packet(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset)
1182 guint start_offset = offset;
1183 guint16 packet_length;
1185 guint8 length_included_flag;
1186 proto_tree *flags_tree = NULL;
1187 proto_item *ti = NULL;
1189 /* Flags in first byte */
1190 flags1 = tvb_get_guint8(tvb, offset);
1191 length_included_flag = (flags1 & 0x80) >> 7;
1193 /* Create subtree for flags fields */
1196 ti = proto_tree_add_string_format(tree, hf_rdt_bw_probing_flags, tvb, offset, 1,
1198 "Length-included=%u",
1199 length_included_flag);
1200 flags_tree = proto_item_add_subtree(ti, ett_rdt_bw_probing_flags);
1202 proto_tree_add_item(flags_tree, hf_rdt_len_included, tvb, offset, 1, FALSE);
1207 proto_tree_add_item(tree, hf_rdt_packet_type, tvb, offset, 2, FALSE);
1210 /* Length field is optional */
1211 if (length_included_flag)
1213 packet_length = tvb_get_ntohs(tvb, offset);
1214 proto_tree_add_item(tree, hf_rdt_packet_length, tvb, offset, 2, FALSE);
1217 /* Check that there are as many bytes as reported */
1218 tvb_ensure_bytes_exist(tvb, start_offset, packet_length);
1222 packet_length = tvb_length_remaining(tvb, start_offset);
1225 proto_tree_add_item(tree, hf_rdt_bwpp_seqno, tvb, offset, 1, FALSE);
1227 proto_tree_add_item(tree, hf_rdt_timestamp, tvb, offset, 1, FALSE);
1230 col_append_str(pinfo->cinfo, COL_INFO, "BW-PROBING: ");
1232 if (packet_length < (offset - start_offset) ||
1233 packet_length > tvb_length_remaining(tvb, start_offset))
1235 proto_tree_add_text(tree, tvb, 0, 0, "Packet length invalid");
1236 packet_length = tvb_length_remaining(tvb, start_offset);
1239 return start_offset + packet_length;
1242 /* Dissect an unknown control packet */
1243 guint dissect_rdt_unknown_control(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset)
1247 /* Flags in first byte */
1248 flags1 = tvb_get_guint8(tvb, offset);
1249 proto_tree_add_item(tree, hf_rdt_unk_flags1, tvb, offset, 1, FALSE);
1253 proto_tree_add_item(tree, hf_rdt_packet_type, tvb, offset, 2, FALSE);
1256 /* The remaining data is unparsed. */
1257 proto_tree_add_item(tree, hf_rdt_data, tvb, offset, -1, FALSE);
1258 offset += tvb_length_remaining(tvb, offset);
1260 col_append_str(pinfo->cinfo, COL_INFO, "UNKNOWN-CTL: ");
1265 /* Look for conversation info and display any setup info found */
1266 static void show_setup_info(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
1268 /* Conversation and current data */
1269 conversation_t *p_conv = NULL;
1270 struct _rdt_conversation_info *p_conv_data = NULL;
1272 /* Use existing packet info if available */
1273 p_conv_data = p_get_proto_data(pinfo->fd, proto_rdt);
1277 /* First time, get info from conversation */
1278 p_conv = find_conversation(pinfo->fd->num, &pinfo->net_dst, &pinfo->net_src,
1280 pinfo->destport, pinfo->srcport, NO_ADDR_B);
1283 /* Create space for conversation info */
1284 struct _rdt_conversation_info *p_conv_packet_data;
1285 p_conv_data = conversation_get_proto_data(p_conv, proto_rdt);
1289 /* Save this conversation info into packet info */
1290 p_conv_packet_data = se_alloc(sizeof(struct _rdt_conversation_info));
1291 g_snprintf(p_conv_packet_data->method, MAX_RDT_SETUP_METHOD_SIZE, "%s", p_conv_data->method);
1292 p_conv_packet_data->method[MAX_RDT_SETUP_METHOD_SIZE]=0;
1293 p_conv_packet_data->frame_number = p_conv_data->frame_number;
1294 p_conv_packet_data->feature_level = p_conv_data->feature_level;
1295 p_add_proto_data(pinfo->fd, proto_rdt, p_conv_packet_data);
1300 /* Create setup info subtree with summary info. */
1303 proto_tree *rdt_setup_tree;
1304 proto_item *ti = proto_tree_add_string_format(tree, hf_rdt_setup, tvb, 0, 0,
1306 "Stream setup by %s (frame %u), feature level %d",
1307 p_conv_data->method,
1308 p_conv_data->frame_number,
1309 p_conv_data->feature_level);
1310 PROTO_ITEM_SET_GENERATED(ti);
1311 rdt_setup_tree = proto_item_add_subtree(ti, ett_rdt_setup);
1314 /* Add details into subtree */
1315 proto_item* item = proto_tree_add_uint(rdt_setup_tree, hf_rdt_setup_frame,
1316 tvb, 0, 0, p_conv_data->frame_number);
1317 PROTO_ITEM_SET_GENERATED(item);
1318 item = proto_tree_add_string(rdt_setup_tree, hf_rdt_setup_method,
1319 tvb, 0, 0, p_conv_data->method);
1320 PROTO_ITEM_SET_GENERATED(item);
1321 item = proto_tree_add_int(rdt_setup_tree, hf_rdt_feature_level,
1322 tvb, 0, 0, p_conv_data->feature_level);
1323 PROTO_ITEM_SET_GENERATED(item);
1329 void proto_register_rdt(void)
1331 static hf_register_info hf[] =
1346 &hf_rdt_data_flags1,
1358 &hf_rdt_len_included,
1361 "rdt.length-included",
1370 &hf_rdt_data_need_reliable,
1373 "rdt.need-reliable",
1382 &hf_rdt_data_stream_id,
1394 &hf_rdt_data_is_reliable,
1406 &hf_rdt_data_flags2,
1414 "RDT data flags2", HFILL
1418 &hf_rdt_data_backtoback,
1430 &hf_rdt_data_slowdata,
1442 &hf_rdt_data_asmrule,
1456 "RDT asm-action flags 1",
1462 "RDT aact flags", HFILL
1466 &hf_rdt_aact_stream_id,
1478 &hf_rdt_sequence_number,
1481 "rdt.sequence-number",
1490 &hf_rdt_packet_type,
1496 VALS(packet_type_vals),
1514 &hf_rdt_ack_lost_high,
1526 &hf_rdt_latency_report_flags,
1528 "RDT latency report flags",
1529 "rdt.latency-report-flags",
1538 &hf_rdt_bandwidth_report_flags,
1540 "RDT bandwidth report flags",
1541 "rdt.bandwidth-report-flags",
1552 "RDT stream end flags",
1553 "rdt.stream-end-flags",
1562 &hf_rdt_rtt_request_flags,
1564 "RDT rtt request flags",
1565 "rdt.rtt-request-flags",
1570 "RDT RTT request flags", HFILL
1574 &hf_rdt_rtt_response_flags,
1576 "RDT rtt response flags",
1577 "rdt.rtt-response-flags",
1582 "RDT RTT response flags", HFILL
1586 &hf_rdt_congestion_flags,
1588 "RDT congestion flags",
1589 "rdt.congestion-flags",
1598 &hf_rdt_report_flags,
1612 "RDT transport info request flags",
1613 "rdt.transport-info-request-flags",
1624 "RDT transport info response flags",
1625 "rdt.transport-info-response-flags",
1634 &hf_rdt_bw_probing_flags,
1636 "RDT bw probing flags",
1637 "rdt.bw-probing-flags",
1646 &hf_rdt_packet_length,
1649 "rdt.packet-length",
1670 &hf_rdt_stream_id_ex,
1672 "Stream-id expansion",
1673 "rdt.stream-id-expansion",
1684 "Asm rule expansion",
1685 "rdt.asm-rule-expansion",
1694 &hf_rdt_total_reliable,
1697 "rdt.total-reliable",
1718 &hf_rdt_aact_reliable_seqno,
1720 "Reliable sequence number",
1721 "rdt.reliable-seq-no",
1730 &hf_rdt_brpt_interval,
1732 "Bandwidth report interval",
1733 "rdt.bwid-report-interval",
1742 &hf_rdt_brpt_bandwidth,
1744 "Bandwidth report bandwidth",
1745 "rdt.bwid-report-bandwidth",
1754 &hf_rdt_brpt_sequence,
1756 "Bandwidth report sequence",
1757 "rdt.bwid-report-sequence",
1766 &hf_rdt_rtrp_ts_sec,
1768 "Round trip response timestamp seconds",
1778 &hf_rdt_rtrp_ts_usec,
1780 "Round trip response timestamp microseconds",
1790 &hf_rdt_cong_xmit_mult,
1792 "Congestion transmit multiplier",
1793 "rdt.cong-xmit-mult",
1802 &hf_rdt_cong_recv_mult,
1804 "Congestion receive multiplier",
1805 "rdt.cong-recv-mult",
1814 &hf_rdt_stre_need_reliable,
1817 "rdt.stre-need-reliable",
1826 &hf_rdt_stre_stream_id,
1829 "rdt.stre-stream-id",
1838 &hf_rdt_stre_packet_sent,
1841 "rdt.stre-packet-sent",
1850 &hf_rdt_stre_ext_flag,
1853 "rdt.stre-ext-flag",
1865 "Stream end sequence number",
1875 &hf_rdt_stre_dummy_flags1,
1877 "Stream end reason dummy flags1",
1878 "rdt.stre-reason-dummy-flags1",
1887 &hf_rdt_stre_dummy_type,
1889 "Stream end reason dummy type",
1890 "rdt.stre-reason-dummy-type",
1899 &hf_rdt_stre_reason_code,
1901 "Stream end reason code",
1902 "rdt.stre-reason-code",
1911 &hf_rdt_lrpt_server_out_time,
1913 "Latency report server out time",
1914 "rdt.lrpt-server-out-time",
1923 &hf_rdt_tirq_request_rtt_info,
1925 "Transport info request rtt info flag",
1926 "rdt.tirq-request-rtt-info",
1935 &hf_rdt_tirq_request_buffer_info,
1937 "Transport info request buffer info flag",
1938 "rdt.tirq-request-buffer-info",
1947 &hf_rdt_tirq_request_time_msec,
1949 "Transport info request time msec",
1950 "rdt.tirq-request-time-msec",
1959 &hf_rdt_tirp_has_rtt_info,
1961 "Transport info response has rtt info flag",
1962 "rdt.tirp-has-rtt-info",
1971 &hf_rdt_tirp_is_delayed,
1973 "Transport info response is delayed",
1974 "rdt.tirp-is-delayed",
1983 &hf_rdt_tirp_has_buffer_info,
1985 "Transport info response has buffer info",
1986 "rdt.tirp-has-buffer-info",
1995 &hf_rdt_tirp_request_time_msec,
1997 "Transport info request time msec",
1998 "rdt.tirp-request-time-msec",
2007 &hf_rdt_tirp_response_time_msec,
2009 "Transport info response time msec",
2010 "rdt.tirp-response-time-msec",
2019 &hf_rdt_tirp_buffer_info_count,
2021 "Transport info buffer into count",
2022 "rdt.tirp-buffer-info-count",
2031 &hf_rdt_tirp_buffer_info,
2034 "rdt.tirp-buffer-info",
2043 &hf_rdt_tirp_buffer_info_stream_id,
2045 "Buffer info stream-id",
2046 "rdt.tirp-buffer-info-stream-id",
2055 &hf_rdt_tirp_buffer_info_lowest_timestamp,
2058 "rdt.tirp-buffer-info-lowest-timestamp",
2067 &hf_rdt_tirp_buffer_info_highest_timestamp,
2069 "Highest timestamp",
2070 "rdt.tirp-buffer-info-highest-timestamp",
2079 &hf_rdt_tirp_buffer_info_bytes_buffered,
2082 "rdt.tirp-buffer-info-bytes-buffered",
2093 "Bandwidth probing packet seqno",
2105 "Unknown packet flags",
2123 "Stream setup, method and frame number", HFILL
2127 &hf_rdt_setup_frame,
2135 "Frame that set up this stream", HFILL
2139 &hf_rdt_setup_method,
2147 "Method used to set up this stream", HFILL
2151 &hf_rdt_feature_level,
2153 "RDT feature level",
2154 "rdt.feature-level",
2164 static gint *ett[] =
2169 &ett_rdt_data_flags1,
2170 &ett_rdt_data_flags2,
2171 &ett_rdt_aact_flags,
2173 &ett_rdt_latency_report_flags,
2174 &ett_rdt_bandwidth_report_flags,
2175 &ett_rdt_stre_flags,
2176 &ett_rdt_rtt_request_flags,
2177 &ett_rdt_rtt_response_flags,
2178 &ett_rdt_congestion_flags,
2179 &ett_rdt_report_flags,
2180 &ett_rdt_tirq_flags,
2181 &ett_rdt_tirp_flags,
2182 &ett_rdt_tirp_buffer_info,
2183 &ett_rdt_bw_probing_flags
2186 module_t *rdt_module;
2188 /* Register protocol and fields */
2189 proto_rdt = proto_register_protocol("Real Data Transport", "RDT", "rdt");
2190 proto_register_field_array(proto_rdt, hf, array_length(hf));
2191 proto_register_subtree_array(ett, array_length(ett));
2192 register_dissector("rdt", dissect_rdt, proto_rdt);
2194 /* Preference settings */
2195 rdt_module = prefs_register_protocol(proto_rdt, proto_reg_handoff_rdt);
2196 prefs_register_bool_preference(rdt_module, "show_setup_info",
2197 "Show stream setup information",
2198 "Where available, show which protocol and frame caused "
2199 "this RDT stream to be created",
2200 &global_rdt_show_setup_info);
2202 prefs_register_bool_preference(rdt_module, "register_udp_port",
2203 "Register default UDP client port",
2204 "Register a client UDP port for RDT traffic",
2205 &global_rdt_register_udp_port);
2207 /* TODO: better to specify a range of ports instead? */
2208 prefs_register_uint_preference(rdt_module, "default_udp_port",
2209 "Default UDP client port",
2210 "Set the UDP port for clients",
2211 10, &global_rdt_udp_port);
2215 void proto_reg_handoff_rdt(void)
2217 static gboolean rdt_prefs_initialized = FALSE;
2218 /* Also store this so can delete registered setting properly */
2219 static gboolean rdt_register_udp_port;
2220 static guint rdt_udp_port;
2222 if (!rdt_prefs_initialized)
2224 /* Register this dissector as one that can be selected by a
2226 rdt_handle = find_dissector("rdt");
2227 dissector_add_handle("udp.port", rdt_handle);
2228 rdt_prefs_initialized = TRUE;
2232 /* Undo any current port registrations */
2233 if (rdt_register_udp_port)
2235 dissector_delete("udp.port", rdt_udp_port, rdt_handle);
2239 /* Remember whether a port is set for next time */
2240 rdt_register_udp_port = global_rdt_register_udp_port;
2242 /* Add any new port registration */
2243 if (global_rdt_register_udp_port)
2245 /* Set our port number for future use */
2246 rdt_udp_port = global_rdt_udp_port;
2248 /* And register with this port */
2249 dissector_add("udp.port", global_rdt_udp_port, rdt_handle);