aboutsummaryrefslogtreecommitdiffstats
path: root/epan/ptvcursor.h
diff options
context:
space:
mode:
Diffstat (limited to 'epan/ptvcursor.h')
-rw-r--r--epan/ptvcursor.h30
1 files changed, 30 insertions, 0 deletions
diff --git a/epan/ptvcursor.h b/epan/ptvcursor.h
index 8c14e4c21c..9080a8b5be 100644
--- a/epan/ptvcursor.h
+++ b/epan/ptvcursor.h
@@ -34,6 +34,8 @@
#include <glib.h>
#include <epan/packet.h>
+#define SUBTREE_UNDEFINED_LENGTH -1
+
typedef struct ptvcursor ptvcursor_t;
/* Allocates an initializes a ptvcursor_t with 3 variables:
@@ -77,4 +79,32 @@ ptvcursor_tree(ptvcursor_t* ptvc);
void
ptvcursor_set_tree(ptvcursor_t* ptvc, proto_tree *tree);
+/* push a subtree in the tree stack of the cursor */
+proto_tree*
+ptvcursor_push_subtree(ptvcursor_t *ptvc, proto_item *it, gint ett_subtree);
+
+/* pop a subtree in the tree stack of the cursor */
+void ptvcursor_pop_subtree(ptvcursor_t *ptvc);
+
+/* Add an item to the tree and create a subtree
+ * If the length is unknown, length may be defined as SUBTREE_UNDEFINED_LENGTH.
+ * In this case, when the subtree will be closed, the parent item length will
+ * be equal to the advancement of the cursor since the creation of the subtree.
+ */
+proto_tree* ptvcursor_add_with_subtree(ptvcursor_t * ptvc, int hfindex, gint length,
+gboolean little_endian, gint ett_subtree);
+
+/* Add a text node to the tree and create a subtree
+ * If the length is unknown, length may be defined as SUBTREE_UNDEFINED_LENGTH.
+ * In this case, when the subtree will be closed, the item length will be equal
+ * to the advancement of the cursor since the creation of the subtree.
+ */
+proto_tree * ptvcursor_add_text_with_subtree(ptvcursor_t * ptvc, gint length,
+ gint ett_subtree, const char *format, ...);
+
+/* Creates a subtree and adds it to the cursor as the working tree but does not
+ * save the old working tree */
+proto_tree*
+ptvcursor_set_subtree(ptvcursor_t *ptvc, proto_item *it, gint ett_subtree);
+
#endif /* __PTVCURSOR_H__ */