aboutsummaryrefslogtreecommitdiffstats
path: root/epan/wscbor.h
diff options
context:
space:
mode:
Diffstat (limited to 'epan/wscbor.h')
-rw-r--r--epan/wscbor.h14
1 files changed, 11 insertions, 3 deletions
diff --git a/epan/wscbor.h b/epan/wscbor.h
index 43bad16905..51d612cb21 100644
--- a/epan/wscbor.h
+++ b/epan/wscbor.h
@@ -1,4 +1,4 @@
-/* wscbor.h
+/** @file
* Definitions for the Wireshark CBOR item decoding API.
* References:
* RFC 8949: https://tools.ietf.org/html/rfc8949
@@ -95,7 +95,7 @@ typedef struct {
/// The start offset of this chunk
gint start;
- /// The length of just this header any any preceding tags
+ /// The length of just this header and any preceding tags
gint head_length;
/// The length of this chunk and its immediate definite data (i.e. strings)
gint data_length;
@@ -163,7 +163,10 @@ gboolean wscbor_is_indefinite_break(const wscbor_chunk_t *chunk);
* @param alloc The allocator to use.
* @param tvb The data buffer.
* @param[in,out] offset The initial offset to read and skip over.
- * @return True if the skipped item was an indefinite break.
+ * Will be set to one-past the last valid CBOR (possibly nested) present.
+ * @return True if the skipped item was fully valid.
+ * @post This can throw ReportedBoundsError or ContainedBoundsError
+ * if the read itself ran out of data.
*/
WS_DLL_PUBLIC
gboolean wscbor_skip_next_item(wmem_allocator_t *alloc, tvbuff_t *tvb, gint *offset);
@@ -305,6 +308,11 @@ proto_item * proto_tree_add_cbor_tstr(proto_tree *tree, int hfindex, packet_info
WS_DLL_PUBLIC
proto_item * proto_tree_add_cbor_bstr(proto_tree *tree, int hfindex, packet_info *pinfo, tvbuff_t *tvb, const wscbor_chunk_t *chunk);
+/** Add an item representing the length of a bstr or tstr value.
+ */
+WS_DLL_PUBLIC
+proto_item * proto_tree_add_cbor_strlen(proto_tree *tree, int hfindex, packet_info *pinfo, tvbuff_t *tvb, const wscbor_chunk_t *chunk);
+
#ifdef __cplusplus
}
#endif