diff options
author | Anders Broman <anders.broman@ericsson.com> | 2007-01-15 10:19:50 +0000 |
---|---|---|
committer | Anders Broman <anders.broman@ericsson.com> | 2007-01-15 10:19:50 +0000 |
commit | de009c280a6eef701f1cb83a943f48d483bced50 (patch) | |
tree | 0b49070cbdf25fdfd095e3b5e65fc85b7128ad8c /asn1 | |
parent | d48fdc737581892a10cd68b921b018eca532fe30 (diff) |
Dissect sms-BearerData also in responce messages if service code seen in Invoke.
Pretify a bunch of DigitsType parameters.
svn path=/trunk/; revision=20439
Diffstat (limited to 'asn1')
-rw-r--r-- | asn1/ansi_map/ansi_map.asn | 12 | ||||
-rw-r--r-- | asn1/ansi_map/ansi_map.cnf | 68 | ||||
-rw-r--r-- | asn1/ansi_map/packet-ansi_map-template.c | 40 |
3 files changed, 88 insertions, 32 deletions
diff --git a/asn1/ansi_map/ansi_map.asn b/asn1/ansi_map/ansi_map.asn index a3be0585b7..5f184c2883 100644 --- a/asn1/ansi_map/ansi_map.asn +++ b/asn1/ansi_map/ansi_map.asn @@ -1735,7 +1735,7 @@ LocationRequestRes ::= [PRIVATE 18] SET { -- (Serving MSC or VLR) O 6.5.2.93 n preferredLanguageIndicator [147] IMPLICIT PreferredLanguageIndicator OPTIONAL, -- O 6.5.2.96 f, r - edirectingNumberDigits [100] IMPLICIT RedirectingNumberDigits OPTIONAL, + redirectingNumberDigits [100] IMPLICIT RedirectingNumberDigits OPTIONAL, -- O 6.5.2.107 j redirectingNumberString [101] IMPLICIT RedirectingNumberString OPTIONAL, -- O 6.5.2.108 f @@ -2086,8 +2086,9 @@ RedirectionRequest ::= [PRIVATE 18] SET { -- (Originating) M 6.5.2.16 electronicSerialNumber [9] IMPLICIT ElectronicSerialNumber, -- M 6.5.2.63 - mobileIdentificationNumber [8] IMPLICIT MobileIdentificationNumber, +-- mobileIdentificationNumber [8] IMPLICIT MobileIdentificationNumber, -- M 6.5.2.81 + msid MSID, redirectionReason [19] IMPLICIT RedirectionReason, -- M 6.5.2.110 cdmaServiceOption [175] IMPLICIT CDMAServiceOption OPTIONAL, @@ -2358,8 +2359,9 @@ RoutingRequest ::= [PRIVATE 18] SET { -- O 6.5.2.77 f, h mobileDirectoryNumber [93] IMPLICIT MobileDirectoryNumber OPTIONAL, -- O 6.5.2.80 f - mobileIdentificationNumber [8] IMPLICIT MobileIdentificationNumber, +-- mobileIdentificationNumber [8] IMPLICIT MobileIdentificationNumber, -- M 6.5.2.81 + msid MSID, mSCIdentificationNumber [94] IMPLICIT MSCIdentificationNumber OPTIONAL, -- O 6.5.2.83 i noAnswerTime [96] IMPLICIT NoAnswerTime OPTIONAL, @@ -6595,11 +6597,11 @@ CallRecoveryIDList ::= SET OF [303] IMPLICIT CallRecoveryID -- callRecoveryIDopt [303] IMPLICIT CallRecoveryID OPTIONAL, -- } --- 6.5.2.ei TIA/EIA-41.5-D Modifications N.S0018Re +-- 6.5.2.ei TIA/EIA-41.5-D Modifications N.S0018Re ?? -- 1 0 0 1 1 1 1 1 (0x9f) -- 1 0 0 0 0 0 1 0 (0x82) -- 0 0 1 1 0 0 0 1 (0x31)(305) -DMH-ServiceID ::= OCTET STRING +DMH-ServiceID ::= OCTET STRING -- 6.5.2.ej -- 1 0 0 1 1 1 1 1 (0x9f) diff --git a/asn1/ansi_map/ansi_map.cnf b/asn1/ansi_map/ansi_map.cnf index 3e90a56190..f06a5fc6dc 100644 --- a/asn1/ansi_map/ansi_map.cnf +++ b/asn1/ansi_map/ansi_map.cnf @@ -20,43 +20,36 @@ OriginationRequestRes #.FIELD_RENAME #.FN_BODY InvokeParameters - gint *opcode; - struct tcap_private_t *p_private_tcap; - /* Data from the TCAP dissector */ - if (pinfo->private_data != NULL){ - p_private_tcap=pinfo->private_data; - opcode = g_malloc(sizeof(gint)); - OperationCode = OperationCode&0x00ff; - *opcode = OperationCode; - if ((!pinfo->fd->flags.visited)&&(p_private_tcap->TransactionID_str)){ - /* Only do this once XXX I hope its the right thing to do */ - g_hash_table_insert(TransactionId_table, g_strdup(p_private_tcap->TransactionID_str), opcode); - } - } + ServiceIndicator = 0; + OperationCode = OperationCode&0x00ff; + ansi_map_is_invoke = TRUE; if (check_col(pinfo->cinfo, COL_INFO)){ col_set_str(pinfo->cinfo, COL_INFO, val_to_str(OperationCode, ansi_map_opr_code_strings, "Unknown ANSI-MAP PDU (%u)")); } /* No Data */ if(tvb_length_remaining(tvb, offset)<=0){ + update_saved_invokedata(pinfo); return offset; } offset = dissect_invokeData(pinfo, tree, tvb, offset); + update_saved_invokedata(pinfo); #.FN_BODY ReturnParameters - gint *opcode; + struct amsi_map_invokedata_t *ansi_map_saved_invokedata; struct tcap_private_t *p_private_tcap; proto_item *item; /* Data from the TCAP dissector */ if (pinfo->private_data != NULL){ p_private_tcap=pinfo->private_data; - opcode = g_hash_table_lookup(TransactionId_table, p_private_tcap->TransactionID_str); - if(opcode){ - OperationCode = *opcode; + ansi_map_saved_invokedata = g_hash_table_lookup(TransactionId_table, p_private_tcap->TransactionID_str); + if(ansi_map_saved_invokedata){ + OperationCode = ansi_map_saved_invokedata->opcode; + ServiceIndicator = ansi_map_saved_invokedata->ServiceIndicator; }else{ OperationCode = OperationCode & 0x00ff; } @@ -75,6 +68,7 @@ OriginationRequestRes item = proto_tree_add_text(tree, tvb, 0, -1, "OperationCode %s",val_to_str(OperationCode, ansi_map_opr_code_strings, "Unknown %u")); PROTO_ITEM_SET_GENERATED(item); + ansi_map_is_invoke = FALSE; offset = dissect_returnData(pinfo, tree, tvb, offset); #.FN_BODY ErrorParameters @@ -333,6 +327,19 @@ OriginationRequestRes SMS_BearerData_tvb = NULL; return offset; } + if(!ansi_map_is_invoke){ + switch(ServiceIndicator){ + case 1: /* CDMA OTASP Service */ + case 3: /* CDMA OTAPA Service */ + dissector_try_port(is683_dissector_table, ansi_map_is_invoke ? 0 : 1, SMS_BearerData_tvb, g_pinfo, g_tree); + break; + case 4: /* CDMA Position Determination Service */ + dissector_try_port(is801_dissector_table, ansi_map_is_invoke ? 0 : 1, SMS_BearerData_tvb, g_pinfo, g_tree); + break; + default: + break; + } + } } # 6.5.2.137 @@ -457,10 +464,9 @@ OriginationRequestRes dissect_cdma2000_a1_elements(parameter_tvb, pinfo, subtree, 0, tvb_length_remaining(parameter_tvb,0)); } -#6.5.2.wB ServiceIndicator +#6.5.2.wB ServiceIndicator N.S0011-0 v 1.0 #.FN_BODY ServiceIndicator VAL_PTR = ¶meter_tvb tvbuff_t *parameter_tvb = NULL; - guint8 ServiceIndicator; %(DEFAULT_BODY)s if (parameter_tvb){ if (SMS_BearerData_tvb !=NULL) @@ -481,15 +487,33 @@ OriginationRequestRes } #.TYPE_ATTR +# Dont't put the bytes after the name in the display +InterMSCCircuitID TYPE = FT_NONE DISPLAY = BASE_DEC STRINGS = NULL +MobileIdentificationNumber TYPE = FT_NONE DISPLAY = BASE_DEC STRINGS = NULL +MobileStationMIN TYPE = FT_NONE DISPLAY = BASE_DEC STRINGS = NULL +CallingPartyNumberString1 TYPE = FT_NONE DISPLAY = BASE_DEC STRINGS = NULL +CallingPartyNumberString2 TYPE = FT_NONE DISPLAY = BASE_DEC STRINGS = NULL +SMS-Address TYPE = FT_NONE DISPLAY = BASE_DEC STRINGS = NULL +SMS-DestinationAddress TYPE = FT_NONE DISPLAY = BASE_DEC STRINGS = NULL +SMS-OriginatingAddress TYPE = FT_NONE DISPLAY = BASE_DEC STRINGS = NULL +SMS-OriginalOriginatingAddress TYPE = FT_NONE DISPLAY = BASE_DEC STRINGS = NULL +SMS-OriginalDestinationAddress TYPE = FT_NONE DISPLAY = BASE_DEC STRINGS = NULL +SenderIdentificationNumber TYPE = FT_NONE DISPLAY = BASE_DEC STRINGS = NULL +MobileDirectoryNumber TYPE = FT_NONE DISPLAY = BASE_DEC STRINGS = NULL +Digits TYPE = FT_NONE DISPLAY = BASE_DEC STRINGS = NULL +MSCIdentificationNumber TYPE = FT_NONE DISPLAY = BASE_DEC STRINGS = NULL +NewlyAssignedMIN TYPE = FT_NONE DISPLAY = BASE_DEC STRINGS = NULL +RedirectingNumberDigits = FT_NONE DISPLAY = BASE_DEC STRINGS = NULL +RedirectingNumberString = FT_NONE DISPLAY = BASE_DEC STRINGS = NULL +CallingPartyNumberDigits1 = FT_NONE DISPLAY = BASE_DEC STRINGS = NULL +CallingPartyNumberDigits2 = FT_NONE DISPLAY = BASE_DEC STRINGS = NULL + ActionCode TYPE = FT_UINT8 DISPLAY = BASE_DEC STRINGS = VALS(ansi_map_ActionCode_vals) AuthenticationCapability TYPE = FT_UINT8 DISPLAY = BASE_DEC STRINGS = VALS(ansi_map_AuthenticationCapability_vals) AlertResult TYPE = FT_UINT8 DISPLAY = BASE_DEC STRINGS = VALS(ansi_map_AlertResult_result_vals) AvailabilityType TYPE = FT_UINT8 DISPLAY = BASE_DEC STRINGS = VALS(ansi_map_AvailabilityType_vals) CancellationType TYPE = FT_UINT8 DISPLAY = BASE_DEC STRINGS = VALS(ansi_map_CancellationType_vals) GeographicAuthorization TYPE = FT_UINT8 DISPLAY = BASE_DEC STRINGS = VALS(ansi_map_GeographicAuthorization_vals) -InterMSCCircuitID TYPE = FT_NONE DISPLAY = BASE_DEC STRINGS = NULL -MobileIdentificationNumber TYPE = FT_NONE DISPLAY = BASE_DEC STRINGS = NULL -MobileStationMIN TYPE = FT_NONE DISPLAY = BASE_DEC STRINGS = NULL CountUpdateReport TYPE = FT_UINT8 DISPLAY = BASE_DEC STRINGS = VALS(ansi_map_CountUpdateReport_vals) ControlChannelMode TYPE = FT_UINT8 DISPLAY = BASE_DEC STRINGS = VALS(ansi_map_ControlChannelMode_vals) PageIndicator TYPE = FT_UINT8 DISPLAY = BASE_DEC STRINGS = VALS(ansi_map_PageIndicator_vals) diff --git a/asn1/ansi_map/packet-ansi_map-template.c b/asn1/ansi_map/packet-ansi_map-template.c index 1dc1f4c43c..f19751efe7 100644 --- a/asn1/ansi_map/packet-ansi_map-template.c +++ b/asn1/ansi_map/packet-ansi_map-template.c @@ -356,6 +356,14 @@ static gboolean is683_ota; static gboolean is801_pld; static gboolean ansi_map_is_invoke; static guint32 OperationCode; +static guint8 ServiceIndicator; + + +struct amsi_map_invokedata_t { + guint32 opcode; + guint8 ServiceIndicator; +}; + /* Transaction table */ static GHashTable *TransactionId_table=NULL; @@ -363,14 +371,14 @@ static GHashTable *TransactionId_table=NULL; static void TransactionId_table_cleanup(gpointer key , gpointer value, gpointer user_data _U_){ - guint8 *opcode = value; + struct amsi_map_invokedata_t *ansi_map_saved_invokedata = value; gchar *TransactionId_str = key; if ( TransactionId_str ){ g_free(TransactionId_str); } - if (opcode){ - g_free(opcode); + if (ansi_map_saved_invokedata){ + g_free(ansi_map_saved_invokedata); } } @@ -393,6 +401,28 @@ ansi_map_init_protocol(void) { ansi_map_init_transaction_table(); } + +/* Store Invoke information needed for the corresponding reply */ +static void +update_saved_invokedata(packet_info *pinfo){ + struct amsi_map_invokedata_t *ansi_map_saved_invokedata; + struct tcap_private_t *p_private_tcap; + + /* Data from the TCAP dissector */ + if (pinfo->private_data != NULL){ + p_private_tcap=pinfo->private_data; + ansi_map_saved_invokedata = g_malloc(sizeof(ansi_map_saved_invokedata)); + ansi_map_saved_invokedata->opcode = OperationCode; + ansi_map_saved_invokedata->ServiceIndicator = ServiceIndicator; + if ((!pinfo->fd->flags.visited)&&(p_private_tcap->TransactionID_str)){ + /* Only do this once XXX I hope its the right thing to do */ + g_hash_table_insert(TransactionId_table, + g_strdup(p_private_tcap->TransactionID_str), + ansi_map_saved_invokedata); + } + } + +} /* value strings */ const value_string ansi_map_opr_code_strings[] = { { 1, "Handoff Measurement Request" }, @@ -678,7 +708,7 @@ dissect_ansi_map_digits_type(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree case 2: /* IA5 Coding */ proto_tree_add_item(subtree, hf_ansi_map_ia5_digits, tvb, offset, -1, FALSE); - proto_item_append_text(item, " - %s", tvb_get_string(tvb,offset,-1)); + proto_item_append_text(item, " - %s", tvb_get_string(tvb,offset,tvb_length_remaining(tvb,offset))); break; case 3: /* Octet string */ @@ -708,7 +738,7 @@ dissect_ansi_map_digits_type(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree case 2: /* IA5 Coding */ proto_tree_add_item(subtree, hf_ansi_map_ia5_digits, tvb, offset, -1, FALSE); - proto_item_append_text(item, " - %s", tvb_get_string(tvb,offset,-1)); + proto_item_append_text(item, " - %s", tvb_get_string(tvb,offset,tvb_length_remaining(tvb,offset))); break; case 3: /* Octet string */ |