diff options
-rw-r--r-- | epan/dissectors/packet-xmpp-utils.h | 12 | ||||
-rw-r--r-- | epan/proto.h | 15 |
2 files changed, 14 insertions, 13 deletions
diff --git a/epan/dissectors/packet-xmpp-utils.h b/epan/dissectors/packet-xmpp-utils.h index c9c3979bf0..0ac0618092 100644 --- a/epan/dissectors/packet-xmpp-utils.h +++ b/epan/dissectors/packet-xmpp-utils.h @@ -26,18 +26,6 @@ #ifndef XMPP_UTILS_H #define XMPP_UTILS_H -#define FI_RESET_FLAG(fi, flag) \ - do { \ - if (fi) \ - (fi)->flags = (fi)->flags & !(flag); \ - } while(0) - -#define PROTO_ITEM_SET_VISIBLE(proto_item) \ - do { \ - if (proto_item) \ - FI_RESET_FLAG(PITEM_FINFO(proto_item), FI_HIDDEN); \ - } while(0) - #define xmpp_elem_cdata(elem) \ elem->data?elem->data->value:"" diff --git a/epan/proto.h b/epan/proto.h index e7a3622a80..3ea7f155e3 100644 --- a/epan/proto.h +++ b/epan/proto.h @@ -418,6 +418,12 @@ typedef struct field_info { if (fi) \ (fi)->flags = (fi)->flags | (flag); \ } while(0) +/** convenience macro to reset field_info.flags */ +#define FI_RESET_FLAG(fi, flag) \ + do { \ + if (fi) \ + (fi)->flags = (fi)->flags & ~(flag); \ + } while(0) #define FI_GET_BITS_OFFSET(fi) (FI_GET_FLAG(fi, FI_BITS_OFFSET(7)) >> 5) #define FI_GET_BITS_SIZE(fi) (FI_GET_FLAG(fi, FI_BITS_SIZE(63)) >> 8) @@ -501,7 +507,14 @@ typedef proto_node proto_item; do { \ if (proto_item) \ FI_SET_FLAG(PITEM_FINFO(proto_item), FI_HIDDEN); \ - } while(0) + } while(0) +/** mark this protocol field to be visible from the protocol tree display */ +#define PROTO_ITEM_SET_VISIBLE(proto_item) \ + do { \ + if (proto_item) \ + FI_RESET_FLAG(PITEM_FINFO(proto_item), FI_HIDDEN); \ + } while(0) + /** is this protocol field generated by Wireshark (and not read from the packet data)? */ #define PROTO_ITEM_IS_GENERATED(proto_item) \ ((proto_item) ? FI_GET_FLAG(PITEM_FINFO(proto_item), FI_GENERATED) : 0) |