diff options
author | Gerasimos Dimitriadis <dimeg@intracom.gr> | 2010-03-20 23:53:22 +0000 |
---|---|---|
committer | Gerasimos Dimitriadis <dimeg@intracom.gr> | 2010-03-20 23:53:22 +0000 |
commit | dfde72f24749689ce0f9c6f2b6d2095f8ad989da (patch) | |
tree | 652f670716f205547d9640114e01a40427e20cdc /epan/dissectors/packet-e212.c | |
parent | f8387d12402cd22e97f004b8929d954774e053a5 (diff) |
Fix for Bug 4588:
RANAP and friends want the MNC encoded in big endian form.
svn path=/trunk/; revision=32257
Diffstat (limited to 'epan/dissectors/packet-e212.c')
-rw-r--r-- | epan/dissectors/packet-e212.c | 47 |
1 files changed, 45 insertions, 2 deletions
diff --git a/epan/dissectors/packet-e212.c b/epan/dissectors/packet-e212.c index e659b1b079..eb8c285f7c 100644 --- a/epan/dissectors/packet-e212.c +++ b/epan/dissectors/packet-e212.c @@ -1596,6 +1596,21 @@ static int hf_E212_mnc = -1; static int hf_E212_msin = -1; /* + * MCC/MNC dissection - little endian MNC encoding + * + * MNC of length 2: + * + * 8 7 6 5 4 3 2 1 + * +---+---+---+---+---+---+---+---+ + * | MCC digit 2 | MCC digit 1 | octet x + * +---------------+---------------+ + * | Filler | MCC digit 3 | octet x+1 + * +---------------+---------------+ + * | MNC digit 2 | MNC digit 1 | octet x+2 + * +---------------+---------------+ + * + * MNC of length 3: + * * 8 7 6 5 4 3 2 1 * +---+---+---+---+---+---+---+---+ * | MCC digit 2 | MCC digit 1 | octet x @@ -1604,9 +1619,34 @@ static int hf_E212_msin = -1; * +---------------+---------------+ * | MNC digit 2 | MNC digit 1 | octet x+2 * +---------------+---------------+ + * + * + * MCC/MNC dissection - big endian MNC encoding + * + * MNC of length 2: + * + * 8 7 6 5 4 3 2 1 + * +---+---+---+---+---+---+---+---+ + * | MCC digit 2 | MCC digit 1 | octet x + * +---------------+---------------+ + * | Filler | MCC digit 3 | octet x+1 + * +---------------+---------------+ + * | MNC digit 2 | MNC digit 1 | octet x+2 + * +---------------+---------------+ + * + * MNC of length 3: + * + * 8 7 6 5 4 3 2 1 + * +---+---+---+---+---+---+---+---+ + * | MCC digit 2 | MCC digit 1 | octet x + * +---------------+---------------+ + * | MNC digit 1 | MCC digit 3 | octet x+1 + * +---------------+---------------+ + * | MNC digit 3 | MNC digit 2 | octet x+2 + * +---------------+---------------+ */ int -dissect_e212_mcc_mnc(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset){ +dissect_e212_mcc_mnc(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset, gboolean little_endian){ int start_offset; guint8 octet; @@ -1632,7 +1672,10 @@ dissect_e212_mcc_mnc(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int of mcc = 100 * mcc1 + 10 * mcc2 + mcc3; mnc = 10 * mnc1 + mnc2; if (mnc3 != 0xf) { - mnc = 10 * mnc + mnc3; + if(little_endian) + mnc = 10 * mnc + mnc3; + else + mnc = 100 * mnc3 + mnc; } item = proto_tree_add_uint(tree, hf_E212_mcc , tvb, start_offset, 2, mcc ); if ((mcc1 > 9) || (mcc2 > 9) || (mcc3 > 9)) |