Various small changes:

- add a missing test on null pointer
- always initialize rrc_nas_sys_info_gsm_map_type with a value from its associated enum
- fix some typo errors
- remove some useless directives from conformance file
- detabify files (ASN.1 generated dissectors are indented with spaces)

svn path=/trunk/; revision=44358
This commit is contained in:
Pascal Quantin 2012-08-08 20:43:48 +00:00
parent a1218c94c9
commit 25523bd0bf
5 changed files with 469 additions and 496 deletions

View File

@ -60,7 +60,7 @@
#define PSNAME "RRC"
#define PFNAME "rrc"
extern int proto_fp; /*Handler to FP*/
extern int proto_fp; /*Handler to FP*/
GTree * hsdsch_muxed_flows;
GTree * rrc_ciph_inf;
@ -140,45 +140,45 @@ static tvbuff_t * start_val;
static int cipher_start_val[2] _U_;
/*Stores how many channels we have detected for a HS-DSCH MAC-flow*/
#define RRC_MAX_NUM_HSDHSCH_MACDFLOW 8
#define RRC_MAX_NUM_HSDHSCH_MACDFLOW 8
static guint8 num_chans_per_flow[RRC_MAX_NUM_HSDHSCH_MACDFLOW];
static int rbid;
static int activation_frame;
/**
* Return the maximum conunter, useful for initiating counters
* Return the maximum counter, useful for initiating counters
*/
#if 0
static int get_max_counter(int com_context){
int i;
guint32 max = 0;
rrc_ciphering_info * c_inf;
if( (c_inf = g_tree_lookup(rrc_ciph_inf, GINT_TO_POINTER((gint)com_context))) == NULL ){
return 0;
}
for(i = 0; i<31; i++){
max = MAX(c_inf->ps_conf_counters[i][0], max);
max = MAX(c_inf->ps_conf_counters[i][1], max);
}
return max;
}
int i;
guint32 max = 0;
rrc_ciphering_info * c_inf;
if( (c_inf = g_tree_lookup(rrc_ciph_inf, GINT_TO_POINTER((gint)com_context))) == NULL ){
return 0;
}
for(i = 0; i<31; i++){
max = MAX(c_inf->ps_conf_counters[i][0], max);
max = MAX(c_inf->ps_conf_counters[i][1], max);
}
return max;
}
#endif
/** Utility functions used for various comparions/cleanups in tree **/
/** Utility functions used for various comparisons/cleanups in tree **/
gint rrc_key_cmp(gconstpointer b_ptr, gconstpointer a_ptr, gpointer ignore _U_){
if( GPOINTER_TO_INT(a_ptr) > GPOINTER_TO_INT(b_ptr) ){
return -1;
}
return GPOINTER_TO_INT(a_ptr) < GPOINTER_TO_INT(b_ptr);
if( GPOINTER_TO_INT(a_ptr) > GPOINTER_TO_INT(b_ptr) ){
return -1;
}
return GPOINTER_TO_INT(a_ptr) < GPOINTER_TO_INT(b_ptr);
}
void rrc_free_key(gpointer key _U_){
/*Key's should be de allocated elsewhere.*/
/*Keys should be de allocated elsewhere.*/
}
}
void rrc_free_value(gpointer value ){
g_free(value);
}
g_free(value);
}
#include "packet-rrc-fn.c"
#include "packet-rrc.h"
@ -187,68 +187,68 @@ void rrc_free_value(gpointer value ){
static void
dissect_rrc(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
{
/* FIX ME Currently don't know the 'starting point' of this protocol
* exported DL-DCCH-Message is the entry point.
*/
proto_item *rrc_item = NULL;
proto_tree *rrc_tree = NULL;
struct rrc_info *rrcinf;
/* FIX ME Currently don't know the 'starting point' of this protocol
* exported DL-DCCH-Message is the entry point.
*/
proto_item *rrc_item = NULL;
proto_tree *rrc_tree = NULL;
struct rrc_info *rrcinf;
top_tree = tree;
rrcinf = p_get_proto_data(pinfo->fd, proto_rrc);
top_tree = tree;
rrcinf = p_get_proto_data(pinfo->fd, proto_rrc);
/* make entry in the Protocol column on summary display */
col_set_str(pinfo->cinfo, COL_PROTOCOL, "RRC");
/* make entry in the Protocol column on summary display */
col_set_str(pinfo->cinfo, COL_PROTOCOL, "RRC");
/* create the rrc protocol tree */
rrc_item = proto_tree_add_item(tree, proto_rrc, tvb, 0, -1, ENC_NA);
rrc_tree = proto_item_add_subtree(rrc_item, ett_rrc);
/* create the rrc protocol tree */
rrc_item = proto_tree_add_item(tree, proto_rrc, tvb, 0, -1, ENC_NA);
rrc_tree = proto_item_add_subtree(rrc_item, ett_rrc);
if (rrcinf) {
switch (rrcinf->msgtype[pinfo->fd->subnum]) {
case RRC_MESSAGE_TYPE_PCCH:
call_dissector(rrc_pcch_handle, tvb, pinfo, rrc_tree);
break;
case RRC_MESSAGE_TYPE_UL_CCCH:
call_dissector(rrc_ul_ccch_handle, tvb, pinfo, rrc_tree);
break;
case RRC_MESSAGE_TYPE_DL_CCCH:
call_dissector(rrc_dl_ccch_handle, tvb, pinfo, rrc_tree);
break;
case RRC_MESSAGE_TYPE_UL_DCCH:
call_dissector(rrc_ul_dcch_handle, tvb, pinfo, rrc_tree);
break;
case RRC_MESSAGE_TYPE_DL_DCCH:
call_dissector(rrc_dl_dcch_handle, tvb, pinfo, rrc_tree);
break;
case RRC_MESSAGE_TYPE_BCCH_FACH:
call_dissector(rrc_bcch_fach_handle, tvb, pinfo, rrc_tree);
break;
default:
;
}
}
if (rrcinf) {
switch (rrcinf->msgtype[pinfo->fd->subnum]) {
case RRC_MESSAGE_TYPE_PCCH:
call_dissector(rrc_pcch_handle, tvb, pinfo, rrc_tree);
break;
case RRC_MESSAGE_TYPE_UL_CCCH:
call_dissector(rrc_ul_ccch_handle, tvb, pinfo, rrc_tree);
break;
case RRC_MESSAGE_TYPE_DL_CCCH:
call_dissector(rrc_dl_ccch_handle, tvb, pinfo, rrc_tree);
break;
case RRC_MESSAGE_TYPE_UL_DCCH:
call_dissector(rrc_ul_dcch_handle, tvb, pinfo, rrc_tree);
break;
case RRC_MESSAGE_TYPE_DL_DCCH:
call_dissector(rrc_dl_dcch_handle, tvb, pinfo, rrc_tree);
break;
case RRC_MESSAGE_TYPE_BCCH_FACH:
call_dissector(rrc_bcch_fach_handle, tvb, pinfo, rrc_tree);
break;
default:
;
}
}
}
void rrc_init(void){
/*Cleanup*/
if(hsdsch_muxed_flows){
g_tree_destroy(hsdsch_muxed_flows);
}
if(rrc_ciph_inf){
g_tree_destroy(rrc_ciph_inf);
}
/*Initialize structure for muxed flow indication*/
hsdsch_muxed_flows = g_tree_new_full(rrc_key_cmp,
/*Cleanup*/
if(hsdsch_muxed_flows){
g_tree_destroy(hsdsch_muxed_flows);
}
if(rrc_ciph_inf){
g_tree_destroy(rrc_ciph_inf);
}
/*Initialize structure for muxed flow indication*/
hsdsch_muxed_flows = g_tree_new_full(rrc_key_cmp,
NULL, /* data pointer, optional */
rrc_free_key,
rrc_free_value);
/*Initialize structure for muxed flow indication*/
rrc_ciph_inf = g_tree_new_full(rrc_key_cmp,
/*Initialize structure for muxed flow indication*/
rrc_ciph_inf = g_tree_new_full(rrc_key_cmp,
NULL, /* data pointer, optional */
NULL,
rrc_free_value);
@ -288,7 +288,7 @@ void proto_register_rrc(void) {
&ett_rrc,
#include "packet-rrc-ettarr.c"
&ett_rrc_eutraFeatureGroupIndicators,
&ett_rrc_cn_CommonGSM_MAP_NAS_SysInfo,
&ett_rrc_cn_CommonGSM_MAP_NAS_SysInfo,
};
@ -305,7 +305,7 @@ void proto_register_rrc(void) {
register_init_routine(rrc_init);
register_init_routine(rrc_init);
}

View File

@ -25,38 +25,38 @@
#ifndef PACKET_RRC_H
#define PACKET_RRC_H
#include <epan/asn1.h> /* Needed for non asn1 dissectors?*/
#include <epan/asn1.h> /* Needed for non asn1 dissectors?*/
extern int proto_rrc;
#include "packet-rrc-exp.h"
enum rrc_message_type {
RRC_MESSAGE_TYPE_INVALID = 0,
RRC_MESSAGE_TYPE_PCCH = 1,
RRC_MESSAGE_TYPE_UL_CCCH,
RRC_MESSAGE_TYPE_DL_CCCH,
RRC_MESSAGE_TYPE_UL_DCCH,
RRC_MESSAGE_TYPE_DL_DCCH,
RRC_MESSAGE_TYPE_BCCH_FACH
RRC_MESSAGE_TYPE_INVALID = 0,
RRC_MESSAGE_TYPE_PCCH = 1,
RRC_MESSAGE_TYPE_UL_CCCH,
RRC_MESSAGE_TYPE_DL_CCCH,
RRC_MESSAGE_TYPE_UL_DCCH,
RRC_MESSAGE_TYPE_DL_DCCH,
RRC_MESSAGE_TYPE_BCCH_FACH
};
#define MAX_RRC_FRAMES 64
#define MAX_RRC_FRAMES 64
typedef struct rrc_info
{
enum rrc_message_type msgtype[MAX_RRC_FRAMES];
enum rrc_message_type msgtype[MAX_RRC_FRAMES];
} rrc_info;
/*Struct for storing ciphering information*/
typedef struct rrc_ciph_info_
{
int seq_no[31][2]; /*Indicates for each Rbid when ciphering starts*/
GTree * /*guint32*/ start_cs; /*Start value for CS counter*/
GTree * /*guint32*/ start_ps; /*Start value for PS counter*/
guint32 conf_algo_indicator; /*Indicates which type of ciphering algorithm used*/
guint32 int_algo_indiccator; /*Indicates which type of integrity algorithm used*/
unsigned int setup_frame; /*Store which frame contained this information*/
guint32 ps_conf_counters[31][2]; /*This should also be made for CS*/
int seq_no[31][2]; /*Indicates for each Rbid when ciphering starts*/
GTree * /*guint32*/ start_cs; /*Start value for CS counter*/
GTree * /*guint32*/ start_ps; /*Start value for PS counter*/
guint32 conf_algo_indicator; /*Indicates which type of ciphering algorithm used*/
guint32 int_algo_indiccator; /*Indicates which type of integrity algorithm used*/
unsigned int setup_frame; /*Store which frame contained this information*/
guint32 ps_conf_counters[31][2]; /*This should also be made for CS*/
} rrc_ciphering_info;
extern GTree * hsdsch_muxed_flows;

View File

@ -145,16 +145,16 @@ HandoverFromUTRANCommand-GSM-r6-IEs/gsm-message/single-GSM-Message single-GSM-Me
%(DEFAULT_BODY)s
if (nas_message_tvb)
call_dissector(gsm_a_dtap_handle,nas_message_tvb,%(ACTX)s->pinfo, tree);
if (nas_message_tvb)
call_dissector(gsm_a_dtap_handle,nas_message_tvb,%(ACTX)s->pinfo, tree);
#.FN_BODY InterRATHandoverInfo/ue-CapabilityContainer/present VAL_PTR = &ue_radio_access_cap_info_tvb
tvbuff_t *ue_radio_access_cap_info_tvb=NULL;
%(DEFAULT_BODY)s
if (ue_radio_access_cap_info_tvb)
call_dissector(rrc_ue_radio_access_cap_info_handle,ue_radio_access_cap_info_tvb,%(ACTX)s->pinfo, tree);
if (ue_radio_access_cap_info_tvb)
call_dissector(rrc_ue_radio_access_cap_info_handle,ue_radio_access_cap_info_tvb,%(ACTX)s->pinfo, tree);
#.END
@ -398,10 +398,10 @@ fp_info *fpinf ;
%(DEFAULT_BODY)s
fpinf = p_get_proto_data(actx->pinfo->fd, proto_fp);
if( (c_inf = g_tree_lookup(rrc_ciph_inf, GINT_TO_POINTER((gint)fpinf->com_context_id))) != NULL ){
c_inf->setup_frame = actx->pinfo->fd->num;
}
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) ){
c_inf->setup_frame = actx->pinfo->fd->num;
}
#.FN_BODY SecurityModeFailure
@ -505,8 +505,8 @@ fp_info *fpinf ;
%(DEFAULT_BODY)s
if (dl_dcch_message_tvb)
call_dissector(rrc_dl_dcch_handle,dl_dcch_message_tvb,%(ACTX)s->pinfo, proto_tree_get_root(tree));
if (dl_dcch_message_tvb)
call_dissector(rrc_dl_dcch_handle,dl_dcch_message_tvb,%(ACTX)s->pinfo, proto_tree_get_root(tree));
#.FN_BODY GSM-MessageList/_item VAL_PTR = &gsm_messagelist_tvb
tvbuff_t *gsm_messagelist_tvb=NULL;
@ -514,7 +514,7 @@ fp_info *fpinf ;
%(DEFAULT_BODY)s
if (gsm_messagelist_tvb)
call_dissector(gsm_a_dtap_handle,gsm_messagelist_tvb,actx->pinfo, tree);
call_dissector(gsm_a_dtap_handle,gsm_messagelist_tvb,actx->pinfo, tree);
#.FN_BODY HandoverFromUTRANCommand-GSM-r3-IEs/gsm-message/single-GSM-Message single-GSM-Message-r3
tvbuff_t *gsm_message_tvb=NULL;
@ -528,8 +528,8 @@ fp_info *fpinf ;
gsm_message_tvb = tvb_new_octet_aligned(tvb, offset, 8*whole_octets_remaining);
if (gsm_message_tvb) {
add_new_data_source(actx->pinfo,gsm_message_tvb,"GSM Message(aligned)");
call_dissector(gsm_a_dtap_handle,gsm_message_tvb,actx->pinfo, tree);
add_new_data_source(actx->pinfo,gsm_message_tvb,"GSM Message(aligned)");
call_dissector(gsm_a_dtap_handle,gsm_message_tvb,actx->pinfo, tree);
}
#.FN_BODY HandoverFromUTRANCommand-GSM-r6-IEs/gsm-message/single-GSM-Message single-GSM-Message-r6
tvbuff_t *gsm_message_tvb=NULL;
@ -543,31 +543,31 @@ fp_info *fpinf ;
gsm_message_tvb = tvb_new_octet_aligned(tvb, offset, 8*whole_octets_remaining);
if (gsm_message_tvb) {
add_new_data_source(actx->pinfo,gsm_message_tvb,"GSM Message(aligned)");
call_dissector(gsm_a_dtap_handle,gsm_message_tvb,actx->pinfo, tree);
add_new_data_source(actx->pinfo,gsm_message_tvb,"GSM Message(aligned)");
call_dissector(gsm_a_dtap_handle,gsm_message_tvb,actx->pinfo, tree);
}
#.FN_BODY GSM-Classmark2 VAL_PTR = &parameter_tvb
tvbuff_t *parameter_tvb=NULL;
tvbuff_t *parameter_tvb=NULL;
%(DEFAULT_BODY)s
if (parameter_tvb){
de_ms_cm_2(parameter_tvb, tree, actx->pinfo, 2, tvb_get_guint8(parameter_tvb,1), NULL, 0);
de_ms_cm_2(parameter_tvb, tree, actx->pinfo, 2, tvb_get_guint8(parameter_tvb,1), NULL, 0);
}
#.FN_BODY GSM-Classmark3 VAL_PTR = &parameter_tvb
tvbuff_t *parameter_tvb=NULL;
tvbuff_t *parameter_tvb=NULL;
%(DEFAULT_BODY)s
if (parameter_tvb){
de_ms_cm_3(parameter_tvb, tree, actx->pinfo, 0, tvb_length(parameter_tvb), NULL, 0);
de_ms_cm_3(parameter_tvb, tree, actx->pinfo, 0, tvb_length(parameter_tvb), NULL, 0);
}
#.FN_BODY InterRATHandoverInfoWithInterRATCapabilities-r3-IEs/interRATHandoverInfo VAL_PTR = &parameter_tvb
tvbuff_t *parameter_tvb=NULL;
tvbuff_t *parameter_tvb=NULL;
%(DEFAULT_BODY)s
if (parameter_tvb){
dissect_rrc_InterRATHandoverInfo_PDU(parameter_tvb, actx->pinfo, tree);
dissect_rrc_InterRATHandoverInfo_PDU(parameter_tvb, actx->pinfo, tree);
}
#.FN_BODY EUTRA-RadioAccessCapability/ue-EUTRA-Capability VAL_PTR = &ue_eutra_cap_tvb
@ -673,38 +673,38 @@ HNBName TYPE=FT_STRING DISPLAY=BASE_NONE
gint *cur_val=NULL;
guint16 hr=0;
%(DEFAULT_BODY)s
%(DEFAULT_BODY)s
/*TODO: This should probably be done better*/
if(type == 4){ /*If this is type HS-DSCH*/
num_chans_per_flow[flowd]++;
/*TODO: This should probably be done better*/
if(type == 4){ /*If this is type HS-DSCH*/
num_chans_per_flow[flowd]++;
/*TODO: This configuration should proably be unique for each UE*/
if(num_chans_per_flow[flowd] > 1 ){
/*TODO: This configuration should proably be unique for each UE*/
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 ");
}
else{
/*Read the H-RNTI value*/
hr = tvb_get_bits16(hrnti,0,16,TRUE);
if(hrnti == NULL){
expert_add_info_format(actx->pinfo, NULL, PI_MALFORMED, PI_WARN, "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 it doesnt exists, insert it*/
if( (cur_val=g_tree_lookup(hsdsch_muxed_flows, GINT_TO_POINTER((gint)hr))) == 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);
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);
}else{
*cur_val = (1<<flowd) | *cur_val;
}else{
*cur_val = (1<<flowd) | *cur_val;
}
}
}
}
}
}
}
}
/*Here we try to figure out which HS-DSCH channels are multiplexed*/
#.FN_BODY DL-TransportChannelType-r7 VAL_PTR = &type
@ -712,137 +712,125 @@ HNBName TYPE=FT_STRING DISPLAY=BASE_NONE
gint *cur_val=NULL;
guint16 hr=0;
%(DEFAULT_BODY)s
%(DEFAULT_BODY)s
/*TODO: This should probably be done better*/
if(type == 4){ /*If this is type HS-DSCH*/
num_chans_per_flow[flowd]++;
/*TODO: This should probably be done better*/
if(type == 4){ /*If this is type HS-DSCH*/
num_chans_per_flow[flowd]++;
if(num_chans_per_flow[flowd] > 1 ){
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 ");
}
else{
/*Read the H-RNTI value*/
hr = tvb_get_bits16(hrnti,0,16,TRUE);
if(hrnti == NULL){
expert_add_info_format(actx->pinfo, NULL, PI_MALFORMED, PI_WARN, "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 it doesnt exists, insert it*/
if( (cur_val=g_tree_lookup(hsdsch_muxed_flows, GINT_TO_POINTER((gint)hr))) == 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);
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);
}else{
*cur_val = (1<<flowd) | *cur_val;
}else{
*cur_val = (1<<flowd) | *cur_val;
}
}
}
}
}
}
}
#.FN_BODY DL-LogicalChannelMapping-r5
%(DEFAULT_BODY)s
#.FN_BODY DL-LogicalChannelMapping-r7
%(DEFAULT_BODY)s
#.FN_BODY LogicalChannelIdentity
%(DEFAULT_BODY)s
}
#.FN_BODY MAC-d-FlowIdentity VAL_PTR = &flowd
%(DEFAULT_BODY)s
%(DEFAULT_BODY)s
#.FN_BODY SRB-InformationSetupList2-r6
%(DEFAULT_BODY)s
/*Clear memory*/
memset(num_chans_per_flow,0,sizeof(guint8));
%(DEFAULT_BODY)s
/*Clear memory*/
memset(num_chans_per_flow,0,sizeof(guint8));
#.FN_BODY H-RNTI VAL_PTR = &hrnti
%(DEFAULT_BODY)s
%(DEFAULT_BODY)s
#.FN_BODY START-Value VAL_PTR = &start_val
fp_info *fpinf;
rrc_ciphering_info * c_inf;
int i;
guint32 * start;
%(DEFAULT_BODY)s
/*We base this map on comuncation context from fp*/
fpinf = p_get_proto_data(actx->pinfo->fd, proto_fp);
/*If no info found, skip all this*/
if(fpinf == NULL){
return offset;
}
/*Retrieves the start value for the two ciphering domains*/
switch(rrc_nas_sys_info_gsm_map_type){
case RRC_NAS_SYS_INFO_CS:
/*
g_warning("Not implemented");
*/
break;
case RRC_NAS_SYS_INFO_PS:
/*Find the entry for the comucnation context (taken from FP)*/
if( (c_inf = g_tree_lookup(rrc_ciph_inf, GINT_TO_POINTER((gint)fpinf->com_context_id))) == NULL ){
c_inf = g_malloc0(sizeof(rrc_ciphering_info));
/*Initaite tree with START_PS values.*/
if(!c_inf->start_ps)
c_inf->start_ps = g_tree_new_full(rrc_key_cmp,
NULL,rrc_free_key,rrc_free_value);
/*Clear and intiliaze seq_no matrix*/
for(i = 0; i< 31; i++){
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);
}
/*Retrive and store the value*/
start = g_malloc(sizeof(guint32));
*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);
break;
default:
break;
}
/*is this dangerous?*/
rrc_nas_sys_info_gsm_map_type = 0;
#.FN_BODY RB-ActivationTimeInfo
fp_info *fpinf;
rrc_ciphering_info * c_inf;
fpinf = p_get_proto_data(actx->pinfo->fd, proto_fp);
fp_info *fpinf;
rrc_ciphering_info * c_inf;
int i;
guint32 * start;
%(DEFAULT_BODY)s
/*If no info found, skip all this*/
if(fpinf == NULL){
return offset;
}
/*This should not happen*/
if( (c_inf = g_tree_lookup(rrc_ciph_inf, GINT_TO_POINTER((gint)fpinf->com_context_id))) == NULL ){
return offset;
}
/*Set the ciphering activation frame information*/
c_inf->seq_no[rbid][fpinf->is_uplink] = activation_frame;
/*We base this map on communication context from fp*/
fpinf = p_get_proto_data(actx->pinfo->fd, proto_fp);
/*If no info found, skip all this*/
if(fpinf == NULL){
return offset;
}
/*Retrieve the start value for the two ciphering domains*/
switch(rrc_nas_sys_info_gsm_map_type){
case RRC_NAS_SYS_INFO_CS:
/*
g_warning("Not implemented");
*/
break;
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 ){
c_inf = g_malloc0(sizeof(rrc_ciphering_info));
/*Initiate tree with START_PS values.*/
if(!c_inf->start_ps)
c_inf->start_ps = g_tree_new_full(rrc_key_cmp,
NULL,rrc_free_key,rrc_free_value);
/*Clear and initialize seq_no matrix*/
for(i = 0; i< 31; i++){
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);
}
/*Retrieve and store the value*/
start = g_malloc(sizeof(guint32));
*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);
break;
default:
break;
}
/*is this dangerous?*/
rrc_nas_sys_info_gsm_map_type = RRC_NAS_SYS_INFO_CN_COMMON;
#.FN_BODY RB-ActivationTimeInfo
fp_info *fpinf;
rrc_ciphering_info * c_inf;
fpinf = p_get_proto_data(actx->pinfo->fd, proto_fp);
%(DEFAULT_BODY)s
/*If no info found, skip all this*/
if(fpinf == NULL){
return offset;
}
/*This should not happen*/
if( (c_inf = g_tree_lookup(rrc_ciph_inf, GINT_TO_POINTER((gint)fpinf->com_context_id))) == NULL ){
return offset;
}
/*Set the ciphering activation frame information*/
c_inf->seq_no[rbid][fpinf->is_uplink] = activation_frame;
#.FN_BODY RB-Identity VAL_PTR = &rbid

View File

@ -68,7 +68,7 @@
#define PSNAME "RRC"
#define PFNAME "rrc"
extern int proto_fp; /*Handler to FP*/
extern int proto_fp; /*Handler to FP*/
GTree * hsdsch_muxed_flows;
GTree * rrc_ciph_inf;
@ -14807,45 +14807,45 @@ static tvbuff_t * start_val;
static int cipher_start_val[2] _U_;
/*Stores how many channels we have detected for a HS-DSCH MAC-flow*/
#define RRC_MAX_NUM_HSDHSCH_MACDFLOW 8
#define RRC_MAX_NUM_HSDHSCH_MACDFLOW 8
static guint8 num_chans_per_flow[RRC_MAX_NUM_HSDHSCH_MACDFLOW];
static int rbid;
static int activation_frame;
/**
* Return the maximum conunter, useful for initiating counters
* Return the maximum counter, useful for initiating counters
*/
#if 0
static int get_max_counter(int com_context){
int i;
guint32 max = 0;
rrc_ciphering_info * c_inf;
if( (c_inf = g_tree_lookup(rrc_ciph_inf, GINT_TO_POINTER((gint)com_context))) == NULL ){
return 0;
}
for(i = 0; i<31; i++){
max = MAX(c_inf->ps_conf_counters[i][0], max);
max = MAX(c_inf->ps_conf_counters[i][1], max);
}
return max;
}
int i;
guint32 max = 0;
rrc_ciphering_info * c_inf;
if( (c_inf = g_tree_lookup(rrc_ciph_inf, GINT_TO_POINTER((gint)com_context))) == NULL ){
return 0;
}
for(i = 0; i<31; i++){
max = MAX(c_inf->ps_conf_counters[i][0], max);
max = MAX(c_inf->ps_conf_counters[i][1], max);
}
return max;
}
#endif
/** Utility functions used for various comparions/cleanups in tree **/
/** Utility functions used for various comparisons/cleanups in tree **/
gint rrc_key_cmp(gconstpointer b_ptr, gconstpointer a_ptr, gpointer ignore _U_){
if( GPOINTER_TO_INT(a_ptr) > GPOINTER_TO_INT(b_ptr) ){
return -1;
}
return GPOINTER_TO_INT(a_ptr) < GPOINTER_TO_INT(b_ptr);
if( GPOINTER_TO_INT(a_ptr) > GPOINTER_TO_INT(b_ptr) ){
return -1;
}
return GPOINTER_TO_INT(a_ptr) < GPOINTER_TO_INT(b_ptr);
}
void rrc_free_key(gpointer key _U_){
/*Key's should be de allocated elsewhere.*/
/*Keys should be de allocated elsewhere.*/
}
}
void rrc_free_value(gpointer value ){
g_free(value);
}
g_free(value);
}
/*--- Included file: packet-rrc-fn.c ---*/
#line 1 "../../asn1/rrc/packet-rrc-fn.c"
@ -15088,7 +15088,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 849 "../../asn1/rrc/rrc.cnf"
#line 837 "../../asn1/rrc/rrc.cnf"
offset = dissect_per_constrained_integer(tvb, offset, actx, tree, hf_index,
1U, 32U, &rbid, FALSE);
@ -15105,7 +15105,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 855 "../../asn1/rrc/rrc.cnf"
#line 843 "../../asn1/rrc/rrc.cnf"
offset = dissect_per_constrained_integer(tvb, offset, actx, tree, hf_index,
0U, 4095U, &activation_frame, FALSE);
@ -15125,27 +15125,27 @@ static const per_sequence_t RB_ActivationTimeInfo_sequence[] = {
static int
dissect_rrc_RB_ActivationTimeInfo(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
#line 828 "../../asn1/rrc/rrc.cnf"
fp_info *fpinf;
rrc_ciphering_info * c_inf;
#line 816 "../../asn1/rrc/rrc.cnf"
fp_info *fpinf;
rrc_ciphering_info * c_inf;
fpinf = p_get_proto_data(actx->pinfo->fd, proto_fp);
fpinf = 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);
/*If no info found, skip all this*/
if(fpinf == NULL){
return offset;
}
/*This should not happen*/
if( (c_inf = g_tree_lookup(rrc_ciph_inf, GINT_TO_POINTER((gint)fpinf->com_context_id))) == NULL ){
return offset;
}
/*Set the ciphering activation frame information*/
c_inf->seq_no[rbid][fpinf->is_uplink] = activation_frame;
/*If no info found, skip all this*/
if(fpinf == NULL){
return offset;
}
/*This should not happen*/
if( (c_inf = g_tree_lookup(rrc_ciph_inf, GINT_TO_POINTER((gint)fpinf->com_context_id))) == NULL ){
return offset;
}
/*Set the ciphering activation frame information*/
c_inf->seq_no[rbid][fpinf->is_uplink] = activation_frame;
@ -19203,8 +19203,8 @@ dissect_rrc_T_r3(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_
static int
dissect_rrc_H_RNTI(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
#line 770 "../../asn1/rrc/rrc.cnf"
offset = dissect_per_bit_string(tvb, offset, actx, tree, hf_index,
#line 758 "../../asn1/rrc/rrc.cnf"
offset = dissect_per_bit_string(tvb, offset, actx, tree, hf_index,
16, 16, FALSE, &hrnti);
@ -32472,14 +32472,9 @@ dissect_rrc_UL_TransportChannelType(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_
static int
dissect_rrc_LogicalChannelIdentity(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
#line 757 "../../asn1/rrc/rrc.cnf"
offset = dissect_per_constrained_integer(tvb, offset, actx, tree, hf_index,
offset = dissect_per_constrained_integer(tvb, offset, actx, tree, hf_index,
1U, 15U, NULL, FALSE);
return offset;
}
@ -38381,8 +38376,8 @@ dissect_rrc_RLC_Info_r5(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_,
static int
dissect_rrc_MAC_d_FlowIdentity(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
#line 761 "../../asn1/rrc/rrc.cnf"
offset = dissect_per_constrained_integer(tvb, offset, actx, tree, hf_index,
#line 749 "../../asn1/rrc/rrc.cnf"
offset = dissect_per_constrained_integer(tvb, offset, actx, tree, hf_index,
0U, 7U, &flowd, FALSE);
@ -38435,41 +38430,41 @@ dissect_rrc_DL_TransportChannelType_r5(tvbuff_t *tvb _U_, int offset _U_, asn1_c
gint *cur_val=NULL;
guint16 hr=0;
offset = dissect_per_choice(tvb, offset, actx, tree, hf_index,
offset = dissect_per_choice(tvb, offset, actx, tree, hf_index,
ett_rrc_DL_TransportChannelType_r5, DL_TransportChannelType_r5_choice,
&type);
/*TODO: This should probably be done better*/
if(type == 4){ /*If this is type HS-DSCH*/
num_chans_per_flow[flowd]++;
/*TODO: This should probably be done better*/
if(type == 4){ /*If this is type HS-DSCH*/
num_chans_per_flow[flowd]++;
/*TODO: This configuration should proably be unique for each UE*/
if(num_chans_per_flow[flowd] > 1 ){
/*TODO: This configuration should proably be unique for each UE*/
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 ");
}
else{
/*Read the H-RNTI value*/
hr = tvb_get_bits16(hrnti,0,16,TRUE);
if(hrnti == NULL){
expert_add_info_format(actx->pinfo, NULL, PI_MALFORMED, PI_WARN, "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 it doesnt exists, insert it*/
if( (cur_val=g_tree_lookup(hsdsch_muxed_flows, GINT_TO_POINTER((gint)hr))) == 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);
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);
}else{
*cur_val = (1<<flowd) | *cur_val;
}else{
*cur_val = (1<<flowd) | *cur_val;
}
}
}
}
}
}
}
}
/*Here we try to figure out which HS-DSCH channels are multiplexed*/
@ -38485,14 +38480,9 @@ static const per_sequence_t DL_LogicalChannelMapping_r5_sequence[] = {
static int
dissect_rrc_DL_LogicalChannelMapping_r5(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
#line 750 "../../asn1/rrc/rrc.cnf"
offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index,
offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index,
ett_rrc_DL_LogicalChannelMapping_r5, DL_LogicalChannelMapping_r5_sequence);
return offset;
}
@ -41918,42 +41908,41 @@ dissect_rrc_DL_TransportChannelType_r7(tvbuff_t *tvb _U_, int offset _U_, asn1_c
gint *cur_val=NULL;
guint16 hr=0;
offset = dissect_per_choice(tvb, offset, actx, tree, hf_index,
offset = dissect_per_choice(tvb, offset, actx, tree, hf_index,
ett_rrc_DL_TransportChannelType_r7, DL_TransportChannelType_r7_choice,
&type);
/*TODO: This should probably be done better*/
if(type == 4){ /*If this is type HS-DSCH*/
num_chans_per_flow[flowd]++;
/*TODO: This should probably be done better*/
if(type == 4){ /*If this is type HS-DSCH*/
num_chans_per_flow[flowd]++;
if(num_chans_per_flow[flowd] > 1 ){
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 ");
}
else{
/*Read the H-RNTI value*/
hr = tvb_get_bits16(hrnti,0,16,TRUE);
if(hrnti == NULL){
expert_add_info_format(actx->pinfo, NULL, PI_MALFORMED, PI_WARN, "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 it doesnt exists, insert it*/
if( (cur_val=g_tree_lookup(hsdsch_muxed_flows, GINT_TO_POINTER((gint)hr))) == 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);
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);
}else{
*cur_val = (1<<flowd) | *cur_val;
}else{
*cur_val = (1<<flowd) | *cur_val;
}
}
}
}
}
}
}
}
@ -41969,13 +41958,9 @@ static const per_sequence_t DL_LogicalChannelMapping_r7_sequence[] = {
static int
dissect_rrc_DL_LogicalChannelMapping_r7(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
#line 754 "../../asn1/rrc/rrc.cnf"
offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index,
offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index,
ett_rrc_DL_LogicalChannelMapping_r7, DL_LogicalChannelMapping_r7_sequence);
return offset;
}
@ -51480,8 +51465,8 @@ dissect_rrc_NAS_Message(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_,
1, 4095, FALSE, &nas_message_tvb);
if (nas_message_tvb)
call_dissector(gsm_a_dtap_handle,nas_message_tvb,actx->pinfo, tree);
if (nas_message_tvb)
call_dissector(gsm_a_dtap_handle,nas_message_tvb,actx->pinfo, tree);
@ -51623,8 +51608,8 @@ dissect_rrc_T_single_GSM_Message_r3(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_
gsm_message_tvb = tvb_new_octet_aligned(tvb, offset, 8*whole_octets_remaining);
if (gsm_message_tvb) {
add_new_data_source(actx->pinfo,gsm_message_tvb,"GSM Message(aligned)");
call_dissector(gsm_a_dtap_handle,gsm_message_tvb,actx->pinfo, tree);
add_new_data_source(actx->pinfo,gsm_message_tvb,"GSM Message(aligned)");
call_dissector(gsm_a_dtap_handle,gsm_message_tvb,actx->pinfo, tree);
}
@ -51643,7 +51628,7 @@ dissect_rrc_GSM_MessageList_item(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *
if (gsm_messagelist_tvb)
call_dissector(gsm_a_dtap_handle,gsm_messagelist_tvb,actx->pinfo, tree);
call_dissector(gsm_a_dtap_handle,gsm_messagelist_tvb,actx->pinfo, tree);
@ -51909,8 +51894,8 @@ dissect_rrc_T_single_GSM_Message_r6(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_
gsm_message_tvb = tvb_new_octet_aligned(tvb, offset, 8*whole_octets_remaining);
if (gsm_message_tvb) {
add_new_data_source(actx->pinfo,gsm_message_tvb,"GSM Message(aligned)");
call_dissector(gsm_a_dtap_handle,gsm_message_tvb,actx->pinfo, tree);
add_new_data_source(actx->pinfo,gsm_message_tvb,"GSM Message(aligned)");
call_dissector(gsm_a_dtap_handle,gsm_message_tvb,actx->pinfo, tree);
}
@ -80099,7 +80084,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 859 "../../asn1/rrc/rrc.cnf"
#line 847 "../../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);
@ -80129,62 +80114,62 @@ dissect_rrc_DL_DCCH_Message(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx
static int
dissect_rrc_START_Value(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
#line 773 "../../asn1/rrc/rrc.cnf"
fp_info *fpinf;
rrc_ciphering_info * c_inf;
int i;
guint32 * start;
#line 761 "../../asn1/rrc/rrc.cnf"
fp_info *fpinf;
rrc_ciphering_info * c_inf;
int i;
guint32 * start;
offset = dissect_per_bit_string(tvb, offset, actx, tree, hf_index,
offset = dissect_per_bit_string(tvb, offset, actx, tree, hf_index,
20, 20, FALSE, &start_val);
/*We base this map on comuncation context from fp*/
fpinf = p_get_proto_data(actx->pinfo->fd, proto_fp);
/*We base this map on communication context from fp*/
fpinf = p_get_proto_data(actx->pinfo->fd, proto_fp);
/*If no info found, skip all this*/
if(fpinf == NULL){
return offset;
}
/*Retrieves the start value for the two ciphering domains*/
switch(rrc_nas_sys_info_gsm_map_type){
case RRC_NAS_SYS_INFO_CS:
/*
g_warning("Not implemented");
*/
break;
case RRC_NAS_SYS_INFO_PS:
/*If no info found, skip all this*/
if(fpinf == NULL){
return offset;
}
/*Retrieve the start value for the two ciphering domains*/
switch(rrc_nas_sys_info_gsm_map_type){
case RRC_NAS_SYS_INFO_CS:
/*
g_warning("Not implemented");
*/
break;
case RRC_NAS_SYS_INFO_PS:
/*Find the entry for the comucnation context (taken from FP)*/
if( (c_inf = g_tree_lookup(rrc_ciph_inf, GINT_TO_POINTER((gint)fpinf->com_context_id))) == NULL ){
c_inf = g_malloc0(sizeof(rrc_ciphering_info));
/*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 ){
c_inf = g_malloc0(sizeof(rrc_ciphering_info));
/*Initaite tree with START_PS values.*/
if(!c_inf->start_ps)
c_inf->start_ps = g_tree_new_full(rrc_key_cmp,
NULL,rrc_free_key,rrc_free_value);
/*Initiate tree with START_PS values.*/
if(!c_inf->start_ps)
c_inf->start_ps = g_tree_new_full(rrc_key_cmp,
NULL,rrc_free_key,rrc_free_value);
/*Clear and intiliaze seq_no matrix*/
for(i = 0; i< 31; i++){
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);
}
/*Clear and initialize seq_no matrix*/
for(i = 0; i< 31; i++){
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);
}
/*Retrive and store the value*/
start = g_malloc(sizeof(guint32));
*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);
/*Retrieve and store the value*/
start = g_malloc(sizeof(guint32));
*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);
break;
default:
break;
}
/*is this dangerous?*/
rrc_nas_sys_info_gsm_map_type = 0;
break;
default:
break;
}
/*is this dangerous?*/
rrc_nas_sys_info_gsm_map_type = RRC_NAS_SYS_INFO_CN_COMMON;
@ -88318,13 +88303,13 @@ dissect_rrc_UE_RadioAccessCapability(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx
static int
dissect_rrc_GSM_Classmark2(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
#line 550 "../../asn1/rrc/rrc.cnf"
tvbuff_t *parameter_tvb=NULL;
tvbuff_t *parameter_tvb=NULL;
offset = dissect_per_octet_string(tvb, offset, actx, tree, hf_index,
5, 5, FALSE, &parameter_tvb);
if (parameter_tvb){
de_ms_cm_2(parameter_tvb, tree, actx->pinfo, 2, tvb_get_guint8(parameter_tvb,1), NULL, 0);
de_ms_cm_2(parameter_tvb, tree, actx->pinfo, 2, tvb_get_guint8(parameter_tvb,1), NULL, 0);
}
@ -88337,13 +88322,13 @@ tvbuff_t *parameter_tvb=NULL;
static int
dissect_rrc_GSM_Classmark3(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
#line 558 "../../asn1/rrc/rrc.cnf"
tvbuff_t *parameter_tvb=NULL;
tvbuff_t *parameter_tvb=NULL;
offset = dissect_per_octet_string(tvb, offset, actx, tree, hf_index,
1, 32, FALSE, &parameter_tvb);
if (parameter_tvb){
de_ms_cm_3(parameter_tvb, tree, actx->pinfo, 0, tvb_length(parameter_tvb), NULL, 0);
de_ms_cm_3(parameter_tvb, tree, actx->pinfo, 0, tvb_length(parameter_tvb), NULL, 0);
}
@ -90047,10 +90032,10 @@ fp_info *fpinf ;
ett_rrc_SecurityModeComplete, SecurityModeComplete_sequence);
fpinf = p_get_proto_data(actx->pinfo->fd, proto_fp);
if( (c_inf = g_tree_lookup(rrc_ciph_inf, GINT_TO_POINTER((gint)fpinf->com_context_id))) != NULL ){
c_inf->setup_frame = actx->pinfo->fd->num;
}
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) ){
c_inf->setup_frame = actx->pinfo->fd->num;
}
@ -94243,14 +94228,14 @@ static const per_sequence_t SRB_InformationSetupList2_r6_sequence_of[1] = {
static int
dissect_rrc_SRB_InformationSetupList2_r6(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
#line 764 "../../asn1/rrc/rrc.cnf"
#line 752 "../../asn1/rrc/rrc.cnf"
offset = dissect_per_constrained_sequence_of(tvb, offset, actx, tree, hf_index,
offset = dissect_per_constrained_sequence_of(tvb, offset, actx, tree, hf_index,
ett_rrc_SRB_InformationSetupList2_r6, SRB_InformationSetupList2_r6_sequence_of,
3, 4, FALSE);
/*Clear memory*/
memset(num_chans_per_flow,0,sizeof(guint8));
/*Clear memory*/
memset(num_chans_per_flow,0,sizeof(guint8));
@ -105078,8 +105063,8 @@ dissect_rrc_T_present(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, p
0, 63, FALSE, &ue_radio_access_cap_info_tvb);
if (ue_radio_access_cap_info_tvb)
call_dissector(rrc_ue_radio_access_cap_info_handle,ue_radio_access_cap_info_tvb,actx->pinfo, tree);
if (ue_radio_access_cap_info_tvb)
call_dissector(rrc_ue_radio_access_cap_info_handle,ue_radio_access_cap_info_tvb,actx->pinfo, tree);
@ -125682,13 +125667,13 @@ dissect_rrc_UE_HistoryInformation(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t
static int
dissect_rrc_T_interRATHandoverInfo(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
#line 566 "../../asn1/rrc/rrc.cnf"
tvbuff_t *parameter_tvb=NULL;
tvbuff_t *parameter_tvb=NULL;
offset = dissect_per_octet_string(tvb, offset, actx, tree, hf_index,
0, 255, FALSE, &parameter_tvb);
if (parameter_tvb){
dissect_rrc_InterRATHandoverInfo_PDU(parameter_tvb, actx->pinfo, tree);
dissect_rrc_InterRATHandoverInfo_PDU(parameter_tvb, actx->pinfo, tree);
}
@ -130357,8 +130342,8 @@ dissect_rrc_T_dL_DCCHmessage(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx
NO_BOUND, NO_BOUND, FALSE, &dl_dcch_message_tvb);
if (dl_dcch_message_tvb)
call_dissector(rrc_dl_dcch_handle,dl_dcch_message_tvb,actx->pinfo, proto_tree_get_root(tree));
if (dl_dcch_message_tvb)
call_dissector(rrc_dl_dcch_handle,dl_dcch_message_tvb,actx->pinfo, proto_tree_get_root(tree));
@ -131110,68 +131095,68 @@ static int dissect_MeasurementReport_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _
static void
dissect_rrc(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
{
/* FIX ME Currently don't know the 'starting point' of this protocol
* exported DL-DCCH-Message is the entry point.
*/
proto_item *rrc_item = NULL;
proto_tree *rrc_tree = NULL;
struct rrc_info *rrcinf;
/* FIX ME Currently don't know the 'starting point' of this protocol
* exported DL-DCCH-Message is the entry point.
*/
proto_item *rrc_item = NULL;
proto_tree *rrc_tree = NULL;
struct rrc_info *rrcinf;
top_tree = tree;
rrcinf = p_get_proto_data(pinfo->fd, proto_rrc);
top_tree = tree;
rrcinf = p_get_proto_data(pinfo->fd, proto_rrc);
/* make entry in the Protocol column on summary display */
col_set_str(pinfo->cinfo, COL_PROTOCOL, "RRC");
/* make entry in the Protocol column on summary display */
col_set_str(pinfo->cinfo, COL_PROTOCOL, "RRC");
/* create the rrc protocol tree */
rrc_item = proto_tree_add_item(tree, proto_rrc, tvb, 0, -1, ENC_NA);
rrc_tree = proto_item_add_subtree(rrc_item, ett_rrc);
/* create the rrc protocol tree */
rrc_item = proto_tree_add_item(tree, proto_rrc, tvb, 0, -1, ENC_NA);
rrc_tree = proto_item_add_subtree(rrc_item, ett_rrc);
if (rrcinf) {
switch (rrcinf->msgtype[pinfo->fd->subnum]) {
case RRC_MESSAGE_TYPE_PCCH:
call_dissector(rrc_pcch_handle, tvb, pinfo, rrc_tree);
break;
case RRC_MESSAGE_TYPE_UL_CCCH:
call_dissector(rrc_ul_ccch_handle, tvb, pinfo, rrc_tree);
break;
case RRC_MESSAGE_TYPE_DL_CCCH:
call_dissector(rrc_dl_ccch_handle, tvb, pinfo, rrc_tree);
break;
case RRC_MESSAGE_TYPE_UL_DCCH:
call_dissector(rrc_ul_dcch_handle, tvb, pinfo, rrc_tree);
break;
case RRC_MESSAGE_TYPE_DL_DCCH:
call_dissector(rrc_dl_dcch_handle, tvb, pinfo, rrc_tree);
break;
case RRC_MESSAGE_TYPE_BCCH_FACH:
call_dissector(rrc_bcch_fach_handle, tvb, pinfo, rrc_tree);
break;
default:
;
}
}
if (rrcinf) {
switch (rrcinf->msgtype[pinfo->fd->subnum]) {
case RRC_MESSAGE_TYPE_PCCH:
call_dissector(rrc_pcch_handle, tvb, pinfo, rrc_tree);
break;
case RRC_MESSAGE_TYPE_UL_CCCH:
call_dissector(rrc_ul_ccch_handle, tvb, pinfo, rrc_tree);
break;
case RRC_MESSAGE_TYPE_DL_CCCH:
call_dissector(rrc_dl_ccch_handle, tvb, pinfo, rrc_tree);
break;
case RRC_MESSAGE_TYPE_UL_DCCH:
call_dissector(rrc_ul_dcch_handle, tvb, pinfo, rrc_tree);
break;
case RRC_MESSAGE_TYPE_DL_DCCH:
call_dissector(rrc_dl_dcch_handle, tvb, pinfo, rrc_tree);
break;
case RRC_MESSAGE_TYPE_BCCH_FACH:
call_dissector(rrc_bcch_fach_handle, tvb, pinfo, rrc_tree);
break;
default:
;
}
}
}
void rrc_init(void){
/*Cleanup*/
if(hsdsch_muxed_flows){
g_tree_destroy(hsdsch_muxed_flows);
}
if(rrc_ciph_inf){
g_tree_destroy(rrc_ciph_inf);
}
/*Initialize structure for muxed flow indication*/
hsdsch_muxed_flows = g_tree_new_full(rrc_key_cmp,
/*Cleanup*/
if(hsdsch_muxed_flows){
g_tree_destroy(hsdsch_muxed_flows);
}
if(rrc_ciph_inf){
g_tree_destroy(rrc_ciph_inf);
}
/*Initialize structure for muxed flow indication*/
hsdsch_muxed_flows = g_tree_new_full(rrc_key_cmp,
NULL, /* data pointer, optional */
rrc_free_key,
rrc_free_value);
/*Initialize structure for muxed flow indication*/
rrc_ciph_inf = g_tree_new_full(rrc_key_cmp,
/*Initialize structure for muxed flow indication*/
rrc_ciph_inf = g_tree_new_full(rrc_key_cmp,
NULL, /* data pointer, optional */
NULL,
rrc_free_value);
@ -172318,7 +172303,7 @@ void proto_register_rrc(void) {
/*--- End of included file: packet-rrc-ettarr.c ---*/
#line 290 "../../asn1/rrc/packet-rrc-template.c"
&ett_rrc_eutraFeatureGroupIndicators,
&ett_rrc_cn_CommonGSM_MAP_NAS_SysInfo,
&ett_rrc_cn_CommonGSM_MAP_NAS_SysInfo,
};
@ -172401,7 +172386,7 @@ void proto_register_rrc(void) {
register_init_routine(rrc_init);
register_init_routine(rrc_init);
}

View File

@ -33,7 +33,7 @@
#ifndef PACKET_RRC_H
#define PACKET_RRC_H
#include <epan/asn1.h> /* Needed for non asn1 dissectors?*/
#include <epan/asn1.h> /* Needed for non asn1 dissectors?*/
extern int proto_rrc;
@ -55,32 +55,32 @@ int dissect_rrc_TargetRNC_ToSourceRNC_Container_PDU(tvbuff_t *tvb _U_, packet_in
#line 32 "../../asn1/rrc/packet-rrc-template.h"
enum rrc_message_type {
RRC_MESSAGE_TYPE_INVALID = 0,
RRC_MESSAGE_TYPE_PCCH = 1,
RRC_MESSAGE_TYPE_UL_CCCH,
RRC_MESSAGE_TYPE_DL_CCCH,
RRC_MESSAGE_TYPE_UL_DCCH,
RRC_MESSAGE_TYPE_DL_DCCH,
RRC_MESSAGE_TYPE_BCCH_FACH
RRC_MESSAGE_TYPE_INVALID = 0,
RRC_MESSAGE_TYPE_PCCH = 1,
RRC_MESSAGE_TYPE_UL_CCCH,
RRC_MESSAGE_TYPE_DL_CCCH,
RRC_MESSAGE_TYPE_UL_DCCH,
RRC_MESSAGE_TYPE_DL_DCCH,
RRC_MESSAGE_TYPE_BCCH_FACH
};
#define MAX_RRC_FRAMES 64
#define MAX_RRC_FRAMES 64
typedef struct rrc_info
{
enum rrc_message_type msgtype[MAX_RRC_FRAMES];
enum rrc_message_type msgtype[MAX_RRC_FRAMES];
} rrc_info;
/*Struct for storing ciphering information*/
typedef struct rrc_ciph_info_
{
int seq_no[31][2]; /*Indicates for each Rbid when ciphering starts*/
GTree * /*guint32*/ start_cs; /*Start value for CS counter*/
GTree * /*guint32*/ start_ps; /*Start value for PS counter*/
guint32 conf_algo_indicator; /*Indicates which type of ciphering algorithm used*/
guint32 int_algo_indiccator; /*Indicates which type of integrity algorithm used*/
unsigned int setup_frame; /*Store which frame contained this information*/
guint32 ps_conf_counters[31][2]; /*This should also be made for CS*/
int seq_no[31][2]; /*Indicates for each Rbid when ciphering starts*/
GTree * /*guint32*/ start_cs; /*Start value for CS counter*/
GTree * /*guint32*/ start_ps; /*Start value for PS counter*/
guint32 conf_algo_indicator; /*Indicates which type of ciphering algorithm used*/
guint32 int_algo_indiccator; /*Indicates which type of integrity algorithm used*/
unsigned int setup_frame; /*Store which frame contained this information*/
guint32 ps_conf_counters[31][2]; /*This should also be made for CS*/
} rrc_ciphering_info;
extern GTree * hsdsch_muxed_flows;