Coverage Report

Created: 2026-11-12 07:01

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/src/wireshark/epan/dissectors/packet-ansi_tcap.c
Line
Count
Source
1
/* Do not modify this file. Changes will be overwritten.                      */
2
/* Generated automatically by the ASN.1 to Wireshark dissector compiler       */
3
/* packet-ansi_tcap.c                                                         */
4
/* asn2wrs.py -b -q -L -p ansi_tcap -c ./ansi_tcap.cnf -s ./packet-ansi_tcap-template -D . -O ../.. TCAP-Remote-Operations-Information-Objects.asn TCAPPackage.asn */
5
6
/* packet-ansi_tcap-template.c
7
 * Routines for ANSI TCAP
8
 * Copyright 2007 Anders Broman <anders.broman@ericsson.com>
9
 * Built from the gsm-map dissector Copyright 2004 - 2005, Anders Broman <anders.broman@ericsson.com>
10
 *
11
 * Wireshark - Network traffic analyzer
12
 * By Gerald Combs <gerald@wireshark.org>
13
 * Copyright 1998 Gerald Combs
14
 *
15
 * SPDX-License-Identifier: GPL-2.0-or-later
16
 * References: T1.114
17
 */
18
19
#include "config.h"
20
21
#include <epan/packet.h>
22
#include <epan/prefs.h>
23
#include <epan/expert.h>
24
#include <epan/oids.h>
25
#include <epan/asn1.h>
26
#include <epan/strutil.h>
27
#include <wsutil/array.h>
28
29
#include "packet-ber.h"
30
#include "packet-tcap.h"
31
#include "packet-ansi_tcap.h"
32
33
void proto_register_ansi_tcap(void);
34
void proto_reg_handoff_ansi_tcap(void);
35
36
/* Preference settings */
37
16
#define ANSI_TCAP_TID_ONLY            0
38
16
#define ANSI_TCAP_TID_AND_SOURCE      1
39
16
#define ANSI_TCAP_TID_SOURCE_AND_DEST 2
40
static int ansi_tcap_response_matching_type = ANSI_TCAP_TID_ONLY;
41
42
/* Initialize the protocol and registered fields */
43
static int proto_ansi_tcap;
44
45
#if 0
46
static int hf_ansi_tcapsrt_SessionId;
47
static int hf_ansi_tcapsrt_Duplicate;
48
static int hf_ansi_tcapsrt_BeginSession;
49
static int hf_ansi_tcapsrt_EndSession;
50
static int hf_ansi_tcapsrt_SessionTime;
51
#endif
52
static int hf_ansi_tcap_bit_h;
53
static int hf_ansi_tcap_op_family;
54
static int hf_ansi_tcap_op_specifier;
55
static int hf_ansi_tcap_parameter;
56
static int hf_ansi_tcap_parameter_length;
57
static int hf_ansi_tcap_parameter_timestamp_year;
58
static int hf_ansi_tcap_parameter_timestamp_month;
59
static int hf_ansi_tcap_parameter_timestamp_day;
60
static int hf_ansi_tcap_parameter_timestamp_hour;
61
static int hf_ansi_tcap_parameter_timestamp_minute;
62
static int hf_ansi_tcap_parameter_timestamp_difference;
63
static int hf_ansi_tcap_parameter_timestamp_local_hour;
64
static int hf_ansi_tcap_parameter_timestamp_local_minute;
65
static int hf_ansi_tcap_parameter_acg_control_cause_indicator;
66
static int hf_ansi_tcap_parameter_acg_duration_field;
67
static int hf_ansi_tcap_parameter_acg_gap;
68
static int hf_ansi_tcap_parameter_standard_announcement;
69
static int hf_ansi_tcap_parameter_customized_announcement;
70
static int hf_ansi_tcap_parameter_set;
71
static int hf_ansi_tcap_parameter_digits_type_of_digits;
72
static int hf_ansi_tcap_parameter_digits_nature_of_number;
73
static int hf_ansi_tcap_parameter_digits_number_plan;
74
static int hf_ansi_tcap_parameter_digits_encoding;
75
static int hf_ansi_tcap_parameter_digits_number_of_digits;
76
static int hf_ansi_tcap_parameter_digits;
77
static int hf_ansi_tcap_standard_user_error_code;
78
static int hf_ansi_tcap_sccp_calling_party_address;
79
static int hf_ansi_tcap_transaction_id;
80
static int hf_ansi_tcap_package_type;
81
static int hf_ansi_tcap_returned_data;
82
static int hf_ansi_tcap_service_key_identifier;
83
static int hf_ansi_tcap_digit_identifier;
84
static int hf_ansi_tcap_digit_length;
85
static int hf_ansi_tcap_destination_number_value;
86
static int hf_ansi_tcap_presentation_restriction;
87
static int hf_ansi_tcap_encoding_scheme;
88
static int hf_ansi_tcap_number_of_digits;
89
static int hf_ansi_tcap_destination_phone_number;
90
static int hf_ansi_tcap_return_phone_number;
91
static int hf_ansi_tcap_busy_idle_status;
92
static int hf_ansi_tcap_originating_restrictions;
93
static int hf_ansi_tcap_terminating_restrictions;
94
static int hf_ansi_tcap_parameter_set_start;
95
static int hf_ansi_tcap_parameter_call_forwarding_on_busy;
96
static int hf_ansi_tcap_parameter_call_forwarding_dont_answer;
97
static int hf_ansi_tcap_parameter_selective_forwarding;
98
static int hf_ansi_tcap_parameter_dn_match;
99
static int hf_ansi_tcap_parameter_dn_line_service;
100
static int hf_ansi_tcap_duration_hour;
101
static int hf_ansi_tcap_duration_minute;
102
static int hf_ansi_tcap_duration_second;
103
static int hf_ansi_tcap_parameter_bearer_capability_requested1;
104
static int hf_ansi_tcap_parameter_bearer_capability_requested2;
105
static int hf_ansi_tcap_parameter_bearer_capability_requested2a;
106
static int hf_ansi_tcap_parameter_bearer_capability_requested2b;
107
static int hf_ansi_tcap_parameter_bearer_capability_requested3;
108
static int hf_ansi_tcap_parameter_bearer_capability_requested3a;
109
static int hf_ansi_tcap_bearer_capability_supported;
110
static int hf_ansi_tcap_reference_id;
111
static int hf_ansi_tcap_parameter_business_group_length_spare;
112
static int hf_ansi_tcap_parameter_business_group_length_AttSt;
113
static int hf_ansi_tcap_parameter_business_group_length_BGID;
114
static int hf_ansi_tcap_parameter_business_group_length_LP11;
115
static int hf_ansi_tcap_parameter_business_group_length_Party_Selector;
116
static int hf_ansi_tcap_parameter_business_group_id;
117
static int hf_ansi_tcap_parameter_business_group_subgroup_id;
118
static int hf_ansi_tcap_parameter_business_group_line_privileges;
119
static int hf_ansi_tcap_parameter_signalling_networks_id;
120
static int hf_ansi_tcap_parameter_generic_name_type_name;
121
static int hf_ansi_tcap_parameter_generic_name_availability;
122
static int hf_ansi_tcap_parameter_generic_name_spare;
123
static int hf_ansi_tcap_parameter_generic_name_presentation;
124
static int hf_ansi_tcap_parameter_generic_name_characters;
125
static int hf_ansi_tcap_message_waiting_indicator_type;
126
static int hf_ansi_tcap_parameter_look_ahead_for_busy_ack_type;
127
static int hf_ansi_tcap_parameter_look_ahead_for_busy_spare;
128
static int hf_ansi_tcap_parameter_look_ahead_for_busy_location_field;
129
static int hf_ansi_tcap_parameter_CIC_lsb;
130
static int hf_ansi_tcap_parameter_CIC_spare;
131
static int hf_ansi_tcap_parameter_CIC_msb;
132
static int hf_ansi_tcap_parameter_precedence_level_spare;
133
static int hf_ansi_tcap_parameter_precedence_level;
134
static int hf_ansi_tcap_parameter_precedence_id1;
135
static int hf_ansi_tcap_parameter_precedence_id2;
136
static int hf_ansi_tcap_parameter_precedence_id3;
137
static int hf_ansi_tcap_parameter_precedence_id4;
138
static int hf_ansi_tcap_parameter_precedence_mlpp_service_domain;
139
static int hf_ansi_tcap_reference_id_call_identify;
140
static int hf_ansi_tcap_reference_id_point_code;
141
static int hf_ansi_tcap_parameter_authorization;
142
static int hf_ansi_tcap_integrity_algid_id;
143
static int hf_ansi_tcap_integrity_algid;
144
static int hf_ansi_tcap_integrity_value_id;
145
static int hf_ansi_tcap_integrity_value;
146
static int hf_ansi_tcap_sequence_number;
147
static int hf_ansi_tcap_num_messages;
148
static int hf_ansi_tcap_display_text;
149
static int hf_ansi_tcap_key_exchange_algid_id;
150
static int hf_ansi_tcap_key_exchange_algid;
151
static int hf_ansi_tcap_key_exchange_value_id;
152
static int hf_ansi_tcap_key_exchange_value;
153
154
155
static int hf_ansi_tcap_national;                 /* T_national */
156
static int hf_ansi_tcap_private;                  /* T_private */
157
static int hf_ansi_tcap_national_01;              /* INTEGER_M128_127 */
158
static int hf_ansi_tcap_ec_private;               /* ANSIMAPPrivateErrorcode */
159
static int hf_ansi_tcap_unidirectional;           /* T_unidirectional */
160
static int hf_ansi_tcap_queryWithPerm;            /* T_queryWithPerm */
161
static int hf_ansi_tcap_queryWithoutPerm;         /* T_queryWithoutPerm */
162
static int hf_ansi_tcap_response;                 /* T_response */
163
static int hf_ansi_tcap_conversationWithPerm;     /* T_conversationWithPerm */
164
static int hf_ansi_tcap_conversationWithoutPerm;  /* T_conversationWithoutPerm */
165
static int hf_ansi_tcap_abort;                    /* T_abort */
166
static int hf_ansi_tcap_identifier;               /* TransactionID */
167
static int hf_ansi_tcap_dialoguePortion;          /* DialoguePortion */
168
static int hf_ansi_tcap_componentPortion;         /* ComponentSequence */
169
static int hf_ansi_tcap_dialogPortion;            /* DialoguePortion */
170
static int hf_ansi_tcap_causeInformation;         /* T_causeInformation */
171
static int hf_ansi_tcap_abortCause;               /* P_Abort_cause */
172
static int hf_ansi_tcap_abort_userInformation;    /* UserAbortInformation */
173
static int hf_ansi_tcap_version;                  /* ProtocolVersion */
174
static int hf_ansi_tcap_applicationContext;       /* T_applicationContext */
175
static int hf_ansi_tcap_integerApplicationId;     /* IntegerApplicationContext */
176
static int hf_ansi_tcap_objectApplicationId;      /* ObjectIDApplicationContext */
177
static int hf_ansi_tcap_userInformation;          /* UserInformation */
178
static int hf_ansi_tcap_securityContext;          /* T_securityContext */
179
static int hf_ansi_tcap_integerSecurityId;        /* INTEGER */
180
static int hf_ansi_tcap_objectSecurityId;         /* OBJECT_IDENTIFIER */
181
static int hf_ansi_tcap_confidentiality;          /* Confidentiality */
182
static int hf_ansi_tcap__untag_item;              /* EXTERNAL */
183
static int hf_ansi_tcap_confidentialityId;        /* T_confidentialityId */
184
static int hf_ansi_tcap_integerConfidentialityId;  /* INTEGER */
185
static int hf_ansi_tcap_objectConfidentialityId;  /* OBJECT_IDENTIFIER */
186
static int hf_ansi_tcap__untag_item_01;           /* ComponentPDU */
187
static int hf_ansi_tcap_invokeLast;               /* Invoke */
188
static int hf_ansi_tcap_returnResultLast;         /* ReturnResult */
189
static int hf_ansi_tcap_returnError;              /* ReturnError */
190
static int hf_ansi_tcap_reject;                   /* Reject */
191
static int hf_ansi_tcap_invokeNotLast;            /* Invoke */
192
static int hf_ansi_tcap_returnResultNotLast;      /* ReturnResult */
193
static int hf_ansi_tcap_componentIDs;             /* T_componentIDs */
194
static int hf_ansi_tcap_operationCode;            /* OperationCode */
195
static int hf_ansi_tcap_invoke_parameter;         /* T_invoke_parameter */
196
static int hf_ansi_tcap_componentID;              /* T_componentID */
197
static int hf_ansi_tcap_returnResult_parameter;   /* T_returnResult_parameter */
198
static int hf_ansi_tcap_componentID_01;           /* T_componentID_01 */
199
static int hf_ansi_tcap_errorCode;                /* ErrorCode */
200
static int hf_ansi_tcap_returnError_parameter;    /* T_returnError_parameter */
201
static int hf_ansi_tcap_componentID_02;           /* OCTET_STRING_SIZE_0_1 */
202
static int hf_ansi_tcap_rejectProblem;            /* Problem */
203
static int hf_ansi_tcap_reject_parameter;         /* T_reject_parameter */
204
static int hf_ansi_tcap_paramSequence;            /* T_paramSequence */
205
static int hf_ansi_tcap_paramSet;                 /* T_paramSet */
206
207
/* Initialize the subtree pointers */
208
static int ett_tcap;
209
static int ett_param;
210
static int ett_ansi_tcap_op_code_nat;
211
static int ett_ansi_tcap_stat_timestamp;
212
static int ett_ansi_tcap_duration;
213
214
static int ett_otid;
215
static int ett_dtid;
216
static int ett_ansi_tcap_stat;
217
218
static expert_field ei_ansi_tcap_dissector_not_implemented;
219
static expert_field ei_ansi_tcap_no_parameters;
220
static expert_field ei_ansi_tcap_too_many_components;
221
222
static struct tcapsrt_info_t * gp_tcapsrt_info;
223
static bool tcap_subdissector_used=false;
224
225
static struct tcaphash_context_t * gp_tcap_context;
226
227
/* Note the high bit should be masked off when registering in this table (0x7fff)*/
228
static dissector_table_t  ansi_tcap_national_opcode_table; /* National Operation Codes */
229
230
static int ett_ansi_tcap_OperationCode;
231
static int ett_ansi_tcap_ErrorCode;
232
static int ett_ansi_tcap_PackageType;
233
static int ett_ansi_tcap_UniTransactionPDU;
234
static int ett_ansi_tcap_TransactionPDU;
235
static int ett_ansi_tcap_Abort;
236
static int ett_ansi_tcap_T_causeInformation;
237
static int ett_ansi_tcap_DialoguePortion_U;
238
static int ett_ansi_tcap_T_applicationContext;
239
static int ett_ansi_tcap_T_securityContext;
240
static int ett_ansi_tcap_UserInformation_U;
241
static int ett_ansi_tcap_Confidentiality;
242
static int ett_ansi_tcap_T_confidentialityId;
243
static int ett_ansi_tcap_SEQUENCE_OF_ComponentPDU;
244
static int ett_ansi_tcap_ComponentPDU;
245
static int ett_ansi_tcap_Invoke;
246
static int ett_ansi_tcap_ReturnResult;
247
static int ett_ansi_tcap_ReturnError;
248
static int ett_ansi_tcap_Reject;
249
static int ett_ansi_tcap_T_reject_parameter;
250
static int ett_ansi_tcap_T_paramSequence;
251
static int ett_ansi_tcap_T_paramSet;
252
253
#define MAX_SSN 254
254
255
static dissector_table_t ber_oid_dissector_table;
256
static const char * cur_oid;
257
static const char * tcapext_oid;
258
259
static dissector_handle_t ansi_map_handle;
260
static dissector_handle_t ain_handle;
261
262
static struct ansi_tcap_private_t ansi_tcap_private;
263
0
#define MAX_TID_STR_LEN 1024
264
265
4
static void ansi_tcap_ctx_init(struct ansi_tcap_private_t *a_tcap_ctx) {
266
4
  memset(a_tcap_ctx, '\0', sizeof(*a_tcap_ctx));
267
4
  a_tcap_ctx->signature = ANSI_TCAP_CTX_SIGNATURE;
268
4
  a_tcap_ctx->oid_is_present = false;
269
4
  a_tcap_ctx->TransactionID_str = NULL;
270
4
}
271
272
/* Tables for register*/
273
274
static const value_string ansi_tcap_national_op_code_family_vals[] = {
275
  {  0x0, "All Families" },
276
  {  0x1, "Parameter" },
277
  {  0x2, "Charging" },
278
  {  0x3, "Provide Instructions" },
279
  {  0x4, "Connection Control" },
280
  {  0x5, "Caller Interaction" },
281
  {  0x6, "Send Notification" },
282
  {  0x7, "Network Management" },
283
  {  0x8, "Procedural" },
284
  {  0x9, "Operation Control" },
285
  {  0xa, "Report Event" },
286
  /* Spare */
287
  {  0x7e, "Miscellaneous" },
288
  {  0x7f, "Reserved" },
289
  { 0, NULL }
290
};
291
292
static const value_string ansi_tcap_national_parameter_control_cause_indication[] = {
293
 { 1, "Vacant Code" },
294
 { 2, "Out-of-Band" },
295
 { 3, "Database Overload" },
296
 { 4, "Destination Mass Calling" },
297
 { 5, "Operation Support System Initiated" },
298
 { 0, NULL },
299
};
300
301
302
static const value_string ansi_tcap_national_parameter_duration_field[] = {
303
 { 0x0, "Not Used" },
304
 { 0x1, "1 Second" },
305
 { 0x2, "2 Seconds" },
306
 { 0x3, "4 Seconds" },
307
 { 0x4, "8 Seconds" },
308
 { 0x5, "16 Seconds" },
309
 { 0x6, "32 Seconds" },
310
 { 0x7, "64 Seconds" },
311
 { 0x8, "128 Seconds" },
312
 { 0x9, "256 Seconds" },
313
 { 0xa, "512 Seconds" },
314
 { 0xb, "1024 Seconds" },
315
 { 0xc, "2048 Seconds" },
316
 { 0, NULL },
317
};
318
319
static const value_string ansi_tcap_national_parameter_gap[] = {
320
 { 0x0, "Remove Gap Control" },
321
 { 0x1, "0.00 Second" },
322
 { 0x2, "0.10 Seconds" },
323
 { 0x3, "0.25 Seconds" },
324
 { 0x4, "0.50 Seconds" },
325
 { 0x5, "1.00 Seconds" },
326
 { 0x6, "2.00 Seconds" },
327
 { 0x7, "5.00 Seconds" },
328
 { 0x8, "10.00 Seconds" },
329
 { 0x9, "15.00 Seconds" },
330
 { 0xa, "30.00 Seconds" },
331
 { 0xb, "60.00 Seconds" },
332
 { 0xc, "120.00 Seconds" },
333
 { 0xd, "300.00 Seconds" },
334
 { 0xe, "600.00 Seconds" },
335
 { 0xf, "Stop All Calls" },
336
 { 0, NULL },
337
};
338
339
static const value_string ansi_tcap_national_parameter_digits_type_of_digits[] = {
340
 { 0x00, "Not Used" },
341
 { 0x01, "Called Party Number" },
342
 { 0x02, "Calling Party Number" },
343
 { 0x03, "Caller Interaction" },
344
 { 0x04, "Routing Number" },
345
 { 0x05, "Billing Number" },
346
 { 0x06, "Destination Number" },
347
 { 0x07, "LATA" },
348
 { 0x08, "Carrier" },
349
 { 0x09, "Last Calling Party" },
350
 { 0x0a, "Last Party Called" },
351
 { 0x0b, "Calling Directory Number" },
352
 { 0x0c, "VMSR Identifier" },
353
 { 0x0d, "Original Called Number" },
354
 { 0x0e, "Redirecting Number" },
355
 { 0x0f, "Connected Number" },
356
 { 0, NULL },
357
};
358
359
static const value_string ansi_tcap_national_parameter_digits_nature_of_number[] = {
360
 { 0x0, "National" },
361
 { 0x1, "International" },
362
 { 0x2, "No Presentation Restriction" },
363
 { 0x3, "Presentation Restriction" },
364
 { 0, NULL },
365
};
366
367
static const value_string ansi_tcap_national_parameter_digits_encoding[] = {
368
 { 0x0, "Not Used" },
369
 { 0x1, "BCD" },
370
 { 0x2, "IA5" },
371
 { 0, NULL },
372
};
373
374
static const value_string ansi_tcap_national_parameter_digits_number_plan[] = {
375
 { 0x0, "Unknown or Not applicable" },
376
 { 0x1, "ISDN Numbering" },
377
 { 0x2, "Telephony Numbering" },
378
 { 0x3, "Data Numbering" },
379
 { 0x4, "Telex Numbering" },
380
 { 0x5, "Maritime Mobile Numbering" },
381
 { 0x6, "Land Mobile Numbering" },
382
 { 0x7, "Private Numbering Plan" },
383
 { 0, NULL },
384
};
385
386
static const value_string ansi_tcap_national_parameter_digits[] = {
387
 { 0x0, "Digit 0 or filler" },
388
 { 0x1, "Digit 1" },
389
 { 0x2, "Digit 2" },
390
 { 0x3, "Digit 3" },
391
 { 0x4, "Digit 4" },
392
 { 0x5, "Digit 5" },
393
 { 0x6, "Digit 6" },
394
 { 0x7, "Digit 7" },
395
 { 0x8, "Digit 8" },
396
 { 0x9, "Digit 9" },
397
 { 0xa, "Spare" },
398
 { 0xb, "Code 11" },
399
 { 0xc, "Code 12" },
400
 { 0xd, "*" },
401
 { 0xe, "#" },
402
 { 0xf, "ST" },
403
 { 0, NULL },
404
};
405
406
static const value_string ansi_tcap_national_parameter_spare[] = {
407
 { 0, "Service Not Supported" },
408
 { 1, "Active" },
409
 { 2, "Not Active" },
410
 { 3, "Spare" },
411
 { 0, NULL },
412
};
413
414
static const value_string ansi_tcap_national_parameter_dn_match[] = {
415
 { 0, "spare" },
416
 { 1, "No Match" },
417
 { 2, "Match" },
418
 { 3, "Spare" },
419
 { 0, NULL },
420
};
421
422
static const value_string ansi_tcap_national_parameter_dn_service_type[] = {
423
 { 0, "Individual" },
424
 { 1, "Coin" },
425
 { 2, "Series Completion" },
426
 { 3, "Multiline Hunt" },
427
 { 4, "Unassigned" },
428
 { 5, "PBX" },
429
 { 6, "Multiparty (3 or more)" },
430
 { 7, "Choke" },
431
 { 8, "Nonspecific" },
432
 { 9, "Temporarily Out-of-Service" },
433
 { 0, NULL },
434
};
435
436
static const value_string ansi_tcap_national_parameter_generic_name_type_of_name[] = {
437
 { 0, "Spare" },
438
 { 1, "Calling name" },
439
 { 2, "Original called name" },
440
 { 3, "Redirected name" },
441
 { 4, "Connected name" },
442
 { 5, "Spare" },
443
 { 6, "Spare" },
444
 { 7, "Spare" },
445
 { 0, NULL },
446
};
447
448
static const value_string ansi_tcap_national_parameter_generic_name_availability[] = {
449
 { 0, "Name available/unknown" },
450
 { 1, "Name not available" },
451
 { 0, NULL },
452
};
453
454
static const value_string ansi_tcap_national_parameter_generic_name_presentation_field[] = {
455
 { 0, "Presentation Allowed" },
456
 { 1, "Presentation Restricted" },
457
 { 2, "Blocking Toggle" },
458
 { 3, "No Indication" },
459
 { 0, NULL },
460
};
461
462
static const value_string ansi_tcap_national_parameter_look_ahead_for_busy_ack[] = {
463
 { 0, "Path Reservation Denied" },
464
 { 1, "Negative Acknowledgement" },
465
 { 2, "Positive Acknowledgement" },
466
 { 3, "Spare" },
467
 { 0, NULL },
468
};
469
470
static const value_string ansi_tcap_national_parameter_look_ahead_for_busy_location_field[] = {
471
 { 0, "User" },
472
 { 1, "Private Network Serving The Local User" },
473
 { 3, "Public Network Serving The Local User" },
474
 { 4, "Transit Network" },
475
 { 5, "Public Network Serving The Remote User" },
476
 { 6, "Private Network Serving The Remote User" },
477
 { 8, "Reserved" },
478
 { 9, "Internation Network" },
479
 { 0xa, "Network Beyond Interworking Point" },
480
 { 0, NULL },
481
};
482
483
static const value_string ansi_tcap_national_parameter_level[] = {
484
 { 0, "Flash Override" },
485
 { 1, "Flash" },
486
 { 3, "Immediate" },
487
 { 4, "Priority" },
488
 { 5, "Routine" },
489
 { 0, NULL },
490
};
491
492
/* Parameter list*/
493
494
0
#define TIMESTAMP                               0x17
495
0
#define ACG_INDICATORS                          0x81
496
0
#define STANDARD_ANNOUNCEMENT                   0x82
497
0
#define CUSTOMIZED_ANNOUNCEMENT                 0x83
498
0
#define DIGITS                                  0x84
499
0
#define STANDARD_USER_ERROR_CODE                0x85
500
#define PROBLEM_DATA                            0x86
501
0
#define SCCP_CALLING_PARTY_ADDRESS              0x87
502
0
#define TRANSACTION_ID                          0x88
503
0
#define PACKAGE_TYPE                            0x89
504
0
#define SERVICE_KEY                             0x8a
505
0
#define BUSY_IDLE_STATUS                        0x8b
506
0
#define CALL_FORWARDING_STATUS                  0x8c
507
0
#define ORIGINATING_RESTRICTIONS                0x8d
508
0
#define TERMINATING_RESTRICTIONS                0x8e
509
0
#define DN_TO_LINE_SERVICE_TYPE_MAPPING         0x8f
510
0
#define DURATION                                0x90
511
0
#define RETURNED_DATA                           0x91
512
0
#define BEARER_CAPABILITY_REQUESTED             0x92
513
0
#define BEARER_CAPABILITY_SUPPORTED             0x93
514
0
#define REFERENCE_ID                            0x94
515
0
#define BUSINESS_GROUP                          0x95
516
0
#define SIGNALLING_NETWORKS_IDENTIFIER          0x96
517
0
#define GENERIC_NAME                            0x97
518
0
#define MESSAGE_WAITING_INDICATOR_TYPE          0x98
519
0
#define LOOK_AHEAD_FOR_BUSY                     0x99
520
0
#define CIRCUIT_IDENTIFICATION_CODE             0x9a
521
0
#define PRECEDENCE_IDENTIFIER                   0x9b
522
0
#define CALL_REFERENCE_IDENTIFIER               0x9c
523
0
#define AUTHORIZATION                           0x9d
524
0
#define INTEGRITY                               0x9e
525
0
#define SEQUENCE_NUMBER                         0x9f1f
526
0
#define NUMBER_OF_MESSAGES                      0x7f20
527
0
#define DISPLAY_TEXT                            0x7f21
528
0
#define KEY_EXCHANGE                            0x7f22
529
0
#define SCCP_CALLED_PARTY_ADDRESS               0x7f23
530
531
532
static const value_string ansi_tcap_parameter_vals[] = {
533
 { TIMESTAMP, "Timestamp" },
534
 { ACG_INDICATORS, "ACG Indicators" },
535
 { STANDARD_ANNOUNCEMENT, "Standard Announcement" },
536
 { CUSTOMIZED_ANNOUNCEMENT, "Customized Announcement Format" },
537
 { DIGITS, "Digits" },
538
 { STANDARD_USER_ERROR_CODE, "Standard User Error Code" },
539
 { PROBLEM_DATA, "Problem Data" },
540
 { SCCP_CALLING_PARTY_ADDRESS, "SCCP Calling Party Address" },
541
 { TRANSACTION_ID, "Transaction ID" },
542
 { PACKAGE_TYPE, "Package Type Identifier" },
543
 { SERVICE_KEY, "Service Key Identifier" },
544
 { BUSY_IDLE_STATUS, "Busy Idle Status" },
545
 { CALL_FORWARDING_STATUS, "Call Forwarding Status" },
546
 { ORIGINATING_RESTRICTIONS, "Originating Restrictions" },
547
 { TERMINATING_RESTRICTIONS, "Terminating Restrictions" },
548
 { DN_TO_LINE_SERVICE_TYPE_MAPPING, "DN To Line Service Type Mapping" },
549
 { DURATION, "Duration" },
550
 { RETURNED_DATA, "Returned Data" },
551
 { BEARER_CAPABILITY_REQUESTED, "Bearer Capability Requested" },
552
 { BEARER_CAPABILITY_SUPPORTED, "Bearer Capability Supported" },
553
 { REFERENCE_ID, "Reference ID" },
554
 { BUSINESS_GROUP, "Business Group" },
555
 { SIGNALLING_NETWORKS_IDENTIFIER, "Signalling Networks Identifier" },
556
 { GENERIC_NAME, "Generic Name Identifier" },
557
 { MESSAGE_WAITING_INDICATOR_TYPE, "Message Waiting Indicator Type" },
558
 { LOOK_AHEAD_FOR_BUSY, "Look Ahead For Busy" },
559
 { CIRCUIT_IDENTIFICATION_CODE, "Circuit Identification Code" },
560
 { PRECEDENCE_IDENTIFIER, "Precedence Level" },
561
 { CALL_REFERENCE_IDENTIFIER, "Call Reference Identifier" },
562
 { AUTHORIZATION, "Authorization" },
563
 { INTEGRITY, "Integrity" },
564
 { SEQUENCE_NUMBER, "Sequence Number" },
565
 { 0xaa, "Service Key Identifier" },
566
 { NUMBER_OF_MESSAGES, "Number of Messages" },
567
 { DISPLAY_TEXT, "Display Text" },
568
 { KEY_EXCHANGE, "Key Exchange" },
569
 { SCCP_CALLED_PARTY_ADDRESS, "SCCP Called Party Address" },
570
 { 0, NULL },
571
};
572
573
static const value_string ansi_tcap_standard_announcements[] = {
574
 { 0, "Not Used" },
575
 { 1, "Out-of-Band" },
576
 { 2, "Vacant Code" },
577
 { 3, "Disconnected Number" },
578
 { 4, "Reorder (120 IPM)" },
579
 { 5, "Busy (60 IPM)" },
580
 { 6, "No Circuit Available" },
581
 { 7, "Reorder" },
582
 { 8, "Audible Ring" },
583
 { 0, NULL },
584
};
585
586
static const value_string ansi_tcap_standard_user_error_code[] = {
587
 { 0, "Call Abandoned" },
588
 { 1, "Improper Caller Response" },
589
 { 0, NULL },
590
};
591
592
static const value_string ansi_tcap_package_types[] = {
593
 { 0xE1, "Unidirectional" },
594
 { 0xE2, "Query with Permission" },
595
 { 0xE3, "Query without Permission" },
596
 { 0xE4, "Response" },
597
 { 0xE5, "Conversation with Permission" },
598
 { 0xE6, "Conversation without Permission" },
599
 { 0xE7, "Abort" },
600
 { 0, NULL },
601
};
602
603
static const value_string ansi_tcap_status_identifier[] = {
604
 { 0, "IDLE" },
605
 { 1, "BUSY" },
606
 { 0, NULL },
607
};
608
609
static const value_string ansi_tcap_originating_restrictions[] = {
610
 { 0, "Denied Origination" },
611
 { 1, "Fully Restricted Origination" },
612
 { 2, "Semi-Restricted Origination" },
613
 { 3, "Unrestricted Origination" },
614
 { 0, NULL },
615
};
616
617
618
static const value_string ansi_tcap_terminating_restrictions[] = {
619
 { 0, "Denied Termination" },
620
 { 1, "Fully Restricted Termination" },
621
 { 2, "Semi-Restricted Termination" },
622
 { 3, "Unrestricted Termination" },
623
 { 4, "Call Rejections Applies" },
624
 { 0, NULL },
625
};
626
627
static const value_string ansi_tcap_bearer_capabilities_supported[] = {
628
 { 1, "Not Supported" },
629
 { 2, "Supported" },
630
 { 3, "Not Authorized" },
631
 { 4, "Not Presently Available" },
632
 { 5, "Not Implemented" },
633
 { 0, NULL },
634
};
635
636
637
/* Transaction tracking */
638
/* Transaction table */
639
struct ansi_tcap_invokedata_t {
640
    int OperationCode;
641
      /*
642
         0 : national,
643
         1 : private
644
      */
645
    int32_t OperationCode_private;
646
    int32_t OperationCode_national;
647
};
648
649
static wmem_multimap_t *TransactionId_table;
650
651
// nibble swap function
652
0
static unsigned char swap_nibbles(unsigned char x){
653
0
    return (x & 0x0F)<<4 | (x & 0xF0)>>4;
654
0
}
655
656
static int parameter_type(proto_tree *tree, tvbuff_t *tvb, unsigned offset_parameter_type)
657
0
{
658
0
  proto_tree *subtree;
659
0
  proto_item *ti, *subitem;
660
0
  uint8_t param_value = tvb_get_uint8(tvb, offset_parameter_type);
661
0
  uint32_t parameter, parameter_length;
662
663
  /* A general parameter decoding looks like: Identifier -> Length -> Value
664
   There is another case statement to account for the 'F' bit */
665
0
  if ((param_value & 0x0F) == 0x0F)
666
0
  {
667
0
      ti = proto_tree_add_item_ret_uint(tree, hf_ansi_tcap_parameter, tvb, offset_parameter_type, 2, ENC_BIG_ENDIAN, &parameter);
668
0
      offset_parameter_type += 2;
669
0
  }
670
0
  else
671
0
  {
672
0
      ti = proto_tree_add_item_ret_uint(tree, hf_ansi_tcap_parameter, tvb, offset_parameter_type, 1, ENC_BIG_ENDIAN, &parameter);
673
0
      offset_parameter_type += 1;
674
0
  }
675
0
  offset_parameter_type += 1;
676
677
0
  proto_tree_add_item_ret_uint(tree, hf_ansi_tcap_parameter_length, tvb, offset_parameter_type, 1, ENC_BIG_ENDIAN, &parameter_length);
678
0
  offset_parameter_type += 1;
679
0
  if (parameter_length == 0)
680
0
  {
681
0
    proto_item_append_text(ti, " (This parameter is asking to be returned)");
682
0
    return offset_parameter_type;
683
0
  }
684
685
0
  switch (parameter)
686
0
  {
687
0
    case TIMESTAMP:
688
0
    {
689
0
      int year, month, day, hour, minute, difference, local_hour, local_minute;
690
0
      subtree = proto_tree_add_subtree(tree, tvb, offset_parameter_type, 8, ett_ansi_tcap_stat_timestamp, &subitem, "Timestamp");
691
692
0
      proto_tree_add_item_ret_int(subtree, hf_ansi_tcap_parameter_timestamp_year, tvb, offset_parameter_type, 1, ENC_BIG_ENDIAN, &year);
693
0
      offset_parameter_type += 1;
694
0
      proto_tree_add_item_ret_int(subtree, hf_ansi_tcap_parameter_timestamp_month, tvb, offset_parameter_type, 1, ENC_BIG_ENDIAN, &month);
695
0
      offset_parameter_type += 1;
696
0
      proto_tree_add_item_ret_int(subtree, hf_ansi_tcap_parameter_timestamp_day, tvb, offset_parameter_type, 1, ENC_BIG_ENDIAN, &day);
697
0
      offset_parameter_type += 1;
698
0
      proto_tree_add_item_ret_int(subtree, hf_ansi_tcap_parameter_timestamp_hour, tvb, offset_parameter_type, 1, ENC_BIG_ENDIAN, &hour);
699
0
      offset_parameter_type += 1;
700
0
      proto_tree_add_item_ret_int(subtree, hf_ansi_tcap_parameter_timestamp_minute, tvb, offset_parameter_type, 1, ENC_BIG_ENDIAN, &minute);
701
0
      offset_parameter_type += 1;
702
0
      proto_tree_add_item_ret_int(subtree, hf_ansi_tcap_parameter_timestamp_difference, tvb, offset_parameter_type, 1, ENC_BIG_ENDIAN, &difference);
703
0
      offset_parameter_type += 1;
704
0
      proto_tree_add_item_ret_int(subtree, hf_ansi_tcap_parameter_timestamp_local_hour, tvb, offset_parameter_type, 1, ENC_BIG_ENDIAN, &local_hour);
705
0
      offset_parameter_type += 1;
706
0
      proto_tree_add_item_ret_int(subtree, hf_ansi_tcap_parameter_timestamp_local_minute, tvb, offset_parameter_type, 1, ENC_BIG_ENDIAN, &local_minute);
707
0
      offset_parameter_type += 1;
708
0
      proto_item_append_text(subitem, " (%02d/%02d/%02d %02d:%02d, diff=%d, local time=%02d:%02d)", day, month, year, hour, minute, difference, local_hour, local_minute);
709
0
    }
710
0
    break;
711
0
    case ACG_INDICATORS:
712
0
      proto_tree_add_item(tree, hf_ansi_tcap_parameter_acg_control_cause_indicator, tvb, offset_parameter_type, 1, ENC_BIG_ENDIAN);
713
0
      offset_parameter_type += 1;
714
0
      proto_tree_add_item(tree, hf_ansi_tcap_parameter_acg_duration_field, tvb, offset_parameter_type, 1, ENC_BIG_ENDIAN);
715
0
      offset_parameter_type += 1;
716
0
      proto_tree_add_item(tree, hf_ansi_tcap_parameter_acg_gap, tvb, offset_parameter_type, 1, ENC_BIG_ENDIAN);
717
0
      offset_parameter_type += 1;
718
0
    break;
719
0
    case STANDARD_ANNOUNCEMENT:
720
0
        proto_tree_add_item(tree, hf_ansi_tcap_parameter_standard_announcement, tvb, offset_parameter_type, 1, ENC_BIG_ENDIAN);
721
0
        offset_parameter_type += 1;
722
0
    break;
723
0
    case CUSTOMIZED_ANNOUNCEMENT:
724
0
      proto_tree_add_item(tree, hf_ansi_tcap_parameter_customized_announcement, tvb, offset_parameter_type, 1, ENC_BIG_ENDIAN);
725
0
      offset_parameter_type += (1 + tvb_get_uint8(tvb, offset_parameter_type));
726
0
      break;
727
0
    case DIGITS:
728
0
    {
729
        /* XXX - Just call dissect_ansi_map_digits_type()? */
730
0
        uint32_t num_digits;
731
0
        proto_tree_add_item(tree, hf_ansi_tcap_parameter_digits_type_of_digits, tvb, offset_parameter_type, 1, ENC_BIG_ENDIAN);
732
0
        offset_parameter_type += 1;
733
0
        proto_tree_add_item(tree, hf_ansi_tcap_parameter_digits_nature_of_number, tvb, offset_parameter_type, 1, ENC_BIG_ENDIAN);
734
0
        offset_parameter_type += 1;
735
0
        proto_tree_add_item(tree, hf_ansi_tcap_parameter_digits_number_plan, tvb, offset_parameter_type, 1, ENC_BIG_ENDIAN);
736
0
        proto_tree_add_item(tree, hf_ansi_tcap_parameter_digits_encoding, tvb, offset_parameter_type, 1, ENC_BIG_ENDIAN);
737
0
        offset_parameter_type += 1;
738
0
        proto_tree_add_item_ret_uint(tree, hf_ansi_tcap_parameter_digits_number_of_digits, tvb, offset_parameter_type, 1, ENC_BIG_ENDIAN, &num_digits);
739
0
        offset_parameter_type += 1;
740
0
        for (uint32_t i = 0; i < num_digits; i++)
741
0
        {
742
0
            proto_tree_add_item(tree, hf_ansi_tcap_parameter_digits, tvb, offset_parameter_type, 1, ENC_BIG_ENDIAN);
743
0
            offset_parameter_type += 1;
744
0
        }
745
0
    }
746
0
    break;
747
0
    case STANDARD_USER_ERROR_CODE:
748
0
        proto_tree_add_item(tree, hf_ansi_tcap_standard_user_error_code, tvb, offset_parameter_type, 1, ENC_BIG_ENDIAN);
749
0
        offset_parameter_type += 1;
750
0
    break;
751
0
    case SCCP_CALLING_PARTY_ADDRESS:
752
0
        proto_tree_add_item(tree, hf_ansi_tcap_sccp_calling_party_address, tvb, offset_parameter_type, 1, ENC_BIG_ENDIAN);
753
0
        offset_parameter_type += 1;
754
0
    break;
755
0
    case TRANSACTION_ID:
756
0
        proto_tree_add_item(tree, hf_ansi_tcap_transaction_id, tvb, offset_parameter_type, 1, ENC_BIG_ENDIAN);
757
0
        offset_parameter_type += 1;
758
0
    break;
759
0
    case PACKAGE_TYPE:
760
0
        proto_tree_add_item(tree, hf_ansi_tcap_package_type, tvb, offset_parameter_type, 1, ENC_BIG_ENDIAN);
761
0
        offset_parameter_type += 1;
762
0
    break;
763
    /* extra case to account for form bit (F bit)*/
764
0
    case SERVICE_KEY: case 0xaa:
765
0
    {
766
0
      proto_tree_add_item(tree, hf_ansi_tcap_digit_identifier, tvb, offset_parameter_type, 1, ENC_BIG_ENDIAN);
767
0
      offset_parameter_type +=1;
768
0
      proto_tree_add_item(tree, hf_ansi_tcap_digit_length, tvb, offset_parameter_type, 1, ENC_BIG_ENDIAN);
769
0
      offset_parameter_type +=1;
770
0
      proto_tree_add_item(tree, hf_ansi_tcap_destination_number_value, tvb, offset_parameter_type, 1, ENC_BIG_ENDIAN);
771
0
      offset_parameter_type +=1;
772
0
      proto_tree_add_item(tree, hf_ansi_tcap_presentation_restriction, tvb, offset_parameter_type, 1, ENC_BIG_ENDIAN);
773
0
      offset_parameter_type +=1;
774
0
      proto_tree_add_item(tree, hf_ansi_tcap_encoding_scheme, tvb, offset_parameter_type, 1, ENC_BIG_ENDIAN);
775
0
      offset_parameter_type +=1;
776
0
      proto_tree_add_item(tree, hf_ansi_tcap_number_of_digits, tvb, offset_parameter_type, 1, ENC_BIG_ENDIAN);
777
0
      uint8_t phoneNumber[5];
778
0
      for (int j = 0; j < 5; j++)
779
0
        phoneNumber[j] = swap_nibbles(tvb_get_uint8(tvb, offset_parameter_type+j));
780
781
0
      proto_tree_add_bytes_format_value(tree, hf_ansi_tcap_destination_phone_number, tvb, offset_parameter_type, 5, phoneNumber,
782
0
            "%x%x%x-%x%x", phoneNumber[0], phoneNumber[1], phoneNumber[2], phoneNumber[3], phoneNumber[4]);
783
0
      offset_parameter_type += 5;
784
785
0
      proto_tree_add_item(tree, hf_ansi_tcap_digit_identifier, tvb, offset_parameter_type, 1, ENC_BIG_ENDIAN);
786
0
      offset_parameter_type +=1;
787
0
      proto_tree_add_item(tree, hf_ansi_tcap_digit_length, tvb, offset_parameter_type, 1, ENC_BIG_ENDIAN);
788
0
      offset_parameter_type +=1;
789
0
      proto_tree_add_item(tree, hf_ansi_tcap_destination_number_value, tvb, offset_parameter_type, 1, ENC_BIG_ENDIAN);
790
0
      offset_parameter_type +=1;
791
0
      proto_tree_add_item(tree, hf_ansi_tcap_presentation_restriction, tvb, offset_parameter_type, 1, ENC_BIG_ENDIAN);
792
0
      offset_parameter_type +=1;
793
0
      proto_tree_add_item(tree, hf_ansi_tcap_encoding_scheme, tvb, offset_parameter_type, 1, ENC_BIG_ENDIAN);
794
0
      offset_parameter_type +=1;
795
0
      proto_tree_add_item(tree, hf_ansi_tcap_number_of_digits, tvb, offset_parameter_type, 1, ENC_BIG_ENDIAN);
796
0
      uint8_t phoneNumberReturn[5];
797
0
      for (int k = 0; k < 5; k++)
798
0
        phoneNumberReturn[k] = swap_nibbles(tvb_get_uint8(tvb, offset_parameter_type+k));
799
800
0
      proto_tree_add_bytes_format_value(tree, hf_ansi_tcap_return_phone_number, tvb, offset_parameter_type, 5, phoneNumberReturn,
801
0
          "%x%x%x-%x%x", phoneNumberReturn[0], phoneNumberReturn[1], phoneNumberReturn[2], phoneNumberReturn[3], phoneNumberReturn[4]);
802
0
      offset_parameter_type += 5;
803
0
    }
804
0
    break;
805
0
    case BUSY_IDLE_STATUS:
806
0
        proto_tree_add_item(tree, hf_ansi_tcap_busy_idle_status, tvb, offset_parameter_type, 1, ENC_BIG_ENDIAN);
807
0
        offset_parameter_type += 1;
808
0
    break;
809
0
    case CALL_FORWARDING_STATUS:
810
0
      proto_tree_add_item(tree, hf_ansi_tcap_parameter_call_forwarding_on_busy, tvb, offset_parameter_type, 1, ENC_BIG_ENDIAN);
811
0
      proto_tree_add_item(tree, hf_ansi_tcap_parameter_call_forwarding_dont_answer, tvb, offset_parameter_type, 1, ENC_BIG_ENDIAN);
812
0
      proto_tree_add_item(tree, hf_ansi_tcap_parameter_selective_forwarding, tvb, offset_parameter_type, 1, ENC_BIG_ENDIAN);
813
0
      offset_parameter_type += 1;
814
0
    break;
815
0
    case ORIGINATING_RESTRICTIONS:
816
0
        proto_tree_add_item(tree, hf_ansi_tcap_originating_restrictions, tvb, offset_parameter_type, 1, ENC_BIG_ENDIAN);
817
0
        offset_parameter_type += 1;
818
0
    break;
819
0
    case TERMINATING_RESTRICTIONS:
820
0
        proto_tree_add_item(tree, hf_ansi_tcap_terminating_restrictions, tvb, offset_parameter_type, 1, ENC_BIG_ENDIAN);
821
0
        offset_parameter_type += 1;
822
0
    break;
823
0
    case DN_TO_LINE_SERVICE_TYPE_MAPPING:
824
0
      proto_tree_add_item(tree, hf_ansi_tcap_parameter_dn_match, tvb, offset_parameter_type, 1, ENC_BIG_ENDIAN);
825
0
      proto_tree_add_item(tree, hf_ansi_tcap_parameter_dn_line_service, tvb, offset_parameter_type, 1, ENC_BIG_ENDIAN);
826
0
      offset_parameter_type += 1;
827
0
      break;
828
0
    case DURATION:
829
0
    {
830
0
        int hour, minute, second;
831
0
        subtree = proto_tree_add_subtree(tree, tvb, offset_parameter_type, 3, ett_ansi_tcap_duration, &subitem, "Call duration");
832
833
0
        proto_tree_add_item_ret_int(subtree, hf_ansi_tcap_duration_hour, tvb, offset_parameter_type, 1, ENC_BIG_ENDIAN, &hour);
834
0
        offset_parameter_type += 1;
835
0
        proto_tree_add_item_ret_int(subtree, hf_ansi_tcap_duration_minute, tvb, offset_parameter_type, 1, ENC_BIG_ENDIAN, &minute);
836
0
        offset_parameter_type += 1;
837
0
        proto_tree_add_item_ret_int(subtree, hf_ansi_tcap_duration_second, tvb, offset_parameter_type, 1, ENC_BIG_ENDIAN, &second);
838
0
        offset_parameter_type += 1;
839
0
        proto_item_append_text(subitem, " (%02d:%02d:%02d)", hour, minute, second);
840
0
    }
841
0
    break;
842
0
    case RETURNED_DATA:
843
0
        proto_tree_add_item(tree, hf_ansi_tcap_returned_data, tvb, offset_parameter_type, 1, ENC_BIG_ENDIAN);
844
0
        offset_parameter_type += 1;
845
0
    break;
846
0
    case BEARER_CAPABILITY_REQUESTED:
847
    // TODO finishing out bearer capability, look into ansi_map
848
0
      proto_tree_add_item(tree, hf_ansi_tcap_parameter_bearer_capability_requested1, tvb, offset_parameter_type, 1, ENC_BIG_ENDIAN);
849
0
      offset_parameter_type +=1;
850
0
      proto_tree_add_item(tree, hf_ansi_tcap_parameter_bearer_capability_requested2, tvb, offset_parameter_type, 1, ENC_BIG_ENDIAN);
851
0
      offset_parameter_type +=1;
852
0
      proto_tree_add_item(tree, hf_ansi_tcap_parameter_bearer_capability_requested2a, tvb, offset_parameter_type, 1, ENC_BIG_ENDIAN);
853
0
      offset_parameter_type +=1;
854
0
      proto_tree_add_item(tree, hf_ansi_tcap_parameter_bearer_capability_requested2b, tvb, offset_parameter_type, 1, ENC_BIG_ENDIAN);
855
0
      offset_parameter_type +=1;
856
0
      proto_tree_add_item(tree, hf_ansi_tcap_parameter_bearer_capability_requested3, tvb, offset_parameter_type, 1, ENC_BIG_ENDIAN);
857
0
      offset_parameter_type +=1;
858
0
      proto_tree_add_item(tree, hf_ansi_tcap_parameter_bearer_capability_requested3a, tvb, offset_parameter_type, 1, ENC_BIG_ENDIAN);
859
0
      offset_parameter_type += 1;
860
0
      break;
861
0
    case BEARER_CAPABILITY_SUPPORTED:
862
0
        proto_tree_add_item(tree, hf_ansi_tcap_bearer_capability_supported, tvb, offset_parameter_type, 1, ENC_BIG_ENDIAN);
863
0
        offset_parameter_type += 1;
864
0
    break;
865
0
    case REFERENCE_ID:
866
0
        proto_tree_add_item(tree, hf_ansi_tcap_reference_id, tvb, offset_parameter_type, 1, ENC_BIG_ENDIAN);
867
0
        offset_parameter_type += 1;
868
0
    break;
869
0
    case BUSINESS_GROUP:
870
0
      proto_tree_add_item(tree, hf_ansi_tcap_parameter_business_group_length_spare, tvb, offset_parameter_type, 1, ENC_BIG_ENDIAN);
871
0
      proto_tree_add_item(tree, hf_ansi_tcap_parameter_business_group_length_AttSt, tvb, offset_parameter_type, 1, ENC_BIG_ENDIAN);
872
0
      proto_tree_add_item(tree, hf_ansi_tcap_parameter_business_group_length_BGID, tvb, offset_parameter_type, 1, ENC_BIG_ENDIAN);
873
0
      proto_tree_add_item(tree, hf_ansi_tcap_parameter_business_group_length_LP11, tvb, offset_parameter_type, 1, ENC_BIG_ENDIAN);
874
0
      proto_tree_add_item(tree, hf_ansi_tcap_parameter_business_group_length_Party_Selector, tvb, offset_parameter_type, 1, ENC_BIG_ENDIAN);
875
0
      offset_parameter_type +=1;
876
0
      proto_tree_add_item(tree, hf_ansi_tcap_parameter_business_group_id, tvb, offset_parameter_type, 3, ENC_BIG_ENDIAN);
877
0
      offset_parameter_type +=3;
878
0
      proto_tree_add_item(tree, hf_ansi_tcap_parameter_business_group_subgroup_id, tvb, offset_parameter_type, 2, ENC_BIG_ENDIAN);
879
0
      offset_parameter_type +=2;
880
0
      proto_tree_add_item(tree, hf_ansi_tcap_parameter_business_group_line_privileges, tvb, offset_parameter_type, 1, ENC_BIG_ENDIAN);
881
0
      offset_parameter_type +=1;
882
0
      break;
883
0
    case SIGNALLING_NETWORKS_IDENTIFIER:
884
0
        proto_tree_add_item(tree, hf_ansi_tcap_parameter_signalling_networks_id, tvb, offset_parameter_type, 1, ENC_BIG_ENDIAN);
885
0
        offset_parameter_type += (1+tvb_get_uint8(tvb, offset_parameter_type));
886
0
    break;
887
0
    case GENERIC_NAME:
888
0
    {
889
0
      uint8_t character_number = tvb_get_uint8(tvb, offset_parameter_type);
890
0
      offset_parameter_type +=1;
891
0
      proto_tree_add_item(tree, hf_ansi_tcap_parameter_generic_name_type_name, tvb, offset_parameter_type, 1, ENC_BIG_ENDIAN);
892
0
      proto_tree_add_item(tree, hf_ansi_tcap_parameter_generic_name_availability, tvb, offset_parameter_type, 1, ENC_BIG_ENDIAN);
893
0
      proto_tree_add_item(tree, hf_ansi_tcap_parameter_generic_name_spare, tvb, offset_parameter_type, 1, ENC_BIG_ENDIAN);
894
0
      proto_tree_add_item(tree, hf_ansi_tcap_parameter_generic_name_presentation, tvb, offset_parameter_type, 1, ENC_BIG_ENDIAN);
895
0
      offset_parameter_type += 1;
896
0
      proto_tree_add_item(tree, hf_ansi_tcap_parameter_generic_name_characters, tvb, offset_parameter_type, character_number, ENC_ASCII);
897
0
      offset_parameter_type += character_number;
898
0
    }
899
0
    break;
900
0
    case MESSAGE_WAITING_INDICATOR_TYPE:
901
0
      proto_tree_add_uint(tree, hf_ansi_tcap_message_waiting_indicator_type, tvb, offset_parameter_type, 1, swap_nibbles(tvb_get_uint8(tvb, offset_parameter_type)));
902
0
      offset_parameter_type += 1;
903
0
    break;
904
0
    case LOOK_AHEAD_FOR_BUSY:
905
0
      proto_tree_add_item(tree, hf_ansi_tcap_parameter_look_ahead_for_busy_ack_type, tvb, offset_parameter_type, 1, ENC_BIG_ENDIAN);
906
0
      proto_tree_add_item(tree, hf_ansi_tcap_parameter_look_ahead_for_busy_spare, tvb, offset_parameter_type, 1, ENC_BIG_ENDIAN);
907
0
      proto_tree_add_item(tree, hf_ansi_tcap_parameter_look_ahead_for_busy_location_field, tvb, offset_parameter_type, 1, ENC_BIG_ENDIAN);
908
0
      offset_parameter_type += 1;
909
0
    break;
910
0
    case CIRCUIT_IDENTIFICATION_CODE:
911
0
      proto_tree_add_item(tree, hf_ansi_tcap_parameter_CIC_lsb, tvb, offset_parameter_type, 1, ENC_BIG_ENDIAN);
912
0
      offset_parameter_type +=1;
913
0
      proto_tree_add_item(tree, hf_ansi_tcap_parameter_CIC_spare, tvb, offset_parameter_type, 1, ENC_BIG_ENDIAN);
914
0
      proto_tree_add_item(tree, hf_ansi_tcap_parameter_CIC_msb, tvb, offset_parameter_type, 1, ENC_BIG_ENDIAN);
915
0
      offset_parameter_type += 1;
916
0
      break;
917
0
    case PRECEDENCE_IDENTIFIER:
918
0
      proto_tree_add_item(tree, hf_ansi_tcap_parameter_precedence_level_spare, tvb, offset_parameter_type, 1, ENC_BIG_ENDIAN);
919
0
      proto_tree_add_item(tree, hf_ansi_tcap_parameter_precedence_level, tvb, offset_parameter_type, 1, ENC_BIG_ENDIAN);
920
0
      offset_parameter_type += 1;
921
0
      proto_tree_add_item(tree, hf_ansi_tcap_parameter_precedence_id1, tvb, offset_parameter_type, 1, ENC_BIG_ENDIAN);
922
0
      proto_tree_add_item(tree, hf_ansi_tcap_parameter_precedence_id2, tvb, offset_parameter_type, 1, ENC_BIG_ENDIAN);
923
0
      offset_parameter_type += 1;
924
0
      proto_tree_add_item(tree, hf_ansi_tcap_parameter_precedence_id3, tvb, offset_parameter_type, 1, ENC_BIG_ENDIAN);
925
0
      proto_tree_add_item(tree, hf_ansi_tcap_parameter_precedence_id4, tvb, offset_parameter_type, 1, ENC_BIG_ENDIAN);
926
0
      offset_parameter_type += 1;
927
0
      proto_tree_add_item(tree, hf_ansi_tcap_parameter_precedence_mlpp_service_domain, tvb, offset_parameter_type, 3, ENC_NA);
928
0
      offset_parameter_type += 3;
929
0
    break;
930
0
    case CALL_REFERENCE_IDENTIFIER:
931
0
        proto_tree_add_item(tree, hf_ansi_tcap_reference_id_call_identify, tvb, offset_parameter_type, 3, ENC_NA);
932
0
        offset_parameter_type += 3;
933
0
        proto_tree_add_item(tree, hf_ansi_tcap_reference_id_point_code, tvb, offset_parameter_type, 3, ENC_NA);
934
0
        offset_parameter_type += 3;
935
0
    break;
936
0
    case AUTHORIZATION:
937
0
        proto_tree_add_item(tree, hf_ansi_tcap_parameter_authorization, tvb, offset_parameter_type, 1, ENC_BIG_ENDIAN);
938
0
        offset_parameter_type += 1;
939
0
    break;
940
0
    case INTEGRITY:
941
0
        proto_tree_add_item(tree, hf_ansi_tcap_integrity_algid_id, tvb, offset_parameter_type, 1, ENC_BIG_ENDIAN);
942
0
        offset_parameter_type += 1;
943
0
        proto_tree_add_item(tree, hf_ansi_tcap_integrity_algid, tvb, offset_parameter_type, 1, ENC_BIG_ENDIAN);
944
0
        offset_parameter_type += (1+ tvb_get_uint8(tvb, offset_parameter_type));
945
0
        proto_tree_add_item(tree, hf_ansi_tcap_integrity_value_id, tvb, offset_parameter_type, 1, ENC_BIG_ENDIAN);
946
0
        offset_parameter_type += 1;
947
0
        proto_tree_add_item(tree, hf_ansi_tcap_integrity_value, tvb, offset_parameter_type, 1, ENC_BIG_ENDIAN);
948
0
        offset_parameter_type += (1+ tvb_get_uint8(tvb, offset_parameter_type));
949
0
    break;
950
951
    /* 2 octet length parameters identifiers */
952
0
    case SEQUENCE_NUMBER:
953
0
      proto_tree_add_item(tree, hf_ansi_tcap_sequence_number, tvb, offset_parameter_type, 1, ENC_BIG_ENDIAN);
954
0
      offset_parameter_type += (1 + tvb_get_uint8(tvb, offset_parameter_type));
955
0
    break;
956
0
    case NUMBER_OF_MESSAGES:
957
0
        proto_tree_add_item(tree, hf_ansi_tcap_num_messages, tvb, offset_parameter_type, 1, ENC_BIG_ENDIAN);
958
0
        offset_parameter_type += (1 + tvb_get_uint8(tvb, offset_parameter_type));
959
0
        break;
960
0
      case DISPLAY_TEXT:
961
0
          proto_tree_add_item(tree, hf_ansi_tcap_display_text, tvb, offset_parameter_type, 1, ENC_ASCII|ENC_BIG_ENDIAN);
962
0
          offset_parameter_type += (1 + tvb_get_uint8(tvb, offset_parameter_type));
963
0
        break;
964
965
0
      case KEY_EXCHANGE:
966
0
          proto_tree_add_item(tree, hf_ansi_tcap_key_exchange_algid_id, tvb, offset_parameter_type, 1, ENC_BIG_ENDIAN);
967
0
          offset_parameter_type += 1;
968
0
          proto_tree_add_item(tree, hf_ansi_tcap_key_exchange_algid, tvb, offset_parameter_type, 1, ENC_BIG_ENDIAN);
969
0
          offset_parameter_type += (1 + tvb_get_uint8(tvb, offset_parameter_type));
970
0
          proto_tree_add_item(tree, hf_ansi_tcap_key_exchange_value_id, tvb, offset_parameter_type, 1, ENC_BIG_ENDIAN);
971
0
          offset_parameter_type += 1;
972
0
          proto_tree_add_item(tree, hf_ansi_tcap_key_exchange_value, tvb, offset_parameter_type, 1, ENC_BIG_ENDIAN);
973
0
          offset_parameter_type += (1 + tvb_get_uint8(tvb, offset_parameter_type));
974
0
        break;
975
976
0
      case SCCP_CALLED_PARTY_ADDRESS:
977
      // TODO Parameter found in T1.112
978
0
        break;
979
980
0
    default:
981
0
    break;
982
0
  }
983
0
  return offset_parameter_type;
984
0
}
985
986
/* Store Invoke information needed for the corresponding reply */
987
static void
988
0
save_invoke_data(packet_info *pinfo, proto_tree *tree _U_, tvbuff_t *tvb _U_){
989
0
  struct ansi_tcap_invokedata_t *ansi_tcap_saved_invokedata;
990
0
  char *src, *dst;
991
0
  char *buf;
992
993
0
  src = address_to_str(pinfo->pool, &(pinfo->src));
994
0
  dst = address_to_str(pinfo->pool, &(pinfo->dst));
995
996
0
  if ((!pinfo->fd->visited)&&(ansi_tcap_private.TransactionID_str)){
997
998
          /* Only do this once XXX I hope it's the right thing to do */
999
          /* The hash string needs to contain src and dest to distinguish different flows */
1000
0
          switch(ansi_tcap_response_matching_type){
1001
0
                        case ANSI_TCAP_TID_ONLY:
1002
0
                                buf = wmem_strdup(pinfo->pool, ansi_tcap_private.TransactionID_str);
1003
0
                                break;
1004
0
                        case ANSI_TCAP_TID_AND_SOURCE:
1005
0
                                buf = wmem_strdup_printf(pinfo->pool, "%s%s",ansi_tcap_private.TransactionID_str,src);
1006
0
                                break;
1007
0
                        case ANSI_TCAP_TID_SOURCE_AND_DEST:
1008
0
                        default:
1009
0
                                buf = wmem_strdup_printf(pinfo->pool, "%s%s%s",ansi_tcap_private.TransactionID_str,src,dst);
1010
0
                                break;
1011
0
                }
1012
1013
0
          ansi_tcap_saved_invokedata = wmem_new(wmem_file_scope(), struct ansi_tcap_invokedata_t);
1014
0
          ansi_tcap_saved_invokedata->OperationCode = ansi_tcap_private.d.OperationCode;
1015
0
          ansi_tcap_saved_invokedata->OperationCode_national = ansi_tcap_private.d.OperationCode_national;
1016
0
          ansi_tcap_saved_invokedata->OperationCode_private = ansi_tcap_private.d.OperationCode_private;
1017
1018
0
          wmem_multimap_insert32(TransactionId_table,
1019
0
                        wmem_strdup(wmem_file_scope(), buf),
1020
0
                        pinfo->num,
1021
0
                        ansi_tcap_saved_invokedata);
1022
          /*
1023
          ws_warning("Tcap Invoke Hash string %s",buf);
1024
          */
1025
0
  }
1026
0
}
1027
1028
static bool
1029
0
find_saved_invokedata(packet_info *pinfo, proto_tree *tree _U_, tvbuff_t *tvb _U_){
1030
0
  struct ansi_tcap_invokedata_t *ansi_tcap_saved_invokedata;
1031
0
  char *src, *dst;
1032
0
  char *buf;
1033
1034
0
  if (!ansi_tcap_private.TransactionID_str) {
1035
0
    return false;
1036
0
  }
1037
1038
0
  src = address_to_str(pinfo->pool, &(pinfo->src));
1039
0
  dst = address_to_str(pinfo->pool, &(pinfo->dst));
1040
1041
  /* The hash string needs to contain src and dest to distinguish different flows */
1042
0
  buf = (char *)wmem_alloc(pinfo->pool, MAX_TID_STR_LEN);
1043
0
  buf[0] = '\0';
1044
  /* Reverse order to invoke */
1045
0
  switch(ansi_tcap_response_matching_type){
1046
0
        case ANSI_TCAP_TID_ONLY:
1047
0
                snprintf(buf,MAX_TID_STR_LEN,"%s",ansi_tcap_private.TransactionID_str);
1048
0
                break;
1049
0
        case ANSI_TCAP_TID_AND_SOURCE:
1050
0
                snprintf(buf,MAX_TID_STR_LEN,"%s%s",ansi_tcap_private.TransactionID_str,dst);
1051
0
                break;
1052
0
        case ANSI_TCAP_TID_SOURCE_AND_DEST:
1053
0
        default:
1054
0
                snprintf(buf,MAX_TID_STR_LEN,"%s%s%s",ansi_tcap_private.TransactionID_str,dst,src);
1055
0
                break;
1056
0
  }
1057
1058
  /* An invoke of an earlier frame: this frame's are not all saved yet in the first pass */
1059
0
  ansi_tcap_saved_invokedata = (struct ansi_tcap_invokedata_t *)wmem_multimap_lookup32_le(TransactionId_table, buf, pinfo->num - 1);
1060
0
  if(ansi_tcap_saved_invokedata){
1061
0
          ansi_tcap_private.d.OperationCode                      = ansi_tcap_saved_invokedata->OperationCode;
1062
0
          ansi_tcap_private.d.OperationCode_national = ansi_tcap_saved_invokedata->OperationCode_national;
1063
0
          ansi_tcap_private.d.OperationCode_private  = ansi_tcap_saved_invokedata->OperationCode_private;
1064
0
          return true;
1065
0
  }
1066
0
  return false;
1067
0
}
1068
1069
/* As currently ANSI MAP is the only possible sub dissector this function
1070
 *  must be improved to handle general cases.
1071
 *
1072
 *
1073
 *
1074
 * TODO:
1075
 * 1)Handle national codes
1076
 *     Design option
1077
 *     - Create a ansi.tcap.national dissector table and have dissectors for
1078
 *       national codes register there and let ansi tcap call them.
1079
 * 2)Handle Private codes properly
1080
 *     Design question
1081
 *     Unclear how to differentiate between different private "code sets".
1082
 *     Use SCCP SSN table as before? or a ansi.tcap.private dissector table?
1083
 *
1084
 */
1085
static bool
1086
0
find_tcap_subdissector(tvbuff_t *tvb, asn1_ctx_t *actx, proto_tree *tree){
1087
0
        proto_item *item;
1088
1089
        /* If "DialoguePortion objectApplicationId ObjectIDApplicationContext
1090
         * points to the subdissector this code can be used.
1091
         *
1092
        if(ansi_tcap_private.d.oid_is_present){
1093
                call_ber_oid_callback(ansi_tcap_private.objectApplicationId_oid, tvb, 0, actx-pinfo, tree, NULL);
1094
                return true;
1095
        }
1096
        */
1097
0
        if(ansi_tcap_private.d.pdu == 1){
1098
                /* Save Invoke data for this transaction */
1099
0
                save_invoke_data(actx->pinfo, tree, tvb);
1100
0
        }else{
1101
                /* Get saved data for this transaction */
1102
0
                if(find_saved_invokedata(actx->pinfo, tree, tvb)){
1103
0
                        if(ansi_tcap_private.d.OperationCode == 0){
1104
                                /* national */
1105
0
                                item = proto_tree_add_int(tree, hf_ansi_tcap_national, tvb, 0, 0, ansi_tcap_private.d.OperationCode_national);
1106
0
                        }else{
1107
0
                                item = proto_tree_add_int(tree, hf_ansi_tcap_private, tvb, 0, 0, ansi_tcap_private.d.OperationCode_private);
1108
0
                        }
1109
0
                        proto_item_set_generated(item);
1110
0
                        ansi_tcap_private.d.OperationCode_item = item;
1111
0
                }
1112
0
        }
1113
        /*
1114
         * Each component handed to a subdissector adds a layer; stop before
1115
         * the layer limit in call_dissector_work(), leaving room for the
1116
         * subdissectors' own layers (e.g. ANSI MAP and IS-637).
1117
         */
1118
0
        if (wmem_list_count(actx->pinfo->layers) + 16 >= prefs.gui_max_tree_depth) {
1119
0
                proto_tree_add_expert_remaining(tree, actx->pinfo, &ei_ansi_tcap_too_many_components, tvb, 0);
1120
0
                return false;
1121
0
        }
1122
0
        if(ansi_tcap_private.d.OperationCode == 0){
1123
                /* national */
1124
0
                proto_item          *item2;
1125
0
                proto_tree          *tree2=NULL;
1126
0
                uint8_t family = (ansi_tcap_private.d.OperationCode_national & 0x7f00)>>8;
1127
0
                uint8_t specifier = (uint8_t)(ansi_tcap_private.d.OperationCode_national & 0xff);
1128
0
                if(!dissector_try_uint(ansi_tcap_national_opcode_table, ansi_tcap_private.d.OperationCode_national, tvb, actx->pinfo, actx->subtree.top_tree)){
1129
0
                        proto_tree_add_expert_format_remaining(tree, actx->pinfo, &ei_ansi_tcap_dissector_not_implemented, tvb, 0,
1130
0
                                        "Dissector for ANSI TCAP NATIONAL code:0x%x(Family %u, Specifier %u) "
1131
0
                                        "not implemented. Contact Wireshark developers if you want this supported(Spec required)",
1132
0
                                        ansi_tcap_private.d.OperationCode_national, family, specifier);
1133
0
                        item2 = proto_tree_add_item(tree, hf_ansi_tcap_parameter_set, tvb, 0, 1, ENC_NA);
1134
0
                        tree2 = proto_item_add_subtree(item2, ett_tcap);
1135
0
                        int offset_parameter = 0;
1136
0
                        proto_tree_add_item(tree2, hf_ansi_tcap_parameter_set_start, tvb, 0, 1, ENC_BIG_ENDIAN);
1137
1138
0
                        if(((tvb_get_uint8(tvb, 0)) & 0xff) == 0xf2) {
1139
0
                            offset_parameter += 1;
1140
0
                            int parameter_length = tvb_get_uint8(tvb, offset_parameter);
1141
0
                            proto_tree_add_item(tree2, hf_ansi_tcap_parameter_length, tvb, offset_parameter, 1, ENC_BIG_ENDIAN);
1142
0
                            proto_item_set_len(item2, parameter_length + 2);
1143
0
                            offset_parameter += 1;
1144
0
                            while (offset_parameter <= parameter_length)
1145
0
                            {
1146
0
                                offset_parameter = parameter_type(tree2, tvb, offset_parameter);
1147
0
                                offset_parameter +=1;
1148
0
                            }
1149
0
                        }else{
1150
0
                            expert_add_info(actx->pinfo, item2, &ei_ansi_tcap_no_parameters);
1151
0
                        }
1152
1153
0
                        return false;
1154
0
                }
1155
0
                return true;
1156
0
        }else if(ansi_tcap_private.d.OperationCode == 1){
1157
                /* private */
1158
0
                if((ansi_tcap_private.d.OperationCode_private & 0xff00) == 0x0900){
1159
                    /* This is abit of a hack as it assumes the private codes with a "family" of 0x09 is ANSI MAP
1160
                    * See TODO above.
1161
                    * N.S0005-0 v 1.0 TCAP Formats and Procedures 5-16 Application Services
1162
                    * 6.3.2 Component Portion
1163
                    * The Operation Code is partitioned into an Operation Family followed by a
1164
                    * Specifier associated with each Operation Family member. For TIA/EIA-41 the
1165
                    * Operation Family is coded as decimal 9. Bit H of the Operation Family is always
1166
                    * coded as 0.
1167
                    */
1168
0
                    call_dissector_with_data(ansi_map_handle, tvb, actx->pinfo, actx->subtree.top_tree, &ansi_tcap_private);
1169
1170
0
                    return true;
1171
0
                } else if ((ansi_tcap_private.d.OperationCode_private & 0xf000) == 0x6000) {
1172
0
                    call_dissector_with_data(ain_handle, tvb, actx->pinfo, actx->subtree.top_tree, &ansi_tcap_private);
1173
0
                    return true;
1174
0
                }
1175
0
        }
1176
0
        proto_tree_add_expert_format_remaining(tree, actx->pinfo, &ei_ansi_tcap_dissector_not_implemented, tvb, 0,
1177
0
            "Dissector for ANSI TCAP PRIVATE code:%u not implemented.\n"
1178
0
            "Contact Wireshark developers if you want this supported(Spec required)",
1179
0
            ansi_tcap_private.d.OperationCode_private);
1180
0
        return false;
1181
0
}
1182
1183
/*--- Cyclic dependencies ---*/
1184
1185
/* ReturnResult/parameter -> ReturnResult/parameter */
1186
static unsigned dissect_ansi_tcap_T_returnResult_parameter(bool implicit_tag _U_, tvbuff_t *tvb _U_, unsigned offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_);
1187
1188
/* ReturnError/parameter -> ReturnError/parameter */
1189
static unsigned dissect_ansi_tcap_T_returnError_parameter(bool implicit_tag _U_, tvbuff_t *tvb _U_, unsigned offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_);
1190
1191
1192
1193
1194
static unsigned
1195
0
dissect_ansi_tcap_T_national(bool implicit_tag _U_, tvbuff_t *tvb _U_, unsigned offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
1196
0
 proto_tree *subtree;
1197
0
 proto_item *spcifier_item;
1198
0
 int start_offset = offset;
1199
0
 uint8_t family;
1200
0
 uint8_t specifier;
1201
1202
0
    offset = dissect_ber_constrained_integer(implicit_tag, actx, tree, tvb, offset,
1203
0
                                                            -32768, 32767U, hf_index, (uint32_t*)&ansi_tcap_private.d.OperationCode_national);
1204
1205
  /* mask off the H bit */
1206
0
  ansi_tcap_private.d.OperationCode_national = (ansi_tcap_private.d.OperationCode_national&0x7fff);
1207
1208
0
  subtree = proto_item_add_subtree(actx->created_item, ett_ansi_tcap_op_code_nat);
1209
  /* Bit H is used to distinguish between Operations that require a reply and those that do not. A value of 1
1210
   * indicates that a reply is required; a value of 0 indicates that a reply is not required.
1211
   */
1212
0
  family = (ansi_tcap_private.d.OperationCode_national & 0x7f00)>>8;
1213
0
  specifier = (uint8_t)(ansi_tcap_private.d.OperationCode_national & 0xff);
1214
0
  proto_tree_add_item(subtree, hf_ansi_tcap_bit_h, tvb, start_offset, 2, ENC_BIG_ENDIAN);
1215
0
  proto_tree_add_item(subtree, hf_ansi_tcap_op_family, tvb, start_offset, 2, ENC_BIG_ENDIAN);
1216
0
  spcifier_item = proto_tree_add_item(subtree, hf_ansi_tcap_op_specifier, tvb, start_offset, 2, ENC_BIG_ENDIAN);
1217
1218
0
  switch(family){
1219
0
  case 0:
1220
    /* All Families ( Not used ) */
1221
0
    break;
1222
0
  case 1:
1223
    /* Parameter */
1224
0
    if(specifier== 1){
1225
0
      proto_item_append_text(spcifier_item, " Provide Value");
1226
0
    }else if (specifier== 2){
1227
0
      proto_item_append_text(spcifier_item, " Set Value");
1228
0
    }
1229
0
    break;
1230
0
  case 2:
1231
    /* Charging */
1232
0
    if (specifier== 1){
1233
0
      proto_item_append_text(spcifier_item, " Bill Call");
1234
0
    }
1235
0
    break;
1236
0
  case 3:
1237
    /* Provide Instructions */
1238
0
    if (specifier== 1){
1239
0
      proto_item_append_text(spcifier_item, " Start");
1240
0
    }else if (specifier== 2){
1241
0
      proto_item_append_text(spcifier_item, " Assist");
1242
0
    }
1243
0
    break;
1244
0
  case 4:
1245
    /* Connection Control */
1246
0
    if (specifier== 1){
1247
0
      proto_item_append_text(spcifier_item, " Connect");
1248
0
    }else if (specifier== 2){
1249
0
      proto_item_append_text(spcifier_item, " Temporary Connect");
1250
0
    }else if (specifier== 3){
1251
0
      proto_item_append_text(spcifier_item, " Disconnect");
1252
0
    }else if (specifier== 4){
1253
0
      proto_item_append_text(spcifier_item, " Forward Disconnect");
1254
0
    }
1255
0
    break;
1256
0
  default:
1257
0
    break;
1258
0
  }
1259
1260
1261
1262
0
  return offset;
1263
0
}
1264
1265
1266
1267
static unsigned
1268
0
dissect_ansi_tcap_T_private(bool implicit_tag _U_, tvbuff_t *tvb _U_, unsigned offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
1269
0
  offset = dissect_ber_integer(implicit_tag, actx, tree, tvb, offset, hf_index,
1270
0
                                                (uint32_t*)&ansi_tcap_private.d.OperationCode_private);
1271
1272
0
  return offset;
1273
0
}
1274
1275
1276
static const value_string ansi_tcap_OperationCode_vals[] = {
1277
  {  16, "national" },
1278
  {  17, "private" },
1279
  { 0, NULL }
1280
};
1281
1282
static const ber_choice_t OperationCode_choice[] = {
1283
  {  16, &hf_ansi_tcap_national  , BER_CLASS_PRI, 16, BER_FLAGS_IMPLTAG, dissect_ansi_tcap_T_national },
1284
  {  17, &hf_ansi_tcap_private   , BER_CLASS_PRI, 17, BER_FLAGS_IMPLTAG, dissect_ansi_tcap_T_private },
1285
  { 0, NULL, 0, 0, 0, NULL }
1286
};
1287
1288
static unsigned
1289
0
dissect_ansi_tcap_OperationCode(bool implicit_tag _U_, tvbuff_t *tvb _U_, unsigned offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
1290
0
  offset = dissect_ber_choice(actx, tree, tvb, offset,
1291
0
                                 OperationCode_choice, hf_index, ett_ansi_tcap_OperationCode,
1292
0
                                 &ansi_tcap_private.d.OperationCode);
1293
1294
0
  ansi_tcap_private.d.OperationCode_item = actx->created_item;
1295
0
  return offset;
1296
0
}
1297
1298
1299
1300
static unsigned
1301
0
dissect_ansi_tcap_INTEGER_M128_127(bool implicit_tag _U_, tvbuff_t *tvb _U_, unsigned offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
1302
0
  offset = dissect_ber_constrained_integer(implicit_tag, actx, tree, tvb, offset,
1303
0
                                                            -128, 127U, hf_index, NULL);
1304
1305
0
  return offset;
1306
0
}
1307
1308
1309
static const value_string ansi_tcap_ANSIMAPPrivateErrorcode_vals[] = {
1310
  { 129, "unrecognized-MIN" },
1311
  { 130, "unrecognized-ESN" },
1312
  { 131, "mINorHLR-Mismatch" },
1313
  { 132, "operation-Sequence-Problem" },
1314
  { 133, "resource-Shortage" },
1315
  { 134, "operation-Not-Supported" },
1316
  { 135, "trunk-Unavailable" },
1317
  { 136, "parameter-Error" },
1318
  { 137, "system-Failure" },
1319
  { 138, "unrecognized-Parameter-Value" },
1320
  { 139, "feature-Inactive" },
1321
  { 140, "missing-Parameter" },
1322
  { 0, NULL }
1323
};
1324
1325
1326
static unsigned
1327
0
dissect_ansi_tcap_ANSIMAPPrivateErrorcode(bool implicit_tag _U_, tvbuff_t *tvb _U_, unsigned offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
1328
0
  offset = dissect_ber_constrained_integer(implicit_tag, actx, tree, tvb, offset,
1329
0
                                                            0U, 255U, hf_index, NULL);
1330
1331
0
  return offset;
1332
0
}
1333
1334
1335
static const value_string ansi_tcap_ErrorCode_vals[] = {
1336
  {  19, "national" },
1337
  {  20, "private" },
1338
  { 0, NULL }
1339
};
1340
1341
static const ber_choice_t ErrorCode_choice[] = {
1342
  {  19, &hf_ansi_tcap_national_01, BER_CLASS_PRI, 19, 0, dissect_ansi_tcap_INTEGER_M128_127 },
1343
  {  20, &hf_ansi_tcap_ec_private, BER_CLASS_PRI, 20, BER_FLAGS_IMPLTAG, dissect_ansi_tcap_ANSIMAPPrivateErrorcode },
1344
  { 0, NULL, 0, 0, 0, NULL }
1345
};
1346
1347
static unsigned
1348
0
dissect_ansi_tcap_ErrorCode(bool implicit_tag _U_, tvbuff_t *tvb _U_, unsigned offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
1349
0
  offset = dissect_ber_choice(actx, tree, tvb, offset,
1350
0
                                 ErrorCode_choice, hf_index, ett_ansi_tcap_ErrorCode,
1351
0
                                 NULL);
1352
1353
0
  return offset;
1354
0
}
1355
1356
1357
1358
static unsigned
1359
0
dissect_ansi_tcap_TransactionID_U(bool implicit_tag _U_, tvbuff_t *tvb _U_, unsigned offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
1360
1361
0
tvbuff_t *next_tvb;
1362
0
unsigned len;
1363
1364
0
  offset = dissect_ber_octet_string(implicit_tag, actx, tree, tvb, offset, hf_index,
1365
0
                                       &next_tvb);
1366
1367
1368
0
if(next_tvb) {
1369
0
  len = tvb_reported_length_remaining(next_tvb, 0);
1370
0
  if(len !=0){
1371
    /* 0 octets for the Unidirectional,
1372
     * 4 octets for Query, Response & Abort
1373
     * 8 octets for Conversation in the order Originating then Responding TID
1374
     *
1375
     * In order to match this it seems like we should only use the last 4 octets
1376
     * in the 8 octets case.
1377
     */
1378
0
    if (len > 4){
1379
0
      ansi_tcap_private.TransactionID_str = tvb_bytes_to_str(actx->pinfo->pool, next_tvb, 4,len-4);
1380
0
    }else{
1381
0
      ansi_tcap_private.TransactionID_str = tvb_bytes_to_str(actx->pinfo->pool, next_tvb, 0,len);
1382
0
    }
1383
0
  }
1384
0
  switch(len) {
1385
0
  case 1:
1386
0
    gp_tcapsrt_info->src_tid=tvb_get_uint8(next_tvb, 0);
1387
0
    break;
1388
0
  case 2:
1389
0
    gp_tcapsrt_info->src_tid=tvb_get_ntohs(next_tvb, 0);
1390
0
    break;
1391
0
  case 4:
1392
0
    gp_tcapsrt_info->src_tid=tvb_get_ntohl(next_tvb, 0);
1393
0
    break;
1394
0
  default:
1395
0
    gp_tcapsrt_info->src_tid=0;
1396
0
    break;
1397
0
  }
1398
0
}
1399
1400
1401
0
  return offset;
1402
0
}
1403
1404
1405
1406
static unsigned
1407
0
dissect_ansi_tcap_TransactionID(bool implicit_tag _U_, tvbuff_t *tvb _U_, unsigned offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
1408
0
  offset = dissect_ber_tagged_type(implicit_tag, actx, tree, tvb, offset,
1409
0
                                      hf_index, BER_CLASS_PRI, 7, true, dissect_ansi_tcap_TransactionID_U);
1410
1411
0
  return offset;
1412
0
}
1413
1414
1415
1416
static unsigned
1417
0
dissect_ansi_tcap_OCTET_STRING_SIZE_1(bool implicit_tag _U_, tvbuff_t *tvb _U_, unsigned offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
1418
0
  offset = dissect_ber_constrained_octet_string(implicit_tag, actx, tree, tvb, offset,
1419
0
                                                   1, 1, hf_index, NULL);
1420
1421
0
  return offset;
1422
0
}
1423
1424
1425
1426
static unsigned
1427
0
dissect_ansi_tcap_ProtocolVersion(bool implicit_tag _U_, tvbuff_t *tvb _U_, unsigned offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
1428
0
  offset = dissect_ber_tagged_type(implicit_tag, actx, tree, tvb, offset,
1429
0
                                      hf_index, BER_CLASS_PRI, 26, true, dissect_ansi_tcap_OCTET_STRING_SIZE_1);
1430
1431
0
  return offset;
1432
0
}
1433
1434
1435
1436
static unsigned
1437
0
dissect_ansi_tcap_INTEGER(bool implicit_tag _U_, tvbuff_t *tvb _U_, unsigned offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
1438
0
  offset = dissect_ber_integer(implicit_tag, actx, tree, tvb, offset, hf_index,
1439
0
                                                NULL);
1440
1441
0
  return offset;
1442
0
}
1443
1444
1445
1446
static unsigned
1447
0
dissect_ansi_tcap_IntegerApplicationContext(bool implicit_tag _U_, tvbuff_t *tvb _U_, unsigned offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
1448
0
  offset = dissect_ber_tagged_type(implicit_tag, actx, tree, tvb, offset,
1449
0
                                      hf_index, BER_CLASS_PRI, 27, true, dissect_ansi_tcap_INTEGER);
1450
1451
0
  return offset;
1452
0
}
1453
1454
1455
1456
static unsigned
1457
0
dissect_ansi_tcap_OBJECT_IDENTIFIER(bool implicit_tag _U_, tvbuff_t *tvb _U_, unsigned offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
1458
0
  offset = dissect_ber_object_identifier(implicit_tag, actx, tree, tvb, offset, hf_index, NULL);
1459
1460
0
  return offset;
1461
0
}
1462
1463
1464
1465
static unsigned
1466
0
dissect_ansi_tcap_ObjectIDApplicationContext(bool implicit_tag _U_, tvbuff_t *tvb _U_, unsigned offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
1467
1468
0
 static const char * oid_str;
1469
1470
0
   offset = dissect_ber_tagged_type(implicit_tag, actx, tree, tvb, offset,
1471
0
                                      hf_index, BER_CLASS_PRI, 28, true, dissect_ansi_tcap_OBJECT_IDENTIFIER);
1472
1473
0
  ansi_tcap_private.objectApplicationId_oid= (const void*) oid_str;
1474
0
  ansi_tcap_private.oid_is_present=true;
1475
1476
1477
0
  return offset;
1478
0
}
1479
1480
1481
static const value_string ansi_tcap_T_applicationContext_vals[] = {
1482
  {  27, "integerApplicationId" },
1483
  {  28, "objectApplicationId" },
1484
  { 0, NULL }
1485
};
1486
1487
static const ber_choice_t T_applicationContext_choice[] = {
1488
  {  27, &hf_ansi_tcap_integerApplicationId, BER_CLASS_PRI, 27, BER_FLAGS_NOOWNTAG, dissect_ansi_tcap_IntegerApplicationContext },
1489
  {  28, &hf_ansi_tcap_objectApplicationId, BER_CLASS_PRI, 28, BER_FLAGS_NOOWNTAG, dissect_ansi_tcap_ObjectIDApplicationContext },
1490
  { 0, NULL, 0, 0, 0, NULL }
1491
};
1492
1493
static unsigned
1494
0
dissect_ansi_tcap_T_applicationContext(bool implicit_tag _U_, tvbuff_t *tvb _U_, unsigned offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
1495
0
  offset = dissect_ber_choice(actx, tree, tvb, offset,
1496
0
                                 T_applicationContext_choice, hf_index, ett_ansi_tcap_T_applicationContext,
1497
0
                                 NULL);
1498
1499
0
  return offset;
1500
0
}
1501
1502
1503
1504
static unsigned
1505
0
dissect_ansi_tcap_EXTERNAL(bool implicit_tag _U_, tvbuff_t *tvb _U_, unsigned offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
1506
0
  offset = dissect_ber_external_type(implicit_tag, tree, tvb, offset, actx, hf_index, NULL);
1507
1508
0
  return offset;
1509
0
}
1510
1511
1512
static const ber_sequence_t UserInformation_U_sequence_of[1] = {
1513
  { &hf_ansi_tcap__untag_item, BER_CLASS_UNI, BER_UNI_TAG_EXTERNAL, BER_FLAGS_NOOWNTAG, dissect_ansi_tcap_EXTERNAL },
1514
};
1515
1516
static unsigned
1517
0
dissect_ansi_tcap_UserInformation_U(bool implicit_tag _U_, tvbuff_t *tvb _U_, unsigned offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
1518
0
  offset = dissect_ber_sequence_of(implicit_tag, actx, tree, tvb, offset,
1519
0
                                      UserInformation_U_sequence_of, hf_index, ett_ansi_tcap_UserInformation_U);
1520
1521
0
  return offset;
1522
0
}
1523
1524
1525
1526
static unsigned
1527
0
dissect_ansi_tcap_UserInformation(bool implicit_tag _U_, tvbuff_t *tvb _U_, unsigned offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
1528
0
  offset = dissect_ber_tagged_type(implicit_tag, actx, tree, tvb, offset,
1529
0
                                      hf_index, BER_CLASS_PRI, 29, true, dissect_ansi_tcap_UserInformation_U);
1530
1531
0
  return offset;
1532
0
}
1533
1534
1535
static const value_string ansi_tcap_T_securityContext_vals[] = {
1536
  {   0, "integerSecurityId" },
1537
  {   1, "objectSecurityId" },
1538
  { 0, NULL }
1539
};
1540
1541
static const ber_choice_t T_securityContext_choice[] = {
1542
  {   0, &hf_ansi_tcap_integerSecurityId, BER_CLASS_CON, 0, BER_FLAGS_IMPLTAG, dissect_ansi_tcap_INTEGER },
1543
  {   1, &hf_ansi_tcap_objectSecurityId, BER_CLASS_CON, 1, BER_FLAGS_IMPLTAG, dissect_ansi_tcap_OBJECT_IDENTIFIER },
1544
  { 0, NULL, 0, 0, 0, NULL }
1545
};
1546
1547
static unsigned
1548
0
dissect_ansi_tcap_T_securityContext(bool implicit_tag _U_, tvbuff_t *tvb _U_, unsigned offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
1549
0
  offset = dissect_ber_choice(actx, tree, tvb, offset,
1550
0
                                 T_securityContext_choice, hf_index, ett_ansi_tcap_T_securityContext,
1551
0
                                 NULL);
1552
1553
0
  return offset;
1554
0
}
1555
1556
1557
static const value_string ansi_tcap_T_confidentialityId_vals[] = {
1558
  {   0, "integerConfidentialityId" },
1559
  {   1, "objectConfidentialityId" },
1560
  { 0, NULL }
1561
};
1562
1563
static const ber_choice_t T_confidentialityId_choice[] = {
1564
  {   0, &hf_ansi_tcap_integerConfidentialityId, BER_CLASS_CON, 0, BER_FLAGS_IMPLTAG, dissect_ansi_tcap_INTEGER },
1565
  {   1, &hf_ansi_tcap_objectConfidentialityId, BER_CLASS_CON, 1, BER_FLAGS_IMPLTAG, dissect_ansi_tcap_OBJECT_IDENTIFIER },
1566
  { 0, NULL, 0, 0, 0, NULL }
1567
};
1568
1569
static unsigned
1570
0
dissect_ansi_tcap_T_confidentialityId(bool implicit_tag _U_, tvbuff_t *tvb _U_, unsigned offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
1571
0
  offset = dissect_ber_choice(actx, tree, tvb, offset,
1572
0
                                 T_confidentialityId_choice, hf_index, ett_ansi_tcap_T_confidentialityId,
1573
0
                                 NULL);
1574
1575
0
  return offset;
1576
0
}
1577
1578
1579
static const ber_sequence_t Confidentiality_sequence[] = {
1580
  { &hf_ansi_tcap_confidentialityId, BER_CLASS_ANY/*choice*/, -1/*choice*/, BER_FLAGS_OPTIONAL|BER_FLAGS_NOOWNTAG|BER_FLAGS_NOTCHKTAG, dissect_ansi_tcap_T_confidentialityId },
1581
  { NULL, 0, 0, 0, NULL }
1582
};
1583
1584
static unsigned
1585
0
dissect_ansi_tcap_Confidentiality(bool implicit_tag _U_, tvbuff_t *tvb _U_, unsigned offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
1586
0
  offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset,
1587
0
                                   Confidentiality_sequence, hf_index, ett_ansi_tcap_Confidentiality);
1588
1589
0
  return offset;
1590
0
}
1591
1592
1593
static const ber_sequence_t DialoguePortion_U_sequence[] = {
1594
  { &hf_ansi_tcap_version   , BER_CLASS_PRI, 26, BER_FLAGS_OPTIONAL|BER_FLAGS_NOOWNTAG, dissect_ansi_tcap_ProtocolVersion },
1595
  { &hf_ansi_tcap_applicationContext, BER_CLASS_ANY/*choice*/, -1/*choice*/, BER_FLAGS_OPTIONAL|BER_FLAGS_NOOWNTAG|BER_FLAGS_NOTCHKTAG, dissect_ansi_tcap_T_applicationContext },
1596
  { &hf_ansi_tcap_userInformation, BER_CLASS_PRI, 29, BER_FLAGS_OPTIONAL|BER_FLAGS_NOOWNTAG, dissect_ansi_tcap_UserInformation },
1597
  { &hf_ansi_tcap_securityContext, BER_CLASS_ANY/*choice*/, -1/*choice*/, BER_FLAGS_OPTIONAL|BER_FLAGS_NOOWNTAG|BER_FLAGS_NOTCHKTAG, dissect_ansi_tcap_T_securityContext },
1598
  { &hf_ansi_tcap_confidentiality, BER_CLASS_CON, 2, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_ansi_tcap_Confidentiality },
1599
  { NULL, 0, 0, 0, NULL }
1600
};
1601
1602
static unsigned
1603
0
dissect_ansi_tcap_DialoguePortion_U(bool implicit_tag _U_, tvbuff_t *tvb _U_, unsigned offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
1604
0
  offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset,
1605
0
                                   DialoguePortion_U_sequence, hf_index, ett_ansi_tcap_DialoguePortion_U);
1606
1607
0
  return offset;
1608
0
}
1609
1610
1611
1612
static unsigned
1613
0
dissect_ansi_tcap_DialoguePortion(bool implicit_tag _U_, tvbuff_t *tvb _U_, unsigned offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
1614
0
  offset = dissect_ber_tagged_type(implicit_tag, actx, tree, tvb, offset,
1615
0
                                      hf_index, BER_CLASS_PRI, 25, true, dissect_ansi_tcap_DialoguePortion_U);
1616
1617
0
  return offset;
1618
0
}
1619
1620
1621
1622
static unsigned
1623
0
dissect_ansi_tcap_T_componentIDs(bool implicit_tag _U_, tvbuff_t *tvb _U_, unsigned offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
1624
0
  offset = dissect_ber_constrained_octet_string(implicit_tag, actx, tree, tvb, offset,
1625
0
                                                   0, 2, hf_index, NULL);
1626
1627
0
  return offset;
1628
0
}
1629
1630
1631
1632
static unsigned
1633
0
dissect_ansi_tcap_T_invoke_parameter(bool implicit_tag _U_, tvbuff_t *tvb _U_, unsigned offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
1634
1635
0
  if(find_tcap_subdissector(tvb, actx, tree))
1636
0
    offset = tvb_reported_length(tvb);
1637
1638
1639
1640
0
  return offset;
1641
0
}
1642
1643
1644
static const ber_sequence_t Invoke_sequence[] = {
1645
  { &hf_ansi_tcap_componentIDs, BER_CLASS_PRI, 15, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_ansi_tcap_T_componentIDs },
1646
  { &hf_ansi_tcap_operationCode, BER_CLASS_ANY/*choice*/, -1/*choice*/, BER_FLAGS_NOOWNTAG|BER_FLAGS_NOTCHKTAG, dissect_ansi_tcap_OperationCode },
1647
  { &hf_ansi_tcap_invoke_parameter, BER_CLASS_ANY, 0, BER_FLAGS_OPTIONAL|BER_FLAGS_NOOWNTAG, dissect_ansi_tcap_T_invoke_parameter },
1648
  { NULL, 0, 0, 0, NULL }
1649
};
1650
1651
static unsigned
1652
0
dissect_ansi_tcap_Invoke(bool implicit_tag _U_, tvbuff_t *tvb _U_, unsigned offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
1653
0
  ansi_tcap_private.d.pdu = 1;
1654
1655
1656
0
  offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset,
1657
0
                                   Invoke_sequence, hf_index, ett_ansi_tcap_Invoke);
1658
1659
0
  return offset;
1660
0
}
1661
1662
1663
1664
static unsigned
1665
0
dissect_ansi_tcap_T_componentID(bool implicit_tag _U_, tvbuff_t *tvb _U_, unsigned offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
1666
0
  offset = dissect_ber_constrained_octet_string(implicit_tag, actx, tree, tvb, offset,
1667
0
                                                   1, 1, hf_index, NULL);
1668
1669
0
  return offset;
1670
0
}
1671
1672
1673
1674
static unsigned
1675
0
dissect_ansi_tcap_T_returnResult_parameter(bool implicit_tag _U_, tvbuff_t *tvb _U_, unsigned offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
1676
  // ReturnResult/parameter -> ReturnResult/parameter
1677
0
  increment_dissection_depth_by_n(actx->pinfo, 1);
1678
0
  if(find_tcap_subdissector(tvb, actx, tree))
1679
0
    offset = tvb_reported_length(tvb);
1680
1681
1682
0
  decrement_dissection_depth_by_n(actx->pinfo, 1);
1683
0
  return offset;
1684
0
}
1685
1686
1687
static const ber_sequence_t ReturnResult_sequence[] = {
1688
  { &hf_ansi_tcap_componentID, BER_CLASS_PRI, 15, BER_FLAGS_IMPLTAG, dissect_ansi_tcap_T_componentID },
1689
  { &hf_ansi_tcap_returnResult_parameter, BER_CLASS_ANY, 0, BER_FLAGS_OPTIONAL|BER_FLAGS_NOOWNTAG, dissect_ansi_tcap_T_returnResult_parameter },
1690
  { NULL, 0, 0, 0, NULL }
1691
};
1692
1693
static unsigned
1694
0
dissect_ansi_tcap_ReturnResult(bool implicit_tag _U_, tvbuff_t *tvb _U_, unsigned offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
1695
0
  ansi_tcap_private.d.pdu = 2;
1696
1697
1698
1699
0
  offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset,
1700
0
                                   ReturnResult_sequence, hf_index, ett_ansi_tcap_ReturnResult);
1701
1702
0
  return offset;
1703
0
}
1704
1705
1706
1707
static unsigned
1708
0
dissect_ansi_tcap_T_componentID_01(bool implicit_tag _U_, tvbuff_t *tvb _U_, unsigned offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
1709
0
  offset = dissect_ber_constrained_octet_string(implicit_tag, actx, tree, tvb, offset,
1710
0
                                                   1, 1, hf_index, NULL);
1711
1712
0
  return offset;
1713
0
}
1714
1715
1716
1717
static unsigned
1718
0
dissect_ansi_tcap_T_returnError_parameter(bool implicit_tag _U_, tvbuff_t *tvb _U_, unsigned offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
1719
  // ReturnError/parameter -> ReturnError/parameter
1720
0
  increment_dissection_depth_by_n(actx->pinfo, 1);
1721
0
  if(find_tcap_subdissector(tvb, actx, tree))
1722
0
    offset = tvb_reported_length(tvb);
1723
1724
1725
0
  decrement_dissection_depth_by_n(actx->pinfo, 1);
1726
0
  return offset;
1727
0
}
1728
1729
1730
static const ber_sequence_t ReturnError_sequence[] = {
1731
  { &hf_ansi_tcap_componentID_01, BER_CLASS_PRI, 15, BER_FLAGS_IMPLTAG, dissect_ansi_tcap_T_componentID_01 },
1732
  { &hf_ansi_tcap_errorCode , BER_CLASS_ANY/*choice*/, -1/*choice*/, BER_FLAGS_NOOWNTAG|BER_FLAGS_NOTCHKTAG, dissect_ansi_tcap_ErrorCode },
1733
  { &hf_ansi_tcap_returnError_parameter, BER_CLASS_ANY, 0, BER_FLAGS_OPTIONAL|BER_FLAGS_NOOWNTAG, dissect_ansi_tcap_T_returnError_parameter },
1734
  { NULL, 0, 0, 0, NULL }
1735
};
1736
1737
static unsigned
1738
0
dissect_ansi_tcap_ReturnError(bool implicit_tag _U_, tvbuff_t *tvb _U_, unsigned offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
1739
0
  ansi_tcap_private.d.pdu = 3;
1740
1741
0
  offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset,
1742
0
                                   ReturnError_sequence, hf_index, ett_ansi_tcap_ReturnError);
1743
1744
0
  return offset;
1745
0
}
1746
1747
1748
1749
static unsigned
1750
0
dissect_ansi_tcap_OCTET_STRING_SIZE_0_1(bool implicit_tag _U_, tvbuff_t *tvb _U_, unsigned offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
1751
0
  offset = dissect_ber_constrained_octet_string(implicit_tag, actx, tree, tvb, offset,
1752
0
                                                   0, 1, hf_index, NULL);
1753
1754
0
  return offset;
1755
0
}
1756
1757
1758
static const value_string ansi_tcap_Problem_vals[] = {
1759
  { 257, "general-unrecognisedComponentType" },
1760
  { 258, "general-incorrectComponentPortion" },
1761
  { 259, "general-badlyStructuredCompPortion" },
1762
  { 260, "general-incorrectComponentCoding" },
1763
  { 513, "invoke-duplicateInvocation" },
1764
  { 514, "invoke-unrecognisedOperation" },
1765
  { 515, "invoke-incorrectParameter" },
1766
  { 516, "invoke-unrecognisedCorrelationID" },
1767
  { 769, "returnResult-unrecognisedCorrelationID" },
1768
  { 770, "returnResult-unexpectedReturnResult" },
1769
  { 771, "returnResult-incorrectParameter" },
1770
  { 1025, "returnError-unrecognisedCorrelationID" },
1771
  { 1026, "returnError-unexpectedReturnError" },
1772
  { 1027, "returnError-unrecognisedError" },
1773
  { 1028, "returnError-unexpectedError" },
1774
  { 1029, "returnError-incorrectParameter" },
1775
  { 1281, "transaction-unrecognizedPackageType" },
1776
  { 1282, "transaction-incorrectTransPortion" },
1777
  { 1283, "transaction-badlyStructuredTransPortion" },
1778
  { 1284, "transaction-unassignedRespondingTransID" },
1779
  { 1285, "transaction-permissionToReleaseProblem" },
1780
  { 1286, "transaction-resourceUnavailable" },
1781
  { 0, NULL }
1782
};
1783
1784
1785
static unsigned
1786
0
dissect_ansi_tcap_Problem(bool implicit_tag _U_, tvbuff_t *tvb _U_, unsigned offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
1787
0
  offset = dissect_ber_integer(implicit_tag, actx, tree, tvb, offset, hf_index,
1788
0
                                                NULL);
1789
1790
0
  return offset;
1791
0
}
1792
1793
1794
static const ber_sequence_t T_paramSequence_sequence[] = {
1795
  { NULL, 0, 0, 0, NULL }
1796
};
1797
1798
static unsigned
1799
0
dissect_ansi_tcap_T_paramSequence(bool implicit_tag _U_, tvbuff_t *tvb _U_, unsigned offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
1800
0
  offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset,
1801
0
                                   T_paramSequence_sequence, hf_index, ett_ansi_tcap_T_paramSequence);
1802
1803
0
  return offset;
1804
0
}
1805
1806
1807
static const ber_sequence_t T_paramSet_set[] = {
1808
  { NULL, 0, 0, 0, NULL }
1809
};
1810
1811
static unsigned
1812
0
dissect_ansi_tcap_T_paramSet(bool implicit_tag _U_, tvbuff_t *tvb _U_, unsigned offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
1813
0
  offset = dissect_ber_set(implicit_tag, actx, tree, tvb, offset,
1814
0
                              T_paramSet_set, hf_index, ett_ansi_tcap_T_paramSet);
1815
1816
0
  return offset;
1817
0
}
1818
1819
1820
static const value_string ansi_tcap_T_reject_parameter_vals[] = {
1821
  {  16, "paramSequence" },
1822
  {  18, "paramSet" },
1823
  { 0, NULL }
1824
};
1825
1826
static const ber_choice_t T_reject_parameter_choice[] = {
1827
  {  16, &hf_ansi_tcap_paramSequence, BER_CLASS_PRI, 16, BER_FLAGS_IMPLTAG, dissect_ansi_tcap_T_paramSequence },
1828
  {  18, &hf_ansi_tcap_paramSet  , BER_CLASS_PRI, 18, BER_FLAGS_IMPLTAG, dissect_ansi_tcap_T_paramSet },
1829
  { 0, NULL, 0, 0, 0, NULL }
1830
};
1831
1832
static unsigned
1833
0
dissect_ansi_tcap_T_reject_parameter(bool implicit_tag _U_, tvbuff_t *tvb _U_, unsigned offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
1834
0
  offset = dissect_ber_choice(actx, tree, tvb, offset,
1835
0
                                 T_reject_parameter_choice, hf_index, ett_ansi_tcap_T_reject_parameter,
1836
0
                                 NULL);
1837
1838
0
  return offset;
1839
0
}
1840
1841
1842
static const ber_sequence_t Reject_sequence[] = {
1843
  { &hf_ansi_tcap_componentID_02, BER_CLASS_PRI, 15, BER_FLAGS_IMPLTAG, dissect_ansi_tcap_OCTET_STRING_SIZE_0_1 },
1844
  { &hf_ansi_tcap_rejectProblem, BER_CLASS_PRI, 21, BER_FLAGS_IMPLTAG, dissect_ansi_tcap_Problem },
1845
  { &hf_ansi_tcap_reject_parameter, BER_CLASS_ANY/*choice*/, -1/*choice*/, BER_FLAGS_NOOWNTAG|BER_FLAGS_NOTCHKTAG, dissect_ansi_tcap_T_reject_parameter },
1846
  { NULL, 0, 0, 0, NULL }
1847
};
1848
1849
static unsigned
1850
0
dissect_ansi_tcap_Reject(bool implicit_tag _U_, tvbuff_t *tvb _U_, unsigned offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
1851
0
  offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset,
1852
0
                                   Reject_sequence, hf_index, ett_ansi_tcap_Reject);
1853
1854
0
  return offset;
1855
0
}
1856
1857
1858
static const value_string ansi_tcap_ComponentPDU_vals[] = {
1859
  {   9, "invokeLast" },
1860
  {  10, "returnResultLast" },
1861
  {  11, "returnError" },
1862
  {  12, "reject" },
1863
  {  13, "invokeNotLast" },
1864
  {  14, "returnResultNotLast" },
1865
  { 0, NULL }
1866
};
1867
1868
static const ber_choice_t ComponentPDU_choice[] = {
1869
  {   9, &hf_ansi_tcap_invokeLast, BER_CLASS_PRI, 9, BER_FLAGS_IMPLTAG, dissect_ansi_tcap_Invoke },
1870
  {  10, &hf_ansi_tcap_returnResultLast, BER_CLASS_PRI, 10, BER_FLAGS_IMPLTAG, dissect_ansi_tcap_ReturnResult },
1871
  {  11, &hf_ansi_tcap_returnError, BER_CLASS_PRI, 11, BER_FLAGS_IMPLTAG, dissect_ansi_tcap_ReturnError },
1872
  {  12, &hf_ansi_tcap_reject    , BER_CLASS_PRI, 12, BER_FLAGS_IMPLTAG, dissect_ansi_tcap_Reject },
1873
  {  13, &hf_ansi_tcap_invokeNotLast, BER_CLASS_PRI, 13, BER_FLAGS_IMPLTAG, dissect_ansi_tcap_Invoke },
1874
  {  14, &hf_ansi_tcap_returnResultNotLast, BER_CLASS_PRI, 14, BER_FLAGS_IMPLTAG, dissect_ansi_tcap_ReturnResult },
1875
  { 0, NULL, 0, 0, 0, NULL }
1876
};
1877
1878
static unsigned
1879
0
dissect_ansi_tcap_ComponentPDU(bool implicit_tag _U_, tvbuff_t *tvb _U_, unsigned offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
1880
0
  offset = dissect_ber_choice(actx, tree, tvb, offset,
1881
0
                                 ComponentPDU_choice, hf_index, ett_ansi_tcap_ComponentPDU,
1882
0
                                 NULL);
1883
1884
0
  return offset;
1885
0
}
1886
1887
1888
static const ber_sequence_t SEQUENCE_OF_ComponentPDU_sequence_of[1] = {
1889
  { &hf_ansi_tcap__untag_item_01, BER_CLASS_ANY/*choice*/, -1/*choice*/, BER_FLAGS_NOOWNTAG|BER_FLAGS_NOTCHKTAG, dissect_ansi_tcap_ComponentPDU },
1890
};
1891
1892
static unsigned
1893
0
dissect_ansi_tcap_SEQUENCE_OF_ComponentPDU(bool implicit_tag _U_, tvbuff_t *tvb _U_, unsigned offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
1894
0
  offset = dissect_ber_sequence_of(implicit_tag, actx, tree, tvb, offset,
1895
0
                                      SEQUENCE_OF_ComponentPDU_sequence_of, hf_index, ett_ansi_tcap_SEQUENCE_OF_ComponentPDU);
1896
1897
0
  return offset;
1898
0
}
1899
1900
1901
1902
static unsigned
1903
0
dissect_ansi_tcap_ComponentSequence(bool implicit_tag _U_, tvbuff_t *tvb _U_, unsigned offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
1904
0
  offset = dissect_ber_tagged_type(implicit_tag, actx, tree, tvb, offset,
1905
0
                                      hf_index, BER_CLASS_PRI, 8, true, dissect_ansi_tcap_SEQUENCE_OF_ComponentPDU);
1906
1907
0
  return offset;
1908
0
}
1909
1910
1911
static const ber_sequence_t UniTransactionPDU_sequence[] = {
1912
  { &hf_ansi_tcap_identifier, BER_CLASS_PRI, 7, BER_FLAGS_NOOWNTAG, dissect_ansi_tcap_TransactionID },
1913
  { &hf_ansi_tcap_dialoguePortion, BER_CLASS_PRI, 25, BER_FLAGS_OPTIONAL|BER_FLAGS_NOOWNTAG, dissect_ansi_tcap_DialoguePortion },
1914
  { &hf_ansi_tcap_componentPortion, BER_CLASS_PRI, 8, BER_FLAGS_NOOWNTAG, dissect_ansi_tcap_ComponentSequence },
1915
  { NULL, 0, 0, 0, NULL }
1916
};
1917
1918
static unsigned
1919
0
dissect_ansi_tcap_UniTransactionPDU(bool implicit_tag _U_, tvbuff_t *tvb _U_, unsigned offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
1920
0
  offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset,
1921
0
                                   UniTransactionPDU_sequence, hf_index, ett_ansi_tcap_UniTransactionPDU);
1922
1923
0
  return offset;
1924
0
}
1925
1926
1927
1928
static unsigned
1929
0
dissect_ansi_tcap_T_unidirectional(bool implicit_tag _U_, tvbuff_t *tvb _U_, unsigned offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
1930
0
gp_tcapsrt_info->ope=TC_ANSI_ALL;
1931
0
col_set_str(actx->pinfo->cinfo, COL_INFO, "unidirectional ");
1932
1933
0
  offset = dissect_ansi_tcap_UniTransactionPDU(implicit_tag, tvb, offset, actx, tree, hf_index);
1934
1935
0
  return offset;
1936
0
}
1937
1938
1939
static const ber_sequence_t TransactionPDU_sequence[] = {
1940
  { &hf_ansi_tcap_identifier, BER_CLASS_PRI, 7, BER_FLAGS_NOOWNTAG, dissect_ansi_tcap_TransactionID },
1941
  { &hf_ansi_tcap_dialoguePortion, BER_CLASS_PRI, 25, BER_FLAGS_OPTIONAL|BER_FLAGS_NOOWNTAG, dissect_ansi_tcap_DialoguePortion },
1942
  { &hf_ansi_tcap_componentPortion, BER_CLASS_PRI, 8, BER_FLAGS_OPTIONAL|BER_FLAGS_NOOWNTAG, dissect_ansi_tcap_ComponentSequence },
1943
  { NULL, 0, 0, 0, NULL }
1944
};
1945
1946
static unsigned
1947
2
dissect_ansi_tcap_TransactionPDU(bool implicit_tag _U_, tvbuff_t *tvb _U_, unsigned offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
1948
2
  offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset,
1949
2
                                   TransactionPDU_sequence, hf_index, ett_ansi_tcap_TransactionPDU);
1950
1951
2
  return offset;
1952
2
}
1953
1954
1955
1956
static unsigned
1957
1
dissect_ansi_tcap_T_queryWithPerm(bool implicit_tag _U_, tvbuff_t *tvb _U_, unsigned offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
1958
1
gp_tcapsrt_info->ope=TC_ANSI_ALL;
1959
1
col_set_str(actx->pinfo->cinfo, COL_INFO, "queryWithPerm ");
1960
1961
1
  offset = dissect_ansi_tcap_TransactionPDU(implicit_tag, tvb, offset, actx, tree, hf_index);
1962
1963
1
  return offset;
1964
1
}
1965
1966
1967
1968
static unsigned
1969
0
dissect_ansi_tcap_T_queryWithoutPerm(bool implicit_tag _U_, tvbuff_t *tvb _U_, unsigned offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
1970
0
gp_tcapsrt_info->ope=TC_ANSI_ALL;
1971
0
col_set_str(actx->pinfo->cinfo, COL_INFO, "queryWithoutPerm ");
1972
1973
0
  offset = dissect_ansi_tcap_TransactionPDU(implicit_tag, tvb, offset, actx, tree, hf_index);
1974
1975
0
  return offset;
1976
0
}
1977
1978
1979
1980
static unsigned
1981
0
dissect_ansi_tcap_T_response(bool implicit_tag _U_, tvbuff_t *tvb _U_, unsigned offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
1982
0
gp_tcapsrt_info->ope=TC_ANSI_ALL;
1983
0
col_set_str(actx->pinfo->cinfo, COL_INFO, "response ");
1984
1985
0
  offset = dissect_ansi_tcap_TransactionPDU(implicit_tag, tvb, offset, actx, tree, hf_index);
1986
1987
0
  return offset;
1988
0
}
1989
1990
1991
1992
static unsigned
1993
1
dissect_ansi_tcap_T_conversationWithPerm(bool implicit_tag _U_, tvbuff_t *tvb _U_, unsigned offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
1994
1
gp_tcapsrt_info->ope=TC_ANSI_ALL;
1995
1
col_set_str(actx->pinfo->cinfo, COL_INFO, "conversationWithPerm ");
1996
1997
1
  offset = dissect_ansi_tcap_TransactionPDU(implicit_tag, tvb, offset, actx, tree, hf_index);
1998
1999
1
  return offset;
2000
1
}
2001
2002
2003
2004
static unsigned
2005
0
dissect_ansi_tcap_T_conversationWithoutPerm(bool implicit_tag _U_, tvbuff_t *tvb _U_, unsigned offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
2006
0
gp_tcapsrt_info->ope=TC_ANSI_ALL;
2007
0
col_set_str(actx->pinfo->cinfo, COL_INFO, "conversationWithoutPerm ");
2008
2009
0
  offset = dissect_ansi_tcap_TransactionPDU(implicit_tag, tvb, offset, actx, tree, hf_index);
2010
2011
0
  return offset;
2012
0
}
2013
2014
2015
static const value_string ansi_tcap_P_Abort_cause_U_vals[] = {
2016
  {   1, "unrecognizedPackageType" },
2017
  {   2, "incorrectTransactionPortion" },
2018
  {   3, "badlyStructuredTransactionPortion" },
2019
  {   4, "unassignedRespondingTransactionID" },
2020
  {   5, "permissionToReleaseProblem" },
2021
  {   6, "resourceUnavailable" },
2022
  {   7, "unrecognizedDialoguePortionID" },
2023
  {   8, "badlyStructuredDialoguePortion" },
2024
  {   9, "missingDialoguePortion" },
2025
  {  10, "inconsistentDialoguePortion" },
2026
  { 0, NULL }
2027
};
2028
2029
2030
static unsigned
2031
0
dissect_ansi_tcap_P_Abort_cause_U(bool implicit_tag _U_, tvbuff_t *tvb _U_, unsigned offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
2032
0
  offset = dissect_ber_integer(implicit_tag, actx, tree, tvb, offset, hf_index,
2033
0
                                                NULL);
2034
2035
0
  return offset;
2036
0
}
2037
2038
2039
2040
static unsigned
2041
0
dissect_ansi_tcap_P_Abort_cause(bool implicit_tag _U_, tvbuff_t *tvb _U_, unsigned offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
2042
0
  offset = dissect_ber_tagged_type(implicit_tag, actx, tree, tvb, offset,
2043
0
                                      hf_index, BER_CLASS_PRI, 23, true, dissect_ansi_tcap_P_Abort_cause_U);
2044
2045
0
  return offset;
2046
0
}
2047
2048
2049
2050
static unsigned
2051
0
dissect_ansi_tcap_UserAbortInformation(bool implicit_tag _U_, tvbuff_t *tvb _U_, unsigned offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
2052
0
  offset = dissect_ber_tagged_type(implicit_tag, actx, tree, tvb, offset,
2053
0
                                      hf_index, BER_CLASS_PRI, 24, false, dissect_ansi_tcap_EXTERNAL);
2054
2055
0
  return offset;
2056
0
}
2057
2058
2059
static const value_string ansi_tcap_T_causeInformation_vals[] = {
2060
  {  23, "abortCause" },
2061
  {  24, "userInformation" },
2062
  { 0, NULL }
2063
};
2064
2065
static const ber_choice_t T_causeInformation_choice[] = {
2066
  {  23, &hf_ansi_tcap_abortCause, BER_CLASS_PRI, 23, BER_FLAGS_NOOWNTAG, dissect_ansi_tcap_P_Abort_cause },
2067
  {  24, &hf_ansi_tcap_abort_userInformation, BER_CLASS_PRI, 24, BER_FLAGS_NOOWNTAG, dissect_ansi_tcap_UserAbortInformation },
2068
  { 0, NULL, 0, 0, 0, NULL }
2069
};
2070
2071
static unsigned
2072
1
dissect_ansi_tcap_T_causeInformation(bool implicit_tag _U_, tvbuff_t *tvb _U_, unsigned offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
2073
1
  offset = dissect_ber_choice(actx, tree, tvb, offset,
2074
1
                                 T_causeInformation_choice, hf_index, ett_ansi_tcap_T_causeInformation,
2075
1
                                 NULL);
2076
2077
1
  return offset;
2078
1
}
2079
2080
2081
static const ber_sequence_t Abort_sequence[] = {
2082
  { &hf_ansi_tcap_identifier, BER_CLASS_PRI, 7, BER_FLAGS_NOOWNTAG, dissect_ansi_tcap_TransactionID },
2083
  { &hf_ansi_tcap_dialogPortion, BER_CLASS_PRI, 25, BER_FLAGS_OPTIONAL|BER_FLAGS_NOOWNTAG, dissect_ansi_tcap_DialoguePortion },
2084
  { &hf_ansi_tcap_causeInformation, BER_CLASS_ANY/*choice*/, -1/*choice*/, BER_FLAGS_NOOWNTAG|BER_FLAGS_NOTCHKTAG, dissect_ansi_tcap_T_causeInformation },
2085
  { NULL, 0, 0, 0, NULL }
2086
};
2087
2088
static unsigned
2089
1
dissect_ansi_tcap_Abort(bool implicit_tag _U_, tvbuff_t *tvb _U_, unsigned offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
2090
1
  offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset,
2091
1
                                   Abort_sequence, hf_index, ett_ansi_tcap_Abort);
2092
2093
1
  return offset;
2094
1
}
2095
2096
2097
2098
static unsigned
2099
1
dissect_ansi_tcap_T_abort(bool implicit_tag _U_, tvbuff_t *tvb _U_, unsigned offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
2100
1
gp_tcapsrt_info->ope=TC_ANSI_ABORT;
2101
1
col_set_str(actx->pinfo->cinfo, COL_INFO, "Abort ");
2102
2103
1
  offset = dissect_ansi_tcap_Abort(implicit_tag, tvb, offset, actx, tree, hf_index);
2104
2105
1
  return offset;
2106
1
}
2107
2108
2109
static const ber_choice_t PackageType_choice[] = {
2110
  {   1, &hf_ansi_tcap_unidirectional, BER_CLASS_PRI, 1, BER_FLAGS_IMPLTAG, dissect_ansi_tcap_T_unidirectional },
2111
  {   2, &hf_ansi_tcap_queryWithPerm, BER_CLASS_PRI, 2, BER_FLAGS_IMPLTAG, dissect_ansi_tcap_T_queryWithPerm },
2112
  {   3, &hf_ansi_tcap_queryWithoutPerm, BER_CLASS_PRI, 3, BER_FLAGS_IMPLTAG, dissect_ansi_tcap_T_queryWithoutPerm },
2113
  {   4, &hf_ansi_tcap_response  , BER_CLASS_PRI, 4, BER_FLAGS_IMPLTAG, dissect_ansi_tcap_T_response },
2114
  {   5, &hf_ansi_tcap_conversationWithPerm, BER_CLASS_PRI, 5, BER_FLAGS_IMPLTAG, dissect_ansi_tcap_T_conversationWithPerm },
2115
  {   6, &hf_ansi_tcap_conversationWithoutPerm, BER_CLASS_PRI, 6, BER_FLAGS_IMPLTAG, dissect_ansi_tcap_T_conversationWithoutPerm },
2116
  {  22, &hf_ansi_tcap_abort     , BER_CLASS_PRI, 22, BER_FLAGS_IMPLTAG, dissect_ansi_tcap_T_abort },
2117
  { 0, NULL, 0, 0, 0, NULL }
2118
};
2119
2120
static unsigned
2121
4
dissect_ansi_tcap_PackageType(bool implicit_tag _U_, tvbuff_t *tvb _U_, unsigned offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
2122
4
  offset = dissect_ber_choice(actx, tree, tvb, offset,
2123
4
                                 PackageType_choice, hf_index, ett_ansi_tcap_PackageType,
2124
4
                                 NULL);
2125
2126
4
  return offset;
2127
4
}
2128
2129
2130
2131
2132
2133
static int
2134
dissect_ansi_tcap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree, void* data _U_)
2135
4
{
2136
4
    proto_item          *item=NULL;
2137
4
    proto_tree          *tree=NULL;
2138
#if 0
2139
    proto_item          *stat_item=NULL;
2140
    proto_tree          *stat_tree=NULL;
2141
        int                     offset = 0;
2142
    struct tcaphash_context_t * p_tcap_context;
2143
    dissector_handle_t subdissector_handle;
2144
#endif
2145
4
        asn1_ctx_t asn1_ctx;
2146
2147
4
        asn1_ctx_init(&asn1_ctx, ASN1_ENC_BER, true, pinfo);
2148
4
        ansi_tcap_ctx_init(&ansi_tcap_private);
2149
2150
4
    asn1_ctx.subtree.top_tree = parent_tree;
2151
4
    col_set_str(pinfo->cinfo, COL_PROTOCOL, "ANSI TCAP");
2152
2153
    /* create display subtree for the protocol */
2154
4
    if(parent_tree){
2155
4
      item = proto_tree_add_item(parent_tree, proto_ansi_tcap, tvb, 0, -1, ENC_NA);
2156
4
      tree = proto_item_add_subtree(item, ett_tcap);
2157
4
    }
2158
4
    cur_oid = NULL;
2159
4
    tcapext_oid = NULL;
2160
2161
4
    gp_tcapsrt_info=tcapsrt_razinfo();
2162
4
    tcap_subdissector_used=false;
2163
4
    gp_tcap_context=NULL;
2164
4
    dissect_ansi_tcap_PackageType(false, tvb, 0, &asn1_ctx, tree, -1);
2165
2166
#if 0 /* Skip this part for now it will be rewritten */
2167
    if (g_ansi_tcap_HandleSRT && !tcap_subdissector_used ) {
2168
                if (gtcap_DisplaySRT && tree) {
2169
                        stat_tree = proto_tree_add_subtree(tree, tvb, 0, 0, ett_ansi_tcap_stat, &stat_item, "Stat");
2170
                        proto_item_set_generated(stat_item);
2171
                }
2172
                p_tcap_context=tcapsrt_call_matching(tvb, pinfo, stat_tree, gp_tcapsrt_info);
2173
                ansi_tcap_private.context=p_tcap_context;
2174
2175
                /* If the current message is TCAP only,
2176
                 * save the Application context name for the next messages
2177
                 */
2178
                if ( p_tcap_context && cur_oid && !p_tcap_context->oid_present ) {
2179
                        /* Save the application context and the sub dissector */
2180
                        (void) g_strlcpy(p_tcap_context->oid, cur_oid, sizeof(p_tcap_context->oid));
2181
                        if ( (subdissector_handle = dissector_get_string_handle(ber_oid_dissector_table, cur_oid)) ) {
2182
                                p_tcap_context->subdissector_handle=subdissector_handle;
2183
                                p_tcap_context->oid_present=true;
2184
                        }
2185
                }
2186
                if (g_ansi_tcap_HandleSRT && p_tcap_context && p_tcap_context->callback) {
2187
                        /* Callback function for the upper layer */
2188
                        (p_tcap_context->callback)(tvb, pinfo, stat_tree, p_tcap_context);
2189
                }
2190
        }
2191
#endif
2192
4
    return tvb_captured_length(tvb);
2193
4
}
2194
2195
2196
void
2197
proto_reg_handoff_ansi_tcap(void)
2198
16
{
2199
16
    ansi_map_handle = find_dissector_add_dependency("ansi_map", proto_ansi_tcap);
2200
16
    ain_handle = find_dissector_add_dependency("ain", proto_ansi_tcap);
2201
16
    ber_oid_dissector_table = find_dissector_table("ber.oid");
2202
16
}
2203
2204
2205
2206
void
2207
proto_register_ansi_tcap(void)
2208
16
{
2209
16
    module_t    *ansi_tcap_module;
2210
2211
2212
/* Setup list of header fields  See Section 1.6.1 for details*/
2213
16
    static hf_register_info hf[] = {
2214
#if 0
2215
        /* Tcap Service Response Time */
2216
        { &hf_ansi_tcapsrt_SessionId,
2217
          { "Session Id",
2218
            "ansi_tcap.srt.session_id",
2219
            FT_UINT32, BASE_DEC, NULL, 0x0,
2220
            NULL, HFILL }
2221
        },
2222
        { &hf_ansi_tcapsrt_BeginSession,
2223
          { "Begin Session",
2224
            "ansi_tcap.srt.begin",
2225
            FT_FRAMENUM, BASE_NONE, NULL, 0x0,
2226
            "SRT Begin of Session", HFILL }
2227
        },
2228
        { &hf_ansi_tcapsrt_EndSession,
2229
          { "End Session",
2230
            "ansi_tcap.srt.end",
2231
            FT_FRAMENUM, BASE_NONE, NULL, 0x0,
2232
            "SRT End of Session", HFILL }
2233
        },
2234
        { &hf_ansi_tcapsrt_SessionTime,
2235
          { "Session duration",
2236
            "ansi_tcap.srt.sessiontime",
2237
            FT_RELATIVE_TIME, BASE_NONE, NULL, 0x0,
2238
            "Duration of the TCAP session", HFILL }
2239
        },
2240
        { &hf_ansi_tcapsrt_Duplicate,
2241
          { "Request Duplicate",
2242
            "ansi_tcap.srt.duplicate",
2243
            FT_UINT32, BASE_DEC, NULL, 0x0,
2244
            NULL, HFILL }
2245
        },
2246
#endif
2247
16
        { &hf_ansi_tcap_bit_h,
2248
16
          { "Require Reply", "ansi_tcap.req_rep",
2249
16
            FT_BOOLEAN, 16, NULL, 0x8000,
2250
16
            NULL, HFILL }
2251
16
        },
2252
16
        { &hf_ansi_tcap_op_family,
2253
16
          { "Family",
2254
16
            "ansi_tcap.op_family",
2255
16
            FT_UINT16, BASE_DEC, VALS(ansi_tcap_national_op_code_family_vals), 0x7f00,
2256
16
            NULL, HFILL }
2257
16
        },
2258
16
        { &hf_ansi_tcap_op_specifier,
2259
16
          { "Specifier",
2260
16
            "ansi_tcap.op_specifier",
2261
16
            FT_UINT16, BASE_DEC, NULL, 0x00ff,
2262
16
            NULL, HFILL }
2263
16
        },
2264
16
        { &hf_ansi_tcap_parameter_set,
2265
16
          { "Parameters",
2266
16
            "ansi_tcap.parameter_set",
2267
16
            FT_NONE, BASE_NONE, NULL, 0,
2268
16
            NULL, HFILL }
2269
16
        },
2270
16
        { &hf_ansi_tcap_parameter_set_start,
2271
16
          { "Start of Parameters",
2272
16
            "ansi_tcap.parameter_set_start",
2273
16
            FT_UINT8, BASE_HEX, NULL, 0,
2274
16
            NULL, HFILL }
2275
16
        },
2276
16
        { &hf_ansi_tcap_parameter,
2277
16
          { "Parameter",
2278
16
            "ansi_tcap.parameter",
2279
16
            FT_UINT16, BASE_HEX, VALS(ansi_tcap_parameter_vals), 0,
2280
16
            NULL, HFILL }
2281
16
        },
2282
16
        { &hf_ansi_tcap_parameter_length,
2283
16
          { "The length of this Parameter set/sequence is",
2284
16
            "ansi_tcap.parameter_length",
2285
16
            FT_UINT8, BASE_HEX, NULL, 0,
2286
16
            NULL, HFILL }
2287
16
        },
2288
16
        { &hf_ansi_tcap_service_key_identifier,
2289
16
          { "Service key identifier",
2290
16
            "ansi_tcap.ansi_tcap_service_key_identifier",
2291
16
            FT_UINT8, BASE_HEX, NULL, 0,
2292
16
            NULL, HFILL }
2293
16
        },
2294
16
        { &hf_ansi_tcap_digit_identifier,
2295
16
          { "Service key digit identifier",
2296
16
            "ansi_tcap.ansi_tcap_digit_identifier",
2297
16
            FT_UINT8, BASE_HEX, NULL, 0,
2298
16
            NULL, HFILL }
2299
16
        },
2300
16
        { &hf_ansi_tcap_digit_length,
2301
16
          { "Service key digit length",
2302
16
            "ansi_tcap.ansi_tcap_digit_length",
2303
16
            FT_UINT8, BASE_HEX, NULL, 0,
2304
16
            NULL, HFILL }
2305
16
        },
2306
16
        { &hf_ansi_tcap_destination_number_value,
2307
16
          { "Destination number value",
2308
16
            "ansi_tcap.ansi_tcap_destination_number_value",
2309
16
            FT_UINT8, BASE_HEX, NULL, 0,
2310
16
            NULL, HFILL }
2311
16
        },
2312
16
        { &hf_ansi_tcap_presentation_restriction,
2313
16
          { "Presentation restriction indicator",
2314
16
            "ansi_tcap.ansi_tcap_presentation_restriction",
2315
16
            FT_BOOLEAN, 8, NULL, 0x02,
2316
16
            NULL, HFILL }
2317
16
        },
2318
16
        { &hf_ansi_tcap_encoding_scheme,
2319
16
          { "Encoding scheme and number planning is",
2320
16
            "ansi_tcap.ansi_tcap_encoding_scheme",
2321
16
            FT_UINT8, BASE_HEX, NULL, 0,
2322
16
            NULL, HFILL }
2323
16
        },
2324
16
        { &hf_ansi_tcap_number_of_digits,
2325
16
          { "Amount of digits in this phone number are",
2326
16
            "ansi_tcap.ansi_tcap_number_of_digits",
2327
16
            FT_UINT8, BASE_HEX, NULL, 0,
2328
16
            NULL, HFILL }
2329
16
        },
2330
16
        { &hf_ansi_tcap_destination_phone_number,
2331
16
          { "Destination Phone Number",
2332
16
            "ansi_tcap.destination_phone_number",
2333
16
            FT_BYTES, BASE_NONE, NULL, 0,
2334
16
            NULL, HFILL }
2335
16
        },
2336
16
        { &hf_ansi_tcap_return_phone_number,
2337
16
          { "Destination Phone Number",
2338
16
            "ansi_tcap.return_phone_number",
2339
16
            FT_BYTES, BASE_NONE, NULL, 0,
2340
16
            NULL, HFILL }
2341
16
        },
2342
16
        { &hf_ansi_tcap_busy_idle_status,
2343
16
          { "Status Identifier",
2344
16
            "ansi_tcap.busy_idle_status",
2345
16
            FT_UINT8, BASE_HEX, VALS(ansi_tcap_status_identifier), 0,
2346
16
            NULL, HFILL }
2347
16
        },
2348
16
        { &hf_ansi_tcap_originating_restrictions,
2349
16
          { "Originating Restrictions",
2350
16
            "ansi_tcap.originating_restrictions",
2351
16
            FT_UINT8, BASE_HEX, VALS(ansi_tcap_originating_restrictions), 0,
2352
16
            NULL, HFILL }
2353
16
        },
2354
16
        { &hf_ansi_tcap_terminating_restrictions,
2355
16
          { "Terminating Restrictions",
2356
16
            "ansi_tcap.terminating_restrictions",
2357
16
            FT_UINT8, BASE_HEX, VALS(ansi_tcap_terminating_restrictions), 0,
2358
16
            NULL, HFILL }
2359
16
        },
2360
2361
        /* TODO: these were missing! */
2362
16
        { &hf_ansi_tcap_parameter_bearer_capability_requested1,
2363
16
          { "Capability Requested1",
2364
16
            "ansi_tcap.capability_requested1",
2365
16
            FT_UINT8, BASE_HEX, NULL, 0,
2366
16
            NULL, HFILL }
2367
16
        },
2368
16
        { &hf_ansi_tcap_parameter_bearer_capability_requested2,
2369
16
          { "Capability Requested2",
2370
16
            "ansi_tcap.capability_requested2",
2371
16
            FT_UINT8, BASE_HEX, NULL, 0,
2372
16
            NULL, HFILL }
2373
16
        },
2374
16
        { &hf_ansi_tcap_parameter_bearer_capability_requested2a,
2375
16
          { "Capability Requested2a",
2376
16
            "ansi_tcap.capability_requested2a",
2377
16
            FT_UINT8, BASE_HEX, NULL, 0,
2378
16
            NULL, HFILL }
2379
16
        },
2380
16
        { &hf_ansi_tcap_parameter_bearer_capability_requested2b,
2381
16
          { "Capability Requested2b",
2382
16
            "ansi_tcap.capability_requested2b",
2383
16
            FT_UINT8, BASE_HEX, NULL, 0,
2384
16
            NULL, HFILL }
2385
16
        },
2386
16
        { &hf_ansi_tcap_parameter_bearer_capability_requested3,
2387
16
          { "Capability Requested3",
2388
16
            "ansi_tcap.capability_requested3",
2389
16
            FT_UINT8, BASE_HEX, NULL, 0,
2390
16
            NULL, HFILL }
2391
16
        },
2392
16
        { &hf_ansi_tcap_parameter_bearer_capability_requested3a,
2393
16
          { "Capability Requested3a",
2394
16
            "ansi_tcap.capability_requested3a",
2395
16
            FT_UINT8, BASE_HEX, NULL, 0,
2396
16
            NULL, HFILL }
2397
16
        },
2398
2399
16
        { &hf_ansi_tcap_bearer_capability_supported,
2400
16
          { "Bearer Capability",
2401
16
            "ansi_tcap.bearer_capability_supported",
2402
16
            FT_UINT8, BASE_DEC, VALS(ansi_tcap_bearer_capabilities_supported), 0,
2403
16
            NULL, HFILL }
2404
16
        },
2405
16
        { &hf_ansi_tcap_reference_id,
2406
16
          { "Reference ID",
2407
16
            "ansi_tcap.reference_id",
2408
16
            FT_UINT8, BASE_HEX, NULL, 0,
2409
16
            NULL, HFILL }
2410
16
        },
2411
16
        { &hf_ansi_tcap_parameter_timestamp_year,
2412
16
          { "Year",
2413
16
            "ansi_tcap.timestamp.year",
2414
16
            FT_INT8, BASE_DEC, NULL, 0,
2415
16
            NULL, HFILL }
2416
16
        },
2417
16
        { &hf_ansi_tcap_parameter_timestamp_month,
2418
16
          { "Month",
2419
16
            "ansi_tcap.timestamp.month",
2420
16
            FT_INT8, BASE_DEC, NULL, 0,
2421
16
            NULL, HFILL }
2422
16
        },
2423
16
        { &hf_ansi_tcap_parameter_timestamp_day,
2424
16
          { "Day",
2425
16
            "ansi_tcap.timestamp.day",
2426
16
            FT_INT8, BASE_DEC, NULL, 0,
2427
16
            NULL, HFILL }
2428
16
        },
2429
16
        { &hf_ansi_tcap_parameter_timestamp_hour,
2430
16
          { "Hour",
2431
16
            "ansi_tcap.timestamp.hour",
2432
16
            FT_INT8, BASE_DEC, NULL, 0,
2433
16
            NULL, HFILL }
2434
16
        },
2435
16
        { &hf_ansi_tcap_parameter_timestamp_minute,
2436
16
          { "Minute",
2437
16
            "ansi_tcap.timestamp.minute",
2438
16
            FT_INT8, BASE_DEC, NULL, 0,
2439
16
            NULL, HFILL }
2440
16
        },
2441
16
        { &hf_ansi_tcap_parameter_timestamp_difference,
2442
16
          { "Time Difference",
2443
16
            "ansi_tcap.timestamp.difference",
2444
16
            FT_INT8, BASE_DEC, NULL, 0,
2445
16
            NULL, HFILL }
2446
16
        },
2447
16
        { &hf_ansi_tcap_parameter_timestamp_local_hour,
2448
16
          { "Local Hour",
2449
16
            "ansi_tcap.timestamp.local_hour",
2450
16
            FT_INT8, BASE_DEC, NULL, 0,
2451
16
            NULL, HFILL }
2452
16
        },
2453
16
        { &hf_ansi_tcap_parameter_timestamp_local_minute,
2454
16
          { "Local Minute",
2455
16
            "ansi_tcap.timestamp.local_minute",
2456
16
            FT_INT8, BASE_DEC, NULL, 0,
2457
16
            NULL, HFILL }
2458
16
        },
2459
16
        { &hf_ansi_tcap_parameter_call_forwarding_on_busy,
2460
16
          { "Call Forwarding On Busy",
2461
16
            "ansi_tcap.call_forwarding_on_busy",
2462
16
            FT_UINT8, BASE_HEX, VALS(ansi_tcap_national_parameter_spare), 0x30,
2463
16
            NULL, HFILL }
2464
16
        },
2465
16
        { &hf_ansi_tcap_parameter_call_forwarding_dont_answer,
2466
16
          { "Call Forwarding Don't Answer",
2467
16
            "ansi_tcap.call_forwarding_dont_answer",
2468
16
            FT_UINT8, BASE_HEX, VALS(ansi_tcap_national_parameter_spare), 0x0C,
2469
16
            NULL, HFILL }
2470
16
        },
2471
16
        { &hf_ansi_tcap_parameter_selective_forwarding,
2472
16
          { "Selective Forwarding",
2473
16
            "ansi_tcap.selective_forwarding",
2474
16
            FT_UINT8, BASE_HEX, VALS(ansi_tcap_national_parameter_spare), 0x03,
2475
16
            NULL, HFILL }
2476
16
        },
2477
16
        { &hf_ansi_tcap_parameter_dn_match,
2478
16
          { "DN Match",
2479
16
            "ansi_tcap.dn_matc",
2480
16
            FT_UINT8, BASE_HEX, VALS(ansi_tcap_national_parameter_dn_match), 0xC0,
2481
16
            NULL, HFILL }
2482
16
        },
2483
16
        { &hf_ansi_tcap_parameter_dn_line_service,
2484
16
          { "DN Line Service",
2485
16
            "ansi_tcap.dn_line_service",
2486
16
            FT_UINT8, BASE_HEX, VALS(ansi_tcap_national_parameter_dn_service_type), 0x3F,
2487
16
            NULL, HFILL }
2488
16
        },
2489
16
        { &hf_ansi_tcap_duration_hour,
2490
16
          { "Hour",
2491
16
            "ansi_tcap.duration.hour",
2492
16
            FT_INT8, BASE_DEC, NULL, 0x0,
2493
16
            NULL, HFILL }
2494
16
        },
2495
16
        { &hf_ansi_tcap_duration_minute,
2496
16
          { "Minute",
2497
16
            "ansi_tcap.duration.minute",
2498
16
            FT_INT8, BASE_DEC, NULL, 0x0,
2499
16
            NULL, HFILL }
2500
16
        },
2501
16
        { &hf_ansi_tcap_duration_second,
2502
16
          { "Second",
2503
16
            "ansi_tcap.duration.second",
2504
16
            FT_INT8, BASE_DEC, NULL, 0x0,
2505
16
            NULL, HFILL }
2506
16
        },
2507
16
        { &hf_ansi_tcap_parameter_business_group_length_spare,
2508
16
          { "Spare",
2509
16
            "ansi_tcap.business_group.length_spare",
2510
16
            FT_UINT8, BASE_HEX, NULL, 0x80,
2511
16
            NULL, HFILL }
2512
16
        },
2513
16
        { &hf_ansi_tcap_parameter_business_group_length_AttSt,
2514
16
          { "AttSt",
2515
16
            "ansi_tcap.business_group.length_AttSt",
2516
16
            FT_BOOLEAN, 8, NULL, 0x40,
2517
16
            NULL, HFILL }
2518
16
        },
2519
16
        { &hf_ansi_tcap_parameter_business_group_length_BGID,
2520
16
          { "BGID",
2521
16
            "ansi_tcap.business_group.length_BGID",
2522
16
            FT_BOOLEAN, 8, NULL, 0x20,
2523
16
            NULL, HFILL }
2524
16
        },
2525
16
        { &hf_ansi_tcap_parameter_business_group_length_LP11,
2526
16
          { "LP11",
2527
16
            "ansi_tcap.business_group.length_LP11",
2528
16
            FT_BOOLEAN, 8, NULL, 0x08,
2529
16
            NULL, HFILL }
2530
16
        },
2531
16
        { &hf_ansi_tcap_parameter_business_group_length_Party_Selector,
2532
16
          { "Party Selector",
2533
16
            "ansi_tcap.business_group.length_Party_Selector",
2534
16
            FT_UINT8, BASE_HEX, NULL, 0x07,
2535
16
            NULL, HFILL }
2536
16
        },
2537
16
        { &hf_ansi_tcap_parameter_business_group_id,
2538
16
          { "Business Group ID",
2539
16
            "ansi_tcap.business_group.id",
2540
16
            FT_UINT24, BASE_HEX, NULL, 0x0,
2541
16
            NULL, HFILL }
2542
16
        },
2543
16
        { &hf_ansi_tcap_parameter_business_group_subgroup_id,
2544
16
          { "Sub-Group ID",
2545
16
            "ansi_tcap.business_group.subgroup_id",
2546
16
            FT_UINT16, BASE_HEX, NULL, 0x0,
2547
16
            NULL, HFILL }
2548
16
        },
2549
16
        { &hf_ansi_tcap_parameter_business_group_line_privileges,
2550
16
          { "Line Privileges",
2551
16
            "ansi_tcap.business_group.line_privileges",
2552
16
            FT_UINT8, BASE_HEX, NULL, 0x0,
2553
16
            NULL, HFILL }
2554
16
        },
2555
16
        { &hf_ansi_tcap_parameter_signalling_networks_id,
2556
16
          { "Signalling Networks ID",
2557
16
            "ansi_tcap.business_group.signalling_networks_id",
2558
16
            FT_UINT_BYTES, BASE_NONE, NULL, 0x0,
2559
16
            NULL, HFILL }
2560
16
        },
2561
16
        { &hf_ansi_tcap_parameter_generic_name_type_name,
2562
16
          { "Generic Name Type",
2563
16
            "ansi_tcap.generic_name.type_name",
2564
16
            FT_UINT8, BASE_HEX, VALS(ansi_tcap_national_parameter_generic_name_type_of_name), 0xD0,
2565
16
            NULL, HFILL }
2566
16
        },
2567
16
        { &hf_ansi_tcap_parameter_generic_name_availability,
2568
16
          { "Generic Name Availability",
2569
16
            "ansi_tcap.generic_name.availability",
2570
16
            FT_UINT8, BASE_HEX, VALS(ansi_tcap_national_parameter_generic_name_availability), 0x10,
2571
16
            NULL, HFILL }
2572
16
        },
2573
16
        { &hf_ansi_tcap_parameter_generic_name_spare,
2574
16
          { "Generic Name Spare",
2575
16
            "ansi_tcap.generic_name.type_name_spare",
2576
16
            FT_UINT8, BASE_HEX, VALS(ansi_tcap_national_parameter_spare), 0x0C,
2577
16
            NULL, HFILL }
2578
16
        },
2579
16
        { &hf_ansi_tcap_parameter_generic_name_presentation,
2580
16
          { "Generic Name Presentation",
2581
16
            "ansi_tcap.generic_name.type_name_presentation",
2582
16
            FT_UINT8, BASE_HEX, VALS(ansi_tcap_national_parameter_generic_name_presentation_field), 0x03,
2583
16
            NULL, HFILL }
2584
16
        },
2585
16
        { &hf_ansi_tcap_message_waiting_indicator_type,
2586
16
          { "Message Waiting Indicator Type",
2587
16
            "ansi_tcap.message_waiting_indicator_type",
2588
16
            FT_UINT8, BASE_HEX, NULL, 0x0,
2589
16
            NULL, HFILL }
2590
16
        },
2591
16
        { &hf_ansi_tcap_parameter_generic_name_characters,
2592
16
          { "Name Characters",
2593
16
            "ansi_tcap.generic_name.characters",
2594
16
            FT_STRING, BASE_NONE, NULL, 0x0,
2595
16
            NULL, HFILL }
2596
16
        },
2597
16
        { &hf_ansi_tcap_parameter_look_ahead_for_busy_ack_type,
2598
16
          { "Act. Type",
2599
16
            "ansi_tcap.look_ahead_for_busy_ack_type",
2600
16
            FT_UINT8, BASE_HEX, VALS(ansi_tcap_national_parameter_look_ahead_for_busy_ack), 0xC0,
2601
16
            NULL, HFILL }
2602
16
        },
2603
16
        { &hf_ansi_tcap_parameter_look_ahead_for_busy_spare,
2604
16
          { "Spare",
2605
16
            "ansi_tcap.look_ahead_for_busy_spare",
2606
16
            FT_UINT8, BASE_HEX, VALS(ansi_tcap_national_parameter_spare), 0x30,
2607
16
            NULL, HFILL }
2608
16
        },
2609
16
        { &hf_ansi_tcap_parameter_look_ahead_for_busy_location_field,
2610
16
          { "Location",
2611
16
            "ansi_tcap.look_ahead_for_busy_location",
2612
16
            FT_UINT8, BASE_HEX, VALS(ansi_tcap_national_parameter_look_ahead_for_busy_location_field), 0x0f,
2613
16
            NULL, HFILL }
2614
16
        },
2615
16
        { &hf_ansi_tcap_parameter_acg_control_cause_indicator,
2616
16
          { "Control Cause Indicator",
2617
16
            "ansi_tcap.acg_control_cause_indicator",
2618
16
            FT_UINT8, BASE_HEX, VALS(ansi_tcap_national_parameter_control_cause_indication), 0x0,
2619
16
            NULL, HFILL }
2620
16
        },
2621
16
        { &hf_ansi_tcap_parameter_acg_duration_field,
2622
16
          { "Duration Field",
2623
16
            "ansi_tcap.acg_duration_field",
2624
16
            FT_UINT8, BASE_HEX, VALS(ansi_tcap_national_parameter_duration_field), 0x0,
2625
16
            NULL, HFILL }
2626
16
        },
2627
16
        { &hf_ansi_tcap_parameter_acg_gap,
2628
16
          { "Gap",
2629
16
            "ansi_tcap.acg_gap",
2630
16
            FT_UINT8, BASE_HEX, VALS(ansi_tcap_national_parameter_gap), 0x0,
2631
16
            NULL, HFILL }
2632
16
        },
2633
16
        { &hf_ansi_tcap_parameter_standard_announcement,
2634
16
          { "Standard Announcement",
2635
16
            "ansi_tcap.standard_announcement",
2636
16
            FT_UINT8, BASE_HEX, VALS(ansi_tcap_standard_announcements), 0x0,
2637
16
            NULL, HFILL }
2638
16
        },
2639
16
        { &hf_ansi_tcap_parameter_customized_announcement,
2640
16
          { "Customized Announcement",
2641
16
            "ansi_tcap.customized_announcement",
2642
16
            FT_UINT_BYTES, BASE_NONE, NULL, 0x0,
2643
16
            NULL, HFILL }
2644
16
        },
2645
16
        { &hf_ansi_tcap_parameter_digits_type_of_digits,
2646
16
          { "Type of Digits",
2647
16
            "ansi_tcap.digits.type_of_digits",
2648
16
            FT_UINT8, BASE_HEX, VALS(ansi_tcap_national_parameter_digits_type_of_digits), 0x0,
2649
16
            NULL, HFILL }
2650
16
        },
2651
16
        { &hf_ansi_tcap_parameter_digits_nature_of_number,
2652
16
          { "Nature of Number",
2653
16
            "ansi_tcap.digits.nature_of_number",
2654
16
            FT_UINT8, BASE_HEX, VALS(ansi_tcap_national_parameter_digits_nature_of_number), 0x03,
2655
16
            NULL, HFILL }
2656
16
        },
2657
16
        { &hf_ansi_tcap_parameter_digits_number_plan,
2658
16
          { "Numbering Plan",
2659
16
            "ansi_tcap.digits.number_plan",
2660
16
            FT_UINT8, BASE_HEX, VALS(ansi_tcap_national_parameter_digits_number_plan), 0xf0,
2661
16
            NULL, HFILL }
2662
16
        },
2663
16
        { &hf_ansi_tcap_parameter_digits_encoding,
2664
16
          { "Encoding",
2665
16
            "ansi_tcap.digits.encoding",
2666
16
            FT_UINT8, BASE_HEX, VALS(ansi_tcap_national_parameter_digits_encoding), 0x0f,
2667
16
            NULL, HFILL }
2668
16
        },
2669
16
        { &hf_ansi_tcap_parameter_digits_number_of_digits,
2670
16
          { "Number of Digits",
2671
16
            "ansi_tcap.digits.number_of_digits",
2672
16
            FT_UINT8, BASE_HEX, NULL, 0x0,
2673
16
            NULL, HFILL }
2674
16
        },
2675
        /* XXX - Should there be separate values for BCD and IA5 digits? */
2676
16
        { &hf_ansi_tcap_parameter_digits,
2677
16
          { "Digits",
2678
16
            "ansi_tcap.digits.digit",
2679
16
            FT_UINT8, BASE_HEX, VALS(ansi_tcap_national_parameter_digits), 0x0,
2680
16
            NULL, HFILL }
2681
16
        },
2682
16
        { &hf_ansi_tcap_standard_user_error_code,
2683
16
          { "User Error Code",
2684
16
            "ansi_tcap.standard_user_error_code",
2685
16
            FT_UINT8, BASE_HEX, VALS(ansi_tcap_standard_user_error_code), 0x0,
2686
16
            NULL, HFILL }
2687
16
        },
2688
16
        { &hf_ansi_tcap_sccp_calling_party_address,
2689
16
          { "SCCP Calling Party Address",
2690
16
            "ansi_tcap.sccp_calling_party_address",
2691
16
            FT_UINT8, BASE_DEC, NULL, 0x0,
2692
16
            NULL, HFILL }
2693
16
        },
2694
16
        { &hf_ansi_tcap_transaction_id,
2695
16
          { "Transaction ID",
2696
16
            "ansi_tcap.transaction_id",
2697
16
            FT_UINT8, BASE_DEC, NULL, 0x0,
2698
16
            NULL, HFILL }
2699
16
        },
2700
16
        { &hf_ansi_tcap_package_type,
2701
16
          { "Package Type",
2702
16
            "ansi_tcap.package_type",
2703
16
            FT_UINT8, BASE_DEC, VALS(ansi_tcap_package_types), 0x0,
2704
16
            NULL, HFILL }
2705
16
        },
2706
16
        { &hf_ansi_tcap_returned_data,
2707
16
          { "Returned Data",
2708
16
            "ansi_tcap.returned_data",
2709
16
            FT_UINT8, BASE_HEX, NULL, 0x0,
2710
16
            NULL, HFILL }
2711
16
        },
2712
16
        { &hf_ansi_tcap_parameter_CIC_lsb,
2713
16
          { "CIC Least Significant Bits",
2714
16
            "ansi_tcap.CIC_lsb",
2715
16
            FT_UINT8, BASE_HEX, NULL, 0x0,
2716
16
            NULL, HFILL }
2717
16
        },
2718
16
        { &hf_ansi_tcap_parameter_CIC_spare,
2719
16
          { "CIC Spare",
2720
16
            "ansi_tcap.CIC_spare",
2721
16
            FT_UINT8, BASE_HEX, NULL, 0xC0,
2722
16
            NULL, HFILL }
2723
16
        },
2724
16
        { &hf_ansi_tcap_parameter_CIC_msb,
2725
16
          { "CIC Most Significant Bits",
2726
16
            "ansi_tcap.CIC_msb",
2727
16
            FT_UINT8, BASE_HEX, NULL, 0x3F,
2728
16
            NULL, HFILL }
2729
16
        },
2730
16
        { &hf_ansi_tcap_parameter_precedence_level_spare,
2731
16
          { "Precedence Level Spare",
2732
16
            "ansi_tcap.precedence_level_spare",
2733
16
            FT_UINT8, BASE_HEX, NULL, 0xF0,
2734
16
            NULL, HFILL }
2735
16
        },
2736
16
        { &hf_ansi_tcap_parameter_precedence_level,
2737
16
          { "Precedence Level",
2738
16
            "ansi_tcap.precedence_level",
2739
16
            FT_UINT8, BASE_HEX, VALS(ansi_tcap_national_parameter_level), 0x0F,
2740
16
            NULL, HFILL }
2741
16
        },
2742
16
        { &hf_ansi_tcap_parameter_precedence_id1,
2743
16
          { "NI digit #1",
2744
16
            "ansi_tcap.precedence_id1",
2745
16
            FT_UINT8, BASE_HEX, NULL, 0xF0,
2746
16
            NULL, HFILL }
2747
16
        },
2748
16
        { &hf_ansi_tcap_parameter_precedence_id2,
2749
16
          { "NI digit #2",
2750
16
            "ansi_tcap.precedence_id2",
2751
16
            FT_UINT8, BASE_HEX, NULL, 0x0F,
2752
16
            NULL, HFILL }
2753
16
        },
2754
16
        { &hf_ansi_tcap_parameter_precedence_id3,
2755
16
          { "NI digit #3",
2756
16
            "ansi_tcap.precedence_id3",
2757
16
            FT_UINT8, BASE_HEX, NULL, 0xF0,
2758
16
            NULL, HFILL }
2759
16
        },
2760
16
        { &hf_ansi_tcap_parameter_precedence_id4,
2761
16
          { "NI digit #4",
2762
16
            "ansi_tcap.precedence_id4",
2763
16
            FT_UINT8, BASE_HEX, NULL, 0x0F,
2764
16
            NULL, HFILL }
2765
16
        },
2766
16
        { &hf_ansi_tcap_parameter_precedence_mlpp_service_domain,
2767
16
          { "MLPP Service Domain",
2768
16
            "ansi_tcap.precedence_mlpp_service_domain",
2769
16
            FT_BYTES, BASE_NONE, NULL, 0x0,
2770
16
            NULL, HFILL }
2771
16
        },
2772
16
        { &hf_ansi_tcap_reference_id_call_identify,
2773
16
          { "Call Identify",
2774
16
            "ansi_tcap.reference_id.call_identify",
2775
16
            FT_BYTES, BASE_NONE, NULL, 0x0,
2776
16
            NULL, HFILL }
2777
16
        },
2778
16
        { &hf_ansi_tcap_reference_id_point_code,
2779
16
          { "Point Code",
2780
16
            "ansi_tcap.reference_id.point_code",
2781
16
            FT_BYTES, BASE_NONE, NULL, 0x0,
2782
16
            NULL, HFILL }
2783
16
        },
2784
16
        { &hf_ansi_tcap_parameter_authorization,
2785
16
          { "Authorization",
2786
16
            "ansi_tcap.authorization",
2787
16
            FT_UINT8, BASE_HEX, NULL, 0x0,
2788
16
            NULL, HFILL }
2789
16
        },
2790
16
        { &hf_ansi_tcap_integrity_algid_id,
2791
16
          { "Integrity AlgID ID",
2792
16
            "ansi_tcap.integrity.algid_id",
2793
16
            FT_UINT8, BASE_HEX, NULL, 0x0,
2794
16
            NULL, HFILL }
2795
16
        },
2796
16
        { &hf_ansi_tcap_integrity_algid,
2797
16
          { "Integrity AlgID",
2798
16
            "ansi_tcap.integrity.algid",
2799
16
            FT_UINT_BYTES, BASE_NONE, NULL, 0x0,
2800
16
            NULL, HFILL }
2801
16
        },
2802
16
        { &hf_ansi_tcap_integrity_value_id,
2803
16
          { "Integrity Value AlgID ID",
2804
16
            "ansi_tcap.integrity.value_id",
2805
16
            FT_UINT8, BASE_HEX, NULL, 0x0,
2806
16
            NULL, HFILL }
2807
16
        },
2808
16
        { &hf_ansi_tcap_integrity_value,
2809
16
          { "Integrity Value AlgID",
2810
16
            "ansi_tcap.integrity.value",
2811
16
            FT_UINT_BYTES, BASE_NONE, NULL, 0x0,
2812
16
            NULL, HFILL }
2813
16
        },
2814
16
        { &hf_ansi_tcap_sequence_number,
2815
16
          { "Sequence Number",
2816
16
            "ansi_tcap.sequence_number",
2817
16
            FT_UINT_BYTES, BASE_NONE, NULL, 0x0,
2818
16
            NULL, HFILL }
2819
16
        },
2820
16
        { &hf_ansi_tcap_num_messages,
2821
16
          { "Number of Messages",
2822
16
            "ansi_tcap.num_messages",
2823
16
            FT_UINT_BYTES, BASE_NONE, NULL, 0x0,
2824
16
            NULL, HFILL }
2825
16
        },
2826
16
        { &hf_ansi_tcap_display_text,
2827
16
          { "Display Text",
2828
16
            "ansi_tcap.display_text",
2829
16
            FT_UINT_STRING, BASE_NONE, NULL, 0x0,
2830
16
            NULL, HFILL }
2831
16
        },
2832
16
        { &hf_ansi_tcap_key_exchange_algid_id,
2833
16
          { "Key Exchange AlgID ID",
2834
16
            "ansi_tcap.key_exchange.algid_id",
2835
16
            FT_UINT8, BASE_HEX, NULL, 0x0,
2836
16
            NULL, HFILL }
2837
16
        },
2838
16
        { &hf_ansi_tcap_key_exchange_algid,
2839
16
          { "Key Exchange AlgID",
2840
16
            "ansi_tcap.key_exchange.algid",
2841
16
            FT_UINT_BYTES, BASE_NONE, NULL, 0x0,
2842
16
            NULL, HFILL }
2843
16
        },
2844
16
        { &hf_ansi_tcap_key_exchange_value_id,
2845
16
          { "Key Exchange Value AlgID ID",
2846
16
            "ansi_tcap.key_exchange.value_id",
2847
16
            FT_UINT8, BASE_HEX, NULL, 0x0,
2848
16
            NULL, HFILL }
2849
16
        },
2850
16
        { &hf_ansi_tcap_key_exchange_value,
2851
16
          { "Key Exchange Value AlgID",
2852
16
            "ansi_tcap.key_exchange.value",
2853
16
            FT_UINT_BYTES, BASE_NONE, NULL, 0x0,
2854
16
            NULL, HFILL }
2855
16
        },
2856
2857
16
    { &hf_ansi_tcap_national,
2858
16
      { "national", "ansi_tcap.national",
2859
16
        FT_INT32, BASE_DEC, NULL, 0,
2860
16
        NULL, HFILL }},
2861
16
    { &hf_ansi_tcap_private,
2862
16
      { "private", "ansi_tcap.private",
2863
16
        FT_INT32, BASE_DEC, NULL, 0,
2864
16
        NULL, HFILL }},
2865
16
    { &hf_ansi_tcap_national_01,
2866
16
      { "national", "ansi_tcap.national",
2867
16
        FT_INT32, BASE_DEC, NULL, 0,
2868
16
        "INTEGER_M128_127", HFILL }},
2869
16
    { &hf_ansi_tcap_ec_private,
2870
16
      { "private", "ansi_tcap.ec_private",
2871
16
        FT_UINT32, BASE_DEC, VALS(ansi_tcap_ANSIMAPPrivateErrorcode_vals), 0,
2872
16
        "ANSIMAPPrivateErrorcode", HFILL }},
2873
16
    { &hf_ansi_tcap_unidirectional,
2874
16
      { "unidirectional", "ansi_tcap.unidirectional_element",
2875
16
        FT_NONE, BASE_NONE, NULL, 0,
2876
16
        NULL, HFILL }},
2877
16
    { &hf_ansi_tcap_queryWithPerm,
2878
16
      { "queryWithPerm", "ansi_tcap.queryWithPerm_element",
2879
16
        FT_NONE, BASE_NONE, NULL, 0,
2880
16
        NULL, HFILL }},
2881
16
    { &hf_ansi_tcap_queryWithoutPerm,
2882
16
      { "queryWithoutPerm", "ansi_tcap.queryWithoutPerm_element",
2883
16
        FT_NONE, BASE_NONE, NULL, 0,
2884
16
        NULL, HFILL }},
2885
16
    { &hf_ansi_tcap_response,
2886
16
      { "response", "ansi_tcap.response_element",
2887
16
        FT_NONE, BASE_NONE, NULL, 0,
2888
16
        NULL, HFILL }},
2889
16
    { &hf_ansi_tcap_conversationWithPerm,
2890
16
      { "conversationWithPerm", "ansi_tcap.conversationWithPerm_element",
2891
16
        FT_NONE, BASE_NONE, NULL, 0,
2892
16
        NULL, HFILL }},
2893
16
    { &hf_ansi_tcap_conversationWithoutPerm,
2894
16
      { "conversationWithoutPerm", "ansi_tcap.conversationWithoutPerm_element",
2895
16
        FT_NONE, BASE_NONE, NULL, 0,
2896
16
        NULL, HFILL }},
2897
16
    { &hf_ansi_tcap_abort,
2898
16
      { "abort", "ansi_tcap.abort_element",
2899
16
        FT_NONE, BASE_NONE, NULL, 0,
2900
16
        NULL, HFILL }},
2901
16
    { &hf_ansi_tcap_identifier,
2902
16
      { "identifier", "ansi_tcap.identifier",
2903
16
        FT_BYTES, BASE_NONE, NULL, 0,
2904
16
        "TransactionID", HFILL }},
2905
16
    { &hf_ansi_tcap_dialoguePortion,
2906
16
      { "dialoguePortion", "ansi_tcap.dialoguePortion_element",
2907
16
        FT_NONE, BASE_NONE, NULL, 0,
2908
16
        NULL, HFILL }},
2909
16
    { &hf_ansi_tcap_componentPortion,
2910
16
      { "componentPortion", "ansi_tcap.componentPortion",
2911
16
        FT_UINT32, BASE_DEC, NULL, 0,
2912
16
        "ComponentSequence", HFILL }},
2913
16
    { &hf_ansi_tcap_dialogPortion,
2914
16
      { "dialogPortion", "ansi_tcap.dialogPortion_element",
2915
16
        FT_NONE, BASE_NONE, NULL, 0,
2916
16
        "DialoguePortion", HFILL }},
2917
16
    { &hf_ansi_tcap_causeInformation,
2918
16
      { "causeInformation", "ansi_tcap.causeInformation",
2919
16
        FT_UINT32, BASE_DEC, VALS(ansi_tcap_T_causeInformation_vals), 0,
2920
16
        NULL, HFILL }},
2921
16
    { &hf_ansi_tcap_abortCause,
2922
16
      { "abortCause", "ansi_tcap.abortCause",
2923
16
        FT_INT32, BASE_DEC, VALS(ansi_tcap_P_Abort_cause_U_vals), 0,
2924
16
        "P_Abort_cause", HFILL }},
2925
16
    { &hf_ansi_tcap_abort_userInformation,
2926
16
      { "userInformation", "ansi_tcap.abort_userInformation_element",
2927
16
        FT_NONE, BASE_NONE, NULL, 0,
2928
16
        "UserAbortInformation", HFILL }},
2929
16
    { &hf_ansi_tcap_version,
2930
16
      { "version", "ansi_tcap.version",
2931
16
        FT_BYTES, BASE_NONE, NULL, 0,
2932
16
        "ProtocolVersion", HFILL }},
2933
16
    { &hf_ansi_tcap_applicationContext,
2934
16
      { "applicationContext", "ansi_tcap.applicationContext",
2935
16
        FT_UINT32, BASE_DEC, VALS(ansi_tcap_T_applicationContext_vals), 0,
2936
16
        NULL, HFILL }},
2937
16
    { &hf_ansi_tcap_integerApplicationId,
2938
16
      { "integerApplicationId", "ansi_tcap.integerApplicationId",
2939
16
        FT_INT32, BASE_DEC, NULL, 0,
2940
16
        "IntegerApplicationContext", HFILL }},
2941
16
    { &hf_ansi_tcap_objectApplicationId,
2942
16
      { "objectApplicationId", "ansi_tcap.objectApplicationId",
2943
16
        FT_OID, BASE_NONE, NULL, 0,
2944
16
        "ObjectIDApplicationContext", HFILL }},
2945
16
    { &hf_ansi_tcap_userInformation,
2946
16
      { "userInformation", "ansi_tcap.userInformation",
2947
16
        FT_UINT32, BASE_DEC, NULL, 0,
2948
16
        NULL, HFILL }},
2949
16
    { &hf_ansi_tcap_securityContext,
2950
16
      { "securityContext", "ansi_tcap.securityContext",
2951
16
        FT_UINT32, BASE_DEC, VALS(ansi_tcap_T_securityContext_vals), 0,
2952
16
        NULL, HFILL }},
2953
16
    { &hf_ansi_tcap_integerSecurityId,
2954
16
      { "integerSecurityId", "ansi_tcap.integerSecurityId",
2955
16
        FT_INT32, BASE_DEC, NULL, 0,
2956
16
        "INTEGER", HFILL }},
2957
16
    { &hf_ansi_tcap_objectSecurityId,
2958
16
      { "objectSecurityId", "ansi_tcap.objectSecurityId",
2959
16
        FT_OID, BASE_NONE, NULL, 0,
2960
16
        "OBJECT_IDENTIFIER", HFILL }},
2961
16
    { &hf_ansi_tcap_confidentiality,
2962
16
      { "confidentiality", "ansi_tcap.confidentiality_element",
2963
16
        FT_NONE, BASE_NONE, NULL, 0,
2964
16
        NULL, HFILL }},
2965
16
    { &hf_ansi_tcap__untag_item,
2966
16
      { "_untag item", "ansi_tcap._untag_item_element",
2967
16
        FT_NONE, BASE_NONE, NULL, 0,
2968
16
        "EXTERNAL", HFILL }},
2969
16
    { &hf_ansi_tcap_confidentialityId,
2970
16
      { "confidentialityId", "ansi_tcap.confidentialityId",
2971
16
        FT_UINT32, BASE_DEC, VALS(ansi_tcap_T_confidentialityId_vals), 0,
2972
16
        NULL, HFILL }},
2973
16
    { &hf_ansi_tcap_integerConfidentialityId,
2974
16
      { "integerConfidentialityId", "ansi_tcap.integerConfidentialityId",
2975
16
        FT_INT32, BASE_DEC, NULL, 0,
2976
16
        "INTEGER", HFILL }},
2977
16
    { &hf_ansi_tcap_objectConfidentialityId,
2978
16
      { "objectConfidentialityId", "ansi_tcap.objectConfidentialityId",
2979
16
        FT_OID, BASE_NONE, NULL, 0,
2980
16
        "OBJECT_IDENTIFIER", HFILL }},
2981
16
    { &hf_ansi_tcap__untag_item_01,
2982
16
      { "ComponentPDU", "ansi_tcap.ComponentPDU",
2983
16
        FT_UINT32, BASE_DEC, VALS(ansi_tcap_ComponentPDU_vals), 0,
2984
16
        NULL, HFILL }},
2985
16
    { &hf_ansi_tcap_invokeLast,
2986
16
      { "invokeLast", "ansi_tcap.invokeLast_element",
2987
16
        FT_NONE, BASE_NONE, NULL, 0,
2988
16
        "Invoke", HFILL }},
2989
16
    { &hf_ansi_tcap_returnResultLast,
2990
16
      { "returnResultLast", "ansi_tcap.returnResultLast_element",
2991
16
        FT_NONE, BASE_NONE, NULL, 0,
2992
16
        "ReturnResult", HFILL }},
2993
16
    { &hf_ansi_tcap_returnError,
2994
16
      { "returnError", "ansi_tcap.returnError_element",
2995
16
        FT_NONE, BASE_NONE, NULL, 0,
2996
16
        NULL, HFILL }},
2997
16
    { &hf_ansi_tcap_reject,
2998
16
      { "reject", "ansi_tcap.reject_element",
2999
16
        FT_NONE, BASE_NONE, NULL, 0,
3000
16
        NULL, HFILL }},
3001
16
    { &hf_ansi_tcap_invokeNotLast,
3002
16
      { "invokeNotLast", "ansi_tcap.invokeNotLast_element",
3003
16
        FT_NONE, BASE_NONE, NULL, 0,
3004
16
        "Invoke", HFILL }},
3005
16
    { &hf_ansi_tcap_returnResultNotLast,
3006
16
      { "returnResultNotLast", "ansi_tcap.returnResultNotLast_element",
3007
16
        FT_NONE, BASE_NONE, NULL, 0,
3008
16
        "ReturnResult", HFILL }},
3009
16
    { &hf_ansi_tcap_componentIDs,
3010
16
      { "componentIDs", "ansi_tcap.componentIDs",
3011
16
        FT_BYTES, BASE_NONE, NULL, 0,
3012
16
        NULL, HFILL }},
3013
16
    { &hf_ansi_tcap_operationCode,
3014
16
      { "operationCode", "ansi_tcap.operationCode",
3015
16
        FT_UINT32, BASE_DEC, VALS(ansi_tcap_OperationCode_vals), 0,
3016
16
        NULL, HFILL }},
3017
16
    { &hf_ansi_tcap_invoke_parameter,
3018
16
      { "parameter", "ansi_tcap.invoke_parameter_element",
3019
16
        FT_NONE, BASE_NONE, NULL, 0,
3020
16
        "T_invoke_parameter", HFILL }},
3021
16
    { &hf_ansi_tcap_componentID,
3022
16
      { "componentID", "ansi_tcap.componentID",
3023
16
        FT_BYTES, BASE_NONE, NULL, 0,
3024
16
        NULL, HFILL }},
3025
16
    { &hf_ansi_tcap_returnResult_parameter,
3026
16
      { "parameter", "ansi_tcap.returnResult_parameter_element",
3027
16
        FT_NONE, BASE_NONE, NULL, 0,
3028
16
        "T_returnResult_parameter", HFILL }},
3029
16
    { &hf_ansi_tcap_componentID_01,
3030
16
      { "componentID", "ansi_tcap.componentID",
3031
16
        FT_BYTES, BASE_NONE, NULL, 0,
3032
16
        "T_componentID_01", HFILL }},
3033
16
    { &hf_ansi_tcap_errorCode,
3034
16
      { "errorCode", "ansi_tcap.errorCode",
3035
16
        FT_UINT32, BASE_DEC, VALS(ansi_tcap_ErrorCode_vals), 0,
3036
16
        NULL, HFILL }},
3037
16
    { &hf_ansi_tcap_returnError_parameter,
3038
16
      { "parameter", "ansi_tcap.returnError_parameter_element",
3039
16
        FT_NONE, BASE_NONE, NULL, 0,
3040
16
        "T_returnError_parameter", HFILL }},
3041
16
    { &hf_ansi_tcap_componentID_02,
3042
16
      { "componentID", "ansi_tcap.componentID",
3043
16
        FT_BYTES, BASE_NONE, NULL, 0,
3044
16
        "OCTET_STRING_SIZE_0_1", HFILL }},
3045
16
    { &hf_ansi_tcap_rejectProblem,
3046
16
      { "rejectProblem", "ansi_tcap.rejectProblem",
3047
16
        FT_INT32, BASE_DEC, VALS(ansi_tcap_Problem_vals), 0,
3048
16
        "Problem", HFILL }},
3049
16
    { &hf_ansi_tcap_reject_parameter,
3050
16
      { "parameter", "ansi_tcap.reject_parameter",
3051
16
        FT_UINT32, BASE_DEC, VALS(ansi_tcap_T_reject_parameter_vals), 0,
3052
16
        "T_reject_parameter", HFILL }},
3053
16
    { &hf_ansi_tcap_paramSequence,
3054
16
      { "paramSequence", "ansi_tcap.paramSequence_element",
3055
16
        FT_NONE, BASE_NONE, NULL, 0,
3056
16
        NULL, HFILL }},
3057
16
    { &hf_ansi_tcap_paramSet,
3058
16
      { "paramSet", "ansi_tcap.paramSet_element",
3059
16
        FT_NONE, BASE_NONE, NULL, 0,
3060
16
        NULL, HFILL }},
3061
16
    };
3062
3063
/* Setup protocol subtree array */
3064
16
    static int *ett[] = {
3065
16
        &ett_tcap,
3066
16
        &ett_param,
3067
16
        &ett_otid,
3068
16
        &ett_dtid,
3069
16
        &ett_ansi_tcap_stat,
3070
16
        &ett_ansi_tcap_op_code_nat,
3071
16
        &ett_ansi_tcap_stat_timestamp,
3072
16
        &ett_ansi_tcap_duration,
3073
16
    &ett_ansi_tcap_OperationCode,
3074
16
    &ett_ansi_tcap_ErrorCode,
3075
16
    &ett_ansi_tcap_PackageType,
3076
16
    &ett_ansi_tcap_UniTransactionPDU,
3077
16
    &ett_ansi_tcap_TransactionPDU,
3078
16
    &ett_ansi_tcap_Abort,
3079
16
    &ett_ansi_tcap_T_causeInformation,
3080
16
    &ett_ansi_tcap_DialoguePortion_U,
3081
16
    &ett_ansi_tcap_T_applicationContext,
3082
16
    &ett_ansi_tcap_T_securityContext,
3083
16
    &ett_ansi_tcap_UserInformation_U,
3084
16
    &ett_ansi_tcap_Confidentiality,
3085
16
    &ett_ansi_tcap_T_confidentialityId,
3086
16
    &ett_ansi_tcap_SEQUENCE_OF_ComponentPDU,
3087
16
    &ett_ansi_tcap_ComponentPDU,
3088
16
    &ett_ansi_tcap_Invoke,
3089
16
    &ett_ansi_tcap_ReturnResult,
3090
16
    &ett_ansi_tcap_ReturnError,
3091
16
    &ett_ansi_tcap_Reject,
3092
16
    &ett_ansi_tcap_T_reject_parameter,
3093
16
    &ett_ansi_tcap_T_paramSequence,
3094
16
    &ett_ansi_tcap_T_paramSet,
3095
16
    };
3096
3097
16
    static ei_register_info ei[] = {
3098
16
        { &ei_ansi_tcap_dissector_not_implemented, { "ansi_tcap.dissector_not_implemented", PI_UNDECODED, PI_WARN, "Dissector not implemented", EXPFILL }},
3099
16
        { &ei_ansi_tcap_no_parameters, { "ansi_tcap.no_parameters", PI_PROTOCOL, PI_NOTE, "No parameters exist", EXPFILL }},
3100
16
        { &ei_ansi_tcap_too_many_components, { "ansi_tcap.too_many_components", PI_UNDECODED, PI_WARN, "Too many components in one package, parameters not dissected", EXPFILL }},
3101
16
    };
3102
3103
16
    expert_module_t* expert_ansi_tcap;
3104
3105
16
    static const enum_val_t ansi_tcap_response_matching_type_values[] = {
3106
16
        {"tid",                  "Transaction ID only", ANSI_TCAP_TID_ONLY},
3107
16
        {"tid_source",           "Transaction ID and Source", ANSI_TCAP_TID_AND_SOURCE},
3108
16
        {"tid_source_dest",      "Transaction ID Source and Destination", ANSI_TCAP_TID_SOURCE_AND_DEST},
3109
16
        {NULL, NULL, -1}
3110
16
    };
3111
3112
/* Register the protocol name and description */
3113
16
    proto_ansi_tcap = proto_register_protocol("ANSI Transaction Capabilities Application Part", "ANSI_TCAP", "ansi_tcap");
3114
16
    register_dissector("ansi_tcap", dissect_ansi_tcap, proto_ansi_tcap);
3115
3116
   /* Note the high bit should be masked off when registering in this table (0x7fff)*/
3117
16
   ansi_tcap_national_opcode_table = register_dissector_table("ansi_tcap.nat.opcode", "ANSI TCAP National Opcodes", proto_ansi_tcap, FT_UINT16, BASE_DEC);
3118
/* Required function calls to register the header fields and subtrees used */
3119
16
    proto_register_field_array(proto_ansi_tcap, hf, array_length(hf));
3120
16
    proto_register_subtree_array(ett, array_length(ett));
3121
16
    expert_ansi_tcap = expert_register_protocol(proto_ansi_tcap);
3122
16
    expert_register_field_array(expert_ansi_tcap, ei, array_length(ei));
3123
3124
16
    ansi_tcap_module = prefs_register_protocol(proto_ansi_tcap, proto_reg_handoff_ansi_tcap);
3125
3126
16
    prefs_register_enum_preference(ansi_tcap_module, "transaction.matchtype",
3127
16
                                   "Type of matching invoke/response",
3128
16
                                   "Type of matching invoke/response, risk of mismatch if loose matching chosen",
3129
16
                                   &ansi_tcap_response_matching_type, ansi_tcap_response_matching_type_values, false);
3130
3131
16
    TransactionId_table = wmem_multimap_new_autoreset(wmem_epan_scope(), wmem_file_scope(), wmem_str_hash, g_str_equal);
3132
16
}