Logo Search packages:      
Sourcecode: wireshark version File versions  Download package

proto.h File Reference


Detailed Description

The protocol tree related functions.
A protocol tree will hold all necessary data to display the whole dissected packet. Creating a protocol tree is done in a two stage process: A static part at program startup, and a dynamic part when the dissection with the real packet data is done.
The "static" information is provided by creating a hf_register_info hf[] array, and register it using the proto_register_field_array() function. This is usually done at dissector registering.
The "dynamic" information is added to the protocol tree by calling one of the proto_tree_add_...() functions, e.g. proto_tree_add_bytes().

Definition in file proto.h.

#include <varargs.h>
#include <glib.h>
#include "ipv4.h"
#include "nstime.h"
#include "time_fmt.h"
#include "tvbuff.h"
#include "ftypes/ftypes.h"
#include "register.h"
#include "epan.h"

Go to the source code of this file.

Classes

struct  _header_field_info
struct  _item_label_t
struct  _proto_node
struct  field_info
struct  hf_register_info
struct  tree_data_t

Defines

#define __DISSECTOR_ASSERT(expression, file, lineno)
#define __DISSECTOR_ASSERT_STRINGIFY(s)   # s
#define BASE_DISPLAY_E_MASK   0x0F
#define BASE_EXT_STRING   0x20
#define BASE_RANGE_STRING   0x10
#define BMT_NO_APPEND   0x01
#define BMT_NO_FALSE   0x04
#define BMT_NO_INT   0x02
#define BMT_NO_TFS   0x08
#define CHECK_DISPLAY_AS_X(x_handle, index, tvb, pinfo, tree)
#define DISSECTOR_ASSERT(expression)
#define DISSECTOR_ASSERT_NOT_REACHED()
#define ENC_BIG_ENDIAN   0x00000000
#define ENC_LITTLE_ENDIAN   0x80000000
#define ENC_NA   0x00000000
#define FI_BIG_ENDIAN   0x00000010
#define FI_BITS_OFFSET(n)   ((n & 7) << 5)
#define FI_BITS_SIZE(n)   ((n & 63) << 8)
#define FI_GENERATED   0x00000002
#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)
#define FI_GET_FLAG(fi, flag)   ((fi) ? (fi->flags & flag) : 0)
#define FI_HIDDEN   0x00000001
#define FI_LITTLE_ENDIAN   0x00000008
#define FI_SET_FLAG(fi, flag)
#define FI_URL   0x00000004
#define g_ptr_array_len(a)   ((a)?(a)->len:0)
#define HFILL   0, 0, HF_REF_TYPE_NONE, 0, NULL, NULL
#define IS_BASE_DUAL(b)   ((b)==BASE_DEC_HEX||(b)==BASE_HEX_DEC)
#define ITEM_LABEL_LENGTH   240
#define PI_CHAT   0x00200000
#define PI_CHECKSUM   0x01000000
#define PI_DEBUG   0x08000000
#define PI_ERROR   0x00800000
#define PI_GROUP_MASK   0xFF000000
#define PI_MALFORMED   0x07000000
#define PI_NOTE   0x00400000
#define PI_PROTOCOL   0x09000000
#define PI_REASSEMBLE   0x06000000
#define PI_REQUEST_CODE   0x04000000
#define PI_RESPONSE_CODE   0x03000000
#define PI_SECURITY   0x0a000000
#define PI_SEQUENCE   0x02000000
#define PI_SEVERITY_MASK   0x00F00000
#define PI_UNDECODED   0x05000000
#define PI_WARN   0x00600000
#define PITEM_FINFO(proto_item)   PNODE_FINFO(proto_item)
#define PNODE_FINFO(proto_node)   ((proto_node)->finfo)
#define PROTO_ITEM_IS_GENERATED(proto_item)   ((proto_item) ? FI_GET_FLAG(PITEM_FINFO(proto_item), FI_GENERATED) : 0)
#define PROTO_ITEM_IS_HIDDEN(proto_item)   ((proto_item) ? FI_GET_FLAG(PITEM_FINFO(proto_item), FI_HIDDEN) : 0)
#define PROTO_ITEM_IS_URL(proto_item)   ((proto_item) ? FI_GET_FLAG(PITEM_FINFO(proto_item), FI_URL) : 0)
#define PROTO_ITEM_SET_GENERATED(proto_item)
#define PROTO_ITEM_SET_HIDDEN(proto_item)
#define PROTO_ITEM_SET_URL(proto_item)
#define PTREE_DATA(proto_tree)   ((proto_tree)->tree_data)
#define PTREE_FINFO(proto_tree)   PNODE_FINFO(proto_tree)
#define REPORT_DISSECTOR_BUG(message)
#define RVALS(x)   (const struct _range_string*)(x)
#define TFS(x)   (const struct true_false_string*)(x)
#define VALS(x)   (const struct _value_string*)(x)

Typedefs

typedef void(* custom_fmt_func_t )(gchar *, guint32)
typedef struct _header_field_info header_field_info
typedef struct _item_label_t item_label_t
typedef void(* prefix_initializer_t )(const char *match)
typedef proto_node proto_item
typedef struct _proto_node proto_node
typedef proto_node proto_tree
typedef void(* proto_tree_foreach_func )(proto_node *, gpointer)
typedef gboolean(* proto_tree_traverse_func )(proto_node *, gpointer)
typedef struct _protocol protocol_t

Enumerations

enum  base_display_e {
  BASE_NONE, BASE_DEC, BASE_HEX, BASE_OCT,
  BASE_DEC_HEX, BASE_HEX_DEC, BASE_CUSTOM
}
enum  hf_ref_type { HF_REF_TYPE_NONE, HF_REF_TYPE_INDIRECT, HF_REF_TYPE_DIRECT }

Functions

protocol_tfind_protocol_by_id (const int proto_id)
int hfinfo_bitwidth (const header_field_info *hfinfo)
GPtrArray * proto_all_finfos (proto_tree *tree)
gboolean proto_can_match_selected (field_info *finfo, epan_dissect_t *edt)
gboolean proto_can_toggle_protocol (const int proto_id)
proto_item *proto_item
*proto_item *proto_item
*guchar 
proto_check_field_name (const gchar *field_name)
gboolean proto_check_for_protocol_or_field (const proto_tree *tree, const int id)
void proto_cleanup (void)
char * proto_construct_match_selected_string (field_info *finfo, epan_dissect_t *edt)
const gchar * proto_custom_set (proto_tree *tree, const int field_id, gchar *result, gchar *expr, const int size)
void proto_enable_all (void)
gboolean proto_field_is_referenced (proto_tree *tree, int proto_id)
field_infoproto_find_field_from_offset (proto_tree *tree, guint offset, tvbuff_t *tvb)
GPtrArray * proto_find_finfo (proto_tree *tree, const int hfindex)
GPtrArray * proto_get_finfo_ptr_array (const proto_tree *tree, const int hfindex)
int proto_get_first_protocol (void **cookie)
header_field_infoproto_get_first_protocol_field (const int proto_id, void **cookle)
int proto_get_id (const protocol_t *protocol)
int proto_get_id_by_filter_name (const gchar *filter_name)
int proto_get_next_protocol (void **cookie)
header_field_infoproto_get_next_protocol_field (void **cookle)
const char * proto_get_protocol_filter_name (const int proto_id)
const char * proto_get_protocol_long_name (const protocol_t *protocol)
const char * proto_get_protocol_name (const int proto_id)
const char * proto_get_protocol_short_name (const protocol_t *protocol)
void proto_init (void(register_all_protocols_func)(register_cb cb, gpointer client_data), void(register_all_handoffs_func)(register_cb cb, gpointer client_data), register_cb cb, void *client_data)
void proto_initialize_all_prefixes (void)
gboolean proto_is_private (const int proto_id)
gboolean proto_is_protocol_enabled (const protocol_t *protocol)
proto_treeproto_item_add_subtree (proto_item *ti, const gint idx)
proto_item *proto_item
*proto_item *void 
proto_item_append_string (proto_item *pi, const char *str)
void void proto_item_append_text (proto_item *ti, const char *format,...) G_GNUC_PRINTF(2
void proto_item_fill_label (field_info *fi, gchar *label_str)
int proto_item_get_len (const proto_item *ti)
proto_itemproto_item_get_parent (const proto_item *ti)
proto_itemproto_item_get_parent_nth (proto_item *ti, int gen)
proto_treeproto_item_get_subtree (const proto_item *ti)
void proto_item_set_end (proto_item *ti, tvbuff_t *tvb, gint end)
gboolean proto_item_set_expert_flags (proto_item *ti, const int group, const guint severity)
void void void proto_item_set_len (proto_item *ti, const gint length)
void proto_item_set_text (proto_item *ti, const char *format,...) G_GNUC_PRINTF(2
void proto_mark_private (const int proto_id)
void proto_register_field_array (const int parent, hf_register_info *hf, const int num_records)
void proto_register_prefix (const char *prefix, prefix_initializer_t initializer)
int proto_register_protocol (const char *name, const char *short_name, const char *filter_name)
void proto_register_subtree_array (gint *const *indices, const int num_indices)
void proto_registrar_dump_fields (const int format)
void proto_registrar_dump_protocols (void)
void proto_registrar_dump_values (void)
const char * proto_registrar_get_abbrev (const int n)
header_field_infoproto_registrar_get_byname (const char *field_name)
int proto_registrar_get_ftype (const int n)
gint proto_registrar_get_length (const int n)
const char * proto_registrar_get_name (const int n)
header_field_infoproto_registrar_get_nth (guint hfindex)
int proto_registrar_get_parent (const int n)
gboolean proto_registrar_is_protocol (const int n)
int proto_registrar_n (void)
void proto_set_cant_toggle (const int proto_id)
void proto_set_decoding (const int proto_id, const gboolean enabled)
gboolean proto_tracking_interesting_fields (const proto_tree *tree)
proto_itemproto_tree_add_bitmask (proto_tree *tree, tvbuff_t *tvb, const guint offset, const int hf_hdr, const gint ett, const int **fields, const gboolean little_endian)
proto_itemproto_tree_add_bitmask_text (proto_tree *tree, tvbuff_t *tvb, const guint offset, const guint len, const char *name, const char *fallback, const gint ett, const int **fields, const gboolean little_endian, const int flags)
proto_itemproto_tree_add_bits_item (proto_tree *tree, const int hf_index, tvbuff_t *tvb, const gint bit_offset, const gint no_of_bits, const gboolean little_endian)
proto_itemproto_tree_add_bits_ret_val (proto_tree *tree, const int hf_index, tvbuff_t *tvb, const gint bit_offset, const gint no_of_bits, guint64 *return_value, const gboolean little_endian)
proto_item *proto_item
*proto_item
proto_tree_add_boolean (proto_tree *tree, int hfindex, tvbuff_t *tvb, gint start, gint length, guint32 value)
proto_item *proto_itemproto_tree_add_boolean_bits_format_value (proto_tree *tree, const int hf_index, tvbuff_t *tvb, const gint bit_offset, const gint no_of_bits, guint32 value, const char *format,...) G_GNUC_PRINTF(7
proto_item *proto_itemproto_tree_add_boolean_format (proto_tree *tree, int hfindex, tvbuff_t *tvb, gint start, gint length, guint32 value, const char *format,...) G_GNUC_PRINTF(7
proto_itemproto_tree_add_boolean_format_value (proto_tree *tree, int hfindex, tvbuff_t *tvb, gint start, gint length, guint32 value, const char *format,...) G_GNUC_PRINTF(7
proto_item *proto_item
*proto_item
proto_tree_add_bytes (proto_tree *tree, int hfindex, tvbuff_t *tvb, gint start, gint length, const guint8 *start_ptr)
proto_item *proto_itemproto_tree_add_bytes_format (proto_tree *tree, int hfindex, tvbuff_t *tvb, gint start, gint length, const guint8 *start_ptr, const char *format,...) G_GNUC_PRINTF(7
proto_itemproto_tree_add_bytes_format_value (proto_tree *tree, int hfindex, tvbuff_t *tvb, gint start, gint length, const guint8 *start_ptr, const char *format,...) G_GNUC_PRINTF(7
proto_item *proto_item
*proto_item
proto_tree_add_debug_text (proto_tree *tree, const char *format,...) G_GNUC_PRINTF(2
proto_item *proto_item
*proto_item
proto_tree_add_double (proto_tree *tree, int hfindex, tvbuff_t *tvb, gint start, gint length, double value)
proto_item *proto_itemproto_tree_add_double_format (proto_tree *tree, int hfindex, tvbuff_t *tvb, gint start, gint length, double value, const char *format,...) G_GNUC_PRINTF(7
proto_itemproto_tree_add_double_format_value (proto_tree *tree, int hfindex, tvbuff_t *tvb, gint start, gint length, double value, const char *format,...) G_GNUC_PRINTF(7
proto_item *proto_item
*proto_item
proto_tree_add_ether (proto_tree *tree, int hfindex, tvbuff_t *tvb, gint start, gint length, const guint8 *value)
proto_item *proto_itemproto_tree_add_ether_format (proto_tree *tree, int hfindex, tvbuff_t *tvb, gint start, gint length, const guint8 *value, const char *format,...) G_GNUC_PRINTF(7
proto_itemproto_tree_add_ether_format_value (proto_tree *tree, int hfindex, tvbuff_t *tvb, gint start, gint length, const guint8 *value, const char *format,...) G_GNUC_PRINTF(7
proto_item *proto_item
*proto_item
proto_tree_add_float (proto_tree *tree, int hfindex, tvbuff_t *tvb, gint start, gint length, float value)
proto_item *proto_item
*proto_item *proto_item
proto_tree_add_float_bits_format_value (proto_tree *tree, const int hf_index, tvbuff_t *tvb, const gint bit_offset, const gint no_of_bits, float value, const char *format,...) G_GNUC_PRINTF(7
proto_item *proto_itemproto_tree_add_float_format (proto_tree *tree, int hfindex, tvbuff_t *tvb, gint start, gint length, float value, const char *format,...) G_GNUC_PRINTF(7
proto_itemproto_tree_add_float_format_value (proto_tree *tree, int hfindex, tvbuff_t *tvb, gint start, gint length, float value, const char *format,...) G_GNUC_PRINTF(7
proto_item *proto_item
*proto_item
proto_tree_add_guid (proto_tree *tree, int hfindex, tvbuff_t *tvb, gint start, gint length, const e_guid_t *value_ptr)
proto_item *proto_itemproto_tree_add_guid_format (proto_tree *tree, int hfindex, tvbuff_t *tvb, gint start, gint length, const e_guid_t *value_ptr, const char *format,...) G_GNUC_PRINTF(7
proto_itemproto_tree_add_guid_format_value (proto_tree *tree, int hfindex, tvbuff_t *tvb, gint start, gint length, const e_guid_t *value_ptr, const char *format,...) G_GNUC_PRINTF(7
proto_item *proto_item
*proto_item
proto_tree_add_int (proto_tree *tree, int hfindex, tvbuff_t *tvb, gint start, gint length, gint32 value)
proto_item *proto_item
*proto_item
proto_tree_add_int64 (proto_tree *tree, int hfindex, tvbuff_t *tvb, gint start, gint length, gint64 value)
proto_item *proto_itemproto_tree_add_int64_format (proto_tree *tree, int hfindex, tvbuff_t *tvb, gint start, gint length, gint64 value, const char *format,...) G_GNUC_PRINTF(7
proto_itemproto_tree_add_int64_format_value (proto_tree *tree, int hfindex, tvbuff_t *tvb, gint start, gint length, gint64 value, const char *format,...) G_GNUC_PRINTF(7
proto_item *proto_item
*proto_item
proto_tree_add_int_bits_format_value (proto_tree *tree, const int hf_index, tvbuff_t *tvb, const gint bit_offset, const gint no_of_bits, gint32 value, const char *format,...) G_GNUC_PRINTF(7
proto_item *proto_itemproto_tree_add_int_format (proto_tree *tree, int hfindex, tvbuff_t *tvb, gint start, gint length, gint32 value, const char *format,...) G_GNUC_PRINTF(7
proto_itemproto_tree_add_int_format_value (proto_tree *tree, int hfindex, tvbuff_t *tvb, gint start, gint length, gint32 value, const char *format,...) G_GNUC_PRINTF(7
proto_item *proto_item
*proto_item
proto_tree_add_ipv4 (proto_tree *tree, int hfindex, tvbuff_t *tvb, gint start, gint length, guint32 value)
proto_item *proto_itemproto_tree_add_ipv4_format (proto_tree *tree, int hfindex, tvbuff_t *tvb, gint start, gint length, guint32 value, const char *format,...) G_GNUC_PRINTF(7
proto_itemproto_tree_add_ipv4_format_value (proto_tree *tree, int hfindex, tvbuff_t *tvb, gint start, gint length, guint32 value, const char *format,...) G_GNUC_PRINTF(7
proto_item *proto_item
*proto_item
proto_tree_add_ipv6 (proto_tree *tree, int hfindex, tvbuff_t *tvb, gint start, gint length, const guint8 *value_ptr)
proto_item *proto_itemproto_tree_add_ipv6_format (proto_tree *tree, int hfindex, tvbuff_t *tvb, gint start, gint length, const guint8 *value_ptr, const char *format,...) G_GNUC_PRINTF(7
proto_itemproto_tree_add_ipv6_format_value (proto_tree *tree, int hfindex, tvbuff_t *tvb, gint start, gint length, const guint8 *value_ptr, const char *format,...) G_GNUC_PRINTF(7
proto_item *proto_item
*proto_item
proto_tree_add_ipxnet (proto_tree *tree, int hfindex, tvbuff_t *tvb, gint start, gint length, guint32 value)
proto_item *proto_itemproto_tree_add_ipxnet_format (proto_tree *tree, int hfindex, tvbuff_t *tvb, gint start, gint length, guint32 value, const char *format,...) G_GNUC_PRINTF(7
proto_itemproto_tree_add_ipxnet_format_value (proto_tree *tree, int hfindex, tvbuff_t *tvb, gint start, gint length, guint32 value, const char *format,...) G_GNUC_PRINTF(7
proto_itemproto_tree_add_item (proto_tree *tree, const int hfindex, tvbuff_t *tvb, const gint start, gint length, const guint encoding)
proto_itemproto_tree_add_none_format (proto_tree *tree, const int hfindex, tvbuff_t *tvb, const gint start, gint length, const char *format,...) G_GNUC_PRINTF(6
proto_item *proto_item
*proto_item
proto_tree_add_oid (proto_tree *tree, int hfindex, tvbuff_t *tvb, gint start, gint length, const guint8 *value_ptr)
proto_item *proto_itemproto_tree_add_oid_format (proto_tree *tree, int hfindex, tvbuff_t *tvb, gint start, gint length, const guint8 *value_ptr, const char *format,...) G_GNUC_PRINTF(7
proto_itemproto_tree_add_oid_format_value (proto_tree *tree, int hfindex, tvbuff_t *tvb, gint start, gint length, const guint8 *value_ptr, const char *format,...) G_GNUC_PRINTF(7
proto_item *proto_itemproto_tree_add_protocol_format (proto_tree *tree, int hfindex, tvbuff_t *tvb, gint start, gint length, const char *format,...) G_GNUC_PRINTF(6
proto_item *proto_item
*proto_item
proto_tree_add_string (proto_tree *tree, int hfindex, tvbuff_t *tvb, gint start, gint length, const char *value)
proto_item *proto_itemproto_tree_add_string_format (proto_tree *tree, int hfindex, tvbuff_t *tvb, gint start, gint length, const char *value, const char *format,...) G_GNUC_PRINTF(7
proto_itemproto_tree_add_string_format_value (proto_tree *tree, int hfindex, tvbuff_t *tvb, gint start, gint length, const char *value, const char *format,...) G_GNUC_PRINTF(7
proto_itemproto_tree_add_text (proto_tree *tree, tvbuff_t *tvb, gint start, gint length, const char *format,...) G_GNUC_PRINTF(5
proto_item *proto_itemproto_tree_add_text_valist (proto_tree *tree, tvbuff_t *tvb, gint start, gint length, const char *format, va_list ap)
proto_item *proto_item
*proto_item
proto_tree_add_time (proto_tree *tree, int hfindex, tvbuff_t *tvb, gint start, gint length, nstime_t *value_ptr)
proto_item *proto_itemproto_tree_add_time_format (proto_tree *tree, int hfindex, tvbuff_t *tvb, gint start, gint length, nstime_t *value_ptr, const char *format,...) G_GNUC_PRINTF(7
proto_itemproto_tree_add_time_format_value (proto_tree *tree, int hfindex, tvbuff_t *tvb, gint start, gint length, nstime_t *value_ptr, const char *format,...) G_GNUC_PRINTF(7
proto_item *proto_item
*proto_item
proto_tree_add_uint (proto_tree *tree, int hfindex, tvbuff_t *tvb, gint start, gint length, guint32 value)
proto_item *proto_item
*proto_item
proto_tree_add_uint64 (proto_tree *tree, int hfindex, tvbuff_t *tvb, gint start, gint length, guint64 value)
proto_item *proto_itemproto_tree_add_uint64_format (proto_tree *tree, int hfindex, tvbuff_t *tvb, gint start, gint length, guint64 value, const char *format,...) G_GNUC_PRINTF(7
proto_itemproto_tree_add_uint64_format_value (proto_tree *tree, int hfindex, tvbuff_t *tvb, gint start, gint length, guint64 value, const char *format,...) G_GNUC_PRINTF(7
proto_itemproto_tree_add_uint_bits_format_value (proto_tree *tree, const int hf_index, tvbuff_t *tvb, const gint bit_offset, const gint no_of_bits, guint32 value, const char *format,...) G_GNUC_PRINTF(7
proto_item *proto_itemproto_tree_add_uint_format (proto_tree *tree, int hfindex, tvbuff_t *tvb, gint start, gint length, guint32 value, const char *format,...) G_GNUC_PRINTF(7
proto_itemproto_tree_add_uint_format_value (proto_tree *tree, int hfindex, tvbuff_t *tvb, gint start, gint length, guint32 value, const char *format,...) G_GNUC_PRINTF(7
void proto_tree_children_foreach (proto_tree *tree, proto_tree_foreach_func func, gpointer data)
proto_treeproto_tree_create_root (void)
void proto_tree_free (proto_tree *tree)
proto_itemproto_tree_get_parent (const proto_tree *tree)
proto_treeproto_tree_get_root (proto_tree *tree)
void proto_tree_move_item (proto_tree *tree, proto_item *fixed_item, proto_item *item_to_move)
void proto_tree_prime_hfid (proto_tree *tree, const int hfid)
void proto_tree_set_appendix (proto_tree *tree, tvbuff_t *tvb, gint start, const gint length)
void proto_tree_set_fake_protocols (proto_tree *tree, gboolean fake_protocols)
gboolean proto_tree_set_visible (proto_tree *tree, gboolean visible)
gboolean proto_tree_traverse_post_order (proto_tree *tree, proto_tree_traverse_func func, gpointer data)

Variables

WS_VAR_IMPORT int hf_text_only
WS_VAR_IMPORT int num_tree_types
WS_VAR_IMPORT gboolean * tree_is_expanded


Generated by  Doxygen 1.6.0   Back to index