Wireshark 4.5.0
The Wireshark network protocol analyzer
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
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_addr.h>
16
17#ifdef __cplusplus
18extern "C" {
19#endif /* __cplusplus */
20
21/*
22 * We use the pcapng option codes for option type values.
23 */
24
25/* Options for all blocks */
26#define OPT_EOFOPT 0
27#define OPT_COMMENT 1
28#define OPT_CUSTOM_STR_COPY 2988
29#define OPT_CUSTOM_BIN_COPY 2989
30#define OPT_CUSTOM_STR_NO_COPY 19372
31#define OPT_CUSTOM_BIN_NO_COPY 19373
33/* Section Header block (SHB) */
34#define OPT_SHB_HARDWARE 2
37#define OPT_SHB_OS 3
40#define OPT_SHB_USERAPPL 4
44/* Interface Description block (IDB) */
45#define OPT_IDB_NAME 2
49#define OPT_IDB_DESCRIPTION 3
55#define OPT_IDB_IP4ADDR 4
60#define OPT_IDB_IP6ADDR 5
66#define OPT_IDB_MACADDR 6
67#define OPT_IDB_EUIADDR 7
68#define OPT_IDB_SPEED 8
70#define OPT_IDB_TSRESOL 9
79#define OPT_IDB_TZONE 10
85#define OPT_IDB_FILTER 11
92#define OPT_IDB_OS 12
100#define OPT_IDB_FCSLEN 13
105#define OPT_IDB_TSOFFSET 14
115#define OPT_IDB_HARDWARE 15
122#define OPT_IDB_TXSPEED 16
125#define OPT_IDB_RXSPEED 17
128#define OPT_IDB_IANA_TZNAME 18
132/*
133 * These are the options for an EPB, but we use them for all WTAP_BLOCK_PACKET
134 */
135#define OPT_PKT_FLAGS 2
136#define OPT_PKT_HASH 3
137#define OPT_PKT_DROPCOUNT 4
138#define OPT_PKT_PACKETID 5
139#define OPT_PKT_QUEUE 6
140#define OPT_PKT_VERDICT 7
141#define OPT_PKT_PROCIDTHRDID 8
142
143/* Name Resolution Block (NRB) */
144#define OPT_NS_DNSNAME 2
145#define OPT_NS_DNSIP4ADDR 3
146#define OPT_NS_DNSIP6ADDR 4
147
148/* Interface Statistics Block (ISB) */
149#define OPT_ISB_STARTTIME 2
150#define OPT_ISB_ENDTIME 3
151#define OPT_ISB_IFRECV 4
152#define OPT_ISB_IFDROP 5
153#define OPT_ISB_FILTERACCEPT 6
154#define OPT_ISB_OSDROP 7
155#define OPT_ISB_USRDELIV 8
156
157struct wtap_block;
158typedef struct wtap_block *wtap_block_t;
159
160/*
161 * Currently supported blocks; these are not the pcapng block type values
162 * for them, they're identifiers used internally, and more than one
163 * pcapng block type may use a given block type.
164 *
165 * Note that, in a given file format, this information won't necessarily
166 * appear in the form of blocks in the file, even though they're presented
167 * to the caller of libwiretap as blocks when reading and are presented
168 * by the caller of libwiretap as blocks when writing. See, for example,
169 * the iptrace file format, in which the interface name is given as part
170 * of the packet record header; we synthesize those blocks when reading
171 * (we don't currently support writing that format, but if we did, we'd
172 * get the interface name from the block and put it in the packet record
173 * header).
174 *
175 * WTAP_BLOCK_IF_ID_AND_INFO is a block that not only gives
176 * descriptive information about an interface but *also* assigns an
177 * ID to the interface, so that every packet has either an explicit
178 * or implicit interface ID indicating on which the packet arrived.
179 *
180 * It does *not* refer to information about interfaces that does not
181 * allow identification of the interface on which a packet arrives
182 * (I'm looking at *you*, Microsoft Network Monitor...). Do *not*
183 * indicate support for that block if your capture format merely
184 * gives a list of interface information without having every packet
185 * explicitly or implicitly (as in, for example, the pcapng Simple
186 * Packet Block) indicate on which of those interfaces the packet
187 * arrived.
188 *
189 * WTAP_BLOCK_PACKET (which corresponds to the Enhanced Packet Block,
190 * the Simple Packet Block, and the deprecated Packet Block) is not
191 * currently used; it's reserved for future use. The same applies
192 * to WTAP_BLOCK_SYSTEMD_JOURNAL_EXPORT.
193 */
194typedef enum {
195 WTAP_BLOCK_SECTION = 0,
196 WTAP_BLOCK_IF_ID_AND_INFO,
197 WTAP_BLOCK_NAME_RESOLUTION,
198 WTAP_BLOCK_IF_STATISTICS,
199 WTAP_BLOCK_DECRYPTION_SECRETS,
200 WTAP_BLOCK_PACKET,
201 WTAP_BLOCK_FT_SPECIFIC_REPORT,
202 WTAP_BLOCK_FT_SPECIFIC_EVENT,
203 WTAP_BLOCK_SYSDIG_EVENT,
204 WTAP_BLOCK_META_EVENT,
205 WTAP_BLOCK_SYSTEMD_JOURNAL_EXPORT,
206 WTAP_BLOCK_CUSTOM,
207 MAX_WTAP_BLOCK_TYPE_VALUE
208} wtap_block_type_t;
209
223
229 GArray *interface_data;
231
237 uint64_t time_units_per_second;
240 uint32_t snap_len;
241
242 uint8_t num_stat_entries;
246
251 GList *ipv4_addr_list;
252 GList *ipv6_addr_list;
254
259 uint32_t interface_id;
260 uint32_t ts_high;
261 uint32_t ts_low;
263
268 uint32_t secrets_type;
269 uint32_t secrets_len;
270 uint8_t *secrets_data;
272
277 uint32_t mev_block_type;
278 unsigned mev_data_len;
279 uint8_t *mev_data;
281
288#if 0
289/* Commented out for now, there's no mandatory data that isn't handled by
290 * Wireshark in other ways.
291 */
292typedef struct wtapng_packet_mandatory_s {
293 uint32_t interface_id;
294 uint32_t ts_high;
295 uint32_t ts_low;
296 uint32_t captured_len;
297 uint32_t orig_len;
298} wtapng_packet_mandatory_t;
299#endif
300
305 unsigned record_type; /* the type of record this is - file type-specific value */
307
308/*
309 * Currently supported option types. These are not option types
310 * in the sense that each one corresponds to a particular option,
311 * they are data types for the data of an option, so, for example,
312 * all options with a 32-bit unsigned integer value have the type
313 * WTAP_OPTTYPE_UINT32.
314 */
315typedef enum {
316 WTAP_OPTTYPE_UINT8,
317 WTAP_OPTTYPE_UINT32,
318 WTAP_OPTTYPE_UINT64,
319 WTAP_OPTTYPE_STRING,
320 WTAP_OPTTYPE_BYTES,
321 WTAP_OPTTYPE_IPv4,
322 WTAP_OPTTYPE_IPv6,
323 WTAP_OPTTYPE_CUSTOM,
324 WTAP_OPTTYPE_IF_FILTER,
325 WTAP_OPTTYPE_PACKET_VERDICT,
326 WTAP_OPTTYPE_PACKET_HASH,
327 WTAP_OPTTYPE_INT8,
328 WTAP_OPTTYPE_INT32,
329 WTAP_OPTTYPE_INT64,
330} wtap_opttype_e;
331
332typedef enum {
333 WTAP_OPTTYPE_SUCCESS = 0,
334 WTAP_OPTTYPE_NO_SUCH_OPTION = -1,
335 WTAP_OPTTYPE_NOT_FOUND = -2,
336 WTAP_OPTTYPE_TYPE_MISMATCH = -3,
337 WTAP_OPTTYPE_NUMBER_MISMATCH = -4,
338 WTAP_OPTTYPE_ALREADY_EXISTS = -5,
339 WTAP_OPTTYPE_BAD_BLOCK = -6,
340} wtap_opttype_return_val;
341
342/* https://www.iana.org/assignments/enterprise-numbers/enterprise-numbers */
343#define PEN_NFLX 10949
344#define PEN_VCTR 46254
345
346/*
347 * Structure describing a custom option.
348 */
349
350typedef struct custom_opt_s {
351 uint32_t pen;
352 union {
353 struct generic_custom_opt_data {
354 size_t custom_data_len;
355 char *custom_data;
356 } generic_data;
357 struct nflx_custom_opt_data {
358 uint32_t type;
359 size_t custom_data_len;
360 char *custom_data;
361 bool use_little_endian;
362 } nflx_data;
363 } data;
365
366/*
367 * Structure describing a NFLX custom option.
368 */
369typedef struct nflx_custom_opt_s {
370 bool nflx_use_little_endian;
371 uint32_t nflx_type;
372 size_t nflx_custom_data_len;
373 char *nflx_custom_data;
375
376/* Interface description data - if_filter option structure */
377
378/* BPF instruction */
379typedef struct wtap_bpf_insn_s {
380 uint16_t code;
381 uint8_t jt;
382 uint8_t jf;
383 uint32_t k;
385
386/*
387 * Type of filter.
388 */
389typedef enum {
390 if_filter_pcap = 0, /* pcap filter string */
391 if_filter_bpf = 1 /* BPF program */
392} if_filter_type_e;
393
394typedef struct if_filter_opt_s {
395 if_filter_type_e type;
396 union {
398 struct wtap_bpf_insns {
399 unsigned bpf_prog_len;
402 } data;
404
405/* Packet - packet_verdict option structure */
406
407/*
408 * Type of verdict.
409 */
410typedef enum {
411 packet_verdict_hardware = 0, /* array of octets */
412 packet_verdict_linux_ebpf_tc = 1, /* 64-bit unsigned integer TC_ACT_ value */
413 packet_verdict_linux_ebpf_xdp = 2 /* 64-bit unsigned integer xdp_action value */
414} packet_verdict_type_e;
415
416typedef struct packet_verdict_opt_s {
417 packet_verdict_type_e type;
418 union {
419 GByteArray *verdict_bytes;
420 uint64_t verdict_linux_ebpf_tc;
421 uint64_t verdict_linux_ebpf_xdp;
422 } data;
424
425typedef struct packet_hash_opt_s {
426 uint8_t type;
427 GByteArray *hash_bytes;
429
430/*
431 * Structure describing a value of an option.
432 */
433typedef union {
434 uint8_t uint8val;
435 uint32_t uint32val;
436 uint64_t uint64val;
437 int8_t int8val;
438 int32_t int32val;
439 int64_t int64val;
440 ws_in4_addr ipv4val; /* network byte order */
441 ws_in6_addr ipv6val;
442 char *stringval;
443 GBytes *byteval;
444 custom_opt_t custom_opt;
445 if_filter_opt_t if_filterval;
446 packet_verdict_opt_t packet_verdictval;
447 packet_hash_opt_t packet_hash;
449
450/*
451 * Structure describing an option in a block.
452 */
453typedef struct {
454 unsigned option_id;
457
458#define NFLX_OPT_TYPE_VERSION 1
459#define NFLX_OPT_TYPE_TCPINFO 2
460#define NFLX_OPT_TYPE_DUMPINFO 4
461#define NFLX_OPT_TYPE_DUMPTIME 5
462#define NFLX_OPT_TYPE_STACKNAME 6
463
465 uint32_t tlh_version;
466 uint32_t tlh_type;
467 uint64_t tlh_length;
468 uint16_t tlh_ie_fport;
469 uint16_t tlh_ie_lport;
470 uint32_t tlh_ie_faddr_addr32[4];
471 uint32_t tlh_ie_laddr_addr32[4];
472 uint32_t tlh_ie_zoneid;
473 uint64_t tlh_offset_tv_sec;
474 uint64_t tlh_offset_tv_usec;
475 char tlh_id[64];
476 char tlh_reason[32];
477 char tlh_tag[32];
478 uint8_t tlh_af;
479 uint8_t _pad[7];
480};
481
482/* Flags used in tlb_eventflags */
483#define NFLX_TLB_FLAG_RXBUF 0x0001 /* Includes receive buffer info */
484#define NFLX_TLB_FLAG_TXBUF 0x0002 /* Includes send buffer info */
485#define NFLX_TLB_FLAG_HDR 0x0004 /* Includes a TCP header */
486#define NFLX_TLB_FLAG_VERBOSE 0x0008 /* Includes function/line numbers */
487#define NFLX_TLB_FLAG_STACKINFO 0x0010 /* Includes stack-specific info */
488
489/* Flags used in tlb_flags */
490#define NFLX_TLB_TF_REQ_SCALE 0x00000020 /* Sent WS option */
491#define NFLX_TLB_TF_RCVD_SCALE 0x00000040 /* Received WS option */
492
493/* Values of tlb_state */
494#define NFLX_TLB_TCPS_ESTABLISHED 4
495#define NFLX_TLB_IS_SYNCHRONIZED(state) (state >= NFLX_TLB_TCPS_ESTABLISHED)
496
498 uint64_t tlb_tv_sec;
499 uint64_t tlb_tv_usec;
500 uint32_t tlb_ticks;
501 uint32_t tlb_sn;
502 uint8_t tlb_stackid;
503 uint8_t tlb_eventid;
504 uint16_t tlb_eventflags;
505 int32_t tlb_errno;
506 uint32_t tlb_rxbuf_tls_sb_acc;
507 uint32_t tlb_rxbuf_tls_sb_ccc;
508 uint32_t tlb_rxbuf_tls_sb_spare;
509 uint32_t tlb_txbuf_tls_sb_acc;
510 uint32_t tlb_txbuf_tls_sb_ccc;
511 uint32_t tlb_txbuf_tls_sb_spare;
512 int32_t tlb_state;
513 uint32_t tlb_starttime;
514 uint32_t tlb_iss;
515 uint32_t tlb_flags;
516 uint32_t tlb_snd_una;
517 uint32_t tlb_snd_max;
518 uint32_t tlb_snd_cwnd;
519 uint32_t tlb_snd_nxt;
520 uint32_t tlb_snd_recover;
521 uint32_t tlb_snd_wnd;
522 uint32_t tlb_snd_ssthresh;
523 uint32_t tlb_srtt;
524 uint32_t tlb_rttvar;
525 uint32_t tlb_rcv_up;
526 uint32_t tlb_rcv_adv;
527 uint32_t tlb_flags2;
528 uint32_t tlb_rcv_nxt;
529 uint32_t tlb_rcv_wnd;
530 uint32_t tlb_dupacks;
531 int32_t tlb_segqlen;
532 int32_t tlb_snd_numholes;
533 uint32_t tlb_flex1;
534 uint32_t tlb_flex2;
535 uint32_t tlb_fbyte_in;
536 uint32_t tlb_fbyte_out;
537 uint8_t tlb_snd_scale:4,
538 tlb_rcv_scale:4;
539 uint8_t _pad[3];
540
541 /* The following fields might become part of a union */
542 uint64_t tlb_stackinfo_bbr_cur_del_rate;
543 uint64_t tlb_stackinfo_bbr_delRate;
544 uint64_t tlb_stackinfo_bbr_rttProp;
545 uint64_t tlb_stackinfo_bbr_bw_inuse;
546 uint32_t tlb_stackinfo_bbr_inflight;
547 uint32_t tlb_stackinfo_bbr_applimited;
548 uint32_t tlb_stackinfo_bbr_delivered;
549 uint32_t tlb_stackinfo_bbr_timeStamp;
550 uint32_t tlb_stackinfo_bbr_epoch;
551 uint32_t tlb_stackinfo_bbr_lt_epoch;
552 uint32_t tlb_stackinfo_bbr_pkts_out;
553 uint32_t tlb_stackinfo_bbr_flex1;
554 uint32_t tlb_stackinfo_bbr_flex2;
555 uint32_t tlb_stackinfo_bbr_flex3;
556 uint32_t tlb_stackinfo_bbr_flex4;
557 uint32_t tlb_stackinfo_bbr_flex5;
558 uint32_t tlb_stackinfo_bbr_flex6;
559 uint32_t tlb_stackinfo_bbr_lost;
560 uint16_t tlb_stackinfo_bbr_pacing_gain;
561 uint16_t tlb_stackinfo_bbr_cwnd_gain;
562 uint16_t tlb_stackinfo_bbr_flex7;
563 uint8_t tlb_stackinfo_bbr_bbr_state;
564 uint8_t tlb_stackinfo_bbr_bbr_substate;
565 uint8_t tlb_stackinfo_bbr_inhpts;
566 uint8_t tlb_stackinfo_bbr_ininput;
567 uint8_t tlb_stackinfo_bbr_use_lt_bw;
568 uint8_t tlb_stackinfo_bbr_flex8;
569 uint32_t tlb_stackinfo_bbr_pkt_epoch;
570
571 uint32_t tlb_len;
572};
573
574typedef void (*wtap_block_create_func)(wtap_block_t block);
575typedef void (*wtap_mand_free_func)(wtap_block_t block);
576typedef void (*wtap_mand_copy_func)(wtap_block_t dest_block, wtap_block_t src_block);
577
584WS_DLL_PUBLIC void
586
594WS_DLL_PUBLIC wtap_block_t
595wtap_block_create(wtap_block_type_t block_type);
596
604WS_DLL_PUBLIC wtap_block_t
606
613WS_DLL_PUBLIC void
615
624WS_DLL_PUBLIC void
625wtap_block_array_free(GArray* block_array);
626
637WS_DLL_PUBLIC void
638wtap_block_array_unref(GArray* block_array);
639
647WS_DLL_PUBLIC void
648wtap_block_array_ref(GArray* block_array);
649
655WS_DLL_PUBLIC wtap_block_type_t
657
663WS_DLL_PUBLIC void*
665
672WS_DLL_PUBLIC unsigned
673wtap_block_count_option(wtap_block_t block, unsigned option_id);
674
683WS_DLL_PUBLIC wtap_opttype_return_val
684wtap_block_add_uint8_option(wtap_block_t block, unsigned option_id, uint8_t value);
685
694WS_DLL_PUBLIC wtap_opttype_return_val
695wtap_block_set_uint8_option_value(wtap_block_t block, unsigned option_id, uint8_t value);
696
705WS_DLL_PUBLIC wtap_opttype_return_val
706wtap_block_get_uint8_option_value(wtap_block_t block, unsigned option_id, uint8_t* value) G_GNUC_WARN_UNUSED_RESULT;
707
716WS_DLL_PUBLIC wtap_opttype_return_val
717wtap_block_add_uint32_option(wtap_block_t block, unsigned option_id, uint32_t value);
718
727WS_DLL_PUBLIC wtap_opttype_return_val
728wtap_block_set_uint32_option_value(wtap_block_t block, unsigned option_id, uint32_t value);
729
738WS_DLL_PUBLIC wtap_opttype_return_val
739wtap_block_get_uint32_option_value(wtap_block_t block, unsigned option_id, uint32_t* value) G_GNUC_WARN_UNUSED_RESULT;
740
749WS_DLL_PUBLIC wtap_opttype_return_val
750wtap_block_add_uint64_option(wtap_block_t block, unsigned option_id, uint64_t value);
751
760WS_DLL_PUBLIC wtap_opttype_return_val
761wtap_block_set_uint64_option_value(wtap_block_t block, unsigned option_id, uint64_t value);
762
771WS_DLL_PUBLIC wtap_opttype_return_val
772wtap_block_get_uint64_option_value(wtap_block_t block, unsigned option_id, uint64_t* value) G_GNUC_WARN_UNUSED_RESULT;
773
782WS_DLL_PUBLIC wtap_opttype_return_val
783wtap_block_add_int8_option(wtap_block_t block, unsigned option_id, int8_t value);
784
793WS_DLL_PUBLIC wtap_opttype_return_val
794wtap_block_set_int8_option_value(wtap_block_t block, unsigned option_id, int8_t value);
795
804WS_DLL_PUBLIC wtap_opttype_return_val
805wtap_block_get_int8_option_value(wtap_block_t block, unsigned option_id, int8_t* value) G_GNUC_WARN_UNUSED_RESULT;
806
815WS_DLL_PUBLIC wtap_opttype_return_val
816wtap_block_add_int32_option(wtap_block_t block, unsigned option_id, int32_t value);
817
826WS_DLL_PUBLIC wtap_opttype_return_val
827wtap_block_set_int32_option_value(wtap_block_t block, unsigned option_id, int32_t value);
828
837WS_DLL_PUBLIC wtap_opttype_return_val
838wtap_block_get_int32_option_value(wtap_block_t block, unsigned option_id, int32_t* value) G_GNUC_WARN_UNUSED_RESULT;
839
848WS_DLL_PUBLIC wtap_opttype_return_val
849wtap_block_add_int64_option(wtap_block_t block, unsigned option_id, int64_t value);
850
859WS_DLL_PUBLIC wtap_opttype_return_val
860wtap_block_set_int64_option_value(wtap_block_t block, unsigned option_id, int64_t value);
861
870WS_DLL_PUBLIC wtap_opttype_return_val
871wtap_block_get_int64_option_value(wtap_block_t block, unsigned option_id, int64_t* value) G_GNUC_WARN_UNUSED_RESULT;
872
881WS_DLL_PUBLIC wtap_opttype_return_val
882wtap_block_add_ipv4_option(wtap_block_t block, unsigned option_id, uint32_t value);
883
892WS_DLL_PUBLIC wtap_opttype_return_val
893wtap_block_set_ipv4_option_value(wtap_block_t block, unsigned option_id, uint32_t value);
894
903WS_DLL_PUBLIC wtap_opttype_return_val
904wtap_block_get_ipv4_option_value(wtap_block_t block, unsigned option_id, uint32_t* value) G_GNUC_WARN_UNUSED_RESULT;
905
914WS_DLL_PUBLIC wtap_opttype_return_val
915wtap_block_add_ipv6_option(wtap_block_t block, unsigned option_id, ws_in6_addr *value);
916
925WS_DLL_PUBLIC wtap_opttype_return_val
926wtap_block_set_ipv6_option_value(wtap_block_t block, unsigned option_id, ws_in6_addr *value);
927
936WS_DLL_PUBLIC wtap_opttype_return_val
937wtap_block_get_ipv6_option_value(wtap_block_t block, unsigned option_id, ws_in6_addr* value) G_GNUC_WARN_UNUSED_RESULT;
938
948WS_DLL_PUBLIC wtap_opttype_return_val
949wtap_block_add_string_option(wtap_block_t block, unsigned option_id, const char *value, size_t value_length);
950
959WS_DLL_PUBLIC wtap_opttype_return_val
960wtap_block_add_string_option_owned(wtap_block_t block, unsigned option_id, char *value);
961
970WS_DLL_PUBLIC wtap_opttype_return_val
971wtap_block_add_string_option_format(wtap_block_t block, unsigned option_id, const char *format, ...)
972 G_GNUC_PRINTF(3,4);
973
983WS_DLL_PUBLIC wtap_opttype_return_val
984wtap_block_set_string_option_value(wtap_block_t block, unsigned option_id, const char* value, size_t value_length);
985
997WS_DLL_PUBLIC wtap_opttype_return_val
998wtap_block_set_nth_string_option_value(wtap_block_t block, unsigned option_id, unsigned idx, const char* value, size_t value_length);
999
1008WS_DLL_PUBLIC wtap_opttype_return_val
1009wtap_block_set_string_option_value_format(wtap_block_t block, unsigned option_id, const char *format, ...)
1010 G_GNUC_PRINTF(3,4);
1011
1022WS_DLL_PUBLIC wtap_opttype_return_val
1023wtap_block_set_nth_string_option_value_format(wtap_block_t block, unsigned option_id, unsigned idx, const char *format, ...)
1024 G_GNUC_PRINTF(4,5);
1025
1034WS_DLL_PUBLIC wtap_opttype_return_val
1035wtap_block_get_string_option_value(wtap_block_t block, unsigned option_id, char** value) G_GNUC_WARN_UNUSED_RESULT;
1036
1047WS_DLL_PUBLIC wtap_opttype_return_val
1048wtap_block_get_nth_string_option_value(wtap_block_t block, unsigned option_id, unsigned idx, char** value) G_GNUC_WARN_UNUSED_RESULT;
1049
1059WS_DLL_PUBLIC wtap_opttype_return_val
1060wtap_block_add_bytes_option(wtap_block_t block, unsigned option_id, const uint8_t *value, size_t value_length);
1061
1070WS_DLL_PUBLIC wtap_opttype_return_val
1071wtap_block_add_bytes_option_borrow(wtap_block_t block, unsigned option_id, GBytes *value);
1072
1082WS_DLL_PUBLIC wtap_opttype_return_val
1083wtap_block_set_bytes_option_value(wtap_block_t block, unsigned option_id, const uint8_t* value, size_t value_length);
1084
1094WS_DLL_PUBLIC wtap_opttype_return_val
1095wtap_block_set_nth_bytes_option_value(wtap_block_t block, unsigned option_id, unsigned idx, GBytes* value);
1096
1107WS_DLL_PUBLIC wtap_opttype_return_val
1108wtap_block_get_bytes_option_value(wtap_block_t block, unsigned option_id, GBytes** value) G_GNUC_WARN_UNUSED_RESULT;
1109
1121WS_DLL_PUBLIC wtap_opttype_return_val
1122wtap_block_get_nth_bytes_option_value(wtap_block_t block, unsigned option_id, unsigned idx, GBytes** value) G_GNUC_WARN_UNUSED_RESULT;
1123
1133WS_DLL_PUBLIC wtap_opttype_return_val
1134wtap_block_add_nflx_custom_option(wtap_block_t block, uint32_t nflx_type, const char *nflx_custom_data, size_t nflx_custom_data_len);
1135
1145WS_DLL_PUBLIC wtap_opttype_return_val
1146wtap_block_get_nflx_custom_option(wtap_block_t block, uint32_t nflx_type, char *nflx_custom_data, size_t nflx_custom_data_len);
1147
1158WS_DLL_PUBLIC wtap_opttype_return_val
1159wtap_block_add_custom_option(wtap_block_t block, unsigned option_id, uint32_t pen, const char *custom_data, size_t custom_data_len);
1160
1169WS_DLL_PUBLIC wtap_opttype_return_val
1170wtap_block_add_if_filter_option(wtap_block_t block, unsigned option_id, if_filter_opt_t* value);
1171
1180WS_DLL_PUBLIC wtap_opttype_return_val
1181wtap_block_set_if_filter_option_value(wtap_block_t block, unsigned option_id, if_filter_opt_t* value);
1182
1191WS_DLL_PUBLIC wtap_opttype_return_val
1192wtap_block_get_if_filter_option_value(wtap_block_t block, unsigned option_id, if_filter_opt_t* value) G_GNUC_WARN_UNUSED_RESULT;
1193
1202WS_DLL_PUBLIC wtap_opttype_return_val
1204
1215WS_DLL_PUBLIC wtap_opttype_return_val
1216wtap_block_set_nth_packet_verdict_option_value(wtap_block_t block, unsigned option_id, unsigned idx, packet_verdict_opt_t* value);
1217
1228WS_DLL_PUBLIC wtap_opttype_return_val
1229wtap_block_get_nth_packet_verdict_option_value(wtap_block_t block, unsigned option_id, unsigned idx, packet_verdict_opt_t* value) G_GNUC_WARN_UNUSED_RESULT;
1230
1231WS_DLL_PUBLIC void
1232wtap_packet_verdict_free(packet_verdict_opt_t* verdict);
1233
1242WS_DLL_PUBLIC wtap_opttype_return_val
1243wtap_block_add_packet_hash_option(wtap_block_t block, unsigned option_id, packet_hash_opt_t* value);
1244
1245WS_DLL_PUBLIC void
1246wtap_packet_hash_free(packet_hash_opt_t* hash);
1247
1255WS_DLL_PUBLIC wtap_opttype_return_val
1256wtap_block_remove_option(wtap_block_t block, unsigned option_id);
1257
1266WS_DLL_PUBLIC wtap_opttype_return_val
1267wtap_block_remove_nth_option_instance(wtap_block_t block, unsigned option_id, unsigned idx);
1268
1277WS_DLL_PUBLIC void
1278wtap_block_copy(wtap_block_t dest_block, wtap_block_t src_block);
1279
1285WS_DLL_PUBLIC wtap_block_t
1287
1288typedef bool (*wtap_block_foreach_func)(wtap_block_t block, unsigned option_id, wtap_opttype_e option_type, wtap_optval_t *option, void *user_data);
1289WS_DLL_PUBLIC bool
1290wtap_block_foreach_option(wtap_block_t block, wtap_block_foreach_func func, void* user_data);
1291
1294WS_DLL_PUBLIC void
1296
1297#ifdef __cplusplus
1298}
1299#endif /* __cplusplus */
1300
1301#endif /* WTAP_OPT_TYPES_H */
Definition wtap_opttypes.h:350
Definition inet_addr.h:21
Definition wtap_opttypes.h:394
char * filter_str
Definition wtap_opttypes.h:397
unsigned bpf_prog_len
Definition wtap_opttypes.h:399
wtap_bpf_insn_t * bpf_prog
Definition wtap_opttypes.h:400
Definition wtap_opttypes.h:369
Definition wtap_opttypes.h:464
Definition wtap_opttypes.h:497
Definition wtap_opttypes.h:425
Definition wtap_opttypes.h:416
Definition wtap_opttypes.c:85
Definition wtap_opttypes.h:379
Definition wtap_opttypes.h:453
wtap_optval_t value
Definition wtap_opttypes.h:455
unsigned option_id
Definition wtap_opttypes.h:454
Definition wtap_opttypes.h:267
uint32_t secrets_len
Definition wtap_opttypes.h:269
uint8_t * secrets_data
Definition wtap_opttypes.h:270
Definition wtap_opttypes.h:304
Definition wtap_opttypes.h:235
GArray * interface_statistics
Definition wtap_opttypes.h:243
int tsprecision
Definition wtap_opttypes.h:238
int wtap_encap
Definition wtap_opttypes.h:236
Definition wtap_opttypes.h:258
Definition wtap_opttypes.h:228
Definition wtap_opttypes.h:276
unsigned mev_data_len
Definition wtap_opttypes.h:278
uint8_t * mev_data
Definition wtap_opttypes.h:279
Definition wtap_opttypes.h:250
Definition wtap_opttypes.h:213
uint64_t section_length
Definition wtap_opttypes.h:214
Definition wtap_opttypes.h:433
WS_DLL_PUBLIC wtap_opttype_return_val wtap_block_set_if_filter_option_value(wtap_block_t block, unsigned option_id, if_filter_opt_t *value)
Definition wtap_opttypes.c:1561
struct wtapng_meta_event_mandatory_s wtapng_meta_event_mandatory_t
WS_DLL_PUBLIC wtap_opttype_return_val wtap_block_get_uint32_option_value(wtap_block_t block, unsigned option_id, uint32_t *value) G_GNUC_WARN_UNUSED_RESULT
Definition wtap_opttypes.c:846
WS_DLL_PUBLIC wtap_opttype_return_val wtap_block_add_custom_option(wtap_block_t block, unsigned option_id, uint32_t pen, const char *custom_data, size_t custom_data_len)
Definition wtap_opttypes.c:1533
WS_DLL_PUBLIC wtap_opttype_return_val wtap_block_set_uint8_option_value(wtap_block_t block, unsigned option_id, uint8_t value)
Definition wtap_opttypes.c:794
WS_DLL_PUBLIC wtap_opttype_return_val wtap_block_add_int64_option(wtap_block_t block, unsigned option_id, int64_t value)
Definition wtap_opttypes.c:976
WS_DLL_PUBLIC wtap_opttype_return_val wtap_block_get_bytes_option_value(wtap_block_t block, unsigned option_id, GBytes **value) G_GNUC_WARN_UNUSED_RESULT
Definition wtap_opttypes.c:1323
WS_DLL_PUBLIC wtap_opttype_return_val wtap_block_get_nth_packet_verdict_option_value(wtap_block_t block, unsigned option_id, unsigned idx, packet_verdict_opt_t *value) G_GNUC_WARN_UNUSED_RESULT
Definition wtap_opttypes.c:1623
WS_DLL_PUBLIC wtap_block_t wtap_block_make_copy(wtap_block_t block)
Definition wtap_opttypes.c:586
struct wtapng_section_mandatory_s wtapng_section_mandatory_t
WS_DLL_PUBLIC wtap_opttype_return_val wtap_block_get_uint8_option_value(wtap_block_t block, unsigned option_id, uint8_t *value) G_GNUC_WARN_UNUSED_RESULT
Definition wtap_opttypes.c:807
WS_DLL_PUBLIC wtap_opttype_return_val wtap_block_set_int32_option_value(wtap_block_t block, unsigned option_id, int32_t value)
Definition wtap_opttypes.c:950
WS_DLL_PUBLIC wtap_opttype_return_val wtap_block_get_int64_option_value(wtap_block_t block, unsigned option_id, int64_t *value) G_GNUC_WARN_UNUSED_RESULT
Definition wtap_opttypes.c:1002
WS_DLL_PUBLIC wtap_opttype_return_val wtap_block_add_string_option(wtap_block_t block, unsigned option_id, const char *value, size_t value_length)
Definition wtap_opttypes.c:1093
WS_DLL_PUBLIC wtap_opttype_return_val wtap_block_add_uint32_option(wtap_block_t block, unsigned option_id, uint32_t value)
Definition wtap_opttypes.c:820
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, unsigned option_id, char **value) G_GNUC_WARN_UNUSED_RESULT
Definition wtap_opttypes.c:1234
WS_DLL_PUBLIC wtap_opttype_return_val wtap_block_add_uint64_option(wtap_block_t block, unsigned option_id, uint64_t value)
Definition wtap_opttypes.c:859
WS_DLL_PUBLIC wtap_opttype_return_val wtap_block_get_ipv6_option_value(wtap_block_t block, unsigned option_id, ws_in6_addr *value) G_GNUC_WARN_UNUSED_RESULT
Definition wtap_opttypes.c:1080
WS_DLL_PUBLIC wtap_opttype_return_val wtap_block_get_if_filter_option_value(wtap_block_t block, unsigned option_id, if_filter_opt_t *value) G_GNUC_WARN_UNUSED_RESULT
Definition wtap_opttypes.c:1579
struct wtapng_if_stats_mandatory_s wtapng_if_stats_mandatory_t
WS_DLL_PUBLIC wtap_opttype_return_val wtap_block_add_string_option_owned(wtap_block_t block, unsigned option_id, char *value)
Definition wtap_opttypes.c:1107
WS_DLL_PUBLIC wtap_opttype_return_val wtap_block_set_nth_string_option_value(wtap_block_t block, unsigned option_id, unsigned idx, const char *value, size_t value_length)
Definition wtap_opttypes.c:1174
WS_DLL_PUBLIC wtap_opttype_return_val wtap_block_add_packet_hash_option(wtap_block_t block, unsigned option_id, packet_hash_opt_t *value)
Definition wtap_opttypes.c:1636
WS_DLL_PUBLIC wtap_opttype_return_val wtap_block_add_string_option_format(wtap_block_t block, unsigned option_id, const char *format,...) G_GNUC_PRINTF(3
WS_DLL_PUBLIC wtap_opttype_return_val wtap_block_set_int64_option_value(wtap_block_t block, unsigned option_id, int64_t value)
Definition wtap_opttypes.c:989
WS_DLL_PUBLIC wtap_opttype_return_val wtap_block_add_int8_option(wtap_block_t block, unsigned option_id, int8_t value)
Definition wtap_opttypes.c:898
WS_DLL_PUBLIC wtap_opttype_return_val wtap_block_add_nflx_custom_option(wtap_block_t block, uint32_t nflx_type, const char *nflx_custom_data, size_t nflx_custom_data_len)
Definition wtap_opttypes.c:1349
WS_DLL_PUBLIC wtap_opttype_return_val wtap_block_get_nth_bytes_option_value(wtap_block_t block, unsigned option_id, unsigned idx, GBytes **value) G_GNUC_WARN_UNUSED_RESULT
Definition wtap_opttypes.c:1336
WS_DLL_PUBLIC wtap_block_t wtap_block_create(wtap_block_type_t block_type)
Definition wtap_opttypes.c:333
struct wtapng_dsb_mandatory_s wtapng_dsb_mandatory_t
struct wtapng_nrb_mandatory_s wtapng_nrb_mandatory_t
WS_DLL_PUBLIC wtap_block_t wtap_block_ref(wtap_block_t block)
Definition wtap_opttypes.c:417
WS_DLL_PUBLIC wtap_opttype_return_val wtap_block_set_string_option_value_format(wtap_block_t block, unsigned option_id, const char *format,...) G_GNUC_PRINTF(3
WS_DLL_PUBLIC wtap_opttype_return_val wtap_block_get_uint64_option_value(wtap_block_t block, unsigned option_id, uint64_t *value) G_GNUC_WARN_UNUSED_RESULT
Definition wtap_opttypes.c:885
WS_DLL_PUBLIC wtap_opttype_return_val wtap_block_remove_nth_option_instance(wtap_block_t block, unsigned option_id, unsigned idx)
Definition wtap_opttypes.c:1691
WS_DLL_PUBLIC wtap_opttype_return_val wtap_block_add_ipv6_option(wtap_block_t block, unsigned option_id, ws_in6_addr *value)
Definition wtap_opttypes.c:1054
WS_DLL_PUBLIC wtap_opttype_return_val wtap_block_add_bytes_option(wtap_block_t block, unsigned option_id, const uint8_t *value, size_t value_length)
Definition wtap_opttypes.c:1260
WS_DLL_PUBLIC wtap_opttype_return_val wtap_block_set_uint32_option_value(wtap_block_t block, unsigned option_id, uint32_t value)
Definition wtap_opttypes.c:833
WS_DLL_PUBLIC wtap_opttype_return_val wtap_block_set_ipv6_option_value(wtap_block_t block, unsigned option_id, ws_in6_addr *value)
Definition wtap_opttypes.c:1067
WS_DLL_PUBLIC void wtap_opttypes_initialize(void)
Definition wtap_opttypes.c:1919
WS_DLL_PUBLIC wtap_opttype_return_val wtap_block_set_ipv4_option_value(wtap_block_t block, unsigned option_id, uint32_t value)
Definition wtap_opttypes.c:1028
WS_DLL_PUBLIC wtap_opttype_return_val wtap_block_add_int32_option(wtap_block_t block, unsigned option_id, int32_t value)
Definition wtap_opttypes.c:937
WS_DLL_PUBLIC wtap_opttype_return_val wtap_block_get_int32_option_value(wtap_block_t block, unsigned option_id, int32_t *value) G_GNUC_WARN_UNUSED_RESULT
Definition wtap_opttypes.c:963
WS_DLL_PUBLIC wtap_opttype_return_val wtap_block_set_nth_packet_verdict_option_value(wtap_block_t block, unsigned option_id, unsigned idx, packet_verdict_opt_t *value)
Definition wtap_opttypes.c:1605
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, unsigned option_id, unsigned idx, const char *format,...) G_GNUC_PRINTF(4
WS_DLL_PUBLIC wtap_opttype_return_val wtap_block_get_int8_option_value(wtap_block_t block, unsigned option_id, int8_t *value) G_GNUC_WARN_UNUSED_RESULT
Definition wtap_opttypes.c:924
struct wtapng_if_descr_mandatory_s wtapng_if_descr_mandatory_t
WS_DLL_PUBLIC void wtap_block_array_ref(GArray *block_array)
Definition wtap_opttypes.c:468
WS_DLL_PUBLIC wtap_opttype_return_val WS_DLL_PUBLIC wtap_opttype_return_val wtap_block_set_string_option_value(wtap_block_t block, unsigned option_id, const char *value, size_t value_length)
Definition wtap_opttypes.c:1151
WS_DLL_PUBLIC wtap_opttype_return_val wtap_block_set_nth_bytes_option_value(wtap_block_t block, unsigned option_id, unsigned idx, GBytes *value)
Definition wtap_opttypes.c:1309
struct wtapng_iface_descriptions_s wtapng_iface_descriptions_t
WS_DLL_PUBLIC void wtap_block_unref(wtap_block_t block)
Definition wtap_opttypes.c:430
WS_DLL_PUBLIC wtap_opttype_return_val wtap_block_add_if_filter_option(wtap_block_t block, unsigned option_id, if_filter_opt_t *value)
Definition wtap_opttypes.c:1548
WS_DLL_PUBLIC wtap_opttype_return_val wtap_block_get_nth_string_option_value(wtap_block_t block, unsigned option_id, unsigned idx, char **value) G_GNUC_WARN_UNUSED_RESULT
Definition wtap_opttypes.c:1247
WS_DLL_PUBLIC wtap_opttype_return_val wtap_block_set_bytes_option_value(wtap_block_t block, unsigned option_id, const uint8_t *value, size_t value_length)
Definition wtap_opttypes.c:1286
WS_DLL_PUBLIC wtap_opttype_return_val wtap_block_add_ipv4_option(wtap_block_t block, unsigned option_id, uint32_t value)
Definition wtap_opttypes.c:1015
WS_DLL_PUBLIC void wtap_opttypes_cleanup(void)
Definition wtap_opttypes.c:2318
WS_DLL_PUBLIC wtap_block_type_t wtap_block_get_type(wtap_block_t block)
Definition wtap_opttypes.c:280
WS_DLL_PUBLIC wtap_opttype_return_val wtap_block_set_int8_option_value(wtap_block_t block, unsigned option_id, int8_t value)
Definition wtap_opttypes.c:911
WS_DLL_PUBLIC void * wtap_block_get_mandatory_data(wtap_block_t block)
Definition wtap_opttypes.c:285
struct wtapng_ft_specific_mandatory_s wtapng_ft_specific_mandatory_t
WS_DLL_PUBLIC wtap_opttype_return_val wtap_block_add_uint8_option(wtap_block_t block, unsigned option_id, uint8_t value)
Definition wtap_opttypes.c:781
WS_DLL_PUBLIC void wtap_block_copy(wtap_block_t dest_block, wtap_block_t src_block)
Definition wtap_opttypes.c:498
WS_DLL_PUBLIC void wtap_block_array_free(GArray *block_array)
Definition wtap_opttypes.c:455
WS_DLL_PUBLIC void wtap_block_array_unref(GArray *block_array)
Definition wtap_opttypes.c:481
WS_DLL_PUBLIC wtap_opttype_return_val wtap_block_add_bytes_option_borrow(wtap_block_t block, unsigned option_id, GBytes *value)
Definition wtap_opttypes.c:1273
WS_DLL_PUBLIC wtap_opttype_return_val wtap_block_remove_option(wtap_block_t block, unsigned option_id)
Definition wtap_opttypes.c:1649
WS_DLL_PUBLIC wtap_opttype_return_val wtap_block_set_uint64_option_value(wtap_block_t block, unsigned option_id, uint64_t value)
Definition wtap_opttypes.c:872
WS_DLL_PUBLIC wtap_opttype_return_val wtap_block_add_packet_verdict_option(wtap_block_t block, unsigned option_id, packet_verdict_opt_t *value)
Definition wtap_opttypes.c:1592
WS_DLL_PUBLIC unsigned wtap_block_count_option(wtap_block_t block, unsigned option_id)
Definition wtap_opttypes.c:596
WS_DLL_PUBLIC wtap_opttype_return_val wtap_block_get_nflx_custom_option(wtap_block_t block, uint32_t nflx_type, char *nflx_custom_data, size_t nflx_custom_data_len)
WS_DLL_PUBLIC wtap_opttype_return_val wtap_block_get_ipv4_option_value(wtap_block_t block, unsigned option_id, uint32_t *value) G_GNUC_WARN_UNUSED_RESULT
Definition wtap_opttypes.c:1041