diff options
author | Pascal Quantin <pascal.quantin@gmail.com> | 2012-11-12 21:39:14 +0000 |
---|---|---|
committer | Pascal Quantin <pascal.quantin@gmail.com> | 2012-11-12 21:39:14 +0000 |
commit | 4e96e6c4753bf4cf286bcce82c2fa8f097dbef09 (patch) | |
tree | 471690b9d9d3e1cd5d0d2394965984b56dfc1b3a /asn1/rrc/rrc.cnf | |
parent | 9f3ff78604c1c17981c434b0210afaac912c6268 (diff) |
Fix detection of H-RNTI when it is given after the DL-TransportChannelType configuration (typically in case of handoverToUTRANCommand)
svn path=/trunk/; revision=46012
Diffstat (limited to 'asn1/rrc/rrc.cnf')
-rw-r--r-- | asn1/rrc/rrc.cnf | 54 |
1 files changed, 28 insertions, 26 deletions
diff --git a/asn1/rrc/rrc.cnf b/asn1/rrc/rrc.cnf index 0f9e3a65bf..1b4d623813 100644 --- a/asn1/rrc/rrc.cnf +++ b/asn1/rrc/rrc.cnf @@ -398,7 +398,7 @@ 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((gint)fpinf->com_context_id))) != NULL) ){ + if(fpinf && ((c_inf = g_tree_lookup(rrc_ciph_inf, GINT_TO_POINTER(fpinf->com_context_id))) != NULL) ){ c_inf->setup_frame = actx->pinfo->fd->num; } @@ -670,7 +670,7 @@ HNBName TYPE=FT_STRING DISPLAY=BASE_NONE gint *flowd_p; gint *cur_val=NULL; - guint16 hr=0; + struct rrc_info *rrcinf; %(DEFAULT_BODY)s @@ -679,20 +679,17 @@ HNBName TYPE=FT_STRING DISPLAY=BASE_NONE num_chans_per_flow[flowd]++; if(num_chans_per_flow[flowd] > 1 ){ - - if(hrnti == NULL){ - expert_add_info_format(actx->pinfo, NULL, PI_MALFORMED, PI_WARN, "Did not detect any H-RNTI "); + rrcinf = 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{ - /*Read the H-RNTI value*/ - hr = tvb_get_bits16(hrnti,0,16,TRUE); - /*If it doesnt exists, insert it*/ - if( (cur_val=g_tree_lookup(hsdsch_muxed_flows, GINT_TO_POINTER((gint)hr))) == NULL ){ + if( (cur_val=g_tree_lookup(hsdsch_muxed_flows, GUINT_TO_POINTER(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*/ - g_tree_insert(hsdsch_muxed_flows, GINT_TO_POINTER((gint)hr), flowd_p); + g_tree_insert(hsdsch_muxed_flows, GUINT_TO_POINTER(rrcinf->hrnti[actx->pinfo->fd->subnum]), flowd_p); }else{ *cur_val = (1<<flowd) | *cur_val; @@ -708,7 +705,7 @@ HNBName TYPE=FT_STRING DISPLAY=BASE_NONE gint *flowd_p; gint *cur_val=NULL; - guint16 hr=0; + struct rrc_info *rrcinf; %(DEFAULT_BODY)s @@ -718,20 +715,17 @@ HNBName TYPE=FT_STRING DISPLAY=BASE_NONE if(num_chans_per_flow[flowd] > 1 ){ - - if(hrnti == NULL){ - expert_add_info_format(actx->pinfo, NULL, PI_MALFORMED, PI_WARN, "Did not detect any H-RNTI "); + rrcinf = 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{ - /*Read the H-RNTI value*/ - hr = tvb_get_bits16(hrnti,0,16,TRUE); - /*If it doesnt exists, insert it*/ - if( (cur_val=g_tree_lookup(hsdsch_muxed_flows, GINT_TO_POINTER((gint)hr))) == NULL ){ + if( (cur_val=g_tree_lookup(hsdsch_muxed_flows, GUINT_TO_POINTER(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*/ - g_tree_insert(hsdsch_muxed_flows, GINT_TO_POINTER((gint)hr), flowd_p); + g_tree_insert(hsdsch_muxed_flows, GUINT_TO_POINTER(rrcinf->hrnti[actx->pinfo->fd->subnum]), flowd_p); }else{ *cur_val = (1<<flowd) | *cur_val; @@ -746,9 +740,19 @@ HNBName TYPE=FT_STRING DISPLAY=BASE_NONE #.FN_BODY MAC-d-FlowIdentity VAL_PTR = &flowd %(DEFAULT_BODY)s -#.FN_BODY H-RNTI VAL_PTR = &hrnti +#.FN_BODY H-RNTI VAL_PTR = &hrnti_tvb + tvbuff_t *hrnti_tvb; + struct rrc_info *rrcinf; %(DEFAULT_BODY)s +#.FN_FTR H-RNTI + rrcinf = p_get_proto_data(actx->pinfo->fd, proto_rrc); + if (!rrcinf) { + rrcinf = se_alloc0(sizeof(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); + #.FN_BODY START-Value VAL_PTR = &start_val tvbuff_t * start_val; fp_info *fpinf; @@ -775,7 +779,7 @@ 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((gint)fpinf->com_context_id))) == NULL ){ + 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)); /*Initiate tree with START_PS values.*/ @@ -788,7 +792,7 @@ HNBName TYPE=FT_STRING DISPLAY=BASE_NONE c_inf->seq_no[i][0] = -1; c_inf->seq_no[i][1] = -1; } - g_tree_insert(rrc_ciph_inf, GINT_TO_POINTER((gint)fpinf->com_context_id), c_inf); + g_tree_insert(rrc_ciph_inf, GINT_TO_POINTER(fpinf->com_context_id), c_inf); } /*Retrieve and store the value*/ @@ -796,7 +800,7 @@ HNBName TYPE=FT_STRING DISPLAY=BASE_NONE *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*/ - g_tree_insert(c_inf->start_ps, GINT_TO_POINTER((gint)actx->pinfo->fd->num), start); + g_tree_insert(c_inf->start_ps, GUINT_TO_POINTER(actx->pinfo->fd->num), start); break; default: @@ -819,7 +823,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((gint)fpinf->com_context_id))) == NULL ){ + if( (c_inf = g_tree_lookup(rrc_ciph_inf, GINT_TO_POINTER(fpinf->com_context_id))) == NULL ){ return offset; } /*Set the ciphering activation frame information*/ @@ -841,11 +845,9 @@ HNBName TYPE=FT_STRING DISPLAY=BASE_NONE #.FN_BODY DL-DCCH-Message %(DEFAULT_BODY)s - hrnti = NULL; #.FN_BODY HandoverToUTRANCommand %(DEFAULT_BODY)s - hrnti = NULL; #.END |