aboutsummaryrefslogtreecommitdiffstats
path: root/epan/proto.h
diff options
context:
space:
mode:
authorguy <guy@f5534014-38df-0310-8fa8-9805f1628bb7>2003-04-29 21:27:19 +0000
committerguy <guy@f5534014-38df-0310-8fa8-9805f1628bb7>2003-04-29 21:27:19 +0000
commit465ccb68b4985c05ab1bb2b695a60e94f96a84d2 (patch)
tree023697e5009882c563216935eee4b494e4f46c9f /epan/proto.h
parentcfe7b742fbdea9ae940501f84d268b7353ae7aed (diff)
Add a "proto_item_set_end()" routine that sets the length of an item
given a tvbuff/offset pair referring to the byte past the end of the item. Use it in one place in the SMB dissector (there are plenty of other places where it could be used as well). git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@7603 f5534014-38df-0310-8fa8-9805f1628bb7
Diffstat (limited to 'epan/proto.h')
-rw-r--r--epan/proto.h11
1 files changed, 10 insertions, 1 deletions
diff --git a/epan/proto.h b/epan/proto.h
index 47cd2dd205..0749cee13a 100644
--- a/epan/proto.h
+++ b/epan/proto.h
@@ -1,7 +1,7 @@
/* proto.h
* Definitions for protocol display
*
- * $Id: proto.h,v 1.38 2003/01/31 03:17:52 guy Exp $
+ * $Id: proto.h,v 1.39 2003/04/29 21:27:14 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
@@ -163,6 +163,15 @@ extern void proto_item_append_text(proto_item *ti, const char *format, ...);
/* Set length of proto_item after having already been created. */
extern void proto_item_set_len(proto_item *ti, gint length);
+/*
+ * Sets the length of the item based on its start and on the specified
+ * offset, which is the offset past the end of the item; as the start
+ * in the item is relative to the beginning of the data source tvbuff,
+ * we need to pass in a tvbuff - the end offset is relative to the beginning
+ * of that tvbuff.
+ */
+extern void proto_item_set_end(proto_item *pi, tvbuff_t *tvb, gint end);
+
/* Get length of proto_item. Useful after using proto_tree_add_item()
* to add a variable-length field (e.g., FT_NSTRING_UINT8) */
extern int proto_item_get_len(proto_item *ti);