Logo Search packages:      
Sourcecode: wireshark version File versions

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 "gnuc_format_check.h"
#include "ipv4.h"
#include "nstime.h"
#include "tvbuff.h"
#include "ftypes/ftypes.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 CHECK_DISPLAY_AS_X(x_handle, index, tvb, pinfo, tree)
#define DISSECTOR_ASSERT(expression)
#define DISSECTOR_ASSERT_NOT_REACHED()
#define FI_GENERATED   0x0002
#define FI_GET_FLAG(fi, flag)   (fi->flags & flag)
#define FI_HIDDEN   0x0001
#define FI_SET_FLAG(fi, flag)   (fi->flags = fi->flags | flag)
#define FI_URL   0x0004
#define g_ptr_array_len(a)   ((a)->len)
#define HFILL   0, 0, 0, 0, NULL, NULL
#define IS_BASE_DUAL(b)   ((b)==BASE_DEC_HEX||(b)==BASE_HEX_DEC)
#define ITEM_LABEL_LENGTH   240
#define PI_CHAT   0x0004
#define PI_CHECKSUM   0x0100
#define PI_DEBUG   0x4000
#define PI_ERROR   0x0010
#define PI_GROUP_MASK   0xFF00
#define PI_MALFORMED   0x2000
#define PI_NOTE   0x0008
#define PI_REASSEMBLE   0x1000
#define PI_REQUEST_CODE   0x0500
#define PI_RESPONSE_CODE   0x0400
#define PI_SEQUENCE   0x0200
#define PI_SEVERITY_MASK   0x001C
#define PI_UNDECODED   0x0800
#define PI_WARN   0x000C
#define PITEM_FINFO(proto_item)   ((proto_item)->finfo)
#define PROTO_ITEM_IS_GENERATED(proto_item)   ((proto_item) ? FI_GET_FLAG((proto_item)->finfo, FI_GENERATED) : 0)
#define PROTO_ITEM_IS_HIDDEN(proto_item)   ((proto_item) ? FI_GET_FLAG((proto_item)->finfo, FI_HIDDEN) : 0)
#define PROTO_ITEM_IS_URL(proto_item)   ((proto_item) ? FI_GET_FLAG((proto_item)->finfo, FI_URL) : 0)
#define PROTO_ITEM_SET_GENERATED(proto_item)   ((proto_item) ? FI_SET_FLAG((proto_item)->finfo, FI_GENERATED) : 0)
#define PROTO_ITEM_SET_HIDDEN(proto_item)   ((proto_item) ? FI_SET_FLAG((proto_item)->finfo, FI_HIDDEN) : 0)
#define PROTO_ITEM_SET_URL(proto_item)   ((proto_item) ? FI_SET_FLAG((proto_item)->finfo, FI_URL) : 0)
#define PTREE_DATA(proto_tree)   ((proto_tree)->tree_data)
#define REPORT_DISSECTOR_BUG(message)
#define TFS(x)   (const struct true_false_string*)(x)
#define VALS(x)   (const struct _value_string*)(x)

Typedefs

typedef struct _header_field_info header_field_info
typedef struct _item_label_t item_label_t
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 struct _protocol protocol_t

Enumerations

enum  base_display_e {
  BASE_NONE, BASE_DEC, BASE_HEX, BASE_OCT,
  BASE_DEC_HEX, BASE_HEX_DEC
}

Functions

protocol_tfind_protocol_by_id (int proto_id)
int hfinfo_bitwidth (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 (int proto_id)
gboolean proto_check_for_protocol_or_field (proto_tree *tree, int id)
void proto_cleanup (void)
char * proto_construct_dfilter_string (field_info *finfo, epan_dissect_t *edt)
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, int hfindex)
GPtrArray * proto_get_finfo_ptr_array (proto_tree *tree, int hfindex)
int proto_get_first_protocol (void **cookie)
header_field_infoproto_get_first_protocol_field (int proto_id, void **cookle)
int proto_get_id (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 (int proto_id)
const char * proto_get_protocol_name (int proto_id)
const char * proto_get_protocol_short_name (protocol_t *protocol)
void proto_init (const char *plugin_dir, void(register_all_protocols)(void), void(register_all_handoffs)(void))
gboolean proto_is_protocol_enabled (protocol_t *protocol)
proto_treeproto_item_add_subtree (proto_item *ti, 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,...) GNUC_FORMAT_CHECK(printf
void proto_item_fill_label (field_info *fi, gchar *label_str)
int proto_item_get_len (proto_item *ti)
proto_itemproto_item_get_parent (proto_item *ti)
proto_itemproto_item_get_parent_nth (proto_item *ti, int gen)
proto_treeproto_item_get_subtree (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, int group, int severity)
void void void proto_item_set_len (proto_item *ti, gint length)
void proto_item_set_text (proto_item *ti, const char *format,...) GNUC_FORMAT_CHECK(printf
void proto_register_field_array (int parent, hf_register_info *hf, int num_records)
int proto_register_protocol (const char *name, const char *short_name, const char *filter_name)
void proto_register_subtree_array (gint *const *indices, int num_indices)
void proto_registrar_dump_fields (int format)
void proto_registrar_dump_protocols (void)
void proto_registrar_dump_values (void)
const char * proto_registrar_get_abbrev (int n)
header_field_infoproto_registrar_get_byname (const char *field_name)
int proto_registrar_get_ftype (int n)
gint proto_registrar_get_length (int n)
const char * proto_registrar_get_name (int n)
header_field_infoproto_registrar_get_nth (guint hfindex)
int proto_registrar_get_parent (int n)
gboolean proto_registrar_is_protocol (int n)
int proto_registrar_n (void)
void proto_set_cant_toggle (int proto_id)
void proto_set_decoding (int proto_id, gboolean enabled)
proto_item proto_item proto_itemproto_tree_add_boolean (proto_tree *tree, int hfindex, tvbuff_t *tvb, gint start, gint length, guint32 value)
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,...) GNUC_FORMAT_CHECK(printf
proto_itemproto_tree_add_boolean_format_value (proto_tree *tree, int hfindex, tvbuff_t *tvb, gint start, gint length, guint32 value, const char *format,...) GNUC_FORMAT_CHECK(printf
proto_itemproto_tree_add_boolean_hidden (proto_tree *tree, int hfindex, tvbuff_t *tvb, gint start, gint length, guint32 value)
proto_item proto_item proto_itemproto_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,...) GNUC_FORMAT_CHECK(printf
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,...) GNUC_FORMAT_CHECK(printf
proto_itemproto_tree_add_bytes_hidden (proto_tree *tree, int hfindex, tvbuff_t *tvb, gint start, gint length, const guint8 *start_ptr)
proto_item proto_item proto_itemproto_tree_add_debug_text (proto_tree *tree, const char *format,...) GNUC_FORMAT_CHECK(printf
proto_item proto_item proto_itemproto_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,...) GNUC_FORMAT_CHECK(printf
proto_itemproto_tree_add_double_format_value (proto_tree *tree, int hfindex, tvbuff_t *tvb, gint start, gint length, double value, const char *format,...) GNUC_FORMAT_CHECK(printf
proto_itemproto_tree_add_double_hidden (proto_tree *tree, int hfindex, tvbuff_t *tvb, gint start, gint length, double value)
proto_item proto_item proto_itemproto_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,...) GNUC_FORMAT_CHECK(printf
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,...) GNUC_FORMAT_CHECK(printf
proto_itemproto_tree_add_ether_hidden (proto_tree *tree, int hfindex, tvbuff_t *tvb, gint start, gint length, const guint8 *value)
proto_item proto_item proto_itemproto_tree_add_float (proto_tree *tree, int hfindex, tvbuff_t *tvb, gint start, gint length, float value)
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,...) GNUC_FORMAT_CHECK(printf
proto_itemproto_tree_add_float_format_value (proto_tree *tree, int hfindex, tvbuff_t *tvb, gint start, gint length, float value, const char *format,...) GNUC_FORMAT_CHECK(printf
proto_itemproto_tree_add_float_hidden (proto_tree *tree, int hfindex, tvbuff_t *tvb, gint start, gint length, float value)
proto_item proto_item proto_itemproto_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,...) GNUC_FORMAT_CHECK(printf
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,...) GNUC_FORMAT_CHECK(printf
proto_itemproto_tree_add_guid_hidden (proto_tree *tree, int hfindex, tvbuff_t *tvb, gint start, gint length, const e_guid_t *value_ptr)
proto_item proto_item proto_itemproto_tree_add_int (proto_tree *tree, int hfindex, tvbuff_t *tvb, gint start, gint length, gint32 value)
proto_item proto_item proto_itemproto_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,...) GNUC_FORMAT_CHECK(printf
proto_itemproto_tree_add_int64_format_value (proto_tree *tree, int hfindex, tvbuff_t *tvb, gint start, gint length, gint64 value, const char *format,...) GNUC_FORMAT_CHECK(printf
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,...) GNUC_FORMAT_CHECK(printf
proto_itemproto_tree_add_int_format_value (proto_tree *tree, int hfindex, tvbuff_t *tvb, gint start, gint length, gint32 value, const char *format,...) GNUC_FORMAT_CHECK(printf
proto_itemproto_tree_add_int_hidden (proto_tree *tree, int hfindex, tvbuff_t *tvb, gint start, gint length, gint32 value)
proto_item proto_item proto_itemproto_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,...) GNUC_FORMAT_CHECK(printf
proto_itemproto_tree_add_ipv4_format_value (proto_tree *tree, int hfindex, tvbuff_t *tvb, gint start, gint length, guint32 value, const char *format,...) GNUC_FORMAT_CHECK(printf
proto_itemproto_tree_add_ipv4_hidden (proto_tree *tree, int hfindex, tvbuff_t *tvb, gint start, gint length, guint32 value)
proto_item proto_item proto_itemproto_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,...) GNUC_FORMAT_CHECK(printf
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,...) GNUC_FORMAT_CHECK(printf
proto_itemproto_tree_add_ipv6_hidden (proto_tree *tree, int hfindex, tvbuff_t *tvb, gint start, gint length, const guint8 *value_ptr)
proto_item proto_item proto_itemproto_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,...) GNUC_FORMAT_CHECK(printf
proto_itemproto_tree_add_ipxnet_format_value (proto_tree *tree, int hfindex, tvbuff_t *tvb, gint start, gint length, guint32 value, const char *format,...) GNUC_FORMAT_CHECK(printf
proto_itemproto_tree_add_ipxnet_hidden (proto_tree *tree, int hfindex, tvbuff_t *tvb, gint start, gint length, guint32 value)
proto_itemproto_tree_add_item (proto_tree *tree, int hfindex, tvbuff_t *tvb, gint start, gint length, gboolean little_endian)
proto_itemproto_tree_add_item_hidden (proto_tree *tree, int hfindex, tvbuff_t *tvb, gint start, gint length, gboolean little_endian)
proto_itemproto_tree_add_none_format (proto_tree *tree, int hfindex, tvbuff_t *tvb, gint start, gint length, const char *format,...) GNUC_FORMAT_CHECK(printf
proto_item proto_item proto_itemproto_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,...) GNUC_FORMAT_CHECK(printf
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,...) GNUC_FORMAT_CHECK(printf
proto_itemproto_tree_add_oid_hidden (proto_tree *tree, int hfindex, tvbuff_t *tvb, gint start, gint length, const guint8 *value_ptr)
proto_item proto_itemproto_tree_add_protocol_format (proto_tree *tree, int hfindex, tvbuff_t *tvb, gint start, gint length, const char *format,...) GNUC_FORMAT_CHECK(printf
proto_item proto_item proto_itemproto_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,...) GNUC_FORMAT_CHECK(printf
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,...) GNUC_FORMAT_CHECK(printf
proto_itemproto_tree_add_string_hidden (proto_tree *tree, int hfindex, tvbuff_t *tvb, gint start, gint length, const char *value)
proto_itemproto_tree_add_text (proto_tree *tree, tvbuff_t *tvb, gint start, gint length, const char *format,...) GNUC_FORMAT_CHECK(printf
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_itemproto_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,...) GNUC_FORMAT_CHECK(printf
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,...) GNUC_FORMAT_CHECK(printf
proto_itemproto_tree_add_time_hidden (proto_tree *tree, int hfindex, tvbuff_t *tvb, gint start, gint length, nstime_t *value_ptr)
proto_item proto_item proto_itemproto_tree_add_uint (proto_tree *tree, int hfindex, tvbuff_t *tvb, gint start, gint length, guint32 value)
proto_item proto_item proto_itemproto_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,...) GNUC_FORMAT_CHECK(printf
proto_itemproto_tree_add_uint64_format_value (proto_tree *tree, int hfindex, tvbuff_t *tvb, gint start, gint length, guint64 value, const char *format,...) GNUC_FORMAT_CHECK(printf
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,...) GNUC_FORMAT_CHECK(printf
proto_itemproto_tree_add_uint_format_value (proto_tree *tree, int hfindex, tvbuff_t *tvb, gint start, gint length, guint32 value, const char *format,...) GNUC_FORMAT_CHECK(printf
proto_itemproto_tree_add_uint_hidden (proto_tree *tree, int hfindex, tvbuff_t *tvb, gint start, gint length, guint32 value)
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 (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, int hfid)
void proto_tree_set_visible (proto_tree *tree, gboolean visible)

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