diff options
Diffstat (limited to 'epan/proto.h')
-rw-r--r-- | epan/proto.h | 35 |
1 files changed, 30 insertions, 5 deletions
diff --git a/epan/proto.h b/epan/proto.h index 0ddb2e55cc..4ced956b1b 100644 --- a/epan/proto.h +++ b/epan/proto.h @@ -101,6 +101,13 @@ typedef struct _protocol protocol_t; ((void) ((expression) ? (void)0 : \ __DISSECTOR_ASSERT (expression, __FILE__, __LINE__))) +#if 0 +/* win32: using a debug breakpoint (int 3) can be very handy while debugging, + * as the assert handling of GTK/GLib is currently not very helpful */ +#define DISSECTOR_ASSERT(expression) \ +{ if(!(expression)) _asm { int 3}; } +#endif + /** Same as DISSECTOR_ASSERT(), but will throw DissectorError exception * unconditionally, much like GLIB's g_assert_not_reached works. */ @@ -192,9 +199,9 @@ typedef struct field_info { header_field_info *hfinfo; /**< pointer to registered field information */ gint start; /**< current start of data in field_info.ds_tvb */ gint length; /**< current data length of item in field_info.ds_tvb */ - gint tree_type; /**< ETT_ */ + gint tree_type; /**< one of ETT_ or -1 */ item_label_t *rep; /**< string for GUI tree */ - int flags; /**< one of FI_HIDDEN, ... */ + int flags; /**< bitfield like FI_GENERATED, ... */ tvbuff_t *ds_tvb; /**< data source tvbuff */ fvalue_t value; } field_info; @@ -202,10 +209,17 @@ typedef struct field_info { /** The protocol field should not be shown in the tree (it's used for filtering only), * used in field_info.flags. */ -#define FI_HIDDEN 0x0001 +/* HIDING PROTOCOL FIELDS IS DEPRECATED, IT'S CONSIDERED TO BE BAD GUI DESIGN! */ +#define FI_HIDDEN 0x0001 /** The protocol field should be displayed as "generated by Ethereal", * used in field_info.flags. */ -#define FI_GENERATED 0x0002 +#define FI_GENERATED 0x0002 +/** The protocol field has a bad checksum */ +#define FI_CHECKSUM_ERROR 0x0004 +/** The protocol field has an unusual sequence (e.g. TCP window is zero) */ +#define FI_SEQUENCE_WARNING 0x0008 +/** The protocol field has a bad sequence (e.g. TCP segment is lost) */ +#define FI_SEQUENCE_ERROR 0x0010 /** convenience macro to get field_info.flags */ #define FI_GET_FLAG(fi, flag) (fi->flags & flag) @@ -238,9 +252,11 @@ typedef proto_node proto_item; /** is this protocol field hidden from the protocol tree display (used for filtering only)? */ +/* HIDING PROTOCOL FIELDS IS DEPRECATED, IT'S CONSIDERED TO BE BAD GUI DESIGN! */ #define PROTO_ITEM_IS_HIDDEN(proto_item) \ ((proto_item) ? FI_GET_FLAG((proto_item)->finfo, FI_HIDDEN) : 0) /** mark this protocol field to be hidden from the protocol tree display (used for filtering only) */ +/* HIDING PROTOCOL FIELDS IS DEPRECATED, IT'S CONSIDERED TO BE BAD GUI DESIGN! */ #define PROTO_ITEM_SET_HIDDEN(proto_item) \ ((proto_item) ? FI_SET_FLAG((proto_item)->finfo, FI_HIDDEN) : 0) /** is this protocol field generated by Ethereal (and not read from the packet data)? */ @@ -249,6 +265,15 @@ typedef proto_node proto_item; /** mark this protocol field as generated by Ethereal (and not read from the packet data) */ #define PROTO_ITEM_SET_GENERATED(proto_item) \ ((proto_item) ? FI_SET_FLAG((proto_item)->finfo, FI_GENERATED) : 0) +/** mark this protocol field having a bad checksum */ +#define PROTO_ITEM_SET_CHECKSUM_ERROR(proto_item) \ + ((proto_item) ? FI_SET_FLAG((proto_item)->finfo, FI_CHECKSUM_ERROR) : 0) +/** mark this protocol field having a sequence warning */ +#define PROTO_ITEM_SET_SEQUENCE_WARNING(proto_item) \ + ((proto_item) ? FI_SET_FLAG((proto_item)->finfo, FI_SEQUENCE_WARNING) : 0) +/** mark this protocol field having a sequence error */ +#define PROTO_ITEM_SET_SEQUENCE_ERROR(proto_item) \ + ((proto_item) ? FI_SET_FLAG((proto_item)->finfo, FI_SEQUENCE_ERROR) : 0) typedef void (*proto_tree_foreach_func)(proto_node *, gpointer); @@ -360,7 +385,7 @@ extern void proto_tree_free(proto_tree *tree); /** Set the tree visible or invisible. Is the parsing being done for a visible proto_tree or an invisible one? By setting this correctly, the proto_tree creation is sped up by not - having to call vsnprintf and copy strings around. + having to call g_vsnprintf and copy strings around. @param tree the tree to be set @param visible ... or not */ extern void |