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
123/*
124 * These are the flags for an EPB, but we use them for all WTAP_BLOCK_PACKET
125 */
126#define OPT_PKT_FLAGS 2
127#define OPT_PKT_HASH 3
128#define OPT_PKT_DROPCOUNT 4
129#define OPT_PKT_PACKETID 5
130#define OPT_PKT_QUEUE 6
131#define OPT_PKT_VERDICT 7
132
133/* Name Resolution Block (NRB) */
134#define OPT_NS_DNSNAME 2
135#define OPT_NS_DNSIP4ADDR 3
136#define OPT_NS_DNSIP6ADDR 4
137
138/* Interface Statistics Block (ISB) */
139#define OPT_ISB_STARTTIME 2
140#define OPT_ISB_ENDTIME 3
141#define OPT_ISB_IFRECV 4
142#define OPT_ISB_IFDROP 5
143#define OPT_ISB_FILTERACCEPT 6
144#define OPT_ISB_OSDROP 7
145#define OPT_ISB_USRDELIV 8
146
147struct wtap_block;
148typedef struct wtap_block *wtap_block_t;
149
150/*
151 * Currently supported blocks; these are not the pcapng block type values
152 * for them, they're identifiers used internally, and more than one
153 * pcapng block type may use a given block type.
154 *
155 * Note that, in a given file format, this information won't necessarily
156 * appear in the form of blocks in the file, even though they're presented
157 * to the caller of libwiretap as blocks when reading and are presented
158 * by the caller of libwiretap as blocks when writing. See, for example,
159 * the iptrace file format, in which the interface name is given as part
160 * of the packet record header; we synthesize those blocks when reading
161 * (we don't currently support writing that format, but if we did, we'd
162 * get the interface name from the block and put it in the packet record
163 * header).
164 *
165 * WTAP_BLOCK_IF_ID_AND_INFO is a block that not only gives
166 * descriptive information about an interface but *also* assigns an
167 * ID to the interface, so that every packet has either an explicit
168 * or implicit interface ID indicating on which the packet arrived.
169 *
170 * It does *not* refer to information about interfaces that does not
171 * allow identification of the interface on which a packet arrives
172 * (I'm looking at *you*, Microsoft Network Monitor...). Do *not*
173 * indicate support for that block if your capture format merely
174 * gives a list of interface information without having every packet
175 * explicitly or implicitly (as in, for example, the pcapng Simple
176 * Packet Block) indicate on which of those interfaces the packet
177 * arrived.
178 *
179 * WTAP_BLOCK_PACKET (which corresponds to the Enhanced Packet Block,
180 * the Simple Packet Block, and the deprecated Packet Block) is not
181 * currently used; it's reserved for future use. The same applies
182 * to WTAP_BLOCK_SYSTEMD_JOURNAL_EXPORT.
183 */
184typedef enum {
185 WTAP_BLOCK_SECTION = 0,
186 WTAP_BLOCK_IF_ID_AND_INFO,
187 WTAP_BLOCK_NAME_RESOLUTION,
188 WTAP_BLOCK_IF_STATISTICS,
189 WTAP_BLOCK_DECRYPTION_SECRETS,
190 WTAP_BLOCK_PACKET,
191 WTAP_BLOCK_FT_SPECIFIC_REPORT,
192 WTAP_BLOCK_FT_SPECIFIC_EVENT,
193 WTAP_BLOCK_SYSDIG_EVENT,
194 WTAP_BLOCK_META_EVENT,
195 WTAP_BLOCK_SYSTEMD_JOURNAL_EXPORT,
196 WTAP_BLOCK_CUSTOM,
197 MAX_WTAP_BLOCK_TYPE_VALUE
198} wtap_block_type_t;
199
213
219 GArray *interface_data;
221
227 uint64_t time_units_per_second;
230 uint32_t snap_len;
231
232 uint8_t num_stat_entries;
236
241 GList *ipv4_addr_list;
242 GList *ipv6_addr_list;
244
249 uint32_t interface_id;
250 uint32_t ts_high;
251 uint32_t ts_low;
253
258 uint32_t secrets_type;
259 uint32_t secrets_len;
260 uint8_t *secrets_data;
262
267 uint32_t mev_block_type;
268 unsigned mev_data_len;
269 uint8_t *mev_data;
271
278#if 0
279/* Commented out for now, there's no mandatory data that isn't handled by
280 * Wireshark in other ways.
281 */
282typedef struct wtapng_packet_mandatory_s {
283 uint32_t interface_id;
284 uint32_t ts_high;
285 uint32_t ts_low;
286 uint32_t captured_len;
287 uint32_t orig_len;
288} wtapng_packet_mandatory_t;
289#endif
290
295 unsigned record_type; /* the type of record this is - file type-specific value */
297
298/*
299 * Currently supported option types. These are not option types
300 * in the sense that each one corresponds to a particular option,
301 * they are data types for the data of an option, so, for example,
302 * all options with a 32-bit unsigned integer value have the type
303 * WTAP_OPTTYPE_UINT32.
304 */
305typedef enum {
306 WTAP_OPTTYPE_UINT8,
307 WTAP_OPTTYPE_UINT32,
308 WTAP_OPTTYPE_UINT64,
309 WTAP_OPTTYPE_STRING,
310 WTAP_OPTTYPE_BYTES,
311 WTAP_OPTTYPE_IPv4,
312 WTAP_OPTTYPE_IPv6,
313 WTAP_OPTTYPE_CUSTOM,
314 WTAP_OPTTYPE_IF_FILTER,
315 WTAP_OPTTYPE_PACKET_VERDICT,
316 WTAP_OPTTYPE_PACKET_HASH,
317 WTAP_OPTTYPE_INT8,
318 WTAP_OPTTYPE_INT32,
319 WTAP_OPTTYPE_INT64,
320} wtap_opttype_e;
321
322typedef enum {
323 WTAP_OPTTYPE_SUCCESS = 0,
324 WTAP_OPTTYPE_NO_SUCH_OPTION = -1,
325 WTAP_OPTTYPE_NOT_FOUND = -2,
326 WTAP_OPTTYPE_TYPE_MISMATCH = -3,
327 WTAP_OPTTYPE_NUMBER_MISMATCH = -4,
328 WTAP_OPTTYPE_ALREADY_EXISTS = -5,
329 WTAP_OPTTYPE_BAD_BLOCK = -6,
330} wtap_opttype_return_val;
331
332/* https://www.iana.org/assignments/enterprise-numbers/enterprise-numbers */
333#define PEN_NFLX 10949
334#define PEN_VCTR 46254
335
336/*
337 * Structure describing a custom option.
338 */
339
340typedef struct custom_opt_s {
341 uint32_t pen;
342 union {
343 struct generic_custom_opt_data {
344 size_t custom_data_len;
345 char *custom_data;
346 } generic_data;
347 struct nflx_custom_opt_data {
348 uint32_t type;
349 size_t custom_data_len;
350 char *custom_data;
351 bool use_little_endian;
352 } nflx_data;
353 } data;
355
356/*
357 * Structure describing a NFLX custom option.
358 */
359typedef struct nflx_custom_opt_s {
360 bool nflx_use_little_endian;
361 uint32_t nflx_type;
362 size_t nflx_custom_data_len;
363 char *nflx_custom_data;
365
366/* Interface description data - if_filter option structure */
367
368/* BPF instruction */
369typedef struct wtap_bpf_insn_s {
370 uint16_t code;
371 uint8_t jt;
372 uint8_t jf;
373 uint32_t k;
375
376/*
377 * Type of filter.
378 */
379typedef enum {
380 if_filter_pcap = 0, /* pcap filter string */
381 if_filter_bpf = 1 /* BPF program */
382} if_filter_type_e;
383
384typedef struct if_filter_opt_s {
385 if_filter_type_e type;
386 union {
388 struct wtap_bpf_insns {
389 unsigned bpf_prog_len;
392 } data;
394
395/* Packet - packet_verdict option structure */
396
397/*
398 * Type of verdict.
399 */
400typedef enum {
401 packet_verdict_hardware = 0, /* array of octets */
402 packet_verdict_linux_ebpf_tc = 1, /* 64-bit unsigned integer TC_ACT_ value */
403 packet_verdict_linux_ebpf_xdp = 2 /* 64-bit unsigned integer xdp_action value */
404} packet_verdict_type_e;
405
406typedef struct packet_verdict_opt_s {
407 packet_verdict_type_e type;
408 union {
409 GByteArray *verdict_bytes;
410 uint64_t verdict_linux_ebpf_tc;
411 uint64_t verdict_linux_ebpf_xdp;
412 } data;
414
415typedef struct packet_hash_opt_s {
416 uint8_t type;
417 GByteArray *hash_bytes;
419
420/*
421 * Structure describing a value of an option.
422 */
423typedef union {
424 uint8_t uint8val;
425 uint32_t uint32val;
426 uint64_t uint64val;
427 int8_t int8val;
428 int32_t int32val;
429 int64_t int64val;
430 ws_in4_addr ipv4val; /* network byte order */
431 ws_in6_addr ipv6val;
432 char *stringval;
433 GBytes *byteval;
434 custom_opt_t custom_opt;
435 if_filter_opt_t if_filterval;
436 packet_verdict_opt_t packet_verdictval;
437 packet_hash_opt_t packet_hash;
439
440/*
441 * Structure describing an option in a block.
442 */
443typedef struct {
444 unsigned option_id;
447
448#define NFLX_OPT_TYPE_VERSION 1
449#define NFLX_OPT_TYPE_TCPINFO 2
450#define NFLX_OPT_TYPE_DUMPINFO 4
451#define NFLX_OPT_TYPE_DUMPTIME 5
452#define NFLX_OPT_TYPE_STACKNAME 6
453
455 uint32_t tlh_version;
456 uint32_t tlh_type;
457 uint64_t tlh_length;
458 uint16_t tlh_ie_fport;
459 uint16_t tlh_ie_lport;
460 uint32_t tlh_ie_faddr_addr32[4];
461 uint32_t tlh_ie_laddr_addr32[4];
462 uint32_t tlh_ie_zoneid;
463 uint64_t tlh_offset_tv_sec;
464 uint64_t tlh_offset_tv_usec;
465 char tlh_id[64];
466 char tlh_reason[32];
467 char tlh_tag[32];
468 uint8_t tlh_af;
469 uint8_t _pad[7];
470};
471
472/* Flags used in tlb_eventflags */
473#define NFLX_TLB_FLAG_RXBUF 0x0001 /* Includes receive buffer info */
474#define NFLX_TLB_FLAG_TXBUF 0x0002 /* Includes send buffer info */
475#define NFLX_TLB_FLAG_HDR 0x0004 /* Includes a TCP header */
476#define NFLX_TLB_FLAG_VERBOSE 0x0008 /* Includes function/line numbers */
477#define NFLX_TLB_FLAG_STACKINFO 0x0010 /* Includes stack-specific info */
478
479/* Flags used in tlb_flags */
480#define NFLX_TLB_TF_REQ_SCALE 0x00000020 /* Sent WS option */
481#define NFLX_TLB_TF_RCVD_SCALE 0x00000040 /* Received WS option */
482
483/* Values of tlb_state */
484#define NFLX_TLB_TCPS_ESTABLISHED 4
485#define NFLX_TLB_IS_SYNCHRONIZED(state) (state >= NFLX_TLB_TCPS_ESTABLISHED)
486
488 uint64_t tlb_tv_sec;
489 uint64_t tlb_tv_usec;
490 uint32_t tlb_ticks;
491 uint32_t tlb_sn;
492 uint8_t tlb_stackid;
493 uint8_t tlb_eventid;
494 uint16_t tlb_eventflags;
495 int32_t tlb_errno;
496 uint32_t tlb_rxbuf_tls_sb_acc;
497 uint32_t tlb_rxbuf_tls_sb_ccc;
498 uint32_t tlb_rxbuf_tls_sb_spare;
499 uint32_t tlb_txbuf_tls_sb_acc;
500 uint32_t tlb_txbuf_tls_sb_ccc;
501 uint32_t tlb_txbuf_tls_sb_spare;
502 int32_t tlb_state;
503 uint32_t tlb_starttime;
504 uint32_t tlb_iss;
505 uint32_t tlb_flags;
506 uint32_t tlb_snd_una;
507 uint32_t tlb_snd_max;
508 uint32_t tlb_snd_cwnd;
509 uint32_t tlb_snd_nxt;
510 uint32_t tlb_snd_recover;
511 uint32_t tlb_snd_wnd;
512 uint32_t tlb_snd_ssthresh;
513 uint32_t tlb_srtt;
514 uint32_t tlb_rttvar;
515 uint32_t tlb_rcv_up;
516 uint32_t tlb_rcv_adv;
517 uint32_t tlb_flags2;
518 uint32_t tlb_rcv_nxt;
519 uint32_t tlb_rcv_wnd;
520 uint32_t tlb_dupacks;
521 int32_t tlb_segqlen;
522 int32_t tlb_snd_numholes;
523 uint32_t tlb_flex1;
524 uint32_t tlb_flex2;
525 uint32_t tlb_fbyte_in;
526 uint32_t tlb_fbyte_out;
527 uint8_t tlb_snd_scale:4,
528 tlb_rcv_scale:4;
529 uint8_t _pad[3];
530
531 /* The following fields might become part of a union */
532 uint64_t tlb_stackinfo_bbr_cur_del_rate;
533 uint64_t tlb_stackinfo_bbr_delRate;
534 uint64_t tlb_stackinfo_bbr_rttProp;
535 uint64_t tlb_stackinfo_bbr_bw_inuse;
536 uint32_t tlb_stackinfo_bbr_inflight;
537 uint32_t tlb_stackinfo_bbr_applimited;
538 uint32_t tlb_stackinfo_bbr_delivered;
539 uint32_t tlb_stackinfo_bbr_timeStamp;
540 uint32_t tlb_stackinfo_bbr_epoch;
541 uint32_t tlb_stackinfo_bbr_lt_epoch;
542 uint32_t tlb_stackinfo_bbr_pkts_out;
543 uint32_t tlb_stackinfo_bbr_flex1;
544 uint32_t tlb_stackinfo_bbr_flex2;
545 uint32_t tlb_stackinfo_bbr_flex3;
546 uint32_t tlb_stackinfo_bbr_flex4;
547 uint32_t tlb_stackinfo_bbr_flex5;
548 uint32_t tlb_stackinfo_bbr_flex6;
549 uint32_t tlb_stackinfo_bbr_lost;
550 uint16_t tlb_stackinfo_bbr_pacing_gain;
551 uint16_t tlb_stackinfo_bbr_cwnd_gain;
552 uint16_t tlb_stackinfo_bbr_flex7;
553 uint8_t tlb_stackinfo_bbr_bbr_state;
554 uint8_t tlb_stackinfo_bbr_bbr_substate;
555 uint8_t tlb_stackinfo_bbr_inhpts;
556 uint8_t tlb_stackinfo_bbr_ininput;
557 uint8_t tlb_stackinfo_bbr_use_lt_bw;
558 uint8_t tlb_stackinfo_bbr_flex8;
559 uint32_t tlb_stackinfo_bbr_pkt_epoch;
560
561 uint32_t tlb_len;
562};
563
564typedef void (*wtap_block_create_func)(wtap_block_t block);
565typedef void (*wtap_mand_free_func)(wtap_block_t block);
566typedef void (*wtap_mand_copy_func)(wtap_block_t dest_block, wtap_block_t src_block);
567
574WS_DLL_PUBLIC void
576
584WS_DLL_PUBLIC wtap_block_t
585wtap_block_create(wtap_block_type_t block_type);
586
594WS_DLL_PUBLIC wtap_block_t
596
603WS_DLL_PUBLIC void
605
614WS_DLL_PUBLIC void
615wtap_block_array_free(GArray* block_array);
616
627WS_DLL_PUBLIC void
628wtap_block_array_unref(GArray* block_array);
629
637WS_DLL_PUBLIC void
638wtap_block_array_ref(GArray* block_array);
639
645WS_DLL_PUBLIC wtap_block_type_t
647
653WS_DLL_PUBLIC void*
655
662WS_DLL_PUBLIC unsigned
663wtap_block_count_option(wtap_block_t block, unsigned option_id);
664
673WS_DLL_PUBLIC wtap_opttype_return_val
674wtap_block_add_uint8_option(wtap_block_t block, unsigned option_id, uint8_t value);
675
684WS_DLL_PUBLIC wtap_opttype_return_val
685wtap_block_set_uint8_option_value(wtap_block_t block, unsigned option_id, uint8_t value);
686
695WS_DLL_PUBLIC wtap_opttype_return_val
696wtap_block_get_uint8_option_value(wtap_block_t block, unsigned option_id, uint8_t* value) G_GNUC_WARN_UNUSED_RESULT;
697
706WS_DLL_PUBLIC wtap_opttype_return_val
707wtap_block_add_uint32_option(wtap_block_t block, unsigned option_id, uint32_t value);
708
717WS_DLL_PUBLIC wtap_opttype_return_val
718wtap_block_set_uint32_option_value(wtap_block_t block, unsigned option_id, uint32_t value);
719
728WS_DLL_PUBLIC wtap_opttype_return_val
729wtap_block_get_uint32_option_value(wtap_block_t block, unsigned option_id, uint32_t* value) G_GNUC_WARN_UNUSED_RESULT;
730
739WS_DLL_PUBLIC wtap_opttype_return_val
740wtap_block_add_uint64_option(wtap_block_t block, unsigned option_id, uint64_t value);
741
750WS_DLL_PUBLIC wtap_opttype_return_val
751wtap_block_set_uint64_option_value(wtap_block_t block, unsigned option_id, uint64_t value);
752
761WS_DLL_PUBLIC wtap_opttype_return_val
762wtap_block_get_uint64_option_value(wtap_block_t block, unsigned option_id, uint64_t* value) G_GNUC_WARN_UNUSED_RESULT;
763
772WS_DLL_PUBLIC wtap_opttype_return_val
773wtap_block_add_int8_option(wtap_block_t block, unsigned option_id, int8_t value);
774
783WS_DLL_PUBLIC wtap_opttype_return_val
784wtap_block_set_int8_option_value(wtap_block_t block, unsigned option_id, int8_t value);
785
794WS_DLL_PUBLIC wtap_opttype_return_val
795wtap_block_get_int8_option_value(wtap_block_t block, unsigned option_id, int8_t* value) G_GNUC_WARN_UNUSED_RESULT;
796
805WS_DLL_PUBLIC wtap_opttype_return_val
806wtap_block_add_int32_option(wtap_block_t block, unsigned option_id, int32_t value);
807
816WS_DLL_PUBLIC wtap_opttype_return_val
817wtap_block_set_int32_option_value(wtap_block_t block, unsigned option_id, int32_t value);
818
827WS_DLL_PUBLIC wtap_opttype_return_val
828wtap_block_get_int32_option_value(wtap_block_t block, unsigned option_id, int32_t* value) G_GNUC_WARN_UNUSED_RESULT;
829
838WS_DLL_PUBLIC wtap_opttype_return_val
839wtap_block_add_int64_option(wtap_block_t block, unsigned option_id, int64_t value);
840
849WS_DLL_PUBLIC wtap_opttype_return_val
850wtap_block_set_int64_option_value(wtap_block_t block, unsigned option_id, int64_t value);
851
860WS_DLL_PUBLIC wtap_opttype_return_val
861wtap_block_get_int64_option_value(wtap_block_t block, unsigned option_id, int64_t* value) G_GNUC_WARN_UNUSED_RESULT;
862
871WS_DLL_PUBLIC wtap_opttype_return_val
872wtap_block_add_ipv4_option(wtap_block_t block, unsigned option_id, uint32_t value);
873
882WS_DLL_PUBLIC wtap_opttype_return_val
883wtap_block_set_ipv4_option_value(wtap_block_t block, unsigned option_id, uint32_t value);
884
893WS_DLL_PUBLIC wtap_opttype_return_val
894wtap_block_get_ipv4_option_value(wtap_block_t block, unsigned option_id, uint32_t* value) G_GNUC_WARN_UNUSED_RESULT;
895
904WS_DLL_PUBLIC wtap_opttype_return_val
905wtap_block_add_ipv6_option(wtap_block_t block, unsigned option_id, ws_in6_addr *value);
906
915WS_DLL_PUBLIC wtap_opttype_return_val
916wtap_block_set_ipv6_option_value(wtap_block_t block, unsigned option_id, ws_in6_addr *value);
917
926WS_DLL_PUBLIC wtap_opttype_return_val
927wtap_block_get_ipv6_option_value(wtap_block_t block, unsigned option_id, ws_in6_addr* value) G_GNUC_WARN_UNUSED_RESULT;
928
938WS_DLL_PUBLIC wtap_opttype_return_val
939wtap_block_add_string_option(wtap_block_t block, unsigned option_id, const char *value, size_t value_length);
940
949WS_DLL_PUBLIC wtap_opttype_return_val
950wtap_block_add_string_option_owned(wtap_block_t block, unsigned option_id, char *value);
951
960WS_DLL_PUBLIC wtap_opttype_return_val
961wtap_block_add_string_option_format(wtap_block_t block, unsigned option_id, const char *format, ...)
962 G_GNUC_PRINTF(3,4);
963
973WS_DLL_PUBLIC wtap_opttype_return_val
974wtap_block_set_string_option_value(wtap_block_t block, unsigned option_id, const char* value, size_t value_length);
975
987WS_DLL_PUBLIC wtap_opttype_return_val
988wtap_block_set_nth_string_option_value(wtap_block_t block, unsigned option_id, unsigned idx, const char* value, size_t value_length);
989
998WS_DLL_PUBLIC wtap_opttype_return_val
999wtap_block_set_string_option_value_format(wtap_block_t block, unsigned option_id, const char *format, ...)
1000 G_GNUC_PRINTF(3,4);
1001
1012WS_DLL_PUBLIC wtap_opttype_return_val
1013wtap_block_set_nth_string_option_value_format(wtap_block_t block, unsigned option_id, unsigned idx, const char *format, ...)
1014 G_GNUC_PRINTF(4,5);
1015
1024WS_DLL_PUBLIC wtap_opttype_return_val
1025wtap_block_get_string_option_value(wtap_block_t block, unsigned option_id, char** value) G_GNUC_WARN_UNUSED_RESULT;
1026
1037WS_DLL_PUBLIC wtap_opttype_return_val
1038wtap_block_get_nth_string_option_value(wtap_block_t block, unsigned option_id, unsigned idx, char** value) G_GNUC_WARN_UNUSED_RESULT;
1039
1049WS_DLL_PUBLIC wtap_opttype_return_val
1050wtap_block_add_bytes_option(wtap_block_t block, unsigned option_id, const uint8_t *value, size_t value_length);
1051
1060WS_DLL_PUBLIC wtap_opttype_return_val
1061wtap_block_add_bytes_option_borrow(wtap_block_t block, unsigned option_id, GBytes *value);
1062
1072WS_DLL_PUBLIC wtap_opttype_return_val
1073wtap_block_set_bytes_option_value(wtap_block_t block, unsigned option_id, const uint8_t* value, size_t value_length);
1074
1084WS_DLL_PUBLIC wtap_opttype_return_val
1085wtap_block_set_nth_bytes_option_value(wtap_block_t block, unsigned option_id, unsigned idx, GBytes* value);
1086
1097WS_DLL_PUBLIC wtap_opttype_return_val
1098wtap_block_get_bytes_option_value(wtap_block_t block, unsigned option_id, GBytes** value) G_GNUC_WARN_UNUSED_RESULT;
1099
1111WS_DLL_PUBLIC wtap_opttype_return_val
1112wtap_block_get_nth_bytes_option_value(wtap_block_t block, unsigned option_id, unsigned idx, GBytes** value) G_GNUC_WARN_UNUSED_RESULT;
1113
1123WS_DLL_PUBLIC wtap_opttype_return_val
1124wtap_block_add_nflx_custom_option(wtap_block_t block, uint32_t nflx_type, const char *nflx_custom_data, size_t nflx_custom_data_len);
1125
1135WS_DLL_PUBLIC wtap_opttype_return_val
1136wtap_block_get_nflx_custom_option(wtap_block_t block, uint32_t nflx_type, char *nflx_custom_data, size_t nflx_custom_data_len);
1137
1148WS_DLL_PUBLIC wtap_opttype_return_val
1149wtap_block_add_custom_option(wtap_block_t block, unsigned option_id, uint32_t pen, const char *custom_data, size_t custom_data_len);
1150
1159WS_DLL_PUBLIC wtap_opttype_return_val
1160wtap_block_add_if_filter_option(wtap_block_t block, unsigned option_id, if_filter_opt_t* value);
1161
1170WS_DLL_PUBLIC wtap_opttype_return_val
1171wtap_block_set_if_filter_option_value(wtap_block_t block, unsigned option_id, if_filter_opt_t* value);
1172
1181WS_DLL_PUBLIC wtap_opttype_return_val
1182wtap_block_get_if_filter_option_value(wtap_block_t block, unsigned option_id, if_filter_opt_t* value) G_GNUC_WARN_UNUSED_RESULT;
1183
1192WS_DLL_PUBLIC wtap_opttype_return_val
1194
1205WS_DLL_PUBLIC wtap_opttype_return_val
1206wtap_block_set_nth_packet_verdict_option_value(wtap_block_t block, unsigned option_id, unsigned idx, packet_verdict_opt_t* value);
1207
1218WS_DLL_PUBLIC wtap_opttype_return_val
1219wtap_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;
1220
1221WS_DLL_PUBLIC void
1222wtap_packet_verdict_free(packet_verdict_opt_t* verdict);
1223
1232WS_DLL_PUBLIC wtap_opttype_return_val
1233wtap_block_add_packet_hash_option(wtap_block_t block, unsigned option_id, packet_hash_opt_t* value);
1234
1235WS_DLL_PUBLIC void
1236wtap_packet_hash_free(packet_hash_opt_t* hash);
1237
1245WS_DLL_PUBLIC wtap_opttype_return_val
1246wtap_block_remove_option(wtap_block_t block, unsigned option_id);
1247
1256WS_DLL_PUBLIC wtap_opttype_return_val
1257wtap_block_remove_nth_option_instance(wtap_block_t block, unsigned option_id, unsigned idx);
1258
1267WS_DLL_PUBLIC void
1268wtap_block_copy(wtap_block_t dest_block, wtap_block_t src_block);
1269
1275WS_DLL_PUBLIC wtap_block_t
1277
1278typedef bool (*wtap_block_foreach_func)(wtap_block_t block, unsigned option_id, wtap_opttype_e option_type, wtap_optval_t *option, void *user_data);
1279WS_DLL_PUBLIC bool
1280wtap_block_foreach_option(wtap_block_t block, wtap_block_foreach_func func, void* user_data);
1281
1284WS_DLL_PUBLIC void
1286
1287#ifdef __cplusplus
1288}
1289#endif /* __cplusplus */
1290
1291#endif /* WTAP_OPT_TYPES_H */
Definition wtap_opttypes.h:340
Definition inet_addr.h:21
Definition wtap_opttypes.h:384
char * filter_str
Definition wtap_opttypes.h:387
unsigned bpf_prog_len
Definition wtap_opttypes.h:389
wtap_bpf_insn_t * bpf_prog
Definition wtap_opttypes.h:390
Definition wtap_opttypes.h:359
Definition wtap_opttypes.h:454
Definition wtap_opttypes.h:487
Definition wtap_opttypes.h:415
Definition wtap_opttypes.h:406
Definition wtap_opttypes.c:85
Definition wtap_opttypes.h:369
Definition wtap_opttypes.h:443
wtap_optval_t value
Definition wtap_opttypes.h:445
unsigned option_id
Definition wtap_opttypes.h:444
Definition wtap_opttypes.h:257
uint32_t secrets_len
Definition wtap_opttypes.h:259
uint8_t * secrets_data
Definition wtap_opttypes.h:260
Definition wtap_opttypes.h:294
Definition wtap_opttypes.h:225
GArray * interface_statistics
Definition wtap_opttypes.h:233
int tsprecision
Definition wtap_opttypes.h:228
int wtap_encap
Definition wtap_opttypes.h:226
Definition wtap_opttypes.h:248
Definition wtap_opttypes.h:218
Definition wtap_opttypes.h:266
unsigned mev_data_len
Definition wtap_opttypes.h:268
uint8_t * mev_data
Definition wtap_opttypes.h:269
Definition wtap_opttypes.h:240
Definition wtap_opttypes.h:203
uint64_t section_length
Definition wtap_opttypes.h:204
Definition wtap_opttypes.h:423
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:1913
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:2264
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