Wireshark 4.7.0
The Wireshark network protocol analyzer
Loading...
Searching...
No Matches
tvbuff.h
Go to the documentation of this file.
1
20#pragma once
21#include <ws_symbol_export.h>
22#include <ws_attributes.h>
23
24#include <epan/guid-utils.h>
25
26#include <wsutil/inet_addr.h>
27#include <wsutil/nstime.h>
28#include "wsutil/ws_mempbrk.h"
29
30#ifdef __cplusplus
31extern "C" {
32#endif /* __cplusplus */
33
45struct tvbuff;
46typedef struct tvbuff tvbuff_t;
47
101typedef void (*tvbuff_free_cb_t)(void*);
102
117WS_DLL_PUBLIC tvbuff_t *tvb_new_octet_aligned(tvbuff_t *tvb,
118 uint32_t bit_offset, uint32_t no_of_bits);
119
132 uint32_t bit_offset, uint32_t no_of_bits);
133
147WS_DLL_PUBLIC tvbuff_t *tvb_new_chain(tvbuff_t *parent, tvbuff_t *backing);
148
155WS_DLL_PUBLIC tvbuff_t *tvb_clone(tvbuff_t *tvb);
156
171WS_DLL_PUBLIC tvbuff_t *tvb_clone_offset_len(tvbuff_t *tvb, unsigned offset,
172 unsigned len);
173
182WS_DLL_PUBLIC void tvb_free(tvbuff_t *tvb);
183
192WS_DLL_PUBLIC void tvb_free_chain(tvbuff_t *tvb);
193
203WS_DLL_PUBLIC void tvb_set_free_cb(tvbuff_t *tvb, const tvbuff_free_cb_t func);
204
222WS_DLL_PUBLIC void tvb_set_child_real_data_tvbuff(tvbuff_t *parent,
223 tvbuff_t *child);
224
238WS_DLL_PUBLIC tvbuff_t *tvb_new_child_real_data(tvbuff_t *parent,
239 const uint8_t *data, const unsigned length, const unsigned reported_length);
240
254WS_DLL_PUBLIC tvbuff_t *tvb_new_real_data(const uint8_t *data,
255 const unsigned length, const unsigned reported_length);
256
288WS_DLL_PUBLIC tvbuff_t *tvb_new_subset_length_caplen(tvbuff_t *backing,
289 const unsigned backing_offset, const unsigned backing_length,
290 const unsigned reported_length);
291
306WS_DLL_PUBLIC tvbuff_t *tvb_new_subset_length(tvbuff_t *backing,
307 const unsigned backing_offset, const unsigned reported_length);
308
320WS_DLL_PUBLIC tvbuff_t *tvb_new_subset_remaining(tvbuff_t *backing,
321 const unsigned backing_offset);
322
332WS_DLL_PUBLIC void tvb_composite_append(tvbuff_t *tvb, tvbuff_t *member);
333
343WS_DLL_PUBLIC void tvb_composite_prepend(tvbuff_t *tvb, tvbuff_t *member);
344
350WS_DLL_PUBLIC tvbuff_t *tvb_new_composite(void);
351
352
361WS_DLL_PUBLIC void tvb_composite_finalize(tvbuff_t *tvb);
362
363
374WS_DLL_PUBLIC unsigned tvb_captured_length(const tvbuff_t *tvb);
375
388WS_DLL_PUBLIC unsigned tvb_captured_length_remaining(const tvbuff_t *tvb, const unsigned offset);
389
406WS_DLL_PUBLIC unsigned tvb_ensure_captured_length_remaining(const tvbuff_t *tvb,
407 const unsigned offset);
408
423WS_DLL_PUBLIC bool tvb_bytes_exist(const tvbuff_t *tvb, const unsigned offset,
424 const int length);
425
438/* coverity[ +taint_sanitize : arg-1 ] */
439/* coverity[ +taint_sanitize : arg-2 ] */
440WS_DLL_PUBLIC void tvb_ensure_bytes_exist64(const tvbuff_t *tvb,
441 const unsigned offset, const uint64_t length);
442
454/* coverity[ +taint_sanitize : arg-1 ] */
455/* coverity[ +taint_sanitize : arg-2 ] */
456WS_DLL_PUBLIC void tvb_ensure_bytes_exist(const tvbuff_t *tvb,
457 const unsigned offset, const int length);
458
467WS_DLL_PUBLIC bool tvb_offset_exists(const tvbuff_t *tvb,
468 const unsigned offset);
469
477WS_DLL_PUBLIC unsigned tvb_reported_length(const tvbuff_t *tvb);
478
491WS_DLL_PUBLIC unsigned tvb_reported_length_remaining(const tvbuff_t *tvb,
492 const unsigned offset);
493
508WS_DLL_PUBLIC unsigned tvb_ensure_reported_length_remaining(const tvbuff_t *tvb,
509 const unsigned offset);
510
523WS_DLL_PUBLIC void tvb_set_reported_length(tvbuff_t *tvb, const unsigned reported_length);
524
525
535WS_DLL_PUBLIC void tvb_fix_reported_length(tvbuff_t *tvb);
536
554WS_DLL_PUBLIC unsigned tvb_offset_from_real_beginning(const tvbuff_t *tvb);
555
572WS_DLL_PUBLIC unsigned tvb_raw_offset(tvbuff_t *tvb);
573
583WS_DLL_PUBLIC void tvb_set_fragment(tvbuff_t *tvb);
584
596WS_DLL_PUBLIC struct tvbuff *tvb_get_ds_tvb(tvbuff_t *tvb);
597
598
599/************** START OF ACCESSORS ****************/
600/* All accessors will throw an exception if appropriate */
601
613WS_DLL_PUBLIC uint8_t tvb_get_uint8(tvbuff_t *tvb, const unsigned offset);
614
628WS_DEPRECATED_X("Use tvb_get_uint8 instead")
629static inline uint8_t tvb_get_guint8(tvbuff_t *tvb, const unsigned offset) {
630 return tvb_get_uint8(tvb, offset);
631}
632
644WS_DLL_PUBLIC int8_t tvb_get_int8(tvbuff_t *tvb, const unsigned offset);
645
659WS_DEPRECATED_X("Use tvb_get_int8 instead")
660static inline int8_t tvb_get_gint8(tvbuff_t *tvb, const unsigned offset) { return tvb_get_int8(tvb, offset); }
661
678WS_DLL_PUBLIC uint16_t tvb_get_ntohs(tvbuff_t *tvb, const unsigned offset);
679
696WS_DLL_PUBLIC int16_t tvb_get_ntohis(tvbuff_t *tvb, const unsigned offset);
697
714WS_DLL_PUBLIC uint32_t tvb_get_ntoh24(tvbuff_t *tvb, const unsigned offset);
715
732WS_DLL_PUBLIC int32_t tvb_get_ntohi24(tvbuff_t *tvb, const unsigned offset);
733
750WS_DLL_PUBLIC uint32_t tvb_get_ntohl(tvbuff_t *tvb, const unsigned offset);
751
768WS_DLL_PUBLIC int32_t tvb_get_ntohil(tvbuff_t *tvb, const unsigned offset);
769
786WS_DLL_PUBLIC uint64_t tvb_get_ntoh40(tvbuff_t *tvb, const unsigned offset);
787
804WS_DLL_PUBLIC int64_t tvb_get_ntohi40(tvbuff_t *tvb, const unsigned offset);
805
822WS_DLL_PUBLIC uint64_t tvb_get_ntoh48(tvbuff_t *tvb, const unsigned offset);
823
840WS_DLL_PUBLIC int64_t tvb_get_ntohi48(tvbuff_t *tvb, const unsigned offset);
841
858WS_DLL_PUBLIC uint64_t tvb_get_ntoh56(tvbuff_t *tvb, const unsigned offset);
859
876WS_DLL_PUBLIC int64_t tvb_get_ntohi56(tvbuff_t *tvb, const unsigned offset);
877
894WS_DLL_PUBLIC uint64_t tvb_get_ntoh64(tvbuff_t *tvb, const unsigned offset);
895
912WS_DLL_PUBLIC int64_t tvb_get_ntohi64(tvbuff_t *tvb, const unsigned offset);
913
930WS_DLL_PUBLIC float tvb_get_ntohieee_float(tvbuff_t *tvb, const unsigned offset);
931
948WS_DLL_PUBLIC double tvb_get_ntohieee_double(tvbuff_t *tvb,
949 const unsigned offset);
950
967WS_DLL_PUBLIC uint16_t tvb_get_letohs(tvbuff_t *tvb, const unsigned offset);
968
985WS_DLL_PUBLIC int16_t tvb_get_letohis(tvbuff_t *tvb, const unsigned offset);
986
1003WS_DLL_PUBLIC uint32_t tvb_get_letoh24(tvbuff_t *tvb, const unsigned offset);
1004
1021WS_DLL_PUBLIC int32_t tvb_get_letohi24(tvbuff_t *tvb, const unsigned offset);
1022
1039WS_DLL_PUBLIC uint32_t tvb_get_letohl(tvbuff_t *tvb, const unsigned offset);
1040
1057WS_DLL_PUBLIC int32_t tvb_get_letohil(tvbuff_t *tvb, const unsigned offset);
1058
1075WS_DLL_PUBLIC uint64_t tvb_get_letoh40(tvbuff_t *tvb, const unsigned offset);
1076
1093WS_DLL_PUBLIC int64_t tvb_get_letohi40(tvbuff_t *tvb, const unsigned offset);
1094
1111WS_DLL_PUBLIC uint64_t tvb_get_letoh48(tvbuff_t *tvb, const unsigned offset);
1112
1129WS_DLL_PUBLIC int64_t tvb_get_letohi48(tvbuff_t *tvb, const unsigned offset);
1130
1147WS_DLL_PUBLIC uint64_t tvb_get_letoh56(tvbuff_t *tvb, const unsigned offset);
1148
1165WS_DLL_PUBLIC int64_t tvb_get_letohi56(tvbuff_t *tvb, const unsigned offset);
1166
1183WS_DLL_PUBLIC uint64_t tvb_get_letoh64(tvbuff_t *tvb, const unsigned offset);
1184
1201WS_DLL_PUBLIC int64_t tvb_get_letohi64(tvbuff_t *tvb, const unsigned offset);
1202
1219WS_DLL_PUBLIC float tvb_get_letohieee_float(tvbuff_t *tvb, const unsigned offset);
1220
1237WS_DLL_PUBLIC double tvb_get_letohieee_double(tvbuff_t *tvb,
1238 const unsigned offset);
1239
1255WS_DLL_PUBLIC uint16_t tvb_get_uint16(tvbuff_t *tvb, const unsigned offset, const unsigned encoding);
1256
1271WS_DEPRECATED_X("Use tvb_get_uint16 instead")
1272static inline uint16_t tvb_get_guint16(tvbuff_t *tvb, const unsigned offset, const unsigned encoding) {
1273 return tvb_get_uint16(tvb, offset, encoding);
1274}
1275
1291WS_DLL_PUBLIC int16_t tvb_get_int16(tvbuff_t *tvb, const unsigned offset, const unsigned encoding);
1292
1307WS_DEPRECATED_X("Use tvb_get_int16 instead")
1308static inline int16_t tvb_get_gint16(tvbuff_t *tvb, const unsigned offset, const unsigned encoding) { return tvb_get_int16(tvb, offset, encoding); }
1309
1325WS_DLL_PUBLIC uint32_t tvb_get_uint24(tvbuff_t *tvb, const unsigned offset, const unsigned encoding);
1326
1341WS_DEPRECATED_X("Use tvb_get_uint24 instead")
1342static inline uint32_t tvb_get_guint24(tvbuff_t *tvb, const unsigned offset, const unsigned encoding) { return tvb_get_uint24(tvb, offset, encoding); }
1343
1359WS_DLL_PUBLIC int32_t tvb_get_int24(tvbuff_t *tvb, const unsigned offset, const unsigned encoding);
1360
1375WS_DEPRECATED_X("Use tvb_get_int24 instead")
1376static inline int32_t tvb_get_gint24(tvbuff_t *tvb, const unsigned offset, const unsigned encoding) { return tvb_get_int24(tvb, offset, encoding); }
1377
1393WS_DLL_PUBLIC uint32_t tvb_get_uint32(tvbuff_t *tvb, const unsigned offset, const unsigned encoding);
1394
1409WS_DEPRECATED_X("Use tvb_get_uint32 instead")
1410static inline uint32_t tvb_get_guint32(tvbuff_t *tvb, const unsigned offset, const unsigned encoding) { return tvb_get_uint32(tvb, offset, encoding); }
1411
1427WS_DLL_PUBLIC int32_t tvb_get_int32(tvbuff_t *tvb, const unsigned offset, const unsigned encoding);
1428
1443WS_DEPRECATED_X("Use tvb_get_int32 instead")
1444static inline int32_t tvb_get_gint32(tvbuff_t *tvb, const unsigned offset, const unsigned encoding) { return tvb_get_int32(tvb, offset, encoding); }
1445
1461WS_DLL_PUBLIC uint64_t tvb_get_uint40(tvbuff_t *tvb, const unsigned offset, const unsigned encoding);
1462
1477WS_DEPRECATED_X("Use tvb_get_uint40 instead")
1478static inline uint64_t tvb_get_guint40(tvbuff_t *tvb, const unsigned offset, const unsigned encoding) { return tvb_get_uint40(tvb, offset, encoding); }
1479
1495WS_DLL_PUBLIC int64_t tvb_get_int40(tvbuff_t *tvb, const unsigned offset, const unsigned encoding);
1496
1511WS_DEPRECATED_X("Use tvb_get_int40 instead")
1512static inline int64_t tvb_get_gint40(tvbuff_t *tvb, const unsigned offset, const unsigned encoding) { return tvb_get_int40(tvb, offset, encoding); }
1513
1529WS_DLL_PUBLIC uint64_t tvb_get_uint48(tvbuff_t *tvb, const unsigned offset, const unsigned encoding);
1530
1545WS_DEPRECATED_X("Use tvb_get_uint48 instead")
1546static inline uint64_t tvb_get_guint48(tvbuff_t *tvb, const unsigned offset, const unsigned encoding) { return tvb_get_uint48(tvb, offset, encoding); }
1547
1563WS_DLL_PUBLIC int64_t tvb_get_int48(tvbuff_t *tvb, const unsigned offset, const unsigned encoding);
1564
1579WS_DEPRECATED_X("Use tvb_get_int48 instead")
1580static inline int64_t tvb_get_gint48(tvbuff_t *tvb, const unsigned offset, const unsigned encoding) { return tvb_get_int48(tvb, offset, encoding); }
1581
1597WS_DLL_PUBLIC uint64_t tvb_get_uint56(tvbuff_t *tvb, const unsigned offset, const unsigned encoding);
1598
1613WS_DEPRECATED_X("Use tvb_get_uint56 instead")
1614static inline uint64_t tvb_get_guint56(tvbuff_t *tvb, const unsigned offset, const unsigned encoding) { return tvb_get_uint56(tvb, offset, encoding); }
1615
1631WS_DLL_PUBLIC int64_t tvb_get_int56(tvbuff_t *tvb, const unsigned offset, const unsigned encoding);
1632
1647WS_DEPRECATED_X("Use tvb_get_int56 instead")
1648static inline int64_t tvb_get_gint56(tvbuff_t *tvb, const unsigned offset, const unsigned encoding) { return tvb_get_int56(tvb, offset, encoding); }
1649
1667WS_DLL_PUBLIC uint64_t tvb_get_uint64(tvbuff_t *tvb, const unsigned offset, const unsigned encoding);
1668
1687WS_DLL_PUBLIC uint64_t tvb_get_uint64_with_length(tvbuff_t *tvb, const unsigned offset, unsigned length, const unsigned encoding);
1688
1703WS_DEPRECATED_X("Use tvb_get_uint64 instead")
1704static inline uint64_t tvb_get_guint64(tvbuff_t *tvb, const unsigned offset, const unsigned encoding) {return tvb_get_uint64(tvb, offset, encoding); }
1705
1721WS_DLL_PUBLIC int64_t tvb_get_int64(tvbuff_t *tvb, const unsigned offset, const unsigned encoding);
1722
1737WS_DEPRECATED_X("Use tvb_get_int64 instead")
1738static inline int64_t tvb_get_gint64(tvbuff_t *tvb, const unsigned offset, const unsigned encoding) { return tvb_get_int64(tvb, offset, encoding); }
1739
1757WS_DLL_PUBLIC float tvb_get_ieee_float(tvbuff_t *tvb, const unsigned offset, const unsigned encoding);
1758
1776WS_DLL_PUBLIC double tvb_get_ieee_double(tvbuff_t *tvb, const unsigned offset, const unsigned encoding);
1777
1795#if G_BYTE_ORDER == G_LITTLE_ENDIAN
1796#define tvb_get_h_uint16 tvb_get_letohs
1797#define tvb_get_h_uint32 tvb_get_letohl
1798#elif G_BYTE_ORDER == G_BIG_ENDIAN
1799#define tvb_get_h_uint16 tvb_get_ntohs
1800#define tvb_get_h_uint32 tvb_get_ntohl
1801#else
1802#error "Unsupported byte order"
1803#endif
1804
1833WS_DLL_PUBLIC
1834nstime_t* tvb_get_string_time(tvbuff_t *tvb, const unsigned offset, const unsigned length,
1835 const unsigned encoding, nstime_t* ns, unsigned *endoff);
1836
1858WS_DLL_PUBLIC
1859GByteArray* tvb_get_string_bytes(tvbuff_t *tvb, const unsigned offset, const unsigned length,
1860 const unsigned encoding, GByteArray* bytes, unsigned *endoff);
1861
1885WS_DLL_PUBLIC
1886bool tvb_get_string_uint64(tvbuff_t *tvb, const unsigned offset, const unsigned length,
1887 const unsigned encoding, uint64_t* value, unsigned *endoff);
1888
1912WS_DLL_PUBLIC
1913bool tvb_get_string_uint(tvbuff_t *tvb, const unsigned offset, const unsigned length,
1914 const unsigned encoding, uint32_t* value, unsigned *endoff);
1915
1939WS_DLL_PUBLIC
1940bool tvb_get_string_uint16(tvbuff_t *tvb, const unsigned offset, const unsigned length,
1941 const unsigned encoding, uint16_t* value, unsigned *endoff);
1942
1966WS_DLL_PUBLIC
1967bool tvb_get_string_uint8(tvbuff_t *tvb, const unsigned offset, const unsigned length,
1968 const unsigned encoding, uint8_t* value, unsigned *endoff);
1969
1993WS_DLL_PUBLIC
1994bool tvb_get_string_int64(tvbuff_t *tvb, const unsigned offset, const unsigned length,
1995 const unsigned encoding, int64_t* value, unsigned *endoff);
1996
2020WS_DLL_PUBLIC
2021bool tvb_get_string_int(tvbuff_t *tvb, const unsigned offset, const unsigned length,
2022 const unsigned encoding, int32_t* value, unsigned *endoff);
2023
2047WS_DLL_PUBLIC
2048bool tvb_get_string_int16(tvbuff_t *tvb, const unsigned offset, const unsigned length,
2049 const unsigned encoding, int16_t* value, unsigned *endoff);
2050
2074WS_DLL_PUBLIC
2075bool tvb_get_string_int8(tvbuff_t *tvb, const unsigned offset, const unsigned length,
2076 const unsigned encoding, int8_t* value, unsigned *endoff);
2077
2095WS_DLL_PUBLIC uint32_t tvb_get_ipv4(tvbuff_t *tvb, const unsigned offset);
2096
2113WS_DLL_PUBLIC void tvb_get_ipv6(tvbuff_t *tvb, const unsigned offset, ws_in6_addr *addr);
2114
2127WS_DLL_PUBLIC int tvb_get_ipv4_addr_with_prefix_len(tvbuff_t *tvb, const unsigned offset,
2128 ws_in4_addr *addr, uint32_t prefix_len);
2129
2143WS_DLL_PUBLIC int tvb_get_ipv6_addr_with_prefix_len(tvbuff_t *tvb, const unsigned offset,
2144 ws_in6_addr *addr, uint32_t prefix_len);
2145
2157WS_DLL_PUBLIC void tvb_get_ntohguid(tvbuff_t *tvb, const unsigned offset, e_guid_t *guid);
2158
2170WS_DLL_PUBLIC void tvb_get_letohguid(tvbuff_t *tvb, const unsigned offset, e_guid_t *guid);
2171
2185WS_DLL_PUBLIC void tvb_get_guid(tvbuff_t *tvb, const unsigned offset, e_guid_t *guid, const unsigned encoding);
2186
2206WS_DLL_PUBLIC uint8_t* tvb_get_bits_array(wmem_allocator_t *scope, tvbuff_t *tvb,
2207 const unsigned offset, size_t length, size_t *data_length, const unsigned encoding);
2208
2228WS_DLL_PUBLIC uint8_t tvb_get_bits8(tvbuff_t *tvb, unsigned bit_offset,
2229 const unsigned no_of_bits);
2230
2252WS_DLL_PUBLIC uint16_t tvb_get_bits16(tvbuff_t *tvb, unsigned bit_offset,
2253 const unsigned no_of_bits, const unsigned encoding);
2254
2276WS_DLL_PUBLIC uint32_t tvb_get_bits32(tvbuff_t *tvb, unsigned bit_offset,
2277 const unsigned no_of_bits, const unsigned encoding);
2278
2300WS_DLL_PUBLIC uint64_t tvb_get_bits64(tvbuff_t *tvb, unsigned bit_offset,
2301 const unsigned no_of_bits, const unsigned encoding);
2302
2320WS_DLL_PUBLIC
2321WS_DEPRECATED_X("Use tvb_get_bits32() instead")
2322uint32_t tvb_get_bits(tvbuff_t *tvb, const unsigned bit_offset,
2323 const unsigned no_of_bits, const unsigned encoding);
2324
2353WS_DLL_PUBLIC void *tvb_memcpy(tvbuff_t *tvb, void *target, const unsigned offset,
2354 size_t length);
2355
2376WS_DLL_PUBLIC void *tvb_memdup(wmem_allocator_t *scope, tvbuff_t *tvb,
2377 const unsigned offset, size_t length);
2378
2414WS_DLL_PUBLIC const uint8_t *tvb_get_ptr(tvbuff_t *tvb, const unsigned offset,
2415 const unsigned length);
2416
2437WS_DLL_PUBLIC bool tvb_find_uint8_remaining(tvbuff_t *tvb, const unsigned offset,
2438 const uint8_t needle, unsigned *found_offset);
2439
2462WS_DLL_PUBLIC bool tvb_find_uint8_length(tvbuff_t *tvb, const unsigned offset,
2463 const unsigned maxlength, const uint8_t needle, unsigned *found_offset);
2464
2490WS_DLL_PUBLIC bool tvb_find_uint16_remaining(tvbuff_t *tvb, const unsigned offset,
2491 const uint16_t needle, unsigned *found_offset);
2492
2520WS_DLL_PUBLIC bool tvb_find_uint16_length(tvbuff_t *tvb, const unsigned offset,
2521 const unsigned maxlength, const uint16_t needle, unsigned *found_offset);
2522
2545WS_DLL_PUBLIC bool tvb_ws_mempbrk_uint8_remaining(tvbuff_t *tvb, const unsigned offset,
2546 const ws_mempbrk_pattern* pattern, unsigned *found_offset, unsigned char *found_needle);
2547
2573WS_DLL_PUBLIC bool tvb_ws_mempbrk_uint8_length(tvbuff_t *tvb, const unsigned offset,
2574 const unsigned maxlength, const ws_mempbrk_pattern* pattern,
2575 unsigned *found_offset, unsigned char *found_needle);
2576
2594WS_DLL_PUBLIC unsigned tvb_strsize(tvbuff_t *tvb, const unsigned offset);
2595
2612WS_DLL_PUBLIC unsigned tvb_unicode_strsize(tvbuff_t *tvb, const unsigned offset);
2613
2637WS_DLL_PUBLIC unsigned tvb_strsize_enc(tvbuff_t *tvb, const unsigned offset, const unsigned encoding);
2638
2656WS_DLL_PUBLIC int tvb_strnlen(tvbuff_t *tvb, const unsigned offset,
2657 const unsigned maxlength);
2658
2675WS_DLL_PUBLIC char *tvb_format_text(wmem_allocator_t *scope, tvbuff_t *tvb, const unsigned offset,
2676 const unsigned size);
2677
2695WS_DLL_PUBLIC char *tvb_format_text_wsp(wmem_allocator_t* allocator, tvbuff_t *tvb, const unsigned offset,
2696 const unsigned size);
2697
2715WS_DLL_PUBLIC char *tvb_format_stringzpad(wmem_allocator_t *scope, tvbuff_t *tvb, const unsigned offset,
2716 const unsigned size);
2717
2736WS_DLL_PUBLIC char *tvb_format_stringzpad_wsp(wmem_allocator_t* allocator, tvbuff_t *tvb, const unsigned offset,
2737 const unsigned size);
2738
2760WS_DLL_PUBLIC uint8_t *tvb_get_string_enc(wmem_allocator_t *scope,
2761 tvbuff_t *tvb, const unsigned offset, const unsigned length, const unsigned encoding);
2762
2787 tvbuff_t *tvb, const unsigned bit_offset, unsigned no_of_chars);
2788
2813 tvbuff_t *tvb, const unsigned offset, unsigned length);
2814
2839 tvbuff_t *tvb, const unsigned offset, unsigned length);
2840
2864WS_DLL_PUBLIC char *tvb_get_ascii_7bits_string(wmem_allocator_t *scope,
2865 tvbuff_t *tvb, const unsigned bit_offset, unsigned no_of_chars);
2866
2891WS_DLL_PUBLIC uint8_t *tvb_get_stringzpad(wmem_allocator_t *scope,
2892 tvbuff_t *tvb, const unsigned offset, const unsigned length, const unsigned encoding);
2893
2918WS_DLL_PUBLIC uint8_t *tvb_get_stringz_enc(wmem_allocator_t *scope,
2919 tvbuff_t *tvb, const unsigned offset, unsigned *lengthp, const unsigned encoding);
2920
2951WS_DLL_PUBLIC
2952WS_DEPRECATED_X("Use APIs that return a valid UTF-8 string instead")
2953const uint8_t *tvb_get_const_stringz(tvbuff_t *tvb,
2954 const unsigned offset, unsigned *lengthp);
2955
2980WS_DLL_PUBLIC unsigned tvb_get_raw_bytes_as_stringz(tvbuff_t *tvb, const unsigned offset,
2981 const unsigned bufsize, uint8_t *buffer);
2982
3000WS_DLL_PUBLIC unsigned tvb_get_raw_bytes_as_string(tvbuff_t *tvb, const unsigned offset, char *buffer, size_t bufsize);
3001
3015WS_DLL_PUBLIC bool tvb_ascii_isprint(tvbuff_t *tvb, const unsigned offset,
3016 const unsigned length);
3017
3030WS_DLL_PUBLIC bool tvb_ascii_isprint_remaining(tvbuff_t *tvb, const unsigned offset);
3031
3051WS_DLL_PUBLIC bool tvb_utf_8_isprint(tvbuff_t *tvb, const unsigned offset,
3052 const unsigned length);
3053
3071WS_DLL_PUBLIC bool tvb_utf_8_isprint_remaining(tvbuff_t *tvb, const unsigned offset);
3072
3086WS_DLL_PUBLIC bool tvb_ascii_isdigit(tvbuff_t *tvb, const unsigned offset,
3087 const unsigned length);
3088
3126WS_DLL_PUBLIC bool tvb_find_line_end_remaining(tvbuff_t *tvb, const unsigned offset,
3127 unsigned *linelen, unsigned *next_offset);
3128
3158WS_DLL_PUBLIC bool tvb_find_line_end_length(tvbuff_t *tvb, const unsigned offset,
3159 const unsigned maxlength, unsigned *linelen, unsigned *next_offset);
3160
3182WS_DLL_PUBLIC int tvb_find_line_end_unquoted(tvbuff_t *tvb, const unsigned offset,
3183 int len, int *next_offset);
3184
3212WS_DLL_PUBLIC bool tvb_find_line_end_unquoted_remaining(tvbuff_t *tvb, const unsigned offset,
3213 unsigned *linelen, unsigned *next_offset);
3214
3245WS_DLL_PUBLIC bool tvb_find_line_end_unquoted_length(tvbuff_t *tvb, const unsigned offset,
3246 const unsigned maxlength, unsigned *linelen, unsigned *next_offset);
3247
3270WS_DLL_PUBLIC unsigned tvb_skip_wsp(tvbuff_t *tvb, const unsigned offset,
3271 const unsigned maxlength);
3272
3301WS_DLL_PUBLIC unsigned tvb_skip_wsp_return(tvbuff_t *tvb, const unsigned offset);
3302
3320WS_DLL_PUBLIC unsigned tvb_skip_uint8(tvbuff_t *tvb, unsigned offset, const unsigned maxlength, const uint8_t ch);
3321
3343WS_DEPRECATED_X("Use tvb_skip_uint8 instead")
3344static inline unsigned tvb_skip_guint8(tvbuff_t *tvb, unsigned offset, const unsigned maxlength, const uint8_t ch) {
3345 return tvb_skip_uint8(tvb, offset, maxlength, ch);
3346}
3347
3372WS_DLL_PUBLIC int tvb_get_token_len(tvbuff_t *tvb, const unsigned offset, int len, int *next_offset, const bool desegment);
3373
3403WS_DLL_PUBLIC bool tvb_get_token_len_remaining(tvbuff_t *tvb, const unsigned offset, unsigned *tokenlen, unsigned *next_offset);
3404
3432WS_DLL_PUBLIC bool tvb_get_token_len_length(tvbuff_t *tvb, const unsigned offset, unsigned maxlength, unsigned *tokenlen, unsigned *next_offset);
3433
3450WS_DLL_PUBLIC int tvb_strneql(tvbuff_t *tvb, const unsigned offset,
3451 const char *str, const size_t size);
3452
3473WS_DLL_PUBLIC int tvb_strncaseeql(tvbuff_t *tvb, const unsigned offset,
3474 const char *str, const size_t size);
3475
3493WS_DLL_PUBLIC int tvb_memeql(tvbuff_t *tvb, const unsigned offset,
3494 const uint8_t *str, size_t size);
3495
3515WS_DLL_PUBLIC char *tvb_bytes_to_str_punct(wmem_allocator_t *scope, tvbuff_t *tvb, const unsigned offset,
3516 const unsigned len, const char punct);
3517
3538WS_DLL_PUBLIC char *tvb_bytes_to_str(wmem_allocator_t *allocator, tvbuff_t *tvb,
3539 const unsigned offset, const unsigned len);
3540
3555typedef struct dgt_set_t
3556{
3557 const unsigned char out[16];
3558}
3560
3588WS_DLL_PUBLIC const char *tvb_bcd_dig_to_str(wmem_allocator_t *scope,
3589 tvbuff_t *tvb, const unsigned offset, const unsigned len, const dgt_set_t *dgt,
3590 bool skip_first);
3591
3619WS_DLL_PUBLIC const char *tvb_bcd_dig_to_str_be(wmem_allocator_t *scope,
3620 tvbuff_t *tvb, const unsigned offset, const unsigned len, const dgt_set_t *dgt,
3621 bool skip_first);
3622
3654WS_DLL_PUBLIC char *tvb_get_bcd_string(wmem_allocator_t *scope, tvbuff_t *tvb,
3655 const unsigned offset, unsigned len, const dgt_set_t *dgt,
3656 bool skip_first, bool odd, bool bigendian);
3657
3673WS_DLL_PUBLIC int tvb_find_tvb(tvbuff_t *haystack_tvb, tvbuff_t *needle_tvb,
3674 const int haystack_offset);
3675
3691WS_DLL_PUBLIC bool tvb_find_tvb_remaining(tvbuff_t *haystack_tvb, tvbuff_t *needle_tvb,
3692 const unsigned haystack_offset, unsigned *found_offset);
3693
3694/* From tvbuff_zlib.c */
3714WS_DEPRECATED_X("Use tvb_uncompress_zlib instead")
3715WS_DLL_PUBLIC tvbuff_t *tvb_uncompress(tvbuff_t *tvb, const unsigned offset,
3716 unsigned comprlen);
3717
3739WS_DLL_PUBLIC tvbuff_t *tvb_uncompress_zlib(tvbuff_t *tvb, const unsigned offset,
3740 unsigned comprlen);
3741
3764WS_DLL_PUBLIC tvbuff_t *tvb_child_uncompress(tvbuff_t *parent, tvbuff_t *tvb,
3765 const unsigned offset, unsigned comprlen);
3766
3783WS_DLL_PUBLIC tvbuff_t *tvb_child_uncompress_zlib(tvbuff_t *parent, tvbuff_t *tvb,
3784 const unsigned offset, unsigned comprlen);
3785
3786/* From tvbuff_brotli.c */
3787
3809WS_DLL_PUBLIC tvbuff_t *tvb_uncompress_brotli(tvbuff_t *tvb, const unsigned offset,
3810 unsigned comprlen);
3811
3830WS_DLL_PUBLIC tvbuff_t *tvb_child_uncompress_brotli(tvbuff_t *parent, tvbuff_t *tvb,
3831 const unsigned offset, unsigned comprlen);
3832
3833/* From tvbuff_snappy.c */
3834
3852WS_DLL_PUBLIC tvbuff_t *tvb_uncompress_snappy(tvbuff_t *tvb, const unsigned offset,
3853 unsigned comprlen);
3854
3873WS_DLL_PUBLIC tvbuff_t *tvb_child_uncompress_snappy(tvbuff_t *parent, tvbuff_t *tvb,
3874 const unsigned offset, unsigned comprlen);
3875
3876/* From tvbuff_lz77.c */
3877
3899WS_DLL_PUBLIC tvbuff_t *tvb_uncompress_lz77(tvbuff_t *tvb,
3900 const unsigned offset, unsigned comprlen);
3901
3921WS_DLL_PUBLIC tvbuff_t *tvb_child_uncompress_lz77(tvbuff_t *parent,
3922 tvbuff_t *tvb, const unsigned offset, unsigned comprlen);
3923
3924/* From tvbuff_lz77huff.c */
3925
3947WS_DLL_PUBLIC tvbuff_t *tvb_uncompress_lz77huff(tvbuff_t *tvb,
3948 const unsigned offset, unsigned comprlen);
3949
3969WS_DLL_PUBLIC tvbuff_t *tvb_child_uncompress_lz77huff(tvbuff_t *parent,
3970 tvbuff_t *tvb, const unsigned offset, unsigned comprlen);
3971
3972/* From tvbuff_lznt1.c */
3973
3995WS_DLL_PUBLIC tvbuff_t *tvb_uncompress_lznt1(tvbuff_t *tvb,
3996 const unsigned offset, unsigned comprlen);
3997
4017WS_DLL_PUBLIC tvbuff_t *tvb_child_uncompress_lznt1(tvbuff_t *parent,
4018 tvbuff_t *tvb, const unsigned offset, unsigned comprlen);
4019
4041WS_DLL_PUBLIC tvbuff_t *tvb_uncompress_zstd(tvbuff_t *tvb,
4042 const unsigned offset, unsigned comprlen);
4043
4063WS_DLL_PUBLIC tvbuff_t *tvb_child_uncompress_zstd(tvbuff_t *parent,
4064 tvbuff_t *tvb, const unsigned offset, unsigned comprlen);
4065
4066/* From tvbuff_base64.c */
4067
4082WS_DLL_PUBLIC tvbuff_t* base64_to_tvb(tvbuff_t *parent, const char *base64);
4083
4102WS_DLL_PUBLIC tvbuff_t* base64_tvb_to_new_tvb(tvbuff_t* parent, unsigned offset, unsigned length);
4103
4123WS_DLL_PUBLIC tvbuff_t* base64uri_tvb_to_new_tvb(tvbuff_t* parent, unsigned offset, unsigned length);
4124
4125/* From tvbuff_hpackhuff.c */
4126
4144 tvbuff_t *tvb, const unsigned offset, const unsigned len);
4145
4165 unsigned offset, unsigned length);
4166
4189WS_DLL_PUBLIC unsigned tvb_get_varint(tvbuff_t *tvb, unsigned offset, unsigned maxlen, uint64_t *value, const unsigned encoding);
4190
4191/************** END OF ACCESSORS ****************/
4192
4193#ifdef __cplusplus
4194}
4195#endif /* __cplusplus */
4196
4197/*
4198 * Editor modelines - https://www.wireshark.org/tools/modelines.html
4199 *
4200 * Local variables:
4201 * c-basic-offset: 4
4202 * tab-width: 8
4203 * indent-tabs-mode: nil
4204 * End:
4205 *
4206 * vi: set shiftwidth=4 tabstop=8 expandtab:
4207 * :indentSize=4:tabSize=8:noTabs=true:
4208 */
WS_DLL_PUBLIC unsigned tvb_ensure_reported_length_remaining(const tvbuff_t *tvb, const unsigned offset)
Same as tvb_reported_length_remaining but throws an exception if the offset is out of bounds.
Definition tvbuff.c:829
WS_DLL_PUBLIC int64_t tvb_get_int64(tvbuff_t *tvb, const unsigned offset, const unsigned encoding)
Retrieve a 64-bit signed value from a tvbuff using the specified encoding.
Definition tvbuff.c:1453
WS_DLL_PUBLIC int64_t tvb_get_int48(tvbuff_t *tvb, const unsigned offset, const unsigned encoding)
Retrieve a 48-bit signed value from a tvbuff using the specified encoding.
Definition tvbuff.c:1359
WS_DLL_PUBLIC int tvb_find_tvb(tvbuff_t *haystack_tvb, tvbuff_t *needle_tvb, const int haystack_offset)
Search for a sub-tvbuff within another tvbuff starting at a given offset.
Definition tvbuff.c:5464
WS_DLL_PUBLIC unsigned tvb_skip_wsp(tvbuff_t *tvb, const unsigned offset, const unsigned maxlength)
Skip ASCII whitespace in a tvbuff and return the offset of the first non-whitespace byte.
Definition tvbuff.c:5125
WS_DLL_PUBLIC uint16_t tvb_get_uint16(tvbuff_t *tvb, const unsigned offset, const unsigned encoding)
Retrieve a 16-bit unsigned value from a tvbuff using the specified encoding.
Definition tvbuff.c:1278
WS_DLL_PUBLIC float tvb_get_ntohieee_float(tvbuff_t *tvb, const unsigned offset)
Retrieve a 32-bit IEEE float in network byte order.
Definition tvbuff.c:1634
WS_DLL_PUBLIC tvbuff_t * tvb_child_uncompress_lz77(tvbuff_t *parent, tvbuff_t *tvb, const unsigned offset, unsigned comprlen)
Uncompress Microsoft Plain LZ77-compressed data from a tvbuff and attach the result to a parent tvbuf...
Definition tvbuff_lz77.c:160
WS_DLL_PUBLIC void tvb_fix_reported_length(tvbuff_t *tvb)
Repair a tvbuff when captured length exceeds reported length.
Definition tvbuff.c:870
WS_DLL_PUBLIC tvbuff_t * tvb_new_child_real_data(tvbuff_t *parent, const uint8_t *data, const unsigned length, const unsigned reported_length)
Create a new child tvbuff with real data.
Definition tvbuff_real.c:104
WS_DLL_PUBLIC bool tvb_offset_exists(const tvbuff_t *tvb, const unsigned offset)
Checks (without throwing an exception) whether the offset exists in the buffer.
Definition tvbuff.c:793
WS_DLL_PUBLIC unsigned tvb_get_raw_bytes_as_stringz(tvbuff_t *tvb, const unsigned offset, const unsigned bufsize, uint8_t *buffer)
Copy up to a specified number of bytes from a tvbuff into a buffer as a NUL-terminated string.
Definition tvbuff.c:4637
WS_DLL_PUBLIC uint64_t tvb_get_letoh40(tvbuff_t *tvb, const unsigned offset)
Retrieve a 40-bit unsigned value in little-endian byte order.
Definition tvbuff.c:1738
WS_DLL_PUBLIC uint16_t tvb_get_letohs(tvbuff_t *tvb, const unsigned offset)
Retrieve a 16-bit unsigned value in little-endian byte order.
Definition tvbuff.c:1683
WS_DLL_PUBLIC tvbuff_t * tvb_uncompress_brotli(tvbuff_t *tvb, const unsigned offset, unsigned comprlen)
Uncompress Brotli-compressed data from a tvbuff.
WS_DLL_PUBLIC char * tvb_get_ascii_7bits_string(wmem_allocator_t *scope, tvbuff_t *tvb, const unsigned bit_offset, unsigned no_of_chars)
Extract and convert an ASCII 7-bit encoded string from a tvbuff to UTF-8.
Definition tvbuff.c:3693
WS_DLL_PUBLIC double tvb_get_ntohieee_double(tvbuff_t *tvb, const unsigned offset)
Retrieve a 64-bit IEEE double in network byte order.
Definition tvbuff.c:1654
WS_DLL_PUBLIC int tvb_get_token_len(tvbuff_t *tvb, const unsigned offset, int len, int *next_offset, const bool desegment)
Determine the length of a token in a tvbuff, optionally desegmenting.
Definition tvbuff.c:5273
WS_DLL_PUBLIC int16_t tvb_get_letohis(tvbuff_t *tvb, const unsigned offset)
Retrieve a 16-bit signed value in little-endian byte order.
Definition tvbuff.c:1692
WS_DLL_PUBLIC unsigned tvb_get_raw_bytes_as_string(tvbuff_t *tvb, const unsigned offset, char *buffer, size_t bufsize)
Extract raw bytes from a tvbuff into a buffer as a NUL-terminated string.
Definition tvbuff.c:4653
WS_DLL_PUBLIC bool tvb_get_string_uint(tvbuff_t *tvb, const unsigned offset, const unsigned length, const unsigned encoding, uint32_t *value, unsigned *endoff)
Parse a case-insensitive byte string into an unsigned 32-bit integer.
Definition tvbuff.c:2003
WS_DLL_PUBLIC void tvb_set_fragment(tvbuff_t *tvb)
Set the "this is a fragment" flag on a tvbuff.
Definition tvbuff.c:5544
WS_DLL_PUBLIC uint64_t tvb_get_uint64(tvbuff_t *tvb, const unsigned offset, const unsigned encoding)
Retrieve a 64-bit unsigned value from a tvbuff using the specified encoding.
Definition tvbuff.c:1386
WS_DLL_PUBLIC bool tvb_find_uint16_length(tvbuff_t *tvb, const unsigned offset, const unsigned maxlength, const uint16_t needle, unsigned *found_offset)
Find the first occurrence of a 16-bit value in a tvbuff up to a limit.
Definition tvbuff.c:3006
WS_DLL_PUBLIC char * tvb_format_stringzpad(wmem_allocator_t *scope, tvbuff_t *tvb, const unsigned offset, const unsigned size)
Format a null-padded string from a tvbuff as printable text.
Definition tvbuff.c:3417
WS_DLL_PUBLIC bool tvb_find_tvb_remaining(tvbuff_t *haystack_tvb, tvbuff_t *needle_tvb, const unsigned haystack_offset, unsigned *found_offset)
Search for a sub-tvbuff within another tvbuff starting at a given offset.
Definition tvbuff.c:5497
WS_DLL_PUBLIC uint8_t * tvb_get_stringzpad(wmem_allocator_t *scope, tvbuff_t *tvb, const unsigned offset, const unsigned length, const unsigned encoding)
Extract and convert a null-padded string from a tvbuff to UTF-8.
Definition tvbuff.c:4144
WS_DLL_PUBLIC bool tvb_find_line_end_unquoted_length(tvbuff_t *tvb, const unsigned offset, const unsigned maxlength, unsigned *linelen, unsigned *next_offset)
Locate the end of a line in a tvbuff, scanning up to a certain length and ignoring newlines within qu...
Definition tvbuff.c:5087
WS_DLL_PUBLIC bool tvb_utf_8_isprint(tvbuff_t *tvb, const unsigned offset, const unsigned length)
Check if a portion of a tvbuff contains only valid, printable UTF-8 characters.
Definition tvbuff.c:4717
WS_DLL_PUBLIC unsigned tvb_strsize_enc(tvbuff_t *tvb, const unsigned offset, const unsigned encoding)
Determine the size of a NUL-terminated string in a given encoding in a tvbuff.
Definition tvbuff.c:3211
WS_DLL_PUBLIC int32_t tvb_get_ntohil(tvbuff_t *tvb, const unsigned offset)
Retrieve a 32-bit signed value in network byte order.
Definition tvbuff.c:1194
WS_DLL_PUBLIC int64_t tvb_get_ntohi48(tvbuff_t *tvb, const unsigned offset)
Retrieve a 48-bit signed value in network byte order.
Definition tvbuff.c:1231
const unsigned char out[16]
Definition tvbuff.h:3557
WS_DLL_PUBLIC uint64_t tvb_get_ntoh64(tvbuff_t *tvb, const unsigned offset)
Retrieve a 64-bit unsigned value in network byte order.
Definition tvbuff.c:1260
WS_DLL_PUBLIC bool tvb_get_string_int64(tvbuff_t *tvb, const unsigned offset, const unsigned length, const unsigned encoding, int64_t *value, unsigned *endoff)
Parse a case-insensitive byte string into a signed 64-bit integer.
Definition tvbuff.c:2126
WS_DLL_PUBLIC unsigned tvb_strsize(tvbuff_t *tvb, const unsigned offset)
Determine the size of a NUL-terminated string in a tvbuff.
Definition tvbuff.c:3140
WS_DLL_PUBLIC bool tvb_get_string_int16(tvbuff_t *tvb, const unsigned offset, const unsigned length, const unsigned encoding, int16_t *value, unsigned *endoff)
Parse a case-insensitive byte string into a signed 16-bit integer.
Definition tvbuff.c:2208
WS_DLL_PUBLIC int16_t tvb_get_ntohis(tvbuff_t *tvb, const unsigned offset)
Retrieve a 16-bit signed value in network byte order.
Definition tvbuff.c:1157
WS_DLL_PUBLIC bool tvb_ascii_isprint_remaining(tvbuff_t *tvb, const unsigned offset)
Check whether all bytes in a tvbuff starting at an offset are ASCII printable characters.
Definition tvbuff.c:4696
WS_DLL_PUBLIC void tvb_free(tvbuff_t *tvb)
Free a tvbuff_t and all tvbuffs chained from it.
Definition tvbuff.c:114
WS_DLL_PUBLIC int32_t tvb_get_int24(tvbuff_t *tvb, const unsigned offset, const unsigned encoding)
Retrieve a 24-bit signed value from a tvbuff using the specified encoding.
Definition tvbuff.c:1305
WS_DLL_PUBLIC unsigned tvb_reported_length_remaining(const tvbuff_t *tvb, const unsigned offset)
Computes bytes of reported packet data from the given offset to the end of buffer.
Definition tvbuff.c:812
WS_DLL_PUBLIC int32_t tvb_get_letohi24(tvbuff_t *tvb, const unsigned offset)
Retrieve a 24-bit signed value in little-endian byte order.
Definition tvbuff.c:1710
WS_DLL_PUBLIC bool tvb_find_line_end_length(tvbuff_t *tvb, const unsigned offset, const unsigned maxlength, unsigned *linelen, unsigned *next_offset)
Locate the end of a line in a tvbuff, scanning up to a certain length.
Definition tvbuff.c:4874
WS_DLL_PUBLIC tvbuff_t * tvb_child_uncompress_zlib(tvbuff_t *parent, tvbuff_t *tvb, const unsigned offset, unsigned comprlen)
Uncompress a zlib-compressed packet inside a tvbuff and attach the result to a parent tvbuff.
Definition tvbuff_zlib.c:334
WS_DLL_PUBLIC uint8_t * tvb_get_string_enc(wmem_allocator_t *scope, tvbuff_t *tvb, const unsigned offset, const unsigned length, const unsigned encoding)
Extract and convert a string from a tvbuff to UTF-8 using the specified encoding.
Definition tvbuff.c:3883
WS_DLL_PUBLIC uint8_t tvb_get_bits8(tvbuff_t *tvb, unsigned bit_offset, const unsigned no_of_bits)
Retrieve 1–8 bits from a tvbuff and return them as a uint8_t.
Definition tvbuff.c:2681
WS_DLL_PUBLIC uint64_t tvb_get_uint40(tvbuff_t *tvb, const unsigned offset, const unsigned encoding)
Retrieve a 40-bit unsigned value from a tvbuff using the specified encoding.
Definition tvbuff.c:1332
WS_DLL_PUBLIC int64_t tvb_get_ntohi56(tvbuff_t *tvb, const unsigned offset)
Retrieve a 56-bit signed value in network byte order.
Definition tvbuff.c:1250
WS_DLL_PUBLIC int64_t tvb_get_letohi64(tvbuff_t *tvb, const unsigned offset)
Retrieve a 64-bit signed value in little-endian byte order.
Definition tvbuff.c:1804
WS_DLL_PUBLIC unsigned tvb_reported_length(const tvbuff_t *tvb)
Get reported length of buffer.
Definition tvbuff.c:804
WS_DLL_PUBLIC uint64_t tvb_get_ntoh56(tvbuff_t *tvb, const unsigned offset)
Retrieve a 56-bit unsigned value in network byte order.
Definition tvbuff.c:1241
WS_DLL_PUBLIC int16_t tvb_get_int16(tvbuff_t *tvb, const unsigned offset, const unsigned encoding)
Retrieve a 16-bit signed value from a tvbuff using the specified encoding.
Definition tvbuff.c:1287
WS_DLL_PUBLIC const char * tvb_bcd_dig_to_str_be(wmem_allocator_t *scope, tvbuff_t *tvb, const unsigned offset, const unsigned len, const dgt_set_t *dgt, bool skip_first)
Convert BCD-encoded digits from a tvbuff to a formatted string (big-endian nibble order).
Definition tvbuff.c:5444
WS_DLL_PUBLIC tvbuff_t * tvb_new_subset_length(tvbuff_t *backing, const unsigned backing_offset, const unsigned reported_length)
Create a subset tvbuff with captured length fitting within backing and reported lengths.
Definition tvbuff_subset.c:188
WS_DLL_PUBLIC bool tvb_utf_8_isprint_remaining(tvbuff_t *tvb, const unsigned offset)
Check if a tvbuff contains only valid, printable UTF-8 characters.
Definition tvbuff.c:4729
WS_DLL_PUBLIC unsigned tvb_skip_uint8(tvbuff_t *tvb, unsigned offset, const unsigned maxlength, const uint8_t ch)
Skip consecutive occurrences of a specific byte value in a tvbuff.
Definition tvbuff.c:5177
WS_DLL_PUBLIC int tvb_strnlen(tvbuff_t *tvb, const unsigned offset, const unsigned maxlength)
Find the length of a NUL-terminated string in a tvbuff, up to a maximum limit.
Definition tvbuff.c:3286
WS_DLL_PUBLIC void tvb_free_chain(tvbuff_t *tvb)
Free the tvbuff_t and all tvbuffs chained from it.
Definition tvbuff.c:120
WS_DLL_PUBLIC wmem_strbuf_t * tvb_get_hpack_huffman_strbuf(wmem_allocator_t *scope, tvbuff_t *tvb, const unsigned offset, const unsigned len)
Decode HPACK Huffman-encoded data from a tvbuff into a string buffer.
Definition tvbuff_hpackhuff.c:51
WS_DLL_PUBLIC tvbuff_t * tvb_clone(tvbuff_t *tvb)
Creates a full clone of the given tvbuff.
Definition tvbuff.c:618
WS_DLL_PUBLIC uint32_t tvb_get_bits(tvbuff_t *tvb, const unsigned bit_offset, const unsigned no_of_bits, const unsigned encoding)
Deprecated accessor for extracting bits from a tvbuff.
Definition tvbuff.c:2872
WS_DLL_PUBLIC uint8_t tvb_get_uint8(tvbuff_t *tvb, const unsigned offset)
Retrieve an 8-bit unsigned value from a tvbuff at the specified offset.
Definition tvbuff.c:1130
WS_DLL_PUBLIC unsigned tvb_offset_from_real_beginning(const tvbuff_t *tvb)
Returns the offset from the beginning of the real (backing) buffer.
Definition tvbuff.c:891
WS_DLL_PUBLIC void * tvb_memcpy(tvbuff_t *tvb, void *target, const unsigned offset, size_t length)
Copy a range of bytes from a tvbuff into a pre-allocated target buffer.
Definition tvbuff.c:1035
WS_DLL_PUBLIC tvbuff_t * base64_to_tvb(tvbuff_t *parent, const char *base64)
Decode a base64-encoded string into a tvbuff and attach it to a parent tvbuff.
Definition tvbuff_base64.c:169
WS_DLL_PUBLIC bool tvb_find_line_end_unquoted_remaining(tvbuff_t *tvb, const unsigned offset, unsigned *linelen, unsigned *next_offset)
Locate the end of a line in a tvbuff, ignoring newlines within quoted strings.
Definition tvbuff.c:5072
WS_DLL_PUBLIC int tvb_find_line_end_unquoted(tvbuff_t *tvb, const unsigned offset, int len, int *next_offset)
Locate the end of a line in a tvbuff, ignoring newlines inside quoted strings.
Definition tvbuff.c:5044
WS_DLL_PUBLIC unsigned tvb_unicode_strsize(tvbuff_t *tvb, const unsigned offset)
Determine the size of a UCS-2 or UTF-16 NUL-terminated string in a tvbuff.
Definition tvbuff.c:3168
WS_DLL_PUBLIC double tvb_get_letohieee_double(tvbuff_t *tvb, const unsigned offset)
Retrieve a 64-bit IEEE double in little-endian byte order.
Definition tvbuff.c:1841
WS_DLL_PUBLIC bool tvb_get_string_uint16(tvbuff_t *tvb, const unsigned offset, const unsigned length, const unsigned encoding, uint16_t *value, unsigned *endoff)
Parse a case-insensitive byte string into an unsigned 16-bit integer.
Definition tvbuff.c:2044
WS_DLL_PUBLIC int tvb_strneql(tvbuff_t *tvb, const unsigned offset, const char *str, const size_t size)
Compare a string in a tvbuff to a reference string using strncmp semantics.
Definition tvbuff.c:3311
WS_DLL_PUBLIC void tvb_ensure_bytes_exist64(const tvbuff_t *tvb, const unsigned offset, const uint64_t length)
Checks that the bytes referred to by 'offset' and 'length' actually exist in the buffer.
Definition tvbuff.c:725
WS_DLL_PUBLIC tvbuff_t * tvb_uncompress_zlib(tvbuff_t *tvb, const unsigned offset, unsigned comprlen)
Uncompress zlib-compressed data from a tvbuff.
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:94
void(* tvbuff_free_cb_t)(void *)
Definition tvbuff.h:101
WS_DLL_PUBLIC int64_t tvb_get_letohi48(tvbuff_t *tvb, const unsigned offset)
Retrieve a 48-bit signed value in little-endian byte order.
Definition tvbuff.c:1766
WS_DLL_PUBLIC tvbuff_t * tvb_new_chain(tvbuff_t *parent, tvbuff_t *backing)
Create a new chained tvbuff from a parent and backing buffer.
Definition tvbuff.c:132
WS_DLL_PUBLIC void tvb_get_ntohguid(tvbuff_t *tvb, const unsigned offset, e_guid_t *guid)
Retrieve a GUID from a tvbuff in network byte order.
Definition tvbuff.c:2615
WS_DLL_PUBLIC uint16_t tvb_get_ntohs(tvbuff_t *tvb, const unsigned offset)
Retrieve a 16-bit unsigned value in network byte order.
Definition tvbuff.c:1148
WS_DLL_PUBLIC unsigned tvb_captured_length(const tvbuff_t *tvb)
Get the amount of captured data in the buffer.
Definition tvbuff.c:624
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:247
WS_DLL_PUBLIC char * tvb_format_text_wsp(wmem_allocator_t *allocator, tvbuff_t *tvb, const unsigned offset, const unsigned size)
Format tvbuff data as printable text, omitting C-style escapes.
Definition tvbuff.c:3404
WS_DLL_PUBLIC uint64_t tvb_get_uint48(tvbuff_t *tvb, const unsigned offset, const unsigned encoding)
Retrieve a 48-bit unsigned value from a tvbuff using the specified encoding.
Definition tvbuff.c:1350
WS_DLL_PUBLIC int tvb_strncaseeql(tvbuff_t *tvb, const unsigned offset, const char *str, const size_t size)
Case-insensitive comparison of tvbuff bytes against a reference string.
Definition tvbuff.c:3338
WS_DLL_PUBLIC unsigned tvb_raw_offset(tvbuff_t *tvb)
Returns the offset from the first byte of real data.
Definition tvbuff.c:5534
WS_DLL_PUBLIC tvbuff_t * tvb_child_uncompress_lz77huff(tvbuff_t *parent, tvbuff_t *tvb, const unsigned offset, unsigned comprlen)
Uncompress Microsoft LZ77+Huffman-compressed data from a tvbuff and attach the result to a parent tvb...
Definition tvbuff_lz77huff.c:414
WS_DLL_PUBLIC tvbuff_t * tvb_uncompress_lz77huff(tvbuff_t *tvb, const unsigned offset, unsigned comprlen)
Uncompress Microsoft LZ77+Huffman-compressed data from a tvbuff.
Definition tvbuff_lz77huff.c:368
WS_DLL_PUBLIC tvbuff_t * tvb_new_composite(void)
Create an empty composite tvbuff.
Definition tvbuff_composite.c:235
WS_DLL_PUBLIC uint64_t tvb_get_uint56(tvbuff_t *tvb, const unsigned offset, const unsigned encoding)
Retrieve a 56-bit unsigned value from a tvbuff using the specified encoding.
Definition tvbuff.c:1368
WS_DLL_PUBLIC bool tvb_find_uint8_remaining(tvbuff_t *tvb, const unsigned offset, const uint8_t needle, unsigned *found_offset)
Find the first occurrence of a byte value in a tvbuff.
Definition tvbuff.c:2952
WS_DLL_PUBLIC nstime_t * tvb_get_string_time(tvbuff_t *tvb, const unsigned offset, const unsigned length, const unsigned encoding, nstime_t *ns, unsigned *endoff)
Fetch a time value from an ASCII-style string in the tvbuff.
Definition tvbuff.c:2296
WS_DLL_PUBLIC bool tvb_find_uint16_remaining(tvbuff_t *tvb, const unsigned offset, const uint16_t needle, unsigned *found_offset)
Find the first occurrence of a 16-bit value in a tvbuff.
Definition tvbuff.c:3028
WS_DLL_PUBLIC uint8_t * tvb_get_stringz_enc(wmem_allocator_t *scope, tvbuff_t *tvb, const unsigned offset, unsigned *lengthp, const unsigned encoding)
Extract and convert a null-terminated string from a tvbuff to UTF-8 using the specified encoding.
Definition tvbuff.c:4358
WS_DLL_PUBLIC tvbuff_t * base64_tvb_to_new_tvb(tvbuff_t *parent, unsigned offset, unsigned length)
Decode a base64-encoded string from a tvbuff region and attach the result to a parent tvbuff.
Definition tvbuff_base64.c:184
WS_DLL_PUBLIC tvbuff_t * tvb_child_uncompress_brotli(tvbuff_t *parent, tvbuff_t *tvb, const unsigned offset, unsigned comprlen)
Uncompress Brotli-compressed data from a tvbuff and attach the result to a parent tvbuff.
Definition tvbuff_brotli.c:173
WS_DLL_PUBLIC struct tvbuff * tvb_get_ds_tvb(tvbuff_t *tvb)
Retrieve the data source tvbuff from a given tvbuff.
Definition tvbuff.c:5550
WS_DLL_PUBLIC char * tvb_bytes_to_str(wmem_allocator_t *allocator, tvbuff_t *tvb, const unsigned offset, const unsigned len)
Format a sequence of bytes from a tvbuff as a hexadecimal string.
Definition tvbuff.c:5457
WS_DLL_PUBLIC tvbuff_t * tvb_uncompress_lz77(tvbuff_t *tvb, const unsigned offset, unsigned comprlen)
Uncompress Microsoft Plain LZ77-compressed data from a tvbuff.
Definition tvbuff_lz77.c:111
WS_DLL_PUBLIC 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:273
WS_DLL_PUBLIC uint8_t * tvb_get_bits_array(wmem_allocator_t *scope, tvbuff_t *tvb, const unsigned offset, size_t length, size_t *data_length, const unsigned encoding)
Retrieve a byte array from a tvbuff using a bit-level offset and encoding.
Definition tvbuff.c:2666
WS_DLL_PUBLIC tvbuff_t * tvb_child_uncompress(tvbuff_t *parent, tvbuff_t *tvb, const unsigned offset, unsigned comprlen)
Deprecated interface for uncompressing data and chaining the result to a parent tvbuff.
Definition tvbuff_zlib.c:349
WS_DLL_PUBLIC tvbuff_t * tvb_new_octet_right_aligned(tvbuff_t *tvb, uint32_t bit_offset, uint32_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:527
WS_DLL_PUBLIC char * tvb_format_stringzpad_wsp(wmem_allocator_t *allocator, tvbuff_t *tvb, const unsigned offset, const unsigned size)
Format a null-padded string from a tvbuff as printable text, preserving whitespace.
Definition tvbuff.c:3433
WS_DLL_PUBLIC bool tvb_get_string_int(tvbuff_t *tvb, const unsigned offset, const unsigned length, const unsigned encoding, int32_t *value, unsigned *endoff)
Parse a case-insensitive byte string into a signed 32-bit integer.
Definition tvbuff.c:2167
WS_DLL_PUBLIC bool tvb_get_token_len_length(tvbuff_t *tvb, const unsigned offset, unsigned maxlength, unsigned *tokenlen, unsigned *next_offset)
Determine the length of a token in a tvbuff.
Definition tvbuff.c:5318
WS_DLL_PUBLIC char * tvb_get_etsi_ts_102_221_annex_a_string(wmem_allocator_t *scope, tvbuff_t *tvb, const unsigned offset, unsigned length)
Extract and convert a string encoded per ETSI TS 102 221 Annex A from a tvbuff to UTF-8.
Definition tvbuff.c:3681
WS_DLL_PUBLIC bool tvb_get_token_len_remaining(tvbuff_t *tvb, const unsigned offset, unsigned *tokenlen, unsigned *next_offset)
Determine the length of a token in a tvbuff.
Definition tvbuff.c:5303
WS_DLL_PUBLIC uint32_t tvb_get_ntoh24(tvbuff_t *tvb, const unsigned offset)
Retrieve a 24-bit unsigned value in network byte order.
Definition tvbuff.c:1166
WS_DLL_PUBLIC double tvb_get_ieee_double(tvbuff_t *tvb, const unsigned offset, const unsigned encoding)
Retrieve a 64-bit IEEE double from a tvbuff using the specified encoding.
Definition tvbuff.c:1471
WS_DLL_PUBLIC uint32_t tvb_get_bits32(tvbuff_t *tvb, unsigned bit_offset, const unsigned no_of_bits, const unsigned encoding)
Retrieve 1–32 bits from a tvbuff and return them as a uint32_t.
Definition tvbuff.c:2697
WS_DLL_PUBLIC bool tvb_ascii_isprint(tvbuff_t *tvb, const unsigned offset, const unsigned length)
Check whether all bytes in a tvbuff range are ASCII printable characters.
Definition tvbuff.c:4680
WS_DLL_PUBLIC float tvb_get_letohieee_float(tvbuff_t *tvb, const unsigned offset)
Retrieve a 32-bit IEEE float in little-endian byte order.
Definition tvbuff.c:1821
WS_DLL_PUBLIC bool tvb_get_string_int8(tvbuff_t *tvb, const unsigned offset, const unsigned length, const unsigned encoding, int8_t *value, unsigned *endoff)
Parse a case-insensitive byte string into a signed 16-bit integer.
Definition tvbuff.c:2249
WS_DLL_PUBLIC unsigned tvb_ensure_captured_length_remaining(const tvbuff_t *tvb, const unsigned offset)
Same as tvb_captured_length_remaining, but throws an exception if the offset is out of bounds.
Definition tvbuff.c:654
WS_DLL_PUBLIC tvbuff_t * tvb_new_octet_aligned(tvbuff_t *tvb, uint32_t bit_offset, uint32_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:468
WS_DLL_PUBLIC void tvb_get_letohguid(tvbuff_t *tvb, const unsigned offset, e_guid_t *guid)
Retrieve a GUID from a tvbuff in little-endian byte order.
Definition tvbuff.c:2626
WS_DLL_PUBLIC uint64_t tvb_get_letoh64(tvbuff_t *tvb, const unsigned offset)
Retrieve a 64-bit unsigned value in little-endian byte order.
Definition tvbuff.c:1795
WS_DLL_PUBLIC int tvb_get_ipv4_addr_with_prefix_len(tvbuff_t *tvb, const unsigned offset, ws_in4_addr *addr, uint32_t prefix_len)
Fetch an IPv4 address from a tvbuff and mask out bits not covered by a prefix length.
Definition tvbuff.c:2573
WS_DLL_PUBLIC int32_t tvb_get_ntohi24(tvbuff_t *tvb, const unsigned offset)
Retrieve a 24-bit signed value in network byte order.
Definition tvbuff.c:1175
WS_DLL_PUBLIC int tvb_get_ipv6_addr_with_prefix_len(tvbuff_t *tvb, const unsigned offset, ws_in6_addr *addr, uint32_t prefix_len)
Fetch an IPv6 address from a tvbuff and mask out bits not covered by a prefix length.
Definition tvbuff.c:2594
WS_DLL_PUBLIC int8_t tvb_get_int8(tvbuff_t *tvb, const unsigned offset)
Retrieve an 8-bit signed value from a tvbuff at the specified offset.
Definition tvbuff.c:1139
WS_DLL_PUBLIC uint64_t tvb_get_uint64_with_length(tvbuff_t *tvb, const unsigned offset, unsigned length, const unsigned encoding)
Retrieve a variable-length unsigned value (up to 64 bits) from a tvbuff using the specified encoding.
Definition tvbuff.c:1395
WS_DLL_PUBLIC uint32_t tvb_get_uint24(tvbuff_t *tvb, const unsigned offset, const unsigned encoding)
Retrieve a 24-bit unsigned value from a tvbuff using the specified encoding.
Definition tvbuff.c:1296
WS_DLL_PUBLIC void tvb_composite_finalize(tvbuff_t *tvb)
Mark a composite tvbuff as finalized.
Definition tvbuff_composite.c:299
WS_DLL_PUBLIC GByteArray * tvb_get_string_bytes(tvbuff_t *tvb, const unsigned offset, const unsigned length, const unsigned encoding, GByteArray *bytes, unsigned *endoff)
Parse a case-insensitive hex string with optional separators into a byte array.
Definition tvbuff.c:1916
WS_DLL_PUBLIC tvbuff_t * tvb_uncompress_zstd(tvbuff_t *tvb, const unsigned offset, unsigned comprlen)
Uncompress Zstandard (ZSTD)-compressed data from a tvbuff.
Definition tvbuff_zstd.c:28
WS_DLL_PUBLIC uint64_t tvb_get_letoh48(tvbuff_t *tvb, const unsigned offset)
Retrieve a 48-bit unsigned value in little-endian byte order.
Definition tvbuff.c:1757
WS_DLL_PUBLIC int64_t tvb_get_ntohi64(tvbuff_t *tvb, const unsigned offset)
Retrieve a 64-bit signed value in network byte order.
Definition tvbuff.c:1269
WS_DLL_PUBLIC void tvb_ensure_bytes_exist(const tvbuff_t *tvb, const unsigned offset, const int length)
Checks that the bytes referred to by 'offset' and 'length' actually exist in the buffer.
Definition tvbuff.c:744
WS_DLL_PUBLIC tvbuff_t * tvb_child_uncompress_zstd(tvbuff_t *parent, tvbuff_t *tvb, const unsigned offset, unsigned comprlen)
Uncompress Zstandard (ZSTD)-compressed data from a tvbuff and attach the result to a parent tvbuff.
Definition tvbuff_zstd.c:101
WS_DLL_PUBLIC int64_t tvb_get_ntohi40(tvbuff_t *tvb, const unsigned offset)
Retrieve a 40-bit signed value in network byte order.
Definition tvbuff.c:1212
WS_DLL_PUBLIC int32_t tvb_get_int32(tvbuff_t *tvb, const unsigned offset, const unsigned encoding)
Retrieve a 32-bit signed value from a tvbuff using the specified encoding.
Definition tvbuff.c:1323
WS_DLL_PUBLIC uint32_t tvb_get_letohl(tvbuff_t *tvb, const unsigned offset)
Retrieve a 32-bit unsigned value in little-endian byte order.
Definition tvbuff.c:1720
WS_DLL_PUBLIC uint32_t tvb_get_ipv4(tvbuff_t *tvb, const unsigned offset)
Retrieve an IPv4 address from a tvbuff in network byte order.
Definition tvbuff.c:2548
WS_DLL_PUBLIC void tvb_get_ipv6(tvbuff_t *tvb, const unsigned offset, ws_in6_addr *addr)
Retrieve an IPv6 address from a tvbuff.
Definition tvbuff.c:2560
WS_DLL_PUBLIC uint16_t tvb_get_bits16(tvbuff_t *tvb, unsigned bit_offset, const unsigned no_of_bits, const unsigned encoding)
Retrieve 1–16 bits from a tvbuff and return them as a uint16_t.
Definition tvbuff.c:2689
WS_DLL_PUBLIC bool tvb_bytes_exist(const tvbuff_t *tvb, const unsigned offset, const int length)
Check that the specified bytes exist in the tvbuff without throwing an exception.
Definition tvbuff.c:689
WS_DLL_PUBLIC const uint8_t * tvb_get_const_stringz(tvbuff_t *tvb, const unsigned offset, unsigned *lengthp)
Deprecated function to retrieve a raw, unmodifiable null-terminated string from a tvbuff.
Definition tvbuff.c:4240
WS_DLL_PUBLIC int64_t tvb_get_letohi40(tvbuff_t *tvb, const unsigned offset)
Retrieve a 40-bit signed value in little-endian byte order.
Definition tvbuff.c:1747
WS_DLL_PUBLIC tvbuff_t * tvb_new_subset_length_caplen(tvbuff_t *backing, const unsigned backing_offset, const unsigned backing_length, const unsigned reported_length)
Create a subset tvbuff with an explicitly limited captured length.
Definition tvbuff_subset.c:161
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:604
WS_DLL_PUBLIC void tvb_get_guid(tvbuff_t *tvb, const unsigned offset, e_guid_t *guid, const unsigned encoding)
Retrieve a GUID from a tvbuff using the specified encoding.
Definition tvbuff.c:2637
WS_DLL_PUBLIC uint64_t tvb_get_ntoh40(tvbuff_t *tvb, const unsigned offset)
Retrieve a 40-bit unsigned value in network byte order.
Definition tvbuff.c:1203
WS_DLL_PUBLIC tvbuff_t * tvb_new_real_data(const uint8_t *data, const unsigned length, const unsigned reported_length)
Create a tvbuff backed by existing data.
Definition tvbuff_real.c:58
WS_DLL_PUBLIC tvbuff_t * base64uri_tvb_to_new_tvb(tvbuff_t *parent, unsigned offset, unsigned length)
Decode a base64url-encoded string from a tvbuff region and attach the result to a parent tvbuff.
Definition tvbuff_base64.c:211
WS_DLL_PUBLIC uint64_t tvb_get_bits64(tvbuff_t *tvb, unsigned bit_offset, const unsigned no_of_bits, const unsigned encoding)
Retrieve 1–64 bits from a tvbuff and return them as a uint64_t.
Definition tvbuff.c:2705
WS_DLL_PUBLIC int64_t tvb_get_int40(tvbuff_t *tvb, const unsigned offset, const unsigned encoding)
Retrieve a 40-bit signed value from a tvbuff using the specified encoding.
Definition tvbuff.c:1341
WS_DLL_PUBLIC bool tvb_ascii_isdigit(tvbuff_t *tvb, const unsigned offset, const unsigned length)
Check if all bytes in a tvbuff range are ASCII digits.
Definition tvbuff.c:4746
WS_DLL_PUBLIC tvbuff_t * tvb_uncompress(tvbuff_t *tvb, const unsigned offset, unsigned comprlen)
Deprecated interface for uncompressing data from a tvbuff using zlib.
Definition tvbuff_zlib.c:343
WS_DLL_PUBLIC bool tvb_find_line_end_remaining(tvbuff_t *tvb, const unsigned offset, unsigned *linelen, unsigned *next_offset)
Locate the end of a line in a tvbuff.
Definition tvbuff.c:4859
WS_DLL_PUBLIC void * tvb_memdup(wmem_allocator_t *scope, tvbuff_t *tvb, const unsigned offset, size_t length)
Duplicate a block of data from a tvbuff into a newly allocated buffer.
Definition tvbuff.c:1078
WS_DLL_PUBLIC int32_t tvb_get_letohil(tvbuff_t *tvb, const unsigned offset)
Retrieve a 32-bit signed value in little-endian byte order.
Definition tvbuff.c:1729
WS_DLL_PUBLIC float tvb_get_ieee_float(tvbuff_t *tvb, const unsigned offset, const unsigned encoding)
Retrieve a 32-bit IEEE float from a tvbuff using the specified encoding.
Definition tvbuff.c:1462
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:84
WS_DLL_PUBLIC bool tvb_get_string_uint8(tvbuff_t *tvb, const unsigned offset, const unsigned length, const unsigned encoding, uint8_t *value, unsigned *endoff)
Parse a case-insensitive byte string into an unsigned 16-bit integer.
Definition tvbuff.c:2085
WS_DLL_PUBLIC char * tvb_get_ts_23_038_7bits_string_unpacked(wmem_allocator_t *scope, tvbuff_t *tvb, const unsigned offset, unsigned length)
Extract and convert a 3GPP TS 23.038 7-bit unpacked string from a tvbuff to UTF-8.
Definition tvbuff.c:3669
WS_DLL_PUBLIC unsigned tvb_skip_wsp_return(tvbuff_t *tvb, const unsigned offset)
Go backwards to find the offset after a token followed by optional ASCII whitespace.
Definition tvbuff.c:5154
WS_DLL_PUBLIC bool tvb_get_string_uint64(tvbuff_t *tvb, const unsigned offset, const unsigned length, const unsigned encoding, uint64_t *value, unsigned *endoff)
Parse a case-insensitive byte string into an unsigned 64-bit integer.
Definition tvbuff.c:1962
WS_DLL_PUBLIC tvbuff_t * tvb_new_subset_remaining(tvbuff_t *backing, const unsigned backing_offset)
Create a subset tvbuff containing all the data starting at an offset into a backing tvbuff.
Definition tvbuff_subset.c:212
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:851
WS_DLL_PUBLIC const uint8_t * tvb_get_ptr(tvbuff_t *tvb, const unsigned offset, const unsigned length)
Returns a raw pointer to tvbuff data. Use with extreme caution.
Definition tvbuff.c:1122
WS_DLL_PUBLIC uint64_t tvb_get_ntoh48(tvbuff_t *tvb, const unsigned offset)
Retrieve a 48-bit unsigned value in network byte order.
Definition tvbuff.c:1222
WS_DLL_PUBLIC const char * tvb_bcd_dig_to_str(wmem_allocator_t *scope, tvbuff_t *tvb, const unsigned offset, const unsigned len, const dgt_set_t *dgt, bool skip_first)
Convert BCD-encoded digits from a tvbuff into a formatted string.
Definition tvbuff.c:5435
WS_DLL_PUBLIC char * tvb_get_bcd_string(wmem_allocator_t *scope, tvbuff_t *tvb, const unsigned offset, unsigned len, const dgt_set_t *dgt, bool skip_first, bool odd, bool bigendian)
Convert BCD-encoded digits from a tvbuff to a UTF-8 string with flexible nibble handling.
Definition tvbuff.c:5366
WS_DLL_PUBLIC tvbuff_t * tvb_uncompress_lznt1(tvbuff_t *tvb, const unsigned offset, unsigned comprlen)
Uncompress Microsoft LZNT1-compressed data from a tvbuff.
Definition tvbuff_lznt1.c:127
WS_DLL_PUBLIC tvbuff_t * tvb_child_uncompress_snappy(tvbuff_t *parent, tvbuff_t *tvb, const unsigned offset, unsigned comprlen)
Uncompress Snappy-compressed data from a tvbuff and attach the result to a parent tvbuff.
Definition tvbuff_snappy.c:66
WS_DLL_PUBLIC int64_t tvb_get_letohi56(tvbuff_t *tvb, const unsigned offset)
Retrieve a 56-bit signed value in little-endian byte order.
Definition tvbuff.c:1785
WS_DLL_PUBLIC char * tvb_get_ts_23_038_7bits_string_packed(wmem_allocator_t *scope, tvbuff_t *tvb, const unsigned bit_offset, unsigned no_of_chars)
Extract and convert a 3GPP TS 23.038 7-bit packed string from a tvbuff to UTF-8.
Definition tvbuff.c:3655
WS_DLL_PUBLIC uint32_t tvb_get_letoh24(tvbuff_t *tvb, const unsigned offset)
Retrieve a 24-bit unsigned value in little-endian byte order.
Definition tvbuff.c:1701
WS_DLL_PUBLIC bool tvb_ws_mempbrk_uint8_length(tvbuff_t *tvb, const unsigned offset, const unsigned maxlength, const ws_mempbrk_pattern *pattern, unsigned *found_offset, unsigned char *found_needle)
Find the first occurrence of any needle from a pre-compiled pattern in a tvbuff up to a maximum searc...
Definition tvbuff.c:3112
WS_DLL_PUBLIC bool tvb_ws_mempbrk_uint8_remaining(tvbuff_t *tvb, const unsigned offset, const ws_mempbrk_pattern *pattern, unsigned *found_offset, unsigned char *found_needle)
Find the first occurrence of any needle from a pre-compiled pattern in a tvbuff.
Definition tvbuff.c:3096
WS_DLL_PUBLIC tvbuff_t * tvb_child_uncompress_lznt1(tvbuff_t *parent, tvbuff_t *tvb, const unsigned offset, unsigned comprlen)
Uncompress Microsoft LZNT1-compressed data from a tvbuff and attach the result to a parent tvbuff.
Definition tvbuff_lznt1.c:166
WS_DLL_PUBLIC uint32_t tvb_get_ntohl(tvbuff_t *tvb, const unsigned offset)
Retrieve a 32-bit unsigned value in network byte order.
Definition tvbuff.c:1185
WS_DLL_PUBLIC int tvb_memeql(tvbuff_t *tvb, const unsigned offset, const uint8_t *str, size_t size)
Compare raw bytes in a tvbuff to a reference buffer using memcmp semantics.
Definition tvbuff.c:3366
WS_DLL_PUBLIC tvbuff_t * tvb_child_uncompress_hpack_huff(tvbuff_t *parent, unsigned offset, unsigned length)
Decode HPACK Huffman-encoded data from a tvbuff region and attach the result to a parent tvbuff.
Definition tvbuff_hpackhuff.c:57
WS_DLL_PUBLIC tvbuff_t * tvb_uncompress_snappy(tvbuff_t *tvb, const unsigned offset, unsigned comprlen)
Uncompress Snappy-compressed data from a tvbuff.
WS_DLL_PUBLIC char * tvb_format_text(wmem_allocator_t *scope, tvbuff_t *tvb, const unsigned offset, const unsigned size)
Format a block of tvbuff data as printable text.
Definition tvbuff.c:3392
WS_DLL_PUBLIC unsigned tvb_get_varint(tvbuff_t *tvb, unsigned offset, unsigned maxlen, uint64_t *value, const unsigned encoding)
Extract a variable-length integer from a tvbuff using the specified encoding.
Definition tvbuff.c:5556
WS_DLL_PUBLIC uint64_t tvb_get_letoh56(tvbuff_t *tvb, const unsigned offset)
Retrieve a 56-bit unsigned value in little-endian byte order.
Definition tvbuff.c:1776
WS_DLL_PUBLIC unsigned tvb_captured_length_remaining(const tvbuff_t *tvb, const unsigned offset)
Computes bytes to end of buffer from the given offset.
Definition tvbuff.c:646
WS_DLL_PUBLIC int64_t tvb_get_int56(tvbuff_t *tvb, const unsigned offset, const unsigned encoding)
Retrieve a 56-bit signed value from a tvbuff using the specified encoding.
Definition tvbuff.c:1377
WS_DLL_PUBLIC bool tvb_find_uint8_length(tvbuff_t *tvb, const unsigned offset, const unsigned maxlength, const uint8_t needle, unsigned *found_offset)
Find the first occurrence of a byte value in a tvbuff up to a limit.
Definition tvbuff.c:2930
WS_DLL_PUBLIC uint32_t tvb_get_uint32(tvbuff_t *tvb, const unsigned offset, const unsigned encoding)
Retrieve a 32-bit unsigned value from a tvbuff using the specified encoding.
Definition tvbuff.c:1314
WS_DLL_PUBLIC char * tvb_bytes_to_str_punct(wmem_allocator_t *scope, tvbuff_t *tvb, const unsigned offset, const unsigned len, const char punct)
Format a sequence of bytes from a tvbuff as a string with a custom separator.
Definition tvbuff.c:5345
uint32_t ws_in4_addr
Represents a 32-bit IPv4 address in network byte order.
Definition inet_addr.h:22
Represents a GUID/UUID value; may be larger than GUID_LEN so must not be used to directly overlay pac...
Definition guid-utils.h:21
Internal memory allocator interface used by the wmem subsystem.
Definition wmem_allocator.h:34
Internal structure representing a wmem-allocated string buffer.
Definition wmem_strbuf.h:38
Definition mcast_stream.h:30
Digit mapping table for BCD decoding.
Definition tvbuff.h:3556
Represents a 128-bit IPv6 address.
Definition inet_addr.h:27
Definition nstime.h:26
Core tvbuff (testy virtual buffer) structure representing a region of packet data,...
Definition tvbuff-int.h:95
unsigned length
Definition tvbuff-int.h:115
unsigned reported_length
Definition tvbuff-int.h:120
Definition ws_mempbrk.h:21
WS_DEPRECATED_X("Use ip_num_to_str_buf() or ip_addr_to_str() instead") WS_DLL_PUBLIC void ip_to_str_buf(const uint8_t *ad
Converts a 32-bit IPv4 address to string format.