aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-k12.c
diff options
context:
space:
mode:
authorMartin Mathieson <martin.r.mathieson@googlemail.com>2007-05-08 17:13:14 +0000
committerMartin Mathieson <martin.r.mathieson@googlemail.com>2007-05-08 17:13:14 +0000
commitaac8ca13557c0b6e4c8cdfe4942c8dbeabb2a62c (patch)
tree57baac369b3c46d5d6d6759117f01c568455c847 /epan/dissectors/packet-k12.c
parent5b41e5bec5c74eddf98f2f58583873079b95a335 (diff)
From Kriang Lerdsuwanakij:
This patch adds the handling of Spare Extension bytes to UMTS Frame Protocol. It also handles the case when the presence of CRC in dedicated channels is not known (i.e. when FP from a K12/K15 log is dissected). The new functionality is placed in the new function "dissect_spare_extension_and_crc". The "dch_crc_present" field inside "struct fp_info" (file packet-umts_fp.h) is also extended to handle the case of unknown CRC presence. Much of other changes is to update "offset" variable and return it so that the location of Spare Extension and CRC is available. The patch also include a small tweak to handle Frame Protocol information saved from K15. Some fields appear 8 bytes later compared to K12. The changes are in the file packet-k12.c. svn path=/trunk/; revision=21726
Diffstat (limited to 'epan/dissectors/packet-k12.c')
-rw-r--r--epan/dissectors/packet-k12.c21
1 files changed, 14 insertions, 7 deletions
diff --git a/epan/dissectors/packet-k12.c b/epan/dissectors/packet-k12.c
index 1bf3d78a64..b94e1dca4e 100644
--- a/epan/dissectors/packet-k12.c
+++ b/epan/dissectors/packet-k12.c
@@ -86,6 +86,7 @@ static const value_string k12_port_types[] = {
};
static void fill_fp_info(fp_info *p_fp_info, guchar *extra_info, guint length) {
+ guint adj = 0;
/* 0x11=control frame 0x30=data frame */
guint info_type = pntohs(extra_info);
/* 1=FDD, 2=TDD 3.84, 3=TDD 1.28 */
@@ -96,6 +97,11 @@ static void fill_fp_info(fp_info *p_fp_info, guchar *extra_info, guint length) {
if (!p_fp_info || length < 22)
return;
+ /* Format used by K15, later fields are
+ shifted by 8 bytes. */
+ if (pntohs(extra_info+2) == 5)
+ adj = 8;
+
p_fp_info->iface_type = IuB_Interface;
p_fp_info->release = 0; /* dummy */
@@ -109,9 +115,10 @@ static void fill_fp_info(fp_info *p_fp_info, guchar *extra_info, guint length) {
p_fp_info->is_uplink = 0;
if (info_type == 0x11) /* control frame */
- channel_type = extra_info[21];
+ channel_type = extra_info[21 + adj];
else if (info_type == 0x30) /* data frame */
- channel_type = extra_info[22];
+ channel_type = extra_info[22 + adj];
+
switch (channel_type) {
case 1:
p_fp_info->channel = CHANNEL_BCH;
@@ -154,14 +161,14 @@ static void fill_fp_info(fp_info *p_fp_info, guchar *extra_info, guint length) {
break;
}
- p_fp_info->dch_crc_present = 1; /* dummy */
+ p_fp_info->dch_crc_present = 2; /* information not available */
if (info_type == 0x30) { /* data frame */
- p_fp_info->num_chans = extra_info[23];
- for (i = 0; i < (guint)p_fp_info->num_chans && (36+i*104) <= length; ++i) {
- p_fp_info->chan_tf_size[i] = pntohl(extra_info+28+i*104);
+ p_fp_info->num_chans = extra_info[23 + adj];
+ for (i = 0; i < (guint)p_fp_info->num_chans && (36+i*104+adj) <= length; ++i) {
+ p_fp_info->chan_tf_size[i] = pntohl(extra_info+28+i*104+adj);
if (p_fp_info->chan_tf_size[i])
- p_fp_info->chan_num_tbs[i] = pntohl(extra_info+32+i*104)
+ p_fp_info->chan_num_tbs[i] = pntohl(extra_info+32+i*104+adj)
/ p_fp_info->chan_tf_size[i];
}
}