| Wireshark 4.7.0 The Wireshark network protocol analyzer

Loading...
Searching...
No Matches
proto.h
Go to the documentation of this file.
1/* proto.h
2 * Definitions for protocol display
3 *
4 * Wireshark - Network traffic analyzer
5 * By Gerald Combs <gerald@wireshark.org>
6 * Copyright 1998 Gerald Combs
7 *
8 * SPDX-License-Identifier: GPL-2.0-or-later
9 */
10
11
23#ifndef __PROTO_H__
24#define __PROTO_H__
25
26#include "wsutil/nstime.h"
27#include "tvbuff.h"
28#include <wsutil/value_string.h>
29#include "packet_info.h"
30#include "ftypes/ftypes.h"
31#include "register.h"
32#include "ws_symbol_export.h"
33#include "ws_attributes.h"
34
35#ifdef __cplusplus
36 extern "C" {
37#endif /* __cplusplus */
38
48WS_DLL_PUBLIC int hf_text_only;
49
51#define ITEM_LABEL_LENGTH 240
52
53#define ITEM_LABEL_UNKNOWN_STR "Unknown"
54
55 struct expert_field;
56
57/* Type-check that 'x' is compatible with 'type', should give compiler warnings otherwise. */
58#define cast_same(type, x) (0 ? (type)0 : (x))
59
61#define VALS(x) (cast_same(const struct _value_string*, (x)))
62
64#define VALS64(x) (cast_same(const struct _val64_string*, (x)))
65
67#define VALS_EXT_PTR(x) (cast_same(value_string_ext*, (x)))
68
70#define TIME_VALS(x) (cast_same(const struct _time_value_string*, (x)))
71
73#define TFS(x) (cast_same(const struct true_false_string*, (x)))
74
76#define UNS(x) (cast_same(const struct unit_name_string*, (x)))
77
78 typedef void (*custom_fmt_func_t)(char *, uint32_t);
79
80 typedef void (*custom_fmt_func_64_t)(char *, uint64_t);
81
82 typedef void (*custom_fmt_func_double_t)(char *, double);
83
91#define CF_FUNC(x) ((const void *) (size_t) (x))
92
95#define RVALS(x) (cast_same(const struct _range_string*, (x)))
96
98#define FRAMENUM_TYPE(x) GINT_TO_POINTER(x)
99
100 struct _protocol;
101
103 typedef struct _protocol protocol_t;
104
115WS_DLL_PUBLIC WS_NORETURN
116 void proto_report_dissector_bug(const char *format, ...)
117 G_GNUC_PRINTF(1, 2);
118
119#define REPORT_DISSECTOR_BUG(...) \
120 proto_report_dissector_bug(__VA_ARGS__)
121
125#ifdef _MSC_VER
126/* XXX - Is there a way to say "quit checking at this point"? */
127#define __DISSECTOR_ASSERT_STATIC_ANALYSIS_HINT(expression) \
128 ; __analysis_assume(expression);
129#else
130#define __DISSECTOR_ASSERT_STATIC_ANALYSIS_HINT(expression)
131#endif
132
144#define __DISSECTOR_ASSERT_STRINGIFY(s) # s
145
146#define __DISSECTOR_ASSERT(expression, file, lineno) \
147 (REPORT_DISSECTOR_BUG("%s:%u: failed assertion \"%s\"", \
148 file, lineno, __DISSECTOR_ASSERT_STRINGIFY(expression)))
149
150#define __DISSECTOR_ASSERT_HINT(expression, file, lineno, hint) \
151 (REPORT_DISSECTOR_BUG("%s:%u: failed assertion \"%s\" (%s)", \
152 file, lineno, __DISSECTOR_ASSERT_STRINGIFY(expression), hint))
153
154#define DISSECTOR_ASSERT(expression) \
155 ((void) ((expression) ? (void)0 : \
156 __DISSECTOR_ASSERT (expression, __FILE__, __LINE__))) \
157 __DISSECTOR_ASSERT_STATIC_ANALYSIS_HINT(expression)
158
166#define DISSECTOR_ASSERT_HINT(expression, hint) \
167 ((void) ((expression) ? (void)0 : \
168 __DISSECTOR_ASSERT_HINT (expression, __FILE__, __LINE__, hint))) \
169 __DISSECTOR_ASSERT_STATIC_ANALYSIS_HINT(expression)
170
171#if 0
172/* win32: using a debug breakpoint (int 3) can be very handy while debugging,
173 * as the assert handling of GTK/GLib is currently not very helpful */
174#define DISSECTOR_ASSERT(expression) \
175{ if(!(expression)) _asm { int 3}; }
176#endif
177
186#define DISSECTOR_ASSERT_NOT_REACHED() \
187 (REPORT_DISSECTOR_BUG("%s:%u: failed assertion \"DISSECTOR_ASSERT_NOT_REACHED\"", \
188 __FILE__, __LINE__))
189
209#define __DISSECTOR_ASSERT_CMPINT(a, op, b, type, fmt) \
210 (REPORT_DISSECTOR_BUG("%s:%u: failed assertion " #a " " #op " " #b " (" fmt " " #op " " fmt ")", \
211 __FILE__, __LINE__, (type)a, (type)b))
212
213#define DISSECTOR_ASSERT_CMPINT(a, op, b) \
214 ((void) ((a op b) ? (void)0 : \
215 __DISSECTOR_ASSERT_CMPINT (a, op, b, int64_t, "%" PRId64))) \
216 __DISSECTOR_ASSERT_STATIC_ANALYSIS_HINT(a op b)
217
223#define DISSECTOR_ASSERT_CMPUINT(a, op, b) \
224 ((void) ((a op b) ? (void)0 : \
225 __DISSECTOR_ASSERT_CMPINT (a, op, b, uint64_t, "%" PRIu64))) \
226 __DISSECTOR_ASSERT_STATIC_ANALYSIS_HINT(a op b)
227
231#define DISSECTOR_ASSERT_CMPUINTHEX(a, op, b) \
232 ((void) ((a op b) ? (void)0 : \
233 __DISSECTOR_ASSERT_CMPINT (a, op, b, uint64_t, "0x%" PRIX64))) \
234 __DISSECTOR_ASSERT_STATIC_ANALYSIS_HINT(a op b)
235
236/*
237 * This is similar to DISSECTOR_ASSERT(hfinfo->type == type) except that
238 * it will report the name of the field with the wrong type as well as
239 * the type.
240 *
241 * @param hfinfo The hfinfo for the field being tested
242 * @param type The type it's expected to have
243 */
244#define __DISSECTOR_ASSERT_FIELD_TYPE(hfinfo, t) \
245 (REPORT_DISSECTOR_BUG("%s:%u: field %s is not of type "#t, \
246 __FILE__, __LINE__, (hfinfo)->abbrev))
247
248#define DISSECTOR_ASSERT_FIELD_TYPE(hfinfo, t) \
249 ((void) (((hfinfo)->type == t) ? (void)0 : \
250 __DISSECTOR_ASSERT_FIELD_TYPE ((hfinfo), t))) \
251 __DISSECTOR_ASSERT_STATIC_ANALYSIS_HINT((hfinfo)->type == t)
252
253#define DISSECTOR_ASSERT_FIELD_TYPE_IS_INTEGRAL(hfinfo) \
254 ((void) ((FT_IS_INTEGER((hfinfo)->type)) ? (void)0 : \
255 REPORT_DISSECTOR_BUG("%s:%u: field %s is not of type FT_CHAR or an FT_{U}INTn type", \
256 __FILE__, __LINE__, (hfinfo)->abbrev))) \
257 __DISSECTOR_ASSERT_STATIC_ANALYSIS_HINT(FT_IS_INTEGER((hfinfo)->type))
258
259#define __DISSECTOR_ASSERT_FIELD_TYPE_IS_STRING(hfinfo) \
260 (REPORT_DISSECTOR_BUG("%s:%u: field %s is not of type FT_STRING, FT_STRINGZ, FT_STRINGZPAD, FT_STRINGZTRUNC, or FT_UINT_STRING", \
261 __FILE__, __LINE__, (hfinfo)->abbrev))
262
263#define DISSECTOR_ASSERT_FIELD_TYPE_IS_STRING(hfinfo) \
264 ((void) (FT_IS_STRING((hfinfo)->type) ? (void)0 : \
265 __DISSECTOR_ASSERT_FIELD_TYPE_IS_STRING ((hfinfo)))) \
266 __DISSECTOR_ASSERT_STATIC_ANALYSIS_HINT(FT_IS_STRING((hfinfo)->type))
267
268#define __DISSECTOR_ASSERT_FIELD_TYPE_IS_TIME(hfinfo) \
269 (REPORT_DISSECTOR_BUG("%s:%u: field %s is not of type FT_ABSOLUTE_TIME or FT_RELATIVE_TIME", \
270 __FILE__, __LINE__, (hfinfo)->abbrev))
271
272#define DISSECTOR_ASSERT_FIELD_TYPE_IS_TIME(hfinfo) \
273 ((void) (((hfinfo)->type == FT_ABSOLUTE_TIME || \
274 (hfinfo)->type == FT_RELATIVE_TIME) ? (void)0 : \
275 __DISSECTOR_ASSERT_FIELD_TYPE_IS_TIME ((hfinfo)))) \
276 __DISSECTOR_ASSERT_STATIC_ANALYSIS_HINT((hfinfo)->type == FT_ABSOLUTE_TIME || \
277 (hfinfo)->type == FT_RELATIVE_TIME)
278
279/*
280 * Encoding flags that apply to multiple data types.
281 */
282/*
283 * The encoding of a field of a particular type may involve more
284 * than just whether it's big-endian or little-endian and its size.
285 *
286 * For integral values, that's it, as 99.9999999999999% of the machines
287 * out there are 2's complement binary machines with 8-bit bytes,
288 * so the protocols out there expect that and, for example, any Unisys
289 * 2200 series machines out there just have to translate between 2's
290 * complement and 1's complement (and nobody's put any IBM 709x's on
291 * any networks lately :-)).
292 *
293 * However:
294 *
295 * for floating-point numbers, in addition to IEEE decimal
296 * floating-point, there's also IBM System/3x0 and PDP-11/VAX
297 * floating-point - most protocols use IEEE binary, but DCE RPC
298 * can use other formats if that's what the sending host uses;
299 *
300 * for character strings, there are various character encodings
301 * (various ISO 646 sets, ISO 8859/x, various other national
302 * standards, various DOS and Windows encodings, various Mac
303 * encodings, UTF-8, UTF-16, other extensions to ASCII, EBCDIC,
304 * etc.);
305 *
306 * for absolute times, there's UNIX time_t, UNIX time_t followed
307 * by 32-bit microseconds, UNIX time_t followed by 32-bit
308 * nanoseconds, DOS date/time, Windows FILETIME, NTP time, etc..
309 *
310 * We might also, in the future, want to allow a field specifier to
311 * indicate the encoding of the field, or at least its default
312 * encoding, as most fields in most protocols always use the
313 * same encoding (although that's not true of all fields, so we
314 * still need to be able to specify that at run time).
315 *
316 * So, for now, we define ENC_BIG_ENDIAN and ENC_LITTLE_ENDIAN as
317 * bit flags, to be combined, in the future, with other information
318 * to specify the encoding in the last argument to
319 * proto_tree_add_item(), and possibly to specify in a field
320 * definition (e.g., ORed in with the type value).
321 *
322 * Currently, proto_tree_add_item() treats its last argument as a
323 * Boolean - if it's zero, the field is big-endian, and if it's non-zero,
324 * the field is little-endian - and other code in epan/proto.c does
325 * the same. We therefore define ENC_BIG_ENDIAN as 0x00000000 and
326 * ENC_LITTLE_ENDIAN as 0x80000000 - we're using the high-order bit
327 * so that we could put a field type and/or a value such as a character
328 * encoding in the lower bits.
329 */
330#define ENC_BIG_ENDIAN 0x00000000
331#define ENC_LITTLE_ENDIAN 0x80000000
332
333#if G_BYTE_ORDER == G_LITTLE_ENDIAN
334 #define ENC_HOST_ENDIAN ENC_LITTLE_ENDIAN
335 #define ENC_ANTI_HOST_ENDIAN ENC_BIG_ENDIAN
336#else
337 #define ENC_HOST_ENDIAN ENC_BIG_ENDIAN
338 #define ENC_ANTI_HOST_ENDIAN ENC_LITTLE_ENDIAN
339#endif
340
341/*
342 * For protocols (FT_PROTOCOL), aggregate items with subtrees (FT_NONE),
343 * opaque byte-array fields (FT_BYTES), and other fields where there
344 * is no choice of encoding (either because it's "just a bucket
345 * of bytes" or because the encoding is completely fixed), we
346 * have ENC_NA (for "Not Applicable").
347 */
348#define ENC_NA 0x00000000
349
350/*
351 * Encoding for character strings - and for character-encoded values
352 * for non-string types.
353 *
354 * Historically, the only place the representation mattered for strings
355 * was with FT_UINT_STRINGs, where we had false for the string length
356 * being big-endian and true for it being little-endian.
357 *
358 * We now have encoding values for the character encoding. The encoding
359 * values are encoded in all but the top bit (which is the byte-order
360 * bit, required for FT_UINT_STRING and for UCS-2 and UTF-16 strings)
361 * and the bottom bit (which we ignore for now so that programs that
362 * pass true for the encoding just do ASCII).
363 *
364 * For ENC_ASCII, we map ASCII characters with the high bit set to the UTF-8
365 * REPLACEMENT CHARACTER, and do the same for ENC_UTF_8 with invalid UTF-8
366 * sequences. We should also map 0x00 to that as well - null-terminated and
367 * null-padded strings never have NULs in them, but counted strings might.
368 * Either that, or strings should be counted, not null-terminated. Note
369 * that conversion of ASCII and UTF-8 can change the length of the string,
370 * as with any other encoding, due to REPLACEMENT CHARACTERs.
371 *
372 * For display, perhaps we should also map control characters to the
373 * Unicode glyphs showing the name of the control character in small
374 * caps, diagonally. (Unfortunately, those only exist for C0, not C1.)
375 *
376 * *DO NOT* add anything to this set that is not a character encoding!
377 */
378#define ENC_CHARENCODING_MASK 0x0000FFFE /* mask out byte-order bits and other bits used with string encodings */
379#define ENC_ASCII 0x00000000
380#define ENC_ISO_646_IRV ENC_ASCII /* ISO 646 International Reference Version = ASCII */
381#define ENC_UTF_8 0x00000002
382#define ENC_UTF_16 0x00000004
383#define ENC_UCS_2 0x00000006
384#define ENC_UCS_4 0x00000008
385#define ENC_ISO_8859_1 0x0000000A
386#define ENC_ISO_8859_2 0x0000000C
387#define ENC_ISO_8859_3 0x0000000E
388#define ENC_ISO_8859_4 0x00000010
389#define ENC_ISO_8859_5 0x00000012
390#define ENC_ISO_8859_6 0x00000014
391#define ENC_ISO_8859_7 0x00000016
392#define ENC_ISO_8859_8 0x00000018
393#define ENC_ISO_8859_9 0x0000001A
394#define ENC_ISO_8859_10 0x0000001C
395#define ENC_ISO_8859_11 0x0000001E
396/* #define ENC_ISO_8859_12 0x00000020 ISO 8859-12 was abandoned */
397#define ENC_ISO_8859_13 0x00000022
398#define ENC_ISO_8859_14 0x00000024
399#define ENC_ISO_8859_15 0x00000026
400#define ENC_ISO_8859_16 0x00000028
401#define ENC_WINDOWS_1250 0x0000002A
402#define ENC_3GPP_TS_23_038_7BITS_PACKED 0x0000002C
403#define ENC_3GPP_TS_23_038_7BITS ENC_3GPP_TS_23_038_7BITS_PACKED
404#define ENC_EBCDIC 0x0000002E
405#define ENC_MAC_ROMAN 0x00000030
406#define ENC_CP437 0x00000032
407#define ENC_ASCII_7BITS 0x00000034
408#define ENC_T61 0x00000036
409#define ENC_EBCDIC_CP037 0x00000038
410#define ENC_WINDOWS_1252 0x0000003A
411#define ENC_WINDOWS_1251 0x0000003C
412#define ENC_CP855 0x0000003E
413#define ENC_CP866 0x00000040
414#define ENC_ISO_646_BASIC 0x00000042
415#define ENC_BCD_DIGITS_0_9 0x00000044 /* Packed BCD, digits 0-9 */
416#define ENC_KEYPAD_ABC_TBCD 0x00000046 /* Keypad-with-a/b/c "telephony BCD" = 0-9, *, #, a, b, c */
417#define ENC_KEYPAD_BC_TBCD 0x00000048 /* Keypad-with-B/C "telephony BCD" = 0-9, B, C, *, # */
418#define ENC_3GPP_TS_23_038_7BITS_UNPACKED 0x0000004C
419#define ENC_ETSI_TS_102_221_ANNEX_A 0x0000004E /* ETSI TS 102 221 Annex A */
420#define ENC_GB18030 0x00000050
421#define ENC_EUC_KR 0x00000052
422#define ENC_APN_STR 0x00000054 /* The encoding the APN/DNN field follows 3GPP TS 23.003 [2] clause 9.1.*/
423#define ENC_DECT_STANDARD_8BITS 0x00000056 /* DECT standard character set as defined in ETSI EN 300 175-5 Annex D */
424#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)*/
425#define ENC_EBCDIC_CP500 0x00000060
426/*
427 * TODO:
428 *
429 * packet-bacapp.c refers to two currently unsupported character sets (where
430 * we just use ASCII currently):
431 *
432 * "IBM MS DBCS" - At the very least could be any IBM/MS Double Byte
433 * Character Set for CJK (4 major ones), but also could just be any non
434 * Unicode and non ISO-8859-1 code page. This would be supported via the
435 * various code pages.
436 * JIS C 6226 / JIS X 0206 - Does this refer to ISO-2022-JP, SHIFT-JIS, or
437 * EUC-JP, which are all encoding schemes that support the JIS X 0206
438 * character set?
439 *
440 * As those are added, change code such as the code in packet-bacapp.c
441 * to use them.
442 *
443 * There's also some other code (e.g., packet-smpp.c) that just ignores
444 * strings if it determines that they are in an unsupported encoding, such
445 * as various encodings of Japanese mentioned above, for example.
446 *
447 */
448
449/*
450 * This is a modifier for FT_UINT_STRING and FT_UINT_BYTES values;
451 * it indicates that the length field should be interpreted as per
452 * sections 2.5.2.11 Octet String through 2.5.2.14 Long Character
453 * String of the ZigBee Cluster Library Specification, where if all
454 * bits are set in the length field, the string has an invalid value,
455 * and the number of octets in the value is 0.
456 */
457#define ENC_ZIGBEE 0x40000000
458
459/*
460 * This is a modifier for ENC_UTF_16, ENC_UCS_2, and ENC_UCS_4
461 * indicating that if the first two (or four, for UCS-4) octets
462 * are a big-endian or little-endian BOM, use that to determine
463 * the serialization order and ignore the ENC_LITTLE_ENDIAN or
464 * ENC_BIG_ENDIAN flag. This can't collide with ENC_ZIGBEE because
465 * it could be used simultaneously.
466 */
467#define ENC_BOM 0x20000000
468
469/*
470 * For cases where either native type or string encodings could both be
471 * valid arguments, we need something to distinguish which one is being
472 * passed as the argument, because ENC_BIG_ENDIAN and ENC_ASCII are both
473 * 0x00000000. So we use ENC_STR_NUM or ENC_STR_HEX bit-or'ed with
474 * ENC_ASCII and its ilk.
475 *
476 * XXX - ENC_STR_NUM is not yet supported by any code in Wireshark,
477 * and these are only used for byte arrays. Presumably they could
478 * also be used for integral values in the future.
479 */
480/* this is for strings as numbers "12345" */
481#define ENC_STR_NUM 0x01000000
482/* this is for strings as hex "1a2b3c" */
483#define ENC_STR_HEX 0x02000000
484/* a convenience macro for either of the above */
485#define ENC_STRING 0x03000000
486/* Kept around for compatibility for Lua scripts; code should use ENC_CHARENCODING_MASK */
487#define ENC_STR_MASK 0x0000FFFE
488
489/*
490 * For cases where the number is allowed to have a leading '+'/'-'
491 * this can't collide with ENC_SEP_* because they can be used simultaneously
492 *
493 * XXX - this is not used anywhere in Wireshark's code, dating back to
494 * at least Wireshark 2.6 and continuing to the current version.
495 * Perhaps the intent was to use it in the future, but 1) I'm not sure
496 * why it would be combined with ENC_SEP_, as byte arrays have no sign
497 * but integral values do, and 2) if we were to support string encodings
498 * for integral types, presumably whether it's signed (FT_INTn) or
499 * unsigned (FT_UINTn) would suffice to indicate whether the value
500 * can be signed or not.
501 */
502#define ENC_NUM_PREF 0x00200000
503
504/*
505 * Encodings for byte arrays.
506 *
507 * For cases where the byte array is encoded as a string composed of
508 * pairs of hex digits, possibly with a separator character between
509 * the pairs. That's specified by the encoding having ENC_STR_HEX,
510 * plus one of these values, set.
511 *
512 * See hex_str_to_bytes_encoding() in epan/strutil.h for details.
513 */
514#define ENC_SEP_NONE 0x00010000
515#define ENC_SEP_COLON 0x00020000
516#define ENC_SEP_DASH 0x00040000
517#define ENC_SEP_DOT 0x00080000
518#define ENC_SEP_SPACE 0x00100000
519/* a convenience macro for the above */
520#define ENC_SEP_MASK 0x001F0000
521
522/* Encodings for BCD strings
523 * Depending if the BCD string has even or odd number of digits
524 * we may need to strip off the last digit/High nibble.
525 */
526#define ENC_BCD_ODD_NUM_DIG 0x00010000
527#define ENC_BCD_SKIP_FIRST 0x00020000
528
529/*
530 * Encodings for time values.
531 *
532 * Historically FT_TIMEs were only timespecs; the only question was whether
533 * they were stored in big- or little-endian format.
534 *
535 * For backwards compatibility, we interpret an encoding of 1 as meaning
536 * "little-endian timespec", so that passing true is interpreted as that.
537 *
538 * We now support:
539 *
540 * ENC_TIME_SECS_NSECS - 8, 12, or 16 bytes. For 8 bytes, the first 4
541 * bytes are seconds and the next 4 bytes are nanoseconds; for 12 bytes,
542 * the first 8 bytes are seconds and the next 4 bytes are nanoseconds;
543 * for 16 bytes, the first 8 bytes are seconds and the next 8 bytes are
544 * nanoseconds. If the time is absolute, the seconds are seconds since
545 * the UN*X epoch (1970-01-01 00:00:00 UTC). (I.e., a UN*X struct
546 * timespec with a 4-byte or 8-byte time_t or a structure with an
547 * 8-byte time_t and an 8-byte nanoseconds field.)
548 *
549 * ENC_TIME_NTP - 8 bytes; the first 4 bytes are seconds since the NTP
550 * epoch (1900-01-01 00:00:00 GMT) and the next 4 bytes are 1/2^32's of
551 * a second since that second. (I.e., a 64-bit count of 1/2^32's of a
552 * second since the NTP epoch, with the upper 32 bits first and the
553 * lower 32 bits second, even when little-endian.) A value of 0 is a
554 * special case representing unknown or unsynchronized time. Per the
555 * suggestion in RFC 4330, if bit 0 is not set then the time is assumed
556 * to be in NTP Era 1, beginning on 2036-02-07 06:28:16 UTC. (I.e., the
557 * time displayed will be between 1968-01-20 03:14:08 UTC and
558 * 2104-02-26 09:42:24 UTC.) The 16 byte NTP date format and the 4 byte
559 * NTP short relative time format are not supported.
560 * Encodings that store only the seconds since the NTP epoch without
561 * fractional seconds should use ENC_TIME_SECS_NTP, described below.
562 *
563 * ENC_TIME_TOD - 8 bytes, as a count of microseconds since the System/3x0
564 * and z/Architecture epoch (1900-01-01 00:00:00 GMT).
565 *
566 * ENC_TIME_RTPS - 8 bytes; the first 4 bytes are seconds since the UN*X
567 * epoch and the next 4 bytes are 1/2^32's of a second since that
568 * second. (I.e., it's the offspring of a mating between UN*X time and
569 * NTP time). It's used by the Object Management Group's Real-Time
570 * Publish-Subscribe Wire Protocol for the Data Distribution Service.
571 *
572 * ENC_TIME_SECS_USECS - 8 bytes; the first 4 bytes are seconds and the
573 * next 4 bytes are microseconds. If the time is absolute, the seconds
574 * are seconds since the UN*X epoch. (I.e., a UN*X struct timeval with
575 * a 4-byte time_t.)
576 *
577 * ENC_TIME_SECS - 4 to 8 bytes, representing a value in seconds.
578 * If the time is absolute, it's seconds since the UN*X epoch.
579 *
580 * ENC_TIME_MSECS - 6 to 8 bytes, representing a value in milliseconds.
581 * If the time is absolute, it's milliseconds since the UN*X epoch.
582 *
583 * ENC_TIME_USECS - 8 bytes, representing a value in microseconds.
584 * If the time is absolute, it's microseconds since the UN*X epoch.
585 *
586 * ENC_TIME_NSECS - 8 bytes, representing a value in nanoseconds.
587 * If the time is absolute, it's nanoseconds since the UN*X epoch.
588 *
589 * ENC_TIME_SECS_NTP - 4 bytes, representing a count of seconds since
590 * the NTP epoch. As with ENC_TIME_NTP, times are assumed to be in
591 * the upper half of NTP Era 0 or the lower half of NTP Era 1.
592 *
593 * ENC_TIME_RFC_3971 - 8 bytes, representing a count of 1/64ths of a
594 * second since the UN*X epoch; see section 5.3.1 "Timestamp Option"
595 * in RFC 3971.
596 *
597 * ENC_TIME_MSEC_NTP - 6-8 bytes, representing a count of milliseconds since
598 * the NTP epoch. Similar to ENC_TIME_NTP, times before the midpoint of
599 * NTP Era 0 (1968-01-20) are assumed to represent the corresponding
600 * time in NTP Era 1 instead.
601 *
602 * ENC_TIME_MIP6 - 8 bytes; the first 48 bits are seconds since the UN*X epoch
603 * and the remaining 16 bits indicate the number of 1/65536's of a second
604 * since that second.
605 *
606 * ENC_TIME_MP4_FILE_SECS - 4-8 bytes, representing a count of seconds since
607 * January 1, 1904, 00:00:00 UTC.
608 *
609 * ENC_TIME_ZBEE_ZCL - 4-8 bytes, representing a count of seconds since
610 * January 1, 2000, 00:00:00 UTC.
611 */
612#define ENC_TIME_SECS_NSECS 0x00000000
613#define ENC_TIME_TIMESPEC 0x00000000 /* for backwards source compatibility */
614#define ENC_TIME_NTP 0x00000002
615#define ENC_TIME_TOD 0x00000004
616#define ENC_TIME_RTPS 0x00000008
617#define ENC_TIME_NTP_BASE_ZERO 0x00000008 /* for backwards source compatibility */
618#define ENC_TIME_SECS_USECS 0x00000010
619#define ENC_TIME_TIMEVAL 0x00000010 /* for backwards source compatibility */
620#define ENC_TIME_SECS 0x00000012
621#define ENC_TIME_MSECS 0x00000014
622#define ENC_TIME_SECS_NTP 0x00000018
623#define ENC_TIME_RFC_3971 0x00000020
624#define ENC_TIME_MSEC_NTP 0x00000022
625#define ENC_TIME_MIP6 0x00000024
626#define ENC_TIME_MP4_FILE_SECS 0x00000026
627#define ENC_TIME_CLASSIC_MAC_OS_SECS 0x00000026 /* for backwards source compatibility */
628#define ENC_TIME_NSECS 0x00000028
629#define ENC_TIME_USECS 0x00000030
630#define ENC_TIME_ZBEE_ZCL 0x00000032
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
683 typedef enum {
684 BASE_NONE = 0,
686/* Integral and float types */
687 BASE_DEC,
688 BASE_HEX,
689 BASE_OCT,
690 BASE_DEC_HEX,
691 BASE_HEX_DEC,
692 BASE_CUSTOM,
693 BASE_EXP,
695/* Byte separators */
696 SEP_DOT,
697 SEP_DASH,
698 SEP_COLON,
699 SEP_SPACE,
701/* Address types */
702 BASE_NETMASK,
704/* Port types */
705 BASE_PT_UDP,
706 BASE_PT_TCP,
707 BASE_PT_DCCP,
708 BASE_PT_SCTP,
710/* OUI types */
711 BASE_OUI,
713/* Time types */
714 ABSOLUTE_TIME_LOCAL,
715 ABSOLUTE_TIME_UTC,
716 ABSOLUTE_TIME_DOY_UTC,
717 ABSOLUTE_TIME_NTP_UTC,
718 ABSOLUTE_TIME_UNIX,
720/* String types */
721 BASE_STR_WSP,
722} field_display_e;
723
724#define FIELD_DISPLAY(d) ((d) & FIELD_DISPLAY_E_MASK)
725
726#define FIELD_DISPLAY_IS_ABSOLUTE_TIME(d) \
727 (FIELD_DISPLAY(d) >= ABSOLUTE_TIME_LOCAL && FIELD_DISPLAY(d) <= ABSOLUTE_TIME_UNIX)
728
729/* Following constants have to be ORed with a field_display_e when dissector
730 * want to use specials value-string MACROs for a header_field_info */
731#define BASE_RANGE_STRING 0x00000100
732#define BASE_EXT_STRING 0x00000200
733#define BASE_VAL64_STRING 0x00000400
734
735#define BASE_ALLOW_ZERO 0x00000800
737#define BASE_UNIT_STRING 0x00001000
739#define BASE_NO_DISPLAY_VALUE 0x00002000
742#define BASE_PROTOCOL_INFO 0x00004000
744#define BASE_SPECIAL_VALS 0x00008000
746#define BASE_SHOW_ASCII_PRINTABLE 0x00010000
748#define BASE_SHOW_UTF_8_PRINTABLE 0x00020000
751#define IS_BASE_DUAL(b) ((b)==BASE_DEC_HEX||(b)==BASE_HEX_DEC)
752
754#define IS_BASE_PORT(b) (((b)==BASE_PT_UDP||(b)==BASE_PT_TCP||(b)==BASE_PT_DCCP||(b)==BASE_PT_SCTP))
755
756 typedef enum {
757 HF_REF_TYPE_NONE,
758 HF_REF_TYPE_INDIRECT,
759 HF_REF_TYPE_DIRECT,
760 HF_REF_TYPE_PRINT
761} hf_ref_type;
762
764 typedef struct _header_field_info header_field_info;
765
767 struct _header_field_info {
768 /* ---------- set by dissector --------- */
769 const char *name;
770 const char *abbrev;
771 enum ftenum type;
772 int display;
773 const void *strings;
777 uint64_t bitmask;
778 const char *blurb;
780 /* ------- set by proto routines (prefilled by HFILL macro, see below) ------ */
781 int id;
782 int parent;
783 hf_ref_type ref_type;
784 int same_name_prev_id;
785 header_field_info *same_name_next;
786};
787
793#define HFILL -1, 0, HF_REF_TYPE_NONE, -1, NULL
794
795#define HFILL_INIT(hf) \
796 (hf).hfinfo.id = -1; \
797 (hf).hfinfo.parent = 0; \
798 (hf).hfinfo.ref_type = HF_REF_TYPE_NONE; \
799 (hf).hfinfo.same_name_prev_id = -1; \
800 (hf).hfinfo.same_name_next = NULL;
801
803 typedef struct hf_register_info {
804 int *p_id;
805 header_field_info hfinfo;
806} hf_register_info;
807
809 typedef struct _item_label_t {
810 char representation[ITEM_LABEL_LENGTH];
811 size_t value_pos;
812 size_t value_len;
813} item_label_t;
814
816 typedef struct field_info {
817 const header_field_info *hfinfo;
818 int start;
819 int length;
820 int appendix_start;
821 int appendix_length;
822 int tree_type;
823 uint32_t flags;
824 item_label_t *rep;
825 tvbuff_t *ds_tvb;
826 fvalue_t *value;
827 int total_layer_num;
828 int proto_layer_num;
829} field_info;
830
831
832/*
833 * This structure describes one segment of a split-bits item
834 * crumb_bit_offset is the bit offset in the input tvb of the first (most significant) bit of this crumb
835 * crumb_bit_length is the number of contiguous bits of this crumb.
836 * The first element of an array of bits_specs describes the most significant crumb of the output value.
837 * The second element of an array of bits_specs describes the next-most significant crumb of the output value, etc.
838 * The array is terminated by a sentinel entry with crumb_bit_length of 0.
839*/
840 typedef struct
841{
842 unsigned crumb_bit_offset;
843 uint8_t crumb_bit_length;
844} crumb_spec_t;
845
846/*
847 * Flag fields. Do not assign values greater than 0x000FFFFF unless you
848 * shuffle the expert information upward; see below.
849 */
850
856#define FI_HIDDEN 0x00000001
859#define FI_GENERATED 0x00000002
861#define FI_URL 0x00000004
862
864#define FI_LITTLE_ENDIAN 0x00000008
866#define FI_BIG_ENDIAN 0x00000010
868#define FI_BITS_OFFSET(n) (((n) & 63) << 5)
870/* if 0, it means that field takes fi->length * 8 */
871#define FI_BITS_SIZE(n) (((n) & 63) << 12)
873#define FI_VARINT 0x00040000
874
876#define FI_GET_FLAG(fi, flag) ((fi) ? ((fi)->flags & (flag)) : 0)
878#define FI_SET_FLAG(fi, flag) \
879 do { \
880 if (fi) \
881 (fi)->flags = (fi)->flags | (flag); \
882 } while(0)
884#define FI_RESET_FLAG(fi, flag) \
885 do { \
886 if (fi) \
887 (fi)->flags = (fi)->flags & ~(flag); \
888 } while(0)
889
890#define FI_GET_BITS_OFFSET(fi) (FI_GET_FLAG(fi, FI_BITS_OFFSET(63)) >> 5)
891#define FI_GET_BITS_SIZE(fi) (FI_GET_FLAG(fi, FI_BITS_SIZE(63)) >> 12)
892
895 typedef struct {
896 GHashTable *interesting_hfids;
897 bool visible;
898 bool fake_protocols;
899 unsigned count;
900 struct _packet_info *pinfo;
901 tvbuff_t *idle_count_ds_tvb;
902 int max_start;
903 unsigned start_idle_count;
904} tree_data_t;
905
907 typedef struct _proto_node {
908 struct _proto_node *first_child;
909 struct _proto_node *last_child;
910 struct _proto_node *next;
911 struct _proto_node *parent;
912 const header_field_info *hfinfo;
913 field_info *finfo;
914 tree_data_t *tree_data;
915} proto_node;
916
918 typedef proto_node proto_tree;
920 typedef proto_node proto_item;
921
922/*
923 * Expert information.
924 * This is in the flags field; we allocate this from the top down,
925 * so as not to collide with FI_ flags, which are allocated from
926 * the bottom up.
927 */
928
929/* expert severities */
930#define PI_SEVERITY_MASK 0x00F00000
932#define PI_COMMENT 0x00100000
934#define PI_CHAT 0x00200000
936#define PI_NOTE 0x00400000
938#define PI_WARN 0x00600000
940#define PI_ERROR 0x00800000
941
942/* expert "event groups" */
943#define PI_GROUP_MASK 0xFF000000
945#define PI_CHECKSUM 0x01000000
947#define PI_SEQUENCE 0x02000000
949#define PI_RESPONSE_CODE 0x03000000
951#define PI_REQUEST_CODE 0x04000000
953#define PI_UNDECODED 0x05000000
955#define PI_REASSEMBLE 0x06000000
957#define PI_MALFORMED 0x07000000
959#define PI_DEBUG 0x08000000
961#define PI_PROTOCOL 0x09000000
963#define PI_SECURITY 0x0a000000
965#define PI_COMMENTS_GROUP 0x0b000000
967#define PI_DECRYPTION 0x0c000000
969#define PI_ASSUMPTION 0x0d000000
971#define PI_DEPRECATED 0x0e000000
973#define PI_RECEIVE 0x0f000000
975#define PI_INTERFACE 0x10000000
977#define PI_DISSECTOR_BUG 0x11000000
978
979/*
980 * add more, see WSDG: 9.3. How to add an expert item:
981 * https://www.wireshark.org/docs/wsdg_html/#ChDissectExpertInfo
982 */
983
985#define PNODE_FINFO(proto_node) ((proto_node)->finfo)
986
988#define PITEM_FINFO(proto_item) PNODE_FINFO(proto_item)
989
991#define PTREE_FINFO(proto_tree) PNODE_FINFO(proto_tree)
992
994#define PNODE_HFINFO(proto_node) ((proto_node)->hfinfo)
995
997#define PITEM_HFINFO(proto_item) PNODE_HFINFO(proto_item)
998
1000#define PTREE_HFINFO(proto_tree) PNODE_HFINFO(proto_tree)
1001
1003#define PTREE_DATA(proto_tree) ((proto_tree)->tree_data)
1004
1006#define PNODE_POOL(proto_node) ((proto_node)->tree_data->pinfo->pool)
1007
1013 static inline bool proto_item_is_hidden(const proto_item *ti) {
1014 if (ti && PITEM_FINFO(ti)) {
1015 return FI_GET_FLAG(PITEM_FINFO(ti), FI_HIDDEN);
1016 }
1017 /* XXX - Is a NULL item hidden? */
1018 return true;
1019}
1020#define PROTO_ITEM_IS_HIDDEN(ti) proto_item_is_hidden((ti))
1021
1026 static inline void proto_item_set_hidden(proto_item *ti) {
1027 if (ti) {
1028 FI_SET_FLAG(PITEM_FINFO(ti), FI_HIDDEN);
1029 }
1030}
1031#define PROTO_ITEM_SET_HIDDEN(ti) proto_item_set_hidden((ti))
1032
1036 static inline void proto_item_set_visible(proto_item *ti) {
1037 if (ti) {
1038 FI_RESET_FLAG(PITEM_FINFO(ti), FI_HIDDEN);
1039 }
1040}
1041#define PROTO_ITEM_SET_VISIBLE(ti) proto_item_set_visible((ti))
1042
1047 static inline bool proto_item_is_generated(const proto_item *ti)
1048{
1049 if (ti) {
1050 return FI_GET_FLAG(PITEM_FINFO(ti), FI_GENERATED);
1051 }
1052 return false;
1053}
1054#define PROTO_ITEM_IS_GENERATED(ti) proto_item_is_generated((ti))
1055
1059 static inline void proto_item_set_generated(proto_item *ti) {
1060 if (ti) {
1061 FI_SET_FLAG(PITEM_FINFO(ti), FI_GENERATED);
1062 }
1063}
1064#define PROTO_ITEM_SET_GENERATED(ti) proto_item_set_generated((ti))
1065
1071 static inline bool proto_item_is_url(const proto_item *ti)
1072{
1073 if (ti) {
1074 return FI_GET_FLAG(PITEM_FINFO(ti), FI_URL);
1075 }
1076 return false;
1077}
1078#define PROTO_ITEM_IS_URL(ti) proto_item_is_url((ti))
1079
1083 static inline void proto_item_set_url(proto_item *ti) {
1084 if (ti) {
1085 FI_SET_FLAG(PITEM_FINFO(ti), FI_URL);
1086 }
1087}
1088#define PROTO_ITEM_SET_URL(ti) proto_item_set_url((ti))
1089
1090 typedef void (*proto_tree_foreach_func)(proto_node *, void *);
1091 typedef bool (*proto_tree_traverse_func)(proto_node *, void *);
1092
1093WS_DLL_PUBLIC void proto_tree_children_foreach(proto_tree *tree,
1094 proto_tree_foreach_func func, void *data);
1095
1096 typedef struct {
1097 void (*register_protoinfo)(void); /* routine to call to register protocol information */
1098 void (*register_handoff)(void); /* routine to call to register dissector handoff */
1099} proto_plugin;
1100
1102WS_DLL_PUBLIC void proto_register_plugin(const proto_plugin *plugin);
1103
1105 void proto_pre_init(void);
1106
1108 void proto_init(GSList *register_all_plugin_protocols_list,
1109 GSList *register_all_plugin_handoffs_list,
1110 register_entity_func register_func, register_entity_func handoff_func,
1111 register_cb cb, void *client_data);
1112
1114 extern void proto_cleanup(void);
1115
1116 typedef void (*proto_execute_in_directory_func)(void* param);
1117
1128WS_DLL_PUBLIC void proto_execute_in_directory(const char* dir, proto_execute_in_directory_func func, void* param);
1129
1130
1144WS_DLL_PUBLIC bool proto_field_is_referenced(proto_tree *tree, int proto_id);
1145
1150WS_DLL_PUBLIC proto_tree* proto_item_add_subtree(proto_item *pi, const int idx) G_GNUC_WARN_UNUSED_RESULT;
1151
1155WS_DLL_PUBLIC proto_tree* proto_item_get_subtree(proto_item *pi);
1156
1160WS_DLL_PUBLIC proto_item* proto_item_get_parent(const proto_item *pi);
1161
1166WS_DLL_PUBLIC proto_item* proto_item_get_parent_nth(proto_item *pi, int gen);
1167
1172WS_DLL_PUBLIC void proto_item_set_text(proto_item *pi, const char *format, ...)
1173 G_GNUC_PRINTF(2,3);
1174
1179WS_DLL_PUBLIC void proto_item_append_text(proto_item *pi, const char *format, ...)
1180 G_GNUC_PRINTF(2,3);
1181
1186WS_DLL_PUBLIC void proto_item_prepend_text(proto_item *pi, const char *format, ...)
1187 G_GNUC_PRINTF(2,3);
1188
1192WS_DLL_PUBLIC void proto_item_set_len(proto_item *pi, const int length);
1193
1212WS_DLL_PUBLIC void proto_item_set_end(proto_item *pi, tvbuff_t *tvb, int end);
1213
1218WS_DLL_PUBLIC int proto_item_get_len(const proto_item *pi);
1219
1225WS_DLL_PUBLIC void proto_item_set_bits_offset_len(proto_item *ti, int bits_offset, int bits_len);
1226
1239WS_DLL_PUBLIC char *proto_item_get_display_repr(wmem_allocator_t *scope, proto_item *pi);
1240
1243WS_DLL_PUBLIC proto_tree* proto_tree_create_root(packet_info* pinfo);
1244
1245 void proto_tree_reset(proto_tree *tree);
1246
1249WS_DLL_PUBLIC void proto_tree_free(proto_tree *tree);
1250
1258WS_DLL_PUBLIC bool
1259 proto_tree_set_visible(proto_tree *tree, bool visible);
1260
1264extern void
1265 proto_tree_set_fake_protocols(proto_tree *tree, bool fake_protocols);
1266
1273extern void
1274 proto_tree_prime_with_hfid(proto_tree *tree, const int hfid);
1275
1281extern void
1282 proto_tree_prime_with_hfid_print(proto_tree *tree, const int hfid);
1283
1287WS_DLL_PUBLIC proto_item* proto_tree_get_parent(proto_tree *tree);
1288
1292WS_DLL_PUBLIC proto_tree *proto_tree_get_parent_tree(proto_tree *tree);
1293
1297WS_DLL_PUBLIC proto_tree* proto_tree_get_root(proto_tree *tree);
1298
1303WS_DLL_PUBLIC void proto_tree_move_item(proto_tree *tree, proto_item *fixed_item, proto_item *item_to_move);
1304
1305
1311WS_DLL_PUBLIC void proto_tree_set_appendix(proto_tree *tree, tvbuff_t *tvb, int start, const int length);
1312
1313
1323WS_DLL_PUBLIC proto_item *
1324 proto_tree_add_item_new(proto_tree *tree, header_field_info *hfinfo, tvbuff_t *tvb,
1325 const int start, int length, const unsigned encoding);
1326
1348WS_DLL_PUBLIC proto_item *
1349 proto_tree_add_item(proto_tree *tree, int hfindex, tvbuff_t *tvb,
1350 const int start, int length, const unsigned encoding);
1351
1364WS_DLL_PUBLIC proto_item *
1365 proto_tree_add_item_new_ret_length(proto_tree *tree, header_field_info *hfinfo, tvbuff_t *tvb,
1366 const int start, int length, const unsigned encoding, int *lenretval);
1367
1368WS_DLL_PUBLIC proto_item *
1369proto_tree_add_item_ret_length(proto_tree *tree, int hfindex, tvbuff_t *tvb,
1370 const int start, int length, const unsigned encoding, int *lenretval);
1371
1403WS_DLL_PUBLIC proto_item *
1404 proto_tree_add_item_ret_int(proto_tree *tree, int hfindex, tvbuff_t *tvb,
1405 const int start, int length, const unsigned encoding, int32_t *retval);
1406
1407WS_DLL_PUBLIC proto_item *
1408proto_tree_add_item_ret_int64(proto_tree *tree, int hfindex, tvbuff_t *tvb,
1409 const int start, int length, const unsigned encoding, int64_t *retval);
1410
1411WS_DLL_PUBLIC proto_item *
1412proto_tree_add_item_ret_uint(proto_tree *tree, int hfindex, tvbuff_t *tvb,
1413 const int start, int length, const unsigned encoding, uint32_t *retval);
1414
1415WS_DLL_PUBLIC proto_item *
1416proto_tree_add_item_ret_uint64(proto_tree *tree, int hfindex, tvbuff_t *tvb,
1417 const int start, int length, const unsigned encoding, uint64_t *retval);
1418
1419WS_DLL_PUBLIC proto_item *
1420proto_tree_add_item_ret_varint(proto_tree *tree, int hfindex, tvbuff_t *tvb,
1421 const int start, int length, const unsigned encoding, uint64_t *retval, int *lenretval);
1422
1423WS_DLL_PUBLIC proto_item *
1424proto_tree_add_item_ret_boolean(proto_tree *tree, int hfindex, tvbuff_t *tvb,
1425 const int start, int length, const unsigned encoding, bool *retval);
1426
1427WS_DLL_PUBLIC proto_item *
1428proto_tree_add_item_ret_ipv4(proto_tree *tree, int hfindex, tvbuff_t *tvb,
1429 const int start, int length, const unsigned encoding, ws_in4_addr *retval);
1430
1445WS_DLL_PUBLIC proto_item *
1446 proto_tree_add_item_ret_ipv6(proto_tree *tree, int hfindex, tvbuff_t *tvb,
1447 const int start, int length, const unsigned encoding, ws_in6_addr *retval);
1448
1463WS_DLL_PUBLIC proto_item *
1464 proto_tree_add_item_ret_ether(proto_tree *tree, int hfindex, tvbuff_t *tvb,
1465 const int start, int length, const unsigned encoding, uint8_t *retval);
1466
1480WS_DLL_PUBLIC proto_item *
1481 proto_tree_add_item_ret_float(proto_tree *tree, int hfindex, tvbuff_t *tvb,
1482 const int start, int length,
1483 const unsigned encoding, float *retval);
1484
1498WS_DLL_PUBLIC proto_item *
1499 proto_tree_add_item_ret_double(proto_tree *tree, int hfindex, tvbuff_t *tvb,
1500 const int start, int length,
1501 const unsigned encoding, double *retval);
1502
1532WS_DLL_PUBLIC proto_item *
1533 proto_tree_add_item_ret_string_and_length(proto_tree *tree, int hfindex,
1534 tvbuff_t *tvb, const int start, int length, const unsigned encoding,
1535 wmem_allocator_t *scope, const uint8_t **retval, int *lenretval);
1536
1564WS_DLL_PUBLIC proto_item *
1565 proto_tree_add_item_ret_string(proto_tree *tree, int hfindex, tvbuff_t *tvb,
1566 const int start, int length, const unsigned encoding,
1567 wmem_allocator_t *scope, const uint8_t **retval);
1568
1589WS_DLL_PUBLIC proto_item *
1590 proto_tree_add_item_ret_display_string_and_length(proto_tree *tree, int hfindex,
1591 tvbuff_t *tvb,
1592 const int start, int length, const unsigned encoding,
1593 wmem_allocator_t *scope, char **retval, int *lenretval);
1594
1612WS_DLL_PUBLIC proto_item *
1613 proto_tree_add_item_ret_display_string(proto_tree *tree, int hfindex,
1614 tvbuff_t *tvb,
1615 const int start, int length, const unsigned encoding,
1616 wmem_allocator_t *scope, char **retval);
1617
1633WS_DLL_PUBLIC proto_item *
1634 proto_tree_add_item_ret_time_string(proto_tree *tree, int hfindex,
1635 tvbuff_t *tvb,
1636 const int start, int length, const unsigned encoding,
1637 wmem_allocator_t *scope, char **retval);
1638
1647 proto_item *
1648 proto_tree_add_text_internal(proto_tree *tree, tvbuff_t *tvb, int start, int length, const char *format,
1649 ...) G_GNUC_PRINTF(5,6);
1650
1659 proto_item *
1660 proto_tree_add_text_valist_internal(proto_tree *tree, tvbuff_t *tvb, int start,
1661 int length, const char *format, va_list ap) G_GNUC_PRINTF(5, 0);
1662
1672WS_DLL_PUBLIC proto_tree *
1673 proto_tree_add_subtree(proto_tree *tree, tvbuff_t *tvb, int start, int length, int idx,
1674 proto_item **tree_item, const char *text);
1675
1686WS_DLL_PUBLIC proto_tree *
1687 proto_tree_add_subtree_format(proto_tree *tree, tvbuff_t *tvb, int start, int length, int idx,
1688 proto_item **tree_item, const char *format, ...) G_GNUC_PRINTF(7,8);
1689
1691WS_DLL_PUBLIC proto_item *
1692 proto_tree_add_format_text(proto_tree *tree, tvbuff_t *tvb, int start, int length);
1693
1695WS_DLL_PUBLIC proto_item *
1696 proto_tree_add_format_wsp_text(proto_tree *tree, tvbuff_t *tvb, int start, int length);
1697
1707WS_DLL_PUBLIC proto_item *
1708 proto_tree_add_none_format(proto_tree *tree, const int hfindex, tvbuff_t *tvb, const int start,
1709 int length, const char *format, ...) G_GNUC_PRINTF(6,7);
1710
1720WS_DLL_PUBLIC proto_item *
1721 proto_tree_add_protocol_format(proto_tree *tree, int hfindex, tvbuff_t *tvb, int start,
1722 int length, const char *format, ...) G_GNUC_PRINTF(6,7);
1723
1732WS_DLL_PUBLIC proto_item *
1733 proto_tree_add_bytes(proto_tree *tree, int hfindex, tvbuff_t *tvb, int start,
1734 int length, const uint8_t* start_ptr);
1735
1746WS_DLL_PUBLIC proto_item *
1747 proto_tree_add_bytes_with_length(proto_tree *tree, int hfindex, tvbuff_t *tvb, int start,
1748 int length, const uint8_t *start_ptr, int ptr_length);
1749
1783WS_DLL_PUBLIC proto_item *
1784 proto_tree_add_bytes_item(proto_tree *tree, int hfindex, tvbuff_t *tvb,
1785 const int start, int length, const unsigned encoding,
1786 GByteArray *retval, int *endoff, int *err);
1787
1801WS_DLL_PUBLIC proto_item *
1802 proto_tree_add_bytes_format_value(proto_tree *tree, int hfindex, tvbuff_t *tvb,
1803 int start, int length, const uint8_t* start_ptr, const char *format,
1804 ...) G_GNUC_PRINTF(7,8);
1805
1818WS_DLL_PUBLIC proto_item *
1819 proto_tree_add_bytes_format(proto_tree *tree, int hfindex, tvbuff_t *tvb, int start,
1820 int length, const uint8_t* start_ptr, const char *format, ...) G_GNUC_PRINTF(7,8);
1821
1830WS_DLL_PUBLIC proto_item *
1831 proto_tree_add_time(proto_tree *tree, int hfindex, tvbuff_t *tvb, int start,
1832 int length, const nstime_t* value_ptr);
1833
1864WS_DLL_PUBLIC proto_item *
1865 proto_tree_add_time_item(proto_tree *tree, int hfindex, tvbuff_t *tvb,
1866 const int start, int length, const unsigned encoding,
1867 nstime_t *retval, int *endoff, int *err);
1868
1869
1882WS_DLL_PUBLIC proto_item *
1883 proto_tree_add_time_format_value(proto_tree *tree, int hfindex, tvbuff_t *tvb,
1884 int start, int length, nstime_t* value_ptr, const char *format, ...)
1885 G_GNUC_PRINTF(7,8);
1886
1899WS_DLL_PUBLIC proto_item *
1900 proto_tree_add_time_format(proto_tree *tree, int hfindex, tvbuff_t *tvb, int start,
1901 int length, nstime_t* value_ptr, const char *format, ...) G_GNUC_PRINTF(7,8);
1902
1911WS_DLL_PUBLIC proto_item *
1912 proto_tree_add_ipxnet(proto_tree *tree, int hfindex, tvbuff_t *tvb, int start,
1913 int length, uint32_t value);
1914
1927WS_DLL_PUBLIC proto_item *
1928 proto_tree_add_ipxnet_format_value(proto_tree *tree, int hfindex, tvbuff_t *tvb,
1929 int start, int length, uint32_t value, const char *format, ...)
1930 G_GNUC_PRINTF(7,8);
1931
1943WS_DLL_PUBLIC proto_item *
1944 proto_tree_add_ipxnet_format(proto_tree *tree, int hfindex, tvbuff_t *tvb, int start,
1945 int length, uint32_t value, const char *format, ...) G_GNUC_PRINTF(7,8);
1946
1955WS_DLL_PUBLIC proto_item *
1956 proto_tree_add_ipv4(proto_tree *tree, int hfindex, tvbuff_t *tvb, int start,
1957 int length, ws_in4_addr value);
1958
1971WS_DLL_PUBLIC proto_item *
1972 proto_tree_add_ipv4_format_value(proto_tree *tree, int hfindex, tvbuff_t *tvb,
1973 int start, int length, ws_in4_addr value, const char *format, ...)
1974 G_GNUC_PRINTF(7,8);
1975
1987WS_DLL_PUBLIC proto_item *
1988 proto_tree_add_ipv4_format(proto_tree *tree, int hfindex, tvbuff_t *tvb, int start,
1989 int length, ws_in4_addr value, const char *format, ...) G_GNUC_PRINTF(7,8);
1990
1999WS_DLL_PUBLIC proto_item *
2000 proto_tree_add_ipv6(proto_tree *tree, int hfindex, tvbuff_t *tvb, int start,
2001 int length, const ws_in6_addr *value_ptr);
2002
2015WS_DLL_PUBLIC proto_item *
2016 proto_tree_add_ipv6_format_value(proto_tree *tree, int hfindex, tvbuff_t *tvb,
2017 int start, int length, const ws_in6_addr *value_ptr, const char *format,
2018 ...) G_GNUC_PRINTF(7,8);
2019
2031WS_DLL_PUBLIC proto_item *
2032 proto_tree_add_ipv6_format(proto_tree *tree, int hfindex, tvbuff_t *tvb, int start,
2033 int length, const ws_in6_addr *value_ptr, const char *format, ...) G_GNUC_PRINTF(7,8);
2034
2043WS_DLL_PUBLIC proto_item *
2044 proto_tree_add_ether(proto_tree *tree, int hfindex, tvbuff_t *tvb, int start,
2045 int length, const uint8_t* value);
2046
2059WS_DLL_PUBLIC proto_item *
2060 proto_tree_add_ether_format_value(proto_tree *tree, int hfindex, tvbuff_t *tvb,
2061 int start, int length, const uint8_t* value, const char *format, ...)
2062 G_GNUC_PRINTF(7,8);
2063
2075WS_DLL_PUBLIC proto_item *
2076 proto_tree_add_ether_format(proto_tree *tree, int hfindex, tvbuff_t *tvb, int start,
2077 int length, const uint8_t* value, const char *format, ...) G_GNUC_PRINTF(7,8);
2078
2087WS_DLL_PUBLIC proto_item *
2088 proto_tree_add_guid(proto_tree *tree, int hfindex, tvbuff_t *tvb, int start,
2089 int length, const e_guid_t *value_ptr);
2090
2103WS_DLL_PUBLIC proto_item *
2104 proto_tree_add_guid_format_value(proto_tree *tree, int hfindex, tvbuff_t *tvb,
2105 int start, int length, const e_guid_t *value_ptr, const char *format,
2106 ...) G_GNUC_PRINTF(7,8);
2107
2119WS_DLL_PUBLIC proto_item *
2120 proto_tree_add_guid_format(proto_tree *tree, int hfindex, tvbuff_t *tvb, int start,
2121 int length, const e_guid_t *value_ptr, const char *format, ...) G_GNUC_PRINTF(7,8);
2122
2131WS_DLL_PUBLIC proto_item *
2132 proto_tree_add_oid(proto_tree *tree, int hfindex, tvbuff_t *tvb, int start,
2133 int length, const uint8_t* value_ptr);
2134
2147WS_DLL_PUBLIC proto_item *
2148 proto_tree_add_oid_format_value(proto_tree *tree, int hfindex, tvbuff_t *tvb,
2149 int start, int length, const uint8_t* value_ptr, const char *format,
2150 ...) G_GNUC_PRINTF(7,8);
2151
2163WS_DLL_PUBLIC proto_item *
2164 proto_tree_add_oid_format(proto_tree *tree, int hfindex, tvbuff_t *tvb, int start,
2165 int length, const uint8_t* value_ptr, const char *format, ...) G_GNUC_PRINTF(7,8);
2166
2186WS_DLL_PUBLIC proto_item *
2187 proto_tree_add_string(proto_tree *tree, int hfindex, tvbuff_t *tvb, int start,
2188 int length, const char* value);
2189
2202WS_DLL_PUBLIC proto_item *
2203 proto_tree_add_string_format_value(proto_tree *tree, int hfindex, tvbuff_t *tvb,
2204 int start, int length, const char* value, const char *format, ...)
2205 G_GNUC_PRINTF(7,8);
2206
2219WS_DLL_PUBLIC proto_item *
2220 proto_tree_add_string_format(proto_tree *tree, int hfindex, tvbuff_t *tvb, int start,
2221 int length, const char* value, const char *format, ...) G_GNUC_PRINTF(7,8);
2222
2231WS_DLL_PUBLIC proto_item *
2232 proto_tree_add_boolean(proto_tree *tree, int hfindex, tvbuff_t *tvb, int start,
2233 int length, uint64_t value);
2234
2247WS_DLL_PUBLIC proto_item *
2248 proto_tree_add_boolean_format_value(proto_tree *tree, int hfindex,
2249 tvbuff_t *tvb, int start, int length, uint64_t value,
2250 const char *format, ...) G_GNUC_PRINTF(7,8);
2251
2263WS_DLL_PUBLIC proto_item *
2264 proto_tree_add_boolean_format(proto_tree *tree, int hfindex, tvbuff_t *tvb, int start,
2265 int length, uint64_t value, const char *format, ...) G_GNUC_PRINTF(7,8);
2266
2275WS_DLL_PUBLIC proto_item *
2276 proto_tree_add_float(proto_tree *tree, int hfindex, tvbuff_t *tvb, int start,
2277 int length, float value);
2278
2291WS_DLL_PUBLIC proto_item *
2292 proto_tree_add_float_format_value(proto_tree *tree, int hfindex, tvbuff_t *tvb,
2293 int start, int length, float value, const char *format, ...)
2294 G_GNUC_PRINTF(7,8);
2295
2307WS_DLL_PUBLIC proto_item *
2308 proto_tree_add_float_format(proto_tree *tree, int hfindex, tvbuff_t *tvb, int start,
2309 int length, float value, const char *format, ...) G_GNUC_PRINTF(7,8);
2310
2319WS_DLL_PUBLIC proto_item *
2320 proto_tree_add_double(proto_tree *tree, int hfindex, tvbuff_t *tvb, int start,
2321 int length, double value);
2322
2335WS_DLL_PUBLIC proto_item *
2336 proto_tree_add_double_format_value(proto_tree *tree, int hfindex, tvbuff_t *tvb,
2337 int start, int length, double value, const char *format, ...)
2338 G_GNUC_PRINTF(7,8);
2339
2351WS_DLL_PUBLIC proto_item *
2352 proto_tree_add_double_format(proto_tree *tree, int hfindex, tvbuff_t *tvb, int start,
2353 int length, double value, const char *format, ...) G_GNUC_PRINTF(7,8);
2354
2363WS_DLL_PUBLIC proto_item *
2364 proto_tree_add_uint(proto_tree *tree, int hfindex, tvbuff_t *tvb, int start,
2365 int length, uint32_t value);
2366
2379WS_DLL_PUBLIC proto_item *
2380 proto_tree_add_uint_format_value(proto_tree *tree, int hfindex, tvbuff_t *tvb,
2381 int start, int length, uint32_t value, const char *format, ...)
2382 G_GNUC_PRINTF(7,8);
2383
2396WS_DLL_PUBLIC proto_item *
2397 proto_tree_add_uint_format(proto_tree *tree, int hfindex, tvbuff_t *tvb, int start,
2398 int length, uint32_t value, const char *format, ...) G_GNUC_PRINTF(7,8);
2399
2408WS_DLL_PUBLIC proto_item *
2409 proto_tree_add_uint64(proto_tree *tree, int hfindex, tvbuff_t *tvb, int start,
2410 int length, uint64_t value);
2411
2424WS_DLL_PUBLIC proto_item *
2425 proto_tree_add_uint64_format_value(proto_tree *tree, int hfindex, tvbuff_t *tvb,
2426 int start, int length, uint64_t value, const char *format, ...)
2427 G_GNUC_PRINTF(7,8);
2428
2440WS_DLL_PUBLIC proto_item *
2441 proto_tree_add_uint64_format(proto_tree *tree, int hfindex, tvbuff_t *tvb, int start,
2442 int length, uint64_t value, const char *format, ...) G_GNUC_PRINTF(7,8);
2443
2452WS_DLL_PUBLIC proto_item *
2453 proto_tree_add_int(proto_tree *tree, int hfindex, tvbuff_t *tvb, int start,
2454 int length, int32_t value);
2455
2468WS_DLL_PUBLIC proto_item *
2469 proto_tree_add_int_format_value(proto_tree *tree, int hfindex, tvbuff_t *tvb,
2470 int start, int length, int32_t value, const char *format, ...)
2471 G_GNUC_PRINTF(7,8);
2472
2485WS_DLL_PUBLIC proto_item *
2486 proto_tree_add_int_format(proto_tree *tree, int hfindex, tvbuff_t *tvb, int start,
2487 int length, int32_t value, const char *format, ...) G_GNUC_PRINTF(7,8);
2488
2497WS_DLL_PUBLIC proto_item *
2498 proto_tree_add_int64(proto_tree *tree, int hfindex, tvbuff_t *tvb, int start,
2499 int length, int64_t value);
2500
2513WS_DLL_PUBLIC proto_item *
2514 proto_tree_add_int64_format_value(proto_tree *tree, int hfindex, tvbuff_t *tvb,
2515 int start, int length, int64_t value, const char *format, ...)
2516 G_GNUC_PRINTF(7,8);
2517
2529WS_DLL_PUBLIC proto_item *
2530 proto_tree_add_int64_format(proto_tree *tree, int hfindex, tvbuff_t *tvb, int start,
2531 int length, int64_t value, const char *format, ...) G_GNUC_PRINTF(7,8);
2532
2541WS_DLL_PUBLIC proto_item *
2542 proto_tree_add_eui64(proto_tree *tree, int hfindex, tvbuff_t *tvb, int start,
2543 int length, const uint64_t value);
2544
2557WS_DLL_PUBLIC proto_item *
2558 proto_tree_add_eui64_format_value(proto_tree *tree, int hfindex, tvbuff_t *tvb,
2559 int start, int length, const uint64_t value, const char *format, ...)
2560 G_GNUC_PRINTF(7,8);
2561
2573WS_DLL_PUBLIC proto_item *
2574 proto_tree_add_eui64_format(proto_tree *tree, int hfindex, tvbuff_t *tvb, int start,
2575 int length, const uint64_t value, const char *format, ...) G_GNUC_PRINTF(7,8);
2576
2578typedef struct _mac_hf_list_t {
2579 int *hf_addr; // FT_ETHER, BASE_NONE
2580 int *hf_addr_resolved; // FT_STRING, BASE_NONE
2581 int *hf_oui; // FT_UINT24, BASE_OUI
2582 int *hf_oui_resolved; // FT_STRING, BASE_NONE
2583 int *hf_lg; // FT_BOOLEAN, 24 bits, mask 0x020000
2584 int *hf_ig; // FT_BOOLEAN, 24 bits, mask 0x010000
2585} mac_hf_list_t;
2586
2596WS_DLL_PUBLIC proto_item *
2597 proto_tree_add_mac48_detail(const mac_hf_list_t *list_specific,
2598 const mac_hf_list_t *list_generic,
2599 int idx, tvbuff_t *tvb, proto_tree *tree, int offset);
2600
2607WS_DLL_PUBLIC proto_item *
2608 proto_tree_add_debug_text(proto_tree *tree, const char *format,
2609 ...) G_GNUC_PRINTF(2,3);
2610
2616WS_DLL_PUBLIC void
2617 proto_item_fill_label(const field_info *finfo, char *label_str, size_t *value_offset);
2618
2626WS_DLL_PUBLIC int
2627 proto_item_fill_display_label(const field_info *fi, char *display_label_str, const int label_str_size);
2628
2634WS_DLL_PUBLIC int
2635 proto_register_protocol(const char *name, const char *short_name, const char *filter_name);
2636
2651WS_DLL_PUBLIC int
2652 proto_register_protocol_in_name_only(const char *name, const char *short_name, const char *filter_name,
2653 int parent_proto, enum ftenum field_type);
2654
2660 bool
2661 proto_deregister_protocol(const char *short_name);
2662
2667WS_DLL_PUBLIC void
2668 proto_register_alias(const int proto_id, const char *alias_name);
2669
2674typedef void (*prefix_initializer_t)(const char* match);
2675
2683WS_DLL_PUBLIC void
2684 proto_register_prefix(const char *prefix, prefix_initializer_t initializer);
2685
2687WS_DLL_PUBLIC void proto_initialize_all_prefixes(void);
2688
2693WS_DLL_PUBLIC void
2694 proto_register_field_array(const int parent, hf_register_info *hf, const int num_records);
2695
2699WS_DLL_PUBLIC void
2700 proto_deregister_field (const int parent, int hf_id);
2701
2704WS_DLL_PUBLIC void
2705 proto_add_deregistered_data (void *data);
2706
2711WS_DLL_PUBLIC void
2712 proto_deregister_all_fields_with_prefix(const int parent, const char *prefix);
2713
2717 void
2718 proto_add_deregistered_slice (size_t block_size, void *mem_block);
2719
2724WS_DLL_PUBLIC void
2725 proto_free_field_strings (ftenum_t field_type, unsigned int field_display, const void *field_strings);
2726
2733WS_DLL_PUBLIC void
2734 proto_free_deregistered_fields (void);
2735
2739WS_DLL_PUBLIC void
2740 proto_register_subtree_array(int * const *indices, const int num_indices);
2741
2745WS_DLL_PUBLIC const char* proto_registrar_get_name(const int n);
2746
2750WS_DLL_PUBLIC const char* proto_registrar_get_abbrev(const int n);
2751
2755WS_DLL_PUBLIC header_field_info* proto_registrar_get_nth(unsigned hfindex);
2756
2760WS_DLL_PUBLIC header_field_info* proto_registrar_get_byname(const char *field_name);
2761
2765WS_DLL_PUBLIC header_field_info* proto_registrar_get_byalias(const char *alias_name);
2766
2770WS_DLL_PUBLIC int proto_registrar_get_id_byname(const char *field_name);
2771
2775WS_DLL_PUBLIC enum ftenum proto_registrar_get_ftype(const int n);
2776
2780WS_DLL_PUBLIC int proto_registrar_get_parent(const int n);
2781
2785WS_DLL_PUBLIC bool proto_registrar_is_protocol(const int n);
2786
2790WS_DLL_PUBLIC int proto_registrar_get_length(const int n);
2791
2792struct proto_registrar_stats {
2793 size_t protocol_count;
2794 size_t deregistered_count;
2795 size_t same_name_count;
2796};
2797
2801WS_DLL_PUBLIC size_t proto_registrar_get_count(struct proto_registrar_stats *stats);
2802
2806WS_DLL_PUBLIC int proto_get_first_protocol(void **cookie);
2807WS_DLL_PUBLIC int proto_get_data_protocol(void *cookie);
2808WS_DLL_PUBLIC int proto_get_next_protocol(void **cookie);
2809WS_DLL_PUBLIC header_field_info *proto_get_first_protocol_field(const int proto_id, void **cookie);
2810WS_DLL_PUBLIC header_field_info *proto_get_next_protocol_field(const int proto_id, void **cookie);
2811
2815WS_DLL_PUBLIC bool proto_name_already_registered(const char *name);
2816
2820WS_DLL_PUBLIC int proto_get_id_by_filter_name(const char* filter_name);
2821
2825WS_DLL_PUBLIC int proto_get_id_by_short_name(const char* short_name);
2826
2830WS_DLL_PUBLIC bool proto_can_toggle_protocol(const int proto_id);
2831
2834WS_DLL_PUBLIC protocol_t *find_protocol_by_id(const int proto_id);
2835
2839WS_DLL_PUBLIC const char *proto_get_protocol_name(const int proto_id);
2840
2843WS_DLL_PUBLIC int proto_get_id(const protocol_t *protocol);
2844
2847WS_DLL_PUBLIC const char *proto_get_protocol_short_name(const protocol_t *protocol);
2848
2851WS_DLL_PUBLIC const char *proto_get_protocol_long_name(const protocol_t *protocol);
2852
2855WS_DLL_PUBLIC bool proto_is_protocol_enabled(const protocol_t *protocol);
2856
2859WS_DLL_PUBLIC bool proto_is_protocol_enabled_by_default(const protocol_t *protocol);
2860
2863WS_DLL_PUBLIC bool proto_is_pino(const protocol_t *protocol);
2864
2868WS_DLL_PUBLIC const char *proto_get_protocol_filter_name(const int proto_id);
2869
2875 extern void proto_add_heuristic_dissector(protocol_t *protocol, const char *short_name);
2876
2882WS_DLL_PUBLIC void proto_heuristic_dissector_foreach(const protocol_t *protocol, GFunc func,
2883 void *user_data);
2884
2902WS_DLL_PUBLIC void proto_get_frame_protocols(const wmem_list_t *layers,
2903 bool *is_ip, bool *is_tcp, bool *is_udp, bool *is_sctp,
2904 bool *is_tls, bool *is_rtp, bool *is_lte_rlc);
2905
2911WS_DLL_PUBLIC bool proto_is_frame_protocol(const wmem_list_t *layers, const char* proto_name);
2912
2917WS_DLL_PUBLIC char * proto_list_layers(const packet_info *pinfo);
2918
2926WS_DLL_PUBLIC uint8_t proto_get_layer_num(const packet_info *pinfo, const int proto_id);
2927
2930WS_DLL_PUBLIC void proto_disable_by_default(const int proto_id);
2931
2935WS_DLL_PUBLIC void proto_set_decoding(const int proto_id, const bool enabled);
2936
2938WS_DLL_PUBLIC void proto_disable_all(void);
2939
2941WS_DLL_PUBLIC void proto_reenable_all(void);
2942
2945WS_DLL_PUBLIC void proto_set_cant_toggle(const int proto_id);
2946
2952 extern bool proto_check_for_protocol_or_field(const proto_tree* tree, const int id);
2953
2962WS_DLL_PUBLIC GPtrArray* proto_get_finfo_ptr_array(const proto_tree *tree, const int hfindex);
2963
2968WS_DLL_PUBLIC bool proto_tracking_interesting_fields(const proto_tree *tree);
2969
2979WS_DLL_PUBLIC GPtrArray* proto_find_finfo(proto_tree *tree, const int hfindex);
2980
2990WS_DLL_PUBLIC GPtrArray* proto_find_first_finfo(proto_tree *tree, const int hfindex);
2991
2999WS_DLL_PUBLIC GPtrArray* proto_all_finfos(proto_tree *tree);
3000
3002WS_DLL_PUBLIC void proto_registrar_dump_protocols(void);
3003
3005WS_DLL_PUBLIC void proto_registrar_dump_values(void);
3006
3008WS_DLL_PUBLIC void proto_registrar_dump_elastic(const char* filter);
3009
3012WS_DLL_PUBLIC bool proto_registrar_dump_fieldcount(void);
3013
3015WS_DLL_PUBLIC void proto_registrar_dump_fields(void);
3016
3018WS_DLL_PUBLIC bool proto_registrar_dump_field_completions(const char *prefix);
3019
3021WS_DLL_PUBLIC void proto_registrar_dump_ftypes(void);
3022
3026WS_DLL_PUBLIC const char* proto_field_display_to_string(int field_display);
3027
3030WS_DLL_PUBLIC int num_tree_types;
3031
3033WS_DLL_PUBLIC bool tree_expanded(int tree_type);
3034
3036WS_DLL_PUBLIC void tree_expanded_set(int tree_type, bool value);
3037
3038WS_DLL_PUBLIC int
3039hfinfo_bitshift(const header_field_info *hfinfo);
3040
3041 struct epan_dissect;
3042
3047WS_DLL_PUBLIC bool
3048 proto_can_match_selected(const field_info *finfo, struct epan_dissect *edt);
3049
3054WS_DLL_PUBLIC char*
3055 proto_construct_match_selected_string(const field_info *finfo, struct epan_dissect *edt);
3056
3062WS_DLL_PUBLIC field_info*
3063 proto_find_field_from_offset(proto_tree *tree, unsigned offset, tvbuff_t *tvb);
3064
3069WS_DLL_PUBLIC char*
3070 proto_find_undecoded_data(proto_tree *tree, unsigned length);
3071
3091WS_DLL_PUBLIC proto_item *
3092 proto_tree_add_bitmask(proto_tree *tree, tvbuff_t *tvb, const unsigned offset,
3093 const int hf_hdr, const int ett, int * const *fields, const unsigned encoding);
3094
3117WS_DLL_PUBLIC proto_item *
3118 proto_tree_add_bitmask_ret_uint64(proto_tree *tree, tvbuff_t *tvb, const unsigned offset,
3119 const int hf_hdr, const int ett, int * const *fields,
3120 const unsigned encoding, uint64_t *retval);
3121
3145WS_DLL_PUBLIC proto_item *
3146 proto_tree_add_bitmask_with_flags(proto_tree *tree, tvbuff_t *tvb, const unsigned offset,
3147 const int hf_hdr, const int ett, int * const *fields, const unsigned encoding, const int flags);
3148
3175WS_DLL_PUBLIC proto_item *
3176 proto_tree_add_bitmask_with_flags_ret_uint64(proto_tree *tree, tvbuff_t *tvb, const unsigned offset,
3177 const int hf_hdr, const int ett, int * const *fields,
3178 const unsigned encoding, const int flags, uint64_t *retval);
3179
3199WS_DLL_PUBLIC proto_item *
3200 proto_tree_add_bitmask_value(proto_tree *tree, tvbuff_t *tvb, const unsigned offset,
3201 const int hf_hdr, const int ett, int * const *fields, const uint64_t value);
3202
3226WS_DLL_PUBLIC proto_item *
3227 proto_tree_add_bitmask_value_with_flags(proto_tree *tree, tvbuff_t *tvb, const unsigned offset,
3228 const int hf_hdr, const int ett, int * const *fields, const uint64_t value, const int flags);
3229
3244WS_DLL_PUBLIC void
3245 proto_tree_add_bitmask_list(proto_tree *tree, tvbuff_t *tvb, const unsigned offset,
3246 const int len, int * const *fields, const unsigned encoding);
3247
3263WS_DLL_PUBLIC void
3264 proto_tree_add_bitmask_list_ret_uint64(proto_tree *tree, tvbuff_t *tvb, const unsigned offset,
3265 const int len, int * const *fields, const unsigned encoding, uint64_t *retval);
3266
3281WS_DLL_PUBLIC void
3282 proto_tree_add_bitmask_list_value(proto_tree *tree, tvbuff_t *tvb, const unsigned offset,
3283 const int len, int * const *fields, const uint64_t value);
3284
3285
3307WS_DLL_PUBLIC proto_item *
3308 proto_tree_add_bitmask_len(proto_tree *tree, tvbuff_t *tvb, const unsigned offset, const unsigned len,
3309 const int hf_hdr, const int ett, int * const *fields, struct expert_field* exp, const unsigned encoding);
3310
3323WS_DLL_PUBLIC proto_item *
3324 proto_tree_add_bitmask_text(proto_tree *tree, tvbuff_t *tvb, const unsigned offset, const unsigned len,
3325 const char *name, const char *fallback,
3326 const int ett, int * const *fields, const unsigned encoding, const int flags);
3327
3328#define BMT_NO_FLAGS 0x00
3329#define BMT_NO_APPEND 0x01
3330#define BMT_NO_INT 0x02
3331#define BMT_NO_FALSE 0x04
3332#define BMT_NO_TFS 0x08
3343WS_DLL_PUBLIC proto_item *
3344 proto_tree_add_bits_item(proto_tree *tree, const int hf_index, tvbuff_t *tvb, const unsigned bit_offset,
3345 const int no_of_bits, const unsigned encoding);
3346
3362WS_DLL_PUBLIC proto_item *
3363 proto_tree_add_split_bits_item_ret_val(proto_tree *tree, const int hf_index, tvbuff_t *tvb,
3364 const unsigned bit_offset, const crumb_spec_t *crumb_spec, uint64_t *return_value);
3365
3379WS_DLL_PUBLIC void
3380 proto_tree_add_split_bits_crumb(proto_tree *tree, const int hf_index, tvbuff_t *tvb,
3381 const unsigned bit_offset, const crumb_spec_t *crumb_spec, uint16_t crumb_index);
3382
3393WS_DLL_PUBLIC proto_item *
3394 proto_tree_add_bits_ret_val(proto_tree *tree, const int hf_index, tvbuff_t *tvb,
3395 const unsigned bit_offset, const int no_of_bits, uint64_t *return_value, const unsigned encoding);
3396
3409WS_DLL_PUBLIC proto_item *
3410 proto_tree_add_uint_bits_format_value(proto_tree *tree, const int hf_index, tvbuff_t *tvb,
3411 const unsigned bit_offset, const int no_of_bits, uint32_t value, const unsigned encoding,
3412 const char *format, ...)
3413 G_GNUC_PRINTF(8,9);
3414
3427WS_DLL_PUBLIC proto_item *
3428 proto_tree_add_uint64_bits_format_value(proto_tree *tree, const int hf_index, tvbuff_t *tvb,
3429 const unsigned bit_offset, const int no_of_bits, uint64_t value, const unsigned encoding,
3430 const char *format, ...)
3431 G_GNUC_PRINTF(8,9);
3432
3446WS_DLL_PUBLIC proto_item *
3447 proto_tree_add_boolean_bits_format_value(proto_tree *tree, const int hf_index, tvbuff_t *tvb,
3448 const unsigned bit_offset, const int no_of_bits, uint64_t value, const unsigned encoding,
3449 const char *format, ...)
3450 G_GNUC_PRINTF(8,9);
3451
3465WS_DLL_PUBLIC proto_item *
3466 proto_tree_add_int_bits_format_value(proto_tree *tree, const int hf_index, tvbuff_t *tvb,
3467 const unsigned bit_offset, const int no_of_bits, int32_t value, const unsigned encoding,
3468 const char *format, ...)
3469 G_GNUC_PRINTF(8,9);
3470
3484WS_DLL_PUBLIC proto_item *
3485 proto_tree_add_int64_bits_format_value(proto_tree *tree, const int hf_index, tvbuff_t *tvb,
3486 const unsigned bit_offset, const int no_of_bits, int64_t value, const unsigned encoding,
3487 const char *format, ...)
3488 G_GNUC_PRINTF(8,9);
3489
3503WS_DLL_PUBLIC proto_item *
3504 proto_tree_add_float_bits_format_value(proto_tree *tree, const int hf_index, tvbuff_t *tvb,
3505 const unsigned bit_offset, const int no_of_bits, float value, const unsigned encoding,
3506 const char *format, ...)
3507 G_GNUC_PRINTF(8,9);
3508
3509
3518WS_DLL_PUBLIC proto_item *
3519 proto_tree_add_ts_23_038_7bits_packed_item(proto_tree *tree, const int hfindex, tvbuff_t *tvb,
3520 const unsigned bit_offset, const int no_of_chars);
3521
3529WS_DLL_PUBLIC proto_item *
3530 proto_tree_add_ascii_7bits_item(proto_tree *tree, const int hfindex, tvbuff_t *tvb,
3531 const unsigned bit_offset, const int no_of_chars);
3532
3550WS_DLL_PUBLIC proto_item *
3551 proto_tree_add_checksum(proto_tree *tree, tvbuff_t *tvb, const unsigned offset,
3552 const int hf_checksum, const int hf_checksum_status, struct expert_field* bad_checksum_expert,
3553 packet_info *pinfo, uint32_t computed_checksum, const unsigned encoding, const unsigned flags);
3554
3572WS_DLL_PUBLIC proto_item*
3573 proto_tree_add_checksum_bytes(proto_tree *tree, tvbuff_t *tvb, const unsigned offset,
3574 const int hf_checksum, const int hf_checksum_status, struct expert_field* bad_checksum_expert,
3575 packet_info *pinfo, const uint8_t *computed_checksum, size_t checksum_len, const unsigned flags);
3576
3577typedef enum
3578{
3579 PROTO_CHECKSUM_E_BAD = 0,
3580 PROTO_CHECKSUM_E_GOOD,
3581 PROTO_CHECKSUM_E_UNVERIFIED,
3582 PROTO_CHECKSUM_E_NOT_PRESENT,
3583 PROTO_CHECKSUM_E_ILLEGAL
3584} proto_checksum_enum_e;
3585
3586#define PROTO_CHECKSUM_NO_FLAGS 0x00
3587#define PROTO_CHECKSUM_VERIFY 0x01
3588#define PROTO_CHECKSUM_GENERATED 0x02
3589#define PROTO_CHECKSUM_IN_CKSUM 0x04
3590#define PROTO_CHECKSUM_ZERO 0x08
3591#define PROTO_CHECKSUM_NOT_PRESENT 0x10
3593WS_DLL_PUBLIC const value_string proto_checksum_vals[];
3594
3601WS_DLL_PUBLIC unsigned char
3602 proto_check_field_name(const char *field_name);
3603
3608WS_DLL_PUBLIC unsigned char
3609 proto_check_field_name_lower(const char *field_name);
3610
3611
3621 const char *
3622 proto_custom_set(proto_tree* tree, GSList *field_id,
3623 int occurrence,
3624 bool display_details,
3625 char *result,
3626 char *expr, const int size );
3627
3636 char *
3637 proto_custom_get_filter(struct epan_dissect *edt, GSList *field_id, int occurrence);
3638
3639#ifdef __cplusplus
3640}
3641#endif /* __cplusplus */
3642
3643#endif /* proto.h */
3644
3645/*
3646 * Editor modelines - https://www.wireshark.org/tools/modelines.html
3647 *
3648 * Local variables:
3649 * c-basic-offset: 4
3650 * tab-width: 8
3651 * indent-tabs-mode: nil
3652 * End:
3653 *
3654 * vi: set shiftwidth=4 tabstop=8 expandtab:
3655 * :indentSize=4:tabSize=8:noTabs=true:
3656 */
ftypes.h
proto_registrar_dump_fieldcount
WS_DLL_PUBLIC bool proto_registrar_dump_fieldcount(void)
Definition proto.c:12027
proto_check_field_name_lower
WS_DLL_PUBLIC unsigned char proto_check_field_name_lower(const char *field_name)
Definition proto.c:14272
hf_text_only
WS_DLL_PUBLIC int hf_text_only
Definition proto.h:48
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 int len, int *const *fields, const unsigned encoding, uint64_t *retval)
Definition proto.c:13175
proto_tree_add_boolean_bits_format_value
WS_DLL_PUBLIC proto_item WS_DLL_PUBLIC proto_item WS_DLL_PUBLIC proto_item * proto_tree_add_boolean_bits_format_value(proto_tree *tree, const int hf_index, tvbuff_t *tvb, const unsigned bit_offset, const int no_of_bits, uint64_t value, const unsigned encoding, const char *format,...) G_GNUC_PRINTF(8
proto_tree_add_eui64
WS_DLL_PUBLIC proto_item WS_DLL_PUBLIC proto_item WS_DLL_PUBLIC proto_item * proto_tree_add_eui64(proto_tree *tree, int hfindex, tvbuff_t *tvb, int start, int length, const uint64_t value)
Definition proto.c:6241
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:13125
ITEM_LABEL_LENGTH
#define ITEM_LABEL_LENGTH
Definition proto.h:51
proto_tree_add_string_format_value
WS_DLL_PUBLIC proto_item * proto_tree_add_string_format_value(proto_tree *tree, int hfindex, tvbuff_t *tvb, int start, int length, const char *value, const char *format,...) G_GNUC_PRINTF(7
proto_get_protocol_name
WS_DLL_PUBLIC const char * proto_get_protocol_name(const int proto_id)
Definition proto.c:8609
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:8670
proto_tree_add_oid_format
WS_DLL_PUBLIC proto_item WS_DLL_PUBLIC proto_item * proto_tree_add_oid_format(proto_tree *tree, int hfindex, tvbuff_t *tvb, int start, int length, const uint8_t *value_ptr, const char *format,...) G_GNUC_PRINTF(7
proto_is_protocol_enabled
WS_DLL_PUBLIC bool proto_is_protocol_enabled(const protocol_t *protocol)
Definition proto.c:8778
item_label_t
struct _item_label_t item_label_t
proto_tree_add_int_format_value
WS_DLL_PUBLIC proto_item * proto_tree_add_int_format_value(proto_tree *tree, int hfindex, tvbuff_t *tvb, int start, int length, int32_t value, const char *format,...) G_GNUC_PRINTF(7
proto_tree_add_ether_format
WS_DLL_PUBLIC proto_item WS_DLL_PUBLIC proto_item * proto_tree_add_ether_format(proto_tree *tree, int hfindex, tvbuff_t *tvb, int start, int length, const uint8_t *value, const char *format,...) G_GNUC_PRINTF(7
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:13643
proto_tree_add_ipv4_format
WS_DLL_PUBLIC proto_item WS_DLL_PUBLIC proto_item * proto_tree_add_ipv4_format(proto_tree *tree, int hfindex, tvbuff_t *tvb, int start, int length, ws_in4_addr value, const char *format,...) G_GNUC_PRINTF(7
proto_tree_add_eui64_format
WS_DLL_PUBLIC proto_item WS_DLL_PUBLIC proto_item * proto_tree_add_eui64_format(proto_tree *tree, int hfindex, tvbuff_t *tvb, int start, int length, const uint64_t value, const char *format,...) G_GNUC_PRINTF(7
proto_tree_add_time_format_value
WS_DLL_PUBLIC proto_item * proto_tree_add_time_format_value(proto_tree *tree, int hfindex, tvbuff_t *tvb, int start, int length, nstime_t *value_ptr, const char *format,...) G_GNUC_PRINTF(7
FI_URL
#define FI_URL
Definition proto.h:861
_item_label_t::value_pos
size_t value_pos
Definition proto.h:811
proto_field_is_referenced
WS_DLL_PUBLIC bool proto_field_is_referenced(proto_tree *tree, int proto_id)
Definition proto.c:974
proto_tree_add_float_bits_format_value
WS_DLL_PUBLIC proto_item WS_DLL_PUBLIC proto_item WS_DLL_PUBLIC proto_item WS_DLL_PUBLIC proto_item WS_DLL_PUBLIC proto_item WS_DLL_PUBLIC proto_item * proto_tree_add_float_bits_format_value(proto_tree *tree, const int hf_index, tvbuff_t *tvb, const unsigned bit_offset, const int no_of_bits, float value, const unsigned encoding, const char *format,...) G_GNUC_PRINTF(8
proto_register_subtree_array
WS_DLL_PUBLIC void proto_register_subtree_array(int *const *indices, const int num_indices)
Definition proto.c:9951
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:13288
tree_expanded
WS_DLL_PUBLIC bool tree_expanded(int tree_type)
Definition proto.c:14278
_header_field_info::bitmask
uint64_t bitmask
Definition proto.h:777
proto_tree_add_bytes
WS_DLL_PUBLIC proto_item WS_DLL_PUBLIC proto_item WS_DLL_PUBLIC proto_item * proto_tree_add_bytes(proto_tree *tree, int hfindex, tvbuff_t *tvb, int start, int length, const uint8_t *start_ptr)
Definition proto.c:4795
proto_tree_add_item_ret_int
WS_DLL_PUBLIC proto_item * proto_tree_add_item_ret_int(proto_tree *tree, int hfindex, tvbuff_t *tvb, const int start, int length, const unsigned encoding, int32_t *retval)
Definition proto.c:3290
proto_tree_add_bytes_format_value
WS_DLL_PUBLIC proto_item * proto_tree_add_bytes_format_value(proto_tree *tree, int hfindex, tvbuff_t *tvb, int start, int length, const uint8_t *start_ptr, const char *format,...) G_GNUC_PRINTF(7
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:13673
proto_tree_add_item_new_ret_length
WS_DLL_PUBLIC proto_item * proto_tree_add_item_new_ret_length(proto_tree *tree, header_field_info *hfinfo, tvbuff_t *tvb, const int start, int length, const unsigned encoding, int *lenretval)
Definition proto.c:4420
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:13465
proto_list_layers
WS_DLL_PUBLIC char * proto_list_layers(const packet_info *pinfo)
Definition proto.c:8735
proto_deregister_field
WS_DLL_PUBLIC void proto_deregister_field(const int parent, int hf_id)
Definition proto.c:8948
proto_tree_prime_with_hfid
void proto_tree_prime_with_hfid(proto_tree *tree, const int hfid)
proto_add_deregistered_slice
void proto_add_deregistered_slice(size_t block_size, void *mem_block)
Definition proto.c:9011
proto_item_get_len
WS_DLL_PUBLIC int proto_item_get_len(const proto_item *pi)
Definition proto.c:7981
_header_field_info::same_name_prev_id
int same_name_prev_id
Definition proto.h:784
proto_get_id_by_short_name
WS_DLL_PUBLIC int proto_get_id_by_short_name(const char *short_name)
Definition proto.c:8595
proto_tree_add_checksum
WS_DLL_PUBLIC proto_item * proto_tree_add_checksum(proto_tree *tree, tvbuff_t *tvb, const unsigned offset, const int hf_checksum, const int hf_checksum_status, struct expert_field *bad_checksum_expert, packet_info *pinfo, uint32_t computed_checksum, const unsigned encoding, const unsigned flags)
Definition proto.c:14068
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 int len, int *const *fields, const uint64_t value)
Definition proto.c:13191
proto_tree_add_boolean_format_value
WS_DLL_PUBLIC proto_item * proto_tree_add_boolean_format_value(proto_tree *tree, int hfindex, tvbuff_t *tvb, int start, int length, uint64_t value, const char *format,...) G_GNUC_PRINTF(7
proto_tree_add_oid
WS_DLL_PUBLIC proto_item WS_DLL_PUBLIC proto_item WS_DLL_PUBLIC proto_item * proto_tree_add_oid(proto_tree *tree, int hfindex, tvbuff_t *tvb, int start, int length, const uint8_t *value_ptr)
Definition proto.c:5286
proto_is_pino
WS_DLL_PUBLIC bool proto_is_pino(const protocol_t *protocol)
Definition proto.c:8771
proto_tree_add_uint
WS_DLL_PUBLIC proto_item WS_DLL_PUBLIC proto_item WS_DLL_PUBLIC proto_item * proto_tree_add_uint(proto_tree *tree, int hfindex, tvbuff_t *tvb, int start, int length, uint32_t value)
Definition proto.c:5866
proto_tree_add_bytes_format
WS_DLL_PUBLIC proto_item WS_DLL_PUBLIC proto_item * proto_tree_add_bytes_format(proto_tree *tree, int hfindex, tvbuff_t *tvb, int start, int length, const uint8_t *start_ptr, const char *format,...) G_GNUC_PRINTF(7
proto_tree_add_int_format
WS_DLL_PUBLIC proto_item WS_DLL_PUBLIC proto_item * proto_tree_add_int_format(proto_tree *tree, int hfindex, tvbuff_t *tvb, int start, int length, int32_t value, const char *format,...) G_GNUC_PRINTF(7
proto_tree_add_string
WS_DLL_PUBLIC proto_item WS_DLL_PUBLIC proto_item WS_DLL_PUBLIC proto_item * proto_tree_add_string(proto_tree *tree, int hfindex, tvbuff_t *tvb, int start, int length, const char *value)
Definition proto.c:5389
proto_tree_add_int_bits_format_value
WS_DLL_PUBLIC proto_item WS_DLL_PUBLIC proto_item WS_DLL_PUBLIC proto_item WS_DLL_PUBLIC proto_item * proto_tree_add_int_bits_format_value(proto_tree *tree, const int hf_index, tvbuff_t *tvb, const unsigned bit_offset, const int no_of_bits, int32_t value, const unsigned encoding, const char *format,...) G_GNUC_PRINTF(8
field_info::ds_tvb
tvbuff_t * ds_tvb
Definition proto.h:825
proto_tree_add_format_wsp_text
WS_DLL_PUBLIC proto_item * proto_tree_add_format_wsp_text(proto_tree *tree, tvbuff_t *tvb, int start, int length)
Definition proto.c:1602
proto_tree_add_bytes_item
WS_DLL_PUBLIC proto_item * proto_tree_add_bytes_item(proto_tree *tree, int hfindex, tvbuff_t *tvb, const int start, int length, const unsigned encoding, GByteArray *retval, int *endoff, int *err)
Definition proto.c:4488
proto_registrar_get_name
WS_DLL_PUBLIC const char * proto_registrar_get_name(const int n)
Definition proto.c:11413
proto_registrar_dump_elastic
WS_DLL_PUBLIC void proto_registrar_dump_elastic(const char *filter)
Definition proto.c:12128
proto_tree_add_float_format
WS_DLL_PUBLIC proto_item WS_DLL_PUBLIC proto_item * proto_tree_add_float_format(proto_tree *tree, int hfindex, tvbuff_t *tvb, int start, int length, float value, const char *format,...) G_GNUC_PRINTF(7
proto_item_fill_label
WS_DLL_PUBLIC proto_item WS_DLL_PUBLIC void proto_item_fill_label(const field_info *finfo, char *label_str, size_t *value_offset)
Definition proto.c:10114
proto_set_decoding
WS_DLL_PUBLIC void proto_set_decoding(const int proto_id, const bool enabled)
Definition proto.c:8828
proto_name_already_registered
WS_DLL_PUBLIC bool proto_name_already_registered(const char *name)
Definition proto.c:8571
proto_register_field_array
WS_DLL_PUBLIC void proto_register_field_array(const int parent, hf_register_info *hf, const int num_records)
Definition proto.c:8906
proto_find_first_finfo
WS_DLL_PUBLIC GPtrArray * proto_find_first_finfo(proto_tree *tree, const int hfindex)
Definition proto.c:11609
proto_tree_add_ts_23_038_7bits_packed_item
WS_DLL_PUBLIC proto_item WS_DLL_PUBLIC proto_item WS_DLL_PUBLIC proto_item WS_DLL_PUBLIC proto_item WS_DLL_PUBLIC proto_item WS_DLL_PUBLIC proto_item WS_DLL_PUBLIC proto_item * proto_tree_add_ts_23_038_7bits_packed_item(proto_tree *tree, const int hfindex, tvbuff_t *tvb, const unsigned bit_offset, const int no_of_chars)
Definition proto.c:14002
proto_registrar_get_length
WS_DLL_PUBLIC int proto_registrar_get_length(const int n)
Definition proto.c:11462
proto_get_protocol_filter_name
WS_DLL_PUBLIC const char * proto_get_protocol_filter_name(const int proto_id)
Definition proto.c:8637
hf_ref_type
hf_ref_type
Definition proto.h:756
proto_item_append_text
WS_DLL_PUBLIC void WS_DLL_PUBLIC void proto_item_append_text(proto_item *pi, const char *format,...) G_GNUC_PRINTF(2
proto_tree_add_float_format_value
WS_DLL_PUBLIC proto_item * proto_tree_add_float_format_value(proto_tree *tree, int hfindex, tvbuff_t *tvb, int start, int length, float value, const char *format,...) G_GNUC_PRINTF(7
proto_tree_add_double_format
WS_DLL_PUBLIC proto_item WS_DLL_PUBLIC proto_item * proto_tree_add_double_format(proto_tree *tree, int hfindex, tvbuff_t *tvb, int start, int length, double value, const char *format,...) G_GNUC_PRINTF(7
proto_get_protocol_long_name
WS_DLL_PUBLIC const char * proto_get_protocol_long_name(const protocol_t *protocol)
Definition proto.c:8629
proto_tree_add_int64_bits_format_value
WS_DLL_PUBLIC proto_item WS_DLL_PUBLIC proto_item WS_DLL_PUBLIC proto_item WS_DLL_PUBLIC proto_item WS_DLL_PUBLIC proto_item * proto_tree_add_int64_bits_format_value(proto_tree *tree, const int hf_index, tvbuff_t *tvb, const unsigned bit_offset, const int no_of_bits, int64_t value, const unsigned encoding, const char *format,...) G_GNUC_PRINTF(8
proto_tree_add_ether_format_value
WS_DLL_PUBLIC proto_item * proto_tree_add_ether_format_value(proto_tree *tree, int hfindex, tvbuff_t *tvb, int start, int length, const uint8_t *value, const char *format,...) G_GNUC_PRINTF(7
proto_registrar_get_ftype
WS_DLL_PUBLIC enum ftenum proto_registrar_get_ftype(const int n)
Definition proto.c:11431
proto_tree_add_guid_format
WS_DLL_PUBLIC proto_item WS_DLL_PUBLIC proto_item * proto_tree_add_guid_format(proto_tree *tree, int hfindex, tvbuff_t *tvb, int start, int length, const e_guid_t *value_ptr, const char *format,...) G_GNUC_PRINTF(7
FI_RESET_FLAG
#define FI_RESET_FLAG(fi, flag)
Definition proto.h:884
proto_tree_add_string_format
WS_DLL_PUBLIC proto_item WS_DLL_PUBLIC proto_item * proto_tree_add_string_format(proto_tree *tree, int hfindex, tvbuff_t *tvb, int start, int length, const char *value, const char *format,...) G_GNUC_PRINTF(7
proto_initialize_all_prefixes
WS_DLL_PUBLIC void proto_initialize_all_prefixes(void)
Definition proto.c:1073
field_info::proto_layer_num
int proto_layer_num
Definition proto.h:828
proto_item_get_parent
WS_DLL_PUBLIC proto_item * proto_item_get_parent(const proto_item *pi)
Definition proto.c:8144
proto_registrar_get_id_byname
WS_DLL_PUBLIC int proto_registrar_get_id_byname(const char *field_name)
Definition proto.c:1157
_header_field_info::display
int display
Definition proto.h:772
proto_tree_add_format_text
WS_DLL_PUBLIC proto_tree WS_DLL_PUBLIC proto_item * proto_tree_add_format_text(proto_tree *tree, tvbuff_t *tvb, int start, int length)
Definition proto.c:1583
proto_tree_add_item_ret_display_string_and_length
WS_DLL_PUBLIC proto_item * proto_tree_add_item_ret_display_string_and_length(proto_tree *tree, int hfindex, tvbuff_t *tvb, const int start, int length, const unsigned encoding, wmem_allocator_t *scope, char **retval, int *lenretval)
Definition proto.c:4174
proto_registrar_get_byalias
WS_DLL_PUBLIC header_field_info * proto_registrar_get_byalias(const char *alias_name)
Definition proto.c:1126
field_info::length
int length
Definition proto.h:819
proto_tree_add_item_ret_float
WS_DLL_PUBLIC proto_item * proto_tree_add_item_ret_float(proto_tree *tree, int hfindex, tvbuff_t *tvb, const int start, int length, const unsigned encoding, float *retval)
Parse a float from the buffer and add it to the tree, returning the item added and the parsed value v...
Definition proto.c:3884
proto_all_finfos
WS_DLL_PUBLIC GPtrArray * proto_all_finfos(proto_tree *tree)
Definition proto.c:11639
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:801
proto_registrar_get_count
WS_DLL_PUBLIC size_t proto_registrar_get_count(struct proto_registrar_stats *stats)
Definition proto.c:11471
proto_tree_set_appendix
WS_DLL_PUBLIC void proto_tree_set_appendix(proto_tree *tree, tvbuff_t *tvb, int start, const int length)
Definition proto.c:8241
proto_tree_add_float
WS_DLL_PUBLIC proto_item WS_DLL_PUBLIC proto_item WS_DLL_PUBLIC proto_item * proto_tree_add_float(proto_tree *tree, int hfindex, tvbuff_t *tvb, int start, int length, float value)
Definition proto.c:5736
proto_heuristic_dissector_foreach
WS_DLL_PUBLIC void proto_heuristic_dissector_foreach(const protocol_t *protocol, GFunc func, void *user_data)
Definition proto.c:8661
proto_tree_add_ipxnet_format_value
WS_DLL_PUBLIC proto_item * proto_tree_add_ipxnet_format_value(proto_tree *tree, int hfindex, tvbuff_t *tvb, int start, int length, uint32_t value, const char *format,...) G_GNUC_PRINTF(7
field_info::total_layer_num
int total_layer_num
Definition proto.h:827
proto_tree_get_parent_tree
WS_DLL_PUBLIC proto_tree * proto_tree_get_parent_tree(proto_tree *tree)
Definition proto.c:8171
proto_register_protocol_in_name_only
WS_DLL_PUBLIC int proto_register_protocol_in_name_only(const char *name, const char *short_name, const char *filter_name, int parent_proto, enum ftenum field_type)
Definition proto.c:8369
proto_node
struct _proto_node proto_node
proto_tree_add_time_format
WS_DLL_PUBLIC proto_item WS_DLL_PUBLIC proto_item * proto_tree_add_time_format(proto_tree *tree, int hfindex, tvbuff_t *tvb, int start, int length, nstime_t *value_ptr, const char *format,...) G_GNUC_PRINTF(7
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:12638
proto_get_protocol_short_name
WS_DLL_PUBLIC const char * proto_get_protocol_short_name(const protocol_t *protocol)
Definition proto.c:8621
proto_find_undecoded_data
WS_DLL_PUBLIC char * proto_find_undecoded_data(proto_tree *tree, unsigned length)
Definition proto.c:11725
proto_pre_init
void proto_pre_init(void)
Definition proto.c:560
proto_tree_add_int64
WS_DLL_PUBLIC proto_item WS_DLL_PUBLIC proto_item WS_DLL_PUBLIC proto_item * proto_tree_add_int64(proto_tree *tree, int hfindex, tvbuff_t *tvb, int start, int length, int64_t value)
Definition proto.c:6146
proto_item_fill_display_label
WS_DLL_PUBLIC int proto_item_fill_display_label(const field_info *fi, char *display_label_str, const int label_str_size)
Definition proto.c:7097
proto_is_protocol_enabled_by_default
WS_DLL_PUBLIC bool proto_is_protocol_enabled_by_default(const protocol_t *protocol)
Definition proto.c:8792
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:11686
proto_tree_add_ipxnet_format
WS_DLL_PUBLIC proto_item WS_DLL_PUBLIC proto_item * proto_tree_add_ipxnet_format(proto_tree *tree, int hfindex, tvbuff_t *tvb, int start, int length, uint32_t value, const char *format,...) G_GNUC_PRINTF(7
proto_registrar_dump_values
WS_DLL_PUBLIC void proto_registrar_dump_values(void)
Definition proto.c:11812
proto_tree_add_guid
WS_DLL_PUBLIC proto_item WS_DLL_PUBLIC proto_item WS_DLL_PUBLIC proto_item * proto_tree_add_guid(proto_tree *tree, int hfindex, tvbuff_t *tvb, int start, int length, const e_guid_t *value_ptr)
Definition proto.c:5209
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:13213
tree_expanded_set
WS_DLL_PUBLIC void tree_expanded_set(int tree_type, bool value)
Definition proto.c:14288
proto_tree_add_item_ret_double
WS_DLL_PUBLIC proto_item * proto_tree_add_item_ret_double(proto_tree *tree, int hfindex, tvbuff_t *tvb, const int start, int length, const unsigned encoding, double *retval)
Parse a double from the buffer and add it to the tree, returning the item added and the parsed value ...
Definition proto.c:3923
proto_item_set_bits_offset_len
WS_DLL_PUBLIC void proto_item_set_bits_offset_len(proto_item *ti, int bits_offset, int bits_len)
Definition proto.c:7992
proto_tree_add_subtree
proto_item proto_item WS_DLL_PUBLIC proto_tree * proto_tree_add_subtree(proto_tree *tree, tvbuff_t *tvb, int start, int length, int idx, proto_item **tree_item, const char *text)
Definition proto.c:1532
FI_GET_FLAG
#define FI_GET_FLAG(fi, flag)
Definition proto.h:876
proto_get_layer_num
WS_DLL_PUBLIC uint8_t proto_get_layer_num(const packet_info *pinfo, const int proto_id)
Definition proto.c:8758
proto_item
proto_node proto_item
Definition proto.h:920
mac_hf_list_t
WS_DLL_PUBLIC proto_item WS_DLL_PUBLIC proto_item struct _mac_hf_list_t mac_hf_list_t
_header_field_info::strings
const void * strings
Definition proto.h:773
field_info::appendix_start
int appendix_start
Definition proto.h:820
proto_tree_add_ipxnet
WS_DLL_PUBLIC proto_item WS_DLL_PUBLIC proto_item WS_DLL_PUBLIC proto_item * proto_tree_add_ipxnet(proto_tree *tree, int hfindex, tvbuff_t *tvb, int start, int length, uint32_t value)
Definition proto.c:4986
proto_tree_add_oid_format_value
WS_DLL_PUBLIC proto_item * proto_tree_add_oid_format_value(proto_tree *tree, int hfindex, tvbuff_t *tvb, int start, int length, const uint8_t *value_ptr, const char *format,...) G_GNUC_PRINTF(7
proto_registrar_get_parent
WS_DLL_PUBLIC int proto_registrar_get_parent(const int n)
Definition proto.c:11440
proto_tree_add_uint64_format_value
WS_DLL_PUBLIC proto_item * proto_tree_add_uint64_format_value(proto_tree *tree, int hfindex, tvbuff_t *tvb, int start, int length, uint64_t value, const char *format,...) G_GNUC_PRINTF(7
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:8114
proto_tree_add_text_internal
proto_item * proto_tree_add_text_internal(proto_tree *tree, tvbuff_t *tvb, int start, int length, const char *format,...) G_GNUC_PRINTF(5
proto_tree_add_double_format_value
WS_DLL_PUBLIC proto_item * proto_tree_add_double_format_value(proto_tree *tree, int hfindex, tvbuff_t *tvb, int start, int length, double value, const char *format,...) G_GNUC_PRINTF(7
proto_tree_add_item
WS_DLL_PUBLIC proto_item * proto_tree_add_item(proto_tree *tree, int hfindex, tvbuff_t *tvb, const int start, int length, const unsigned encoding)
Append a decoded field to a protocol tree using a registered header-field index.
Definition proto.c:4406
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,...) G_GNUC_PRINTF(8
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, int offset)
Definition proto.c:6318
proto_registrar_get_nth
WS_DLL_PUBLIC header_field_info * proto_registrar_get_nth(unsigned hfindex)
Definition proto.c:998
FI_HIDDEN
#define FI_HIDDEN
Definition proto.h:856
proto_tree_add_item_ret_ether
WS_DLL_PUBLIC proto_item * proto_tree_add_item_ret_ether(proto_tree *tree, int hfindex, tvbuff_t *tvb, const int start, int length, const unsigned encoding, uint8_t *retval)
Parse an ethernet address from the buffer and add it to the tree, writing the value to the pointer sp...
Definition proto.c:4054
proto_tree_add_ipv4
WS_DLL_PUBLIC proto_item WS_DLL_PUBLIC proto_item WS_DLL_PUBLIC proto_item * proto_tree_add_ipv4(proto_tree *tree, int hfindex, tvbuff_t *tvb, int start, int length, ws_in4_addr value)
Definition proto.c:5051
proto_item_get_parent_nth
WS_DLL_PUBLIC proto_item * proto_item_get_parent_nth(proto_item *pi, int gen)
Definition proto.c:8151
field_info::flags
uint32_t flags
Definition proto.h:823
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.
Definition proto.c:14266
proto_tree_add_double
WS_DLL_PUBLIC proto_item WS_DLL_PUBLIC proto_item WS_DLL_PUBLIC proto_item * proto_tree_add_double(proto_tree *tree, int hfindex, tvbuff_t *tvb, int start, int length, double value)
Definition proto.c:5801
proto_tree_add_ipv6
WS_DLL_PUBLIC proto_item WS_DLL_PUBLIC proto_item WS_DLL_PUBLIC proto_item * proto_tree_add_ipv6(proto_tree *tree, int hfindex, tvbuff_t *tvb, int start, int length, const ws_in6_addr *value_ptr)
Definition proto.c:5118
proto_tree_add_uint_format_value
WS_DLL_PUBLIC proto_item * proto_tree_add_uint_format_value(proto_tree *tree, int hfindex, tvbuff_t *tvb, int start, int length, uint32_t value, const char *format,...) G_GNUC_PRINTF(7
field_info::hfinfo
const header_field_info * hfinfo
Definition proto.h:817
proto_get_finfo_ptr_array
WS_DLL_PUBLIC GPtrArray * proto_get_finfo_ptr_array(const proto_tree *tree, const int hfindex)
Definition proto.c:11519
proto_tree_set_fake_protocols
void proto_tree_set_fake_protocols(proto_tree *tree, bool fake_protocols)
Definition proto.c:960
proto_tree_prime_with_hfid_print
void proto_tree_prime_with_hfid_print(proto_tree *tree, const int hfid)
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:13065
proto_deregister_protocol
bool proto_deregister_protocol(const char *short_name)
Definition proto.c:8428
proto_tree_add_guid_format_value
WS_DLL_PUBLIC proto_item * proto_tree_add_guid_format_value(proto_tree *tree, int hfindex, tvbuff_t *tvb, int start, int length, const e_guid_t *value_ptr, const char *format,...) G_GNUC_PRINTF(7
proto_is_frame_protocol
WS_DLL_PUBLIC bool proto_is_frame_protocol(const wmem_list_t *layers, const char *proto_name)
Definition proto.c:8710
_header_field_info::name
const char * name
Definition proto.h:769
proto_add_deregistered_data
WS_DLL_PUBLIC void proto_add_deregistered_data(void *data)
Definition proto.c:9005
field_display_e
field_display_e
Definition proto.h:683
proto_registrar_get_abbrev
WS_DLL_PUBLIC const char * proto_registrar_get_abbrev(const int n)
Definition proto.c:11422
prefix_initializer_t
void(* prefix_initializer_t)(const char *match)
Definition proto.h:2674
proto_tree_add_text_valist_internal
proto_item proto_item * proto_tree_add_text_valist_internal(proto_tree *tree, tvbuff_t *tvb, int start, int length, const char *format, va_list ap) G_GNUC_PRINTF(5
field_info::rep
item_label_t * rep
Definition proto.h:824
proto_tree_add_int
WS_DLL_PUBLIC proto_item WS_DLL_PUBLIC proto_item WS_DLL_PUBLIC proto_item * proto_tree_add_int(proto_tree *tree, int hfindex, tvbuff_t *tvb, int start, int length, int32_t value)
Definition proto.c:6051
proto_tree_set_visible
WS_DLL_PUBLIC bool proto_tree_set_visible(proto_tree *tree, bool visible)
Definition proto.c:950
proto_tree_add_int64_format
WS_DLL_PUBLIC proto_item WS_DLL_PUBLIC proto_item * proto_tree_add_int64_format(proto_tree *tree, int hfindex, tvbuff_t *tvb, int start, int length, int64_t value, const char *format,...) G_GNUC_PRINTF(7
hf_register_info::p_id
int * p_id
Definition proto.h:804
_item_label_t::value_len
size_t value_len
Definition proto.h:812
proto_cleanup
void proto_cleanup(void)
Definition proto.c:756
proto_tree_add_time_item
WS_DLL_PUBLIC proto_item * proto_tree_add_time_item(proto_tree *tree, int hfindex, tvbuff_t *tvb, const int start, int length, const unsigned encoding, nstime_t *retval, int *endoff, int *err)
Definition proto.c:4627
proto_tree_add_ipv6_format
WS_DLL_PUBLIC proto_item WS_DLL_PUBLIC proto_item * proto_tree_add_ipv6_format(proto_tree *tree, int hfindex, tvbuff_t *tvb, int start, int length, const ws_in6_addr *value_ptr, const char *format,...) G_GNUC_PRINTF(7
proto_report_dissector_bug
WS_DLL_PUBLIC WS_NORETURN void proto_report_dissector_bug(const char *format,...) G_GNUC_PRINTF(1
proto_get_id_by_filter_name
WS_DLL_PUBLIC int proto_get_id_by_filter_name(const char *filter_name)
Definition proto.c:8581
proto_add_heuristic_dissector
void proto_add_heuristic_dissector(protocol_t *protocol, const char *short_name)
Definition proto.c:8647
proto_item_get_subtree
WS_DLL_PUBLIC proto_tree * proto_item_get_subtree(proto_item *pi)
Definition proto.c:8132
proto_tree_free
WS_DLL_PUBLIC void proto_tree_free(proto_tree *tree)
Definition proto.c:924
_header_field_info::ref_type
hf_ref_type ref_type
Definition proto.h:783
proto_registrar_dump_fields
WS_DLL_PUBLIC void proto_registrar_dump_fields(void)
Definition proto.c:12288
proto_get_first_protocol
WS_DLL_PUBLIC int proto_get_first_protocol(void **cookie)
Definition proto.c:8488
proto_item_set_len
WS_DLL_PUBLIC void WS_DLL_PUBLIC void WS_DLL_PUBLIC void WS_DLL_PUBLIC void proto_item_set_len(proto_item *pi, const int length)
Definition proto.c:7939
proto_tree_add_none_format
WS_DLL_PUBLIC proto_item * proto_tree_add_none_format(proto_tree *tree, const int hfindex, tvbuff_t *tvb, const int start, int length, const char *format,...) G_GNUC_PRINTF(6
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:13053
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:13134
proto_tree_add_item_ret_time_string
WS_DLL_PUBLIC proto_item * proto_tree_add_item_ret_time_string(proto_tree *tree, int hfindex, tvbuff_t *tvb, const int start, int length, const unsigned encoding, wmem_allocator_t *scope, char **retval)
Definition proto.c:4302
proto_tree_move_item
WS_DLL_PUBLIC void proto_tree_move_item(proto_tree *tree, proto_item *fixed_item, proto_item *item_to_move)
Definition proto.c:8194
proto_tree_add_ascii_7bits_item
WS_DLL_PUBLIC proto_item * proto_tree_add_ascii_7bits_item(proto_tree *tree, const int hfindex, tvbuff_t *tvb, const unsigned bit_offset, const int no_of_chars)
Definition proto.c:14030
proto_tree
proto_node proto_tree
Definition proto.h:918
proto_item_get_display_repr
WS_DLL_PUBLIC char * proto_item_get_display_repr(wmem_allocator_t *scope, proto_item *pi)
Definition proto.c:8001
proto_can_match_selected
WS_DLL_PUBLIC bool proto_can_match_selected(const field_info *finfo, struct epan_dissect *edt)
Definition proto.c:12626
proto_find_finfo
WS_DLL_PUBLIC GPtrArray * proto_find_finfo(proto_tree *tree, const int hfindex)
Definition proto.c:11590
_header_field_info::parent
int parent
Definition proto.h:782
proto_tree_add_uint64_format
WS_DLL_PUBLIC proto_item WS_DLL_PUBLIC proto_item * proto_tree_add_uint64_format(proto_tree *tree, int hfindex, tvbuff_t *tvb, int start, int length, uint64_t value, const char *format,...) G_GNUC_PRINTF(7
proto_disable_by_default
WS_DLL_PUBLIC void proto_disable_by_default(const int proto_id)
Definition proto.c:8816
proto_item_set_text
WS_DLL_PUBLIC void proto_item_set_text(proto_item *pi, const char *format,...) G_GNUC_PRINTF(2
proto_tree_add_debug_text
WS_DLL_PUBLIC proto_item * proto_tree_add_debug_text(proto_tree *tree, const char *format,...) G_GNUC_PRINTF(2
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)
Definition proto.c:587
proto_tree_add_bytes_with_length
WS_DLL_PUBLIC proto_item * proto_tree_add_bytes_with_length(proto_tree *tree, int hfindex, tvbuff_t *tvb, int start, int length, const uint8_t *start_ptr, int ptr_length)
Definition proto.c:4820
proto_item_prepend_text
WS_DLL_PUBLIC void WS_DLL_PUBLIC void WS_DLL_PUBLIC void proto_item_prepend_text(proto_item *pi, const char *format,...) G_GNUC_PRINTF(2
proto_tree_add_item_new
WS_DLL_PUBLIC proto_item * proto_tree_add_item_new(proto_tree *tree, header_field_info *hfinfo, tvbuff_t *tvb, const int start, int length, const unsigned encoding)
Definition proto.c:4385
proto_deregister_all_fields_with_prefix
WS_DLL_PUBLIC void proto_deregister_all_fields_with_prefix(const int parent, const char *prefix)
Definition proto.c:8979
proto_tree_add_int64_format_value
WS_DLL_PUBLIC proto_item * proto_tree_add_int64_format_value(proto_tree *tree, int hfindex, tvbuff_t *tvb, int start, int length, int64_t value, const char *format,...) G_GNUC_PRINTF(7
proto_tree_add_bitmask_list
WS_DLL_PUBLIC void proto_tree_add_bitmask_list(proto_tree *tree, tvbuff_t *tvb, const unsigned offset, const int len, int *const *fields, const unsigned encoding)
Definition proto.c:13162
proto_tree_get_parent
WS_DLL_PUBLIC proto_item * proto_tree_get_parent(proto_tree *tree)
Definition proto.c:8164
proto_register_plugin
WS_DLL_PUBLIC void proto_register_plugin(const proto_plugin *plugin)
proto_tree_add_item_ret_string_and_length
WS_DLL_PUBLIC proto_item * proto_tree_add_item_ret_string_and_length(proto_tree *tree, int hfindex, tvbuff_t *tvb, const int start, int length, const unsigned encoding, wmem_allocator_t *scope, const uint8_t **retval, int *lenretval)
Definition proto.c:4093
proto_tree_add_boolean_format
WS_DLL_PUBLIC proto_item WS_DLL_PUBLIC proto_item * proto_tree_add_boolean_format(proto_tree *tree, int hfindex, tvbuff_t *tvb, int start, int length, uint64_t value, const char *format,...) G_GNUC_PRINTF(7
proto_tree_add_item_ret_display_string
WS_DLL_PUBLIC proto_item * proto_tree_add_item_ret_display_string(proto_tree *tree, int hfindex, tvbuff_t *tvb, const int start, int length, const unsigned encoding, wmem_allocator_t *scope, char **retval)
Definition proto.c:4290
proto_tree_add_subtree_format
WS_DLL_PUBLIC proto_tree * proto_tree_add_subtree_format(proto_tree *tree, tvbuff_t *tvb, int start, int length, int idx, proto_item **tree_item, const char *format,...) G_GNUC_PRINTF(7
proto_set_cant_toggle
WS_DLL_PUBLIC void proto_set_cant_toggle(const int proto_id)
Definition proto.c:8887
proto_tracking_interesting_fields
WS_DLL_PUBLIC bool proto_tracking_interesting_fields(const proto_tree *tree)
Definition proto.c:11532
proto_register_prefix
WS_DLL_PUBLIC void proto_register_prefix(const char *prefix, prefix_initializer_t initializer)
Definition proto.c:1056
_header_field_info::type
enum ftenum type
Definition proto.h:771
proto_register_protocol
WS_DLL_PUBLIC int proto_register_protocol(const char *name, const char *short_name, const char *filter_name)
Definition proto.c:8306
proto_registrar_dump_protocols
WS_DLL_PUBLIC void proto_registrar_dump_protocols(void)
Definition proto.c:11749
proto_tree_add_checksum_bytes
WS_DLL_PUBLIC proto_item * proto_tree_add_checksum_bytes(proto_tree *tree, tvbuff_t *tvb, const unsigned offset, const int hf_checksum, const int hf_checksum_status, struct expert_field *bad_checksum_expert, packet_info *pinfo, const uint8_t *computed_checksum, size_t checksum_len, const unsigned flags)
Definition proto.c:14173
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:7388
proto_check_for_protocol_or_field
bool proto_check_for_protocol_or_field(const proto_tree *tree, const int id)
Definition proto.c:11501
proto_tree_add_ipv6_format_value
WS_DLL_PUBLIC proto_item * proto_tree_add_ipv6_format_value(proto_tree *tree, int hfindex, tvbuff_t *tvb, int start, int length, const ws_in6_addr *value_ptr, const char *format,...) G_GNUC_PRINTF(7
proto_tree_add_time
WS_DLL_PUBLIC proto_item WS_DLL_PUBLIC proto_item WS_DLL_PUBLIC proto_item * proto_tree_add_time(proto_tree *tree, int hfindex, tvbuff_t *tvb, int start, int length, const nstime_t *value_ptr)
Definition proto.c:4919
field_info::start
int start
Definition proto.h:818
_header_field_info::abbrev
const char * abbrev
Definition proto.h:770
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:7624
proto_tree_add_protocol_format
WS_DLL_PUBLIC proto_item WS_DLL_PUBLIC proto_item * proto_tree_add_protocol_format(proto_tree *tree, int hfindex, tvbuff_t *tvb, int start, int length, const char *format,...) G_GNUC_PRINTF(6
_header_field_info::blurb
const char * blurb
Definition proto.h:778
proto_tree_create_root
WS_DLL_PUBLIC proto_tree * proto_tree_create_root(packet_info *pinfo)
Definition proto.c:8015
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:13100
proto_tree_get_root
WS_DLL_PUBLIC proto_tree * proto_tree_get_root(proto_tree *tree)
Definition proto.c:8184
proto_tree_add_uint_format
WS_DLL_PUBLIC proto_item WS_DLL_PUBLIC proto_item * proto_tree_add_uint_format(proto_tree *tree, int hfindex, tvbuff_t *tvb, int start, int length, uint32_t value, const char *format,...) G_GNUC_PRINTF(7
proto_tree_add_uint64_bits_format_value
WS_DLL_PUBLIC proto_item WS_DLL_PUBLIC proto_item * proto_tree_add_uint64_bits_format_value(proto_tree *tree, const int hf_index, tvbuff_t *tvb, const unsigned bit_offset, const int no_of_bits, uint64_t value, const unsigned encoding, const char *format,...) G_GNUC_PRINTF(8
field_info::appendix_length
int appendix_length
Definition proto.h:821
proto_registrar_dump_field_completions
WS_DLL_PUBLIC bool proto_registrar_dump_field_completions(const char *prefix)
Definition proto.c:12399
proto_can_toggle_protocol
WS_DLL_PUBLIC bool proto_can_toggle_protocol(const int proto_id)
Definition proto.c:8803
proto_registrar_dump_ftypes
WS_DLL_PUBLIC void proto_registrar_dump_ftypes(void)
Definition proto.c:12464
proto_tree_add_ipv4_format_value
WS_DLL_PUBLIC proto_item * proto_tree_add_ipv4_format_value(proto_tree *tree, int hfindex, tvbuff_t *tvb, int start, int length, ws_in4_addr value, const char *format,...) G_GNUC_PRINTF(7
find_protocol_by_id
WS_DLL_PUBLIC protocol_t * find_protocol_by_id(const int proto_id)
Definition proto.c:8550
proto_reenable_all
WS_DLL_PUBLIC void proto_reenable_all(void)
Definition proto.c:8869
proto_registrar_is_protocol
WS_DLL_PUBLIC bool proto_registrar_is_protocol(const int n)
Definition proto.c:11449
proto_disable_all
WS_DLL_PUBLIC void proto_disable_all(void)
Definition proto.c:8839
proto_tree_add_uint64
WS_DLL_PUBLIC proto_item WS_DLL_PUBLIC proto_item WS_DLL_PUBLIC proto_item * proto_tree_add_uint64(proto_tree *tree, int hfindex, tvbuff_t *tvb, int start, int length, uint64_t value)
Definition proto.c:5959
proto_registrar_get_byname
WS_DLL_PUBLIC header_field_info * proto_registrar_get_byname(const char *field_name)
Definition proto.c:1084
num_tree_types
WS_DLL_PUBLIC int num_tree_types
Definition proto.h:3030
PITEM_FINFO
#define PITEM_FINFO(proto_item)
Definition proto.h:988
proto_field_display_to_string
WS_DLL_PUBLIC const char * proto_field_display_to_string(int field_display)
Definition proto.c:9216
proto_free_deregistered_fields
WS_DLL_PUBLIC void proto_free_deregistered_fields(void)
Definition proto.c:9167
_header_field_info::id
int id
Definition proto.h:781
FI_GENERATED
#define FI_GENERATED
Definition proto.h:859
proto_tree_add_boolean
WS_DLL_PUBLIC proto_item WS_DLL_PUBLIC proto_item WS_DLL_PUBLIC proto_item * proto_tree_add_boolean(proto_tree *tree, int hfindex, tvbuff_t *tvb, int start, int length, uint64_t value)
Definition proto.c:5575
FI_SET_FLAG
#define FI_SET_FLAG(fi, flag)
Definition proto.h:878
proto_tree_add_item_ret_ipv6
WS_DLL_PUBLIC proto_item * proto_tree_add_item_ret_ipv6(proto_tree *tree, int hfindex, tvbuff_t *tvb, const int start, int length, const unsigned encoding, ws_in6_addr *retval)
Parse an ipv6 address from the buffer and add it to the tree, writing the value to the pointer specif...
Definition proto.c:4015
field_info::tree_type
int tree_type
Definition proto.h:822
proto_tree_add_item_ret_string
WS_DLL_PUBLIC proto_item * proto_tree_add_item_ret_string(proto_tree *tree, int hfindex, tvbuff_t *tvb, const int start, int length, const unsigned encoding, wmem_allocator_t *scope, const uint8_t **retval)
Definition proto.c:4164
proto_get_id
WS_DLL_PUBLIC int proto_get_id(const protocol_t *protocol)
Definition proto.c:8565
proto_tree_add_eui64_format_value
WS_DLL_PUBLIC proto_item * proto_tree_add_eui64_format_value(proto_tree *tree, int hfindex, tvbuff_t *tvb, int start, int length, const uint64_t value, const char *format,...) G_GNUC_PRINTF(7
hf_register_info::hfinfo
header_field_info hfinfo
Definition proto.h:805
proto_register_alias
WS_DLL_PUBLIC void proto_register_alias(const int proto_id, const char *alias_name)
Definition proto.c:8470
proto_free_field_strings
WS_DLL_PUBLIC void proto_free_field_strings(ftenum_t field_type, unsigned int field_display, const void *field_strings)
Definition proto.c:9021
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:13265
proto_item_set_end
WS_DLL_PUBLIC void proto_item_set_end(proto_item *pi, tvbuff_t *tvb, int end)
Definition proto.c:7961
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:13027
proto_tree_add_ether
WS_DLL_PUBLIC proto_item WS_DLL_PUBLIC proto_item WS_DLL_PUBLIC proto_item * proto_tree_add_ether(proto_tree *tree, int hfindex, tvbuff_t *tvb, int start, int length, const uint8_t *value)
Definition proto.c:5504
_header_field_info::same_name_next
header_field_info * same_name_next
Definition proto.h:785
HF_REF_TYPE_INDIRECT
@ HF_REF_TYPE_INDIRECT
Definition proto.h:758
HF_REF_TYPE_NONE
@ HF_REF_TYPE_NONE
Definition proto.h:757
HF_REF_TYPE_DIRECT
@ HF_REF_TYPE_DIRECT
Definition proto.h:759
HF_REF_TYPE_PRINT
@ HF_REF_TYPE_PRINT
Definition proto.h:760
ABSOLUTE_TIME_DOY_UTC
@ ABSOLUTE_TIME_DOY_UTC
Definition proto.h:716
BASE_PT_UDP
@ BASE_PT_UDP
Definition proto.h:705
BASE_HEX_DEC
@ BASE_HEX_DEC
Definition proto.h:691
BASE_HEX
@ BASE_HEX
Definition proto.h:688
ABSOLUTE_TIME_NTP_UTC
@ ABSOLUTE_TIME_NTP_UTC
Definition proto.h:717
BASE_EXP
@ BASE_EXP
Definition proto.h:693
ABSOLUTE_TIME_UTC
@ ABSOLUTE_TIME_UTC
Definition proto.h:715
BASE_DEC
@ BASE_DEC
Definition proto.h:687
ABSOLUTE_TIME_UNIX
@ ABSOLUTE_TIME_UNIX
Definition proto.h:718
BASE_PT_TCP
@ BASE_PT_TCP
Definition proto.h:706
BASE_DEC_HEX
@ BASE_DEC_HEX
Definition proto.h:690
BASE_OUI
@ BASE_OUI
Definition proto.h:711
SEP_COLON
@ SEP_COLON
Definition proto.h:698
BASE_PT_SCTP
@ BASE_PT_SCTP
Definition proto.h:708
BASE_NETMASK
@ BASE_NETMASK
Definition proto.h:702
ABSOLUTE_TIME_LOCAL
@ ABSOLUTE_TIME_LOCAL
Definition proto.h:714
BASE_PT_DCCP
@ BASE_PT_DCCP
Definition proto.h:707
BASE_STR_WSP
@ BASE_STR_WSP
Definition proto.h:721
BASE_NONE
@ BASE_NONE
Definition proto.h:684
SEP_DOT
@ SEP_DOT
Definition proto.h:696
SEP_DASH
@ SEP_DASH
Definition proto.h:697
SEP_SPACE
@ SEP_SPACE
Definition proto.h:699
BASE_OCT
@ BASE_OCT
Definition proto.h:689
BASE_CUSTOM
@ BASE_CUSTOM
Definition proto.h:692
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
_e_guid_t
Definition guid-utils.h:23
_fvalue_t
Represents a typed field value used in protocol dissection.
Definition ftypes-int.h:24
_header_field_info
Definition proto.h:767
_item_label_t
Definition proto.h:809
_mac_hf_list_t
Definition proto.h:2578
_packet_info
Definition packet_info.h:43
_plugin
Definition plugins.c:29
_proto_node
Definition proto.h:907
_protocol
Definition proto.c:381
_value_string
Mapping between a 32-bit integer value and its string representation.
Definition value_string.h:33
_wmem_allocator_t
Internal memory allocator interface used by the wmem subsystem.
Definition wmem_allocator.h:34
_wmem_list_t
Definition wmem_list.c:23
crumb_spec_t
Definition proto.h:841
e_in6_addr
Represents a 128-bit IPv6 address.
Definition inet_addr.h:27
epan_dissect
Definition epan_dissect.h:28
expert_field
Definition expert.h:39
field_info
Definition proto.h:816
hf_register_info
Definition proto.h:803
nstime_t
Definition nstime.h:26
proto_plugin
Definition proto.h:1096
proto_registrar_stats
Definition proto.h:2792
tree_data_t
Definition proto.h:895
tvbuff
Definition tvbuff-int.h:35
tvbuff.h
value_string.h