Wireshark 4.7.0
The Wireshark network protocol analyzer
Loading...
Searching...
No Matches
tvbuff.h
Go to the documentation of this file.
1
21#ifndef __TVBUFF_H__
22#define __TVBUFF_H__
23
24#include <ws_symbol_export.h>
25#include <ws_attributes.h>
26
27#include <epan/guid-utils.h>
28
29#include <wsutil/inet_addr.h>
30#include <wsutil/nstime.h>
31#include "wsutil/ws_mempbrk.h"
32
33#ifdef __cplusplus
34extern "C" {
35#endif /* __cplusplus */
36
47struct tvbuff;
48typedef struct tvbuff tvbuff_t;
49
103typedef void (*tvbuff_free_cb_t)(void*);
104
119WS_DLL_PUBLIC tvbuff_t *tvb_new_octet_aligned(tvbuff_t *tvb,
120 uint32_t bit_offset, int32_t no_of_bits);
121
134 uint32_t bit_offset, int32_t no_of_bits);
135
136WS_DLL_PUBLIC tvbuff_t *tvb_new_chain(tvbuff_t *parent, tvbuff_t *backing);
137
144WS_DLL_PUBLIC tvbuff_t *tvb_clone(tvbuff_t *tvb);
145
160WS_DLL_PUBLIC tvbuff_t *tvb_clone_offset_len(tvbuff_t *tvb, unsigned offset,
161 unsigned len);
162
171WS_DLL_PUBLIC void tvb_free(tvbuff_t *tvb);
172
181WS_DLL_PUBLIC void tvb_free_chain(tvbuff_t *tvb);
182
192WS_DLL_PUBLIC void tvb_set_free_cb(tvbuff_t *tvb, const tvbuff_free_cb_t func);
193
211WS_DLL_PUBLIC void tvb_set_child_real_data_tvbuff(tvbuff_t *parent,
212 tvbuff_t *child);
213
214WS_DLL_PUBLIC tvbuff_t *tvb_new_child_real_data(tvbuff_t *parent,
215 const uint8_t *data, const unsigned length, const int reported_length);
216
230WS_DLL_PUBLIC tvbuff_t *tvb_new_real_data(const uint8_t *data,
231 const unsigned length, const int reported_length);
232
266WS_DLL_PUBLIC tvbuff_t *tvb_new_subset_length_caplen(tvbuff_t *backing,
267 const int backing_offset, const int backing_length,
268 const int reported_length);
269
282WS_DLL_PUBLIC tvbuff_t *tvb_new_subset_length(tvbuff_t *backing,
283 const int backing_offset, const int reported_length);
284
295WS_DLL_PUBLIC tvbuff_t *tvb_new_subset_remaining(tvbuff_t *backing,
296 const int backing_offset);
297
307WS_DLL_PUBLIC void tvb_composite_append(tvbuff_t *tvb, tvbuff_t *member);
308
318extern void tvb_composite_prepend(tvbuff_t *tvb, tvbuff_t *member);
319
325WS_DLL_PUBLIC tvbuff_t *tvb_new_composite(void);
326
327
336WS_DLL_PUBLIC void tvb_composite_finalize(tvbuff_t *tvb);
337
338
349WS_DLL_PUBLIC unsigned tvb_captured_length(const tvbuff_t *tvb);
350
364WS_DLL_PUBLIC int tvb_captured_length_remaining(const tvbuff_t *tvb, const int offset);
365
367WS_DLL_PUBLIC unsigned tvb_ensure_captured_length_remaining(const tvbuff_t *tvb,
368 const int offset);
369
370/* Checks (w/o throwing exception) that the bytes referred to by
371 * 'offset'/'length' actually exist in the buffer */
372WS_DLL_PUBLIC bool tvb_bytes_exist(const tvbuff_t *tvb, const int offset,
373 const int length);
374
387WS_DLL_PUBLIC void tvb_ensure_bytes_exist64(const tvbuff_t *tvb,
388 const int offset, const uint64_t length);
389
401WS_DLL_PUBLIC void tvb_ensure_bytes_exist(const tvbuff_t *tvb,
402 const int offset, const int length);
403
412WS_DLL_PUBLIC bool tvb_offset_exists(const tvbuff_t *tvb,
413 const int offset);
414
422WS_DLL_PUBLIC unsigned tvb_reported_length(const tvbuff_t *tvb);
423
436WS_DLL_PUBLIC int tvb_reported_length_remaining(const tvbuff_t *tvb,
437 const int offset);
438
449WS_DLL_PUBLIC unsigned tvb_ensure_reported_length_remaining(const tvbuff_t *tvb,
450 const int offset);
451
464WS_DLL_PUBLIC void tvb_set_reported_length(tvbuff_t *tvb, const unsigned reported_length);
465
466
467/* Repair a tvbuff where the captured length is greater than the
468 * reported length; such a tvbuff makes no sense, as it's impossible
469 * to capture more data than is in the packet.
470 */
471WS_DLL_PUBLIC void tvb_fix_reported_length(tvbuff_t *tvb);
472
473WS_DLL_PUBLIC unsigned tvb_offset_from_real_beginning(const tvbuff_t *tvb);
474
475/* Returns the offset from the first byte of real data. */
476WS_DLL_PUBLIC int tvb_raw_offset(tvbuff_t *tvb);
477
481WS_DLL_PUBLIC void tvb_set_fragment(tvbuff_t *tvb);
482
483WS_DLL_PUBLIC struct tvbuff *tvb_get_ds_tvb(tvbuff_t *tvb);
484
485
486/************** START OF ACCESSORS ****************/
487/* All accessors will throw an exception if appropriate */
488
489WS_DLL_PUBLIC uint8_t tvb_get_uint8(tvbuff_t *tvb, const int offset);
490WS_DEPRECATED_X("Use tvb_get_uint8 instead")
491static inline uint8_t tvb_get_guint8(tvbuff_t *tvb, const int offset) { return tvb_get_uint8(tvb, offset); }
492WS_DLL_PUBLIC int8_t tvb_get_int8(tvbuff_t *tvb, const int offset);
493WS_DEPRECATED_X("Use tvb_get_int8 instead")
494static inline int8_t tvb_get_gint8(tvbuff_t *tvb, const int offset) { return tvb_get_int8(tvb, offset); }
495
496WS_DLL_PUBLIC uint16_t tvb_get_ntohs(tvbuff_t *tvb, const int offset);
497WS_DLL_PUBLIC int16_t tvb_get_ntohis(tvbuff_t *tvb, const int offset);
498WS_DLL_PUBLIC uint32_t tvb_get_ntoh24(tvbuff_t *tvb, const int offset);
499WS_DLL_PUBLIC int32_t tvb_get_ntohi24(tvbuff_t *tvb, const int offset);
500WS_DLL_PUBLIC uint32_t tvb_get_ntohl(tvbuff_t *tvb, const int offset);
501WS_DLL_PUBLIC int32_t tvb_get_ntohil(tvbuff_t *tvb, const int offset);
502WS_DLL_PUBLIC uint64_t tvb_get_ntoh40(tvbuff_t *tvb, const int offset);
503WS_DLL_PUBLIC int64_t tvb_get_ntohi40(tvbuff_t *tvb, const int offset);
504WS_DLL_PUBLIC uint64_t tvb_get_ntoh48(tvbuff_t *tvb, const int offset);
505WS_DLL_PUBLIC int64_t tvb_get_ntohi48(tvbuff_t *tvb, const int offset);
506WS_DLL_PUBLIC uint64_t tvb_get_ntoh56(tvbuff_t *tvb, const int offset);
507WS_DLL_PUBLIC int64_t tvb_get_ntohi56(tvbuff_t *tvb, const int offset);
508WS_DLL_PUBLIC uint64_t tvb_get_ntoh64(tvbuff_t *tvb, const int offset);
509WS_DLL_PUBLIC int64_t tvb_get_ntohi64(tvbuff_t *tvb, const int offset);
510WS_DLL_PUBLIC float tvb_get_ntohieee_float(tvbuff_t *tvb, const int offset);
511WS_DLL_PUBLIC double tvb_get_ntohieee_double(tvbuff_t *tvb,
512 const int offset);
513
514WS_DLL_PUBLIC uint16_t tvb_get_letohs(tvbuff_t *tvb, const int offset);
515WS_DLL_PUBLIC int16_t tvb_get_letohis(tvbuff_t *tvb, const int offset);
516WS_DLL_PUBLIC uint32_t tvb_get_letoh24(tvbuff_t *tvb, const int offset);
517WS_DLL_PUBLIC int32_t tvb_get_letohi24(tvbuff_t *tvb, const int offset);
518WS_DLL_PUBLIC uint32_t tvb_get_letohl(tvbuff_t *tvb, const int offset);
519WS_DLL_PUBLIC int32_t tvb_get_letohil(tvbuff_t *tvb, const int offset);
520WS_DLL_PUBLIC uint64_t tvb_get_letoh40(tvbuff_t *tvb, const int offset);
521WS_DLL_PUBLIC int64_t tvb_get_letohi40(tvbuff_t *tvb, const int offset);
522WS_DLL_PUBLIC uint64_t tvb_get_letoh48(tvbuff_t *tvb, const int offset);
523WS_DLL_PUBLIC int64_t tvb_get_letohi48(tvbuff_t *tvb, const int offset);
524WS_DLL_PUBLIC uint64_t tvb_get_letoh56(tvbuff_t *tvb, const int offset);
525WS_DLL_PUBLIC int64_t tvb_get_letohi56(tvbuff_t *tvb, const int offset);
526WS_DLL_PUBLIC uint64_t tvb_get_letoh64(tvbuff_t *tvb, const int offset);
527WS_DLL_PUBLIC int64_t tvb_get_letohi64(tvbuff_t *tvb, const int offset);
528WS_DLL_PUBLIC float tvb_get_letohieee_float(tvbuff_t *tvb, const int offset);
529WS_DLL_PUBLIC double tvb_get_letohieee_double(tvbuff_t *tvb,
530 const int offset);
531
532WS_DLL_PUBLIC uint16_t tvb_get_uint16(tvbuff_t *tvb, const int offset, const unsigned encoding);
533WS_DEPRECATED_X("Use tvb_get_uint16 instead")
534static inline uint16_t tvb_get_guint16(tvbuff_t *tvb, const int offset, const unsigned encoding) { return tvb_get_uint16(tvb, offset, encoding); }
535WS_DLL_PUBLIC int16_t tvb_get_int16(tvbuff_t *tvb, const int offset, const unsigned encoding);
536WS_DEPRECATED_X("Use tvb_get_int16 instead")
537static inline int16_t tvb_get_gint16(tvbuff_t *tvb, const int offset, const unsigned encoding) { return tvb_get_int16(tvb, offset, encoding); }
538WS_DLL_PUBLIC uint32_t tvb_get_uint24(tvbuff_t *tvb, const int offset, const unsigned encoding);
539WS_DEPRECATED_X("Use tvb_get_uint24 instead")
540static inline uint32_t tvb_get_guint24(tvbuff_t *tvb, const int offset, const unsigned encoding) { return tvb_get_uint24(tvb, offset, encoding); }
541WS_DLL_PUBLIC int32_t tvb_get_int24(tvbuff_t *tvb, const int offset, const unsigned encoding);
542WS_DEPRECATED_X("Use tvb_get_int24 instead")
543static inline int32_t tvb_get_gint24(tvbuff_t *tvb, const int offset, const unsigned encoding) { return tvb_get_int24(tvb, offset, encoding); }
544WS_DLL_PUBLIC uint32_t tvb_get_uint32(tvbuff_t *tvb, const int offset, const unsigned encoding);
545WS_DEPRECATED_X("Use tvb_get_uint32 instead")
546static inline uint32_t tvb_get_guint32(tvbuff_t *tvb, const int offset, const unsigned encoding) { return tvb_get_uint32(tvb, offset, encoding); }
547WS_DLL_PUBLIC int32_t tvb_get_int32(tvbuff_t *tvb, const int offset, const unsigned encoding);
548WS_DEPRECATED_X("Use tvb_get_int32 instead")
549static inline int32_t tvb_get_gint32(tvbuff_t *tvb, const int offset, const unsigned encoding) { return tvb_get_int32(tvb, offset, encoding); }
550WS_DLL_PUBLIC uint64_t tvb_get_uint40(tvbuff_t *tvb, const int offset, const unsigned encoding);
551WS_DEPRECATED_X("Use tvb_get_uint40 instead")
552static inline uint64_t tvb_get_guint40(tvbuff_t *tvb, const int offset, const unsigned encoding) { return tvb_get_uint40(tvb, offset, encoding); }
553WS_DLL_PUBLIC int64_t tvb_get_int40(tvbuff_t *tvb, const int offset, const unsigned encoding);
554WS_DEPRECATED_X("Use tvb_get_int40 instead")
555static inline int64_t tvb_get_gint40(tvbuff_t *tvb, const int offset, const unsigned encoding) { return tvb_get_int40(tvb, offset, encoding); }
556WS_DLL_PUBLIC uint64_t tvb_get_uint48(tvbuff_t *tvb, const int offset, const unsigned encoding);
557WS_DEPRECATED_X("Use tvb_get_uint48 instead")
558static inline uint64_t tvb_get_guint48(tvbuff_t *tvb, const int offset, const unsigned encoding) { return tvb_get_uint48(tvb, offset, encoding); }
559WS_DLL_PUBLIC int64_t tvb_get_int48(tvbuff_t *tvb, const int offset, const unsigned encoding);
560WS_DEPRECATED_X("Use tvb_get_int48 instead")
561static inline int64_t tvb_get_gint48(tvbuff_t *tvb, const int offset, const unsigned encoding) { return tvb_get_int48(tvb, offset, encoding); }
562WS_DLL_PUBLIC uint64_t tvb_get_uint56(tvbuff_t *tvb, const int offset, const unsigned encoding);
563WS_DEPRECATED_X("Use tvb_get_uint56 instead")
564static inline uint64_t tvb_get_guint56(tvbuff_t *tvb, const int offset, const unsigned encoding) { return tvb_get_uint56(tvb, offset, encoding); }
565WS_DLL_PUBLIC int64_t tvb_get_int56(tvbuff_t *tvb, const int offset, const unsigned encoding);
566WS_DEPRECATED_X("Use tvb_get_int56 instead")
567static inline int64_t tvb_get_gint56(tvbuff_t *tvb, const int offset, const unsigned encoding) { return tvb_get_int56(tvb, offset, encoding); }
568WS_DLL_PUBLIC uint64_t tvb_get_uint64(tvbuff_t *tvb, const int offset, const unsigned encoding);
569WS_DLL_PUBLIC uint64_t tvb_get_uint64_with_length(tvbuff_t *tvb, const int offset, unsigned length, const unsigned encoding);
570WS_DEPRECATED_X("Use tvb_get_uint64 instead")
571static inline uint64_t tvb_get_guint64(tvbuff_t *tvb, const int offset, const unsigned encoding) {return tvb_get_uint64(tvb, offset, encoding); }
572WS_DLL_PUBLIC int64_t tvb_get_int64(tvbuff_t *tvb, const int offset, const unsigned encoding);
573WS_DEPRECATED_X("Use tvb_get_int64 instead")
574static inline int64_t tvb_get_gint64(tvbuff_t *tvb, const int offset, const unsigned encoding) { return tvb_get_int64(tvb, offset, encoding); }
575WS_DLL_PUBLIC float tvb_get_ieee_float(tvbuff_t *tvb, const int offset, const unsigned encoding);
576WS_DLL_PUBLIC double tvb_get_ieee_double(tvbuff_t *tvb, const int offset, const unsigned encoding);
577
578/*
579 * Fetch 16-bit and 32-bit values in host byte order.
580 * Used for some pseudo-headers in pcap/pcapng files, in which the
581 * headers are, when capturing, in the byte order of the host, and
582 * are converted to the byte order of the host reading the file
583 * when reading a capture file.
584 */
585#if G_BYTE_ORDER == G_LITTLE_ENDIAN
586#define tvb_get_h_uint16 tvb_get_letohs
587#define tvb_get_h_uint32 tvb_get_letohl
588#elif G_BYTE_ORDER == G_BIG_ENDIAN
589#define tvb_get_h_uint16 tvb_get_ntohs
590#define tvb_get_h_uint32 tvb_get_ntohl
591#else
592#error "Unsupported byte order"
593#endif
594
595
596/* Fetch a time value from an ASCII-style string in the tvb.
597 *
598 * @param[in] offset The beginning offset in the tvb (cannot be negative)
599 * @param[in] length The field's length in the tvb (or -1 for remaining)
600 * @param[in] encoding The ENC_* that defines the format (e.g., ENC_ISO_8601_DATE_TIME)
601 * @param[in,out] ns The pre-allocated nstime_t that will be set to the decoded value
602 * @param[out] endoff if not NULL, should point to a int that this
603 * routine will then set to be the offset to the character after
604 * the last character used in the conversion. This is useful because
605 * they may not consume the whole section.
606 *
607 * @return a pointer to the nstime_t passed-in, or NULL on failure; if no
608 * valid conversion could be performed, *endoff is set to 0, and the
609 * nstime_t* passed-in will be cleared.
610 *
611 * @note The conversion ignores leading spaces, and will succeed even if it does
612 * not consume the entire string. If you care about such things, always compare
613 * the *endoff to where you expect it to be (namely, offset+length).
614 *
615 * This routine will not throw an error unless the passed-in arguments are
616 * invalid (e.g., offset is beyond the tvb's length).
617 *
618 * @warning This only works for string encodings which encode ASCII characters in
619 * a single byte: ENC_ASCII, ENC_UTF_8, ENC_ISO_8859_*, etc. It does NOT work
620 * for purely multi-byte encodings such as ENC_UTF_16, ENC_UCS_*, etc.
621 */
622WS_DLL_PUBLIC
623nstime_t* tvb_get_string_time(tvbuff_t *tvb, const int offset, const int length,
624 const unsigned encoding, nstime_t* ns, int *endoff);
625
626/* Similar to above, but returns a GByteArray based on the case-insensitive
627 * hex-char strings with optional separators, and with optional leading spaces.
628 * The separators allowed are based on the ENC_SEP_* passed in the encoding param.
629 *
630 * The passed-in bytes is set to the values, and its pointer is also the return
631 * value or NULL on error. The GByteArray bytes must be pre-constructed with
632 * g_byte_array_new().
633 */
634WS_DLL_PUBLIC
635GByteArray* tvb_get_string_bytes(tvbuff_t *tvb, const int offset, const int length,
636 const unsigned encoding, GByteArray* bytes, int *endoff);
637
642WS_DLL_PUBLIC uint32_t tvb_get_ipv4(tvbuff_t *tvb, const int offset);
643
644/* Fetch an IPv6 address. */
645WS_DLL_PUBLIC void tvb_get_ipv6(tvbuff_t *tvb, const int offset,
646 ws_in6_addr *addr);
647
658extern int tvb_get_ipv4_addr_with_prefix_len(tvbuff_t *tvb, int offset,
659 ws_in4_addr *addr, uint32_t prefix_len);
660
671extern int tvb_get_ipv6_addr_with_prefix_len(tvbuff_t *tvb, int offset,
672 ws_in6_addr *addr, uint32_t prefix_len);
673
674/* Fetch a GUID. */
675WS_DLL_PUBLIC void tvb_get_ntohguid(tvbuff_t *tvb, const int offset,
676 e_guid_t *guid);
677
678WS_DLL_PUBLIC void tvb_get_letohguid(tvbuff_t *tvb, const int offset,
679 e_guid_t *guid);
680
681WS_DLL_PUBLIC void tvb_get_guid(tvbuff_t *tvb, const int offset,
682 e_guid_t *guid, const unsigned encoding);
683
684/* Fetches a byte array given a bit offset in a tvb */
685WS_DLL_PUBLIC uint8_t* tvb_get_bits_array(wmem_allocator_t *scope, tvbuff_t *tvb,
686 const int offset, size_t length, size_t *data_length, const unsigned encoding);
687
688/* Fetch a specified number of bits from bit offset in a tvb. All of these
689 * functions are equivalent, except for the type of the return value. Note
690 * that the parameter encoding (where supplied) indicates the *bit* ordering
691 * within each octet, but offsets 0-7 still indicate octet 0 in the buffer.
692 * Versions of Wireshark prior to 3.6 ignored the encoding parameter.
693 */
694
695/* get 1 - 8 bits returned in a uint8_t */
696WS_DLL_PUBLIC uint8_t tvb_get_bits8(tvbuff_t *tvb, unsigned bit_offset,
697 const int no_of_bits);
698
699/* get 1 - 16 bits returned in a uint16_t */
700WS_DLL_PUBLIC uint16_t tvb_get_bits16(tvbuff_t *tvb, unsigned bit_offset,
701 const int no_of_bits, const unsigned encoding);
702
703/* get 1 - 32 bits returned in a uint32_t */
704WS_DLL_PUBLIC uint32_t tvb_get_bits32(tvbuff_t *tvb, unsigned bit_offset,
705 const int no_of_bits, const unsigned encoding);
706
707/* get 1 - 64 bits returned in a uint64_t */
708WS_DLL_PUBLIC uint64_t tvb_get_bits64(tvbuff_t *tvb, unsigned bit_offset,
709 const int no_of_bits, const unsigned encoding);
710
714WS_DLL_PUBLIC
715WS_DEPRECATED_X("Use tvb_get_bits32() instead")
716uint32_t tvb_get_bits(tvbuff_t *tvb, const unsigned bit_offset,
717 const int no_of_bits, const unsigned encoding);
718
725WS_DLL_PUBLIC void *tvb_memcpy(tvbuff_t *tvb, void *target, const int offset,
726 size_t length);
727
743WS_DLL_PUBLIC void *tvb_memdup(wmem_allocator_t *scope, tvbuff_t *tvb,
744 const int offset, size_t length);
745
771WS_DLL_PUBLIC const uint8_t *tvb_get_ptr(tvbuff_t *tvb, const int offset,
772 const int length);
773
781WS_DLL_PUBLIC int tvb_find_uint8(tvbuff_t *tvb, const int offset,
782 const int maxlength, const uint8_t needle);
783
784WS_DEPRECATED_X("Use tvb_find_uint8 instead")
785static inline int tvb_find_guint8(tvbuff_t* tvb, const int offset,
786 const int maxlength, const uint8_t needle) { return tvb_find_uint8(tvb, offset, maxlength, needle); }
787
789WS_DLL_PUBLIC int tvb_find_uint16(tvbuff_t *tvb, const int offset,
790 const int maxlength, const uint16_t needle);
791
792WS_DEPRECATED_X("Use tvb_find_uint16 instead")
793static inline int tvb_find_guint16(tvbuff_t* tvb, const int offset,
794 const int maxlength, const uint16_t needle) {
795 return tvb_find_uint16(tvb, offset, maxlength, needle);
796}
805WS_DLL_PUBLIC int tvb_ws_mempbrk_pattern_uint8(tvbuff_t *tvb, const int offset,
806 const int maxlength, const ws_mempbrk_pattern* pattern, unsigned char *found_needle);
807
808WS_DEPRECATED_X("Use tvb_ws_mempbrk_pattern_uint8 instead")
809static inline int tvb_ws_mempbrk_pattern_guint8(tvbuff_t* tvb, const int offset,
810 const int maxlength, const ws_mempbrk_pattern* pattern, unsigned char* found_needle) {
811 return tvb_ws_mempbrk_pattern_uint8(tvb, offset, maxlength, pattern, found_needle);
812}
813
819WS_DLL_PUBLIC unsigned tvb_strsize(tvbuff_t *tvb, const int offset);
820
827WS_DLL_PUBLIC unsigned tvb_unicode_strsize(tvbuff_t *tvb, const int offset);
828
833WS_DLL_PUBLIC int tvb_strnlen(tvbuff_t *tvb, const int offset,
834 const unsigned maxlength);
835
839WS_DLL_PUBLIC char *tvb_format_text(wmem_allocator_t *scope, tvbuff_t *tvb, const int offset,
840 const int size);
841
846WS_DLL_PUBLIC char *tvb_format_text_wsp(wmem_allocator_t* allocator, tvbuff_t *tvb, const int offset,
847 const int size);
848
853extern char *tvb_format_stringzpad(wmem_allocator_t *scope, tvbuff_t *tvb, const int offset,
854 const int size);
855
860extern char *tvb_format_stringzpad_wsp(wmem_allocator_t* allocator, tvbuff_t *tvb, const int offset,
861 const int size);
862
883WS_DLL_PUBLIC uint8_t *tvb_get_string_enc(wmem_allocator_t *scope,
884 tvbuff_t *tvb, const int offset, const int length, const unsigned encoding);
885
908 tvbuff_t *tvb, const int bit_offset, int no_of_chars);
909
932 tvbuff_t *tvb, const int offset, int length);
933
955 tvbuff_t *tvb, const int offset, int length);
956
977WS_DLL_PUBLIC char *tvb_get_ascii_7bits_string(wmem_allocator_t *scope,
978 tvbuff_t *tvb, const int bit_offset, int no_of_chars);
979
1000WS_DLL_PUBLIC uint8_t *tvb_get_stringzpad(wmem_allocator_t *scope,
1001 tvbuff_t *tvb, const int offset, const int length, const unsigned encoding);
1002
1029WS_DLL_PUBLIC uint8_t *tvb_get_stringz_enc(wmem_allocator_t *scope,
1030 tvbuff_t *tvb, const int offset, int *lengthp, const unsigned encoding);
1031
1056WS_DLL_PUBLIC
1057WS_DEPRECATED_X("Use APIs that return a valid UTF-8 string instead")
1058const uint8_t *tvb_get_const_stringz(tvbuff_t *tvb,
1059 const int offset, int *lengthp);
1060
1070WS_DLL_PUBLIC int tvb_get_raw_bytes_as_stringz(tvbuff_t *tvb, const int offset,
1071 const unsigned bufsize, uint8_t *buffer);
1072
1073/*
1074 * Given a tvbuff, an offset into the tvbuff, a buffer, and a buffer size,
1075 * extract as many raw bytes from the tvbuff, starting at the offset,
1076 * as 1) are available in the tvbuff and 2) will fit in the buffer, leaving
1077 * room for a terminating NUL.
1078 */
1079WS_DLL_PUBLIC int tvb_get_raw_bytes_as_string(tvbuff_t *tvb, const int offset, char *buffer, size_t bufsize);
1080
1085WS_DLL_PUBLIC bool tvb_ascii_isprint(tvbuff_t *tvb, const int offset,
1086 const int length);
1087
1097WS_DLL_PUBLIC bool tvb_utf_8_isprint(tvbuff_t *tvb, const int offset,
1098 const int length);
1099
1104WS_DLL_PUBLIC bool tvb_ascii_isdigit(tvbuff_t *tvb, const int offset,
1105 const int length);
1106
1126WS_DLL_PUBLIC int tvb_find_line_end(tvbuff_t *tvb, const int offset, int len,
1127 int *next_offset, const bool desegment);
1128
1147WS_DLL_PUBLIC int tvb_find_line_end_unquoted(tvbuff_t *tvb, const int offset,
1148 int len, int *next_offset);
1149
1167WS_DLL_PUBLIC int tvb_skip_wsp(tvbuff_t *tvb, const int offset,
1168 const int maxlength);
1169
1170WS_DLL_PUBLIC int tvb_skip_wsp_return(tvbuff_t *tvb, const int offset);
1171
1172int tvb_skip_uint8(tvbuff_t *tvb, int offset, const int maxlength, const uint8_t ch);
1173WS_DEPRECATED_X("Use tvb_skip_uint8 instead")
1174static inline int tvb_skip_guint8(tvbuff_t *tvb, int offset, const int maxlength, const uint8_t ch) {
1175 return tvb_skip_uint8(tvb, offset, maxlength, ch);
1176}
1177
1196WS_DLL_PUBLIC int tvb_get_token_len(tvbuff_t *tvb, const int offset, int len, int *next_offset, const bool desegment);
1197
1202WS_DLL_PUBLIC int tvb_strneql(tvbuff_t *tvb, const int offset,
1203 const char *str, const size_t size);
1204
1209WS_DLL_PUBLIC int tvb_strncaseeql(tvbuff_t *tvb, const int offset,
1210 const char *str, const size_t size);
1211
1216WS_DLL_PUBLIC int tvb_memeql(tvbuff_t *tvb, const int offset,
1217 const uint8_t *str, size_t size);
1218
1224WS_DLL_PUBLIC char *tvb_bytes_to_str_punct(wmem_allocator_t *scope, tvbuff_t *tvb, const int offset,
1225 const int len, const char punct);
1226
1231WS_DLL_PUBLIC char *tvb_bytes_to_str(wmem_allocator_t *allocator, tvbuff_t *tvb,
1232 const int offset, const int len);
1233
1244typedef struct dgt_set_t
1245{
1246 const unsigned char out[16];
1247}
1249
1250WS_DLL_PUBLIC const char *tvb_bcd_dig_to_str(wmem_allocator_t *scope,
1251 tvbuff_t *tvb, const int offset, const int len, const dgt_set_t *dgt,
1252 bool skip_first);
1253
1265WS_DLL_PUBLIC const char *tvb_bcd_dig_to_str_be(wmem_allocator_t *scope,
1266 tvbuff_t *tvb, const int offset, const int len, const dgt_set_t *dgt,
1267 bool skip_first);
1268
1284WS_DLL_PUBLIC char *tvb_get_bcd_string(wmem_allocator_t *scope, tvbuff_t *tvb,
1285 const int offset, int len, const dgt_set_t *dgt,
1286 bool skip_first, bool odd, bool bigendian);
1287
1292WS_DLL_PUBLIC int tvb_find_tvb(tvbuff_t *haystack_tvb, tvbuff_t *needle_tvb,
1293 const int haystack_offset);
1294
1295/* From tvbuff_zlib.c */
1296
1297WS_DEPRECATED_X("Use tvb_uncompress_zlib instead")
1298WS_DLL_PUBLIC tvbuff_t *tvb_uncompress(tvbuff_t *tvb, const int offset,
1299 int comprlen);
1300
1310WS_DLL_PUBLIC tvbuff_t *tvb_uncompress_zlib(tvbuff_t *tvb, const int offset,
1311 int comprlen);
1312
1313WS_DEPRECATED_X("Use tvb_child_uncompress_zlib instead")
1314WS_DLL_PUBLIC tvbuff_t *tvb_child_uncompress(tvbuff_t *parent, tvbuff_t *tvb,
1315 const int offset, int comprlen);
1316
1322WS_DLL_PUBLIC tvbuff_t *tvb_child_uncompress_zlib(tvbuff_t *parent, tvbuff_t *tvb,
1323 const int offset, int comprlen);
1324
1325/* From tvbuff_brotli.c */
1326
1336WS_DLL_PUBLIC tvbuff_t *tvb_uncompress_brotli(tvbuff_t *tvb, const int offset,
1337 int comprlen);
1338
1344WS_DLL_PUBLIC tvbuff_t *tvb_child_uncompress_brotli(tvbuff_t *parent, tvbuff_t *tvb,
1345 const int offset, int comprlen);
1346
1347/* From tvbuff_snappy.c */
1348
1354WS_DLL_PUBLIC tvbuff_t *tvb_uncompress_snappy(tvbuff_t *tvb, const int offset,
1355 int comprlen);
1356
1362WS_DLL_PUBLIC tvbuff_t *tvb_child_uncompress_snappy(tvbuff_t *parent, tvbuff_t *tvb,
1363 const int offset, int comprlen);
1364
1365/* From tvbuff_lz77.c */
1366
1377WS_DLL_PUBLIC tvbuff_t *tvb_uncompress_lz77(tvbuff_t *tvb,
1378 const int offset, int comprlen);
1379
1386WS_DLL_PUBLIC tvbuff_t *tvb_child_uncompress_lz77(tvbuff_t *parent,
1387 tvbuff_t *tvb, const int offset, int comprlen);
1388
1389/* From tvbuff_lz77huff.c */
1390
1401WS_DLL_PUBLIC tvbuff_t *tvb_uncompress_lz77huff(tvbuff_t *tvb,
1402 const int offset, int comprlen);
1403
1410WS_DLL_PUBLIC tvbuff_t *tvb_child_uncompress_lz77huff(tvbuff_t *parent,
1411 tvbuff_t *tvb, const int offset, int comprlen);
1412
1413/* From tvbuff_lznt1.c */
1414
1425WS_DLL_PUBLIC tvbuff_t *tvb_uncompress_lznt1(tvbuff_t *tvb,
1426 const int offset, int comprlen);
1427
1434WS_DLL_PUBLIC tvbuff_t *tvb_child_uncompress_lznt1(tvbuff_t *parent,
1435 tvbuff_t *tvb, const int offset, int comprlen);
1436
1447WS_DLL_PUBLIC tvbuff_t *tvb_uncompress_zstd(tvbuff_t *tvb,
1448 const int offset, int comprlen);
1449
1456WS_DLL_PUBLIC tvbuff_t *tvb_child_uncompress_zstd(tvbuff_t *parent,
1457 tvbuff_t *tvb, const int offset, int comprlen);
1458
1459/* From tvbuff_base64.c */
1460
1470extern tvbuff_t* base64_to_tvb(tvbuff_t *parent, const char *base64);
1471
1472
1482extern tvbuff_t* base64_tvb_to_new_tvb(tvbuff_t* parent, int offset, int length);
1483
1484extern tvbuff_t* base64uri_tvb_to_new_tvb(tvbuff_t* parent, int offset, int length);
1485
1486/* From tvbuff_hpackhuff.c */
1487
1488WS_DLL_PUBLIC wmem_strbuf_t* tvb_get_hpack_huffman_strbuf(wmem_allocator_t *scope,
1489 tvbuff_t *tvb, const int offset, const int len);
1490
1491WS_DLL_PUBLIC tvbuff_t* tvb_child_uncompress_hpack_huff(tvbuff_t *parent,
1492 int offset, int length);
1493
1507WS_DLL_PUBLIC unsigned tvb_get_varint(tvbuff_t *tvb, unsigned offset, unsigned maxlen, uint64_t *value, const unsigned encoding);
1508
1509/************** END OF ACCESSORS ****************/
1510
1513#ifdef __cplusplus
1514}
1515#endif /* __cplusplus */
1516
1517#endif /* __TVBUFF_H__ */
1518
1519/*
1520 * Editor modelines - https://www.wireshark.org/tools/modelines.html
1521 *
1522 * Local variables:
1523 * c-basic-offset: 4
1524 * tab-width: 8
1525 * indent-tabs-mode: nil
1526 * End:
1527 *
1528 * vi: set shiftwidth=4 tabstop=8 expandtab:
1529 * :indentSize=4:tabSize=8:noTabs=true:
1530 */
WS_DLL_PUBLIC bool tvb_ascii_isprint(tvbuff_t *tvb, const int offset, const int length)
Definition tvbuff.c:4129
WS_DLL_PUBLIC bool tvb_ascii_isdigit(tvbuff_t *tvb, const int offset, const int length)
Definition tvbuff.c:4160
WS_DLL_PUBLIC int tvb_find_uint16(tvbuff_t *tvb, const int offset, const int maxlength, const uint16_t needle)
Definition tvbuff.c:2503
WS_DLL_PUBLIC int tvb_find_tvb(tvbuff_t *haystack_tvb, tvbuff_t *needle_tvb, const int haystack_offset)
Definition tvbuff.c:4747
WS_DLL_PUBLIC int tvb_strnlen(tvbuff_t *tvb, const int offset, const unsigned maxlength)
Definition tvbuff.c:2679
WS_DLL_PUBLIC tvbuff_t * tvb_child_uncompress_brotli(tvbuff_t *parent, tvbuff_t *tvb, const int offset, int comprlen)
Definition tvbuff_brotli.c:173
int tvb_get_ipv4_addr_with_prefix_len(tvbuff_t *tvb, int offset, ws_in4_addr *addr, uint32_t prefix_len)
Definition tvbuff.c:2135
WS_DLL_PUBLIC void tvb_set_fragment(tvbuff_t *tvb)
Definition tvbuff.c:4785
WS_DLL_PUBLIC int tvb_get_token_len(tvbuff_t *tvb, const int offset, int len, int *next_offset, const bool desegment)
Definition tvbuff.c:4541
WS_DLL_PUBLIC char * tvb_get_etsi_ts_102_221_annex_a_string(wmem_allocator_t *scope, tvbuff_t *tvb, const int offset, int length)
Definition tvbuff.c:3096
WS_DLL_PUBLIC int tvb_strneql(tvbuff_t *tvb, const int offset, const char *str, const size_t size)
Definition tvbuff.c:2707
WS_DLL_PUBLIC tvbuff_t * tvb_new_octet_aligned(tvbuff_t *tvb, uint32_t bit_offset, int32_t no_of_bits)
Extracts a specified number of bits starting at a given bit offset, aligning the result to octet boun...
Definition tvbuff.c:371
WS_DLL_PUBLIC void tvb_free(tvbuff_t *tvb)
Free a tvbuff_t and all tvbuffs chained from it.
Definition tvbuff.c:109
WS_DLL_PUBLIC char * tvb_get_ascii_7bits_string(wmem_allocator_t *scope, tvbuff_t *tvb, const int bit_offset, int no_of_chars)
Definition tvbuff.c:3108
WS_DLL_PUBLIC tvbuff_t * tvb_new_subset_length(tvbuff_t *backing, const int backing_offset, const int reported_length)
Definition tvbuff_subset.c:191
WS_DLL_PUBLIC tvbuff_t * tvb_uncompress_lz77huff(tvbuff_t *tvb, const int offset, int comprlen)
Definition tvbuff_lz77huff.c:360
WS_DLL_PUBLIC unsigned tvb_ensure_captured_length_remaining(const tvbuff_t *tvb, const int offset)
Definition tvbuff.c:578
WS_DLL_PUBLIC int tvb_get_raw_bytes_as_stringz(tvbuff_t *tvb, const int offset, const unsigned bufsize, uint8_t *buffer)
Definition tvbuff.c:4079
WS_DLL_PUBLIC char * tvb_format_text_wsp(wmem_allocator_t *allocator, tvbuff_t *tvb, const int offset, const int size)
Definition tvbuff.c:2803
WS_DLL_PUBLIC unsigned tvb_reported_length(const tvbuff_t *tvb)
Get reported length of buffer.
Definition tvbuff.c:756
WS_DLL_PUBLIC uint8_t * tvb_get_stringz_enc(wmem_allocator_t *scope, tvbuff_t *tvb, const int offset, int *lengthp, const unsigned encoding)
Definition tvbuff.c:3795
WS_DLL_PUBLIC char * tvb_get_bcd_string(wmem_allocator_t *scope, tvbuff_t *tvb, const int offset, int len, const dgt_set_t *dgt, bool skip_first, bool odd, bool bigendian)
Definition tvbuff.c:4634
WS_DLL_PUBLIC tvbuff_t * tvb_child_uncompress_lznt1(tvbuff_t *parent, tvbuff_t *tvb, const int offset, int comprlen)
Definition tvbuff_lznt1.c:148
WS_DLL_PUBLIC uint8_t * tvb_get_stringzpad(wmem_allocator_t *scope, tvbuff_t *tvb, const int offset, const int length, const unsigned encoding)
Definition tvbuff.c:3564
WS_DLL_PUBLIC unsigned tvb_unicode_strsize(tvbuff_t *tvb, const int offset)
Definition tvbuff.c:2658
WS_DLL_PUBLIC void tvb_free_chain(tvbuff_t *tvb)
Free the tvbuff_t and all tvbuffs chained from it.
Definition tvbuff.c:115
WS_DLL_PUBLIC tvbuff_t * tvb_clone(tvbuff_t *tvb)
Creates a full clone of the given tvbuff.
Definition tvbuff.c:535
WS_DLL_PUBLIC uint8_t * tvb_get_string_enc(wmem_allocator_t *scope, tvbuff_t *tvb, const int offset, const int length, const unsigned encoding)
Definition tvbuff.c:3298
WS_DLL_PUBLIC bool tvb_offset_exists(const tvbuff_t *tvb, const int offset)
Checks (without throwing an exception) whether the offset exists in the buffer.
Definition tvbuff.c:738
WS_DLL_PUBLIC const uint8_t * tvb_get_const_stringz(tvbuff_t *tvb, const int offset, int *lengthp)
Definition tvbuff.c:3663
WS_DLL_PUBLIC char * tvb_bytes_to_str_punct(wmem_allocator_t *scope, tvbuff_t *tvb, const int offset, const int len, const char punct)
Definition tvbuff.c:4612
WS_DLL_PUBLIC tvbuff_t * tvb_child_uncompress_zstd(tvbuff_t *parent, tvbuff_t *tvb, const int offset, int comprlen)
Definition tvbuff_zstd.c:101
WS_DLL_PUBLIC void tvb_set_child_real_data_tvbuff(tvbuff_t *parent, tvbuff_t *child)
Attach a "real" tvbuff to a parent tvbuff.
Definition tvbuff_real.c:96
void(* tvbuff_free_cb_t)(void *)
Definition tvbuff.h:103
WS_DLL_PUBLIC char * tvb_get_ts_23_038_7bits_string_unpacked(wmem_allocator_t *scope, tvbuff_t *tvb, const int offset, int length)
Definition tvbuff.c:3084
WS_DLL_PUBLIC unsigned tvb_captured_length(const tvbuff_t *tvb)
Get the amount of captured data in the buffer.
Definition tvbuff.c:541
WS_DLL_PUBLIC char * tvb_format_text(wmem_allocator_t *scope, tvbuff_t *tvb, const int offset, const int size)
Definition tvbuff.c:2788
WS_DLL_PUBLIC unsigned tvb_ensure_reported_length_remaining(const tvbuff_t *tvb, const int offset)
Same as tvb_reported_length_remaining but throws an exception if the offset is out of bounds.
Definition tvbuff.c:782
WS_DLL_PUBLIC void tvb_composite_append(tvbuff_t *tvb, tvbuff_t *member)
Append to the list of tvbuffs that make up this composite tvbuff.
Definition tvbuff_composite.c:216
WS_DLL_PUBLIC tvbuff_t * tvb_new_composite(void)
Create an empty composite tvbuff.
Definition tvbuff_composite.c:201
WS_DLL_PUBLIC void tvb_ensure_bytes_exist(const tvbuff_t *tvb, const int offset, const int length)
Checks that the bytes referred to by 'offset' and 'length' actually exist in the buffer.
Definition tvbuff.c:653
WS_DLL_PUBLIC int tvb_strncaseeql(tvbuff_t *tvb, const int offset, const char *str, const size_t size)
Definition tvbuff.c:2734
WS_DLL_PUBLIC char * tvb_get_ts_23_038_7bits_string_packed(wmem_allocator_t *scope, tvbuff_t *tvb, const int bit_offset, int no_of_chars)
Definition tvbuff.c:3070
WS_DLL_PUBLIC int tvb_find_uint8(tvbuff_t *tvb, const int offset, const int maxlength, const uint8_t needle)
Definition tvbuff.c:2464
WS_DLL_PUBLIC tvbuff_t * tvb_child_uncompress_snappy(tvbuff_t *parent, tvbuff_t *tvb, const int offset, int comprlen)
Definition tvbuff_snappy.c:66
tvbuff_t * base64_to_tvb(tvbuff_t *parent, const char *base64)
Definition tvbuff_base64.c:169
WS_DLL_PUBLIC int tvb_reported_length_remaining(const tvbuff_t *tvb, const int offset)
Computes bytes of reported packet data from the given offset to the end of buffer.
Definition tvbuff.c:764
WS_DLL_PUBLIC const uint8_t * tvb_get_ptr(tvbuff_t *tvb, const int offset, const int length)
Definition tvbuff.c:1013
WS_DLL_PUBLIC void tvb_ensure_bytes_exist64(const tvbuff_t *tvb, const int offset, const uint64_t length)
Checks that the bytes referred to by 'offset' and 'length' actually exist in the buffer.
Definition tvbuff.c:636
WS_DLL_PUBLIC const char * tvb_bcd_dig_to_str_be(wmem_allocator_t *scope, tvbuff_t *tvb, const int offset, const int len, const dgt_set_t *dgt, bool skip_first)
Definition tvbuff.c:4726
WS_DLL_PUBLIC int tvb_captured_length_remaining(const tvbuff_t *tvb, const int offset)
Computes bytes to end of buffer from the given offset.
Definition tvbuff.c:563
WS_DLL_PUBLIC tvbuff_t * tvb_child_uncompress_zlib(tvbuff_t *parent, tvbuff_t *tvb, const int offset, int comprlen)
Definition tvbuff_zlib.c:309
WS_DLL_PUBLIC uint32_t tvb_get_ipv4(tvbuff_t *tvb, const int offset)
Definition tvbuff.c:2110
WS_DLL_PUBLIC tvbuff_t * tvb_uncompress_lznt1(tvbuff_t *tvb, const int offset, int comprlen)
Definition tvbuff_lznt1.c:109
WS_DLL_PUBLIC int tvb_find_line_end(tvbuff_t *tvb, const int offset, int len, int *next_offset, const bool desegment)
Definition tvbuff.c:4197
WS_DLL_PUBLIC tvbuff_t * tvb_new_subset_remaining(tvbuff_t *backing, const int backing_offset)
Similar to tvb_new_subset_length_caplen() but with backing_length and reported_length set to -1.
Definition tvbuff_subset.c:240
WS_DLL_PUBLIC void * tvb_memcpy(tvbuff_t *tvb, void *target, const int offset, size_t length)
Definition tvbuff.c:936
WS_DLL_PUBLIC void tvb_composite_finalize(tvbuff_t *tvb)
Mark a composite tvbuff as finalized.
Definition tvbuff_composite.c:262
WS_DLL_PUBLIC int tvb_memeql(tvbuff_t *tvb, const int offset, const uint8_t *str, size_t size)
Definition tvbuff.c:2762
WS_DLL_PUBLIC tvbuff_t * tvb_clone_offset_len(tvbuff_t *tvb, unsigned offset, unsigned len)
Clones a portion of the given tvbuff starting at a specific offset and length.
Definition tvbuff.c:521
tvbuff_t * base64_tvb_to_new_tvb(tvbuff_t *parent, int offset, int length)
Definition tvbuff_base64.c:184
WS_DLL_PUBLIC tvbuff_t * tvb_child_uncompress_lz77(tvbuff_t *parent, tvbuff_t *tvb, const int offset, int comprlen)
Definition tvbuff_lz77.c:136
WS_DLL_PUBLIC tvbuff_t * tvb_new_subset_length_caplen(tvbuff_t *backing, const int backing_offset, const int backing_length, const int reported_length)
Definition tvbuff_subset.c:155
WS_DLL_PUBLIC bool tvb_utf_8_isprint(tvbuff_t *tvb, const int offset, const int length)
Definition tvbuff.c:4146
WS_DLL_PUBLIC char * tvb_bytes_to_str(wmem_allocator_t *allocator, tvbuff_t *tvb, const int offset, const int len)
Definition tvbuff.c:4738
WS_DLL_PUBLIC tvbuff_t * tvb_new_octet_right_aligned(tvbuff_t *tvb, uint32_t bit_offset, int32_t no_of_bits)
Extracts a specified number of bits starting at a given bit offset, with bits counted from least sign...
Definition tvbuff.c:437
WS_DLL_PUBLIC void tvb_set_free_cb(tvbuff_t *tvb, const tvbuff_free_cb_t func)
Set a callback function to be called when a tvbuff is actually freed.
Definition tvbuff_real.c:86
char * tvb_format_stringzpad_wsp(wmem_allocator_t *allocator, tvbuff_t *tvb, const int offset, const int size)
Definition tvbuff.c:2838
int tvb_get_ipv6_addr_with_prefix_len(tvbuff_t *tvb, int offset, ws_in6_addr *addr, uint32_t prefix_len)
Definition tvbuff.c:2156
WS_DLL_PUBLIC unsigned tvb_strsize(tvbuff_t *tvb, const int offset)
Definition tvbuff.c:2628
WS_DLL_PUBLIC void tvb_set_reported_length(tvbuff_t *tvb, const unsigned reported_length)
Set a tvbuff's reported_length to a given value.
Definition tvbuff.c:805
WS_DLL_PUBLIC tvbuff_t * tvb_uncompress_brotli(tvbuff_t *tvb, const int offset, int comprlen)
WS_DLL_PUBLIC tvbuff_t * tvb_child_uncompress_lz77huff(tvbuff_t *parent, tvbuff_t *tvb, const int offset, int comprlen)
Definition tvbuff_lz77huff.c:406
WS_DLL_PUBLIC int tvb_ws_mempbrk_pattern_uint8(tvbuff_t *tvb, const int offset, const int maxlength, const ws_mempbrk_pattern *pattern, unsigned char *found_needle)
Definition tvbuff.c:2584
WS_DLL_PUBLIC void * tvb_memdup(wmem_allocator_t *scope, tvbuff_t *tvb, const int offset, size_t length)
Definition tvbuff.c:994
WS_DLL_PUBLIC int tvb_skip_wsp(tvbuff_t *tvb, const int offset, const int maxlength)
Definition tvbuff.c:4469
WS_DLL_PUBLIC tvbuff_t * tvb_new_real_data(const uint8_t *data, const unsigned length, const int reported_length)
Create a tvbuff backed by existing data.
Definition tvbuff_real.c:58
char * tvb_format_stringzpad(wmem_allocator_t *scope, tvbuff_t *tvb, const int offset, const int size)
Definition tvbuff.c:2819
WS_DLL_PUBLIC unsigned tvb_get_varint(tvbuff_t *tvb, unsigned offset, unsigned maxlen, uint64_t *value, const unsigned encoding)
Definition tvbuff.c:4797
WS_DLL_PUBLIC tvbuff_t * tvb_uncompress_snappy(tvbuff_t *tvb, const int offset, int comprlen)
void tvb_composite_prepend(tvbuff_t *tvb, tvbuff_t *member)
Prepend to the list of tvbuffs that make up this composite tvbuff.
Definition tvbuff_composite.c:239
WS_DLL_PUBLIC uint32_t tvb_get_bits(tvbuff_t *tvb, const unsigned bit_offset, const int no_of_bits, const unsigned encoding)
Definition tvbuff.c:2434
WS_DLL_PUBLIC tvbuff_t * tvb_uncompress_zstd(tvbuff_t *tvb, const int offset, int comprlen)
Definition tvbuff_zstd.c:28
WS_DLL_PUBLIC tvbuff_t * tvb_uncompress_lz77(tvbuff_t *tvb, const int offset, int comprlen)
Definition tvbuff_lz77.c:97
WS_DLL_PUBLIC tvbuff_t * tvb_uncompress_zlib(tvbuff_t *tvb, const int offset, int comprlen)
WS_DLL_PUBLIC int tvb_find_line_end_unquoted(tvbuff_t *tvb, const int offset, int len, int *next_offset)
Definition tvbuff.c:4320
uint32_t ws_in4_addr
Definition inet_addr.h:22
Definition guid-utils.h:23
Definition wmem_allocator.h:27
Definition wmem_strbuf.h:39
Definition mcast_stream.h:30
Definition tvbuff.h:1245
Definition inet_addr.h:27
Definition nstime.h:26
Definition tvbuff-int.h:35
unsigned length
Definition tvbuff-int.h:61
unsigned reported_length
Definition tvbuff-int.h:67
Definition ws_mempbrk.h:21