summaryrefslogtreecommitdiff
path: root/asn1
diff options
context:
space:
mode:
authorAnders Broman <anders.broman@ericsson.com>2012-07-26 08:15:20 +0000
committerAnders Broman <anders.broman@ericsson.com>2012-07-26 08:15:20 +0000
commitaed65b0c7b2bf94aaf60805b26c84d9c511249dc (patch)
tree411e000b270d409943a480c9a60996c9790c7968 /asn1
parent65ebfc9db449b0ef759a295bd94dca17f3eb43ae (diff)
downloadwireshark-aed65b0c7b2bf94aaf60805b26c84d9c511249dc.tar.gz
From Jacob Nordgren and Rishie Sharma:
- RRC now configures logical channels in HS-DSCH hs, and some HSDSCH common support added - RLC: modifed memory management, MAC: dch would set the incorrect logical channel for RLC svn path=/trunk/; revision=44027
Diffstat (limited to 'asn1')
-rw-r--r--asn1/nbap/nbap.cnf73
-rw-r--r--asn1/nbap/packet-nbap-template.c8
-rw-r--r--asn1/nbap/packet-nbap-template.h4
-rw-r--r--asn1/rrc/packet-rrc-template.c39
-rw-r--r--asn1/rrc/packet-rrc-template.h5
-rw-r--r--asn1/rrc/rrc.cnf65
6 files changed, 191 insertions, 3 deletions
diff --git a/asn1/nbap/nbap.cnf b/asn1/nbap/nbap.cnf
index b3361b69da..38112efaea 100644
--- a/asn1/nbap/nbap.cnf
+++ b/asn1/nbap/nbap.cnf
@@ -719,6 +719,10 @@ transportFormatSet_type = NBAP_CPCH;
SE_COPY_ADDRESS(&(umts_fp_conversation_info->crnc_address), &dst_addr);
umts_fp_conversation_info->crnc_port = BindingID_port;
umts_fp_conversation_info->rlc_mode = FP_RLC_MODE_UNKNOWN;
+
+ /*Save unique UE-identifier */
+ /*umts_fp_conversation_info->com_context_id = com_context_id;
+ */
/* DCH's in this flow */
umts_fp_conversation_info->dch_crc_present = g_nbap_msg_info_for_fp.dch_crc_present;
@@ -910,7 +914,10 @@ transportFormatSet_type = NBAP_CPCH;
SE_COPY_ADDRESS(&(umts_fp_conversation_info->crnc_address), &dst_addr);
umts_fp_conversation_info->crnc_port = BindingID_port;
umts_fp_conversation_info->rlc_mode = FP_RLC_MODE_UNKNOWN;
-
+ /*Save unique UE-identifier */
+ /*umts_fp_conversation_info->com_context_id = com_context_id;
+ */
+
/* DCH's in this flow */
umts_fp_conversation_info->dch_crc_present = g_nbap_msg_info_for_fp.dch_crc_present;
/* Set data for First or single channel */
@@ -1052,6 +1059,13 @@ guint32 TransportBlockSize;
}
}
+#Handle when DCHs get modified
+#.FN_BODY FDD-DCHs-to-ModifyItem
+
+%(DEFAULT_BODY)s
+ /*g_warning("im going to modify dch_id: %%d and t_dch_id: %%d", dch_id, t_dch_id);
+ */
+
#.FN_BODY RL-Specific-DCH-Info-Item/dCH-id
%(DEFAULT_BODY)s
@@ -1113,6 +1127,9 @@ dch_id = 0xFFFFFFFF;
/* DCH's in this flow */
umts_fp_conversation_info->dch_crc_present = g_nbap_msg_info_for_fp.dch_crc_present;
+ /*Save unique UE-identifier */
+ umts_fp_conversation_info->com_context_id = com_context_id;
+
/*UPLINK*/
/* Set data for First or single channel */
umts_fp_conversation_info->fp_dch_channel_info[0].num_ul_chans = num_tf = nbap_dch_chnl_info[dch_id].num_ul_chans;
@@ -1215,6 +1232,10 @@ BindingID_port = 0;
umts_fp_conversation_info->rlc_mode = FP_RLC_MODE_UNKNOWN;
+ /*TODO: Fix this (make it better)*/
+ if(BindingID_port == 1968){
+ umts_fp_conversation_info->urnti = 4711;
+ }
/* Set address for collection of DDI entries */
COPY_ADDRESS(&(nbap_edch_channel_info[e_dch_macdflow_id].crnc_address),&dst_addr);
nbap_edch_channel_info[e_dch_macdflow_id].crnc_port = BindingID_port;
@@ -1478,6 +1499,9 @@ int i;
/*Added june 3, normally just the iterator variable*/
umts_fp_conversation_info->hsdsch_macdflow_id = i ; /*hsdsch_macdflow_ids[i];*/ /* hsdsch_macdflow_id;*/
+ /*Added july 2012*/
+ umts_fp_conversation_info->com_context_id = com_context_id;
+
/* Cheat and use the DCH entries */
umts_fp_conversation_info->num_dch_in_flow++;
umts_fp_conversation_info->dchs_in_flow_list[umts_fp_conversation_info->num_dch_in_flow -1] = i;
@@ -1530,6 +1554,16 @@ int i;
#.FN_BODY HSDSCH-Common-System-InformationFDD
+/*
+ * 5.1.6 High Speed Downlink Shared Channels
+ * The Data Transfer procedure is used to transfer a HS-DSCH DATA FRAME (TYPE 1, TYPE 2 [FDD and 1.28Mcps
+ * TDD - or TYPE3]) from the CRNC to a Node B. HS-DSCH DATA FRAME TYPE 2 is selected if the IE HS-DSCH
+ * MAC-d PDU Size Format in NBAP (TS 25.433 [6]) is present and set to "Flexible MAC-d PDU Size" [FDD and
+ * 1.28Mcps TDD - or if the IE HS-DSCH Common System Information is present and the UE is in Cell_FACH state. HS-
+ * DSCH DATA FRAME TYPE 3 is selected if the IE HS-DSCH Paging System Information in NBAP (TS 25.433 [6]) is
+ * present and the UE is in Cell_PCH state or URA_PCH state]. HS-DSCH DATA FRAME TYPE 1 is selected in any
+ * other case.
+ */
umts_fp_conversation_info_t *umts_fp_conversation_info = NULL;
address null_addr;
conversation_t *conversation = NULL;
@@ -1567,9 +1601,23 @@ int i;
if(actx->pinfo->link_dir==P2P_DIR_DL){
umts_fp_conversation_info = se_new0(umts_fp_conversation_info_t);
+ /*Select frame type = 3 according to paragraph 5.1.6 in 3GPP TS 25.435*/
umts_fp_conversation_info->channel = CHANNEL_HSDSCH_COMMON;
umts_fp_conversation_info->division = Division_FDD;
+ umts_fp_conversation_info->dl_frame_number = 0;
+ umts_fp_conversation_info->ul_frame_number = actx->pinfo->fd->num;
+ SE_COPY_ADDRESS(&(umts_fp_conversation_info->crnc_address), &nbap_common_channel_info[i].crnc_address);
+ umts_fp_conversation_info->crnc_port = nbap_common_channel_info[i].crnc_port;
+
+ /*umts_fp_conversation_info->hsdsch_macdflow_id = i ;*/ /*hsdsch_macdflow_ids[i];*/ /* hsdsch_macdflow_id;*/
+ umts_fp_conversation_info->common_macdflow_id = common_macdflow_id;
+
+ umts_fp_conversation_info->hsdsch_entity = ehs;
+
+ umts_fp_conversation_info->num_dch_in_flow++;
+ umts_fp_conversation_info->dchs_in_flow_list[umts_fp_conversation_info->num_dch_in_flow -1] = i;
+
set_umts_fp_conv_data(conversation, umts_fp_conversation_info);
}
@@ -1577,7 +1625,11 @@ int i;
}
+
}
+#This guy should perhaps also be impletemend, hsdsch frame type 3
+#.FN_BODY HSDSCH-Paging-System-InformationFDD
+ g_warning("HS-DSCH Type 3 NOT Implemented!");
#
#Routines for figuring out a unique UE identification number (to track flows over changing channels)
@@ -1586,9 +1638,28 @@ int i;
#.FN_BODY NodeB-CommunicationContextID VAL_PTR = &com_context_id
%(DEFAULT_BODY)s
#.FN_BODY CRNC-CommunicationContextID VAL_PTR = &com_context_id
+%(DEFAULT_BODY)s
+#.FN_BODY HSDSCH-RNTI VAL_PTR = &hrnti
+umts_fp_conversation_info_t *umts_fp_conversation_info = NULL;
+address null_addr;
+conversation_t *conversation = NULL;
+int i;
%(DEFAULT_BODY)s
+ /*Find the conversations assoicated with the HS-DSCH flows in this packet and set proper H-RNTI*/
+ SET_ADDRESS(&null_addr, AT_NONE, 0, NULL);
+ for (i = 0; i < maxNrOfMACdFlows; i++) {
+ if (nbap_hsdsch_channel_info[i].crnc_port != 0){
+ conversation = find_conversation(actx->pinfo->fd->num, &(nbap_hsdsch_channel_info[i].crnc_address), &null_addr,
+ PT_UDP,
+ nbap_hsdsch_channel_info[i].crnc_port, 0, NO_ADDR_B);
+ if(conversation != NULL){
+ umts_fp_conversation_info = (umts_fp_conversation_info_t *)conversation_get_proto_data(conversation, proto_fp);
+ umts_fp_conversation_info->hrnti = hrnti;
+ }
+ }
+ }
#.REGISTER_NEW
#NBAP-PROTOCOL-IES
diff --git a/asn1/nbap/packet-nbap-template.c b/asn1/nbap/packet-nbap-template.c
index 53aea37aa7..165c9b194d 100644
--- a/asn1/nbap/packet-nbap-template.c
+++ b/asn1/nbap/packet-nbap-template.c
@@ -159,6 +159,7 @@ typedef struct
address crnc_address;
guint16 crnc_port;
enum fp_rlc_mode rlc_mode;
+
} nbap_common_channel_info_t;
nbap_common_channel_info_t nbap_common_channel_info[maxNrOfMACdFlows]; /*TODO: Fix this!*/
@@ -168,6 +169,9 @@ gint g_num_dch_in_flow;
gint g_dchs_in_flow_list[maxNrOfTFs];
gint hsdsch_macdflow_ids[maxNrOfMACdFlows];
+
+gint hrnti;
+
struct _nbap_msg_info_for_fp g_nbap_msg_info_for_fp;
/* Global variables */
@@ -434,6 +438,7 @@ void proto_register_nbap(void) {
}
+
/*--- proto_reg_handoff_nbap ---------------------------------------*/
void
proto_reg_handoff_nbap(void)
@@ -443,6 +448,9 @@ proto_reg_handoff_nbap(void)
nbap_handle = find_dissector("nbap");
fp_handle = find_dissector("fp");
dissector_add_uint("sctp.ppi", NBAP_PAYLOAD_PROTOCOL_ID, nbap_handle);
+#ifdef EXTRA_PPI
+ dissector_add_uint("sctp.ppi", 17, nbap_handle);
+#endif
dissector_add_handle("sctp.port", nbap_handle); /* for "decode-as" */
#include "packet-nbap-dis-tab.c"
diff --git a/asn1/nbap/packet-nbap-template.h b/asn1/nbap/packet-nbap-template.h
index e6703b4711..f0208c3c7c 100644
--- a/asn1/nbap/packet-nbap-template.h
+++ b/asn1/nbap/packet-nbap-template.h
@@ -47,7 +47,7 @@ static const guint8 lchId_type_table[]= {
MAC_CONTENT_PS_DTCH, /* 12 Streaming PS => DTCH*/
MAC_CONTENT_CS_DTCH, /* 13 Streaming CS*/
MAC_CONTENT_PS_DTCH, /* 14 Interatictive PS => DTCH*/
- MAC_CONTENT_UNKNOWN /* This is CCCH? */
+ MAC_CONTENT_CCCH /* This is CCCH? */
};
@@ -96,7 +96,7 @@ static const guint8 hsdsch_macdflow_id_mac_content_map[] = {
};
/* Make fake logical channel id's based on MACdFlow-ID's*/
-static const guint8 fake_lchid_macd_flow[] = {0,9,14,11,0,12};
+static const guint8 fake_lchid_macd_flow[] = {1,9,14,11,0,12};
static const value_string lchid_name_resolve[] = {
{1,"DCCH"}, /* 1 to 4 SRB => DCCH*/
diff --git a/asn1/rrc/packet-rrc-template.c b/asn1/rrc/packet-rrc-template.c
index def3d07e97..85a7f131ca 100644
--- a/asn1/rrc/packet-rrc-template.c
+++ b/asn1/rrc/packet-rrc-template.c
@@ -34,11 +34,14 @@
#include <glib.h>
#include <epan/packet.h>
#include <epan/asn1.h>
+#include <epan/conversation.h>
+#include <epan/expert.h>
#include "packet-ber.h"
#include "packet-per.h"
#include "packet-rrc.h"
#include "packet-gsm_a_common.h"
+#include "packet-umts_fp.h"
#ifdef _MSC_VER
/* disable: "warning C4049: compiler limit : terminating line number emission" */
@@ -51,6 +54,9 @@
#define PSNAME "RRC"
#define PFNAME "rrc"
+extern int proto_fp; /*Handler to FP*/
+
+
static dissector_handle_t gsm_a_dtap_handle;
static dissector_handle_t rrc_ue_radio_access_cap_info_handle=NULL;
static dissector_handle_t rrc_pcch_handle=NULL;
@@ -118,11 +124,15 @@ static const true_false_string rrc_eutra_feat_group_ind_4_val = {
"Undefined - Supported",
"Undefined - Not supported"
};
+static int flowd,type;
+
+static tvbuff_t * hrnti;
#include "packet-rrc-fn.c"
#include "packet-rrc.h"
+
static void
dissect_rrc(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
{
@@ -168,6 +178,31 @@ dissect_rrc(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
}
}
}
+gint rrc_key_cmp(gconstpointer a_ptr, gconstpointer b_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);
+}
+void rrc_free_key(gpointer key _U_){
+ /*Key's should be de allocated elsewhere.*/
+
+ }
+void rrc_free_value(gpointer value ){
+ g_free(value);
+ }
+void rrc_init(void){
+
+ /*Cleanup*/
+ if(hsdsch_muxed_flows){
+ g_tree_destroy(hsdsch_muxed_flows);
+ }
+ /*Initialize*/
+ hsdsch_muxed_flows = g_tree_new_full(rrc_key_cmp,
+ NULL, /* data pointer, optional */
+ rrc_free_key,
+ rrc_free_value);
+}
/*--- proto_register_rrc -------------------------------------------*/
void proto_register_rrc(void) {
@@ -216,6 +251,10 @@ void proto_register_rrc(void) {
#include "packet-rrc-dis-reg.c"
+
+
+
+ register_init_routine(rrc_init);
}
diff --git a/asn1/rrc/packet-rrc-template.h b/asn1/rrc/packet-rrc-template.h
index 86c7db5b70..ea21f0ffe6 100644
--- a/asn1/rrc/packet-rrc-template.h
+++ b/asn1/rrc/packet-rrc-template.h
@@ -26,6 +26,7 @@
#define PACKET_RRC_H
#include <epan/asn1.h> /* Needed for non asn1 dissectors?*/
+
extern int proto_rrc;
#include "packet-rrc-exp.h"
@@ -44,5 +45,9 @@ typedef struct rrc_info
{
enum rrc_message_type msgtype[MAX_RRC_FRAMES];
} rrc_info;
+/*Stores how many channels we have detected for a HS-DSCH MAC-flow*/
+#define MAX_NUM_HSDHSCH_MACDFLOW 8
+guint8 num_chans_per_flow[MAX_NUM_HSDHSCH_MACDFLOW];
+GTree * hsdsch_muxed_flows;
#endif /* PACKET_RRC_H */
diff --git a/asn1/rrc/rrc.cnf b/asn1/rrc/rrc.cnf
index 4ab1f1111a..a5925a67a0 100644
--- a/asn1/rrc/rrc.cnf
+++ b/asn1/rrc/rrc.cnf
@@ -656,5 +656,70 @@ HNBName TYPE=FT_STRING DISPLAY=BASE_NONE
}
rrc_nas_sys_info_gsm_map_type = RRC_NAS_SYS_INFO_CN_COMMON;
+/*Here we try to figure out which HS-DSCH channels are multiplexed*/
+/*TODO: Should this also be made under r7?*/
+#.FN_BODY DL-TransportChannelType-r5 VAL_PTR = &type
+
+ gint *flowd_p;
+ gint *cur_val=NULL;
+ guint16 hr=0;
+
+ %(DEFAULT_BODY)s
+
+ /*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(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,FALSE);
+ }
+ /*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);
+
+ }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
+
+#.FN_BODY SRB_InformationSetupList2_r6
+
+ %(DEFAULT_BODY)s
+ /*Clear memory*/
+ memset(num_chans_per_flow,0,sizeof(guint8));
+
+#.FN_BODY H_RNTI VAL_PTR = &hrnti
+
+
+
#.END