aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-meta.c
diff options
context:
space:
mode:
authorJeff Morriss <jeff.morriss@ulticom.com>2011-01-16 20:51:21 +0000
committerJeff Morriss <jeff.morriss@ulticom.com>2011-01-16 20:51:21 +0000
commit8d32d2066a22a6e3b3970961af9fb9a2a64c2ae6 (patch)
tree420d5401a47ed145c8aba98c7891e5f098f86e19 /epan/dissectors/packet-meta.c
parentc04dd5fda9af1d2fdac3eb2d16b7e6de757558a9 (diff)
There's no need to pass the result of tvb_get_ptr() as the 'value' in
proto_tree_add_*(): just use proto_tree_add_item(). Replace some tvb_get_ptr()s with tvb_get_ephemeral_string() or tvb_get_const_stringz(). Use tvb_memeql() & tvb_memcmp(). svn path=/trunk/; revision=35558
Diffstat (limited to 'epan/dissectors/packet-meta.c')
-rw-r--r--epan/dissectors/packet-meta.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/epan/dissectors/packet-meta.c b/epan/dissectors/packet-meta.c
index 71c91a14fa..9e59a7877c 100644
--- a/epan/dissectors/packet-meta.c
+++ b/epan/dissectors/packet-meta.c
@@ -175,8 +175,8 @@ static guint16 skip_item(proto_tree *meta_tree, tvbuff_t *tvb, packet_info *pinf
proto_tree_add_uint(item_tree, hf_meta_item_len,
tvb, offs - 1, 1, len);
if (len > 0)
- proto_tree_add_bytes(item_tree, hf_meta_item_data,
- tvb, offs, len, tvb_get_ptr(tvb, offs, len));
+ proto_tree_add_item(item_tree, hf_meta_item_data,
+ tvb, offs, len, ENC_NA);
return total_len;
}
@@ -227,8 +227,8 @@ static guint16 evaluate_meta_item_pcap(proto_tree *meta_tree, tvbuff_t *tvb, pac
proto_tree_add_uint(item_tree, hf_meta_item_len,
tvb, offs - 1, 1, len);
if (len > 0)
- proto_tree_add_bytes(item_tree, hf_meta_item_data,
- tvb, offs, len, tvb_get_ptr(tvb, offs, len));
+ proto_tree_add_item(item_tree, hf_meta_item_data,
+ tvb, offs, len, ENC_NA);
}
return total_len;
}
@@ -322,7 +322,7 @@ static guint16 evaluate_meta_item_dxt(proto_tree *meta_tree, tvbuff_t *tvb, pack
}
switch (aal5proto) {
case META_AAL5PROTO_MTP3:
- p_sscop_info->subdissector = sscf_nni_handle;
+ p_sscop_info->subdissector = sscf_nni_handle;
break;
case META_AAL5PROTO_ALCAP:
p_sscop_info->subdissector = alcap_handle;
@@ -377,8 +377,8 @@ static guint16 evaluate_meta_item_dxt(proto_tree *meta_tree, tvbuff_t *tvb, pack
proto_tree_add_uint(item_tree, hf_meta_item_len,
tvb, offs - 1, 1, len);
if (len > 0)
- proto_tree_add_bytes(item_tree, hf_meta_item_data,
- tvb, offs, len, tvb_get_ptr(tvb, offs, len));
+ proto_tree_add_item(item_tree, hf_meta_item_data,
+ tvb, offs, len, ENC_NA);
}
return total_len;
}
@@ -405,7 +405,7 @@ static gint32 evaluate_meta_items(guint16 schema, tvbuff_t *tvb, packet_info *pi
}
if (item_len < 4) { /* 4 is the minimum length of an item: id + type + length field */
proto_item *malformed;
- malformed = proto_tree_add_protocol_format(meta_tree,
+ malformed = proto_tree_add_protocol_format(meta_tree,
proto_malformed, tvb, offs, -1, "[Malformed Packet: %s]", pinfo->current_proto);
expert_add_info_format(pinfo, malformed, PI_MALFORMED, PI_ERROR,
"Malformed Packet (wrong item encoding)");
@@ -515,7 +515,7 @@ proto_register_meta(void)
{ &hf_meta_reserved, { "Reserved", "meta.reserved", FT_UINT16, BASE_HEX, NULL, 0, NULL, HFILL } },
/* general meta item */
- { &hf_meta_item, { "Unknown Item", "meta.item", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL } },
+ { &hf_meta_item, { "Unknown Item", "meta.item", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL } },
{ &hf_meta_item_id, { "Item ID", "meta.item.id", FT_UINT16, BASE_HEX, VALS(meta_id_vals), 0x0, NULL, HFILL } },
{ &hf_meta_item_type, { "Item Type", "meta.item.type", FT_UINT8, BASE_HEX, VALS(meta_type_vals), 0x0, NULL, HFILL } },
{ &hf_meta_item_len, { "Item Length", "meta.item.len", FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL } },