Wireshark  4.3.0
The Wireshark network protocol analyzer
wtap_opttypes.h
Go to the documentation of this file.
1 
10 #ifndef WTAP_OPT_TYPES_H
11 #define WTAP_OPT_TYPES_H
12 
13 #include "ws_symbol_export.h"
14 
15 #include <wsutil/inet_ipv4.h>
16 #include <wsutil/inet_ipv6.h>
17 
18 #ifdef __cplusplus
19 extern "C" {
20 #endif /* __cplusplus */
21 
22 /*
23  * We use the pcapng option codes for option type values.
24  */
25 
26 /* Options for all blocks */
27 #define OPT_EOFOPT 0
28 #define OPT_COMMENT 1
29 #define OPT_CUSTOM_STR_COPY 2988
30 #define OPT_CUSTOM_BIN_COPY 2989
31 #define OPT_CUSTOM_STR_NO_COPY 19372
32 #define OPT_CUSTOM_BIN_NO_COPY 19373
34 /* Section Header block (SHB) */
35 #define OPT_SHB_HARDWARE 2
38 #define OPT_SHB_OS 3
41 #define OPT_SHB_USERAPPL 4
45 /* Interface Description block (IDB) */
46 #define OPT_IDB_NAME 2
50 #define OPT_IDB_DESCRIPTION 3
56 #define OPT_IDB_IP4ADDR 4
61 #define OPT_IDB_IP6ADDR 5
67 #define OPT_IDB_MACADDR 6
68 #define OPT_IDB_EUIADDR 7
69 #define OPT_IDB_SPEED 8
71 #define OPT_IDB_TSRESOL 9
80 #define OPT_IDB_TZONE 10
81 #define OPT_IDB_FILTER 11
88 #define OPT_IDB_OS 12
96 #define OPT_IDB_FCSLEN 13
101 #define OPT_IDB_TSOFFSET 14
109 #define OPT_IDB_HARDWARE 15
117 /*
118  * These are the flags for an EPB, but we use them for all WTAP_BLOCK_PACKET
119  */
120 #define OPT_PKT_FLAGS 2
121 #define OPT_PKT_HASH 3
122 #define OPT_PKT_DROPCOUNT 4
123 #define OPT_PKT_PACKETID 5
124 #define OPT_PKT_QUEUE 6
125 #define OPT_PKT_VERDICT 7
126 
127 /* Name Resolution Block (NRB) */
128 #define OPT_NS_DNSNAME 2
129 #define OPT_NS_DNSIP4ADDR 3
130 #define OPT_NS_DNSIP6ADDR 4
131 
132 /* Interface Statistics Block (ISB) */
133 #define OPT_ISB_STARTTIME 2
134 #define OPT_ISB_ENDTIME 3
135 #define OPT_ISB_IFRECV 4
136 #define OPT_ISB_IFDROP 5
137 #define OPT_ISB_FILTERACCEPT 6
138 #define OPT_ISB_OSDROP 7
139 #define OPT_ISB_USRDELIV 8
140 
141 struct wtap_block;
142 typedef struct wtap_block *wtap_block_t;
143 
144 /*
145  * Currently supported blocks; these are not the pcapng block type values
146  * for them, they're identifiers used internally, and more than one
147  * pcapng block type may use a given block type.
148  *
149  * Note that, in a given file format, this information won't necessarily
150  * appear in the form of blocks in the file, even though they're presented
151  * to the caller of libwiretap as blocks when reading and are presented
152  * by the caller of libwiretap as blocks when writing. See, for example,
153  * the iptrace file format, in which the interface name is given as part
154  * of the packet record header; we synthesize those blocks when reading
155  * (we don't currently support writing that format, but if we did, we'd
156  * get the interface name from the block and put it in the packet record
157  * header).
158  *
159  * WTAP_BLOCK_IF_ID_AND_INFO is a block that not only gives
160  * descriptive information about an interface but *also* assigns an
161  * ID to the interface, so that every packet has either an explicit
162  * or implicit interface ID indicating on which the packet arrived.
163  *
164  * It does *not* refer to information about interfaces that does not
165  * allow identification of the interface on which a packet arrives
166  * (I'm looking at *you*, Microsoft Network Monitor...). Do *not*
167  * indicate support for that block if your capture format merely
168  * gives a list of interface information without having every packet
169  * explicitly or implicitly (as in, for example, the pcapng Simple
170  * Packet Block) indicate on which of those interfaces the packet
171  * arrived.
172  *
173  * WTAP_BLOCK_PACKET (which corresponds to the Enhanced Packet Block,
174  * the Simple Packet Block, and the deprecated Packet Block) is not
175  * currently used; it's reserved for future use. The same applies
176  * to WTAP_BLOCK_SYSTEMD_JOURNAL_EXPORT.
177  */
178 typedef enum {
179  WTAP_BLOCK_SECTION = 0,
180  WTAP_BLOCK_IF_ID_AND_INFO,
181  WTAP_BLOCK_NAME_RESOLUTION,
182  WTAP_BLOCK_IF_STATISTICS,
183  WTAP_BLOCK_DECRYPTION_SECRETS,
184  WTAP_BLOCK_PACKET,
185  WTAP_BLOCK_FT_SPECIFIC_REPORT,
186  WTAP_BLOCK_FT_SPECIFIC_EVENT,
187  WTAP_BLOCK_SYSDIG_EVENT,
188  WTAP_BLOCK_META_EVENT,
189  WTAP_BLOCK_SYSTEMD_JOURNAL_EXPORT,
190  WTAP_BLOCK_CUSTOM,
191  MAX_WTAP_BLOCK_TYPE_VALUE
192 } wtap_block_type_t;
193 
198  guint64 section_length;
207 
213  GArray *interface_data;
215 
221  guint64 time_units_per_second;
224  guint32 snap_len;
225 
226  guint8 num_stat_entries;
230 
234 typedef struct wtapng_nrb_mandatory_s {
235  GList *ipv4_addr_list;
236  GList *ipv6_addr_list;
238 
243  guint32 interface_id;
244  guint32 ts_high;
245  guint32 ts_low;
247 
251 typedef struct wtapng_dsb_mandatory_s {
252  guint32 secrets_type;
253  guint32 secrets_len;
254  guint8 *secrets_data;
256 
261  uint32_t mev_block_type;
262  unsigned mev_data_len;
263  uint8_t *mev_data;
265 
272 #if 0
273 /* Commented out for now, there's no mandatory data that isn't handled by
274  * Wireshark in other ways.
275  */
276 typedef struct wtapng_packet_mandatory_s {
277  guint32 interface_id;
278  guint32 ts_high;
279  guint32 ts_low;
280  guint32 captured_len;
281  guint32 orig_len;
282 } wtapng_packet_mandatory_t;
283 #endif
284 
289  guint record_type; /* the type of record this is - file type-specific value */
291 
292 /*
293  * Currently supported option types. These are not option types
294  * in the sense that each one corresponds to a particular option,
295  * they are data types for the data of an option, so, for example,
296  * all options with a 32-bit unsigned integer value have the type
297  * WTAP_OPTTYPE_UINT32.
298  */
299 typedef enum {
300  WTAP_OPTTYPE_UINT8,
301  WTAP_OPTTYPE_UINT32,
302  WTAP_OPTTYPE_UINT64,
303  WTAP_OPTTYPE_STRING,
304  WTAP_OPTTYPE_BYTES,
305  WTAP_OPTTYPE_IPv4,
306  WTAP_OPTTYPE_IPv6,
307  WTAP_OPTTYPE_CUSTOM,
308  WTAP_OPTTYPE_IF_FILTER,
309  WTAP_OPTTYPE_PACKET_VERDICT,
310  WTAP_OPTTYPE_PACKET_HASH,
311 } wtap_opttype_e;
312 
313 typedef enum {
314  WTAP_OPTTYPE_SUCCESS = 0,
315  WTAP_OPTTYPE_NO_SUCH_OPTION = -1,
316  WTAP_OPTTYPE_NOT_FOUND = -2,
317  WTAP_OPTTYPE_TYPE_MISMATCH = -3,
318  WTAP_OPTTYPE_NUMBER_MISMATCH = -4,
319  WTAP_OPTTYPE_ALREADY_EXISTS = -5,
320  WTAP_OPTTYPE_BAD_BLOCK = -6,
321 } wtap_opttype_return_val;
322 
323 /* https://www.iana.org/assignments/enterprise-numbers/enterprise-numbers */
324 #define PEN_NFLX 10949
325 #define PEN_VCTR 46254
326 
327 /*
328  * Structure describing a custom option.
329  */
330 
331 typedef struct custom_opt_s {
332  guint32 pen;
333  union {
334  struct generic_custom_opt_data {
335  gsize custom_data_len;
336  gchar *custom_data;
337  } generic_data;
338  struct nflx_custom_opt_data {
339  guint32 type;
340  gsize custom_data_len;
341  gchar *custom_data;
342  gboolean use_little_endian;
343  } nflx_data;
344  } data;
345 } custom_opt_t;
346 
347 /*
348  * Structure describing a NFLX custom option.
349  */
350 typedef struct nflx_custom_opt_s {
351  gboolean nflx_use_little_endian;
352  guint32 nflx_type;
353  gsize nflx_custom_data_len;
354  gchar *nflx_custom_data;
356 
357 /* Interface description data - if_filter option structure */
358 
359 /* BPF instruction */
360 typedef struct wtap_bpf_insn_s {
361  guint16 code;
362  guint8 jt;
363  guint8 jf;
364  guint32 k;
366 
367 /*
368  * Type of filter.
369  */
370 typedef enum {
371  if_filter_pcap = 0, /* pcap filter string */
372  if_filter_bpf = 1 /* BPF program */
373 } if_filter_type_e;
374 
375 typedef struct if_filter_opt_s {
376  if_filter_type_e type;
377  union {
378  gchar *filter_str;
379  struct wtap_bpf_insns {
380  guint bpf_prog_len;
383  } data;
385 
386 /* Packet - packet_verdict option structure */
387 
388 /*
389  * Type of verdict.
390  */
391 typedef enum {
392  packet_verdict_hardware = 0, /* array of octets */
393  packet_verdict_linux_ebpf_tc = 1, /* 64-bit unsigned integer TC_ACT_ value */
394  packet_verdict_linux_ebpf_xdp = 2 /* 64-bit unsigned integer xdp_action value */
395 } packet_verdict_type_e;
396 
397 typedef struct packet_verdict_opt_s {
398  packet_verdict_type_e type;
399  union {
400  GByteArray *verdict_bytes;
401  guint64 verdict_linux_ebpf_tc;
402  guint64 verdict_linux_ebpf_xdp;
403  } data;
405 
406 typedef struct packet_hash_opt_s {
407  guint8 type;
408  GByteArray *hash_bytes;
410 
411 /*
412  * Structure describing a value of an option.
413  */
414 typedef union {
415  guint8 uint8val;
416  guint32 uint32val;
417  guint64 uint64val;
418  ws_in4_addr ipv4val; /* network byte order */
419  ws_in6_addr ipv6val;
420  char *stringval;
421  GBytes *byteval;
422  custom_opt_t custom_opt;
423  if_filter_opt_t if_filterval;
424  packet_verdict_opt_t packet_verdictval;
425  packet_hash_opt_t packet_hash;
426 } wtap_optval_t;
427 
428 /*
429  * Structure describing an option in a block.
430  */
431 typedef struct {
432  guint option_id;
434 } wtap_option_t;
435 
436 #define NFLX_OPT_TYPE_VERSION 1
437 #define NFLX_OPT_TYPE_TCPINFO 2
438 #define NFLX_OPT_TYPE_DUMPINFO 4
439 #define NFLX_OPT_TYPE_DUMPTIME 5
440 #define NFLX_OPT_TYPE_STACKNAME 6
441 
443  guint32 tlh_version;
444  guint32 tlh_type;
445  guint64 tlh_length;
446  guint16 tlh_ie_fport;
447  guint16 tlh_ie_lport;
448  guint32 tlh_ie_faddr_addr32[4];
449  guint32 tlh_ie_laddr_addr32[4];
450  guint32 tlh_ie_zoneid;
451  guint64 tlh_offset_tv_sec;
452  guint64 tlh_offset_tv_usec;
453  char tlh_id[64];
454  char tlh_reason[32];
455  char tlh_tag[32];
456  guint8 tlh_af;
457  guint8 _pad[7];
458 };
459 
460 /* Flags used in tlb_eventflags */
461 #define NFLX_TLB_FLAG_RXBUF 0x0001 /* Includes receive buffer info */
462 #define NFLX_TLB_FLAG_TXBUF 0x0002 /* Includes send buffer info */
463 #define NFLX_TLB_FLAG_HDR 0x0004 /* Includes a TCP header */
464 #define NFLX_TLB_FLAG_VERBOSE 0x0008 /* Includes function/line numbers */
465 #define NFLX_TLB_FLAG_STACKINFO 0x0010 /* Includes stack-specific info */
466 
467 /* Flags used in tlb_flags */
468 #define NFLX_TLB_TF_REQ_SCALE 0x00000020 /* Sent WS option */
469 #define NFLX_TLB_TF_RCVD_SCALE 0x00000040 /* Received WS option */
470 
471 /* Values of tlb_state */
472 #define NFLX_TLB_TCPS_ESTABLISHED 4
473 #define NFLX_TLB_IS_SYNCHRONIZED(state) (state >= NFLX_TLB_TCPS_ESTABLISHED)
474 
475 struct nflx_tcpinfo {
476  guint64 tlb_tv_sec;
477  guint64 tlb_tv_usec;
478  guint32 tlb_ticks;
479  guint32 tlb_sn;
480  guint8 tlb_stackid;
481  guint8 tlb_eventid;
482  guint16 tlb_eventflags;
483  gint32 tlb_errno;
484  guint32 tlb_rxbuf_tls_sb_acc;
485  guint32 tlb_rxbuf_tls_sb_ccc;
486  guint32 tlb_rxbuf_tls_sb_spare;
487  guint32 tlb_txbuf_tls_sb_acc;
488  guint32 tlb_txbuf_tls_sb_ccc;
489  guint32 tlb_txbuf_tls_sb_spare;
490  gint32 tlb_state;
491  guint32 tlb_starttime;
492  guint32 tlb_iss;
493  guint32 tlb_flags;
494  guint32 tlb_snd_una;
495  guint32 tlb_snd_max;
496  guint32 tlb_snd_cwnd;
497  guint32 tlb_snd_nxt;
498  guint32 tlb_snd_recover;
499  guint32 tlb_snd_wnd;
500  guint32 tlb_snd_ssthresh;
501  guint32 tlb_srtt;
502  guint32 tlb_rttvar;
503  guint32 tlb_rcv_up;
504  guint32 tlb_rcv_adv;
505  guint32 tlb_flags2;
506  guint32 tlb_rcv_nxt;
507  guint32 tlb_rcv_wnd;
508  guint32 tlb_dupacks;
509  gint32 tlb_segqlen;
510  gint32 tlb_snd_numholes;
511  guint32 tlb_flex1;
512  guint32 tlb_flex2;
513  guint32 tlb_fbyte_in;
514  guint32 tlb_fbyte_out;
515  guint8 tlb_snd_scale:4,
516  tlb_rcv_scale:4;
517  guint8 _pad[3];
518 
519  /* The following fields might become part of a union */
520  guint64 tlb_stackinfo_bbr_cur_del_rate;
521  guint64 tlb_stackinfo_bbr_delRate;
522  guint64 tlb_stackinfo_bbr_rttProp;
523  guint64 tlb_stackinfo_bbr_bw_inuse;
524  guint32 tlb_stackinfo_bbr_inflight;
525  guint32 tlb_stackinfo_bbr_applimited;
526  guint32 tlb_stackinfo_bbr_delivered;
527  guint32 tlb_stackinfo_bbr_timeStamp;
528  guint32 tlb_stackinfo_bbr_epoch;
529  guint32 tlb_stackinfo_bbr_lt_epoch;
530  guint32 tlb_stackinfo_bbr_pkts_out;
531  guint32 tlb_stackinfo_bbr_flex1;
532  guint32 tlb_stackinfo_bbr_flex2;
533  guint32 tlb_stackinfo_bbr_flex3;
534  guint32 tlb_stackinfo_bbr_flex4;
535  guint32 tlb_stackinfo_bbr_flex5;
536  guint32 tlb_stackinfo_bbr_flex6;
537  guint32 tlb_stackinfo_bbr_lost;
538  guint16 tlb_stackinfo_bbr_pacing_gain;
539  guint16 tlb_stackinfo_bbr_cwnd_gain;
540  guint16 tlb_stackinfo_bbr_flex7;
541  guint8 tlb_stackinfo_bbr_bbr_state;
542  guint8 tlb_stackinfo_bbr_bbr_substate;
543  guint8 tlb_stackinfo_bbr_inhpts;
544  guint8 tlb_stackinfo_bbr_ininput;
545  guint8 tlb_stackinfo_bbr_use_lt_bw;
546  guint8 tlb_stackinfo_bbr_flex8;
547  guint32 tlb_stackinfo_bbr_pkt_epoch;
548 
549  guint32 tlb_len;
550 };
551 
552 typedef void (*wtap_block_create_func)(wtap_block_t block);
553 typedef void (*wtap_mand_free_func)(wtap_block_t block);
554 typedef void (*wtap_mand_copy_func)(wtap_block_t dest_block, wtap_block_t src_block);
555 
562 WS_DLL_PUBLIC void
564 
572 WS_DLL_PUBLIC wtap_block_t
573 wtap_block_create(wtap_block_type_t block_type);
574 
582 WS_DLL_PUBLIC wtap_block_t
584 
591 WS_DLL_PUBLIC void
593 
602 WS_DLL_PUBLIC void
603 wtap_block_array_free(GArray* block_array);
604 
610 WS_DLL_PUBLIC wtap_block_type_t
612 
618 WS_DLL_PUBLIC void*
620 
627 WS_DLL_PUBLIC guint
628 wtap_block_count_option(wtap_block_t block, guint option_id);
629 
638 WS_DLL_PUBLIC wtap_opttype_return_val
639 wtap_block_add_uint8_option(wtap_block_t block, guint option_id, guint8 value);
640 
649 WS_DLL_PUBLIC wtap_opttype_return_val
650 wtap_block_set_uint8_option_value(wtap_block_t block, guint option_id, guint8 value);
651 
660 WS_DLL_PUBLIC wtap_opttype_return_val
661 wtap_block_get_uint8_option_value(wtap_block_t block, guint option_id, guint8* value) G_GNUC_WARN_UNUSED_RESULT;
662 
671 WS_DLL_PUBLIC wtap_opttype_return_val
672 wtap_block_add_uint32_option(wtap_block_t block, guint option_id, guint32 value);
673 
682 WS_DLL_PUBLIC wtap_opttype_return_val
683 wtap_block_set_uint32_option_value(wtap_block_t block, guint option_id, guint32 value);
684 
693 WS_DLL_PUBLIC wtap_opttype_return_val
694 wtap_block_get_uint32_option_value(wtap_block_t block, guint option_id, guint32* value) G_GNUC_WARN_UNUSED_RESULT;
695 
704 WS_DLL_PUBLIC wtap_opttype_return_val
705 wtap_block_add_uint64_option(wtap_block_t block, guint option_id, guint64 value);
706 
715 WS_DLL_PUBLIC wtap_opttype_return_val
716 wtap_block_set_uint64_option_value(wtap_block_t block, guint option_id, guint64 value);
717 
726 WS_DLL_PUBLIC wtap_opttype_return_val
727 wtap_block_get_uint64_option_value(wtap_block_t block, guint option_id, guint64* value) G_GNUC_WARN_UNUSED_RESULT;
728 
737 WS_DLL_PUBLIC wtap_opttype_return_val
738 wtap_block_add_ipv4_option(wtap_block_t block, guint option_id, guint32 value);
739 
748 WS_DLL_PUBLIC wtap_opttype_return_val
749 wtap_block_set_ipv4_option_value(wtap_block_t block, guint option_id, guint32 value);
750 
759 WS_DLL_PUBLIC wtap_opttype_return_val
760 wtap_block_get_ipv4_option_value(wtap_block_t block, guint option_id, guint32* value) G_GNUC_WARN_UNUSED_RESULT;
761 
770 WS_DLL_PUBLIC wtap_opttype_return_val
771 wtap_block_add_ipv6_option(wtap_block_t block, guint option_id, ws_in6_addr *value);
772 
781 WS_DLL_PUBLIC wtap_opttype_return_val
782 wtap_block_set_ipv6_option_value(wtap_block_t block, guint option_id, ws_in6_addr *value);
783 
792 WS_DLL_PUBLIC wtap_opttype_return_val
793 wtap_block_get_ipv6_option_value(wtap_block_t block, guint option_id, ws_in6_addr* value) G_GNUC_WARN_UNUSED_RESULT;
794 
804 WS_DLL_PUBLIC wtap_opttype_return_val
805 wtap_block_add_string_option(wtap_block_t block, guint option_id, const char *value, gsize value_length);
806 
815 WS_DLL_PUBLIC wtap_opttype_return_val
816 wtap_block_add_string_option_owned(wtap_block_t block, guint option_id, char *value);
817 
826 WS_DLL_PUBLIC wtap_opttype_return_val
827 wtap_block_add_string_option_format(wtap_block_t block, guint option_id, const char *format, ...)
828  G_GNUC_PRINTF(3,4);
829 
839 WS_DLL_PUBLIC wtap_opttype_return_val
840 wtap_block_set_string_option_value(wtap_block_t block, guint option_id, const char* value, gsize value_length);
841 
853 WS_DLL_PUBLIC wtap_opttype_return_val
854 wtap_block_set_nth_string_option_value(wtap_block_t block, guint option_id, guint idx, const char* value, gsize value_length);
855 
864 WS_DLL_PUBLIC wtap_opttype_return_val
865 wtap_block_set_string_option_value_format(wtap_block_t block, guint option_id, const char *format, ...)
866  G_GNUC_PRINTF(3,4);
867 
878 WS_DLL_PUBLIC wtap_opttype_return_val
879 wtap_block_set_nth_string_option_value_format(wtap_block_t block, guint option_id, guint idx, const char *format, ...)
880  G_GNUC_PRINTF(4,5);
881 
890 WS_DLL_PUBLIC wtap_opttype_return_val
891 wtap_block_get_string_option_value(wtap_block_t block, guint option_id, char** value) G_GNUC_WARN_UNUSED_RESULT;
892 
903 WS_DLL_PUBLIC wtap_opttype_return_val
904 wtap_block_get_nth_string_option_value(wtap_block_t block, guint option_id, guint idx, char** value) G_GNUC_WARN_UNUSED_RESULT;
905 
915 WS_DLL_PUBLIC wtap_opttype_return_val
916 wtap_block_add_bytes_option(wtap_block_t block, guint option_id, const guint8 *value, gsize value_length);
917 
926 WS_DLL_PUBLIC wtap_opttype_return_val
927 wtap_block_add_bytes_option_borrow(wtap_block_t block, guint option_id, GBytes *value);
928 
938 WS_DLL_PUBLIC wtap_opttype_return_val
939 wtap_block_set_bytes_option_value(wtap_block_t block, guint option_id, const guint8* value, gsize value_length);
940 
950 WS_DLL_PUBLIC wtap_opttype_return_val
951 wtap_block_set_nth_bytes_option_value(wtap_block_t block, guint option_id, guint idx, GBytes* value);
952 
963 WS_DLL_PUBLIC wtap_opttype_return_val
964 wtap_block_get_bytes_option_value(wtap_block_t block, guint option_id, GBytes** value) G_GNUC_WARN_UNUSED_RESULT;
965 
977 WS_DLL_PUBLIC wtap_opttype_return_val
978 wtap_block_get_nth_bytes_option_value(wtap_block_t block, guint option_id, guint idx, GBytes** value) G_GNUC_WARN_UNUSED_RESULT;
979 
989 WS_DLL_PUBLIC wtap_opttype_return_val
990 wtap_block_add_nflx_custom_option(wtap_block_t block, guint32 nflx_type, const char *nflx_custom_data, gsize nflx_custom_data_len);
991 
1001 WS_DLL_PUBLIC wtap_opttype_return_val
1002 wtap_block_get_nflx_custom_option(wtap_block_t block, guint32 nflx_type, char *nflx_custom_data, gsize nflx_custom_data_len);
1003 
1014 WS_DLL_PUBLIC wtap_opttype_return_val
1015 wtap_block_add_custom_option(wtap_block_t block, guint option_id, guint32 pen, const char *custom_data, gsize custom_data_len);
1016 
1025 WS_DLL_PUBLIC wtap_opttype_return_val
1026 wtap_block_add_if_filter_option(wtap_block_t block, guint option_id, if_filter_opt_t* value);
1027 
1036 WS_DLL_PUBLIC wtap_opttype_return_val
1038 
1047 WS_DLL_PUBLIC wtap_opttype_return_val
1048 wtap_block_get_if_filter_option_value(wtap_block_t block, guint option_id, if_filter_opt_t* value) G_GNUC_WARN_UNUSED_RESULT;
1049 
1058 WS_DLL_PUBLIC wtap_opttype_return_val
1060 
1071 WS_DLL_PUBLIC wtap_opttype_return_val
1072 wtap_block_set_nth_packet_verdict_option_value(wtap_block_t block, guint option_id, guint idx, packet_verdict_opt_t* value);
1073 
1084 WS_DLL_PUBLIC wtap_opttype_return_val
1085 wtap_block_get_nth_packet_verdict_option_value(wtap_block_t block, guint option_id, guint idx, packet_verdict_opt_t* value) G_GNUC_WARN_UNUSED_RESULT;
1086 
1087 WS_DLL_PUBLIC void
1088 wtap_packet_verdict_free(packet_verdict_opt_t* verdict);
1089 
1098 WS_DLL_PUBLIC wtap_opttype_return_val
1099 wtap_block_add_packet_hash_option(wtap_block_t block, guint option_id, packet_hash_opt_t* value);
1100 
1101 WS_DLL_PUBLIC void
1102 wtap_packet_hash_free(packet_hash_opt_t* hash);
1103 
1111 WS_DLL_PUBLIC wtap_opttype_return_val
1112 wtap_block_remove_option(wtap_block_t block, guint option_id);
1113 
1122 WS_DLL_PUBLIC wtap_opttype_return_val
1123 wtap_block_remove_nth_option_instance(wtap_block_t block, guint option_id, guint idx);
1124 
1133 WS_DLL_PUBLIC void
1134 wtap_block_copy(wtap_block_t dest_block, wtap_block_t src_block);
1135 
1141 WS_DLL_PUBLIC wtap_block_t
1143 
1144 typedef gboolean (*wtap_block_foreach_func)(wtap_block_t block, guint option_id, wtap_opttype_e option_type, wtap_optval_t *option, void *user_data);
1145 WS_DLL_PUBLIC gboolean
1146 wtap_block_foreach_option(wtap_block_t block, wtap_block_foreach_func func, void* user_data);
1147 
1150 WS_DLL_PUBLIC void
1151 wtap_opttypes_cleanup(void);
1152 
1153 #ifdef __cplusplus
1154 }
1155 #endif /* __cplusplus */
1156 
1157 #endif /* WTAP_OPT_TYPES_H */
Definition: wtap_opttypes.h:331
Definition: inet_ipv6.h:21
Definition: wtap_opttypes.h:375
gchar * filter_str
Definition: wtap_opttypes.h:378
guint bpf_prog_len
Definition: wtap_opttypes.h:380
wtap_bpf_insn_t * bpf_prog
Definition: wtap_opttypes.h:381
Definition: wtap_opttypes.h:350
Definition: wtap_opttypes.h:442
Definition: wtap_opttypes.h:475
Definition: wtap_opttypes.h:406
Definition: wtap_opttypes.h:397
Definition: wtap_opttypes.c:86
Definition: wtap_opttypes.h:360
Definition: wtap_opttypes.h:431
wtap_optval_t value
Definition: wtap_opttypes.h:433
guint option_id
Definition: wtap_opttypes.h:432
Definition: wtap_opttypes.h:251
guint8 * secrets_data
Definition: wtap_opttypes.h:254
guint32 secrets_len
Definition: wtap_opttypes.h:253
Definition: wtap_opttypes.h:288
Definition: wtap_opttypes.h:219
GArray * interface_statistics
Definition: wtap_opttypes.h:227
int tsprecision
Definition: wtap_opttypes.h:222
int wtap_encap
Definition: wtap_opttypes.h:220
Definition: wtap_opttypes.h:242
Definition: wtap_opttypes.h:212
Definition: wtap_opttypes.h:260
unsigned mev_data_len
Definition: wtap_opttypes.h:262
uint8_t * mev_data
Definition: wtap_opttypes.h:263
Definition: wtap_opttypes.h:234
Definition: wtap_opttypes.h:197
guint64 section_length
Definition: wtap_opttypes.h:198
Definition: wtap_opttypes.h:414
struct wtapng_meta_event_mandatory_s wtapng_meta_event_mandatory_t
WS_DLL_PUBLIC wtap_opttype_return_val wtap_block_remove_option(wtap_block_t block, guint option_id)
Definition: wtap_opttypes.c:1495
WS_DLL_PUBLIC wtap_opttype_return_val wtap_block_add_uint8_option(wtap_block_t block, guint option_id, guint8 value)
Definition: wtap_opttypes.c:744
WS_DLL_PUBLIC wtap_block_t wtap_block_make_copy(wtap_block_t block)
Definition: wtap_opttypes.c:549
struct wtapng_section_mandatory_s wtapng_section_mandatory_t
WS_DLL_PUBLIC wtap_opttype_return_val wtap_block_get_uint64_option_value(wtap_block_t block, guint option_id, guint64 *value) G_GNUC_WARN_UNUSED_RESULT
Definition: wtap_opttypes.c:848
WS_DLL_PUBLIC wtap_opttype_return_val wtap_block_set_nth_bytes_option_value(wtap_block_t block, guint option_id, guint idx, GBytes *value)
Definition: wtap_opttypes.c:1155
WS_DLL_PUBLIC wtap_opttype_return_val wtap_block_add_ipv4_option(wtap_block_t block, guint option_id, guint32 value)
Definition: wtap_opttypes.c:861
WS_DLL_PUBLIC wtap_opttype_return_val wtap_block_set_uint8_option_value(wtap_block_t block, guint option_id, guint8 value)
Definition: wtap_opttypes.c:757
WS_DLL_PUBLIC wtap_opttype_return_val wtap_block_add_nflx_custom_option(wtap_block_t block, guint32 nflx_type, const char *nflx_custom_data, gsize nflx_custom_data_len)
Definition: wtap_opttypes.c:1195
WS_DLL_PUBLIC wtap_opttype_return_val wtap_block_get_if_filter_option_value(wtap_block_t block, guint option_id, if_filter_opt_t *value) G_GNUC_WARN_UNUSED_RESULT
Definition: wtap_opttypes.c:1425
WS_DLL_PUBLIC wtap_opttype_return_val wtap_block_add_uint64_option(wtap_block_t block, guint option_id, guint64 value)
Definition: wtap_opttypes.c:822
WS_DLL_PUBLIC wtap_opttype_return_val wtap_block_add_custom_option(wtap_block_t block, guint option_id, guint32 pen, const char *custom_data, gsize custom_data_len)
Definition: wtap_opttypes.c:1379
WS_DLL_PUBLIC wtap_opttype_return_val wtap_block_add_bytes_option_borrow(wtap_block_t block, guint option_id, GBytes *value)
Definition: wtap_opttypes.c:1119
WS_DLL_PUBLIC wtap_opttype_return_val wtap_block_set_ipv4_option_value(wtap_block_t block, guint option_id, guint32 value)
Definition: wtap_opttypes.c:874
struct wtapng_if_stats_mandatory_s wtapng_if_stats_mandatory_t
WS_DLL_PUBLIC wtap_opttype_return_val wtap_block_get_uint32_option_value(wtap_block_t block, guint option_id, guint32 *value) G_GNUC_WARN_UNUSED_RESULT
Definition: wtap_opttypes.c:809
WS_DLL_PUBLIC wtap_opttype_return_val wtap_block_add_uint32_option(wtap_block_t block, guint option_id, guint32 value)
Definition: wtap_opttypes.c:783
WS_DLL_PUBLIC wtap_opttype_return_val wtap_block_get_uint8_option_value(wtap_block_t block, guint option_id, guint8 *value) G_GNUC_WARN_UNUSED_RESULT
Definition: wtap_opttypes.c:770
WS_DLL_PUBLIC wtap_opttype_return_val wtap_block_set_nth_packet_verdict_option_value(wtap_block_t block, guint option_id, guint idx, packet_verdict_opt_t *value)
Definition: wtap_opttypes.c:1451
WS_DLL_PUBLIC wtap_block_t wtap_block_create(wtap_block_type_t block_type)
Definition: wtap_opttypes.c:334
WS_DLL_PUBLIC wtap_opttype_return_val wtap_block_add_bytes_option(wtap_block_t block, guint option_id, const guint8 *value, gsize value_length)
Definition: wtap_opttypes.c:1106
WS_DLL_PUBLIC wtap_opttype_return_val wtap_block_add_string_option(wtap_block_t block, guint option_id, const char *value, gsize value_length)
Definition: wtap_opttypes.c:939
struct wtapng_dsb_mandatory_s wtapng_dsb_mandatory_t
struct wtapng_nrb_mandatory_s wtapng_nrb_mandatory_t
WS_DLL_PUBLIC wtap_opttype_return_val wtap_block_get_nflx_custom_option(wtap_block_t block, guint32 nflx_type, char *nflx_custom_data, gsize nflx_custom_data_len)
WS_DLL_PUBLIC wtap_block_t wtap_block_ref(wtap_block_t block)
Definition: wtap_opttypes.c:418
WS_DLL_PUBLIC wtap_opttype_return_val wtap_block_add_if_filter_option(wtap_block_t block, guint option_id, if_filter_opt_t *value)
Definition: wtap_opttypes.c:1394
WS_DLL_PUBLIC wtap_opttype_return_val wtap_block_set_if_filter_option_value(wtap_block_t block, guint option_id, if_filter_opt_t *value)
Definition: wtap_opttypes.c:1407
WS_DLL_PUBLIC wtap_opttype_return_val WS_DLL_PUBLIC wtap_opttype_return_val WS_DLL_PUBLIC wtap_opttype_return_val wtap_block_get_string_option_value(wtap_block_t block, guint option_id, char **value) G_GNUC_WARN_UNUSED_RESULT
Definition: wtap_opttypes.c:1080
WS_DLL_PUBLIC wtap_opttype_return_val wtap_block_add_ipv6_option(wtap_block_t block, guint option_id, ws_in6_addr *value)
Definition: wtap_opttypes.c:900
WS_DLL_PUBLIC void wtap_opttypes_initialize(void)
Definition: wtap_opttypes.c:1759
WS_DLL_PUBLIC wtap_opttype_return_val wtap_block_get_nth_packet_verdict_option_value(wtap_block_t block, guint option_id, guint idx, packet_verdict_opt_t *value) G_GNUC_WARN_UNUSED_RESULT
Definition: wtap_opttypes.c:1469
WS_DLL_PUBLIC wtap_opttype_return_val wtap_block_remove_nth_option_instance(wtap_block_t block, guint option_id, guint idx)
Definition: wtap_opttypes.c:1537
WS_DLL_PUBLIC wtap_opttype_return_val wtap_block_set_bytes_option_value(wtap_block_t block, guint option_id, const guint8 *value, gsize value_length)
WS_DLL_PUBLIC wtap_opttype_return_val wtap_block_get_ipv6_option_value(wtap_block_t block, guint option_id, ws_in6_addr *value) G_GNUC_WARN_UNUSED_RESULT
Definition: wtap_opttypes.c:926
struct wtapng_if_descr_mandatory_s wtapng_if_descr_mandatory_t
WS_DLL_PUBLIC wtap_opttype_return_val wtap_block_set_ipv6_option_value(wtap_block_t block, guint option_id, ws_in6_addr *value)
Definition: wtap_opttypes.c:913
WS_DLL_PUBLIC wtap_opttype_return_val wtap_block_set_uint32_option_value(wtap_block_t block, guint option_id, guint32 value)
Definition: wtap_opttypes.c:796
struct wtapng_iface_descriptions_s wtapng_iface_descriptions_t
WS_DLL_PUBLIC void * wtap_block_get_mandatory_data(wtap_block_t block)
Definition: wtap_opttypes.c:286
WS_DLL_PUBLIC wtap_opttype_return_val WS_DLL_PUBLIC wtap_opttype_return_val wtap_block_set_string_option_value(wtap_block_t block, guint option_id, const char *value, gsize value_length)
WS_DLL_PUBLIC wtap_opttype_return_val wtap_block_get_nth_bytes_option_value(wtap_block_t block, guint option_id, guint idx, GBytes **value) G_GNUC_WARN_UNUSED_RESULT
Definition: wtap_opttypes.c:1182
WS_DLL_PUBLIC void wtap_block_unref(wtap_block_t block)
Definition: wtap_opttypes.c:431
WS_DLL_PUBLIC void wtap_opttypes_cleanup(void)
Definition: wtap_opttypes.c:2103
WS_DLL_PUBLIC wtap_block_type_t wtap_block_get_type(wtap_block_t block)
Definition: wtap_opttypes.c:281
WS_DLL_PUBLIC wtap_opttype_return_val wtap_block_add_string_option_owned(wtap_block_t block, guint option_id, char *value)
Definition: wtap_opttypes.c:953
struct wtapng_ft_specific_mandatory_s wtapng_ft_specific_mandatory_t
WS_DLL_PUBLIC wtap_opttype_return_val wtap_block_add_string_option_format(wtap_block_t block, guint option_id, const char *format,...) G_GNUC_PRINTF(3
WS_DLL_PUBLIC void wtap_block_copy(wtap_block_t dest_block, wtap_block_t src_block)
Definition: wtap_opttypes.c:473
WS_DLL_PUBLIC wtap_opttype_return_val WS_DLL_PUBLIC wtap_opttype_return_val wtap_block_set_nth_string_option_value_format(wtap_block_t block, guint option_id, guint idx, const char *format,...) G_GNUC_PRINTF(4
WS_DLL_PUBLIC void wtap_block_array_free(GArray *block_array)
Definition: wtap_opttypes.c:456
WS_DLL_PUBLIC wtap_opttype_return_val wtap_block_get_ipv4_option_value(wtap_block_t block, guint option_id, guint32 *value) G_GNUC_WARN_UNUSED_RESULT
Definition: wtap_opttypes.c:887
WS_DLL_PUBLIC wtap_opttype_return_val wtap_block_set_nth_string_option_value(wtap_block_t block, guint option_id, guint idx, const char *value, gsize value_length)
WS_DLL_PUBLIC guint wtap_block_count_option(wtap_block_t block, guint option_id)
Definition: wtap_opttypes.c:559
WS_DLL_PUBLIC wtap_opttype_return_val wtap_block_get_bytes_option_value(wtap_block_t block, guint option_id, GBytes **value) G_GNUC_WARN_UNUSED_RESULT
Definition: wtap_opttypes.c:1169
WS_DLL_PUBLIC wtap_opttype_return_val wtap_block_set_uint64_option_value(wtap_block_t block, guint option_id, guint64 value)
Definition: wtap_opttypes.c:835
WS_DLL_PUBLIC wtap_opttype_return_val wtap_block_add_packet_hash_option(wtap_block_t block, guint option_id, packet_hash_opt_t *value)
Definition: wtap_opttypes.c:1482
WS_DLL_PUBLIC wtap_opttype_return_val wtap_block_get_nth_string_option_value(wtap_block_t block, guint option_id, guint idx, char **value) G_GNUC_WARN_UNUSED_RESULT
Definition: wtap_opttypes.c:1093
WS_DLL_PUBLIC wtap_opttype_return_val wtap_block_set_string_option_value_format(wtap_block_t block, guint option_id, const char *format,...) G_GNUC_PRINTF(3
WS_DLL_PUBLIC wtap_opttype_return_val wtap_block_add_packet_verdict_option(wtap_block_t block, guint option_id, packet_verdict_opt_t *value)
Definition: wtap_opttypes.c:1438