From Jacob Nordgren and Rishie Sharma:

Updated conversation handling to dissect FP/MAC/RLC

svn path=/trunk/; revision=43749
This commit is contained in:
Anders Broman 2012-07-16 13:11:20 +00:00
parent f41a04b7ab
commit fe630ec1df
11 changed files with 941 additions and 152 deletions

View File

@ -36,6 +36,7 @@ EXTRA_DIST = \
Makefile.nmake \
$(ASN_FILE_LIST) \
packet-$(PROTOCOL_NAME)-template.c \
packet-$(PROTOCOL_NAME)-template.h \
$(PROTOCOL_NAME).cnf
SRC_FILES = \

View File

@ -1,6 +1,8 @@
# nbap.cnf
# nbap conformation file
# Copyright 2005 Anders Broman
# Copyright 2005 - 2012 Anders Broman
# Modified 2012 by Jacob Nordgren <jacob.nordgren@ericsson.com> and
# Rishie Sharma <rishie.sharma@ericsson.com>
# $Id$
#.OPT
@ -648,10 +650,14 @@ nbap_dch_chnl_info[commonphysicalchannelid].next_dch = 0;
nbap_dch_chnl_info[commontransportchannelid].next_dch = 0;
#.FN_BODY E-DCH-MACdFlow-ID VAL_PTR = &e_dch_macdflow_id
%(DEFAULT_BODY)s
#.FN_BODY HSDSCH-MACdFlow-ID VAL_PTR = &hsdsch_macdflow_id
%(DEFAULT_BODY)s
hsdsch_macdflow_ids[num_items-1] = hsdsch_macdflow_id;
#.FN_BODY BindingID VAL_PTR = &parameter_tvb
tvbuff_t *parameter_tvb=NULL;
@ -1087,6 +1093,7 @@ dch_id = 0xFFFFFFFF;
conversation_set_dissector(conversation, fp_handle);
if(actx->pinfo->link_dir==P2P_DIR_DL){
umts_fp_conversation_info = se_new0(umts_fp_conversation_info_t);
/* Fill in the data */
umts_fp_conversation_info->iface_type = IuB_Interface;
umts_fp_conversation_info->division = Division_FDD;
@ -1099,6 +1106,8 @@ dch_id = 0xFFFFFFFF;
/* DCH's in this flow */
umts_fp_conversation_info->dch_crc_present = g_nbap_msg_info_for_fp.dch_crc_present;
/*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;
for (j = 0; j < num_tf; j++) {
@ -1112,14 +1121,18 @@ dch_id = 0xFFFFFFFF;
umts_fp_conversation_info->fp_dch_channel_info[0].dl_chan_tf_size[j] = nbap_dch_chnl_info[dch_id].dl_chan_tf_size[j];
umts_fp_conversation_info->fp_dch_channel_info[0].dl_chan_num_tbs[j] = nbap_dch_chnl_info[dch_id].dl_chan_num_tbs[j];
}
/* Set data for associated DCH's if we have any */
i = dch_id;
umts_fp_conversation_info->dchs_in_flow_list[0] = dch_id;
while(nbap_dch_chnl_info[i].next_dch != 0){
i = nbap_dch_chnl_info[i].next_dch;
umts_fp_conversation_info->num_dch_in_flow++;
umts_fp_conversation_info->dchs_in_flow_list[umts_fp_conversation_info->num_dch_in_flow] = i;
umts_fp_conversation_info->dchs_in_flow_list[umts_fp_conversation_info->num_dch_in_flow] = i; /*Set transport channel id*/
/*Setting Logical Channel's for this DCH*/
/* Traffic flows per DCH(UL) */
umts_fp_conversation_info->fp_dch_channel_info[umts_fp_conversation_info->num_dch_in_flow].num_ul_chans = num_tf = nbap_dch_chnl_info[i].num_ul_chans;
for (j = 0; j < num_tf; j++) {
@ -1138,6 +1151,9 @@ dch_id = 0xFFFFFFFF;
umts_fp_conversation_info->dchs_in_flow_list[umts_fp_conversation_info->num_dch_in_flow] = i;
set_umts_fp_conv_data(conversation, umts_fp_conversation_info);
}
nbap_debug1("Total number of chans for the flow will be: %%d", umts_fp_conversation_info->num_dch_in_flow);
}
@ -1183,6 +1199,7 @@ BindingID_port = 0;
umts_fp_conversation_info->ul_frame_number = actx->pinfo->fd->num;
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;
/* Set address for collection of DDI entries */
@ -1223,6 +1240,8 @@ guint32 no_ddi_entries, i;
for (i = 0; i < no_ddi_entries; i++) {
p_conv_data->edch_ddi[i] = nbap_edch_channel_info[e_dch_macdflow_id].edch_ddi[i];
p_conv_data->edch_macd_pdu_size[i] = nbap_edch_channel_info[e_dch_macdflow_id].edch_macd_pdu_size[i];
p_conv_data->edch_lchId[i] = nbap_edch_channel_info[e_dch_macdflow_id].lchId[i]; /*lchId_type_table[nbap_edch_channel_info[e_dch_macdflow_id].lchId[i]];*/
nbap_debug3("E-DCH-MACdFlow-Specific-InfoItem: e_dch_macdflow_id %%u edch_ddi %%u edch_macd_pdu_size %%u",
e_dch_macdflow_id,
nbap_edch_channel_info[e_dch_macdflow_id].edch_ddi[i],
@ -1232,7 +1251,13 @@ guint32 no_ddi_entries, i;
p_conv_data->dch_crc_present = g_nbap_msg_info_for_fp.dch_crc_present;
p_conv_data->edch_type = 0; /* 1 means T2 */
/* Figure out which type of E-DCH frame, based on DDI value (DDI = 0 => type 2)*/
if( 0 == e_dch_ddi_value ){
p_conv_data->edch_type = 1; /* 1 means T2 */
}else{
p_conv_data->edch_type = 0; /* 1 means T2 */
}
/* use to display e_dch_macdflow_id */
p_conv_data->num_dch_in_flow = 1;
p_conv_data->dchs_in_flow_list[0] = e_dch_macdflow_id;
@ -1267,6 +1292,15 @@ guint32 no_ddi_entries, i;
}
nbap_edch_channel_info[e_dch_macdflow_id].edch_macd_pdu_size[num_items-1] = MACdPDU_Size;
#.FN_BODY LogicalChannelID VAL_PTR = &logical_channel_id
/* Set logical channel id for this entry*/
%(DEFAULT_BODY)s
nbap_edch_channel_info[e_dch_macdflow_id].lchId[num_items-1] = logical_channel_id;
#.FN_BODY RLC-Mode VAL_PTR = &rlc_mode
guint32 rlc_mode;
@ -1280,6 +1314,8 @@ guint32 no_ddi_entries, i;
/* rLC-UM */
nbap_hsdsch_channel_info[hsdsch_macdflow_id].rlc_mode = FP_RLC_UM;
break;
default:
break;
}
#.FN_BODY UE-Capability-Information/hSDSCH-Physical-Layer-Category VAL_PTR = &hsdsch_physical_layer_category
@ -1289,12 +1325,17 @@ guint32 no_ddi_entries, i;
nbap_hsdsch_channel_info[hsdsch_macdflow_id].hsdsch_physical_layer_category = hsdsch_physical_layer_category;
#.FN_BODY HSDSCH-MACdFlows-Information
num_items = 0;
%(DEFAULT_BODY)s
#.FN_BODY HSDSCH-MACdFlow-Specific-InfoItem
address dst_addr;
transportLayerAddress_ipv4 = 0;
BindingID_port = 0;
num_items++;
%(DEFAULT_BODY)s
if (actx->pinfo->fd->flags.visited||transportLayerAddress_ipv4==0||BindingID_port == 0)
@ -1311,6 +1352,22 @@ guint32 no_ddi_entries, i;
nbap_hsdsch_channel_info[hsdsch_macdflow_id].crnc_port = BindingID_port;
#.FN_BODY HSDSCH-MACdPDUSizeFormat
/*
* Set the channel entity i.e the type of the hsdch channels (if this is present entity = ehs)
*/
int i;
%(DEFAULT_BODY)s
/* */
for (i = 0; i < maxNrOfMACdFlows; i++) {
if (nbap_hsdsch_channel_info[i].crnc_port != 0){
nbap_hsdsch_channel_info[i].entity = ehs;
nbap_debug1("Setting entity = ehs for HSDSCH channel: %%d\n",i);
}
}
#.FN_BODY HSDSCH-FDD-Information
/*
* Collect the information about the HSDSCH MACdFlows set up conversation(s) and set the conversation data.
@ -1325,6 +1382,8 @@ guint32 no_ddi_entries, i;
for (i = 0; i < maxNrOfMACdFlows; i++) {
nbap_hsdsch_channel_info[i].crnc_port = 0;
nbap_hsdsch_channel_info[i].rlc_mode = FP_RLC_MODE_UNKNOWN;
/*XXX: Added 29 jun*/
nbap_hsdsch_channel_info[i].entity = entity_not_specified; /* Maybe this should default to entity = hs*/
}
}
@ -1367,15 +1426,24 @@ guint32 no_ddi_entries, i;
umts_fp_conversation_info->ul_frame_number = actx->pinfo->fd->num;
SE_COPY_ADDRESS(&(umts_fp_conversation_info->crnc_address), &nbap_hsdsch_channel_info[i].crnc_address);
umts_fp_conversation_info->crnc_port = nbap_hsdsch_channel_info[i].crnc_port;
/*Added june 3, normally just the iterator variable*/
umts_fp_conversation_info->hsdsch_macdflow_id = i ; /*hsdsch_macdflow_ids[i];*/ /* hsdsch_macdflow_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;
if(nbap_hsdsch_channel_info[i].hsdsch_physical_layer_category > 12){
umts_fp_conversation_info->hsdsch_entity = ehs;
/*XXX: Is this craziness, what is physical_layer? */
if(nbap_hsdsch_channel_info[i].entity == entity_not_specified ){
if(nbap_hsdsch_channel_info[i].hsdsch_physical_layer_category > 12){
umts_fp_conversation_info->hsdsch_entity = ehs;
}else{
umts_fp_conversation_info->hsdsch_entity = hs;
}
}else{
umts_fp_conversation_info->hsdsch_entity = hs;
umts_fp_conversation_info->hsdsch_entity = nbap_hsdsch_channel_info[i].entity;
}
umts_fp_conversation_info->rlc_mode = nbap_hsdsch_channel_info[i].rlc_mode;
set_umts_fp_conv_data(conversation, umts_fp_conversation_info);
@ -1384,6 +1452,85 @@ guint32 no_ddi_entries, i;
}
}
#.FN_BODY Common-MACFlow-ID VAL_PTR = &common_macdflow_id
%(DEFAULT_BODY)s
/*hsdsch_macdflow_ids[num_items-1] = hsdsch_macdflow_id;*/
/*THIS STUFF IST NOT DONE YET!*/
#.FN_BODY CommonMACFlow-Specific-InfoItem
address dst_addr;
transportLayerAddress_ipv4 = 0;
BindingID_port = 0;
num_items++;
%(DEFAULT_BODY)s
if (actx->pinfo->fd->flags.visited||transportLayerAddress_ipv4==0||BindingID_port == 0)
{
return offset;
}
dst_addr.type=AT_IPv4;
dst_addr.len=4;
dst_addr.data=(guint8 *)&transportLayerAddress_ipv4;
/* Set address for collection of common entries */
COPY_ADDRESS(&(nbap_common_channel_info[common_macdflow_id].crnc_address),&dst_addr);
nbap_common_channel_info[common_macdflow_id].crnc_port = BindingID_port;
#.FN_BODY HSDSCH-Common-System-InformationFDD
umts_fp_conversation_info_t *umts_fp_conversation_info = NULL;
address null_addr;
conversation_t *conversation = NULL;
int i;
if (!actx->pinfo->fd->flags.visited){
/* Set port to zero use that as an indication of wether we have data or not */
for (i = 0; i < maxNrOfCommonMACFlows; i++) {
nbap_common_channel_info[i].crnc_port = 0;
nbap_common_channel_info[i].rlc_mode = FP_RLC_MODE_UNKNOWN;
}
}
%(DEFAULT_BODY)s
/* Set port to zero use that as an indication of wether we have data or not */
SET_ADDRESS(&null_addr, AT_NONE, 0, NULL);
for (i = 0; i < maxNrOfCommonMACFlows; i++) {
if (nbap_common_channel_info[i].crnc_port != 0){
conversation = find_conversation(actx->pinfo->fd->num, &(nbap_common_channel_info[i].crnc_address), &null_addr,
PT_UDP,
nbap_common_channel_info[i].crnc_port, 0, NO_ADDR_B);
if (conversation == NULL) {
conversation = conversation_new(actx->pinfo->fd->num, &(nbap_common_channel_info[i].crnc_address),
&null_addr, PT_UDP, nbap_common_channel_info[i].crnc_port,
0, NO_ADDR2|NO_PORT2);
/* Set dissector */
conversation_set_dissector(conversation, fp_handle);
/*Set NBAP configuration to lower layers*/
if(actx->pinfo->link_dir==P2P_DIR_DL){
umts_fp_conversation_info = se_new0(umts_fp_conversation_info_t);
umts_fp_conversation_info->channel = CHANNEL_HSDSCH_COMMON;
set_umts_fp_conv_data(conversation, umts_fp_conversation_info);
}
}
}
}
#.REGISTER_NEW

View File

@ -39,7 +39,10 @@
#include "packet-per.h"
#include "packet-isup.h"
#include "packet-umts_fp.h"
#include "packet-umts_mac.h"
#include "packet-rrc.h"
#include "packet-rlc.h"
#include "packet-nbap.h"
#ifdef _MSC_VER
/* disable: "warning C4146: unary minus operator applied to unsigned type, result still unsigned" */
@ -129,6 +132,7 @@ typedef struct
guint8 edch_ddi[MAX_EDCH_DDIS];
guint edch_macd_pdu_size[MAX_EDCH_DDIS];
guint8 edch_type; /* 1 means T2 */
guint8 lchId[MAX_EDCH_DDIS]; /*Logical channel ids.*/
} nbap_edch_channel_info_t;
@ -140,13 +144,25 @@ typedef struct
guint16 crnc_port;
enum fp_rlc_mode rlc_mode;
guint32 hsdsch_physical_layer_category;
guint8 entity; /* "ns" means type 1 and "ehs" means type 2, type 3 == ?*/
} nbap_hsdsch_channel_info_t;
nbap_hsdsch_channel_info_t nbap_hsdsch_channel_info[maxNrOfMACdFlows];
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!*/
gint g_num_dch_in_flow;
/* maxNrOfTFs INTEGER ::= 32 */
gint g_dchs_in_flow_list[maxNrOfTFs];
gint hsdsch_macdflow_ids[maxNrOfMACdFlows];
struct _nbap_msg_info_for_fp g_nbap_msg_info_for_fp;
/* Global variables */
@ -154,7 +170,8 @@ static guint32 ProcedureCode;
static guint32 ProtocolIE_ID;
static guint32 ddMode;
static const gchar *ProcedureID;
static guint32 t_dch_id, dch_id, prev_dch_id, commonphysicalchannelid, e_dch_macdflow_id, hsdsch_macdflow_id, e_dch_ddi_value;
static guint32 t_dch_id, dch_id, prev_dch_id, commonphysicalchannelid, e_dch_macdflow_id, hsdsch_macdflow_id=3,
e_dch_ddi_value,logical_channel_id,common_macdflow_id;
static guint32 MACdPDU_Size, commontransportchannelid;
static guint num_items;
static gint paging_indications;
@ -171,6 +188,16 @@ enum TransportFormatSet_type_enum
enum TransportFormatSet_type_enum transportFormatSet_type;
/****************************/
/* GUI Stuff */
typedef struct _attribute_type_t {
gchar* attribute_type;
gchar* attribute_desc;
} attribute_type_t;
static attribute_type_t* attribute_types = NULL;
static guint num_attribute_types = 0;
static GHashTable* attribute_types_hash = NULL;
/* Dissector tables */
static dissector_table_t nbap_ies_dissector_table;
static dissector_table_t nbap_extension_dissector_table;
@ -184,6 +211,7 @@ static int dissect_InitiatingMessageValue(tvbuff_t *tvb, packet_info *pinfo, pro
static int dissect_SuccessfulOutcomeValue(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree);
static int dissect_UnsuccessfulOutcomeValue(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree);
#include "packet-nbap-fn.c"
static int dissect_ProtocolIEFieldValue(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
@ -230,6 +258,30 @@ dissect_nbap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
dissect_NBAP_PDU_PDU(tvb, pinfo, nbap_tree);
}
static void
attribute_types_initialize_cb(void)
{
}
static void
attribute_types_free_cb(void*r)
{
}
static void
attribute_types_update_cb(void *r, const char **err)
{
g_warning("Running attr types update");
}
static void *
attribute_types_copy_cb(void* n, const void* o, size_t siz _U_)
{
return NULL;
}
/*--- proto_register_nbap -------------------------------------------*/
void proto_register_nbap(void) {
@ -260,7 +312,15 @@ void proto_register_nbap(void) {
#include "packet-nbap-ettarr.c"
};
/* UAT for header fields */
/* static uat_field_t custom_attribute_types_uat_fields[] = {
UAT_FLD_CSTRING(attribute_types, attribute_type, "Attribute type", "Attribute type"),
UAT_FLD_CSTRING(attribute_types, attribute_desc, "Description", "Description of the value matching type"),
UAT_END_FIELDS
};
*/
/*uat_t *attributes_uat;*/
/* Register protocol */
proto_nbap = proto_register_protocol(PNAME, PSNAME, PFNAME);
/* Register fields and subtrees */
@ -270,6 +330,27 @@ void proto_register_nbap(void) {
/* Register dissector */
register_dissector("nbap", dissect_nbap, proto_nbap);
/* Setting up GUI stuff*/
/* UAT */
/*attributes_uat = uat_new("Custom NBAP maps",
sizeof(attribute_type_t),
"custom_ldap_attribute_types",
TRUE,
(void*) &attribute_types,
&num_attribute_types,
UAT_CAT_FIELDS,
NULL,
attribute_types_copy_cb,
attribute_types_update_cb,
attribute_types_free_cb,
attribute_types_initialize_cb,
custom_attribute_types_uat_fields);*/
/*prefs_register_uat_preference(nbap_module, "custom_ldap_attribute_types",
"Custom AttributeValue types",
"A table to define custom LDAP attribute type values for which fields can be setup and used for filtering/data extraction etc.",
attributes_uat);*/
/* Register dissector tables */
nbap_ies_dissector_table = register_dissector_table("nbap.ies", "NBAP-PROTOCOL-IES", FT_UINT32, BASE_DEC);
nbap_extension_dissector_table = register_dissector_table("nbap.extension", "NBAP-PROTOCOL-EXTENSION", FT_UINT32, BASE_DEC);

View File

@ -0,0 +1,116 @@
/* packet-nbap-template.h
*
* $Id$
*
* Wireshark - Network traffic analyzer
* By Gerald Combs <gerald@wireshark.org>
* Copyright 1998 Gerald Combs
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#ifndef PACKET_NBAP_H
#define PACKET_NBAP_H
/*
* Ericsson specific mapping for various dissector settings.
* Must be altered for other equipment.
*/
/*Array are indexed on logical channel id, meaning they need to be defined for 1-15*/
/* Mapping from logical channel id to MAC content type ie. DCCH or DTCH*/
static const guint8 lchId_type_table[]= {
MAC_CONTENT_UNKNOWN, /*Should't happen*/
MAC_CONTENT_DCCH, /* 1 to 4 SRB => DCCH*/
MAC_CONTENT_DCCH,
MAC_CONTENT_DCCH,
MAC_CONTENT_DCCH,
MAC_CONTENT_CS_DTCH, /* 5 to 7 Conv CS speech => ?*/
MAC_CONTENT_CS_DTCH,
MAC_CONTENT_CS_DTCH,
MAC_CONTENT_DCCH, /* 8 SRB => DCCH*/
MAC_CONTENT_PS_DTCH, /* 9 maps to DTCH*/
MAC_CONTENT_UNKNOWN, /* 10 Conv CS unknown*/
MAC_CONTENT_PS_DTCH, /* 11 Interactive PS => DTCH*/
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? */
};
/* Mapping logicalchannel id to RLC_MODE */
static const guint8 lchId_rlc_map[] = {
0,
RLC_UM, /* Logical channel id = 1 is SRB1 which uses RLC_UM*/
RLC_AM,
RLC_AM,
RLC_AM,
RLC_TM, /*5 to 7 Conv CS Speech*/
RLC_TM,
RLC_TM, /*...*/
RLC_AM,
RLC_AM,
RLC_AM,
RLC_AM,
RLC_AM,
RLC_AM,
RLC_AM,
RLC_AM, /* This is CCCH which is UM?, probably not */
};
/* 1 to 8*/
static const guint8 hsdsch_macdflow_id_rlc_map[] = {
RLC_UM, /*1 SRB */
RLC_AM, /*2 Interactive PS*/
RLC_AM, /*3 Interatcive PS*/
RLC_UNKNOWN_MODE, /*4 ???*/
RLC_AM, /*5 Streaming PS*/
RLC_UNKNOWN_MODE,
RLC_UNKNOWN_MODE
};
/* Mapping hsdsch MACd-FlowId to MAC_CONTENT, basically flowid = 1 (0) => SRB*/
/* 1 to 8*/
static const guint8 hsdsch_macdflow_id_mac_content_map[] = {
MAC_CONTENT_DCCH, /*1 SRB */
MAC_CONTENT_PS_DTCH, /*2 Interactive PS*/
MAC_CONTENT_PS_DTCH, /*3 Interatcive PS*/
RLC_UNKNOWN_MODE, /*4 ???*/
MAC_CONTENT_PS_DTCH, /*5 Streaming PS*/
RLC_UNKNOWN_MODE,
RLC_UNKNOWN_MODE,
RLC_UNKNOWN_MODE
};
/* 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 value_string lchid_name_resolve[] = {
{1,"DCCH"}, /* 1 to 4 SRB => DCCH*/
{2,"DCCH"},
{3,"DCCH"},
{4,"DCCH"},
{8,"DCCH"}, /* 8 SRB => DCCH*/
{9,"DTCH"}, /*9 maps to DTCH*/
{10,"UNKNOWN"}, /*10 Conv CS unknown*/
{11,"DTCH"}, /*11 Interactive PS => DTCH*/
{12,"DTCH"}, /*12 13 Streaming PS => DTCH*/
{13,"DTCH"},
{14,"DTCH"}, /*14 Interatictive PS => DTCH*/
{15,"MAC_CONTENT_UNKNOWN"},
{0, NULL} /* This is CCCH? */
};
#endif

View File

@ -1362,6 +1362,7 @@ DISSECTOR_INCLUDES = \
packet-msrp.h \
packet-mstp.h \
packet-mtp3.h \
packet-nbap.h \
packet-ncp-int.h \
packet-ncp-nmas.h \
packet-ncp-sss.h \

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,124 @@
/* Do not modify this file. */
/* It is created automatically by the ASN.1 to Wireshark dissector compiler */
/* packet-nbap.h */
/* ../../tools/asn2wrs.py -p nbap -c ./nbap.cnf -s ./packet-nbap-template -D . -O ../../epan/dissectors NBAP-CommonDataTypes.asn NBAP-Constants.asn NBAP-Containers.asn NBAP-IEs.asn NBAP-PDU-Contents.asn NBAP-PDU-Descriptions.asn */
/* Input file: packet-nbap-template.h */
#line 1 "../../asn1/nbap/packet-nbap-template.h"
/* packet-nbap-template.h
*
* $Id$
*
* Wireshark - Network traffic analyzer
* By Gerald Combs <gerald@wireshark.org>
* Copyright 1998 Gerald Combs
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#ifndef PACKET_NBAP_H
#define PACKET_NBAP_H
/*
* Ericsson specific mapping for various dissector settings.
* Must be altered for other equipment.
*/
/*Array are indexed on logical channel id, meaning they need to be defined for 1-15*/
/* Mapping from logical channel id to MAC content type ie. DCCH or DTCH*/
static const guint8 lchId_type_table[]= {
MAC_CONTENT_UNKNOWN, /*Should't happen*/
MAC_CONTENT_DCCH, /* 1 to 4 SRB => DCCH*/
MAC_CONTENT_DCCH,
MAC_CONTENT_DCCH,
MAC_CONTENT_DCCH,
MAC_CONTENT_CS_DTCH, /* 5 to 7 Conv CS speech => ?*/
MAC_CONTENT_CS_DTCH,
MAC_CONTENT_CS_DTCH,
MAC_CONTENT_DCCH, /* 8 SRB => DCCH*/
MAC_CONTENT_PS_DTCH, /* 9 maps to DTCH*/
MAC_CONTENT_UNKNOWN, /* 10 Conv CS unknown*/
MAC_CONTENT_PS_DTCH, /* 11 Interactive PS => DTCH*/
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? */
};
/* Mapping logicalchannel id to RLC_MODE */
static const guint8 lchId_rlc_map[] = {
0,
RLC_UM, /* Logical channel id = 1 is SRB1 which uses RLC_UM*/
RLC_AM,
RLC_AM,
RLC_AM,
RLC_TM, /*5 to 7 Conv CS Speech*/
RLC_TM,
RLC_TM, /*...*/
RLC_AM,
RLC_AM,
RLC_AM,
RLC_AM,
RLC_AM,
RLC_AM,
RLC_AM,
RLC_AM, /* This is CCCH which is UM?, probably not */
};
/* 1 to 8*/
static const guint8 hsdsch_macdflow_id_rlc_map[] = {
RLC_UM, /*1 SRB */
RLC_AM, /*2 Interactive PS*/
RLC_AM, /*3 Interatcive PS*/
RLC_UNKNOWN_MODE, /*4 ???*/
RLC_AM, /*5 Streaming PS*/
RLC_UNKNOWN_MODE,
RLC_UNKNOWN_MODE
};
/* Mapping hsdsch MACd-FlowId to MAC_CONTENT, basically flowid = 1 (0) => SRB*/
/* 1 to 8*/
static const guint8 hsdsch_macdflow_id_mac_content_map[] = {
MAC_CONTENT_DCCH, /*1 SRB */
MAC_CONTENT_PS_DTCH, /*2 Interactive PS*/
MAC_CONTENT_PS_DTCH, /*3 Interatcive PS*/
RLC_UNKNOWN_MODE, /*4 ???*/
MAC_CONTENT_PS_DTCH, /*5 Streaming PS*/
RLC_UNKNOWN_MODE,
RLC_UNKNOWN_MODE,
RLC_UNKNOWN_MODE
};
/* 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 value_string lchid_name_resolve[] = {
{1,"DCCH"}, /* 1 to 4 SRB => DCCH*/
{2,"DCCH"},
{3,"DCCH"},
{4,"DCCH"},
{8,"DCCH"}, /* 8 SRB => DCCH*/
{9,"DTCH"}, /*9 maps to DTCH*/
{10,"UNKNOWN"}, /*10 Conv CS unknown*/
{11,"DTCH"}, /*11 Interactive PS => DTCH*/
{12,"DTCH"}, /*12 13 Streaming PS => DTCH*/
{13,"DTCH"},
{14,"DTCH"}, /*14 Interatictive PS => DTCH*/
{15,"MAC_CONTENT_UNKNOWN"},
{0, NULL} /* This is CCCH? */
};
#endif

View File

@ -32,6 +32,8 @@
#include <epan/prefs.h>
#include <epan/conversation.h>
#include <wsutil/crc7.h>
#include "packet-umts_mac.h"
#include "packet-rlc.h"
#include "packet-umts_fp.h"
@ -209,6 +211,7 @@ static dissector_handle_t mac_fdd_fach_handle;
static dissector_handle_t mac_fdd_pch_handle;
static dissector_handle_t mac_fdd_edch_handle;
static dissector_handle_t mac_fdd_hsdsch_handle;
static dissector_handle_t fp_handle;
static proto_tree *top_level_tree = NULL;
@ -3165,7 +3168,35 @@ heur_dissect_fp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
p_fp_info = (fp_info *)p_get_proto_data(pinfo->fd, proto_fp);
/* if no FP info is present, assume this is not FP over UDP */
if (!p_fp_info) return FALSE;
if (!p_fp_info) {
/* We only know the header length of control frames, so check that bit first */
int offset = 0, length;
guint8 oct, calc_crc = 0, crc;
unsigned char *buf;
oct = tvb_get_guint8(tvb, offset);
crc = oct & 0xfe;
if ((oct & 0x01) == 1){
/*
* 6.3.2.1 Frame CRC
* Description: It is the result of the CRC applied to the remaining part of the frame,
* i.e. from bit 0 of the first byte of the header (the FT IE) to bit 0 of the last byte of the payload,
* with the corresponding generator polynomial: G(D) = D7+D6+D2+1. See subclause 7.2.
*/
length = tvb_length(tvb);
buf = ep_tvb_memdup(tvb, 0, length);
buf[0] = 01;
calc_crc = crc7update(calc_crc, buf, length);
if(calc_crc == crc){
/* assume this is FP, set conversatio dissector to catch the data frames too */
conversation_set_dissector(find_or_create_conversation(pinfo), fp_handle);
dissect_fp(tvb, pinfo, tree);
return TRUE;
}
}
return FALSE;
}
/* if FP info is present, check that it really is an ethernet link */
if (p_fp_info->link_type != FP_Link_Ethernet) {
@ -4625,6 +4656,7 @@ void proto_reg_handoff_fp(void)
mac_fdd_dch_handle = find_dissector("mac.fdd.dch");
mac_fdd_edch_handle = find_dissector("mac.fdd.edch");
mac_fdd_hsdsch_handle = find_dissector("mac.fdd.hsdsch");
fp_handle = find_dissector("fp");
heur_dissector_add("udp", heur_dissect_fp, proto_fp);
}

View File

@ -101,6 +101,9 @@ typedef struct fp_info
gint no_ddi_entries;
guint8 edch_ddi[MAX_EDCH_DDIS];
guint edch_macd_pdu_size[MAX_EDCH_DDIS];
guint edch_lchId[MAX_EDCH_DDIS]; /* Logical Channel Id for E-DCH*/
guint8 edch_type; /* 1 means T2 */
gint cur_tb; /* current transport block (required for dissecting of single TBs */
@ -110,6 +113,7 @@ typedef struct fp_info
/* HSDSCH Related data */
enum fp_hsdsch_entity hsdsch_entity;
gint hsdsch_macflowd_id;
enum fp_link_type link_type;
} fp_info;
@ -155,10 +159,12 @@ typedef struct
gint no_ddi_entries;
guint8 edch_ddi[MAX_EDCH_DDIS];
guint edch_macd_pdu_size[MAX_EDCH_DDIS];
guint8 edch_lchId[MAX_EDCH_DDIS];
guint8 edch_type; /* 1 means T2 */
/* HSDSCH Related data */
enum fp_hsdsch_entity hsdsch_entity;
guint8 hsdsch_macdflow_id;
} umts_fp_conversation_info_t;
void set_umts_fp_conv_data(conversation_t *conversation, umts_fp_conversation_info_t *umts_fp_conversation_info);

View File

@ -29,10 +29,13 @@
#include <epan/packet.h>
#include <epan/conversation.h>
#include <epan/expert.h>
#include "packet-rrc.h"
#include "packet-umts_fp.h"
#include "packet-rlc.h"
#include "packet-umts_mac.h"
#include "packet-rlc.h"
#include "packet-nbap.h"
int proto_umts_mac = -1;
extern int proto_fp;
@ -61,6 +64,7 @@ static dissector_handle_t rlc_ccch_handle;
static dissector_handle_t rlc_ctch_handle;
static dissector_handle_t rlc_dcch_handle;
static dissector_handle_t rlc_ps_dtch_handle;
static dissector_handle_t rrc_handle;
static const value_string rach_fdd_tctf_vals[] = {
{ TCTF_CCCH_RACH_FDD , "CCCH over RACH (FDD)" },
@ -85,15 +89,6 @@ static const value_string ueid_type_vals[] = {
{ 0, NULL }
};
#define MAC_PCCH 0
#define MAC_CCCH 1
#define MAC_CTCH 2
#define MAC_DCCH 3
#define MAC_DTCH 4
#define MAC_BCCH 5
#define MAC_MCCH 6
#define MAC_MSCH 7
#define MAC_MTCH 8
static const value_string mac_logical_channel_vals[] = {
{ MAC_PCCH, "PCCH" },
{ MAC_CCCH, "CCCH" },
@ -269,15 +264,17 @@ static void dissect_mac_fdd_rach(tvbuff_t *tvb, packet_info *pinfo, proto_tree *
static void dissect_mac_fdd_fach(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
{
guint8 hdr, tctf;
guint16 bitoffs = 0;
guint16 tctf_len, chan;
proto_tree *fach_tree = NULL;
proto_item *channel_type;
umts_mac_info *macinf;
fp_info *fpinf;
rlc_info *rlcinf;
proto_item *ti = NULL;
guint8 hdr, tctf;
guint16 bitoffs = 0;
guint16 tctf_len, chan;
proto_tree *fach_tree = NULL;
proto_item *channel_type;
umts_mac_info *macinf;
fp_info *fpinf;
rlc_info *rlcinf;
struct rrc_info *rrcinf;
proto_item *ti = NULL;
gint c_t;
hdr = tvb_get_guint8(tvb, 0);
@ -320,9 +317,13 @@ static void dissect_mac_fdd_fach(tvbuff_t *tvb, packet_info *pinfo, proto_tree *
next_tvb = tvb_new_subset(tvb, 1, tvb_length_remaining(tvb, 1), -1);
call_dissector(rlc_ccch_handle, next_tvb, pinfo, tree);
break;
case TCTF_DCCH_DTCH_FACH_FDD:
switch (macinf->content[fpinf->cur_tb]) {
case MAC_CONTENT_DCCH:
case TCTF_DCCH_DTCH_FACH_FDD:
/*Set RLC Mode based on the L-CHID derived from the C/T flag*/
c_t = tvb_get_bits8(tvb,bitoffs-4,4);
rlcinf->mode[fpinf->cur_tb] = lchId_rlc_map[c_t+1];
switch (macinf->content[fpinf->cur_tb]) {
case MAC_CONTENT_DCCH:
proto_item_append_text(ti, " (DCCH)");
channel_type = proto_tree_add_uint(fach_tree, hf_mac_channel, tvb, 0, 0, MAC_DCCH);
PROTO_ITEM_SET_GENERATED(channel_type);
@ -354,9 +355,32 @@ static void dissect_mac_fdd_fach(tvbuff_t *tvb, packet_info *pinfo, proto_tree *
next_tvb = tvb_new_subset(tvb, 1, tvb_length_remaining(tvb, 1), -1);
call_dissector(rlc_ctch_handle, next_tvb, pinfo, tree);
break;
default:
proto_item_append_text(ti, " (Unknown FACH Content)");
}
case TCTF_BCCH_FACH_FDD:
proto_item_append_text(ti, " (BCCH)");
channel_type = proto_tree_add_uint(fach_tree, hf_mac_channel, tvb, 0, 0, MAC_BCCH);
PROTO_ITEM_SET_GENERATED(channel_type);
/*We need to skip the first two bits (the TCTF bits), and since there is no MAC header, send rest to RRC*/
next_tvb= tvb_new_octet_aligned(tvb, 2, (tvb_length(tvb)*8)-2);
add_new_data_source(pinfo, next_tvb, "Octet-Aligned BCCH Data");
/* In this case skip RLC and call RRC immediately subdissector */
rrcinf = p_get_proto_data(pinfo->fd, proto_rrc);
if (!rrcinf) {
rrcinf = se_alloc0(sizeof(struct rrc_info));
rrcinf->msgtype[fpinf->cur_tb] = RRC_MESSAGE_TYPE_BCCH_FACH;
p_add_proto_data(pinfo->fd, proto_rrc, rrcinf);
}
call_dissector(rrc_handle, next_tvb, pinfo, tree);
break;
case TCTF_MSCH_FACH_FDD:
case TCTF_MCCH_FACH_FDD:
case TCTF_MTCH_FACH_FDD:
break;
expert_add_info_format(pinfo, NULL, PI_DEBUG, PI_ERROR, " Unimplemented FACH Content type!");
default:
proto_item_append_text(ti, " (Unknown FACH Content)");
}
}
static void dissect_mac_fdd_dch(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
@ -596,5 +620,7 @@ proto_reg_handoff_umts_mac(void)
rlc_ctch_handle = find_dissector("rlc.ctch");
rlc_dcch_handle = find_dissector("rlc.dcch");
rlc_ps_dtch_handle = find_dissector("rlc.ps_dtch");
rrc_handle = find_dissector("rrc");
}

View File

@ -21,6 +21,9 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#ifndef PACKET_UMTS_MAC_H
#define PACKET_UMTS_MAC_H
/* Target Channel Type Field (TCTF) values */
#define TCTF_CCCH_RACH_FDD 0x0
#define TCTF_DCCH_DTCH_RACH_FDD 0x1
@ -41,10 +44,30 @@
#define MAC_CONTENT_DCCH 1
#define MAC_CONTENT_PS_DTCH 2
#define MAC_CONTENT_CS_DTCH 3
#define MAC_CONTENT_CCCH 4
/* Used for mapping id to string names*/
#define MAC_PCCH 0
#define MAC_CCCH 1
#define MAC_CTCH 2
#define MAC_DCCH 3
#define MAC_DTCH 4
#define MAC_BCCH 5
#define MAC_MCCH 6
#define MAC_MSCH 7
#define MAC_MTCH 8
#define MAX_MAC_FRAMES 64
typedef struct umts_mac_info
{
gboolean ctmux[MAX_MAC_FRAMES];
guint8 content[MAX_MAC_FRAMES];
guint8 lchid[MAX_MAC_FRAMES]; /*Makes displaying logical channel alot easier*/
guint8 macdflow_id[MAX_MAC_FRAMES]; /*Makes displaying logical channel alot easier*/
gboolean fake_chid[MAX_MAC_FRAMES]; /*Indicate if the child ID is faked or not*/
guint pdu_len; /*Length of MAC PDU, same for all PDUs in one FP frame*/
guint8 trchid[MAX_MAC_FRAMES]; /*Makes displaying logical channel alot easier*/
} umts_mac_info;
#endif