Wireshark 5.1.0
The Wireshark network protocol analyzer
Loading...
Searching...
No Matches
proto.h
Go to the documentation of this file.
1/* proto.h
2 * Definitions for protocol display
3 *
4 * Wireshark - Network traffic analyzer
5 * By Gerald Combs <[email protected]>
6 * Copyright 1998 Gerald Combs
7 *
8 * SPDX-License-Identifier: GPL-2.0-or-later
9 */
10
11
22#pragma once
23#include "wsutil/nstime.h"
24#include "tvbuff.h"
25#include <wsutil/value_string.h>
26#include "packet_info.h"
27#include "ftypes/ftypes.h"
28#include "register.h"
29#include "ws_symbol_export.h"
30#include "ws_attributes.h"
31
32#ifdef __cplusplus
33extern "C" {
34#endif /* __cplusplus */
35
43
45WS_DLL_PUBLIC int hf_text_only;
46
48#define ITEM_LABEL_LENGTH 240
49
50#define ITEM_LABEL_UNKNOWN_STR "Unknown"
51
52struct expert_field;
53
54/* Type-check that 'x' is compatible with 'type', should give compiler warnings otherwise. */
55#define cast_same(type, x) (0 ? (type)0 : (x))
56
58#define VALS(x) (cast_same(const struct _value_string*, (x)))
59
61#define VALS64(x) (cast_same(const struct _val64_string*, (x)))
62
64#define VALS_EXT_PTR(x) (cast_same(value_string_ext*, (x)))
65
67#define TIME_VALS(x) (cast_same(const struct _time_value_string*, (x)))
68
70#define TFS(x) (cast_same(const struct true_false_string*, (x)))
71
73#define UNS(x) (cast_same(const struct unit_name_string*, (x)))
74
75typedef void (*custom_fmt_func_t)(char *, uint32_t);
76
77typedef void (*custom_fmt_func_64_t)(char *, uint64_t);
78
79typedef void (*custom_fmt_func_double_t)(char *, double);
80
88#define CF_FUNC(x) ((const void *) (size_t) (x))
89
92#define RVALS(x) (cast_same(const struct _range_string*, (x)))
93
95#define FRAMENUM_TYPE(x) GINT_TO_POINTER(x)
96
97struct _protocol;
98
100typedef struct _protocol protocol_t;
101
102
109
110typedef enum {
113 PROTOCOL_GROUP_MAX,
115
116
120WS_DLL_PUBLIC int proto_get_group(const protocol_t* protocol);
121
125WS_DLL_PUBLIC const char* proto_get_group_name(const protocol_t* protocol);
126
137WS_DLL_PUBLIC WS_NORETURN
138void proto_report_dissector_bug(const char *format, ...)
139 G_GNUC_PRINTF(1, 2);
140
141#define REPORT_DISSECTOR_BUG(...) \
142 proto_report_dissector_bug(__VA_ARGS__)
143
147#ifdef _MSC_VER
148/* XXX - Is there a way to say "quit checking at this point"? */
149#define __DISSECTOR_ASSERT_STATIC_ANALYSIS_HINT(expression) \
150 ; __analysis_assume(expression);
151#else
152#define __DISSECTOR_ASSERT_STATIC_ANALYSIS_HINT(expression)
153#endif
154
165
166#define __DISSECTOR_ASSERT_STRINGIFY(s) # s
167
168#define __DISSECTOR_ASSERT(expression, file, lineno) \
169 (REPORT_DISSECTOR_BUG("%s:%u: failed assertion \"%s\"", \
170 file, lineno, __DISSECTOR_ASSERT_STRINGIFY(expression)))
171
172#define __DISSECTOR_ASSERT_HINT(expression, file, lineno, hint) \
173 (REPORT_DISSECTOR_BUG("%s:%u: failed assertion \"%s\" (%s)", \
174 file, lineno, __DISSECTOR_ASSERT_STRINGIFY(expression), hint))
175
176#define DISSECTOR_ASSERT(expression) \
177 ((void) ((expression) ? (void)0 : \
178 __DISSECTOR_ASSERT (expression, __FILE__, __LINE__))) \
179 __DISSECTOR_ASSERT_STATIC_ANALYSIS_HINT(expression)
180
188#define DISSECTOR_ASSERT_HINT(expression, hint) \
189 ((void) ((expression) ? (void)0 : \
190 __DISSECTOR_ASSERT_HINT (expression, __FILE__, __LINE__, hint))) \
191 __DISSECTOR_ASSERT_STATIC_ANALYSIS_HINT(expression)
192
193#if 0
194/* win32: using a debug breakpoint (int 3) can be very handy while debugging,
195 * as the assert handling of GTK/GLib is currently not very helpful */
196#define DISSECTOR_ASSERT(expression) \
197{ if(!(expression)) _asm { int 3}; }
198#endif
199
208#define DISSECTOR_ASSERT_NOT_REACHED() \
209 (REPORT_DISSECTOR_BUG("%s:%u: failed assertion \"DISSECTOR_ASSERT_NOT_REACHED\"", \
210 __FILE__, __LINE__))
211
231#define __DISSECTOR_ASSERT_CMPINT(a, op, b, type, fmt) \
232 (REPORT_DISSECTOR_BUG("%s:%u: failed assertion " #a " " #op " " #b " (" fmt " " #op " " fmt ")", \
233 __FILE__, __LINE__, (type)a, (type)b))
234
235#define DISSECTOR_ASSERT_CMPINT(a, op, b) \
236 ((void) ((a op b) ? (void)0 : \
237 __DISSECTOR_ASSERT_CMPINT (a, op, b, int64_t, "%" PRId64))) \
238 __DISSECTOR_ASSERT_STATIC_ANALYSIS_HINT(a op b)
239
245#define DISSECTOR_ASSERT_CMPUINT(a, op, b) \
246 ((void) ((a op b) ? (void)0 : \
247 __DISSECTOR_ASSERT_CMPINT (a, op, b, uint64_t, "%" PRIu64))) \
248 __DISSECTOR_ASSERT_STATIC_ANALYSIS_HINT(a op b)
249
253#define DISSECTOR_ASSERT_CMPUINTHEX(a, op, b) \
254 ((void) ((a op b) ? (void)0 : \
255 __DISSECTOR_ASSERT_CMPINT (a, op, b, uint64_t, "0x%" PRIX64))) \
256 __DISSECTOR_ASSERT_STATIC_ANALYSIS_HINT(a op b)
257
258/*
259 * This is similar to DISSECTOR_ASSERT(hfinfo->type == type) except that
260 * it will report the name of the field with the wrong type as well as
261 * the type.
262 *
263 * @param hfinfo The hfinfo for the field being tested
264 * @param type The type it's expected to have
265 */
266#define __DISSECTOR_ASSERT_FIELD_TYPE(hfinfo, t) \
267 (REPORT_DISSECTOR_BUG("%s:%u: field %s is not of type "#t, \
268 __FILE__, __LINE__, (hfinfo)->abbrev))
269
270#define DISSECTOR_ASSERT_FIELD_TYPE(hfinfo, t) \
271 ((void) (((hfinfo)->type == t) ? (void)0 : \
272 __DISSECTOR_ASSERT_FIELD_TYPE ((hfinfo), t))) \
273 __DISSECTOR_ASSERT_STATIC_ANALYSIS_HINT((hfinfo)->type == t)
274
275#define DISSECTOR_ASSERT_FIELD_TYPE_IS_INTEGRAL(hfinfo) \
276 ((void) ((FT_IS_INTEGER((hfinfo)->type)) ? (void)0 : \
277 REPORT_DISSECTOR_BUG("%s:%u: field %s is not of type FT_CHAR or an FT_{U}INTn type", \
278 __FILE__, __LINE__, (hfinfo)->abbrev))) \
279 __DISSECTOR_ASSERT_STATIC_ANALYSIS_HINT(FT_IS_INTEGER((hfinfo)->type))
280
281#define __DISSECTOR_ASSERT_FIELD_TYPE_IS_STRING(hfinfo) \
282 (REPORT_DISSECTOR_BUG("%s:%u: field %s is not of type FT_STRING, FT_STRINGZ, FT_STRINGZPAD, FT_STRINGZTRUNC, or FT_UINT_STRING", \
283 __FILE__, __LINE__, (hfinfo)->abbrev))
284
285#define DISSECTOR_ASSERT_FIELD_TYPE_IS_STRING(hfinfo) \
286 ((void) (FT_IS_STRING((hfinfo)->type) ? (void)0 : \
287 __DISSECTOR_ASSERT_FIELD_TYPE_IS_STRING ((hfinfo)))) \
288 __DISSECTOR_ASSERT_STATIC_ANALYSIS_HINT(FT_IS_STRING((hfinfo)->type))
289
290#define __DISSECTOR_ASSERT_FIELD_TYPE_IS_TIME(hfinfo) \
291 (REPORT_DISSECTOR_BUG("%s:%u: field %s is not of type FT_ABSOLUTE_TIME or FT_RELATIVE_TIME", \
292 __FILE__, __LINE__, (hfinfo)->abbrev))
293
294#define DISSECTOR_ASSERT_FIELD_TYPE_IS_TIME(hfinfo) \
295 ((void) (((hfinfo)->type == FT_ABSOLUTE_TIME || \
296 (hfinfo)->type == FT_RELATIVE_TIME) ? (void)0 : \
297 __DISSECTOR_ASSERT_FIELD_TYPE_IS_TIME ((hfinfo)))) \
298 __DISSECTOR_ASSERT_STATIC_ANALYSIS_HINT((hfinfo)->type == FT_ABSOLUTE_TIME || \
299 (hfinfo)->type == FT_RELATIVE_TIME)
300
301/*
302 * Encoding flags that apply to multiple data types.
303 */
304/*
305 * The encoding of a field of a particular type may involve more
306 * than just whether it's big-endian or little-endian and its size.
307 *
308 * For integral values, that's it, as 99.9999999999999% of the machines
309 * out there are 2's complement binary machines with 8-bit bytes,
310 * so the protocols out there expect that and, for example, any Unisys
311 * 2200 series machines out there just have to translate between 2's
312 * complement and 1's complement (and nobody's put any IBM 709x's on
313 * any networks lately :-)).
314 *
315 * However:
316 *
317 * for floating-point numbers, in addition to IEEE decimal
318 * floating-point, there's also IBM System/3x0 and PDP-11/VAX
319 * floating-point - most protocols use IEEE binary, but DCE RPC
320 * can use other formats if that's what the sending host uses;
321 *
322 * for character strings, there are various character encodings
323 * (various ISO 646 sets, ISO 8859/x, various other national
324 * standards, various DOS and Windows encodings, various Mac
325 * encodings, UTF-8, UTF-16, other extensions to ASCII, EBCDIC,
326 * etc.);
327 *
328 * for absolute times, there's UNIX time_t, UNIX time_t followed
329 * by 32-bit microseconds, UNIX time_t followed by 32-bit
330 * nanoseconds, DOS date/time, Windows FILETIME, NTP time, etc..
331 *
332 * We might also, in the future, want to allow a field specifier to
333 * indicate the encoding of the field, or at least its default
334 * encoding, as most fields in most protocols always use the
335 * same encoding (although that's not true of all fields, so we
336 * still need to be able to specify that at run time).
337 *
338 * So, for now, we define ENC_BIG_ENDIAN and ENC_LITTLE_ENDIAN as
339 * bit flags, to be combined, in the future, with other information
340 * to specify the encoding in the last argument to
341 * proto_tree_add_item(), and possibly to specify in a field
342 * definition (e.g., ORed in with the type value).
343 *
344 * Currently, proto_tree_add_item() treats its last argument as a
345 * Boolean - if it's zero, the field is big-endian, and if it's non-zero,
346 * the field is little-endian - and other code in epan/proto.c does
347 * the same. We therefore define ENC_BIG_ENDIAN as 0x00000000 and
348 * ENC_LITTLE_ENDIAN as 0x80000000 - we're using the high-order bit
349 * so that we could put a field type and/or a value such as a character
350 * encoding in the lower bits.
351 */
352#define ENC_BIG_ENDIAN 0x00000000
353#define ENC_LITTLE_ENDIAN 0x80000000
354
355#if G_BYTE_ORDER == G_LITTLE_ENDIAN
356 #define ENC_HOST_ENDIAN ENC_LITTLE_ENDIAN
357 #define ENC_ANTI_HOST_ENDIAN ENC_BIG_ENDIAN
358#else
359 #define ENC_HOST_ENDIAN ENC_BIG_ENDIAN
360 #define ENC_ANTI_HOST_ENDIAN ENC_LITTLE_ENDIAN
361#endif
362
363/*
364 * For protocols (FT_PROTOCOL), aggregate items with subtrees (FT_NONE),
365 * opaque byte-array fields (FT_BYTES), and other fields where there
366 * is no choice of encoding (either because it's "just a bucket
367 * of bytes" or because the encoding is completely fixed), we
368 * have ENC_NA (for "Not Applicable").
369 */
370#define ENC_NA 0x00000000
371
372/*
373 * Encoding for character strings - and for character-encoded values
374 * for non-string types.
375 *
376 * Historically, the only place the representation mattered for strings
377 * was with FT_UINT_STRINGs, where we had false for the string length
378 * being big-endian and true for it being little-endian.
379 *
380 * We now have encoding values for the character encoding. The encoding
381 * values are encoded in all but the top bit (which is the byte-order
382 * bit, required for FT_UINT_STRING and for UCS-2 and UTF-16 strings)
383 * and the bottom bit (which we ignore for now so that programs that
384 * pass true for the encoding just do ASCII).
385 *
386 * For ENC_ASCII, we map ASCII characters with the high bit set to the UTF-8
387 * REPLACEMENT CHARACTER, and do the same for ENC_UTF_8 with invalid UTF-8
388 * sequences. We should also map 0x00 to that as well - null-terminated and
389 * null-padded strings never have NULs in them, but counted strings might.
390 * Either that, or strings should be counted, not null-terminated. Note
391 * that conversion of ASCII and UTF-8 can change the length of the string,
392 * as with any other encoding, due to REPLACEMENT CHARACTERs.
393 *
394 * For display, perhaps we should also map control characters to the
395 * Unicode glyphs showing the name of the control character in small
396 * caps, diagonally. (Unfortunately, those only exist for C0, not C1.)
397 *
398 * *DO NOT* add anything to this set that is not a character encoding!
399 */
400#define ENC_CHARENCODING_MASK 0x0000FFFE /* mask out byte-order bits and other bits used with string encodings */
401#define ENC_ASCII 0x00000000
402#define ENC_ISO_646_IRV ENC_ASCII /* ISO 646 International Reference Version = ASCII */
403#define ENC_UTF_8 0x00000002
404#define ENC_UTF_16 0x00000004
405#define ENC_UCS_2 0x00000006
406#define ENC_UCS_4 0x00000008
407#define ENC_ISO_8859_1 0x0000000A
408#define ENC_ISO_8859_2 0x0000000C
409#define ENC_ISO_8859_3 0x0000000E
410#define ENC_ISO_8859_4 0x00000010
411#define ENC_ISO_8859_5 0x00000012
412#define ENC_ISO_8859_6 0x00000014
413#define ENC_ISO_8859_7 0x00000016
414#define ENC_ISO_8859_8 0x00000018
415#define ENC_ISO_8859_9 0x0000001A
416#define ENC_ISO_8859_10 0x0000001C
417#define ENC_ISO_8859_11 0x0000001E
418/* #define ENC_ISO_8859_12 0x00000020 ISO 8859-12 was abandoned */
419#define ENC_ISO_8859_13 0x00000022
420#define ENC_ISO_8859_14 0x00000024
421#define ENC_ISO_8859_15 0x00000026
422#define ENC_ISO_8859_16 0x00000028
423#define ENC_WINDOWS_1250 0x0000002A
424#define ENC_3GPP_TS_23_038_7BITS_PACKED 0x0000002C
425#define ENC_3GPP_TS_23_038_7BITS ENC_3GPP_TS_23_038_7BITS_PACKED
426#define ENC_EBCDIC 0x0000002E
427#define ENC_MAC_ROMAN 0x00000030
428#define ENC_CP437 0x00000032
429#define ENC_ASCII_7BITS 0x00000034
430#define ENC_T61 0x00000036
431#define ENC_EBCDIC_CP037 0x00000038
432#define ENC_WINDOWS_1252 0x0000003A
433#define ENC_WINDOWS_1251 0x0000003C
434#define ENC_CP855 0x0000003E
435#define ENC_CP866 0x00000040
436#define ENC_ISO_646_BASIC 0x00000042
437#define ENC_BCD_DIGITS_0_9 0x00000044 /* Packed BCD, digits 0-9 */
438#define ENC_KEYPAD_ABC_TBCD 0x00000046 /* Keypad-with-a/b/c "telephony BCD" = 0-9, *, #, a, b, c */
439#define ENC_KEYPAD_BC_TBCD 0x00000048 /* Keypad-with-B/C "telephony BCD" = 0-9, B, C, *, # */
440#define ENC_3GPP_TS_23_038_7BITS_UNPACKED 0x0000004C
441#define ENC_ETSI_TS_102_221_ANNEX_A 0x0000004E /* ETSI TS 102 221 Annex A */
442#define ENC_GB18030 0x00000050
443#define ENC_EUC_KR 0x00000052
444#define ENC_APN_STR 0x00000054 /* The encoding the APN/DNN field follows 3GPP TS 23.003 [2] clause 9.1.*/
445#define ENC_DECT_STANDARD_8BITS 0x00000056 /* DECT standard character set as defined in ETSI EN 300 175-5 Annex D */
446#define ENC_DECT_STANDARD_4BITS_TBCD 0x00000058 /* DECT standard 4bits character set as defined in ETSI EN 300 175-5 Annex D (BCD with 0xb = SPACE)*/
447#define ENC_EBCDIC_CP500 0x00000060
448/*
449 * TODO:
450 *
451 * packet-bacapp.c refers to two currently unsupported character sets (where
452 * we just use ASCII currently):
453 *
454 * "IBM MS DBCS" - At the very least could be any IBM/MS Double Byte
455 * Character Set for CJK (4 major ones), but also could just be any non
456 * Unicode and non ISO-8859-1 code page. This would be supported via the
457 * various code pages.
458 * JIS C 6226 / JIS X 0206 - Does this refer to ISO-2022-JP, SHIFT-JIS, or
459 * EUC-JP, which are all encoding schemes that support the JIS X 0206
460 * character set?
461 *
462 * As those are added, change code such as the code in packet-bacapp.c
463 * to use them.
464 *
465 * There's also some other code (e.g., packet-smpp.c) that just ignores
466 * strings if it determines that they are in an unsupported encoding, such
467 * as various encodings of Japanese mentioned above, for example.
468 *
469 */
470
471/*
472 * This is a modifier for FT_UINT_STRING and FT_UINT_BYTES values;
473 * it indicates that the length field should be interpreted as per
474 * sections 2.5.2.11 Octet String through 2.5.2.14 Long Character
475 * String of the ZigBee Cluster Library Specification, where if all
476 * bits are set in the length field, the string has an invalid value,
477 * and the number of octets in the value is 0.
478 */
479#define ENC_ZIGBEE 0x40000000
480
481/*
482 * This is a modifier for ENC_UTF_16, ENC_UCS_2, and ENC_UCS_4
483 * indicating that if the first two (or four, for UCS-4) octets
484 * are a big-endian or little-endian BOM, use that to determine
485 * the serialization order and ignore the ENC_LITTLE_ENDIAN or
486 * ENC_BIG_ENDIAN flag. This can't collide with ENC_ZIGBEE because
487 * it could be used simultaneously.
488 */
489#define ENC_BOM 0x20000000
490
491/*
492 * For cases where either native type or string encodings could both be
493 * valid arguments, we need something to distinguish which one is being
494 * passed as the argument, because ENC_BIG_ENDIAN and ENC_ASCII are both
495 * 0x00000000. So we use ENC_STR_NUM or ENC_STR_HEX bit-or'ed with
496 * ENC_ASCII and its ilk.
497 */
498/* this is for strings with auto-detected base as with strtoul */
499#define ENC_STR_NUM 0x01000000
500/* this is for strings as hex "1a2b3c" */
501#define ENC_STR_HEX 0x02000000
502/* this is for strings as decimal "12345" */
503#define ENC_STR_DEC 0x04000000
504/* a convenience macro for any of the above */
505#define ENC_STRING 0x07000000
506/* Kept around for compatibility for Lua scripts; code should use ENC_CHARENCODING_MASK */
507#define ENC_STR_MASK 0x0000FFFE
508
509/*
510 * For cases where the number is allowed to have a leading '+'/'-'
511 * this can't collide with ENC_SEP_* because they can be used simultaneously
512 *
513 * XXX - this is not used anywhere in Wireshark's code, dating back to
514 * at least Wireshark 2.6 and continuing to the current version.
515 * Perhaps the intent was to use it in the future, but 1) I'm not sure
516 * why it would be combined with ENC_SEP_, as byte arrays have no sign
517 * but integral values do, and 2) if we were to support string encodings
518 * for integral types, presumably whether it's signed (FT_INTn) or
519 * unsigned (FT_UINTn) would suffice to indicate whether the value
520 * can be signed or not.
521 */
522#define ENC_NUM_PREF 0x00200000
523
524/*
525 * Encodings for byte arrays.
526 *
527 * For cases where the byte array is encoded as a string composed of
528 * pairs of hex digits, possibly with a separator character between
529 * the pairs. That's specified by the encoding having ENC_STR_HEX,
530 * plus one of these values, set.
531 *
532 * See hex_str_to_bytes_encoding() in epan/strutil.h for details.
533 */
534#define ENC_SEP_NONE 0x00010000
535#define ENC_SEP_COLON 0x00020000
536#define ENC_SEP_DASH 0x00040000
537#define ENC_SEP_DOT 0x00080000
538#define ENC_SEP_SPACE 0x00100000
539/* a convenience macro for the above */
540#define ENC_SEP_MASK 0x001F0000
541
542/* Encodings for BCD strings
543 * Depending if the BCD string has even or odd number of digits
544 * we may need to strip off the last digit/High nibble.
545 */
546#define ENC_BCD_ODD_NUM_DIG 0x00010000
547#define ENC_BCD_SKIP_FIRST 0x00020000
548
549/*
550 * Encodings for time values.
551 *
552 * Historically FT_TIMEs were only timespecs; the only question was whether
553 * they were stored in big- or little-endian format.
554 *
555 * For backwards compatibility, we interpret an encoding of 1 as meaning
556 * "little-endian timespec", so that passing true is interpreted as that.
557 *
558 * We now support:
559 *
560 * ENC_TIME_SECS_NSECS - 8, 12, or 16 bytes. For 8 bytes, the first 4
561 * bytes are seconds and the next 4 bytes are nanoseconds; for 12 bytes,
562 * the first 8 bytes are seconds and the next 4 bytes are nanoseconds;
563 * for 16 bytes, the first 8 bytes are seconds and the next 8 bytes are
564 * nanoseconds. If the time is absolute, the seconds are seconds since
565 * the UN*X epoch (1970-01-01 00:00:00 UTC). (I.e., a UN*X struct
566 * timespec with a 4-byte or 8-byte time_t or a structure with an
567 * 8-byte time_t and an 8-byte nanoseconds field.)
568 *
569 * ENC_TIME_NTP - 8 bytes; the first 4 bytes are seconds since the NTP
570 * epoch (1900-01-01 00:00:00 GMT) and the next 4 bytes are 1/2^32's of
571 * a second since that second. (I.e., a 64-bit count of 1/2^32's of a
572 * second since the NTP epoch, with the upper 32 bits first and the
573 * lower 32 bits second, even when little-endian.) A value of 0 is a
574 * special case representing unknown or unsynchronized time. Per the
575 * suggestion in RFC 4330, if bit 0 is not set then the time is assumed
576 * to be in NTP Era 1, beginning on 2036-02-07 06:28:16 UTC. (I.e., the
577 * time displayed will be between 1968-01-20 03:14:08 UTC and
578 * 2104-02-26 09:42:24 UTC.) The 16 byte NTP date format and the 4 byte
579 * NTP short relative time format are not supported.
580 * Encodings that store only the seconds since the NTP epoch without
581 * fractional seconds should use ENC_TIME_SECS_NTP, described below.
582 *
583 * ENC_TIME_TOD - 8 bytes, as a count of microseconds since the System/3x0
584 * and z/Architecture epoch (1900-01-01 00:00:00 GMT).
585 *
586 * ENC_TIME_RTPS - 8 bytes; the first 4 bytes are seconds since the UN*X
587 * epoch and the next 4 bytes are 1/2^32's of a second since that
588 * second. (I.e., it's the offspring of a mating between UN*X time and
589 * NTP time). It's used by the Object Management Group's Real-Time
590 * Publish-Subscribe Wire Protocol for the Data Distribution Service.
591 *
592 * ENC_TIME_SECS_USECS - 8 bytes; the first 4 bytes are seconds and the
593 * next 4 bytes are microseconds. If the time is absolute, the seconds
594 * are seconds since the UN*X epoch. (I.e., a UN*X struct timeval with
595 * a 4-byte time_t.)
596 *
597 * ENC_TIME_SECS - 4 to 8 bytes, representing a value in seconds.
598 * If the time is absolute, it's seconds since the UN*X epoch.
599 *
600 * ENC_TIME_MSECS - 6 to 8 bytes, representing a value in milliseconds.
601 * If the time is absolute, it's milliseconds since the UN*X epoch.
602 *
603 * ENC_TIME_USECS - 8 bytes, representing a value in microseconds.
604 * If the time is absolute, it's microseconds since the UN*X epoch.
605 *
606 * ENC_TIME_NSECS - 8 bytes, representing a value in nanoseconds.
607 * If the time is absolute, it's nanoseconds since the UN*X epoch.
608 *
609 * ENC_TIME_SECS_NTP - 4 bytes, representing a count of seconds since
610 * the NTP epoch. As with ENC_TIME_NTP, times are assumed to be in
611 * the upper half of NTP Era 0 or the lower half of NTP Era 1.
612 *
613 * ENC_TIME_RFC_3971 - 8 bytes, representing a count of 1/64ths of a
614 * second since the UN*X epoch; see section 5.3.1 "Timestamp Option"
615 * in RFC 3971.
616 *
617 * ENC_TIME_MSEC_NTP - 6-8 bytes, representing a count of milliseconds since
618 * the NTP epoch. Similar to ENC_TIME_NTP, times before the midpoint of
619 * NTP Era 0 (1968-01-20) are assumed to represent the corresponding
620 * time in NTP Era 1 instead.
621 *
622 * ENC_TIME_MIP6 - 8 bytes; the first 48 bits are seconds since the UN*X epoch
623 * and the remaining 16 bits indicate the number of 1/65536's of a second
624 * since that second.
625 *
626 * ENC_TIME_MP4_FILE_SECS - 4-8 bytes, representing a count of seconds since
627 * January 1, 1904, 00:00:00 UTC.
628 *
629 * ENC_TIME_ZBEE_ZCL - 4-8 bytes, representing a count of seconds since
630 * January 1, 2000, 00:00:00 UTC.
631 *
632 * ENC_TIME_WINDOWS - 8 bytes, representing a count of 100-nanosecond intervals
633 * since January 1, 1601, 00:00:00 UTC. (I.e., a Windows FILETIME struct, with
634 * the low 32 bits first and the high 32 bits second, even when big-endian.)
635 */
636#define ENC_TIME_SECS_NSECS 0x00000000
637#define ENC_TIME_TIMESPEC 0x00000000 /* for backwards source compatibility */
638#define ENC_TIME_NTP 0x00000002
639#define ENC_TIME_TOD 0x00000004
640#define ENC_TIME_RTPS 0x00000008
641#define ENC_TIME_NTP_BASE_ZERO 0x00000008 /* for backwards source compatibility */
642#define ENC_TIME_SECS_USECS 0x00000010
643#define ENC_TIME_TIMEVAL 0x00000010 /* for backwards source compatibility */
644#define ENC_TIME_SECS 0x00000012
645#define ENC_TIME_MSECS 0x00000014
646#define ENC_TIME_SECS_NTP 0x00000018
647#define ENC_TIME_RFC_3971 0x00000020
648#define ENC_TIME_MSEC_NTP 0x00000022
649#define ENC_TIME_MIP6 0x00000024
650#define ENC_TIME_MP4_FILE_SECS 0x00000026
651#define ENC_TIME_CLASSIC_MAC_OS_SECS 0x00000026 /* for backwards source compatibility */
652#define ENC_TIME_NSECS 0x00000028
653#define ENC_TIME_USECS 0x00000030
654#define ENC_TIME_ZBEE_ZCL 0x00000032
655#define ENC_TIME_WINDOWS 0x00000034
656
657/*
658 * For cases where a string encoding contains a timestamp, use one
659 * of these (but only one). These values can collide with the ENC_SEP_
660 * values used when a string encoding contains a byte array, because
661 * you can't do both at the same time. They must not, however,
662 * overlap with the character encoding values.
663 */
664#define ENC_ISO_8601_DATE 0x00010000
665#define ENC_ISO_8601_TIME 0x00020000
666#define ENC_ISO_8601_DATE_TIME 0x00030000
667#define ENC_IMF_DATE_TIME 0x00040000 /* Internet Message Format - RFCs 822, 1123, 2822, 5322 */
668#define ENC_RFC_822 0x00040000 /* backwards compatibility */
669#define ENC_RFC_1123 0x00040000 /* backwards source compatibility - not binary */
670#define ENC_ISO_8601_DATE_TIME_BASIC 0x00100000
671/* a convenience macro for the above - for internal use only */
672#define ENC_STR_TIME_MASK 0x001F0000
673
674/*
675 * Encodings for variable-length integral types.
676 */
677
678/* Use varint format as described in Protobuf protocol
679 * https://developers.google.cn/protocol-buffers/docs/encoding
680 */
681#define ENC_VARINT_PROTOBUF 0x00000002
682/*
683 * Decodes a variable-length integer used in QUIC protocol
684 * See https://tools.ietf.org/html/draft-ietf-quic-transport-08#section-8.1
685 */
686#define ENC_VARINT_QUIC 0x00000004
687 /*
688 * Use "zig-zag" varint format as described in Protobuf protocol
689 * See https://developers.google.com/protocol-buffers/docs/encoding?csw=1#types
690 */
691#define ENC_VARINT_ZIGZAG 0x00000008
692/*
693 * Decodes a variable-length integer used in DTN protocols
694 * See https://www.rfc-editor.org/rfc/rfc6256.html
695 */
696#define ENC_VARINT_SDNV 0x00000010
697
698#define ENC_VARINT_MASK (ENC_VARINT_PROTOBUF|ENC_VARINT_QUIC|ENC_VARINT_ZIGZAG|ENC_VARINT_SDNV)
699
700/* Values for header_field_info.display */
701
702/* For integral types, the display format is a BASE_* field_display_e value
703 * possibly ORed with BASE_*_STRING */
704
706#define FIELD_DISPLAY_E_MASK 0xFF
707
751
752#define FIELD_DISPLAY(d) ((d) & FIELD_DISPLAY_E_MASK)
753
754#define FIELD_DISPLAY_IS_ABSOLUTE_TIME(d) \
755 (FIELD_DISPLAY(d) >= ABSOLUTE_TIME_LOCAL && FIELD_DISPLAY(d) <= ABSOLUTE_TIME_UNIX)
756
757/* Following constants have to be ORed with a field_display_e when dissector
758 * want to use specials value-string MACROs for a header_field_info */
759#define BASE_RANGE_STRING 0x00000100
760#define BASE_EXT_STRING 0x00000200
761#define BASE_VAL64_STRING 0x00000400
762
763#define BASE_ALLOW_ZERO 0x00000800
764
765#define BASE_UNIT_STRING 0x00001000
766
767#define BASE_NO_DISPLAY_VALUE 0x00002000
769
770#define BASE_PROTOCOL_INFO 0x00004000
771
772#define BASE_SPECIAL_VALS 0x00008000
773
774#define BASE_SHOW_ASCII_PRINTABLE 0x00010000
775
776#define BASE_SHOW_UTF_8_PRINTABLE 0x00020000
777
779#define IS_BASE_DUAL(b) ((b)==BASE_DEC_HEX||(b)==BASE_HEX_DEC)
780
782#define IS_BASE_PORT(b) (((b)==BASE_PT_UDP||(b)==BASE_PT_TCP||(b)==BASE_PT_DCCP||(b)==BASE_PT_SCTP))
783
793
796
799 /* ---------- set by dissector --------- */
800 const char *name;
801 const char *abbrev;
804 const void *strings;
808 uint64_t bitmask;
809 const char *blurb;
810
811 /* ------- set by proto routines (prefilled by HFILL macro, see below) ------ */
812 int id;
813 int parent;
817};
818
824#define HFILL -1, 0, HF_REF_TYPE_NONE, -1, NULL
825
826#define HFILL_INIT(hf) \
827 (hf).hfinfo.id = -1; \
828 (hf).hfinfo.parent = 0; \
829 (hf).hfinfo.ref_type = HF_REF_TYPE_NONE; \
830 (hf).hfinfo.same_name_prev_id = -1; \
831 (hf).hfinfo.same_name_next = NULL;
832
838
840typedef struct _item_label_t {
841 char representation[ITEM_LABEL_LENGTH];
842 size_t value_pos;
843 size_t value_len;
845
847typedef struct field_info {
849 unsigned start;
850 unsigned length;
851 unsigned appendix_start;
854 uint32_t flags;
856 tvbuff_t *ds_tvb;
857 fvalue_t *value;
861
862
872typedef struct
873{
877
878/*
879 * Flag fields. Do not assign values greater than 0x000FFFFF unless you
880 * shuffle the expert information upward; see below.
881 */
882
888#define FI_HIDDEN 0x00000001
891#define FI_GENERATED 0x00000002
893#define FI_URL 0x00000004
894
896#define FI_LITTLE_ENDIAN 0x00000008
898#define FI_BIG_ENDIAN 0x00000010
900#define FI_BITS_OFFSET(n) (((n) & 63) << 5)
902/* if 0, it means that field takes fi->length * 8 */
903#define FI_BITS_SIZE(n) (((n) & 63) << 12)
905#define FI_VARINT 0x00040000
906
908#define FI_GET_FLAG(fi, flag) ((fi) ? ((fi)->flags & (flag)) : 0)
910#define FI_SET_FLAG(fi, flag) \
911 do { \
912 if (fi) \
913 (fi)->flags = (fi)->flags | (flag); \
914 } while(0)
915
916#define FI_RESET_FLAG(fi, flag) \
917 do { \
918 if (fi) \
919 (fi)->flags = (fi)->flags & ~(flag); \
920 } while(0)
921
922#define FI_GET_BITS_OFFSET(fi) (FI_GET_FLAG(fi, FI_BITS_OFFSET(63)) >> 5)
923#define FI_GET_BITS_SIZE(fi) (FI_GET_FLAG(fi, FI_BITS_SIZE(63)) >> 12)
924
927typedef struct {
928 GHashTable *interesting_hfids;
929 bool visible;
930 bool fake_protocols;
931 unsigned count;
932 struct _packet_info *pinfo;
933 tvbuff_t *idle_count_ds_tvb;
934 unsigned max_start;
935 unsigned start_idle_count;
937
939typedef struct _proto_node {
940 struct _proto_node *first_child;
941 struct _proto_node *last_child;
942 struct _proto_node *next;
943 struct _proto_node *parent;
944 const header_field_info *hfinfo;
945 field_info *finfo;
946 tree_data_t *tree_data;
948
950typedef proto_node proto_tree;
953
954/*
955 * Expert information.
956 * This is in the flags field; we allocate this from the top down,
957 * so as not to collide with FI_ flags, which are allocated from
958 * the bottom up.
959 */
960
961/* expert severities */
962#define PI_SEVERITY_MASK 0x00F00000
964#define PI_COMMENT 0x00100000
966#define PI_CHAT 0x00200000
968#define PI_NOTE 0x00400000
970#define PI_WARN 0x00600000
972#define PI_ERROR 0x00800000
973
974/* expert "event groups" */
975#define PI_GROUP_MASK 0xFF000000
977#define PI_CHECKSUM 0x01000000
979#define PI_SEQUENCE 0x02000000
981#define PI_RESPONSE_CODE 0x03000000
983#define PI_REQUEST_CODE 0x04000000
985#define PI_UNDECODED 0x05000000
987#define PI_REASSEMBLE 0x06000000
989#define PI_MALFORMED 0x07000000
991#define PI_DEBUG 0x08000000
993#define PI_PROTOCOL 0x09000000
995#define PI_SECURITY 0x0a000000
997#define PI_COMMENTS_GROUP 0x0b000000
999#define PI_DECRYPTION 0x0c000000
1001#define PI_ASSUMPTION 0x0d000000
1003#define PI_DEPRECATED 0x0e000000
1005#define PI_RECEIVE 0x0f000000
1007#define PI_INTERFACE 0x10000000
1009#define PI_DISSECTOR_BUG 0x11000000
1010
1011/*
1012 * add more, see WSDG: 9.3. How to add an expert item:
1013 * https://www.wireshark.org/docs/wsdg_html/#ChDissectExpertInfo
1014 */
1015
1017#define PNODE_FINFO(proto_node) ((proto_node)->finfo)
1018
1020#define PITEM_FINFO(proto_item) PNODE_FINFO(proto_item)
1021
1023#define PTREE_FINFO(proto_tree) PNODE_FINFO(proto_tree)
1024
1026#define PNODE_HFINFO(proto_node) ((proto_node)->hfinfo)
1027
1029#define PITEM_HFINFO(proto_item) PNODE_HFINFO(proto_item)
1030
1032#define PTREE_HFINFO(proto_tree) PNODE_HFINFO(proto_tree)
1033
1035#define PTREE_DATA(proto_tree) ((proto_tree)->tree_data)
1036
1038#define PNODE_POOL(proto_node) ((proto_node)->tree_data->pinfo->pool)
1039
1045static inline bool proto_item_is_hidden(const proto_item *ti) {
1046 if (ti && PITEM_FINFO(ti)) {
1047 return FI_GET_FLAG(PITEM_FINFO(ti), FI_HIDDEN);
1048 }
1049 /* XXX - Is a NULL item hidden? */
1050 return true;
1051}
1052#define PROTO_ITEM_IS_HIDDEN(ti) proto_item_is_hidden((ti))
1053
1058static inline void proto_item_set_hidden(proto_item *ti) {
1059 if (ti) {
1061 }
1062}
1063#define PROTO_ITEM_SET_HIDDEN(ti) proto_item_set_hidden((ti))
1064
1068static inline void proto_item_set_visible(proto_item *ti) {
1069 if (ti) {
1071 }
1072}
1073#define PROTO_ITEM_SET_VISIBLE(ti) proto_item_set_visible((ti))
1074
1079static inline bool proto_item_is_generated(const proto_item *ti)
1080{
1081 if (ti) {
1083 }
1084 return false;
1085}
1086#define PROTO_ITEM_IS_GENERATED(ti) proto_item_is_generated((ti))
1087
1091static inline void proto_item_set_generated(proto_item *ti) {
1092 if (ti) {
1094 }
1095}
1096#define PROTO_ITEM_SET_GENERATED(ti) proto_item_set_generated((ti))
1097
1103static inline bool proto_item_is_url(const proto_item *ti)
1104{
1105 if (ti) {
1106 return FI_GET_FLAG(PITEM_FINFO(ti), FI_URL);
1107 }
1108 return false;
1109}
1110#define PROTO_ITEM_IS_URL(ti) proto_item_is_url((ti))
1111
1115static inline void proto_item_set_url(proto_item *ti) {
1116 if (ti) {
1118 }
1119}
1120#define PROTO_ITEM_SET_URL(ti) proto_item_set_url((ti))
1121
1127typedef void (*proto_tree_foreach_func)(proto_node *node, void *data);
1128
1135typedef bool (*proto_tree_traverse_func)(proto_node *node, void *data);
1136
1144WS_DLL_PUBLIC void proto_tree_children_foreach(proto_tree *tree,
1145 proto_tree_foreach_func func, void *data);
1146
1150typedef struct {
1154 void (*register_protoinfo)(void);
1155
1159 void (*register_handoff)(void);
1160} proto_plugin;
1161
1169WS_DLL_PUBLIC void proto_register_plugin(const proto_plugin *plugin);
1170
1176void proto_pre_init(void);
1177
1198void proto_init(GSList *register_all_plugin_protocols_list,
1199 GSList *register_all_plugin_handoffs_list,
1200 register_entity_func register_func, register_entity_func handoff_func,
1201 register_cb cb, void *client_data);
1202
1208extern void proto_cleanup(void);
1209
1215typedef void (*proto_execute_in_directory_func)(void* param);
1216
1227WS_DLL_PUBLIC void proto_execute_in_directory(const char* dir, proto_execute_in_directory_func func, void* param);
1228
1229
1243WS_DLL_PUBLIC bool proto_field_is_referenced(proto_tree *tree, int proto_id);
1244
1249WS_DLL_PUBLIC proto_tree* proto_item_add_subtree(proto_item *pi, const int idx) G_GNUC_WARN_UNUSED_RESULT;
1250
1254WS_DLL_PUBLIC proto_tree* proto_item_get_subtree(proto_item *pi);
1255
1259WS_DLL_PUBLIC proto_item* proto_item_get_parent(const proto_item *pi);
1260
1265WS_DLL_PUBLIC proto_item* proto_item_get_parent_nth(proto_item *pi, int gen);
1266
1271WS_DLL_PUBLIC void proto_item_set_text(proto_item *pi, const char *format, ...)
1272 G_GNUC_PRINTF(2,3);
1273
1278WS_DLL_PUBLIC void proto_item_append_text(proto_item *pi, const char *format, ...)
1279 G_GNUC_PRINTF(2,3);
1280
1285WS_DLL_PUBLIC void proto_item_prepend_text(proto_item *pi, const char *format, ...)
1286 G_GNUC_PRINTF(2,3);
1287
1291WS_DLL_PUBLIC void proto_item_set_len(proto_item *pi, const unsigned length);
1292
1314WS_DLL_PUBLIC void proto_item_set_end(proto_item *pi, tvbuff_t *tvb, unsigned end);
1315
1331WS_DLL_PUBLIC unsigned proto_item_get_len(const proto_item *pi);
1332
1338WS_DLL_PUBLIC void proto_item_set_bits_offset_len(proto_item *ti, int bits_offset, int bits_len);
1339
1352WS_DLL_PUBLIC char *proto_item_get_display_repr(wmem_allocator_t *scope, proto_item *pi);
1353
1360WS_DLL_PUBLIC proto_tree *proto_tree_create_root(packet_info *pinfo);
1361
1368void proto_tree_reset(proto_tree *tree);
1369
1375WS_DLL_PUBLIC void proto_tree_free(proto_tree *tree);
1376
1384WS_DLL_PUBLIC bool
1385proto_tree_set_visible(proto_tree *tree, bool visible);
1386
1390extern void
1391proto_tree_set_fake_protocols(proto_tree *tree, bool fake_protocols);
1392
1399extern void
1400proto_tree_prime_with_hfid(proto_tree *tree, const int hfid);
1401
1407extern void
1408proto_tree_prime_with_hfid_print(proto_tree *tree, const int hfid);
1409
1413WS_DLL_PUBLIC proto_item* proto_tree_get_parent(proto_tree *tree);
1414
1418WS_DLL_PUBLIC proto_tree *proto_tree_get_parent_tree(proto_tree *tree);
1419
1423WS_DLL_PUBLIC proto_tree* proto_tree_get_root(proto_tree *tree);
1424
1429WS_DLL_PUBLIC void proto_tree_move_item(proto_tree *tree, proto_item *fixed_item, proto_item *item_to_move);
1430
1431
1441WS_DLL_PUBLIC void proto_tree_set_appendix(proto_tree *tree, tvbuff_t *tvb, unsigned start, const unsigned length);
1442
1443
1453WS_DLL_PUBLIC proto_item *
1454proto_tree_add_item_new(proto_tree *tree, header_field_info *hfinfo, tvbuff_t *tvb,
1455 const unsigned start, int length, const unsigned encoding);
1456
1478WS_DLL_PUBLIC proto_item *
1479proto_tree_add_item(proto_tree *tree, int hfindex, tvbuff_t *tvb,
1480 const unsigned start, int length, const unsigned encoding);
1481
1494WS_DLL_PUBLIC proto_item *
1495proto_tree_add_item_new_ret_length(proto_tree *tree, header_field_info *hfinfo, tvbuff_t *tvb,
1496 const unsigned start, int length, const unsigned encoding, unsigned *lenretval);
1497
1510WS_DLL_PUBLIC proto_item *
1511proto_tree_add_item_ret_length(proto_tree *tree, int hfindex, tvbuff_t *tvb,
1512 const unsigned start, int length, const unsigned encoding, unsigned *lenretval);
1513
1545WS_DLL_PUBLIC proto_item *
1546proto_tree_add_item_ret_int(proto_tree *tree, int hfindex, tvbuff_t *tvb,
1547 const unsigned start, unsigned length, const unsigned encoding, int32_t *retval);
1548
1561WS_DLL_PUBLIC proto_item *
1562proto_tree_add_item_ret_int64(proto_tree *tree, int hfindex, tvbuff_t *tvb,
1563 const unsigned start, unsigned length, const unsigned encoding, int64_t *retval);
1564
1578WS_DLL_PUBLIC proto_item *
1579proto_tree_add_item_ret_uint(proto_tree *tree, int hfindex, tvbuff_t *tvb,
1580 const unsigned start, unsigned length, const unsigned encoding, uint32_t *retval);
1581
1597WS_DLL_PUBLIC proto_item *
1598proto_tree_add_item_ret_uint32(proto_tree *tree, int hfindex, tvbuff_t *tvb,
1599 const unsigned start, unsigned length, const unsigned encoding, uint32_t *retval);
1600
1613WS_DLL_PUBLIC proto_item *
1614proto_tree_add_item_ret_uint8(proto_tree *tree, int hfindex, tvbuff_t *tvb,
1615 const unsigned start, unsigned length, const unsigned encoding, uint8_t *retval);
1616
1629WS_DLL_PUBLIC proto_item *
1630proto_tree_add_item_ret_uint16(proto_tree *tree, int hfindex, tvbuff_t *tvb,
1631 const unsigned start, unsigned length, const unsigned encoding, uint16_t *retval);
1632
1645WS_DLL_PUBLIC proto_item *
1646proto_tree_add_item_ret_uint64(proto_tree *tree, int hfindex, tvbuff_t *tvb,
1647 const unsigned start, unsigned length, const unsigned encoding, uint64_t *retval);
1648
1672WS_DLL_PUBLIC proto_item *
1673proto_tree_add_item_ret_varint(proto_tree *tree, int hfindex, tvbuff_t *tvb,
1674 const unsigned start, unsigned length, const unsigned encoding, uint64_t *retval, unsigned *lenretval);
1675
1688WS_DLL_PUBLIC proto_item *
1689proto_tree_add_item_ret_boolean(proto_tree *tree, int hfindex, tvbuff_t *tvb,
1690 const unsigned start, unsigned length, const unsigned encoding, bool *retval);
1691
1705WS_DLL_PUBLIC proto_item *
1706proto_tree_add_item_ret_ipv4(proto_tree *tree, int hfindex, tvbuff_t *tvb,
1707 const unsigned start, unsigned length, const unsigned encoding, ws_in4_addr *retval);
1708
1723WS_DLL_PUBLIC proto_item *
1724proto_tree_add_item_ret_ipv6(proto_tree *tree, int hfindex, tvbuff_t *tvb,
1725 const unsigned start, unsigned length, const unsigned encoding, ws_in6_addr *retval);
1726
1741WS_DLL_PUBLIC proto_item *
1742proto_tree_add_item_ret_ether(proto_tree *tree, int hfindex, tvbuff_t *tvb,
1743 const unsigned start, unsigned length, const unsigned encoding, uint8_t *retval);
1744
1758WS_DLL_PUBLIC proto_item *
1759proto_tree_add_item_ret_float(proto_tree *tree, int hfindex, tvbuff_t *tvb,
1760 const unsigned start, unsigned length,
1761 const unsigned encoding, float *retval);
1762
1776WS_DLL_PUBLIC proto_item *
1777proto_tree_add_item_ret_double(proto_tree *tree, int hfindex, tvbuff_t *tvb,
1778 const unsigned start, unsigned length,
1779 const unsigned encoding, double *retval);
1780
1810WS_DLL_PUBLIC proto_item *
1811proto_tree_add_item_ret_string_and_length(proto_tree *tree, int hfindex,
1812 tvbuff_t *tvb, const unsigned start, int length, const unsigned encoding,
1813 wmem_allocator_t *scope, const uint8_t **retval, unsigned *lenretval);
1814
1842WS_DLL_PUBLIC proto_item *
1843proto_tree_add_item_ret_string(proto_tree *tree, int hfindex, tvbuff_t *tvb,
1844 const unsigned start, int length, const unsigned encoding,
1845 wmem_allocator_t *scope, const uint8_t **retval);
1846
1867WS_DLL_PUBLIC proto_item *
1868proto_tree_add_item_ret_display_string_and_length(proto_tree *tree, int hfindex,
1869 tvbuff_t *tvb,
1870 const unsigned start, int length, const unsigned encoding,
1871 wmem_allocator_t *scope, char **retval, unsigned *lenretval);
1872
1890WS_DLL_PUBLIC proto_item *
1891proto_tree_add_item_ret_display_string(proto_tree *tree, int hfindex,
1892 tvbuff_t *tvb,
1893 const unsigned start, int length, const unsigned encoding,
1894 wmem_allocator_t *scope, char **retval);
1895
1911WS_DLL_PUBLIC proto_item *
1912proto_tree_add_item_ret_time_string(proto_tree *tree, int hfindex,
1913 tvbuff_t *tvb,
1914 const unsigned start, int length, const unsigned encoding,
1915 wmem_allocator_t *scope, char **retval);
1916
1925proto_item *
1926proto_tree_add_text_internal(proto_tree *tree, tvbuff_t *tvb, unsigned start, unsigned length, const char *format,
1927 ...) G_GNUC_PRINTF(5,6);
1928
1937proto_item *
1938proto_tree_add_text_valist_internal(proto_tree *tree, tvbuff_t *tvb, unsigned start,
1939 unsigned length, const char *format, va_list ap) G_GNUC_PRINTF(5, 0);
1940
1950WS_DLL_PUBLIC proto_tree *
1951proto_tree_add_subtree(proto_tree *tree, tvbuff_t *tvb, unsigned start, int length, int idx,
1952 proto_item **tree_item, const char *text);
1953
1964WS_DLL_PUBLIC proto_tree *
1965proto_tree_add_subtree_format(proto_tree *tree, tvbuff_t *tvb, unsigned start, int length, int idx,
1966 proto_item **tree_item, const char *format, ...) G_GNUC_PRINTF(7,8);
1967
1969WS_DLL_PUBLIC proto_item *
1970proto_tree_add_format_text(proto_tree *tree, tvbuff_t *tvb, unsigned start, unsigned length);
1971
1973WS_DLL_PUBLIC proto_item *
1974proto_tree_add_format_wsp_text(proto_tree *tree, tvbuff_t *tvb, unsigned start, unsigned length);
1975
1985WS_DLL_PUBLIC proto_item *
1986proto_tree_add_none_format(proto_tree *tree, const int hfindex, tvbuff_t *tvb, const unsigned start,
1987 int length, const char *format, ...) G_GNUC_PRINTF(6,7);
1988
1998WS_DLL_PUBLIC proto_item *
1999proto_tree_add_protocol_format(proto_tree *tree, int hfindex, tvbuff_t *tvb, unsigned start,
2000 int length, const char *format, ...) G_GNUC_PRINTF(6,7);
2001
2010WS_DLL_PUBLIC proto_item *
2011proto_tree_add_bytes(proto_tree *tree, int hfindex, tvbuff_t *tvb, unsigned start,
2012 int length, const uint8_t* start_ptr);
2013
2024WS_DLL_PUBLIC proto_item *
2025proto_tree_add_bytes_with_length(proto_tree *tree, int hfindex, tvbuff_t *tvb, unsigned start,
2026 int length, const uint8_t *start_ptr, int ptr_length);
2027
2061WS_DLL_PUBLIC proto_item *
2062proto_tree_add_bytes_item(proto_tree *tree, int hfindex, tvbuff_t *tvb,
2063 const unsigned start, unsigned length, const unsigned encoding,
2064 GByteArray *retval, unsigned *endoff, int *err);
2065
2079WS_DLL_PUBLIC proto_item *
2080proto_tree_add_bytes_format_value(proto_tree *tree, int hfindex, tvbuff_t *tvb,
2081 unsigned start, int length, const uint8_t* start_ptr, const char *format,
2082 ...) G_GNUC_PRINTF(7,8);
2083
2096WS_DLL_PUBLIC proto_item *
2097proto_tree_add_bytes_format(proto_tree *tree, int hfindex, tvbuff_t *tvb, unsigned start,
2098 int length, const uint8_t* start_ptr, const char *format, ...) G_GNUC_PRINTF(7,8);
2099
2108WS_DLL_PUBLIC proto_item *
2109proto_tree_add_time(proto_tree *tree, int hfindex, tvbuff_t *tvb, unsigned start,
2110 unsigned length, const nstime_t* value_ptr);
2111
2142WS_DLL_PUBLIC proto_item *
2143proto_tree_add_time_item(proto_tree *tree, int hfindex, tvbuff_t *tvb,
2144 const unsigned start, const unsigned length, const unsigned encoding,
2145 nstime_t *retval, unsigned *endoff, int *err);
2146
2147
2160WS_DLL_PUBLIC proto_item *
2161proto_tree_add_time_format_value(proto_tree *tree, int hfindex, tvbuff_t *tvb,
2162 unsigned start, unsigned length, nstime_t* value_ptr, const char *format, ...)
2163 G_GNUC_PRINTF(7,8);
2164
2177WS_DLL_PUBLIC proto_item *
2178proto_tree_add_time_format(proto_tree *tree, int hfindex, tvbuff_t *tvb, unsigned start,
2179 unsigned length, nstime_t* value_ptr, const char *format, ...) G_GNUC_PRINTF(7,8);
2180
2189WS_DLL_PUBLIC proto_item *
2190proto_tree_add_ipxnet(proto_tree *tree, int hfindex, tvbuff_t *tvb, unsigned start,
2191 unsigned length, uint32_t value);
2192
2205WS_DLL_PUBLIC proto_item *
2206proto_tree_add_ipxnet_format_value(proto_tree *tree, int hfindex, tvbuff_t *tvb,
2207 unsigned start, unsigned length, uint32_t value, const char *format, ...)
2208 G_GNUC_PRINTF(7,8);
2209
2221WS_DLL_PUBLIC proto_item *
2222proto_tree_add_ipxnet_format(proto_tree *tree, int hfindex, tvbuff_t *tvb, unsigned start,
2223 unsigned length, uint32_t value, const char *format, ...) G_GNUC_PRINTF(7,8);
2224
2233WS_DLL_PUBLIC proto_item *
2234proto_tree_add_ipv4(proto_tree *tree, int hfindex, tvbuff_t *tvb, unsigned start,
2235 unsigned length, ws_in4_addr value);
2236
2249WS_DLL_PUBLIC proto_item *
2250proto_tree_add_ipv4_format_value(proto_tree *tree, int hfindex, tvbuff_t *tvb,
2251 unsigned start, unsigned length, ws_in4_addr value, const char *format, ...)
2252 G_GNUC_PRINTF(7,8);
2253
2265WS_DLL_PUBLIC proto_item *
2266proto_tree_add_ipv4_format(proto_tree *tree, int hfindex, tvbuff_t *tvb, unsigned start,
2267 unsigned length, ws_in4_addr value, const char *format, ...) G_GNUC_PRINTF(7,8);
2268
2277WS_DLL_PUBLIC proto_item *
2278proto_tree_add_ipv6(proto_tree *tree, int hfindex, tvbuff_t *tvb, unsigned start,
2279 unsigned length, const ws_in6_addr *value_ptr);
2280
2293WS_DLL_PUBLIC proto_item *
2294proto_tree_add_ipv6_format_value(proto_tree *tree, int hfindex, tvbuff_t *tvb,
2295 unsigned start, unsigned length, const ws_in6_addr *value_ptr, const char *format,
2296 ...) G_GNUC_PRINTF(7,8);
2297
2309WS_DLL_PUBLIC proto_item *
2310proto_tree_add_ipv6_format(proto_tree *tree, int hfindex, tvbuff_t *tvb, unsigned start,
2311 unsigned length, const ws_in6_addr *value_ptr, const char *format, ...) G_GNUC_PRINTF(7,8);
2312
2321WS_DLL_PUBLIC proto_item *
2322proto_tree_add_ether(proto_tree *tree, int hfindex, tvbuff_t *tvb, unsigned start,
2323 unsigned length, const uint8_t* value);
2324
2337WS_DLL_PUBLIC proto_item *
2338proto_tree_add_ether_format_value(proto_tree *tree, int hfindex, tvbuff_t *tvb,
2339 unsigned start, unsigned length, const uint8_t* value, const char *format, ...)
2340 G_GNUC_PRINTF(7,8);
2341
2353WS_DLL_PUBLIC proto_item *
2354proto_tree_add_ether_format(proto_tree *tree, int hfindex, tvbuff_t *tvb, unsigned start,
2355 unsigned length, const uint8_t* value, const char *format, ...) G_GNUC_PRINTF(7,8);
2356
2365WS_DLL_PUBLIC proto_item *
2366proto_tree_add_guid(proto_tree *tree, int hfindex, tvbuff_t *tvb, unsigned start,
2367 unsigned length, const e_guid_t *value_ptr);
2368
2381WS_DLL_PUBLIC proto_item *
2382proto_tree_add_guid_format_value(proto_tree *tree, int hfindex, tvbuff_t *tvb,
2383 unsigned start, unsigned length, const e_guid_t *value_ptr, const char *format,
2384 ...) G_GNUC_PRINTF(7,8);
2385
2397WS_DLL_PUBLIC proto_item *
2398proto_tree_add_guid_format(proto_tree *tree, int hfindex, tvbuff_t *tvb, unsigned start,
2399 unsigned length, const e_guid_t *value_ptr, const char *format, ...) G_GNUC_PRINTF(7,8);
2400
2409WS_DLL_PUBLIC proto_item *
2410proto_tree_add_oid(proto_tree *tree, int hfindex, tvbuff_t *tvb, unsigned start,
2411 unsigned length, const uint8_t* value_ptr);
2412
2425WS_DLL_PUBLIC proto_item *
2426proto_tree_add_oid_format_value(proto_tree *tree, int hfindex, tvbuff_t *tvb,
2427 unsigned start, unsigned length, const uint8_t* value_ptr, const char *format,
2428 ...) G_GNUC_PRINTF(7,8);
2429
2441WS_DLL_PUBLIC proto_item *
2442proto_tree_add_oid_format(proto_tree *tree, int hfindex, tvbuff_t *tvb, unsigned start,
2443 unsigned length, const uint8_t* value_ptr, const char *format, ...) G_GNUC_PRINTF(7,8);
2444
2464WS_DLL_PUBLIC proto_item *
2465proto_tree_add_string(proto_tree *tree, int hfindex, tvbuff_t *tvb, unsigned start,
2466 int length, const char* value);
2467
2480WS_DLL_PUBLIC proto_item *
2481proto_tree_add_string_format_value(proto_tree *tree, int hfindex, tvbuff_t *tvb,
2482 unsigned start, int length, const char* value, const char *format, ...)
2483 G_GNUC_PRINTF(7,8);
2484
2497WS_DLL_PUBLIC proto_item *
2498proto_tree_add_string_format(proto_tree *tree, int hfindex, tvbuff_t *tvb, unsigned start,
2499 int length, const char* value, const char *format, ...) G_GNUC_PRINTF(7,8);
2500
2509WS_DLL_PUBLIC proto_item *
2510proto_tree_add_boolean(proto_tree *tree, int hfindex, tvbuff_t *tvb, unsigned start,
2511 unsigned length, uint64_t value);
2512
2525WS_DLL_PUBLIC proto_item *
2526proto_tree_add_boolean_format_value(proto_tree *tree, int hfindex,
2527 tvbuff_t *tvb, unsigned start, unsigned length, uint64_t value,
2528 const char *format, ...) G_GNUC_PRINTF(7,8);
2529
2541WS_DLL_PUBLIC proto_item *
2542proto_tree_add_boolean_format(proto_tree *tree, int hfindex, tvbuff_t *tvb, unsigned start,
2543 unsigned length, uint64_t value, const char *format, ...) G_GNUC_PRINTF(7,8);
2544
2553WS_DLL_PUBLIC proto_item *
2554proto_tree_add_float(proto_tree *tree, int hfindex, tvbuff_t *tvb, unsigned start,
2555 unsigned length, float value);
2556
2569WS_DLL_PUBLIC proto_item *
2570proto_tree_add_float_format_value(proto_tree *tree, int hfindex, tvbuff_t *tvb,
2571 unsigned start, unsigned length, float value, const char *format, ...)
2572 G_GNUC_PRINTF(7,8);
2573
2585WS_DLL_PUBLIC proto_item *
2586proto_tree_add_float_format(proto_tree *tree, int hfindex, tvbuff_t *tvb, unsigned start,
2587 unsigned length, float value, const char *format, ...) G_GNUC_PRINTF(7,8);
2588
2597WS_DLL_PUBLIC proto_item *
2598proto_tree_add_double(proto_tree *tree, int hfindex, tvbuff_t *tvb, unsigned start,
2599 unsigned length, double value);
2600
2613WS_DLL_PUBLIC proto_item *
2614proto_tree_add_double_format_value(proto_tree *tree, int hfindex, tvbuff_t *tvb,
2615 unsigned start, unsigned length, double value, const char *format, ...)
2616 G_GNUC_PRINTF(7,8);
2617
2629WS_DLL_PUBLIC proto_item *
2630proto_tree_add_double_format(proto_tree *tree, int hfindex, tvbuff_t *tvb, unsigned start,
2631 unsigned length, double value, const char *format, ...) G_GNUC_PRINTF(7,8);
2632
2641WS_DLL_PUBLIC proto_item *
2642proto_tree_add_uint(proto_tree *tree, int hfindex, tvbuff_t *tvb, unsigned start,
2643 unsigned length, uint32_t value);
2644
2657WS_DLL_PUBLIC proto_item *
2658proto_tree_add_uint_format_value(proto_tree *tree, int hfindex, tvbuff_t *tvb,
2659 unsigned start, unsigned length, uint32_t value, const char *format, ...)
2660 G_GNUC_PRINTF(7,8);
2661
2674WS_DLL_PUBLIC proto_item *
2675proto_tree_add_uint_format(proto_tree *tree, int hfindex, tvbuff_t *tvb, unsigned start,
2676 unsigned length, uint32_t value, const char *format, ...) G_GNUC_PRINTF(7,8);
2677
2686WS_DLL_PUBLIC proto_item *
2687proto_tree_add_uint64(proto_tree *tree, int hfindex, tvbuff_t *tvb, unsigned start,
2688 unsigned length, uint64_t value);
2689
2702WS_DLL_PUBLIC proto_item *
2703proto_tree_add_uint64_format_value(proto_tree *tree, int hfindex, tvbuff_t *tvb,
2704 unsigned start, unsigned length, uint64_t value, const char *format, ...)
2705 G_GNUC_PRINTF(7,8);
2706
2718WS_DLL_PUBLIC proto_item *
2719proto_tree_add_uint64_format(proto_tree *tree, int hfindex, tvbuff_t *tvb, unsigned start,
2720 unsigned length, uint64_t value, const char *format, ...) G_GNUC_PRINTF(7,8);
2721
2730WS_DLL_PUBLIC proto_item *
2731proto_tree_add_int(proto_tree *tree, int hfindex, tvbuff_t *tvb, unsigned start,
2732 unsigned length, int32_t value);
2733
2746WS_DLL_PUBLIC proto_item *
2747proto_tree_add_int_format_value(proto_tree *tree, int hfindex, tvbuff_t *tvb,
2748 unsigned start, unsigned length, int32_t value, const char *format, ...)
2749 G_GNUC_PRINTF(7,8);
2750
2763WS_DLL_PUBLIC proto_item *
2764proto_tree_add_int_format(proto_tree *tree, int hfindex, tvbuff_t *tvb, unsigned start,
2765 unsigned length, int32_t value, const char *format, ...) G_GNUC_PRINTF(7,8);
2766
2775WS_DLL_PUBLIC proto_item *
2776proto_tree_add_int64(proto_tree *tree, int hfindex, tvbuff_t *tvb, unsigned start,
2777 unsigned length, int64_t value);
2778
2791WS_DLL_PUBLIC proto_item *
2792proto_tree_add_int64_format_value(proto_tree *tree, int hfindex, tvbuff_t *tvb,
2793 unsigned start, unsigned length, int64_t value, const char *format, ...)
2794 G_GNUC_PRINTF(7,8);
2795
2807WS_DLL_PUBLIC proto_item *
2808proto_tree_add_int64_format(proto_tree *tree, int hfindex, tvbuff_t *tvb, unsigned start,
2809 unsigned length, int64_t value, const char *format, ...) G_GNUC_PRINTF(7,8);
2810
2819WS_DLL_PUBLIC proto_item *
2820proto_tree_add_eui64(proto_tree *tree, int hfindex, tvbuff_t *tvb, unsigned start,
2821 unsigned length, const uint64_t value);
2822
2835WS_DLL_PUBLIC proto_item *
2836proto_tree_add_eui64_format_value(proto_tree *tree, int hfindex, tvbuff_t *tvb,
2837 unsigned start, unsigned length, const uint64_t value, const char *format, ...)
2838 G_GNUC_PRINTF(7,8);
2839
2851WS_DLL_PUBLIC proto_item *
2852proto_tree_add_eui64_format(proto_tree *tree, int hfindex, tvbuff_t *tvb, unsigned start,
2853 unsigned length, const uint64_t value, const char *format, ...) G_GNUC_PRINTF(7,8);
2854
2856typedef struct _mac_hf_list_t {
2857 int *hf_addr; // FT_ETHER, BASE_NONE
2858 int *hf_addr_resolved; // FT_STRING, BASE_NONE
2859 int *hf_oui; // FT_UINT24, BASE_OUI
2860 int *hf_oui_resolved; // FT_STRING, BASE_NONE
2861 int *hf_lg; // FT_BOOLEAN, 24 bits, mask 0x020000
2862 int *hf_ig; // FT_BOOLEAN, 24 bits, mask 0x010000
2864
2874WS_DLL_PUBLIC proto_item *
2875proto_tree_add_mac48_detail(const mac_hf_list_t *list_specific,
2876 const mac_hf_list_t *list_generic,
2877 int idx, tvbuff_t *tvb, proto_tree *tree, unsigned offset);
2878
2885WS_DLL_PUBLIC proto_item *
2886proto_tree_add_debug_text(proto_tree *tree, const char *format,
2887 ...) G_GNUC_PRINTF(2,3);
2888
2894WS_DLL_PUBLIC void
2895proto_item_fill_label(const field_info *finfo, char *label_str, size_t *value_offset);
2896
2904WS_DLL_PUBLIC int
2905proto_item_fill_display_label(const field_info *fi, char *display_label_str, const int label_str_size);
2906
2912WS_DLL_PUBLIC int
2913proto_register_protocol(const char *name, const char *short_name, const char *filter_name);
2914
2921WS_DLL_PUBLIC int
2922proto_register_protocol_and_group(const char* name, const char* short_name, const char* filter_name, protocol_group_t group);
2923
2938WS_DLL_PUBLIC int
2939proto_register_protocol_in_name_only(const char *name, const char *short_name, const char *filter_name,
2940 int parent_proto, enum ftenum field_type);
2941
2947bool
2948proto_deregister_protocol(const char *short_name);
2949
2954WS_DLL_PUBLIC void
2955proto_register_alias(const int proto_id, const char *alias_name);
2956
2961typedef void (*prefix_initializer_t)(const char* match);
2962
2970WS_DLL_PUBLIC void
2971proto_register_prefix(const char *prefix, prefix_initializer_t initializer);
2972
2974WS_DLL_PUBLIC void proto_initialize_all_prefixes(void);
2975
2980WS_DLL_PUBLIC void
2981proto_register_field_array(const int parent, hf_register_info *hf, const int num_records);
2982
2986WS_DLL_PUBLIC void
2987proto_deregister_field (const int parent, int hf_id);
2988
2991WS_DLL_PUBLIC void
2992proto_add_deregistered_data (void *data);
2993
2998WS_DLL_PUBLIC void
2999proto_deregister_all_fields_with_prefix(const int parent, const char *prefix);
3000
3004void
3005proto_add_deregistered_slice (size_t block_size, void *mem_block);
3006
3011WS_DLL_PUBLIC void
3012proto_free_field_strings (ftenum_t field_type, unsigned int field_display, const void *field_strings);
3013
3020WS_DLL_PUBLIC void
3022
3026WS_DLL_PUBLIC void
3027proto_register_subtree_array(int * const *indices, const int num_indices);
3028
3032WS_DLL_PUBLIC const char* proto_registrar_get_name(const int n);
3033
3037WS_DLL_PUBLIC const char* proto_registrar_get_abbrev(const int n);
3038
3042WS_DLL_PUBLIC header_field_info* proto_registrar_get_nth(unsigned hfindex);
3043
3047WS_DLL_PUBLIC header_field_info* proto_registrar_get_byname(const char *field_name);
3048
3052WS_DLL_PUBLIC header_field_info* proto_registrar_get_byalias(const char *alias_name);
3053
3057WS_DLL_PUBLIC int proto_registrar_get_id_byname(const char *field_name);
3058
3062WS_DLL_PUBLIC enum ftenum proto_registrar_get_ftype(const int n);
3063
3067WS_DLL_PUBLIC int proto_registrar_get_parent(const int n);
3068
3072WS_DLL_PUBLIC bool proto_registrar_is_protocol(const int n);
3073
3077WS_DLL_PUBLIC int proto_registrar_get_length(const int n);
3078
3087
3091WS_DLL_PUBLIC size_t proto_registrar_get_count(struct proto_registrar_stats *stats);
3092
3104WS_DLL_PUBLIC int proto_get_first_protocol(void **cookie);
3105
3113WS_DLL_PUBLIC int proto_get_data_protocol(void *cookie);
3114
3123WS_DLL_PUBLIC int proto_get_next_protocol(void **cookie);
3124
3136WS_DLL_PUBLIC header_field_info *proto_get_first_protocol_field(const int proto_id, void **cookie);
3137
3148WS_DLL_PUBLIC header_field_info *proto_get_next_protocol_field(const int proto_id, void **cookie);
3149
3153WS_DLL_PUBLIC bool proto_name_already_registered(const char *name);
3154
3158WS_DLL_PUBLIC int proto_get_id_by_filter_name(const char* filter_name);
3159
3163WS_DLL_PUBLIC int proto_get_id_by_short_name(const char* short_name);
3164
3168WS_DLL_PUBLIC bool proto_can_toggle_protocol(const int proto_id);
3169
3172WS_DLL_PUBLIC protocol_t *find_protocol_by_id(const int proto_id);
3173
3177WS_DLL_PUBLIC const char *proto_get_protocol_name(const int proto_id);
3178
3181WS_DLL_PUBLIC int proto_get_id(const protocol_t *protocol);
3182
3185WS_DLL_PUBLIC const char *proto_get_protocol_short_name(const protocol_t *protocol);
3186
3189WS_DLL_PUBLIC const char *proto_get_protocol_long_name(const protocol_t *protocol);
3190
3193WS_DLL_PUBLIC bool proto_is_protocol_enabled(const protocol_t *protocol);
3194
3197WS_DLL_PUBLIC bool proto_is_protocol_enabled_by_default(const protocol_t *protocol);
3198
3201WS_DLL_PUBLIC bool proto_is_pino(const protocol_t *protocol);
3202
3210extern bool proto_is_bytes_pino(const protocol_t *protocol);
3211
3215WS_DLL_PUBLIC const char *proto_get_protocol_filter_name(const int proto_id);
3216
3222extern void proto_add_heuristic_dissector(protocol_t *protocol, const char *short_name);
3223
3229WS_DLL_PUBLIC void proto_heuristic_dissector_foreach(const protocol_t *protocol, GFunc func,
3230 void *user_data);
3231
3249WS_DLL_PUBLIC void proto_get_frame_protocols(const wmem_list_t *layers,
3250 bool *is_ip, bool *is_tcp, bool *is_udp, bool *is_sctp,
3251 bool *is_tls, bool *is_rtp, bool *is_lte_rlc);
3252
3258WS_DLL_PUBLIC bool proto_is_frame_protocol(const wmem_list_t *layers, const char* proto_name);
3259
3264WS_DLL_PUBLIC char * proto_list_layers(const packet_info *pinfo);
3265
3273WS_DLL_PUBLIC uint8_t proto_get_layer_num(const packet_info *pinfo, const int proto_id);
3274
3277WS_DLL_PUBLIC void proto_disable_by_default(const int proto_id);
3278
3282WS_DLL_PUBLIC void proto_set_decoding(const int proto_id, const bool enabled);
3283
3285WS_DLL_PUBLIC void proto_disable_all(void);
3286
3288WS_DLL_PUBLIC void proto_reenable_all(void);
3289
3292WS_DLL_PUBLIC void proto_set_cant_toggle(const int proto_id);
3293
3299extern bool proto_check_for_protocol_or_field(const proto_tree* tree, const int id);
3300
3309WS_DLL_PUBLIC GPtrArray* proto_get_finfo_ptr_array(const proto_tree *tree, const int hfindex);
3310
3315WS_DLL_PUBLIC bool proto_tracking_interesting_fields(const proto_tree *tree);
3316
3326WS_DLL_PUBLIC GPtrArray* proto_find_finfo(proto_tree *tree, const int hfindex);
3327
3337WS_DLL_PUBLIC GPtrArray* proto_find_first_finfo(proto_tree *tree, const int hfindex);
3338
3346WS_DLL_PUBLIC GPtrArray* proto_all_finfos(proto_tree *tree);
3347
3349WS_DLL_PUBLIC void proto_registrar_dump_protocols(void);
3350
3352WS_DLL_PUBLIC void proto_registrar_dump_values(void);
3353
3355WS_DLL_PUBLIC void proto_registrar_dump_elastic(const char* filter);
3356
3359WS_DLL_PUBLIC bool proto_registrar_dump_fieldcount(void);
3360
3362WS_DLL_PUBLIC void proto_registrar_dump_fields(void);
3363
3372WS_DLL_PUBLIC bool proto_registrar_dump_field_completions(const char *prefix);
3373
3378WS_DLL_PUBLIC void proto_registrar_dump_ftypes(void);
3379
3387WS_DLL_PUBLIC const char *proto_field_display_to_string(int field_display);
3388
3392WS_DLL_PUBLIC int num_tree_types;
3393
3399WS_DLL_PUBLIC bool tree_expanded(int tree_type);
3400
3407WS_DLL_PUBLIC void tree_expanded_set(int tree_type, bool value);
3408
3417WS_DLL_PUBLIC int
3418hfinfo_bitshift(const header_field_info *hfinfo);
3419
3420struct epan_dissect;
3421
3426WS_DLL_PUBLIC bool
3427proto_can_match_selected(const field_info *finfo, struct epan_dissect *edt);
3428
3433WS_DLL_PUBLIC char*
3435
3441WS_DLL_PUBLIC field_info*
3442proto_find_field_from_offset(proto_tree *tree, unsigned offset, tvbuff_t *tvb);
3443
3448WS_DLL_PUBLIC char*
3449proto_find_undecoded_data(proto_tree *tree, unsigned length);
3450
3470WS_DLL_PUBLIC proto_item *
3471proto_tree_add_bitmask(proto_tree *tree, tvbuff_t *tvb, const unsigned offset,
3472 const int hf_hdr, const int ett, int * const *fields, const unsigned encoding);
3473
3496WS_DLL_PUBLIC proto_item *
3497proto_tree_add_bitmask_ret_uint64(proto_tree *tree, tvbuff_t *tvb, const unsigned offset,
3498 const int hf_hdr, const int ett, int * const *fields,
3499 const unsigned encoding, uint64_t *retval);
3500
3524WS_DLL_PUBLIC proto_item *
3525proto_tree_add_bitmask_with_flags(proto_tree *tree, tvbuff_t *tvb, const unsigned offset,
3526 const int hf_hdr, const int ett, int * const *fields, const unsigned encoding, const int flags);
3527
3554WS_DLL_PUBLIC proto_item *
3555proto_tree_add_bitmask_with_flags_ret_uint64(proto_tree *tree, tvbuff_t *tvb, const unsigned offset,
3556 const int hf_hdr, const int ett, int * const *fields,
3557 const unsigned encoding, const int flags, uint64_t *retval);
3558
3578WS_DLL_PUBLIC proto_item *
3579proto_tree_add_bitmask_value(proto_tree *tree, tvbuff_t *tvb, const unsigned offset,
3580 const int hf_hdr, const int ett, int * const *fields, const uint64_t value);
3581
3605WS_DLL_PUBLIC proto_item *
3606proto_tree_add_bitmask_value_with_flags(proto_tree *tree, tvbuff_t *tvb, const unsigned offset,
3607 const int hf_hdr, const int ett, int * const *fields, const uint64_t value, const int flags);
3608
3623WS_DLL_PUBLIC void
3624proto_tree_add_bitmask_list(proto_tree *tree, tvbuff_t *tvb, const unsigned offset,
3625 const unsigned len, int * const *fields, const unsigned encoding);
3626
3642WS_DLL_PUBLIC void
3643proto_tree_add_bitmask_list_ret_uint64(proto_tree *tree, tvbuff_t *tvb, const unsigned offset,
3644 const unsigned len, int * const *fields, const unsigned encoding, uint64_t *retval);
3645
3660WS_DLL_PUBLIC void
3661proto_tree_add_bitmask_list_value(proto_tree *tree, tvbuff_t *tvb, const unsigned offset,
3662 const unsigned len, int * const *fields, const uint64_t value);
3663
3664
3686WS_DLL_PUBLIC proto_item *
3687proto_tree_add_bitmask_len(proto_tree *tree, tvbuff_t *tvb, const unsigned offset, const unsigned len,
3688 const int hf_hdr, const int ett, int * const *fields, struct expert_field* exp, const unsigned encoding);
3689
3702WS_DLL_PUBLIC proto_item *
3703proto_tree_add_bitmask_text(proto_tree *tree, tvbuff_t *tvb, const unsigned offset, const unsigned len,
3704 const char *name, const char *fallback,
3705 const int ett, int * const *fields, const unsigned encoding, const int flags);
3706
3707#define BMT_NO_FLAGS 0x00
3708#define BMT_NO_APPEND 0x01
3709#define BMT_NO_INT 0x02
3710#define BMT_NO_FALSE 0x04
3711#define BMT_NO_TFS 0x08
3712
3722WS_DLL_PUBLIC proto_item *
3723proto_tree_add_bits_item(proto_tree *tree, const int hf_index, tvbuff_t *tvb, const unsigned bit_offset,
3724 const int no_of_bits, const unsigned encoding);
3725
3741WS_DLL_PUBLIC proto_item *
3742proto_tree_add_split_bits_item_ret_val(proto_tree *tree, const int hf_index, tvbuff_t *tvb,
3743 const unsigned bit_offset, const crumb_spec_t *crumb_spec, uint64_t *return_value);
3744
3758WS_DLL_PUBLIC void
3759proto_tree_add_split_bits_crumb(proto_tree *tree, const int hf_index, tvbuff_t *tvb,
3760 const unsigned bit_offset, const crumb_spec_t *crumb_spec, uint16_t crumb_index);
3761
3772WS_DLL_PUBLIC proto_item *
3773proto_tree_add_bits_ret_val(proto_tree *tree, const int hf_index, tvbuff_t *tvb,
3774 const unsigned bit_offset, const int no_of_bits, uint64_t *return_value, const unsigned encoding);
3775
3788WS_DLL_PUBLIC proto_item *
3789proto_tree_add_uint_bits_format_value(proto_tree *tree, const int hf_index, tvbuff_t *tvb,
3790 const unsigned bit_offset, const int no_of_bits, uint32_t value, const unsigned encoding,
3791 const char *format, ...)
3792 G_GNUC_PRINTF(8,9);
3793
3806WS_DLL_PUBLIC proto_item *
3807proto_tree_add_uint64_bits_format_value(proto_tree *tree, const int hf_index, tvbuff_t *tvb,
3808 const unsigned bit_offset, const int no_of_bits, uint64_t value, const unsigned encoding,
3809 const char *format, ...)
3810 G_GNUC_PRINTF(8,9);
3811
3825WS_DLL_PUBLIC proto_item *
3826proto_tree_add_boolean_bits_format_value(proto_tree *tree, const int hf_index, tvbuff_t *tvb,
3827 const unsigned bit_offset, const int no_of_bits, uint64_t value, const unsigned encoding,
3828 const char *format, ...)
3829 G_GNUC_PRINTF(8,9);
3830
3844WS_DLL_PUBLIC proto_item *
3845proto_tree_add_int_bits_format_value(proto_tree *tree, const int hf_index, tvbuff_t *tvb,
3846 const unsigned bit_offset, const int no_of_bits, int32_t value, const unsigned encoding,
3847 const char *format, ...)
3848 G_GNUC_PRINTF(8,9);
3849
3863WS_DLL_PUBLIC proto_item *
3864proto_tree_add_int64_bits_format_value(proto_tree *tree, const int hf_index, tvbuff_t *tvb,
3865 const unsigned bit_offset, const int no_of_bits, int64_t value, const unsigned encoding,
3866 const char *format, ...)
3867 G_GNUC_PRINTF(8,9);
3868
3882WS_DLL_PUBLIC proto_item *
3883proto_tree_add_float_bits_format_value(proto_tree *tree, const int hf_index, tvbuff_t *tvb,
3884 const unsigned bit_offset, const int no_of_bits, float value, const unsigned encoding,
3885 const char *format, ...)
3886 G_GNUC_PRINTF(8,9);
3887
3888
3897WS_DLL_PUBLIC proto_item *
3898proto_tree_add_ts_23_038_7bits_packed_item(proto_tree *tree, const int hfindex, tvbuff_t *tvb,
3899 const unsigned bit_offset, const int no_of_chars);
3900
3908WS_DLL_PUBLIC proto_item *
3909proto_tree_add_ascii_7bits_item(proto_tree *tree, const int hfindex, tvbuff_t *tvb,
3910 const unsigned bit_offset, const int no_of_chars);
3911
3926WS_DLL_PUBLIC proto_item *
3927proto_tree_add_checksum(proto_tree *tree, tvbuff_t *tvb, const unsigned offset,
3928 const int hf_checksum, const int hf_checksum_status, struct expert_field* bad_checksum_expert,
3929 packet_info *pinfo, uint32_t computed_checksum, const unsigned encoding, const unsigned flags);
3930
3945WS_DLL_PUBLIC proto_item*
3946proto_tree_add_checksum_bytes(proto_tree *tree, tvbuff_t *tvb, const unsigned offset,
3947 const int hf_checksum, const int hf_checksum_status, struct expert_field* bad_checksum_expert,
3948 packet_info *pinfo, const uint8_t *computed_checksum, size_t checksum_len, const unsigned flags);
3949
3961
3962#define PROTO_CHECKSUM_NO_FLAGS 0x00
3963#define PROTO_CHECKSUM_VERIFY 0x01
3964#define PROTO_CHECKSUM_GENERATED 0x02
3965#define PROTO_CHECKSUM_IN_CKSUM 0x04
3966#define PROTO_CHECKSUM_ZERO 0x08
3967#define PROTO_CHECKSUM_NOT_PRESENT 0x10
3968
3969WS_DLL_PUBLIC const value_string proto_checksum_vals[];
3970
3977WS_DLL_PUBLIC unsigned char
3978proto_check_field_name(const char *field_name);
3979
3984WS_DLL_PUBLIC unsigned char
3985proto_check_field_name_lower(const char *field_name);
3986
3987
3997const char *
3998proto_custom_set(proto_tree* tree, GSList *field_id,
3999 int occurrence,
4000 bool display_details,
4001 char *result,
4002 char *expr, const int size );
4003
4012char *
4013proto_custom_get_filter(struct epan_dissect *edt, GSList *field_id, int occurrence);
4014
4015#ifdef __cplusplus
4016}
4017#endif /* __cplusplus */
4018
4019/*
4020 * Editor modelines - https://www.wireshark.org/tools/modelines.html
4021 *
4022 * Local variables:
4023 * c-basic-offset: 4
4024 * tab-width: 8
4025 * indent-tabs-mode: nil
4026 * End:
4027 *
4028 * vi: set shiftwidth=4 tabstop=8 expandtab:
4029 * :indentSize=4:tabSize=8:noTabs=true:
4030 */
enum ftenum ftenum_t
Convenience typedef for ftenum.
Definition ftypes.h:190
ftenum
Fundamental field value types used throughout the Wireshark dissector framework.
Definition ftypes.h:26
struct _packet_info packet_info
Represents the metadata and indexing information for a single captured frame.
WS_DLL_PUBLIC bool proto_registrar_dump_fieldcount(void)
Definition proto.c:12410
WS_DLL_PUBLIC unsigned char proto_check_field_name_lower(const char *field_name)
WS_DLL_PUBLIC proto_item * proto_tree_add_bitmask_value(proto_tree *tree, tvbuff_t *tvb, const unsigned offset, const int hf_hdr, const int ett, int *const *fields, const uint64_t value)
Definition proto.c:13508
#define ITEM_LABEL_LENGTH
Definition proto.h:48
WS_DLL_PUBLIC const char * proto_get_protocol_name(const int proto_id)
Definition proto.c:8917
proto_item * proto_tree_add_time_format_value(proto_tree *tree, int hfindex, tvbuff_t *tvb, unsigned start, unsigned length, nstime_t *value_ptr, const char *format,...)
Definition proto.c:5118
proto_item * proto_tree_add_item_ret_ether(proto_tree *tree, int hfindex, tvbuff_t *tvb, const unsigned start, unsigned length, const unsigned encoding, uint8_t *retval)
Parse an ethernet address from the buffer and add it to the tree, writing the value to the pointer sp...
Definition proto.c:4222
WS_DLL_PUBLIC void proto_get_frame_protocols(const wmem_list_t *layers, bool *is_ip, bool *is_tcp, bool *is_udp, bool *is_sctp, bool *is_tls, bool *is_rtp, bool *is_lte_rlc)
Definition proto.c:8978
WS_DLL_PUBLIC bool proto_is_protocol_enabled(const protocol_t *protocol)
Definition proto.c:9115
struct _item_label_t item_label_t
void proto_tree_set_appendix(proto_tree *tree, tvbuff_t *tvb, unsigned start, const unsigned length)
Definition proto.c:8528
proto_item * proto_tree_add_guid_format(proto_tree *tree, int hfindex, tvbuff_t *tvb, unsigned start, unsigned length, const e_guid_t *value_ptr, const char *format,...)
Definition proto.c:5427
WS_DLL_PUBLIC void proto_tree_add_split_bits_crumb(proto_tree *tree, const int hf_index, tvbuff_t *tvb, const unsigned bit_offset, const crumb_spec_t *crumb_spec, uint16_t crumb_index)
Definition proto.c:14026
proto_item * proto_tree_add_time_item(proto_tree *tree, int hfindex, tvbuff_t *tvb, const unsigned start, const unsigned length, const unsigned encoding, nstime_t *retval, unsigned *endoff, int *err)
Definition proto.c:4803
#define FI_URL
Definition proto.h:893
size_t value_pos
Definition proto.h:842
WS_DLL_PUBLIC bool proto_field_is_referenced(proto_tree *tree, int proto_id)
Definition proto.c:1007
proto_item * proto_tree_add_item_ret_time_string(proto_tree *tree, int hfindex, tvbuff_t *tvb, const unsigned start, int length, const unsigned encoding, wmem_allocator_t *scope, char **retval)
Definition proto.c:4472
void proto_register_subtree_array(int *const *indices, const int num_indices)
Definition proto.c:10311
WS_DLL_PUBLIC proto_item * proto_tree_add_bits_item(proto_tree *tree, const int hf_index, tvbuff_t *tvb, const unsigned bit_offset, const int no_of_bits, const unsigned encoding)
Definition proto.c:13671
WS_DLL_PUBLIC bool tree_expanded(int tree_type)
Return whether subtrees of a given type are currently expanded.
uint64_t bitmask
Definition proto.h:808
proto_tree * proto_tree_add_subtree_format(proto_tree *tree, tvbuff_t *tvb, unsigned start, int length, int idx, proto_item **tree_item, const char *format,...)
Definition proto.c:1572
struct _protocol protocol_t
Definition proto.h:100
proto_item * proto_tree_add_item_ret_ipv6(proto_tree *tree, int hfindex, tvbuff_t *tvb, const unsigned start, unsigned length, const unsigned encoding, ws_in6_addr *addr)
Parse an ipv6 address from the buffer and add it to the tree, writing the value to the pointer specif...
Definition proto.c:4183
WS_DLL_PUBLIC proto_item * proto_tree_add_bits_ret_val(proto_tree *tree, const int hf_index, tvbuff_t *tvb, const unsigned bit_offset, const int no_of_bits, uint64_t *return_value, const unsigned encoding)
Definition proto.c:14052
WS_DLL_PUBLIC proto_item * proto_tree_add_split_bits_item_ret_val(proto_tree *tree, const int hf_index, tvbuff_t *tvb, const unsigned bit_offset, const crumb_spec_t *crumb_spec, uint64_t *return_value)
Definition proto.c:13848
WS_DLL_PUBLIC char * proto_list_layers(const packet_info *pinfo)
Definition proto.c:9043
void proto_deregister_field(const int parent, int hf_id)
Definition proto.c:9285
proto_item * proto_tree_add_uint64_format(proto_tree *tree, int hfindex, tvbuff_t *tvb, unsigned start, unsigned length, uint64_t value, const char *format,...)
Definition proto.c:6191
WS_DLL_PUBLIC void proto_tree_add_bitmask_list_ret_uint64(proto_tree *tree, tvbuff_t *tvb, const unsigned offset, const unsigned len, int *const *fields, const unsigned encoding, uint64_t *retval)
Definition proto.c:13558
void proto_add_deregistered_slice(size_t block_size, void *mem_block)
Definition proto.c:9348
proto_item * proto_tree_add_double(proto_tree *tree, int hfindex, tvbuff_t *tvb, unsigned start, unsigned length, double value)
Definition proto.c:5986
WS_DLL_PUBLIC header_field_info * proto_get_first_protocol_field(const int proto_id, void **cookie)
Begin iterating over all header fields registered to a protocol.
Definition proto.c:8831
int same_name_prev_id
Definition proto.h:815
WS_DLL_PUBLIC int proto_get_id_by_short_name(const char *short_name)
Definition proto.c:8903
proto_item * proto_tree_add_ipv4_format_value(proto_tree *tree, int hfindex, tvbuff_t *tvb, unsigned start, unsigned length, ws_in4_addr value, const char *format,...)
Definition proto.c:5250
proto_item * proto_tree_add_checksum(proto_tree *tree, tvbuff_t *tvb, const unsigned offset, const int hf_checksum, const int hf_checksum_status, struct expert_field *bad_checksum_expert, packet_info *pinfo, uint32_t computed_checksum, const unsigned encoding, const unsigned flags)
Definition proto.c:14449
WS_DLL_PUBLIC int proto_get_next_protocol(void **cookie)
Advance the protocol iterator and return the next protocol ID.
Definition proto.c:8817
proto_item * proto_tree_add_bytes_item(proto_tree *tree, int hfindex, tvbuff_t *tvb, const unsigned start, unsigned length, const unsigned encoding, GByteArray *retval, unsigned *endoff, int *err)
Definition proto.c:4661
WS_DLL_PUBLIC bool proto_is_pino(const protocol_t *protocol)
Definition proto.c:9079
proto_item * proto_tree_add_ether(proto_tree *tree, int hfindex, tvbuff_t *tvb, unsigned start, unsigned length, const uint8_t *value)
Definition proto.c:5689
proto_item * proto_tree_add_guid(proto_tree *tree, int hfindex, tvbuff_t *tvb, unsigned start, unsigned length, const e_guid_t *value_ptr)
Definition proto.c:5389
WS_DLL_PUBLIC int proto_get_data_protocol(void *cookie)
Return the protocol ID stored in the current iterator position.
Definition proto.c:8808
proto_item * proto_tree_add_text_valist_internal(proto_tree *tree, tvbuff_t *tvb, unsigned start, unsigned length, const char *format, va_list ap)
Definition proto.c:1536
proto_item * proto_tree_add_int_bits_format_value(proto_tree *tree, const int hfindex, tvbuff_t *tvb, const unsigned bit_offset, const int no_of_bits, int32_t value, const unsigned encoding, const char *format,...)
Definition proto.c:14293
proto_item * proto_tree_add_none_format(proto_tree *tree, const int hfindex, tvbuff_t *tvb, const unsigned start, int length, const char *format,...)
Definition proto.c:4873
tvbuff_t * ds_tvb
Definition proto.h:856
proto_item * proto_tree_add_uint_format(proto_tree *tree, int hfindex, tvbuff_t *tvb, unsigned start, unsigned length, uint32_t value, const char *format,...)
Definition proto.c:6099
proto_item * proto_tree_add_item_ret_boolean(proto_tree *tree, int hfindex, tvbuff_t *tvb, const unsigned start, unsigned length, const unsigned encoding, bool *retval)
Add an FT_BOOLEAN item to the protocol tree and return its value.
Definition proto.c:4000
proto_item * proto_tree_add_item_ret_double(proto_tree *tree, int hfindex, tvbuff_t *tvb, const unsigned start, unsigned length, const unsigned encoding, double *retval)
Parse a double from the buffer and add it to the tree, returning the item added and the parsed value ...
Definition proto.c:4091
proto_item * proto_tree_add_string_format(proto_tree *tree, int hfindex, tvbuff_t *tvb, unsigned start, int length, const char *value, const char *format,...)
Definition proto.c:5627
const char * proto_registrar_get_name(const int n)
Definition proto.c:11796
proto_item * proto_tree_add_boolean_format_value(proto_tree *tree, int hfindex, tvbuff_t *tvb, unsigned start, unsigned length, uint64_t value, const char *format,...)
Definition proto.c:5779
void(* register_handoff)(void)
Routine to call to register dissector handoff.
Definition proto.h:1159
WS_DLL_PUBLIC void proto_registrar_dump_elastic(const char *filter)
Definition proto.c:12511
proto_item * proto_tree_add_text_internal(proto_tree *tree, tvbuff_t *tvb, unsigned start, unsigned length, const char *format,...)
Definition proto.c:1510
WS_DLL_PUBLIC void proto_set_decoding(const int proto_id, const bool enabled)
Definition proto.c:9165
WS_DLL_PUBLIC bool proto_name_already_registered(const char *name)
Definition proto.c:8879
void proto_register_field_array(const int parent, hf_register_info *hf, const int num_records)
Definition proto.c:9243
WS_DLL_PUBLIC GPtrArray * proto_find_first_finfo(proto_tree *tree, const int hfindex)
Definition proto.c:11992
int proto_registrar_get_length(const int n)
Definition proto.c:11845
WS_DLL_PUBLIC const char * proto_get_protocol_filter_name(const int proto_id)
Definition proto.c:8945
void(* proto_tree_foreach_func)(proto_node *node, void *data)
Callback type for proto_tree_children_foreach().
Definition proto.h:1127
hf_ref_type
Enum for specifying whether a field is referenced by a filter, and if so, how.
Definition proto.h:787
proto_item * proto_tree_add_item_ret_int(proto_tree *tree, int hfindex, tvbuff_t *tvb, const unsigned start, unsigned length, const unsigned encoding, int32_t *retval)
Definition proto.c:3408
WS_DLL_PUBLIC const char * proto_get_protocol_long_name(const protocol_t *protocol)
Definition proto.c:8937
WS_DLL_PUBLIC void proto_tree_children_foreach(proto_tree *tree, proto_tree_foreach_func func, void *data)
Invoke a callback for each direct child of a proto_tree node.
Definition proto.c:870
enum ftenum proto_registrar_get_ftype(const int n)
Definition proto.c:11814
proto_item * proto_tree_add_int_format(proto_tree *tree, int hfindex, tvbuff_t *tvb, unsigned start, unsigned length, int32_t value, const char *format,...)
Definition proto.c:6282
#define FI_RESET_FLAG(fi, flag)
Definition proto.h:916
WS_DLL_PUBLIC void proto_tree_add_bitmask_list_value(proto_tree *tree, tvbuff_t *tvb, const unsigned offset, const unsigned len, int *const *fields, const uint64_t value)
Definition proto.c:13574
void proto_initialize_all_prefixes(void)
Definition proto.c:1106
int proto_layer_num
Definition proto.h:859
WS_DLL_PUBLIC int hfinfo_bitshift(const header_field_info *hfinfo)
Return the number of bits to right-shift a field's bitmask to obtain its least-significant bit positi...
Definition proto.c:11356
proto_item * proto_tree_add_double_format_value(proto_tree *tree, int hfindex, tvbuff_t *tvb, unsigned start, unsigned length, double value, const char *format,...)
Definition proto.c:6005
proto_item * proto_tree_add_int64_format(proto_tree *tree, int hfindex, tvbuff_t *tvb, unsigned start, unsigned length, int64_t value, const char *format,...)
Definition proto.c:6405
proto_item * proto_tree_add_uint_format_value(proto_tree *tree, int hfindex, tvbuff_t *tvb, unsigned start, unsigned length, uint32_t value, const char *format,...)
Definition proto.c:6081
WS_DLL_PUBLIC proto_item * proto_item_get_parent(const proto_item *pi)
Definition proto.c:8431
int proto_registrar_get_id_byname(const char *field_name)
Definition proto.c:1193
proto_item * proto_tree_add_float_format(proto_tree *tree, int hfindex, tvbuff_t *tvb, unsigned start, unsigned length, float value, const char *format,...)
Definition proto.c:5958
int display
Definition proto.h:803
proto_item * proto_tree_add_ts_23_038_7bits_packed_item(proto_tree *tree, const int hfindex, tvbuff_t *tvb, const unsigned bit_offset, const int no_of_chars)
Definition proto.c:14381
header_field_info * proto_registrar_get_byalias(const char *alias_name)
Definition proto.c:1162
struct _mac_hf_list_t mac_hf_list_t
proto_checksum_enum_e
Checksum verification result for a protocol field.
Definition proto.h:3954
WS_DLL_PUBLIC GPtrArray * proto_all_finfos(proto_tree *tree)
Definition proto.c:12022
proto_item * proto_tree_add_oid_format(proto_tree *tree, int hfindex, tvbuff_t *tvb, unsigned start, unsigned length, const uint8_t *value_ptr, const char *format,...)
Definition proto.c:5504
WS_DLL_PUBLIC void proto_execute_in_directory(const char *dir, proto_execute_in_directory_func func, void *param)
Definition proto.c:831
proto_item * proto_tree_add_time(proto_tree *tree, int hfindex, tvbuff_t *tvb, unsigned start, unsigned length, const nstime_t *value_ptr)
Definition proto.c:5099
proto_item * proto_tree_add_format_wsp_text(proto_tree *tree, tvbuff_t *tvb, unsigned start, unsigned length)
Definition proto.c:1638
WS_DLL_PUBLIC size_t proto_registrar_get_count(struct proto_registrar_stats *stats)
Definition proto.c:11854
void proto_item_fill_label(const field_info *fi, char *label_str, size_t *value_pos)
Definition proto.c:10477
WS_DLL_PUBLIC void proto_heuristic_dissector_foreach(const protocol_t *protocol, GFunc func, void *user_data)
Definition proto.c:8969
int total_layer_num
Definition proto.h:858
proto_tree * proto_tree_get_parent_tree(proto_tree *tree)
Definition proto.c:8458
int proto_register_protocol_in_name_only(const char *name, const char *short_name, const char *filter_name, int parent_proto, enum ftenum field_type)
Definition proto.c:8677
struct _proto_node proto_node
proto_item * proto_tree_add_ipv6_format(proto_tree *tree, int hfindex, tvbuff_t *tvb, unsigned start, unsigned length, const ws_in6_addr *value_ptr, const char *format,...)
Definition proto.c:5336
WS_DLL_PUBLIC char * proto_construct_match_selected_string(const field_info *finfo, struct epan_dissect *edt)
Definition proto.c:13021
WS_DLL_PUBLIC const char * proto_get_protocol_short_name(const protocol_t *protocol)
Definition proto.c:8929
proto_item * proto_tree_add_item_ret_uint32(proto_tree *tree, int hfindex, tvbuff_t *tvb, const unsigned start, unsigned length, const unsigned encoding, uint32_t *retval)
Add an FT_UINT32 item to the protocol tree and return its value.
Definition proto.c:3543
WS_DLL_PUBLIC char * proto_find_undecoded_data(proto_tree *tree, unsigned length)
Definition proto.c:12108
void proto_pre_init(void)
Pre-initialise the proto subsystem memory structures.
Definition proto.c:589
int proto_item_fill_display_label(const field_info *finfo, char *display_label_str, const int label_str_size)
Definition proto.c:7366
WS_DLL_PUBLIC bool proto_is_protocol_enabled_by_default(const protocol_t *protocol)
Definition proto.c:9129
WS_DLL_PUBLIC field_info * proto_find_field_from_offset(proto_tree *tree, unsigned offset, tvbuff_t *tvb)
Definition proto.c:12069
proto_item * proto_tree_add_item_ret_string(proto_tree *tree, int hfindex, tvbuff_t *tvb, const unsigned start, int length, const unsigned encoding, wmem_allocator_t *scope, const uint8_t **retval)
Definition proto.c:4332
void(* register_protoinfo)(void)
Routine to call to register protocol information.
Definition proto.h:1154
WS_DLL_PUBLIC void proto_registrar_dump_values(void)
Definition proto.c:12195
void proto_item_set_len(proto_item *pi, const unsigned length)
Definition proto.c:8209
proto_item * proto_tree_add_int64_format_value(proto_tree *tree, int hfindex, tvbuff_t *tvb, unsigned start, unsigned length, int64_t value, const char *format,...)
Definition proto.c:6359
WS_DLL_PUBLIC proto_item * proto_tree_add_bitmask_len(proto_tree *tree, tvbuff_t *tvb, const unsigned offset, const unsigned len, const int hf_hdr, const int ett, int *const *fields, struct expert_field *exp, const unsigned encoding)
Definition proto.c:13596
WS_DLL_PUBLIC void tree_expanded_set(int tree_type, bool value)
Set the expansion state for subtrees of a given type.
proto_item * proto_tree_add_item_new_ret_length(proto_tree *tree, header_field_info *hfinfo, tvbuff_t *tvb, const unsigned start, int length, const unsigned encoding, unsigned *lenretval)
Definition proto.c:4590
proto_item * proto_tree_add_boolean(proto_tree *tree, int hfindex, tvbuff_t *tvb, unsigned start, unsigned length, uint64_t value)
Definition proto.c:5760
unsigned crumb_bit_offset
Definition proto.h:874
void proto_item_set_bits_offset_len(proto_item *ti, int bits_offset, int bits_len)
Definition proto.c:8279
#define FI_GET_FLAG(fi, flag)
Definition proto.h:908
WS_DLL_PUBLIC uint8_t proto_get_layer_num(const packet_info *pinfo, const int proto_id)
Definition proto.c:9066
proto_node proto_item
Definition proto.h:952
proto_item * proto_tree_add_bytes_format_value(proto_tree *tree, int hfindex, tvbuff_t *tvb, unsigned start, int length, const uint8_t *start_ptr, const char *format,...)
Definition proto.c:5030
const void * strings
Definition proto.h:804
proto_item * proto_tree_add_uint64_bits_format_value(proto_tree *tree, const int hfindex, tvbuff_t *tvb, const unsigned bit_offset, const int no_of_bits, uint64_t value, const unsigned encoding, const char *format,...)
Definition proto.c:14238
proto_item * proto_tree_add_item_ret_uint64(proto_tree *tree, int hfindex, tvbuff_t *tvb, const unsigned start, unsigned length, const unsigned encoding, uint64_t *retval)
Add an FT_UINT64 item to the protocol tree and return its value.
Definition proto.c:3801
int proto_registrar_get_parent(const int n)
Definition proto.c:11823
proto_item * proto_tree_add_ipxnet(proto_tree *tree, int hfindex, tvbuff_t *tvb, unsigned start, unsigned length, uint32_t value)
Definition proto.c:5166
proto_item * proto_tree_add_uint64_format_value(proto_tree *tree, int hfindex, tvbuff_t *tvb, unsigned start, unsigned length, uint64_t value, const char *format,...)
Definition proto.c:6173
WS_DLL_PUBLIC int proto_get_group(const protocol_t *protocol)
Definition proto.c:9085
WS_DLL_PUBLIC header_field_info * proto_get_next_protocol_field(const int proto_id, void **cookie)
Advance the field iterator and return the next header field.
Definition proto.c:8843
WS_DLL_PUBLIC proto_tree * proto_item_add_subtree(proto_item *pi, const int idx) G_GNUC_WARN_UNUSED_RESULT
Definition proto.c:8401
unsigned appendix_length
Definition proto.h:852
proto_item * proto_tree_add_item_new(proto_tree *tree, header_field_info *hfinfo, tvbuff_t *tvb, const unsigned start, int length, const unsigned encoding)
Definition proto.c:4555
int proto_register_protocol_and_group(const char *name, const char *short_name, const char *filter_name, protocol_group_t group)
Definition proto.c:8603
proto_item * proto_tree_add_time_format(proto_tree *tree, int hfindex, tvbuff_t *tvb, unsigned start, unsigned length, nstime_t *value_ptr, const char *format,...)
Definition proto.c:5136
header_field_info * proto_registrar_get_nth(unsigned hfindex)
Definition proto.c:1031
void(* proto_execute_in_directory_func)(void *param)
Callback type for a function executed within a specific directory context.
Definition proto.h:1215
#define FI_HIDDEN
Definition proto.h:888
proto_item * proto_tree_add_int64_bits_format_value(proto_tree *tree, const int hfindex, tvbuff_t *tvb, const unsigned bit_offset, const int no_of_bits, int64_t value, const unsigned encoding, const char *format,...)
Definition proto.c:14326
WS_DLL_PUBLIC proto_item * proto_item_get_parent_nth(proto_item *pi, int gen)
Definition proto.c:8438
proto_item * proto_tree_add_item_ret_ipv4(proto_tree *tree, int hfindex, tvbuff_t *tvb, const unsigned start, unsigned length, const unsigned encoding, ws_in4_addr *retval)
Add an FT_IPv4 item to the protocol tree and return its value.
Definition proto.c:4130
uint32_t flags
Definition proto.h:854
WS_DLL_PUBLIC unsigned char proto_check_field_name(const char *field_name)
Check if a given string is a valid protocol field name.
WS_DLL_PUBLIC proto_item * proto_tree_add_debug_text(proto_tree *tree, const char *format,...)
Definition proto.c:1598
proto_item * proto_tree_add_uint(proto_tree *tree, int hfindex, tvbuff_t *tvb, unsigned start, unsigned length, uint32_t value)
Definition proto.c:6051
void proto_item_prepend_text(proto_item *pi, const char *format,...)
Definition proto.c:8132
proto_tree * proto_tree_add_subtree(proto_tree *tree, tvbuff_t *tvb, unsigned start, int length, int idx, proto_item **tree_item, const char *text)
Definition proto.c:1564
proto_item * proto_tree_add_guid_format_value(proto_tree *tree, int hfindex, tvbuff_t *tvb, unsigned start, unsigned length, const e_guid_t *value_ptr, const char *format,...)
Definition proto.c:5408
proto_item * proto_tree_add_item_ret_display_string_and_length(proto_tree *tree, int hfindex, tvbuff_t *tvb, const unsigned start, int length, const unsigned encoding, wmem_allocator_t *scope, char **retval, unsigned *lenretval)
Definition proto.c:4343
proto_item * proto_tree_add_item_ret_length(proto_tree *tree, int hfindex, tvbuff_t *tvb, const unsigned start, int length, const unsigned encoding, unsigned *lenretval)
Add an item to a protocol tree and return the length of the parsed field.
Definition proto.c:4635
const header_field_info * hfinfo
Definition proto.h:848
WS_DLL_PUBLIC GPtrArray * proto_get_finfo_ptr_array(const proto_tree *tree, const int hfindex)
Definition proto.c:11902
proto_item * proto_tree_add_ipv4_format(proto_tree *tree, int hfindex, tvbuff_t *tvb, unsigned start, unsigned length, ws_in4_addr value, const char *format,...)
Definition proto.c:5268
unsigned start
Definition proto.h:849
proto_item * proto_tree_add_boolean_format(proto_tree *tree, int hfindex, tvbuff_t *tvb, unsigned start, unsigned length, uint64_t value, const char *format,...)
Definition proto.c:5797
void proto_tree_set_fake_protocols(proto_tree *tree, bool fake_protocols)
Definition proto.c:993
proto_item * proto_tree_add_oid_format_value(proto_tree *tree, int hfindex, tvbuff_t *tvb, unsigned start, unsigned length, const uint8_t *value_ptr, const char *format,...)
Definition proto.c:5485
WS_DLL_PUBLIC proto_item * proto_tree_add_bitmask_with_flags_ret_uint64(proto_tree *tree, tvbuff_t *tvb, const unsigned offset, const int hf_hdr, const int ett, int *const *fields, const unsigned encoding, const int flags, uint64_t *retval)
Definition proto.c:13448
protocol_group_t
Definition proto.h:110
bool proto_deregister_protocol(const char *short_name)
Definition proto.c:8736
WS_DLL_PUBLIC bool proto_is_frame_protocol(const wmem_list_t *layers, const char *proto_name)
Definition proto.c:9018
size_t protocol_count
Definition proto.h:3083
const char * name
Definition proto.h:800
void proto_add_deregistered_data(void *data)
Definition proto.c:9342
field_display_e
Enum for specifying the display format of a field.
Definition proto.h:711
void proto_item_set_end(proto_item *pi, tvbuff_t *tvb, unsigned end)
Definition proto.c:8231
proto_item * proto_tree_add_ipxnet_format(proto_tree *tree, int hfindex, tvbuff_t *tvb, unsigned start, unsigned length, uint32_t value, const char *format,...)
Definition proto.c:5203
proto_item * proto_tree_add_item_ret_string_and_length(proto_tree *tree, int hfindex, tvbuff_t *tvb, const unsigned start, int length, const unsigned encoding, wmem_allocator_t *scope, const uint8_t **retval, unsigned *lenretval)
Definition proto.c:4261
proto_item * proto_tree_add_item_ret_uint8(proto_tree *tree, int hfindex, tvbuff_t *tvb, const unsigned start, unsigned length, const unsigned encoding, uint8_t *retval)
Add an FT_UINT8 item to the protocol tree and return its value.
Definition proto.c:3551
const char * proto_registrar_get_abbrev(const int n)
Definition proto.c:11805
void(* prefix_initializer_t)(const char *match)
Definition proto.h:2961
proto_item * proto_tree_add_bytes_format(proto_tree *tree, int hfindex, tvbuff_t *tvb, unsigned start, int length, const uint8_t *start_ptr, const char *format,...)
Definition proto.c:5050
proto_item * proto_tree_add_int(proto_tree *tree, int hfindex, tvbuff_t *tvb, unsigned start, unsigned length, int32_t value)
Definition proto.c:6236
item_label_t * rep
Definition proto.h:855
WS_DLL_PUBLIC proto_item * proto_tree_add_uint_bits_format_value(proto_tree *tree, const int hf_index, tvbuff_t *tvb, const unsigned bit_offset, const int no_of_bits, uint32_t value, const unsigned encoding, const char *format,...)
Definition proto.c:14205
bool proto_tree_set_visible(proto_tree *tree, bool visible)
Definition proto.c:983
proto_item * proto_tree_add_ipv6(proto_tree *tree, int hfindex, tvbuff_t *tvb, unsigned start, unsigned length, const ws_in6_addr *value)
Definition proto.c:5298
proto_item * proto_tree_add_float_format_value(proto_tree *tree, int hfindex, tvbuff_t *tvb, unsigned start, unsigned length, float value, const char *format,...)
Definition proto.c:5940
int * p_id
Definition proto.h:835
size_t value_len
Definition proto.h:843
void proto_cleanup(void)
Release all memory allocated by the proto subsystem.
Definition proto.c:786
proto_item * proto_tree_add_protocol_format(proto_tree *tree, int hfindex, tvbuff_t *tvb, unsigned start, int length, const char *format,...)
Definition proto.c:4933
proto_item * proto_tree_add_item_ret_display_string(proto_tree *tree, int hfindex, tvbuff_t *tvb, const unsigned start, int length, const unsigned encoding, wmem_allocator_t *scope, char **retval)
Definition proto.c:4459
WS_DLL_PUBLIC int proto_get_id_by_filter_name(const char *filter_name)
Definition proto.c:8889
WS_DLL_PUBLIC WS_NORETURN void proto_report_dissector_bug(const char *format,...)
Definition proto.c:1659
bool(* proto_tree_traverse_func)(proto_node *node, void *data)
Callback type for depth-first proto_tree traversal functions.
Definition proto.h:1135
void proto_add_heuristic_dissector(protocol_t *protocol, const char *short_name)
Definition proto.c:8955
WS_DLL_PUBLIC proto_tree * proto_item_get_subtree(proto_item *pi)
Definition proto.c:8419
void proto_tree_free(proto_tree *tree)
Free a protocol tree and all of its nodes.
Definition proto.c:957
hf_ref_type ref_type
Definition proto.h:814
WS_DLL_PUBLIC void proto_registrar_dump_fields(void)
Definition proto.c:12671
WS_DLL_PUBLIC int proto_get_first_protocol(void **cookie)
Begin iterating over all registered protocols.
Definition proto.c:8796
WS_DLL_PUBLIC proto_item * proto_tree_add_bitmask(proto_tree *tree, tvbuff_t *tvb, const unsigned offset, const int hf_hdr, const int ett, int *const *fields, const unsigned encoding)
Definition proto.c:13436
proto_item * proto_tree_add_item_ret_int64(proto_tree *tree, int hfindex, tvbuff_t *tvb, const unsigned start, unsigned length, const unsigned encoding, int64_t *retval)
Add an FT_INT64 item to the protocol tree and return its value.
Definition proto.c:3866
WS_DLL_PUBLIC proto_item * proto_tree_add_bitmask_value_with_flags(proto_tree *tree, tvbuff_t *tvb, const unsigned offset, const int hf_hdr, const int ett, int *const *fields, const uint64_t value, const int flags)
Definition proto.c:13517
void proto_tree_move_item(proto_tree *tree, proto_item *fixed_item, proto_item *item_to_move)
Definition proto.c:8481
proto_item * proto_tree_add_ascii_7bits_item(proto_tree *tree, const int hfindex, tvbuff_t *tvb, const unsigned bit_offset, const int no_of_chars)
Definition proto.c:14409
char * proto_item_get_display_repr(wmem_allocator_t *scope, proto_item *pi)
Definition proto.c:8288
WS_DLL_PUBLIC bool proto_can_match_selected(const field_info *finfo, struct epan_dissect *edt)
Definition proto.c:13009
WS_DLL_PUBLIC GPtrArray * proto_find_finfo(proto_tree *tree, const int hfindex)
Definition proto.c:11973
int parent
Definition proto.h:813
WS_DLL_PUBLIC void proto_disable_by_default(const int proto_id)
Definition proto.c:9153
void proto_init(GSList *register_all_plugin_protocols_list, GSList *register_all_plugin_handoffs_list, register_entity_func register_func, register_entity_func handoff_func, register_cb cb, void *client_data)
Initialise the proto subsystem and run all registration callbacks.
Definition proto.c:616
WS_DLL_PUBLIC void proto_item_set_text(proto_item *pi, const char *format,...)
Definition proto.c:8051
proto_item * proto_tree_add_item_ret_uint(proto_tree *tree, int hfindex, tvbuff_t *tvb, const unsigned start, unsigned length, const unsigned encoding, uint32_t *retval)
Add an FT_UINT32 (or compatible uint) item to the protocol tree and return its value as a uint32_t.
Definition proto.c:3473
struct _header_field_info header_field_info
Definition proto.h:795
unsigned proto_item_get_len(const proto_item *pi)
Definition proto.c:8256
proto_item * proto_tree_add_ether_format(proto_tree *tree, int hfindex, tvbuff_t *tvb, unsigned start, unsigned length, const uint8_t *value, const char *format,...)
Definition proto.c:5726
void proto_deregister_all_fields_with_prefix(const int parent, const char *prefix)
Definition proto.c:9316
proto_item * proto_tree_get_parent(proto_tree *tree)
Definition proto.c:8451
proto_item * proto_tree_add_ether_format_value(proto_tree *tree, int hfindex, tvbuff_t *tvb, unsigned start, unsigned length, const uint8_t *value, const char *format,...)
Definition proto.c:5708
WS_DLL_PUBLIC void proto_register_plugin(const proto_plugin *plugin)
Register a dissector plugin with the plugin system.
WS_DLL_PUBLIC void proto_set_cant_toggle(const int proto_id)
Definition proto.c:9224
proto_item * proto_tree_add_item_ret_uint16(proto_tree *tree, int hfindex, tvbuff_t *tvb, const unsigned start, unsigned length, const unsigned encoding, uint16_t *retval)
Add an FT_UINT16 item to the protocol tree and return its value.
Definition proto.c:3563
WS_DLL_PUBLIC bool proto_tracking_interesting_fields(const proto_tree *tree)
Definition proto.c:11915
void proto_register_prefix(const char *prefix, prefix_initializer_t pi)
Definition proto.c:1089
enum ftenum type
Definition proto.h:802
proto_item * proto_tree_add_format_text(proto_tree *tree, tvbuff_t *tvb, unsigned start, unsigned length)
Definition proto.c:1619
int proto_register_protocol(const char *name, const char *short_name, const char *filter_name)
Definition proto.c:8671
WS_DLL_PUBLIC void proto_registrar_dump_protocols(void)
Definition proto.c:12132
size_t deregistered_count
Definition proto.h:3084
proto_item * proto_tree_add_checksum_bytes(proto_tree *tree, tvbuff_t *tvb, const unsigned offset, const int hf_checksum, const int hf_checksum_status, struct expert_field *bad_checksum_expert, packet_info *pinfo, const uint8_t *computed_checksum, size_t checksum_len, const unsigned flags)
Definition proto.c:14559
WS_DLL_PUBLIC const char * proto_get_group_name(const protocol_t *protocol)
Definition proto.c:9094
const char * proto_custom_set(proto_tree *tree, GSList *field_id, int occurrence, bool display_details, char *result, char *expr, const int size)
Set the column text for a custom column.
Definition proto.c:7659
bool proto_check_for_protocol_or_field(const proto_tree *tree, const int id)
Definition proto.c:11884
proto_item * proto_tree_add_ipv4(proto_tree *tree, int hfindex, tvbuff_t *tvb, unsigned start, unsigned length, ws_in4_addr value)
Definition proto.c:5231
proto_item * proto_tree_add_uint64(proto_tree *tree, int hfindex, tvbuff_t *tvb, unsigned start, unsigned length, uint64_t value)
Definition proto.c:6144
proto_item * proto_tree_add_item_ret_float(proto_tree *tree, int hfindex, tvbuff_t *tvb, const unsigned start, unsigned length, const unsigned encoding, float *retval)
Parse a float from the buffer and add it to the tree, returning the item added and the parsed value v...
Definition proto.c:4052
proto_item * proto_tree_add_string_format_value(proto_tree *tree, int hfindex, tvbuff_t *tvb, unsigned start, int length, const char *value, const char *format,...)
Definition proto.c:5608
const char * abbrev
Definition proto.h:801
char * proto_custom_get_filter(struct epan_dissect *edt, GSList *field_id, int occurrence)
Construct a display filter string for a custom column.
Definition proto.c:7895
const char * blurb
Definition proto.h:809
proto_tree * proto_tree_create_root(packet_info *pinfo)
Allocate and initialise a new protocol tree root node.
Definition proto.c:8302
size_t same_name_count
Definition proto.h:3085
WS_DLL_PUBLIC proto_item * proto_tree_add_bitmask_with_flags(proto_tree *tree, tvbuff_t *tvb, const unsigned offset, const int hf_hdr, const int ett, int *const *fields, const unsigned encoding, const int flags)
Definition proto.c:13483
proto_item * proto_tree_add_string(proto_tree *tree, int hfindex, tvbuff_t *tvb, unsigned start, int length, const char *value)
Definition proto.c:5569
proto_tree * proto_tree_get_root(proto_tree *tree)
Definition proto.c:8471
proto_item * proto_tree_add_bytes(proto_tree *tree, int hfindex, tvbuff_t *tvb, unsigned start, int length, const uint8_t *start_ptr)
Definition proto.c:4978
WS_DLL_PUBLIC bool proto_registrar_dump_field_completions(const char *prefix)
Dump all protocol and field abbreviations that start with a given prefix to standard output.
Definition proto.c:12782
WS_DLL_PUBLIC bool proto_can_toggle_protocol(const int proto_id)
Definition proto.c:9140
WS_DLL_PUBLIC void proto_registrar_dump_ftypes(void)
Dump all registered field types and their descriptive names to standard output.
Definition proto.c:12847
proto_item * proto_tree_add_float_bits_format_value(proto_tree *tree, const int hfindex, tvbuff_t *tvb, const unsigned bit_offset, const int no_of_bits, float value, const unsigned encoding, const char *format,...)
Definition proto.c:14271
proto_item * proto_tree_add_eui64(proto_tree *tree, int hfindex, tvbuff_t *tvb, unsigned start, unsigned length, const uint64_t value)
Definition proto.c:6426
proto_item * proto_tree_add_eui64_format(proto_tree *tree, int hfindex, tvbuff_t *tvb, unsigned start, unsigned length, const uint64_t value, const char *format,...)
Definition proto.c:6463
WS_DLL_PUBLIC protocol_t * find_protocol_by_id(const int proto_id)
Definition proto.c:8858
WS_DLL_PUBLIC void proto_reenable_all(void)
Definition proto.c:9206
bool proto_registrar_is_protocol(const int n)
Definition proto.c:11832
WS_DLL_PUBLIC void proto_disable_all(void)
Definition proto.c:9176
uint8_t crumb_bit_length
Definition proto.h:875
proto_item * proto_tree_add_double_format(proto_tree *tree, int hfindex, tvbuff_t *tvb, unsigned start, unsigned length, double value, const char *format,...)
Definition proto.c:6023
proto_item * proto_tree_add_int_format_value(proto_tree *tree, int hfindex, tvbuff_t *tvb, unsigned start, unsigned length, int32_t value, const char *format,...)
Definition proto.c:6264
proto_item * proto_tree_add_item(proto_tree *tree, int hfindex, tvbuff_t *tvb, const unsigned start, int length, const unsigned encoding)
Append a decoded field to a protocol tree using a registered header-field index.
Definition proto.c:4576
header_field_info * proto_registrar_get_byname(const char *field_name)
Definition proto.c:1120
void proto_tree_reset(proto_tree *tree)
Reset a protocol tree to its initial empty state, retaining the root node and its associated tree dat...
Definition proto.c:928
#define PITEM_FINFO(proto_item)
Definition proto.h:1020
WS_DLL_PUBLIC const char * proto_field_display_to_string(int field_display)
Convert a field display value to its string representation.
Definition proto.c:9553
void proto_free_deregistered_fields(void)
Definition proto.c:9504
WS_DLL_PUBLIC void proto_tree_add_bitmask_list(proto_tree *tree, tvbuff_t *tvb, const unsigned offset, const unsigned len, int *const *fields, const unsigned encoding)
Definition proto.c:13545
int id
Definition proto.h:812
#define FI_GENERATED
Definition proto.h:891
proto_item * proto_tree_add_item_ret_varint(proto_tree *tree, int hfindex, tvbuff_t *tvb, const unsigned start, unsigned length, const unsigned encoding, uint64_t *retval, unsigned *lenretval)
Add a variable-length integer item to the protocol tree and return its value and consumed byte count.
Definition proto.c:3926
bool proto_is_bytes_pino(const protocol_t *protocol)
Definition proto.c:9102
unsigned length
Definition proto.h:850
#define FI_SET_FLAG(fi, flag)
Definition proto.h:910
WS_DLL_PUBLIC proto_item * proto_tree_add_mac48_detail(const mac_hf_list_t *list_specific, const mac_hf_list_t *list_generic, int idx, tvbuff_t *tvb, proto_tree *tree, unsigned offset)
Definition proto.c:6503
proto_item * proto_tree_add_float(proto_tree *tree, int hfindex, tvbuff_t *tvb, unsigned start, unsigned length, float value)
Definition proto.c:5921
proto_item * proto_tree_add_oid(proto_tree *tree, int hfindex, tvbuff_t *tvb, unsigned start, unsigned length, const uint8_t *value_ptr)
Definition proto.c:5466
proto_item * proto_tree_add_int64(proto_tree *tree, int hfindex, tvbuff_t *tvb, unsigned start, unsigned length, int64_t value)
Definition proto.c:6331
int tree_type
Definition proto.h:853
WS_DLL_PUBLIC int proto_get_id(const protocol_t *protocol)
Definition proto.c:8873
header_field_info hfinfo
Definition proto.h:836
void proto_register_alias(const int proto_id, const char *alias_name)
Definition proto.c:8778
proto_item * proto_tree_add_eui64_format_value(proto_tree *tree, int hfindex, tvbuff_t *tvb, unsigned start, unsigned length, const uint64_t value, const char *format,...)
Definition proto.c:6445
proto_item * proto_tree_add_bytes_with_length(proto_tree *tree, int hfindex, tvbuff_t *tvb, unsigned start, int tvbuff_length, const uint8_t *start_ptr, int ptr_length)
Definition proto.c:5006
proto_item * proto_tree_add_ipxnet_format_value(proto_tree *tree, int hfindex, tvbuff_t *tvb, unsigned start, unsigned length, uint32_t value, const char *format,...)
Definition proto.c:5185
proto_item * proto_tree_add_ipv6_format_value(proto_tree *tree, int hfindex, tvbuff_t *tvb, unsigned start, unsigned length, const ws_in6_addr *value_ptr, const char *format,...)
Definition proto.c:5317
void proto_free_field_strings(ftenum_t field_type, unsigned int field_display, const void *field_strings)
Definition proto.c:9358
proto_item * proto_tree_add_boolean_bits_format_value(proto_tree *tree, const int hfindex, tvbuff_t *tvb, const unsigned bit_offset, const int no_of_bits, uint64_t value, const unsigned encoding, const char *format,...)
Definition proto.c:14359
WS_DLL_PUBLIC proto_item * proto_tree_add_bitmask_text(proto_tree *tree, tvbuff_t *tvb, const unsigned offset, const unsigned len, const char *name, const char *fallback, const int ett, int *const *fields, const unsigned encoding, const int flags)
Definition proto.c:13648
unsigned appendix_start
Definition proto.h:851
WS_DLL_PUBLIC proto_item * proto_tree_add_bitmask_ret_uint64(proto_tree *tree, tvbuff_t *tvb, const unsigned offset, const int hf_hdr, const int ett, int *const *fields, const unsigned encoding, uint64_t *retval)
Definition proto.c:13410
void proto_item_append_text(proto_item *pi, const char *format,...)
Definition proto.c:8074
header_field_info * same_name_next
Definition proto.h:816
@ HF_REF_TYPE_INDIRECT
Definition proto.h:789
@ HF_REF_TYPE_NONE
Definition proto.h:788
@ HF_REF_TYPE_DIRECT
Definition proto.h:790
@ HF_REF_TYPE_PRINT
Definition proto.h:791
@ PROTO_CHECKSUM_E_GOOD
Definition proto.h:3956
@ PROTO_CHECKSUM_E_ILLEGAL
Definition proto.h:3959
@ PROTO_CHECKSUM_E_BAD
Definition proto.h:3955
@ PROTO_CHECKSUM_E_NOT_PRESENT
Definition proto.h:3958
@ PROTO_CHECKSUM_E_UNVERIFIED
Definition proto.h:3957
@ PROTOCOL_GROUP_NONE
Definition proto.h:111
@ PROTOCOL_GROUP_GAMES
Definition proto.h:112
@ ABSOLUTE_TIME_DOY_UTC
Definition proto.h:744
@ BASE_PT_UDP
Definition proto.h:733
@ BASE_HEX_DEC
Definition proto.h:719
@ BASE_HEX
Definition proto.h:716
@ ABSOLUTE_TIME_NTP_UTC
Definition proto.h:745
@ BASE_EXP
Definition proto.h:721
@ ABSOLUTE_TIME_UTC
Definition proto.h:743
@ BASE_DEC
Definition proto.h:715
@ ABSOLUTE_TIME_UNIX
Definition proto.h:746
@ BASE_PT_TCP
Definition proto.h:734
@ BASE_DEC_HEX
Definition proto.h:718
@ BASE_OUI
Definition proto.h:739
@ SEP_COLON
Definition proto.h:726
@ BASE_PT_SCTP
Definition proto.h:736
@ BASE_NETMASK
Definition proto.h:730
@ ABSOLUTE_TIME_LOCAL
Definition proto.h:742
@ BASE_PT_DCCP
Definition proto.h:735
@ BASE_STR_WSP
Definition proto.h:749
@ BASE_NONE
Definition proto.h:712
@ SEP_DOT
Definition proto.h:724
@ SEP_DASH
Definition proto.h:725
@ SEP_SPACE
Definition proto.h:727
@ BASE_OCT
Definition proto.h:717
@ BASE_CUSTOM
Definition proto.h:720
struct _wmem_list_t wmem_list_t
Opaque type representing a scoped, doubly-linked list in the wmem system.
Definition wmem_list.h:42
struct _wmem_allocator_t wmem_allocator_t
Definition wmem_core.h:44
struct _e_guid_t e_guid_t
Represents a GUID/UUID value; may be larger than GUID_LEN so must not be used to directly overlay pac...
struct e_in6_addr ws_in6_addr
Represents a 128-bit IPv6 address.
uint32_t ws_in4_addr
Represents a 32-bit IPv4 address in network byte order.
Definition inet_addr.h:22
Definition proto.h:798
Definition proto.h:840
Definition proto.h:2856
Represents the metadata and indexing information for a single captured frame.
Definition packet_info.h:43
Definition proto.h:939
Definition proto.c:400
Definition packet-bt-dht.c:98
This structure describes one segment of a split-bits item.
Definition proto.h:873
Holds all state for the dissection of a single byte array, including session, buffer,...
Definition epan_dissect.h:28
proto_tree * tree
Definition epan_dissect.h:31
Pairs an expert info index with its associated header field index for registration and display.
Definition expert.h:41
Definition proto.h:847
Definition proto.h:834
Definition nstime.h:26
Descriptor for a dissector plugin's registration entry points.
Definition proto.h:1150
Holds aggregate statistics about the state of the protocol registrar.
Definition proto.h:3082
Definition proto.h:927
struct _value_string value_string
Mapping between a 32-bit integer value and its string representation.