Wireshark  2.9.0-477-g68ec514b
The Wireshark network protocol analyzer
tvbuff.h
1 /* tvbuff.h
2  *
3  * Testy, Virtual(-izable) Buffer of guint8*'s
4  *
5  * "Testy" -- the buffer gets mad when an attempt is made to access data
6  * beyond the bounds of the buffer. An exception is thrown.
7  *
8  * "Virtual" -- the buffer can have its own data, can use a subset of
9  * the data of a backing tvbuff, or can be a composite of
10  * other tvbuffs.
11  *
12  * Copyright (c) 2000 by Gilbert Ramirez <gram@alumni.rice.edu>
13  *
14  * Wireshark - Network traffic analyzer
15  * By Gerald Combs <gerald@wireshark.org>
16  * Copyright 1998 Gerald Combs
17  *
18  * SPDX-License-Identifier: GPL-2.0-or-later
19  */
20 
21 #ifndef __TVBUFF_H__
22 #define __TVBUFF_H__
23 
24 #include <glib.h>
25 #include <epan/guid-utils.h>
26 #include <epan/wmem/wmem.h>
27 #include <epan/ipv6.h>
28 
29 #include <wsutil/nstime.h>
30 #include "wsutil/ws_mempbrk.h"
31 
32 #ifdef __cplusplus
33 extern "C" {
34 #endif /* __cplusplus */
35 
46 struct tvbuff;
47 typedef struct tvbuff tvbuff_t;
48 
103 typedef void (*tvbuff_free_cb_t)(void*);
104 
109 WS_DLL_PUBLIC tvbuff_t *tvb_new_octet_aligned(tvbuff_t *tvb,
110  guint32 bit_offset, gint32 no_of_bits);
111 
112 WS_DLL_PUBLIC tvbuff_t *tvb_new_chain(tvbuff_t *parent, tvbuff_t *backing);
113 
114 WS_DLL_PUBLIC tvbuff_t *tvb_clone(tvbuff_t *tvb);
115 
116 WS_DLL_PUBLIC tvbuff_t *tvb_clone_offset_len(tvbuff_t *tvb, guint offset,
117  guint len);
118 
124 WS_DLL_PUBLIC void tvb_free(tvbuff_t *tvb);
125 
131 WS_DLL_PUBLIC void tvb_free_chain(tvbuff_t *tvb);
132 
137 WS_DLL_PUBLIC void tvb_set_free_cb(tvbuff_t *tvb, const tvbuff_free_cb_t func);
138 
148 WS_DLL_PUBLIC void tvb_set_child_real_data_tvbuff(tvbuff_t *parent,
149  tvbuff_t *child);
150 
151 WS_DLL_PUBLIC tvbuff_t *tvb_new_child_real_data(tvbuff_t *parent,
152  const guint8 *data, const guint length, const gint reported_length);
153 
158 WS_DLL_PUBLIC tvbuff_t *tvb_new_real_data(const guint8 *data,
159  const guint length, const gint reported_length);
160 
176 WS_DLL_PUBLIC tvbuff_t *tvb_new_subset_length_caplen(tvbuff_t *backing,
177  const gint backing_offset, const gint backing_length,
178  const gint reported_length);
179 
185 WS_DLL_PUBLIC tvbuff_t *tvb_new_subset_length(tvbuff_t *backing,
186  const gint backing_offset, const gint reported_length);
187 
190 WS_DLL_PUBLIC tvbuff_t *tvb_new_subset_remaining(tvbuff_t *backing,
191  const gint backing_offset);
192 
193 /*
194 * Both tvb_composite_append and tvb_composite_prepend can throw
195  * BoundsError if member_offset/member_length goes beyond bounds of
196  * the 'member' tvbuff. */
197 
199 WS_DLL_PUBLIC void tvb_composite_append(tvbuff_t *tvb, tvbuff_t *member);
200 
202 extern void tvb_composite_prepend(tvbuff_t *tvb, tvbuff_t *member);
203 
205 WS_DLL_PUBLIC tvbuff_t *tvb_new_composite(void);
206 
209 WS_DLL_PUBLIC void tvb_composite_finalize(tvbuff_t *tvb);
210 
211 
212 /* Get amount of captured data in the buffer (which is *NOT* necessarily the
213  * length of the packet). You probably want tvb_reported_length instead. */
214 WS_DLL_PUBLIC guint tvb_captured_length(const tvbuff_t *tvb);
215 
220 WS_DLL_PUBLIC gint tvb_captured_length_remaining(const tvbuff_t *tvb, const gint offset);
221 
223 WS_DLL_PUBLIC guint tvb_ensure_captured_length_remaining(const tvbuff_t *tvb,
224  const gint offset);
225 
226 /* Checks (w/o throwing exception) that the bytes referred to by
227  * 'offset'/'length' actually exist in the buffer */
228 WS_DLL_PUBLIC gboolean tvb_bytes_exist(const tvbuff_t *tvb, const gint offset,
229  const gint length);
230 
234 WS_DLL_PUBLIC void tvb_ensure_bytes_exist64(const tvbuff_t *tvb,
235  const gint offset, const guint64 length);
236 
239 WS_DLL_PUBLIC void tvb_ensure_bytes_exist(const tvbuff_t *tvb,
240  const gint offset, const gint length);
241 
242 /* Checks (w/o throwing exception) that offset exists in buffer */
243 WS_DLL_PUBLIC gboolean tvb_offset_exists(const tvbuff_t *tvb,
244  const gint offset);
245 
246 /* Get reported length of buffer */
247 WS_DLL_PUBLIC guint tvb_reported_length(const tvbuff_t *tvb);
248 
253 WS_DLL_PUBLIC gint tvb_reported_length_remaining(const tvbuff_t *tvb,
254  const gint offset);
255 
262 WS_DLL_PUBLIC void tvb_set_reported_length(tvbuff_t *tvb, const guint);
263 
264 WS_DLL_PUBLIC guint tvb_offset_from_real_beginning(const tvbuff_t *tvb);
265 
266 /* Returns the offset from the first byte of real data. */
267 WS_DLL_PUBLIC gint tvb_raw_offset(tvbuff_t *tvb);
268 
270 WS_DLL_PUBLIC void tvb_set_fragment(tvbuff_t *tvb);
271 
272 WS_DLL_PUBLIC struct tvbuff *tvb_get_ds_tvb(tvbuff_t *tvb);
273 
274 
275 /************** START OF ACCESSORS ****************/
276 /* All accessors will throw an exception if appropriate */
277 
278 WS_DLL_PUBLIC guint8 tvb_get_guint8(tvbuff_t *tvb, const gint offset);
279 WS_DLL_PUBLIC gint8 tvb_get_gint8(tvbuff_t *tvb, const gint offset);
280 
281 WS_DLL_PUBLIC guint16 tvb_get_ntohs(tvbuff_t *tvb, const gint offset);
282 WS_DLL_PUBLIC gint16 tvb_get_ntohis(tvbuff_t *tvb, const gint offset);
283 WS_DLL_PUBLIC guint32 tvb_get_ntoh24(tvbuff_t *tvb, const gint offset);
284 WS_DLL_PUBLIC gint32 tvb_get_ntohi24(tvbuff_t *tvb, const gint offset);
285 WS_DLL_PUBLIC guint32 tvb_get_ntohl(tvbuff_t *tvb, const gint offset);
286 WS_DLL_PUBLIC gint32 tvb_get_ntohil(tvbuff_t *tvb, const gint offset);
287 WS_DLL_PUBLIC guint64 tvb_get_ntoh40(tvbuff_t *tvb, const gint offset);
288 WS_DLL_PUBLIC gint64 tvb_get_ntohi40(tvbuff_t *tvb, const gint offset);
289 WS_DLL_PUBLIC guint64 tvb_get_ntoh48(tvbuff_t *tvb, const gint offset);
290 WS_DLL_PUBLIC gint64 tvb_get_ntohi48(tvbuff_t *tvb, const gint offset);
291 WS_DLL_PUBLIC guint64 tvb_get_ntoh56(tvbuff_t *tvb, const gint offset);
292 WS_DLL_PUBLIC gint64 tvb_get_ntohi56(tvbuff_t *tvb, const gint offset);
293 WS_DLL_PUBLIC guint64 tvb_get_ntoh64(tvbuff_t *tvb, const gint offset);
294 WS_DLL_PUBLIC gint64 tvb_get_ntohi64(tvbuff_t *tvb, const gint offset);
295 WS_DLL_PUBLIC gfloat tvb_get_ntohieee_float(tvbuff_t *tvb, const gint offset);
296 WS_DLL_PUBLIC gdouble tvb_get_ntohieee_double(tvbuff_t *tvb,
297  const gint offset);
298 
299 WS_DLL_PUBLIC guint16 tvb_get_letohs(tvbuff_t *tvb, const gint offset);
300 WS_DLL_PUBLIC gint16 tvb_get_letohis(tvbuff_t *tvb, const gint offset);
301 WS_DLL_PUBLIC guint32 tvb_get_letoh24(tvbuff_t *tvb, const gint offset);
302 WS_DLL_PUBLIC gint32 tvb_get_letohi24(tvbuff_t *tvb, const gint offset);
303 WS_DLL_PUBLIC guint32 tvb_get_letohl(tvbuff_t *tvb, const gint offset);
304 WS_DLL_PUBLIC gint32 tvb_get_letohil(tvbuff_t *tvb, const gint offset);
305 WS_DLL_PUBLIC guint64 tvb_get_letoh40(tvbuff_t *tvb, const gint offset);
306 WS_DLL_PUBLIC gint64 tvb_get_letohi40(tvbuff_t *tvb, const gint offset);
307 WS_DLL_PUBLIC guint64 tvb_get_letoh48(tvbuff_t *tvb, const gint offset);
308 WS_DLL_PUBLIC gint64 tvb_get_letohi48(tvbuff_t *tvb, const gint offset);
309 WS_DLL_PUBLIC guint64 tvb_get_letoh56(tvbuff_t *tvb, const gint offset);
310 WS_DLL_PUBLIC gint64 tvb_get_letohi56(tvbuff_t *tvb, const gint offset);
311 WS_DLL_PUBLIC guint64 tvb_get_letoh64(tvbuff_t *tvb, const gint offset);
312 WS_DLL_PUBLIC gint64 tvb_get_letohi64(tvbuff_t *tvb, const gint offset);
313 WS_DLL_PUBLIC gfloat tvb_get_letohieee_float(tvbuff_t *tvb, const gint offset);
314 WS_DLL_PUBLIC gdouble tvb_get_letohieee_double(tvbuff_t *tvb,
315  const gint offset);
316 
317 WS_DLL_PUBLIC guint16 tvb_get_guint16(tvbuff_t *tvb, const gint offset, const guint encoding);
318 WS_DLL_PUBLIC gint16 tvb_get_gint16(tvbuff_t *tvb, const gint offset, const guint encoding);
319 WS_DLL_PUBLIC guint32 tvb_get_guint24(tvbuff_t *tvb, const gint offset, const guint encoding);
320 WS_DLL_PUBLIC gint32 tvb_get_gint24(tvbuff_t *tvb, const gint offset, const guint encoding);
321 WS_DLL_PUBLIC guint32 tvb_get_guint32(tvbuff_t *tvb, const gint offset, const guint encoding);
322 WS_DLL_PUBLIC gint32 tvb_get_gint32(tvbuff_t *tvb, const gint offset, const guint encoding);
323 WS_DLL_PUBLIC guint64 tvb_get_guint40(tvbuff_t *tvb, const gint offset, const guint encoding);
324 WS_DLL_PUBLIC gint64 tvb_get_gint40(tvbuff_t *tvb, const gint offset, const guint encoding);
325 WS_DLL_PUBLIC guint64 tvb_get_guint48(tvbuff_t *tvb, const gint offset, const guint encoding);
326 WS_DLL_PUBLIC gint64 tvb_get_gint48(tvbuff_t *tvb, const gint offset, const guint encoding);
327 WS_DLL_PUBLIC guint64 tvb_get_guint56(tvbuff_t *tvb, const gint offset, const guint encoding);
328 WS_DLL_PUBLIC gint64 tvb_get_gint56(tvbuff_t *tvb, const gint offset, const guint encoding);
329 WS_DLL_PUBLIC guint64 tvb_get_guint64(tvbuff_t *tvb, const gint offset, const guint encoding);
330 WS_DLL_PUBLIC gint64 tvb_get_gint64(tvbuff_t *tvb, const gint offset, const guint encoding);
331 WS_DLL_PUBLIC gfloat tvb_get_ieee_float(tvbuff_t *tvb, const gint offset, const guint encoding);
332 WS_DLL_PUBLIC gdouble tvb_get_ieee_double(tvbuff_t *tvb, const gint offset, const guint encoding);
333 
334 /*
335  * Fetch 16-bit and 32-bit values in host byte order.
336  * Used for some pseudo-headers in pcap/pcapng files, in which the
337  * headers are, when capturing, in the byte order of the host, and
338  * are converted to the byte order of the host reading the file
339  * when reading a capture file.
340  */
341 #if G_BYTE_ORDER == G_LITTLE_ENDIAN
342 #define tvb_get_h_guint16 tvb_get_letohs
343 #define tvb_get_h_guint32 tvb_get_letohl
344 #elif G_BYTE_ORDER == G_BIG_ENDIAN
345 #define tvb_get_h_guint16 tvb_get_ntohs
346 #define tvb_get_h_guint32 tvb_get_ntohl
347 #else
348 #error "Unsupported byte order"
349 #endif
350 
351 
352 /* Fetch a time value from an ASCII-style string in the tvb.
353  *
354  * @param[in] offset The beginning offset in the tvb (cannot be negative)
355  * @param[in] length The field's length in the tvb (or -1 for remaining)
356  * @param[in] encoding The ENC_* that defines the format (e.g., ENC_ISO_8601_DATE_TIME)
357  * @param[in,out] ns The pre-allocated nstime_t that will be set to the decoded value
358  * @param[out] endoff if not NULL, should point to a gint that this
359  * routine will then set to be the offset to the character after
360  * the last character used in the conversion. This is useful because
361  * they may not consume the whole section.
362  *
363  * @return a pointer to the nstime_t passed-in, or NULL on failure; if no
364  * valid conversion could be performed, *endoff is set to 0, and errno will be
365  * EDOM or ERANGE, and the nstime_t* passed-in will be cleared.
366  *
367  * @note The conversion ignores leading spaces, and will succeed even if it does
368  * not consume the entire string. If you care about such things, always compare
369  * the *endoff to where you expect it to be (namely, offset+length).
370  *
371  * This routine will not throw an error unless the passed-in arguments are
372  * invalid (e.g., offset is beyond the tvb's length).
373  *
374  * @warning This only works for string encodings which encode ASCII characters in
375  * a single byte: ENC_ASCII, ENC_UTF_8, ENC_ISO_8859_*, etc. It does NOT work
376  * for purely multi-byte encodings such as ENC_UTF_16, ENC_UCS_*, etc.
377  */
378 WS_DLL_PUBLIC
379 nstime_t* tvb_get_string_time(tvbuff_t *tvb, const gint offset, const gint length,
380  const guint encoding, nstime_t* ns, gint *endoff);
381 
382 /* Similar to above, but returns a GByteArray based on the case-insensitive
383  * hex-char strings with optional separators, and with optional leading spaces.
384  * The separators allowed are based on the ENC_SEP_* passed in the encoding param.
385  *
386  * The passed-in bytes is set to the values, and its pointer is also the return
387  * value or NULL on error. The GByteArray bytes must be pre-constructed with
388  * g_byte_array_new().
389  */
390 WS_DLL_PUBLIC
391 GByteArray* tvb_get_string_bytes(tvbuff_t *tvb, const gint offset, const gint length,
392  const guint encoding, GByteArray* bytes, gint *endoff);
393 
398 WS_DLL_PUBLIC guint32 tvb_get_ipv4(tvbuff_t *tvb, const gint offset);
399 
400 /* Fetch an IPv6 address. */
401 WS_DLL_PUBLIC void tvb_get_ipv6(tvbuff_t *tvb, const gint offset,
402  ws_in6_addr *addr);
403 
404 /* Fetch a GUID. */
405 WS_DLL_PUBLIC void tvb_get_ntohguid(tvbuff_t *tvb, const gint offset,
406  e_guid_t *guid);
407 WS_DLL_PUBLIC void tvb_get_letohguid(tvbuff_t *tvb, const gint offset,
408  e_guid_t *guid);
409 WS_DLL_PUBLIC void tvb_get_guid(tvbuff_t *tvb, const gint offset,
410  e_guid_t *guid, const guint encoding);
411 
412 /* Fetch a specified number of bits from bit offset in a tvb. All of these
413  * functions are equivalent, except for the type of the return value. Note
414  * that the parameter encoding (where supplied) is meaningless and ignored */
415 
416 /* get 1 - 8 bits returned in a guint8 */
417 WS_DLL_PUBLIC guint8 tvb_get_bits8(tvbuff_t *tvb, guint bit_offset,
418  const gint no_of_bits);
419 /* get 1 - 16 bits returned in a guint16 */
420 WS_DLL_PUBLIC guint16 tvb_get_bits16(tvbuff_t *tvb, guint bit_offset,
421  const gint no_of_bits, const guint encoding);
422 /* get 1 - 32 bits returned in a guint32 */
423 WS_DLL_PUBLIC guint32 tvb_get_bits32(tvbuff_t *tvb, guint bit_offset,
424  const gint no_of_bits, const guint encoding);
425 /* get 1 - 64 bits returned in a guint64 */
426 WS_DLL_PUBLIC guint64 tvb_get_bits64(tvbuff_t *tvb, guint bit_offset,
427  const gint no_of_bits, const guint encoding);
428 
433 WS_DLL_PUBLIC guint32 tvb_get_bits(tvbuff_t *tvb, const guint bit_offset,
434  const gint no_of_bits, const guint encoding);
435 
442 WS_DLL_PUBLIC void *tvb_memcpy(tvbuff_t *tvb, void *target, const gint offset,
443  size_t length);
444 
460 WS_DLL_PUBLIC void *tvb_memdup(wmem_allocator_t *scope, tvbuff_t *tvb,
461  const gint offset, size_t length);
462 
488 WS_DLL_PUBLIC const guint8 *tvb_get_ptr(tvbuff_t *tvb, const gint offset,
489  const gint length);
490 
498 WS_DLL_PUBLIC gint tvb_find_guint8(tvbuff_t *tvb, const gint offset,
499  const gint maxlength, const guint8 needle);
500 
502 WS_DLL_PUBLIC gint tvb_find_guint16(tvbuff_t *tvb, const gint offset,
503  const gint maxlength, const guint16 needle);
504 
513 WS_DLL_PUBLIC gint tvb_ws_mempbrk_pattern_guint8(tvbuff_t *tvb, const gint offset,
514  const gint maxlength, const ws_mempbrk_pattern* pattern, guchar *found_needle);
515 
516 
522 WS_DLL_PUBLIC guint tvb_strsize(tvbuff_t *tvb, const gint offset);
523 
530 WS_DLL_PUBLIC guint tvb_unicode_strsize(tvbuff_t *tvb, const gint offset);
531 
536 WS_DLL_PUBLIC gint tvb_strnlen(tvbuff_t *tvb, const gint offset,
537  const guint maxlength);
538 
543 WS_DLL_PUBLIC gchar *tvb_format_text(tvbuff_t *tvb, const gint offset,
544  const gint size);
545 
550 WS_DLL_PUBLIC gchar *tvb_format_text_wsp(wmem_allocator_t* allocator, tvbuff_t *tvb, const gint offset,
551  const gint size);
552 
558 extern gchar *tvb_format_stringzpad(tvbuff_t *tvb, const gint offset,
559  const gint size);
560 
565 extern gchar *tvb_format_stringzpad_wsp(wmem_allocator_t* allocator, tvbuff_t *tvb, const gint offset,
566  const gint size);
567 
588 WS_DLL_PUBLIC guint8 *tvb_get_string_enc(wmem_allocator_t *scope,
589  tvbuff_t *tvb, const gint offset, const gint length, const guint encoding);
590 
611 WS_DLL_PUBLIC gchar *tvb_get_ts_23_038_7bits_string(wmem_allocator_t *scope,
612  tvbuff_t *tvb, const gint bit_offset, gint no_of_chars);
613 
634 WS_DLL_PUBLIC gchar *tvb_get_ascii_7bits_string(wmem_allocator_t *scope,
635  tvbuff_t *tvb, const gint bit_offset, gint no_of_chars);
636 
657 WS_DLL_PUBLIC guint8 *tvb_get_stringzpad(wmem_allocator_t *scope,
658  tvbuff_t *tvb, const gint offset, const gint length, const guint encoding);
659 
686 WS_DLL_PUBLIC guint8 *tvb_get_stringz_enc(wmem_allocator_t *scope,
687  tvbuff_t *tvb, const gint offset, gint *lengthp, const guint encoding);
688 
707 WS_DLL_PUBLIC const guint8 *tvb_get_const_stringz(tvbuff_t *tvb,
708  const gint offset, gint *lengthp);
709 
723 WS_DLL_PUBLIC gint tvb_get_nstringz(tvbuff_t *tvb, const gint offset,
724  const guint bufsize, guint8 *buffer);
725 
732 WS_DLL_PUBLIC gint tvb_get_nstringz0(tvbuff_t *tvb, const gint offset,
733  const guint bufsize, guint8 *buffer);
734 
754 WS_DLL_PUBLIC gint tvb_find_line_end(tvbuff_t *tvb, const gint offset, int len,
755  gint *next_offset, const gboolean desegment);
756 
775 WS_DLL_PUBLIC gint tvb_find_line_end_unquoted(tvbuff_t *tvb, const gint offset,
776  int len, gint *next_offset);
777 
795 WS_DLL_PUBLIC gint tvb_skip_wsp(tvbuff_t *tvb, const gint offset,
796  const gint maxlength);
797 
798 WS_DLL_PUBLIC gint tvb_skip_wsp_return(tvbuff_t *tvb, const gint offset);
799 
800 int tvb_skip_guint8(tvbuff_t *tvb, int offset, const int maxlength, const guint8 ch);
801 
806 WS_DLL_PUBLIC gint tvb_strneql(tvbuff_t *tvb, const gint offset,
807  const gchar *str, const size_t size);
808 
813 WS_DLL_PUBLIC gint tvb_strncaseeql(tvbuff_t *tvb, const gint offset,
814  const gchar *str, const size_t size);
815 
820 WS_DLL_PUBLIC gint tvb_memeql(tvbuff_t *tvb, const gint offset,
821  const guint8 *str, size_t size);
822 
828 WS_DLL_PUBLIC gchar *tvb_bytes_to_str_punct(wmem_allocator_t *scope, tvbuff_t *tvb, const gint offset,
829  const gint len, const gchar punct);
830 
835 WS_DLL_PUBLIC gchar *tvb_bytes_to_str(wmem_allocator_t *allocator, tvbuff_t *tvb,
836  const gint offset, const gint len);
837 
848 typedef struct dgt_set_t
849 {
850  const unsigned char out[16];
851 }
852 dgt_set_t;
853 
854 WS_DLL_PUBLIC const gchar *tvb_bcd_dig_to_wmem_packet_str(tvbuff_t *tvb,
855  const gint offset, const gint len, const dgt_set_t *dgt,
856  gboolean skip_first);
857 
862 WS_DLL_PUBLIC gint tvb_find_tvb(tvbuff_t *haystack_tvb, tvbuff_t *needle_tvb,
863  const gint haystack_offset);
864 
865 /* From tvbuff_zlib.c */
866 
872 WS_DLL_PUBLIC tvbuff_t *tvb_uncompress(tvbuff_t *tvb, const int offset,
873  int comprlen);
874 
880 WS_DLL_PUBLIC tvbuff_t *tvb_child_uncompress(tvbuff_t *parent, tvbuff_t *tvb,
881  const int offset, int comprlen);
882 
883 /* From tvbuff_base64.c */
884 
888 extern tvbuff_t* base64_to_tvb(tvbuff_t *parent, const char *base64);
889 
903 WS_DLL_PUBLIC guint tvb_get_varint(tvbuff_t *tvb, guint offset, guint maxlen, guint64 *value, const guint encoding);
904 
905 /************** END OF ACCESSORS ****************/
906 
909 #ifdef __cplusplus
910 }
911 #endif /* __cplusplus */
912 
913 #endif /* __TVBUFF_H__ */
914 
915 /*
916  * Editor modelines - http://www.wireshark.org/tools/modelines.html
917  *
918  * Local variables:
919  * c-basic-offset: 4
920  * tab-width: 8
921  * indent-tabs-mode: nil
922  * End:
923  *
924  * vi: set shiftwidth=4 tabstop=8 expandtab:
925  * :indentSize=4:tabSize=8:noTabs=true:
926  */
WS_DLL_PUBLIC guint tvb_unicode_strsize(tvbuff_t *tvb, const gint offset)
Definition: tvbuff.c:2223
WS_DLL_PUBLIC gint tvb_get_nstringz(tvbuff_t *tvb, const gint offset, const guint bufsize, guint8 *buffer)
Definition: tvbuff.c:3287
WS_DLL_PUBLIC gint tvb_captured_length_remaining(const tvbuff_t *tvb, const gint offset)
Definition: tvbuff.c:497
WS_DLL_PUBLIC const guint8 * tvb_get_const_stringz(tvbuff_t *tvb, const gint offset, gint *lengthp)
Definition: tvbuff.c:2941
Definition: inet_ipv6.h:20
void(* tvbuff_free_cb_t)(void *)
Definition: tvbuff.h:103
WS_DLL_PUBLIC gchar * tvb_bytes_to_str_punct(wmem_allocator_t *scope, tvbuff_t *tvb, const gint offset, const gint len, const gchar punct)
Definition: tvbuff.c:3684
WS_DLL_PUBLIC gint tvb_find_guint16(tvbuff_t *tvb, const gint offset, const gint maxlength, const guint16 needle)
Definition: tvbuff.c:2085
WS_DLL_PUBLIC gint tvb_strnlen(tvbuff_t *tvb, const gint offset, const guint maxlength)
Definition: tvbuff.c:2244
Definition: ws_mempbrk.h:21
WS_DLL_PUBLIC guint tvb_get_varint(tvbuff_t *tvb, guint offset, guint maxlen, guint64 *value, const guint encoding)
Definition: tvbuff.c:3826
WS_DLL_PUBLIC tvbuff_t * tvb_new_octet_aligned(tvbuff_t *tvb, guint32 bit_offset, gint32 no_of_bits)
Definition: tvbuff.c:371
WS_DLL_PUBLIC void tvb_ensure_bytes_exist(const tvbuff_t *tvb, const gint offset, const gint length)
Definition: tvbuff.c:583
WS_DLL_PUBLIC gint tvb_get_nstringz0(tvbuff_t *tvb, const gint offset, const guint bufsize, guint8 *buffer)
Definition: tvbuff.c:3301
struct dgt_set_t dgt_set_t
WS_DLL_PUBLIC gint tvb_skip_wsp(tvbuff_t *tvb, const gint offset, const gint maxlength)
Definition: tvbuff.c:3612
WS_DLL_PUBLIC gchar * tvb_get_ts_23_038_7bits_string(wmem_allocator_t *scope, tvbuff_t *tvb, const gint bit_offset, gint no_of_chars)
Definition: tvbuff.c:2614
Definition: tvbuff-int.h:35
WS_DLL_PUBLIC tvbuff_t * tvb_new_real_data(const guint8 *data, const guint length, const gint reported_length)
Definition: tvbuff_real.c:58
WS_DLL_PUBLIC guint tvb_strsize(tvbuff_t *tvb, const gint offset)
Definition: tvbuff.c:2193
Definition: nstime.h:27
WS_DLL_PUBLIC tvbuff_t * tvb_uncompress(tvbuff_t *tvb, const int offset, int comprlen)
WS_DLL_PUBLIC void * tvb_memdup(wmem_allocator_t *scope, tvbuff_t *tvb, const gint offset, size_t length)
Definition: tvbuff.c:881
WS_DLL_PUBLIC guint8 * tvb_get_string_enc(wmem_allocator_t *scope, tvbuff_t *tvb, const gint offset, const gint length, const guint encoding)
Definition: tvbuff.c:2675
WS_DLL_PUBLIC gint tvb_strncaseeql(tvbuff_t *tvb, const gint offset, const gchar *str, const size_t size)
Definition: tvbuff.c:2299
WS_DLL_PUBLIC gint tvb_memeql(tvbuff_t *tvb, const gint offset, const guint8 *str, size_t size)
Definition: tvbuff.c:2327
gchar * tvb_format_stringzpad_wsp(wmem_allocator_t *allocator, tvbuff_t *tvb, const gint offset, const gint size)
Definition: tvbuff.c:2405
WS_DLL_PUBLIC tvbuff_t * tvb_new_subset_length_caplen(tvbuff_t *backing, const gint backing_offset, const gint backing_length, const gint reported_length)
Definition: tvbuff_subset.c:135
Definition: guid-utils.h:21
WS_DLL_PUBLIC gint tvb_find_tvb(tvbuff_t *haystack_tvb, tvbuff_t *needle_tvb, const gint haystack_offset)
Definition: tvbuff.c:3776
WS_DLL_PUBLIC guint32 tvb_get_ipv4(tvbuff_t *tvb, const gint offset)
Definition: tvbuff.c:1835
WS_DLL_PUBLIC void * tvb_memcpy(tvbuff_t *tvb, void *target, const gint offset, size_t length)
Definition: tvbuff.c:823
WS_DLL_PUBLIC gchar * tvb_format_text(tvbuff_t *tvb, const gint offset, const gint size)
Definition: tvbuff.c:2354
WS_DLL_PUBLIC guint8 * tvb_get_stringz_enc(wmem_allocator_t *scope, tvbuff_t *tvb, const gint offset, gint *lengthp, const guint encoding)
Definition: tvbuff.c:3031
WS_DLL_PUBLIC void tvb_set_reported_length(tvbuff_t *tvb, const guint)
Definition: tvbuff.c:715
WS_DLL_PUBLIC gint tvb_find_guint8(tvbuff_t *tvb, const gint offset, const gint maxlength, const guint8 needle)
Definition: tvbuff.c:2046
gchar * tvb_format_stringzpad(tvbuff_t *tvb, const gint offset, const gint size)
Definition: tvbuff.c:2386
WS_DLL_PUBLIC void tvb_free_chain(tvbuff_t *tvb)
Definition: tvbuff.c:118
WS_DLL_PUBLIC tvbuff_t * tvb_new_subset_length(tvbuff_t *backing, const gint backing_offset, const gint reported_length)
Definition: tvbuff_subset.c:164
Definition: wmem_allocator.h:26
void tvb_composite_prepend(tvbuff_t *tvb, tvbuff_t *member)
Definition: tvbuff_composite.c:231
guint length
Definition: tvbuff-int.h:61
guint reported_length
Definition: tvbuff-int.h:67
WS_DLL_PUBLIC gint tvb_strneql(tvbuff_t *tvb, const gint offset, const gchar *str, const size_t size)
Definition: tvbuff.c:2272
WS_DLL_PUBLIC void tvb_set_free_cb(tvbuff_t *tvb, const tvbuff_free_cb_t func)
Definition: tvbuff_real.c:86
WS_DLL_PUBLIC gchar * tvb_get_ascii_7bits_string(wmem_allocator_t *scope, tvbuff_t *tvb, const gint bit_offset, gint no_of_chars)
Definition: tvbuff.c:2628
WS_DLL_PUBLIC tvbuff_t * tvb_new_subset_remaining(tvbuff_t *backing, const gint backing_offset)
Definition: tvbuff_subset.c:197
WS_DLL_PUBLIC void tvb_composite_append(tvbuff_t *tvb, tvbuff_t *member)
Definition: tvbuff_composite.c:213
WS_DLL_PUBLIC void tvb_free(tvbuff_t *tvb)
Definition: tvbuff.c:112
WS_DLL_PUBLIC gint tvb_find_line_end(tvbuff_t *tvb, const gint offset, int len, gint *next_offset, const gboolean desegment)
Definition: tvbuff.c:3340
WS_DLL_PUBLIC guint8 * tvb_get_stringzpad(wmem_allocator_t *scope, tvbuff_t *tvb, const gint offset, const gint length, const guint encoding)
Definition: tvbuff.c:2856
Definition: mcast_stream.h:30
WS_DLL_PUBLIC gint tvb_find_line_end_unquoted(tvbuff_t *tvb, const gint offset, int len, gint *next_offset)
Definition: tvbuff.c:3463
WS_DLL_PUBLIC void tvb_composite_finalize(tvbuff_t *tvb)
Definition: tvbuff_composite.c:249
WS_DLL_PUBLIC tvbuff_t * tvb_new_composite(void)
Definition: tvbuff_composite.c:199
tvbuff_t * base64_to_tvb(tvbuff_t *parent, const char *base64)
Definition: tvbuff_base64.c:19
WS_DLL_PUBLIC guint32 tvb_get_bits(tvbuff_t *tvb, const guint bit_offset, const gint no_of_bits, const guint encoding)
Definition: tvbuff.c:2017
WS_DLL_PUBLIC guint tvb_ensure_captured_length_remaining(const tvbuff_t *tvb, const gint offset)
Definition: tvbuff.c:512
WS_DLL_PUBLIC void tvb_set_fragment(tvbuff_t *tvb)
Definition: tvbuff.c:3814
WS_DLL_PUBLIC void tvb_ensure_bytes_exist64(const tvbuff_t *tvb, const gint offset, const guint64 length)
Definition: tvbuff.c:566
WS_DLL_PUBLIC void tvb_set_child_real_data_tvbuff(tvbuff_t *parent, tvbuff_t *child)
Definition: tvbuff_real.c:96
WS_DLL_PUBLIC gint tvb_reported_length_remaining(const tvbuff_t *tvb, const gint offset)
Definition: tvbuff.c:692
WS_DLL_PUBLIC gint tvb_ws_mempbrk_pattern_guint8(tvbuff_t *tvb, const gint offset, const gint maxlength, const ws_mempbrk_pattern *pattern, guchar *found_needle)
Definition: tvbuff.c:2149
WS_DLL_PUBLIC tvbuff_t * tvb_child_uncompress(tvbuff_t *parent, tvbuff_t *tvb, const int offset, int comprlen)
Definition: tvbuff_zlib.c:328
WS_DLL_PUBLIC const guint8 * tvb_get_ptr(tvbuff_t *tvb, const gint offset, const gint length)
Definition: tvbuff.c:897
WS_DLL_PUBLIC gchar * tvb_bytes_to_str(wmem_allocator_t *allocator, tvbuff_t *tvb, const gint offset, const gint len)
Definition: tvbuff.c:3768
WS_DLL_PUBLIC gchar * tvb_format_text_wsp(wmem_allocator_t *allocator, tvbuff_t *tvb, const gint offset, const gint size)
Definition: tvbuff.c:2369
Definition: tvbuff.h:848