aboutsummaryrefslogtreecommitdiffstats
path: root/epan/tvbuff.c
diff options
context:
space:
mode:
authorJeff Foster <jfoste@woodward.com>2001-03-23 14:44:04 +0000
committerJeff Foster <jfoste@woodward.com>2001-03-23 14:44:04 +0000
commit395b68ea19c7309f32d663776e1b3da37bff0a5b (patch)
tree3f409c6b10b05a765a7b836578421e65d7a7e231 /epan/tvbuff.c
parentc5791fac0cd877c895db31fc1ac4bb92a0c2c225 (diff)
Changes required to support multiple named data sources.
Tvbuffers changed to added the data source name, GUI and printing code changed to support these changes and display the multiple hex views. svn path=/trunk/; revision=3165
Diffstat (limited to 'epan/tvbuff.c')
-rw-r--r--epan/tvbuff.c15
1 files changed, 13 insertions, 2 deletions
diff --git a/epan/tvbuff.c b/epan/tvbuff.c
index d2152bc679..1d6f3f2407 100644
--- a/epan/tvbuff.c
+++ b/epan/tvbuff.c
@@ -9,7 +9,7 @@
* the data of a backing tvbuff, or can be a composite of
* other tvbuffs.
*
- * $Id: tvbuff.c,v 1.15 2001/03/13 21:34:27 gram Exp $
+ * $Id: tvbuff.c,v 1.16 2001/03/23 14:44:02 jfoster Exp $
*
* Copyright (c) 2000 by Gilbert Ramirez <gram@xiexie.org>
*
@@ -69,6 +69,7 @@ struct tvbuff {
tvbuff_type type;
gboolean initialized;
guint usage_count;
+ gchar* ds_name; /* data source name */
/* The tvbuffs in which this tvbuff is a member
* (that is, a backing tvbuff for a TVBUFF_SUBSET
@@ -319,7 +320,7 @@ tvb_set_real_data(tvbuff_t* tvb, const guint8* data, guint length, gint reported
}
tvbuff_t*
-tvb_new_real_data(const guint8* data, guint length, gint reported_length)
+tvb_new_real_data(const guint8* data, guint length, gint reported_length, const gchar* ds_name)
{
tvbuff_t *tvb;
@@ -329,6 +330,9 @@ tvb_new_real_data(const guint8* data, guint length, gint reported_length)
tvb_set_real_data(tvb, data, length, reported_length);
+ /* set the data source name */
+ tvb->ds_name = g_strdup( ds_name);
+
CLEANUP_POP;
return tvb;
@@ -497,6 +501,7 @@ tvb_new_subset(tvbuff_t *backing, gint backing_offset, gint backing_length, gint
tvb_set_subset(tvb, backing, backing_offset, backing_length, reported_length);
+ tvb->ds_name = backing->ds_name;
CLEANUP_POP;
return tvb;
@@ -1568,3 +1573,9 @@ tvb_bytes_to_str(tvbuff_t *tvb, gint offset, gint len)
{
return bytes_to_str(tvb_get_ptr(tvb, offset, len), len);
}
+
+gchar*
+tvb_get_name(tvbuff_t* tvb)
+{
+ return tvb->ds_name;
+}