Make boolean bitmask type 64-bit wide
[metze/wireshark/wip.git] / epan / proto.h
index bb573ad11abd0691d100be3ac499412bf6cd5960..eb788561c6a983e11039f9070d30c7daa9dd75fa 100644 (file)
@@ -1,8 +1,6 @@
 /* proto.h
  * Definitions for protocol display
  *
- * $Id$
- *
  * Wireshark - Network traffic analyzer
  * By Gerald Combs <gerald@wireshark.org>
  * Copyright 1998 Gerald Combs
@@ -82,6 +80,9 @@ struct expert_field;
 /** Make a const value_string[] look like a _value_string pointer, used to set header_field_info.strings */
 #define VALS(x)        (const struct _value_string*)(x)
 
+/** Make a const val64_string[] look like a _val64_string pointer, used to set header_field_info.strings */
+#define VALS64(x)   (const struct _val64_string*)(x)
+
 /** Make a const true_false_string[] look like a _true_false_string pointer, used to set header_field_info.strings */
 #define TFS(x) (const struct true_false_string*)(x)
 
@@ -173,6 +174,51 @@ WS_DLL_PUBLIC WS_MSVC_NORETURN void proto_report_dissector_bug(const char *messa
     ep_strdup_printf("%s:%u: failed assertion \"DISSECTOR_ASSERT_NOT_REACHED\"", \
      __FILE__, __LINE__)))
 
+/** Compare two integers.
+ *
+ * This is functionally the same as `DISSECTOR_ASSERT(a op b)` except that it
+ * will display the values of a and b upon failure.
+ *
+ *     DISSECTOR_ASSERT_CMPINT(a, ==, b);
+ *     DISSECTOR_ASSERT_CMPINT(min, <=, max);
+ *
+ * This function can currently compare values that fit inside a gint64.
+ *
+ * WARNING: The number of times the arguments are evaluated is undefined.  Do
+ * not use expressions with side effects as arguments.
+ *
+ * @param a  The first integer.
+ * @param op Any binary operator.
+ * @param b  The second integer.
+ */
+#define DISSECTOR_ASSERT_CMPINT(a, op, b)  \
+  ((void) ((a op b) ? (void)0 : \
+   __DISSECTOR_ASSERT_CMPINT (a, op, b, gint64, "%"G_GINT64_MODIFIER"d"))) \
+   __DISSECTOR_ASSERT_STATIC_ANALYSIS_HINT(a op b)
+
+/** Like DISSECTOR_ASSERT_CMPINT() except the arguments are treated as
+ * unsigned values.
+ *
+ * This function can currently compare values that fit inside a guint64.
+ */
+#define DISSECTOR_ASSERT_CMPUINT(a, op, b)  \
+  ((void) ((a op b) ? (void)0 : \
+   __DISSECTOR_ASSERT_CMPINT (a, op, b, guint64, "%"G_GINT64_MODIFIER"u"))) \
+   __DISSECTOR_ASSERT_STATIC_ANALYSIS_HINT(a op b)
+
+/** Like DISSECTOR_ASSERT_CMPUINT() except the values are displayed in
+ * hexadecimal upon assertion failure.
+ */
+#define DISSECTOR_ASSERT_CMPUINTHEX(a, op, b)  \
+  ((void) ((a op b) ? (void)0 : \
+   __DISSECTOR_ASSERT_CMPINT (a, op, b, guint64, "0x%"G_GINT64_MODIFIER"X"))) \
+  __DISSECTOR_ASSERT_STATIC_ANALYSIS_HINT(a op b)
+
+#define __DISSECTOR_ASSERT_CMPINT(a, op, b, type, fmt) \
+  (REPORT_DISSECTOR_BUG( \
+    ep_strdup_printf("%s:%u: failed assertion "#a" "#op" "#b" ("fmt" "#op" "fmt")", \
+     __FILE__, __LINE__, (type)a, (type)b)))
+
 #define __DISSECTOR_ASSERT_STRINGIFY(s)        # s
 
 #define __DISSECTOR_ASSERT(expression, file, lineno)  \
@@ -236,6 +282,13 @@ WS_DLL_PUBLIC WS_MSVC_NORETURN void proto_report_dissector_bug(const char *messa
 #define ENC_BIG_ENDIAN         0x00000000
 #define ENC_LITTLE_ENDIAN      0x80000000
 
+#if G_BYTE_ORDER == G_LITTLE_ENDIAN
+    #define ENC_HOST_ENDIAN ENC_LITTLE_ENDIAN
+#else
+    #define ENC_HOST_ENDIAN ENC_BIG_ENDIAN
+#endif
+
+
 /*
  * Historically FT_TIMEs were only timespecs; the only question was whether
  * they were stored in big- or little-endian format.
@@ -299,6 +352,9 @@ WS_DLL_PUBLIC WS_MSVC_NORETURN void proto_report_dissector_bug(const char *messa
 #define ENC_WINDOWS_1250               0x0000002A
 #define ENC_3GPP_TS_23_038_7BITS       0x0000002C
 #define ENC_EBCDIC                     0x0000002E
+#define ENC_MAC_ROMAN                  0x00000030
+#define ENC_CP437                      0x00000032
+#define ENC_ASCII_7BITS                        0x00000034
 
 /*
  * TODO:
@@ -307,7 +363,6 @@ WS_DLL_PUBLIC WS_MSVC_NORETURN void proto_report_dissector_bug(const char *messa
  *
  *     "IBM MS DBCS"
  *     JIS C 6226
- *     7-bit encodings such as 7 bits ASCII used in packet-ansi_637.c
  *
  * As those are added, change code such as the code in packet-bacapp.c
  * to use them.
@@ -322,6 +377,49 @@ WS_DLL_PUBLIC WS_MSVC_NORETURN void proto_report_dissector_bug(const char *messa
  */
 #define ENC_NA                 0x00000000
 
+/* For cases where either native type or string encodings could both be
+ * valid arguments, we need something to distinguish which one is being
+ * passed as the argument, because ENC_BIG_ENDIAN and ENC_ASCII are both
+ * 0x00000000. So we use ENC_STR_NUM or ENC_STR_HEX bit-or'ed with
+ * ENC_ASCII and its ilk.
+ */
+/* this is for strings as numbers "12345" */
+#define ENC_STR_NUM             0x01000000
+/* this is for strings as hex "1a2b3c" */
+#define ENC_STR_HEX             0x02000000
+/* a convenience macro for either of the above */
+#define ENC_STRING              0x03000000
+/* mask out ENC_STR_* and related bits - should this replace ENC_CHARENCODING_MASK? */
+#define ENC_STR_MASK            0x0000FFFE
+
+/* for cases where the number is allowed to have a leading '+'/'-' */
+/* this can't collide with ENC_SEP_* because they can be used simultaneously */
+#define ENC_NUM_PREF    0x00200000
+
+/* For cases where a string encoding contains hex, bit-or one or more
+ * of these for the allowed separator(s), as well as with ENC_STR_HEX.
+ * See hex_str_to_bytes_encoding() in epan/strutil.h for details.
+ */
+#define ENC_SEP_NONE    0x00010000
+#define ENC_SEP_COLON   0x00020000
+#define ENC_SEP_DASH    0x00040000
+#define ENC_SEP_DOT   0x00080000
+#define ENC_SEP_SPACE   0x00100000
+/* a convenience macro for the above */
+#define ENC_SEP_MASK    0x001F0000
+
+/* For cases where a string encoding contains a timestamp, use one
+ * of these (but only one). These values can collide with above, because
+ * you can't do both at the same time.
+ */
+#define ENC_ISO_8601_DATE       0x00010000
+#define ENC_ISO_8601_TIME       0x00020000
+#define ENC_ISO_8601_DATE_TIME  0x00030000
+#define ENC_RFC_822             0x00040000
+#define ENC_RFC_1123            0x00080000
+/* a convenience macro for the above - for internal use only */
+#define ENC_STR_TIME_MASK       0x000F0000
+
 /* Values for header_field_info.display */
 
 /* For integral types, the display format is a BASE_* field_display_e value
@@ -344,7 +442,7 @@ typedef enum {
 /* String types */
        STR_ASCII    = BASE_NONE, /**< shows non-printable ASCII characters as C-style escapes */
        /* XXX, support for format_text_wsp() ? */
-       STR_UNICODE  = 7          /**< shows non-printable UNICODE characters as \uXXXX (XXX for now non-printable characters display depends on UI) */
+       STR_UNICODE  = 7          /**< shows non-printable UNICODE characters as \\uXXXX (XXX for now non-printable characters display depends on UI) */
 } field_display_e;
 
 /* Following constants have to be ORed with a field_display_e when dissector
@@ -375,19 +473,19 @@ struct _header_field_info {
        const char              *abbrev;         /**< [FIELDABBREV] abbreviated name of this field */
        enum ftenum              type;           /**< [FIELDTYPE] field type, one of FT_ (from ftypes.h) */
        int                          display;        /**< [FIELDDISPLAY] one of BASE_, or field bit-width if FT_BOOLEAN and non-zero bitmask */
-       const void              *strings;        /**< [FIELDCONVERT] value_string, range_string or true_false_string,
+       const void              *strings;        /**< [FIELDCONVERT] value_string, val64_string, range_string or true_false_string,
                                                      typically converted by VALS(), RVALS() or TFS().
                                                      If this is an FT_PROTOCOL then it points to the
                                                      associated protocol_t structure */
-       guint32                  bitmask;        /**< [BITMASK] bitmask of interesting bits */
+       guint64                  bitmask;        /**< [BITMASK] bitmask of interesting bits */
        const char              *blurb;          /**< [FIELDDESCR] Brief description of field */
 
        /* ------- set by proto routines (prefilled by HFILL macro, see below) ------ */
-       int                      id;             /**< Field ID */
-       int                      parent;         /**< parent protocol tree */
-       hf_ref_type              ref_type;       /**< is this field referenced by a filter */
-       int                      same_name_prev_id; /**< ID of previous hfinfo with same abbrev */
-       header_field_info       *same_name_next; /**< Link to next hfinfo with same abbrev */
+       int                                  id;                /**< Field ID */
+       int                                      parent;            /**< parent protocol tree */
+       hf_ref_type                      ref_type;          /**< is this field referenced by a filter */
+       int                  same_name_prev_id; /**< ID of previous hfinfo with same abbrev */
+       header_field_info       *same_name_next;    /**< Link to next hfinfo with same abbrev */
 };
 
 /**
@@ -397,6 +495,13 @@ struct _header_field_info {
  */
 #define HFILL -1, 0, HF_REF_TYPE_NONE, -1, NULL
 
+#define HFILL_INIT(hf)   \
+       hf.hfinfo.id                            = -1;   \
+       hf.hfinfo.parent                        = 0;   \
+       hf.hfinfo.ref_type                      = HF_REF_TYPE_NONE;   \
+       hf.hfinfo.same_name_prev_id     = -1;   \
+       hf.hfinfo.same_name_next        = NULL;
+
 /** Used when registering many fields at once, using proto_register_field_array() */
 typedef struct hf_register_info {
        int                             *p_id;  /**< written to by register() function */
@@ -518,40 +623,42 @@ typedef proto_node proto_item;
  * the bottom up.
  */
 
+/* do not modify the PI_SEVERITY_MASK name - it's used by make-init-lua.pl */
 /* expert severities */
 #define PI_SEVERITY_MASK        0x00F00000     /**< mask usually for internal use only! */
-/** Packet is commented */
+/** Packet comment */
 #define PI_COMMENT              0x00100000
 /** Usual workflow, e.g. TCP connection establishing */
 #define PI_CHAT                 0x00200000
-/** Notable messages, e.g. an application returned an "usual" error code like HTTP 404 */
+/** Notable messages, e.g. an application returned an "unusual" error code like HTTP 404 */
 #define PI_NOTE                 0x00400000
 /** Warning, e.g. application returned an "unusual" error code */
 #define PI_WARN                 0x00600000
-/** Serious problems, e.g. [Malformed Packet] */
+/** Serious problems, e.g. a malformed packet */
 #define PI_ERROR                0x00800000
 
+/* do not modify the PI_GROUP_MASK name - it's used by make-init-lua.pl */
 /* expert "event groups" */
 #define PI_GROUP_MASK           0xFF000000     /**< mask usually for internal use only! */
-/** The protocol field has a bad checksum, usually PI_WARN */
+/** The protocol field has a bad checksum, usually uses PI_WARN severity */
 #define PI_CHECKSUM             0x01000000
 /** The protocol field indicates a sequence problem (e.g. TCP window is zero) */
 #define PI_SEQUENCE             0x02000000
-/** The protocol field indicates a bad application response code (e.g. HTTP 404), usually PI_NOTE */
+/** The protocol field indicates a bad application response code (e.g. HTTP 404), usually PI_NOTE severity */
 #define PI_RESPONSE_CODE        0x03000000
-/** The protocol field indicates an application request (e.g. File Handle == xxxx), usually PI_CHAT */
+/** The protocol field indicates an application request (e.g. File Handle == xxxx), usually PI_CHAT severity */
 #define PI_REQUEST_CODE         0x04000000
-/** The data is undecoded, the protocol dissection is incomplete here, usually PI_WARN */
+/** The data is undecoded, the protocol dissection is incomplete here, usually PI_WARN severity */
 #define PI_UNDECODED            0x05000000
-/** The protocol field indicates a reassemble (e.g. DCE/RPC defragmentation), usually PI_CHAT (or PI_ERROR) */
+/** The protocol field indicates a reassemble (e.g. DCE/RPC defragmentation), usually PI_CHAT severity (or PI_ERROR) */
 #define PI_REASSEMBLE           0x06000000
-/** The packet data is malformed, the dissector has "given up", usually PI_ERROR */
+/** The packet data is malformed, the dissector has "given up", usually PI_ERROR severity */
 #define PI_MALFORMED            0x07000000
-/** A generic debugging message (shouldn't remain in production code!), usually PI_ERROR */
+/** A generic debugging message (shouldn't remain in production code!), usually PI_ERROR severity */
 #define PI_DEBUG                0x08000000
-/** The protocol field violates a protocol specification, usually PI_WARN */
+/** The protocol field violates a protocol specification, usually PI_WARN severity */
 #define PI_PROTOCOL             0x09000000
-/** The protocol field indicates a security probem (e.g. unsecure implementation) */
+/** The protocol field indicates a security problem (e.g. insecure implementation) */
 #define PI_SECURITY             0x0a000000
 /** The protocol field indicates a packet comment */
 #define PI_COMMENTS_GROUP       0x0b000000
@@ -745,7 +852,7 @@ extern void
 proto_tree_set_fake_protocols(proto_tree *tree, gboolean fake_protocols);
 
 /** Mark a field/protocol ID as "interesting".
- @param tree the tree to be set
+ @param tree the tree to be set (currently ignored)
  @param hfid the interesting field id
  @todo what *does* interesting mean? */
 extern void
@@ -793,7 +900,7 @@ WS_DLL_PUBLIC proto_item *
 proto_tree_add_item(proto_tree *tree, int hfindex, tvbuff_t *tvb,
                    const gint start, gint length, const guint encoding);
 
-/** Add a text-only node to a proto_tree.
+/** (DEPRECATED) Add a text-only node to a proto_tree.
  @param tree the tree to append this item to
  @param tvb the tv buffer of the current data
  @param start start of data in tvb
@@ -805,7 +912,7 @@ WS_DLL_PUBLIC proto_item *
 proto_tree_add_text(proto_tree *tree, tvbuff_t *tvb, gint start, gint length, const char *format,
        ...) G_GNUC_PRINTF(5,6);
 
-/** Add a text-only node to a proto_tree using a variable argument list.
+/** (DEPRECATED) Add a text-only node to a proto_tree using a variable argument list.
  @param tree the tree to append this item to
  @param tvb the tv buffer of the current data
  @param start start of data in tvb
@@ -815,8 +922,43 @@ proto_tree_add_text(proto_tree *tree, tvbuff_t *tvb, gint start, gint length, co
  @return the newly created item */
 proto_item *
 proto_tree_add_text_valist(proto_tree *tree, tvbuff_t *tvb, gint start,
-       gint length, const char *format, va_list ap);
+       gint length, const char *format, va_list ap)
+       G_GNUC_PRINTF(5, 0);
+
+/** Add a text-only node that creates a subtree underneath.
+ proto_tree_add_text + proto_item_add_subtree
+ @param tree the tree to append this item to
+ @param tvb the tv buffer of the current data
+ @param start start of data in tvb
+ @param length length of data in tvb
+ @param idx one of the ett_ array elements registered with proto_register_subtree_array()
+ @param tree_item item returned with tree creation. Can be NULL if going to be unused
+ @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);
+
+/** Add a text-only node that creates a subtree underneath.
+ proto_tree_add_text + proto_item_add_subtree
+ @param tree the tree to append this item to
+ @param tvb the tv buffer of the current data
+ @param start start of data in tvb
+ @param length length of data in tvb
+ @param idx one of the ett_ array elements registered with proto_register_subtree_array()
+ @param tree_item item returned with tree creation. Can be NULL if going to be unused
+ @param format printf like format string
+ @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);
 
+/** Add a text-only node to a proto_tree with tvb_format_text() string. */
+proto_item *
+proto_tree_add_format_text(proto_tree *tree, tvbuff_t *tvb, gint start, gint length);
+
+/** Add a text-only node to a proto_tree with tvb_format_text_wsp() string. */
+proto_item *
+proto_tree_add_format_wsp_text(proto_tree *tree, tvbuff_t *tvb, gint start, gint length);
 
 /** Add a FT_NONE field to a proto_tree.
  @param tree the tree to append this item to
@@ -859,6 +1001,44 @@ WS_DLL_PUBLIC proto_item *
 proto_tree_add_bytes(proto_tree *tree, int hfindex, tvbuff_t *tvb, gint start,
        gint length, const guint8* start_ptr);
 
+/** Get and add a byte-array-based FT_* to a proto_tree.
+
+ Supported: FT_BYTES, FT_UINT_BYTES, FT_OID, FT_REL_OID, and FT_SYSTEM_ID.
+
+ The item is extracted from the tvbuff handed to it, based on the ENC_* passed
+ in for the encoding, and the retrieved byte array is also set to *retval so the
+ caller gets it back for other uses.
+
+ This function retrieves the value even if the passed-in tree param is NULL,
+ so that it can be used by dissectors at all times to both get the value
+ and set the tree item to it.
+
+ Like other proto_tree_add functions, if there is a tree and the value cannot
+ be decoded from the tvbuff, then an expert info error is reported. For string
+ encoding, this means that a failure to decode the hex value from the string
+ results in an expert info error being added to the tree.
+
+ If encoding is string-based, it will convert using tvb_get_string_bytes(); see
+ that function's comments for details.
+
+ @note The GByteArray retval must be pre-constructed using g_byte_array_new().
+
+ @param tree the tree to append this item to
+ @param hfindex field index
+ @param tvb the tv buffer of the current data
+ @param start start of data in tvb
+ @param length length of data in tvb
+ @param encoding data encoding (e.g, ENC_LITTLE_ENDIAN, or ENC_UTF_8|ENC_STR_HEX)
+ @param[in,out] retval points to a GByteArray which will be set to the bytes from the Tvb.
+ @param[in,out] endoff if not NULL, gets set to the character after those consumed.
+ @param[in,out] err if not NULL, gets set to 0 if no failure, else the errno code (e.g., EDOM, ERANGE).
+ @return the newly created item, and retval is set to the decoded value
+ */
+WS_DLL_PUBLIC proto_item *
+proto_tree_add_bytes_item(proto_tree *tree, int hfindex, tvbuff_t *tvb,
+    const gint start, gint length, const guint encoding,
+    GByteArray *retval, gint *endoff, gint *err);
+
 /** Add a formatted FT_BYTES to a proto_tree, with the format generating
     the string for the value and with the field name being included
     automatically.
@@ -903,6 +1083,42 @@ WS_DLL_PUBLIC proto_item *
 proto_tree_add_time(proto_tree *tree, int hfindex, tvbuff_t *tvb, gint start,
        gint length, const nstime_t* value_ptr);
 
+/** Get and add a FT_ABSOLUTE_TIME or FT_RELATIVE_TIME to a proto_tree.
+ The item is extracted from the tvbuff handed to it, based on the ENC_* passed
+ in for the encoding, and the retrieved value is also set to *retval so the
+ caller gets it back for other uses.
+
+ This function retrieves the value even if the passed-in tree param is NULL,
+ so that it can be used by dissectors at all times to both get the value
+ and set the tree item to it.
+
+ Like other proto_tree_add functions, if there is a tree and the value cannot
+ be decoded from the tvbuff, then an expert info error is reported. For string
+ encoding, this means that a failure to decode the time value from the string
+ results in an expert info error being added to the tree.
+
+ If encoding is string-based, it will convert using tvb_get_string_time(); see
+ that function's comments for details.
+
+ @note The nstime_t *retval must be pre-allocated as a nstime_t.
+
+ @param tree the tree to append this item to
+ @param hfindex field index
+ @param tvb the tv buffer of the current data
+ @param start start of data in tvb
+ @param length length of data in tvb
+ @param encoding data encoding (e.g, ENC_LITTLE_ENDIAN, ENC_UTF_8|ENC_ISO_8601_DATE_TIME, etc.)
+ @param[in,out] retval points to a nstime_t which will be set to the value
+ @param[in,out] endoff if not NULL, gets set to the character after those consumed.
+ @param[in,out] err if not NULL, gets set to 0 if no failure, else the errno code (e.g., EDOM, ERANGE).
+ @return the newly created item, and retval is set to the decoded value
+ */
+WS_DLL_PUBLIC proto_item *
+proto_tree_add_time_item(proto_tree *tree, int hfindex, tvbuff_t *tvb,
+    const gint start, gint length, const guint encoding,
+    nstime_t *retval, gint *endoff, gint *err);
+
+
 /** Add a formatted FT_ABSOLUTE_TIME or FT_RELATIVE_TIME to a proto_tree, with
     the format generating the string for the value and with the field name
     being included automatically.
@@ -1212,7 +1428,7 @@ extern proto_item *
 proto_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,8);
 
-/** Add a FT_STRING to a proto_tree.
+/** Add a FT_STRING or FT_STRINGZPAD to a proto_tree.
  @param tree the tree to append this item to
  @param hfindex field index
  @param tvb the tv buffer of the current data
@@ -1224,9 +1440,9 @@ WS_DLL_PUBLIC proto_item *
 proto_tree_add_string(proto_tree *tree, int hfindex, tvbuff_t *tvb, gint start,
        gint length, const char* value);
 
-/** Add a formatted FT_STRING to a proto_tree, with the format generating
-    the string for the value and with the field name being included
-    automatically.
+/** Add a formatted FT_STRING or FT_STRINGZPAD to a proto_tree, with the
+    format generating the string for the value and with the field name
+    being included automatically.
  @param tree the tree to append this item to
  @param hfindex field index
  @param tvb the tv buffer of the current data
@@ -1241,8 +1457,9 @@ proto_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,8);
 
-/** Add a formatted FT_STRING to a proto_tree, with the format generating
-    the entire string for the entry, including any field name.
+/** Add a formatted FT_STRING or FT_STRINGZPAD to a proto_tree, with the
+    format generating the entire string for the entry, including any field
+    name.
  @param tree the tree to append this item to
  @param hfindex field index
  @param tvb the tv buffer of the current data
@@ -1763,14 +1980,19 @@ extern gint proto_registrar_get_length(const int n);
 WS_DLL_PUBLIC int proto_get_first_protocol(void **cookie);
 WS_DLL_PUBLIC int proto_get_data_protocol(void *cookie);
 WS_DLL_PUBLIC int proto_get_next_protocol(void **cookie);
-WS_DLL_PUBLIC header_field_info *proto_get_first_protocol_field(const int proto_id, void **cookle);
-WS_DLL_PUBLIC header_field_info *proto_get_next_protocol_field(void **cookle);
+WS_DLL_PUBLIC header_field_info *proto_get_first_protocol_field(const int proto_id, void **cookie);
+WS_DLL_PUBLIC header_field_info *proto_get_next_protocol_field(const int proto_id, void **cookie);
 
 /** Given a protocol's filter_name.
  @param filter_name the filter name to search for
  @return proto_id */
 WS_DLL_PUBLIC int proto_get_id_by_filter_name(const gchar* filter_name);
 
+/** Given a protocol's short name.
+ @param short_name the protocol short name to search for
+ @return proto_id */
+WS_DLL_PUBLIC int proto_get_id_by_short_name(const gchar* short_name);
+
 /** Can item # n decoding be disabled?
  @param proto_id protocol id (0-indexed)
  @return TRUE if it's a protocol, FALSE if it's not */
@@ -1946,7 +2168,7 @@ proto_find_field_from_offset(proto_tree *tree, guint offset, tvbuff_t *tvb);
         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)
+ @param encoding big or little endian byte representation (ENC_BIG_ENDIAN/ENC_LITTLE_ENDIAN/ENC_HOST_ENDIAN)
  @return the newly created item */
 WS_DLL_PUBLIC proto_item *
 proto_tree_add_bitmask(proto_tree *tree, tvbuff_t *tvb, const guint offset,
@@ -1971,7 +2193,7 @@ proto_tree_add_bitmask(proto_tree *tree, tvbuff_t *tvb, const guint offset,
         matched string displayed on the expansion line.
  @param exp expert info field used when decodable_len < len.  This also means this function
         should be called even when tree == NULL
- @param encoding big or little endian byte representation (ENC_BIG_ENDIAN/ENC_LITTLE_ENDIAN)
+ @param encoding big or little endian byte representation (ENC_BIG_ENDIAN/ENC_LITTLE_ENDIAN/ENC_HOST_ENDIAN)
  @return the newly created item */
 WS_DLL_PUBLIC proto_item *
 proto_tree_add_bitmask_len(proto_tree *tree, tvbuff_t *tvb, const guint offset, const guint len,
@@ -1986,7 +2208,7 @@ proto_tree_add_bitmask_len(proto_tree *tree, tvbuff_t *tvb, const guint offset,
  @param fallback field name if none of bitfields were usable
  @param ett subtree index
  @param fields NULL-terminated array of bitfield indexes
- @param encoding big or little endian byte representation (ENC_BIG_ENDIAN/ENC_LITTLE_ENDIAN)
+ @param encoding big or little endian byte representation (ENC_BIG_ENDIAN/ENC_LITTLE_ENDIAN/ENC_HOST_ENDIAN)
  @param flags bitmask field
  @return the newly created item */
 WS_DLL_PUBLIC proto_item *
@@ -2137,6 +2359,17 @@ WS_DLL_PUBLIC proto_item *
 proto_tree_add_ts_23_038_7bits_item(proto_tree *tree, const int hfindex, tvbuff_t *tvb,
        const guint bit_offset, const gint no_of_chars);
 
+/** Add a FT_STRING with ENC_ASCII_7BITS encoding to a proto_tree.
+ @param tree the tree to append this item to
+ @param hfindex field index
+ @param tvb the tv buffer of the current data
+ @param bit_offset start of data in tvb expressed in bits
+ @param no_of_chars number of 7bits characters to display
+ @return the newly created item */
+WS_DLL_PUBLIC proto_item *
+proto_tree_add_ascii_7bits_item(proto_tree *tree, const int hfindex, tvbuff_t *tvb,
+       const guint bit_offset, const gint no_of_chars);
+
 /** 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 */
@@ -2193,6 +2426,11 @@ proto_custom_set(proto_tree* tree, const int field_id,
 
 #define proto_tree_add_uint(tree, hfinfo, tvb, start, length, value) \
        proto_tree_add_uint(tree, (hfinfo)->id, tvb, start, length, value)
+
+#define proto_tree_add_float_format_value(tree, hfinfo, \
+                  tvb, start, length, value, format, ...) \
+       proto_tree_add_float_format_value(tree, (hfinfo)->id, \
+         tvb, start, length, value, format, __VA_ARGS__)
 #endif
 
 /** @} */