1 /* packet-inap-template.c
3 * Copyright 2004, Tim Endean <endeant@hotmail.com>
4 * Built from the gsm-map dissector Copyright 2004, Anders Broman <anders.broman@ericsson.com>
7 * Wireshark - Network traffic analyzer
8 * By Gerald Combs <gerald@wireshark.org>
9 * Copyright 1998 Gerald Combs
11 * This program is free software; you can redistribute it and/or
12 * modify it under the terms of the GNU General Public License
13 * as published by the Free Software Foundation; either version 2
14 * of the License, or (at your option) any later version.
16 * This program is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 * GNU General Public License for more details.
21 * You should have received a copy of the GNU General Public License
22 * along with this program; if not, write to the Free Software
23 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
24 * References: ETSI 300 374
33 #include <epan/packet.h>
34 #include <epan/prefs.h>
35 #include <epan/conversation.h>
36 #include <epan/oids.h>
37 #include "epan/expert.h"
38 #include <epan/asn1.h>
43 #include "packet-ber.h"
44 #include "packet-inap.h"
45 #include "packet-q931.h"
46 #include "packet-e164.h"
47 #include "packet-isup.h"
48 #include "packet-tcap.h"
50 #define PNAME "Intelligent Network Application Protocol"
54 /* Initialize the protocol and registered fields */
57 #include "packet-inap-hf.c"
60 static range_t *global_ssn_range;
61 static range_t *ssn_range;
63 static dissector_handle_t inap_handle;
65 /* Global variables */
66 static guint32 opcode=0;
67 static guint32 errorCode;
69 /* Initialize the subtree pointers */
70 static gint ett_inap = -1;
71 static gint ett_inapisup_parameter = -1;
72 #include "packet-inap-ett.c"
74 const value_string inap_opr_code_strings[] = {
77 {1, "OriginationAttemptAuthorized"},
78 {2, "CollectedInformation"},
79 {3, "AnalysedInformation"},
80 {4, "RouteSelectFailure"},
81 {5, "oCalledPartyBusy"},
85 {9, "TermAttemptAuthorized"},
92 {16, "AssistRequestInstructions"},
93 {17,"EstablishTemporaryConnection"},
94 {18, "DisconnectForwardConnection"},
95 {19,"ConnectToResource"},
97 {21,"HoldCallInNetwork"},
99 {23, "RequestReportBCSMEven"},
100 {23, "RequestReportBCSMEvent"},
101 {24, "EventReportBCSM"},
102 {25, "RequestNotificationChargingEvent"},
103 {26, "EventNotificationCharging"},
104 {27, "CollectInformation"},
105 {28, "AnalyseInformation"},
107 {30, "SelectFacility"},
109 {32, "InitiateCallAttempt"},
111 {34, "FurnishChargingInformation"},
112 {35, "ApplyCharging"},
113 {36, "ApplyChargingReport"},
114 {37, "RequestCurrentStatusReport"},
115 {38, "RequestEveryStatusChangeReport"},
116 {39, "RequestFirstStatusMatchReport"},
117 {40, "StatusReport"},
119 {42, "ActivateServiceFiltering"},
120 {43, "ServiceFilteringResponse"},
121 {44, "CallInformationReport"},
122 {45, "CallInformationRequest"},
123 {46, "SendChargingInformation"},
124 {47, "PlayAnnouncement"},
125 {48, "PromptAndCollectUserInformation"},
126 {49, "SpecializedResourceReport"},
128 {54, "CancelStatusReportRequest"},
129 {55, "ActivityTest"},
130 {80, "FacilitySelectedAndAvailable"},
131 {81, "OriginationAttempt"},
132 {82, "TerminationAttempt"},
136 {87, "AuthorizeTermination"},
137 {88, "ContinueWithArgument"},
138 {89, "CreateCallSegmentAssociation "},
139 {90, "DisconnectLeg"},
140 {91, "MergeCallSegments"},
141 {92, "MoveCallSegments"},
145 {96, "EntityReleased"},
146 {97, "ManageTriggerData"},
147 {98, "requestReportUTSI"},
148 {99,"ReceivedInformation"}, /*???????*/
151 {102, "sendFacilityInformation"},
152 {103, "requestReportFacilityEvent"},
153 {104, "eventReportFacility"},
154 {107, "promptAndReceiveMessage"},
155 {108, "scriptInformation"},
156 {109, "scriptEvent"},
158 {111, "scriptClose"},
159 {135, "createOrRemoveTriggerData"},
160 {136, "setServiceProfile"},
162 {145, "CallFiltering"},
163 {146, "monitorRouteRequest"},
164 {147, "monitorRouteReport"},
168 const value_string inap_error_code_strings[] = {
173 {4,"improperCallerResponse"},
174 {6,"missingCustomerRecord"},
175 {7,"missingParameter"},
176 {8,"parameterOutOfRange"},
177 {10,"RequestedInfoError"},
178 {11,"SystemFailure"},
180 {13,"UnavailableResource"},
181 {14,"UnexpectedComponentSequence"},
182 {15,"UnexpectedDataValue"},
183 {16,"UnexpectedParameter"},
185 {18,"UnknownResource"},
189 const value_string inap_general_problem_strings[] = {
190 {0,"General Problem Unrecognized Component"},
191 {1,"General Problem Mistyped Component"},
192 {3,"General Problem Badly Structured Component"},
196 /* Forvard declarations */
197 static int dissect_invokeData(proto_tree *tree, tvbuff_t *tvb, int offset, asn1_ctx_t *actx _U_);
198 static int dissect_returnResultData(proto_tree *tree, tvbuff_t *tvb, int offset, asn1_ctx_t *actx _U_);
199 static int dissect_returnErrorData(proto_tree *tree, tvbuff_t *tvb, int offset, asn1_ctx_t *actx);
201 #include "packet-inap-fn.c"
203 TC-Invokable OPERATION ::=
204 {activateServiceFiltering | activityTest | analysedInformation |
205 analyseInformation | applyCharging | applyChargingReport |
206 assistRequestInstructions | callGap | callInformationReport |
207 callInformationRequest | cancel | cancelStatusReportRequest |
208 collectedInformation | collectInformation | connect | connectToResource |
209 continue | disconnectForwardConnection | establishTemporaryConnection |
210 eventNotificationCharging | eventReportBCSM | furnishChargingInformation |
211 holdCallInNetwork | initialDP | initiateCallAttempt | oAnswer |
212 oCalledPartyBusy | oDisconnect | oMidCall | oNoAnswer |
213 originationAttemptAuthorized | releaseCall | requestCurrentStatusReport |
214 requestEveryStatusChangeReport | requestFirstStatusMatchReport |
215 requestNotificationChargingEvent | requestReportBCSMEvent | resetTimer |
216 routeSelectFailure | selectFacility | selectRoute | sendChargingInformation
217 | serviceFilteringResponse | statusReport | tAnswer | tBusy | tDisconnect |
218 termAttemptAuthorized | tMidCall | tNoAnswer | playAnnouncement |
219 promptAndCollectUserInformation}
222 static int dissect_invokeData(proto_tree *tree, tvbuff_t *tvb, int offset, asn1_ctx_t *actx _U_) {
224 case 0: /*InitialDP*/
225 offset=dissect_inap_InitialDPArg(FALSE, tvb, offset, actx, tree, hf_inap_InitialDPArg_PDU);
227 case 1: /*1 OriginationAttemptAuthorized */
228 offset=dissect_inap_OriginationAttemptAuthorizedArg(FALSE, tvb, offset, actx, tree, hf_inap_OriginationAttemptAuthorizedArg_PDU);
230 case 2: /*2 CollectedInformation */
231 offset=dissect_inap_CollectedInformationArg(FALSE, tvb, offset, actx, tree, hf_inap_CollectedInformationArg_PDU);
233 case 3: /*3 AnalysedInformation */
234 offset=dissect_inap_AnalysedInformationArg(FALSE, tvb, offset, actx, tree, hf_inap_AnalysedInformationArg_PDU);
236 case 4: /*4 RouteSelectFailure */
237 offset=dissect_inap_RouteSelectFailureArg(FALSE, tvb, offset, actx, tree, hf_inap_RouteSelectFailureArg_PDU);
239 case 5: /*5 oCalledPartyBusy */
240 offset=dissect_inap_OCalledPartyBusyArg(FALSE, tvb, offset, actx, tree, hf_inap_OCalledPartyBusyArg_PDU);
242 case 6: /*6 oNoAnswer */
243 offset=dissect_inap_ONoAnswerArg(FALSE, tvb, offset, actx, tree, hf_inap_ONoAnswerArg_PDU);
245 case 7: /*7 oAnswer */
246 offset=dissect_inap_OAnswerArg(FALSE, tvb, offset, actx, tree, hf_inap_OAnswerArg_PDU);
248 case 8: /*8 oDisconnect */
249 offset=dissect_inap_ODisconnectArg(FALSE, tvb, offset, actx, tree, hf_inap_ODisconnectArg_PDU);
251 case 9: /*9 TermAttemptAuthorized */
252 offset=dissect_inap_TermAttemptAuthorizedArg(FALSE, tvb, offset, actx, tree, hf_inap_TermAttemptAuthorizedArg_PDU);
254 case 10: /*10 tBusy */
255 offset=dissect_inap_TBusyArg(FALSE, tvb, offset, actx, tree, hf_inap_TBusyArg_PDU);
257 case 11: /*11 tNoAnswer */
258 offset=dissect_inap_TNoAnswerArg(FALSE, tvb, offset, actx, tree, hf_inap_TNoAnswerArg_PDU);
260 case 12: /*12 tAnswer */
261 offset=dissect_inap_TAnswerArg(FALSE, tvb, offset, actx, tree, hf_inap_TAnswerArg_PDU);
263 case 13: /*13 tDisconnect */
264 offset=dissect_inap_TDisconnectArg(FALSE, tvb, offset, actx, tree, hf_inap_TDisconnectArg_PDU);
266 case 14: /*14 oMidCall */
267 offset=dissect_inap_MidCallArg(FALSE, tvb, offset, actx, tree, hf_inap_MidCallArg_PDU);
269 case 15: /*15 tMidCall */
270 offset=dissect_inap_MidCallArg(FALSE, tvb, offset, actx, tree, hf_inap_MidCallArg_PDU);
272 case 16: /*AssistRequestInstructions*/
273 offset=dissect_inap_AssistRequestInstructionsArg(FALSE, tvb, offset, actx, tree, hf_inap_AssistRequestInstructionsArg_PDU);
275 case 17: /*EstablishTemporaryConnection*/
276 offset=dissect_inap_EstablishTemporaryConnectionArg(FALSE, tvb, offset, actx, tree, hf_inap_EstablishTemporaryConnectionArg_PDU);
278 case 18: /*DisconnectForwardConnections*/
279 proto_tree_add_text(tree, tvb, offset, -1, "Disconnect Forward Connection");
281 case 19: /*ConnectToResource*/
282 offset=dissect_inap_ConnectToResourceArg(FALSE, tvb, offset, actx, tree, hf_inap_ConnectToResourceArg_PDU);
285 offset=dissect_inap_ConnectArg(FALSE, tvb, offset, actx, tree,hf_inap_ConnectArg_PDU);
287 case 21: /* 21 HoldCallInNetwork */
288 offset=dissect_inap_HoldCallInNetworkArg(FALSE, tvb, offset, actx, tree,hf_inap_HoldCallInNetworkArg_PDU);
291 case 22: /*ReleaseCall*/
292 offset=dissect_inap_ReleaseCallArg(FALSE, tvb, offset, actx, tree,hf_inap_ReleaseCallArg_PDU);
294 case 23: /*InitialDP*/
295 offset=dissect_inap_RequestReportBCSMEventArg(FALSE, tvb, offset, actx, tree, hf_inap_RequestReportBCSMEventArg_PDU);
297 case 24: /*EventReportBCSM*/
298 offset=dissect_inap_EventReportBCSMArg(FALSE, tvb, offset, actx, tree, hf_inap_EventReportBCSMArg_PDU);
300 case 25: /*25, "RequestNotificationChargingEvent */
301 offset=dissect_inap_RequestNotificationChargingEventArg(FALSE, tvb, offset, actx, tree, hf_inap_RequestNotificationChargingEventArg_PDU);
303 case 26: /*26, "EventNotificationCharging */
304 offset=dissect_inap_EventNotificationChargingArg(FALSE, tvb, offset, actx, tree, hf_inap_EventNotificationChargingArg_PDU);
306 case 27: /*27, "CollectInformation */
307 offset=dissect_inap_CollectInformationArg(FALSE, tvb, offset, actx, tree, hf_inap_CollectInformationArg_PDU);
309 case 28: /*28, "AnalyseInformation */
310 offset=dissect_inap_AnalyseInformationArg(FALSE, tvb, offset, actx, tree, hf_inap_AnalyseInformationArg_PDU);
312 case 29: /*29, "SelectRoute */
313 offset=dissect_inap_SelectRouteArg(FALSE, tvb, offset, actx, tree, hf_inap_SelectRouteArg_PDU);
315 case 30: /*30, "SelectFacility */
316 offset=dissect_inap_SelectFacilityArg(FALSE, tvb, offset, actx, tree, hf_inap_SelectFacilityArg_PDU);
319 case 32: /*32, InitiateCallAttempt*/
320 offset=dissect_inap_InitiateCallAttemptArg(FALSE, tvb, offset, actx, tree, hf_inap_InitiateCallAttemptArg_PDU);
322 case 33: /*ResetTimer*/
323 offset=dissect_inap_ResetTimerArg(FALSE, tvb, offset, actx, tree, hf_inap_ResetTimerArg_PDU);
325 case 34: /*FurnishChargingInformation*/
326 offset=dissect_inap_FurnishChargingInformationArg(FALSE, tvb, offset, actx, tree, hf_inap_FurnishChargingInformationArg_PDU);
328 case 35: /*35, ApplyCharging */
329 offset=dissect_inap_ApplyChargingArg(FALSE, tvb, offset, actx, tree, hf_inap_ApplyChargingArg_PDU);
331 case 36: /*36, "ApplyChargingReport */
332 offset=dissect_inap_ApplyChargingReportArg(FALSE, tvb, offset, actx, tree, hf_inap_ApplyChargingReportArg_PDU);
334 case 37: /*37, "RequestCurrentStatusReport */
335 offset=dissect_inap_RequestCurrentStatusReportArg(FALSE, tvb, offset, actx, tree, hf_inap_RequestCurrentStatusReportArg_PDU);
337 case 38:/*38, "RequestEveryStatusChangeReport */
338 offset=dissect_inap_RequestEveryStatusChangeReportArg(FALSE, tvb, offset, actx, tree, hf_inap_RequestEveryStatusChangeReportArg_PDU);
340 case 39:/*39, "RequestFirstStatusMatchReport */
341 offset=dissect_inap_RequestFirstStatusMatchReportArg(FALSE, tvb, offset, actx, tree, hf_inap_RequestFirstStatusMatchReportArg_PDU);
343 case 40:/*40, "StatusReport */
344 offset=dissect_inap_StatusReportArg(FALSE, tvb, offset, actx, tree, hf_inap_StatusReportArg_PDU);
346 case 41:/*41, "CallGap */
347 offset=dissect_inap_CallGapArg(FALSE, tvb, offset, actx, tree, hf_inap_CallGapArg_PDU);
349 case 42:/*42, "ActivateServiceFiltering */
350 offset=dissect_inap_ActivateServiceFilteringArg(FALSE, tvb, offset, actx, tree, hf_inap_ActivateServiceFilteringArg_PDU);
352 case 43:/*43, "ServiceFilteringResponse */
353 offset=dissect_inap_ServiceFilteringResponseArg(FALSE, tvb, offset, actx, tree, hf_inap_ServiceFilteringResponseArg_PDU);
355 case 44: /*CallInformationReport*/
356 offset=dissect_inap_CallInformationReportArg(FALSE, tvb, offset, actx, tree, hf_inap_CallInformationReportArg_PDU);
358 case 45: /*CallInformationRequest*/
359 offset=dissect_inap_CallInformationRequestArg(FALSE, tvb, offset, actx, tree, hf_inap_CallInformationRequestArg_PDU);
361 case 47: /*PlayAnnouncement*/
362 offset=dissect_inap_PlayAnnouncementArg(FALSE, tvb, offset, actx, tree, hf_inap_PlayAnnouncementArg_PDU);
364 case 48: /*PromptAndCollectUserInformation*/
365 offset=dissect_inap_PromptAndCollectUserInformationArg(FALSE, tvb, offset, actx, tree, hf_inap_PromptAndCollectUserInformationArg_PDU);
367 case 49: /* 49 SpecializedResourceReport */
368 offset=dissect_inap_SpecializedResourceReportArg(FALSE, tvb, offset, actx, tree, hf_inap_SpecializedResourceReportArg_PDU);
371 offset=dissect_inap_CancelArg(FALSE, tvb, offset, actx, tree, hf_inap_CancelArg_PDU);
373 case 80: /*FacilitySelectedAndAvailable*/
374 offset = dissect_inap_FacilitySelectedAndAvailableArg(FALSE, tvb, offset, actx, tree, -1);
376 case 81: /*OriginationAttempt*/
377 offset = dissect_inap_OriginationAttemptArg(FALSE, tvb, offset, actx, tree, -1);
379 case 82: /*TerminationAttempt*/
380 offset = dissect_inap_TerminationAttemptArg(FALSE, tvb, offset, actx, tree, -1);
382 case 83: /*OAbandon*/
383 offset =dissect_inap_OAbandonArg(FALSE, tvb, offset, actx, tree, -1);
385 case 84: /*OSuspended*/
386 offset = dissect_inap_OSuspendedArg(FALSE, tvb, offset, actx, tree, -1);
388 case 85: /*TSuspended*/
389 offset = dissect_inap_TSuspendedArg(FALSE, tvb, offset, actx, tree, -1);
391 case 87: /*AuthorizeTermination*/
392 offset = dissect_inap_AuthorizeTerminationArg(FALSE, tvb, offset, actx, tree, -1);
394 case 88: /*continueWithArgument*/
395 offset=dissect_inap_ContinueWithArgumentArg(FALSE, tvb, offset, actx, tree, -1);
397 case 89: /*CreateCallSegmentAssociation */
398 offset = dissect_inap_CreateCallSegmentAssociationArg(FALSE, tvb, offset, actx, tree, -1);
400 case 90: /*DisconnectLeg*/
401 offset = dissect_inap_DisconnectLegArg(FALSE, tvb, offset, actx, tree, -1);
403 case 91: /*MergeCallSegments*/
404 offset = dissect_inap_MergeCallSegmentsArg(FALSE, tvb, offset, actx, tree, -1);
406 case 92: /*MoveCallSegments*/
407 offset = dissect_inap_MoveCallSegmentsArg(FALSE, tvb, offset, actx, tree, -1);
410 offset = dissect_inap_MoveLegArg(FALSE, tvb, offset, actx, tree, -1);
412 case 94: /*Reconnect*/
413 offset = dissect_inap_ReconnectArg(FALSE, tvb, offset, actx, tree, -1);
415 case 95: /*SplitLeg*/
416 offset = dissect_inap_SplitLegArg(FALSE, tvb, offset, actx, tree, -1);
418 case 96: /*EntityReleased*/
419 offset = dissect_inap_EntityReleasedArg(FALSE, tvb, offset, actx, tree, -1);
421 case 97: /*ManageTriggerData*/
422 offset = dissect_inap_ManageTriggerDataArg(FALSE, tvb, offset, actx, tree, -1);
424 case 98: /*requestReportUTSI*/
425 offset = dissect_inap_RequestReportUTSIArg(FALSE, tvb, offset, actx, tree, -1);
427 case 99: /* ReceivedInformation - ???????*/
428 offset = dissect_inap_ReceivedInformationArg(FALSE, tvb, offset, actx, tree, -1);
430 case 100: /*sendSTUI*/
431 offset = dissect_inap_SendSTUIArg(FALSE, tvb, offset, actx, tree, -1);
433 case 101: /*reportUTSI*/
434 offset = dissect_inap_ReportUTSIArg(FALSE, tvb, offset, actx, tree, -1);
436 case 102: /*sendFacilityInformation*/
437 offset = dissect_inap_SendFacilityInformationArg(FALSE, tvb, offset, actx, tree, -1);
439 case 103: /*requestReportFacilityEvent*/
440 offset = dissect_inap_RequestReportFacilityEventArg(FALSE, tvb, offset, actx, tree, -1);
442 case 104: /*eventReportFacility*/
443 offset = dissect_inap_EventReportFacilityArg(FALSE, tvb, offset, actx, tree, -1);
445 case 107: /*promptAndReceiveMessage*/
446 offset = dissect_inap_PromptAndReceiveMessageArg(FALSE, tvb, offset, actx, tree, -1);
448 case 108: /*scriptInformation*/
449 offset = dissect_inap_ScriptInformationArg(FALSE, tvb, offset, actx, tree, -1);
451 case 109: /*scriptEvent*/
452 offset = dissect_inap_ScriptEventArg(FALSE, tvb, offset, actx, tree, -1);
454 case 110: /*scriptRun*/
455 offset = dissect_inap_ScriptRunArg(FALSE, tvb, offset, actx, tree, -1);
457 case 111: /*scriptClose*/
458 offset = dissect_inap_ScriptCloseArg(FALSE, tvb, offset, actx, tree, -1);
460 case 135: /*createOrRemoveTriggerData*/
461 offset = dissect_inap_CreateOrRemoveTriggerDataArg(FALSE, tvb, offset, actx, tree, -1);
463 case 139: /*srfCallGap*/
464 offset = dissect_inap_SRFCallGapArg(FALSE, tvb, offset, actx, tree, -1);
466 case 136: /*setServiceProfile*/
467 offset = dissect_inap_SetServiceProfileArg(FALSE, tvb, offset, actx, tree, -1);
469 case 145: /*CallFiltering*/
470 offset = dissect_inap_CallFilteringArg(FALSE, tvb, offset, actx, tree, -1);
472 case 146: /*monitorRouteRequest*/
473 offset = dissect_inap_MonitorRouteRequestArg(FALSE, tvb, offset, actx, tree, -1);
475 case 147: /*monitorRouteReport*/
476 offset = dissect_inap_MonitorRouteReportArg(FALSE, tvb, offset, actx, tree, -1);
480 proto_tree_add_text(tree, tvb, offset, -1, "Unknown invokeData blob");
481 /* todo call the asn.1 dissector */
487 TC-Returnable OPERATION ::=
488 {activateServiceFiltering | activityTest | requestCurrentStatusReport |
489 requestEveryStatusChangeReport | requestFirstStatusMatchReport |
490 promptAndCollectUserInformation}
492 activateServiceFiltering - No arg
493 activityTest - No Arg
494 requestCurrentStatusReport - RESULT RequestCurrentStatusReportResultArg
495 requestEveryStatusChangeReport - No arg
496 requestFirstStatusMatchReport - No Arg
497 promptAndCollectUserInformation - RESULT ReceivedInformationArg
500 static int dissect_returnResultData(proto_tree *tree, tvbuff_t *tvb, int offset, asn1_ctx_t *actx _U_) {
502 case 37: /*requestCurrentStatusReport*/
503 offset=dissect_inap_RequestCurrentStatusReportResultArg(FALSE, tvb, offset, actx, tree, -1);
505 case 48: /*PromptAndCollectUserInformation*/
506 offset=dissect_inap_ReceivedInformationArg(FALSE, tvb, offset, actx, tree, -1);
509 proto_tree_add_text(tree, tvb, offset, -1, "Unknown returnResultData blob");
513 /* From GSMMAP TODO find out if there is ERROR parameters */
514 static int dissect_returnErrorData(proto_tree *tree, tvbuff_t *tvb, int offset, asn1_ctx_t *actx) {
519 cause=proto_tree_add_text(tree, tvb, offset, -1, "Unknown returnErrorData blob");
520 proto_item_set_expert_flags(cause, PI_MALFORMED, PI_WARN);
521 expert_add_info_format(actx->pinfo, cause, PI_MALFORMED, PI_WARN, "Unknown invokeData %d",errorCode);
527 static guint8 inap_pdu_type = 0;
528 static guint8 inap_pdu_size = 0;
532 dissect_inap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree)
534 proto_item *item=NULL;
535 proto_tree *tree=NULL;
538 if (check_col(pinfo->cinfo, COL_PROTOCOL))
540 col_set_str(pinfo->cinfo, COL_PROTOCOL, "INAP");
543 /* create display subtree for the protocol */
545 item = proto_tree_add_item(parent_tree, proto_inap, tvb, 0, -1, FALSE);
546 tree = proto_item_add_subtree(item, ett_inap);
548 inap_pdu_type = tvb_get_guint8(tvb, offset)&0x0f;
549 /* Get the length and add 2 */
550 inap_pdu_size = tvb_get_guint8(tvb, offset+1)+2;
552 dissect_INAP_Component_PDU(tvb, pinfo, tree);
557 /*--- proto_reg_handoff_inap ---------------------------------------*/
558 static void range_delete_callback(guint32 ssn)
561 delete_itu_tcap_subdissector(ssn, inap_handle);
565 static void range_add_callback(guint32 ssn)
568 add_itu_tcap_subdissector(ssn, inap_handle);
572 void proto_reg_handoff_inap(void) {
574 static int inap_prefs_initialized = FALSE;
576 inap_handle = create_dissector_handle(dissect_inap, proto_inap);
578 if (!inap_prefs_initialized) {
579 inap_prefs_initialized = TRUE;
582 range_foreach(ssn_range, range_delete_callback);
586 ssn_range = range_copy(global_ssn_range);
588 range_foreach(ssn_range, range_add_callback);
590 oid_add_from_string("Core-INAP-CS1-Codes","0.4.0.1.1.0.3.0");
594 void proto_register_inap(void) {
595 module_t *inap_module;
597 static hf_register_info hf[] = {
601 #include "packet-inap-hfarr.c"
609 /* List of subtrees */
610 static gint *ett[] = {
612 &ett_inapisup_parameter,
613 #include "packet-inap-ettarr.c"
616 /* Register protocol */
617 proto_inap = proto_register_protocol(PNAME, PSNAME, PFNAME);
618 register_dissector("inap", dissect_inap, proto_inap);
619 /* Register fields and subtrees */
620 proto_register_field_array(proto_inap, hf, array_length(hf));
621 proto_register_subtree_array(ett, array_length(ett));
623 /* Set default SSNs */
624 range_convert_str(&global_ssn_range, "106,241", MAX_SSN);
625 ssn_range = range_empty();
627 inap_module = prefs_register_protocol(proto_inap, proto_reg_handoff_inap);
629 prefs_register_obsolete_preference(inap_module, "tcap.itu_ssn");
631 prefs_register_obsolete_preference(inap_module, "tcap.itu_ssn1");
633 prefs_register_range_preference(inap_module, "ssn", "TCAP SSNs",
634 "TCAP Subsystem numbers used for INAP",
635 &global_ssn_range, MAX_SSN);