Use explicit casts.
authorAnders Broman <anders.broman@ericsson.com>
Sun, 3 Mar 2013 21:22:25 +0000 (21:22 -0000)
committerAnders Broman <anders.broman@ericsson.com>
Sun, 3 Mar 2013 21:22:25 +0000 (21:22 -0000)
svn path=/trunk/; revision=48043

asn1/credssp/packet-credssp-template.c
asn1/rrc/rrc.cnf
epan/dissectors/packet-credssp.c
epan/dissectors/packet-rrc.c

index 7fc7c8dcff6eecc9515dd6644a64c1bb504ba8bd..f4db923051604a6cca09becaf35d20238eacd9b5 100644 (file)
@@ -83,7 +83,7 @@ dissect_credssp_heur(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree,
 {
   asn1_ctx_t asn1_ctx;
   int offset = 0;
-  gint8 class;
+  gint8 ber_class;
   gboolean pc;
   gint32 tag;
   guint32 length;
@@ -92,14 +92,14 @@ dissect_credssp_heur(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree,
 
   /* Look for SEQUENCE, CONTEXT 0, and INTEGER 2 */  
   if(tvb_length(tvb) > 7) {
-    offset = get_ber_identifier(tvb, offset, &class, &pc, &tag); 
-    if((class == BER_CLASS_UNI) && (tag == BER_UNI_TAG_SEQUENCE) && (pc == TRUE)) {
+    offset = get_ber_identifier(tvb, offset, &ber_class, &pc, &tag); 
+    if((ber_class == BER_CLASS_UNI) && (tag == BER_UNI_TAG_SEQUENCE) && (pc == TRUE)) {
       offset = get_ber_length(tvb, offset, NULL, NULL);
-      offset = get_ber_identifier(tvb, offset, &class, &pc, &tag); 
-      if((class == BER_CLASS_CON) && (tag == 0)) {
+      offset = get_ber_identifier(tvb, offset, &ber_class, &pc, &tag); 
+      if((ber_class == BER_CLASS_CON) && (tag == 0)) {
        offset = get_ber_length(tvb, offset, NULL, NULL);
-       offset = get_ber_identifier(tvb, offset, &class, &pc, &tag); 
-       if((class == BER_CLASS_UNI) && (tag == BER_UNI_TAG_INTEGER)) {
+       offset = get_ber_identifier(tvb, offset, &ber_class, &pc, &tag); 
+       if((ber_class == BER_CLASS_UNI) && (tag == BER_UNI_TAG_INTEGER)) {
          offset = get_ber_length(tvb, offset, &length, NULL);
          if((length == 1) && (tvb_get_guint8(tvb, offset) == 2)) {
            dissect_credssp(tvb, pinfo, parent_tree);
index 9621a92609029a9d9d4fb298f888391f19714598..fede325d96f4ad7989de93fdec4ff0f0363f05ef 100644 (file)
@@ -401,8 +401,8 @@ fp_info       *fpinf ;
 
 %(DEFAULT_BODY)s
 
-  fpinf = p_get_proto_data(actx->pinfo->fd, proto_fp);
-  if(fpinf && ((c_inf = g_tree_lookup(rrc_ciph_inf, GINT_TO_POINTER(fpinf->com_context_id))) != NULL) ){
+  fpinf = (fp_info *)p_get_proto_data(actx->pinfo->fd, proto_fp);
+  if(fpinf && ((c_inf = (rrc_ciphering_info *)g_tree_lookup(rrc_ciph_inf, GINT_TO_POINTER(fpinf->com_context_id))) != NULL) ){
     c_inf->setup_frame = actx->pinfo->fd->num;
   }
 
@@ -715,13 +715,13 @@ HNBName TYPE=FT_STRING DISPLAY=BASE_NONE
         num_chans_per_flow[flowd]++;
 
         if(num_chans_per_flow[flowd] > 1 ){
-            rrcinf = p_get_proto_data(actx->pinfo->fd, proto_rrc);
+            rrcinf = (rrc_info *)p_get_proto_data(actx->pinfo->fd, proto_rrc);
             if((rrcinf == NULL) || (rrcinf->hrnti[actx->pinfo->fd->subnum] == 0)){
                 expert_add_info_format(actx->pinfo, actx->created_item, PI_SEQUENCE, PI_NOTE, "Did not detect any H-RNTI");
             }
             else{
                 /*If it doesnt exists, insert it*/
-                if( (cur_val=g_tree_lookup(hsdsch_muxed_flows, GUINT_TO_POINTER((guint)rrcinf->hrnti[actx->pinfo->fd->subnum]))) == NULL ){
+                if( (cur_val=(gint *)g_tree_lookup(hsdsch_muxed_flows, GUINT_TO_POINTER((guint)rrcinf->hrnti[actx->pinfo->fd->subnum]))) == NULL ){
 
                     flowd_p = (guint*)g_malloc0(sizeof(gint));
                     *flowd_p = (1<<flowd);    /*Set the bit to mark it as true*/
@@ -751,13 +751,13 @@ HNBName TYPE=FT_STRING DISPLAY=BASE_NONE
 
 
         if(num_chans_per_flow[flowd] > 1 ){
-            rrcinf = p_get_proto_data(actx->pinfo->fd, proto_rrc);
+            rrcinf = (rrc_info *)p_get_proto_data(actx->pinfo->fd, proto_rrc);
             if((rrcinf == NULL) || (rrcinf->hrnti[actx->pinfo->fd->subnum] == 0)){
                 expert_add_info_format(actx->pinfo, actx->created_item, PI_SEQUENCE, PI_NOTE, "Did not detect any H-RNTI");
             }
             else{
                 /*If it doesnt exists, insert it*/
-                if( (cur_val=g_tree_lookup(hsdsch_muxed_flows, GUINT_TO_POINTER((guint)rrcinf->hrnti[actx->pinfo->fd->subnum]))) == NULL ){
+                if( (cur_val=(gint *)g_tree_lookup(hsdsch_muxed_flows, GUINT_TO_POINTER((guint)rrcinf->hrnti[actx->pinfo->fd->subnum]))) == NULL ){
 
                     flowd_p = (guint*)g_malloc0(sizeof(gint));
                     *flowd_p = (1<<flowd);    /* Set the bit to mark it as true*/
@@ -782,9 +782,9 @@ HNBName TYPE=FT_STRING DISPLAY=BASE_NONE
 %(DEFAULT_BODY)s
 
 #.FN_FTR H-RNTI
-  rrcinf = p_get_proto_data(actx->pinfo->fd, proto_rrc);
+  rrcinf = (struct rrc_info *)p_get_proto_data(actx->pinfo->fd, proto_rrc);
   if (!rrcinf) {
-    rrcinf = se_alloc0(sizeof(struct rrc_info));
+    rrcinf = se_new0(struct rrc_info);
     p_add_proto_data(actx->pinfo->fd, proto_rrc, rrcinf);
   }
   rrcinf->hrnti[actx->pinfo->fd->subnum] = tvb_get_ntohs(hrnti_tvb, 0);
@@ -799,7 +799,7 @@ HNBName TYPE=FT_STRING DISPLAY=BASE_NONE
 %(DEFAULT_BODY)s
 
   /*We base this map on communication context from fp*/
-    fpinf = p_get_proto_data(actx->pinfo->fd, proto_fp);
+    fpinf = (fp_info *)p_get_proto_data(actx->pinfo->fd, proto_fp);
 
   /*If no info found, skip all this*/
   if(fpinf == NULL){
@@ -815,8 +815,8 @@ HNBName TYPE=FT_STRING DISPLAY=BASE_NONE
     case RRC_NAS_SYS_INFO_PS:
 
       /*Find the entry for the communication context (taken from FP)*/
-      if( (c_inf = g_tree_lookup(rrc_ciph_inf, GINT_TO_POINTER(fpinf->com_context_id))) == NULL ){
-        c_inf = g_malloc0(sizeof(rrc_ciphering_info));
+      if( (c_inf =(rrc_ciphering_info *)g_tree_lookup(rrc_ciph_inf, GINT_TO_POINTER(fpinf->com_context_id))) == NULL ){
+        c_inf = g_new0(rrc_ciphering_info,1);
 
         /*Initiate tree with START_PS values.*/
         if(!c_inf->start_ps)
@@ -832,7 +832,7 @@ HNBName TYPE=FT_STRING DISPLAY=BASE_NONE
         }
 
         /*Retrieve and store the value*/
-        start = g_malloc(sizeof(guint32));
+        start = g_new(guint32,1);
                 *start = tvb_get_bits32(start_val,0,20,ENC_BIG_ENDIAN);
                 if(c_inf && c_inf->start_ps)
                 /*Insert the value based on current frame num since this might vary over time*/
@@ -850,7 +850,8 @@ HNBName TYPE=FT_STRING DISPLAY=BASE_NONE
   rrc_ciphering_info * c_inf;
 
 
-  fpinf = p_get_proto_data(actx->pinfo->fd, proto_fp);
+  
+  fpinf = (fp_info *)p_get_proto_data(actx->pinfo->fd, proto_fp);
 
 %(DEFAULT_BODY)s
 
@@ -859,7 +860,7 @@ HNBName TYPE=FT_STRING DISPLAY=BASE_NONE
     return offset;
   }
   /*This should not happen*/
-  if( (c_inf = g_tree_lookup(rrc_ciph_inf, GINT_TO_POINTER(fpinf->com_context_id))) == NULL ){
+  if( (c_inf = (rrc_ciphering_info *)g_tree_lookup(rrc_ciph_inf, GINT_TO_POINTER(fpinf->com_context_id))) == NULL ){
     return offset;
   }
   /*Set the ciphering activation frame information*/
index 9c52bcd170749f5b11af418974ee64448d57653e..0c2def4729ee4d60c40dc65a15af78c847aa745e 100644 (file)
@@ -355,7 +355,7 @@ dissect_credssp_heur(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree,
 {
   asn1_ctx_t asn1_ctx;
   int offset = 0;
-  gint8 class;
+  gint8 ber_class;
   gboolean pc;
   gint32 tag;
   guint32 length;
@@ -364,14 +364,14 @@ dissect_credssp_heur(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree,
 
   /* Look for SEQUENCE, CONTEXT 0, and INTEGER 2 */  
   if(tvb_length(tvb) > 7) {
-    offset = get_ber_identifier(tvb, offset, &class, &pc, &tag); 
-    if((class == BER_CLASS_UNI) && (tag == BER_UNI_TAG_SEQUENCE) && (pc == TRUE)) {
+    offset = get_ber_identifier(tvb, offset, &ber_class, &pc, &tag); 
+    if((ber_class == BER_CLASS_UNI) && (tag == BER_UNI_TAG_SEQUENCE) && (pc == TRUE)) {
       offset = get_ber_length(tvb, offset, NULL, NULL);
-      offset = get_ber_identifier(tvb, offset, &class, &pc, &tag); 
-      if((class == BER_CLASS_CON) && (tag == 0)) {
+      offset = get_ber_identifier(tvb, offset, &ber_class, &pc, &tag); 
+      if((ber_class == BER_CLASS_CON) && (tag == 0)) {
        offset = get_ber_length(tvb, offset, NULL, NULL);
-       offset = get_ber_identifier(tvb, offset, &class, &pc, &tag); 
-       if((class == BER_CLASS_UNI) && (tag == BER_UNI_TAG_INTEGER)) {
+       offset = get_ber_identifier(tvb, offset, &ber_class, &pc, &tag); 
+       if((ber_class == BER_CLASS_UNI) && (tag == BER_UNI_TAG_INTEGER)) {
          offset = get_ber_length(tvb, offset, &length, NULL);
          if((length == 1) && (tvb_get_guint8(tvb, offset) == 2)) {
            dissect_credssp(tvb, pinfo, parent_tree);
index c941e381e9a669033125cae5c7b695e54b9c672e..4f3e75c19801fa04afd2d022ed9724ed614f8b02 100644 (file)
@@ -16182,7 +16182,7 @@ dissect_rrc_ActivationTime(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _
 
 static int
 dissect_rrc_RB_Identity(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
-#line 870 "../../asn1/rrc/rrc.cnf"
+#line 871 "../../asn1/rrc/rrc.cnf"
 
   offset = dissect_per_constrained_integer(tvb, offset, actx, tree, hf_index,
                                                             1U, 32U, &rbid, FALSE);
@@ -16199,7 +16199,7 @@ dissect_rrc_RB_Identity(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_,
 
 static int
 dissect_rrc_RLC_SequenceNumber(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
-#line 876 "../../asn1/rrc/rrc.cnf"
+#line 877 "../../asn1/rrc/rrc.cnf"
 
   offset = dissect_per_constrained_integer(tvb, offset, actx, tree, hf_index,
                                                             0U, 4095U, &activation_frame, FALSE);
@@ -16224,7 +16224,8 @@ dissect_rrc_RB_ActivationTimeInfo(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t
   rrc_ciphering_info * c_inf;
 
 
-  fpinf = p_get_proto_data(actx->pinfo->fd, proto_fp);
+  
+  fpinf = (fp_info *)p_get_proto_data(actx->pinfo->fd, proto_fp);
 
   offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index,
                                    ett_rrc_RB_ActivationTimeInfo, RB_ActivationTimeInfo_sequence);
@@ -16235,7 +16236,7 @@ dissect_rrc_RB_ActivationTimeInfo(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t
     return offset;
   }
   /*This should not happen*/
-  if( (c_inf = g_tree_lookup(rrc_ciph_inf, GINT_TO_POINTER(fpinf->com_context_id))) == NULL ){
+  if( (c_inf = (rrc_ciphering_info *)g_tree_lookup(rrc_ciph_inf, GINT_TO_POINTER(fpinf->com_context_id))) == NULL ){
     return offset;
   }
   /*Set the ciphering activation frame information*/
@@ -20307,9 +20308,9 @@ dissect_rrc_H_RNTI(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, prot
 
 
 #line 785 "../../asn1/rrc/rrc.cnf"
-  rrcinf = p_get_proto_data(actx->pinfo->fd, proto_rrc);
+  rrcinf = (struct rrc_info *)p_get_proto_data(actx->pinfo->fd, proto_rrc);
   if (!rrcinf) {
-    rrcinf = se_alloc0(sizeof(struct rrc_info));
+    rrcinf = se_new0(struct rrc_info);
     p_add_proto_data(actx->pinfo->fd, proto_rrc, rrcinf);
   }
   rrcinf->hrnti[actx->pinfo->fd->subnum] = tvb_get_ntohs(hrnti_tvb, 0);
@@ -41172,13 +41173,13 @@ dissect_rrc_DL_TransportChannelType_r5(tvbuff_t *tvb _U_, int offset _U_, asn1_c
         num_chans_per_flow[flowd]++;
 
         if(num_chans_per_flow[flowd] > 1 ){
-            rrcinf = p_get_proto_data(actx->pinfo->fd, proto_rrc);
+            rrcinf = (rrc_info *)p_get_proto_data(actx->pinfo->fd, proto_rrc);
             if((rrcinf == NULL) || (rrcinf->hrnti[actx->pinfo->fd->subnum] == 0)){
                 expert_add_info_format(actx->pinfo, actx->created_item, PI_SEQUENCE, PI_NOTE, "Did not detect any H-RNTI");
             }
             else{
                 /*If it doesnt exists, insert it*/
-                if( (cur_val=g_tree_lookup(hsdsch_muxed_flows, GUINT_TO_POINTER((guint)rrcinf->hrnti[actx->pinfo->fd->subnum]))) == NULL ){
+                if( (cur_val=(gint *)g_tree_lookup(hsdsch_muxed_flows, GUINT_TO_POINTER((guint)rrcinf->hrnti[actx->pinfo->fd->subnum]))) == NULL ){
 
                     flowd_p = (guint*)g_malloc0(sizeof(gint));
                     *flowd_p = (1<<flowd);    /*Set the bit to mark it as true*/
@@ -44647,13 +44648,13 @@ dissect_rrc_DL_TransportChannelType_r7(tvbuff_t *tvb _U_, int offset _U_, asn1_c
 
 
         if(num_chans_per_flow[flowd] > 1 ){
-            rrcinf = p_get_proto_data(actx->pinfo->fd, proto_rrc);
+            rrcinf = (rrc_info *)p_get_proto_data(actx->pinfo->fd, proto_rrc);
             if((rrcinf == NULL) || (rrcinf->hrnti[actx->pinfo->fd->subnum] == 0)){
                 expert_add_info_format(actx->pinfo, actx->created_item, PI_SEQUENCE, PI_NOTE, "Did not detect any H-RNTI");
             }
             else{
                 /*If it doesnt exists, insert it*/
-                if( (cur_val=g_tree_lookup(hsdsch_muxed_flows, GUINT_TO_POINTER((guint)rrcinf->hrnti[actx->pinfo->fd->subnum]))) == NULL ){
+                if( (cur_val=(gint *)g_tree_lookup(hsdsch_muxed_flows, GUINT_TO_POINTER((guint)rrcinf->hrnti[actx->pinfo->fd->subnum]))) == NULL ){
 
                     flowd_p = (guint*)g_malloc0(sizeof(gint));
                     *flowd_p = (1<<flowd);    /* Set the bit to mark it as true*/
@@ -86655,7 +86656,7 @@ static const per_choice_t DL_DCCH_MessageType_choice[] = {
 
 static int
 dissect_rrc_DL_DCCH_MessageType(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
-#line 880 "../../asn1/rrc/rrc.cnf"
+#line 881 "../../asn1/rrc/rrc.cnf"
   offset = dissect_per_choice(tvb, offset, actx, tree, hf_index,
                                  ett_rrc_DL_DCCH_MessageType, DL_DCCH_MessageType_choice,
                                  &msg_type);
@@ -86675,7 +86676,7 @@ static const per_sequence_t DL_DCCH_Message_sequence[] = {
 
 static int
 dissect_rrc_DL_DCCH_Message(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
-#line 883 "../../asn1/rrc/rrc.cnf"
+#line 884 "../../asn1/rrc/rrc.cnf"
   offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index,
                                    ett_rrc_DL_DCCH_Message, DL_DCCH_Message_sequence);
 
@@ -86701,7 +86702,7 @@ dissect_rrc_START_Value(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_,
 
 
   /*We base this map on communication context from fp*/
-    fpinf = p_get_proto_data(actx->pinfo->fd, proto_fp);
+    fpinf = (fp_info *)p_get_proto_data(actx->pinfo->fd, proto_fp);
 
   /*If no info found, skip all this*/
   if(fpinf == NULL){
@@ -86717,8 +86718,8 @@ dissect_rrc_START_Value(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_,
     case RRC_NAS_SYS_INFO_PS:
 
       /*Find the entry for the communication context (taken from FP)*/
-      if( (c_inf = g_tree_lookup(rrc_ciph_inf, GINT_TO_POINTER(fpinf->com_context_id))) == NULL ){
-        c_inf = g_malloc0(sizeof(rrc_ciphering_info));
+      if( (c_inf =(rrc_ciphering_info *)g_tree_lookup(rrc_ciph_inf, GINT_TO_POINTER(fpinf->com_context_id))) == NULL ){
+        c_inf = g_new0(rrc_ciphering_info,1);
 
         /*Initiate tree with START_PS values.*/
         if(!c_inf->start_ps)
@@ -86734,7 +86735,7 @@ dissect_rrc_START_Value(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_,
         }
 
         /*Retrieve and store the value*/
-        start = g_malloc(sizeof(guint32));
+        start = g_new(guint32,1);
                 *start = tvb_get_bits32(start_val,0,20,ENC_BIG_ENDIAN);
                 if(c_inf && c_inf->start_ps)
                 /*Insert the value based on current frame num since this might vary over time*/
@@ -96770,8 +96771,8 @@ fp_info       *fpinf ;
                                    ett_rrc_SecurityModeComplete, SecurityModeComplete_sequence);
 
 
-  fpinf = p_get_proto_data(actx->pinfo->fd, proto_fp);
-  if(fpinf && ((c_inf = g_tree_lookup(rrc_ciph_inf, GINT_TO_POINTER(fpinf->com_context_id))) != NULL) ){
+  fpinf = (fp_info *)p_get_proto_data(actx->pinfo->fd, proto_fp);
+  if(fpinf && ((c_inf = (rrc_ciphering_info *)g_tree_lookup(rrc_ciph_inf, GINT_TO_POINTER(fpinf->com_context_id))) != NULL) ){
     c_inf->setup_frame = actx->pinfo->fd->num;
   }
 
@@ -112741,7 +112742,7 @@ static const per_choice_t HandoverToUTRANCommand_choice[] = {
 
 static int
 dissect_rrc_HandoverToUTRANCommand(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
-#line 886 "../../asn1/rrc/rrc.cnf"
+#line 887 "../../asn1/rrc/rrc.cnf"
   offset = dissect_per_choice(tvb, offset, actx, tree, hf_index,
                                  ett_rrc_HandoverToUTRANCommand, HandoverToUTRANCommand_choice,
                                  NULL);