| Wireshark 4.7.3 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 <gerald@wireshark.org>
6 * Copyright 1998 Gerald Combs
7 *
8 * SPDX-License-Identifier: GPL-2.0-or-later
9 */
10
11
22#pragma once
23#include "wsutil/nstime.h"
24#include "tvbuff.h"
25#include <wsutil/value_string.h>
26#include "packet_info.h"
27#include "ftypes/ftypes.h"
28#include "register.h"
29#include "ws_symbol_export.h"
30#include "ws_attributes.h"
31
32#ifdef __cplusplus
33 extern "C" {
34#endif /* __cplusplus */
35
43
45WS_DLL_PUBLIC int hf_text_only;
46
48#define ITEM_LABEL_LENGTH 240
49
50#define ITEM_LABEL_UNKNOWN_STR "Unknown"
51
52 struct expert_field;
53
54/* Type-check that 'x' is compatible with 'type', should give compiler warnings otherwise. */
55#define cast_same(type, x) (0 ? (type)0 : (x))
56
58#define VALS(x) (cast_same(const struct _value_string*, (x)))
59
61#define VALS64(x) (cast_same(const struct _val64_string*, (x)))
62
64#define VALS_EXT_PTR(x) (cast_same(value_string_ext*, (x)))
65
67#define TIME_VALS(x) (cast_same(const struct _time_value_string*, (x)))
68
70#define TFS(x) (cast_same(const struct true_false_string*, (x)))
71
73#define UNS(x) (cast_same(const struct unit_name_string*, (x)))
74
75 typedef void (*custom_fmt_func_t)(char *, uint32_t);
76
77 typedef void (*custom_fmt_func_64_t)(char *, uint64_t);
78
79 typedef 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
97 struct _protocol;
98
100 typedef struct _protocol protocol_t;
101
112WS_DLL_PUBLIC WS_NORETURN
113 void 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
140
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/* this is for strings with auto-detected base as with strtoul */
474#define ENC_STR_NUM 0x01000000
475/* this is for strings as hex "1a2b3c" */
476#define ENC_STR_HEX 0x02000000
477/* this is for strings as decimal "12345" */
478#define ENC_STR_DEC 0x04000000
479/* a convenience macro for any of the above */
480#define ENC_STRING 0x07000000
481/* Kept around for compatibility for Lua scripts; code should use ENC_CHARENCODING_MASK */
482#define ENC_STR_MASK 0x0000FFFE
483
484/*
485 * For cases where the number is allowed to have a leading '+'/'-'
486 * this can't collide with ENC_SEP_* because they can be used simultaneously
487 *
488 * XXX - this is not used anywhere in Wireshark's code, dating back to
489 * at least Wireshark 2.6 and continuing to the current version.
490 * Perhaps the intent was to use it in the future, but 1) I'm not sure
491 * why it would be combined with ENC_SEP_, as byte arrays have no sign
492 * but integral values do, and 2) if we were to support string encodings
493 * for integral types, presumably whether it's signed (FT_INTn) or
494 * unsigned (FT_UINTn) would suffice to indicate whether the value
495 * can be signed or not.
496 */
497#define ENC_NUM_PREF 0x00200000
498
499/*
500 * Encodings for byte arrays.
501 *
502 * For cases where the byte array is encoded as a string composed of
503 * pairs of hex digits, possibly with a separator character between
504 * the pairs. That's specified by the encoding having ENC_STR_HEX,
505 * plus one of these values, set.
506 *
507 * See hex_str_to_bytes_encoding() in epan/strutil.h for details.
508 */
509#define ENC_SEP_NONE 0x00010000
510#define ENC_SEP_COLON 0x00020000
511#define ENC_SEP_DASH 0x00040000
512#define ENC_SEP_DOT 0x00080000
513#define ENC_SEP_SPACE 0x00100000
514/* a convenience macro for the above */
515#define ENC_SEP_MASK 0x001F0000
516
517/* Encodings for BCD strings
518 * Depending if the BCD string has even or odd number of digits
519 * we may need to strip off the last digit/High nibble.
520 */
521#define ENC_BCD_ODD_NUM_DIG 0x00010000
522#define ENC_BCD_SKIP_FIRST 0x00020000
523
524/*
525 * Encodings for time values.
526 *
527 * Historically FT_TIMEs were only timespecs; the only question was whether
528 * they were stored in big- or little-endian format.
529 *
530 * For backwards compatibility, we interpret an encoding of 1 as meaning
531 * "little-endian timespec", so that passing true is interpreted as that.
532 *
533 * We now support:
534 *
535 * ENC_TIME_SECS_NSECS - 8, 12, or 16 bytes. For 8 bytes, the first 4
536 * bytes are seconds and the next 4 bytes are nanoseconds; for 12 bytes,
537 * the first 8 bytes are seconds and the next 4 bytes are nanoseconds;
538 * for 16 bytes, the first 8 bytes are seconds and the next 8 bytes are
539 * nanoseconds. If the time is absolute, the seconds are seconds since
540 * the UN*X epoch (1970-01-01 00:00:00 UTC). (I.e., a UN*X struct
541 * timespec with a 4-byte or 8-byte time_t or a structure with an
542 * 8-byte time_t and an 8-byte nanoseconds field.)
543 *
544 * ENC_TIME_NTP - 8 bytes; the first 4 bytes are seconds since the NTP
545 * epoch (1900-01-01 00:00:00 GMT) and the next 4 bytes are 1/2^32's of
546 * a second since that second. (I.e., a 64-bit count of 1/2^32's of a
547 * second since the NTP epoch, with the upper 32 bits first and the
548 * lower 32 bits second, even when little-endian.) A value of 0 is a
549 * special case representing unknown or unsynchronized time. Per the
550 * suggestion in RFC 4330, if bit 0 is not set then the time is assumed
551 * to be in NTP Era 1, beginning on 2036-02-07 06:28:16 UTC. (I.e., the
552 * time displayed will be between 1968-01-20 03:14:08 UTC and
553 * 2104-02-26 09:42:24 UTC.) The 16 byte NTP date format and the 4 byte
554 * NTP short relative time format are not supported.
555 * Encodings that store only the seconds since the NTP epoch without
556 * fractional seconds should use ENC_TIME_SECS_NTP, described below.
557 *
558 * ENC_TIME_TOD - 8 bytes, as a count of microseconds since the System/3x0
559 * and z/Architecture epoch (1900-01-01 00:00:00 GMT).
560 *
561 * ENC_TIME_RTPS - 8 bytes; the first 4 bytes are seconds since the UN*X
562 * epoch and the next 4 bytes are 1/2^32's of a second since that
563 * second. (I.e., it's the offspring of a mating between UN*X time and
564 * NTP time). It's used by the Object Management Group's Real-Time
565 * Publish-Subscribe Wire Protocol for the Data Distribution Service.
566 *
567 * ENC_TIME_SECS_USECS - 8 bytes; the first 4 bytes are seconds and the
568 * next 4 bytes are microseconds. If the time is absolute, the seconds
569 * are seconds since the UN*X epoch. (I.e., a UN*X struct timeval with
570 * a 4-byte time_t.)
571 *
572 * ENC_TIME_SECS - 4 to 8 bytes, representing a value in seconds.
573 * If the time is absolute, it's seconds since the UN*X epoch.
574 *
575 * ENC_TIME_MSECS - 6 to 8 bytes, representing a value in milliseconds.
576 * If the time is absolute, it's milliseconds since the UN*X epoch.
577 *
578 * ENC_TIME_USECS - 8 bytes, representing a value in microseconds.
579 * If the time is absolute, it's microseconds since the UN*X epoch.
580 *
581 * ENC_TIME_NSECS - 8 bytes, representing a value in nanoseconds.
582 * If the time is absolute, it's nanoseconds since the UN*X epoch.
583 *
584 * ENC_TIME_SECS_NTP - 4 bytes, representing a count of seconds since
585 * the NTP epoch. As with ENC_TIME_NTP, times are assumed to be in
586 * the upper half of NTP Era 0 or the lower half of NTP Era 1.
587 *
588 * ENC_TIME_RFC_3971 - 8 bytes, representing a count of 1/64ths of a
589 * second since the UN*X epoch; see section 5.3.1 "Timestamp Option"
590 * in RFC 3971.
591 *
592 * ENC_TIME_MSEC_NTP - 6-8 bytes, representing a count of milliseconds since
593 * the NTP epoch. Similar to ENC_TIME_NTP, times before the midpoint of
594 * NTP Era 0 (1968-01-20) are assumed to represent the corresponding
595 * time in NTP Era 1 instead.
596 *
597 * ENC_TIME_MIP6 - 8 bytes; the first 48 bits are seconds since the UN*X epoch
598 * and the remaining 16 bits indicate the number of 1/65536's of a second
599 * since that second.
600 *
601 * ENC_TIME_MP4_FILE_SECS - 4-8 bytes, representing a count of seconds since
602 * January 1, 1904, 00:00:00 UTC.
603 *
604 * ENC_TIME_ZBEE_ZCL - 4-8 bytes, representing a count of seconds since
605 * January 1, 2000, 00:00:00 UTC.
606 *
607 * ENC_TIME_WINDOWS - 8 bytes, representing a count of 100-nanosecond intervals
608 * since January 1, 1601, 00:00:00 UTC. (I.e., a Windows FILETIME struct, with
609 * the low 32 bits first and the high 32 bits second, even when big-endian.)
610 */
611#define ENC_TIME_SECS_NSECS 0x00000000
612#define ENC_TIME_TIMESPEC 0x00000000 /* for backwards source compatibility */
613#define ENC_TIME_NTP 0x00000002
614#define ENC_TIME_TOD 0x00000004
615#define ENC_TIME_RTPS 0x00000008
616#define ENC_TIME_NTP_BASE_ZERO 0x00000008 /* for backwards source compatibility */
617#define ENC_TIME_SECS_USECS 0x00000010
618#define ENC_TIME_TIMEVAL 0x00000010 /* for backwards source compatibility */
619#define ENC_TIME_SECS 0x00000012
620#define ENC_TIME_MSECS 0x00000014
621#define ENC_TIME_SECS_NTP 0x00000018
622#define ENC_TIME_RFC_3971 0x00000020
623#define ENC_TIME_MSEC_NTP 0x00000022
624#define ENC_TIME_MIP6 0x00000024
625#define ENC_TIME_MP4_FILE_SECS 0x00000026
626#define ENC_TIME_CLASSIC_MAC_OS_SECS 0x00000026 /* for backwards source compatibility */
627#define ENC_TIME_NSECS 0x00000028
628#define ENC_TIME_USECS 0x00000030
629#define ENC_TIME_ZBEE_ZCL 0x00000032
630#define ENC_TIME_WINDOWS 0x00000034
631
632/*
633 * For cases where a string encoding contains a timestamp, use one
634 * of these (but only one). These values can collide with the ENC_SEP_
635 * values used when a string encoding contains a byte array, because
636 * you can't do both at the same time. They must not, however,
637 * overlap with the character encoding values.
638 */
639#define ENC_ISO_8601_DATE 0x00010000
640#define ENC_ISO_8601_TIME 0x00020000
641#define ENC_ISO_8601_DATE_TIME 0x00030000
642#define ENC_IMF_DATE_TIME 0x00040000 /* Internet Message Format - RFCs 822, 1123, 2822, 5322 */
643#define ENC_RFC_822 0x00040000 /* backwards compatibility */
644#define ENC_RFC_1123 0x00040000 /* backwards source compatibility - not binary */
645#define ENC_ISO_8601_DATE_TIME_BASIC 0x00100000
646/* a convenience macro for the above - for internal use only */
647#define ENC_STR_TIME_MASK 0x001F0000
648
649/*
650 * Encodings for variable-length integral types.
651 */
652
653/* Use varint format as described in Protobuf protocol
654 * https://developers.google.cn/protocol-buffers/docs/encoding
655 */
656#define ENC_VARINT_PROTOBUF 0x00000002
657/*
658 * Decodes a variable-length integer used in QUIC protocol
659 * See https://tools.ietf.org/html/draft-ietf-quic-transport-08#section-8.1
660 */
661#define ENC_VARINT_QUIC 0x00000004
662 /*
663 * Use "zig-zag" varint format as described in Protobuf protocol
664 * See https://developers.google.com/protocol-buffers/docs/encoding?csw=1#types
665 */
666#define ENC_VARINT_ZIGZAG 0x00000008
667/*
668 * Decodes a variable-length integer used in DTN protocols
669 * See https://www.rfc-editor.org/rfc/rfc6256.html
670 */
671#define ENC_VARINT_SDNV 0x00000010
672
673#define ENC_VARINT_MASK (ENC_VARINT_PROTOBUF|ENC_VARINT_QUIC|ENC_VARINT_ZIGZAG|ENC_VARINT_SDNV)
674
675/* Values for header_field_info.display */
676
677/* For integral types, the display format is a BASE_* field_display_e value
678 * possibly ORed with BASE_*_STRING */
679
681#define FIELD_DISPLAY_E_MASK 0xFF
682
686 typedef enum {
687 BASE_NONE = 0,
688
689/* Integral and float types */
690 BASE_DEC,
691 BASE_HEX,
692 BASE_OCT,
693 BASE_DEC_HEX,
694 BASE_HEX_DEC,
695 BASE_CUSTOM,
696 BASE_EXP,
697
698/* Byte separators */
699 SEP_DOT,
700 SEP_DASH,
701 SEP_COLON,
702 SEP_SPACE,
703
704/* Address types */
705 BASE_NETMASK,
706
707/* Port types */
708 BASE_PT_UDP,
709 BASE_PT_TCP,
710 BASE_PT_DCCP,
711 BASE_PT_SCTP,
712
713/* OUI types */
714 BASE_OUI,
715
716/* Time types */
717 ABSOLUTE_TIME_LOCAL,
718 ABSOLUTE_TIME_UTC,
719 ABSOLUTE_TIME_DOY_UTC,
720 ABSOLUTE_TIME_NTP_UTC,
721 ABSOLUTE_TIME_UNIX,
722
723/* String types */
724 BASE_STR_WSP,
725} field_display_e;
726
727#define FIELD_DISPLAY(d) ((d) & FIELD_DISPLAY_E_MASK)
728
729#define FIELD_DISPLAY_IS_ABSOLUTE_TIME(d) \
730 (FIELD_DISPLAY(d) >= ABSOLUTE_TIME_LOCAL && FIELD_DISPLAY(d) <= ABSOLUTE_TIME_UNIX)
731
732/* Following constants have to be ORed with a field_display_e when dissector
733 * want to use specials value-string MACROs for a header_field_info */
734#define BASE_RANGE_STRING 0x00000100
735#define BASE_EXT_STRING 0x00000200
736#define BASE_VAL64_STRING 0x00000400
737
738#define BASE_ALLOW_ZERO 0x00000800
739
740#define BASE_UNIT_STRING 0x00001000
741
742#define BASE_NO_DISPLAY_VALUE 0x00002000
744
745#define BASE_PROTOCOL_INFO 0x00004000
746
747#define BASE_SPECIAL_VALS 0x00008000
748
749#define BASE_SHOW_ASCII_PRINTABLE 0x00010000
750
751#define BASE_SHOW_UTF_8_PRINTABLE 0x00020000
752
754#define IS_BASE_DUAL(b) ((b)==BASE_DEC_HEX||(b)==BASE_HEX_DEC)
755
757#define IS_BASE_PORT(b) (((b)==BASE_PT_UDP||(b)==BASE_PT_TCP||(b)==BASE_PT_DCCP||(b)==BASE_PT_SCTP))
758
762 typedef enum {
763 HF_REF_TYPE_NONE,
764 HF_REF_TYPE_INDIRECT,
765 HF_REF_TYPE_DIRECT,
766 HF_REF_TYPE_PRINT
767} hf_ref_type;
768
770 typedef struct _header_field_info header_field_info;
771
773 struct _header_field_info {
774 /* ---------- set by dissector --------- */
775 const char *name;
776 const char *abbrev;
777 enum ftenum type;
778 int display;
779 const void *strings;
783 uint64_t bitmask;
784 const char *blurb;
785
786 /* ------- set by proto routines (prefilled by HFILL macro, see below) ------ */
787 int id;
788 int parent;
789 hf_ref_type ref_type;
790 int same_name_prev_id;
791 header_field_info *same_name_next;
792};
793
799#define HFILL -1, 0, HF_REF_TYPE_NONE, -1, NULL
800
801#define HFILL_INIT(hf) \
802 (hf).hfinfo.id = -1; \
803 (hf).hfinfo.parent = 0; \
804 (hf).hfinfo.ref_type = HF_REF_TYPE_NONE; \
805 (hf).hfinfo.same_name_prev_id = -1; \
806 (hf).hfinfo.same_name_next = NULL;
807
809 typedef struct hf_register_info {
810 int *p_id;
811 header_field_info hfinfo;
812} hf_register_info;
813
815 typedef struct _item_label_t {
816 char representation[ITEM_LABEL_LENGTH];
817 size_t value_pos;
818 size_t value_len;
819} item_label_t;
820
822 typedef struct field_info {
823 const header_field_info *hfinfo;
824 unsigned start;
825 unsigned length;
826 unsigned appendix_start;
827 unsigned appendix_length;
828 int tree_type;
829 uint32_t flags;
830 item_label_t *rep;
831 tvbuff_t *ds_tvb;
832 fvalue_t *value;
833 int total_layer_num;
834 int proto_layer_num;
835} field_info;
836
837
847 typedef struct
848{
849 unsigned crumb_bit_offset;
850 uint8_t crumb_bit_length;
851} crumb_spec_t;
852
853/*
854 * Flag fields. Do not assign values greater than 0x000FFFFF unless you
855 * shuffle the expert information upward; see below.
856 */
857
863#define FI_HIDDEN 0x00000001
866#define FI_GENERATED 0x00000002
868#define FI_URL 0x00000004
869
871#define FI_LITTLE_ENDIAN 0x00000008
873#define FI_BIG_ENDIAN 0x00000010
875#define FI_BITS_OFFSET(n) (((n) & 63) << 5)
877/* if 0, it means that field takes fi->length * 8 */
878#define FI_BITS_SIZE(n) (((n) & 63) << 12)
880#define FI_VARINT 0x00040000
881
883#define FI_GET_FLAG(fi, flag) ((fi) ? ((fi)->flags & (flag)) : 0)
885#define FI_SET_FLAG(fi, flag) \
886 do { \
887 if (fi) \
888 (fi)->flags = (fi)->flags | (flag); \
889 } while(0)
890
891#define FI_RESET_FLAG(fi, flag) \
892 do { \
893 if (fi) \
894 (fi)->flags = (fi)->flags & ~(flag); \
895 } while(0)
896
897#define FI_GET_BITS_OFFSET(fi) (FI_GET_FLAG(fi, FI_BITS_OFFSET(63)) >> 5)
898#define FI_GET_BITS_SIZE(fi) (FI_GET_FLAG(fi, FI_BITS_SIZE(63)) >> 12)
899
902 typedef struct {
903 GHashTable *interesting_hfids;
904 bool visible;
905 bool fake_protocols;
906 unsigned count;
907 struct _packet_info *pinfo;
908 tvbuff_t *idle_count_ds_tvb;
909 unsigned max_start;
910 unsigned start_idle_count;
911} tree_data_t;
912
914 typedef struct _proto_node {
915 struct _proto_node *first_child;
916 struct _proto_node *last_child;
917 struct _proto_node *next;
918 struct _proto_node *parent;
919 const header_field_info *hfinfo;
920 field_info *finfo;
921 tree_data_t *tree_data;
922} proto_node;
923
925 typedef proto_node proto_tree;
927 typedef proto_node proto_item;
928
929/*
930 * Expert information.
931 * This is in the flags field; we allocate this from the top down,
932 * so as not to collide with FI_ flags, which are allocated from
933 * the bottom up.
934 */
935
936/* expert severities */
937#define PI_SEVERITY_MASK 0x00F00000
939#define PI_COMMENT 0x00100000
941#define PI_CHAT 0x00200000
943#define PI_NOTE 0x00400000
945#define PI_WARN 0x00600000
947#define PI_ERROR 0x00800000
948
949/* expert "event groups" */
950#define PI_GROUP_MASK 0xFF000000
952#define PI_CHECKSUM 0x01000000
954#define PI_SEQUENCE 0x02000000
956#define PI_RESPONSE_CODE 0x03000000
958#define PI_REQUEST_CODE 0x04000000
960#define PI_UNDECODED 0x05000000
962#define PI_REASSEMBLE 0x06000000
964#define PI_MALFORMED 0x07000000
966#define PI_DEBUG 0x08000000
968#define PI_PROTOCOL 0x09000000
970#define PI_SECURITY 0x0a000000
972#define PI_COMMENTS_GROUP 0x0b000000
974#define PI_DECRYPTION 0x0c000000
976#define PI_ASSUMPTION 0x0d000000
978#define PI_DEPRECATED 0x0e000000
980#define PI_RECEIVE 0x0f000000
982#define PI_INTERFACE 0x10000000
984#define PI_DISSECTOR_BUG 0x11000000
985
986/*
987 * add more, see WSDG: 9.3. How to add an expert item:
988 * https://www.wireshark.org/docs/wsdg_html/#ChDissectExpertInfo
989 */
990
992#define PNODE_FINFO(proto_node) ((proto_node)->finfo)
993
995#define PITEM_FINFO(proto_item) PNODE_FINFO(proto_item)
996
998#define PTREE_FINFO(proto_tree) PNODE_FINFO(proto_tree)
999
1001#define PNODE_HFINFO(proto_node) ((proto_node)->hfinfo)
1002
1004#define PITEM_HFINFO(proto_item) PNODE_HFINFO(proto_item)
1005
1007#define PTREE_HFINFO(proto_tree) PNODE_HFINFO(proto_tree)
1008
1010#define PTREE_DATA(proto_tree) ((proto_tree)->tree_data)
1011
1013#define PNODE_POOL(proto_node) ((proto_node)->tree_data->pinfo->pool)
1014
1020 static inline bool proto_item_is_hidden(const proto_item *ti) {
1021 if (ti && PITEM_FINFO(ti)) {
1022 return FI_GET_FLAG(PITEM_FINFO(ti), FI_HIDDEN);
1023 }
1024 /* XXX - Is a NULL item hidden? */
1025 return true;
1026}
1027#define PROTO_ITEM_IS_HIDDEN(ti) proto_item_is_hidden((ti))
1028
1033 static inline void proto_item_set_hidden(proto_item *ti) {
1034 if (ti) {
1035 FI_SET_FLAG(PITEM_FINFO(ti), FI_HIDDEN);
1036 }
1037}
1038#define PROTO_ITEM_SET_HIDDEN(ti) proto_item_set_hidden((ti))
1039
1043 static inline void proto_item_set_visible(proto_item *ti) {
1044 if (ti) {
1045 FI_RESET_FLAG(PITEM_FINFO(ti), FI_HIDDEN);
1046 }
1047}
1048#define PROTO_ITEM_SET_VISIBLE(ti) proto_item_set_visible((ti))
1049
1054 static inline bool proto_item_is_generated(const proto_item *ti)
1055{
1056 if (ti) {
1057 return FI_GET_FLAG(PITEM_FINFO(ti), FI_GENERATED);
1058 }
1059 return false;
1060}
1061#define PROTO_ITEM_IS_GENERATED(ti) proto_item_is_generated((ti))
1062
1066 static inline void proto_item_set_generated(proto_item *ti) {
1067 if (ti) {
1068 FI_SET_FLAG(PITEM_FINFO(ti), FI_GENERATED);
1069 }
1070}
1071#define PROTO_ITEM_SET_GENERATED(ti) proto_item_set_generated((ti))
1072
1078 static inline bool proto_item_is_url(const proto_item *ti)
1079{
1080 if (ti) {
1081 return FI_GET_FLAG(PITEM_FINFO(ti), FI_URL);
1082 }
1083 return false;
1084}
1085#define PROTO_ITEM_IS_URL(ti) proto_item_is_url((ti))
1086
1090 static inline void proto_item_set_url(proto_item *ti) {
1091 if (ti) {
1092 FI_SET_FLAG(PITEM_FINFO(ti), FI_URL);
1093 }
1094}
1095#define PROTO_ITEM_SET_URL(ti) proto_item_set_url((ti))
1096
1102 typedef void (*proto_tree_foreach_func)(proto_node *node, void *data);
1103
1110 typedef bool (*proto_tree_traverse_func)(proto_node *node, void *data);
1111
1119WS_DLL_PUBLIC void proto_tree_children_foreach(proto_tree *tree,
1120 proto_tree_foreach_func func, void *data);
1121
1125 typedef struct {
1129 void (*register_protoinfo)(void);
1130
1134 void (*register_handoff)(void);
1135} proto_plugin;
1136
1144WS_DLL_PUBLIC void proto_register_plugin(const proto_plugin *plugin);
1145
1151 void proto_pre_init(void);
1152
1173 void proto_init(GSList *register_all_plugin_protocols_list,
1174 GSList *register_all_plugin_handoffs_list,
1175 register_entity_func register_func, register_entity_func handoff_func,
1176 register_cb cb, void *client_data);
1177
1183 extern void proto_cleanup(void);
1184
1190 typedef void (*proto_execute_in_directory_func)(void* param);
1191
1202WS_DLL_PUBLIC void proto_execute_in_directory(const char* dir, proto_execute_in_directory_func func, void* param);
1203
1204
1218WS_DLL_PUBLIC bool proto_field_is_referenced(proto_tree *tree, int proto_id);
1219
1224WS_DLL_PUBLIC proto_tree* proto_item_add_subtree(proto_item *pi, const int idx) G_GNUC_WARN_UNUSED_RESULT;
1225
1229WS_DLL_PUBLIC proto_tree* proto_item_get_subtree(proto_item *pi);
1230
1234WS_DLL_PUBLIC proto_item* proto_item_get_parent(const proto_item *pi);
1235
1240WS_DLL_PUBLIC proto_item* proto_item_get_parent_nth(proto_item *pi, int gen);
1241
1246WS_DLL_PUBLIC void proto_item_set_text(proto_item *pi, const char *format, ...)
1247 G_GNUC_PRINTF(2,3);
1248
1253WS_DLL_PUBLIC void proto_item_append_text(proto_item *pi, const char *format, ...)
1254 G_GNUC_PRINTF(2,3);
1255
1260WS_DLL_PUBLIC void proto_item_prepend_text(proto_item *pi, const char *format, ...)
1261 G_GNUC_PRINTF(2,3);
1262
1266WS_DLL_PUBLIC void proto_item_set_len(proto_item *pi, const unsigned length);
1267
1289WS_DLL_PUBLIC void proto_item_set_end(proto_item *pi, tvbuff_t *tvb, unsigned end);
1290
1306WS_DLL_PUBLIC unsigned proto_item_get_len(const proto_item *pi);
1307
1313WS_DLL_PUBLIC void proto_item_set_bits_offset_len(proto_item *ti, int bits_offset, int bits_len);
1314
1327WS_DLL_PUBLIC char *proto_item_get_display_repr(wmem_allocator_t *scope, proto_item *pi);
1328
1335WS_DLL_PUBLIC proto_tree *proto_tree_create_root(packet_info *pinfo);
1336
1343 void proto_tree_reset(proto_tree *tree);
1344
1350WS_DLL_PUBLIC void proto_tree_free(proto_tree *tree);
1351
1359WS_DLL_PUBLIC bool
1360 proto_tree_set_visible(proto_tree *tree, bool visible);
1361
1365extern void
1366 proto_tree_set_fake_protocols(proto_tree *tree, bool fake_protocols);
1367
1374extern void
1375proto_tree_prime_with_hfid(proto_tree *tree, const int hfid);
1376
1382extern void
1383proto_tree_prime_with_hfid_print(proto_tree *tree, const int hfid);
1384
1388WS_DLL_PUBLIC proto_item* proto_tree_get_parent(proto_tree *tree);
1389
1393WS_DLL_PUBLIC proto_tree *proto_tree_get_parent_tree(proto_tree *tree);
1394
1398WS_DLL_PUBLIC proto_tree* proto_tree_get_root(proto_tree *tree);
1399
1404WS_DLL_PUBLIC void proto_tree_move_item(proto_tree *tree, proto_item *fixed_item, proto_item *item_to_move);
1405
1406
1416WS_DLL_PUBLIC void proto_tree_set_appendix(proto_tree *tree, tvbuff_t *tvb, unsigned start, const unsigned length);
1417
1418
1428WS_DLL_PUBLIC proto_item *
1429 proto_tree_add_item_new(proto_tree *tree, header_field_info *hfinfo, tvbuff_t *tvb,
1430 const unsigned start, int length, const unsigned encoding);
1431
1453WS_DLL_PUBLIC proto_item *
1454 proto_tree_add_item(proto_tree *tree, int hfindex, tvbuff_t *tvb,
1455 const unsigned start, int length, const unsigned encoding);
1456
1469WS_DLL_PUBLIC proto_item *
1470 proto_tree_add_item_new_ret_length(proto_tree *tree, header_field_info *hfinfo, tvbuff_t *tvb,
1471 const unsigned start, int length, const unsigned encoding, unsigned *lenretval);
1472
1485WS_DLL_PUBLIC proto_item *
1486 proto_tree_add_item_ret_length(proto_tree *tree, int hfindex, tvbuff_t *tvb,
1487 const unsigned start, int length, const unsigned encoding, unsigned *lenretval);
1488
1520WS_DLL_PUBLIC proto_item *
1521 proto_tree_add_item_ret_int(proto_tree *tree, int hfindex, tvbuff_t *tvb,
1522 const unsigned start, unsigned length, const unsigned encoding, int32_t *retval);
1523
1536WS_DLL_PUBLIC proto_item *
1537 proto_tree_add_item_ret_int64(proto_tree *tree, int hfindex, tvbuff_t *tvb,
1538 const unsigned start, unsigned length, const unsigned encoding, int64_t *retval);
1539
1553WS_DLL_PUBLIC proto_item *
1554 proto_tree_add_item_ret_uint(proto_tree *tree, int hfindex, tvbuff_t *tvb,
1555 const unsigned start, unsigned length, const unsigned encoding, uint32_t *retval);
1556
1572WS_DLL_PUBLIC proto_item *
1573 proto_tree_add_item_ret_uint32(proto_tree *tree, int hfindex, tvbuff_t *tvb,
1574 const unsigned start, unsigned length, const unsigned encoding, uint32_t *retval);
1575
1588WS_DLL_PUBLIC proto_item *
1589 proto_tree_add_item_ret_uint8(proto_tree *tree, int hfindex, tvbuff_t *tvb,
1590 const unsigned start, unsigned length, const unsigned encoding, uint8_t *retval);
1591
1604WS_DLL_PUBLIC proto_item *
1605 proto_tree_add_item_ret_uint16(proto_tree *tree, int hfindex, tvbuff_t *tvb,
1606 const unsigned start, unsigned length, const unsigned encoding, uint16_t *retval);
1607
1620WS_DLL_PUBLIC proto_item *
1621 proto_tree_add_item_ret_uint64(proto_tree *tree, int hfindex, tvbuff_t *tvb,
1622 const unsigned start, unsigned length, const unsigned encoding, uint64_t *retval);
1623
1647WS_DLL_PUBLIC proto_item *
1648 proto_tree_add_item_ret_varint(proto_tree *tree, int hfindex, tvbuff_t *tvb,
1649 const unsigned start, unsigned length, const unsigned encoding, uint64_t *retval, unsigned *lenretval);
1650
1663WS_DLL_PUBLIC proto_item *
1664 proto_tree_add_item_ret_boolean(proto_tree *tree, int hfindex, tvbuff_t *tvb,
1665 const unsigned start, unsigned length, const unsigned encoding, bool *retval);
1666
1680WS_DLL_PUBLIC proto_item *
1681 proto_tree_add_item_ret_ipv4(proto_tree *tree, int hfindex, tvbuff_t *tvb,
1682 const unsigned start, unsigned length, const unsigned encoding, ws_in4_addr *retval);
1683
1698WS_DLL_PUBLIC proto_item *
1699 proto_tree_add_item_ret_ipv6(proto_tree *tree, int hfindex, tvbuff_t *tvb,
1700 const unsigned start, unsigned length, const unsigned encoding, ws_in6_addr *retval);
1701
1716WS_DLL_PUBLIC proto_item *
1717 proto_tree_add_item_ret_ether(proto_tree *tree, int hfindex, tvbuff_t *tvb,
1718 const unsigned start, unsigned length, const unsigned encoding, uint8_t *retval);
1719
1733WS_DLL_PUBLIC proto_item *
1734 proto_tree_add_item_ret_float(proto_tree *tree, int hfindex, tvbuff_t *tvb,
1735 const unsigned start, unsigned length,
1736 const unsigned encoding, float *retval);
1737
1751WS_DLL_PUBLIC proto_item *
1752 proto_tree_add_item_ret_double(proto_tree *tree, int hfindex, tvbuff_t *tvb,
1753 const unsigned start, unsigned length,
1754 const unsigned encoding, double *retval);
1755
1785WS_DLL_PUBLIC proto_item *
1786 proto_tree_add_item_ret_string_and_length(proto_tree *tree, int hfindex,
1787 tvbuff_t *tvb, const unsigned start, int length, const unsigned encoding,
1788 wmem_allocator_t *scope, const uint8_t **retval, unsigned *lenretval);
1789
1817WS_DLL_PUBLIC proto_item *
1818 proto_tree_add_item_ret_string(proto_tree *tree, int hfindex, tvbuff_t *tvb,
1819 const unsigned start, int length, const unsigned encoding,
1820 wmem_allocator_t *scope, const uint8_t **retval);
1821
1842WS_DLL_PUBLIC proto_item *
1843 proto_tree_add_item_ret_display_string_and_length(proto_tree *tree, int hfindex,
1844 tvbuff_t *tvb,
1845 const unsigned start, int length, const unsigned encoding,
1846 wmem_allocator_t *scope, char **retval, unsigned *lenretval);
1847
1865WS_DLL_PUBLIC proto_item *
1866 proto_tree_add_item_ret_display_string(proto_tree *tree, int hfindex,
1867 tvbuff_t *tvb,
1868 const unsigned start, int length, const unsigned encoding,
1869 wmem_allocator_t *scope, char **retval);
1870
1886WS_DLL_PUBLIC proto_item *
1887 proto_tree_add_item_ret_time_string(proto_tree *tree, int hfindex,
1888 tvbuff_t *tvb,
1889 const unsigned start, int length, const unsigned encoding,
1890 wmem_allocator_t *scope, char **retval);
1891
1900 proto_item *
1901 proto_tree_add_text_internal(proto_tree *tree, tvbuff_t *tvb, unsigned start, unsigned length, const char *format,
1902 ...) G_GNUC_PRINTF(5,6);
1903
1912 proto_item *
1913 proto_tree_add_text_valist_internal(proto_tree *tree, tvbuff_t *tvb, unsigned start,
1914 unsigned length, const char *format, va_list ap) G_GNUC_PRINTF(5, 0);
1915
1925WS_DLL_PUBLIC proto_tree *
1926 proto_tree_add_subtree(proto_tree *tree, tvbuff_t *tvb, unsigned start, int length, int idx,
1927 proto_item **tree_item, const char *text);
1928
1939WS_DLL_PUBLIC proto_tree *
1940 proto_tree_add_subtree_format(proto_tree *tree, tvbuff_t *tvb, unsigned start, int length, int idx,
1941 proto_item **tree_item, const char *format, ...) G_GNUC_PRINTF(7,8);
1942
1944WS_DLL_PUBLIC proto_item *
1945 proto_tree_add_format_text(proto_tree *tree, tvbuff_t *tvb, unsigned start, unsigned length);
1946
1948WS_DLL_PUBLIC proto_item *
1949 proto_tree_add_format_wsp_text(proto_tree *tree, tvbuff_t *tvb, unsigned start, unsigned length);
1950
1960WS_DLL_PUBLIC proto_item *
1961 proto_tree_add_none_format(proto_tree *tree, const int hfindex, tvbuff_t *tvb, const unsigned start,
1962 int length, const char *format, ...) G_GNUC_PRINTF(6,7);
1963
1973WS_DLL_PUBLIC proto_item *
1974 proto_tree_add_protocol_format(proto_tree *tree, int hfindex, tvbuff_t *tvb, unsigned start,
1975 int length, const char *format, ...) G_GNUC_PRINTF(6,7);
1976
1985WS_DLL_PUBLIC proto_item *
1986 proto_tree_add_bytes(proto_tree *tree, int hfindex, tvbuff_t *tvb, unsigned start,
1987 int length, const uint8_t* start_ptr);
1988
1999WS_DLL_PUBLIC proto_item *
2000 proto_tree_add_bytes_with_length(proto_tree *tree, int hfindex, tvbuff_t *tvb, unsigned start,
2001 int length, const uint8_t *start_ptr, int ptr_length);
2002
2036WS_DLL_PUBLIC proto_item *
2037 proto_tree_add_bytes_item(proto_tree *tree, int hfindex, tvbuff_t *tvb,
2038 const unsigned start, unsigned length, const unsigned encoding,
2039 GByteArray *retval, unsigned *endoff, int *err);
2040
2054WS_DLL_PUBLIC proto_item *
2055 proto_tree_add_bytes_format_value(proto_tree *tree, int hfindex, tvbuff_t *tvb,
2056 unsigned start, int length, const uint8_t* start_ptr, const char *format,
2057 ...) G_GNUC_PRINTF(7,8);
2058
2071WS_DLL_PUBLIC proto_item *
2072 proto_tree_add_bytes_format(proto_tree *tree, int hfindex, tvbuff_t *tvb, unsigned start,
2073 int length, const uint8_t* start_ptr, const char *format, ...) G_GNUC_PRINTF(7,8);
2074
2083WS_DLL_PUBLIC proto_item *
2084 proto_tree_add_time(proto_tree *tree, int hfindex, tvbuff_t *tvb, unsigned start,
2085 unsigned length, const nstime_t* value_ptr);
2086
2117WS_DLL_PUBLIC proto_item *
2118 proto_tree_add_time_item(proto_tree *tree, int hfindex, tvbuff_t *tvb,
2119 const unsigned start, const unsigned length, const unsigned encoding,
2120 nstime_t *retval, unsigned *endoff, int *err);
2121
2122
2135WS_DLL_PUBLIC proto_item *
2136 proto_tree_add_time_format_value(proto_tree *tree, int hfindex, tvbuff_t *tvb,
2137 unsigned start, unsigned length, nstime_t* value_ptr, const char *format, ...)
2138 G_GNUC_PRINTF(7,8);
2139
2152WS_DLL_PUBLIC proto_item *
2153 proto_tree_add_time_format(proto_tree *tree, int hfindex, tvbuff_t *tvb, unsigned start,
2154 unsigned length, nstime_t* value_ptr, const char *format, ...) G_GNUC_PRINTF(7,8);
2155
2164WS_DLL_PUBLIC proto_item *
2165 proto_tree_add_ipxnet(proto_tree *tree, int hfindex, tvbuff_t *tvb, unsigned start,
2166 unsigned length, uint32_t value);
2167
2180WS_DLL_PUBLIC proto_item *
2181 proto_tree_add_ipxnet_format_value(proto_tree *tree, int hfindex, tvbuff_t *tvb,
2182 unsigned start, unsigned length, uint32_t value, const char *format, ...)
2183 G_GNUC_PRINTF(7,8);
2184
2196WS_DLL_PUBLIC proto_item *
2197 proto_tree_add_ipxnet_format(proto_tree *tree, int hfindex, tvbuff_t *tvb, unsigned start,
2198 unsigned length, uint32_t value, const char *format, ...) G_GNUC_PRINTF(7,8);
2199
2208WS_DLL_PUBLIC proto_item *
2209 proto_tree_add_ipv4(proto_tree *tree, int hfindex, tvbuff_t *tvb, unsigned start,
2210 unsigned length, ws_in4_addr value);
2211
2224WS_DLL_PUBLIC proto_item *
2225 proto_tree_add_ipv4_format_value(proto_tree *tree, int hfindex, tvbuff_t *tvb,
2226 unsigned start, unsigned length, ws_in4_addr value, const char *format, ...)
2227 G_GNUC_PRINTF(7,8);
2228
2240WS_DLL_PUBLIC proto_item *
2241 proto_tree_add_ipv4_format(proto_tree *tree, int hfindex, tvbuff_t *tvb, unsigned start,
2242 unsigned length, ws_in4_addr value, const char *format, ...) G_GNUC_PRINTF(7,8);
2243
2252WS_DLL_PUBLIC proto_item *
2253 proto_tree_add_ipv6(proto_tree *tree, int hfindex, tvbuff_t *tvb, unsigned start,
2254 unsigned length, const ws_in6_addr *value_ptr);
2255
2268WS_DLL_PUBLIC proto_item *
2269 proto_tree_add_ipv6_format_value(proto_tree *tree, int hfindex, tvbuff_t *tvb,
2270 unsigned start, unsigned length, const ws_in6_addr *value_ptr, const char *format,
2271 ...) G_GNUC_PRINTF(7,8);
2272
2284WS_DLL_PUBLIC proto_item *
2285 proto_tree_add_ipv6_format(proto_tree *tree, int hfindex, tvbuff_t *tvb, unsigned start,
2286 unsigned length, const ws_in6_addr *value_ptr, const char *format, ...) G_GNUC_PRINTF(7,8);
2287
2296WS_DLL_PUBLIC proto_item *
2297 proto_tree_add_ether(proto_tree *tree, int hfindex, tvbuff_t *tvb, unsigned start,
2298 unsigned length, const uint8_t* value);
2299
2312WS_DLL_PUBLIC proto_item *
2313 proto_tree_add_ether_format_value(proto_tree *tree, int hfindex, tvbuff_t *tvb,
2314 unsigned start, unsigned length, const uint8_t* value, const char *format, ...)
2315 G_GNUC_PRINTF(7,8);
2316
2328WS_DLL_PUBLIC proto_item *
2329 proto_tree_add_ether_format(proto_tree *tree, int hfindex, tvbuff_t *tvb, unsigned start,
2330 unsigned length, const uint8_t* value, const char *format, ...) G_GNUC_PRINTF(7,8);
2331
2340WS_DLL_PUBLIC proto_item *
2341 proto_tree_add_guid(proto_tree *tree, int hfindex, tvbuff_t *tvb, unsigned start,
2342 unsigned length, const e_guid_t *value_ptr);
2343
2356WS_DLL_PUBLIC proto_item *
2357 proto_tree_add_guid_format_value(proto_tree *tree, int hfindex, tvbuff_t *tvb,
2358 unsigned start, unsigned length, const e_guid_t *value_ptr, const char *format,
2359 ...) G_GNUC_PRINTF(7,8);
2360
2372WS_DLL_PUBLIC proto_item *
2373 proto_tree_add_guid_format(proto_tree *tree, int hfindex, tvbuff_t *tvb, unsigned start,
2374 unsigned length, const e_guid_t *value_ptr, const char *format, ...) G_GNUC_PRINTF(7,8);
2375
2384WS_DLL_PUBLIC proto_item *
2385 proto_tree_add_oid(proto_tree *tree, int hfindex, tvbuff_t *tvb, unsigned start,
2386 unsigned length, const uint8_t* value_ptr);
2387
2400WS_DLL_PUBLIC proto_item *
2401 proto_tree_add_oid_format_value(proto_tree *tree, int hfindex, tvbuff_t *tvb,
2402 unsigned start, unsigned length, const uint8_t* value_ptr, const char *format,
2403 ...) G_GNUC_PRINTF(7,8);
2404
2416WS_DLL_PUBLIC proto_item *
2417 proto_tree_add_oid_format(proto_tree *tree, int hfindex, tvbuff_t *tvb, unsigned start,
2418 unsigned length, const uint8_t* value_ptr, const char *format, ...) G_GNUC_PRINTF(7,8);
2419
2439WS_DLL_PUBLIC proto_item *
2440 proto_tree_add_string(proto_tree *tree, int hfindex, tvbuff_t *tvb, unsigned start,
2441 int length, const char* value);
2442
2455WS_DLL_PUBLIC proto_item *
2456 proto_tree_add_string_format_value(proto_tree *tree, int hfindex, tvbuff_t *tvb,
2457 unsigned start, int length, const char* value, const char *format, ...)
2458 G_GNUC_PRINTF(7,8);
2459
2472WS_DLL_PUBLIC proto_item *
2473 proto_tree_add_string_format(proto_tree *tree, int hfindex, tvbuff_t *tvb, unsigned start,
2474 int length, const char* value, const char *format, ...) G_GNUC_PRINTF(7,8);
2475
2484WS_DLL_PUBLIC proto_item *
2485 proto_tree_add_boolean(proto_tree *tree, int hfindex, tvbuff_t *tvb, unsigned start,
2486 unsigned length, uint64_t value);
2487
2500WS_DLL_PUBLIC proto_item *
2501 proto_tree_add_boolean_format_value(proto_tree *tree, int hfindex,
2502 tvbuff_t *tvb, unsigned start, unsigned length, uint64_t value,
2503 const char *format, ...) G_GNUC_PRINTF(7,8);
2504
2516WS_DLL_PUBLIC proto_item *
2517 proto_tree_add_boolean_format(proto_tree *tree, int hfindex, tvbuff_t *tvb, unsigned start,
2518 unsigned length, uint64_t value, const char *format, ...) G_GNUC_PRINTF(7,8);
2519
2528WS_DLL_PUBLIC proto_item *
2529 proto_tree_add_float(proto_tree *tree, int hfindex, tvbuff_t *tvb, unsigned start,
2530 unsigned length, float value);
2531
2544WS_DLL_PUBLIC proto_item *
2545 proto_tree_add_float_format_value(proto_tree *tree, int hfindex, tvbuff_t *tvb,
2546 unsigned start, unsigned length, float value, const char *format, ...)
2547 G_GNUC_PRINTF(7,8);
2548
2560WS_DLL_PUBLIC proto_item *
2561 proto_tree_add_float_format(proto_tree *tree, int hfindex, tvbuff_t *tvb, unsigned start,
2562 unsigned length, float value, const char *format, ...) G_GNUC_PRINTF(7,8);
2563
2572WS_DLL_PUBLIC proto_item *
2573 proto_tree_add_double(proto_tree *tree, int hfindex, tvbuff_t *tvb, unsigned start,
2574 unsigned length, double value);
2575
2588WS_DLL_PUBLIC proto_item *
2589 proto_tree_add_double_format_value(proto_tree *tree, int hfindex, tvbuff_t *tvb,
2590 unsigned start, unsigned length, double value, const char *format, ...)
2591 G_GNUC_PRINTF(7,8);
2592
2604WS_DLL_PUBLIC proto_item *
2605 proto_tree_add_double_format(proto_tree *tree, int hfindex, tvbuff_t *tvb, unsigned start,
2606 unsigned length, double value, const char *format, ...) G_GNUC_PRINTF(7,8);
2607
2616WS_DLL_PUBLIC proto_item *
2617 proto_tree_add_uint(proto_tree *tree, int hfindex, tvbuff_t *tvb, unsigned start,
2618 unsigned length, uint32_t value);
2619
2632WS_DLL_PUBLIC proto_item *
2633 proto_tree_add_uint_format_value(proto_tree *tree, int hfindex, tvbuff_t *tvb,
2634 unsigned start, unsigned length, uint32_t value, const char *format, ...)
2635 G_GNUC_PRINTF(7,8);
2636
2649WS_DLL_PUBLIC proto_item *
2650 proto_tree_add_uint_format(proto_tree *tree, int hfindex, tvbuff_t *tvb, unsigned start,
2651 unsigned length, uint32_t value, const char *format, ...) G_GNUC_PRINTF(7,8);
2652
2661WS_DLL_PUBLIC proto_item *
2662 proto_tree_add_uint64(proto_tree *tree, int hfindex, tvbuff_t *tvb, unsigned start,
2663 unsigned length, uint64_t value);
2664
2677WS_DLL_PUBLIC proto_item *
2678 proto_tree_add_uint64_format_value(proto_tree *tree, int hfindex, tvbuff_t *tvb,
2679 unsigned start, unsigned length, uint64_t value, const char *format, ...)
2680 G_GNUC_PRINTF(7,8);
2681
2693WS_DLL_PUBLIC proto_item *
2694 proto_tree_add_uint64_format(proto_tree *tree, int hfindex, tvbuff_t *tvb, unsigned start,
2695 unsigned length, uint64_t value, const char *format, ...) G_GNUC_PRINTF(7,8);
2696
2705WS_DLL_PUBLIC proto_item *
2706 proto_tree_add_int(proto_tree *tree, int hfindex, tvbuff_t *tvb, unsigned start,
2707 unsigned length, int32_t value);
2708
2721WS_DLL_PUBLIC proto_item *
2722 proto_tree_add_int_format_value(proto_tree *tree, int hfindex, tvbuff_t *tvb,
2723 unsigned start, unsigned length, int32_t value, const char *format, ...)
2724 G_GNUC_PRINTF(7,8);
2725
2738WS_DLL_PUBLIC proto_item *
2739 proto_tree_add_int_format(proto_tree *tree, int hfindex, tvbuff_t *tvb, unsigned start,
2740 unsigned length, int32_t value, const char *format, ...) G_GNUC_PRINTF(7,8);
2741
2750WS_DLL_PUBLIC proto_item *
2751 proto_tree_add_int64(proto_tree *tree, int hfindex, tvbuff_t *tvb, unsigned start,
2752 unsigned length, int64_t value);
2753
2766WS_DLL_PUBLIC proto_item *
2767 proto_tree_add_int64_format_value(proto_tree *tree, int hfindex, tvbuff_t *tvb,
2768 unsigned start, unsigned length, int64_t value, const char *format, ...)
2769 G_GNUC_PRINTF(7,8);
2770
2782WS_DLL_PUBLIC proto_item *
2783 proto_tree_add_int64_format(proto_tree *tree, int hfindex, tvbuff_t *tvb, unsigned start,
2784 unsigned length, int64_t value, const char *format, ...) G_GNUC_PRINTF(7,8);
2785
2794WS_DLL_PUBLIC proto_item *
2795 proto_tree_add_eui64(proto_tree *tree, int hfindex, tvbuff_t *tvb, unsigned start,
2796 unsigned length, const uint64_t value);
2797
2810WS_DLL_PUBLIC proto_item *
2811 proto_tree_add_eui64_format_value(proto_tree *tree, int hfindex, tvbuff_t *tvb,
2812 unsigned start, unsigned length, const uint64_t value, const char *format, ...)
2813 G_GNUC_PRINTF(7,8);
2814
2826WS_DLL_PUBLIC proto_item *
2827 proto_tree_add_eui64_format(proto_tree *tree, int hfindex, tvbuff_t *tvb, unsigned start,
2828 unsigned length, const uint64_t value, const char *format, ...) G_GNUC_PRINTF(7,8);
2829
2831typedef struct _mac_hf_list_t {
2832 int *hf_addr; // FT_ETHER, BASE_NONE
2833 int *hf_addr_resolved; // FT_STRING, BASE_NONE
2834 int *hf_oui; // FT_UINT24, BASE_OUI
2835 int *hf_oui_resolved; // FT_STRING, BASE_NONE
2836 int *hf_lg; // FT_BOOLEAN, 24 bits, mask 0x020000
2837 int *hf_ig; // FT_BOOLEAN, 24 bits, mask 0x010000
2838} mac_hf_list_t;
2839
2849WS_DLL_PUBLIC proto_item *
2850 proto_tree_add_mac48_detail(const mac_hf_list_t *list_specific,
2851 const mac_hf_list_t *list_generic,
2852 int idx, tvbuff_t *tvb, proto_tree *tree, unsigned offset);
2853
2860WS_DLL_PUBLIC proto_item *
2861 proto_tree_add_debug_text(proto_tree *tree, const char *format,
2862 ...) G_GNUC_PRINTF(2,3);
2863
2869WS_DLL_PUBLIC void
2870 proto_item_fill_label(const field_info *finfo, char *label_str, size_t *value_offset);
2871
2879WS_DLL_PUBLIC int
2880 proto_item_fill_display_label(const field_info *fi, char *display_label_str, const int label_str_size);
2881
2887WS_DLL_PUBLIC int
2888 proto_register_protocol(const char *name, const char *short_name, const char *filter_name);
2889
2904WS_DLL_PUBLIC int
2905 proto_register_protocol_in_name_only(const char *name, const char *short_name, const char *filter_name,
2906 int parent_proto, enum ftenum field_type);
2907
2913 bool
2914 proto_deregister_protocol(const char *short_name);
2915
2920WS_DLL_PUBLIC void
2921 proto_register_alias(const int proto_id, const char *alias_name);
2922
2927typedef void (*prefix_initializer_t)(const char* match);
2928
2936WS_DLL_PUBLIC void
2937 proto_register_prefix(const char *prefix, prefix_initializer_t initializer);
2938
2940WS_DLL_PUBLIC void proto_initialize_all_prefixes(void);
2941
2946WS_DLL_PUBLIC void
2947 proto_register_field_array(const int parent, hf_register_info *hf, const int num_records);
2948
2952WS_DLL_PUBLIC void
2953 proto_deregister_field (const int parent, int hf_id);
2954
2957WS_DLL_PUBLIC void
2958 proto_add_deregistered_data (void *data);
2959
2964WS_DLL_PUBLIC void
2965 proto_deregister_all_fields_with_prefix(const int parent, const char *prefix);
2966
2970 void
2971 proto_add_deregistered_slice (size_t block_size, void *mem_block);
2972
2977WS_DLL_PUBLIC void
2978 proto_free_field_strings (ftenum_t field_type, unsigned int field_display, const void *field_strings);
2979
2986WS_DLL_PUBLIC void
2987 proto_free_deregistered_fields (void);
2988
2992WS_DLL_PUBLIC void
2993 proto_register_subtree_array(int * const *indices, const int num_indices);
2994
2998WS_DLL_PUBLIC const char* proto_registrar_get_name(const int n);
2999
3003WS_DLL_PUBLIC const char* proto_registrar_get_abbrev(const int n);
3004
3008WS_DLL_PUBLIC header_field_info* proto_registrar_get_nth(unsigned hfindex);
3009
3013WS_DLL_PUBLIC header_field_info* proto_registrar_get_byname(const char *field_name);
3014
3018WS_DLL_PUBLIC header_field_info* proto_registrar_get_byalias(const char *alias_name);
3019
3023WS_DLL_PUBLIC int proto_registrar_get_id_byname(const char *field_name);
3024
3028WS_DLL_PUBLIC enum ftenum proto_registrar_get_ftype(const int n);
3029
3033WS_DLL_PUBLIC int proto_registrar_get_parent(const int n);
3034
3038WS_DLL_PUBLIC bool proto_registrar_is_protocol(const int n);
3039
3043WS_DLL_PUBLIC int proto_registrar_get_length(const int n);
3044
3048struct proto_registrar_stats {
3049 size_t protocol_count;
3050 size_t deregistered_count;
3051 size_t same_name_count;
3052};
3053
3057WS_DLL_PUBLIC size_t proto_registrar_get_count(struct proto_registrar_stats *stats);
3058
3070WS_DLL_PUBLIC int proto_get_first_protocol(void **cookie);
3071
3079WS_DLL_PUBLIC int proto_get_data_protocol(void *cookie);
3080
3089WS_DLL_PUBLIC int proto_get_next_protocol(void **cookie);
3090
3102WS_DLL_PUBLIC header_field_info *proto_get_first_protocol_field(const int proto_id, void **cookie);
3103
3114WS_DLL_PUBLIC header_field_info *proto_get_next_protocol_field(const int proto_id, void **cookie);
3115
3119WS_DLL_PUBLIC bool proto_name_already_registered(const char *name);
3120
3124WS_DLL_PUBLIC int proto_get_id_by_filter_name(const char* filter_name);
3125
3129WS_DLL_PUBLIC int proto_get_id_by_short_name(const char* short_name);
3130
3134WS_DLL_PUBLIC bool proto_can_toggle_protocol(const int proto_id);
3135
3138WS_DLL_PUBLIC protocol_t *find_protocol_by_id(const int proto_id);
3139
3143WS_DLL_PUBLIC const char *proto_get_protocol_name(const int proto_id);
3144
3147WS_DLL_PUBLIC int proto_get_id(const protocol_t *protocol);
3148
3151WS_DLL_PUBLIC const char *proto_get_protocol_short_name(const protocol_t *protocol);
3152
3155WS_DLL_PUBLIC const char *proto_get_protocol_long_name(const protocol_t *protocol);
3156
3159WS_DLL_PUBLIC bool proto_is_protocol_enabled(const protocol_t *protocol);
3160
3163WS_DLL_PUBLIC bool proto_is_protocol_enabled_by_default(const protocol_t *protocol);
3164
3167WS_DLL_PUBLIC bool proto_is_pino(const protocol_t *protocol);
3168
3176 extern bool proto_is_bytes_pino(const protocol_t *protocol);
3177
3181WS_DLL_PUBLIC const char *proto_get_protocol_filter_name(const int proto_id);
3182
3188 extern void proto_add_heuristic_dissector(protocol_t *protocol, const char *short_name);
3189
3195WS_DLL_PUBLIC void proto_heuristic_dissector_foreach(const protocol_t *protocol, GFunc func,
3196 void *user_data);
3197
3215WS_DLL_PUBLIC void proto_get_frame_protocols(const wmem_list_t *layers,
3216 bool *is_ip, bool *is_tcp, bool *is_udp, bool *is_sctp,
3217 bool *is_tls, bool *is_rtp, bool *is_lte_rlc);
3218
3224WS_DLL_PUBLIC bool proto_is_frame_protocol(const wmem_list_t *layers, const char* proto_name);
3225
3230WS_DLL_PUBLIC char * proto_list_layers(const packet_info *pinfo);
3231
3239WS_DLL_PUBLIC uint8_t proto_get_layer_num(const packet_info *pinfo, const int proto_id);
3240
3243WS_DLL_PUBLIC void proto_disable_by_default(const int proto_id);
3244
3248WS_DLL_PUBLIC void proto_set_decoding(const int proto_id, const bool enabled);
3249
3251WS_DLL_PUBLIC void proto_disable_all(void);
3252
3254WS_DLL_PUBLIC void proto_reenable_all(void);
3255
3258WS_DLL_PUBLIC void proto_set_cant_toggle(const int proto_id);
3259
3265 extern bool proto_check_for_protocol_or_field(const proto_tree* tree, const int id);
3266
3275WS_DLL_PUBLIC GPtrArray* proto_get_finfo_ptr_array(const proto_tree *tree, const int hfindex);
3276
3281WS_DLL_PUBLIC bool proto_tracking_interesting_fields(const proto_tree *tree);
3282
3292WS_DLL_PUBLIC GPtrArray* proto_find_finfo(proto_tree *tree, const int hfindex);
3293
3303WS_DLL_PUBLIC GPtrArray* proto_find_first_finfo(proto_tree *tree, const int hfindex);
3304
3312WS_DLL_PUBLIC GPtrArray* proto_all_finfos(proto_tree *tree);
3313
3315WS_DLL_PUBLIC void proto_registrar_dump_protocols(void);
3316
3318WS_DLL_PUBLIC void proto_registrar_dump_values(void);
3319
3321WS_DLL_PUBLIC void proto_registrar_dump_elastic(const char* filter);
3322
3325WS_DLL_PUBLIC bool proto_registrar_dump_fieldcount(void);
3326
3328WS_DLL_PUBLIC void proto_registrar_dump_fields(void);
3329
3338WS_DLL_PUBLIC bool proto_registrar_dump_field_completions(const char *prefix);
3339
3344WS_DLL_PUBLIC void proto_registrar_dump_ftypes(void);
3345
3353WS_DLL_PUBLIC const char *proto_field_display_to_string(int field_display);
3354
3358WS_DLL_PUBLIC int num_tree_types;
3359
3365WS_DLL_PUBLIC bool tree_expanded(int tree_type);
3366
3373WS_DLL_PUBLIC void tree_expanded_set(int tree_type, bool value);
3374
3383WS_DLL_PUBLIC int
3384 hfinfo_bitshift(const header_field_info *hfinfo);
3385
3386 struct epan_dissect;
3387
3392WS_DLL_PUBLIC bool
3393 proto_can_match_selected(const field_info *finfo, struct epan_dissect *edt);
3394
3399WS_DLL_PUBLIC char*
3400 proto_construct_match_selected_string(const field_info *finfo, struct epan_dissect *edt);
3401
3407WS_DLL_PUBLIC field_info*
3408 proto_find_field_from_offset(proto_tree *tree, unsigned offset, tvbuff_t *tvb);
3409
3414WS_DLL_PUBLIC char*
3415 proto_find_undecoded_data(proto_tree *tree, unsigned length);
3416
3436WS_DLL_PUBLIC proto_item *
3437 proto_tree_add_bitmask(proto_tree *tree, tvbuff_t *tvb, const unsigned offset,
3438 const int hf_hdr, const int ett, int * const *fields, const unsigned encoding);
3439
3462WS_DLL_PUBLIC proto_item *
3463 proto_tree_add_bitmask_ret_uint64(proto_tree *tree, tvbuff_t *tvb, const unsigned offset,
3464 const int hf_hdr, const int ett, int * const *fields,
3465 const unsigned encoding, uint64_t *retval);
3466
3490WS_DLL_PUBLIC proto_item *
3491 proto_tree_add_bitmask_with_flags(proto_tree *tree, tvbuff_t *tvb, const unsigned offset,
3492 const int hf_hdr, const int ett, int * const *fields, const unsigned encoding, const int flags);
3493
3520WS_DLL_PUBLIC proto_item *
3521 proto_tree_add_bitmask_with_flags_ret_uint64(proto_tree *tree, tvbuff_t *tvb, const unsigned offset,
3522 const int hf_hdr, const int ett, int * const *fields,
3523 const unsigned encoding, const int flags, uint64_t *retval);
3524
3544WS_DLL_PUBLIC proto_item *
3545 proto_tree_add_bitmask_value(proto_tree *tree, tvbuff_t *tvb, const unsigned offset,
3546 const int hf_hdr, const int ett, int * const *fields, const uint64_t value);
3547
3571WS_DLL_PUBLIC proto_item *
3572 proto_tree_add_bitmask_value_with_flags(proto_tree *tree, tvbuff_t *tvb, const unsigned offset,
3573 const int hf_hdr, const int ett, int * const *fields, const uint64_t value, const int flags);
3574
3589WS_DLL_PUBLIC void
3590 proto_tree_add_bitmask_list(proto_tree *tree, tvbuff_t *tvb, const unsigned offset,
3591 const unsigned len, int * const *fields, const unsigned encoding);
3592
3608WS_DLL_PUBLIC void
3609 proto_tree_add_bitmask_list_ret_uint64(proto_tree *tree, tvbuff_t *tvb, const unsigned offset,
3610 const unsigned len, int * const *fields, const unsigned encoding, uint64_t *retval);
3611
3626WS_DLL_PUBLIC void
3627 proto_tree_add_bitmask_list_value(proto_tree *tree, tvbuff_t *tvb, const unsigned offset,
3628 const unsigned len, int * const *fields, const uint64_t value);
3629
3630
3652WS_DLL_PUBLIC proto_item *
3653 proto_tree_add_bitmask_len(proto_tree *tree, tvbuff_t *tvb, const unsigned offset, const unsigned len,
3654 const int hf_hdr, const int ett, int * const *fields, struct expert_field* exp, const unsigned encoding);
3655
3668WS_DLL_PUBLIC proto_item *
3669 proto_tree_add_bitmask_text(proto_tree *tree, tvbuff_t *tvb, const unsigned offset, const unsigned len,
3670 const char *name, const char *fallback,
3671 const int ett, int * const *fields, const unsigned encoding, const int flags);
3672
3673#define BMT_NO_FLAGS 0x00
3674#define BMT_NO_APPEND 0x01
3675#define BMT_NO_INT 0x02
3676#define BMT_NO_FALSE 0x04
3677#define BMT_NO_TFS 0x08
3678
3688WS_DLL_PUBLIC proto_item *
3689 proto_tree_add_bits_item(proto_tree *tree, const int hf_index, tvbuff_t *tvb, const unsigned bit_offset,
3690 const int no_of_bits, const unsigned encoding);
3691
3707WS_DLL_PUBLIC proto_item *
3708 proto_tree_add_split_bits_item_ret_val(proto_tree *tree, const int hf_index, tvbuff_t *tvb,
3709 const unsigned bit_offset, const crumb_spec_t *crumb_spec, uint64_t *return_value);
3710
3724WS_DLL_PUBLIC void
3725 proto_tree_add_split_bits_crumb(proto_tree *tree, const int hf_index, tvbuff_t *tvb,
3726 const unsigned bit_offset, const crumb_spec_t *crumb_spec, uint16_t crumb_index);
3727
3738WS_DLL_PUBLIC proto_item *
3739 proto_tree_add_bits_ret_val(proto_tree *tree, const int hf_index, tvbuff_t *tvb,
3740 const unsigned bit_offset, const int no_of_bits, uint64_t *return_value, const unsigned encoding);
3741
3754WS_DLL_PUBLIC proto_item *
3755 proto_tree_add_uint_bits_format_value(proto_tree *tree, const int hf_index, tvbuff_t *tvb,
3756 const unsigned bit_offset, const int no_of_bits, uint32_t value, const unsigned encoding,
3757 const char *format, ...)
3758 G_GNUC_PRINTF(8,9);
3759
3772WS_DLL_PUBLIC proto_item *
3773 proto_tree_add_uint64_bits_format_value(proto_tree *tree, const int hf_index, tvbuff_t *tvb,
3774 const unsigned bit_offset, const int no_of_bits, uint64_t value, const unsigned encoding,
3775 const char *format, ...)
3776 G_GNUC_PRINTF(8,9);
3777
3791WS_DLL_PUBLIC proto_item *
3792 proto_tree_add_boolean_bits_format_value(proto_tree *tree, const int hf_index, tvbuff_t *tvb,
3793 const unsigned bit_offset, const int no_of_bits, uint64_t value, const unsigned encoding,
3794 const char *format, ...)
3795 G_GNUC_PRINTF(8,9);
3796
3810WS_DLL_PUBLIC proto_item *
3811 proto_tree_add_int_bits_format_value(proto_tree *tree, const int hf_index, tvbuff_t *tvb,
3812 const unsigned bit_offset, const int no_of_bits, int32_t value, const unsigned encoding,
3813 const char *format, ...)
3814 G_GNUC_PRINTF(8,9);
3815
3829WS_DLL_PUBLIC proto_item *
3830 proto_tree_add_int64_bits_format_value(proto_tree *tree, const int hf_index, tvbuff_t *tvb,
3831 const unsigned bit_offset, const int no_of_bits, int64_t value, const unsigned encoding,
3832 const char *format, ...)
3833 G_GNUC_PRINTF(8,9);
3834
3848WS_DLL_PUBLIC proto_item *
3849 proto_tree_add_float_bits_format_value(proto_tree *tree, const int hf_index, tvbuff_t *tvb,
3850 const unsigned bit_offset, const int no_of_bits, float value, const unsigned encoding,
3851 const char *format, ...)
3852 G_GNUC_PRINTF(8,9);
3853
3854
3863WS_DLL_PUBLIC proto_item *
3864 proto_tree_add_ts_23_038_7bits_packed_item(proto_tree *tree, const int hfindex, tvbuff_t *tvb,
3865 const unsigned bit_offset, const int no_of_chars);
3866
3874WS_DLL_PUBLIC proto_item *
3875 proto_tree_add_ascii_7bits_item(proto_tree *tree, const int hfindex, tvbuff_t *tvb,
3876 const unsigned bit_offset, const int no_of_chars);
3877
3892WS_DLL_PUBLIC proto_item *
3893 proto_tree_add_checksum(proto_tree *tree, tvbuff_t *tvb, const unsigned offset,
3894 const int hf_checksum, const int hf_checksum_status, struct expert_field* bad_checksum_expert,
3895 packet_info *pinfo, uint32_t computed_checksum, const unsigned encoding, const unsigned flags);
3896
3911WS_DLL_PUBLIC proto_item*
3912 proto_tree_add_checksum_bytes(proto_tree *tree, tvbuff_t *tvb, const unsigned offset,
3913 const int hf_checksum, const int hf_checksum_status, struct expert_field* bad_checksum_expert,
3914 packet_info *pinfo, const uint8_t *computed_checksum, size_t checksum_len, const unsigned flags);
3915
3919typedef enum
3920{
3921 PROTO_CHECKSUM_E_BAD = 0,
3922 PROTO_CHECKSUM_E_GOOD,
3923 PROTO_CHECKSUM_E_UNVERIFIED,
3924 PROTO_CHECKSUM_E_NOT_PRESENT,
3925 PROTO_CHECKSUM_E_ILLEGAL
3926} proto_checksum_enum_e;
3927
3928#define PROTO_CHECKSUM_NO_FLAGS 0x00
3929#define PROTO_CHECKSUM_VERIFY 0x01
3930#define PROTO_CHECKSUM_GENERATED 0x02
3931#define PROTO_CHECKSUM_IN_CKSUM 0x04
3932#define PROTO_CHECKSUM_ZERO 0x08
3933#define PROTO_CHECKSUM_NOT_PRESENT 0x10
3934
3935WS_DLL_PUBLIC const value_string proto_checksum_vals[];
3936
3943WS_DLL_PUBLIC unsigned char
3944 proto_check_field_name(const char *field_name);
3945
3950WS_DLL_PUBLIC unsigned char
3951 proto_check_field_name_lower(const char *field_name);
3952
3953
3963 const char *
3964 proto_custom_set(proto_tree* tree, GSList *field_id,
3965 int occurrence,
3966 bool display_details,
3967 char *result,
3968 char *expr, const int size );
3969
3978 char *
3979 proto_custom_get_filter(struct epan_dissect *edt, GSList *field_id, int occurrence);
3980
3981#ifdef __cplusplus
3982}
3983#endif /* __cplusplus */
3984
3985/*
3986 * Editor modelines - https://www.wireshark.org/tools/modelines.html
3987 *
3988 * Local variables:
3989 * c-basic-offset: 4
3990 * tab-width: 8
3991 * indent-tabs-mode: nil
3992 * End:
3993 *
3994 * vi: set shiftwidth=4 tabstop=8 expandtab:
3995 * :indentSize=4:tabSize=8:noTabs=true:
3996 */
ftypes.h
ftenum_t
enum ftenum ftenum_t
Convenience typedef for ftenum.
Definition ftypes.h:190
ftenum
ftenum
Fundamental field value types used throughout the Wireshark dissector framework.
Definition ftypes.h:26
packet_info
struct _packet_info packet_info
Represents the metadata and indexing information for a single captured frame.
proto_registrar_dump_fieldcount
WS_DLL_PUBLIC bool proto_registrar_dump_fieldcount(void)
Definition proto.c:12361
proto_check_field_name_lower
WS_DLL_PUBLIC unsigned char proto_check_field_name_lower(const char *field_name)
proto_tree_add_bitmask_value
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:13459
ITEM_LABEL_LENGTH
#define ITEM_LABEL_LENGTH
Definition proto.h:48
proto_get_protocol_name
WS_DLL_PUBLIC const char * proto_get_protocol_name(const int proto_id)
Definition proto.c:8896
proto_tree_add_time_format_value
proto_item * proto_tree_add_time_format_value(proto_tree *tree, int hfindex, tvbuff_t *tvb, unsigned start, unsigned length, nstime_t *value_ptr, const char *format,...)
Definition proto.c:5108
proto_tree_add_item_ret_ether
proto_item * proto_tree_add_item_ret_ether(proto_tree *tree, int hfindex, tvbuff_t *tvb, const unsigned start, unsigned length, const unsigned encoding, uint8_t *retval)
Parse an ethernet address from the buffer and add it to the tree, writing the value to the pointer sp...
Definition proto.c:4212
proto_get_frame_protocols
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:8957
proto_is_protocol_enabled
WS_DLL_PUBLIC bool proto_is_protocol_enabled(const protocol_t *protocol)
Definition proto.c:9077
item_label_t
struct _item_label_t item_label_t
proto_tree_set_appendix
void proto_tree_set_appendix(proto_tree *tree, tvbuff_t *tvb, unsigned start, const unsigned length)
Definition proto.c:8518
proto_tree_add_guid_format
proto_item * proto_tree_add_guid_format(proto_tree *tree, int hfindex, tvbuff_t *tvb, unsigned start, unsigned length, const e_guid_t *value_ptr, const char *format,...)
Definition proto.c:5417
proto_tree_add_split_bits_crumb
WS_DLL_PUBLIC void proto_tree_add_split_bits_crumb(proto_tree *tree, const int hf_index, tvbuff_t *tvb, const unsigned bit_offset, const crumb_spec_t *crumb_spec, uint16_t crumb_index)
Definition proto.c:13977
proto_tree_add_time_item
proto_item * proto_tree_add_time_item(proto_tree *tree, int hfindex, tvbuff_t *tvb, const unsigned start, const unsigned length, const unsigned encoding, nstime_t *retval, unsigned *endoff, int *err)
Definition proto.c:4793
FI_URL
#define FI_URL
Definition proto.h:868
_item_label_t::value_pos
size_t value_pos
Definition proto.h:817
proto_field_is_referenced
WS_DLL_PUBLIC bool proto_field_is_referenced(proto_tree *tree, int proto_id)
Definition proto.c:1000
proto_tree_add_item_ret_time_string
proto_item * proto_tree_add_item_ret_time_string(proto_tree *tree, int hfindex, tvbuff_t *tvb, const unsigned start, int length, const unsigned encoding, wmem_allocator_t *scope, char **retval)
Definition proto.c:4462
proto_register_subtree_array
void proto_register_subtree_array(int *const *indices, const int num_indices)
Definition proto.c:10273
proto_tree_add_bits_item
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:13622
tree_expanded
WS_DLL_PUBLIC bool tree_expanded(int tree_type)
Return whether subtrees of a given type are currently expanded.
_header_field_info::bitmask
uint64_t bitmask
Definition proto.h:783
proto_tree_add_subtree_format
proto_tree * proto_tree_add_subtree_format(proto_tree *tree, tvbuff_t *tvb, unsigned start, int length, int idx, proto_item **tree_item, const char *format,...)
Definition proto.c:1562
protocol_t
struct _protocol protocol_t
Definition proto.h:100
proto_tree_add_item_ret_ipv6
proto_item * proto_tree_add_item_ret_ipv6(proto_tree *tree, int hfindex, tvbuff_t *tvb, const unsigned start, unsigned length, const unsigned encoding, ws_in6_addr *addr)
Parse an ipv6 address from the buffer and add it to the tree, writing the value to the pointer specif...
Definition proto.c:4173
proto_tree_add_bits_ret_val
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:14003
proto_tree_add_split_bits_item_ret_val
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:13799
proto_list_layers
WS_DLL_PUBLIC char * proto_list_layers(const packet_info *pinfo)
Definition proto.c:9022
proto_deregister_field
void proto_deregister_field(const int parent, int hf_id)
Definition proto.c:9247
proto_tree_add_uint64_format
proto_item * proto_tree_add_uint64_format(proto_tree *tree, int hfindex, tvbuff_t *tvb, unsigned start, unsigned length, uint64_t value, const char *format,...)
Definition proto.c:6181
proto_tree_add_bitmask_list_ret_uint64
WS_DLL_PUBLIC void proto_tree_add_bitmask_list_ret_uint64(proto_tree *tree, tvbuff_t *tvb, const unsigned offset, const unsigned len, int *const *fields, const unsigned encoding, uint64_t *retval)
Definition proto.c:13509
proto_add_deregistered_slice
void proto_add_deregistered_slice(size_t block_size, void *mem_block)
Definition proto.c:9310
proto_tree_add_double
proto_item * proto_tree_add_double(proto_tree *tree, int hfindex, tvbuff_t *tvb, unsigned start, unsigned length, double value)
Definition proto.c:5976
proto_get_first_protocol_field
WS_DLL_PUBLIC header_field_info * proto_get_first_protocol_field(const int proto_id, void **cookie)
Begin iterating over all header fields registered to a protocol.
Definition proto.c:8810
_header_field_info::same_name_prev_id
int same_name_prev_id
Definition proto.h:790
proto_get_id_by_short_name
WS_DLL_PUBLIC int proto_get_id_by_short_name(const char *short_name)
Definition proto.c:8882
proto_tree_add_ipv4_format_value
proto_item * proto_tree_add_ipv4_format_value(proto_tree *tree, int hfindex, tvbuff_t *tvb, unsigned start, unsigned length, ws_in4_addr value, const char *format,...)
Definition proto.c:5240
proto_tree_add_checksum
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:14400
proto_get_next_protocol
WS_DLL_PUBLIC int proto_get_next_protocol(void **cookie)
Advance the protocol iterator and return the next protocol ID.
Definition proto.c:8796
proto_tree_add_bytes_item
proto_item * proto_tree_add_bytes_item(proto_tree *tree, int hfindex, tvbuff_t *tvb, const unsigned start, unsigned length, const unsigned encoding, GByteArray *retval, unsigned *endoff, int *err)
Definition proto.c:4651
proto_is_pino
WS_DLL_PUBLIC bool proto_is_pino(const protocol_t *protocol)
Definition proto.c:9058
proto_tree_add_ether
proto_item * proto_tree_add_ether(proto_tree *tree, int hfindex, tvbuff_t *tvb, unsigned start, unsigned length, const uint8_t *value)
Definition proto.c:5679
proto_tree_add_guid
proto_item * proto_tree_add_guid(proto_tree *tree, int hfindex, tvbuff_t *tvb, unsigned start, unsigned length, const e_guid_t *value_ptr)
Definition proto.c:5379
proto_get_data_protocol
WS_DLL_PUBLIC int proto_get_data_protocol(void *cookie)
Return the protocol ID stored in the current iterator position.
Definition proto.c:8787
proto_tree_add_text_valist_internal
proto_item * proto_tree_add_text_valist_internal(proto_tree *tree, tvbuff_t *tvb, unsigned start, unsigned length, const char *format, va_list ap)
Definition proto.c:1526
proto_tree_add_int_bits_format_value
proto_item * proto_tree_add_int_bits_format_value(proto_tree *tree, const int hfindex, tvbuff_t *tvb, const unsigned bit_offset, const int no_of_bits, int32_t value, const unsigned encoding, const char *format,...)
Definition proto.c:14244
proto_tree_add_none_format
proto_item * proto_tree_add_none_format(proto_tree *tree, const int hfindex, tvbuff_t *tvb, const unsigned start, int length, const char *format,...)
Definition proto.c:4863
field_info::ds_tvb
tvbuff_t * ds_tvb
Definition proto.h:831
proto_tree_add_uint_format
proto_item * proto_tree_add_uint_format(proto_tree *tree, int hfindex, tvbuff_t *tvb, unsigned start, unsigned length, uint32_t value, const char *format,...)
Definition proto.c:6089
proto_tree_add_item_ret_boolean
proto_item * proto_tree_add_item_ret_boolean(proto_tree *tree, int hfindex, tvbuff_t *tvb, const unsigned start, unsigned length, const unsigned encoding, bool *retval)
Add an FT_BOOLEAN item to the protocol tree and return its value.
Definition proto.c:3990
proto_tree_add_item_ret_double
proto_item * proto_tree_add_item_ret_double(proto_tree *tree, int hfindex, tvbuff_t *tvb, const unsigned start, unsigned length, const unsigned encoding, double *retval)
Parse a double from the buffer and add it to the tree, returning the item added and the parsed value ...
Definition proto.c:4081
proto_tree_add_string_format
proto_item * proto_tree_add_string_format(proto_tree *tree, int hfindex, tvbuff_t *tvb, unsigned start, int length, const char *value, const char *format,...)
Definition proto.c:5617
proto_registrar_get_name
const char * proto_registrar_get_name(const int n)
Definition proto.c:11747
proto_tree_add_boolean_format_value
proto_item * proto_tree_add_boolean_format_value(proto_tree *tree, int hfindex, tvbuff_t *tvb, unsigned start, unsigned length, uint64_t value, const char *format,...)
Definition proto.c:5769
proto_plugin::register_handoff
void(* register_handoff)(void)
Routine to call to register dissector handoff.
Definition proto.h:1134
proto_registrar_dump_elastic
WS_DLL_PUBLIC void proto_registrar_dump_elastic(const char *filter)
Definition proto.c:12462
proto_tree_add_text_internal
proto_item * proto_tree_add_text_internal(proto_tree *tree, tvbuff_t *tvb, unsigned start, unsigned length, const char *format,...)
Definition proto.c:1500
proto_set_decoding
WS_DLL_PUBLIC void proto_set_decoding(const int proto_id, const bool enabled)
Definition proto.c:9127
proto_name_already_registered
WS_DLL_PUBLIC bool proto_name_already_registered(const char *name)
Definition proto.c:8858
proto_register_field_array
void proto_register_field_array(const int parent, hf_register_info *hf, const int num_records)
Definition proto.c:9205
proto_find_first_finfo
WS_DLL_PUBLIC GPtrArray * proto_find_first_finfo(proto_tree *tree, const int hfindex)
Definition proto.c:11943
proto_registrar_get_length
int proto_registrar_get_length(const int n)
Definition proto.c:11796
proto_get_protocol_filter_name
WS_DLL_PUBLIC const char * proto_get_protocol_filter_name(const int proto_id)
Definition proto.c:8924
proto_tree_foreach_func
void(* proto_tree_foreach_func)(proto_node *node, void *data)
Callback type for proto_tree_children_foreach().
Definition proto.h:1102
hf_ref_type
hf_ref_type
Enum for specifying whether a field is referenced by a filter, and if so, how.
Definition proto.h:762
proto_tree_add_item_ret_int
proto_item * proto_tree_add_item_ret_int(proto_tree *tree, int hfindex, tvbuff_t *tvb, const unsigned start, unsigned length, const unsigned encoding, int32_t *retval)
Definition proto.c:3398
proto_get_protocol_long_name
WS_DLL_PUBLIC const char * proto_get_protocol_long_name(const protocol_t *protocol)
Definition proto.c:8916
proto_tree_children_foreach
WS_DLL_PUBLIC void proto_tree_children_foreach(proto_tree *tree, proto_tree_foreach_func func, void *data)
Invoke a callback for each direct child of a proto_tree node.
Definition proto.c:863
proto_registrar_get_ftype
enum ftenum proto_registrar_get_ftype(const int n)
Definition proto.c:11765
proto_tree_add_int_format
proto_item * proto_tree_add_int_format(proto_tree *tree, int hfindex, tvbuff_t *tvb, unsigned start, unsigned length, int32_t value, const char *format,...)
Definition proto.c:6272
FI_RESET_FLAG
#define FI_RESET_FLAG(fi, flag)
Definition proto.h:891
proto_tree_add_bitmask_list_value
WS_DLL_PUBLIC void proto_tree_add_bitmask_list_value(proto_tree *tree, tvbuff_t *tvb, const unsigned offset, const unsigned len, int *const *fields, const uint64_t value)
Definition proto.c:13525
proto_initialize_all_prefixes
void proto_initialize_all_prefixes(void)
Definition proto.c:1099
field_info::proto_layer_num
int proto_layer_num
Definition proto.h:834
hfinfo_bitshift
WS_DLL_PUBLIC int hfinfo_bitshift(const header_field_info *hfinfo)
Return the number of bits to right-shift a field's bitmask to obtain its least-significant bit positi...
Definition proto.c:11307
proto_tree_add_double_format_value
proto_item * proto_tree_add_double_format_value(proto_tree *tree, int hfindex, tvbuff_t *tvb, unsigned start, unsigned length, double value, const char *format,...)
Definition proto.c:5995
proto_tree_add_int64_format
proto_item * proto_tree_add_int64_format(proto_tree *tree, int hfindex, tvbuff_t *tvb, unsigned start, unsigned length, int64_t value, const char *format,...)
Definition proto.c:6395
proto_tree_add_uint_format_value
proto_item * proto_tree_add_uint_format_value(proto_tree *tree, int hfindex, tvbuff_t *tvb, unsigned start, unsigned length, uint32_t value, const char *format,...)
Definition proto.c:6071
proto_item_get_parent
WS_DLL_PUBLIC proto_item * proto_item_get_parent(const proto_item *pi)
Definition proto.c:8421
proto_registrar_get_id_byname
int proto_registrar_get_id_byname(const char *field_name)
Definition proto.c:1183
proto_tree_add_float_format
proto_item * proto_tree_add_float_format(proto_tree *tree, int hfindex, tvbuff_t *tvb, unsigned start, unsigned length, float value, const char *format,...)
Definition proto.c:5948
_header_field_info::display
int display
Definition proto.h:778
proto_tree_add_ts_23_038_7bits_packed_item
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:14332
proto_registrar_get_byalias
header_field_info * proto_registrar_get_byalias(const char *alias_name)
Definition proto.c:1152
mac_hf_list_t
struct _mac_hf_list_t mac_hf_list_t
proto_checksum_enum_e
proto_checksum_enum_e
Checksum verification result for a protocol field.
Definition proto.h:3920
proto_all_finfos
WS_DLL_PUBLIC GPtrArray * proto_all_finfos(proto_tree *tree)
Definition proto.c:11973
proto_tree_add_oid_format
proto_item * proto_tree_add_oid_format(proto_tree *tree, int hfindex, tvbuff_t *tvb, unsigned start, unsigned length, const uint8_t *value_ptr, const char *format,...)
Definition proto.c:5494
proto_execute_in_directory
WS_DLL_PUBLIC void proto_execute_in_directory(const char *dir, proto_execute_in_directory_func func, void *param)
Definition proto.c:824
proto_tree_add_time
proto_item * proto_tree_add_time(proto_tree *tree, int hfindex, tvbuff_t *tvb, unsigned start, unsigned length, const nstime_t *value_ptr)
Definition proto.c:5089
proto_tree_add_format_wsp_text
proto_item * proto_tree_add_format_wsp_text(proto_tree *tree, tvbuff_t *tvb, unsigned start, unsigned length)
Definition proto.c:1628
proto_registrar_get_count
WS_DLL_PUBLIC size_t proto_registrar_get_count(struct proto_registrar_stats *stats)
Definition proto.c:11805
proto_item_fill_label
void proto_item_fill_label(const field_info *fi, char *label_str, size_t *value_pos)
Definition proto.c:10439
proto_heuristic_dissector_foreach
WS_DLL_PUBLIC void proto_heuristic_dissector_foreach(const protocol_t *protocol, GFunc func, void *user_data)
Definition proto.c:8948
field_info::total_layer_num
int total_layer_num
Definition proto.h:833
proto_tree_get_parent_tree
proto_tree * proto_tree_get_parent_tree(proto_tree *tree)
Definition proto.c:8448
proto_register_protocol_in_name_only
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:8656
proto_node
struct _proto_node proto_node
proto_tree_add_ipv6_format
proto_item * proto_tree_add_ipv6_format(proto_tree *tree, int hfindex, tvbuff_t *tvb, unsigned start, unsigned length, const ws_in6_addr *value_ptr, const char *format,...)
Definition proto.c:5326
proto_construct_match_selected_string
WS_DLL_PUBLIC char * proto_construct_match_selected_string(const field_info *finfo, struct epan_dissect *edt)
Definition proto.c:12972
proto_get_protocol_short_name
WS_DLL_PUBLIC const char * proto_get_protocol_short_name(const protocol_t *protocol)
Definition proto.c:8908
proto_tree_add_item_ret_uint32
proto_item * proto_tree_add_item_ret_uint32(proto_tree *tree, int hfindex, tvbuff_t *tvb, const unsigned start, unsigned length, const unsigned encoding, uint32_t *retval)
Add an FT_UINT32 item to the protocol tree and return its value.
Definition proto.c:3533
proto_find_undecoded_data
WS_DLL_PUBLIC char * proto_find_undecoded_data(proto_tree *tree, unsigned length)
Definition proto.c:12059
proto_pre_init
void proto_pre_init(void)
Pre-initialise the proto subsystem memory structures.
Definition proto.c:582
proto_item_fill_display_label
int proto_item_fill_display_label(const field_info *finfo, char *display_label_str, const int label_str_size)
Definition proto.c:7356
proto_is_protocol_enabled_by_default
WS_DLL_PUBLIC bool proto_is_protocol_enabled_by_default(const protocol_t *protocol)
Definition proto.c:9091
proto_find_field_from_offset
WS_DLL_PUBLIC field_info * proto_find_field_from_offset(proto_tree *tree, unsigned offset, tvbuff_t *tvb)
Definition proto.c:12020
proto_tree_add_item_ret_string
proto_item * proto_tree_add_item_ret_string(proto_tree *tree, int hfindex, tvbuff_t *tvb, const unsigned start, int length, const unsigned encoding, wmem_allocator_t *scope, const uint8_t **retval)
Definition proto.c:4322
proto_plugin::register_protoinfo
void(* register_protoinfo)(void)
Routine to call to register protocol information.
Definition proto.h:1129
proto_registrar_dump_values
WS_DLL_PUBLIC void proto_registrar_dump_values(void)
Definition proto.c:12146
proto_item_set_len
void proto_item_set_len(proto_item *pi, const unsigned length)
Definition proto.c:8199
proto_tree_add_int64_format_value
proto_item * proto_tree_add_int64_format_value(proto_tree *tree, int hfindex, tvbuff_t *tvb, unsigned start, unsigned length, int64_t value, const char *format,...)
Definition proto.c:6349
proto_tree_add_bitmask_len
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:13547
tree_expanded_set
WS_DLL_PUBLIC void tree_expanded_set(int tree_type, bool value)
Set the expansion state for subtrees of a given type.
proto_tree_add_item_new_ret_length
proto_item * proto_tree_add_item_new_ret_length(proto_tree *tree, header_field_info *hfinfo, tvbuff_t *tvb, const unsigned start, int length, const unsigned encoding, unsigned *lenretval)
Definition proto.c:4580
proto_tree_add_boolean
proto_item * proto_tree_add_boolean(proto_tree *tree, int hfindex, tvbuff_t *tvb, unsigned start, unsigned length, uint64_t value)
Definition proto.c:5750
crumb_spec_t::crumb_bit_offset
unsigned crumb_bit_offset
Definition proto.h:849
proto_item_set_bits_offset_len
void proto_item_set_bits_offset_len(proto_item *ti, int bits_offset, int bits_len)
Definition proto.c:8269
FI_GET_FLAG
#define FI_GET_FLAG(fi, flag)
Definition proto.h:883
proto_get_layer_num
WS_DLL_PUBLIC uint8_t proto_get_layer_num(const packet_info *pinfo, const int proto_id)
Definition proto.c:9045
proto_item
proto_node proto_item
Definition proto.h:927
proto_tree_add_bytes_format_value
proto_item * proto_tree_add_bytes_format_value(proto_tree *tree, int hfindex, tvbuff_t *tvb, unsigned start, int length, const uint8_t *start_ptr, const char *format,...)
Definition proto.c:5020
_header_field_info::strings
const void * strings
Definition proto.h:779
proto_tree_add_uint64_bits_format_value
proto_item * proto_tree_add_uint64_bits_format_value(proto_tree *tree, const int hfindex, tvbuff_t *tvb, const unsigned bit_offset, const int no_of_bits, uint64_t value, const unsigned encoding, const char *format,...)
Definition proto.c:14189
proto_tree_add_item_ret_uint64
proto_item * proto_tree_add_item_ret_uint64(proto_tree *tree, int hfindex, tvbuff_t *tvb, const unsigned start, unsigned length, const unsigned encoding, uint64_t *retval)
Add an FT_UINT64 item to the protocol tree and return its value.
Definition proto.c:3791
proto_registrar_get_parent
int proto_registrar_get_parent(const int n)
Definition proto.c:11774
proto_tree_add_ipxnet
proto_item * proto_tree_add_ipxnet(proto_tree *tree, int hfindex, tvbuff_t *tvb, unsigned start, unsigned length, uint32_t value)
Definition proto.c:5156
proto_tree_add_uint64_format_value
proto_item * proto_tree_add_uint64_format_value(proto_tree *tree, int hfindex, tvbuff_t *tvb, unsigned start, unsigned length, uint64_t value, const char *format,...)
Definition proto.c:6163
proto_get_next_protocol_field
WS_DLL_PUBLIC header_field_info * proto_get_next_protocol_field(const int proto_id, void **cookie)
Advance the field iterator and return the next header field.
Definition proto.c:8822
proto_item_add_subtree
WS_DLL_PUBLIC proto_tree * proto_item_add_subtree(proto_item *pi, const int idx) G_GNUC_WARN_UNUSED_RESULT
Definition proto.c:8391
field_info::appendix_length
unsigned appendix_length
Definition proto.h:827
proto_tree_add_item_new
proto_item * proto_tree_add_item_new(proto_tree *tree, header_field_info *hfinfo, tvbuff_t *tvb, const unsigned start, int length, const unsigned encoding)
Definition proto.c:4545
proto_tree_add_time_format
proto_item * proto_tree_add_time_format(proto_tree *tree, int hfindex, tvbuff_t *tvb, unsigned start, unsigned length, nstime_t *value_ptr, const char *format,...)
Definition proto.c:5126
proto_registrar_get_nth
header_field_info * proto_registrar_get_nth(unsigned hfindex)
Definition proto.c:1024
proto_execute_in_directory_func
void(* proto_execute_in_directory_func)(void *param)
Callback type for a function executed within a specific directory context.
Definition proto.h:1190
FI_HIDDEN
#define FI_HIDDEN
Definition proto.h:863
proto_tree_add_int64_bits_format_value
proto_item * proto_tree_add_int64_bits_format_value(proto_tree *tree, const int hfindex, tvbuff_t *tvb, const unsigned bit_offset, const int no_of_bits, int64_t value, const unsigned encoding, const char *format,...)
Definition proto.c:14277
proto_item_get_parent_nth
WS_DLL_PUBLIC proto_item * proto_item_get_parent_nth(proto_item *pi, int gen)
Definition proto.c:8428
proto_tree_add_item_ret_ipv4
proto_item * proto_tree_add_item_ret_ipv4(proto_tree *tree, int hfindex, tvbuff_t *tvb, const unsigned start, unsigned length, const unsigned encoding, ws_in4_addr *retval)
Add an FT_IPv4 item to the protocol tree and return its value.
Definition proto.c:4120
field_info::flags
uint32_t flags
Definition proto.h:829
proto_check_field_name
WS_DLL_PUBLIC unsigned char proto_check_field_name(const char *field_name)
Check if a given string is a valid protocol field name.
proto_tree_add_debug_text
WS_DLL_PUBLIC proto_item * proto_tree_add_debug_text(proto_tree *tree, const char *format,...)
Definition proto.c:1588
proto_tree_add_uint
proto_item * proto_tree_add_uint(proto_tree *tree, int hfindex, tvbuff_t *tvb, unsigned start, unsigned length, uint32_t value)
Definition proto.c:6041
proto_item_prepend_text
void proto_item_prepend_text(proto_item *pi, const char *format,...)
Definition proto.c:8122
proto_tree_add_subtree
proto_tree * proto_tree_add_subtree(proto_tree *tree, tvbuff_t *tvb, unsigned start, int length, int idx, proto_item **tree_item, const char *text)
Definition proto.c:1554
proto_tree_add_guid_format_value
proto_item * proto_tree_add_guid_format_value(proto_tree *tree, int hfindex, tvbuff_t *tvb, unsigned start, unsigned length, const e_guid_t *value_ptr, const char *format,...)
Definition proto.c:5398
proto_tree_add_item_ret_display_string_and_length
proto_item * proto_tree_add_item_ret_display_string_and_length(proto_tree *tree, int hfindex, tvbuff_t *tvb, const unsigned start, int length, const unsigned encoding, wmem_allocator_t *scope, char **retval, unsigned *lenretval)
Definition proto.c:4333
proto_tree_add_item_ret_length
proto_item * proto_tree_add_item_ret_length(proto_tree *tree, int hfindex, tvbuff_t *tvb, const unsigned start, int length, const unsigned encoding, unsigned *lenretval)
Add an item to a protocol tree and return the length of the parsed field.
Definition proto.c:4625
field_info::hfinfo
const header_field_info * hfinfo
Definition proto.h:823
proto_get_finfo_ptr_array
WS_DLL_PUBLIC GPtrArray * proto_get_finfo_ptr_array(const proto_tree *tree, const int hfindex)
Definition proto.c:11853
proto_tree_add_ipv4_format
proto_item * proto_tree_add_ipv4_format(proto_tree *tree, int hfindex, tvbuff_t *tvb, unsigned start, unsigned length, ws_in4_addr value, const char *format,...)
Definition proto.c:5258
field_info::start
unsigned start
Definition proto.h:824
proto_tree_add_boolean_format
proto_item * proto_tree_add_boolean_format(proto_tree *tree, int hfindex, tvbuff_t *tvb, unsigned start, unsigned length, uint64_t value, const char *format,...)
Definition proto.c:5787
proto_tree_set_fake_protocols
void proto_tree_set_fake_protocols(proto_tree *tree, bool fake_protocols)
Definition proto.c:986
proto_tree_add_oid_format_value
proto_item * proto_tree_add_oid_format_value(proto_tree *tree, int hfindex, tvbuff_t *tvb, unsigned start, unsigned length, const uint8_t *value_ptr, const char *format,...)
Definition proto.c:5475
proto_tree_add_bitmask_with_flags_ret_uint64
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:13399
proto_deregister_protocol
bool proto_deregister_protocol(const char *short_name)
Definition proto.c:8715
proto_is_frame_protocol
WS_DLL_PUBLIC bool proto_is_frame_protocol(const wmem_list_t *layers, const char *proto_name)
Definition proto.c:8997
proto_registrar_stats::protocol_count
size_t protocol_count
Definition proto.h:3049
_header_field_info::name
const char * name
Definition proto.h:775
proto_add_deregistered_data
void proto_add_deregistered_data(void *data)
Definition proto.c:9304
field_display_e
field_display_e
Enum for specifying the display format of a field.
Definition proto.h:686
proto_item_set_end
void proto_item_set_end(proto_item *pi, tvbuff_t *tvb, unsigned end)
Definition proto.c:8221
proto_tree_add_ipxnet_format
proto_item * proto_tree_add_ipxnet_format(proto_tree *tree, int hfindex, tvbuff_t *tvb, unsigned start, unsigned length, uint32_t value, const char *format,...)
Definition proto.c:5193
proto_tree_add_item_ret_string_and_length
proto_item * proto_tree_add_item_ret_string_and_length(proto_tree *tree, int hfindex, tvbuff_t *tvb, const unsigned start, int length, const unsigned encoding, wmem_allocator_t *scope, const uint8_t **retval, unsigned *lenretval)
Definition proto.c:4251
proto_tree_add_item_ret_uint8
proto_item * proto_tree_add_item_ret_uint8(proto_tree *tree, int hfindex, tvbuff_t *tvb, const unsigned start, unsigned length, const unsigned encoding, uint8_t *retval)
Add an FT_UINT8 item to the protocol tree and return its value.
Definition proto.c:3541
proto_registrar_get_abbrev
const char * proto_registrar_get_abbrev(const int n)
Definition proto.c:11756
prefix_initializer_t
void(* prefix_initializer_t)(const char *match)
Definition proto.h:2927
proto_tree_add_bytes_format
proto_item * proto_tree_add_bytes_format(proto_tree *tree, int hfindex, tvbuff_t *tvb, unsigned start, int length, const uint8_t *start_ptr, const char *format,...)
Definition proto.c:5040
proto_tree_add_int
proto_item * proto_tree_add_int(proto_tree *tree, int hfindex, tvbuff_t *tvb, unsigned start, unsigned length, int32_t value)
Definition proto.c:6226
field_info::rep
item_label_t * rep
Definition proto.h:830
proto_tree_add_uint_bits_format_value
WS_DLL_PUBLIC proto_item * proto_tree_add_uint_bits_format_value(proto_tree *tree, const int hf_index, tvbuff_t *tvb, const unsigned bit_offset, const int no_of_bits, uint32_t value, const unsigned encoding, const char *format,...)
Definition proto.c:14156
proto_tree_set_visible
bool proto_tree_set_visible(proto_tree *tree, bool visible)
Definition proto.c:976
proto_tree_add_ipv6
proto_item * proto_tree_add_ipv6(proto_tree *tree, int hfindex, tvbuff_t *tvb, unsigned start, unsigned length, const ws_in6_addr *value)
Definition proto.c:5288
proto_tree_add_float_format_value
proto_item * proto_tree_add_float_format_value(proto_tree *tree, int hfindex, tvbuff_t *tvb, unsigned start, unsigned length, float value, const char *format,...)
Definition proto.c:5930
hf_register_info::p_id
int * p_id
Definition proto.h:810
_item_label_t::value_len
size_t value_len
Definition proto.h:818
proto_cleanup
void proto_cleanup(void)
Release all memory allocated by the proto subsystem.
Definition proto.c:779
proto_tree_add_protocol_format
proto_item * proto_tree_add_protocol_format(proto_tree *tree, int hfindex, tvbuff_t *tvb, unsigned start, int length, const char *format,...)
Definition proto.c:4923
proto_tree_add_item_ret_display_string
proto_item * proto_tree_add_item_ret_display_string(proto_tree *tree, int hfindex, tvbuff_t *tvb, const unsigned start, int length, const unsigned encoding, wmem_allocator_t *scope, char **retval)
Definition proto.c:4449
proto_get_id_by_filter_name
WS_DLL_PUBLIC int proto_get_id_by_filter_name(const char *filter_name)
Definition proto.c:8868
proto_report_dissector_bug
WS_DLL_PUBLIC WS_NORETURN void proto_report_dissector_bug(const char *format,...)
Definition proto.c:1649
proto_tree_traverse_func
bool(* proto_tree_traverse_func)(proto_node *node, void *data)
Callback type for depth-first proto_tree traversal functions.
Definition proto.h:1110
proto_add_heuristic_dissector
void proto_add_heuristic_dissector(protocol_t *protocol, const char *short_name)
Definition proto.c:8934
proto_item_get_subtree
WS_DLL_PUBLIC proto_tree * proto_item_get_subtree(proto_item *pi)
Definition proto.c:8409
proto_tree_free
void proto_tree_free(proto_tree *tree)
Free a protocol tree and all of its nodes.
Definition proto.c:950
_header_field_info::ref_type
hf_ref_type ref_type
Definition proto.h:789
proto_registrar_dump_fields
WS_DLL_PUBLIC void proto_registrar_dump_fields(void)
Definition proto.c:12622
proto_get_first_protocol
WS_DLL_PUBLIC int proto_get_first_protocol(void **cookie)
Begin iterating over all registered protocols.
Definition proto.c:8775
proto_tree_add_bitmask
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:13387
proto_tree_add_item_ret_int64
proto_item * proto_tree_add_item_ret_int64(proto_tree *tree, int hfindex, tvbuff_t *tvb, const unsigned start, unsigned length, const unsigned encoding, int64_t *retval)
Add an FT_INT64 item to the protocol tree and return its value.
Definition proto.c:3856
proto_tree_add_bitmask_value_with_flags
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:13468
proto_tree_move_item
void proto_tree_move_item(proto_tree *tree, proto_item *fixed_item, proto_item *item_to_move)
Definition proto.c:8471
proto_tree_add_ascii_7bits_item
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:14360
proto_item_get_display_repr
char * proto_item_get_display_repr(wmem_allocator_t *scope, proto_item *pi)
Definition proto.c:8278
proto_can_match_selected
WS_DLL_PUBLIC bool proto_can_match_selected(const field_info *finfo, struct epan_dissect *edt)
Definition proto.c:12960
proto_find_finfo
WS_DLL_PUBLIC GPtrArray * proto_find_finfo(proto_tree *tree, const int hfindex)
Definition proto.c:11924
_header_field_info::parent
int parent
Definition proto.h:788
proto_disable_by_default
WS_DLL_PUBLIC void proto_disable_by_default(const int proto_id)
Definition proto.c:9115
proto_init
void proto_init(GSList *register_all_plugin_protocols_list, GSList *register_all_plugin_handoffs_list, register_entity_func register_func, register_entity_func handoff_func, register_cb cb, void *client_data)
Initialise the proto subsystem and run all registration callbacks.
Definition proto.c:609
proto_item_set_text
WS_DLL_PUBLIC void proto_item_set_text(proto_item *pi, const char *format,...)
Definition proto.c:8041
proto_tree_add_item_ret_uint
proto_item * proto_tree_add_item_ret_uint(proto_tree *tree, int hfindex, tvbuff_t *tvb, const unsigned start, unsigned length, const unsigned encoding, uint32_t *retval)
Add an FT_UINT32 (or compatible uint) item to the protocol tree and return its value as a uint32_t.
Definition proto.c:3463
header_field_info
struct _header_field_info header_field_info
Definition proto.h:770
proto_item_get_len
unsigned proto_item_get_len(const proto_item *pi)
Definition proto.c:8246
proto_tree_add_ether_format
proto_item * proto_tree_add_ether_format(proto_tree *tree, int hfindex, tvbuff_t *tvb, unsigned start, unsigned length, const uint8_t *value, const char *format,...)
Definition proto.c:5716
proto_deregister_all_fields_with_prefix
void proto_deregister_all_fields_with_prefix(const int parent, const char *prefix)
Definition proto.c:9278
proto_tree_get_parent
proto_item * proto_tree_get_parent(proto_tree *tree)
Definition proto.c:8441
proto_tree_add_ether_format_value
proto_item * proto_tree_add_ether_format_value(proto_tree *tree, int hfindex, tvbuff_t *tvb, unsigned start, unsigned length, const uint8_t *value, const char *format,...)
Definition proto.c:5698
proto_register_plugin
WS_DLL_PUBLIC void proto_register_plugin(const proto_plugin *plugin)
Register a dissector plugin with the plugin system.
proto_set_cant_toggle
WS_DLL_PUBLIC void proto_set_cant_toggle(const int proto_id)
Definition proto.c:9186
proto_tree_add_item_ret_uint16
proto_item * proto_tree_add_item_ret_uint16(proto_tree *tree, int hfindex, tvbuff_t *tvb, const unsigned start, unsigned length, const unsigned encoding, uint16_t *retval)
Add an FT_UINT16 item to the protocol tree and return its value.
Definition proto.c:3553
proto_tracking_interesting_fields
WS_DLL_PUBLIC bool proto_tracking_interesting_fields(const proto_tree *tree)
Definition proto.c:11866
proto_register_prefix
void proto_register_prefix(const char *prefix, prefix_initializer_t pi)
Definition proto.c:1082
_header_field_info::type
enum ftenum type
Definition proto.h:777
proto_tree_add_format_text
proto_item * proto_tree_add_format_text(proto_tree *tree, tvbuff_t *tvb, unsigned start, unsigned length)
Definition proto.c:1609
proto_register_protocol
int proto_register_protocol(const char *name, const char *short_name, const char *filter_name)
Definition proto.c:8593
proto_registrar_dump_protocols
WS_DLL_PUBLIC void proto_registrar_dump_protocols(void)
Definition proto.c:12083
proto_registrar_stats::deregistered_count
size_t deregistered_count
Definition proto.h:3050
proto_tree_add_checksum_bytes
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:14510
proto_custom_set
const char * proto_custom_set(proto_tree *tree, GSList *field_id, int occurrence, bool display_details, char *result, char *expr, const int size)
Set the column text for a custom column.
Definition proto.c:7649
proto_check_for_protocol_or_field
bool proto_check_for_protocol_or_field(const proto_tree *tree, const int id)
Definition proto.c:11835
proto_tree_add_ipv4
proto_item * proto_tree_add_ipv4(proto_tree *tree, int hfindex, tvbuff_t *tvb, unsigned start, unsigned length, ws_in4_addr value)
Definition proto.c:5221
proto_tree_add_uint64
proto_item * proto_tree_add_uint64(proto_tree *tree, int hfindex, tvbuff_t *tvb, unsigned start, unsigned length, uint64_t value)
Definition proto.c:6134
proto_tree_add_item_ret_float
proto_item * proto_tree_add_item_ret_float(proto_tree *tree, int hfindex, tvbuff_t *tvb, const unsigned start, unsigned length, const unsigned encoding, float *retval)
Parse a float from the buffer and add it to the tree, returning the item added and the parsed value v...
Definition proto.c:4042
proto_tree_add_string_format_value
proto_item * proto_tree_add_string_format_value(proto_tree *tree, int hfindex, tvbuff_t *tvb, unsigned start, int length, const char *value, const char *format,...)
Definition proto.c:5598
_header_field_info::abbrev
const char * abbrev
Definition proto.h:776
proto_custom_get_filter
char * proto_custom_get_filter(struct epan_dissect *edt, GSList *field_id, int occurrence)
Construct a display filter string for a custom column.
Definition proto.c:7885
_header_field_info::blurb
const char * blurb
Definition proto.h:784
proto_tree_create_root
proto_tree * proto_tree_create_root(packet_info *pinfo)
Allocate and initialise a new protocol tree root node.
Definition proto.c:8292
proto_registrar_stats::same_name_count
size_t same_name_count
Definition proto.h:3051
proto_tree_add_bitmask_with_flags
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:13434
proto_tree_add_string
proto_item * proto_tree_add_string(proto_tree *tree, int hfindex, tvbuff_t *tvb, unsigned start, int length, const char *value)
Definition proto.c:5559
proto_tree_get_root
proto_tree * proto_tree_get_root(proto_tree *tree)
Definition proto.c:8461
proto_tree_add_bytes
proto_item * proto_tree_add_bytes(proto_tree *tree, int hfindex, tvbuff_t *tvb, unsigned start, int length, const uint8_t *start_ptr)
Definition proto.c:4968
proto_registrar_dump_field_completions
WS_DLL_PUBLIC bool proto_registrar_dump_field_completions(const char *prefix)
Dump all protocol and field abbreviations that start with a given prefix to standard output.
Definition proto.c:12733
proto_can_toggle_protocol
WS_DLL_PUBLIC bool proto_can_toggle_protocol(const int proto_id)
Definition proto.c:9102
proto_registrar_dump_ftypes
WS_DLL_PUBLIC void proto_registrar_dump_ftypes(void)
Dump all registered field types and their descriptive names to standard output.
Definition proto.c:12798
proto_tree_add_float_bits_format_value
proto_item * proto_tree_add_float_bits_format_value(proto_tree *tree, const int hfindex, tvbuff_t *tvb, const unsigned bit_offset, const int no_of_bits, float value, const unsigned encoding, const char *format,...)
Definition proto.c:14222
proto_tree_add_eui64
proto_item * proto_tree_add_eui64(proto_tree *tree, int hfindex, tvbuff_t *tvb, unsigned start, unsigned length, const uint64_t value)
Definition proto.c:6416
proto_tree_add_eui64_format
proto_item * proto_tree_add_eui64_format(proto_tree *tree, int hfindex, tvbuff_t *tvb, unsigned start, unsigned length, const uint64_t value, const char *format,...)
Definition proto.c:6453
find_protocol_by_id
WS_DLL_PUBLIC protocol_t * find_protocol_by_id(const int proto_id)
Definition proto.c:8837
proto_reenable_all
WS_DLL_PUBLIC void proto_reenable_all(void)
Definition proto.c:9168
proto_registrar_is_protocol
bool proto_registrar_is_protocol(const int n)
Definition proto.c:11783
proto_disable_all
WS_DLL_PUBLIC void proto_disable_all(void)
Definition proto.c:9138
crumb_spec_t::crumb_bit_length
uint8_t crumb_bit_length
Definition proto.h:850
proto_tree_add_double_format
proto_item * proto_tree_add_double_format(proto_tree *tree, int hfindex, tvbuff_t *tvb, unsigned start, unsigned length, double value, const char *format,...)
Definition proto.c:6013
proto_tree_add_int_format_value
proto_item * proto_tree_add_int_format_value(proto_tree *tree, int hfindex, tvbuff_t *tvb, unsigned start, unsigned length, int32_t value, const char *format,...)
Definition proto.c:6254
proto_tree_add_item
proto_item * proto_tree_add_item(proto_tree *tree, int hfindex, tvbuff_t *tvb, const unsigned start, int length, const unsigned encoding)
Append a decoded field to a protocol tree using a registered header-field index.
Definition proto.c:4566
proto_registrar_get_byname
header_field_info * proto_registrar_get_byname(const char *field_name)
Definition proto.c:1110
proto_tree_reset
void proto_tree_reset(proto_tree *tree)
Reset a protocol tree to its initial empty state, retaining the root node and its associated tree dat...
Definition proto.c:921
PITEM_FINFO
#define PITEM_FINFO(proto_item)
Definition proto.h:995
proto_field_display_to_string
WS_DLL_PUBLIC const char * proto_field_display_to_string(int field_display)
Convert a field display value to its string representation.
Definition proto.c:9515
proto_free_deregistered_fields
void proto_free_deregistered_fields(void)
Definition proto.c:9466
proto_tree_add_bitmask_list
WS_DLL_PUBLIC void proto_tree_add_bitmask_list(proto_tree *tree, tvbuff_t *tvb, const unsigned offset, const unsigned len, int *const *fields, const unsigned encoding)
Definition proto.c:13496
_header_field_info::id
int id
Definition proto.h:787
FI_GENERATED
#define FI_GENERATED
Definition proto.h:866
proto_tree_add_item_ret_varint
proto_item * proto_tree_add_item_ret_varint(proto_tree *tree, int hfindex, tvbuff_t *tvb, const unsigned start, unsigned length, const unsigned encoding, uint64_t *retval, unsigned *lenretval)
Add a variable-length integer item to the protocol tree and return its value and consumed byte count.
Definition proto.c:3916
proto_is_bytes_pino
bool proto_is_bytes_pino(const protocol_t *protocol)
Definition proto.c:9064
field_info::length
unsigned length
Definition proto.h:825
FI_SET_FLAG
#define FI_SET_FLAG(fi, flag)
Definition proto.h:885
proto_tree_add_mac48_detail
WS_DLL_PUBLIC proto_item * proto_tree_add_mac48_detail(const mac_hf_list_t *list_specific, const mac_hf_list_t *list_generic, int idx, tvbuff_t *tvb, proto_tree *tree, unsigned offset)
Definition proto.c:6493
proto_tree_add_float
proto_item * proto_tree_add_float(proto_tree *tree, int hfindex, tvbuff_t *tvb, unsigned start, unsigned length, float value)
Definition proto.c:5911
proto_tree_add_oid
proto_item * proto_tree_add_oid(proto_tree *tree, int hfindex, tvbuff_t *tvb, unsigned start, unsigned length, const uint8_t *value_ptr)
Definition proto.c:5456
proto_tree_add_int64
proto_item * proto_tree_add_int64(proto_tree *tree, int hfindex, tvbuff_t *tvb, unsigned start, unsigned length, int64_t value)
Definition proto.c:6321
field_info::tree_type
int tree_type
Definition proto.h:828
proto_get_id
WS_DLL_PUBLIC int proto_get_id(const protocol_t *protocol)
Definition proto.c:8852
hf_register_info::hfinfo
header_field_info hfinfo
Definition proto.h:811
proto_register_alias
void proto_register_alias(const int proto_id, const char *alias_name)
Definition proto.c:8757
proto_tree_add_eui64_format_value
proto_item * proto_tree_add_eui64_format_value(proto_tree *tree, int hfindex, tvbuff_t *tvb, unsigned start, unsigned length, const uint64_t value, const char *format,...)
Definition proto.c:6435
proto_tree_add_bytes_with_length
proto_item * proto_tree_add_bytes_with_length(proto_tree *tree, int hfindex, tvbuff_t *tvb, unsigned start, int tvbuff_length, const uint8_t *start_ptr, int ptr_length)
Definition proto.c:4996
proto_tree_add_ipxnet_format_value
proto_item * proto_tree_add_ipxnet_format_value(proto_tree *tree, int hfindex, tvbuff_t *tvb, unsigned start, unsigned length, uint32_t value, const char *format,...)
Definition proto.c:5175
proto_tree_add_ipv6_format_value
proto_item * proto_tree_add_ipv6_format_value(proto_tree *tree, int hfindex, tvbuff_t *tvb, unsigned start, unsigned length, const ws_in6_addr *value_ptr, const char *format,...)
Definition proto.c:5307
proto_free_field_strings
void proto_free_field_strings(ftenum_t field_type, unsigned int field_display, const void *field_strings)
Definition proto.c:9320
proto_tree_add_boolean_bits_format_value
proto_item * proto_tree_add_boolean_bits_format_value(proto_tree *tree, const int hfindex, tvbuff_t *tvb, const unsigned bit_offset, const int no_of_bits, uint64_t value, const unsigned encoding, const char *format,...)
Definition proto.c:14310
proto_tree_add_bitmask_text
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:13599
field_info::appendix_start
unsigned appendix_start
Definition proto.h:826
proto_tree_add_bitmask_ret_uint64
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:13361
proto_item_append_text
void proto_item_append_text(proto_item *pi, const char *format,...)
Definition proto.c:8064
_header_field_info::same_name_next
header_field_info * same_name_next
Definition proto.h:791
HF_REF_TYPE_INDIRECT
@ HF_REF_TYPE_INDIRECT
Definition proto.h:764
HF_REF_TYPE_NONE
@ HF_REF_TYPE_NONE
Definition proto.h:763
HF_REF_TYPE_DIRECT
@ HF_REF_TYPE_DIRECT
Definition proto.h:765
HF_REF_TYPE_PRINT
@ HF_REF_TYPE_PRINT
Definition proto.h:766
PROTO_CHECKSUM_E_GOOD
@ PROTO_CHECKSUM_E_GOOD
Definition proto.h:3922
PROTO_CHECKSUM_E_ILLEGAL
@ PROTO_CHECKSUM_E_ILLEGAL
Definition proto.h:3925
PROTO_CHECKSUM_E_BAD
@ PROTO_CHECKSUM_E_BAD
Definition proto.h:3921
PROTO_CHECKSUM_E_NOT_PRESENT
@ PROTO_CHECKSUM_E_NOT_PRESENT
Definition proto.h:3924
PROTO_CHECKSUM_E_UNVERIFIED
@ PROTO_CHECKSUM_E_UNVERIFIED
Definition proto.h:3923
ABSOLUTE_TIME_DOY_UTC
@ ABSOLUTE_TIME_DOY_UTC
Definition proto.h:719
BASE_PT_UDP
@ BASE_PT_UDP
Definition proto.h:708
BASE_HEX_DEC
@ BASE_HEX_DEC
Definition proto.h:694
BASE_HEX
@ BASE_HEX
Definition proto.h:691
ABSOLUTE_TIME_NTP_UTC
@ ABSOLUTE_TIME_NTP_UTC
Definition proto.h:720
BASE_EXP
@ BASE_EXP
Definition proto.h:696
ABSOLUTE_TIME_UTC
@ ABSOLUTE_TIME_UTC
Definition proto.h:718
BASE_DEC
@ BASE_DEC
Definition proto.h:690
ABSOLUTE_TIME_UNIX
@ ABSOLUTE_TIME_UNIX
Definition proto.h:721
BASE_PT_TCP
@ BASE_PT_TCP
Definition proto.h:709
BASE_DEC_HEX
@ BASE_DEC_HEX
Definition proto.h:693
BASE_OUI
@ BASE_OUI
Definition proto.h:714
SEP_COLON
@ SEP_COLON
Definition proto.h:701
BASE_PT_SCTP
@ BASE_PT_SCTP
Definition proto.h:711
BASE_NETMASK
@ BASE_NETMASK
Definition proto.h:705
ABSOLUTE_TIME_LOCAL
@ ABSOLUTE_TIME_LOCAL
Definition proto.h:717
BASE_PT_DCCP
@ BASE_PT_DCCP
Definition proto.h:710
BASE_STR_WSP
@ BASE_STR_WSP
Definition proto.h:724
BASE_NONE
@ BASE_NONE
Definition proto.h:687
SEP_DOT
@ SEP_DOT
Definition proto.h:699
SEP_DASH
@ SEP_DASH
Definition proto.h:700
SEP_SPACE
@ SEP_SPACE
Definition proto.h:702
BASE_OCT
@ BASE_OCT
Definition proto.h:692
BASE_CUSTOM
@ BASE_CUSTOM
Definition proto.h:695
wmem_list_t
struct _wmem_list_t wmem_list_t
Opaque type representing a scoped, doubly-linked list in the wmem system.
Definition wmem_list.h:42
wmem_allocator_t
struct _wmem_allocator_t wmem_allocator_t
Definition wmem_core.h:44
e_guid_t
struct _e_guid_t e_guid_t
Represents a GUID/UUID value; may be larger than GUID_LEN so must not be used to directly overlay pac...
ws_in6_addr
struct e_in6_addr ws_in6_addr
Represents a 128-bit IPv6 address.
ws_in4_addr
uint32_t ws_in4_addr
Represents a 32-bit IPv4 address in network byte order.
Definition inet_addr.h:22
nstime.h
packet_info.h
register.h
_header_field_info
Definition proto.h:773
_item_label_t
Definition proto.h:815
_mac_hf_list_t
Definition proto.h:2831
_packet_info
Represents the metadata and indexing information for a single captured frame.
Definition packet_info.h:43
_proto_node
Definition proto.h:914
_protocol
Definition proto.c:394
client_data
Definition packet-bt-dht.c:97
crumb_spec_t
This structure describes one segment of a split-bits item.
Definition proto.h:848
epan_dissect
Holds all state for the dissection of a single byte array, including session, buffer,...
Definition epan_dissect.h:28
epan_dissect::tree
proto_tree * tree
Definition epan_dissect.h:31
expert_field
Pairs an expert info index with its associated header field index for registration and display.
Definition expert.h:41
field_info
Definition proto.h:822
hf_register_info
Definition proto.h:809
nstime_t
Definition nstime.h:26
proto_plugin
Descriptor for a dissector plugin's registration entry points.
Definition proto.h:1125
proto_registrar_stats
Holds aggregate statistics about the state of the protocol registrar.
Definition proto.h:3048
tree_data_t
Definition proto.h:902
tvbuff.h
value_string.h
value_string
struct _value_string value_string
Mapping between a 32-bit integer value and its string representation.