aboutsummaryrefslogtreecommitdiffstats
path: root/epan/proto.c
diff options
context:
space:
mode:
authorGerald Combs <gerald@wireshark.org>2019-04-03 14:32:30 -0700
committerAnders Broman <a.broman58@gmail.com>2019-04-04 04:03:38 +0000
commit8d3ac3af866ecc7b847dd5b621d828872fe9ba18 (patch)
tree3fa7aa1a57e1b828f636829f08d1adb9dfb5b395 /epan/proto.c
parentbdf26a35f696a1524364945a2c868e57c97d1729 (diff)
epan: Convert our PROTO_ITEM_ macros to inline functions.
Convert our various PROTO_ITEM_ macros to inline functions and document them. Change-Id: I070b15d4f70d2189217a177ee8ba2740be36327c Reviewed-on: https://code.wireshark.org/review/32706 Reviewed-by: Gerald Combs <gerald@wireshark.org> Petri-Dish: Gerald Combs <gerald@wireshark.org> Reviewed-by: Anders Broman <a.broman58@gmail.com>
Diffstat (limited to 'epan/proto.c')
-rw-r--r--epan/proto.c24
1 files changed, 12 insertions, 12 deletions
diff --git a/epan/proto.c b/epan/proto.c
index 2104d99c4c..8e1007bbeb 100644
--- a/epan/proto.c
+++ b/epan/proto.c
@@ -5675,7 +5675,7 @@ proto_tree_set_representation_value(proto_item *pi, const char *format, va_list
/* If the tree (GUI) or item isn't visible it's pointless for us to generate the protocol
* items string representation */
- if (PTREE_DATA(pi)->visible && !PROTO_ITEM_IS_HIDDEN(pi)) {
+ if (PTREE_DATA(pi)->visible && !proto_item_is_hidden(pi)) {
int ret = 0;
field_info *fi = PITEM_FINFO(pi);
header_field_info *hf;
@@ -5728,7 +5728,7 @@ proto_tree_set_representation(proto_item *pi, const char *format, va_list ap)
DISSECTOR_ASSERT(fi);
- if (!PROTO_ITEM_IS_HIDDEN(pi)) {
+ if (!proto_item_is_hidden(pi)) {
ITEM_LABEL_NEW(PNODE_POOL(pi), fi->rep);
ret = g_vsnprintf(fi->rep->representation, ITEM_LABEL_LENGTH,
format, ap);
@@ -6328,7 +6328,7 @@ proto_item_append_text(proto_item *pi, const char *format, ...)
return;
}
- if (!PROTO_ITEM_IS_HIDDEN(pi)) {
+ if (!proto_item_is_hidden(pi)) {
/*
* If we don't already have a representation,
* generate the default representation.
@@ -6363,7 +6363,7 @@ proto_item_prepend_text(proto_item *pi, const char *format, ...)
return;
}
- if (!PROTO_ITEM_IS_HIDDEN(pi)) {
+ if (!proto_item_is_hidden(pi)) {
/*
* If we don't already have a representation,
* generate the default representation.
@@ -9870,7 +9870,7 @@ check_for_offset(proto_node *node, gpointer data)
offset_search_t *offsearch = (offset_search_t *)data;
/* !fi == the top most container node which holds nothing */
- if (fi && !PROTO_ITEM_IS_HIDDEN(node) && !PROTO_ITEM_IS_GENERATED(node) && fi->ds_tvb && offsearch->tvb == fi->ds_tvb) {
+ if (fi && !proto_item_is_hidden(node) && !proto_item_is_generated(node) && fi->ds_tvb && offsearch->tvb == fi->ds_tvb) {
if (offsearch->offset >= (guint) fi->start &&
offsearch->offset < (guint) (fi->start + fi->length)) {
@@ -12284,17 +12284,17 @@ proto_tree_add_checksum(proto_tree *tree, tvbuff_t *tvb, const guint offset,
if (flags & PROTO_CHECKSUM_NOT_PRESENT) {
ti = proto_tree_add_uint_format_value(tree, hf_checksum, tvb, offset, len, 0, "[missing]");
- PROTO_ITEM_SET_GENERATED(ti);
+ proto_item_set_generated(ti);
if (hf_checksum_status != -1) {
ti2 = proto_tree_add_uint(tree, hf_checksum_status, tvb, offset, len, PROTO_CHECKSUM_E_NOT_PRESENT);
- PROTO_ITEM_SET_GENERATED(ti2);
+ proto_item_set_generated(ti2);
}
return ti;
}
if (flags & PROTO_CHECKSUM_GENERATED) {
ti = proto_tree_add_uint(tree, hf_checksum, tvb, offset, len, computed_checksum);
- PROTO_ITEM_SET_GENERATED(ti);
+ proto_item_set_generated(ti);
} else {
ti = proto_tree_add_item_ret_uint(tree, hf_checksum, tvb, offset, len, encoding, &checksum);
if (flags & PROTO_CHECKSUM_VERIFY) {
@@ -12303,7 +12303,7 @@ proto_tree_add_checksum(proto_tree *tree, tvbuff_t *tvb, const guint offset,
proto_item_append_text(ti, " [correct]");
if (hf_checksum_status != -1) {
ti2 = proto_tree_add_uint(tree, hf_checksum_status, tvb, offset, 0, PROTO_CHECKSUM_E_GOOD);
- PROTO_ITEM_SET_GENERATED(ti2);
+ proto_item_set_generated(ti2);
}
incorrect_checksum = FALSE;
} else if (flags & PROTO_CHECKSUM_IN_CKSUM) {
@@ -12314,7 +12314,7 @@ proto_tree_add_checksum(proto_tree *tree, tvbuff_t *tvb, const guint offset,
proto_item_append_text(ti, " [correct]");
if (hf_checksum_status != -1) {
ti2 = proto_tree_add_uint(tree, hf_checksum_status, tvb, offset, 0, PROTO_CHECKSUM_E_GOOD);
- PROTO_ITEM_SET_GENERATED(ti2);
+ proto_item_set_generated(ti2);
}
incorrect_checksum = FALSE;
}
@@ -12323,7 +12323,7 @@ proto_tree_add_checksum(proto_tree *tree, tvbuff_t *tvb, const guint offset,
if (incorrect_checksum) {
if (hf_checksum_status != -1) {
ti2 = proto_tree_add_uint(tree, hf_checksum_status, tvb, offset, 0, PROTO_CHECKSUM_E_BAD);
- PROTO_ITEM_SET_GENERATED(ti2);
+ proto_item_set_generated(ti2);
}
if (flags & PROTO_CHECKSUM_ZERO) {
proto_item_append_text(ti, " [incorrect]");
@@ -12339,7 +12339,7 @@ proto_tree_add_checksum(proto_tree *tree, tvbuff_t *tvb, const guint offset,
if (hf_checksum_status != -1) {
proto_item_append_text(ti, " [unverified]");
ti2 = proto_tree_add_uint(tree, hf_checksum_status, tvb, offset, 0, PROTO_CHECKSUM_E_UNVERIFIED);
- PROTO_ITEM_SET_GENERATED(ti2);
+ proto_item_set_generated(ti2);
}
}
}