aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoretxrab <etxrab@f5534014-38df-0310-8fa8-9805f1628bb7>2011-12-08 21:45:35 +0000
committeretxrab <etxrab@f5534014-38df-0310-8fa8-9805f1628bb7>2011-12-08 21:45:35 +0000
commitb650afdfb93639d9bcbc77fbbf95d2eed0841154 (patch)
tree057baea374802f30b3a34e42015891f31fea57a9
parentcd7d19d07957585aec5f8a7efb271088540d6028 (diff)
Start using functions from packet-rohc.c
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@40120 f5534014-38df-0310-8fa8-9805f1628bb7
-rw-r--r--epan/dissectors/Makefile.common1
-rw-r--r--epan/dissectors/packet-pdcp-lte.c42
-rw-r--r--epan/dissectors/packet-rohc.c24
-rw-r--r--epan/dissectors/packet-rohc.h51
4 files changed, 99 insertions, 19 deletions
diff --git a/epan/dissectors/Makefile.common b/epan/dissectors/Makefile.common
index cf15caca45..238339b767 100644
--- a/epan/dissectors/Makefile.common
+++ b/epan/dissectors/Makefile.common
@@ -1322,6 +1322,7 @@ DISSECTOR_INCLUDES = \
packet-rmt-fec.h \
packet-rmt-lct.h \
packet-rmt-norm.h \
+ packet-rohc.h \
packet-ros.h \
packet-rpc.h \
packet-rquota.h \
diff --git a/epan/dissectors/packet-pdcp-lte.c b/epan/dissectors/packet-pdcp-lte.c
index 635e4d5b8d..fb1d663388 100644
--- a/epan/dissectors/packet-pdcp-lte.c
+++ b/epan/dissectors/packet-pdcp-lte.c
@@ -33,7 +33,9 @@
#include <epan/prefs.h>
#include <epan/expert.h>
#include <epan/addr_resolv.h>
+#include <epan/emem.h>
+#include "packet-rohc.h"
#include "packet-pdcp-lte.h"
/* Described in:
@@ -657,7 +659,7 @@ static int dissect_large_cid(proto_tree *tree,
}
}
-
+#if 0
static int dissect_pdcp_dynamic_chain(proto_tree *tree,
proto_item *root_item _U_,
tvbuff_t *tvb,
@@ -831,7 +833,7 @@ static int dissect_pdcp_dynamic_chain(proto_tree *tree,
return offset;
}
-
+#endif
static int dissect_pdcp_irdyn_packet(proto_tree *tree,
proto_item *root_item,
@@ -840,6 +842,8 @@ static int dissect_pdcp_irdyn_packet(proto_tree *tree,
struct pdcp_lte_info *p_pdcp_info,
packet_info *pinfo)
{
+ rohc_info *p_rohc_info;
+
col_append_str(pinfo->cinfo, COL_INFO, " IRDYN");
proto_item_append_text(root_item, " (IRDYN)");
@@ -856,6 +860,7 @@ static int dissect_pdcp_irdyn_packet(proto_tree *tree,
proto_tree_add_item(tree, hf_pdcp_lte_rohc_ir_crc, tvb, offset, 1, ENC_BIG_ENDIAN);
offset++;
+#if 0
/* Dissect dynamic chain */
offset = dissect_pdcp_dynamic_chain(tree,
root_item,
@@ -863,6 +868,21 @@ static int dissect_pdcp_irdyn_packet(proto_tree *tree,
offset,
p_pdcp_info,
pinfo);
+#endif
+ /* RoHC settings */
+ p_rohc_info = ep_new(rohc_info);
+
+ p_rohc_info->rohc_compression = p_pdcp_info->rohc_compression;
+ p_rohc_info->rohc_ip_version = p_pdcp_info->rohc_ip_version;
+ p_rohc_info->cid_inclusion_info = p_pdcp_info->cid_inclusion_info;
+ p_rohc_info->large_cid_present = p_pdcp_info->large_cid_present;
+ p_rohc_info->mode = p_pdcp_info->mode;
+ p_rohc_info->rnd = p_pdcp_info->rnd;
+ p_rohc_info->udp_checkum_present = p_pdcp_info->udp_checkum_present;
+ p_rohc_info->profile = p_pdcp_info->profile;
+ p_rohc_info->last_created_item = root_item;
+
+ dissect_rohc_ir_rtp_profile_dynamic(tvb, tree, offset, p_rohc_info);
return offset;
}
@@ -875,6 +895,7 @@ static int dissect_pdcp_ir_packet(proto_tree *tree,
packet_info *pinfo)
{
unsigned char dynamic_chain_present;
+ rohc_info *p_rohc_info;
col_append_str(pinfo->cinfo, COL_INFO, " IR");
proto_item_append_text(root_item, " (IR)");
@@ -990,12 +1011,29 @@ static int dissect_pdcp_ir_packet(proto_tree *tree,
/* Dynamic chain */
if (dynamic_chain_present) {
+#if 0
offset = dissect_pdcp_dynamic_chain(tree,
root_item,
tvb,
offset,
p_pdcp_info,
pinfo);
+#endif
+ /* RoHC settings */
+ p_rohc_info = ep_new(rohc_info);
+
+ p_rohc_info->rohc_compression = p_pdcp_info->rohc_compression;
+ p_rohc_info->rohc_ip_version = p_pdcp_info->rohc_ip_version;
+ p_rohc_info->cid_inclusion_info = p_pdcp_info->cid_inclusion_info;
+ p_rohc_info->large_cid_present = p_pdcp_info->large_cid_present;
+ p_rohc_info->mode = p_pdcp_info->mode;
+ p_rohc_info->rnd = p_pdcp_info->rnd;
+ p_rohc_info->udp_checkum_present = p_pdcp_info->udp_checkum_present;
+ p_rohc_info->profile = p_pdcp_info->profile;
+ p_rohc_info->last_created_item = root_item;
+
+ dissect_rohc_ir_rtp_profile_dynamic(tvb, tree, offset, p_rohc_info);
+
}
return offset;
diff --git a/epan/dissectors/packet-rohc.c b/epan/dissectors/packet-rohc.c
index ad9fba8240..04ca05fe0f 100644
--- a/epan/dissectors/packet-rohc.c
+++ b/epan/dissectors/packet-rohc.c
@@ -40,6 +40,7 @@
#include <epan/rtp_pt.h>
#include <epan/expert.h>
+#include "packet-rohc.h"
/* Initialize the protocol and registered fields */
static int proto_rohc = -1;
@@ -114,20 +115,7 @@ enum rohc_mode
RELIABLE_BIDIRECTIONAL = 3
};
-typedef struct rohc_info
-{
- /* RoHC settings */
- gboolean rohc_compression;
- unsigned short rohc_ip_version;
- gboolean cid_inclusion_info;
- gboolean large_cid_present;
- enum rohc_mode mode;
- gboolean rnd;
- gboolean udp_checkum_present;
- unsigned short profile;
- proto_item *last_created_item;
-} rohc_info;
/* ROHC Profiles */
#define ROHC_PROFILE_RTP 1
@@ -347,7 +335,7 @@ dissect_rohc_feedback_data(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo,
break;
}
}
-static void
+int
dissect_rohc_ir_rtp_profile_dynamic(tvbuff_t *tvb, proto_tree *tree, int offset, rohc_info *p_rohc_info){
proto_item *item;
@@ -384,7 +372,7 @@ dissect_rohc_ir_rtp_profile_dynamic(tvbuff_t *tvb, proto_tree *tree, int offset,
break;
case 6:
proto_tree_add_text(sub_tree, tvb, offset, -1, "Not dissected yet");
- return;
+ return offset;
break;
default:
break;
@@ -401,7 +389,7 @@ dissect_rohc_ir_rtp_profile_dynamic(tvbuff_t *tvb, proto_tree *tree, int offset,
offset +=2;
proto_item_set_len(item, offset - start_offset);
proto_tree_add_text(tree, tvb, offset, -1, "RTP data");
- return;
+ return offset;
}
/* 5.7.7.6. Initialization of RTP Header
@@ -454,7 +442,7 @@ dissect_rohc_ir_rtp_profile_dynamic(tvbuff_t *tvb, proto_tree *tree, int offset,
/* : Reserved | X | Mode |TIS|TSS: if RX = 1 */
if(rx==0){
proto_tree_add_text(tree, tvb, offset, -1, "RTP data");
- return;
+ return offset;
}
proto_tree_add_item(sub_tree, hf_rohc_rtp_x, tvb, offset, 1, ENC_BIG_ENDIAN);
proto_tree_add_item(sub_tree, hf_rohc_rtp_mode, tvb, offset, 1, ENC_BIG_ENDIAN);
@@ -483,6 +471,8 @@ dissect_rohc_ir_rtp_profile_dynamic(tvbuff_t *tvb, proto_tree *tree, int offset,
proto_item_set_len(item, offset - start_offset);
proto_tree_add_text(tree, tvb, offset, -1, "RTP data");
+ return offset;
+
}
static void
dissect_rohc_ir_rtp_udp_profile_static(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, int offset, gboolean d, rohc_info *p_rohc_info){
diff --git a/epan/dissectors/packet-rohc.h b/epan/dissectors/packet-rohc.h
new file mode 100644
index 0000000000..67150b23de
--- /dev/null
+++ b/epan/dissectors/packet-rohc.h
@@ -0,0 +1,51 @@
+/* packet-rohc.h
+ * Routines for RObust Header Compression (ROHC) dissection.
+ *
+ * Copyright 2011, Anders Broman <anders.broman[at]ericsson.com>
+ *
+ * $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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *
+ * Ref:
+ * http://www.ietf.org/rfc/rfc3095.txt RObust Header Compression (ROHC): Framework and four profiles: RTP, UDP, ESP, and uncompressed
+ * http://datatracker.ietf.org/doc/rfc4815/ RObust Header Compression (ROHC): Corrections and Clarifications to RFC 3095
+ * http://datatracker.ietf.org/doc/rfc5225/ RObust Header Compression Version 2 (ROHCv2): Profiles for RTP, UDP, IP, ESP and UDP-Lite
+ */
+
+#ifndef PACKET_ROHC_H
+#define PACKET_ROHC_H
+
+typedef struct rohc_info
+{
+
+ /* RoHC settings */
+ gboolean rohc_compression;
+ unsigned short rohc_ip_version;
+ gboolean cid_inclusion_info;
+ gboolean large_cid_present;
+ enum rohc_mode mode;
+ gboolean rnd;
+ gboolean udp_checkum_present;
+ unsigned short profile;
+ proto_item *last_created_item;
+} rohc_info;
+
+int dissect_rohc_ir_rtp_profile_dynamic(tvbuff_t *tvb, proto_tree *tree, int offset, rohc_info *p_rohc_info);
+#endif PACKET_ROHC_H