diff options
author | etxrab <etxrab@f5534014-38df-0310-8fa8-9805f1628bb7> | 2006-08-21 21:58:30 +0000 |
---|---|---|
committer | etxrab <etxrab@f5534014-38df-0310-8fa8-9805f1628bb7> | 2006-08-21 21:58:30 +0000 |
commit | dbf1db3f30752b9f1b3e5b6c04227dba252a9299 (patch) | |
tree | e1e2550387ac4e06dc142dfa46f2c8416ccb9d1a /asn1/camel | |
parent | 8eea73db230fd5acbff807299d3f96ff97f19563 (diff) |
From Florent Drouin:
This patch introduce the decoding of the RP-Cause element in the Release SMS message for Camel.
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@18986 f5534014-38df-0310-8fa8-9805f1628bb7
Diffstat (limited to 'asn1/camel')
-rw-r--r-- | asn1/camel/camel.asn | 4 | ||||
-rw-r--r-- | asn1/camel/camel.cnf | 17 | ||||
-rw-r--r-- | asn1/camel/packet-camel-template.c | 75 |
3 files changed, 92 insertions, 4 deletions
diff --git a/asn1/camel/camel.asn b/asn1/camel/camel.asn index 96f403658d..520470eae7 100644 --- a/asn1/camel/camel.asn +++ b/asn1/camel/camel.asn @@ -2977,10 +2977,10 @@ ExtensionContainer ::= SEQUENCE -- ReleaseSMSArg notes: not recursive, exported, -- locally refd 0 times, import refd 0 times -ReleaseSMSArg ::= +ReleaseSMSArg ::= RPCause -OCTET STRING (SIZE (1)) +--OCTET STRING (SIZE (1)) -- ApplyChargingGPRSArg notes: not recursive, exported, -- locally refd 0 times, import refd 0 times diff --git a/asn1/camel/camel.cnf b/asn1/camel/camel.cnf index ffbbe8680a..b90e9708a3 100644 --- a/asn1/camel/camel.cnf +++ b/asn1/camel/camel.cnf @@ -129,6 +129,23 @@ tvbuff_t *parameter_tvb; #.END #---------------------------------------------------------------------------------------- +#.FN_PARS RPCause + VAL_PTR = &camel_tvb + +#.FN_BODY RPCause + + tvbuff_t *camel_tvb; + guint8 Cause_value; + +%(DEFAULT_BODY)s + + if (camel_tvb) + dissect_RP_cause_ie(camel_tvb, 0, tvb_length_remaining(camel_tvb,0), tree, hf_camel_RP_Cause, &Cause_value); + + return offset; +#.END + +#---------------------------------------------------------------------------------------- #.FN_BODY DateAndTime diff --git a/asn1/camel/packet-camel-template.c b/asn1/camel/packet-camel-template.c index 1649967848..954a7225bf 100644 --- a/asn1/camel/packet-camel-template.c +++ b/asn1/camel/packet-camel-template.c @@ -87,6 +87,8 @@ static int hf_camel_PDPTypeNumber_ietf = -1; static int hf_camel_PDPAddress_IPv4 = -1; static int hf_camel_PDPAddress_IPv6 = -1; static int hf_camel_cellGlobalIdOrServiceAreaIdFixedLength = -1; +static int hf_camel_RP_Cause = -1; + #include "packet-camel-hf.c" static guint global_tcap_itu_ssn = 0; @@ -122,6 +124,8 @@ static guint8 PDPTypeNumber; static int dissect_invokeCmd(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset); +static guint8 dissect_RP_cause_ie(tvbuff_t *tvb, guint32 offset, guint len, + proto_tree *tree, int hf_cause_value, guint8 *cause_value); static const true_false_string camel_extension_value = { "No Extension", @@ -183,6 +187,34 @@ static const value_string camel_number_plan_values[] = { /* End includes from old" packet-camel.c */ +static const value_string camel_RP_Cause_values[] = { + { 1, "Unassigned (unallocated) number" }, + { 8, "Operator determined barring" }, + { 10, "Call barred" }, + { 11, "Reserved" }, + { 21, "Short message transfer rejected" }, + { 27, "Destination out of order" }, + { 28, "Unidentified subscriber" }, + { 29, "Facility Rejected" }, + { 30, "Unknown subscriber" }, + { 38, "Network out of order" }, + { 41, "Temporary failure" }, + { 42, "Congestion" }, + { 47, "Resources unavailable, unspecified" }, + { 50, "Requested facility not subscribed" }, + { 69, "Requested facility not implemented" }, + { 81, "Invalid short message transfer reference value" }, + { 95, "Semantically incorrect message" }, + { 96, "Invalid mandatory information" }, + { 97, " Message Type non-existent or not implemented" }, + { 98, "Message not compatible with short message protocol state" }, + { 99, "Information element non existent or not implemented" }, + { 111, "Protocol error, unspecified" }, + { 127, "Interworking, unspecified" }, + { 22,"Memory capacity exceeded" }, + { 0, NULL } +}; + #include "packet-camel-fn.c" const value_string camel_opr_code_strings[] = { @@ -252,6 +284,41 @@ char camel_number_to_char(int number) return (char) (number + 55 ); } +/* + * 24.011 8.2.5.4 + */ +static guint8 +dissect_RP_cause_ie(tvbuff_t *tvb, guint32 offset, guint len, + proto_tree *tree, int hf_cause_value, guint8 *cause_value) +{ + guint8 oct; + guint32 curr_offset; + static char a_bigbuf[1024]; + + curr_offset = offset; + oct = tvb_get_guint8(tvb, curr_offset); + + *cause_value = oct & 0x7f; + + other_decode_bitfield_value(a_bigbuf, oct, 0x7f, 8); + proto_tree_add_uint_format(tree, hf_cause_value, + tvb, curr_offset, 1, *cause_value, + "%s : %s", + a_bigbuf, + val_to_str(*cause_value, camel_RP_Cause_values, + "Unknown Cause (%u), treated as (41) \"Temporary failure\" for MO-SMS or (111) \"Protocol error,unspecified\" for MT-SMS")); + curr_offset++; + + if ((oct & 0x80)) { + oct = tvb_get_guint8(tvb, curr_offset); + proto_tree_add_uint_format(tree, hf_cause_value, + tvb, curr_offset, 1, oct, + "Diagnostic : %u", oct); + curr_offset++; + } + return(curr_offset - offset); +} + static guint32 opcode=0; static int @@ -360,7 +427,7 @@ static int dissect_invokeData(packet_info *pinfo, proto_tree *tree, tvbuff_t *tv /* ContinueSMS: no arguments - do nothing */ break; case 66: /*ReleaseSMS*/ - offset=dissect_camel_ReleaseSMSArg(FALSE, tvb, offset, pinfo, tree, -1); + offset=dissect_camel_ReleaseSMSArg(FALSE, tvb, offset, pinfo, tree, hf_camel_RP_Cause); break; case 67: /*ResetTimerSMS*/ offset=dissect_camel_ResetTimerSMSArg(FALSE, tvb, offset, pinfo, tree, -1); @@ -722,10 +789,14 @@ void proto_register_camel(void) { { "PDPAddress IPv6", "camel.PDPAddress_IPv6", FT_IPv6, BASE_NONE, NULL, 0, "IPAddress IPv6", HFILL }}, - { &hf_camel_cellGlobalIdOrServiceAreaIdFixedLength, + { &hf_camel_cellGlobalIdOrServiceAreaIdFixedLength, { "CellGlobalIdOrServiceAreaIdFixedLength", "camel.CellGlobalIdOrServiceAreaIdFixedLength", FT_BYTES, BASE_HEX, NULL, 0, "LocationInformationGPRS/CellGlobalIdOrServiceAreaIdOrLAI", HFILL }}, + { &hf_camel_RP_Cause, + { "RP Cause", "camel.RP_Cause", + FT_UINT8, BASE_DEC, NULL, 0, + "RP Cause Value", HFILL }}, #ifdef REMOVED #endif |