Wireshark 4.5.0
The Wireshark network protocol analyzer
Loading...
Searching...
No Matches
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_STRING,
324 WTAP_OPTTYPE_CUSTOM_BINARY,
325 WTAP_OPTTYPE_IF_FILTER,
326 WTAP_OPTTYPE_PACKET_VERDICT,
327 WTAP_OPTTYPE_PACKET_HASH,
328 WTAP_OPTTYPE_INT8,
329 WTAP_OPTTYPE_INT32,
330 WTAP_OPTTYPE_INT64,
331} wtap_opttype_e;
332
333typedef enum {
334 WTAP_OPTTYPE_SUCCESS = 0,
335 WTAP_OPTTYPE_NO_SUCH_OPTION = -1,
336 WTAP_OPTTYPE_NOT_FOUND = -2,
337 WTAP_OPTTYPE_TYPE_MISMATCH = -3,
338 WTAP_OPTTYPE_NUMBER_MISMATCH = -4,
339 WTAP_OPTTYPE_ALREADY_EXISTS = -5,
340 WTAP_OPTTYPE_BAD_BLOCK = -6,
341 WTAP_OPTTYPE_PEN_MISMATCH = -7,
342} wtap_opttype_return_val;
343
344/* https://www.iana.org/assignments/enterprise-numbers/enterprise-numbers */
345#define PEN_NFLX 10949
346#define PEN_VCTR 46254
347
348/*
349 * Structure giving the value of a custom string option; the value
350 * includes both the Private Enterprise Number and the data following it.
351 */
352typedef struct custom_string_opt_s {
353 uint32_t pen; /* Private Enterprise Number of this option */
354 char* string;
356
357/*
358 * Structure giving the data of a custom binary option.
359 */
360typedef struct binary_optdata {
361 size_t custom_data_len;
362 void* custom_data;
364
365/*
366 * Structure giving the value of a custom binary option; the value
367 * includes both the Private Enterprise Number and the data following it.
368 */
369typedef struct custom_binary_opt_s {
370 uint32_t pen; /* Private Enterprise Number of this option */
371 union {
372 binary_optdata_t generic_data;
373 struct nflx_custom_opt_data {
374 uint32_t type;
375 size_t custom_data_len;
376 char *custom_data;
377 } nflx_data;
378 } data;
380
381/* Interface description data - if_filter option structure */
382
383/* BPF instruction */
384typedef struct wtap_bpf_insn_s {
385 uint16_t code;
386 uint8_t jt;
387 uint8_t jf;
388 uint32_t k;
390
391/*
392 * Type of filter.
393 */
394typedef enum {
395 if_filter_pcap = 0, /* pcap filter string */
396 if_filter_bpf = 1 /* BPF program */
397} if_filter_type_e;
398
399typedef struct if_filter_opt_s {
400 if_filter_type_e type;
401 union {
403 struct wtap_bpf_insns {
404 unsigned bpf_prog_len;
407 } data;
409
410/* Packet - packet_verdict option structure */
411
412/*
413 * Type of verdict.
414 */
415typedef enum {
416 packet_verdict_hardware = 0, /* array of octets */
417 packet_verdict_linux_ebpf_tc = 1, /* 64-bit unsigned integer TC_ACT_ value */
418 packet_verdict_linux_ebpf_xdp = 2 /* 64-bit unsigned integer xdp_action value */
419} packet_verdict_type_e;
420
421typedef struct packet_verdict_opt_s {
422 packet_verdict_type_e type;
423 union {
424 GByteArray *verdict_bytes;
425 uint64_t verdict_linux_ebpf_tc;
426 uint64_t verdict_linux_ebpf_xdp;
427 } data;
429
430typedef struct packet_hash_opt_s {
431 uint8_t type;
432 GByteArray *hash_bytes;
434
435/*
436 * Structure describing a value of an option.
437 */
438typedef union {
439 uint8_t uint8val;
440 uint32_t uint32val;
441 uint64_t uint64val;
442 int8_t int8val;
443 int32_t int32val;
444 int64_t int64val;
445 ws_in4_addr ipv4val; /* network byte order */
446 ws_in6_addr ipv6val;
447 char *stringval;
448 GBytes *byteval;
449 custom_string_opt_t custom_stringval;
450 custom_binary_opt_t custom_binaryval;
451 if_filter_opt_t if_filterval;
452 packet_verdict_opt_t packet_verdictval;
453 packet_hash_opt_t packet_hash;
455
456/*
457 * Structure describing an option in a block.
458 */
459typedef struct {
460 unsigned option_id;
463
464#define NFLX_OPT_TYPE_VERSION 1
465#define NFLX_OPT_TYPE_TCPINFO 2
466#define NFLX_OPT_TYPE_DUMPINFO 4
467#define NFLX_OPT_TYPE_DUMPTIME 5
468#define NFLX_OPT_TYPE_STACKNAME 6
469
471 uint32_t tlh_version;
472 uint32_t tlh_type;
473 uint64_t tlh_length;
474 uint16_t tlh_ie_fport;
475 uint16_t tlh_ie_lport;
476 uint32_t tlh_ie_faddr_addr32[4];
477 uint32_t tlh_ie_laddr_addr32[4];
478 uint32_t tlh_ie_zoneid;
479 uint64_t tlh_offset_tv_sec;
480 uint64_t tlh_offset_tv_usec;
481 char tlh_id[64];
482 char tlh_reason[32];
483 char tlh_tag[32];
484 uint8_t tlh_af;
485 uint8_t _pad[7];
486};
487
488/* Flags used in tlb_eventflags */
489#define NFLX_TLB_FLAG_RXBUF 0x0001 /* Includes receive buffer info */
490#define NFLX_TLB_FLAG_TXBUF 0x0002 /* Includes send buffer info */
491#define NFLX_TLB_FLAG_HDR 0x0004 /* Includes a TCP header */
492#define NFLX_TLB_FLAG_VERBOSE 0x0008 /* Includes function/line numbers */
493#define NFLX_TLB_FLAG_STACKINFO 0x0010 /* Includes stack-specific info */
494
495/* Flags used in tlb_flags */
496#define NFLX_TLB_TF_REQ_SCALE 0x00000020 /* Sent WS option */
497#define NFLX_TLB_TF_RCVD_SCALE 0x00000040 /* Received WS option */
498
499/* Values of tlb_state */
500#define NFLX_TLB_TCPS_ESTABLISHED 4
501#define NFLX_TLB_IS_SYNCHRONIZED(state) (state >= NFLX_TLB_TCPS_ESTABLISHED)
502
504 uint64_t tlb_tv_sec;
505 uint64_t tlb_tv_usec;
506 uint32_t tlb_ticks;
507 uint32_t tlb_sn;
508 uint8_t tlb_stackid;
509 uint8_t tlb_eventid;
510 uint16_t tlb_eventflags;
511 int32_t tlb_errno;
512 uint32_t tlb_rxbuf_tls_sb_acc;
513 uint32_t tlb_rxbuf_tls_sb_ccc;
514 uint32_t tlb_rxbuf_tls_sb_spare;
515 uint32_t tlb_txbuf_tls_sb_acc;
516 uint32_t tlb_txbuf_tls_sb_ccc;
517 uint32_t tlb_txbuf_tls_sb_spare;
518 int32_t tlb_state;
519 uint32_t tlb_starttime;
520 uint32_t tlb_iss;
521 uint32_t tlb_flags;
522 uint32_t tlb_snd_una;
523 uint32_t tlb_snd_max;
524 uint32_t tlb_snd_cwnd;
525 uint32_t tlb_snd_nxt;
526 uint32_t tlb_snd_recover;
527 uint32_t tlb_snd_wnd;
528 uint32_t tlb_snd_ssthresh;
529 uint32_t tlb_srtt;
530 uint32_t tlb_rttvar;
531 uint32_t tlb_rcv_up;
532 uint32_t tlb_rcv_adv;
533 uint32_t tlb_flags2;
534 uint32_t tlb_rcv_nxt;
535 uint32_t tlb_rcv_wnd;
536 uint32_t tlb_dupacks;
537 int32_t tlb_segqlen;
538 int32_t tlb_snd_numholes;
539 uint32_t tlb_flex1;
540 uint32_t tlb_flex2;
541 uint32_t tlb_fbyte_in;
542 uint32_t tlb_fbyte_out;
543 uint8_t tlb_snd_scale:4,
544 tlb_rcv_scale:4;
545 uint8_t _pad[3];
546
547 /* The following fields might become part of a union */
548 uint64_t tlb_stackinfo_bbr_cur_del_rate;
549 uint64_t tlb_stackinfo_bbr_delRate;
550 uint64_t tlb_stackinfo_bbr_rttProp;
551 uint64_t tlb_stackinfo_bbr_bw_inuse;
552 uint32_t tlb_stackinfo_bbr_inflight;
553 uint32_t tlb_stackinfo_bbr_applimited;
554 uint32_t tlb_stackinfo_bbr_delivered;
555 uint32_t tlb_stackinfo_bbr_timeStamp;
556 uint32_t tlb_stackinfo_bbr_epoch;
557 uint32_t tlb_stackinfo_bbr_lt_epoch;
558 uint32_t tlb_stackinfo_bbr_pkts_out;
559 uint32_t tlb_stackinfo_bbr_flex1;
560 uint32_t tlb_stackinfo_bbr_flex2;
561 uint32_t tlb_stackinfo_bbr_flex3;
562 uint32_t tlb_stackinfo_bbr_flex4;
563 uint32_t tlb_stackinfo_bbr_flex5;
564 uint32_t tlb_stackinfo_bbr_flex6;
565 uint32_t tlb_stackinfo_bbr_lost;
566 uint16_t tlb_stackinfo_bbr_pacing_gain;
567 uint16_t tlb_stackinfo_bbr_cwnd_gain;
568 uint16_t tlb_stackinfo_bbr_flex7;
569 uint8_t tlb_stackinfo_bbr_bbr_state;
570 uint8_t tlb_stackinfo_bbr_bbr_substate;
571 uint8_t tlb_stackinfo_bbr_inhpts;
572 uint8_t tlb_stackinfo_bbr_ininput;
573 uint8_t tlb_stackinfo_bbr_use_lt_bw;
574 uint8_t tlb_stackinfo_bbr_flex8;
575 uint32_t tlb_stackinfo_bbr_pkt_epoch;
576
577 uint32_t tlb_len;
578};
579
580typedef void (*wtap_block_create_func)(wtap_block_t block);
581typedef void (*wtap_mand_free_func)(wtap_block_t block);
582typedef void (*wtap_mand_copy_func)(wtap_block_t dest_block, wtap_block_t src_block);
583
590WS_DLL_PUBLIC void
592
600WS_DLL_PUBLIC wtap_block_t
601wtap_block_create(wtap_block_type_t block_type);
602
610WS_DLL_PUBLIC wtap_block_t
612
619WS_DLL_PUBLIC void
621
630WS_DLL_PUBLIC void
631wtap_block_array_free(GArray* block_array);
632
643WS_DLL_PUBLIC void
644wtap_block_array_unref(GArray* block_array);
645
653WS_DLL_PUBLIC void
654wtap_block_array_ref(GArray* block_array);
655
661WS_DLL_PUBLIC wtap_block_type_t
663
669WS_DLL_PUBLIC void*
671
678WS_DLL_PUBLIC unsigned
679wtap_block_count_option(wtap_block_t block, unsigned option_id);
680
689WS_DLL_PUBLIC wtap_opttype_return_val
690wtap_block_add_uint8_option(wtap_block_t block, unsigned option_id, uint8_t value);
691
700WS_DLL_PUBLIC wtap_opttype_return_val
701wtap_block_set_uint8_option_value(wtap_block_t block, unsigned option_id, uint8_t value);
702
711WS_DLL_PUBLIC wtap_opttype_return_val
712wtap_block_get_uint8_option_value(wtap_block_t block, unsigned option_id, uint8_t* value) G_GNUC_WARN_UNUSED_RESULT;
713
722WS_DLL_PUBLIC wtap_opttype_return_val
723wtap_block_add_uint32_option(wtap_block_t block, unsigned option_id, uint32_t value);
724
733WS_DLL_PUBLIC wtap_opttype_return_val
734wtap_block_set_uint32_option_value(wtap_block_t block, unsigned option_id, uint32_t value);
735
744WS_DLL_PUBLIC wtap_opttype_return_val
745wtap_block_get_uint32_option_value(wtap_block_t block, unsigned option_id, uint32_t* value) G_GNUC_WARN_UNUSED_RESULT;
746
755WS_DLL_PUBLIC wtap_opttype_return_val
756wtap_block_add_uint64_option(wtap_block_t block, unsigned option_id, uint64_t value);
757
766WS_DLL_PUBLIC wtap_opttype_return_val
767wtap_block_set_uint64_option_value(wtap_block_t block, unsigned option_id, uint64_t value);
768
777WS_DLL_PUBLIC wtap_opttype_return_val
778wtap_block_get_uint64_option_value(wtap_block_t block, unsigned option_id, uint64_t* value) G_GNUC_WARN_UNUSED_RESULT;
779
788WS_DLL_PUBLIC wtap_opttype_return_val
789wtap_block_add_int8_option(wtap_block_t block, unsigned option_id, int8_t value);
790
799WS_DLL_PUBLIC wtap_opttype_return_val
800wtap_block_set_int8_option_value(wtap_block_t block, unsigned option_id, int8_t value);
801
810WS_DLL_PUBLIC wtap_opttype_return_val
811wtap_block_get_int8_option_value(wtap_block_t block, unsigned option_id, int8_t* value) G_GNUC_WARN_UNUSED_RESULT;
812
821WS_DLL_PUBLIC wtap_opttype_return_val
822wtap_block_add_int32_option(wtap_block_t block, unsigned option_id, int32_t value);
823
832WS_DLL_PUBLIC wtap_opttype_return_val
833wtap_block_set_int32_option_value(wtap_block_t block, unsigned option_id, int32_t value);
834
843WS_DLL_PUBLIC wtap_opttype_return_val
844wtap_block_get_int32_option_value(wtap_block_t block, unsigned option_id, int32_t* value) G_GNUC_WARN_UNUSED_RESULT;
845
854WS_DLL_PUBLIC wtap_opttype_return_val
855wtap_block_add_int64_option(wtap_block_t block, unsigned option_id, int64_t value);
856
865WS_DLL_PUBLIC wtap_opttype_return_val
866wtap_block_set_int64_option_value(wtap_block_t block, unsigned option_id, int64_t value);
867
876WS_DLL_PUBLIC wtap_opttype_return_val
877wtap_block_get_int64_option_value(wtap_block_t block, unsigned option_id, int64_t* value) G_GNUC_WARN_UNUSED_RESULT;
878
887WS_DLL_PUBLIC wtap_opttype_return_val
888wtap_block_add_ipv4_option(wtap_block_t block, unsigned option_id, uint32_t value);
889
898WS_DLL_PUBLIC wtap_opttype_return_val
899wtap_block_set_ipv4_option_value(wtap_block_t block, unsigned option_id, uint32_t value);
900
909WS_DLL_PUBLIC wtap_opttype_return_val
910wtap_block_get_ipv4_option_value(wtap_block_t block, unsigned option_id, uint32_t* value) G_GNUC_WARN_UNUSED_RESULT;
911
920WS_DLL_PUBLIC wtap_opttype_return_val
921wtap_block_add_ipv6_option(wtap_block_t block, unsigned option_id, ws_in6_addr *value);
922
931WS_DLL_PUBLIC wtap_opttype_return_val
932wtap_block_set_ipv6_option_value(wtap_block_t block, unsigned option_id, ws_in6_addr *value);
933
942WS_DLL_PUBLIC wtap_opttype_return_val
943wtap_block_get_ipv6_option_value(wtap_block_t block, unsigned option_id, ws_in6_addr* value) G_GNUC_WARN_UNUSED_RESULT;
944
954WS_DLL_PUBLIC wtap_opttype_return_val
955wtap_block_add_string_option(wtap_block_t block, unsigned option_id, const char *value, size_t value_length);
956
965WS_DLL_PUBLIC wtap_opttype_return_val
966wtap_block_add_string_option_owned(wtap_block_t block, unsigned option_id, char *value);
967
976WS_DLL_PUBLIC wtap_opttype_return_val
977wtap_block_add_string_option_format(wtap_block_t block, unsigned option_id, const char *format, ...)
978 G_GNUC_PRINTF(3,4);
979
989WS_DLL_PUBLIC wtap_opttype_return_val
990wtap_block_set_string_option_value(wtap_block_t block, unsigned option_id, const char* value, size_t value_length);
991
1003WS_DLL_PUBLIC wtap_opttype_return_val
1004wtap_block_set_nth_string_option_value(wtap_block_t block, unsigned option_id, unsigned idx, const char* value, size_t value_length);
1005
1014WS_DLL_PUBLIC wtap_opttype_return_val
1015wtap_block_set_string_option_value_format(wtap_block_t block, unsigned option_id, const char *format, ...)
1016 G_GNUC_PRINTF(3,4);
1017
1028WS_DLL_PUBLIC wtap_opttype_return_val
1029wtap_block_set_nth_string_option_value_format(wtap_block_t block, unsigned option_id, unsigned idx, const char *format, ...)
1030 G_GNUC_PRINTF(4,5);
1031
1040WS_DLL_PUBLIC wtap_opttype_return_val
1041wtap_block_get_string_option_value(wtap_block_t block, unsigned option_id, char** value) G_GNUC_WARN_UNUSED_RESULT;
1042
1053WS_DLL_PUBLIC wtap_opttype_return_val
1054wtap_block_get_nth_string_option_value(wtap_block_t block, unsigned option_id, unsigned idx, char** value) G_GNUC_WARN_UNUSED_RESULT;
1055
1065WS_DLL_PUBLIC wtap_opttype_return_val
1066wtap_block_add_bytes_option(wtap_block_t block, unsigned option_id, const uint8_t *value, size_t value_length);
1067
1076WS_DLL_PUBLIC wtap_opttype_return_val
1077wtap_block_add_bytes_option_borrow(wtap_block_t block, unsigned option_id, GBytes *value);
1078
1088WS_DLL_PUBLIC wtap_opttype_return_val
1089wtap_block_set_bytes_option_value(wtap_block_t block, unsigned option_id, const uint8_t* value, size_t value_length);
1090
1100WS_DLL_PUBLIC wtap_opttype_return_val
1101wtap_block_set_nth_bytes_option_value(wtap_block_t block, unsigned option_id, unsigned idx, GBytes* value);
1102
1113WS_DLL_PUBLIC wtap_opttype_return_val
1114wtap_block_get_bytes_option_value(wtap_block_t block, unsigned option_id, GBytes** value) G_GNUC_WARN_UNUSED_RESULT;
1115
1127WS_DLL_PUBLIC wtap_opttype_return_val
1128wtap_block_get_nth_bytes_option_value(wtap_block_t block, unsigned option_id, unsigned idx, GBytes** value) G_GNUC_WARN_UNUSED_RESULT;
1129
1141WS_DLL_PUBLIC wtap_opttype_return_val
1142wtap_block_add_custom_string_option(wtap_block_t block, unsigned option_id, uint32_t pen, const char *value, size_t value_length);
1143
1154WS_DLL_PUBLIC wtap_opttype_return_val
1155wtap_block_add_custom_binary_option(wtap_block_t block, unsigned option_id, uint32_t pen, binary_optdata_t *value);
1156
1168WS_DLL_PUBLIC wtap_opttype_return_val
1169wtap_block_add_custom_binary_option_from_data(wtap_block_t block, unsigned option_id, uint32_t pen, const void *data, size_t data_size);
1170
1182WS_DLL_PUBLIC wtap_opttype_return_val
1183wtap_block_get_nth_custom_binary_option_value(wtap_block_t block, unsigned option_id, uint32_t pen, unsigned idx, binary_optdata_t *value);
1184
1194WS_DLL_PUBLIC wtap_opttype_return_val
1195wtap_block_add_nflx_custom_option(wtap_block_t block, uint32_t nflx_type, const char *nflx_custom_data, size_t nflx_custom_data_len);
1196
1206WS_DLL_PUBLIC wtap_opttype_return_val
1207wtap_block_get_nflx_custom_option(wtap_block_t block, uint32_t nflx_type, char *nflx_custom_data, size_t nflx_custom_data_len);
1208
1217WS_DLL_PUBLIC wtap_opttype_return_val
1218wtap_block_add_if_filter_option(wtap_block_t block, unsigned option_id, if_filter_opt_t* value);
1219
1228WS_DLL_PUBLIC wtap_opttype_return_val
1229wtap_block_set_if_filter_option_value(wtap_block_t block, unsigned option_id, if_filter_opt_t* value);
1230
1239WS_DLL_PUBLIC wtap_opttype_return_val
1240wtap_block_get_if_filter_option_value(wtap_block_t block, unsigned option_id, if_filter_opt_t* value) G_GNUC_WARN_UNUSED_RESULT;
1241
1250WS_DLL_PUBLIC wtap_opttype_return_val
1252
1263WS_DLL_PUBLIC wtap_opttype_return_val
1264wtap_block_set_nth_packet_verdict_option_value(wtap_block_t block, unsigned option_id, unsigned idx, packet_verdict_opt_t* value);
1265
1276WS_DLL_PUBLIC wtap_opttype_return_val
1277wtap_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;
1278
1279WS_DLL_PUBLIC void
1280wtap_packet_verdict_free(packet_verdict_opt_t* verdict);
1281
1290WS_DLL_PUBLIC wtap_opttype_return_val
1291wtap_block_add_packet_hash_option(wtap_block_t block, unsigned option_id, packet_hash_opt_t* value);
1292
1293WS_DLL_PUBLIC void
1294wtap_packet_hash_free(packet_hash_opt_t* hash);
1295
1303WS_DLL_PUBLIC wtap_opttype_return_val
1304wtap_block_remove_option(wtap_block_t block, unsigned option_id);
1305
1314WS_DLL_PUBLIC wtap_opttype_return_val
1315wtap_block_remove_nth_option_instance(wtap_block_t block, unsigned option_id, unsigned idx);
1316
1325WS_DLL_PUBLIC void
1326wtap_block_copy(wtap_block_t dest_block, wtap_block_t src_block);
1327
1333WS_DLL_PUBLIC wtap_block_t
1335
1336typedef bool (*wtap_block_foreach_func)(wtap_block_t block, unsigned option_id, wtap_opttype_e option_type, wtap_optval_t *option, void *user_data);
1337WS_DLL_PUBLIC bool
1338wtap_block_foreach_option(wtap_block_t block, wtap_block_foreach_func func, void* user_data);
1339
1342WS_DLL_PUBLIC void
1344
1345#ifdef __cplusplus
1346}
1347#endif /* __cplusplus */
1348
1349#endif /* WTAP_OPT_TYPES_H */
Definition wtap_opttypes.h:360
Definition wtap_opttypes.h:369
Definition wtap_opttypes.h:352
Definition inet_addr.h:21
Definition wtap_opttypes.h:399
char * filter_str
Definition wtap_opttypes.h:402
unsigned bpf_prog_len
Definition wtap_opttypes.h:404
wtap_bpf_insn_t * bpf_prog
Definition wtap_opttypes.h:405
Definition wtap_opttypes.h:470
Definition wtap_opttypes.h:503
Definition wtap_opttypes.h:430
Definition wtap_opttypes.h:421
Definition wtap_opttypes.c:85
Definition wtap_opttypes.h:384
Definition wtap_opttypes.h:459
wtap_optval_t value
Definition wtap_opttypes.h:461
unsigned option_id
Definition wtap_opttypes.h:460
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:438
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:1793
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:884
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:832
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:1014
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:1361
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:1855
WS_DLL_PUBLIC wtap_block_t wtap_block_make_copy(wtap_block_t block)
Definition wtap_opttypes.c:624
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:845
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:988
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:1040
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:1131
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:858
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:1272
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:897
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:1118
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:1811
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:1145
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:1212
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:1868
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:1027
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:936
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:1598
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:1374
WS_DLL_PUBLIC wtap_block_t wtap_block_create(wtap_block_type_t block_type)
Definition wtap_opttypes.c:355
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:443
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:923
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:1923
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:1092
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:1298
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:871
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:1105
WS_DLL_PUBLIC wtap_opttype_return_val wtap_block_add_custom_binary_option_from_data(wtap_block_t block, unsigned option_id, uint32_t pen, const void *data, size_t data_size)
Definition wtap_opttypes.c:1561
WS_DLL_PUBLIC wtap_opttype_return_val wtap_block_add_custom_binary_option(wtap_block_t block, unsigned option_id, uint32_t pen, binary_optdata_t *value)
Definition wtap_opttypes.c:1546
WS_DLL_PUBLIC void wtap_opttypes_initialize(void)
Definition wtap_opttypes.c:2151
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:1066
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:975
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:1001
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:1837
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:962
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:494
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:1189
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:1347
struct wtapng_iface_descriptions_s wtapng_iface_descriptions_t
WS_DLL_PUBLIC void wtap_block_unref(wtap_block_t block)
Definition wtap_opttypes.c:456
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:1780
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:1285
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:1324
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:1053
WS_DLL_PUBLIC void wtap_opttypes_cleanup(void)
Definition wtap_opttypes.c:2550
WS_DLL_PUBLIC wtap_block_type_t wtap_block_get_type(wtap_block_t block)
Definition wtap_opttypes.c:299
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:949
WS_DLL_PUBLIC void * wtap_block_get_mandatory_data(wtap_block_t block)
Definition wtap_opttypes.c:304
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:819
WS_DLL_PUBLIC void wtap_block_copy(wtap_block_t dest_block, wtap_block_t src_block)
Definition wtap_opttypes.c:524
WS_DLL_PUBLIC void wtap_block_array_free(GArray *block_array)
Definition wtap_opttypes.c:481
WS_DLL_PUBLIC void wtap_block_array_unref(GArray *block_array)
Definition wtap_opttypes.c:507
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:1311
WS_DLL_PUBLIC wtap_opttype_return_val wtap_block_remove_option(wtap_block_t block, unsigned option_id)
Definition wtap_opttypes.c:1881
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:910
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:1824
WS_DLL_PUBLIC wtap_opttype_return_val wtap_block_get_nth_custom_binary_option_value(wtap_block_t block, unsigned option_id, uint32_t pen, unsigned idx, binary_optdata_t *value)
Definition wtap_opttypes.c:1579
WS_DLL_PUBLIC unsigned wtap_block_count_option(wtap_block_t block, unsigned option_id)
Definition wtap_opttypes.c:634
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:1079
WS_DLL_PUBLIC wtap_opttype_return_val wtap_block_add_custom_string_option(wtap_block_t block, unsigned option_id, uint32_t pen, const char *value, size_t value_length)
Definition wtap_opttypes.c:1513