diff options
author | Kovarththanan Rajaratnam <kovarththanan.rajaratnam@gmail.com> | 2009-09-10 18:22:33 +0000 |
---|---|---|
committer | Kovarththanan Rajaratnam <kovarththanan.rajaratnam@gmail.com> | 2009-09-10 18:22:33 +0000 |
commit | 56b8d36e03eccf22ea9bb078e0fd7befdc029008 (patch) | |
tree | 39c9ec6eceba4376f7bf167ea9be6869149327d0 /epan/proto.c | |
parent | 019625d876f94d1f2ec85a54d3024a34c046c09c (diff) |
Introduce a few FT_XXX lengths defines and use those instead of hard coding constants
svn path=/trunk/; revision=29846
Diffstat (limited to 'epan/proto.c')
-rw-r--r-- | epan/proto.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/epan/proto.c b/epan/proto.c index 5388d6d7bd..11427dd703 100644 --- a/epan/proto.c +++ b/epan/proto.c @@ -1261,29 +1261,29 @@ proto_tree_new_item(field_info *new_fi, proto_tree *tree, break; case FT_IPv4: - DISSECTOR_ASSERT(length == 4); + DISSECTOR_ASSERT(length == FT_IPv4_LEN); value = tvb_get_ipv4(tvb, start); proto_tree_set_ipv4(new_fi, little_endian ? GUINT32_SWAP_LE_BE(value) : value); break; case FT_IPXNET: - DISSECTOR_ASSERT(length == 4); + DISSECTOR_ASSERT(length == FT_IPXNET_LEN); proto_tree_set_ipxnet(new_fi, get_uint_value(tvb, start, 4, FALSE)); break; case FT_IPv6: - DISSECTOR_ASSERT(length >=0 && length <= 16); + DISSECTOR_ASSERT(length >=0 && length <= FT_IPv6_LEN); proto_tree_set_ipv6_tvb(new_fi, tvb, start, length); break; case FT_ETHER: - DISSECTOR_ASSERT(length == 6); + DISSECTOR_ASSERT(length == FT_ETHER_LEN); proto_tree_set_ether_tvb(new_fi, tvb, start); break; case FT_GUID: - DISSECTOR_ASSERT(length == 16); + DISSECTOR_ASSERT(length == FT_GUID_LEN); proto_tree_set_guid_tvb(new_fi, tvb, start, little_endian); break; @@ -2386,7 +2386,7 @@ proto_tree_set_ether(field_info *fi, const guint8* value) static void proto_tree_set_ether_tvb(field_info *fi, tvbuff_t *tvb, gint start) { - proto_tree_set_ether(fi, tvb_get_ptr(tvb, start, 6)); + proto_tree_set_ether(fi, tvb_get_ptr(tvb, start, FT_ETHER_LEN)); } /* Add a FT_BOOLEAN to a proto_tree */ |