Wireshark 4.5.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
23#ifndef __PROTO_H__
24#define __PROTO_H__
25
26#include "wsutil/nstime.h"
27#include "tvbuff.h"
28#include "value_string.h"
29#include "packet_info.h"
30#include "ftypes/ftypes.h"
31#include "register.h"
32#include "ws_symbol_export.h"
33#include "ws_attributes.h"
34
35#ifdef __cplusplus
36extern "C" {
37#endif /* __cplusplus */
38
48WS_DLL_PUBLIC int hf_text_only;
49
51#define ITEM_LABEL_LENGTH 240
52
53#define ITEM_LABEL_UNKNOWN_STR "Unknown"
54
55struct expert_field;
56
57/* Type-check that 'x' is compatible with 'type', should give compiler warnings otherwise. */
58#define cast_same(type, x) (0 ? (type)0 : (x))
59
61#define VALS(x) (cast_same(const struct _value_string*, (x)))
62
64#define VALS64(x) (cast_same(const struct _val64_string*, (x)))
65
67#define VALS_EXT_PTR(x) (cast_same(value_string_ext*, (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
112WS_DLL_PUBLIC WS_NORETURN
113void proto_report_dissector_bug(const char *format, ...)
114 G_GNUC_PRINTF(1, 2);
115
116#define REPORT_DISSECTOR_BUG(...) \
117 proto_report_dissector_bug(__VA_ARGS__)
118
122#ifdef _MSC_VER
123/* XXX - Is there a way to say "quit checking at this point"? */
124#define __DISSECTOR_ASSERT_STATIC_ANALYSIS_HINT(expression) \
125 ; __analysis_assume(expression);
126#else
127#define __DISSECTOR_ASSERT_STATIC_ANALYSIS_HINT(expression)
128#endif
129
141#define __DISSECTOR_ASSERT_STRINGIFY(s) # s
142
143#define __DISSECTOR_ASSERT(expression, file, lineno) \
144 (REPORT_DISSECTOR_BUG("%s:%u: failed assertion \"%s\"", \
145 file, lineno, __DISSECTOR_ASSERT_STRINGIFY(expression)))
146
147#define __DISSECTOR_ASSERT_HINT(expression, file, lineno, hint) \
148 (REPORT_DISSECTOR_BUG("%s:%u: failed assertion \"%s\" (%s)", \
149 file, lineno, __DISSECTOR_ASSERT_STRINGIFY(expression), hint))
150
151#define DISSECTOR_ASSERT(expression) \
152 ((void) ((expression) ? (void)0 : \
153 __DISSECTOR_ASSERT (expression, __FILE__, __LINE__))) \
154 __DISSECTOR_ASSERT_STATIC_ANALYSIS_HINT(expression)
155
163#define DISSECTOR_ASSERT_HINT(expression, hint) \
164 ((void) ((expression) ? (void)0 : \
165 __DISSECTOR_ASSERT_HINT (expression, __FILE__, __LINE__, hint))) \
166 __DISSECTOR_ASSERT_STATIC_ANALYSIS_HINT(expression)
167
168#if 0
169/* win32: using a debug breakpoint (int 3) can be very handy while debugging,
170 * as the assert handling of GTK/GLib is currently not very helpful */
171#define DISSECTOR_ASSERT(expression) \
172{ if(!(expression)) _asm { int 3}; }
173#endif
174
183#define DISSECTOR_ASSERT_NOT_REACHED() \
184 (REPORT_DISSECTOR_BUG("%s:%u: failed assertion \"DISSECTOR_ASSERT_NOT_REACHED\"", \
185 __FILE__, __LINE__))
186
206#define __DISSECTOR_ASSERT_CMPINT(a, op, b, type, fmt) \
207 (REPORT_DISSECTOR_BUG("%s:%u: failed assertion " #a " " #op " " #b " (" fmt " " #op " " fmt ")", \
208 __FILE__, __LINE__, (type)a, (type)b))
209
210#define DISSECTOR_ASSERT_CMPINT(a, op, b) \
211 ((void) ((a op b) ? (void)0 : \
212 __DISSECTOR_ASSERT_CMPINT (a, op, b, int64_t, "%" PRId64))) \
213 __DISSECTOR_ASSERT_STATIC_ANALYSIS_HINT(a op b)
214
220#define DISSECTOR_ASSERT_CMPUINT(a, op, b) \
221 ((void) ((a op b) ? (void)0 : \
222 __DISSECTOR_ASSERT_CMPINT (a, op, b, uint64_t, "%" PRIu64))) \
223 __DISSECTOR_ASSERT_STATIC_ANALYSIS_HINT(a op b)
224
228#define DISSECTOR_ASSERT_CMPUINTHEX(a, op, b) \
229 ((void) ((a op b) ? (void)0 : \
230 __DISSECTOR_ASSERT_CMPINT (a, op, b, uint64_t, "0x%" PRIX64))) \
231 __DISSECTOR_ASSERT_STATIC_ANALYSIS_HINT(a op b)
232
233/*
234 * This is similar to DISSECTOR_ASSERT(hfinfo->type == type) except that
235 * it will report the name of the field with the wrong type as well as
236 * the type.
237 *
238 * @param hfinfo The hfinfo for the field being tested
239 * @param type The type it's expected to have
240 */
241#define __DISSECTOR_ASSERT_FIELD_TYPE(hfinfo, t) \
242 (REPORT_DISSECTOR_BUG("%s:%u: field %s is not of type "#t, \
243 __FILE__, __LINE__, (hfinfo)->abbrev))
244
245#define DISSECTOR_ASSERT_FIELD_TYPE(hfinfo, t) \
246 ((void) (((hfinfo)->type == t) ? (void)0 : \
247 __DISSECTOR_ASSERT_FIELD_TYPE ((hfinfo), t))) \
248 __DISSECTOR_ASSERT_STATIC_ANALYSIS_HINT((hfinfo)->type == t)
249
250#define DISSECTOR_ASSERT_FIELD_TYPE_IS_INTEGRAL(hfinfo) \
251 ((void) ((FT_IS_INTEGER((hfinfo)->type)) ? (void)0 : \
252 REPORT_DISSECTOR_BUG("%s:%u: field %s is not of type FT_CHAR or an FT_{U}INTn type", \
253 __FILE__, __LINE__, (hfinfo)->abbrev))) \
254 __DISSECTOR_ASSERT_STATIC_ANALYSIS_HINT(FT_IS_INTEGER((hfinfo)->type))
255
256#define __DISSECTOR_ASSERT_FIELD_TYPE_IS_STRING(hfinfo) \
257 (REPORT_DISSECTOR_BUG("%s:%u: field %s is not of type FT_STRING, FT_STRINGZ, FT_STRINGZPAD, FT_STRINGZTRUNC, or FT_UINT_STRING", \
258 __FILE__, __LINE__, (hfinfo)->abbrev))
259
260#define DISSECTOR_ASSERT_FIELD_TYPE_IS_STRING(hfinfo) \
261 ((void) (FT_IS_STRING((hfinfo)->type) ? (void)0 : \
262 __DISSECTOR_ASSERT_FIELD_TYPE_IS_STRING ((hfinfo)))) \
263 __DISSECTOR_ASSERT_STATIC_ANALYSIS_HINT(FT_IS_STRING((hfinfo)->type))
264
265#define __DISSECTOR_ASSERT_FIELD_TYPE_IS_TIME(hfinfo) \
266 (REPORT_DISSECTOR_BUG("%s:%u: field %s is not of type FT_ABSOLUTE_TIME or FT_RELATIVE_TIME", \
267 __FILE__, __LINE__, (hfinfo)->abbrev))
268
269#define DISSECTOR_ASSERT_FIELD_TYPE_IS_TIME(hfinfo) \
270 ((void) (((hfinfo)->type == FT_ABSOLUTE_TIME || \
271 (hfinfo)->type == FT_RELATIVE_TIME) ? (void)0 : \
272 __DISSECTOR_ASSERT_FIELD_TYPE_IS_TIME ((hfinfo)))) \
273 __DISSECTOR_ASSERT_STATIC_ANALYSIS_HINT((hfinfo)->type == FT_ABSOLUTE_TIME || \
274 (hfinfo)->type == FT_RELATIVE_TIME)
275
276/*
277 * Encoding flags that apply to multiple data types.
278 */
279/*
280 * The encoding of a field of a particular type may involve more
281 * than just whether it's big-endian or little-endian and its size.
282 *
283 * For integral values, that's it, as 99.9999999999999% of the machines
284 * out there are 2's complement binary machines with 8-bit bytes,
285 * so the protocols out there expect that and, for example, any Unisys
286 * 2200 series machines out there just have to translate between 2's
287 * complement and 1's complement (and nobody's put any IBM 709x's on
288 * any networks lately :-)).
289 *
290 * However:
291 *
292 * for floating-point numbers, in addition to IEEE decimal
293 * floating-point, there's also IBM System/3x0 and PDP-11/VAX
294 * floating-point - most protocols use IEEE binary, but DCE RPC
295 * can use other formats if that's what the sending host uses;
296 *
297 * for character strings, there are various character encodings
298 * (various ISO 646 sets, ISO 8859/x, various other national
299 * standards, various DOS and Windows encodings, various Mac
300 * encodings, UTF-8, UTF-16, other extensions to ASCII, EBCDIC,
301 * etc.);
302 *
303 * for absolute times, there's UNIX time_t, UNIX time_t followed
304 * by 32-bit microseconds, UNIX time_t followed by 32-bit
305 * nanoseconds, DOS date/time, Windows FILETIME, NTP time, etc..
306 *
307 * We might also, in the future, want to allow a field specifier to
308 * indicate the encoding of the field, or at least its default
309 * encoding, as most fields in most protocols always use the
310 * same encoding (although that's not true of all fields, so we
311 * still need to be able to specify that at run time).
312 *
313 * So, for now, we define ENC_BIG_ENDIAN and ENC_LITTLE_ENDIAN as
314 * bit flags, to be combined, in the future, with other information
315 * to specify the encoding in the last argument to
316 * proto_tree_add_item(), and possibly to specify in a field
317 * definition (e.g., ORed in with the type value).
318 *
319 * Currently, proto_tree_add_item() treats its last argument as a
320 * Boolean - if it's zero, the field is big-endian, and if it's non-zero,
321 * the field is little-endian - and other code in epan/proto.c does
322 * the same. We therefore define ENC_BIG_ENDIAN as 0x00000000 and
323 * ENC_LITTLE_ENDIAN as 0x80000000 - we're using the high-order bit
324 * so that we could put a field type and/or a value such as a character
325 * encoding in the lower bits.
326 */
327#define ENC_BIG_ENDIAN 0x00000000
328#define ENC_LITTLE_ENDIAN 0x80000000
329
330#if G_BYTE_ORDER == G_LITTLE_ENDIAN
331 #define ENC_HOST_ENDIAN ENC_LITTLE_ENDIAN
332 #define ENC_ANTI_HOST_ENDIAN ENC_BIG_ENDIAN
333#else
334 #define ENC_HOST_ENDIAN ENC_BIG_ENDIAN
335 #define ENC_ANTI_HOST_ENDIAN ENC_LITTLE_ENDIAN
336#endif
337
338/*
339 * For protocols (FT_PROTOCOL), aggregate items with subtrees (FT_NONE),
340 * opaque byte-array fields (FT_BYTES), and other fields where there
341 * is no choice of encoding (either because it's "just a bucket
342 * of bytes" or because the encoding is completely fixed), we
343 * have ENC_NA (for "Not Applicable").
344 */
345#define ENC_NA 0x00000000
346
347/*
348 * Encoding for character strings - and for character-encoded values
349 * for non-string types.
350 *
351 * Historically, the only place the representation mattered for strings
352 * was with FT_UINT_STRINGs, where we had false for the string length
353 * being big-endian and true for it being little-endian.
354 *
355 * We now have encoding values for the character encoding. The encoding
356 * values are encoded in all but the top bit (which is the byte-order
357 * bit, required for FT_UINT_STRING and for UCS-2 and UTF-16 strings)
358 * and the bottom bit (which we ignore for now so that programs that
359 * pass true for the encoding just do ASCII).
360 *
361 * For ENC_ASCII, we map ASCII characters with the high bit set to the UTF-8
362 * REPLACEMENT CHARACTER, and do the same for ENC_UTF_8 with invalid UTF-8
363 * sequences. We should also map 0x00 to that as well - null-terminated and
364 * null-padded strings never have NULs in them, but counted strings might.
365 * Either that, or strings should be counted, not null-terminated. Note
366 * that conversion of ASCII and UTF-8 can change the length of the string,
367 * as with any other encoding, due to REPLACEMENT CHARACTERs.
368 *
369 * For display, perhaps we should also map control characters to the
370 * Unicode glyphs showing the name of the control character in small
371 * caps, diagonally. (Unfortunately, those only exist for C0, not C1.)
372 *
373 * *DO NOT* add anything to this set that is not a character encoding!
374 */
375#define ENC_CHARENCODING_MASK 0x0000FFFE /* mask out byte-order bits and other bits used with string encodings */
376#define ENC_ASCII 0x00000000
377#define ENC_ISO_646_IRV ENC_ASCII /* ISO 646 International Reference Version = ASCII */
378#define ENC_UTF_8 0x00000002
379#define ENC_UTF_16 0x00000004
380#define ENC_UCS_2 0x00000006
381#define ENC_UCS_4 0x00000008
382#define ENC_ISO_8859_1 0x0000000A
383#define ENC_ISO_8859_2 0x0000000C
384#define ENC_ISO_8859_3 0x0000000E
385#define ENC_ISO_8859_4 0x00000010
386#define ENC_ISO_8859_5 0x00000012
387#define ENC_ISO_8859_6 0x00000014
388#define ENC_ISO_8859_7 0x00000016
389#define ENC_ISO_8859_8 0x00000018
390#define ENC_ISO_8859_9 0x0000001A
391#define ENC_ISO_8859_10 0x0000001C
392#define ENC_ISO_8859_11 0x0000001E
393/* #define ENC_ISO_8859_12 0x00000020 ISO 8859-12 was abandoned */
394#define ENC_ISO_8859_13 0x00000022
395#define ENC_ISO_8859_14 0x00000024
396#define ENC_ISO_8859_15 0x00000026
397#define ENC_ISO_8859_16 0x00000028
398#define ENC_WINDOWS_1250 0x0000002A
399#define ENC_3GPP_TS_23_038_7BITS_PACKED 0x0000002C
400#define ENC_3GPP_TS_23_038_7BITS ENC_3GPP_TS_23_038_7BITS_PACKED
401#define ENC_EBCDIC 0x0000002E
402#define ENC_MAC_ROMAN 0x00000030
403#define ENC_CP437 0x00000032
404#define ENC_ASCII_7BITS 0x00000034
405#define ENC_T61 0x00000036
406#define ENC_EBCDIC_CP037 0x00000038
407#define ENC_WINDOWS_1252 0x0000003A
408#define ENC_WINDOWS_1251 0x0000003C
409#define ENC_CP855 0x0000003E
410#define ENC_CP866 0x00000040
411#define ENC_ISO_646_BASIC 0x00000042
412#define ENC_BCD_DIGITS_0_9 0x00000044 /* Packed BCD, digits 0-9 */
413#define ENC_KEYPAD_ABC_TBCD 0x00000046 /* Keypad-with-a/b/c "telephony BCD" = 0-9, *, #, a, b, c */
414#define ENC_KEYPAD_BC_TBCD 0x00000048 /* Keypad-with-B/C "telephony BCD" = 0-9, B, C, *, # */
415#define ENC_3GPP_TS_23_038_7BITS_UNPACKED 0x0000004C
416#define ENC_ETSI_TS_102_221_ANNEX_A 0x0000004E /* ETSI TS 102 221 Annex A */
417#define ENC_GB18030 0x00000050
418#define ENC_EUC_KR 0x00000052
419#define ENC_APN_STR 0x00000054 /* The encoding the APN/DNN field follows 3GPP TS 23.003 [2] clause 9.1.*/
420#define ENC_DECT_STANDARD_8BITS 0x00000056 /* DECT standard character set as defined in ETSI EN 300 175-5 Annex D */
421#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)*/
422#define ENC_EBCDIC_CP500 0x00000060
423/*
424 * TODO:
425 *
426 * packet-bacapp.c refers to two currently unsupported character sets (where
427 * we just use ASCII currently):
428 *
429 * "IBM MS DBCS" - At the very least could be any IBM/MS Double Byte
430 * Character Set for CJK (4 major ones), but also could just be any non
431 * Unicode and non ISO-8859-1 code page. This would be supported via the
432 * various code pages.
433 * JIS C 6226 / JIS X 0206 - Does this refer to ISO-2022-JP, SHIFT-JIS, or
434 * EUC-JP, which are all encoding schemes that support the JIS X 0206
435 * character set?
436 *
437 * As those are added, change code such as the code in packet-bacapp.c
438 * to use them.
439 *
440 * There's also some other code (e.g., packet-smpp.c) that just ignores
441 * strings if it determines that they are in an unsupported encoding, such
442 * as various encodings of Japanese mentioned above, for example.
443 *
444 */
445
446/*
447 * This is a modifier for FT_UINT_STRING and FT_UINT_BYTES values;
448 * it indicates that the length field should be interpreted as per
449 * sections 2.5.2.11 Octet String through 2.5.2.14 Long Character
450 * String of the ZigBee Cluster Library Specification, where if all
451 * bits are set in the length field, the string has an invalid value,
452 * and the number of octets in the value is 0.
453 */
454#define ENC_ZIGBEE 0x40000000
455
456/*
457 * This is a modifier for ENC_UTF_16, ENC_UCS_2, and ENC_UCS_4
458 * indicating that if the first two (or four, for UCS-4) octets
459 * are a big-endian or little-endian BOM, use that to determine
460 * the serialization order and ignore the ENC_LITTLE_ENDIAN or
461 * ENC_BIG_ENDIAN flag. This can't collide with ENC_ZIGBEE because
462 * it could be used simultaneously.
463 */
464#define ENC_BOM 0x20000000
465
466/*
467 * For cases where either native type or string encodings could both be
468 * valid arguments, we need something to distinguish which one is being
469 * passed as the argument, because ENC_BIG_ENDIAN and ENC_ASCII are both
470 * 0x00000000. So we use ENC_STR_NUM or ENC_STR_HEX bit-or'ed with
471 * ENC_ASCII and its ilk.
472 *
473 * XXX - ENC_STR_NUM is not yet supported by any code in Wireshark,
474 * and these are only used for byte arrays. Presumably they could
475 * also be used for integral values in the future.
476 */
477/* this is for strings as numbers "12345" */
478#define ENC_STR_NUM 0x01000000
479/* this is for strings as hex "1a2b3c" */
480#define ENC_STR_HEX 0x02000000
481/* a convenience macro for either of the above */
482#define ENC_STRING 0x03000000
483/* Kept around for compatibility for Lua scripts; code should use ENC_CHARENCODING_MASK */
484#define ENC_STR_MASK 0x0000FFFE
485
486/*
487 * For cases where the number is allowed to have a leading '+'/'-'
488 * this can't collide with ENC_SEP_* because they can be used simultaneously
489 *
490 * XXX - this is not used anywhere in Wireshark's code, dating back to
491 * at least Wireshark 2.6 and continuing to the current version.
492 * Perhaps the intent was to use it in the future, but 1) I'm not sure
493 * why it would be combined with ENC_SEP_, as byte arrays have no sign
494 * but integral values do, and 2) if we were to support string encodings
495 * for integral types, presumably whether it's signed (FT_INTn) or
496 * unsigned (FT_UINTn) would suffice to indicate whether the value
497 * can be signed or not.
498 */
499#define ENC_NUM_PREF 0x00200000
500
501/*
502 * Encodings for byte arrays.
503 *
504 * For cases where the byte array is encoded as a string composed of
505 * pairs of hex digits, possibly with a separator character between
506 * the pairs. That's specified by the encoding having ENC_STR_HEX,
507 * plus one of these values, set.
508 *
509 * See hex_str_to_bytes_encoding() in epan/strutil.h for details.
510 */
511#define ENC_SEP_NONE 0x00010000
512#define ENC_SEP_COLON 0x00020000
513#define ENC_SEP_DASH 0x00040000
514#define ENC_SEP_DOT 0x00080000
515#define ENC_SEP_SPACE 0x00100000
516/* a convenience macro for the above */
517#define ENC_SEP_MASK 0x001F0000
518
519/* Encodings for BCD strings
520 * Depending if the BCD string has even or odd number of digits
521 * we may need to strip of the last digit/High nibble
522 */
523#define ENC_BCD_ODD_NUM_DIG 0x00010000
524#define ENC_BCD_SKIP_FIRST 0x00020000
525
526/*
527 * Encodings for time values.
528 *
529 * Historically FT_TIMEs were only timespecs; the only question was whether
530 * they were stored in big- or little-endian format.
531 *
532 * For backwards compatibility, we interpret an encoding of 1 as meaning
533 * "little-endian timespec", so that passing true is interpreted as that.
534 *
535 * We now support:
536 *
537 * ENC_TIME_SECS_NSECS - 8, 12, or 16 bytes. For 8 bytes, the first 4
538 * bytes are seconds and the next 4 bytes are nanoseconds; for 12 bytes,
539 * the first 8 bytes are seconds and the next 4 bytes are nanoseconds;
540 * for 16 bytes, the first 8 bytes are seconds and the next 8 bytes are
541 * nanoseconds. If the time is absolute, the seconds are seconds since
542 * the UN*X epoch (1970-01-01 00:00:00 UTC). (I.e., a UN*X struct
543 * timespec with a 4-byte or 8-byte time_t or a structure with an
544 * 8-byte time_t and an 8-byte nanoseconds field.)
545 *
546 * ENC_TIME_NTP - 8 bytes; the first 4 bytes are seconds since the NTP
547 * epoch (1900-01-01 00:00:00 GMT) and the next 4 bytes are 1/2^32's of
548 * a second since that second. (I.e., a 64-bit count of 1/2^32's of a
549 * second since the NTP epoch, with the upper 32 bits first and the
550 * lower 32 bits second, even when little-endian.) A value of 0 is a
551 * special case representing unknown or unsynchronized time. Per the
552 * suggestion in RFC 4330, if bit 0 is not set then the time is assumed
553 * to be in NTP Era 1, beginning on 2036-02-07 06:28:16 UTC. (I.e., the
554 * time displayed will be between 1968-01-20 03:14:08 UTC and
555 * 2104-02-26 09:42:24 UTC.) The 16 byte NTP date format and the 4 byte
556 * NTP short relative time format are not supported.
557 * Encodings that store only the seconds since the NTP epoch without
558 * fractional seconds should use ENC_TIME_SECS_NTP, described below.
559 *
560 * ENC_TIME_TOD - 8 bytes, as a count of microseconds since the System/3x0
561 * and z/Architecture epoch (1900-01-01 00:00:00 GMT).
562 *
563 * ENC_TIME_RTPS - 8 bytes; the first 4 bytes are seconds since the UN*X
564 * epoch and the next 4 bytes are 1/2^32's of a second since that
565 * second. (I.e., it's the offspring of a mating between UN*X time and
566 * NTP time). It's used by the Object Management Group's Real-Time
567 * Publish-Subscribe Wire Protocol for the Data Distribution Service.
568 *
569 * ENC_TIME_SECS_USECS - 8 bytes; the first 4 bytes are seconds and the
570 * next 4 bytes are microseconds. If the time is absolute, the seconds
571 * are seconds since the UN*X epoch. (I.e., a UN*X struct timeval with
572 * a 4-byte time_t.)
573 *
574 * ENC_TIME_SECS - 4 to 8 bytes, representing a value in seconds.
575 * If the time is absolute, it's seconds since the UN*X epoch.
576 *
577 * ENC_TIME_MSECS - 6 to 8 bytes, representing a value in milliseconds.
578 * If the time is absolute, it's milliseconds since the UN*X epoch.
579 *
580 * ENC_TIME_USECS - 8 bytes, representing a value in microseconds.
581 * If the time is absolute, it's microseconds since the UN*X epoch.
582 *
583 * ENC_TIME_NSECS - 8 bytes, representing a value in nanoseconds.
584 * If the time is absolute, it's nanoseconds since the UN*X epoch.
585 *
586 * ENC_TIME_SECS_NTP - 4 bytes, representing a count of seconds since
587 * the NTP epoch. As with ENC_TIME_NTP, times are assumed to be in
588 * the upper half of NTP Era 0 or the lower half of NTP Era 1.
589 *
590 * ENC_TIME_RFC_3971 - 8 bytes, representing a count of 1/64ths of a
591 * second since the UN*X epoch; see section 5.3.1 "Timestamp Option"
592 * in RFC 3971.
593 *
594 * ENC_TIME_MSEC_NTP - 6-8 bytes, representing a count of milliseconds since
595 * the NTP epoch. Similar to ENC_TIME_NTP, times before the midpoint of
596 * NTP Era 0 (1968-01-20) are assumed to represent the corresponding
597 * time in NTP Era 1 instead.
598 *
599 * ENC_TIME_MIP6 - 8 bytes; the first 48 bits are seconds since the UN*X epoch
600 * and the remaining 16 bits indicate the number of 1/65536's of a second
601 * since that second.
602 *
603 * ENC_TIME_MP4_FILE_SECS - 4-8 bytes, representing a count of seconds since
604 * January 1, 1904, 00:00:00 UTC.
605 *
606 * ENC_TIME_ZBEE_ZCL - 4-8 bytes, representing a count of seconds since
607 * January 1, 2000, 00:00:00 UTC.
608 */
609#define ENC_TIME_SECS_NSECS 0x00000000
610#define ENC_TIME_TIMESPEC 0x00000000 /* for backwards source compatibility */
611#define ENC_TIME_NTP 0x00000002
612#define ENC_TIME_TOD 0x00000004
613#define ENC_TIME_RTPS 0x00000008
614#define ENC_TIME_NTP_BASE_ZERO 0x00000008 /* for backwards source compatibility */
615#define ENC_TIME_SECS_USECS 0x00000010
616#define ENC_TIME_TIMEVAL 0x00000010 /* for backwards source compatibility */
617#define ENC_TIME_SECS 0x00000012
618#define ENC_TIME_MSECS 0x00000014
619#define ENC_TIME_SECS_NTP 0x00000018
620#define ENC_TIME_RFC_3971 0x00000020
621#define ENC_TIME_MSEC_NTP 0x00000022
622#define ENC_TIME_MIP6 0x00000024
623#define ENC_TIME_MP4_FILE_SECS 0x00000026
624#define ENC_TIME_CLASSIC_MAC_OS_SECS 0x00000026 /* for backwards source compatibility */
625#define ENC_TIME_NSECS 0x00000028
626#define ENC_TIME_USECS 0x00000030
627#define ENC_TIME_ZBEE_ZCL 0x00000032
628
629/*
630 * For cases where a string encoding contains a timestamp, use one
631 * of these (but only one). These values can collide with the ENC_SEP_
632 * values used when a string encoding contains a byte array, because
633 * you can't do both at the same time. They must not, however,
634 * overlap with the character encoding values.
635 */
636#define ENC_ISO_8601_DATE 0x00010000
637#define ENC_ISO_8601_TIME 0x00020000
638#define ENC_ISO_8601_DATE_TIME 0x00030000
639#define ENC_IMF_DATE_TIME 0x00040000 /* Internet Message Format - RFCs 822, 1123, 2822, 5322 */
640#define ENC_RFC_822 0x00040000 /* backwards compatibility */
641#define ENC_RFC_1123 0x00040000 /* backwards source compatibility - not binary */
642#define ENC_ISO_8601_DATE_TIME_BASIC 0x00100000
643/* a convenience macro for the above - for internal use only */
644#define ENC_STR_TIME_MASK 0x001F0000
645
646/*
647 * Encodings for variable-length integral types.
648 */
649
650/* Use varint format as described in Protobuf protocol
651 * https://developers.google.cn/protocol-buffers/docs/encoding
652 */
653#define ENC_VARINT_PROTOBUF 0x00000002
654/*
655 * Decodes a variable-length integer used in QUIC protocol
656 * See https://tools.ietf.org/html/draft-ietf-quic-transport-08#section-8.1
657 */
658#define ENC_VARINT_QUIC 0x00000004
659 /*
660 * Use "zig-zag" varint format as described in Protobuf protocol
661 * See https://developers.google.com/protocol-buffers/docs/encoding?csw=1#types
662 */
663#define ENC_VARINT_ZIGZAG 0x00000008
664/*
665 * Decodes a variable-length integer used in DTN protocols
666 * See https://www.rfc-editor.org/rfc/rfc6256.html
667 */
668#define ENC_VARINT_SDNV 0x00000010
669
670#define ENC_VARINT_MASK (ENC_VARINT_PROTOBUF|ENC_VARINT_QUIC|ENC_VARINT_ZIGZAG|ENC_VARINT_SDNV)
671
672/* Values for header_field_info.display */
673
674/* For integral types, the display format is a BASE_* field_display_e value
675 * possibly ORed with BASE_*_STRING */
676
678#define FIELD_DISPLAY_E_MASK 0xFF
679
720
721#define FIELD_DISPLAY(d) ((d) & FIELD_DISPLAY_E_MASK)
722
723#define FIELD_DISPLAY_IS_ABSOLUTE_TIME(d) \
724 (FIELD_DISPLAY(d) >= ABSOLUTE_TIME_LOCAL && FIELD_DISPLAY(d) <= ABSOLUTE_TIME_UNIX)
725
726/* Following constants have to be ORed with a field_display_e when dissector
727 * want to use specials value-string MACROs for a header_field_info */
728#define BASE_RANGE_STRING 0x00000100
729#define BASE_EXT_STRING 0x00000200
730#define BASE_VAL64_STRING 0x00000400
731
732#define BASE_ALLOW_ZERO 0x00000800
734#define BASE_UNIT_STRING 0x00001000
736#define BASE_NO_DISPLAY_VALUE 0x00002000
739#define BASE_PROTOCOL_INFO 0x00004000
741#define BASE_SPECIAL_VALS 0x00008000
743#define BASE_SHOW_ASCII_PRINTABLE 0x00010000
745#define BASE_SHOW_UTF_8_PRINTABLE 0x00020000
748#define IS_BASE_DUAL(b) ((b)==BASE_DEC_HEX||(b)==BASE_HEX_DEC)
749
751#define IS_BASE_PORT(b) (((b)==BASE_PT_UDP||(b)==BASE_PT_TCP||(b)==BASE_PT_DCCP||(b)==BASE_PT_SCTP))
752
759
762
765 /* ---------- set by dissector --------- */
766 const char *name;
767 const char *abbrev;
768 enum ftenum type;
770 const void *strings;
774 uint64_t bitmask;
775 const char *blurb;
777 /* ------- set by proto routines (prefilled by HFILL macro, see below) ------ */
778 int id;
779 int parent;
783};
784
790#define HFILL -1, 0, HF_REF_TYPE_NONE, -1, NULL
791
792#define HFILL_INIT(hf) \
793 (hf).hfinfo.id = -1; \
794 (hf).hfinfo.parent = 0; \
795 (hf).hfinfo.ref_type = HF_REF_TYPE_NONE; \
796 (hf).hfinfo.same_name_prev_id = -1; \
797 (hf).hfinfo.same_name_next = NULL;
798
804
806typedef struct _item_label_t {
807 char representation[ITEM_LABEL_LENGTH];
808 size_t value_pos;
809 size_t value_len;
811
827
828
829/*
830 * This structure describes one segment of a split-bits item
831 * crumb_bit_offset is the bit offset in the input tvb of the first (most significant) bit of this crumb
832 * crumb_bit_length is the number of contiguous bits of this crumb.
833 * The first element of an array of bits_specs describes the most significant crumb of the output value.
834 * The second element of an array of bits_specs describes the next-most significant crumb of the output value, etc.
835 * The array is terminated by a sentinel entry with crumb_bit_length of 0.
836*/
837typedef struct
838{
839 unsigned crumb_bit_offset;
840 uint8_t crumb_bit_length;
842
843/*
844 * Flag fields. Do not assign values greater than 0x000FFFFF unless you
845 * shuffle the expert information upward; see below.
846 */
847
853#define FI_HIDDEN 0x00000001
856#define FI_GENERATED 0x00000002
858#define FI_URL 0x00000004
859
861#define FI_LITTLE_ENDIAN 0x00000008
863#define FI_BIG_ENDIAN 0x00000010
865#define FI_BITS_OFFSET(n) (((n) & 7) << 5)
867/* if 0, it means that field takes fi->length * 8 */
868#define FI_BITS_SIZE(n) (((n) & 63) << 8)
870#define FI_VARINT 0x00004000
871
873#define FI_GET_FLAG(fi, flag) ((fi) ? ((fi)->flags & (flag)) : 0)
875#define FI_SET_FLAG(fi, flag) \
876 do { \
877 if (fi) \
878 (fi)->flags = (fi)->flags | (flag); \
879 } while(0)
881#define FI_RESET_FLAG(fi, flag) \
882 do { \
883 if (fi) \
884 (fi)->flags = (fi)->flags & ~(flag); \
885 } while(0)
886
887#define FI_GET_BITS_OFFSET(fi) (FI_GET_FLAG(fi, FI_BITS_OFFSET(7)) >> 5)
888#define FI_GET_BITS_SIZE(fi) (FI_GET_FLAG(fi, FI_BITS_SIZE(63)) >> 8)
889
892typedef struct {
893 GHashTable *interesting_hfids;
894 bool visible;
895 bool fake_protocols;
896 unsigned count;
897 struct _packet_info *pinfo;
899
901typedef struct _proto_node {
902 struct _proto_node *first_child;
903 struct _proto_node *last_child;
904 struct _proto_node *next;
905 struct _proto_node *parent;
906 field_info *finfo;
907 tree_data_t *tree_data;
909
914
915/*
916 * Expert information.
917 * This is in the flags field; we allocate this from the top down,
918 * so as not to collide with FI_ flags, which are allocated from
919 * the bottom up.
920 */
921
922/* expert severities */
923#define PI_SEVERITY_MASK 0x00F00000
925#define PI_COMMENT 0x00100000
927#define PI_CHAT 0x00200000
929#define PI_NOTE 0x00400000
931#define PI_WARN 0x00600000
933#define PI_ERROR 0x00800000
934
935/* expert "event groups" */
936#define PI_GROUP_MASK 0xFF000000
938#define PI_CHECKSUM 0x01000000
940#define PI_SEQUENCE 0x02000000
942#define PI_RESPONSE_CODE 0x03000000
944#define PI_REQUEST_CODE 0x04000000
946#define PI_UNDECODED 0x05000000
948#define PI_REASSEMBLE 0x06000000
950#define PI_MALFORMED 0x07000000
952#define PI_DEBUG 0x08000000
954#define PI_PROTOCOL 0x09000000
956#define PI_SECURITY 0x0a000000
958#define PI_COMMENTS_GROUP 0x0b000000
960#define PI_DECRYPTION 0x0c000000
962#define PI_ASSUMPTION 0x0d000000
964#define PI_DEPRECATED 0x0e000000
966#define PI_RECEIVE 0x0f000000
968#define PI_INTERFACE 0x10000000
970#define PI_DISSECTOR_BUG 0x11000000
971
972/*
973 * add more, see
974 * https://gitlab.com/wireshark/wireshark/-/wikis/Development/ExpertInfo
975 */
976
978#define PNODE_FINFO(proto_node) ((proto_node)->finfo)
979
981#define PITEM_FINFO(proto_item) PNODE_FINFO(proto_item)
982
984#define PTREE_FINFO(proto_tree) PNODE_FINFO(proto_tree)
985
987#define PTREE_DATA(proto_tree) ((proto_tree)->tree_data)
988
990#define PNODE_POOL(proto_node) ((proto_node)->tree_data->pinfo->pool)
991
997static inline bool proto_item_is_hidden(proto_item *ti) {
998 if (ti) {
999 return FI_GET_FLAG(PITEM_FINFO(ti), FI_HIDDEN);
1000 }
1001 return false;
1002}
1003#define PROTO_ITEM_IS_HIDDEN(ti) proto_item_is_hidden((ti))
1004
1009static inline void proto_item_set_hidden(proto_item *ti) {
1010 if (ti) {
1012 }
1013}
1014#define PROTO_ITEM_SET_HIDDEN(ti) proto_item_set_hidden((ti))
1015
1019static inline void proto_item_set_visible(proto_item *ti) {
1020 if (ti) {
1022 }
1023}
1024#define PROTO_ITEM_SET_VISIBLE(ti) proto_item_set_visible((ti))
1025
1030static inline bool proto_item_is_generated(proto_item *ti) {
1031 if (ti) {
1033 }
1034 return false;
1035}
1036#define PROTO_ITEM_IS_GENERATED(ti) proto_item_is_generated((ti))
1037
1041static inline void proto_item_set_generated(proto_item *ti) {
1042 if (ti) {
1044 }
1045}
1046#define PROTO_ITEM_SET_GENERATED(ti) proto_item_set_generated((ti))
1047
1053static inline bool proto_item_is_url(proto_item *ti) {
1054 if (ti) {
1055 return FI_GET_FLAG(PITEM_FINFO(ti), FI_URL);
1056 }
1057 return false;
1058}
1059#define PROTO_ITEM_IS_URL(ti) proto_item_is_url((ti))
1060
1064static inline void proto_item_set_url(proto_item *ti) {
1065 if (ti) {
1067 }
1068}
1069#define PROTO_ITEM_SET_URL(ti) proto_item_set_url((ti))
1070
1071typedef void (*proto_tree_foreach_func)(proto_node *, void *);
1072typedef bool (*proto_tree_traverse_func)(proto_node *, void *);
1073
1074WS_DLL_PUBLIC void proto_tree_children_foreach(proto_tree *tree,
1075 proto_tree_foreach_func func, void *data);
1076
1077typedef struct {
1078 void (*register_protoinfo)(void); /* routine to call to register protocol information */
1079 void (*register_handoff)(void); /* routine to call to register dissector handoff */
1080} proto_plugin;
1081
1083WS_DLL_PUBLIC void proto_register_plugin(const proto_plugin *plugin);
1084
1086void proto_init(GSList *register_all_plugin_protocols_list,
1087 GSList *register_all_plugin_handoffs_list, register_cb cb, void *client_data);
1088
1090extern void proto_cleanup(void);
1091
1105WS_DLL_PUBLIC bool proto_field_is_referenced(proto_tree *tree, int proto_id);
1106
1111WS_DLL_PUBLIC proto_tree* proto_item_add_subtree(proto_item *pi, const int idx) G_GNUC_WARN_UNUSED_RESULT;
1112
1116WS_DLL_PUBLIC proto_tree* proto_item_get_subtree(proto_item *pi);
1117
1121WS_DLL_PUBLIC proto_item* proto_item_get_parent(const proto_item *pi);
1122
1127WS_DLL_PUBLIC proto_item* proto_item_get_parent_nth(proto_item *pi, int gen);
1128
1133WS_DLL_PUBLIC void proto_item_set_text(proto_item *pi, const char *format, ...)
1134 G_GNUC_PRINTF(2,3);
1135
1140WS_DLL_PUBLIC void proto_item_append_text(proto_item *pi, const char *format, ...)
1141 G_GNUC_PRINTF(2,3);
1142
1147WS_DLL_PUBLIC void proto_item_prepend_text(proto_item *pi, const char *format, ...)
1148 G_GNUC_PRINTF(2,3);
1149
1153WS_DLL_PUBLIC void proto_item_set_len(proto_item *pi, const int length);
1154
1173WS_DLL_PUBLIC void proto_item_set_end(proto_item *pi, tvbuff_t *tvb, int end);
1174
1179WS_DLL_PUBLIC int proto_item_get_len(const proto_item *pi);
1180
1186WS_DLL_PUBLIC void proto_item_set_bits_offset_len(proto_item *ti, int bits_offset, int bits_len);
1187
1194WS_DLL_PUBLIC char *proto_item_get_display_repr(wmem_allocator_t *scope, proto_item *pi);
1195
1198extern proto_tree* proto_tree_create_root(struct _packet_info *pinfo);
1199
1200void proto_tree_reset(proto_tree *tree);
1201
1204WS_DLL_PUBLIC void proto_tree_free(proto_tree *tree);
1205
1213WS_DLL_PUBLIC bool
1214proto_tree_set_visible(proto_tree *tree, bool visible);
1215
1219extern void
1220proto_tree_set_fake_protocols(proto_tree *tree, bool fake_protocols);
1221
1228extern void
1230
1236extern void
1238
1242WS_DLL_PUBLIC proto_item* proto_tree_get_parent(proto_tree *tree);
1243
1248
1252WS_DLL_PUBLIC proto_tree* proto_tree_get_root(proto_tree *tree);
1253
1258WS_DLL_PUBLIC void proto_tree_move_item(proto_tree *tree, proto_item *fixed_item, proto_item *item_to_move);
1259
1260
1266WS_DLL_PUBLIC void proto_tree_set_appendix(proto_tree *tree, tvbuff_t *tvb, int start, const int length);
1267
1268
1278WS_DLL_PUBLIC proto_item *
1280 const int start, int length, const unsigned encoding);
1281
1282WS_DLL_PUBLIC proto_item *
1283proto_tree_add_item(proto_tree *tree, int hfindex, tvbuff_t *tvb,
1284 const int start, int length, const unsigned encoding);
1285
1298WS_DLL_PUBLIC proto_item *
1300 const int start, int length, const unsigned encoding, int *lenretval);
1301
1302WS_DLL_PUBLIC proto_item *
1303proto_tree_add_item_ret_length(proto_tree *tree, int hfindex, tvbuff_t *tvb,
1304 const int start, int length, const unsigned encoding, int *lenretval);
1305
1337WS_DLL_PUBLIC proto_item *
1338proto_tree_add_item_ret_int(proto_tree *tree, int hfindex, tvbuff_t *tvb,
1339 const int start, int length, const unsigned encoding, int32_t *retval);
1340
1341WS_DLL_PUBLIC proto_item *
1342proto_tree_add_item_ret_int64(proto_tree *tree, int hfindex, tvbuff_t *tvb,
1343 const int start, int length, const unsigned encoding, int64_t *retval);
1344
1345WS_DLL_PUBLIC proto_item *
1346proto_tree_add_item_ret_uint(proto_tree *tree, int hfindex, tvbuff_t *tvb,
1347 const int start, int length, const unsigned encoding, uint32_t *retval);
1348
1349WS_DLL_PUBLIC proto_item *
1350proto_tree_add_item_ret_uint64(proto_tree *tree, int hfindex, tvbuff_t *tvb,
1351 const int start, int length, const unsigned encoding, uint64_t *retval);
1352
1353WS_DLL_PUBLIC proto_item *
1354proto_tree_add_item_ret_varint(proto_tree *tree, int hfindex, tvbuff_t *tvb,
1355 const int start, int length, const unsigned encoding, uint64_t *retval, int *lenretval);
1356
1357WS_DLL_PUBLIC proto_item *
1358proto_tree_add_item_ret_boolean(proto_tree *tree, int hfindex, tvbuff_t *tvb,
1359 const int start, int length, const unsigned encoding, bool *retval);
1360
1361WS_DLL_PUBLIC proto_item *
1362proto_tree_add_item_ret_ipv4(proto_tree *tree, int hfindex, tvbuff_t *tvb,
1363 const int start, int length, const unsigned encoding, ws_in4_addr *retval);
1364
1379WS_DLL_PUBLIC proto_item *
1380proto_tree_add_item_ret_ipv6(proto_tree *tree, int hfindex, tvbuff_t *tvb,
1381 const int start, int length, const unsigned encoding, ws_in6_addr *retval);
1382
1397WS_DLL_PUBLIC proto_item *
1398proto_tree_add_item_ret_ether(proto_tree *tree, int hfindex, tvbuff_t *tvb,
1399 const int start, int length, const unsigned encoding, uint8_t *retval);
1400
1414WS_DLL_PUBLIC proto_item *
1415proto_tree_add_item_ret_float(proto_tree *tree, int hfindex, tvbuff_t *tvb,
1416 const int start, int length,
1417 const unsigned encoding, float *retval);
1418
1432WS_DLL_PUBLIC proto_item *
1433proto_tree_add_item_ret_double(proto_tree *tree, int hfindex, tvbuff_t *tvb,
1434 const int start, int length,
1435 const unsigned encoding, double *retval);
1436
1466WS_DLL_PUBLIC proto_item *
1468 tvbuff_t *tvb, const int start, int length, const unsigned encoding,
1469 wmem_allocator_t *scope, const uint8_t **retval, int *lenretval);
1470
1498WS_DLL_PUBLIC proto_item *
1499proto_tree_add_item_ret_string(proto_tree *tree, int hfindex, tvbuff_t *tvb,
1500 const int start, int length, const unsigned encoding,
1501 wmem_allocator_t *scope, const uint8_t **retval);
1502
1523WS_DLL_PUBLIC proto_item *
1525 tvbuff_t *tvb,
1526 const int start, int length, const unsigned encoding,
1527 wmem_allocator_t *scope, char **retval, int *lenretval);
1528
1546WS_DLL_PUBLIC proto_item *
1548 tvbuff_t *tvb,
1549 const int start, int length, const unsigned encoding,
1550 wmem_allocator_t *scope, char **retval);
1551
1567WS_DLL_PUBLIC proto_item *
1569 tvbuff_t *tvb,
1570 const int start, int length, const unsigned encoding,
1571 wmem_allocator_t *scope, char **retval);
1572
1581proto_item *
1582proto_tree_add_text_internal(proto_tree *tree, tvbuff_t *tvb, int start, int length, const char *format,
1583 ...) G_GNUC_PRINTF(5,6);
1584
1593proto_item *
1595 int length, const char *format, va_list ap) G_GNUC_PRINTF(5, 0);
1596
1606WS_DLL_PUBLIC proto_tree *
1607proto_tree_add_subtree(proto_tree *tree, tvbuff_t *tvb, int start, int length, int idx,
1608 proto_item **tree_item, const char *text);
1609
1620WS_DLL_PUBLIC proto_tree *
1621proto_tree_add_subtree_format(proto_tree *tree, tvbuff_t *tvb, int start, int length, int idx,
1622 proto_item **tree_item, const char *format, ...) G_GNUC_PRINTF(7,8);
1623
1625proto_item *
1626proto_tree_add_format_text(proto_tree *tree, tvbuff_t *tvb, int start, int length);
1627
1629proto_item *
1630proto_tree_add_format_wsp_text(proto_tree *tree, tvbuff_t *tvb, int start, int length);
1631
1641WS_DLL_PUBLIC proto_item *
1642proto_tree_add_none_format(proto_tree *tree, const int hfindex, tvbuff_t *tvb, const int start,
1643 int length, const char *format, ...) G_GNUC_PRINTF(6,7);
1644
1654WS_DLL_PUBLIC proto_item *
1655proto_tree_add_protocol_format(proto_tree *tree, int hfindex, tvbuff_t *tvb, int start,
1656 int length, const char *format, ...) G_GNUC_PRINTF(6,7);
1657
1666WS_DLL_PUBLIC proto_item *
1667proto_tree_add_bytes(proto_tree *tree, int hfindex, tvbuff_t *tvb, int start,
1668 int length, const uint8_t* start_ptr);
1669
1680WS_DLL_PUBLIC proto_item *
1681proto_tree_add_bytes_with_length(proto_tree *tree, int hfindex, tvbuff_t *tvb, int start,
1682 int length, const uint8_t *start_ptr, int ptr_length);
1683
1717WS_DLL_PUBLIC proto_item *
1718proto_tree_add_bytes_item(proto_tree *tree, int hfindex, tvbuff_t *tvb,
1719 const int start, int length, const unsigned encoding,
1720 GByteArray *retval, int *endoff, int *err);
1721
1734WS_DLL_PUBLIC proto_item *
1736 int start, int length, const uint8_t* start_ptr, const char *format,
1737 ...) G_GNUC_PRINTF(7,8);
1738
1750WS_DLL_PUBLIC proto_item *
1751proto_tree_add_bytes_format(proto_tree *tree, int hfindex, tvbuff_t *tvb, int start,
1752 int length, const uint8_t* start_ptr, const char *format, ...) G_GNUC_PRINTF(7,8);
1753
1762WS_DLL_PUBLIC proto_item *
1763proto_tree_add_time(proto_tree *tree, int hfindex, tvbuff_t *tvb, int start,
1764 int length, const nstime_t* value_ptr);
1765
1796WS_DLL_PUBLIC proto_item *
1797proto_tree_add_time_item(proto_tree *tree, int hfindex, tvbuff_t *tvb,
1798 const int start, int length, const unsigned encoding,
1799 nstime_t *retval, int *endoff, int *err);
1800
1801
1814WS_DLL_PUBLIC proto_item *
1816 int start, int length, nstime_t* value_ptr, const char *format, ...)
1817 G_GNUC_PRINTF(7,8);
1818
1831WS_DLL_PUBLIC proto_item *
1832proto_tree_add_time_format(proto_tree *tree, int hfindex, tvbuff_t *tvb, int start,
1833 int length, nstime_t* value_ptr, const char *format, ...) G_GNUC_PRINTF(7,8);
1834
1843WS_DLL_PUBLIC proto_item *
1844proto_tree_add_ipxnet(proto_tree *tree, int hfindex, tvbuff_t *tvb, int start,
1845 int length, uint32_t value);
1846
1859WS_DLL_PUBLIC proto_item *
1861 int start, int length, uint32_t value, const char *format, ...)
1862 G_GNUC_PRINTF(7,8);
1863
1875WS_DLL_PUBLIC proto_item *
1876proto_tree_add_ipxnet_format(proto_tree *tree, int hfindex, tvbuff_t *tvb, int start,
1877 int length, uint32_t value, const char *format, ...) G_GNUC_PRINTF(7,8);
1878
1887WS_DLL_PUBLIC proto_item *
1888proto_tree_add_ipv4(proto_tree *tree, int hfindex, tvbuff_t *tvb, int start,
1889 int length, ws_in4_addr value);
1890
1903WS_DLL_PUBLIC proto_item *
1905 int start, int length, ws_in4_addr value, const char *format, ...)
1906 G_GNUC_PRINTF(7,8);
1907
1919WS_DLL_PUBLIC proto_item *
1920proto_tree_add_ipv4_format(proto_tree *tree, int hfindex, tvbuff_t *tvb, int start,
1921 int length, ws_in4_addr value, const char *format, ...) G_GNUC_PRINTF(7,8);
1922
1931WS_DLL_PUBLIC proto_item *
1932proto_tree_add_ipv6(proto_tree *tree, int hfindex, tvbuff_t *tvb, int start,
1933 int length, const ws_in6_addr *value_ptr);
1934
1947WS_DLL_PUBLIC proto_item *
1949 int start, int length, const ws_in6_addr *value_ptr, const char *format,
1950 ...) G_GNUC_PRINTF(7,8);
1951
1963WS_DLL_PUBLIC proto_item *
1964proto_tree_add_ipv6_format(proto_tree *tree, int hfindex, tvbuff_t *tvb, int start,
1965 int length, const ws_in6_addr *value_ptr, const char *format, ...) G_GNUC_PRINTF(7,8);
1966
1975WS_DLL_PUBLIC proto_item *
1976proto_tree_add_ether(proto_tree *tree, int hfindex, tvbuff_t *tvb, int start,
1977 int length, const uint8_t* value);
1978
1991WS_DLL_PUBLIC proto_item *
1993 int start, int length, const uint8_t* value, const char *format, ...)
1994 G_GNUC_PRINTF(7,8);
1995
2007WS_DLL_PUBLIC proto_item *
2008proto_tree_add_ether_format(proto_tree *tree, int hfindex, tvbuff_t *tvb, int start,
2009 int length, const uint8_t* value, const char *format, ...) G_GNUC_PRINTF(7,8);
2010
2019WS_DLL_PUBLIC proto_item *
2020proto_tree_add_guid(proto_tree *tree, int hfindex, tvbuff_t *tvb, int start,
2021 int length, const e_guid_t *value_ptr);
2022
2035WS_DLL_PUBLIC proto_item *
2037 int start, int length, const e_guid_t *value_ptr, const char *format,
2038 ...) G_GNUC_PRINTF(7,8);
2039
2051WS_DLL_PUBLIC proto_item *
2052proto_tree_add_guid_format(proto_tree *tree, int hfindex, tvbuff_t *tvb, int start,
2053 int length, const e_guid_t *value_ptr, const char *format, ...) G_GNUC_PRINTF(7,8);
2054
2063WS_DLL_PUBLIC proto_item *
2064proto_tree_add_oid(proto_tree *tree, int hfindex, tvbuff_t *tvb, int start,
2065 int length, const uint8_t* value_ptr);
2066
2079WS_DLL_PUBLIC proto_item *
2081 int start, int length, const uint8_t* value_ptr, const char *format,
2082 ...) G_GNUC_PRINTF(7,8);
2083
2095WS_DLL_PUBLIC proto_item *
2096proto_tree_add_oid_format(proto_tree *tree, int hfindex, tvbuff_t *tvb, int start,
2097 int length, const uint8_t* value_ptr, const char *format, ...) G_GNUC_PRINTF(7,8);
2098
2118WS_DLL_PUBLIC proto_item *
2119proto_tree_add_string(proto_tree *tree, int hfindex, tvbuff_t *tvb, int start,
2120 int length, const char* value);
2121
2134WS_DLL_PUBLIC proto_item *
2136 int start, int length, const char* value, const char *format, ...)
2137 G_GNUC_PRINTF(7,8);
2138
2151WS_DLL_PUBLIC proto_item *
2152proto_tree_add_string_format(proto_tree *tree, int hfindex, tvbuff_t *tvb, int start,
2153 int length, const char* value, const char *format, ...) G_GNUC_PRINTF(7,8);
2154
2163WS_DLL_PUBLIC proto_item *
2164proto_tree_add_boolean(proto_tree *tree, int hfindex, tvbuff_t *tvb, int start,
2165 int length, uint64_t value);
2166
2179WS_DLL_PUBLIC proto_item *
2181 tvbuff_t *tvb, int start, int length, uint64_t value,
2182 const char *format, ...) G_GNUC_PRINTF(7,8);
2183
2195WS_DLL_PUBLIC proto_item *
2196proto_tree_add_boolean_format(proto_tree *tree, int hfindex, tvbuff_t *tvb, int start,
2197 int length, uint64_t value, const char *format, ...) G_GNUC_PRINTF(7,8);
2198
2207WS_DLL_PUBLIC proto_item *
2208proto_tree_add_float(proto_tree *tree, int hfindex, tvbuff_t *tvb, int start,
2209 int length, float value);
2210
2223WS_DLL_PUBLIC proto_item *
2225 int start, int length, float value, const char *format, ...)
2226 G_GNUC_PRINTF(7,8);
2227
2239WS_DLL_PUBLIC proto_item *
2240proto_tree_add_float_format(proto_tree *tree, int hfindex, tvbuff_t *tvb, int start,
2241 int length, float value, const char *format, ...) G_GNUC_PRINTF(7,8);
2242
2251WS_DLL_PUBLIC proto_item *
2252proto_tree_add_double(proto_tree *tree, int hfindex, tvbuff_t *tvb, int start,
2253 int length, double value);
2254
2267WS_DLL_PUBLIC proto_item *
2269 int start, int length, double value, const char *format, ...)
2270 G_GNUC_PRINTF(7,8);
2271
2283WS_DLL_PUBLIC proto_item *
2284proto_tree_add_double_format(proto_tree *tree, int hfindex, tvbuff_t *tvb, int start,
2285 int length, double value, const char *format, ...) G_GNUC_PRINTF(7,8);
2286
2295WS_DLL_PUBLIC proto_item *
2296proto_tree_add_uint(proto_tree *tree, int hfindex, tvbuff_t *tvb, int start,
2297 int length, uint32_t value);
2298
2311WS_DLL_PUBLIC proto_item *
2313 int start, int length, uint32_t value, const char *format, ...)
2314 G_GNUC_PRINTF(7,8);
2315
2328WS_DLL_PUBLIC proto_item *
2329proto_tree_add_uint_format(proto_tree *tree, int hfindex, tvbuff_t *tvb, int start,
2330 int length, uint32_t value, const char *format, ...) G_GNUC_PRINTF(7,8);
2331
2340WS_DLL_PUBLIC proto_item *
2341proto_tree_add_uint64(proto_tree *tree, int hfindex, tvbuff_t *tvb, int start,
2342 int length, uint64_t value);
2343
2356WS_DLL_PUBLIC proto_item *
2358 int start, int length, uint64_t value, const char *format, ...)
2359 G_GNUC_PRINTF(7,8);
2360
2372WS_DLL_PUBLIC proto_item *
2373proto_tree_add_uint64_format(proto_tree *tree, int hfindex, tvbuff_t *tvb, int start,
2374 int length, uint64_t value, const char *format, ...) G_GNUC_PRINTF(7,8);
2375
2384WS_DLL_PUBLIC proto_item *
2385proto_tree_add_int(proto_tree *tree, int hfindex, tvbuff_t *tvb, int start,
2386 int length, int32_t value);
2387
2400WS_DLL_PUBLIC proto_item *
2402 int start, int length, int32_t value, const char *format, ...)
2403 G_GNUC_PRINTF(7,8);
2404
2417WS_DLL_PUBLIC proto_item *
2418proto_tree_add_int_format(proto_tree *tree, int hfindex, tvbuff_t *tvb, int start,
2419 int length, int32_t value, const char *format, ...) G_GNUC_PRINTF(7,8);
2420
2429WS_DLL_PUBLIC proto_item *
2430proto_tree_add_int64(proto_tree *tree, int hfindex, tvbuff_t *tvb, int start,
2431 int length, int64_t value);
2432
2445WS_DLL_PUBLIC proto_item *
2447 int start, int length, int64_t value, const char *format, ...)
2448 G_GNUC_PRINTF(7,8);
2449
2461WS_DLL_PUBLIC proto_item *
2462proto_tree_add_int64_format(proto_tree *tree, int hfindex, tvbuff_t *tvb, int start,
2463 int length, int64_t value, const char *format, ...) G_GNUC_PRINTF(7,8);
2464
2473WS_DLL_PUBLIC proto_item *
2474proto_tree_add_eui64(proto_tree *tree, int hfindex, tvbuff_t *tvb, int start,
2475 int length, const uint64_t value);
2476
2489WS_DLL_PUBLIC proto_item *
2491 int start, int length, const uint64_t value, const char *format, ...)
2492 G_GNUC_PRINTF(7,8);
2493
2505WS_DLL_PUBLIC proto_item *
2506proto_tree_add_eui64_format(proto_tree *tree, int hfindex, tvbuff_t *tvb, int start,
2507 int length, const uint64_t value, const char *format, ...) G_GNUC_PRINTF(7,8);
2508
2510typedef struct _mac_hf_list_t {
2511 int *hf_addr; // FT_ETHER, BASE_NONE
2512 int *hf_addr_resolved; // FT_STRING, BASE_NONE
2513 int *hf_oui; // FT_UINT24, BASE_OUI
2514 int *hf_oui_resolved; // FT_STRING, BASE_NONE
2515 int *hf_lg; // FT_BOOLEAN, 24 bits, mask 0x020000
2516 int *hf_ig; // FT_BOOLEAN, 24 bits, mask 0x010000
2518
2528WS_DLL_PUBLIC proto_item *
2529proto_tree_add_mac48_detail(const mac_hf_list_t *list_specific,
2530 const mac_hf_list_t *list_generic,
2531 int idx, tvbuff_t *tvb, proto_tree *tree, int offset);
2532
2539WS_DLL_PUBLIC proto_item *
2540proto_tree_add_debug_text(proto_tree *tree, const char *format,
2541 ...) G_GNUC_PRINTF(2,3);
2542
2548WS_DLL_PUBLIC void
2549proto_item_fill_label(const field_info *finfo, char *label_str, size_t *value_offset);
2550
2558WS_DLL_PUBLIC int
2559proto_item_fill_display_label(const field_info *fi, char *display_label_str, const int label_str_size);
2560
2566WS_DLL_PUBLIC int
2567proto_register_protocol(const char *name, const char *short_name, const char *filter_name);
2568
2583WS_DLL_PUBLIC int
2584proto_register_protocol_in_name_only(const char *name, const char *short_name, const char *filter_name,
2585 int parent_proto, enum ftenum field_type);
2586
2592bool
2593proto_deregister_protocol(const char *short_name);
2594
2599WS_DLL_PUBLIC void
2600proto_register_alias(const int proto_id, const char *alias_name);
2601
2606typedef void (*prefix_initializer_t)(const char* match);
2607
2615WS_DLL_PUBLIC void
2616proto_register_prefix(const char *prefix, prefix_initializer_t initializer);
2617
2619WS_DLL_PUBLIC void proto_initialize_all_prefixes(void);
2620
2625WS_DLL_PUBLIC void
2626proto_register_field_array(const int parent, hf_register_info *hf, const int num_records);
2627
2631WS_DLL_PUBLIC void
2632proto_deregister_field (const int parent, int hf_id);
2633
2636WS_DLL_PUBLIC void
2637proto_add_deregistered_data (void *data);
2638
2642void
2643proto_add_deregistered_slice (size_t block_size, void *mem_block);
2644
2649WS_DLL_PUBLIC void
2650proto_free_field_strings (ftenum_t field_type, unsigned int field_display, const void *field_strings);
2651
2653WS_DLL_PUBLIC void
2655
2659WS_DLL_PUBLIC void
2660proto_register_subtree_array(int * const *indices, const int num_indices);
2661
2665WS_DLL_PUBLIC const char* proto_registrar_get_name(const int n);
2666
2670WS_DLL_PUBLIC const char* proto_registrar_get_abbrev(const int n);
2671
2675WS_DLL_PUBLIC header_field_info* proto_registrar_get_nth(unsigned hfindex);
2676
2680WS_DLL_PUBLIC header_field_info* proto_registrar_get_byname(const char *field_name);
2681
2685WS_DLL_PUBLIC header_field_info* proto_registrar_get_byalias(const char *alias_name);
2686
2690WS_DLL_PUBLIC int proto_registrar_get_id_byname(const char *field_name);
2691
2695WS_DLL_PUBLIC enum ftenum proto_registrar_get_ftype(const int n);
2696
2700WS_DLL_PUBLIC int proto_registrar_get_parent(const int n);
2701
2705WS_DLL_PUBLIC bool proto_registrar_is_protocol(const int n);
2706
2710extern int proto_registrar_get_length(const int n);
2711
2712
2716WS_DLL_PUBLIC int proto_get_first_protocol(void **cookie);
2717WS_DLL_PUBLIC int proto_get_data_protocol(void *cookie);
2718WS_DLL_PUBLIC int proto_get_next_protocol(void **cookie);
2719WS_DLL_PUBLIC header_field_info *proto_get_first_protocol_field(const int proto_id, void **cookie);
2720WS_DLL_PUBLIC header_field_info *proto_get_next_protocol_field(const int proto_id, void **cookie);
2721
2725WS_DLL_PUBLIC bool proto_name_already_registered(const char *name);
2726
2730WS_DLL_PUBLIC int proto_get_id_by_filter_name(const char* filter_name);
2731
2735WS_DLL_PUBLIC int proto_get_id_by_short_name(const char* short_name);
2736
2740WS_DLL_PUBLIC bool proto_can_toggle_protocol(const int proto_id);
2741
2744WS_DLL_PUBLIC protocol_t *find_protocol_by_id(const int proto_id);
2745
2749WS_DLL_PUBLIC const char *proto_get_protocol_name(const int proto_id);
2750
2753WS_DLL_PUBLIC int proto_get_id(const protocol_t *protocol);
2754
2757WS_DLL_PUBLIC const char *proto_get_protocol_short_name(const protocol_t *protocol);
2758
2761WS_DLL_PUBLIC const char *proto_get_protocol_long_name(const protocol_t *protocol);
2762
2765WS_DLL_PUBLIC bool proto_is_protocol_enabled(const protocol_t *protocol);
2766
2769WS_DLL_PUBLIC bool proto_is_protocol_enabled_by_default(const protocol_t *protocol);
2770
2773WS_DLL_PUBLIC bool proto_is_pino(const protocol_t *protocol);
2774
2778WS_DLL_PUBLIC const char *proto_get_protocol_filter_name(const int proto_id);
2779
2785extern void proto_add_heuristic_dissector(protocol_t *protocol, const char *short_name);
2786
2792WS_DLL_PUBLIC void proto_heuristic_dissector_foreach(const protocol_t *protocol, GFunc func,
2793 void *user_data);
2794
2812WS_DLL_PUBLIC void proto_get_frame_protocols(const wmem_list_t *layers,
2813 bool *is_ip, bool *is_tcp, bool *is_udp, bool *is_sctp,
2814 bool *is_tls, bool *is_rtp, bool *is_lte_rlc);
2815
2821WS_DLL_PUBLIC bool proto_is_frame_protocol(const wmem_list_t *layers, const char* proto_name);
2822
2827WS_DLL_PUBLIC char * proto_list_layers(const packet_info *pinfo);
2828
2831WS_DLL_PUBLIC void proto_disable_by_default(const int proto_id);
2832
2836WS_DLL_PUBLIC void proto_set_decoding(const int proto_id, const bool enabled);
2837
2839WS_DLL_PUBLIC void proto_disable_all(void);
2840
2842WS_DLL_PUBLIC void proto_reenable_all(void);
2843
2846WS_DLL_PUBLIC void proto_set_cant_toggle(const int proto_id);
2847
2853extern bool proto_check_for_protocol_or_field(const proto_tree* tree, const int id);
2854
2863WS_DLL_PUBLIC GPtrArray* proto_get_finfo_ptr_array(const proto_tree *tree, const int hfindex);
2864
2869WS_DLL_PUBLIC bool proto_tracking_interesting_fields(const proto_tree *tree);
2870
2880WS_DLL_PUBLIC GPtrArray* proto_find_finfo(proto_tree *tree, const int hfindex);
2881
2891WS_DLL_PUBLIC GPtrArray* proto_find_first_finfo(proto_tree *tree, const int hfindex);
2892
2900WS_DLL_PUBLIC GPtrArray* proto_all_finfos(proto_tree *tree);
2901
2903WS_DLL_PUBLIC void proto_registrar_dump_protocols(void);
2904
2906WS_DLL_PUBLIC void proto_registrar_dump_values(void);
2907
2909WS_DLL_PUBLIC void proto_registrar_dump_elastic(const char* filter);
2910
2913WS_DLL_PUBLIC bool proto_registrar_dump_fieldcount(void);
2914
2916WS_DLL_PUBLIC void proto_registrar_dump_fields(void);
2917
2919WS_DLL_PUBLIC bool proto_registrar_dump_field_completions(const char *prefix);
2920
2922WS_DLL_PUBLIC void proto_registrar_dump_ftypes(void);
2923
2927WS_DLL_PUBLIC const char* proto_field_display_to_string(int field_display);
2928
2931WS_DLL_PUBLIC int num_tree_types;
2932
2934WS_DLL_PUBLIC bool tree_expanded(int tree_type);
2935
2937WS_DLL_PUBLIC void tree_expanded_set(int tree_type, bool value);
2938
2939WS_DLL_PUBLIC int
2940hfinfo_bitshift(const header_field_info *hfinfo);
2941
2942struct epan_dissect;
2943
2948WS_DLL_PUBLIC bool
2949proto_can_match_selected(const field_info *finfo, struct epan_dissect *edt);
2950
2955WS_DLL_PUBLIC char*
2957
2963WS_DLL_PUBLIC field_info*
2964proto_find_field_from_offset(proto_tree *tree, unsigned offset, tvbuff_t *tvb);
2965
2970WS_DLL_PUBLIC char*
2971proto_find_undecoded_data(proto_tree *tree, unsigned length);
2972
2992WS_DLL_PUBLIC proto_item *
2993proto_tree_add_bitmask(proto_tree *tree, tvbuff_t *tvb, const unsigned offset,
2994 const int hf_hdr, const int ett, int * const *fields, const unsigned encoding);
2995
3018WS_DLL_PUBLIC proto_item *
3019proto_tree_add_bitmask_ret_uint64(proto_tree *tree, tvbuff_t *tvb, const unsigned offset,
3020 const int hf_hdr, const int ett, int * const *fields,
3021 const unsigned encoding, uint64_t *retval);
3022
3046WS_DLL_PUBLIC proto_item *
3047proto_tree_add_bitmask_with_flags(proto_tree *tree, tvbuff_t *tvb, const unsigned offset,
3048 const int hf_hdr, const int ett, int * const *fields, const unsigned encoding, const int flags);
3049
3076WS_DLL_PUBLIC proto_item *
3077proto_tree_add_bitmask_with_flags_ret_uint64(proto_tree *tree, tvbuff_t *tvb, const unsigned offset,
3078 const int hf_hdr, const int ett, int * const *fields,
3079 const unsigned encoding, const int flags, uint64_t *retval);
3080
3100WS_DLL_PUBLIC proto_item *
3101proto_tree_add_bitmask_value(proto_tree *tree, tvbuff_t *tvb, const unsigned offset,
3102 const int hf_hdr, const int ett, int * const *fields, const uint64_t value);
3103
3127WS_DLL_PUBLIC proto_item *
3128proto_tree_add_bitmask_value_with_flags(proto_tree *tree, tvbuff_t *tvb, const unsigned offset,
3129 const int hf_hdr, const int ett, int * const *fields, const uint64_t value, const int flags);
3130
3145WS_DLL_PUBLIC void
3146proto_tree_add_bitmask_list(proto_tree *tree, tvbuff_t *tvb, const unsigned offset,
3147 const int len, int * const *fields, const unsigned encoding);
3148
3164WS_DLL_PUBLIC void
3165proto_tree_add_bitmask_list_ret_uint64(proto_tree *tree, tvbuff_t *tvb, const unsigned offset,
3166 const int len, int * const *fields, const unsigned encoding, uint64_t *retval);
3167
3182WS_DLL_PUBLIC void
3183proto_tree_add_bitmask_list_value(proto_tree *tree, tvbuff_t *tvb, const unsigned offset,
3184 const int len, int * const *fields, const uint64_t value);
3185
3186
3208WS_DLL_PUBLIC proto_item *
3209proto_tree_add_bitmask_len(proto_tree *tree, tvbuff_t *tvb, const unsigned offset, const unsigned len,
3210 const int hf_hdr, const int ett, int * const *fields, struct expert_field* exp, const unsigned encoding);
3211
3224WS_DLL_PUBLIC proto_item *
3225proto_tree_add_bitmask_text(proto_tree *tree, tvbuff_t *tvb, const unsigned offset, const unsigned len,
3226 const char *name, const char *fallback,
3227 const int ett, int * const *fields, const unsigned encoding, const int flags);
3228
3229#define BMT_NO_FLAGS 0x00
3230#define BMT_NO_APPEND 0x01
3231#define BMT_NO_INT 0x02
3232#define BMT_NO_FALSE 0x04
3233#define BMT_NO_TFS 0x08
3244WS_DLL_PUBLIC proto_item *
3245proto_tree_add_bits_item(proto_tree *tree, const int hf_index, tvbuff_t *tvb, const unsigned bit_offset,
3246 const int no_of_bits, const unsigned encoding);
3247
3263WS_DLL_PUBLIC proto_item *
3264proto_tree_add_split_bits_item_ret_val(proto_tree *tree, const int hf_index, tvbuff_t *tvb,
3265 const unsigned bit_offset, const crumb_spec_t *crumb_spec, uint64_t *return_value);
3266
3280void
3281proto_tree_add_split_bits_crumb(proto_tree *tree, const int hf_index, tvbuff_t *tvb,
3282 const unsigned bit_offset, const crumb_spec_t *crumb_spec, uint16_t crumb_index);
3283
3294WS_DLL_PUBLIC proto_item *
3295proto_tree_add_bits_ret_val(proto_tree *tree, const int hf_index, tvbuff_t *tvb,
3296 const unsigned bit_offset, const int no_of_bits, uint64_t *return_value, const unsigned encoding);
3297
3310WS_DLL_PUBLIC proto_item *
3312 const unsigned bit_offset, const int no_of_bits, uint32_t value, const unsigned encoding,
3313 const char *format, ...)
3314 G_GNUC_PRINTF(8,9);
3315
3328WS_DLL_PUBLIC proto_item *
3330 const unsigned bit_offset, const int no_of_bits, uint64_t value, const unsigned encoding,
3331 const char *format, ...)
3332 G_GNUC_PRINTF(8,9);
3333
3347proto_item *
3349 const unsigned bit_offset, const int no_of_bits, uint64_t value, const unsigned encoding,
3350 const char *format, ...)
3351 G_GNUC_PRINTF(8,9);
3352
3366proto_item *
3368 const unsigned bit_offset, const int no_of_bits, int32_t value, const unsigned encoding,
3369 const char *format, ...)
3370 G_GNUC_PRINTF(8,9);
3371
3385proto_item *
3387 const unsigned bit_offset, const int no_of_bits, int64_t value, const unsigned encoding,
3388 const char *format, ...)
3389 G_GNUC_PRINTF(8,9);
3390
3404proto_item *
3406 const unsigned bit_offset, const int no_of_bits, float value, const unsigned encoding,
3407 const char *format, ...)
3408 G_GNUC_PRINTF(8,9);
3409
3410
3419WS_DLL_PUBLIC proto_item *
3421 const unsigned bit_offset, const int no_of_chars);
3422
3430WS_DLL_PUBLIC proto_item *
3431proto_tree_add_ascii_7bits_item(proto_tree *tree, const int hfindex, tvbuff_t *tvb,
3432 const unsigned bit_offset, const int no_of_chars);
3433
3451WS_DLL_PUBLIC proto_item *
3452proto_tree_add_checksum(proto_tree *tree, tvbuff_t *tvb, const unsigned offset,
3453 const int hf_checksum, const int hf_checksum_status, struct expert_field* bad_checksum_expert,
3454 packet_info *pinfo, uint32_t computed_checksum, const unsigned encoding, const unsigned flags);
3455
3473WS_DLL_PUBLIC proto_item*
3474proto_tree_add_checksum_bytes(proto_tree *tree, tvbuff_t *tvb, const unsigned offset,
3475 const int hf_checksum, const int hf_checksum_status, struct expert_field* bad_checksum_expert,
3476 packet_info *pinfo, const uint8_t *computed_checksum, size_t checksum_len, const unsigned flags);
3477
3478typedef enum
3479{
3480 PROTO_CHECKSUM_E_BAD = 0,
3481 PROTO_CHECKSUM_E_GOOD,
3482 PROTO_CHECKSUM_E_UNVERIFIED,
3483 PROTO_CHECKSUM_E_NOT_PRESENT,
3484 PROTO_CHECKSUM_E_ILLEGAL
3485} proto_checksum_enum_e;
3486
3487#define PROTO_CHECKSUM_NO_FLAGS 0x00
3488#define PROTO_CHECKSUM_VERIFY 0x01
3489#define PROTO_CHECKSUM_GENERATED 0x02
3490#define PROTO_CHECKSUM_IN_CKSUM 0x04
3491#define PROTO_CHECKSUM_ZERO 0x08
3492#define PROTO_CHECKSUM_NOT_PRESENT 0x10
3494WS_DLL_PUBLIC const value_string proto_checksum_vals[];
3495
3499WS_DLL_PUBLIC unsigned char
3500proto_check_field_name(const char *field_name);
3501
3506WS_DLL_PUBLIC unsigned char
3507proto_check_field_name_lower(const char *field_name);
3508
3509
3518const char *
3519proto_custom_set(proto_tree* tree, GSList *field_id,
3520 int occurrence,
3521 bool display_details,
3522 char *result,
3523 char *expr, const int size );
3524
3530char *
3531proto_custom_get_filter(struct epan_dissect *edt, GSList *field_id, int occurrence);
3532
3535const char *
3536hfinfo_char_value_format_display(int display, char buf[7], uint32_t value);
3537
3538#ifdef __cplusplus
3539}
3540#endif /* __cplusplus */
3541
3542#endif /* proto.h */
3543
3544/*
3545 * Editor modelines - https://www.wireshark.org/tools/modelines.html
3546 *
3547 * Local variables:
3548 * c-basic-offset: 4
3549 * tab-width: 8
3550 * indent-tabs-mode: nil
3551 * End:
3552 *
3553 * vi: set shiftwidth=4 tabstop=8 expandtab:
3554 * :indentSize=4:tabSize=8:noTabs=true:
3555 */
WS_DLL_PUBLIC bool proto_registrar_dump_fieldcount(void)
Definition proto.c:11781
WS_DLL_PUBLIC unsigned char proto_check_field_name_lower(const char *field_name)
Definition proto.c:14044
WS_DLL_PUBLIC int hf_text_only
Definition proto.h:48
WS_DLL_PUBLIC void proto_tree_add_bitmask_list_ret_uint64(proto_tree *tree, tvbuff_t *tvb, const unsigned offset, const int len, int *const *fields, const unsigned encoding, uint64_t *retval)
Definition proto.c:12955
WS_DLL_PUBLIC proto_item WS_DLL_PUBLIC proto_item WS_DLL_PUBLIC proto_item * proto_tree_add_eui64(proto_tree *tree, int hfindex, tvbuff_t *tvb, int start, int length, const uint64_t value)
Definition proto.c:6205
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:12905
#define ITEM_LABEL_LENGTH
Definition proto.h:51
WS_DLL_PUBLIC proto_item * proto_tree_add_string_format_value(proto_tree *tree, int hfindex, tvbuff_t *tvb, int start, int length, const char *value, const char *format,...) G_GNUC_PRINTF(7
WS_DLL_PUBLIC const char * proto_get_protocol_name(const int proto_id)
Definition proto.c:8476
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:8537
WS_DLL_PUBLIC proto_item WS_DLL_PUBLIC proto_item * proto_tree_add_oid_format(proto_tree *tree, int hfindex, tvbuff_t *tvb, int start, int length, const uint8_t *value_ptr, const char *format,...) G_GNUC_PRINTF(7
WS_DLL_PUBLIC bool proto_is_protocol_enabled(const protocol_t *protocol)
Definition proto.c:8632
struct _item_label_t item_label_t
WS_DLL_PUBLIC proto_item * proto_tree_add_int_format_value(proto_tree *tree, int hfindex, tvbuff_t *tvb, int start, int length, int32_t value, const char *format,...) G_GNUC_PRINTF(7
WS_DLL_PUBLIC proto_item WS_DLL_PUBLIC proto_item * proto_tree_add_ether_format(proto_tree *tree, int hfindex, tvbuff_t *tvb, int start, int length, const uint8_t *value, const char *format,...) G_GNUC_PRINTF(7
WS_DLL_PUBLIC proto_item WS_DLL_PUBLIC proto_item * proto_tree_add_ipv4_format(proto_tree *tree, int hfindex, tvbuff_t *tvb, int start, int length, ws_in4_addr value, const char *format,...) G_GNUC_PRINTF(7
proto_item * proto_tree_add_format_wsp_text(proto_tree *tree, tvbuff_t *tvb, int start, int length)
Definition proto.c:1529
WS_DLL_PUBLIC proto_item WS_DLL_PUBLIC proto_item * proto_tree_add_eui64_format(proto_tree *tree, int hfindex, tvbuff_t *tvb, int start, int length, const uint64_t value, const char *format,...) G_GNUC_PRINTF(7
WS_DLL_PUBLIC proto_item * proto_tree_add_time_format_value(proto_tree *tree, int hfindex, tvbuff_t *tvb, int start, int length, nstime_t *value_ptr, const char *format,...) G_GNUC_PRINTF(7
#define FI_URL
Definition proto.h:858
WS_DLL_PUBLIC bool proto_field_is_referenced(proto_tree *tree, int proto_id)
Definition proto.c:901
WS_DLL_PUBLIC void proto_register_subtree_array(int *const *indices, const int num_indices)
Definition proto.c:9783
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:13068
WS_DLL_PUBLIC bool tree_expanded(int tree_type)
Definition proto.c:14050
WS_DLL_PUBLIC proto_item WS_DLL_PUBLIC proto_item proto_item proto_item proto_item proto_item * proto_tree_add_float_bits_format_value(proto_tree *tree, const int hf_index, tvbuff_t *tvb, const unsigned bit_offset, const int no_of_bits, float value, const unsigned encoding, const char *format,...) G_GNUC_PRINTF(8
WS_DLL_PUBLIC proto_item WS_DLL_PUBLIC proto_item WS_DLL_PUBLIC proto_item * proto_tree_add_bytes(proto_tree *tree, int hfindex, tvbuff_t *tvb, int start, int length, const uint8_t *start_ptr)
Definition proto.c:4759
WS_DLL_PUBLIC proto_item * proto_tree_add_item_ret_int(proto_tree *tree, int hfindex, tvbuff_t *tvb, const int start, int length, const unsigned encoding, int32_t *retval)
Definition proto.c:3263
WS_DLL_PUBLIC proto_item * proto_tree_add_bytes_format_value(proto_tree *tree, int hfindex, tvbuff_t *tvb, int start, int length, const uint8_t *start_ptr, const char *format,...) G_GNUC_PRINTF(7
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:13453
WS_DLL_PUBLIC proto_item * proto_tree_add_item_new_ret_length(proto_tree *tree, header_field_info *hfinfo, tvbuff_t *tvb, const int start, int length, const unsigned encoding, int *lenretval)
Definition proto.c:4397
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:13245
WS_DLL_PUBLIC char * proto_list_layers(const packet_info *pinfo)
Definition proto.c:8602
WS_DLL_PUBLIC void proto_deregister_field(const int parent, int hf_id)
Definition proto.c:8796
void proto_tree_prime_with_hfid(proto_tree *tree, const int hfid)
void proto_add_deregistered_slice(size_t block_size, void *mem_block)
Definition proto.c:8832
WS_DLL_PUBLIC int proto_item_get_len(const proto_item *pi)
Definition proto.c:7831
WS_DLL_PUBLIC int proto_get_id_by_short_name(const char *short_name)
Definition proto.c:8462
WS_DLL_PUBLIC 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:13848
WS_DLL_PUBLIC void proto_tree_add_bitmask_list_value(proto_tree *tree, tvbuff_t *tvb, const unsigned offset, const int len, int *const *fields, const uint64_t value)
Definition proto.c:12971
WS_DLL_PUBLIC proto_item * proto_tree_add_boolean_format_value(proto_tree *tree, int hfindex, tvbuff_t *tvb, int start, int length, uint64_t value, const char *format,...) G_GNUC_PRINTF(7
WS_DLL_PUBLIC proto_item WS_DLL_PUBLIC proto_item WS_DLL_PUBLIC proto_item * proto_tree_add_oid(proto_tree *tree, int hfindex, tvbuff_t *tvb, int start, int length, const uint8_t *value_ptr)
Definition proto.c:5250
WS_DLL_PUBLIC bool proto_is_pino(const protocol_t *protocol)
Definition proto.c:8625
WS_DLL_PUBLIC proto_item WS_DLL_PUBLIC proto_item WS_DLL_PUBLIC proto_item * proto_tree_add_uint(proto_tree *tree, int hfindex, tvbuff_t *tvb, int start, int length, uint32_t value)
Definition proto.c:5830
WS_DLL_PUBLIC proto_item WS_DLL_PUBLIC proto_item * proto_tree_add_bytes_format(proto_tree *tree, int hfindex, tvbuff_t *tvb, int start, int length, const uint8_t *start_ptr, const char *format,...) G_GNUC_PRINTF(7
WS_DLL_PUBLIC proto_item WS_DLL_PUBLIC proto_item * proto_tree_add_int_format(proto_tree *tree, int hfindex, tvbuff_t *tvb, int start, int length, int32_t value, const char *format,...) G_GNUC_PRINTF(7
WS_DLL_PUBLIC proto_item WS_DLL_PUBLIC proto_item WS_DLL_PUBLIC proto_item * proto_tree_add_string(proto_tree *tree, int hfindex, tvbuff_t *tvb, int start, int length, const char *value)
Definition proto.c:5353
WS_DLL_PUBLIC proto_item * proto_tree_add_bytes_item(proto_tree *tree, int hfindex, tvbuff_t *tvb, const int start, int length, const unsigned encoding, GByteArray *retval, int *endoff, int *err)
Definition proto.c:4465
int proto_registrar_get_length(const int n)
Definition proto.c:11244
WS_DLL_PUBLIC const char * proto_registrar_get_name(const int n)
Definition proto.c:11195
WS_DLL_PUBLIC void proto_registrar_dump_elastic(const char *filter)
Definition proto.c:11889
WS_DLL_PUBLIC proto_item WS_DLL_PUBLIC proto_item * proto_tree_add_float_format(proto_tree *tree, int hfindex, tvbuff_t *tvb, int start, int length, float value, const char *format,...) G_GNUC_PRINTF(7
WS_DLL_PUBLIC proto_item WS_DLL_PUBLIC void proto_item_fill_label(const field_info *finfo, char *label_str, size_t *value_offset)
Definition proto.c:9933
WS_DLL_PUBLIC void proto_set_decoding(const int proto_id, const bool enabled)
Definition proto.c:8682
WS_DLL_PUBLIC bool proto_name_already_registered(const char *name)
Definition proto.c:8438
WS_DLL_PUBLIC void proto_register_field_array(const int parent, hf_register_info *hf, const int num_records)
Definition proto.c:8762
WS_DLL_PUBLIC GPtrArray * proto_find_first_finfo(proto_tree *tree, const int hfindex)
Definition proto.c:11363
WS_DLL_PUBLIC const char * proto_get_protocol_filter_name(const int proto_id)
Definition proto.c:8504
hf_ref_type
Definition proto.h:753
WS_DLL_PUBLIC void WS_DLL_PUBLIC void proto_item_append_text(proto_item *pi, const char *format,...) G_GNUC_PRINTF(2
WS_DLL_PUBLIC proto_item * proto_tree_add_float_format_value(proto_tree *tree, int hfindex, tvbuff_t *tvb, int start, int length, float value, const char *format,...) G_GNUC_PRINTF(7
WS_DLL_PUBLIC proto_item WS_DLL_PUBLIC proto_item * proto_tree_add_double_format(proto_tree *tree, int hfindex, tvbuff_t *tvb, int start, int length, double value, const char *format,...) G_GNUC_PRINTF(7
WS_DLL_PUBLIC const char * proto_get_protocol_long_name(const protocol_t *protocol)
Definition proto.c:8496
WS_DLL_PUBLIC proto_item * proto_tree_add_ether_format_value(proto_tree *tree, int hfindex, tvbuff_t *tvb, int start, int length, const uint8_t *value, const char *format,...) G_GNUC_PRINTF(7
WS_DLL_PUBLIC enum ftenum proto_registrar_get_ftype(const int n)
Definition proto.c:11213
WS_DLL_PUBLIC proto_item WS_DLL_PUBLIC proto_item * proto_tree_add_guid_format(proto_tree *tree, int hfindex, tvbuff_t *tvb, int start, int length, const e_guid_t *value_ptr, const char *format,...) G_GNUC_PRINTF(7
#define FI_RESET_FLAG(fi, flag)
Definition proto.h:881
WS_DLL_PUBLIC proto_item WS_DLL_PUBLIC proto_item * proto_tree_add_string_format(proto_tree *tree, int hfindex, tvbuff_t *tvb, int start, int length, const char *value, const char *format,...) G_GNUC_PRINTF(7
WS_DLL_PUBLIC void proto_initialize_all_prefixes(void)
Definition proto.c:1000
WS_DLL_PUBLIC proto_item * proto_item_get_parent(const proto_item *pi)
Definition proto.c:7987
WS_DLL_PUBLIC int proto_registrar_get_id_byname(const char *field_name)
Definition proto.c:1084
WS_DLL_PUBLIC proto_item * proto_tree_add_item_ret_display_string_and_length(proto_tree *tree, int hfindex, tvbuff_t *tvb, const int start, int length, const unsigned encoding, wmem_allocator_t *scope, char **retval, int *lenretval)
Definition proto.c:4150
WS_DLL_PUBLIC header_field_info * proto_registrar_get_byalias(const char *alias_name)
Definition proto.c:1053
WS_DLL_PUBLIC proto_item * proto_tree_add_item_ret_float(proto_tree *tree, int hfindex, tvbuff_t *tvb, const int start, int 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:3860
WS_DLL_PUBLIC GPtrArray * proto_all_finfos(proto_tree *tree)
Definition proto.c:11393
WS_DLL_PUBLIC void proto_tree_set_appendix(proto_tree *tree, tvbuff_t *tvb, int start, const int length)
Definition proto.c:8101
WS_DLL_PUBLIC proto_item WS_DLL_PUBLIC proto_item WS_DLL_PUBLIC proto_item * proto_tree_add_float(proto_tree *tree, int hfindex, tvbuff_t *tvb, int start, int length, float value)
Definition proto.c:5700
WS_DLL_PUBLIC void proto_heuristic_dissector_foreach(const protocol_t *protocol, GFunc func, void *user_data)
Definition proto.c:8528
WS_DLL_PUBLIC proto_item * proto_tree_add_ipxnet_format_value(proto_tree *tree, int hfindex, tvbuff_t *tvb, int start, int length, uint32_t value, const char *format,...) G_GNUC_PRINTF(7
WS_DLL_PUBLIC proto_tree * proto_tree_get_parent_tree(proto_tree *tree)
Definition proto.c:8030
WS_DLL_PUBLIC 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:8236
struct _proto_node proto_node
WS_DLL_PUBLIC proto_item WS_DLL_PUBLIC proto_item * proto_tree_add_time_format(proto_tree *tree, int hfindex, tvbuff_t *tvb, int start, int length, nstime_t *value_ptr, const char *format,...) G_GNUC_PRINTF(7
WS_DLL_PUBLIC char * proto_construct_match_selected_string(const field_info *finfo, struct epan_dissect *edt)
Definition proto.c:12418
WS_DLL_PUBLIC const char * proto_get_protocol_short_name(const protocol_t *protocol)
Definition proto.c:8488
WS_DLL_PUBLIC char * proto_find_undecoded_data(proto_tree *tree, unsigned length)
Definition proto.c:11479
WS_DLL_PUBLIC proto_item WS_DLL_PUBLIC proto_item WS_DLL_PUBLIC proto_item * proto_tree_add_int64(proto_tree *tree, int hfindex, tvbuff_t *tvb, int start, int length, int64_t value)
Definition proto.c:6110
WS_DLL_PUBLIC int proto_item_fill_display_label(const field_info *fi, char *display_label_str, const int label_str_size)
Definition proto.c:6952
WS_DLL_PUBLIC bool proto_is_protocol_enabled_by_default(const protocol_t *protocol)
Definition proto.c:8646
WS_DLL_PUBLIC field_info * proto_find_field_from_offset(proto_tree *tree, unsigned offset, tvbuff_t *tvb)
Definition proto.c:11440
WS_DLL_PUBLIC proto_item WS_DLL_PUBLIC proto_item * proto_tree_add_ipxnet_format(proto_tree *tree, int hfindex, tvbuff_t *tvb, int start, int length, uint32_t value, const char *format,...) G_GNUC_PRINTF(7
WS_DLL_PUBLIC void proto_registrar_dump_values(void)
Definition proto.c:11566
WS_DLL_PUBLIC proto_item WS_DLL_PUBLIC proto_item WS_DLL_PUBLIC proto_item * proto_tree_add_guid(proto_tree *tree, int hfindex, tvbuff_t *tvb, int start, int length, const e_guid_t *value_ptr)
Definition proto.c:5173
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:12993
WS_DLL_PUBLIC void tree_expanded_set(int tree_type, bool value)
Definition proto.c:14060
WS_DLL_PUBLIC proto_item * proto_tree_add_item_ret_double(proto_tree *tree, int hfindex, tvbuff_t *tvb, const int start, int 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:3899
WS_DLL_PUBLIC void proto_item_set_bits_offset_len(proto_item *ti, int bits_offset, int bits_len)
Definition proto.c:7842
proto_item proto_item WS_DLL_PUBLIC proto_tree * proto_tree_add_subtree(proto_tree *tree, tvbuff_t *tvb, int start, int length, int idx, proto_item **tree_item, const char *text)
Definition proto.c:1459
#define FI_GET_FLAG(fi, flag)
Definition proto.h:873
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:13423
proto_node proto_item
Definition proto.h:913
WS_DLL_PUBLIC proto_item WS_DLL_PUBLIC proto_item struct _mac_hf_list_t mac_hf_list_t
WS_DLL_PUBLIC proto_item WS_DLL_PUBLIC proto_item WS_DLL_PUBLIC proto_item * proto_tree_add_ipxnet(proto_tree *tree, int hfindex, tvbuff_t *tvb, int start, int length, uint32_t value)
Definition proto.c:4950
WS_DLL_PUBLIC proto_item * proto_tree_add_oid_format_value(proto_tree *tree, int hfindex, tvbuff_t *tvb, int start, int length, const uint8_t *value_ptr, const char *format,...) G_GNUC_PRINTF(7
WS_DLL_PUBLIC int proto_registrar_get_parent(const int n)
Definition proto.c:11222
WS_DLL_PUBLIC proto_item * proto_tree_add_uint64_format_value(proto_tree *tree, int hfindex, tvbuff_t *tvb, int start, int length, uint64_t value, const char *format,...) G_GNUC_PRINTF(7
WS_DLL_PUBLIC proto_tree * proto_item_add_subtree(proto_item *pi, const int idx) G_GNUC_WARN_UNUSED_RESULT
Definition proto.c:7957
proto_item * proto_tree_add_text_internal(proto_tree *tree, tvbuff_t *tvb, int start, int length, const char *format,...) G_GNUC_PRINTF(5
WS_DLL_PUBLIC proto_item * proto_tree_add_double_format_value(proto_tree *tree, int hfindex, tvbuff_t *tvb, int start, int length, double value, const char *format,...) G_GNUC_PRINTF(7
WS_DLL_PUBLIC proto_item WS_DLL_PUBLIC proto_item proto_item proto_item * proto_tree_add_int_bits_format_value(proto_tree *tree, const int hf_index, tvbuff_t *tvb, const unsigned bit_offset, const int no_of_bits, int32_t value, const unsigned encoding, const char *format,...) G_GNUC_PRINTF(8
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,...) G_GNUC_PRINTF(8
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, int offset)
Definition proto.c:6279
WS_DLL_PUBLIC header_field_info * proto_registrar_get_nth(unsigned hfindex)
Definition proto.c:925
#define FI_HIDDEN
Definition proto.h:853
WS_DLL_PUBLIC proto_item * proto_tree_add_item_ret_ether(proto_tree *tree, int hfindex, tvbuff_t *tvb, const int start, int 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:4030
WS_DLL_PUBLIC proto_item WS_DLL_PUBLIC proto_item WS_DLL_PUBLIC proto_item * proto_tree_add_ipv4(proto_tree *tree, int hfindex, tvbuff_t *tvb, int start, int length, ws_in4_addr value)
Definition proto.c:5015
WS_DLL_PUBLIC proto_item * proto_item_get_parent_nth(proto_item *pi, int gen)
Definition proto.c:8009
WS_DLL_PUBLIC unsigned char proto_check_field_name(const char *field_name)
Definition proto.c:14038
WS_DLL_PUBLIC proto_item WS_DLL_PUBLIC proto_item WS_DLL_PUBLIC proto_item * proto_tree_add_double(proto_tree *tree, int hfindex, tvbuff_t *tvb, int start, int length, double value)
Definition proto.c:5765
WS_DLL_PUBLIC proto_item WS_DLL_PUBLIC proto_item WS_DLL_PUBLIC proto_item * proto_tree_add_ipv6(proto_tree *tree, int hfindex, tvbuff_t *tvb, int start, int length, const ws_in6_addr *value_ptr)
Definition proto.c:5082
WS_DLL_PUBLIC proto_item * proto_tree_add_uint_format_value(proto_tree *tree, int hfindex, tvbuff_t *tvb, int start, int length, uint32_t value, const char *format,...) G_GNUC_PRINTF(7
WS_DLL_PUBLIC GPtrArray * proto_get_finfo_ptr_array(const proto_tree *tree, const int hfindex)
Definition proto.c:11273
WS_DLL_PUBLIC proto_item WS_DLL_PUBLIC proto_item proto_item proto_item proto_item proto_item WS_DLL_PUBLIC 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:13782
void proto_tree_set_fake_protocols(proto_tree *tree, bool fake_protocols)
Definition proto.c:887
void proto_tree_prime_with_hfid_print(proto_tree *tree, const int hfid)
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:12845
bool proto_deregister_protocol(const char *short_name)
Definition proto.c:8295
WS_DLL_PUBLIC proto_item * proto_tree_add_guid_format_value(proto_tree *tree, int hfindex, tvbuff_t *tvb, int start, int length, const e_guid_t *value_ptr, const char *format,...) G_GNUC_PRINTF(7
WS_DLL_PUBLIC bool proto_is_frame_protocol(const wmem_list_t *layers, const char *proto_name)
Definition proto.c:8577
WS_DLL_PUBLIC void proto_add_deregistered_data(void *data)
Definition proto.c:8826
field_display_e
Definition proto.h:680
WS_DLL_PUBLIC const char * proto_registrar_get_abbrev(const int n)
Definition proto.c:11204
void(* prefix_initializer_t)(const char *match)
Definition proto.h:2606
WS_DLL_PUBLIC proto_item WS_DLL_PUBLIC proto_item proto_item proto_item proto_item * proto_tree_add_int64_bits_format_value(proto_tree *tree, const int hf_index, tvbuff_t *tvb, const unsigned bit_offset, const int no_of_bits, int64_t value, const unsigned encoding, const char *format,...) G_GNUC_PRINTF(8
proto_item proto_item * proto_tree_add_text_valist_internal(proto_tree *tree, tvbuff_t *tvb, int start, int length, const char *format, va_list ap) G_GNUC_PRINTF(5
WS_DLL_PUBLIC proto_item WS_DLL_PUBLIC proto_item proto_item * proto_tree_add_boolean_bits_format_value(proto_tree *tree, const int hf_index, tvbuff_t *tvb, const unsigned bit_offset, const int no_of_bits, uint64_t value, const unsigned encoding, const char *format,...) G_GNUC_PRINTF(8
WS_DLL_PUBLIC proto_item WS_DLL_PUBLIC proto_item WS_DLL_PUBLIC proto_item * proto_tree_add_int(proto_tree *tree, int hfindex, tvbuff_t *tvb, int start, int length, int32_t value)
Definition proto.c:6015
WS_DLL_PUBLIC bool proto_tree_set_visible(proto_tree *tree, bool visible)
Definition proto.c:877
WS_DLL_PUBLIC proto_item WS_DLL_PUBLIC proto_item * proto_tree_add_int64_format(proto_tree *tree, int hfindex, tvbuff_t *tvb, int start, int length, int64_t value, const char *format,...) G_GNUC_PRINTF(7
void proto_cleanup(void)
Definition proto.c:735
WS_DLL_PUBLIC proto_item * proto_tree_add_time_item(proto_tree *tree, int hfindex, tvbuff_t *tvb, const int start, int length, const unsigned encoding, nstime_t *retval, int *endoff, int *err)
Definition proto.c:4593
WS_DLL_PUBLIC proto_item WS_DLL_PUBLIC proto_item * proto_tree_add_ipv6_format(proto_tree *tree, int hfindex, tvbuff_t *tvb, int start, int length, const ws_in6_addr *value_ptr, const char *format,...) G_GNUC_PRINTF(7
WS_DLL_PUBLIC WS_NORETURN void proto_report_dissector_bug(const char *format,...) G_GNUC_PRINTF(1
WS_DLL_PUBLIC int proto_get_id_by_filter_name(const char *filter_name)
Definition proto.c:8448
void proto_add_heuristic_dissector(protocol_t *protocol, const char *short_name)
Definition proto.c:8514
WS_DLL_PUBLIC proto_tree * proto_item_get_subtree(proto_item *pi)
Definition proto.c:7975
WS_DLL_PUBLIC void proto_tree_free(proto_tree *tree)
Definition proto.c:851
WS_DLL_PUBLIC void proto_registrar_dump_fields(void)
Definition proto.c:12051
WS_DLL_PUBLIC int proto_get_first_protocol(void **cookie)
Definition proto.c:8355
WS_DLL_PUBLIC void WS_DLL_PUBLIC void WS_DLL_PUBLIC void WS_DLL_PUBLIC void proto_item_set_len(proto_item *pi, const int length)
Definition proto.c:7786
WS_DLL_PUBLIC proto_item * proto_tree_add_none_format(proto_tree *tree, const int hfindex, tvbuff_t *tvb, const int start, int length, const char *format,...) G_GNUC_PRINTF(6
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:12833
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:12914
WS_DLL_PUBLIC proto_item * proto_tree_add_item_ret_time_string(proto_tree *tree, int hfindex, tvbuff_t *tvb, const int start, int length, const unsigned encoding, wmem_allocator_t *scope, char **retval)
Definition proto.c:4278
WS_DLL_PUBLIC void proto_tree_move_item(proto_tree *tree, proto_item *fixed_item, proto_item *item_to_move)
Definition proto.c:8054
WS_DLL_PUBLIC 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:13810
proto_node proto_tree
Definition proto.h:911
WS_DLL_PUBLIC char * proto_item_get_display_repr(wmem_allocator_t *scope, proto_item *pi)
Definition proto.c:7851
WS_DLL_PUBLIC bool proto_can_match_selected(const field_info *finfo, struct epan_dissect *edt)
Definition proto.c:12406
WS_DLL_PUBLIC GPtrArray * proto_find_finfo(proto_tree *tree, const int hfindex)
Definition proto.c:11344
WS_DLL_PUBLIC proto_item WS_DLL_PUBLIC proto_item * proto_tree_add_uint64_format(proto_tree *tree, int hfindex, tvbuff_t *tvb, int start, int length, uint64_t value, const char *format,...) G_GNUC_PRINTF(7
proto_tree * proto_tree_create_root(struct _packet_info *pinfo)
Definition proto.c:7863
WS_DLL_PUBLIC void proto_disable_by_default(const int proto_id)
Definition proto.c:8670
WS_DLL_PUBLIC void proto_item_set_text(proto_item *pi, const char *format,...) G_GNUC_PRINTF(2
WS_DLL_PUBLIC proto_item * proto_tree_add_debug_text(proto_tree *tree, const char *format,...) G_GNUC_PRINTF(2
WS_DLL_PUBLIC proto_item * proto_tree_add_bytes_with_length(proto_tree *tree, int hfindex, tvbuff_t *tvb, int start, int length, const uint8_t *start_ptr, int ptr_length)
Definition proto.c:4784
WS_DLL_PUBLIC void WS_DLL_PUBLIC void WS_DLL_PUBLIC void proto_item_prepend_text(proto_item *pi, const char *format,...) G_GNUC_PRINTF(2
WS_DLL_PUBLIC proto_item * proto_tree_add_item_new(proto_tree *tree, header_field_info *hfinfo, tvbuff_t *tvb, const int start, int length, const unsigned encoding)
Definition proto.c:4362
WS_DLL_PUBLIC proto_item * proto_tree_add_int64_format_value(proto_tree *tree, int hfindex, tvbuff_t *tvb, int start, int length, int64_t value, const char *format,...) G_GNUC_PRINTF(7
WS_DLL_PUBLIC void proto_tree_add_bitmask_list(proto_tree *tree, tvbuff_t *tvb, const unsigned offset, const int len, int *const *fields, const unsigned encoding)
Definition proto.c:12942
WS_DLL_PUBLIC proto_item * proto_tree_get_parent(proto_tree *tree)
Definition proto.c:8023
WS_DLL_PUBLIC void proto_register_plugin(const proto_plugin *plugin)
WS_DLL_PUBLIC proto_item * proto_tree_add_item_ret_string_and_length(proto_tree *tree, int hfindex, tvbuff_t *tvb, const int start, int length, const unsigned encoding, wmem_allocator_t *scope, const uint8_t **retval, int *lenretval)
Definition proto.c:4069
WS_DLL_PUBLIC proto_item WS_DLL_PUBLIC proto_item * proto_tree_add_boolean_format(proto_tree *tree, int hfindex, tvbuff_t *tvb, int start, int length, uint64_t value, const char *format,...) G_GNUC_PRINTF(7
WS_DLL_PUBLIC proto_item * proto_tree_add_item_ret_display_string(proto_tree *tree, int hfindex, tvbuff_t *tvb, const int start, int length, const unsigned encoding, wmem_allocator_t *scope, char **retval)
Definition proto.c:4266
WS_DLL_PUBLIC proto_tree * proto_tree_add_subtree_format(proto_tree *tree, tvbuff_t *tvb, int start, int length, int idx, proto_item **tree_item, const char *format,...) G_GNUC_PRINTF(7
WS_DLL_PUBLIC void proto_set_cant_toggle(const int proto_id)
Definition proto.c:8741
WS_DLL_PUBLIC bool proto_tracking_interesting_fields(const proto_tree *tree)
Definition proto.c:11286
WS_DLL_PUBLIC void proto_register_prefix(const char *prefix, prefix_initializer_t initializer)
Definition proto.c:983
WS_DLL_PUBLIC int proto_register_protocol(const char *name, const char *short_name, const char *filter_name)
Definition proto.c:8166
WS_DLL_PUBLIC void proto_registrar_dump_protocols(void)
Definition proto.c:11503
WS_DLL_PUBLIC 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:13945
const char * proto_custom_set(proto_tree *tree, GSList *field_id, int occurrence, bool display_details, char *result, char *expr, const int size)
Definition proto.c:7236
bool proto_check_for_protocol_or_field(const proto_tree *tree, const int id)
Definition proto.c:11255
WS_DLL_PUBLIC proto_item * proto_tree_add_ipv6_format_value(proto_tree *tree, int hfindex, tvbuff_t *tvb, int start, int length, const ws_in6_addr *value_ptr, const char *format,...) G_GNUC_PRINTF(7
WS_DLL_PUBLIC proto_item WS_DLL_PUBLIC proto_item WS_DLL_PUBLIC proto_item * proto_tree_add_time(proto_tree *tree, int hfindex, tvbuff_t *tvb, int start, int length, const nstime_t *value_ptr)
Definition proto.c:4883
char * proto_custom_get_filter(struct epan_dissect *edt, GSList *field_id, int occurrence)
Definition proto.c:7469
WS_DLL_PUBLIC proto_item WS_DLL_PUBLIC proto_item * proto_tree_add_protocol_format(proto_tree *tree, int hfindex, tvbuff_t *tvb, int start, int length, const char *format,...) G_GNUC_PRINTF(6
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:12880
WS_DLL_PUBLIC proto_tree proto_item * proto_tree_add_format_text(proto_tree *tree, tvbuff_t *tvb, int start, int length)
Definition proto.c:1510
WS_DLL_PUBLIC proto_tree * proto_tree_get_root(proto_tree *tree)
Definition proto.c:8044
WS_DLL_PUBLIC proto_item WS_DLL_PUBLIC proto_item * proto_tree_add_uint_format(proto_tree *tree, int hfindex, tvbuff_t *tvb, int start, int length, uint32_t value, const char *format,...) G_GNUC_PRINTF(7
WS_DLL_PUBLIC proto_item WS_DLL_PUBLIC proto_item * proto_tree_add_uint64_bits_format_value(proto_tree *tree, const int hf_index, tvbuff_t *tvb, const unsigned bit_offset, const int no_of_bits, uint64_t value, const unsigned encoding, const char *format,...) G_GNUC_PRINTF(8
WS_DLL_PUBLIC bool proto_registrar_dump_field_completions(const char *prefix)
Definition proto.c:12162
WS_DLL_PUBLIC bool proto_can_toggle_protocol(const int proto_id)
Definition proto.c:8657
void proto_init(GSList *register_all_plugin_protocols_list, GSList *register_all_plugin_handoffs_list, register_cb cb, void *client_data)
Definition proto.c:557
WS_DLL_PUBLIC void proto_registrar_dump_ftypes(void)
Definition proto.c:12227
WS_DLL_PUBLIC proto_item * proto_tree_add_ipv4_format_value(proto_tree *tree, int hfindex, tvbuff_t *tvb, int start, int length, ws_in4_addr value, const char *format,...) G_GNUC_PRINTF(7
WS_DLL_PUBLIC protocol_t * find_protocol_by_id(const int proto_id)
Definition proto.c:8417
WS_DLL_PUBLIC void proto_reenable_all(void)
Definition proto.c:8723
WS_DLL_PUBLIC bool proto_registrar_is_protocol(const int n)
Definition proto.c:11231
WS_DLL_PUBLIC void proto_disable_all(void)
Definition proto.c:8693
WS_DLL_PUBLIC proto_item WS_DLL_PUBLIC proto_item WS_DLL_PUBLIC proto_item * proto_tree_add_uint64(proto_tree *tree, int hfindex, tvbuff_t *tvb, int start, int length, uint64_t value)
Definition proto.c:5923
WS_DLL_PUBLIC header_field_info * proto_registrar_get_byname(const char *field_name)
Definition proto.c:1011
WS_DLL_PUBLIC int num_tree_types
Definition proto.h:2931
#define PITEM_FINFO(proto_item)
Definition proto.h:981
WS_DLL_PUBLIC const char * proto_field_display_to_string(int field_display)
Definition proto.c:9037
WS_DLL_PUBLIC void proto_free_deregistered_fields(void)
Definition proto.c:8988
#define FI_GENERATED
Definition proto.h:856
WS_DLL_PUBLIC proto_item WS_DLL_PUBLIC proto_item WS_DLL_PUBLIC proto_item * proto_tree_add_boolean(proto_tree *tree, int hfindex, tvbuff_t *tvb, int start, int length, uint64_t value)
Definition proto.c:5539
#define FI_SET_FLAG(fi, flag)
Definition proto.h:875
WS_DLL_PUBLIC proto_item * proto_tree_add_item_ret_ipv6(proto_tree *tree, int hfindex, tvbuff_t *tvb, const int start, int length, const unsigned encoding, ws_in6_addr *retval)
Parse an ipv6 address from the buffer and add it to the tree, writing the value to the pointer specif...
Definition proto.c:3991
WS_DLL_PUBLIC proto_item * proto_tree_add_item_ret_string(proto_tree *tree, int hfindex, tvbuff_t *tvb, const int start, int length, const unsigned encoding, wmem_allocator_t *scope, const uint8_t **retval)
Definition proto.c:4140
WS_DLL_PUBLIC int proto_get_id(const protocol_t *protocol)
Definition proto.c:8432
WS_DLL_PUBLIC proto_item * proto_tree_add_eui64_format_value(proto_tree *tree, int hfindex, tvbuff_t *tvb, int start, int length, const uint64_t value, const char *format,...) G_GNUC_PRINTF(7
WS_DLL_PUBLIC void proto_register_alias(const int proto_id, const char *alias_name)
Definition proto.c:8337
WS_DLL_PUBLIC void proto_free_field_strings(ftenum_t field_type, unsigned int field_display, const void *field_strings)
Definition proto.c:8842
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:13045
WS_DLL_PUBLIC void proto_item_set_end(proto_item *pi, tvbuff_t *tvb, int end)
Definition proto.c:7811
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:12807
WS_DLL_PUBLIC proto_item WS_DLL_PUBLIC proto_item WS_DLL_PUBLIC proto_item * proto_tree_add_ether(proto_tree *tree, int hfindex, tvbuff_t *tvb, int start, int length, const uint8_t *value)
Definition proto.c:5468
@ HF_REF_TYPE_INDIRECT
Definition proto.h:755
@ HF_REF_TYPE_NONE
Definition proto.h:754
@ HF_REF_TYPE_DIRECT
Definition proto.h:756
@ HF_REF_TYPE_PRINT
Definition proto.h:757
@ ABSOLUTE_TIME_DOY_UTC
Definition proto.h:713
@ BASE_PT_UDP
Definition proto.h:702
@ BASE_HEX_DEC
Definition proto.h:688
@ BASE_HEX
Definition proto.h:685
@ ABSOLUTE_TIME_NTP_UTC
Definition proto.h:714
@ BASE_EXP
Definition proto.h:690
@ ABSOLUTE_TIME_UTC
Definition proto.h:712
@ BASE_DEC
Definition proto.h:684
@ ABSOLUTE_TIME_UNIX
Definition proto.h:715
@ BASE_PT_TCP
Definition proto.h:703
@ BASE_DEC_HEX
Definition proto.h:687
@ BASE_OUI
Definition proto.h:708
@ SEP_COLON
Definition proto.h:695
@ BASE_PT_SCTP
Definition proto.h:705
@ BASE_NETMASK
Definition proto.h:699
@ ABSOLUTE_TIME_LOCAL
Definition proto.h:711
@ BASE_PT_DCCP
Definition proto.h:704
@ BASE_STR_WSP
Definition proto.h:718
@ BASE_NONE
Definition proto.h:681
@ SEP_DOT
Definition proto.h:693
@ SEP_DASH
Definition proto.h:694
@ SEP_SPACE
Definition proto.h:696
@ BASE_OCT
Definition proto.h:686
@ BASE_CUSTOM
Definition proto.h:689
Definition guid-utils.h:23
Definition ftypes-int.h:17
Definition proto.h:764
uint64_t bitmask
Definition proto.h:774
int same_name_prev_id
Definition proto.h:781
int display
Definition proto.h:769
const void * strings
Definition proto.h:770
const char * name
Definition proto.h:766
hf_ref_type ref_type
Definition proto.h:780
int parent
Definition proto.h:779
enum ftenum type
Definition proto.h:768
const char * abbrev
Definition proto.h:767
const char * blurb
Definition proto.h:775
int id
Definition proto.h:778
header_field_info * same_name_next
Definition proto.h:782
Definition proto.h:806
size_t value_pos
Definition proto.h:808
size_t value_len
Definition proto.h:809
Definition proto.h:2510
Definition packet_info.h:43
Definition plugins.c:29
Definition proto.h:901
Definition proto.c:375
Definition value_string.h:25
Definition wmem_allocator.h:27
Definition wmem_list.c:23
Definition proto.h:838
Definition inet_addr.h:21
Definition epan_dissect.h:28
Definition expert.h:39
Definition proto.h:813
tvbuff_t * ds_tvb
Definition proto.h:822
int proto_layer_num
Definition proto.h:825
int length
Definition proto.h:816
int total_layer_num
Definition proto.h:824
int appendix_start
Definition proto.h:817
uint32_t flags
Definition proto.h:820
const header_field_info * hfinfo
Definition proto.h:814
item_label_t * rep
Definition proto.h:821
int start
Definition proto.h:815
int appendix_length
Definition proto.h:818
int tree_type
Definition proto.h:819
Definition proto.h:800
int * p_id
Definition proto.h:801
header_field_info hfinfo
Definition proto.h:802
Definition nstime.h:26
Definition proto.h:1077
Definition proto.h:892
Definition tvbuff-int.h:35