1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
|
/* packet-rdt.c
*
* Routines for RDT dissection
* RDT = Real Data Transport
*
* Copyright 2005
* Written by Martin Mathieson and Tom Marshall
*
* Wireshark - Network traffic analyzer
* By Gerald Combs <gerald@wireshark.org>
* Copyright 1998 Gerald Combs
*
* SPDX-License-Identifier: GPL-2.0-or-later
*/
/* Information sources:
* helixcommunity.org sources, in particular
* server/protocol/transport/rdt/pub/tngpkt.pm
*/
#include "config.h"
#include <epan/packet.h>
#include <epan/expert.h>
#include <epan/conversation.h>
#include <epan/prefs.h>
#include <epan/proto_data.h>
#include "packet-rdt.h"
static dissector_handle_t rdt_handle;
static int proto_rdt;
/* Packet fields */
static int hf_rdt_packet;
/* flags1: shared */
static int hf_rdt_len_included;
/* flags1: data packet */
static int hf_rdt_data_flags1;
static int hf_rdt_data_need_reliable;
static int hf_rdt_data_stream_id;
static int hf_rdt_data_is_reliable;
/* flags2: data packet */
static int hf_rdt_data_flags2;
static int hf_rdt_data_backtoback;
static int hf_rdt_data_slowdata;
static int hf_rdt_data_asmrule;
/* flags1: asm action packet */
static int hf_rdt_aact_flags;
static int hf_rdt_aact_stream_id;
/* flags1: ack packet */
static int hf_rdt_ack_flags;
static int hf_rdt_ack_lost_high;
/* flags1: latency report packet */
static int hf_rdt_latency_report_flags;
/* flags1: bandwidth report packet */
static int hf_rdt_bandwidth_report_flags;
/* flags1: stream end packet */
static int hf_rdt_stre_flags;
static int hf_rdt_stre_need_reliable;
static int hf_rdt_stre_stream_id;
static int hf_rdt_stre_packet_sent;
static int hf_rdt_stre_ext_flag;
/* static int hf_rdt_rtt_request_flags; */
/* static int hf_rdt_rtt_response_flags; */
/* static int hf_rdt_congestion_flags; */
static int hf_rdt_report_flags;
/* static int hf_rdt_tirq_flags; */
static int hf_rdt_tirp_flags;
static int hf_rdt_bw_probing_flags;
/* Octets 1-2: sequence number or packet type */
static int hf_rdt_sequence_number;
static int hf_rdt_packet_type;
/* Only present if length_included */
static int hf_rdt_packet_length;
/* General shared fields */
static int hf_rdt_timestamp;
static int hf_rdt_stream_id_ex;
static int hf_rdt_asmrule_ex;
static int hf_rdt_total_reliable;
static int hf_rdt_data;
/* Special use fields */
static int hf_rdt_aact_reliable_seqno;
static int hf_rdt_brpt_interval;
static int hf_rdt_brpt_bandwidth;
static int hf_rdt_brpt_sequence;
static int hf_rdt_rtrp_ts_sec;
static int hf_rdt_rtrp_ts_usec;
static int hf_rdt_cong_xmit_mult;
static int hf_rdt_cong_recv_mult;
static int hf_rdt_stre_seqno;
static int hf_rdt_stre_dummy_flags1;
static int hf_rdt_stre_dummy_type;
static int hf_rdt_stre_reason_code;
static int hf_rdt_lrpt_server_out_time;
static int hf_rdt_tirq_request_rtt_info;
static int hf_rdt_tirq_request_buffer_info;
static int hf_rdt_tirq_request_time_msec;
static int hf_rdt_tirp_has_rtt_info;
static int hf_rdt_tirp_is_delayed;
static int hf_rdt_tirp_has_buffer_info;
static int hf_rdt_tirp_request_time_msec;
static int hf_rdt_tirp_response_time_msec;
static int hf_rdt_tirp_buffer_info;
static int hf_rdt_tirp_buffer_info_count;
static int hf_rdt_tirp_buffer_info_stream_id;
static int hf_rdt_tirp_buffer_info_lowest_timestamp;
static int hf_rdt_tirp_buffer_info_highest_timestamp;
static int hf_rdt_tirp_buffer_info_bytes_buffered;
static int hf_rdt_bwpp_seqno;
static int hf_rdt_unk_flags1;
/* RDT setup fields */
static int hf_rdt_setup;
static int hf_rdt_setup_frame;
static int hf_rdt_setup_method;
static int hf_rdt_feature_level;
/* RDT fields defining a sub tree */
static int ett_rdt;
static int ett_rdt_packet;
static int ett_rdt_setup;
static int ett_rdt_data_flags1;
static int ett_rdt_data_flags2;
static int ett_rdt_aact_flags;
static int ett_rdt_ack_flags;
static int ett_rdt_latency_report_flags;
static int ett_rdt_bandwidth_report_flags;
static int ett_rdt_stre_flags;
static int ett_rdt_rtt_request_flags;
static int ett_rdt_rtt_response_flags;
static int ett_rdt_congestion_flags;
static int ett_rdt_report_flags;
static int ett_rdt_tirq_flags;
static int ett_rdt_tirp_flags;
static int ett_rdt_tirp_buffer_info;
static int ett_rdt_bw_probing_flags;
static expert_field ei_rdt_packet_length;
#define RDT_UDP_PORT 6970
void proto_register_rdt(void);
void proto_reg_handoff_rdt(void);
/* Parse individual packet types */
static unsigned dissect_rdt_data_packet(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned offset);
static unsigned dissect_rdt_asm_action_packet(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned offset);
static unsigned dissect_rdt_bandwidth_report_packet(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned offset);
static unsigned dissect_rdt_ack_packet(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned offset);
static unsigned dissect_rdt_rtt_request_packet(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned offset);
static unsigned dissect_rdt_rtt_response_packet(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned offset);
static unsigned dissect_rdt_congestion_packet(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned offset);
static unsigned dissect_rdt_stream_end_packet(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned offset);
static unsigned dissect_rdt_report_packet(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned offset);
static unsigned dissect_rdt_latency_report_packet(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned offset);
static unsigned dissect_rdt_transport_info_request_packet(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned offset);
static unsigned dissect_rdt_transport_info_response_packet(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned offset);
static unsigned dissect_rdt_bw_probing_packet(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned offset);
static unsigned dissect_rdt_unknown_control(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned offset);
static void show_setup_info(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree);
/* Preferences bool to control whether or not setup info should be shown */
static bool global_rdt_show_setup_info = true;
/* Packet types */
#define RDT_ASMACTIION_PACKET 0xff00
#define RDT_BANDWIDTHREPORT_PACKET 0xff01
#define RDT_ACK_PACKET 0xff02
#define RDT_RTTREQUEST_PACKET 0xff03
#define RDT_RTTRESPONSE_PACKET 0xff04
#define RDT_CONGESTION_PACKET 0xff05
#define RDT_STREAMEND_PACKET 0xff06
#define RDT_REPORT_PACKET 0xff07
#define RDT_LATENCYREPORT_PACKET 0xff08
#define RDT_TRANSPORTINFO_PACKET 0xff09
#define RDT_TRANSPORTINFORESPONSE_PACKET 0xff0a
#define RDT_BWPROBING_PACKET 0xff0b
static const value_string packet_type_vals[] =
{
{ RDT_ASMACTIION_PACKET, "Asm action" },
{ RDT_BANDWIDTHREPORT_PACKET, "Bandwidth report" },
{ RDT_ACK_PACKET, "Ack" },
{ RDT_RTTREQUEST_PACKET, "RTT request" },
{ RDT_RTTRESPONSE_PACKET, "RTT response" },
{ RDT_CONGESTION_PACKET, "Congestion" },
{ RDT_STREAMEND_PACKET, "Stream end" },
{ RDT_REPORT_PACKET, "Report" },
{ RDT_LATENCYREPORT_PACKET, "Latency report" },
{ RDT_TRANSPORTINFO_PACKET, "Transport info" },
{ RDT_TRANSPORTINFORESPONSE_PACKET, "Transport info response" },
{ RDT_BWPROBING_PACKET, "BW probing" },
{ 0, NULL }
};
/* Set up an RDT conversation */
void rdt_add_address(packet_info *pinfo,
address *addr, int port,
int other_port,
const char *setup_method,
int rdt_feature_level)
{
address null_addr;
conversation_t* p_conv;
struct _rdt_conversation_info *p_conv_data;
/* If this isn't the first time this packet has been processed,
we've already done this work, so we don't need to do it
again. */
if (pinfo->fd->visited)
{
return;
}
clear_address(&null_addr);
/* Check if the ip address and port combination is not already registered
as a conversation. */
p_conv = find_conversation(pinfo->num, addr, &null_addr, CONVERSATION_UDP, port, other_port,
NO_ADDR_B | (!other_port ? NO_PORT_B : 0));
/* If not, create a new conversation. */
if ( !p_conv || p_conv->setup_frame != pinfo->num)
{
p_conv = conversation_new(pinfo->num, addr, &null_addr, CONVERSATION_UDP,
(uint32_t)port, (uint32_t)other_port,
NO_ADDR2 | (!other_port ? NO_PORT2 : 0));
}
/* Set dissector */
conversation_set_dissector(p_conv, rdt_handle);
/* Check if the conversation has data associated with it. */
p_conv_data = (struct _rdt_conversation_info *)conversation_get_proto_data(p_conv, proto_rdt);
/* If not, add a new data item. */
if (!p_conv_data)
{
/* Create conversation data */
p_conv_data = wmem_new(wmem_file_scope(), struct _rdt_conversation_info);
conversation_add_proto_data(p_conv, proto_rdt, p_conv_data);
}
/* Update the conversation data. */
(void) g_strlcpy(p_conv_data->method, setup_method, MAX_RDT_SETUP_METHOD_SIZE);
p_conv_data->frame_number = pinfo->num;
p_conv_data->feature_level = rdt_feature_level;
}
/****************************************************************************/
/* Main dissection function */
/****************************************************************************/
static int dissect_rdt(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
{
unsigned previous_offset = 0;
int offset = 0;
proto_item *ti;
proto_tree *rdt_tree = NULL;
proto_tree *rdt_packet_tree;
uint16_t packet_type;
/* Set/clear columns */
col_set_str(pinfo->cinfo, COL_PROTOCOL, "RDT");
col_clear(pinfo->cinfo, COL_INFO);
/* Create RDT protocol tree */
ti = proto_tree_add_item(tree, proto_rdt, tvb, offset, -1, ENC_NA);
rdt_tree = proto_item_add_subtree(ti, ett_rdt);
/* Conversation setup info */
if (global_rdt_show_setup_info)
{
show_setup_info(tvb, pinfo, rdt_tree);
}
/* Parse all RDT packets found in the frame */
while (offset != -1 && tvb_reported_length_remaining(tvb, offset))
{
/* Every packet type should have at least 3 bytes */
tvb_ensure_bytes_exist(tvb, offset, 3);
/* 2nd & 3rd bytes determine packet type */
packet_type = tvb_get_ntohs(tvb, offset+1);
/* Add a tree for the next individual packet */
ti = proto_tree_add_string_format(rdt_tree, hf_rdt_packet, tvb, offset, -1,
"",
"RDT packet (%s)",
packet_type < 0xff00 ? "Data" :
val_to_str_const(packet_type, packet_type_vals, "Unknown"));
rdt_packet_tree = proto_item_add_subtree(ti, ett_rdt_packet);
/* Dissect the details of the next packet in this frame */
if (packet_type < 0xff00)
{
offset = dissect_rdt_data_packet(tvb, pinfo, rdt_packet_tree, offset);
}
else
{
switch (packet_type)
{
case RDT_ASMACTIION_PACKET:
offset = dissect_rdt_asm_action_packet(tvb, pinfo, rdt_packet_tree, offset);
break;
case RDT_BANDWIDTHREPORT_PACKET:
offset = dissect_rdt_bandwidth_report_packet(tvb, pinfo, rdt_packet_tree, offset);
break;
case RDT_ACK_PACKET:
offset = dissect_rdt_ack_packet(tvb, pinfo, rdt_packet_tree, offset);
break;
case RDT_RTTREQUEST_PACKET:
offset = dissect_rdt_rtt_request_packet(tvb, pinfo, rdt_packet_tree, offset);
break;
case RDT_RTTRESPONSE_PACKET:
offset = dissect_rdt_rtt_response_packet(tvb, pinfo, rdt_packet_tree, offset);
break;
case RDT_CONGESTION_PACKET:
offset = dissect_rdt_congestion_packet(tvb, pinfo, rdt_packet_tree, offset);
break;
case RDT_STREAMEND_PACKET:
offset = dissect_rdt_stream_end_packet(tvb, pinfo, rdt_packet_tree, offset);
break;
case RDT_REPORT_PACKET:
offset = dissect_rdt_report_packet(tvb, pinfo, rdt_packet_tree, offset);
break;
case RDT_LATENCYREPORT_PACKET:
offset = dissect_rdt_latency_report_packet(tvb, pinfo, rdt_packet_tree, offset);
break;
case RDT_TRANSPORTINFO_PACKET:
offset = dissect_rdt_transport_info_request_packet(tvb, pinfo, rdt_packet_tree, offset);
break;
case RDT_TRANSPORTINFORESPONSE_PACKET:
offset = dissect_rdt_transport_info_response_packet(tvb, pinfo, rdt_packet_tree, offset);
break;
case RDT_BWPROBING_PACKET:
offset = dissect_rdt_bw_probing_packet(tvb, pinfo, rdt_packet_tree, offset);
break;
default:
/* Unknown control packet */
offset = dissect_rdt_unknown_control(tvb, pinfo, rdt_packet_tree, offset);
break;
}
}
/* Select correct number of bytes for the tree showing this packet */
if (offset != -1)
{
proto_item_set_len(rdt_packet_tree, offset-previous_offset);
}
previous_offset = offset;
}
return tvb_captured_length(tvb);
}
/************************************************/
/* Functions to dissect individual packet types */
/************************************************/
/* Dissect a data packet */
unsigned dissect_rdt_data_packet(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned offset)
{
unsigned start_offset = offset;
uint16_t packet_length;
uint8_t flags1;
uint8_t length_included_flag;
uint8_t need_reliable_flag;
uint16_t stream_id;
uint16_t sequence_number;
uint8_t is_reliable_flag;
uint8_t flags2;
uint32_t timestamp;
uint16_t asm_rule_number;
uint8_t back_to_back;
uint8_t slow_data;
proto_tree *flags_tree1;
proto_tree *flags_tree2;
proto_item *ti;
/* Flags in first byte */
flags1 = tvb_get_uint8(tvb, offset);
length_included_flag = (flags1 & 0x80) >> 7;
need_reliable_flag = (flags1 & 0x40) >> 6;
stream_id = (flags1 & 0x3e) >> 1;
is_reliable_flag = flags1 & 0x01;
/* Create subtree for flags1 fields */
ti = proto_tree_add_string_format(tree, hf_rdt_data_flags1, tvb, offset, 1,
"",
"Length-included=%u, need-reliable=%u, stream-id=%u, is-reliable=%u",
length_included_flag,
need_reliable_flag,
stream_id,
is_reliable_flag);
flags_tree1 = proto_item_add_subtree(ti, ett_rdt_data_flags1);
proto_tree_add_item(flags_tree1, hf_rdt_len_included, tvb, offset, 1, ENC_BIG_ENDIAN);
proto_tree_add_item(flags_tree1, hf_rdt_data_need_reliable, tvb, offset, 1, ENC_BIG_ENDIAN);
proto_tree_add_item(flags_tree1, hf_rdt_data_stream_id, tvb, offset, 1, ENC_BIG_ENDIAN);
proto_tree_add_item(flags_tree1, hf_rdt_data_is_reliable, tvb, offset, 1, ENC_BIG_ENDIAN);
offset++;
/* Sequence number */
sequence_number = tvb_get_ntohs(tvb, offset);
proto_tree_add_item(tree, hf_rdt_sequence_number, tvb, offset, 2, ENC_BIG_ENDIAN);
offset += 2;
/* Length field is optional */
if (length_included_flag)
{
packet_length = tvb_get_ntohs(tvb, offset);
proto_tree_add_item(tree, hf_rdt_packet_length, tvb, offset, 2, ENC_BIG_ENDIAN);
offset += 2;
/* Check that there are as many bytes as reported */
tvb_ensure_bytes_exist(tvb, start_offset, packet_length);
}
else
{
packet_length = tvb_captured_length_remaining(tvb, start_offset);
}
/* More flags */
flags2 = tvb_get_uint8(tvb, offset);
back_to_back = (flags2 & 0x80) >> 7;
slow_data = (flags2 & 0x40) >> 6;
asm_rule_number = flags2 & 0x3f;
/* Create subtree for flags2 fields */
ti = proto_tree_add_string_format(tree, hf_rdt_data_flags2, tvb, offset, 1,
"",
"Back-to-back=%u, slow-data=%u, asm-rule=%u",
back_to_back,
slow_data,
asm_rule_number);
/* Create subtree for flags and add fields */
flags_tree2 = proto_item_add_subtree(ti, ett_rdt_data_flags2);
proto_tree_add_item(flags_tree2, hf_rdt_data_backtoback, tvb, offset, 1, ENC_BIG_ENDIAN);
proto_tree_add_item(flags_tree2, hf_rdt_data_slowdata, tvb, offset, 1, ENC_BIG_ENDIAN);
proto_tree_add_item(flags_tree2, hf_rdt_data_asmrule, tvb, offset, 1, ENC_BIG_ENDIAN);
offset++;
/* Timestamp */
timestamp = tvb_get_ntohl(tvb, offset);
proto_tree_add_item(tree, hf_rdt_timestamp, tvb, offset, 4, ENC_BIG_ENDIAN);
offset += 4;
/* Stream ID expansion */
if (stream_id == 31)
{
stream_id = tvb_get_ntohs(tvb, offset);
proto_tree_add_item(tree, hf_rdt_stream_id_ex, tvb, offset, 2, ENC_BIG_ENDIAN);
offset += 2;
}
/* Total reliable */
if (need_reliable_flag)
{
proto_tree_add_item(tree, hf_rdt_total_reliable, tvb, offset, 2, ENC_BIG_ENDIAN);
offset += 2;
}
/* Asm rule number */
if (asm_rule_number == 63)
{
asm_rule_number = tvb_get_ntohs(tvb, offset);
proto_tree_add_item(tree, hf_rdt_asmrule_ex, tvb, offset, 2, ENC_BIG_ENDIAN);
offset += 2;
}
col_append_fstr(pinfo->cinfo, COL_INFO,
"DATA: stream-id=%02u asm-rule=%02u seq=%05u ts=%05u ",
stream_id, asm_rule_number, sequence_number, timestamp);
/* The remaining data is unparsed. */
proto_tree_add_item(tree, hf_rdt_data, tvb, offset, -1, ENC_NA);
offset += tvb_captured_length_remaining(tvb, offset);
if (packet_length < (offset - start_offset) ||
packet_length > tvb_reported_length_remaining(tvb, start_offset))
{
proto_tree_add_expert(tree, pinfo, &ei_rdt_packet_length, tvb, 0, 0);
packet_length = tvb_captured_length_remaining(tvb, start_offset);
}
return start_offset + packet_length;
}
/* Dissect an asm-action packet */
unsigned dissect_rdt_asm_action_packet(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned offset)
{
unsigned start_offset = offset;
uint16_t packet_length;
uint8_t flags1;
uint8_t length_included_flag;
uint16_t stream_id;
uint16_t rel_seqno;
proto_tree *flags_tree;
proto_item *ti;
/* Flags in first byte */
flags1 = tvb_get_uint8(tvb, offset);
length_included_flag = (flags1 & 0x80) >> 7;
stream_id = (flags1 & 0x7c) >> 2;
/* Create subtree for flags fields */
proto_tree_add_item(tree, proto_rdt, tvb, offset, -1, ENC_NA);
ti = proto_tree_add_string_format(tree, hf_rdt_aact_flags, tvb, offset, 1,
"",
"Length-included=%u, stream_id=%u",
length_included_flag,
stream_id);
flags_tree = proto_item_add_subtree(ti, ett_rdt_aact_flags);
proto_tree_add_item(flags_tree, hf_rdt_len_included, tvb, offset, 1, ENC_BIG_ENDIAN);
proto_tree_add_item(flags_tree, hf_rdt_aact_stream_id, tvb, offset, 1, ENC_BIG_ENDIAN);
offset++;
/* Packet type */
proto_tree_add_item(tree, hf_rdt_packet_type, tvb, offset, 2, ENC_BIG_ENDIAN);
offset += 2;
rel_seqno = tvb_get_ntohs(tvb, offset);
proto_tree_add_item(tree, hf_rdt_aact_reliable_seqno, tvb, offset, 2, ENC_BIG_ENDIAN);
offset += 2;
/* Length field is optional */
if (length_included_flag)
{
packet_length = tvb_get_ntohs(tvb, offset);
proto_tree_add_item(tree, hf_rdt_packet_length, tvb, offset, 2, ENC_BIG_ENDIAN);
offset += 2;
/* Check that there are as many bytes as reported */
tvb_ensure_bytes_exist(tvb, start_offset, packet_length);
}
else
{
packet_length = tvb_captured_length_remaining(tvb, start_offset);
}
/* Stream ID expansion */
if (stream_id == 31)
{
stream_id = tvb_get_ntohs(tvb, offset);
proto_tree_add_item(tree, hf_rdt_stream_id_ex, tvb, offset, 2, ENC_BIG_ENDIAN);
offset += 2;
}
col_append_fstr(pinfo->cinfo, COL_INFO,
"ASM-ACTION: stream-id=%02u rel-seqno=%05u ",
stream_id, rel_seqno);
/* The remaining data is unparsed. */
proto_tree_add_item(tree, hf_rdt_data, tvb, offset, -1, ENC_NA);
if (packet_length < (offset - start_offset) ||
packet_length > tvb_reported_length_remaining(tvb, start_offset))
{
proto_tree_add_expert(tree, pinfo, &ei_rdt_packet_length, tvb, 0, 0);
packet_length = tvb_captured_length_remaining(tvb, start_offset);
}
return start_offset + packet_length;
}
/* Dissect an bandwidth-report packet */
unsigned dissect_rdt_bandwidth_report_packet(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned offset)
{
unsigned start_offset = offset;
uint16_t packet_length;
uint8_t flags1;
uint8_t length_included_flag;
proto_tree *flags_tree;
proto_item *ti;
/* Flags in first byte */
flags1 = tvb_get_uint8(tvb, offset);
length_included_flag = (flags1 & 0x80) >> 7;
/* Create subtree for flags fields */
ti = proto_tree_add_string_format(tree, hf_rdt_bandwidth_report_flags, tvb, offset, 1,
"",
"Length-included=%u",
length_included_flag);
flags_tree = proto_item_add_subtree(ti, ett_rdt_bandwidth_report_flags);
proto_tree_add_item(flags_tree, hf_rdt_len_included, tvb, offset, 1, ENC_BIG_ENDIAN);
offset++;
/* Packet type */
proto_tree_add_item(tree, hf_rdt_packet_type, tvb, offset, 2, ENC_BIG_ENDIAN);
offset += 2;
/* Length field is optional */
if (length_included_flag)
{
packet_length = tvb_get_ntohs(tvb, offset);
proto_tree_add_item(tree, hf_rdt_packet_length, tvb, offset, 2, ENC_BIG_ENDIAN);
offset += 2;
/* Check that there are as many bytes as reported */
tvb_ensure_bytes_exist(tvb, start_offset, packet_length);
}
else
{
packet_length = tvb_captured_length_remaining(tvb, start_offset);
}
proto_tree_add_item(tree, hf_rdt_brpt_interval, tvb, offset, 2, ENC_BIG_ENDIAN);
offset += 2;
proto_tree_add_item(tree, hf_rdt_brpt_bandwidth, tvb, offset, 4, ENC_BIG_ENDIAN);
offset += 4;
proto_tree_add_item(tree, hf_rdt_brpt_sequence, tvb, offset, 1, ENC_BIG_ENDIAN);
offset += 1;
col_append_str(pinfo->cinfo, COL_INFO, "BANDWIDTH-REPORT: ");
if (packet_length < (offset - start_offset) ||
packet_length > tvb_reported_length_remaining(tvb, start_offset))
{
proto_tree_add_expert(tree, pinfo, &ei_rdt_packet_length, tvb, 0, 0);
packet_length = tvb_captured_length_remaining(tvb, start_offset);
}
return start_offset + packet_length;
}
/* Dissect an ack packet */
unsigned dissect_rdt_ack_packet(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned offset)
{
unsigned start_offset = offset;
uint16_t packet_length;
uint8_t flags1;
uint8_t length_included_flag;
uint8_t lost_high_flag;
proto_tree *flags_tree;
proto_item *ti;
/* Flags in first byte */
flags1 = tvb_get_uint8(tvb, offset);
length_included_flag = (flags1 & 0x80) >> 7;
lost_high_flag = (flags1 & 0x40) >> 6;
/* Create subtree for flags fields */
ti = proto_tree_add_string_format(tree, hf_rdt_ack_flags, tvb, offset, 1,
"",
"Length-included=%u, lost-high=%u",
length_included_flag,
lost_high_flag);
flags_tree = proto_item_add_subtree(ti, ett_rdt_ack_flags);
proto_tree_add_item(flags_tree, hf_rdt_len_included, tvb, offset, 1, ENC_BIG_ENDIAN);
proto_tree_add_item(flags_tree, hf_rdt_ack_lost_high, tvb, offset, 1, ENC_BIG_ENDIAN);
offset++;
/* Packet type */
proto_tree_add_item(tree, hf_rdt_packet_type, tvb, offset, 2, ENC_BIG_ENDIAN);
offset += 2;
/* Length field is optional */
if (length_included_flag)
{
packet_length = tvb_get_ntohs(tvb, offset);
proto_tree_add_item(tree, hf_rdt_packet_length, tvb, offset, 2, ENC_BIG_ENDIAN);
offset += 2;
/* Check that there are as many bytes as reported */
tvb_ensure_bytes_exist(tvb, start_offset, packet_length);
}
else
{
packet_length = tvb_captured_length_remaining(tvb, start_offset);
}
/* XXX: The remaining data is unparsed. */
proto_tree_add_item(tree, hf_rdt_data, tvb, offset, -1, ENC_NA);
col_append_fstr(pinfo->cinfo, COL_INFO, "ACK: lh=%u ", lost_high_flag);
if (packet_length < (offset - start_offset) ||
packet_length > tvb_reported_length_remaining(tvb, start_offset))
{
proto_tree_add_expert(tree, pinfo, &ei_rdt_packet_length, tvb, 0, 0);
packet_length = tvb_captured_length_remaining(tvb, start_offset);
}
return start_offset + packet_length;
}
/* Dissect an att-request packet */
unsigned dissect_rdt_rtt_request_packet(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned offset)
{
/* Flags in first byte */
offset++;
/* Packet type */
proto_tree_add_item(tree, hf_rdt_packet_type, tvb, offset, 2, ENC_BIG_ENDIAN);
offset += 2;
col_append_str(pinfo->cinfo, COL_INFO, "RTT-REQUEST: ");
return offset;
}
/* Dissect an att-response packet */
unsigned dissect_rdt_rtt_response_packet(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned offset)
{
/* Flags in first byte */
offset++;
/* Packet type */
proto_tree_add_item(tree, hf_rdt_packet_type, tvb, offset, 2, ENC_BIG_ENDIAN);
offset += 2;
proto_tree_add_item(tree, hf_rdt_rtrp_ts_sec, tvb, offset, 4, ENC_BIG_ENDIAN);
offset += 4;
proto_tree_add_item(tree, hf_rdt_rtrp_ts_usec, tvb, offset, 4, ENC_BIG_ENDIAN);
offset += 4;
col_append_str(pinfo->cinfo, COL_INFO, "RTT-RESPONSE: ");
return offset;
}
/* Dissect an congestion packet */
unsigned dissect_rdt_congestion_packet(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned offset)
{
/* Flags in first byte */
offset++;
/* Packet type */
proto_tree_add_item(tree, hf_rdt_packet_type, tvb, offset, 2, ENC_BIG_ENDIAN);
offset += 2;
proto_tree_add_item(tree, hf_rdt_cong_xmit_mult, tvb, offset, 4, ENC_BIG_ENDIAN);
offset += 4;
proto_tree_add_item(tree, hf_rdt_cong_recv_mult, tvb, offset, 4, ENC_BIG_ENDIAN);
offset += 4;
col_append_str(pinfo->cinfo, COL_INFO, "CONGESTION: ");
return offset;
}
/* Dissect an stream-end packet */
unsigned dissect_rdt_stream_end_packet(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned offset)
{
uint8_t flags1;
uint8_t need_reliable;
uint16_t stream_id;
uint8_t packet_sent;
uint8_t ext_flag;
proto_tree *flags_tree;
proto_item *ti;
/* Flags in first byte */
flags1 = tvb_get_uint8(tvb, offset);
need_reliable = (flags1 & 0x80) >> 7;
stream_id = (flags1 & 0x7c) >> 2;
packet_sent = (flags1 & 0x2) >> 1;
ext_flag = flags1 & 0x1;
/* Create subtree for flags fields */
ti = proto_tree_add_string_format(tree, hf_rdt_stre_flags, tvb, offset, 1,
"",
"Need-reliable=%u, stream-id=%u, packet-sent=%u, ext-flag=%u",
need_reliable,
stream_id,
packet_sent,
ext_flag);
flags_tree = proto_item_add_subtree(ti, ett_rdt_stre_flags);
proto_tree_add_item(flags_tree, hf_rdt_stre_need_reliable, tvb, offset, 1, ENC_BIG_ENDIAN);
proto_tree_add_item(flags_tree, hf_rdt_stre_stream_id, tvb, offset, 1, ENC_BIG_ENDIAN);
proto_tree_add_item(flags_tree, hf_rdt_stre_packet_sent, tvb, offset, 1, ENC_BIG_ENDIAN);
proto_tree_add_item(flags_tree, hf_rdt_stre_ext_flag, tvb, offset, 1, ENC_BIG_ENDIAN);
offset++;
/* Packet type */
proto_tree_add_item(tree, hf_rdt_packet_type, tvb, offset, 2, ENC_BIG_ENDIAN);
offset += 2;
proto_tree_add_item(tree, hf_rdt_stre_seqno, tvb, offset, 2, ENC_BIG_ENDIAN);
offset += 2;
proto_tree_add_item(tree, hf_rdt_timestamp, tvb, offset, 4, ENC_BIG_ENDIAN);
offset += 4;
/* Stream ID expansion */
if (stream_id == 31)
{
stream_id = tvb_get_ntohs(tvb, offset);
proto_tree_add_item(tree, hf_rdt_stream_id_ex, tvb, offset, 2, ENC_BIG_ENDIAN);
offset += 2;
}
/* Total reliable */
if (need_reliable)
{
proto_tree_add_item(tree, hf_rdt_total_reliable, tvb, offset, 2, ENC_BIG_ENDIAN);
offset += 2;
}
if (ext_flag)
{
proto_tree_add_item(tree, hf_rdt_stre_dummy_flags1, tvb, offset, 1, ENC_BIG_ENDIAN);
offset += 1;
proto_tree_add_item(tree, hf_rdt_stre_dummy_type, tvb, offset, 2, ENC_BIG_ENDIAN);
offset += 2;
proto_tree_add_item(tree, hf_rdt_stre_reason_code, tvb, offset, 4, ENC_BIG_ENDIAN);
offset += 4;
/* XXX: Remainder is reason_text */
offset += tvb_captured_length_remaining(tvb, offset);
}
col_append_fstr(pinfo->cinfo, COL_INFO, "STREAM-END: stream-id=%02u ", stream_id);
return offset;
}
/* Dissect an report packet */
unsigned dissect_rdt_report_packet(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned offset)
{
unsigned start_offset = offset;
uint16_t packet_length;
uint8_t flags1;
uint8_t length_included_flag;
proto_tree *flags_tree;
proto_item *ti;
/* Flags in first byte */
flags1 = tvb_get_uint8(tvb, offset);
length_included_flag = (flags1 & 0x80) >> 7;
/* Create subtree for flags fields */
ti = proto_tree_add_string_format(tree, hf_rdt_report_flags, tvb, offset, 1,
"",
"Length-included=%u",
length_included_flag);
flags_tree = proto_item_add_subtree(ti, ett_rdt_report_flags);
proto_tree_add_item(flags_tree, hf_rdt_len_included, tvb, offset, 1, ENC_BIG_ENDIAN);
offset++;
/* Packet type */
proto_tree_add_item(tree, hf_rdt_packet_type, tvb, offset, 2, ENC_BIG_ENDIAN);
offset += 2;
/* Length field is optional */
if (length_included_flag)
{
packet_length = tvb_get_ntohs(tvb, offset);
proto_tree_add_item(tree, hf_rdt_packet_length, tvb, offset, 2, ENC_BIG_ENDIAN);
offset += 2;
/* Check that there are as many bytes as reported */
tvb_ensure_bytes_exist(tvb, start_offset, packet_length);
}
else
{
packet_length = tvb_captured_length_remaining(tvb, start_offset);
}
col_append_str(pinfo->cinfo, COL_INFO, "REPORT: ");
/* The remaining data is unparsed. */
proto_tree_add_item(tree, hf_rdt_data, tvb, offset, -1, ENC_NA);
if (packet_length < (offset - start_offset) ||
packet_length > tvb_reported_length_remaining(tvb, start_offset))
{
proto_tree_add_expert(tree, pinfo, &ei_rdt_packet_length, tvb, 0, 0);
packet_length = tvb_captured_length_remaining(tvb, start_offset);
}
return start_offset + packet_length;
}
/* Dissect an latency-report packet */
unsigned dissect_rdt_latency_report_packet(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned offset)
{
unsigned start_offset = offset;
uint16_t packet_length;
uint8_t flags1;
uint8_t length_included_flag;
uint32_t server_out_time;
proto_tree *flags_tree;
proto_item *ti;
/* Flags in first byte */
flags1 = tvb_get_uint8(tvb, offset);
length_included_flag = (flags1 & 0x80) >> 7;
/* Create subtree for flags fields */
ti = proto_tree_add_string_format(tree, hf_rdt_latency_report_flags, tvb, offset, 1,
"",
"Length-included=%u",
length_included_flag);
flags_tree = proto_item_add_subtree(ti, ett_rdt_latency_report_flags);
proto_tree_add_item(flags_tree, hf_rdt_len_included, tvb, offset, 1, ENC_BIG_ENDIAN);
offset++;
/* Packet type */
proto_tree_add_item(tree, hf_rdt_packet_type, tvb, offset, 2, ENC_BIG_ENDIAN);
offset += 2;
/* Length field is optional */
if (length_included_flag)
{
packet_length = tvb_get_ntohs(tvb, offset);
proto_tree_add_item(tree, hf_rdt_packet_length, tvb, offset, 2, ENC_BIG_ENDIAN);
offset += 2;
/* Check that there are as many bytes as reported */
tvb_ensure_bytes_exist(tvb, start_offset, packet_length);
}
else
{
packet_length = tvb_captured_length_remaining(tvb, start_offset);
}
server_out_time = tvb_get_ntohl(tvb, offset);
proto_tree_add_item(tree, hf_rdt_lrpt_server_out_time, tvb, offset, 4, ENC_BIG_ENDIAN);
offset += 4;
col_append_fstr(pinfo->cinfo, COL_INFO, "LATENCY-REPORT: t=%u ", server_out_time);
if (packet_length < (offset - start_offset) ||
packet_length > tvb_reported_length_remaining(tvb, start_offset))
{
proto_tree_add_expert(tree, pinfo, &ei_rdt_packet_length, tvb, 0, 0);
packet_length = tvb_captured_length_remaining(tvb, start_offset);
}
return start_offset + packet_length;
}
/* Dissect a transport-info packet */
unsigned dissect_rdt_transport_info_request_packet(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned offset)
{
uint8_t flags1;
uint8_t request_rtt_info_flag;
uint8_t request_buffer_info_flag;
proto_tree *flags_tree;
proto_item *ti;
/* Flags in first byte */
flags1 = tvb_get_uint8(tvb, offset);
request_rtt_info_flag = (flags1 & 0x2) >> 1;
request_buffer_info_flag = (flags1 & 0x01);
/* Create subtree for flags fields */
ti = proto_tree_add_string_format(tree, hf_rdt_ack_flags, tvb, offset, 1,
"",
"Request-rtt-info=%u, request-buffer-info=%u",
request_rtt_info_flag,
request_buffer_info_flag);
flags_tree = proto_item_add_subtree(ti, ett_rdt_tirq_flags);
proto_tree_add_item(flags_tree, hf_rdt_tirq_request_rtt_info, tvb, offset, 1, ENC_BIG_ENDIAN);
proto_tree_add_item(flags_tree, hf_rdt_tirq_request_buffer_info, tvb, offset, 1, ENC_BIG_ENDIAN);
offset++;
/* Packet type */
proto_tree_add_item(tree, hf_rdt_packet_type, tvb, offset, 2, ENC_BIG_ENDIAN);
offset += 2;
if (request_rtt_info_flag)
{
proto_tree_add_item(tree, hf_rdt_tirq_request_time_msec, tvb, offset, 4, ENC_BIG_ENDIAN);
offset += 4;
}
col_append_str(pinfo->cinfo, COL_INFO, "TRANSPORT-INFO-REQUEST: ");
return offset;
}
/* Dissect an transport-info-response packet */
unsigned dissect_rdt_transport_info_response_packet(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned offset)
{
uint8_t flags1;
uint8_t has_rtt_info;
uint8_t is_delayed;
uint8_t has_buffer_info;
proto_tree *flags_tree;
proto_item *ti;
/* Flags in first byte */
flags1 = tvb_get_uint8(tvb, offset);
has_rtt_info = (flags1 & 0x4) >> 2;
is_delayed = (flags1 & 0x2) >> 1;
has_buffer_info = (flags1 & 0x1);
/* Create subtree for flags fields */
ti = proto_tree_add_string_format(tree, hf_rdt_tirp_flags, tvb, offset, 1,
"",
"Has-rtt-info=%u, is-delayed=%u, has-buffer-info=%u",
has_rtt_info,
is_delayed,
has_buffer_info);
flags_tree = proto_item_add_subtree(ti, ett_rdt_tirp_flags);
proto_tree_add_item(flags_tree, hf_rdt_tirp_has_rtt_info, tvb, offset, 1, ENC_BIG_ENDIAN);
proto_tree_add_item(flags_tree, hf_rdt_tirp_is_delayed, tvb, offset, 1, ENC_BIG_ENDIAN);
proto_tree_add_item(flags_tree, hf_rdt_tirp_has_buffer_info, tvb, offset, 1, ENC_BIG_ENDIAN);
offset++;
/* Packet type */
proto_tree_add_item(tree, hf_rdt_packet_type, tvb, offset, 2, ENC_BIG_ENDIAN);
offset += 2;
/* RTT info */
if (has_rtt_info)
{
proto_tree_add_item(tree, hf_rdt_tirp_request_time_msec, tvb, offset, 4, ENC_BIG_ENDIAN);
offset += 4;
if (is_delayed)
{
proto_tree_add_item(tree, hf_rdt_tirp_response_time_msec, tvb, offset, 4, ENC_BIG_ENDIAN);
offset += 4;
}
}
/* Buffer info */
if (has_buffer_info)
{
uint16_t n;
/* Read number of buffers */
uint16_t buffer_info_count = tvb_get_ntohs(tvb, offset);
proto_tree_add_item(tree, hf_rdt_tirp_buffer_info_count, tvb, offset, 2, ENC_BIG_ENDIAN);
offset += 2;
for (n=0; n < buffer_info_count; n++)
{
proto_tree *buffer_info_tree;
proto_item *ti2;
/* Each buffer info in a new subtree */
ti2 = proto_tree_add_string_format(tree, hf_rdt_tirp_buffer_info, tvb, offset, 14,
"",
"Buffer info %u",
n+1);
buffer_info_tree = proto_item_add_subtree(ti2, ett_rdt_tirp_buffer_info);
/* Read individual buffer info */
proto_tree_add_item(buffer_info_tree, hf_rdt_tirp_buffer_info_stream_id, tvb, offset, 2, ENC_BIG_ENDIAN);
offset += 2;
proto_tree_add_item(buffer_info_tree, hf_rdt_tirp_buffer_info_lowest_timestamp, tvb, offset, 4, ENC_BIG_ENDIAN);
offset += 4;
proto_tree_add_item(buffer_info_tree, hf_rdt_tirp_buffer_info_highest_timestamp, tvb, offset, 4, ENC_BIG_ENDIAN);
offset += 4;
proto_tree_add_item(buffer_info_tree, hf_rdt_tirp_buffer_info_bytes_buffered, tvb, offset, 4, ENC_BIG_ENDIAN);
offset += 4;
}
}
/* Report what is left */
offset += tvb_captured_length_remaining(tvb, offset);
col_append_str(pinfo->cinfo, COL_INFO, "RESPONSE: ");
return offset;
}
/* Dissect a bw-probing packet */
unsigned dissect_rdt_bw_probing_packet(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned offset)
{
unsigned start_offset = offset;
uint16_t packet_length;
uint8_t flags1;
uint8_t length_included_flag;
proto_tree *flags_tree;
proto_item *ti;
/* Flags in first byte */
flags1 = tvb_get_uint8(tvb, offset);
length_included_flag = (flags1 & 0x80) >> 7;
/* Create subtree for flags fields */
ti = proto_tree_add_string_format(tree, hf_rdt_bw_probing_flags, tvb, offset, 1,
"",
"Length-included=%u",
length_included_flag);
flags_tree = proto_item_add_subtree(ti, ett_rdt_bw_probing_flags);
proto_tree_add_item(flags_tree, hf_rdt_len_included, tvb, offset, 1, ENC_BIG_ENDIAN);
offset++;
/* Packet type */
proto_tree_add_item(tree, hf_rdt_packet_type, tvb, offset, 2, ENC_BIG_ENDIAN);
offset += 2;
/* Length field is optional */
if (length_included_flag)
{
packet_length = tvb_get_ntohs(tvb, offset);
proto_tree_add_item(tree, hf_rdt_packet_length, tvb, offset, 2, ENC_BIG_ENDIAN);
offset += 2;
/* Check that there are as many bytes as reported */
tvb_ensure_bytes_exist(tvb, start_offset, packet_length);
}
else
{
packet_length = tvb_captured_length_remaining(tvb, start_offset);
}
proto_tree_add_item(tree, hf_rdt_bwpp_seqno, tvb, offset, 1, ENC_BIG_ENDIAN);
offset += 1;
proto_tree_add_item(tree, hf_rdt_timestamp, tvb, offset, 1, ENC_BIG_ENDIAN);
offset += 4;
col_append_str(pinfo->cinfo, COL_INFO, "BW-PROBING: ");
if (packet_length < (offset - start_offset) ||
packet_length > tvb_reported_length_remaining(tvb, start_offset))
{
proto_tree_add_expert(tree, pinfo, &ei_rdt_packet_length, tvb, 0, 0);
packet_length = tvb_captured_length_remaining(tvb, start_offset);
}
return start_offset + packet_length;
}
/* Dissect an unknown control packet */
unsigned dissect_rdt_unknown_control(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned offset)
{
/* Flags in first byte */
proto_tree_add_item(tree, hf_rdt_unk_flags1, tvb, offset, 1, ENC_BIG_ENDIAN);
offset++;
/* Packet type */
proto_tree_add_item(tree, hf_rdt_packet_type, tvb, offset, 2, ENC_BIG_ENDIAN);
offset += 2;
/* The remaining data is unparsed. */
proto_tree_add_item(tree, hf_rdt_data, tvb, offset, -1, ENC_NA);
offset += tvb_captured_length_remaining(tvb, offset);
col_append_str(pinfo->cinfo, COL_INFO, "UNKNOWN-CTL: ");
return offset;
}
/* Look for conversation info and display any setup info found */
static void show_setup_info(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
{
/* Conversation and current data */
conversation_t *p_conv;
struct _rdt_conversation_info *p_conv_data;
/* Use existing packet info if available */
p_conv_data = (struct _rdt_conversation_info *)p_get_proto_data(wmem_file_scope(), pinfo, proto_rdt, 0);
if (!p_conv_data)
{
/* First time, get info from conversation */
p_conv = find_conversation(pinfo->num, &pinfo->net_dst, &pinfo->net_src,
conversation_pt_to_conversation_type(pinfo->ptype),
pinfo->destport, pinfo->srcport, NO_ADDR_B);
if (p_conv)
{
/* Create space for conversation info */
struct _rdt_conversation_info *p_conv_packet_data;
p_conv_data = (struct _rdt_conversation_info *)conversation_get_proto_data(p_conv, proto_rdt);
if (p_conv_data)
{
/* Save this conversation info into packet info */
p_conv_packet_data = wmem_new(wmem_file_scope(), struct _rdt_conversation_info);
(void) g_strlcpy(p_conv_packet_data->method, p_conv_data->method, MAX_RDT_SETUP_METHOD_SIZE);
p_conv_packet_data->frame_number = p_conv_data->frame_number;
p_conv_packet_data->feature_level = p_conv_data->feature_level;
p_add_proto_data(wmem_file_scope(), pinfo, proto_rdt, 0, p_conv_packet_data);
}
}
}
/* Create setup info subtree with summary info. */
if (p_conv_data)
{
proto_tree *rdt_setup_tree;
proto_item *ti = proto_tree_add_string_format(tree, hf_rdt_setup, tvb, 0, 0,
"",
"Stream setup by %s (frame %u), feature level %d",
p_conv_data->method,
p_conv_data->frame_number,
p_conv_data->feature_level);
proto_item_set_generated(ti);
rdt_setup_tree = proto_item_add_subtree(ti, ett_rdt_setup);
if (rdt_setup_tree)
{
/* Add details into subtree */
proto_item* item = proto_tree_add_uint(rdt_setup_tree, hf_rdt_setup_frame,
tvb, 0, 0, p_conv_data->frame_number);
proto_item_set_generated(item);
item = proto_tree_add_string(rdt_setup_tree, hf_rdt_setup_method,
tvb, 0, 0, p_conv_data->method);
proto_item_set_generated(item);
item = proto_tree_add_int(rdt_setup_tree, hf_rdt_feature_level,
tvb, 0, 0, p_conv_data->feature_level);
proto_item_set_generated(item);
}
}
}
void proto_register_rdt(void)
{
static hf_register_info hf[] =
{
{
&hf_rdt_packet,
{
"RDT packet",
"rdt.packet",
FT_STRING,
BASE_NONE,
NULL,
0x0,
NULL, HFILL
}
},
{
&hf_rdt_data_flags1,
{
"RDT data flags 1",
"rdt.data-flags1",
FT_STRING,
BASE_NONE,
NULL,
0x0,
NULL, HFILL
}
},
{
&hf_rdt_len_included,
{
"Length included",
"rdt.length-included",
FT_UINT8,
BASE_DEC,
NULL,
0x80,
NULL, HFILL
}
},
{
&hf_rdt_data_need_reliable,
{
"Need reliable",
"rdt.need-reliable",
FT_UINT8,
BASE_DEC,
NULL,
0x40,
NULL, HFILL
}
},
{
&hf_rdt_data_stream_id,
{
"Stream ID",
"rdt.stream-id",
FT_UINT8,
BASE_DEC,
NULL,
0x3e,
NULL, HFILL
}
},
{
&hf_rdt_data_is_reliable,
{
"Is reliable",
"rdt.is-reliable",
FT_UINT8,
BASE_DEC,
NULL,
0x01,
NULL, HFILL
}
},
{
&hf_rdt_data_flags2,
{
"RDT data flags 2",
"rdt.data-flags2",
FT_STRING,
BASE_NONE,
NULL,
0x0,
"RDT data flags2", HFILL
}
},
{
&hf_rdt_data_backtoback,
{
"Back-to-back",
"rdt.back-to-back",
FT_UINT8,
BASE_DEC,
NULL,
0x80,
NULL, HFILL
}
},
{
&hf_rdt_data_slowdata,
{
"Slow data",
"rdt.slow-data",
FT_UINT8,
BASE_DEC,
NULL,
0x40,
NULL, HFILL
}
},
{
&hf_rdt_data_asmrule,
{
"asm rule",
"rdt.asm-rule",
FT_UINT8,
BASE_DEC,
NULL,
0x3f,
NULL, HFILL
}
},
{
&hf_rdt_aact_flags,
{
"RDT asm-action flags 1",
"rdt.aact-flags",
FT_STRING,
BASE_NONE,
NULL,
0x0,
"RDT aact flags", HFILL
}
},
{
&hf_rdt_aact_stream_id,
{
"Stream ID",
"rdt.stream-id",
FT_UINT8,
BASE_DEC,
NULL,
0x7c,
NULL, HFILL
}
},
{
&hf_rdt_sequence_number,
{
"Sequence number",
"rdt.sequence-number",
FT_UINT16,
BASE_DEC,
NULL,
0x0,
NULL, HFILL
}
},
{
&hf_rdt_packet_type,
{
"Packet type",
"rdt.packet-type",
FT_UINT16,
BASE_HEX,
VALS(packet_type_vals),
0x0,
NULL, HFILL
}
},
{
&hf_rdt_ack_flags,
{
"RDT ack flags",
"rdt.ack-flags",
FT_STRING,
BASE_NONE,
NULL,
0x0,
NULL, HFILL
}
},
{
&hf_rdt_ack_lost_high,
{
"Lost high",
"rdt.lost-high",
FT_UINT8,
BASE_DEC,
NULL,
0x40,
NULL, HFILL
}
},
{
&hf_rdt_latency_report_flags,
{
"RDT latency report flags",
"rdt.latency-report-flags",
FT_STRING,
BASE_NONE,
NULL,
0x0,
NULL, HFILL
}
},
{
&hf_rdt_bandwidth_report_flags,
{
"RDT bandwidth report flags",
"rdt.bandwidth-report-flags",
FT_STRING,
BASE_NONE,
NULL,
0x0,
NULL, HFILL
}
},
{
&hf_rdt_stre_flags,
{
"RDT stream end flags",
"rdt.stream-end-flags",
FT_STRING,
BASE_NONE,
NULL,
0x0,
NULL, HFILL
}
},
#if 0
{
&hf_rdt_rtt_request_flags,
{
"RDT rtt request flags",
"rdt.rtt-request-flags",
FT_STRING,
BASE_NONE,
NULL,
0x0,
NULL, HFILL
}
},
#endif
#if 0
{
&hf_rdt_rtt_response_flags,
{
"RDT rtt response flags",
"rdt.rtt-response-flags",
FT_STRING,
BASE_NONE,
NULL,
0x0,
NULL, HFILL
}
},
#endif
#if 0
{
&hf_rdt_congestion_flags,
{
"RDT congestion flags",
"rdt.congestion-flags",
FT_STRING,
BASE_NONE,
NULL,
0x0,
NULL, HFILL
}
},
#endif
{
&hf_rdt_report_flags,
{
"RDT report flags",
"rdt.report-flags",
FT_STRING,
BASE_NONE,
NULL,
0x0,
NULL, HFILL
}
},
#if 0
{
&hf_rdt_tirq_flags,
{
"RDT transport info request flags",
"rdt.transport-info-request-flags",
FT_STRING,
BASE_NONE,
NULL,
0x0,
NULL, HFILL
}
},
#endif
{
&hf_rdt_tirp_flags,
{
"RDT transport info response flags",
"rdt.transport-info-response-flags",
FT_STRING,
BASE_NONE,
NULL,
0x0,
NULL, HFILL
}
},
{
&hf_rdt_bw_probing_flags,
{
"RDT bw probing flags",
"rdt.bw-probing-flags",
FT_STRING,
BASE_NONE,
NULL,
0x0,
NULL, HFILL
}
},
{
&hf_rdt_packet_length,
{
"Packet length",
"rdt.packet-length",
FT_UINT16,
BASE_DEC,
NULL,
0x0,
NULL, HFILL
}
},
{
&hf_rdt_timestamp,
{
"Timestamp",
"rdt.timestamp",
FT_UINT32,
BASE_DEC,
NULL,
0x0,
NULL, HFILL
}
},
{
&hf_rdt_stream_id_ex,
{
"Stream-id expansion",
"rdt.stream-id-expansion",
FT_UINT16,
BASE_DEC,
NULL,
0x0,
NULL, HFILL
}
},
{
&hf_rdt_asmrule_ex,
{
"Asm rule expansion",
"rdt.asm-rule-expansion",
FT_UINT16,
BASE_DEC,
NULL,
0x0,
NULL, HFILL
}
},
{
&hf_rdt_total_reliable,
{
"Total reliable",
"rdt.total-reliable",
FT_UINT16,
BASE_DEC,
NULL,
0x0,
NULL, HFILL
}
},
{
&hf_rdt_data,
{
"Data",
"rdt.data",
FT_NONE,
BASE_NONE,
NULL,
0x0,
NULL, HFILL
}
},
{
&hf_rdt_aact_reliable_seqno,
{
"Reliable sequence number",
"rdt.reliable-seq-no",
FT_UINT16,
BASE_DEC,
NULL,
0x0,
NULL, HFILL
}
},
{
&hf_rdt_brpt_interval,
{
"Bandwidth report interval",
"rdt.bwid-report-interval",
FT_UINT16,
BASE_DEC,
NULL,
0x0,
NULL, HFILL
}
},
{
&hf_rdt_brpt_bandwidth,
{
"Bandwidth report bandwidth",
"rdt.bwid-report-bandwidth",
FT_UINT32,
BASE_DEC,
NULL,
0x0,
NULL, HFILL
}
},
{
&hf_rdt_brpt_sequence,
{
"Bandwidth report sequence",
"rdt.bwid-report-sequence",
FT_UINT16,
BASE_DEC,
NULL,
0x0,
NULL, HFILL
}
},
{
&hf_rdt_rtrp_ts_sec,
{
"Round trip response timestamp seconds",
"rdt.rtrp-ts-sec",
FT_UINT32,
BASE_DEC,
NULL,
0x0,
NULL, HFILL
}
},
{
&hf_rdt_rtrp_ts_usec,
{
"Round trip response timestamp microseconds",
"rdt.rtrp-ts-usec",
FT_UINT32,
BASE_DEC,
NULL,
0x0,
NULL, HFILL
}
},
{
&hf_rdt_cong_xmit_mult,
{
"Congestion transmit multiplier",
"rdt.cong-xmit-mult",
FT_UINT32,
BASE_DEC,
NULL,
0x0,
NULL, HFILL
}
},
{
&hf_rdt_cong_recv_mult,
{
"Congestion receive multiplier",
"rdt.cong-recv-mult",
FT_UINT32,
BASE_DEC,
NULL,
0x0,
NULL, HFILL
}
},
{
&hf_rdt_stre_need_reliable,
{
"Need reliable",
"rdt.stre-need-reliable",
FT_UINT8,
BASE_DEC,
NULL,
0x80,
NULL, HFILL
}
},
{
&hf_rdt_stre_stream_id,
{
"Stream id",
"rdt.stre-stream-id",
FT_UINT8,
BASE_DEC,
NULL,
0x7c,
NULL, HFILL
}
},
{
&hf_rdt_stre_packet_sent,
{
"Packet sent",
"rdt.stre-packet-sent",
FT_UINT8,
BASE_DEC,
NULL,
0x02,
NULL, HFILL
}
},
{
&hf_rdt_stre_ext_flag,
{
"Ext flag",
"rdt.stre-ext-flag",
FT_UINT8,
BASE_DEC,
NULL,
0x01,
NULL, HFILL
}
},
{
&hf_rdt_stre_seqno,
{
"Stream end sequence number",
"rdt.stre-seqno",
FT_UINT16,
BASE_DEC,
NULL,
0x0,
NULL, HFILL
}
},
{
&hf_rdt_stre_dummy_flags1,
{
"Stream end reason dummy flags1",
"rdt.stre-reason-dummy-flags1",
FT_UINT8,
BASE_HEX,
NULL,
0x0,
NULL, HFILL
}
},
{
&hf_rdt_stre_dummy_type,
{
"Stream end reason dummy type",
"rdt.stre-reason-dummy-type",
FT_UINT16,
BASE_HEX,
NULL,
0x0,
NULL, HFILL
}
},
{
&hf_rdt_stre_reason_code,
{
"Stream end reason code",
"rdt.stre-reason-code",
FT_UINT32,
BASE_HEX,
NULL,
0x0,
NULL, HFILL
}
},
{
&hf_rdt_lrpt_server_out_time,
{
"Latency report server out time",
"rdt.lrpt-server-out-time",
FT_UINT32,
BASE_DEC,
NULL,
0x0,
NULL, HFILL
}
},
{
&hf_rdt_tirq_request_rtt_info,
{
"Transport info request rtt info flag",
"rdt.tirq-request-rtt-info",
FT_UINT8,
BASE_DEC,
NULL,
0x2,
NULL, HFILL
}
},
{
&hf_rdt_tirq_request_buffer_info,
{
"Transport info request buffer info flag",
"rdt.tirq-request-buffer-info",
FT_UINT8,
BASE_DEC,
NULL,
0x1,
NULL, HFILL
}
},
{
&hf_rdt_tirq_request_time_msec,
{
"Transport info request time msec",
"rdt.tirq-request-time-msec",
FT_UINT32,
BASE_DEC,
NULL,
0x0,
NULL, HFILL
}
},
{
&hf_rdt_tirp_has_rtt_info,
{
"Transport info response has rtt info flag",
"rdt.tirp-has-rtt-info",
FT_UINT8,
BASE_DEC,
NULL,
0x4,
NULL, HFILL
}
},
{
&hf_rdt_tirp_is_delayed,
{
"Transport info response is delayed",
"rdt.tirp-is-delayed",
FT_UINT8,
BASE_DEC,
NULL,
0x2,
NULL, HFILL
}
},
{
&hf_rdt_tirp_has_buffer_info,
{
"Transport info response has buffer info",
"rdt.tirp-has-buffer-info",
FT_UINT8,
BASE_DEC,
NULL,
0x1,
NULL, HFILL
}
},
{
&hf_rdt_tirp_request_time_msec,
{
"Transport info request time msec",
"rdt.tirp-request-time-msec",
FT_UINT32,
BASE_DEC,
NULL,
0x0,
NULL, HFILL
}
},
{
&hf_rdt_tirp_response_time_msec,
{
"Transport info response time msec",
"rdt.tirp-response-time-msec",
FT_UINT32,
BASE_DEC,
NULL,
0x0,
NULL, HFILL
}
},
{
&hf_rdt_tirp_buffer_info_count,
{
"Transport info buffer into count",
"rdt.tirp-buffer-info-count",
FT_UINT16,
BASE_DEC,
NULL,
0x0,
NULL, HFILL
}
},
{
&hf_rdt_tirp_buffer_info,
{
"RDT buffer info",
"rdt.tirp-buffer-info",
FT_STRING,
BASE_NONE,
NULL,
0x0,
NULL, HFILL
}
},
{
&hf_rdt_tirp_buffer_info_stream_id,
{
"Buffer info stream-id",
"rdt.tirp-buffer-info-stream-id",
FT_UINT16,
BASE_DEC,
NULL,
0x0,
NULL, HFILL
}
},
{
&hf_rdt_tirp_buffer_info_lowest_timestamp,
{
"Lowest timestamp",
"rdt.tirp-buffer-info-lowest-timestamp",
FT_UINT32,
BASE_DEC,
NULL,
0x0,
NULL, HFILL
}
},
{
&hf_rdt_tirp_buffer_info_highest_timestamp,
{
"Highest timestamp",
"rdt.tirp-buffer-info-highest-timestamp",
FT_UINT32,
BASE_DEC,
NULL,
0x0,
NULL, HFILL
}
},
{
&hf_rdt_tirp_buffer_info_bytes_buffered,
{
"Bytes buffered",
"rdt.tirp-buffer-info-bytes-buffered",
FT_UINT32,
BASE_DEC,
NULL,
0x0,
NULL, HFILL
}
},
{
&hf_rdt_bwpp_seqno,
{
"Bandwidth probing packet seqno",
"rdt.bwpp-seqno",
FT_UINT8,
BASE_DEC,
NULL,
0x0,
NULL, HFILL
}
},
{
&hf_rdt_unk_flags1,
{
"Unknown packet flags",
"rdt.unk-flags1",
FT_UINT8,
BASE_DEC,
NULL,
0x0,
NULL, HFILL
}
},
{
&hf_rdt_setup,
{
"Stream setup",
"rdt.setup",
FT_STRING,
BASE_NONE,
NULL,
0x0,
"Stream setup, method and frame number", HFILL
}
},
{
&hf_rdt_setup_frame,
{
"Setup frame",
"rdt.setup-frame",
FT_FRAMENUM,
BASE_NONE,
NULL,
0x0,
"Frame that set up this stream", HFILL
}
},
{
&hf_rdt_setup_method,
{
"Setup Method",
"rdt.setup-method",
FT_STRING,
BASE_NONE,
NULL,
0x0,
"Method used to set up this stream", HFILL
}
},
{
&hf_rdt_feature_level,
{
"RDT feature level",
"rdt.feature-level",
FT_INT32,
BASE_DEC,
NULL,
0x0,
NULL, HFILL
}
},
};
static int *ett[] =
{
&ett_rdt,
&ett_rdt_packet,
&ett_rdt_setup,
&ett_rdt_data_flags1,
&ett_rdt_data_flags2,
&ett_rdt_aact_flags,
&ett_rdt_ack_flags,
&ett_rdt_latency_report_flags,
&ett_rdt_bandwidth_report_flags,
&ett_rdt_stre_flags,
&ett_rdt_rtt_request_flags,
&ett_rdt_rtt_response_flags,
&ett_rdt_congestion_flags,
&ett_rdt_report_flags,
&ett_rdt_tirq_flags,
&ett_rdt_tirp_flags,
&ett_rdt_tirp_buffer_info,
&ett_rdt_bw_probing_flags
};
static ei_register_info ei[] = {
{ &ei_rdt_packet_length, { "rdt.invalid_packet_length", PI_MALFORMED, PI_ERROR, "Packet length invalid", EXPFILL }},
};
module_t *rdt_module;
expert_module_t* expert_rdt;
/* Register protocol and fields */
proto_rdt = proto_register_protocol("Real Data Transport", "RDT", "rdt");
proto_register_field_array(proto_rdt, hf, array_length(hf));
proto_register_subtree_array(ett, array_length(ett));
expert_rdt = expert_register_protocol(proto_rdt);
expert_register_field_array(expert_rdt, ei, array_length(ei));
rdt_handle = register_dissector("rdt", dissect_rdt, proto_rdt);
/* Preference settings */
rdt_module = prefs_register_protocol(proto_rdt, NULL);
prefs_register_bool_preference(rdt_module, "show_setup_info",
"Show stream setup information",
"Where available, show which protocol and frame caused "
"this RDT stream to be created",
&global_rdt_show_setup_info);
prefs_register_obsolete_preference(rdt_module, "register_udp_port");
}
void proto_reg_handoff_rdt(void)
{
dissector_add_uint_with_preference("udp.port", RDT_UDP_PORT, rdt_handle);
}
/*
* Editor modelines - https://www.wireshark.org/tools/modelines.html
*
* Local variables:
* c-basic-offset: 4
* tab-width: 8
* indent-tabs-mode: nil
* End:
*
* vi: set shiftwidth=4 tabstop=8 expandtab:
* :indentSize=4:tabSize=8:noTabs=true:
*/
|