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
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
|
/* Do not modify this file. */
/* It is created automatically by the ASN.1 to Wireshark dissector compiler */
/* packet-tcap.c */
/* ../../tools/asn2wrs.py -b -p tcap -c ./tcap.cnf -s ./packet-tcap-template -D . -O ../../epan/dissectors tcap.asn UnidialoguePDUs.asn DialoguePDUs.asn */
/* Input file: packet-tcap-template.c */
#line 1 "../../asn1/tcap/packet-tcap-template.c"
/* packet-tcap-template.c
* Routines for TCAP
* Copyright 2004 - 2005, Tim Endean <endeant@hotmail.com>
* Built from the gsm-map dissector Copyright 2004 - 2005, Anders Broman <anders.broman@ericsson.com>
*
* $Id$
*
* Wireshark - Network traffic analyzer
* By Gerald Combs <gerald@wireshark.org>
* Copyright 1998 Gerald Combs
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
* References: ETSI 300 374
*/
#ifdef HAVE_CONFIG_H
# include "config.h"
#endif
#include <glib.h>
#include <epan/packet.h>
#include <epan/prefs.h>
#include <epan/oids.h>
#include <epan/asn1.h>
#include <epan/strutil.h>
#include <string.h>
#include "packet-ber.h"
#include "packet-tcap.h"
#include "packet-frame.h"
#include <epan/tcap-persistentdata.h>
#define PNAME "Transaction Capabilities Application Part"
#define PSNAME "TCAP"
#define PFNAME "tcap"
/* Initialize the protocol and registered fields */
static int proto_tcap = -1;
static int hf_tcap_tag = -1;
static int hf_tcap_length = -1;
static int hf_tcap_data = -1;
static int hf_tcap_tid = -1;
int hf_tcapsrt_SessionId=-1;
int hf_tcapsrt_Duplicate=-1;
int hf_tcapsrt_BeginSession=-1;
int hf_tcapsrt_EndSession=-1;
int hf_tcapsrt_SessionTime=-1;
/*--- Included file: packet-tcap-hf.c ---*/
#line 1 "../../asn1/tcap/packet-tcap-hf.c"
static int hf_tcap_UniDialoguePDU_PDU = -1; /* UniDialoguePDU */
static int hf_tcap_DialoguePDU_PDU = -1; /* DialoguePDU */
static int hf_tcap_oid = -1; /* OBJECT_IDENTIFIER */
static int hf_tcap_dialog = -1; /* Dialog1 */
static int hf_tcap_unidirectional = -1; /* Unidirectional */
static int hf_tcap_begin = -1; /* Begin */
static int hf_tcap_end = -1; /* End */
static int hf_tcap_continue = -1; /* Continue */
static int hf_tcap_abort = -1; /* Abort */
static int hf_tcap_dialoguePortion = -1; /* DialoguePortion */
static int hf_tcap_components = -1; /* ComponentPortion */
static int hf_tcap_otid = -1; /* OrigTransactionID */
static int hf_tcap_dtid = -1; /* DestTransactionID */
static int hf_tcap_reason = -1; /* Reason */
static int hf_tcap_p_abortCause = -1; /* P_AbortCause */
static int hf_tcap_u_abortCause = -1; /* DialoguePortion */
static int hf_tcap__untag_item = -1; /* Component */
static int hf_tcap_invoke = -1; /* Invoke */
static int hf_tcap_returnResultLast = -1; /* ReturnResult */
static int hf_tcap_returnError = -1; /* ReturnError */
static int hf_tcap_reject = -1; /* Reject */
static int hf_tcap_returnResultNotLast = -1; /* ReturnResult */
static int hf_tcap_invokeID = -1; /* InvokeIdType */
static int hf_tcap_linkedID = -1; /* InvokeIdType */
static int hf_tcap_opCode = -1; /* OPERATION */
static int hf_tcap_parameter = -1; /* Parameter */
static int hf_tcap_resultretres = -1; /* T_resultretres */
static int hf_tcap_errorCode = -1; /* ErrorCode */
static int hf_tcap_invokeIDRej = -1; /* T_invokeIDRej */
static int hf_tcap_derivable = -1; /* InvokeIdType */
static int hf_tcap_not_derivable = -1; /* NULL */
static int hf_tcap_problem = -1; /* T_problem */
static int hf_tcap_generalProblem = -1; /* GeneralProblem */
static int hf_tcap_invokeProblem = -1; /* InvokeProblem */
static int hf_tcap_returnResultProblem = -1; /* ReturnResultProblem */
static int hf_tcap_returnErrorProblem = -1; /* ReturnErrorProblem */
static int hf_tcap_localValue = -1; /* INTEGER */
static int hf_tcap_globalValue = -1; /* OBJECT_IDENTIFIER */
static int hf_tcap_nationaler = -1; /* INTEGER_M32768_32767 */
static int hf_tcap_privateer = -1; /* INTEGER */
static int hf_tcap_unidialoguePDU = -1; /* AUDT_apdu */
static int hf_tcap_audt_protocol_version = -1; /* AUDT_protocol_version */
static int hf_tcap_audt_application_context_name = -1; /* AUDT_application_context_name */
static int hf_tcap_audt_user_information = -1; /* AUDT_user_information */
static int hf_tcap_audt_user_information_item = -1; /* EXTERNAL */
static int hf_tcap_dialogueRequest = -1; /* AARQ_apdu */
static int hf_tcap_dialogueResponse = -1; /* AARE_apdu */
static int hf_tcap_dialogueAbort = -1; /* ABRT_apdu */
static int hf_tcap_aarq_protocol_version = -1; /* AARQ_protocol_version */
static int hf_tcap_aarq_application_context_name = -1; /* AARQ_application_context_name */
static int hf_tcap_aarq_user_information = -1; /* AARQ_user_information */
static int hf_tcap_aarq_user_information_item = -1; /* EXTERNAL */
static int hf_tcap_aare_protocol_version = -1; /* AARE_protocol_version */
static int hf_tcap_aare_application_context_name = -1; /* AARE_application_context_name */
static int hf_tcap_result = -1; /* Associate_result */
static int hf_tcap_result_source_diagnostic = -1; /* Associate_source_diagnostic */
static int hf_tcap_aare_user_information = -1; /* AARE_user_information */
static int hf_tcap_aare_user_information_item = -1; /* EXTERNAL */
static int hf_tcap_abort_source = -1; /* ABRT_source */
static int hf_tcap_abrt_user_information = -1; /* ABRT_user_information */
static int hf_tcap_abrt_user_information_item = -1; /* EXTERNAL */
static int hf_tcap_dialogue_service_user = -1; /* T_dialogue_service_user */
static int hf_tcap_dialogue_service_provider = -1; /* T_dialogue_service_provider */
/* named bits */
static int hf_tcap_AUDT_protocol_version_version1 = -1;
static int hf_tcap_AARQ_protocol_version_version1 = -1;
static int hf_tcap_AARE_protocol_version_version1 = -1;
/*--- End of included file: packet-tcap-hf.c ---*/
#line 63 "../../asn1/tcap/packet-tcap-template.c"
/* Initialize the subtree pointers */
static gint ett_tcap = -1;
static gint ett_param = -1;
static gint ett_otid = -1;
static gint ett_dtid = -1;
gint ett_tcap_stat = -1;
static struct tcapsrt_info_t * gp_tcapsrt_info;
static gboolean tcap_subdissector_used=FALSE;
static dissector_handle_t requested_subdissector_handle = NULL;
static struct tcaphash_context_t * gp_tcap_context=NULL;
/*--- Included file: packet-tcap-ett.c ---*/
#line 1 "../../asn1/tcap/packet-tcap-ett.c"
static gint ett_tcap_ExternalPDU_U = -1;
static gint ett_tcap_TCMessage = -1;
static gint ett_tcap_Unidirectional = -1;
static gint ett_tcap_Begin = -1;
static gint ett_tcap_End = -1;
static gint ett_tcap_Continue = -1;
static gint ett_tcap_Abort = -1;
static gint ett_tcap_Reason = -1;
static gint ett_tcap_SEQUENCE_SIZE_1_MAX_OF_Component = -1;
static gint ett_tcap_Component = -1;
static gint ett_tcap_Invoke = -1;
static gint ett_tcap_ReturnResult = -1;
static gint ett_tcap_T_resultretres = -1;
static gint ett_tcap_ReturnError = -1;
static gint ett_tcap_Reject = -1;
static gint ett_tcap_T_invokeIDRej = -1;
static gint ett_tcap_T_problem = -1;
static gint ett_tcap_OPERATION = -1;
static gint ett_tcap_ERROR = -1;
static gint ett_tcap_ErrorCode = -1;
static gint ett_tcap_UniDialoguePDU = -1;
static gint ett_tcap_AUDT_apdu_U = -1;
static gint ett_tcap_AUDT_protocol_version = -1;
static gint ett_tcap_AUDT_user_information = -1;
static gint ett_tcap_DialoguePDU = -1;
static gint ett_tcap_AARQ_apdu_U = -1;
static gint ett_tcap_AARQ_protocol_version = -1;
static gint ett_tcap_AARQ_user_information = -1;
static gint ett_tcap_AARE_apdu_U = -1;
static gint ett_tcap_AARE_protocol_version = -1;
static gint ett_tcap_AARE_user_information = -1;
static gint ett_tcap_ABRT_apdu_U = -1;
static gint ett_tcap_ABRT_user_information = -1;
static gint ett_tcap_Associate_source_diagnostic = -1;
/*--- End of included file: packet-tcap-ett.c ---*/
#line 79 "../../asn1/tcap/packet-tcap-template.c"
#define MAX_SSN 254
static range_t *global_ssn_range;
static range_t *ssn_range;
struct tcap_private_t tcap_private;
gboolean gtcap_HandleSRT=FALSE;
extern gboolean gtcap_PersistentSRT;
extern gboolean gtcap_DisplaySRT;
extern guint gtcap_RepetitionTimeout;
extern guint gtcap_LostTimeout;
static dissector_handle_t tcap_handle = NULL;
static dissector_table_t ber_oid_dissector_table;
static const char * cur_oid;
static const char * tcapext_oid;
static proto_tree * tcap_top_tree=NULL;
static proto_tree * tcap_stat_tree=NULL;
static dissector_handle_t data_handle;
static dissector_handle_t ansi_tcap_handle;
static void raz_tcap_private(struct tcap_private_t * p_tcap_private);
static int dissect_tcap_param(asn1_ctx_t *actx, proto_tree *tree, tvbuff_t *tvb, int offset);
static int dissect_tcap_ITU_ComponentPDU(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, asn1_ctx_t *actx _U_, proto_tree *tree, int hf_index _U_);
static GHashTable* ansi_sub_dissectors = NULL;
static GHashTable* itu_sub_dissectors = NULL;
static void dissect_tcap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree);
extern void add_ansi_tcap_subdissector(guint32 ssn, dissector_handle_t dissector) {
g_hash_table_insert(ansi_sub_dissectors,GUINT_TO_POINTER(ssn),dissector);
dissector_add_uint("sccp.ssn",ssn,tcap_handle);
}
extern void add_itu_tcap_subdissector(guint32 ssn, dissector_handle_t dissector) {
g_hash_table_insert(itu_sub_dissectors,GUINT_TO_POINTER(ssn),dissector);
dissector_add_uint("sccp.ssn",ssn,tcap_handle);
}
extern void delete_ansi_tcap_subdissector(guint32 ssn, dissector_handle_t dissector _U_) {
g_hash_table_remove(ansi_sub_dissectors,GUINT_TO_POINTER(ssn));
if (!get_itu_tcap_subdissector(ssn))
dissector_delete_uint("sccp.ssn",ssn,tcap_handle);
}
extern void delete_itu_tcap_subdissector(guint32 ssn, dissector_handle_t dissector _U_) {
g_hash_table_remove(itu_sub_dissectors,GUINT_TO_POINTER(ssn));
if (!get_ansi_tcap_subdissector(ssn))
dissector_delete_uint("sccp.ssn", ssn,tcap_handle);
}
dissector_handle_t get_ansi_tcap_subdissector(guint32 ssn) {
return (dissector_handle_t)g_hash_table_lookup(ansi_sub_dissectors,GUINT_TO_POINTER(ssn));
}
dissector_handle_t get_itu_tcap_subdissector(guint32 ssn) {
return (dissector_handle_t)g_hash_table_lookup(itu_sub_dissectors,GUINT_TO_POINTER(ssn));
}
/*--- Included file: packet-tcap-fn.c ---*/
#line 1 "../../asn1/tcap/packet-tcap-fn.c"
static int
dissect_tcap_OBJECT_IDENTIFIER(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
offset = dissect_ber_object_identifier(implicit_tag, actx, tree, tvb, offset, hf_index, NULL);
return offset;
}
static int
dissect_tcap_Dialog1(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
#line 69 "../../asn1/tcap/tcap.cnf"
offset = dissect_tcap_DialoguePDU(TRUE, tvb, offset, actx, tree, -1);
return offset;
}
static const ber_sequence_t ExternalPDU_U_sequence[] = {
{ &hf_tcap_oid , BER_CLASS_UNI, BER_UNI_TAG_OID, BER_FLAGS_NOOWNTAG, dissect_tcap_OBJECT_IDENTIFIER },
{ &hf_tcap_dialog , BER_CLASS_CON, 0, BER_FLAGS_IMPLTAG, dissect_tcap_Dialog1 },
{ NULL, 0, 0, 0, NULL }
};
static int
dissect_tcap_ExternalPDU_U(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset,
ExternalPDU_U_sequence, hf_index, ett_tcap_ExternalPDU_U);
return offset;
}
static int
dissect_tcap_ExternalPDU(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
#line 64 "../../asn1/tcap/tcap.cnf"
offset = dissect_ber_tagged_type(implicit_tag, actx, tree, tvb, offset,
hf_index, BER_CLASS_UNI, 8, TRUE, dissect_tcap_ExternalPDU_U);
return offset;
}
static int
dissect_tcap_DialogueOC(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
#line 59 "../../asn1/tcap/tcap.cnf"
offset = dissect_tcap_ExternalPDU(FALSE /*implicit_tag*/, tvb, offset, actx, tree, -1);
return offset;
}
static int
dissect_tcap_DialoguePortion(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
offset = dissect_ber_tagged_type(implicit_tag, actx, tree, tvb, offset,
hf_index, BER_CLASS_APP, 11, TRUE, dissect_tcap_DialogueOC);
return offset;
}
static int
dissect_tcap_InvokeIdType(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
offset = dissect_ber_integer(implicit_tag, actx, tree, tvb, offset, hf_index,
NULL);
return offset;
}
static int
dissect_tcap_INTEGER(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
offset = dissect_ber_integer(implicit_tag, actx, tree, tvb, offset, hf_index,
NULL);
return offset;
}
static const value_string tcap_OPERATION_vals[] = {
{ 0, "localValue" },
{ 1, "globalValue" },
{ 0, NULL }
};
static const ber_choice_t OPERATION_choice[] = {
{ 0, &hf_tcap_localValue , BER_CLASS_UNI, BER_UNI_TAG_INTEGER, BER_FLAGS_NOOWNTAG, dissect_tcap_INTEGER },
{ 1, &hf_tcap_globalValue , BER_CLASS_UNI, BER_UNI_TAG_OID, BER_FLAGS_NOOWNTAG, dissect_tcap_OBJECT_IDENTIFIER },
{ 0, NULL, 0, 0, 0, NULL }
};
static int
dissect_tcap_OPERATION(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
offset = dissect_ber_choice(actx, tree, tvb, offset,
OPERATION_choice, hf_index, ett_tcap_OPERATION,
NULL);
return offset;
}
static int
dissect_tcap_Parameter(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
#line 74 "../../asn1/tcap/tcap.cnf"
offset = dissect_tcap_param(actx,tree,tvb,offset);
return offset;
}
static const ber_sequence_t Invoke_sequence[] = {
{ &hf_tcap_invokeID , BER_CLASS_UNI, BER_UNI_TAG_INTEGER, BER_FLAGS_NOOWNTAG, dissect_tcap_InvokeIdType },
{ &hf_tcap_linkedID , BER_CLASS_CON, 0, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_tcap_InvokeIdType },
{ &hf_tcap_opCode , BER_CLASS_ANY/*choice*/, -1/*choice*/, BER_FLAGS_NOOWNTAG|BER_FLAGS_NOTCHKTAG, dissect_tcap_OPERATION },
{ &hf_tcap_parameter , BER_CLASS_ANY, 0, BER_FLAGS_OPTIONAL|BER_FLAGS_NOOWNTAG, dissect_tcap_Parameter },
{ NULL, 0, 0, 0, NULL }
};
static int
dissect_tcap_Invoke(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset,
Invoke_sequence, hf_index, ett_tcap_Invoke);
return offset;
}
static const ber_sequence_t T_resultretres_sequence[] = {
{ &hf_tcap_opCode , BER_CLASS_ANY/*choice*/, -1/*choice*/, BER_FLAGS_NOOWNTAG|BER_FLAGS_NOTCHKTAG, dissect_tcap_OPERATION },
{ &hf_tcap_parameter , BER_CLASS_ANY, 0, BER_FLAGS_OPTIONAL|BER_FLAGS_NOOWNTAG, dissect_tcap_Parameter },
{ NULL, 0, 0, 0, NULL }
};
static int
dissect_tcap_T_resultretres(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset,
T_resultretres_sequence, hf_index, ett_tcap_T_resultretres);
return offset;
}
static const ber_sequence_t ReturnResult_sequence[] = {
{ &hf_tcap_invokeID , BER_CLASS_UNI, BER_UNI_TAG_INTEGER, BER_FLAGS_NOOWNTAG, dissect_tcap_InvokeIdType },
{ &hf_tcap_resultretres , BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_OPTIONAL|BER_FLAGS_NOOWNTAG, dissect_tcap_T_resultretres },
{ NULL, 0, 0, 0, NULL }
};
static int
dissect_tcap_ReturnResult(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset,
ReturnResult_sequence, hf_index, ett_tcap_ReturnResult);
return offset;
}
static int
dissect_tcap_INTEGER_M32768_32767(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
offset = dissect_ber_integer(implicit_tag, actx, tree, tvb, offset, hf_index,
NULL);
return offset;
}
static const value_string tcap_ErrorCode_vals[] = {
{ 19, "nationaler" },
{ 20, "privateer" },
{ 0, NULL }
};
static const ber_choice_t ErrorCode_choice[] = {
{ 19, &hf_tcap_nationaler , BER_CLASS_PRI, 19, BER_FLAGS_IMPLTAG, dissect_tcap_INTEGER_M32768_32767 },
{ 20, &hf_tcap_privateer , BER_CLASS_PRI, 20, BER_FLAGS_IMPLTAG, dissect_tcap_INTEGER },
{ 0, NULL, 0, 0, 0, NULL }
};
static int
dissect_tcap_ErrorCode(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
offset = dissect_ber_choice(actx, tree, tvb, offset,
ErrorCode_choice, hf_index, ett_tcap_ErrorCode,
NULL);
return offset;
}
static const ber_sequence_t ReturnError_sequence[] = {
{ &hf_tcap_invokeID , BER_CLASS_UNI, BER_UNI_TAG_INTEGER, BER_FLAGS_NOOWNTAG, dissect_tcap_InvokeIdType },
{ &hf_tcap_errorCode , BER_CLASS_ANY/*choice*/, -1/*choice*/, BER_FLAGS_NOOWNTAG|BER_FLAGS_NOTCHKTAG, dissect_tcap_ErrorCode },
{ &hf_tcap_parameter , BER_CLASS_ANY, 0, BER_FLAGS_OPTIONAL|BER_FLAGS_NOOWNTAG, dissect_tcap_Parameter },
{ NULL, 0, 0, 0, NULL }
};
static int
dissect_tcap_ReturnError(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset,
ReturnError_sequence, hf_index, ett_tcap_ReturnError);
return offset;
}
static int
dissect_tcap_NULL(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
offset = dissect_ber_null(implicit_tag, actx, tree, tvb, offset, hf_index);
return offset;
}
static const value_string tcap_T_invokeIDRej_vals[] = {
{ 0, "derivable" },
{ 1, "not-derivable" },
{ 0, NULL }
};
static const ber_choice_t T_invokeIDRej_choice[] = {
{ 0, &hf_tcap_derivable , BER_CLASS_UNI, BER_UNI_TAG_INTEGER, BER_FLAGS_NOOWNTAG, dissect_tcap_InvokeIdType },
{ 1, &hf_tcap_not_derivable , BER_CLASS_UNI, BER_UNI_TAG_NULL, BER_FLAGS_NOOWNTAG, dissect_tcap_NULL },
{ 0, NULL, 0, 0, 0, NULL }
};
static int
dissect_tcap_T_invokeIDRej(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
offset = dissect_ber_choice(actx, tree, tvb, offset,
T_invokeIDRej_choice, hf_index, ett_tcap_T_invokeIDRej,
NULL);
return offset;
}
static const value_string tcap_GeneralProblem_vals[] = {
{ 0, "unrecognizedComponent" },
{ 1, "mistypedComponent" },
{ 2, "badlyStructuredComponent" },
{ 0, NULL }
};
static int
dissect_tcap_GeneralProblem(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
offset = dissect_ber_integer(implicit_tag, actx, tree, tvb, offset, hf_index,
NULL);
return offset;
}
static const value_string tcap_InvokeProblem_vals[] = {
{ 0, "duplicateInvokeID" },
{ 1, "unrecognizedOperation" },
{ 2, "mistypedParameter" },
{ 3, "resourceLimitation" },
{ 4, "initiatingRelease" },
{ 5, "unrecognizedLinkedID" },
{ 6, "linkedResponseUnexpected" },
{ 7, "unexpectedLinkedOperation" },
{ 0, NULL }
};
static int
dissect_tcap_InvokeProblem(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
offset = dissect_ber_integer(implicit_tag, actx, tree, tvb, offset, hf_index,
NULL);
return offset;
}
static const value_string tcap_ReturnResultProblem_vals[] = {
{ 0, "unrecognizedInvokeID" },
{ 1, "returnResultUnexpected" },
{ 2, "mistypedParameter" },
{ 0, NULL }
};
static int
dissect_tcap_ReturnResultProblem(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
offset = dissect_ber_integer(implicit_tag, actx, tree, tvb, offset, hf_index,
NULL);
return offset;
}
static const value_string tcap_ReturnErrorProblem_vals[] = {
{ 0, "unrecognizedInvokeID" },
{ 1, "returnErrorUnexpected" },
{ 2, "unrecognizedError" },
{ 3, "unexpectedError" },
{ 4, "mistypedParameter" },
{ 0, NULL }
};
static int
dissect_tcap_ReturnErrorProblem(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
offset = dissect_ber_integer(implicit_tag, actx, tree, tvb, offset, hf_index,
NULL);
return offset;
}
static const value_string tcap_T_problem_vals[] = {
{ 0, "generalProblem" },
{ 1, "invokeProblem" },
{ 2, "returnResultProblem" },
{ 3, "returnErrorProblem" },
{ 0, NULL }
};
static const ber_choice_t T_problem_choice[] = {
{ 0, &hf_tcap_generalProblem , BER_CLASS_CON, 0, BER_FLAGS_IMPLTAG, dissect_tcap_GeneralProblem },
{ 1, &hf_tcap_invokeProblem , BER_CLASS_CON, 1, BER_FLAGS_IMPLTAG, dissect_tcap_InvokeProblem },
{ 2, &hf_tcap_returnResultProblem, BER_CLASS_CON, 2, BER_FLAGS_IMPLTAG, dissect_tcap_ReturnResultProblem },
{ 3, &hf_tcap_returnErrorProblem, BER_CLASS_CON, 3, BER_FLAGS_IMPLTAG, dissect_tcap_ReturnErrorProblem },
{ 0, NULL, 0, 0, 0, NULL }
};
static int
dissect_tcap_T_problem(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
offset = dissect_ber_choice(actx, tree, tvb, offset,
T_problem_choice, hf_index, ett_tcap_T_problem,
NULL);
return offset;
}
static const ber_sequence_t Reject_sequence[] = {
{ &hf_tcap_invokeIDRej , BER_CLASS_ANY/*choice*/, -1/*choice*/, BER_FLAGS_NOOWNTAG|BER_FLAGS_NOTCHKTAG, dissect_tcap_T_invokeIDRej },
{ &hf_tcap_problem , BER_CLASS_ANY/*choice*/, -1/*choice*/, BER_FLAGS_NOOWNTAG|BER_FLAGS_NOTCHKTAG, dissect_tcap_T_problem },
{ NULL, 0, 0, 0, NULL }
};
static int
dissect_tcap_Reject(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset,
Reject_sequence, hf_index, ett_tcap_Reject);
return offset;
}
static const value_string tcap_Component_vals[] = {
{ 1, "invoke" },
{ 2, "returnResultLast" },
{ 3, "returnError" },
{ 4, "reject" },
{ 7, "returnResultNotLast" },
{ 0, NULL }
};
static const ber_choice_t Component_choice[] = {
{ 1, &hf_tcap_invoke , BER_CLASS_CON, 1, BER_FLAGS_IMPLTAG, dissect_tcap_Invoke },
{ 2, &hf_tcap_returnResultLast, BER_CLASS_CON, 2, BER_FLAGS_IMPLTAG, dissect_tcap_ReturnResult },
{ 3, &hf_tcap_returnError , BER_CLASS_CON, 3, BER_FLAGS_IMPLTAG, dissect_tcap_ReturnError },
{ 4, &hf_tcap_reject , BER_CLASS_CON, 4, BER_FLAGS_IMPLTAG, dissect_tcap_Reject },
{ 7, &hf_tcap_returnResultNotLast, BER_CLASS_CON, 7, BER_FLAGS_IMPLTAG, dissect_tcap_ReturnResult },
{ 0, NULL, 0, 0, 0, NULL }
};
static int
dissect_tcap_Component(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
#line 79 "../../asn1/tcap/tcap.cnf"
tvbuff_t *next_tvb;
gint8 ber_class;
gboolean pc;
gint tag;
guint32 len, comp_offset;
gint ind_field;
comp_offset = dissect_ber_identifier(actx->pinfo, tree, tvb, offset, &ber_class, &pc, &tag);
comp_offset = dissect_ber_length(actx->pinfo, tree, tvb, comp_offset, &len, &ind_field);
/* we can believe the length now */
next_tvb = tvb_new_subset(tvb, offset, len+comp_offset-offset, len+comp_offset-offset);
if (!next_tvb)
return comp_offset;
TRY {
offset = dissect_ber_choice(actx, tree, tvb, offset,
Component_choice, hf_index, ett_tcap_Component,
NULL);
}
CATCH(BoundsError) {
RETHROW;
}
CATCH(ReportedBoundsError) {
show_reported_bounds_error(tvb, actx->pinfo, tree);
}
ENDTRY;
dissect_tcap_ITU_ComponentPDU(implicit_tag, next_tvb, 0, actx, tcap_top_tree, hf_index);
/* return comp_offset+len; or return offset (will be automatically added) */
return offset;
}
static const ber_sequence_t SEQUENCE_SIZE_1_MAX_OF_Component_sequence_of[1] = {
{ &hf_tcap__untag_item , BER_CLASS_ANY/*choice*/, -1/*choice*/, BER_FLAGS_NOOWNTAG|BER_FLAGS_NOTCHKTAG, dissect_tcap_Component },
};
static int
dissect_tcap_SEQUENCE_SIZE_1_MAX_OF_Component(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
offset = dissect_ber_sequence_of(implicit_tag, actx, tree, tvb, offset,
SEQUENCE_SIZE_1_MAX_OF_Component_sequence_of, hf_index, ett_tcap_SEQUENCE_SIZE_1_MAX_OF_Component);
return offset;
}
static int
dissect_tcap_ComponentPortion(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
offset = dissect_ber_tagged_type(implicit_tag, actx, tree, tvb, offset,
hf_index, BER_CLASS_APP, 12, TRUE, dissect_tcap_SEQUENCE_SIZE_1_MAX_OF_Component);
return offset;
}
static const ber_sequence_t Unidirectional_sequence[] = {
{ &hf_tcap_dialoguePortion, BER_CLASS_APP, 11, BER_FLAGS_OPTIONAL|BER_FLAGS_NOOWNTAG, dissect_tcap_DialoguePortion },
{ &hf_tcap_components , BER_CLASS_APP, 12, BER_FLAGS_NOOWNTAG, dissect_tcap_ComponentPortion },
{ NULL, 0, 0, 0, NULL }
};
static int
dissect_tcap_Unidirectional(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset,
Unidirectional_sequence, hf_index, ett_tcap_Unidirectional);
return offset;
}
static int
dissect_tcap_OCTET_STRING_SIZE_1_4(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
offset = dissect_ber_octet_string(implicit_tag, actx, tree, tvb, offset, hf_index,
NULL);
return offset;
}
static int
dissect_tcap_OrigTransactionID(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
#line 126 "../../asn1/tcap/tcap.cnf"
tvbuff_t *parameter_tvb;
guint8 len, i;
proto_item *tid_item;
proto_tree *subtree;
tid_item = proto_tree_add_text(tree, tvb, offset, -1, "Source Transaction ID");
subtree = proto_item_add_subtree(tid_item, ett_otid);
dissect_ber_octet_string(implicit_tag, actx, subtree, tvb, offset, hf_tcap_tid, NULL);
PROTO_ITEM_SET_HIDDEN(actx->created_item);
offset = dissect_ber_octet_string(implicit_tag, actx, subtree, tvb, offset, hf_tcap_otid,
¶meter_tvb);
if (parameter_tvb){
len = tvb_length_remaining(parameter_tvb, 0);
switch(len) {
case 1:
gp_tcapsrt_info->src_tid=tvb_get_guint8(parameter_tvb, 0);
break;
case 2:
gp_tcapsrt_info->src_tid=tvb_get_ntohs(parameter_tvb, 0);
break;
case 4:
gp_tcapsrt_info->src_tid=tvb_get_ntohl(parameter_tvb, 0);
break;
default:
gp_tcapsrt_info->src_tid=0;
break;
}
if (len){
col_append_str(actx->pinfo->cinfo, COL_INFO, "otid(");
for(i=0;i<len;i++)
col_append_fstr(actx->pinfo->cinfo, COL_INFO, "%02x",tvb_get_guint8(parameter_tvb,i));
col_append_str(actx->pinfo->cinfo, COL_INFO, ") ");
}
}
return offset;
}
static const ber_sequence_t Begin_sequence[] = {
{ &hf_tcap_otid , BER_CLASS_APP, 8, BER_FLAGS_NOOWNTAG, dissect_tcap_OrigTransactionID },
{ &hf_tcap_dialoguePortion, BER_CLASS_APP, 11, BER_FLAGS_OPTIONAL|BER_FLAGS_NOOWNTAG, dissect_tcap_DialoguePortion },
{ &hf_tcap_components , BER_CLASS_APP, 12, BER_FLAGS_OPTIONAL|BER_FLAGS_NOOWNTAG, dissect_tcap_ComponentPortion },
{ NULL, 0, 0, 0, NULL }
};
static int
dissect_tcap_Begin(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
#line 204 "../../asn1/tcap/tcap.cnf"
gp_tcapsrt_info->ope=TC_BEGIN;
/* Do not change col_add_str() to col_append_str() here: we _want_ this call
* to overwrite whatever's currently in the INFO column (e.g., "UDT" from
* the SCCP dissector).
*
* If there's something there that should not be overwritten, whoever
* put that info there should call col_set_fence() to protect it.
*/
col_set_str(actx->pinfo->cinfo, COL_INFO, "Begin ");
offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset,
Begin_sequence, hf_index, ett_tcap_Begin);
return offset;
}
static int
dissect_tcap_DestTransactionID(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
#line 167 "../../asn1/tcap/tcap.cnf"
tvbuff_t *parameter_tvb;
guint8 len , i;
proto_item *tid_item;
proto_tree *subtree;
tid_item = proto_tree_add_text(tree, tvb, offset, -1, "Destination Transaction ID");
subtree = proto_item_add_subtree(tid_item, ett_dtid);
dissect_ber_octet_string(implicit_tag, actx, subtree, tvb, offset, hf_tcap_tid, NULL);
PROTO_ITEM_SET_HIDDEN(actx->created_item);
offset = dissect_ber_octet_string(implicit_tag, actx, subtree, tvb, offset, hf_tcap_dtid,
¶meter_tvb);
if (parameter_tvb){
len = tvb_length_remaining(parameter_tvb, 0);
switch(len) {
case 1:
gp_tcapsrt_info->dst_tid=tvb_get_guint8(parameter_tvb, 0);
break;
case 2:
gp_tcapsrt_info->dst_tid=tvb_get_ntohs(parameter_tvb, 0);
break;
case 4:
gp_tcapsrt_info->dst_tid=tvb_get_ntohl(parameter_tvb, 0);
break;
default:
gp_tcapsrt_info->dst_tid=0;
break;
}
if (len){
col_append_str(actx->pinfo->cinfo, COL_INFO, "dtid(");
for(i=0;i<len;i++)
col_append_fstr(actx->pinfo->cinfo, COL_INFO, "%02x",tvb_get_guint8(parameter_tvb,i));
col_append_str(actx->pinfo->cinfo, COL_INFO, ") ");
}
}
return offset;
}
static const ber_sequence_t End_sequence[] = {
{ &hf_tcap_dtid , BER_CLASS_APP, 9, BER_FLAGS_NOOWNTAG, dissect_tcap_DestTransactionID },
{ &hf_tcap_dialoguePortion, BER_CLASS_APP, 11, BER_FLAGS_OPTIONAL|BER_FLAGS_NOOWNTAG, dissect_tcap_DialoguePortion },
{ &hf_tcap_components , BER_CLASS_APP, 12, BER_FLAGS_OPTIONAL|BER_FLAGS_NOOWNTAG, dissect_tcap_ComponentPortion },
{ NULL, 0, 0, 0, NULL }
};
static int
dissect_tcap_End(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
#line 218 "../../asn1/tcap/tcap.cnf"
gp_tcapsrt_info->ope=TC_END;
col_set_str(actx->pinfo->cinfo, COL_INFO, "End ");
offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset,
End_sequence, hf_index, ett_tcap_End);
return offset;
}
static const ber_sequence_t Continue_sequence[] = {
{ &hf_tcap_otid , BER_CLASS_APP, 8, BER_FLAGS_NOOWNTAG, dissect_tcap_OrigTransactionID },
{ &hf_tcap_dtid , BER_CLASS_APP, 9, BER_FLAGS_NOOWNTAG, dissect_tcap_DestTransactionID },
{ &hf_tcap_dialoguePortion, BER_CLASS_APP, 11, BER_FLAGS_OPTIONAL|BER_FLAGS_NOOWNTAG, dissect_tcap_DialoguePortion },
{ &hf_tcap_components , BER_CLASS_APP, 12, BER_FLAGS_OPTIONAL|BER_FLAGS_NOOWNTAG, dissect_tcap_ComponentPortion },
{ NULL, 0, 0, 0, NULL }
};
static int
dissect_tcap_Continue(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
#line 225 "../../asn1/tcap/tcap.cnf"
gp_tcapsrt_info->ope=TC_CONT;
col_set_str(actx->pinfo->cinfo, COL_INFO, "Continue ");
offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset,
Continue_sequence, hf_index, ett_tcap_Continue);
return offset;
}
static const value_string tcap_P_AbortCause_U_vals[] = {
{ 0, "unrecognizedMessageType" },
{ 1, "unrecognizedTransactionID" },
{ 2, "badlyFormattedTransactionPortion" },
{ 3, "incorrectTransactionPortion" },
{ 4, "resourceLimitation" },
{ 0, NULL }
};
static int
dissect_tcap_P_AbortCause_U(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
offset = dissect_ber_integer(implicit_tag, actx, tree, tvb, offset, hf_index,
NULL);
return offset;
}
static int
dissect_tcap_P_AbortCause(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
offset = dissect_ber_tagged_type(implicit_tag, actx, tree, tvb, offset,
hf_index, BER_CLASS_APP, 10, TRUE, dissect_tcap_P_AbortCause_U);
return offset;
}
static const value_string tcap_Reason_vals[] = {
{ 10, "p-abortCause" },
{ 11, "u-abortCause" },
{ 0, NULL }
};
static const ber_choice_t Reason_choice[] = {
{ 10, &hf_tcap_p_abortCause , BER_CLASS_APP, 10, BER_FLAGS_NOOWNTAG, dissect_tcap_P_AbortCause },
{ 11, &hf_tcap_u_abortCause , BER_CLASS_APP, 11, BER_FLAGS_NOOWNTAG, dissect_tcap_DialoguePortion },
{ 0, NULL, 0, 0, 0, NULL }
};
static int
dissect_tcap_Reason(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
offset = dissect_ber_choice(actx, tree, tvb, offset,
Reason_choice, hf_index, ett_tcap_Reason,
NULL);
return offset;
}
static const ber_sequence_t Abort_sequence[] = {
{ &hf_tcap_dtid , BER_CLASS_APP, 9, BER_FLAGS_NOOWNTAG, dissect_tcap_DestTransactionID },
{ &hf_tcap_reason , BER_CLASS_ANY/*choice*/, -1/*choice*/, BER_FLAGS_OPTIONAL|BER_FLAGS_NOOWNTAG|BER_FLAGS_NOTCHKTAG, dissect_tcap_Reason },
{ NULL, 0, 0, 0, NULL }
};
static int
dissect_tcap_Abort(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
#line 232 "../../asn1/tcap/tcap.cnf"
gp_tcapsrt_info->ope=TC_ABORT;
col_set_str(actx->pinfo->cinfo, COL_INFO, "Abort ");
offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset,
Abort_sequence, hf_index, ett_tcap_Abort);
return offset;
}
static const value_string tcap_TCMessage_vals[] = {
{ 1, "unidirectional" },
{ 2, "begin" },
{ 4, "end" },
{ 5, "continue" },
{ 7, "abort" },
{ 0, NULL }
};
static const ber_choice_t TCMessage_choice[] = {
{ 1, &hf_tcap_unidirectional , BER_CLASS_APP, 1, BER_FLAGS_IMPLTAG, dissect_tcap_Unidirectional },
{ 2, &hf_tcap_begin , BER_CLASS_APP, 2, BER_FLAGS_IMPLTAG, dissect_tcap_Begin },
{ 4, &hf_tcap_end , BER_CLASS_APP, 4, BER_FLAGS_IMPLTAG, dissect_tcap_End },
{ 5, &hf_tcap_continue , BER_CLASS_APP, 5, BER_FLAGS_IMPLTAG, dissect_tcap_Continue },
{ 7, &hf_tcap_abort , BER_CLASS_APP, 7, BER_FLAGS_IMPLTAG, dissect_tcap_Abort },
{ 0, NULL, 0, 0, 0, NULL }
};
static int
dissect_tcap_TCMessage(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
offset = dissect_ber_choice(actx, tree, tvb, offset,
TCMessage_choice, hf_index, ett_tcap_TCMessage,
NULL);
return offset;
}
static const value_string tcap_ERROR_vals[] = {
{ 0, "localValue" },
{ 1, "globalValue" },
{ 0, NULL }
};
static const ber_choice_t ERROR_choice[] = {
{ 0, &hf_tcap_localValue , BER_CLASS_UNI, BER_UNI_TAG_INTEGER, BER_FLAGS_NOOWNTAG, dissect_tcap_INTEGER },
{ 1, &hf_tcap_globalValue , BER_CLASS_UNI, BER_UNI_TAG_OID, BER_FLAGS_NOOWNTAG, dissect_tcap_OBJECT_IDENTIFIER },
{ 0, NULL, 0, 0, 0, NULL }
};
static int
dissect_tcap_ERROR(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
offset = dissect_ber_choice(actx, tree, tvb, offset,
ERROR_choice, hf_index, ett_tcap_ERROR,
NULL);
return offset;
}
static const asn_namedbit AUDT_protocol_version_bits[] = {
{ 0, &hf_tcap_AUDT_protocol_version_version1, -1, -1, "version1", NULL },
{ 0, NULL, 0, 0, NULL, NULL }
};
static int
dissect_tcap_AUDT_protocol_version(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
offset = dissect_ber_bitstring(implicit_tag, actx, tree, tvb, offset,
AUDT_protocol_version_bits, hf_index, ett_tcap_AUDT_protocol_version,
NULL);
return offset;
}
static int
dissect_tcap_AUDT_application_context_name(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
#line 111 "../../asn1/tcap/tcap.cnf"
offset = dissect_ber_object_identifier_str(implicit_tag, actx, tree, tvb, offset, hf_index, &cur_oid);
tcap_private.oid= (void*) cur_oid;
tcap_private.acv=TRUE;
return offset;
}
static int
dissect_tcap_EXTERNAL(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
offset = dissect_ber_external_type(implicit_tag, tree, tvb, offset, actx, hf_index, NULL);
return offset;
}
static const ber_sequence_t AUDT_user_information_sequence_of[1] = {
{ &hf_tcap_audt_user_information_item, BER_CLASS_UNI, BER_UNI_TAG_EXTERNAL, BER_FLAGS_NOOWNTAG, dissect_tcap_EXTERNAL },
};
static int
dissect_tcap_AUDT_user_information(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
offset = dissect_ber_sequence_of(implicit_tag, actx, tree, tvb, offset,
AUDT_user_information_sequence_of, hf_index, ett_tcap_AUDT_user_information);
return offset;
}
static const ber_sequence_t AUDT_apdu_U_sequence[] = {
{ &hf_tcap_audt_protocol_version, BER_CLASS_CON, 0, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_tcap_AUDT_protocol_version },
{ &hf_tcap_audt_application_context_name, BER_CLASS_CON, 1, 0, dissect_tcap_AUDT_application_context_name },
{ &hf_tcap_audt_user_information, BER_CLASS_CON, 30, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_tcap_AUDT_user_information },
{ NULL, 0, 0, 0, NULL }
};
static int
dissect_tcap_AUDT_apdu_U(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset,
AUDT_apdu_U_sequence, hf_index, ett_tcap_AUDT_apdu_U);
return offset;
}
static int
dissect_tcap_AUDT_apdu(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
offset = dissect_ber_tagged_type(implicit_tag, actx, tree, tvb, offset,
hf_index, BER_CLASS_APP, 0, TRUE, dissect_tcap_AUDT_apdu_U);
return offset;
}
const value_string tcap_UniDialoguePDU_vals[] = {
{ 0, "unidialoguePDU" },
{ 0, NULL }
};
static const ber_choice_t UniDialoguePDU_choice[] = {
{ 0, &hf_tcap_unidialoguePDU , BER_CLASS_APP, 0, BER_FLAGS_NOOWNTAG, dissect_tcap_AUDT_apdu },
{ 0, NULL, 0, 0, 0, NULL }
};
int
dissect_tcap_UniDialoguePDU(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
offset = dissect_ber_choice(actx, tree, tvb, offset,
UniDialoguePDU_choice, hf_index, ett_tcap_UniDialoguePDU,
NULL);
return offset;
}
static const asn_namedbit AARQ_protocol_version_bits[] = {
{ 0, &hf_tcap_AARQ_protocol_version_version1, -1, -1, "version1", NULL },
{ 0, NULL, 0, 0, NULL, NULL }
};
static int
dissect_tcap_AARQ_protocol_version(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
offset = dissect_ber_bitstring(implicit_tag, actx, tree, tvb, offset,
AARQ_protocol_version_bits, hf_index, ett_tcap_AARQ_protocol_version,
NULL);
return offset;
}
static int
dissect_tcap_AARQ_application_context_name(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
#line 116 "../../asn1/tcap/tcap.cnf"
offset = dissect_ber_object_identifier_str(implicit_tag, actx, tree, tvb, offset, hf_index, &cur_oid);
tcap_private.oid= (void*) cur_oid;
tcap_private.acv=TRUE;
return offset;
}
static const ber_sequence_t AARQ_user_information_sequence_of[1] = {
{ &hf_tcap_aarq_user_information_item, BER_CLASS_UNI, BER_UNI_TAG_EXTERNAL, BER_FLAGS_NOOWNTAG, dissect_tcap_EXTERNAL },
};
static int
dissect_tcap_AARQ_user_information(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
offset = dissect_ber_sequence_of(implicit_tag, actx, tree, tvb, offset,
AARQ_user_information_sequence_of, hf_index, ett_tcap_AARQ_user_information);
return offset;
}
static const ber_sequence_t AARQ_apdu_U_sequence[] = {
{ &hf_tcap_aarq_protocol_version, BER_CLASS_CON, 0, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_tcap_AARQ_protocol_version },
{ &hf_tcap_aarq_application_context_name, BER_CLASS_CON, 1, 0, dissect_tcap_AARQ_application_context_name },
{ &hf_tcap_aarq_user_information, BER_CLASS_CON, 30, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_tcap_AARQ_user_information },
{ NULL, 0, 0, 0, NULL }
};
static int
dissect_tcap_AARQ_apdu_U(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset,
AARQ_apdu_U_sequence, hf_index, ett_tcap_AARQ_apdu_U);
return offset;
}
static int
dissect_tcap_AARQ_apdu(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
offset = dissect_ber_tagged_type(implicit_tag, actx, tree, tvb, offset,
hf_index, BER_CLASS_APP, 0, TRUE, dissect_tcap_AARQ_apdu_U);
return offset;
}
static const asn_namedbit AARE_protocol_version_bits[] = {
{ 0, &hf_tcap_AARE_protocol_version_version1, -1, -1, "version1", NULL },
{ 0, NULL, 0, 0, NULL, NULL }
};
static int
dissect_tcap_AARE_protocol_version(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
offset = dissect_ber_bitstring(implicit_tag, actx, tree, tvb, offset,
AARE_protocol_version_bits, hf_index, ett_tcap_AARE_protocol_version,
NULL);
return offset;
}
static int
dissect_tcap_AARE_application_context_name(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
#line 121 "../../asn1/tcap/tcap.cnf"
offset = dissect_ber_object_identifier_str(implicit_tag, actx, tree, tvb, offset, hf_index, &cur_oid);
tcap_private.oid= (void*) cur_oid;
tcap_private.acv=TRUE;
return offset;
}
static const value_string tcap_Associate_result_vals[] = {
{ 0, "accepted" },
{ 1, "reject-permanent" },
{ 0, NULL }
};
static int
dissect_tcap_Associate_result(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
offset = dissect_ber_integer(implicit_tag, actx, tree, tvb, offset, hf_index,
NULL);
return offset;
}
static const value_string tcap_T_dialogue_service_user_vals[] = {
{ 0, "null" },
{ 1, "no-reason-given" },
{ 2, "application-context-name-not-supported" },
{ 0, NULL }
};
static int
dissect_tcap_T_dialogue_service_user(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
offset = dissect_ber_integer(implicit_tag, actx, tree, tvb, offset, hf_index,
NULL);
return offset;
}
static const value_string tcap_T_dialogue_service_provider_vals[] = {
{ 0, "null" },
{ 1, "no-reason-given" },
{ 2, "no-common-dialogue-portion" },
{ 0, NULL }
};
static int
dissect_tcap_T_dialogue_service_provider(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
offset = dissect_ber_integer(implicit_tag, actx, tree, tvb, offset, hf_index,
NULL);
return offset;
}
static const value_string tcap_Associate_source_diagnostic_vals[] = {
{ 1, "dialogue-service-user" },
{ 2, "dialogue-service-provider" },
{ 0, NULL }
};
static const ber_choice_t Associate_source_diagnostic_choice[] = {
{ 1, &hf_tcap_dialogue_service_user, BER_CLASS_CON, 1, 0, dissect_tcap_T_dialogue_service_user },
{ 2, &hf_tcap_dialogue_service_provider, BER_CLASS_CON, 2, 0, dissect_tcap_T_dialogue_service_provider },
{ 0, NULL, 0, 0, 0, NULL }
};
static int
dissect_tcap_Associate_source_diagnostic(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
offset = dissect_ber_choice(actx, tree, tvb, offset,
Associate_source_diagnostic_choice, hf_index, ett_tcap_Associate_source_diagnostic,
NULL);
return offset;
}
static const ber_sequence_t AARE_user_information_sequence_of[1] = {
{ &hf_tcap_aare_user_information_item, BER_CLASS_UNI, BER_UNI_TAG_EXTERNAL, BER_FLAGS_NOOWNTAG, dissect_tcap_EXTERNAL },
};
static int
dissect_tcap_AARE_user_information(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
offset = dissect_ber_sequence_of(implicit_tag, actx, tree, tvb, offset,
AARE_user_information_sequence_of, hf_index, ett_tcap_AARE_user_information);
return offset;
}
static const ber_sequence_t AARE_apdu_U_sequence[] = {
{ &hf_tcap_aare_protocol_version, BER_CLASS_CON, 0, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_tcap_AARE_protocol_version },
{ &hf_tcap_aare_application_context_name, BER_CLASS_CON, 1, 0, dissect_tcap_AARE_application_context_name },
{ &hf_tcap_result , BER_CLASS_CON, 2, 0, dissect_tcap_Associate_result },
{ &hf_tcap_result_source_diagnostic, BER_CLASS_CON, 3, BER_FLAGS_NOTCHKTAG, dissect_tcap_Associate_source_diagnostic },
{ &hf_tcap_aare_user_information, BER_CLASS_CON, 30, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_tcap_AARE_user_information },
{ NULL, 0, 0, 0, NULL }
};
static int
dissect_tcap_AARE_apdu_U(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset,
AARE_apdu_U_sequence, hf_index, ett_tcap_AARE_apdu_U);
return offset;
}
static int
dissect_tcap_AARE_apdu(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
offset = dissect_ber_tagged_type(implicit_tag, actx, tree, tvb, offset,
hf_index, BER_CLASS_APP, 1, TRUE, dissect_tcap_AARE_apdu_U);
return offset;
}
static const value_string tcap_ABRT_source_vals[] = {
{ 0, "dialogue-service-user" },
{ 1, "dialogue-service-provider" },
{ 0, NULL }
};
static int
dissect_tcap_ABRT_source(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
offset = dissect_ber_integer(implicit_tag, actx, tree, tvb, offset, hf_index,
NULL);
return offset;
}
static const ber_sequence_t ABRT_user_information_sequence_of[1] = {
{ &hf_tcap_abrt_user_information_item, BER_CLASS_UNI, BER_UNI_TAG_EXTERNAL, BER_FLAGS_NOOWNTAG, dissect_tcap_EXTERNAL },
};
static int
dissect_tcap_ABRT_user_information(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
offset = dissect_ber_sequence_of(implicit_tag, actx, tree, tvb, offset,
ABRT_user_information_sequence_of, hf_index, ett_tcap_ABRT_user_information);
return offset;
}
static const ber_sequence_t ABRT_apdu_U_sequence[] = {
{ &hf_tcap_abort_source , BER_CLASS_CON, 0, BER_FLAGS_IMPLTAG, dissect_tcap_ABRT_source },
{ &hf_tcap_abrt_user_information, BER_CLASS_CON, 30, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_tcap_ABRT_user_information },
{ NULL, 0, 0, 0, NULL }
};
static int
dissect_tcap_ABRT_apdu_U(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset,
ABRT_apdu_U_sequence, hf_index, ett_tcap_ABRT_apdu_U);
return offset;
}
static int
dissect_tcap_ABRT_apdu(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
offset = dissect_ber_tagged_type(implicit_tag, actx, tree, tvb, offset,
hf_index, BER_CLASS_APP, 4, TRUE, dissect_tcap_ABRT_apdu_U);
return offset;
}
const value_string tcap_DialoguePDU_vals[] = {
{ 0, "dialogueRequest" },
{ 1, "dialogueResponse" },
{ 4, "dialogueAbort" },
{ 0, NULL }
};
static const ber_choice_t DialoguePDU_choice[] = {
{ 0, &hf_tcap_dialogueRequest, BER_CLASS_APP, 0, BER_FLAGS_NOOWNTAG, dissect_tcap_AARQ_apdu },
{ 1, &hf_tcap_dialogueResponse, BER_CLASS_APP, 1, BER_FLAGS_NOOWNTAG, dissect_tcap_AARE_apdu },
{ 4, &hf_tcap_dialogueAbort , BER_CLASS_APP, 4, BER_FLAGS_NOOWNTAG, dissect_tcap_ABRT_apdu },
{ 0, NULL, 0, 0, 0, NULL }
};
int
dissect_tcap_DialoguePDU(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
offset = dissect_ber_choice(actx, tree, tvb, offset,
DialoguePDU_choice, hf_index, ett_tcap_DialoguePDU,
NULL);
return offset;
}
/*--- PDUs ---*/
static void dissect_UniDialoguePDU_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_) {
asn1_ctx_t asn1_ctx;
asn1_ctx_init(&asn1_ctx, ASN1_ENC_BER, TRUE, pinfo);
dissect_tcap_UniDialoguePDU(FALSE, tvb, 0, &asn1_ctx, tree, hf_tcap_UniDialoguePDU_PDU);
}
static void dissect_DialoguePDU_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_) {
asn1_ctx_t asn1_ctx;
asn1_ctx_init(&asn1_ctx, ASN1_ENC_BER, TRUE, pinfo);
dissect_tcap_DialoguePDU(FALSE, tvb, 0, &asn1_ctx, tree, hf_tcap_DialoguePDU_PDU);
}
/*--- End of included file: packet-tcap-fn.c ---*/
#line 142 "../../asn1/tcap/packet-tcap-template.c"
const value_string tcap_component_type_str[] = {
{ TCAP_COMP_INVOKE, "Invoke" },
{ TCAP_COMP_RRL, "Return Result(L)" },
{ TCAP_COMP_RE, "Return Error" },
{ TCAP_COMP_REJECT, "Reject" },
{ TCAP_COMP_RRN, "Return Result(NL)" },
{ 0, NULL } };
static void
dissect_tcap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree)
{
proto_item *item=NULL;
proto_tree *tree=NULL;
struct tcaphash_context_t * p_tcap_context;
dissector_handle_t subdissector_handle;
asn1_ctx_t asn1_ctx;
gint8 ber_class;
gboolean pc;
gint tag;
/* Check if ANSI TCAP and call the ANSI TCAP dissector if that's the case
* PackageType ::= CHOICE { unidirectional [PRIVATE 1] IMPLICIT UniTransactionPDU,
* queryWithPerm [PRIVATE 2] IMPLICIT TransactionPDU,
* queryWithoutPerm [PRIVATE 3] IMPLICIT TransactionPDU,
* response [PRIVATE 4] IMPLICIT TransactionPDU,
* conversationWithPerm [PRIVATE 5] IMPLICIT TransactionPDU,
* conversationWithoutPerm [PRIVATE 6] IMPLICIT TransactionPDU,
* abort [PRIVATE 22] IMPLICIT Abort
* }
*
*
*/
get_ber_identifier(tvb, 0, &ber_class, &pc, &tag);
if(ber_class == BER_CLASS_PRI){
switch(tag){
case 1:
case 2:
case 3:
case 4:
case 5:
case 6:
case 22:
call_dissector(ansi_tcap_handle, tvb, pinfo, parent_tree);
return;
break;
default:
return;
}
}
/* ITU TCAP */
asn1_ctx_init(&asn1_ctx, ASN1_ENC_BER, TRUE, pinfo);
tcap_top_tree = parent_tree;
tcap_stat_tree = NULL;
col_set_str(pinfo->cinfo, COL_PROTOCOL, "TCAP");
/* create display subtree for the protocol */
if(parent_tree){
item = proto_tree_add_item(parent_tree, proto_tcap, tvb, 0, -1, ENC_NA);
tree = proto_item_add_subtree(item, ett_tcap);
tcap_stat_tree=tree;
}
cur_oid = NULL;
tcapext_oid = NULL;
raz_tcap_private(&tcap_private);
pinfo->private_data = &tcap_private;
gp_tcapsrt_info=tcapsrt_razinfo();
tcap_subdissector_used=FALSE;
gp_tcap_context=NULL;
dissect_tcap_TCMessage(FALSE, tvb, 0, &asn1_ctx, tree, -1);
if (gtcap_HandleSRT && !tcap_subdissector_used ) {
p_tcap_context=tcapsrt_call_matching(tvb, pinfo, tcap_stat_tree, gp_tcapsrt_info);
tcap_private.context=p_tcap_context;
/* If the current message is TCAP only,
* save the Application Context Name for the next messages
*/
if ( p_tcap_context && cur_oid && !p_tcap_context->oid_present ) {
/* Save the application context and the sub dissector */
g_strlcpy(p_tcap_context->oid, cur_oid, sizeof(p_tcap_context->oid));
p_tcap_context->oid_present=TRUE;
if ( (subdissector_handle = dissector_get_string_handle(ber_oid_dissector_table, cur_oid)) ) {
p_tcap_context->subdissector_handle=subdissector_handle;
p_tcap_context->subdissector_present=TRUE;
}
}
if (gtcap_HandleSRT && p_tcap_context && p_tcap_context->callback) {
/* Callback fonction for the upper layer */
(p_tcap_context->callback)(tvb, pinfo, tcap_stat_tree, p_tcap_context);
}
}
}
void
proto_reg_handoff_tcap(void)
{
data_handle = find_dissector("data");
ansi_tcap_handle = find_dissector("ansi_tcap");
ber_oid_dissector_table = find_dissector_table("ber.oid");
/*--- Included file: packet-tcap-dis-tab.c ---*/
#line 1 "../../asn1/tcap/packet-tcap-dis-tab.c"
register_ber_oid_dissector("0.0.17.773.1.1.1", dissect_DialoguePDU_PDU, proto_tcap, "id-as-dialogue");
register_ber_oid_dissector("0.0.17.773.1.2.1", dissect_UniDialoguePDU_PDU, proto_tcap, "id-as-uniDialogue");
/*--- End of included file: packet-tcap-dis-tab.c ---*/
#line 254 "../../asn1/tcap/packet-tcap-template.c"
}
static void init_tcap(void);
void
proto_register_tcap(void)
{
/* Setup list of header fields See Section 1.6.1 for details*/
static hf_register_info hf[] = {
{ &hf_tcap_tag,
{ "Tag", "tcap.msgtype",
FT_UINT8, BASE_HEX, NULL, 0,
NULL, HFILL }
},
{ &hf_tcap_length,
{ "Length", "tcap.len",
FT_UINT8, BASE_DEC, NULL, 0,
NULL, HFILL }
},
{ &hf_tcap_data,
{ "Data", "tcap.data",
FT_BYTES, BASE_NONE, NULL, 0,
NULL, HFILL }
},
{ &hf_tcap_tid,
{ "Transaction Id", "tcap.tid",
FT_BYTES, BASE_NONE, NULL, 0,
NULL, HFILL }
},
/* Tcap Service Response Time */
{ &hf_tcapsrt_SessionId,
{ "Session Id",
"tcap.srt.session_id",
FT_UINT32, BASE_DEC, NULL, 0x0,
NULL, HFILL }
},
{ &hf_tcapsrt_BeginSession,
{ "Begin Session",
"tcap.srt.begin",
FT_FRAMENUM, BASE_NONE, NULL, 0x0,
"SRT Begin of Session", HFILL }
},
{ &hf_tcapsrt_EndSession,
{ "End Session",
"tcap.srt.end",
FT_FRAMENUM, BASE_NONE, NULL, 0x0,
"SRT End of Session", HFILL }
},
{ &hf_tcapsrt_SessionTime,
{ "Session duration",
"tcap.srt.sessiontime",
FT_RELATIVE_TIME, BASE_NONE, NULL, 0x0,
"Duration of the TCAP session", HFILL }
},
{ &hf_tcapsrt_Duplicate,
{ "Session Duplicate",
"tcap.srt.duplicate",
FT_FRAMENUM, BASE_NONE, NULL, 0x0,
"SRT Duplicated with Session", HFILL }
},
/*--- Included file: packet-tcap-hfarr.c ---*/
#line 1 "../../asn1/tcap/packet-tcap-hfarr.c"
{ &hf_tcap_UniDialoguePDU_PDU,
{ "UniDialoguePDU", "tcap.UniDialoguePDU",
FT_UINT32, BASE_DEC, VALS(tcap_UniDialoguePDU_vals), 0,
NULL, HFILL }},
{ &hf_tcap_DialoguePDU_PDU,
{ "DialoguePDU", "tcap.DialoguePDU",
FT_UINT32, BASE_DEC, VALS(tcap_DialoguePDU_vals), 0,
NULL, HFILL }},
{ &hf_tcap_oid,
{ "oid", "tcap.oid",
FT_OID, BASE_NONE, NULL, 0,
"OBJECT_IDENTIFIER", HFILL }},
{ &hf_tcap_dialog,
{ "dialog", "tcap.dialog",
FT_BYTES, BASE_NONE, NULL, 0,
"Dialog1", HFILL }},
{ &hf_tcap_unidirectional,
{ "unidirectional", "tcap.unidirectional",
FT_NONE, BASE_NONE, NULL, 0,
NULL, HFILL }},
{ &hf_tcap_begin,
{ "begin", "tcap.begin",
FT_NONE, BASE_NONE, NULL, 0,
NULL, HFILL }},
{ &hf_tcap_end,
{ "end", "tcap.end",
FT_NONE, BASE_NONE, NULL, 0,
NULL, HFILL }},
{ &hf_tcap_continue,
{ "continue", "tcap.continue",
FT_NONE, BASE_NONE, NULL, 0,
NULL, HFILL }},
{ &hf_tcap_abort,
{ "abort", "tcap.abort",
FT_NONE, BASE_NONE, NULL, 0,
NULL, HFILL }},
{ &hf_tcap_dialoguePortion,
{ "dialoguePortion", "tcap.dialoguePortion",
FT_BYTES, BASE_NONE, NULL, 0,
NULL, HFILL }},
{ &hf_tcap_components,
{ "components", "tcap.components",
FT_UINT32, BASE_DEC, NULL, 0,
"ComponentPortion", HFILL }},
{ &hf_tcap_otid,
{ "otid", "tcap.otid",
FT_BYTES, BASE_NONE, NULL, 0,
"OrigTransactionID", HFILL }},
{ &hf_tcap_dtid,
{ "dtid", "tcap.dtid",
FT_BYTES, BASE_NONE, NULL, 0,
"DestTransactionID", HFILL }},
{ &hf_tcap_reason,
{ "reason", "tcap.reason",
FT_UINT32, BASE_DEC, VALS(tcap_Reason_vals), 0,
NULL, HFILL }},
{ &hf_tcap_p_abortCause,
{ "p-abortCause", "tcap.p_abortCause",
FT_UINT32, BASE_DEC, VALS(tcap_P_AbortCause_U_vals), 0,
NULL, HFILL }},
{ &hf_tcap_u_abortCause,
{ "u-abortCause", "tcap.u_abortCause",
FT_BYTES, BASE_NONE, NULL, 0,
"DialoguePortion", HFILL }},
{ &hf_tcap__untag_item,
{ "Component", "tcap.Component",
FT_UINT32, BASE_DEC, VALS(tcap_Component_vals), 0,
NULL, HFILL }},
{ &hf_tcap_invoke,
{ "invoke", "tcap.invoke",
FT_NONE, BASE_NONE, NULL, 0,
NULL, HFILL }},
{ &hf_tcap_returnResultLast,
{ "returnResultLast", "tcap.returnResultLast",
FT_NONE, BASE_NONE, NULL, 0,
"ReturnResult", HFILL }},
{ &hf_tcap_returnError,
{ "returnError", "tcap.returnError",
FT_NONE, BASE_NONE, NULL, 0,
NULL, HFILL }},
{ &hf_tcap_reject,
{ "reject", "tcap.reject",
FT_NONE, BASE_NONE, NULL, 0,
NULL, HFILL }},
{ &hf_tcap_returnResultNotLast,
{ "returnResultNotLast", "tcap.returnResultNotLast",
FT_NONE, BASE_NONE, NULL, 0,
"ReturnResult", HFILL }},
{ &hf_tcap_invokeID,
{ "invokeID", "tcap.invokeID",
FT_INT32, BASE_DEC, NULL, 0,
"InvokeIdType", HFILL }},
{ &hf_tcap_linkedID,
{ "linkedID", "tcap.linkedID",
FT_INT32, BASE_DEC, NULL, 0,
"InvokeIdType", HFILL }},
{ &hf_tcap_opCode,
{ "opCode", "tcap.opCode",
FT_UINT32, BASE_DEC, VALS(tcap_OPERATION_vals), 0,
"OPERATION", HFILL }},
{ &hf_tcap_parameter,
{ "parameter", "tcap.parameter",
FT_NONE, BASE_NONE, NULL, 0,
NULL, HFILL }},
{ &hf_tcap_resultretres,
{ "resultretres", "tcap.resultretres",
FT_NONE, BASE_NONE, NULL, 0,
NULL, HFILL }},
{ &hf_tcap_errorCode,
{ "errorCode", "tcap.errorCode",
FT_UINT32, BASE_DEC, VALS(tcap_ErrorCode_vals), 0,
NULL, HFILL }},
{ &hf_tcap_invokeIDRej,
{ "invokeIDRej", "tcap.invokeIDRej",
FT_UINT32, BASE_DEC, VALS(tcap_T_invokeIDRej_vals), 0,
NULL, HFILL }},
{ &hf_tcap_derivable,
{ "derivable", "tcap.derivable",
FT_INT32, BASE_DEC, NULL, 0,
"InvokeIdType", HFILL }},
{ &hf_tcap_not_derivable,
{ "not-derivable", "tcap.not_derivable",
FT_NONE, BASE_NONE, NULL, 0,
NULL, HFILL }},
{ &hf_tcap_problem,
{ "problem", "tcap.problem",
FT_UINT32, BASE_DEC, VALS(tcap_T_problem_vals), 0,
NULL, HFILL }},
{ &hf_tcap_generalProblem,
{ "generalProblem", "tcap.generalProblem",
FT_INT32, BASE_DEC, VALS(tcap_GeneralProblem_vals), 0,
NULL, HFILL }},
{ &hf_tcap_invokeProblem,
{ "invokeProblem", "tcap.invokeProblem",
FT_INT32, BASE_DEC, VALS(tcap_InvokeProblem_vals), 0,
NULL, HFILL }},
{ &hf_tcap_returnResultProblem,
{ "returnResultProblem", "tcap.returnResultProblem",
FT_INT32, BASE_DEC, VALS(tcap_ReturnResultProblem_vals), 0,
NULL, HFILL }},
{ &hf_tcap_returnErrorProblem,
{ "returnErrorProblem", "tcap.returnErrorProblem",
FT_INT32, BASE_DEC, VALS(tcap_ReturnErrorProblem_vals), 0,
NULL, HFILL }},
{ &hf_tcap_localValue,
{ "localValue", "tcap.localValue",
FT_INT32, BASE_DEC, NULL, 0,
"INTEGER", HFILL }},
{ &hf_tcap_globalValue,
{ "globalValue", "tcap.globalValue",
FT_OID, BASE_NONE, NULL, 0,
"OBJECT_IDENTIFIER", HFILL }},
{ &hf_tcap_nationaler,
{ "nationaler", "tcap.nationaler",
FT_INT32, BASE_DEC, NULL, 0,
"INTEGER_M32768_32767", HFILL }},
{ &hf_tcap_privateer,
{ "privateer", "tcap.privateer",
FT_INT32, BASE_DEC, NULL, 0,
"INTEGER", HFILL }},
{ &hf_tcap_unidialoguePDU,
{ "unidialoguePDU", "tcap.unidialoguePDU",
FT_NONE, BASE_NONE, NULL, 0,
"AUDT_apdu", HFILL }},
{ &hf_tcap_audt_protocol_version,
{ "protocol-version", "tcap.protocol_version",
FT_BYTES, BASE_NONE, NULL, 0,
"AUDT_protocol_version", HFILL }},
{ &hf_tcap_audt_application_context_name,
{ "application-context-name", "tcap.application_context_name",
FT_OID, BASE_NONE, NULL, 0,
"AUDT_application_context_name", HFILL }},
{ &hf_tcap_audt_user_information,
{ "user-information", "tcap.user_information",
FT_UINT32, BASE_DEC, NULL, 0,
"AUDT_user_information", HFILL }},
{ &hf_tcap_audt_user_information_item,
{ "user-information item", "tcap.user_information_item",
FT_NONE, BASE_NONE, NULL, 0,
"EXTERNAL", HFILL }},
{ &hf_tcap_dialogueRequest,
{ "dialogueRequest", "tcap.dialogueRequest",
FT_NONE, BASE_NONE, NULL, 0,
"AARQ_apdu", HFILL }},
{ &hf_tcap_dialogueResponse,
{ "dialogueResponse", "tcap.dialogueResponse",
FT_NONE, BASE_NONE, NULL, 0,
"AARE_apdu", HFILL }},
{ &hf_tcap_dialogueAbort,
{ "dialogueAbort", "tcap.dialogueAbort",
FT_NONE, BASE_NONE, NULL, 0,
"ABRT_apdu", HFILL }},
{ &hf_tcap_aarq_protocol_version,
{ "protocol-version", "tcap.protocol_version",
FT_BYTES, BASE_NONE, NULL, 0,
"AARQ_protocol_version", HFILL }},
{ &hf_tcap_aarq_application_context_name,
{ "application-context-name", "tcap.application_context_name",
FT_OID, BASE_NONE, NULL, 0,
"AARQ_application_context_name", HFILL }},
{ &hf_tcap_aarq_user_information,
{ "user-information", "tcap.user_information",
FT_UINT32, BASE_DEC, NULL, 0,
"AARQ_user_information", HFILL }},
{ &hf_tcap_aarq_user_information_item,
{ "user-information item", "tcap.user_information_item",
FT_NONE, BASE_NONE, NULL, 0,
"EXTERNAL", HFILL }},
{ &hf_tcap_aare_protocol_version,
{ "protocol-version", "tcap.protocol_version",
FT_BYTES, BASE_NONE, NULL, 0,
"AARE_protocol_version", HFILL }},
{ &hf_tcap_aare_application_context_name,
{ "application-context-name", "tcap.application_context_name",
FT_OID, BASE_NONE, NULL, 0,
"AARE_application_context_name", HFILL }},
{ &hf_tcap_result,
{ "result", "tcap.result",
FT_INT32, BASE_DEC, VALS(tcap_Associate_result_vals), 0,
"Associate_result", HFILL }},
{ &hf_tcap_result_source_diagnostic,
{ "result-source-diagnostic", "tcap.result_source_diagnostic",
FT_UINT32, BASE_DEC, VALS(tcap_Associate_source_diagnostic_vals), 0,
"Associate_source_diagnostic", HFILL }},
{ &hf_tcap_aare_user_information,
{ "user-information", "tcap.user_information",
FT_UINT32, BASE_DEC, NULL, 0,
"AARE_user_information", HFILL }},
{ &hf_tcap_aare_user_information_item,
{ "user-information item", "tcap.user_information_item",
FT_NONE, BASE_NONE, NULL, 0,
"EXTERNAL", HFILL }},
{ &hf_tcap_abort_source,
{ "abort-source", "tcap.abort_source",
FT_INT32, BASE_DEC, VALS(tcap_ABRT_source_vals), 0,
"ABRT_source", HFILL }},
{ &hf_tcap_abrt_user_information,
{ "user-information", "tcap.user_information",
FT_UINT32, BASE_DEC, NULL, 0,
"ABRT_user_information", HFILL }},
{ &hf_tcap_abrt_user_information_item,
{ "user-information item", "tcap.user_information_item",
FT_NONE, BASE_NONE, NULL, 0,
"EXTERNAL", HFILL }},
{ &hf_tcap_dialogue_service_user,
{ "dialogue-service-user", "tcap.dialogue_service_user",
FT_INT32, BASE_DEC, VALS(tcap_T_dialogue_service_user_vals), 0,
NULL, HFILL }},
{ &hf_tcap_dialogue_service_provider,
{ "dialogue-service-provider", "tcap.dialogue_service_provider",
FT_INT32, BASE_DEC, VALS(tcap_T_dialogue_service_provider_vals), 0,
NULL, HFILL }},
{ &hf_tcap_AUDT_protocol_version_version1,
{ "version1", "tcap.version1",
FT_BOOLEAN, 8, NULL, 0x80,
NULL, HFILL }},
{ &hf_tcap_AARQ_protocol_version_version1,
{ "version1", "tcap.version1",
FT_BOOLEAN, 8, NULL, 0x80,
NULL, HFILL }},
{ &hf_tcap_AARE_protocol_version_version1,
{ "version1", "tcap.version1",
FT_BOOLEAN, 8, NULL, 0x80,
NULL, HFILL }},
/*--- End of included file: packet-tcap-hfarr.c ---*/
#line 316 "../../asn1/tcap/packet-tcap-template.c"
};
/* Setup protocol subtree array */
static gint *ett[] = {
&ett_tcap,
&ett_param,
&ett_otid,
&ett_dtid,
&ett_tcap_stat,
/*--- Included file: packet-tcap-ettarr.c ---*/
#line 1 "../../asn1/tcap/packet-tcap-ettarr.c"
&ett_tcap_ExternalPDU_U,
&ett_tcap_TCMessage,
&ett_tcap_Unidirectional,
&ett_tcap_Begin,
&ett_tcap_End,
&ett_tcap_Continue,
&ett_tcap_Abort,
&ett_tcap_Reason,
&ett_tcap_SEQUENCE_SIZE_1_MAX_OF_Component,
&ett_tcap_Component,
&ett_tcap_Invoke,
&ett_tcap_ReturnResult,
&ett_tcap_T_resultretres,
&ett_tcap_ReturnError,
&ett_tcap_Reject,
&ett_tcap_T_invokeIDRej,
&ett_tcap_T_problem,
&ett_tcap_OPERATION,
&ett_tcap_ERROR,
&ett_tcap_ErrorCode,
&ett_tcap_UniDialoguePDU,
&ett_tcap_AUDT_apdu_U,
&ett_tcap_AUDT_protocol_version,
&ett_tcap_AUDT_user_information,
&ett_tcap_DialoguePDU,
&ett_tcap_AARQ_apdu_U,
&ett_tcap_AARQ_protocol_version,
&ett_tcap_AARQ_user_information,
&ett_tcap_AARE_apdu_U,
&ett_tcap_AARE_protocol_version,
&ett_tcap_AARE_user_information,
&ett_tcap_ABRT_apdu_U,
&ett_tcap_ABRT_user_information,
&ett_tcap_Associate_source_diagnostic,
/*--- End of included file: packet-tcap-ettarr.c ---*/
#line 326 "../../asn1/tcap/packet-tcap-template.c"
};
/*static enum_val_t tcap_options[] = {
{ "itu", "ITU", ITU_TCAP_STANDARD },
{ "ansi", "ANSI", ANSI_TCAP_STANDARD },
{ NULL, NULL, 0 }
};*/
module_t *tcap_module;
/* Register the protocol name and description */
proto_tcap = proto_register_protocol(PNAME, PSNAME, PFNAME);
/* Required function calls to register the header fields and subtrees used */
proto_register_field_array(proto_tcap, hf, array_length(hf));
proto_register_subtree_array(ett, array_length(ett));
tcap_module = prefs_register_protocol(proto_tcap, NULL);
#if 0
prefs_register_enum_preference(tcap_module, "standard", "ITU TCAP standard",
"The SS7 standard used in ITU TCAP packets",
&tcap_standard, tcap_options, FALSE);
#else
prefs_register_obsolete_preference(tcap_module, "standard");
#endif
#if 0
prefs_register_bool_preference(tcap_module, "lock_info_col", "Lock Info column",
"Always show TCAP in Info column",
&lock_info_col);
#else
prefs_register_obsolete_preference(tcap_module, "lock_info_col");
#endif
/* Set default SSNs */
range_convert_str(&global_ssn_range, "", MAX_SSN);
ssn_range = range_empty();
prefs_register_range_preference(tcap_module, "ssn", "SCCP SSNs",
"SCCP (and SUA) SSNs to decode as TCAP",
&global_ssn_range, MAX_SSN);
prefs_register_bool_preference(tcap_module, "srt",
"Service Response Time Analyse",
"Activate the analyse for Response Time",
>cap_HandleSRT);
prefs_register_bool_preference(tcap_module, "persistentsrt",
"Persistent stats for SRT",
"Statistics for Response Time",
>cap_PersistentSRT);
prefs_register_uint_preference(tcap_module, "repetitiontimeout",
"Repetition timeout",
"Maximal delay for message repetion",
10, >cap_RepetitionTimeout);
prefs_register_uint_preference(tcap_module, "losttimeout",
"lost timeout",
"Maximal delay for message lost",
10, >cap_LostTimeout);
ansi_sub_dissectors = g_hash_table_new(g_direct_hash,g_direct_equal);
itu_sub_dissectors = g_hash_table_new(g_direct_hash,g_direct_equal);
/* 'globally' register dissector */
register_dissector("tcap", dissect_tcap, proto_tcap);
tcap_handle = create_dissector_handle(dissect_tcap, proto_tcap);
register_init_routine(&init_tcap);
}
static void range_delete_callback(guint32 ssn)
{
if ( ssn && !get_ansi_tcap_subdissector(ssn) && !get_itu_tcap_subdissector(ssn) ) {
dissector_delete_uint("sccp.ssn", ssn, tcap_handle);
}
}
static void range_add_callback(guint32 ssn)
{
if (ssn && !get_ansi_tcap_subdissector(ssn) && !get_itu_tcap_subdissector(ssn) ) {
dissector_add_uint("sccp.ssn", ssn, tcap_handle);
}
}
static void init_tcap(void) {
if (ssn_range) {
range_foreach(ssn_range, range_delete_callback);
g_free(ssn_range);
}
ssn_range = range_copy(global_ssn_range);
range_foreach(ssn_range, range_add_callback);
tcapsrt_init_routine();
}
static int
dissect_tcap_param(asn1_ctx_t *actx, proto_tree *tree, tvbuff_t *tvb, int offset)
{
gint tag_offset, saved_offset, len_offset;
tvbuff_t *next_tvb;
proto_tree *subtree;
proto_item *pi;
gint8 ber_class;
gboolean pc;
gint32 tag;
guint32 len;
guint32 tag_length;
guint32 len_length;
gboolean ind_field;
while (tvb_reported_length_remaining(tvb, offset) > 0)
{
saved_offset = offset;
offset = get_ber_identifier(tvb, offset, &ber_class, &pc, &tag);
tag_offset = offset;
offset = get_ber_length(tvb, offset, &len, &ind_field);
len_offset = offset;
tag_length = tag_offset - saved_offset;
len_length = len_offset - tag_offset;
if (pc)
{
pi = proto_tree_add_text(tree, tvb, saved_offset,
len + (len_offset - saved_offset),
"CONSTRUCTOR");
subtree = proto_item_add_subtree(pi, ett_param);
proto_tree_add_uint_format(subtree, hf_tcap_tag, tvb,
saved_offset, tag_length, tag,
"CONSTRUCTOR Tag");
proto_tree_add_uint(subtree, hf_tcap_tag, tvb, saved_offset,
tag_length, ber_class);
proto_tree_add_uint(subtree, hf_tcap_length, tvb, tag_offset,
len_length, len);
if (len-(2*ind_field)) /*should always be positive unless we get an empty contructor pointless? */
{
next_tvb = tvb_new_subset(tvb, offset, len-(2*ind_field),
len-(2*ind_field));
dissect_tcap_param(actx, subtree,next_tvb,0);
}
if (ind_field)
proto_tree_add_text(subtree, tvb, offset+len-2, 2, "CONSTRUCTOR EOC");
offset += len;
}
else
{
pi = proto_tree_add_text(tree, tvb, saved_offset,
len + (len_offset - saved_offset),
"Parameter (0x%.2x)", tag);
subtree = proto_item_add_subtree(pi, ett_param);
proto_tree_add_uint(subtree, hf_tcap_tag, tvb, saved_offset,
tag_length, tag);
proto_tree_add_uint(subtree, hf_tcap_length, tvb,
saved_offset+tag_length, len_length, len);
if (len) /* check for NULLS */
{
next_tvb = tvb_new_subset(tvb, offset, len, len);
dissect_ber_octet_string(TRUE, actx, tree, next_tvb, 0,
hf_tcap_data, NULL);
}
offset += len;
}
}
return offset;
}
static void raz_tcap_private(struct tcap_private_t * p_tcap_private)
{
memset(p_tcap_private,0,sizeof(struct tcap_private_t) );
}
/*
* Call ITU Subdissector to decode the Tcap Component
*/
static int
dissect_tcap_ITU_ComponentPDU(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, asn1_ctx_t *actx _U_, proto_tree *tree, int hf_index _U_)
{
dissector_handle_t subdissector_handle=NULL;
gboolean is_subdissector=FALSE;
struct tcaphash_context_t * p_tcap_context=NULL;
/*
* ok lets look at the oid and ssn and try and find a dissector, otherwise lets decode it.
*/
/*
* Handle The TCAP Service Response Time
*/
if ( gtcap_HandleSRT ) {
if (!tcap_subdissector_used) {
p_tcap_context=tcapsrt_call_matching(tvb, actx->pinfo, tcap_stat_tree, gp_tcapsrt_info);
tcap_subdissector_used=TRUE;
gp_tcap_context=p_tcap_context;
tcap_private.context=p_tcap_context;
}else{
/* Take the last TCAP context */
p_tcap_context = gp_tcap_context;
tcap_private.context=p_tcap_context;
}
}
if (p_tcap_context) {
if (cur_oid) {
if (p_tcap_context->oid_present) {
/* We have already an Application Context, check if we have
to fallback to a lower version */
if ( strncmp(p_tcap_context->oid, cur_oid, sizeof(p_tcap_context->oid))!=0) {
/* ACN, changed, Fallback to lower version
* and update the subdissector (purely formal)
*/
g_strlcpy(p_tcap_context->oid,cur_oid, sizeof(p_tcap_context->oid));
if ( (subdissector_handle = dissector_get_string_handle(ber_oid_dissector_table, cur_oid)) ) {
p_tcap_context->subdissector_handle=subdissector_handle;
p_tcap_context->subdissector_present=TRUE;
}
}
} else {
/* We do not have the OID in the TCAP context, so store it */
g_strlcpy(p_tcap_context->oid, cur_oid, sizeof(p_tcap_context->oid));
p_tcap_context->oid_present=TRUE;
/* Try to find a subdissector according to OID */
if ( (subdissector_handle
= dissector_get_string_handle(ber_oid_dissector_table, cur_oid)) ) {
p_tcap_context->subdissector_handle=subdissector_handle;
p_tcap_context->subdissector_present=TRUE;
} else {
/* Not found, so try to find a subdissector according to SSN */
if ( (subdissector_handle = get_itu_tcap_subdissector(actx->pinfo->match_uint))) {
/* Found according to SSN */
p_tcap_context->subdissector_handle=subdissector_handle;
p_tcap_context->subdissector_present=TRUE;
}
}
} /* context OID */
} else {
/* Copy the OID from the TCAP context to the current oid */
if (p_tcap_context->oid_present) {
tcap_private.oid= (void*) p_tcap_context->oid;
tcap_private.acv=TRUE;
}
} /* no OID */
} /* no TCAP context */
if ( p_tcap_context
&& p_tcap_context->subdissector_present) {
/* Take the subdissector from the context */
subdissector_handle=p_tcap_context->subdissector_handle;
is_subdissector=TRUE;
}
/* Have SccpUsersTable protocol taking precedence over sccp.ssn table */
if (!is_subdissector && requested_subdissector_handle) {
is_subdissector = TRUE;
subdissector_handle = requested_subdissector_handle;
}
if (!is_subdissector) {
/*
* If we do not currently know the subdissector, we have to find it
* - first, according to the OID
* - then according to the SSN
* - and at least, take the default Data handler
*/
if (ber_oid_dissector_table && cur_oid) {
/* Search if we can find the sub protocol according to the A.C.N */
if ( (subdissector_handle
= dissector_get_string_handle(ber_oid_dissector_table, cur_oid)) ) {
/* found */
is_subdissector=TRUE;
} else {
/* Search if we can found the sub protocol according to the SSN table */
if ( (subdissector_handle
= get_itu_tcap_subdissector(actx->pinfo->match_uint))) {
/* Found according to SSN */
is_subdissector=TRUE;
} else {
/* Nothing found, take the Data handler */
subdissector_handle = data_handle;
is_subdissector=TRUE;
} /* SSN */
} /* ACN */
} else {
/* There is no A.C.N for this transaction, so search in the SSN table */
if ( (subdissector_handle = get_itu_tcap_subdissector(actx->pinfo->match_uint))) {
/* Found according to SSN */
is_subdissector=TRUE;
} else {
subdissector_handle = data_handle;
is_subdissector=TRUE;
}
} /* OID */
} else {
/* We have it already */
}
/* Call the sub dissector if present, and not already called */
if (is_subdissector)
call_dissector(subdissector_handle, tvb, actx->pinfo, tree);
return offset;
}
void call_tcap_dissector(dissector_handle_t handle, tvbuff_t* tvb, packet_info* pinfo, proto_tree* tree) {
requested_subdissector_handle = handle;
TRY {
dissect_tcap(tvb, pinfo, tree);
} CATCH_ALL {
requested_subdissector_handle = NULL;
RETHROW;
} ENDTRY;
requested_subdissector_handle = NULL;
}
|