e212: fix for e212.sai in GTP packet
authorHessam Jalali <hessam.jalali@gmail.com>
Mon, 24 Oct 2016 09:25:29 +0000 (12:55 +0330)
committerAnders Broman <a.broman58@gmail.com>
Tue, 25 Oct 2016 04:12:40 +0000 (04:12 +0000)
geo location type 1 represents SAI, but for GTP v1 it is returned as e212, hence not aggregating with GTP v2
the patch also opens up a way to add e212.cgi (Cell Global Identity) which is shared between GTP vesions.

Change-Id: I853cd26037533aac2735b9d965793362c16f3f04
Reviewed-on: https://code.wireshark.org/review/18428
Petri-Dish: Anders Broman <a.broman58@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
epan/dissectors/packet-gsm_a_bssmap.c
epan/dissectors/packet-gsm_a_common.h
epan/dissectors/packet-gtp.c

index deb8f27d1d1d56acc83f9214052557a8a06bfe32..962d4d977fec14b96a2134ea81292a3a9850c37f 100644 (file)
@@ -1577,7 +1577,7 @@ be_lsa_id_list(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint32
  * Formats everything after the discriminator, shared function
  */
 guint16
-be_cell_id_aux(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, guint32 offset, guint len, gchar *add_string, int string_len, guint8 disc)
+be_cell_id_type(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, guint32 offset, guint len, gchar *add_string, int string_len, guint8 disc, e212_number_type_t number_type)
 {
     guint32 value;
     guint32 curr_offset;
@@ -1613,9 +1613,9 @@ be_cell_id_aux(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, guint32 offs
         /* FALLTHRU */
     case 0x0c:  /* For identification of a UTRAN cell for cell load information: */
         if (disc != 0x0b)
-            curr_offset = dissect_e212_mcc_mnc(tvb, pinfo, tree, curr_offset, E212_NONE, TRUE);
+            curr_offset = dissect_e212_mcc_mnc(tvb, pinfo, tree, curr_offset, number_type, TRUE);
         else
-            curr_offset = dissect_e212_mcc_mnc(tvb, pinfo, tree, curr_offset, E212_NONE, FALSE);
+            curr_offset = dissect_e212_mcc_mnc(tvb, pinfo, tree, curr_offset, number_type, FALSE);
         /* FALLTHRU */
 
     case 0x01:
@@ -1697,6 +1697,12 @@ be_cell_id_aux(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, guint32 offs
     return(curr_offset - offset);
 }
 
+guint16
+be_cell_id_aux(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, guint32 offset, guint len, gchar *add_string, int string_len, guint8 disc)
+{
+    return be_cell_id_type(tvb, tree, pinfo, offset, len, add_string, string_len, disc, E212_NONE);
+}
+
 static guint16
 be_cell_id(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint32 offset, guint len _U_, gchar *add_string, int string_len)
 {
index 057a7d00c641b3767f4973e854e407c5208cdebf..47c24d0c3485919677cc829dc58ff44ed5b7fd17 100644 (file)
@@ -72,6 +72,7 @@
 #include <epan/proto.h>
 
 #include "packet-sccp.h"
+#include "packet-e212.h"
 #include "ws_symbol_export.h"
 
 /* PROTOTYPES/FORWARDS */
@@ -631,6 +632,7 @@ void bssmap_new_bss_to_old_bss_info(tvbuff_t *tvb, proto_tree *tree, packet_info
 void dtap_mm_mm_info(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, guint32 offset, guint len);
 
 guint16 be_cell_id_aux(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, guint32 offset, guint len, gchar *add_string, int string_len, guint8 disc);
+guint16 be_cell_id_type(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, guint32 offset, guint len, gchar *add_string, int string_len, guint8 disc, e212_number_type_t number_type);
 guint16 be_cell_id_list(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, guint32 offset, guint len, gchar *add_string, int string_len);
 guint16 be_chan_type(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, guint32 offset, guint len, gchar *add_string, int string_len);
 guint16 be_prio(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, guint32 offset, guint len, gchar *add_string, int string_len);
index 1ec06599c2cee469af7afff0b290825a5676ee19..299dc1de271d2c57f361b8ed26b29aee412aa4f6 100644 (file)
@@ -6003,7 +6003,7 @@ gchar *dissect_radius_user_loc(proto_tree * tree, tvbuff_t * tvb, packet_info* p
              * SAI is defined in sub-clause 9.2.3.9 of 3GPP TS 25.413 [7].
              */
             /* Use gsm_a's function to dissect Geographic Location by faking disc ( last 4) */
-            be_cell_id_aux(tvb, tree, pinfo, offset, length - 1, NULL, 0, 4);
+            be_cell_id_type(tvb, tree, pinfo, offset, length - 1, NULL, 0, 4,E212_SAI);
             offset = offset + 5;
             proto_tree_add_item(tree, hf_gtp_ext_sac, tvb, offset, 2, ENC_BIG_ENDIAN);
             break;
@@ -6101,7 +6101,7 @@ decode_gtp_usr_loc_inf(tvbuff_t * tvb, int offset, packet_info * pinfo, proto_tr
              * SAI is defined in sub-clause 9.2.3.9 of 3GPP TS 25.413 [7].
              */
             /* Use gsm_a's function to dissect Geographic Location by faking disc ( last 4) */
-            be_cell_id_aux(tvb, ext_tree, pinfo, offset, length - 1, NULL, 0, 4);
+            be_cell_id_type(tvb, ext_tree, pinfo, offset, length - 1, NULL, 0, 4,E212_SAI);
             offset = offset + 5;
             proto_tree_add_item(ext_tree, hf_gtp_ext_sac, tvb, offset, 2, ENC_BIG_ENDIAN);
             break;