From Oleg Kostenko:
[obnox/wireshark/wip.git] / epan / proto.h
index 5c1645bd196c8d38451b1d4c1b7b81fcf38e4757..ead06e0fd414092e8a3e582eaa3c58d5290a4c3c 100644 (file)
@@ -3,8 +3,8 @@
  *
  * $Id$
  *
- * Ethereal - Network traffic analyzer
- * By Gerald Combs <gerald@ethereal.com>
+ * Wireshark - Network traffic analyzer
+ * By Gerald Combs <gerald@wireshark.org>
  * Copyright 1998 Gerald Combs
  *
  * This program is free software; you can redistribute it and/or
@@ -51,8 +51,8 @@
 #include "tvbuff.h"
 #include "ftypes/ftypes.h"
 
-/** The header-field index for the special text pseudo-field. Exported by libethereal.dll */
-ETH_VAR_IMPORT int hf_text_only;
+/** The header-field index for the special text pseudo-field. Exported by libwireshark.dll */
+WS_VAR_IMPORT int hf_text_only;
 
 /** the maximum length of a protocol field string representation */
 #define ITEM_LABEL_LENGTH      240
@@ -87,13 +87,13 @@ typedef struct _protocol protocol_t;
  * If that string is dynamically allocated, it should be allocated with
  * ep_alloc(); using ep_strdup_printf() would work.
  *
- * If the ETHEREAL_ABORT_ON_DISSECTOR_BUG environment variable is set,
+ * If the WIRESHARK_ABORT_ON_DISSECTOR_BUG environment variable is set,
  * it will call abort(), instead, to make it easier to get a stack trace.
  *
  * @param message string to use as the message
  */
 #define REPORT_DISSECTOR_BUG(message)  \
-  ((getenv("ETHEREAL_ABORT_ON_DISSECTOR_BUG") != NULL) ? \
+  ((getenv("WIRESHARK_ABORT_ON_DISSECTOR_BUG") != NULL) ? \
     abort() : \
     THROW_MESSAGE(DissectorError, message))
 
@@ -208,7 +208,7 @@ typedef struct field_info {
  * used in field_info.flags. */
 /* 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",
+/** The protocol field should be displayed as "generated by Wireshark",
  * used in field_info.flags. */
 #define FI_GENERATED           0x0002
 
@@ -272,7 +272,7 @@ typedef proto_node proto_item;
 /** The protocol field indicates a security probem (e.g. unsecure implementation) */
 /*#define PI_SECURITY                  0x8000*/
 
-/* add more, see http://wiki.ethereal.com/Development/ExpertInfo */
+/* add more, see http://wiki.wireshark.org/Development/ExpertInfo */
 
 
 /** is this protocol field hidden from the protocol tree display (used for filtering only)? */
@@ -283,10 +283,10 @@ typedef proto_node proto_item;
 /* 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)? */
+/** is this protocol field generated by Wireshark (and not read from the packet data)? */
 #define PROTO_ITEM_IS_GENERATED(proto_item)    \
        ((proto_item) ? FI_GET_FLAG((proto_item)->finfo, FI_GENERATED) : 0)
-/** mark this protocol field as generated by Ethereal (and not read from the packet data) */
+/** mark this protocol field as generated by Wireshark (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)
 
@@ -320,7 +320,7 @@ extern void proto_cleanup(void);
     you will still need to call any subdissector with the original value of 
     tree or filtering will break.
 
-    The purpose of this is to optimize ethereal for speed and make it
+    The purpose of this is to optimize wireshark for speed and make it
     faster for when filters are being used.
 */
 extern gboolean proto_field_is_referenced(proto_tree *tree, int proto_id);
@@ -389,8 +389,8 @@ extern int proto_item_get_len(proto_item *ti);
 /**
  * Sets an expert info to the proto_item.
  @param ti the item to set the expert info
- @param group the group of this info (e.g. FI_CHECKSUM)
- @param severity of this info (e.g. FI_ERROR)
+ @param group the group of this info (e.g. PI_CHECKSUM)
+ @param severity of this info (e.g. PI_ERROR)
  @return TRUE if value was written
  */
 extern gboolean proto_item_set_expert_flags(proto_item *ti, int group, int severity);
@@ -427,6 +427,11 @@ proto_tree_prime_hfid(proto_tree *tree, int hfid);
  @return parent item */
 extern proto_item* proto_tree_get_parent(proto_tree *tree);
 
+/** Get the root tree from any subtree.
+ @param tree the tree to get the root from
+ @return root tree */
+extern proto_tree* proto_tree_get_root(proto_tree *tree);
+
 /** Move an existing item behind another existing item.
  @param tree the tree to which both items belong
  @param fixed_item the item which keeps it's position
@@ -1475,6 +1480,10 @@ extern GPtrArray* proto_get_finfo_ptr_array(proto_tree *tree, int hfindex);
  * proto_get_finfo_ptr_array because it has to search through the tree. */
 extern GPtrArray* proto_find_finfo(proto_tree *tree, int hfindex);
 
+/* Return GPtrArray* of field_info pointers containg all hfindexes that appear in
+* tree. */
+extern GPtrArray* proto_all_finfos(proto_tree *tree);
+
 /** Dumps a glossary of the protocol registrations to STDOUT */
 extern void proto_registrar_dump_protocols(void);
 
@@ -1491,12 +1500,12 @@ extern void proto_registrar_dump_fields(int format);
 /** Points to the first element of an array of Booleans, indexed by
    a subtree item type. That array element is TRUE if subtrees of
    an item of that type are to be expanded. With MSVC and a 
-   libethereal.dll, we need a special declaration. */
-ETH_VAR_IMPORT gboolean             *tree_is_expanded;
+   libwireshark.dll, we need a special declaration. */
+WS_VAR_IMPORT gboolean      *tree_is_expanded;
 
 /** Number of elements in the tree_is_expanded array. With MSVC and a 
- * libethereal.dll, we need a special declaration. */
-ETH_VAR_IMPORT int           num_tree_types;
+ * libwireshark.dll, we need a special declaration. */
+WS_VAR_IMPORT int           num_tree_types;
 
 /** glib doesn't have g_ptr_array_len of all things!*/
 #ifndef g_ptr_array_len