summaryrefslogtreecommitdiff
path: root/asn1
diff options
context:
space:
mode:
authorAnders Broman <anders.broman@ericsson.com>2006-06-15 05:40:21 +0000
committerAnders Broman <anders.broman@ericsson.com>2006-06-15 05:40:21 +0000
commit012f0c5f735ddc3b32f9c8dd42f61c625683a8e8 (patch)
tree43b6be332f5ff131dbfd2094927870c1fed10881 /asn1
parent2f95f76a1ed4126ed982f2778fcd13e8df455b97 (diff)
downloadwireshark-012f0c5f735ddc3b32f9c8dd42f61c625683a8e8.tar.gz
RANAP:
Handle the case where length is two octets. SS-Operations.asn - cosmetict change. svn path=/trunk/; revision=18466
Diffstat (limited to 'asn1')
-rw-r--r--asn1/gsm_ss/SS-Operations.asn3
-rw-r--r--asn1/ranap/packet-ranap-template.c21
2 files changed, 15 insertions, 9 deletions
diff --git a/asn1/gsm_ss/SS-Operations.asn b/asn1/gsm_ss/SS-Operations.asn
index 94c5e8605d..9206888a08 100644
--- a/asn1/gsm_ss/SS-Operations.asn
+++ b/asn1/gsm_ss/SS-Operations.asn
@@ -209,7 +209,8 @@ ECT-CallState ::= ENUMERATED {
NameIndicator ::= SEQUENCE {
callingName [0] Name OPTIONAL,
-...}
+ ...
+ }
Name ::= CHOICE {
namePresentationAllowed [0] NameSet,
diff --git a/asn1/ranap/packet-ranap-template.c b/asn1/ranap/packet-ranap-template.c
index 748c657e6d..f8eb34ad15 100644
--- a/asn1/ranap/packet-ranap-template.c
+++ b/asn1/ranap/packet-ranap-template.c
@@ -1082,17 +1082,15 @@ static gboolean
dissect_sccp_ranap_heur(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
{
guint8 temp;
+ asn_ctx_t asn_ctx;
+ guint length;
+ int offset;
+
+ asn_ctx_init(&asn_ctx, ASN_ENC_PER, TRUE, pinfo);
/* Is it a ranap packet?
*
* 4th octet should be the length of the rest of the message.
- * note: I believe the length octet may actually be represented
- * by more than one octet. Something like...
- * bit 01234567 octets
- * 0xxxxxxx 1
- * 10xxxxxx xxxxxxxx 2
- * For now, we have ignored this. I hope that's safe.
- *
* 2nd octet is the message-type e Z[0, 28]
* (obviously there must be at least four octets)
*
@@ -1102,7 +1100,14 @@ dissect_sccp_ranap_heur(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
#define LENGTH_OFFSET 3
#define MSG_TYPE_OFFSET 1
if (tvb_length(tvb) < 4) { return FALSE; }
- if (tvb_get_guint8(tvb, LENGTH_OFFSET) != (tvb_length(tvb) - 4)) { return FALSE; }
+ /*if (tvb_get_guint8(tvb, LENGTH_OFFSET) != (tvb_length(tvb) - 4)) { return FALSE; }*/
+ /* Read the length NOTE offset in bits */
+ offset = dissect_per_length_determinant(tvb, LENGTH_OFFSET<<3, &asn_ctx, tree, -1, &length);
+ offset = offset>>3;
+ if (length!= (tvb_length(tvb) - offset)){
+ return FALSE;
+ }
+
temp = tvb_get_guint8(tvb, MSG_TYPE_OFFSET);
if (temp > RANAP_MAX_PC) { return FALSE; }