aboutsummaryrefslogtreecommitdiffstats
path: root/epan/tvbuff.h
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2013-04-18 19:22:24 +0000
committerGuy Harris <guy@alum.mit.edu>2013-04-18 19:22:24 +0000
commitc0c15029ed8d1234c95a71fdf7510a8bf0964fcb (patch)
tree585d3be4be77a93eb5fed23814d87ced468e9df9 /epan/tvbuff.h
parentd89d6c8314b8a5c407f86fe0f6e029b4da582b43 (diff)
Add to tvbuffs a "fragment length" field; if the tvbuff represents the
first fragment of a non-reassembled packet, and we know the length the packet would have if it were reassembled, this field holds the length of the fragment, and the "reported length" field shows the length the packet would have if it were reassembled, so going past the end of the fragment but staying within the length of the reassembled packet can be reported as "dissection would have worked if the packet had been reassembled" rather than "the packet is too short, so it was probably malformed". Add a FragmentBoundsError exception, thrown in the "dissection would have worked if the packet had been reassembled" case. Add a new tvb_new_subset_length_fragment() routine to create a new subset tvb with specified fragment and reported lengths. Use it in the CLNP dissector. Add some more sanity checks in the CLNP dissector. svn path=/trunk/; revision=48917
Diffstat (limited to 'epan/tvbuff.h')
-rw-r--r--epan/tvbuff.h13
1 files changed, 12 insertions, 1 deletions
diff --git a/epan/tvbuff.h b/epan/tvbuff.h
index 7a165dc8f9..21abf5ecf7 100644
--- a/epan/tvbuff.h
+++ b/epan/tvbuff.h
@@ -183,11 +183,22 @@ WS_DLL_PUBLIC tvbuff_t* tvb_new_subset(tvbuff_t* backing,
/*
* Similar to tvb_new_subset() but with captured length calculated
- * to fit within min(reported length, backing_length).
+ * to fit within the existing captured length and the specified
+ * backing length (which is used as both the fragment and reported
+ * length).
* Can throw ReportedBoundsError. */
WS_DLL_PUBLIC tvbuff_t* tvb_new_subset_length(tvbuff_t *backing,
const gint backing_offset, const gint backing_length);
+/** Similar to tvb_new_subset() but with fragment and reported length
+ * set as specified and captured length calculated to fit within
+ * the existing captured length and the specified fragment and
+ * reported lengths.
+ * Can throw ReportedBoundsError. */
+extern tvbuff_t* tvb_new_subset_length_fragment(tvbuff_t *backing,
+ const gint backing_offset, const gint fragment_length,
+ const gint reported_length);
+
/** Similar to tvb_new_subset() but with backing_length and reported_length set to -1.
* Can throw ReportedBoundsError. */
WS_DLL_PUBLIC tvbuff_t* tvb_new_subset_remaining(tvbuff_t* backing,