UMTS RLC: Mark ciphered frames

- Updated RRC dissector to always collect ciphering sequence numbers
from Security Mode Command/ Security Mode Complete
- Updated RLC dissector to seek the collected info when deciding if
the frame is ciphered

Change-Id: I44bc61736968ef9f420782048e15ba27d6c6267f
Reviewed-on: https://code.wireshark.org/review/23132
Petri-Dish: Pascal Quantin <pascal.quantin@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
This commit is contained in:
Darien Spencer 2017-08-19 17:33:14 +03:00 committed by Pascal Quantin
parent ba95723473
commit bdf10a239f
6 changed files with 533 additions and 271 deletions

View File

@ -64,7 +64,7 @@ extern int proto_umts_mac; /*Handler to MAC*/
extern int proto_umts_rlc; /*Handler to RLC*/
GTree * hsdsch_muxed_flows = NULL;
GTree * rrc_ciph_inf = NULL;
GTree * rrc_ciph_info_tree = NULL;
GTree * rrc_scrambling_code_urnti = NULL;
wmem_tree_t* rrc_rach_urnti_crnti_map = NULL;
static int msg_type _U_;
@ -90,6 +90,9 @@ typedef struct umts_rrc_private_data_t
guint32 current_u_rnti;
guint32 scrambling_code;
enum nas_sys_info_gsm_map cn_domain;
guint32 rbid;
guint32 rlc_ciphering_sqn; /* Sequence number where ciphering starts in a given bearer */
rrc_ciphering_info* ciphering_info;
} umts_rrc_private_data_t;
@ -108,74 +111,110 @@ static umts_rrc_private_data_t* umts_rrc_get_private_data(asn1_ctx_t *actx)
static guint32 private_data_get_s_rnc_id(asn1_ctx_t *actx)
{
umts_rrc_private_data_t *private_data = (umts_rrc_private_data_t*)umts_rrc_get_private_data(actx);
return private_data->s_rnc_id;
umts_rrc_private_data_t *private_data = (umts_rrc_private_data_t*)umts_rrc_get_private_data(actx);
return private_data->s_rnc_id;
}
static void private_data_set_s_rnc_id(asn1_ctx_t *actx, guint32 s_rnc_id)
{
umts_rrc_private_data_t *private_data = (umts_rrc_private_data_t*)umts_rrc_get_private_data(actx);
private_data->s_rnc_id = s_rnc_id;
umts_rrc_private_data_t *private_data = (umts_rrc_private_data_t*)umts_rrc_get_private_data(actx);
private_data->s_rnc_id = s_rnc_id;
}
static guint32 private_data_get_s_rnti(asn1_ctx_t *actx)
{
umts_rrc_private_data_t *private_data = (umts_rrc_private_data_t*)umts_rrc_get_private_data(actx);
return private_data->s_rnti;
umts_rrc_private_data_t *private_data = (umts_rrc_private_data_t*)umts_rrc_get_private_data(actx);
return private_data->s_rnti;
}
static void private_data_set_s_rnti(asn1_ctx_t *actx, guint32 s_rnti)
{
umts_rrc_private_data_t *private_data = (umts_rrc_private_data_t*)umts_rrc_get_private_data(actx);
private_data->s_rnti = s_rnti;
umts_rrc_private_data_t *private_data = (umts_rrc_private_data_t*)umts_rrc_get_private_data(actx);
private_data->s_rnti = s_rnti;
}
static guint32 private_data_get_new_u_rnti(asn1_ctx_t *actx)
{
umts_rrc_private_data_t *private_data = (umts_rrc_private_data_t*)umts_rrc_get_private_data(actx);
return private_data->new_u_rnti;
umts_rrc_private_data_t *private_data = (umts_rrc_private_data_t*)umts_rrc_get_private_data(actx);
return private_data->new_u_rnti;
}
static void private_data_set_new_u_rnti(asn1_ctx_t *actx, guint32 new_u_rnti)
{
umts_rrc_private_data_t *private_data = (umts_rrc_private_data_t*)umts_rrc_get_private_data(actx);
private_data->new_u_rnti = new_u_rnti;
umts_rrc_private_data_t *private_data = (umts_rrc_private_data_t*)umts_rrc_get_private_data(actx);
private_data->new_u_rnti = new_u_rnti;
}
static guint32 private_data_get_current_u_rnti(asn1_ctx_t *actx)
{
umts_rrc_private_data_t *private_data = (umts_rrc_private_data_t*)umts_rrc_get_private_data(actx);
return private_data->current_u_rnti;
umts_rrc_private_data_t *private_data = (umts_rrc_private_data_t*)umts_rrc_get_private_data(actx);
return private_data->current_u_rnti;
}
static void private_data_set_current_u_rnti(asn1_ctx_t *actx, guint32 current_u_rnti)
{
umts_rrc_private_data_t *private_data = (umts_rrc_private_data_t*)umts_rrc_get_private_data(actx);
private_data->current_u_rnti = current_u_rnti;
umts_rrc_private_data_t *private_data = (umts_rrc_private_data_t*)umts_rrc_get_private_data(actx);
private_data->current_u_rnti = current_u_rnti;
}
static guint32 private_data_get_scrambling_code(asn1_ctx_t *actx)
{
umts_rrc_private_data_t *private_data = (umts_rrc_private_data_t*)umts_rrc_get_private_data(actx);
return private_data->scrambling_code;
umts_rrc_private_data_t *private_data = (umts_rrc_private_data_t*)umts_rrc_get_private_data(actx);
return private_data->scrambling_code;
}
static void private_data_set_scrambling_code(asn1_ctx_t *actx, guint32 scrambling_code)
{
umts_rrc_private_data_t *private_data = (umts_rrc_private_data_t*)umts_rrc_get_private_data(actx);
private_data->scrambling_code = scrambling_code;
umts_rrc_private_data_t *private_data = (umts_rrc_private_data_t*)umts_rrc_get_private_data(actx);
private_data->scrambling_code = scrambling_code;
}
static enum nas_sys_info_gsm_map private_data_get_cn_domain(asn1_ctx_t *actx)
{
umts_rrc_private_data_t *private_data = (umts_rrc_private_data_t*)umts_rrc_get_private_data(actx);
return private_data->cn_domain;
umts_rrc_private_data_t *private_data = (umts_rrc_private_data_t*)umts_rrc_get_private_data(actx);
return private_data->cn_domain;
}
static void private_data_set_cn_domain(asn1_ctx_t *actx, enum nas_sys_info_gsm_map cn_domain)
{
umts_rrc_private_data_t *private_data = (umts_rrc_private_data_t*)umts_rrc_get_private_data(actx);
private_data->cn_domain = cn_domain;
umts_rrc_private_data_t *private_data = (umts_rrc_private_data_t*)umts_rrc_get_private_data(actx);
private_data->cn_domain = cn_domain;
}
static guint32 private_data_get_rbid(asn1_ctx_t *actx)
{
umts_rrc_private_data_t *private_data = (umts_rrc_private_data_t*)umts_rrc_get_private_data(actx);
return private_data->rbid;
}
static void private_data_set_rbid(asn1_ctx_t *actx, guint32 rbid)
{
umts_rrc_private_data_t *private_data = (umts_rrc_private_data_t*)umts_rrc_get_private_data(actx);
private_data->rbid = rbid;
}
static guint32 private_data_get_rlc_ciphering_sqn(asn1_ctx_t *actx)
{
umts_rrc_private_data_t *private_data = (umts_rrc_private_data_t*)umts_rrc_get_private_data(actx);
return private_data->rlc_ciphering_sqn;
}
static void private_data_set_rlc_ciphering_sqn(asn1_ctx_t *actx, guint32 rlc_ciphering_sqn)
{
umts_rrc_private_data_t *private_data = (umts_rrc_private_data_t*)umts_rrc_get_private_data(actx);
private_data->rlc_ciphering_sqn = rlc_ciphering_sqn;
}
static rrc_ciphering_info* private_data_get_ciphering_info(asn1_ctx_t *actx)
{
umts_rrc_private_data_t *private_data = (umts_rrc_private_data_t*)umts_rrc_get_private_data(actx);
return private_data->ciphering_info;
}
static void private_data_set_ciphering_info(asn1_ctx_t *actx, rrc_ciphering_info* ciphering_info)
{
umts_rrc_private_data_t *private_data = (umts_rrc_private_data_t*)umts_rrc_get_private_data(actx);
private_data->ciphering_info = ciphering_info;
}
/*****************************************************************************/
@ -265,9 +304,6 @@ static int flowd,type;
/*Stores how many channels we have detected for a HS-DSCH MAC-flow*/
#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 counter, useful for initiating counters
@ -276,14 +312,14 @@ static int activation_frame;
static int get_max_counter(int com_context){
int i;
guint32 max = 0;
rrc_ciphering_info * c_inf;
rrc_ciphering_info * ciphering_info;
if( (c_inf = g_tree_lookup(rrc_ciph_inf, GINT_TO_POINTER((gint)com_context))) == NULL ){
if( (ciphering_info = g_tree_lookup(rrc_ciph_info_tree, 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);
max = MAX(ciphering_info->ps_conf_counters[i][0], max);
max = MAX(ciphering_info->ps_conf_counters[i][1], max);
}
return max;
}
@ -304,8 +340,35 @@ static void rrc_free_key(gpointer key _U_){
static void rrc_free_value(gpointer value ){
g_free(value);
}
#include "packet-rrc-fn.c"
static rrc_ciphering_info*
get_or_create_cipher_info(fp_info *fpinf, rlc_info *rlcinf) {
rrc_ciphering_info *cipher_info = NULL;
guint32 ueid;
int i;
ueid = rlcinf->ueid[fpinf->cur_tb];
cipher_info = (rrc_ciphering_info *)g_tree_lookup(rrc_ciph_info_tree, GINT_TO_POINTER((gint)ueid));
if( cipher_info == NULL ){
cipher_info = g_new0(rrc_ciphering_info,1);
/*Initiate tree with START_PS values.*/
if(!cipher_info->start_ps)
cipher_info->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++){
cipher_info->seq_no[i][0] = -1;
cipher_info->seq_no[i][1] = -1;
}
g_tree_insert(rrc_ciph_info_tree, GINT_TO_POINTER((gint)rlcinf->ueid[fpinf->cur_tb]), cipher_info);
}
return cipher_info;
}
#include "packet-rrc-fn.c"
static int
@ -366,7 +429,7 @@ rrc_init(void) {
rrc_free_key,
rrc_free_value);
rrc_ciph_inf = g_tree_new_full(rrc_key_cmp,
rrc_ciph_info_tree = g_tree_new_full(rrc_key_cmp,
NULL, /* data pointer, optional */
NULL,
rrc_free_value);
@ -385,7 +448,8 @@ static void
rrc_cleanup(void) {
/*Cleanup*/
g_tree_destroy(hsdsch_muxed_flows);
g_tree_destroy(rrc_ciph_inf);
g_tree_destroy(rrc_ciph_info_tree);
g_tree_destroy(rrc_scrambling_code_urnti);
}
/*--- proto_register_rrc -------------------------------------------*/

View File

@ -46,20 +46,20 @@ typedef struct rrc_info
} rrc_info;
/*Struct for storing ciphering information*/
typedef struct rrc_ciph_info_
typedef struct rrc_ciphering_info
{
int seq_no[31][2]; /*Indicates for each Rbid when ciphering starts*/
int seq_no[31][2]; /*Indicates for each Rbid when ciphering starts - Indexers are [BearerID][Direction]*/
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 setup_frame[2]; /*Store which frame contained this information - Indexer is [Direction]*/
guint32 ps_conf_counters[31][2]; /*This should also be made for CS*/
} rrc_ciphering_info;
extern GTree * hsdsch_muxed_flows;
extern GTree * rrc_ciph_inf;
extern GTree * rrc_ciph_info_tree;
extern GTree * rrc_scrambling_code_urnti;
extern wmem_tree_t* rrc_rach_urnti_crnti_map;

View File

@ -417,20 +417,46 @@ HandoverFromUTRANCommand-GSM-r6-IEs/gsm-message/single-GSM-Message single-GSM-Me
%(DEFAULT_BODY)s
#.FN_BODY SecurityModeCommand
fp_info *fpinf;
rlc_info *rlcinf;
rrc_ciphering_info *ciphering_info = NULL;
guint8 direction;
col_append_str(actx->pinfo->cinfo, COL_INFO, "SecurityModeCommand");
%(DEFAULT_BODY)s
#.FN_BODY SecurityModeComplete
rrc_ciphering_info * c_inf ;
fp_info *fpinf ;
col_append_str(actx->pinfo->cinfo, COL_INFO, "SecurityModeComplete");
%(DEFAULT_BODY)s
fpinf = (fp_info *)p_get_proto_data(wmem_file_scope(), actx->pinfo, proto_fp, 0);
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->num;
rlcinf = (rlc_info *)p_get_proto_data(wmem_file_scope(), actx->pinfo, proto_umts_rlc, 0);
/*If FP info or RLC info is missing , skip all this*/
if(fpinf != NULL && rlcinf != NULL){
ciphering_info = get_or_create_cipher_info(fpinf, rlcinf);
private_data_set_ciphering_info(actx, ciphering_info);
}
%(DEFAULT_BODY)s
if( ciphering_info != NULL ){
direction = 0; /* Security Mode Command is from the RNC, direction is always downlink */
ciphering_info->setup_frame[direction] = actx->pinfo->num;
}
#.FN_BODY SecurityModeComplete
fp_info *fpinf;
rlc_info *rlcinf;
rrc_ciphering_info *ciphering_info = NULL;
guint8 direction;
col_append_str(actx->pinfo->cinfo, COL_INFO, "SecurityModeComplete");
fpinf = (fp_info *)p_get_proto_data(wmem_file_scope(), actx->pinfo, proto_fp, 0);
rlcinf = (rlc_info *)p_get_proto_data(wmem_file_scope(), actx->pinfo, proto_umts_rlc, 0);
/*If FP info or RLC info is missing , skip all this*/
if(fpinf != NULL || rlcinf != NULL){
ciphering_info = get_or_create_cipher_info(fpinf, rlcinf);
private_data_set_ciphering_info(actx, ciphering_info);
}
%(DEFAULT_BODY)s
if( ciphering_info != NULL ){
direction = 1; /* Security Mode Complete is from the UE, direction is always uplink */
ciphering_info->setup_frame[direction] = actx->pinfo->num;
}
@ -978,18 +1004,19 @@ private_data_set_scrambling_code(actx,scrambling_code);
#.FN_BODY START-Value VAL_PTR = &start_val
tvbuff_t * start_val;
fp_info *fpinf;
rrc_ciphering_info * c_inf;
int i;
rlc_info *rlcinf;
rrc_ciphering_info * ciphering_info;
guint32 * start;
enum nas_sys_info_gsm_map cn_domain;
%(DEFAULT_BODY)s
/*We base this map on communication context from fp*/
fpinf = (fp_info *)p_get_proto_data(wmem_file_scope(), actx->pinfo, proto_fp, 0);
/*We base this map on User Identity from RLC*/
fpinf = (fp_info *)p_get_proto_data(wmem_file_scope(), actx->pinfo, proto_fp, 0);
rlcinf = (rlc_info *)p_get_proto_data(wmem_file_scope(), actx->pinfo, proto_umts_rlc, 0);
/*If no info found, skip all this*/
if(fpinf == NULL){
/*If FP info or RLC info is missing , skip all this*/
if(fpinf == NULL || rlcinf== NULL){
return offset;
}
/*Retrieve the start value for the two ciphering domains*/
@ -1002,29 +1029,16 @@ private_data_set_scrambling_code(actx,scrambling_code);
break;
case RRC_NAS_SYS_INFO_PS:
/*Find the entry for the communication context (taken from FP)*/
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)
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(fpinf->com_context_id), c_inf);
}
/*Find the entry for the UE ID(taken from RLC)*/
ciphering_info = get_or_create_cipher_info(fpinf, rlcinf);
private_data_set_ciphering_info(actx, ciphering_info);
/*Retrieve and store the value*/
start = g_new(guint32,1);
*start = tvb_get_bits32(start_val,0,20,ENC_BIG_ENDIAN);
if(c_inf && c_inf->start_ps)
if(ciphering_info && ciphering_info->start_ps)
/*Insert the value based on current frame num since this might vary over time*/
g_tree_insert(c_inf->start_ps, GUINT_TO_POINTER(actx->pinfo->num), start);
g_tree_insert(ciphering_info->start_ps, GUINT_TO_POINTER(actx->pinfo->num), start);
break;
default:
@ -1033,36 +1047,43 @@ private_data_set_scrambling_code(actx,scrambling_code);
private_data_set_cn_domain(actx, RRC_NAS_SYS_UNKNOWN);
#.FN_BODY RB-ActivationTimeInfo
fp_info *fpinf;
rrc_ciphering_info * c_inf;
fp_info *fpinf;
rlc_info *rlcinf;
rrc_ciphering_info *ciphering_info;
guint32 rbid;
guint32 rlc_ciphering_sqn;
fpinf = (fp_info *)p_get_proto_data(wmem_file_scope(), actx->pinfo, proto_fp, 0);
rlcinf = (rlc_info *)p_get_proto_data(wmem_file_scope(), actx->pinfo, proto_umts_rlc, 0);
%(DEFAULT_BODY)s
/*If no info found, skip all this*/
if(fpinf == NULL){
/*If FP info or RLC info is missing , skip all this*/
if(fpinf == NULL || rlcinf== NULL){
return offset;
}
/*This should not happen*/
if( (c_inf = (rrc_ciphering_info *)g_tree_lookup(rrc_ciph_inf, GINT_TO_POINTER(fpinf->com_context_id))) == NULL ){
ciphering_info = private_data_get_ciphering_info(actx);
if( ciphering_info == NULL ){
return offset;
}
rbid = private_data_get_rbid(actx);
rlc_ciphering_sqn = private_data_get_rlc_ciphering_sqn(actx);
/*Set the ciphering activation frame information*/
c_inf->seq_no[rbid][fpinf->is_uplink] = activation_frame;
ciphering_info->seq_no[rbid][fpinf->is_uplink] = rlc_ciphering_sqn;
#.FN_BODY RB-Identity VAL_PTR = &rbid
guint32 rbid;
%(DEFAULT_BODY)s
private_data_set_rbid(actx, rbid);
#.FN_BODY RLC-SequenceNumber VAL_PTR = &activation_frame
#.FN_BODY RLC-SequenceNumber VAL_PTR = &rlc_ciphering_sqn
guint32 rlc_ciphering_sqn;
%(DEFAULT_BODY)s
private_data_set_rlc_ciphering_sqn(actx, rlc_ciphering_sqn);
#.FN_BODY DL-DCCH-MessageType VAL_PTR = &msg_type
%(DEFAULT_BODY)s

View File

@ -72,7 +72,7 @@ extern int proto_umts_mac; /*Handler to MAC*/
extern int proto_umts_rlc; /*Handler to RLC*/
GTree * hsdsch_muxed_flows = NULL;
GTree * rrc_ciph_inf = NULL;
GTree * rrc_ciph_info_tree = NULL;
GTree * rrc_scrambling_code_urnti = NULL;
wmem_tree_t* rrc_rach_urnti_crnti_map = NULL;
static int msg_type _U_;
@ -98,6 +98,9 @@ typedef struct umts_rrc_private_data_t
guint32 current_u_rnti;
guint32 scrambling_code;
enum nas_sys_info_gsm_map cn_domain;
guint32 rbid;
guint32 rlc_ciphering_sqn; /* Sequence number where ciphering starts in a given bearer */
rrc_ciphering_info* ciphering_info;
} umts_rrc_private_data_t;
@ -116,74 +119,110 @@ static umts_rrc_private_data_t* umts_rrc_get_private_data(asn1_ctx_t *actx)
static guint32 private_data_get_s_rnc_id(asn1_ctx_t *actx)
{
umts_rrc_private_data_t *private_data = (umts_rrc_private_data_t*)umts_rrc_get_private_data(actx);
return private_data->s_rnc_id;
umts_rrc_private_data_t *private_data = (umts_rrc_private_data_t*)umts_rrc_get_private_data(actx);
return private_data->s_rnc_id;
}
static void private_data_set_s_rnc_id(asn1_ctx_t *actx, guint32 s_rnc_id)
{
umts_rrc_private_data_t *private_data = (umts_rrc_private_data_t*)umts_rrc_get_private_data(actx);
private_data->s_rnc_id = s_rnc_id;
umts_rrc_private_data_t *private_data = (umts_rrc_private_data_t*)umts_rrc_get_private_data(actx);
private_data->s_rnc_id = s_rnc_id;
}
static guint32 private_data_get_s_rnti(asn1_ctx_t *actx)
{
umts_rrc_private_data_t *private_data = (umts_rrc_private_data_t*)umts_rrc_get_private_data(actx);
return private_data->s_rnti;
umts_rrc_private_data_t *private_data = (umts_rrc_private_data_t*)umts_rrc_get_private_data(actx);
return private_data->s_rnti;
}
static void private_data_set_s_rnti(asn1_ctx_t *actx, guint32 s_rnti)
{
umts_rrc_private_data_t *private_data = (umts_rrc_private_data_t*)umts_rrc_get_private_data(actx);
private_data->s_rnti = s_rnti;
umts_rrc_private_data_t *private_data = (umts_rrc_private_data_t*)umts_rrc_get_private_data(actx);
private_data->s_rnti = s_rnti;
}
static guint32 private_data_get_new_u_rnti(asn1_ctx_t *actx)
{
umts_rrc_private_data_t *private_data = (umts_rrc_private_data_t*)umts_rrc_get_private_data(actx);
return private_data->new_u_rnti;
umts_rrc_private_data_t *private_data = (umts_rrc_private_data_t*)umts_rrc_get_private_data(actx);
return private_data->new_u_rnti;
}
static void private_data_set_new_u_rnti(asn1_ctx_t *actx, guint32 new_u_rnti)
{
umts_rrc_private_data_t *private_data = (umts_rrc_private_data_t*)umts_rrc_get_private_data(actx);
private_data->new_u_rnti = new_u_rnti;
umts_rrc_private_data_t *private_data = (umts_rrc_private_data_t*)umts_rrc_get_private_data(actx);
private_data->new_u_rnti = new_u_rnti;
}
static guint32 private_data_get_current_u_rnti(asn1_ctx_t *actx)
{
umts_rrc_private_data_t *private_data = (umts_rrc_private_data_t*)umts_rrc_get_private_data(actx);
return private_data->current_u_rnti;
umts_rrc_private_data_t *private_data = (umts_rrc_private_data_t*)umts_rrc_get_private_data(actx);
return private_data->current_u_rnti;
}
static void private_data_set_current_u_rnti(asn1_ctx_t *actx, guint32 current_u_rnti)
{
umts_rrc_private_data_t *private_data = (umts_rrc_private_data_t*)umts_rrc_get_private_data(actx);
private_data->current_u_rnti = current_u_rnti;
umts_rrc_private_data_t *private_data = (umts_rrc_private_data_t*)umts_rrc_get_private_data(actx);
private_data->current_u_rnti = current_u_rnti;
}
static guint32 private_data_get_scrambling_code(asn1_ctx_t *actx)
{
umts_rrc_private_data_t *private_data = (umts_rrc_private_data_t*)umts_rrc_get_private_data(actx);
return private_data->scrambling_code;
umts_rrc_private_data_t *private_data = (umts_rrc_private_data_t*)umts_rrc_get_private_data(actx);
return private_data->scrambling_code;
}
static void private_data_set_scrambling_code(asn1_ctx_t *actx, guint32 scrambling_code)
{
umts_rrc_private_data_t *private_data = (umts_rrc_private_data_t*)umts_rrc_get_private_data(actx);
private_data->scrambling_code = scrambling_code;
umts_rrc_private_data_t *private_data = (umts_rrc_private_data_t*)umts_rrc_get_private_data(actx);
private_data->scrambling_code = scrambling_code;
}
static enum nas_sys_info_gsm_map private_data_get_cn_domain(asn1_ctx_t *actx)
{
umts_rrc_private_data_t *private_data = (umts_rrc_private_data_t*)umts_rrc_get_private_data(actx);
return private_data->cn_domain;
umts_rrc_private_data_t *private_data = (umts_rrc_private_data_t*)umts_rrc_get_private_data(actx);
return private_data->cn_domain;
}
static void private_data_set_cn_domain(asn1_ctx_t *actx, enum nas_sys_info_gsm_map cn_domain)
{
umts_rrc_private_data_t *private_data = (umts_rrc_private_data_t*)umts_rrc_get_private_data(actx);
private_data->cn_domain = cn_domain;
umts_rrc_private_data_t *private_data = (umts_rrc_private_data_t*)umts_rrc_get_private_data(actx);
private_data->cn_domain = cn_domain;
}
static guint32 private_data_get_rbid(asn1_ctx_t *actx)
{
umts_rrc_private_data_t *private_data = (umts_rrc_private_data_t*)umts_rrc_get_private_data(actx);
return private_data->rbid;
}
static void private_data_set_rbid(asn1_ctx_t *actx, guint32 rbid)
{
umts_rrc_private_data_t *private_data = (umts_rrc_private_data_t*)umts_rrc_get_private_data(actx);
private_data->rbid = rbid;
}
static guint32 private_data_get_rlc_ciphering_sqn(asn1_ctx_t *actx)
{
umts_rrc_private_data_t *private_data = (umts_rrc_private_data_t*)umts_rrc_get_private_data(actx);
return private_data->rlc_ciphering_sqn;
}
static void private_data_set_rlc_ciphering_sqn(asn1_ctx_t *actx, guint32 rlc_ciphering_sqn)
{
umts_rrc_private_data_t *private_data = (umts_rrc_private_data_t*)umts_rrc_get_private_data(actx);
private_data->rlc_ciphering_sqn = rlc_ciphering_sqn;
}
static rrc_ciphering_info* private_data_get_ciphering_info(asn1_ctx_t *actx)
{
umts_rrc_private_data_t *private_data = (umts_rrc_private_data_t*)umts_rrc_get_private_data(actx);
return private_data->ciphering_info;
}
static void private_data_set_ciphering_info(asn1_ctx_t *actx, rrc_ciphering_info* ciphering_info)
{
umts_rrc_private_data_t *private_data = (umts_rrc_private_data_t*)umts_rrc_get_private_data(actx);
private_data->ciphering_info = ciphering_info;
}
/*****************************************************************************/
@ -412,7 +451,7 @@ static int dissect_SysInfoType22_PDU(tvbuff_t *tvb, packet_info *pinfo, proto_tr
#define maxWLANs 64
/*--- End of included file: packet-rrc-val.h ---*/
#line 209 "./asn1/rrc/packet-rrc-template.c"
#line 248 "./asn1/rrc/packet-rrc-template.c"
/* Initialize the protocol and registered fields */
int proto_rrc = -1;
@ -11251,7 +11290,7 @@ static int hf_rrc_GsmSecurityCapability_a5_2 = -1;
static int hf_rrc_GsmSecurityCapability_a5_1 = -1;
/*--- End of included file: packet-rrc-hf.c ---*/
#line 214 "./asn1/rrc/packet-rrc-template.c"
#line 253 "./asn1/rrc/packet-rrc-template.c"
/* Initialize the subtree pointers */
static int ett_rrc = -1;
@ -18155,7 +18194,7 @@ static gint ett_rrc_UE_RadioAccessCapability_r6 = -1;
static gint ett_rrc_UL_RFC3095_Context = -1;
/*--- End of included file: packet-rrc-ett.c ---*/
#line 219 "./asn1/rrc/packet-rrc-template.c"
#line 258 "./asn1/rrc/packet-rrc-template.c"
static gint ett_rrc_eutraFeatureGroupIndicators = -1;
static gint ett_rrc_cn_CommonGSM_MAP_NAS_SysInfo = -1;
@ -18205,9 +18244,6 @@ static int flowd,type;
/*Stores how many channels we have detected for a HS-DSCH MAC-flow*/
#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 counter, useful for initiating counters
@ -18216,14 +18252,14 @@ static int activation_frame;
static int get_max_counter(int com_context){
int i;
guint32 max = 0;
rrc_ciphering_info * c_inf;
rrc_ciphering_info * ciphering_info;
if( (c_inf = g_tree_lookup(rrc_ciph_inf, GINT_TO_POINTER((gint)com_context))) == NULL ){
if( (ciphering_info = g_tree_lookup(rrc_ciph_info_tree, 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);
max = MAX(ciphering_info->ps_conf_counters[i][0], max);
max = MAX(ciphering_info->ps_conf_counters[i][1], max);
}
return max;
}
@ -18245,6 +18281,34 @@ static void rrc_free_value(gpointer value ){
g_free(value);
}
static rrc_ciphering_info*
get_or_create_cipher_info(fp_info *fpinf, rlc_info *rlcinf) {
rrc_ciphering_info *cipher_info = NULL;
guint32 ueid;
int i;
ueid = rlcinf->ueid[fpinf->cur_tb];
cipher_info = (rrc_ciphering_info *)g_tree_lookup(rrc_ciph_info_tree, GINT_TO_POINTER((gint)ueid));
if( cipher_info == NULL ){
cipher_info = g_new0(rrc_ciphering_info,1);
/*Initiate tree with START_PS values.*/
if(!cipher_info->start_ps)
cipher_info->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++){
cipher_info->seq_no[i][0] = -1;
cipher_info->seq_no[i][1] = -1;
}
g_tree_insert(rrc_ciph_info_tree, GINT_TO_POINTER((gint)rlcinf->ueid[fpinf->cur_tb]), cipher_info);
}
return cipher_info;
}
/*--- Included file: packet-rrc-fn.c ---*/
#line 1 "./asn1/rrc/packet-rrc-fn.c"
/*--- PDUs declarations ---*/
@ -18486,12 +18550,12 @@ 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 1058 "./asn1/rrc/rrc.cnf"
#line 1078 "./asn1/rrc/rrc.cnf"
guint32 rbid;
offset = dissect_per_constrained_integer(tvb, offset, actx, tree, hf_index,
1U, 32U, &rbid, FALSE);
private_data_set_rbid(actx, rbid);
@ -18503,11 +18567,12 @@ 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 1064 "./asn1/rrc/rrc.cnf"
#line 1084 "./asn1/rrc/rrc.cnf"
guint32 rlc_ciphering_sqn;
offset = dissect_per_constrained_integer(tvb, offset, actx, tree, hf_index,
0U, 4095U, &activation_frame, FALSE);
0U, 4095U, &rlc_ciphering_sqn, FALSE);
private_data_set_rlc_ciphering_sqn(actx, rlc_ciphering_sqn);
@ -18523,28 +18588,34 @@ 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 1036 "./asn1/rrc/rrc.cnf"
fp_info *fpinf;
rrc_ciphering_info * c_inf;
#line 1050 "./asn1/rrc/rrc.cnf"
fp_info *fpinf;
rlc_info *rlcinf;
rrc_ciphering_info *ciphering_info;
guint32 rbid;
guint32 rlc_ciphering_sqn;
fpinf = (fp_info *)p_get_proto_data(wmem_file_scope(), actx->pinfo, proto_fp, 0);
rlcinf = (rlc_info *)p_get_proto_data(wmem_file_scope(), actx->pinfo, proto_umts_rlc, 0);
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){
/*If FP info or RLC info is missing , skip all this*/
if(fpinf == NULL || rlcinf== NULL){
return offset;
}
/*This should not happen*/
if( (c_inf = (rrc_ciphering_info *)g_tree_lookup(rrc_ciph_inf, GINT_TO_POINTER(fpinf->com_context_id))) == NULL ){
ciphering_info = private_data_get_ciphering_info(actx);
if( ciphering_info == NULL ){
return offset;
}
rbid = private_data_get_rbid(actx);
rlc_ciphering_sqn = private_data_get_rlc_ciphering_sqn(actx);
/*Set the ciphering activation frame information*/
c_inf->seq_no[rbid][fpinf->is_uplink] = activation_frame;
ciphering_info->seq_no[rbid][fpinf->is_uplink] = rlc_ciphering_sqn;
@ -18586,7 +18657,7 @@ dissect_rrc_CipheringModeInfo(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *act
static int
dissect_rrc_SRNC_Identity(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
#line 765 "./asn1/rrc/rrc.cnf"
#line 791 "./asn1/rrc/rrc.cnf"
tvbuff_t * s_rnc_id_tvb = NULL;
offset = dissect_per_bit_string(tvb, offset, actx, tree, hf_index,
12, 12, FALSE, &s_rnc_id_tvb, NULL);
@ -18604,7 +18675,7 @@ dissect_rrc_SRNC_Identity(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U
static int
dissect_rrc_S_RNTI(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
#line 772 "./asn1/rrc/rrc.cnf"
#line 798 "./asn1/rrc/rrc.cnf"
tvbuff_t * s_rnti_tvb = NULL;
offset = dissect_per_bit_string(tvb, offset, actx, tree, hf_index,
20, 20, FALSE, &s_rnti_tvb, NULL);
@ -18627,7 +18698,7 @@ static const per_sequence_t U_RNTI_sequence[] = {
static int
dissect_rrc_U_RNTI(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
#line 779 "./asn1/rrc/rrc.cnf"
#line 805 "./asn1/rrc/rrc.cnf"
private_data_set_s_rnc_id(actx, 0);
private_data_set_s_rnti(actx, 0);
guint32 s_rnc_id;
@ -18716,7 +18787,7 @@ dissect_rrc_PLMN_Identity(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U
static int
dissect_rrc_NAS_SystemInformationGSM_MAP(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
#line 733 "./asn1/rrc/rrc.cnf"
#line 759 "./asn1/rrc/rrc.cnf"
tvbuff_t *nas_sys_info_gsm_map_tvb = NULL;
guint32 length;
enum nas_sys_info_gsm_map cn_domain;
@ -18759,7 +18830,7 @@ dissect_rrc_NAS_SystemInformationGSM_MAP(tvbuff_t *tvb _U_, int offset _U_, asn1
static int
dissect_rrc_T_cn_CommonGSM_MAP_NAS_SysInfo(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
#line 717 "./asn1/rrc/rrc.cnf"
#line 743 "./asn1/rrc/rrc.cnf"
private_data_set_cn_domain(actx, RRC_NAS_SYS_INFO_CN_COMMON);
offset = dissect_rrc_NAS_SystemInformationGSM_MAP(tvb, offset, actx, tree, hf_index);
@ -18779,7 +18850,7 @@ static const value_string rrc_CN_DomainIdentity_vals[] = {
static int
dissect_rrc_CN_DomainIdentity(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
#line 710 "./asn1/rrc/rrc.cnf"
#line 736 "./asn1/rrc/rrc.cnf"
guint32 nas_sys_info;
offset = dissect_per_enumerated(tvb, offset, actx, tree, hf_index,
2, &nas_sys_info, FALSE, 0, NULL);
@ -22438,7 +22509,7 @@ dissect_rrc_SSDT_UL(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, pro
static int
dissect_rrc_CellIdentity(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
#line 878 "./asn1/rrc/rrc.cnf"
#line 904 "./asn1/rrc/rrc.cnf"
tvbuff_t * cell_id_tvb = NULL;
proto_item *temp_ti;
proto_tree *cell_identity_tree;
@ -22663,7 +22734,7 @@ 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 966 "./asn1/rrc/rrc.cnf"
#line 992 "./asn1/rrc/rrc.cnf"
tvbuff_t *hrnti_tvb;
struct rrc_info *rrcinf;
offset = dissect_per_bit_string(tvb, offset, actx, tree, hf_index,
@ -22672,7 +22743,7 @@ dissect_rrc_H_RNTI(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, prot
#line 971 "./asn1/rrc/rrc.cnf"
#line 997 "./asn1/rrc/rrc.cnf"
rrcinf = (struct rrc_info *)p_get_proto_data(wmem_file_scope(), actx->pinfo, proto_rrc, 0);
if (!rrcinf) {
rrcinf = wmem_new0(wmem_file_scope(), struct rrc_info);
@ -22698,7 +22769,7 @@ dissect_rrc_E_RNTI(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, prot
static int
dissect_rrc_T_cn_CommonGSM_MAP_NAS_SysInfo_01(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
#line 721 "./asn1/rrc/rrc.cnf"
#line 747 "./asn1/rrc/rrc.cnf"
private_data_set_cn_domain(actx, RRC_NAS_SYS_INFO_CN_COMMON);
offset = dissect_rrc_NAS_SystemInformationGSM_MAP(tvb, offset, actx, tree, hf_index);
@ -28172,7 +28243,7 @@ dissect_rrc_ScramblingCodeType(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *ac
static int
dissect_rrc_UL_ScramblingCode(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
#line 873 "./asn1/rrc/rrc.cnf"
#line 899 "./asn1/rrc/rrc.cnf"
guint32 scrambling_code;
offset = dissect_per_constrained_integer(tvb, offset, actx, tree, hf_index,
0U, 16777215U, &scrambling_code, FALSE);
@ -38726,7 +38797,7 @@ dissect_rrc_CellChangeOrderFromUTRAN_r3_IEs(tvbuff_t *tvb _U_, int offset _U_, a
static int
dissect_rrc_GERAN_SystemInfoBlock(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
#line 581 "./asn1/rrc/rrc.cnf"
#line 607 "./asn1/rrc/rrc.cnf"
tvbuff_t *parameter_tvb=NULL;
offset = dissect_per_octet_string(tvb, offset, actx, tree, hf_index,
@ -38917,7 +38988,7 @@ dissect_rrc_CellChangeOrderFromUTRAN(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx
static int
dissect_rrc_C_RNTI(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
#line 804 "./asn1/rrc/rrc.cnf"
#line 830 "./asn1/rrc/rrc.cnf"
fp_info *fpinf = NULL;
umts_mac_info *macinf = NULL;
rlc_info *rlcinf = NULL;
@ -46025,7 +46096,7 @@ 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 963 "./asn1/rrc/rrc.cnf"
#line 989 "./asn1/rrc/rrc.cnf"
offset = dissect_per_constrained_integer(tvb, offset, actx, tree, hf_index,
0U, 7U, &flowd, FALSE);
@ -46073,7 +46144,7 @@ static const per_choice_t DL_TransportChannelType_r5_choice[] = {
static int
dissect_rrc_DL_TransportChannelType_r5(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
#line 892 "./asn1/rrc/rrc.cnf"
#line 918 "./asn1/rrc/rrc.cnf"
/*Here we try to figure out which HS-DSCH channels are multiplexed*/
guint *flowd_p;
guint *cur_val=NULL;
@ -49547,7 +49618,7 @@ static const per_choice_t DL_TransportChannelType_r7_choice[] = {
static int
dissect_rrc_DL_TransportChannelType_r7(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
#line 927 "./asn1/rrc/rrc.cnf"
#line 953 "./asn1/rrc/rrc.cnf"
/*Here we try to figure out which HS-DSCH channels are multiplexed*/
guint *flowd_p;
guint *cur_val=NULL;
@ -63696,7 +63767,7 @@ static const per_sequence_t T_single_GSM_Message_r3_sequence[] = {
static int
dissect_rrc_T_single_GSM_Message_r3(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"
#line 576 "./asn1/rrc/rrc.cnf"
tvbuff_t *gsm_message_tvb=NULL;
guint bits_remaining, whole_octets_remaining;
@ -63722,7 +63793,7 @@ dissect_rrc_T_single_GSM_Message_r3(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_
static int
dissect_rrc_GSM_MessageList_item(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
#line 542 "./asn1/rrc/rrc.cnf"
#line 568 "./asn1/rrc/rrc.cnf"
tvbuff_t *gsm_messagelist_tvb=NULL;
offset = dissect_per_bit_string(tvb, offset, actx, tree, hf_index,
@ -63982,7 +64053,7 @@ static const per_sequence_t T_single_GSM_Message_r6_sequence[] = {
static int
dissect_rrc_T_single_GSM_Message_r6(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
#line 565 "./asn1/rrc/rrc.cnf"
#line 591 "./asn1/rrc/rrc.cnf"
tvbuff_t *gsm_message_tvb=NULL;
guint bits_remaining, whole_octets_remaining;
@ -90125,7 +90196,7 @@ static const value_string rrc_ReleaseCause_vals[] = {
static int
dissect_rrc_ReleaseCause(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
#line 1085 "./asn1/rrc/rrc.cnf"
#line 1106 "./asn1/rrc/rrc.cnf"
guint32 value;
offset = dissect_per_enumerated(tvb, offset, actx, tree, hf_index,
8, &value, FALSE, 0, NULL);
@ -91135,11 +91206,28 @@ static const per_choice_t SecurityModeCommand_choice[] = {
static int
dissect_rrc_SecurityModeCommand(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
#line 420 "./asn1/rrc/rrc.cnf"
fp_info *fpinf;
rlc_info *rlcinf;
rrc_ciphering_info *ciphering_info = NULL;
guint8 direction;
col_append_str(actx->pinfo->cinfo, COL_INFO, "SecurityModeCommand");
fpinf = (fp_info *)p_get_proto_data(wmem_file_scope(), actx->pinfo, proto_fp, 0);
rlcinf = (rlc_info *)p_get_proto_data(wmem_file_scope(), actx->pinfo, proto_umts_rlc, 0);
/*If FP info or RLC info is missing , skip all this*/
if(fpinf != NULL && rlcinf != NULL){
ciphering_info = get_or_create_cipher_info(fpinf, rlcinf);
private_data_set_ciphering_info(actx, ciphering_info);
}
offset = dissect_per_choice(tvb, offset, actx, tree, hf_index,
ett_rrc_SecurityModeCommand, SecurityModeCommand_choice,
NULL);
if( ciphering_info != NULL ){
direction = 0; /* Security Mode Command is from the RNC, direction is always downlink */
ciphering_info->setup_frame[direction] = actx->pinfo->num;
}
@ -91276,7 +91364,7 @@ static const per_choice_t SignallingConnectionRelease_choice[] = {
static int
dissect_rrc_SignallingConnectionRelease(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
#line 442 "./asn1/rrc/rrc.cnf"
#line 468 "./asn1/rrc/rrc.cnf"
col_append_str(actx->pinfo->cinfo, COL_INFO, "SignallingConnectionRelease");
offset = dissect_per_choice(tvb, offset, actx, tree, hf_index,
ett_rrc_SignallingConnectionRelease, SignallingConnectionRelease_choice,
@ -93383,7 +93471,7 @@ static const per_choice_t TransportChannelReconfiguration_choice[] = {
static int
dissect_rrc_TransportChannelReconfiguration(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
#line 462 "./asn1/rrc/rrc.cnf"
#line 488 "./asn1/rrc/rrc.cnf"
col_append_str(actx->pinfo->cinfo, COL_INFO, "TransportChannelReconfiguration");
offset = dissect_per_choice(tvb, offset, actx, tree, hf_index,
ett_rrc_TransportChannelReconfiguration, TransportChannelReconfiguration_choice,
@ -93528,7 +93616,7 @@ static const per_sequence_t TransportFormatCombinationControl_sequence[] = {
static int
dissect_rrc_TransportFormatCombinationControl(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
#line 474 "./asn1/rrc/rrc.cnf"
#line 500 "./asn1/rrc/rrc.cnf"
col_append_str(actx->pinfo->cinfo, COL_INFO, "TransportFormatCombinationControl");
offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index,
ett_rrc_TransportFormatCombinationControl, TransportFormatCombinationControl_sequence);
@ -93961,7 +94049,7 @@ static const per_choice_t UECapabilityEnquiry_choice[] = {
static int
dissect_rrc_UECapabilityEnquiry(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
#line 482 "./asn1/rrc/rrc.cnf"
#line 508 "./asn1/rrc/rrc.cnf"
col_append_str(actx->pinfo->cinfo, COL_INFO, "UECapabilityEnquiry");
offset = dissect_per_choice(tvb, offset, actx, tree, hf_index,
ett_rrc_UECapabilityEnquiry, UECapabilityEnquiry_choice,
@ -94119,7 +94207,7 @@ static const per_choice_t UECapabilityInformationConfirm_choice[] = {
static int
dissect_rrc_UECapabilityInformationConfirm(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
#line 490 "./asn1/rrc/rrc.cnf"
#line 516 "./asn1/rrc/rrc.cnf"
col_append_str(actx->pinfo->cinfo, COL_INFO, "UECapabilityInformationConfirm");
offset = dissect_per_choice(tvb, offset, actx, tree, hf_index,
ett_rrc_UECapabilityInformationConfirm, UECapabilityInformationConfirm_choice,
@ -94883,7 +94971,7 @@ static const per_choice_t UplinkPhysicalChannelControl_choice[] = {
static int
dissect_rrc_UplinkPhysicalChannelControl(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
#line 506 "./asn1/rrc/rrc.cnf"
#line 532 "./asn1/rrc/rrc.cnf"
col_append_str(actx->pinfo->cinfo, COL_INFO, "UplinkPhysicalChannelControl");
offset = dissect_per_choice(tvb, offset, actx, tree, hf_index,
ett_rrc_UplinkPhysicalChannelControl, UplinkPhysicalChannelControl_choice,
@ -95226,7 +95314,7 @@ static const per_choice_t URAUpdateConfirm_choice[] = {
static int
dissect_rrc_URAUpdateConfirm(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
#line 514 "./asn1/rrc/rrc.cnf"
#line 540 "./asn1/rrc/rrc.cnf"
col_append_str(actx->pinfo->cinfo, COL_INFO, "URAUpdateConfirm");
offset = dissect_per_choice(tvb, offset, actx, tree, hf_index,
ett_rrc_URAUpdateConfirm, URAUpdateConfirm_choice,
@ -95689,7 +95777,7 @@ dissect_rrc_UE_ConnTimersAndConstants(tvbuff_t *tvb _U_, int offset _U_, asn1_ct
static int
dissect_rrc_T_cn_CommonGSM_MAP_NAS_SysInfo_02(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
#line 725 "./asn1/rrc/rrc.cnf"
#line 751 "./asn1/rrc/rrc.cnf"
private_data_set_cn_domain(actx, RRC_NAS_SYS_INFO_CN_COMMON);
offset = dissect_rrc_NAS_SystemInformationGSM_MAP(tvb, offset, actx, tree, hf_index);
@ -97574,7 +97662,7 @@ static const per_choice_t UTRANMobilityInformation_choice[] = {
static int
dissect_rrc_UTRANMobilityInformation(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
#line 522 "./asn1/rrc/rrc.cnf"
#line 548 "./asn1/rrc/rrc.cnf"
col_append_str(actx->pinfo->cinfo, COL_INFO, "UTRANMobilityInformation");
offset = dissect_per_choice(tvb, offset, actx, tree, hf_index,
ett_rrc_UTRANMobilityInformation, UTRANMobilityInformation_choice,
@ -98294,7 +98382,7 @@ dissect_rrc_ETWSPrimaryNotificationWithSecurity(tvbuff_t *tvb _U_, int offset _U
static int
dissect_rrc_T_eutra_Message(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
#line 636 "./asn1/rrc/rrc.cnf"
#line 662 "./asn1/rrc/rrc.cnf"
tvbuff_t *eutra_message_tvb = NULL;
offset = dissect_per_octet_string(tvb, offset, actx, tree, hf_index,
NO_BOUND, NO_BOUND, FALSE, &eutra_message_tvb);
@ -98356,7 +98444,7 @@ dissect_rrc_T_r8_04(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, pro
static int
dissect_rrc_T_ims_Information(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
#line 672 "./asn1/rrc/rrc.cnf"
#line 698 "./asn1/rrc/rrc.cnf"
tvbuff_t *imsInformation_tvb=NULL;
offset = dissect_per_octet_string(tvb, offset, actx, tree, hf_index,
1, 32, FALSE, &imsInformation_tvb);
@ -98411,7 +98499,7 @@ dissect_rrc_RSR_VCC_Info(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_
static int
dissect_rrc_T_eutra_Message_01(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
#line 642 "./asn1/rrc/rrc.cnf"
#line 668 "./asn1/rrc/rrc.cnf"
tvbuff_t *eutra_message_tvb = NULL;
offset = dissect_per_octet_string(tvb, offset, actx, tree, hf_index,
NO_BOUND, NO_BOUND, FALSE, &eutra_message_tvb);
@ -98777,7 +98865,7 @@ static const per_sequence_t UEInformationRequest_sequence[] = {
static int
dissect_rrc_UEInformationRequest(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
#line 494 "./asn1/rrc/rrc.cnf"
#line 520 "./asn1/rrc/rrc.cnf"
col_append_str(actx->pinfo->cinfo, COL_INFO, "UEInformationRequest");
offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index,
ett_rrc_UEInformationRequest, UEInformationRequest_sequence);
@ -99546,7 +99634,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 1068 "./asn1/rrc/rrc.cnf"
#line 1089 "./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);
@ -99566,7 +99654,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 1071 "./asn1/rrc/rrc.cnf"
#line 1092 "./asn1/rrc/rrc.cnf"
offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index,
ett_rrc_DL_DCCH_Message, DL_DCCH_Message_sequence);
@ -99580,11 +99668,11 @@ 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 979 "./asn1/rrc/rrc.cnf"
#line 1005 "./asn1/rrc/rrc.cnf"
tvbuff_t * start_val;
fp_info *fpinf;
rrc_ciphering_info * c_inf;
int i;
rlc_info *rlcinf;
rrc_ciphering_info * ciphering_info;
guint32 * start;
enum nas_sys_info_gsm_map cn_domain;
@ -99592,11 +99680,12 @@ dissect_rrc_START_Value(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_,
20, 20, FALSE, &start_val, NULL);
/*We base this map on communication context from fp*/
fpinf = (fp_info *)p_get_proto_data(wmem_file_scope(), actx->pinfo, proto_fp, 0);
/*We base this map on User Identity from RLC*/
fpinf = (fp_info *)p_get_proto_data(wmem_file_scope(), actx->pinfo, proto_fp, 0);
rlcinf = (rlc_info *)p_get_proto_data(wmem_file_scope(), actx->pinfo, proto_umts_rlc, 0);
/*If no info found, skip all this*/
if(fpinf == NULL){
/*If FP info or RLC info is missing , skip all this*/
if(fpinf == NULL || rlcinf== NULL){
return offset;
}
/*Retrieve the start value for the two ciphering domains*/
@ -99609,29 +99698,16 @@ dissect_rrc_START_Value(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_,
break;
case RRC_NAS_SYS_INFO_PS:
/*Find the entry for the communication context (taken from FP)*/
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)
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(fpinf->com_context_id), c_inf);
}
/*Find the entry for the UE ID(taken from RLC)*/
ciphering_info = get_or_create_cipher_info(fpinf, rlcinf);
private_data_set_ciphering_info(actx, ciphering_info);
/*Retrieve and store the value*/
start = g_new(guint32,1);
*start = tvb_get_bits32(start_val,0,20,ENC_BIG_ENDIAN);
if(c_inf && c_inf->start_ps)
if(ciphering_info && ciphering_info->start_ps)
/*Insert the value based on current frame num since this might vary over time*/
g_tree_insert(c_inf->start_ps, GUINT_TO_POINTER(actx->pinfo->num), start);
g_tree_insert(ciphering_info->start_ps, GUINT_TO_POINTER(actx->pinfo->num), start);
break;
default:
@ -101501,7 +101577,7 @@ dissect_rrc_HandoverFromUtranFailure_v590ext_IEs(tvbuff_t *tvb _U_, int offset _
static int
dissect_rrc_T_eutra_Message_02(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
#line 648 "./asn1/rrc/rrc.cnf"
#line 674 "./asn1/rrc/rrc.cnf"
tvbuff_t *eutra_message_tvb = NULL;
offset = dissect_per_octet_string(tvb, offset, actx, tree, hf_index,
NO_BOUND, NO_BOUND, FALSE, &eutra_message_tvb);
@ -109115,7 +109191,7 @@ 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 598 "./asn1/rrc/rrc.cnf"
#line 624 "./asn1/rrc/rrc.cnf"
tvbuff_t *parameter_tvb=NULL;
offset = dissect_per_octet_string(tvb, offset, actx, tree, hf_index,
@ -109134,7 +109210,7 @@ dissect_rrc_GSM_Classmark2(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _
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 606 "./asn1/rrc/rrc.cnf"
#line 632 "./asn1/rrc/rrc.cnf"
tvbuff_t *parameter_tvb=NULL;
offset = dissect_per_octet_string(tvb, offset, actx, tree, hf_index,
@ -110879,19 +110955,28 @@ static const per_sequence_t SecurityModeComplete_sequence[] = {
static int
dissect_rrc_SecurityModeComplete(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
#line 424 "./asn1/rrc/rrc.cnf"
rrc_ciphering_info * c_inf ;
fp_info *fpinf ;
#line 441 "./asn1/rrc/rrc.cnf"
fp_info *fpinf;
rlc_info *rlcinf;
rrc_ciphering_info *ciphering_info = NULL;
guint8 direction;
col_append_str(actx->pinfo->cinfo, COL_INFO, "SecurityModeComplete");
fpinf = (fp_info *)p_get_proto_data(wmem_file_scope(), actx->pinfo, proto_fp, 0);
rlcinf = (rlc_info *)p_get_proto_data(wmem_file_scope(), actx->pinfo, proto_umts_rlc, 0);
/*If FP info or RLC info is missing , skip all this*/
if(fpinf != NULL || rlcinf != NULL){
ciphering_info = get_or_create_cipher_info(fpinf, rlcinf);
private_data_set_ciphering_info(actx, ciphering_info);
}
offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index,
ett_rrc_SecurityModeComplete, SecurityModeComplete_sequence);
fpinf = (fp_info *)p_get_proto_data(wmem_file_scope(), actx->pinfo, proto_fp, 0);
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->num;
if( ciphering_info != NULL ){
direction = 1; /* Security Mode Complete is from the UE, direction is always uplink */
ciphering_info->setup_frame[direction] = actx->pinfo->num;
}
@ -110938,7 +111023,7 @@ static const per_sequence_t SecurityModeFailure_sequence[] = {
static int
dissect_rrc_SecurityModeFailure(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
#line 438 "./asn1/rrc/rrc.cnf"
#line 464 "./asn1/rrc/rrc.cnf"
col_append_str(actx->pinfo->cinfo, COL_INFO, "SecurityModeFailure");
offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index,
ett_rrc_SecurityModeFailure, SecurityModeFailure_sequence);
@ -111031,7 +111116,7 @@ static const per_sequence_t SignallingConnectionReleaseIndication_sequence[] = {
static int
dissect_rrc_SignallingConnectionReleaseIndication(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
#line 446 "./asn1/rrc/rrc.cnf"
#line 472 "./asn1/rrc/rrc.cnf"
col_append_str(actx->pinfo->cinfo, COL_INFO, "SignallingConnectionReleaseIndication");
offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index,
ett_rrc_SignallingConnectionReleaseIndication, SignallingConnectionReleaseIndication_sequence);
@ -111129,7 +111214,7 @@ static const per_sequence_t TransportChannelReconfigurationComplete_sequence[] =
static int
dissect_rrc_TransportChannelReconfigurationComplete(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
#line 466 "./asn1/rrc/rrc.cnf"
#line 492 "./asn1/rrc/rrc.cnf"
col_append_str(actx->pinfo->cinfo, COL_INFO, "TransportChannelReconfigurationComplete");
offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index,
ett_rrc_TransportChannelReconfigurationComplete, TransportChannelReconfigurationComplete_sequence);
@ -111178,7 +111263,7 @@ static const per_sequence_t TransportChannelReconfigurationFailure_sequence[] =
static int
dissect_rrc_TransportChannelReconfigurationFailure(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
#line 470 "./asn1/rrc/rrc.cnf"
#line 496 "./asn1/rrc/rrc.cnf"
col_append_str(actx->pinfo->cinfo, COL_INFO, "TransportChannelReconfigurationFailure");
offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index,
ett_rrc_TransportChannelReconfigurationFailure, TransportChannelReconfigurationFailure_sequence);
@ -111227,7 +111312,7 @@ static const per_sequence_t TransportFormatCombinationControlFailure_sequence[]
static int
dissect_rrc_TransportFormatCombinationControlFailure(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
#line 478 "./asn1/rrc/rrc.cnf"
#line 504 "./asn1/rrc/rrc.cnf"
col_append_str(actx->pinfo->cinfo, COL_INFO, "TransportFormatCombinationControlFailure");
offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index,
ett_rrc_TransportFormatCombinationControlFailure, TransportFormatCombinationControlFailure_sequence);
@ -111503,7 +111588,7 @@ static const per_sequence_t UECapabilityInformation_sequence[] = {
static int
dissect_rrc_UECapabilityInformation(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
#line 486 "./asn1/rrc/rrc.cnf"
#line 512 "./asn1/rrc/rrc.cnf"
col_append_str(actx->pinfo->cinfo, COL_INFO, "UECapabilityInformation");
offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index,
ett_rrc_UECapabilityInformation, UECapabilityInformation_sequence);
@ -111698,7 +111783,7 @@ static const per_sequence_t UplinkDirectTransfer_sequence[] = {
static int
dissect_rrc_UplinkDirectTransfer(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
#line 502 "./asn1/rrc/rrc.cnf"
#line 528 "./asn1/rrc/rrc.cnf"
col_append_str(actx->pinfo->cinfo, COL_INFO, "UplinkDirectTransfer");
offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index,
ett_rrc_UplinkDirectTransfer, UplinkDirectTransfer_sequence);
@ -111838,7 +111923,7 @@ static const per_sequence_t UTRANMobilityInformationConfirm_sequence[] = {
static int
dissect_rrc_UTRANMobilityInformationConfirm(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
#line 526 "./asn1/rrc/rrc.cnf"
#line 552 "./asn1/rrc/rrc.cnf"
col_append_str(actx->pinfo->cinfo, COL_INFO, "UTRANMobilityInformationConfirm");
offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index,
ett_rrc_UTRANMobilityInformationConfirm, UTRANMobilityInformationConfirm_sequence);
@ -111887,7 +111972,7 @@ static const per_sequence_t UTRANMobilityInformationFailure_sequence[] = {
static int
dissect_rrc_UTRANMobilityInformationFailure(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
#line 530 "./asn1/rrc/rrc.cnf"
#line 556 "./asn1/rrc/rrc.cnf"
col_append_str(actx->pinfo->cinfo, COL_INFO, "UTRANMobilityInformationFailure");
offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index,
ett_rrc_UTRANMobilityInformationFailure, UTRANMobilityInformationFailure_sequence);
@ -113704,7 +113789,7 @@ static const per_sequence_t UEInformationResponse_sequence[] = {
static int
dissect_rrc_UEInformationResponse(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
#line 498 "./asn1/rrc/rrc.cnf"
#line 524 "./asn1/rrc/rrc.cnf"
col_append_str(actx->pinfo->cinfo, COL_INFO, "UEInformationResponse");
offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index,
ett_rrc_UEInformationResponse, UEInformationResponse_sequence);
@ -118230,7 +118315,7 @@ static const per_choice_t URAUpdateConfirm_CCCH_choice[] = {
static int
dissect_rrc_URAUpdateConfirm_CCCH(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
#line 518 "./asn1/rrc/rrc.cnf"
#line 544 "./asn1/rrc/rrc.cnf"
col_append_str(actx->pinfo->cinfo, COL_INFO, "URAUpdateConfirm-CCCH");
offset = dissect_per_choice(tvb, offset, actx, tree, hf_index,
ett_rrc_URAUpdateConfirm_CCCH, URAUpdateConfirm_CCCH_choice,
@ -120133,7 +120218,7 @@ static const per_sequence_t URAUpdate_sequence[] = {
static int
dissect_rrc_URAUpdate(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
#line 510 "./asn1/rrc/rrc.cnf"
#line 536 "./asn1/rrc/rrc.cnf"
col_append_str(actx->pinfo->cinfo, COL_INFO, "URAUpdate");
offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index,
ett_rrc_URAUpdate, URAUpdate_sequence);
@ -121614,7 +121699,7 @@ static const per_sequence_t SystemInformation_FACH_sequence[] = {
static int
dissect_rrc_SystemInformation_FACH(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
#line 454 "./asn1/rrc/rrc.cnf"
#line 480 "./asn1/rrc/rrc.cnf"
col_append_str(actx->pinfo->cinfo, COL_INFO, "SystemInformation-FACH");
offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index,
ett_rrc_SystemInformation_FACH, SystemInformation_FACH_sequence);
@ -121720,7 +121805,7 @@ static const per_sequence_t SystemInformationChangeIndication_sequence[] = {
static int
dissect_rrc_SystemInformationChangeIndication(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
#line 458 "./asn1/rrc/rrc.cnf"
#line 484 "./asn1/rrc/rrc.cnf"
col_append_str(actx->pinfo->cinfo, COL_INFO, "SystemInformationChangeIndication");
offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index,
ett_rrc_SystemInformationChangeIndication, SystemInformationChangeIndication_sequence);
@ -121901,7 +121986,7 @@ static const per_sequence_t SystemInformation_BCH_sequence[] = {
static int
dissect_rrc_SystemInformation_BCH(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
#line 450 "./asn1/rrc/rrc.cnf"
#line 476 "./asn1/rrc/rrc.cnf"
col_append_str(actx->pinfo->cinfo, COL_INFO, "SystemInformation-BCH");
offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index,
ett_rrc_SystemInformation_BCH, SystemInformation_BCH_sequence);
@ -129338,7 +129423,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 1074 "./asn1/rrc/rrc.cnf"
#line 1095 "./asn1/rrc/rrc.cnf"
offset = dissect_per_choice(tvb, offset, actx, tree, hf_index,
ett_rrc_HandoverToUTRANCommand, HandoverToUTRANCommand_choice,
NULL);
@ -129479,7 +129564,7 @@ static const per_sequence_t UE_SecurityInformation_sequence[] = {
static int
dissect_rrc_UE_SecurityInformation(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
#line 1077 "./asn1/rrc/rrc.cnf"
#line 1098 "./asn1/rrc/rrc.cnf"
private_data_set_cn_domain(actx, RRC_NAS_SYS_INFO_CS);
offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index,
ett_rrc_UE_SecurityInformation, UE_SecurityInformation_sequence);
@ -129882,7 +129967,7 @@ static const per_sequence_t UE_SecurityInformation2_sequence[] = {
static int
dissect_rrc_UE_SecurityInformation2(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
#line 1081 "./asn1/rrc/rrc.cnf"
#line 1102 "./asn1/rrc/rrc.cnf"
private_data_set_cn_domain(actx, RRC_NAS_SYS_INFO_PS);
offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index,
ett_rrc_UE_SecurityInformation2, UE_SecurityInformation2_sequence);
@ -136952,7 +137037,7 @@ dissect_rrc_T_supportOfInterRATHOToEUTRATDD(tvbuff_t *tvb _U_, int offset _U_, a
static int
dissect_rrc_T_eutraFeatureGroupIndicators(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
#line 654 "./asn1/rrc/rrc.cnf"
#line 680 "./asn1/rrc/rrc.cnf"
tvbuff_t *eutraFeatureGroupIndicators_tvb=NULL;
offset = dissect_per_bit_string(tvb, offset, actx, tree, hf_index,
4, 4, FALSE, &eutraFeatureGroupIndicators_tvb, NULL);
@ -138550,7 +138635,7 @@ dissect_rrc_T_supportOfInter_RAT_PS_Handover(tvbuff_t *tvb _U_, int offset _U_,
static int
dissect_rrc_GSM_MS_RadioAccessCapability(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
#line 614 "./asn1/rrc/rrc.cnf"
#line 640 "./asn1/rrc/rrc.cnf"
tvbuff_t *parameter_tvb=NULL;
offset = dissect_per_octet_string(tvb, offset, actx, tree, hf_index,
@ -138863,7 +138948,7 @@ dissect_rrc_UE_RadioAccessCapability_v860ext_IEs(tvbuff_t *tvb _U_, int offset _
static int
dissect_rrc_T_ue_EUTRA_Capability(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
#line 630 "./asn1/rrc/rrc.cnf"
#line 656 "./asn1/rrc/rrc.cnf"
tvbuff_t *ue_eutra_cap_tvb = NULL;
offset = dissect_per_octet_string(tvb, offset, actx, tree, hf_index,
NO_BOUND, NO_BOUND, FALSE, &ue_eutra_cap_tvb);
@ -150576,7 +150661,7 @@ dissect_rrc_ExtSIBTypeInfoSchedulingInfo_List3(tvbuff_t *tvb _U_, int offset _U_
static int
dissect_rrc_HNBName(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
#line 704 "./asn1/rrc/rrc.cnf"
#line 730 "./asn1/rrc/rrc.cnf"
tvbuff_t *hnbname_tvb = NULL;
offset = dissect_per_octet_string(tvb, offset, actx, tree, -1,
@ -151167,7 +151252,7 @@ dissect_rrc_SIB_ReferenceList2(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *ac
static int
dissect_rrc_T_cn_CommonGSM_MAP_NAS_SysInfo_03(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
#line 729 "./asn1/rrc/rrc.cnf"
#line 755 "./asn1/rrc/rrc.cnf"
private_data_set_cn_domain(actx, RRC_NAS_SYS_INFO_CN_COMMON);
offset = dissect_rrc_NAS_SystemInformationGSM_MAP(tvb, offset, actx, tree, hf_index);
@ -156471,7 +156556,7 @@ 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 622 "./asn1/rrc/rrc.cnf"
#line 648 "./asn1/rrc/rrc.cnf"
tvbuff_t *parameter_tvb=NULL;
offset = dissect_per_octet_string(tvb, offset, actx, tree, hf_index,
@ -162050,7 +162135,7 @@ dissect_rrc_ToTargetRNC_Container(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t
static int
dissect_rrc_T_dL_DCCHmessage(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
#line 534 "./asn1/rrc/rrc.cnf"
#line 560 "./asn1/rrc/rrc.cnf"
tvbuff_t *dl_dcch_message_tvb=NULL;
offset = dissect_per_octet_string(tvb, offset, actx, tree, hf_index,
@ -162882,8 +162967,7 @@ static int dissect_MeasurementReport_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _
/*--- End of included file: packet-rrc-fn.c ---*/
#line 308 "./asn1/rrc/packet-rrc-template.c"
#line 372 "./asn1/rrc/packet-rrc-template.c"
static int
@ -162944,7 +163028,7 @@ rrc_init(void) {
rrc_free_key,
rrc_free_value);
rrc_ciph_inf = g_tree_new_full(rrc_key_cmp,
rrc_ciph_info_tree = g_tree_new_full(rrc_key_cmp,
NULL, /* data pointer, optional */
NULL,
rrc_free_value);
@ -162963,7 +163047,8 @@ static void
rrc_cleanup(void) {
/*Cleanup*/
g_tree_destroy(hsdsch_muxed_flows);
g_tree_destroy(rrc_ciph_inf);
g_tree_destroy(rrc_ciph_info_tree);
g_tree_destroy(rrc_scrambling_code_urnti);
}
/*--- proto_register_rrc -------------------------------------------*/
@ -206289,7 +206374,7 @@ void proto_register_rrc(void) {
NULL, HFILL }},
/*--- End of included file: packet-rrc-hfarr.c ---*/
#line 398 "./asn1/rrc/packet-rrc-template.c"
#line 462 "./asn1/rrc/packet-rrc-template.c"
{ &hf_test,
{ "RAB Test", "rrc.RAB.test",
FT_UINT8, BASE_DEC, NULL, 0,
@ -213238,7 +213323,7 @@ void proto_register_rrc(void) {
&ett_rrc_UL_RFC3095_Context,
/*--- End of included file: packet-rrc-ettarr.c ---*/
#line 448 "./asn1/rrc/packet-rrc-template.c"
#line 512 "./asn1/rrc/packet-rrc-template.c"
&ett_rrc_eutraFeatureGroupIndicators,
&ett_rrc_cn_CommonGSM_MAP_NAS_SysInfo,
&ett_rrc_ims_info,
@ -213337,7 +213422,7 @@ void proto_register_rrc(void) {
/*--- End of included file: packet-rrc-dis-reg.c ---*/
#line 471 "./asn1/rrc/packet-rrc-template.c"
#line 535 "./asn1/rrc/packet-rrc-template.c"

View File

@ -70,20 +70,20 @@ typedef struct rrc_info
} rrc_info;
/*Struct for storing ciphering information*/
typedef struct rrc_ciph_info_
typedef struct rrc_ciphering_info
{
int seq_no[31][2]; /*Indicates for each Rbid when ciphering starts*/
int seq_no[31][2]; /*Indicates for each Rbid when ciphering starts - Indexers are [BearerID][Direction]*/
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 setup_frame[2]; /*Store which frame contained this information - Indexer is [Direction]*/
guint32 ps_conf_counters[31][2]; /*This should also be made for CS*/
} rrc_ciphering_info;
extern GTree * hsdsch_muxed_flows;
extern GTree * rrc_ciph_inf;
extern GTree * rrc_ciph_info_tree;
extern GTree * rrc_scrambling_code_urnti;
extern wmem_tree_t* rrc_rach_urnti_crnti_map;

View File

@ -58,9 +58,13 @@ static gboolean global_rlc_perform_reassemby = TRUE;
/* Preference to expect RLC headers without payloads */
static gboolean global_rlc_headers_expected = FALSE;
/* Preference to expect ciphered data */
/* Preference to expect ONLY ciphered data */
static gboolean global_rlc_ciphered = FALSE;
/* Preference to ignore ciphering state reported from RRC */
/* This is important for captures with deciphered traffic AND the original security RRC messages present*/
static gboolean global_ignore_rrc_ciphering_indication = FALSE;
/* Preference to try deciphering */
static gboolean global_rlc_try_decipher = FALSE;
@ -94,6 +98,8 @@ static int hf_rlc_li_value = -1;
static int hf_rlc_li_ext = -1;
static int hf_rlc_li_data = -1;
static int hf_rlc_data = -1;
static int hf_rlc_ciphered_data = -1;
static int hf_rlc_ciphered_lis_data = -1;
static int hf_rlc_ctrl_type = -1;
static int hf_rlc_r1 = -1;
static int hf_rlc_rsn = -1;
@ -1446,6 +1452,48 @@ rlc_decipher_tvb(tvbuff_t *tvb, packet_info *pinfo, guint32 counter, guint8 rbid
#endif /* HAVE_UMTS_KASUMI */
}
/** @brief Checks if an RLC packet is ciphered, according to information reported from the RRC layer
*
* @param pinfo Packet info.
* @param fpinf FP info
* @param rlcinf RLC info
* @param seq Sequence number of the RLC packet
* @return gboolean Returns TRUE if the packet is ciphered and false otherwise
*/
static gboolean
is_ciphered_according_to_rrc(packet_info *pinfo, fp_info *fpinf, rlc_info *rlcinf ,guint16 seq) {
gint16 cur_tb;
guint32 ueid;
rrc_ciphering_info *ciphering_info;
guint8 rbid;
guint8 direction;
guint32 security_mode_frame_num;
gint32 ciphering_begin_seq;
if(global_ignore_rrc_ciphering_indication) {
return FALSE;
}
cur_tb = fpinf->cur_tb;
ueid = rlcinf->ueid[cur_tb];
ciphering_info = (rrc_ciphering_info *)g_tree_lookup(rrc_ciph_info_tree, GINT_TO_POINTER((gint)ueid));
if(ciphering_info != NULL) {
rbid = rlcinf->rbid[cur_tb];
direction = fpinf->is_uplink ? 1 : 0;
security_mode_frame_num = ciphering_info->setup_frame[direction];
ciphering_begin_seq = ciphering_info->seq_no[rbid][direction];
/* Making sure the rrc security message's frame number makes sense */
if( security_mode_frame_num > 0 && security_mode_frame_num <= pinfo->num) {
/* Making sure the sequence number where ciphering starts makes sense */
/* TODO: This check is incorrect if the sequence numbers wrap around */
if(ciphering_begin_seq >= 0 && ciphering_begin_seq <= seq){
return TRUE;
}
}
}
return FALSE;
}
/*
* @param key is created with GINT_TO_POINTER
* @param value is a pointer to a guint32
@ -1487,9 +1535,11 @@ static void
rlc_decipher(tvbuff_t *tvb, packet_info * pinfo, proto_tree * tree, fp_info * fpinf,
rlc_info * rlcinf, guint16 seq, enum rlc_mode mode)
{
rrc_ciphering_info * c_inf;
rrc_ciphering_info *ciphering_info;
guint8 indx, header_size, hfn_shift;
gint16 pos;
guint8 ext;
int ciphered_data_hf;
indx = fpinf->is_uplink ? 1 : 0;
pos = fpinf->cur_tb;
@ -1502,12 +1552,12 @@ rlc_decipher(tvbuff_t *tvb, packet_info * pinfo, proto_tree * tree, fp_info * fp
}
/*Ciphering info singled in RRC by securitymodecommands */
c_inf = (rrc_ciphering_info *)g_tree_lookup(rrc_ciph_inf, GINT_TO_POINTER((gint)fpinf->com_context_id));
ciphering_info = (rrc_ciphering_info *)g_tree_lookup(rrc_ciph_info_tree, GINT_TO_POINTER((gint)rlcinf->ueid[fpinf->cur_tb]));
/*TODO: This doesn't really work for all packets..*/
/*Check if we have ciphering info and that this frame is ciphered*/
if(c_inf!=NULL && ( (c_inf->setup_frame > 0 && c_inf->setup_frame < pinfo->num && c_inf->seq_no[rlcinf->rbid[pos]][indx] == -1) ||
(c_inf->setup_frame < pinfo->num && c_inf->seq_no[rlcinf->rbid[pos]][indx] >= 0 && c_inf->seq_no[rlcinf->rbid[pos]][indx] <= seq) )){
if(ciphering_info!=NULL && ( (ciphering_info->setup_frame[indx] > 0 && ciphering_info->setup_frame[indx] < pinfo->num && ciphering_info->seq_no[rlcinf->rbid[pos]][indx] == -1) ||
(ciphering_info->setup_frame[indx] < pinfo->num && ciphering_info->seq_no[rlcinf->rbid[pos]][indx] >= 0 && ciphering_info->seq_no[rlcinf->rbid[pos]][indx] <= seq) )){
tvbuff_t *t;
@ -1519,10 +1569,10 @@ rlc_decipher(tvbuff_t *tvb, packet_info * pinfo, proto_tree * tree, fp_info * fp
counter_init[rlcinf->rbid[pos]][0] = TRUE;
counter_init[rlcinf->rbid[pos]][1] = TRUE;
/*Find appropriate start value*/
g_tree_foreach(c_inf->start_ps, (GTraverseFunc)iter_same, &frame_num);
g_tree_foreach(ciphering_info->start_ps, (GTraverseFunc)iter_same, &frame_num);
/*Set COUNTER value accordingly as specified by 6.4.8 in 3GPP TS 33.102 */
if(max_counter +2 > frame_num && c_inf->seq_no[rlcinf->rbid[pos]][indx] == -1){
if(max_counter +2 > frame_num && ciphering_info->seq_no[rlcinf->rbid[pos]][indx] == -1){
ps_counter[rlcinf->rbid[pos]][0] = (max_counter+2) << hfn_shift;
ps_counter[rlcinf->rbid[pos]][1] = (max_counter+2) << hfn_shift;
}else{
@ -1582,7 +1632,12 @@ rlc_decipher(tvbuff_t *tvb, packet_info * pinfo, proto_tree * tree, fp_info * fp
/*Unable to decipher the packet*/
if(t == NULL){
proto_tree_add_expert(tree, pinfo, &ei_rlc_ciphered_data, tvb, 0, -1);
/* Choosing the right field text ("LIs & Data" or just "Data") based on extension bit / header extension */
ext = tvb_get_guint8(tvb, header_size - 1) & 0x01;
ciphered_data_hf = (ext == 1) ? hf_rlc_ciphered_lis_data : hf_rlc_ciphered_data;
/* Adding ciphered payload field to tree */
proto_tree_add_item(tree, ciphered_data_hf, tvb, header_size, -1, ENC_NA);
proto_tree_add_expert(tree, pinfo, &ei_rlc_ciphered_data, tvb, header_size, -1);
col_append_str(pinfo->cinfo, COL_INFO, "[Ciphered Data]");
return;
@ -1842,10 +1897,16 @@ dissect_rlc_um(enum rlc_channel_type channel, tvbuff_t *tvb, packet_info *pinfo,
rlc_info *rlcinf;
guint32 orig_num;
guint8 seq;
guint8 ext;
guint8 next_byte, offs = 0;
gint16 pos, num_li = 0;
gint16 cur_tb, num_li = 0;
gboolean is_truncated, li_is_on_2_bytes;
proto_item *truncated_ti;
gboolean ciphered_according_to_rrc = FALSE;
gboolean ciphered_flag = FALSE;
gboolean deciphered_flag = FALSE;
int ciphered_data_hf;
next_byte = tvb_get_guint8(tvb, offs++);
seq = next_byte >> 1;
@ -1868,23 +1929,30 @@ dissect_rlc_um(enum rlc_channel_type channel, tvbuff_t *tvb, packet_info *pinfo,
return;
}
pos = fpinf->cur_tb;
if ((rlcinf->ciphered[pos] == TRUE && rlcinf->deciphered[pos] == FALSE) || global_rlc_ciphered) {
cur_tb = fpinf->cur_tb;
ciphered_according_to_rrc = is_ciphered_according_to_rrc(pinfo, fpinf, rlcinf, (guint16)seq);
ciphered_flag = rlcinf->ciphered[cur_tb];
deciphered_flag = rlcinf->deciphered[cur_tb];
if (((ciphered_according_to_rrc || ciphered_flag) && !deciphered_flag) || global_rlc_ciphered) {
if(global_rlc_try_decipher){
rlc_decipher(tvb, pinfo, tree, fpinf, rlcinf, seq, RLC_UM);
}else{
proto_tree_add_expert(tree, pinfo, &ei_rlc_ciphered_data, tvb, 0, -1);
/* Choosing the right field text ("LIs & Data" or just "Data") based on extension bit */
ext = tvb_get_guint8(tvb, 0) & 0x01;
ciphered_data_hf = (ext == 1) ? hf_rlc_ciphered_lis_data : hf_rlc_ciphered_data;
/* Adding ciphered payload field to tree */
proto_tree_add_item(tree, ciphered_data_hf, tvb, offs, -1, ENC_NA);
proto_tree_add_expert(tree, pinfo, &ei_rlc_ciphered_data, tvb, offs, -1);
col_append_str(pinfo->cinfo, COL_INFO, "[Ciphered Data]");
return;
}
}
if (global_rlc_li_size == RLC_LI_UPPERLAYER) {
if (rlcinf->li_size[pos] == RLC_LI_VARIABLE) {
if (rlcinf->li_size[cur_tb] == RLC_LI_VARIABLE) {
li_is_on_2_bytes = (tvb_reported_length(tvb) > 125) ? TRUE : FALSE;
} else {
li_is_on_2_bytes = (rlcinf->li_size[pos] == RLC_LI_15BITS) ? TRUE : FALSE;
li_is_on_2_bytes = (rlcinf->li_size[cur_tb] == RLC_LI_15BITS) ? TRUE : FALSE;
}
} else { /* Override rlcinf configuration with preference. */
li_is_on_2_bytes = (global_rlc_li_size == RLC_LI_15BITS) ? TRUE : FALSE;
@ -2243,11 +2311,16 @@ dissect_rlc_am(enum rlc_channel_type channel, tvbuff_t *tvb, packet_info *pinfo,
guint8 ext, dc;
guint8 next_byte, offs = 0;
guint32 orig_num = 0;
gint16 num_li = 0, pos;
gint16 num_li = 0;
gint16 cur_tb;
guint16 seq;
gboolean is_truncated, li_is_on_2_bytes;
proto_item *truncated_ti, *ti;
guint64 polling;
gboolean ciphered_according_to_rrc = FALSE;
gboolean ciphered_flag = FALSE;
gboolean deciphered_flag = FALSE;
int ciphered_data_hf;
fpinf = (fp_info *)p_get_proto_data(wmem_file_scope(), pinfo, proto_fp, 0);
rlcinf = (rlc_info *)p_get_proto_data(wmem_file_scope(), pinfo, proto_umts_rlc, 0);
@ -2289,26 +2362,32 @@ dissect_rlc_am(enum rlc_channel_type channel, tvbuff_t *tvb, packet_info *pinfo,
return;
}
pos = fpinf->cur_tb;
cur_tb = fpinf->cur_tb;
/**
* WARNING DECIPHERING IS HIGHLY EXPERIMENTAL!!!
* */
if (((rlcinf->ciphered[pos] == TRUE && rlcinf->deciphered[pos] == FALSE) || global_rlc_ciphered)) {
ciphered_according_to_rrc = is_ciphered_according_to_rrc(pinfo, fpinf, rlcinf, (guint16)seq);
ciphered_flag = rlcinf->ciphered[cur_tb];
deciphered_flag = rlcinf->deciphered[cur_tb];
if (((ciphered_according_to_rrc || ciphered_flag) && !deciphered_flag) || global_rlc_ciphered) {
if(global_rlc_try_decipher){
rlc_decipher(tvb, pinfo, tree, fpinf, rlcinf, seq, RLC_AM);
}else{
proto_tree_add_expert(tree, pinfo, &ei_rlc_ciphered_data, tvb, 0, -1);
/* Choosing the right field text ("LIs & Data" or just "Data") based on header extension field */
ciphered_data_hf = (ext == 0x01) ? hf_rlc_ciphered_lis_data : hf_rlc_ciphered_data;
/* Adding ciphered payload field to tree */
proto_tree_add_item(tree, ciphered_data_hf, tvb, offs, -1, ENC_NA);
proto_tree_add_expert(tree, pinfo, &ei_rlc_ciphered_data, tvb, offs, -1);
col_append_str(pinfo->cinfo, COL_INFO, "[Ciphered Data]");
return;
}
}
if (global_rlc_li_size == RLC_LI_UPPERLAYER) {
if (rlcinf->li_size[pos] == RLC_LI_VARIABLE) {
if (rlcinf->li_size[cur_tb] == RLC_LI_VARIABLE) {
li_is_on_2_bytes = (tvb_reported_length(tvb) > 126) ? TRUE : FALSE;
} else {
li_is_on_2_bytes = (rlcinf->li_size[pos] == RLC_LI_15BITS) ? TRUE : FALSE;
li_is_on_2_bytes = (rlcinf->li_size[cur_tb] == RLC_LI_15BITS) ? TRUE : FALSE;
}
} else { /* Override rlcinf configuration with preference. */
li_is_on_2_bytes = (global_rlc_li_size == RLC_LI_15BITS) ? TRUE : FALSE;
@ -2816,6 +2895,14 @@ proto_register_rlc(void)
{ "Data", "rlc.data",
FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL }
},
{ &hf_rlc_ciphered_data,
{ "Ciphered Data", "rlc.ciphered_data",
FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL }
},
{ &hf_rlc_ciphered_lis_data,
{ "Ciphered LIs & Data", "rlc.ciphered_data",
FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL }
},
/* LI information */
{ &hf_rlc_li,
{ "LI", "rlc.li",
@ -2987,14 +3074,19 @@ proto_register_rlc(void)
"add expert info to indicate that headers were omitted",
&global_rlc_headers_expected);
prefs_register_bool_preference(rlc_module, "ignore_rrc_cipher_indication",
"Ignore ciphering indication from higher layers",
"When enabled, RLC will ignore sequence numbers reported in 'Security Mode Command'/'Security Mode Complete' (RRC) messages when checking if frames are ciphered",
&global_ignore_rrc_ciphering_indication);
prefs_register_bool_preference(rlc_module, "ciphered_data",
"Ciphered data",
"When enabled, rlc will assume all data is ciphered",
"All data is ciphered",
"When enabled, RLC will assume all payloads in RLC frames are ciphered",
&global_rlc_ciphered);
prefs_register_bool_preference(rlc_module, "try_decipher",
"Try to Decipher data",
"When enabled, rlc will try to decipher data. (Experimental)",
"Try to decipher data",
"When enabled, RLC will try to decipher data. (Experimental)",
&global_rlc_try_decipher);
prefs_register_enum_preference(rlc_module, "li_size",