--- trunk-1.8/epan/dissectors/packet-bssgp.c	2013/12/19 18:43:02	54262
+++ trunk-1.8/epan/dissectors/packet-bssgp.c	2013/12/19 18:52:48	54263
@@ -77,7 +77,6 @@
 static int bssgp_decode_nri = 0;
 static guint bssgp_nri_length = 4;
 
-static packet_info *gpinfo;
 static guint8 g_pdu_type, g_rim_application_identity;
 static proto_tree *gparent_tree;
 static dissector_handle_t llc_handle;
@@ -887,7 +886,7 @@
  */
 
 static guint16
-de_bssgp_llc_pdu(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint32 offset, guint len, gchar *add_string _U_, int string_len _U_)
+de_bssgp_llc_pdu(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, guint32 offset, guint len, gchar *add_string _U_, int string_len _U_)
 {
     tvbuff_t *next_tvb=NULL;
     guint32 curr_offset;
@@ -901,10 +900,10 @@
 
     if(next_tvb){
         if (llc_handle) {
-            call_dissector(llc_handle, next_tvb, gpinfo, gparent_tree);
+            call_dissector(llc_handle, next_tvb, pinfo, gparent_tree);
         }
         else if (data_handle) {
-            call_dissector(data_handle, next_tvb, gpinfo, gparent_tree);
+            call_dissector(data_handle, next_tvb, pinfo, gparent_tree);
         }
     }
 
@@ -1089,7 +1088,7 @@
 };
 
 static guint16
-de_bssgp_qos_profile(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint32 offset, guint len _U_, gchar *add_string _U_, int string_len _U_)
+de_bssgp_qos_profile(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, guint32 offset, guint len _U_, gchar *add_string _U_, int string_len _U_)
 {
     proto_item *pi, *pre_item;
     guint32 curr_offset;
@@ -1102,7 +1101,7 @@
     /* octet 3-4 Peak bit rate provided by the network (note)
      * NOTE: The bit rate 0 (zero) shall mean "best effort" in this IE.
      */
-    link_dir = gpinfo->link_dir;
+    link_dir = pinfo->link_dir;
 
     peak_bit_rate = tvb_get_ntohs(tvb, curr_offset);
     pi = proto_tree_add_text(tree, tvb, curr_offset, 1, "Peak bit rate: ");
@@ -1504,7 +1503,7 @@
  * 11.3.48  NSEI (Network Service Entity Identifier)
  */
 static guint16
-de_bssgp_nsei(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint32 offset, guint len _U_, gchar *add_string _U_, int string_len _U_)
+de_bssgp_nsei(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, guint32 offset, guint len _U_, gchar *add_string _U_, int string_len _U_)
 {
     guint32 curr_offset;
     guint16 nsei;
@@ -1515,7 +1514,7 @@
     proto_tree_add_item(tree, hf_bssgp_nsei, tvb, curr_offset, 2, ENC_BIG_ENDIAN);
     curr_offset+=2;
 
-    col_append_sep_fstr(gpinfo->cinfo, COL_INFO, BSSGP_SEP, "NSEI %u", nsei);
+    col_append_sep_fstr(pinfo->cinfo, COL_INFO, BSSGP_SEP, "NSEI %u", nsei);
 
 
     return(curr_offset-offset);
@@ -1524,7 +1523,7 @@
  * 11.3.49  RRLP APDU
  */
 static guint16
-de_bssgp_rrlp_apdu(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint32 offset, guint len _U_, gchar *add_string _U_, int string_len _U_)
+de_bssgp_rrlp_apdu(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, guint32 offset, guint len _U_, gchar *add_string _U_, int string_len _U_)
 {
     tvbuff_t *next_tvb=NULL;
     guint32 curr_offset;
@@ -1544,9 +1543,9 @@
 
     if(next_tvb){
         if (rrlp_handle) {
-            call_dissector(rrlp_handle, next_tvb, gpinfo, gparent_tree);
+            call_dissector(rrlp_handle, next_tvb, pinfo, gparent_tree);
         }else if (data_handle) {
-            call_dissector(data_handle, next_tvb, gpinfo, gparent_tree);
+            call_dissector(data_handle, next_tvb, pinfo, gparent_tree);
         }
     }
     return(len);
@@ -1737,7 +1736,7 @@
             {
             asn1_ctx_t asn1_ctx;
 
-            asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, gpinfo);
+            asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo);
             /* 11.3.63.1.4  RAN-INFORMATION-REQUEST Application Container for the SON Transfer Application */
             /* Reporting Cell Identifier */
             /* convert to bit offset */
@@ -1754,7 +1753,7 @@
              * 3GPP TS 25.413
              */
             new_tvb = tvb_new_subset_remaining(tvb, curr_offset);
-            curr_offset = curr_offset + dissect_ranap_SourceCellID_PDU(new_tvb, gpinfo, tree);
+            curr_offset = curr_offset + dissect_ranap_SourceCellID_PDU(new_tvb, pinfo, tree);
             break;
         default :
             proto_tree_add_text(tree, tvb, curr_offset, len, "Unknown RIM Application Identity");
@@ -1836,7 +1835,7 @@
                     if (msg_fcn_p == NULL){
                         proto_tree_add_text(si_tree, tvb, curr_offset, 21, "Unknown SI message");
                     }else{
-                        (*msg_fcn_p)(tvb, si_tree, gpinfo, curr_offset+1, 20);
+                        (*msg_fcn_p)(tvb, si_tree, pinfo, curr_offset+1, 20);
                     }
                     curr_offset+=21;
                 }
@@ -1884,14 +1883,14 @@
                      * Source Cell ID) as defined in 3GPP TS 25.413
                      */
                     new_tvb = tvb_new_subset_remaining(tvb, curr_offset);
-                    curr_offset = curr_offset + dissect_ranap_SourceCellID_PDU(new_tvb, gpinfo, tree);
+                    curr_offset = curr_offset + dissect_ranap_SourceCellID_PDU(new_tvb, pinfo, tree);
                     break;
                 case 2:
                     /* If the RAT discriminator field indicates E-UTRAN, this field is encoded as the E-UTRAN CGI IE as
                      * defined in 3GPP TS 36.413
                      */
                     new_tvb = tvb_new_subset_remaining(tvb, curr_offset);
-                    curr_offset = curr_offset + dissect_s1ap_Global_ENB_ID_PDU(new_tvb, gpinfo, tree);
+                    curr_offset = curr_offset + dissect_s1ap_Global_ENB_ID_PDU(new_tvb, pinfo, tree);
                     break;
                 default:
                     break;
@@ -1905,7 +1904,7 @@
              * (UTRAN Source Cell ID) as defined in 3GPP TS 25.413
              */
             new_tvb = tvb_new_subset_remaining(tvb, curr_offset);
-            curr_offset = curr_offset + dissect_ranap_SourceCellID_PDU(new_tvb, gpinfo, tree);
+            curr_offset = curr_offset + dissect_ranap_SourceCellID_PDU(new_tvb, pinfo, tree);
             /* Octet (m+1)-n UTRA SI Container
              * UTRA SI Container: This field contains System Information Container valid for the reporting cell
              * encoded as defined in TS 25.331
@@ -1961,7 +1960,7 @@
 };
 
 static guint16
-de_bssgp_ran_app_error_cont(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint32 offset, guint len _U_, gchar *add_string _U_, int string_len _U_)
+de_bssgp_ran_app_error_cont(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, guint32 offset, guint len _U_, gchar *add_string _U_, int string_len _U_)
 {
     tvbuff_t *new_tvb = NULL;
     guint32 curr_offset;
@@ -2007,7 +2006,7 @@
              * The "SON Transfer Cause" field is encoded as the SON Transfer Cause IE as defined in 3GPP TS 36.413
              */
             new_tvb = tvb_new_subset_remaining(tvb, curr_offset);
-            curr_offset = curr_offset + dissect_s1ap_SONtransferCause_PDU(new_tvb, gpinfo, tree);
+            curr_offset = curr_offset + dissect_s1ap_SONtransferCause_PDU(new_tvb, pinfo, tree);
             /* Erroneous Application Container including IEI and LI */
             proto_tree_add_text(tree, tvb, curr_offset, len-(curr_offset-offset), "Erroneous Application Container including IEI and LI");
             break;
@@ -2201,7 +2200,7 @@
 };
 
 static guint16
-de_bssgp_rim_routing_inf(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint32 offset, guint len _U_, gchar *add_string _U_, int string_len _U_)
+de_bssgp_rim_routing_inf(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, guint32 offset, guint len _U_, gchar *add_string _U_, int string_len _U_)
 {
     guint8 oct;
     guint16 rnc_id;
@@ -2250,7 +2249,7 @@
             curr_offset = curr_offset+ de_emm_trac_area_id(tvb, tree, pinfo, curr_offset, 5, add_string, string_len);
             /* Octets 9-n contain the Global eNB ID (see 3GPP TS 36.413 [36]) of the eNodeB. */
             new_tvb = tvb_new_subset_remaining(tvb, curr_offset);
-            dissect_s1ap_Global_ENB_ID_PDU(new_tvb, gpinfo, tree);
+            dissect_s1ap_Global_ENB_ID_PDU(new_tvb, pinfo, tree);
             break;
         default:
             proto_tree_add_text(tree, tvb, curr_offset, 3, "Unknown RIM Routing Address discriminator");
@@ -2290,7 +2289,7 @@
  * 11.3.72  MBMS Session Duration
  */
 static guint16
-de_bssgp_mbms_session_dur(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint32 offset, guint len _U_, gchar *add_string _U_, int string_len _U_)
+de_bssgp_mbms_session_dur(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, guint32 offset, guint len _U_, gchar *add_string _U_, int string_len _U_)
 {
     tvbuff_t *new_tvb;
     guint32 curr_offset;
@@ -2299,7 +2298,7 @@
 
     /* AVP Code: 904 MBMS-Session-Duration Registered by packet-gtp.c */
     new_tvb =tvb_new_subset(tvb, offset, len, len);
-    dissector_try_uint(diameter_3gpp_avp_dissector_table, 904, new_tvb, gpinfo, tree);
+    dissector_try_uint(diameter_3gpp_avp_dissector_table, 904, new_tvb, pinfo, tree);
 
     return(curr_offset-offset);
 }
@@ -2311,7 +2310,7 @@
  *
  */
 static guint16
-de_bssgp_mbms_sai_list(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint32 offset, guint len, gchar *add_string _U_, int string_len _U_)
+de_bssgp_mbms_sai_list(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, guint32 offset, guint len, gchar *add_string _U_, int string_len _U_)
 {
     tvbuff_t *new_tvb;
     guint32 curr_offset;
@@ -2320,7 +2319,7 @@
 
     /* AVP Code: 903 MBMS-Service-Area Registered by packet-gtp.c */
     new_tvb =tvb_new_subset(tvb, offset, len, len);
-    dissector_try_uint(diameter_3gpp_avp_dissector_table, 903, new_tvb, gpinfo, tree);
+    dissector_try_uint(diameter_3gpp_avp_dissector_table, 903, new_tvb, pinfo, tree);
 
     return(curr_offset-offset);
 }
@@ -2829,7 +2828,7 @@
  * 11.3.94  Inter RAT Handover Info
  */
 static guint16
-de_bssgp_inter_rat_ho_info(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint32 offset, guint len _U_, gchar *add_string _U_, int string_len _U_)
+de_bssgp_inter_rat_ho_info(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, guint32 offset, guint len _U_, gchar *add_string _U_, int string_len _U_)
 {
     tvbuff_t    *new_tvb;
     guint32 curr_offset;
@@ -2841,7 +2840,7 @@
      * Inter RAT Handover Information coded as specified in 3GPP
      * Technical Specification 25.331
      */
-    dissect_rrc_InterRATHandoverInfo_PDU(new_tvb, gpinfo, tree);
+    dissect_rrc_InterRATHandoverInfo_PDU(new_tvb, pinfo, tree);
 
     return(len);
 }
@@ -3085,7 +3084,7 @@
 
     /* Octets 8-n contain the Global eNB ID (see 3GPP TS 36.413) of the eNodeB. */
     new_tvb = tvb_new_subset_remaining(tvb, curr_offset);
-    dissect_s1ap_Global_ENB_ID_PDU(new_tvb, gpinfo, tree);
+    dissect_s1ap_Global_ENB_ID_PDU(new_tvb, pinfo, tree);
 
     return(len);
 }
@@ -3093,7 +3092,7 @@
  * 11.3.104     E-UTRAN Inter RAT Handover Info
  */
 static guint16
-de_bssgp_e_utran_inter_rat_ho_info(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint32 offset, guint len _U_, gchar *add_string _U_, int string_len _U_)
+de_bssgp_e_utran_inter_rat_ho_info(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, guint32 offset, guint len _U_, gchar *add_string _U_, int string_len _U_)
 {
     tvbuff_t    *new_tvb;
     guint32 curr_offset;
@@ -3107,7 +3106,7 @@
      * significant bit of the first octet of the octet string contains bit 8 of
      * the first octet of the IE.
      */
-    dissect_lte_rrc_UE_EUTRA_Capability_PDU(new_tvb, gpinfo, tree);
+    dissect_lte_rrc_UE_EUTRA_Capability_PDU(new_tvb, pinfo, tree);
 
     return(len);
 }
@@ -3170,7 +3169,7 @@
  * 11.3.108     SON Transfer Application Identity
  */
 static guint16
-de_bssgp_son_transfer_app_id(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint32 offset _U_, guint len _U_, gchar *add_string _U_, int string_len _U_)
+de_bssgp_son_transfer_app_id(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, guint32 offset _U_, guint len _U_, gchar *add_string _U_, int string_len _U_)
 {
 	tvbuff_t *next_tvb;
     /* SON Transfer Application Identity: This field is encoded as the SON Transfer Application Identity IE
@@ -3178,7 +3177,7 @@
      */
     if(len > 0){
         next_tvb = tvb_new_subset(tvb, offset, len, len);
-        dissect_s1ap_SONtransferApplicationIdentity_PDU(next_tvb, gpinfo, tree);
+        dissect_s1ap_SONtransferApplicationIdentity_PDU(next_tvb, pinfo, tree);
     }
 
     return(len);
@@ -6249,7 +6248,6 @@
     void              (*msg_fcn)(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, guint32 offset, guint len);
 
     /* Save pinfo */
-    gpinfo = pinfo;
     g_rim_application_identity = 0;
     gparent_tree = tree;
     len = tvb_length(tvb);
