aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPau Espin Pedrol <pespin@sysmocom.de>2017-05-12 11:40:04 +0200
committerPau Espin Pedrol <pespin@sysmocom.de>2017-05-12 11:47:59 +0200
commitea2231458a55fd730398aa3570236490358f68a5 (patch)
treeb8d07eadd64a298042a2f11f37dbf85be5b65216
parentad60fe0238a877cb29af36fd59cd872364b19bfb (diff)
gsm_osmux: Use proper sizes for structo smuxh fieldspespin/osmux-stats
-rw-r--r--epan/dissectors/packet-gsm_osmux.c31
1 files changed, 17 insertions, 14 deletions
diff --git a/epan/dissectors/packet-gsm_osmux.c b/epan/dissectors/packet-gsm_osmux.c
index 14a9066..1aabe24 100644
--- a/epan/dissectors/packet-gsm_osmux.c
+++ b/epan/dissectors/packet-gsm_osmux.c
@@ -150,21 +150,21 @@ struct osmux_stream {
/* Tap structure of Osmux header */
struct osmux_hdr {
- guint32 rtp_m;
- guint32 ft;
- guint32 ctr;
- guint32 amr_f;
- guint32 amr_q;
- guint32 seq;
- guint32 circuit_id;
- guint32 amr_cmr;
- guint32 amr_ft;
+ gboolean rtp_m;
+ guint8 ft;
+ guint8 ctr;
+ gboolean amr_f;
+ gboolean amr_q;
+ guint8 seq;
+ guint8 circuit_id;
+ guint8 amr_cmr;
+ guint8 amr_ft;
gboolean is_old_dummy;
struct osmux_stream *stream;
};
static guint8
-amr_ft_to_bytes(guint32 amr_ft)
+amr_ft_to_bytes(guint8 amr_ft)
{
if (amr_ft >= AMR_FT_MAX) /* malformed packet ? */
return 0;
@@ -318,7 +318,7 @@ dissect_osmux(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U
proto_tree *osmux_tree = NULL;
guint8 ft_ctr;
guint64 amr_ft_cmr;
- guint i;
+ guint8 i;
guint32 size;
osmuxh = wmem_new0(wmem_packet_scope(), struct osmux_hdr);
@@ -353,16 +353,19 @@ dissect_osmux(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U
/* Old versions of the protocol used to send dummy packets of only 2 bytes (control + cid):_*/
if (ft_ctr == 0x23 && tvb_reported_length_remaining(tvb, offset - 1) == 2) {
osmuxh->is_old_dummy = TRUE;
- proto_tree_add_item_ret_uint(osmux_tree, hf_osmux_circuit_id, tvb, offset, 1, ENC_BIG_ENDIAN, &osmuxh->circuit_id);
+ osmuxh->circuit_id = tvb_get_guint8(tvb, offset);
+ proto_tree_add_item(osmux_tree, hf_osmux_circuit_id, tvb, offset, 1, ENC_BIG_ENDIAN);
col_append_fstr(pinfo->cinfo, COL_INFO, "Old Dummy (CID %u)", osmuxh->circuit_id);
finish_process_pkt(tvb, pinfo, tree, osmuxh);
return tvb_reported_length(tvb);
}
- proto_tree_add_item_ret_uint(osmux_tree, hf_osmux_seq, tvb, offset, 1, ENC_BIG_ENDIAN, &osmuxh->seq);
+ osmuxh->seq = tvb_get_guint8(tvb, offset);
+ proto_tree_add_item(osmux_tree, hf_osmux_seq, tvb, offset, 1, ENC_BIG_ENDIAN);
offset++;
- proto_tree_add_item_ret_uint(osmux_tree, hf_osmux_circuit_id, tvb, offset, 1, ENC_BIG_ENDIAN, &osmuxh->circuit_id);
+ osmuxh->circuit_id = tvb_get_guint8(tvb, offset);
+ proto_tree_add_item(osmux_tree, hf_osmux_circuit_id, tvb, offset, 1, ENC_BIG_ENDIAN);
offset++;
col_append_fstr(pinfo->cinfo, COL_INFO, "(CID %u) ", osmuxh->circuit_id);