diff options
author | Bill Meier <wmeier@newsguy.com> | 2009-09-30 13:19:14 +0000 |
---|---|---|
committer | Bill Meier <wmeier@newsguy.com> | 2009-09-30 13:19:14 +0000 |
commit | 7245b43dde96f4647f0e9e090764f09b3fde6870 (patch) | |
tree | 1c96770e8d3d8c5ec46d0e777ef28c5e48ea9c2d /epan/dissectors/packet-acn.c | |
parent | 53b061495db30b1a724bfd05c1b65435c3d6097e (diff) |
Rework is_acn to use tvb_memeql insted of doing a tvb_get_epemeral_string and a memcmp;
Remove some unneeded calls to col_clear().
svn path=/trunk/; revision=30211
Diffstat (limited to 'epan/dissectors/packet-acn.c')
-rw-r--r-- | epan/dissectors/packet-acn.c | 22 |
1 files changed, 9 insertions, 13 deletions
diff --git a/epan/dissectors/packet-acn.c b/epan/dissectors/packet-acn.c index 7a1390e2e5..0cae7d2d63 100644 --- a/epan/dissectors/packet-acn.c +++ b/epan/dissectors/packet-acn.c @@ -323,14 +323,15 @@ static const enum_val_t dmx_display_line_format[] = { static gboolean is_acn(tvbuff_t *tvb) { static char acn_packet_id[] = "ASC-E1.17\0\0\0"; /* must be 12 bytes */ - guint8 *packet_id; - /* Get the fields in octets 2 - 12 octet */ - packet_id = tvb_get_ephemeral_string(tvb, 4, 12); - if (memcmp(packet_id, &acn_packet_id, 12) == 0) { - return TRUE; - } - return FALSE; + if (tvb_length(tvb) < (4+sizeof(acn_packet_id))) + return FALSE; + + /* Check the bytes in octets 4 - 16 */ + if (tvb_memeql(tvb, 4, acn_packet_id, sizeof(acn_packet_id)) != 0) + return FALSE; + + return TRUE; } @@ -2129,7 +2130,6 @@ dissect_acn_dmx_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int off if(check_col(pinfo->cinfo,COL_INFO)){ col_append_fstr(pinfo->cinfo,COL_INFO, ", Universe %d, Seq %3d", universe, sequence ); } - proto_item_append_text(ti, ", Universe: %d, Priority: %d", universe, priority); data_offset = dissect_acn_dmx_data_pdu(tvb, pinfo, pdu_tree, data_offset, &pdu_offsets); @@ -2491,7 +2491,6 @@ dissect_acn_root_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int of /* add cid to info */ if(check_col(pinfo->cinfo,COL_INFO)){ - col_clear(pinfo->cinfo,COL_INFO); col_add_fstr(pinfo->cinfo,COL_INFO, "CID %s", guid_to_str(&guid)); } @@ -2589,11 +2588,8 @@ dissect_acn(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) /* Set the protocol column */ col_set_str(pinfo->cinfo, COL_PROTOCOL, "ACN"); - /* Clear out stuff in the info column */ - if(check_col(pinfo->cinfo,COL_INFO)){ - /* col_clear(pinfo->cinfo,COL_INFO); */ + if(check_col(pinfo->cinfo,COL_INFO)) col_add_fstr(pinfo->cinfo,COL_INFO, "ACN [Src Port: %d, Dst Port: %d]", pinfo->srcport, pinfo->destport ); - } if (tree) { /* we are being asked for details */ ti = proto_tree_add_item(tree, proto_acn, tvb, 0, -1, FALSE); |