2005-02-09 22:31:40 +00:00
|
|
|
/* packet-inap-template.c
|
|
|
|
* Routines for INAP
|
|
|
|
* Copyright 2004, Tim Endean <endeant@hotmail.com>
|
|
|
|
* Built from the gsm-map dissector Copyright 2004, Anders Broman <anders.broman@ericsson.com>
|
|
|
|
*
|
2005-02-10 03:19:59 +00:00
|
|
|
* $Id$
|
2005-02-09 22:31:40 +00:00
|
|
|
* Ethereal - Network traffic analyzer
|
|
|
|
* By Gerald Combs <gerald@ethereal.com>
|
|
|
|
* Copyright 1998 Gerald Combs
|
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU General Public License
|
|
|
|
* as published by the Free Software Foundation; either version 2
|
|
|
|
* of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program; if not, write to the Free Software
|
|
|
|
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|
|
|
* References: ETSI 300 374
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifdef HAVE_CONFIG_H
|
|
|
|
# include "config.h"
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#include <glib.h>
|
|
|
|
#include <epan/packet.h>
|
|
|
|
#include <epan/prefs.h>
|
|
|
|
#include <epan/conversation.h>
|
|
|
|
|
|
|
|
#include <stdio.h>
|
|
|
|
#include <string.h>
|
|
|
|
|
|
|
|
#include "packet-ber.h"
|
|
|
|
#include "packet-inap.h"
|
|
|
|
#include "packet-q931.h"
|
|
|
|
#include "packet-e164.h"
|
|
|
|
|
|
|
|
#define PNAME "INAP"
|
|
|
|
#define PSNAME "INAP"
|
|
|
|
#define PFNAME "inap"
|
|
|
|
|
|
|
|
/* Initialize the protocol and registered fields */
|
|
|
|
int proto_inap = -1;
|
|
|
|
static int hf_inap_invokeCmd = -1; /* Opcode */
|
|
|
|
static int hf_inap_invokeid = -1; /* INTEGER */
|
|
|
|
static int hf_inap_absent = -1; /* NULL */
|
|
|
|
static int hf_inap_invokeId = -1; /* InvokeId */
|
|
|
|
static int hf_inap_invoke = -1; /* InvokePDU */
|
2005-04-02 18:50:57 +00:00
|
|
|
static int hf_inap_ReturnError = -1; /* InvokePDU */
|
2005-02-09 22:31:40 +00:00
|
|
|
static int hf_inap_returnResult = -1; /* InvokePDU */
|
|
|
|
static int hf_inap_returnResult_result = -1;
|
|
|
|
static int hf_inap_getPassword = -1;
|
|
|
|
static int hf_inap_currentPassword = -1;
|
2005-04-02 18:50:57 +00:00
|
|
|
static int hf_inap_genproblem = -1;
|
2005-02-09 22:31:40 +00:00
|
|
|
#include "packet-inap-hf.c"
|
2005-04-02 18:50:57 +00:00
|
|
|
|
|
|
|
static guint tcap_itu_ssn = 106;
|
|
|
|
static guint tcap_itu_ssn1 = 241;
|
|
|
|
|
|
|
|
|
|
|
|
static guint global_tcap_itu_ssn = 1;
|
|
|
|
static guint global_tcap_itu_ssn1 = 1;
|
2005-02-09 22:31:40 +00:00
|
|
|
|
|
|
|
/* Initialize the subtree pointers */
|
|
|
|
static gint ett_inap = -1;
|
|
|
|
static gint ett_inap_InvokeId = -1;
|
|
|
|
static gint ett_inap_InvokePDU = -1;
|
2005-04-02 18:50:57 +00:00
|
|
|
static gint ett_inap_ReturnErrorPDU = -1;
|
2005-02-09 22:31:40 +00:00
|
|
|
static gint ett_inap_ReturnResultPDU = -1;
|
|
|
|
static gint ett_inap_ReturnResult_result = -1;
|
|
|
|
static gint ett_inap_INAPPDU = -1;
|
|
|
|
static gint ett_inapisup_parameter = -1;
|
|
|
|
#include "packet-inap-ett.c"
|
|
|
|
|
|
|
|
static int dissect_invokeCmd(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset);
|
|
|
|
|
|
|
|
#include "packet-inap-fn.c"
|
|
|
|
|
|
|
|
|
|
|
|
const value_string inap_opr_code_strings[] = {
|
|
|
|
|
|
|
|
{16, "AssistRequestInstructions"},
|
|
|
|
{44, "CallInformationReport"},
|
|
|
|
{45, "CallInformationRequest"},
|
|
|
|
{53, "Cancel"},
|
|
|
|
{20, "Connect"},
|
2005-04-02 18:50:57 +00:00
|
|
|
{18, "DisconnectForwardConnection"},
|
2005-02-09 22:31:40 +00:00
|
|
|
{19,"ConnectToResource"},
|
|
|
|
{17,"EstablishTemporaryConnection"},
|
|
|
|
{24,"EventReportBCSM"},
|
|
|
|
{34,"FurnishChargingInformation"},
|
|
|
|
{0,"InitialDP"},
|
|
|
|
{47,"PlayAnnouncement"},
|
|
|
|
{48,"PromptAndCollectUserInformation"},
|
|
|
|
{99,"ReceivedInformation"}, /*???????*/
|
|
|
|
{33,"ResetTimer"},
|
|
|
|
{23,"RequestReportBCSMEvent"},
|
2005-04-02 18:50:57 +00:00
|
|
|
{49,"SpecializedResourceReport"},
|
2005-08-28 02:28:48 +00:00
|
|
|
{22,"ReleaseCall"},
|
|
|
|
{0, NULL}
|
2005-04-02 18:50:57 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
const value_string inap_error_code_strings[] = {
|
|
|
|
|
|
|
|
{0,"cancelled"},
|
|
|
|
{1,"cancelFailed"},
|
|
|
|
{3,"etcFailed"},
|
|
|
|
{4,"improperCallerResponse"},
|
|
|
|
{6,"missingCustomerRecord"},
|
|
|
|
{7,"missingParameter"},
|
|
|
|
{8,"parameterOutOfRange"},
|
|
|
|
{10,"RequestedInfoError"},
|
|
|
|
{11,"SystemFailure"},
|
|
|
|
{12,"TaskRefused"},
|
|
|
|
{13,"UnavailableResource"},
|
|
|
|
{14,"UnexpectedComponentSequence"},
|
|
|
|
{15,"UnexpectedDataValue"},
|
|
|
|
{16,"UnexpectedParameter"},
|
2005-08-28 02:28:48 +00:00
|
|
|
{17,"UnknownLegID"},
|
|
|
|
{0, NULL}
|
2005-04-02 18:50:57 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
const value_string inap_general_problem_strings[] = {
|
|
|
|
{0,"General Problem Unrecognized Component"},
|
|
|
|
{1,"General Problem Mistyped Component"},
|
|
|
|
{3,"General Problem Badly Structured Component"},
|
2005-08-28 02:28:48 +00:00
|
|
|
{0, NULL}
|
2005-02-09 22:31:40 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
2005-04-02 18:50:57 +00:00
|
|
|
|
2005-02-09 22:31:40 +00:00
|
|
|
static guint32 opcode=0;
|
|
|
|
|
|
|
|
static int
|
|
|
|
dissect_inap_Opcode(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index) {
|
|
|
|
offset = dissect_ber_integer(FALSE, pinfo, tree, tvb, offset, hf_index, &opcode);
|
|
|
|
|
|
|
|
if (check_col(pinfo->cinfo, COL_INFO)){
|
|
|
|
col_set_str(pinfo->cinfo, COL_INFO, val_to_str(opcode, inap_opr_code_strings, "Unknown Inap (%u)"));
|
|
|
|
}
|
|
|
|
|
|
|
|
return offset;
|
|
|
|
}
|
|
|
|
|
2005-04-02 18:50:57 +00:00
|
|
|
|
|
|
|
|
|
|
|
static int
|
|
|
|
dissect_inap_errorCode(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index) {
|
|
|
|
offset = dissect_ber_integer(FALSE, pinfo, tree, tvb, offset, hf_index, &opcode);
|
|
|
|
|
|
|
|
if (check_col(pinfo->cinfo, COL_INFO)){
|
|
|
|
col_set_str(pinfo->cinfo, COL_INFO, val_to_str(opcode, inap_error_code_strings, "Unknown Inap (%u)"));
|
|
|
|
}
|
|
|
|
|
|
|
|
return offset;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2005-02-09 22:31:40 +00:00
|
|
|
static int dissect_invokeData(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
|
|
|
|
switch(opcode){
|
|
|
|
case 16: /*AssistRequestInstructions*/
|
|
|
|
offset=dissect_inap_AssistRequestInstructionsarg(FALSE, tvb, offset, pinfo, tree, -1);
|
|
|
|
break;
|
|
|
|
case 44: /*CallInformationReport*/
|
|
|
|
offset=dissect_inap_CallInformationReportarg(FALSE, tvb, offset, pinfo, tree, -1);
|
|
|
|
break;
|
|
|
|
case 45: /*CallInformationRequest*/
|
|
|
|
offset=dissect_inap_CallInformationRequestarg(FALSE, tvb, offset, pinfo, tree, -1);
|
|
|
|
break;
|
|
|
|
case 53: /*Cancel*/
|
|
|
|
offset=dissect_inap_Cancelarg(FALSE, tvb, offset, pinfo, tree, -1);
|
|
|
|
break;
|
|
|
|
case 20: /*Connect*/
|
|
|
|
offset=dissect_inap_Connectarg(FALSE, tvb, offset, pinfo, tree, -1);
|
|
|
|
break;
|
2005-04-02 18:50:57 +00:00
|
|
|
case 18: /*DisconnectForwardConnections*/
|
2005-02-09 22:31:40 +00:00
|
|
|
proto_tree_add_text(tree, tvb, offset, -1, "Disconnect Forward Connection");
|
|
|
|
break;
|
|
|
|
case 19: /*ConnectToResource*/
|
|
|
|
offset=dissect_inap_ConnectToResource(FALSE, tvb, offset, pinfo, tree, -1);
|
|
|
|
break;
|
|
|
|
case 17: /*EstablishTemporaryConnection*/
|
|
|
|
offset=dissect_inap_EstablishTemporaryConnection(FALSE, tvb, offset, pinfo, tree, -1);
|
|
|
|
break;
|
|
|
|
case 24: /*EventReportBCSM*/
|
|
|
|
offset=dissect_inap_EventReportBCSM(FALSE, tvb, offset, pinfo, tree, -1);
|
|
|
|
break;
|
|
|
|
case 34: /*FurnishChargingInformation*/
|
|
|
|
offset=dissect_inap_FurnishChargingInformationarg(FALSE, tvb, offset, pinfo, tree, -1);
|
|
|
|
break;
|
|
|
|
case 0: /*InitialDP*/
|
|
|
|
offset=dissect_inap_InitialDP(FALSE, tvb, offset, pinfo, tree, -1);
|
|
|
|
break;
|
|
|
|
|
|
|
|
case 23: /*InitialDP*/
|
|
|
|
offset=dissect_inap_RequestReportBCSMEvent(FALSE, tvb, offset, pinfo, tree, -1);
|
|
|
|
break;
|
|
|
|
|
|
|
|
case 47: /*PlayAnnouncement*/
|
|
|
|
offset=dissect_inap_PlayAnnouncement(FALSE, tvb, offset, pinfo, tree, -1);
|
|
|
|
break;
|
|
|
|
case 48: /*PromptAndCollectUserInformation*/
|
|
|
|
offset=dissect_inap_PromptAndCollectUserInformationarg(FALSE, tvb, offset, pinfo, tree, -1);
|
|
|
|
break;
|
|
|
|
case 33: /*ResetTimer*/
|
|
|
|
offset=dissect_inap_ResetTimer(FALSE, tvb, offset, pinfo, tree, -1);
|
|
|
|
break;
|
2005-04-02 18:50:57 +00:00
|
|
|
case 22: /*ResetTimer*/
|
|
|
|
offset=dissect_inap_ReleaseCallArg(FALSE, tvb, offset, pinfo, tree, -1);
|
|
|
|
break;
|
2005-02-09 22:31:40 +00:00
|
|
|
default:
|
|
|
|
proto_tree_add_text(tree, tvb, offset, -1, "Unknown invokeData blob");
|
|
|
|
/* todo call the asn.1 dissector */
|
|
|
|
}
|
|
|
|
return offset;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static int dissect_returnResultData(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
|
|
|
|
switch(opcode){
|
|
|
|
case 48: /*PromptAndCollectUserInformation*/
|
|
|
|
offset=dissect_inap_PromptAndCollectUserInformationres(FALSE, tvb, offset, pinfo, tree, -1);
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
proto_tree_add_text(tree, tvb, offset, -1, "Unknown returnResultData blob");
|
|
|
|
}
|
|
|
|
return offset;
|
|
|
|
}
|
|
|
|
|
|
|
|
static int
|
|
|
|
dissect_invokeCmd(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
|
|
|
|
return dissect_inap_Opcode(FALSE, tvb, offset, pinfo, tree, hf_inap_invokeCmd);
|
|
|
|
}
|
|
|
|
|
2005-04-02 18:50:57 +00:00
|
|
|
|
|
|
|
static int
|
|
|
|
dissect_errorCode(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
|
|
|
|
return dissect_inap_errorCode(FALSE, tvb, offset, pinfo, tree, hf_inap_ReturnError);
|
|
|
|
}
|
|
|
|
|
2005-02-09 22:31:40 +00:00
|
|
|
static int dissect_invokeid(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
|
|
|
|
return dissect_ber_integer(FALSE, pinfo, tree, tvb, offset, hf_inap_invokeid, NULL);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static const value_string InvokeId_vals[] = {
|
|
|
|
{ 0, "invokeid" },
|
|
|
|
{ 1, "absent" },
|
|
|
|
{ 0, NULL }
|
|
|
|
};
|
|
|
|
|
|
|
|
static int dissect_absent(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
|
|
|
|
return dissect_inap_NULL(FALSE, tvb, offset, pinfo, tree, hf_inap_absent);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static const ber_choice_t InvokeId_choice[] = {
|
|
|
|
{ 0, BER_CLASS_UNI, BER_UNI_TAG_INTEGER, BER_FLAGS_NOOWNTAG, dissect_invokeid },
|
|
|
|
{ 1, BER_CLASS_UNI, BER_UNI_TAG_NULL, BER_FLAGS_NOOWNTAG, dissect_absent },
|
|
|
|
{ 0, 0, 0, 0, NULL }
|
|
|
|
};
|
|
|
|
|
|
|
|
static int
|
|
|
|
dissect_inap_InvokeId(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index) {
|
2005-07-21 21:12:09 +00:00
|
|
|
offset = dissect_ber_choice(pinfo, tree, tvb, offset,
|
2005-06-26 05:48:50 +00:00
|
|
|
InvokeId_choice, hf_index, ett_inap_InvokeId, NULL);
|
2005-02-09 22:31:40 +00:00
|
|
|
|
|
|
|
return offset;
|
|
|
|
}
|
|
|
|
static int dissect_invokeId(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
|
|
|
|
return dissect_inap_InvokeId(FALSE, tvb, offset, pinfo, tree, hf_inap_invokeId);
|
|
|
|
}
|
|
|
|
|
|
|
|
static const ber_sequence_t InvokePDU_sequence[] = {
|
|
|
|
{ BER_CLASS_UNI, -1/*choice*/, BER_FLAGS_NOOWNTAG|BER_FLAGS_NOTCHKTAG, dissect_invokeId },
|
|
|
|
{ BER_CLASS_UNI, BER_UNI_TAG_INTEGER, BER_FLAGS_NOOWNTAG, dissect_invokeCmd },
|
|
|
|
{ BER_CLASS_UNI, -1/*depends on Cmd*/, BER_FLAGS_NOOWNTAG|BER_FLAGS_NOTCHKTAG, dissect_invokeData },
|
|
|
|
{ 0, 0, 0, NULL }
|
|
|
|
};
|
|
|
|
|
|
|
|
static int
|
|
|
|
dissect_inap_InvokePDU(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index) {
|
|
|
|
offset = dissect_ber_sequence(implicit_tag, pinfo, tree, tvb, offset,
|
|
|
|
InvokePDU_sequence, hf_index, ett_inap_InvokePDU);
|
|
|
|
|
|
|
|
return offset;
|
|
|
|
}
|
2005-04-02 18:50:57 +00:00
|
|
|
|
|
|
|
|
|
|
|
static const ber_sequence_t returnErrorPDU_sequence[] = {
|
|
|
|
{ BER_CLASS_UNI, -1/*choice*/, BER_FLAGS_NOOWNTAG|BER_FLAGS_NOTCHKTAG, dissect_invokeId },
|
|
|
|
{ BER_CLASS_UNI, BER_UNI_TAG_INTEGER, BER_FLAGS_NOOWNTAG, dissect_errorCode },
|
|
|
|
{ 0, 0, 0, NULL }
|
|
|
|
};
|
|
|
|
|
|
|
|
static int
|
|
|
|
dissect_inap_returnErrorPDU(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index) {
|
|
|
|
offset = dissect_ber_sequence(implicit_tag, pinfo, tree, tvb, offset,
|
|
|
|
returnErrorPDU_sequence, hf_index, ett_inap_ReturnErrorPDU);
|
|
|
|
|
|
|
|
return offset;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2005-02-09 22:31:40 +00:00
|
|
|
static int dissect_invoke_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
|
|
|
|
return dissect_inap_InvokePDU(TRUE, tvb, offset, pinfo, tree, hf_inap_invoke);
|
|
|
|
}
|
|
|
|
|
2005-04-02 18:50:57 +00:00
|
|
|
static int dissect_returnError_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
|
|
|
|
return dissect_inap_returnErrorPDU(TRUE, tvb, offset, pinfo, tree, hf_inap_invoke);
|
|
|
|
}
|
|
|
|
|
2005-02-09 22:31:40 +00:00
|
|
|
static const ber_sequence_t ReturnResult_result_sequence[] = {
|
|
|
|
{ BER_CLASS_UNI, BER_UNI_TAG_INTEGER, BER_FLAGS_NOOWNTAG, dissect_invokeCmd },
|
|
|
|
{ BER_CLASS_UNI, -1/*depends on Cmd*/, BER_FLAGS_NOOWNTAG|BER_FLAGS_NOTCHKTAG, dissect_returnResultData },
|
|
|
|
{ 0, 0, 0, NULL }
|
|
|
|
};
|
|
|
|
static int
|
|
|
|
dissect_returnResult_result(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
|
|
|
|
offset = dissect_ber_sequence(FALSE, pinfo, tree, tvb, offset,
|
|
|
|
ReturnResult_result_sequence, hf_inap_returnResult_result, ett_inap_ReturnResult_result);
|
|
|
|
|
|
|
|
return offset;
|
|
|
|
}
|
|
|
|
|
|
|
|
static const ber_sequence_t ReturnResultPDU_sequence[] = {
|
|
|
|
{ BER_CLASS_UNI, -1/*choice*/, BER_FLAGS_NOOWNTAG|BER_FLAGS_NOTCHKTAG, dissect_invokeId },
|
|
|
|
{ BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_returnResult_result },
|
|
|
|
{ 0, 0, 0, NULL }
|
|
|
|
};
|
|
|
|
|
|
|
|
static int
|
|
|
|
dissect_inap_returnResultPDU(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index) {
|
|
|
|
offset = dissect_ber_sequence(implicit_tag, pinfo, tree, tvb, offset,
|
|
|
|
ReturnResultPDU_sequence, hf_index, ett_inap_ReturnResultPDU);
|
|
|
|
|
|
|
|
return offset;
|
|
|
|
}
|
|
|
|
static int dissect_returnResult_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
|
|
|
|
return dissect_inap_returnResultPDU(TRUE, tvb, offset, pinfo, tree, hf_inap_returnResult);
|
|
|
|
}
|
|
|
|
|
2005-04-02 18:50:57 +00:00
|
|
|
|
|
|
|
static int dissect_reject_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
|
|
|
|
return dissect_inap_RejectPDU(TRUE, tvb, offset, pinfo, tree, -1);
|
|
|
|
}
|
|
|
|
|
2005-02-09 22:31:40 +00:00
|
|
|
static const value_string INAPPDU_vals[] = {
|
|
|
|
{ 1, "invoke" },
|
|
|
|
{ 2, "returnResult" },
|
|
|
|
{ 3, "returnError" },
|
|
|
|
{ 4, "reject" },
|
|
|
|
{ 0, NULL }
|
|
|
|
};
|
|
|
|
|
|
|
|
static const ber_choice_t INAPPDU_choice[] = {
|
|
|
|
{ 1, BER_CLASS_CON, 1, BER_FLAGS_IMPLTAG, dissect_invoke_impl },
|
|
|
|
{ 2, BER_CLASS_CON, 2, BER_FLAGS_IMPLTAG, dissect_returnResult_impl },
|
|
|
|
{ 3, BER_CLASS_CON, 3, BER_FLAGS_IMPLTAG, dissect_returnError_impl },
|
|
|
|
{ 4, BER_CLASS_CON, 4, BER_FLAGS_IMPLTAG, dissect_reject_impl },
|
|
|
|
{ 0, 0, 0, 0, NULL }
|
|
|
|
};
|
|
|
|
|
|
|
|
static guint8 inap_pdu_type = 0;
|
|
|
|
static guint8 inap_pdu_size = 0;
|
|
|
|
|
|
|
|
static int
|
|
|
|
dissect_inap_INAPPDU(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index) {
|
|
|
|
|
|
|
|
inap_pdu_type = tvb_get_guint8(tvb, offset)&0x0f;
|
|
|
|
/* Get the length and add 2 */
|
|
|
|
inap_pdu_size = tvb_get_guint8(tvb, offset+1)+2;
|
|
|
|
|
2005-07-21 21:12:09 +00:00
|
|
|
offset = dissect_ber_choice(pinfo, tree, tvb, offset,
|
2005-06-26 05:48:50 +00:00
|
|
|
INAPPDU_choice, hf_index, ett_inap_INAPPDU, NULL);
|
2005-02-09 22:31:40 +00:00
|
|
|
|
|
|
|
if (check_col(pinfo->cinfo, COL_INFO)){
|
|
|
|
col_prepend_fstr(pinfo->cinfo, COL_INFO, val_to_str(opcode, inap_opr_code_strings, "Unknown INAP (%u)"));
|
|
|
|
}
|
|
|
|
|
|
|
|
return offset;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static void
|
|
|
|
dissect_inap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree)
|
|
|
|
{
|
|
|
|
proto_item *item=NULL;
|
|
|
|
proto_tree *tree=NULL;
|
|
|
|
|
|
|
|
|
|
|
|
if (check_col(pinfo->cinfo, COL_PROTOCOL))
|
|
|
|
{
|
|
|
|
col_set_str(pinfo->cinfo, COL_PROTOCOL, "INAP");
|
|
|
|
}
|
|
|
|
|
|
|
|
/* create display subtree for the protocol */
|
|
|
|
if(parent_tree){
|
|
|
|
item = proto_tree_add_item(parent_tree, proto_inap, tvb, 0, -1, FALSE);
|
|
|
|
tree = proto_item_add_subtree(item, ett_inap);
|
|
|
|
}
|
|
|
|
|
|
|
|
dissect_inap_INAPPDU(FALSE, tvb, 0, pinfo, tree, -1);
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
/*--- proto_reg_handoff_inap ---------------------------------------*/
|
|
|
|
void proto_reg_handoff_inap(void) {
|
|
|
|
dissector_handle_t inap_handle;
|
2005-04-02 18:50:57 +00:00
|
|
|
static int inap_prefs_initialized = FALSE;
|
|
|
|
|
2005-02-09 22:31:40 +00:00
|
|
|
inap_handle = create_dissector_handle(dissect_inap, proto_inap);
|
2005-04-02 18:50:57 +00:00
|
|
|
|
|
|
|
if (!inap_prefs_initialized) {
|
|
|
|
inap_prefs_initialized = TRUE;
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
dissector_delete("tcap.itu_ssn", tcap_itu_ssn, inap_handle);
|
|
|
|
dissector_delete("tcap.itu_ssn", tcap_itu_ssn1, inap_handle);
|
|
|
|
}
|
|
|
|
tcap_itu_ssn = global_tcap_itu_ssn;
|
|
|
|
tcap_itu_ssn1 = global_tcap_itu_ssn1;
|
2005-02-09 22:31:40 +00:00
|
|
|
dissector_add("tcap.itu_ssn", global_tcap_itu_ssn, inap_handle);
|
2005-04-02 18:50:57 +00:00
|
|
|
dissector_add("tcap.itu_ssn", global_tcap_itu_ssn1, inap_handle);
|
2005-02-09 22:31:40 +00:00
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void proto_register_inap(void) {
|
|
|
|
module_t *inap_module;
|
|
|
|
/* List of fields */
|
|
|
|
static hf_register_info hf[] = {
|
|
|
|
{ &hf_inap_invokeCmd,
|
|
|
|
{ "invokeCmd", "inap.invokeCmd",
|
|
|
|
FT_UINT32, BASE_DEC, VALS(inap_opr_code_strings), 0,
|
|
|
|
"InvokePDU/invokeCmd", HFILL }},
|
2005-04-02 18:50:57 +00:00
|
|
|
{ &hf_inap_ReturnError,
|
|
|
|
{ "ReturnError", "inap.ReturnError",
|
|
|
|
FT_UINT32, BASE_DEC, VALS(inap_error_code_strings), 0,
|
|
|
|
"InvokePDU/ReturnError", HFILL }},
|
|
|
|
{ &hf_inap_invokeid,
|
2005-02-09 22:31:40 +00:00
|
|
|
{ "invokeid", "inap.invokeid",
|
|
|
|
FT_INT32, BASE_DEC, NULL, 0,
|
|
|
|
"InvokeId/invokeid", HFILL }},
|
|
|
|
{ &hf_inap_absent,
|
|
|
|
{ "absent", "inap.absent",
|
|
|
|
FT_NONE, BASE_NONE, NULL, 0,
|
|
|
|
"InvokeId/absent", HFILL }},
|
|
|
|
{ &hf_inap_invokeId,
|
|
|
|
{ "invokeId", "inap.invokeId",
|
|
|
|
FT_UINT32, BASE_DEC, VALS(InvokeId_vals), 0,
|
|
|
|
"InvokePDU/invokeId", HFILL }},
|
|
|
|
{ &hf_inap_invoke,
|
|
|
|
{ "invoke", "inap.invoke",
|
|
|
|
FT_NONE, BASE_NONE, NULL, 0,
|
|
|
|
"INAPPDU/invoke", HFILL }},
|
|
|
|
{ &hf_inap_returnResult,
|
|
|
|
{ "returnResult", "inap.returnResult",
|
|
|
|
FT_NONE, BASE_NONE, NULL, 0,
|
|
|
|
"INAPPDU/returnResult", HFILL }},
|
|
|
|
|
|
|
|
|
|
|
|
#include "packet-inap-hfarr.c"
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* List of subtrees */
|
|
|
|
static gint *ett[] = {
|
|
|
|
&ett_inap,
|
|
|
|
&ett_inap_InvokeId,
|
|
|
|
&ett_inap_InvokePDU,
|
2005-04-02 18:50:57 +00:00
|
|
|
&ett_inap_ReturnErrorPDU,
|
2005-02-09 22:31:40 +00:00
|
|
|
&ett_inap_ReturnResultPDU,
|
|
|
|
&ett_inap_ReturnResult_result,
|
|
|
|
&ett_inap_INAPPDU,
|
|
|
|
&ett_inapisup_parameter,
|
|
|
|
#include "packet-inap-ettarr.c"
|
|
|
|
};
|
|
|
|
|
|
|
|
/* Register protocol */
|
|
|
|
proto_inap = proto_register_protocol(PNAME, PSNAME, PFNAME);
|
|
|
|
/*XXX register_dissector("inap", dissect_inap, proto_inap);*/
|
|
|
|
/* Register fields and subtrees */
|
|
|
|
proto_register_field_array(proto_inap, hf, array_length(hf));
|
|
|
|
proto_register_subtree_array(ett, array_length(ett));
|
|
|
|
|
2005-04-02 18:50:57 +00:00
|
|
|
|
2005-02-09 22:31:40 +00:00
|
|
|
inap_module = prefs_register_protocol(proto_inap, proto_reg_handoff_inap);
|
|
|
|
|
|
|
|
prefs_register_uint_preference(inap_module, "tcap.itu_ssn",
|
|
|
|
"Subsystem number used for INAP",
|
|
|
|
"Set Subsystem number used for INAP",
|
|
|
|
10, &global_tcap_itu_ssn);
|
|
|
|
|
2005-04-02 18:50:57 +00:00
|
|
|
prefs_register_uint_preference(inap_module, "tcap.itu_ssn1",
|
|
|
|
"Subsystem number used for INAP",
|
|
|
|
"Set Subsystem number used for INAP",
|
|
|
|
10, &global_tcap_itu_ssn1);
|
2005-02-09 22:31:40 +00:00
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|