proto.h: fix indentation and add modeline.
Change-Id: I1d1adb6456c4a80f2a157cb29dc19c63755ee3fd Reviewed-on: https://code.wireshark.org/review/31485 Reviewed-by: Peter Wu <peter@lekensteyn.nl> Petri-Dish: Peter Wu <peter@lekensteyn.nl> Tested-by: Petri Dish Buildbot Reviewed-by: Anders Broman <a.broman58@gmail.com>
This commit is contained in:
parent
3561c88012
commit
e984cdeb22
116
epan/proto.h
116
epan/proto.h
|
@ -673,15 +673,11 @@ typedef struct hf_register_info {
|
|||
header_field_info hfinfo; /**< the field info to be registered */
|
||||
} hf_register_info;
|
||||
|
||||
|
||||
|
||||
|
||||
/** string representation, if one of the proto_tree_add_..._format() functions used */
|
||||
typedef struct _item_label_t {
|
||||
char representation[ITEM_LABEL_LENGTH];
|
||||
} item_label_t;
|
||||
|
||||
|
||||
/** Contains the field information for the proto_item. */
|
||||
typedef struct field_info {
|
||||
header_field_info *hfinfo; /**< pointer to registered field information */
|
||||
|
@ -709,7 +705,7 @@ typedef struct
|
|||
{
|
||||
guint crumb_bit_offset;
|
||||
guint8 crumb_bit_length;
|
||||
}crumb_spec_t;
|
||||
} crumb_spec_t;
|
||||
|
||||
/*
|
||||
* Flag fields. Do not assign values greater than 0x00000080 unless you
|
||||
|
@ -912,9 +908,7 @@ WS_DLL_PUBLIC void proto_register_plugin(const proto_plugin *plugin);
|
|||
|
||||
/** Sets up memory used by proto routines. Called at program startup */
|
||||
void proto_init(GSList *register_all_plugin_protocols_list,
|
||||
GSList *register_all_plugin_handoffs_list,
|
||||
register_cb cb, void *client_data);
|
||||
|
||||
GSList *register_all_plugin_handoffs_list, register_cb cb, void *client_data);
|
||||
|
||||
/** Frees memory used by proto routines. Called at program shutdown */
|
||||
extern void proto_cleanup(void);
|
||||
|
@ -1100,8 +1094,7 @@ proto_tree_add_item_new_ret_length(proto_tree *tree, header_field_info *hfinfo,
|
|||
|
||||
WS_DLL_PUBLIC proto_item *
|
||||
proto_tree_add_item_ret_length(proto_tree *tree, int hfindex, tvbuff_t *tvb,
|
||||
const gint start, gint length,
|
||||
const guint encoding, gint *lenretval);
|
||||
const gint start, gint length, const guint encoding, gint *lenretval);
|
||||
|
||||
/** Add an integer data item to a proto_tree, using the text label registered to that item.
|
||||
The item is extracted from the tvbuff handed to it, and the retrieved
|
||||
|
@ -1242,8 +1235,7 @@ proto_tree_add_text_internal(proto_tree *tree, tvbuff_t *tvb, gint start, gint l
|
|||
@return the newly created item */
|
||||
proto_item *
|
||||
proto_tree_add_text_valist_internal(proto_tree *tree, tvbuff_t *tvb, gint start,
|
||||
gint length, const char *format, va_list ap)
|
||||
G_GNUC_PRINTF(5, 0);
|
||||
gint length, const char *format, va_list ap) G_GNUC_PRINTF(5, 0);
|
||||
|
||||
/** Add a text-only node that creates a subtree underneath.
|
||||
@param tree the tree to append this item to
|
||||
|
@ -1255,7 +1247,8 @@ proto_tree_add_text_valist_internal(proto_tree *tree, tvbuff_t *tvb, gint start,
|
|||
@param text label for the tree
|
||||
@return the newly created tree */
|
||||
WS_DLL_PUBLIC proto_tree *
|
||||
proto_tree_add_subtree(proto_tree *tree, tvbuff_t *tvb, gint start, gint length, gint idx, proto_item **tree_item, const char *text);
|
||||
proto_tree_add_subtree(proto_tree *tree, tvbuff_t *tvb, gint start, gint length, gint idx,
|
||||
proto_item **tree_item, const char *text);
|
||||
|
||||
/** Add a text-only node that creates a subtree underneath.
|
||||
@param tree the tree to append this item to
|
||||
|
@ -1268,7 +1261,8 @@ proto_tree_add_subtree(proto_tree *tree, tvbuff_t *tvb, gint start, gint length,
|
|||
@param ... printf like parameters
|
||||
@return the newly created tree */
|
||||
WS_DLL_PUBLIC proto_tree *
|
||||
proto_tree_add_subtree_format(proto_tree *tree, tvbuff_t *tvb, gint start, gint length, gint idx, proto_item **tree_item, const char *format, ...) G_GNUC_PRINTF(7,8);
|
||||
proto_tree_add_subtree_format(proto_tree *tree, tvbuff_t *tvb, gint start, gint length, gint idx,
|
||||
proto_item **tree_item, const char *format, ...) G_GNUC_PRINTF(7,8);
|
||||
|
||||
/** Add a text-only node to a proto_tree with tvb_format_text() string. */
|
||||
proto_item *
|
||||
|
@ -1304,9 +1298,6 @@ WS_DLL_PUBLIC proto_item *
|
|||
proto_tree_add_protocol_format(proto_tree *tree, int hfindex, tvbuff_t *tvb, gint start,
|
||||
gint length, const char *format, ...) G_GNUC_PRINTF(6,7);
|
||||
|
||||
|
||||
|
||||
|
||||
/** Add a FT_BYTES to a proto_tree.
|
||||
@param tree the tree to append this item to
|
||||
@param hfindex field index
|
||||
|
@ -1331,7 +1322,7 @@ proto_tree_add_bytes(proto_tree *tree, int hfindex, tvbuff_t *tvb, gint start,
|
|||
@return the newly created item */
|
||||
WS_DLL_PUBLIC proto_item *
|
||||
proto_tree_add_bytes_with_length(proto_tree *tree, int hfindex, tvbuff_t *tvb, gint start,
|
||||
gint length, const guint8 *start_ptr, gint ptr_length);
|
||||
gint length, const guint8 *start_ptr, gint ptr_length);
|
||||
|
||||
/** Get and add a byte-array-based FT_* to a proto_tree.
|
||||
|
||||
|
@ -2147,7 +2138,6 @@ WS_DLL_PUBLIC proto_item *
|
|||
proto_tree_add_eui64_format(proto_tree *tree, int hfindex, tvbuff_t *tvb, gint start,
|
||||
gint length, const guint64 value, const char *format, ...) G_GNUC_PRINTF(7,8);
|
||||
|
||||
|
||||
/** Useful for quick debugging. Also sends string to STDOUT, so don't
|
||||
leave call to this function in production code.
|
||||
@param tree the tree to append the text to
|
||||
|
@ -2158,7 +2148,6 @@ WS_DLL_PUBLIC proto_item *
|
|||
proto_tree_add_debug_text(proto_tree *tree, const char *format,
|
||||
...) G_GNUC_PRINTF(2,3);
|
||||
|
||||
|
||||
/** Fill given label_str with string representation of field
|
||||
@param fi the item to get the info from
|
||||
@param label_str the string to fill
|
||||
|
@ -2166,7 +2155,6 @@ proto_tree_add_debug_text(proto_tree *tree, const char *format,
|
|||
WS_DLL_PUBLIC void
|
||||
proto_item_fill_label(field_info *fi, gchar *label_str);
|
||||
|
||||
|
||||
/** Register a new protocol.
|
||||
@param name the full name of the new protocol
|
||||
@param short_name abbreviated name of the new protocol
|
||||
|
@ -2190,7 +2178,8 @@ proto_register_protocol(const char *name, const char *short_name, const char *fi
|
|||
if pino is part of TLV.
|
||||
@return the new protocol handle */
|
||||
WS_DLL_PUBLIC int
|
||||
proto_register_protocol_in_name_only(const char *name, const char *short_name, const char *filter_name, int parent_proto, enum ftenum field_type);
|
||||
proto_register_protocol_in_name_only(const char *name, const char *short_name, const char *filter_name,
|
||||
int parent_proto, enum ftenum field_type);
|
||||
|
||||
/** Deregister a protocol.
|
||||
@param short_name abbreviated name of the protocol
|
||||
|
@ -2224,8 +2213,10 @@ proto_register_prefix(const char *prefix, prefix_initializer_t initializer);
|
|||
/** Initialize every remaining uninitialized prefix. */
|
||||
WS_DLL_PUBLIC void proto_initialize_all_prefixes(void);
|
||||
|
||||
WS_DLL_PUBLIC void proto_register_fields_manual(const int parent, header_field_info **hfi, const int num_records);
|
||||
WS_DLL_PUBLIC void proto_register_fields_section(const int parent, header_field_info *hfi, const int num_records);
|
||||
WS_DLL_PUBLIC void proto_register_fields_manual(const int parent, header_field_info **hfi,
|
||||
const int num_records);
|
||||
WS_DLL_PUBLIC void proto_register_fields_section(const int parent, header_field_info *hfi,
|
||||
const int num_records);
|
||||
|
||||
/** Register a header_field array.
|
||||
@param parent the protocol handle from proto_register_protocol()
|
||||
|
@ -2385,8 +2376,8 @@ extern void proto_add_heuristic_dissector(protocol_t *protocol, const char *shor
|
|||
* @param func function to execute on heuristics
|
||||
* @param user_data user-specific data for function
|
||||
*/
|
||||
WS_DLL_PUBLIC void proto_heuristic_dissector_foreach(const protocol_t *protocol, GFunc func, gpointer user_data);
|
||||
|
||||
WS_DLL_PUBLIC void proto_heuristic_dissector_foreach(const protocol_t *protocol, GFunc func,
|
||||
gpointer user_data);
|
||||
|
||||
/** Find commonly-used protocols in a layer list.
|
||||
* @param layers Protocol layer list
|
||||
|
@ -2591,8 +2582,7 @@ proto_tree_add_bitmask(proto_tree *tree, tvbuff_t *tvb, const guint offset,
|
|||
matched string displayed on the expansion line.
|
||||
@param encoding big or little endian byte representation (ENC_BIG_ENDIAN/ENC_LITTLE_ENDIAN/ENC_HOST_ENDIAN)
|
||||
@param[out] retval points to a guint64 which will be set
|
||||
@return the newly created item, and *retval is set to the decoded value masked/shifted according to bitmask
|
||||
*/
|
||||
@return the newly created item, and *retval is set to the decoded value masked/shifted according to bitmask */
|
||||
WS_DLL_PUBLIC proto_item *
|
||||
proto_tree_add_bitmask_ret_uint64(proto_tree *tree, tvbuff_t *tvb, const guint offset,
|
||||
const int hf_hdr, const gint ett, const int **fields,
|
||||
|
@ -2650,8 +2640,7 @@ proto_tree_add_bitmask_with_flags(proto_tree *tree, tvbuff_t *tvb, const guint o
|
|||
@param encoding big or little endian byte representation (ENC_BIG_ENDIAN/ENC_LITTLE_ENDIAN/ENC_HOST_ENDIAN)
|
||||
@param flags bitmask field using BMT_NO_* flags to determine behavior
|
||||
@param[out] retval points to a guint64 which will be set
|
||||
@return the newly created item, and *retval is set to the decoded value masked/shifted according to bitmask
|
||||
*/
|
||||
@return the newly created item, and *retval is set to the decoded value masked/shifted according to bitmask */
|
||||
WS_DLL_PUBLIC proto_item *
|
||||
proto_tree_add_bitmask_with_flags_ret_uint64(proto_tree *tree, tvbuff_t *tvb, const guint offset,
|
||||
const int hf_hdr, const gint ett, const int **fields,
|
||||
|
@ -2720,8 +2709,7 @@ proto_tree_add_bitmask_value_with_flags(proto_tree *tree, tvbuff_t *tvb, const g
|
|||
FT_BOOLEAN bits that are set to 1 will have the name added to the expansion.
|
||||
FT_integer fields that have a value_string attached will have the
|
||||
matched string displayed on the expansion line.
|
||||
@param encoding big or little endian byte representation (ENC_BIG_ENDIAN/ENC_LITTLE_ENDIAN/ENC_HOST_ENDIAN)
|
||||
*/
|
||||
@param encoding big or little endian byte representation (ENC_BIG_ENDIAN/ENC_LITTLE_ENDIAN/ENC_HOST_ENDIAN) */
|
||||
WS_DLL_PUBLIC void
|
||||
proto_tree_add_bitmask_list(proto_tree *tree, tvbuff_t *tvb, const guint offset,
|
||||
const int len, const int **fields, const guint encoding);
|
||||
|
@ -2803,7 +2791,8 @@ proto_tree_add_bitmask_text(proto_tree *tree, tvbuff_t *tvb, const guint offset,
|
|||
@param encoding data encoding
|
||||
@return the newly created item */
|
||||
WS_DLL_PUBLIC proto_item *
|
||||
proto_tree_add_bits_item(proto_tree *tree, const int hf_index, tvbuff_t *tvb, const guint bit_offset, const gint no_of_bits, const guint encoding);
|
||||
proto_tree_add_bits_item(proto_tree *tree, const int hf_index, tvbuff_t *tvb, const guint bit_offset,
|
||||
const gint no_of_bits, const guint encoding);
|
||||
|
||||
/** Add bits to a proto_tree, using the text label registered to that item.
|
||||
* The item is extracted from the tvbuff handed to it as a set
|
||||
|
@ -2822,9 +2811,7 @@ proto_tree_add_bits_item(proto_tree *tree, const int hf_index, tvbuff_t *tvb, co
|
|||
@return the newly created item */
|
||||
WS_DLL_PUBLIC proto_item *
|
||||
proto_tree_add_split_bits_item_ret_val(proto_tree *tree, const int hf_index, tvbuff_t *tvb,
|
||||
const guint bit_offset, const crumb_spec_t *crumb_spec,
|
||||
guint64 *return_value);
|
||||
|
||||
const guint bit_offset, const crumb_spec_t *crumb_spec, guint64 *return_value);
|
||||
|
||||
/** Add bitmap text for a split-bits crumb to a proto_tree,
|
||||
* using the text label registered to an item. The bitmap is
|
||||
|
@ -2840,8 +2827,8 @@ proto_tree_add_split_bits_item_ret_val(proto_tree *tree, const int hf_index, tvb
|
|||
@param crumb_spec pointer to crumb_spec array
|
||||
@param crumb_index into the crumb_spec array for this crumb */
|
||||
void
|
||||
proto_tree_add_split_bits_crumb(proto_tree *tree, const int hf_index, tvbuff_t *tvb, const guint bit_offset,
|
||||
const crumb_spec_t *crumb_spec, guint16 crumb_index);
|
||||
proto_tree_add_split_bits_crumb(proto_tree *tree, const int hf_index, tvbuff_t *tvb,
|
||||
const guint bit_offset, const crumb_spec_t *crumb_spec, guint16 crumb_index);
|
||||
|
||||
/** Add bits to a proto_tree, using the text label registered to that item.
|
||||
The item is extracted from the tvbuff handed to it.
|
||||
|
@ -2854,7 +2841,8 @@ proto_tree_add_split_bits_crumb(proto_tree *tree, const int hf_index, tvbuff_t *
|
|||
@param encoding data encoding
|
||||
@return the newly created item */
|
||||
WS_DLL_PUBLIC proto_item *
|
||||
proto_tree_add_bits_ret_val(proto_tree *tree, const int hf_index, tvbuff_t *tvb, const guint bit_offset, const gint no_of_bits, guint64 *return_value, const guint encoding);
|
||||
proto_tree_add_bits_ret_val(proto_tree *tree, const int hf_index, tvbuff_t *tvb,
|
||||
const guint bit_offset, const gint no_of_bits, guint64 *return_value, const guint encoding);
|
||||
|
||||
/** Add bits for a FT_UINT8, FT_UINT16, FT_UINT24 or FT_UINT32
|
||||
header field to a proto_tree, with the format generating the
|
||||
|
@ -2868,8 +2856,9 @@ proto_tree_add_bits_ret_val(proto_tree *tree, const int hf_index, tvbuff_t *tvb,
|
|||
@param format printf like format string
|
||||
@return the newly created item */
|
||||
WS_DLL_PUBLIC proto_item *
|
||||
proto_tree_add_uint_bits_format_value(proto_tree *tree, const int hf_index, tvbuff_t *tvb, const guint bit_offset, const gint no_of_bits,
|
||||
guint32 value, const char *format, ...) G_GNUC_PRINTF(7,8);
|
||||
proto_tree_add_uint_bits_format_value(proto_tree *tree, const int hf_index, tvbuff_t *tvb,
|
||||
const guint bit_offset, const gint no_of_bits, guint32 value, const char *format, ...)
|
||||
G_GNUC_PRINTF(7,8);
|
||||
|
||||
/** Add bits for a FT_UINT8, FT_UINT16, FT_UINT24 or FT_UINT32
|
||||
header field to a proto_tree, with the format generating the
|
||||
|
@ -2883,8 +2872,9 @@ proto_tree_add_uint_bits_format_value(proto_tree *tree, const int hf_index, tvbu
|
|||
@param format printf like format string
|
||||
@return the newly created item */
|
||||
WS_DLL_PUBLIC proto_item *
|
||||
proto_tree_add_uint64_bits_format_value(proto_tree *tree, const int hf_index, tvbuff_t *tvb, const guint bit_offset, const gint no_of_bits,
|
||||
guint64 value, const char *format, ...) G_GNUC_PRINTF(7,8);
|
||||
proto_tree_add_uint64_bits_format_value(proto_tree *tree, const int hf_index, tvbuff_t *tvb,
|
||||
const guint bit_offset, const gint no_of_bits, guint64 value, const char *format, ...)
|
||||
G_GNUC_PRINTF(7,8);
|
||||
|
||||
/** Add bits for a FT_BOOLEAN header field to a proto_tree, with
|
||||
the format generating the string for the value and with the field
|
||||
|
@ -2899,8 +2889,9 @@ proto_tree_add_uint64_bits_format_value(proto_tree *tree, const int hf_index, tv
|
|||
@param ... printf like parameters
|
||||
@return the newly created item */
|
||||
proto_item *
|
||||
proto_tree_add_boolean_bits_format_value(proto_tree *tree, const int hf_index, tvbuff_t *tvb, const guint bit_offset, const gint no_of_bits,
|
||||
guint32 value, const char *format, ...) G_GNUC_PRINTF(7,8);
|
||||
proto_tree_add_boolean_bits_format_value(proto_tree *tree, const int hf_index, tvbuff_t *tvb,
|
||||
const guint bit_offset, const gint no_of_bits, guint32 value, const char *format, ...)
|
||||
G_GNUC_PRINTF(7,8);
|
||||
|
||||
/** Add bits for a FT_BOOLEAN header field to a proto_tree, with
|
||||
the format generating the string for the value and with the field
|
||||
|
@ -2915,8 +2906,9 @@ proto_tree_add_boolean_bits_format_value(proto_tree *tree, const int hf_index, t
|
|||
@param ... printf like parameters
|
||||
@return the newly created item */
|
||||
proto_item *
|
||||
proto_tree_add_boolean_bits_format_value64(proto_tree *tree, const int hf_index, tvbuff_t *tvb, const guint bit_offset, const gint no_of_bits,
|
||||
guint64 value, const char *format, ...) G_GNUC_PRINTF(7,8);
|
||||
proto_tree_add_boolean_bits_format_value64(proto_tree *tree, const int hf_index, tvbuff_t *tvb,
|
||||
const guint bit_offset, const gint no_of_bits, guint64 value, const char *format, ...)
|
||||
G_GNUC_PRINTF(7,8);
|
||||
|
||||
/** Add bits for a FT_INT8, FT_INT16, FT_INT24 or FT_INT32
|
||||
header field to a proto_tree, with the format generating the
|
||||
|
@ -2931,8 +2923,9 @@ proto_tree_add_boolean_bits_format_value64(proto_tree *tree, const int hf_index,
|
|||
@param ... printf like parameters
|
||||
@return the newly created item */
|
||||
proto_item *
|
||||
proto_tree_add_int_bits_format_value(proto_tree *tree, const int hf_index, tvbuff_t *tvb, const guint bit_offset, const gint no_of_bits,
|
||||
gint32 value, const char *format, ...) G_GNUC_PRINTF(7,8);
|
||||
proto_tree_add_int_bits_format_value(proto_tree *tree, const int hf_index, tvbuff_t *tvb,
|
||||
const guint bit_offset, const gint no_of_bits, gint32 value, const char *format, ...)
|
||||
G_GNUC_PRINTF(7,8);
|
||||
|
||||
/** Add bits for a FT_INT8, FT_INT16, FT_INT24 or FT_INT32
|
||||
header field to a proto_tree, with the format generating the
|
||||
|
@ -2947,8 +2940,9 @@ proto_tree_add_int_bits_format_value(proto_tree *tree, const int hf_index, tvbuf
|
|||
@param ... printf like parameters
|
||||
@return the newly created item */
|
||||
proto_item *
|
||||
proto_tree_add_int64_bits_format_value(proto_tree *tree, const int hf_index, tvbuff_t *tvb, const guint bit_offset, const gint no_of_bits,
|
||||
gint64 value, const char *format, ...) G_GNUC_PRINTF(7,8);
|
||||
proto_tree_add_int64_bits_format_value(proto_tree *tree, const int hf_index, tvbuff_t *tvb,
|
||||
const guint bit_offset, const gint no_of_bits, gint64 value, const char *format, ...)
|
||||
G_GNUC_PRINTF(7,8);
|
||||
|
||||
/** Add bits for a FT_FLOAT header field to a proto_tree, with
|
||||
the format generating the string for the value and with the field
|
||||
|
@ -2963,8 +2957,9 @@ proto_tree_add_int64_bits_format_value(proto_tree *tree, const int hf_index, tvb
|
|||
@param ... printf like parameters
|
||||
@return the newly created item */
|
||||
proto_item *
|
||||
proto_tree_add_float_bits_format_value(proto_tree *tree, const int hf_index, tvbuff_t *tvb, const guint bit_offset, const gint no_of_bits,
|
||||
float value, const char *format, ...) G_GNUC_PRINTF(7,8);
|
||||
proto_tree_add_float_bits_format_value(proto_tree *tree, const int hf_index, tvbuff_t *tvb,
|
||||
const guint bit_offset, const gint no_of_bits, float value, const char *format, ...)
|
||||
G_GNUC_PRINTF(7,8);
|
||||
|
||||
|
||||
/** Add a FT_STRING with ENC_3GPP_TS_23_038_7BITS encoding to a proto_tree.
|
||||
|
@ -3017,7 +3012,6 @@ typedef enum
|
|||
PROTO_CHECKSUM_E_GOOD,
|
||||
PROTO_CHECKSUM_E_UNVERIFIED,
|
||||
PROTO_CHECKSUM_E_NOT_PRESENT
|
||||
|
||||
} proto_checksum_enum_e;
|
||||
|
||||
#define PROTO_CHECKSUM_NO_FLAGS 0x00 /**< Don't use any flags */
|
||||
|
@ -3029,7 +3023,6 @@ typedef enum
|
|||
|
||||
WS_DLL_PUBLIC const value_string proto_checksum_vals[];
|
||||
|
||||
|
||||
/** Check if given string is a valid field name
|
||||
@param field_name the field name to check
|
||||
@return 0 if valid, else first illegal character */
|
||||
|
@ -3155,3 +3148,16 @@ proto_custom_set(proto_tree* tree, GSList *field_id,
|
|||
#endif /* __cplusplus */
|
||||
|
||||
#endif /* proto.h */
|
||||
|
||||
/*
|
||||
* Editor modelines - https://www.wireshark.org/tools/modelines.html
|
||||
*
|
||||
* Local variables:
|
||||
* c-basic-offset: 4
|
||||
* tab-width: 8
|
||||
* indent-tabs-mode: nil
|
||||
* End:
|
||||
*
|
||||
* vi: set shiftwidth=4 tabstop=8 expandtab:
|
||||
* :indentSize=4:tabSize=8:noTabs=true:
|
||||
*/
|
||||
|
|
Loading…
Reference in New Issue