aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel Willmann <dwillmann@sysmocom.de>2016-07-13 15:44:43 +0200
committerDaniel Willmann <daniel@totalueberwachung.de>2016-07-13 15:44:43 +0200
commitde522e2ff722d6ddc58cec1b561e0ddf28f99f13 (patch)
tree07358cefc122ea7460d93dc270dd57cd24ab9dc6
parentf6f9f7cc8964f267efd552fd70035cc9dec25791 (diff)
osmux: Add osmuxh info for osmux tap
-rw-r--r--epan/dissectors/packet-osmux.c40
1 files changed, 30 insertions, 10 deletions
diff --git a/epan/dissectors/packet-osmux.c b/epan/dissectors/packet-osmux.c
index 8d464b7..e800d7a 100644
--- a/epan/dissectors/packet-osmux.c
+++ b/epan/dissectors/packet-osmux.c
@@ -27,6 +27,7 @@
#include <epan/stats_tree.h>
#include <epan/tap.h>
#include <epan/prefs.h>
+#include <epan/conversation.h>
void proto_register_osmux(void);
void proto_reg_handoff_osmux(void);
@@ -43,6 +44,17 @@ static const value_string osmux_ft_vals[] =
{0, NULL}
};
+struct osmux_hdr {
+ int ft;
+ int ctr;
+ int amr_f;
+ int amr_q;
+ int seq;
+ int circuit_id;
+ int amr_cmr;
+ int amr_ft;
+};
+
/* Initialize the protocol and registered fields */
static dissector_handle_t osmux_handle;
static int proto_osmux = -1;
@@ -79,28 +91,36 @@ dissect_osmux(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U
{
int offset = 0;
+ struct osmux_hdr *osmuxh;
proto_item *ti;
proto_tree *osmux_tree = NULL;
- guint8 ft_ctr, ft;
- //, ctr, seq, circuit_id, amr_ft_cdr;
+ guint8 ft_ctr, amr_ft_cmr;
col_set_str(pinfo->cinfo, COL_PROTOCOL, "OSmux");
col_clear(pinfo->cinfo, COL_INFO);
+ osmuxh = wmem_new0(wmem_packet_scope(), struct osmux_hdr);
+
ft_ctr = tvb_get_guint8(tvb, offset);
- ft = ft_ctr >> 5;
-// ctr = (ft_ctr >> 2) & 0x7;
+ osmuxh->ft = ft_ctr >> 5;
+ osmuxh->ctr = (ft_ctr >> 2) & 0x7;
+ osmuxh->amr_q = !!(ft_ctr & 0x02);
+ osmuxh->amr_f = !!(ft_ctr & 0x01);
-// seq = tvb_get_guint8(tvb, offset+1);
-// circuit_id = tvb_get_guint8(tvb, offset+2);
-// amr_ft_cdr = tvb_get_guint8(tvb, offset+3);
+ osmuxh->seq = tvb_get_guint8(tvb, offset+1);
+ osmuxh->circuit_id = tvb_get_guint8(tvb, offset+2);
+
+ amr_ft_cmr = tvb_get_guint8(tvb, offset+3);
+ osmuxh->amr_ft = (amr_ft_cmr & 0xf0) >> 4;
+ osmuxh->amr_cmr = amr_ft_cmr & 0x0f;
col_append_fstr(pinfo->cinfo, COL_INFO, "OSMux ");
+
ti = proto_tree_add_protocol_format(tree, proto_osmux,
tvb, offset, -1,
"OSmux type %s frame",
- val_to_str(ft, osmux_ft_vals,
+ val_to_str(osmuxh->ft, osmux_ft_vals,
"unknown 0x%02x"));
osmux_tree = proto_item_add_subtree(ti, ett_osmux);
@@ -112,7 +132,7 @@ dissect_osmux(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U
}
col_append_fstr(pinfo->cinfo, COL_INFO, "%s ",
- val_to_str(ft, osmux_ft_vals,
+ val_to_str(osmuxh->ft, osmux_ft_vals,
"unknown 0x%02x"));
{
@@ -143,7 +163,7 @@ dissect_osmux(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U
offset++;
}
- tap_queue_packet(osmux_tap, pinfo, NULL);
+ tap_queue_packet(osmux_tap, pinfo, osmuxh);
return offset;
}