summaryrefslogtreecommitdiff
path: root/epan/tvbuff-int.h
diff options
context:
space:
mode:
authorJakub Zawadzki <darkjames-ws@darkjames.pl>2013-07-10 19:08:02 +0000
committerJakub Zawadzki <darkjames-ws@darkjames.pl>2013-07-10 19:08:02 +0000
commitd7175365ab6880cf0e7ef93e9e2b2331b94a7b48 (patch)
tree5a1d933059904d354f023bc7e012054f894b8075 /epan/tvbuff-int.h
parentbdd8e5bb57c90067e7e1247a2e1441128520a143 (diff)
downloadwireshark-d7175365ab6880cf0e7ef93e9e2b2331b94a7b48.tar.gz
tvbuff: allow tvb-implementations using their own structure (it's fine as long as first member of struct is tvbuff)
Move some stuff outside tvbuff struct. svn path=/trunk/; revision=50489
Diffstat (limited to 'epan/tvbuff-int.h')
-rw-r--r--epan/tvbuff-int.h25
1 files changed, 18 insertions, 7 deletions
diff --git a/epan/tvbuff-int.h b/epan/tvbuff-int.h
index 24aac4750a..c1964bcdf7 100644
--- a/epan/tvbuff-int.h
+++ b/epan/tvbuff-int.h
@@ -29,6 +29,7 @@
struct tvbuff;
struct tvb_ops {
+ gsize (*tvb_size)(void);
void (*tvb_init)(struct tvbuff *tvb);
void (*tvb_free)(struct tvbuff *tvb);
guint (*tvb_offset)(const struct tvbuff *tvb, guint counter);
@@ -77,13 +78,6 @@ struct tvbuff {
guint flags;
struct tvbuff *ds_tvb; /**< data source top-level tvbuff */
- /** TVBUFF_SUBSET and TVBUFF_COMPOSITE keep track
- * of the other tvbuff's they use */
- union {
- tvb_backing_t subset;
- tvb_comp_t composite;
- } tvbuffs;
-
/** We're either a TVBUFF_REAL_DATA or a
* TVBUFF_SUBSET that has a backing buffer that
* has real_data != NULL, or a TVBUFF_COMPOSITE
@@ -100,9 +94,26 @@ struct tvbuff {
/* Offset from beginning of first TVBUFF_REAL. */
gint raw_offset;
+};
+
+struct tvb_real {
+ struct tvbuff tvb;
/** Func to call when actually freed */
tvbuff_free_cb_t free_cb;
};
+struct tvb_subset {
+ struct tvbuff tvb;
+
+ tvb_backing_t subset;
+};
+
+struct tvb_composite {
+ struct tvbuff tvb;
+
+ tvb_comp_t composite;
+};
+
+
#endif