Wireshark 4.7.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
157/* Darwin Process Info Block (DPIB) */
158#define OPT_DPIB_NAME 2
159#define OPT_DPIB_UUID 4
161/* Darwin-specific options for EPB */
162#define OPT_PKT_DARWIN_PIB_ID 32769
163#define OPT_PKT_DARWIN_SVC_CODE 32770
164#define OPT_PKT_DARWIN_EFFECTIVE_PIB_ID 32771
165#define OPT_PKT_DARWIN_MD_FLAGS 32772
166#define OPT_PKT_DARWIN_FLOW_ID 32773
167#define OPT_PKT_DARWIN_TRACE_TAG 32774
168#define OPT_PKT_DARWIN_DROP_REASON 32775
169#define OPT_PKT_DARWIN_DROP_LINE 32776
170#define OPT_PKT_DARWIN_DROP_FUNC 32777
171#define OPT_PKT_DARWIN_COMP_GENCNT 32778
250
251struct wtap_block;
252typedef struct wtap_block* wtap_block_t;
253
254typedef void (*wtap_block_create_func)(wtap_block_t block);
255typedef void (*wtap_mand_free_func)(wtap_block_t block);
256typedef void (*wtap_mand_copy_func)(wtap_block_t dest_block, wtap_block_t src_block);
257
258/*
259 * Structure describing a type of block.
260 */
261typedef struct wtap_blocktype_t {
263 const char* name;
264 const char* description;
265 wtap_block_create_func create;
266 wtap_mand_free_func free_mand;
267 wtap_mand_copy_func copy_mand;
268 GHashTable* options;
270
272{
273 struct wtap_blocktype_t* info;
274 void* mandatory_data;
275 GArray* options;
276 int ref_count;
277#ifdef DEBUG_COUNT_REFS
278 unsigned id;
279#endif
280};
281
295
301 GArray *interface_data;
303
309 GArray *dpibs;
311
317 uint64_t time_units_per_second;
320 uint32_t snap_len;
321
322 uint8_t num_stat_entries;
326
331 GList *ipv4_addr_list;
332 GList *ipv6_addr_list;
334
339 uint32_t interface_id;
340 uint32_t ts_high;
341 uint32_t ts_low;
343
348 uint32_t secrets_type;
349 uint32_t secrets_len;
350 uint8_t *secrets_data;
352
357 uint32_t mev_block_type;
358 unsigned mev_data_len;
359 uint8_t *mev_data;
361
368#if 0
369/* Commented out for now, there's no mandatory data that isn't handled by
370 * Wireshark in other ways.
371 */
372typedef struct wtapng_packet_mandatory_s {
373 uint32_t interface_id;
374 uint32_t ts_high;
375 uint32_t ts_low;
376 uint32_t captured_len;
377 uint32_t orig_len;
378} wtapng_packet_mandatory_t;
379#endif
380
387
392 unsigned record_type; /* the type of record this is - file type-specific value */
394
419
433
434/* https://www.iana.org/assignments/enterprise-numbers/enterprise-numbers */
435#define PEN_VCTR 46254
436
437/*
438 * Structure giving the value of a custom string option; the value
439 * includes both the Private Enterprise Number and the data following it.
440 */
441typedef struct custom_string_opt_s {
442 uint32_t pen; /* Private Enterprise Number of this option */
443 char* string;
445
446/*
447 * Structure giving the data of a custom binary option.
448 */
449typedef struct binary_optdata {
450 size_t custom_data_len;
451 void* custom_data;
453
454/*
455 * Structure giving the value of a custom binary option; the value
456 * includes both the Private Enterprise Number and the data following it.
457 */
458typedef struct custom_binary_opt_s {
459 uint32_t pen; /* Private Enterprise Number of this option */
460 binary_optdata_t data;
462
463/* Interface description data - if_filter option structure */
464
471typedef struct wtap_bpf_insn_s {
472 uint16_t code;
473 uint8_t jt;
474 uint8_t jf;
475 uint32_t k;
477
478
484typedef enum {
485 if_filter_pcap = 0, /* pcap filter string */
486 if_filter_bpf = 1 /* BPF program */
488
489typedef struct if_filter_opt_s {
490 if_filter_type_e type;
491 union {
493 struct wtap_bpf_insns {
494 unsigned bpf_prog_len;
497 } data;
499
500/* Packet - packet_verdict option structure */
501
510
511
523
524
528typedef struct packet_hash_opt_s {
529 uint8_t type;
530 GByteArray *hash_bytes;
532
533
557
558/*
559 * Structure describing an option in a block.
560 */
561typedef struct {
562 unsigned option_id;
565
566typedef void (*wtap_block_create_func)(wtap_block_t block);
567typedef void (*wtap_mand_free_func)(wtap_block_t block);
568typedef void (*wtap_mand_copy_func)(wtap_block_t dest_block, wtap_block_t src_block);
569
570/*
571 * Structure describing a type of option.
572 */
573typedef struct {
574 const char* name;
575 const char* description;
577 unsigned flags;
579
580#define GET_OPTION_TYPE(options, option_id) \
581 (const wtap_opttype_t *)g_hash_table_lookup((options), GUINT_TO_POINTER(option_id))
582
590WS_DLL_PUBLIC void
592
601WS_DLL_PUBLIC wtap_block_t
603
612WS_DLL_PUBLIC wtap_block_t
614
622WS_DLL_PUBLIC void
624
634WS_DLL_PUBLIC void
635wtap_block_array_free(GArray* block_array);
636
648WS_DLL_PUBLIC void
649wtap_block_array_unref(GArray* block_array);
650
659WS_DLL_PUBLIC void
660wtap_block_array_ref(GArray* block_array);
661
667WS_DLL_PUBLIC void
669
676WS_DLL_PUBLIC wtap_block_type_t
678
685WS_DLL_PUBLIC void*
687
695WS_DLL_PUBLIC unsigned
696wtap_block_count_option(wtap_block_t block, unsigned option_id);
697
707WS_DLL_PUBLIC wtap_opttype_return_val
708wtap_block_add_uint8_option(wtap_block_t block, unsigned option_id, uint8_t value);
709
719WS_DLL_PUBLIC wtap_opttype_return_val
720wtap_block_set_uint8_option_value(wtap_block_t block, unsigned option_id, uint8_t value);
721
731WS_DLL_PUBLIC wtap_opttype_return_val
732wtap_block_get_uint8_option_value(wtap_block_t block, unsigned option_id, uint8_t* value) G_GNUC_WARN_UNUSED_RESULT;
733
743WS_DLL_PUBLIC wtap_opttype_return_val
744wtap_block_add_uint32_option(wtap_block_t block, unsigned option_id, uint32_t value);
745
755WS_DLL_PUBLIC wtap_opttype_return_val
756wtap_block_set_uint32_option_value(wtap_block_t block, unsigned option_id, uint32_t value);
757
767WS_DLL_PUBLIC wtap_opttype_return_val
768wtap_block_get_uint32_option_value(wtap_block_t block, unsigned option_id, uint32_t* value) G_GNUC_WARN_UNUSED_RESULT;
769
779WS_DLL_PUBLIC wtap_opttype_return_val
780wtap_block_add_uint64_option(wtap_block_t block, unsigned option_id, uint64_t value);
781
791WS_DLL_PUBLIC wtap_opttype_return_val
792wtap_block_set_uint64_option_value(wtap_block_t block, unsigned option_id, uint64_t value);
793
803WS_DLL_PUBLIC wtap_opttype_return_val
804wtap_block_get_uint64_option_value(wtap_block_t block, unsigned option_id, uint64_t* value) G_GNUC_WARN_UNUSED_RESULT;
805
815WS_DLL_PUBLIC wtap_opttype_return_val
816wtap_block_add_int8_option(wtap_block_t block, unsigned option_id, int8_t value);
817
827WS_DLL_PUBLIC wtap_opttype_return_val
828wtap_block_set_int8_option_value(wtap_block_t block, unsigned option_id, int8_t value);
829
839WS_DLL_PUBLIC wtap_opttype_return_val
840wtap_block_get_int8_option_value(wtap_block_t block, unsigned option_id, int8_t* value) G_GNUC_WARN_UNUSED_RESULT;
841
851WS_DLL_PUBLIC wtap_opttype_return_val
852wtap_block_add_int32_option(wtap_block_t block, unsigned option_id, int32_t value);
853
863WS_DLL_PUBLIC wtap_opttype_return_val
864wtap_block_set_int32_option_value(wtap_block_t block, unsigned option_id, int32_t value);
865
875WS_DLL_PUBLIC wtap_opttype_return_val
876wtap_block_get_int32_option_value(wtap_block_t block, unsigned option_id, int32_t* value) G_GNUC_WARN_UNUSED_RESULT;
877
887WS_DLL_PUBLIC wtap_opttype_return_val
888wtap_block_add_int64_option(wtap_block_t block, unsigned option_id, int64_t value);
889
899WS_DLL_PUBLIC wtap_opttype_return_val
900wtap_block_set_int64_option_value(wtap_block_t block, unsigned option_id, int64_t value);
901
911WS_DLL_PUBLIC wtap_opttype_return_val
912wtap_block_get_int64_option_value(wtap_block_t block, unsigned option_id, int64_t* value) G_GNUC_WARN_UNUSED_RESULT;
913
923WS_DLL_PUBLIC wtap_opttype_return_val
924wtap_block_add_ipv4_option(wtap_block_t block, unsigned option_id, uint32_t value);
925
935WS_DLL_PUBLIC wtap_opttype_return_val
936wtap_block_set_ipv4_option_value(wtap_block_t block, unsigned option_id, uint32_t value);
937
947WS_DLL_PUBLIC wtap_opttype_return_val
948wtap_block_get_ipv4_option_value(wtap_block_t block, unsigned option_id, uint32_t* value) G_GNUC_WARN_UNUSED_RESULT;
949
959WS_DLL_PUBLIC wtap_opttype_return_val
960wtap_block_add_ipv6_option(wtap_block_t block, unsigned option_id, ws_in6_addr *value);
961
971WS_DLL_PUBLIC wtap_opttype_return_val
972wtap_block_set_ipv6_option_value(wtap_block_t block, unsigned option_id, ws_in6_addr *value);
973
983WS_DLL_PUBLIC wtap_opttype_return_val
984wtap_block_get_ipv6_option_value(wtap_block_t block, unsigned option_id, ws_in6_addr* value) G_GNUC_WARN_UNUSED_RESULT;
985
996WS_DLL_PUBLIC wtap_opttype_return_val
997wtap_block_add_string_option(wtap_block_t block, unsigned option_id, const char *value, size_t value_length);
998
1009WS_DLL_PUBLIC wtap_opttype_return_val
1010wtap_block_add_string_option_owned(wtap_block_t block, unsigned option_id, char *value) G_GNUC_WARN_UNUSED_RESULT;
1011
1021WS_DLL_PUBLIC wtap_opttype_return_val
1022wtap_block_add_string_option_format(wtap_block_t block, unsigned option_id, const char *format, ...)
1023 G_GNUC_PRINTF(3,4);
1024
1035WS_DLL_PUBLIC wtap_opttype_return_val
1036wtap_block_set_string_option_value(wtap_block_t block, unsigned option_id, const char* value, size_t value_length);
1037
1050WS_DLL_PUBLIC wtap_opttype_return_val
1051wtap_block_set_nth_string_option_value(wtap_block_t block, unsigned option_id, unsigned idx, const char* value, size_t value_length);
1052
1062WS_DLL_PUBLIC wtap_opttype_return_val
1063wtap_block_set_string_option_value_format(wtap_block_t block, unsigned option_id, const char *format, ...)
1064 G_GNUC_PRINTF(3,4);
1065
1077WS_DLL_PUBLIC wtap_opttype_return_val
1078wtap_block_set_nth_string_option_value_format(wtap_block_t block, unsigned option_id, unsigned idx, const char *format, ...)
1079 G_GNUC_PRINTF(4,5);
1080
1090WS_DLL_PUBLIC wtap_opttype_return_val
1091wtap_block_get_string_option_value(wtap_block_t block, unsigned option_id, char** value) G_GNUC_WARN_UNUSED_RESULT;
1092
1104WS_DLL_PUBLIC wtap_opttype_return_val
1105wtap_block_get_nth_string_option_value(wtap_block_t block, unsigned option_id, unsigned idx, char** value) G_GNUC_WARN_UNUSED_RESULT;
1106
1117WS_DLL_PUBLIC wtap_opttype_return_val
1118wtap_block_add_bytes_option(wtap_block_t block, unsigned option_id, const uint8_t *value, size_t value_length);
1119
1129WS_DLL_PUBLIC wtap_opttype_return_val
1130wtap_block_add_bytes_option_borrow(wtap_block_t block, unsigned option_id, GBytes *value);
1131
1142WS_DLL_PUBLIC wtap_opttype_return_val
1143wtap_block_set_bytes_option_value(wtap_block_t block, unsigned option_id, const uint8_t* value, size_t value_length);
1144
1155WS_DLL_PUBLIC wtap_opttype_return_val
1156wtap_block_set_nth_bytes_option_value(wtap_block_t block, unsigned option_id, unsigned idx, GBytes* value);
1157
1169WS_DLL_PUBLIC wtap_opttype_return_val
1170wtap_block_get_bytes_option_value(wtap_block_t block, unsigned option_id, GBytes** value) G_GNUC_WARN_UNUSED_RESULT;
1171
1184WS_DLL_PUBLIC wtap_opttype_return_val
1185wtap_block_get_nth_bytes_option_value(wtap_block_t block, unsigned option_id, unsigned idx, GBytes** value) G_GNUC_WARN_UNUSED_RESULT;
1186
1199WS_DLL_PUBLIC wtap_opttype_return_val
1200wtap_block_add_custom_string_option(wtap_block_t block, unsigned option_id, uint32_t pen, const char *value, size_t value_length);
1201
1213WS_DLL_PUBLIC wtap_opttype_return_val
1214wtap_block_add_custom_binary_option(wtap_block_t block, unsigned option_id, uint32_t pen, binary_optdata_t *value);
1215
1228WS_DLL_PUBLIC wtap_opttype_return_val
1229wtap_block_add_custom_binary_option_from_data(wtap_block_t block, unsigned option_id, uint32_t pen, const void *data, size_t data_size);
1230
1243WS_DLL_PUBLIC wtap_opttype_return_val
1244wtap_block_get_nth_custom_binary_option_value(wtap_block_t block, unsigned option_id, uint32_t pen, unsigned idx, binary_optdata_t *value);
1245
1255WS_DLL_PUBLIC wtap_opttype_return_val
1256wtap_block_add_if_filter_option(wtap_block_t block, unsigned option_id, if_filter_opt_t* value);
1257
1267WS_DLL_PUBLIC wtap_opttype_return_val
1268wtap_block_set_if_filter_option_value(wtap_block_t block, unsigned option_id, if_filter_opt_t* value);
1269
1279WS_DLL_PUBLIC wtap_opttype_return_val
1280wtap_block_get_if_filter_option_value(wtap_block_t block, unsigned option_id, if_filter_opt_t* value) G_GNUC_WARN_UNUSED_RESULT;
1281
1291WS_DLL_PUBLIC wtap_opttype_return_val
1293
1305WS_DLL_PUBLIC wtap_opttype_return_val
1306wtap_block_set_nth_packet_verdict_option_value(wtap_block_t block, unsigned option_id, unsigned idx, packet_verdict_opt_t* value);
1307
1319WS_DLL_PUBLIC wtap_opttype_return_val
1320wtap_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;
1321
1327WS_DLL_PUBLIC void
1329
1339WS_DLL_PUBLIC wtap_opttype_return_val
1340wtap_block_add_packet_hash_option(wtap_block_t block, unsigned option_id, packet_hash_opt_t* value);
1341
1347WS_DLL_PUBLIC void
1349
1358WS_DLL_PUBLIC wtap_opttype_return_val
1359wtap_block_remove_option(wtap_block_t block, unsigned option_id);
1360
1370WS_DLL_PUBLIC wtap_opttype_return_val
1371wtap_block_remove_nth_option_instance(wtap_block_t block, unsigned option_id, unsigned idx);
1372
1382WS_DLL_PUBLIC void
1383wtap_block_copy(wtap_block_t dest_block, wtap_block_t src_block);
1384
1391WS_DLL_PUBLIC wtap_block_t
1393
1407typedef bool (*wtap_block_foreach_func)(wtap_block_t block, unsigned option_id,
1408 wtap_opttype_e option_type, wtap_optval_t *option,
1409 void *user_data);
1410
1421WS_DLL_PUBLIC bool
1423
1427WS_DLL_PUBLIC void
1429
1430#ifdef __cplusplus
1431}
1432#endif /* __cplusplus */
1433
1434#endif /* WTAP_OPT_TYPES_H */
uint32_t ws_in4_addr
Represents a 32-bit IPv4 address in network byte order.
Definition inet_addr.h:22
Definition wtap_opttypes.h:449
Definition wtap_opttypes.h:458
Definition wtap_opttypes.h:441
Represents a 128-bit IPv6 address.
Definition inet_addr.h:27
Definition wtap_opttypes.h:489
char * filter_str
Definition wtap_opttypes.h:492
unsigned bpf_prog_len
Definition wtap_opttypes.h:494
wtap_bpf_insn_t * bpf_prog
Definition wtap_opttypes.h:495
Definition file-pcapng.h:57
Packet hash option value, carrying a typed digest of the packet contents.
Definition wtap_opttypes.h:528
GByteArray * hash_bytes
Definition wtap_opttypes.h:530
uint8_t type
Definition wtap_opttypes.h:529
Packet verdict option value, carrying a type-tagged verdict from the capture source.
Definition wtap_opttypes.h:515
GByteArray * verdict_bytes
Definition wtap_opttypes.h:518
packet_verdict_type_e type
Definition wtap_opttypes.h:516
uint64_t verdict_linux_ebpf_tc
Definition wtap_opttypes.h:519
union packet_verdict_opt_s::@651 data
uint64_t verdict_linux_ebpf_xdp
Definition wtap_opttypes.h:520
Definition wtap_opttypes.h:272
Definition wtap_opttypes.h:261
const char * description
Definition wtap_opttypes.h:264
GHashTable * options
Definition wtap_opttypes.h:268
const char * name
Definition wtap_opttypes.h:263
wtap_block_type_t block_type
Definition wtap_opttypes.h:262
Berkeley Packet Filter (BPF) instruction.
Definition wtap_opttypes.h:471
uint32_t k
Definition wtap_opttypes.h:475
uint8_t jf
Definition wtap_opttypes.h:474
uint8_t jt
Definition wtap_opttypes.h:473
uint16_t code
Definition wtap_opttypes.h:472
Definition wtap_opttypes.h:561
wtap_optval_t value
Definition wtap_opttypes.h:563
unsigned option_id
Definition wtap_opttypes.h:562
Definition wtap_opttypes.h:573
wtap_opttype_e data_type
Definition wtap_opttypes.h:576
const char * description
Definition wtap_opttypes.h:575
const char * name
Definition wtap_opttypes.h:574
unsigned flags
Definition wtap_opttypes.h:577
Definition wtap_opttypes.h:384
Definition wtap_opttypes.h:308
Definition wtap_opttypes.h:347
uint32_t secrets_len
Definition wtap_opttypes.h:349
uint8_t * secrets_data
Definition wtap_opttypes.h:350
Definition wtap_opttypes.h:391
Definition wtap_opttypes.h:315
GArray * interface_statistics
Definition wtap_opttypes.h:323
int tsprecision
Definition wtap_opttypes.h:318
int wtap_encap
Definition wtap_opttypes.h:316
Definition wtap_opttypes.h:338
Definition wtap_opttypes.h:300
Definition wtap_opttypes.h:356
unsigned mev_data_len
Definition wtap_opttypes.h:358
uint8_t * mev_data
Definition wtap_opttypes.h:359
Definition wtap_opttypes.h:330
Definition wtap_opttypes.h:285
uint64_t section_length
Definition wtap_opttypes.h:286
Discriminated union holding the value of any Wiretap option type.
Definition wtap_opttypes.h:540
packet_verdict_opt_t packet_verdictval
Definition wtap_opttypes.h:554
if_filter_opt_t if_filterval
Definition wtap_opttypes.h:553
char * stringval
Definition wtap_opttypes.h:549
int8_t int8val
Definition wtap_opttypes.h:544
GBytes * byteval
Definition wtap_opttypes.h:550
custom_binary_opt_t custom_binaryval
Definition wtap_opttypes.h:552
custom_string_opt_t custom_stringval
Definition wtap_opttypes.h:551
packet_hash_opt_t packet_hash
Definition wtap_opttypes.h:555
ws_in4_addr ipv4val
Definition wtap_opttypes.h:547
uint64_t uint64val
Definition wtap_opttypes.h:543
int32_t int32val
Definition wtap_opttypes.h:545
uint32_t uint32val
Definition wtap_opttypes.h:542
uint8_t uint8val
Definition wtap_opttypes.h:541
int64_t int64val
Definition wtap_opttypes.h:546
ws_in6_addr ipv6val
Definition wtap_opttypes.h:548
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)
Set an if_filter option value in a block.
Definition wtap_opttypes.c:1557
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
Get UINT32 option value from a block.
Definition wtap_opttypes.c:830
WS_DLL_PUBLIC wtap_opttype_return_val wtap_block_set_uint8_option_value(wtap_block_t block, unsigned option_id, uint8_t value)
Set UINT8 option value in a block.
Definition wtap_opttypes.c:778
wtap_block_type_t
Currently supported blocks; these are not the pcapng block type values for them, they're identifiers ...
Definition wtap_opttypes.h:234
@ WTAP_BLOCK_PACKET
Definition wtap_opttypes.h:240
@ WTAP_BLOCK_SYSDIG_EVENT
Definition wtap_opttypes.h:243
@ WTAP_BLOCK_FT_SPECIFIC_REPORT
Definition wtap_opttypes.h:241
@ WTAP_BLOCK_CUSTOM
Definition wtap_opttypes.h:246
@ WTAP_BLOCK_IF_ID_AND_INFO
Definition wtap_opttypes.h:236
@ WTAP_BLOCK_SECTION
Definition wtap_opttypes.h:235
@ WTAP_BLOCK_DECRYPTION_SECRETS
Definition wtap_opttypes.h:239
@ WTAP_BLOCK_FT_SPECIFIC_EVENT
Definition wtap_opttypes.h:242
@ WTAP_BLOCK_FT_SPECIFIC_INFORMATION
Definition wtap_opttypes.h:247
@ WTAP_BLOCK_IF_STATISTICS
Definition wtap_opttypes.h:238
@ WTAP_BLOCK_META_EVENT
Definition wtap_opttypes.h:244
@ MAX_WTAP_BLOCK_TYPE_VALUE
Definition wtap_opttypes.h:248
@ WTAP_BLOCK_SYSTEMD_JOURNAL_EXPORT
Definition wtap_opttypes.h:245
@ WTAP_BLOCK_NAME_RESOLUTION
Definition wtap_opttypes.h:237
WS_DLL_PUBLIC wtap_opttype_return_val wtap_block_add_int64_option(wtap_block_t block, unsigned option_id, int64_t value)
Add INT64 option value to a block.
Definition wtap_opttypes.c:960
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,...)
Set string option value for the nth instance of a particular option in a block to a printf-formatted ...
Definition wtap_opttypes.c:1201
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
Get bytes option value from a block.
Definition wtap_opttypes.c:1307
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
Get packet_verdict option value for the nth instance of a particular option in a block.
Definition wtap_opttypes.c:1619
WS_DLL_PUBLIC wtap_block_t wtap_block_make_copy(wtap_block_t block)
Make a copy of a block.
Definition wtap_opttypes.c:570
wtap_opttype_e
Data types for option values stored within a wtap block.
Definition wtap_opttypes.h:402
@ WTAP_OPTTYPE_UINT32
Definition wtap_opttypes.h:404
@ WTAP_OPTTYPE_CUSTOM_STRING
Definition wtap_opttypes.h:410
@ WTAP_OPTTYPE_IPv6
Definition wtap_opttypes.h:409
@ WTAP_OPTTYPE_STRING
Definition wtap_opttypes.h:406
@ WTAP_OPTTYPE_IPv4
Definition wtap_opttypes.h:408
@ WTAP_OPTTYPE_BYTES
Definition wtap_opttypes.h:407
@ WTAP_OPTTYPE_INT8
Definition wtap_opttypes.h:415
@ WTAP_OPTTYPE_INT64
Definition wtap_opttypes.h:417
@ WTAP_OPTTYPE_IF_FILTER
Definition wtap_opttypes.h:412
@ WTAP_OPTTYPE_UINT64
Definition wtap_opttypes.h:405
@ WTAP_OPTTYPE_INT32
Definition wtap_opttypes.h:416
@ WTAP_OPTTYPE_PACKET_VERDICT
Definition wtap_opttypes.h:413
@ WTAP_OPTTYPE_CUSTOM_BINARY
Definition wtap_opttypes.h:411
@ WTAP_OPTTYPE_PACKET_HASH
Definition wtap_opttypes.h:414
@ WTAP_OPTTYPE_UINT8
Definition wtap_opttypes.h:403
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
Get UINT8 option value from a block.
Definition wtap_opttypes.c:791
WS_DLL_PUBLIC void wtap_packet_hash_free(packet_hash_opt_t *hash)
Frees memory allocated for a packet hash option.
Definition wtap_opttypes.c:179
struct wtap_bpf_insn_s wtap_bpf_insn_t
Berkeley Packet Filter (BPF) instruction.
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)
Set string option value in a block.
Definition wtap_opttypes.c:1135
WS_DLL_PUBLIC wtap_opttype_return_val wtap_block_add_string_option_format(wtap_block_t block, unsigned option_id, const char *format,...)
Add a string option to a block with a printf-formatted string as its value.
Definition wtap_opttypes.c:1119
WS_DLL_PUBLIC wtap_opttype_return_val wtap_block_set_int32_option_value(wtap_block_t block, unsigned option_id, int32_t value)
Set INT32 option value in a block.
Definition wtap_opttypes.c:934
struct wtapng_dpib_lookup_info_s wtapng_dpib_lookup_info_t
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
Get INT64 option value from a block.
Definition wtap_opttypes.c:986
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)
Add a string option to a block.
Definition wtap_opttypes.c:1077
WS_DLL_PUBLIC wtap_opttype_return_val wtap_block_add_uint32_option(wtap_block_t block, unsigned option_id, uint32_t value)
Add UINT32 option value to a block.
Definition wtap_opttypes.c:804
WS_DLL_PUBLIC void wtap_opttype_block_register(wtap_blocktype_t *blocktype)
Register a block type handler.
Definition wtap_opttypes.c:185
struct packet_hash_opt_s packet_hash_opt_t
Packet hash option value, carrying a typed digest of the packet contents.
WS_DLL_PUBLIC wtap_opttype_return_val wtap_block_add_uint64_option(wtap_block_t block, unsigned option_id, uint64_t value)
Add UINT64 option value to a block.
Definition wtap_opttypes.c:843
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
Get IPv6 option value from a block.
Definition wtap_opttypes.c:1064
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
Get an if_filter option value from a block.
Definition wtap_opttypes.c:1575
packet_verdict_type_e
Discriminator tag identifying the encoding of a packet verdict option.
Definition wtap_opttypes.h:505
@ packet_verdict_hardware
Definition wtap_opttypes.h:506
@ packet_verdict_linux_ebpf_tc
Definition wtap_opttypes.h:507
@ packet_verdict_linux_ebpf_xdp
Definition wtap_opttypes.h:508
struct wtapng_if_stats_mandatory_s wtapng_if_stats_mandatory_t
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)
Set string option value for the nth instance of a particular option in a block.
Definition wtap_opttypes.c:1158
WS_DLL_PUBLIC wtap_opttype_return_val wtap_block_add_string_option_owned(wtap_block_t block, unsigned option_id, char *value) G_GNUC_WARN_UNUSED_RESULT
Add a string option to a block taking ownership of the null-terminated string.
Definition wtap_opttypes.c:1091
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)
Add a packet_hash option value to a block.
Definition wtap_opttypes.c:1632
WS_DLL_PUBLIC wtap_opttype_return_val wtap_block_set_int64_option_value(wtap_block_t block, unsigned option_id, int64_t value)
Set INT64 option value in a block.
Definition wtap_opttypes.c:973
WS_DLL_PUBLIC wtap_opttype_return_val wtap_block_add_int8_option(wtap_block_t block, unsigned option_id, int8_t value)
Add INT8 option value to a block.
Definition wtap_opttypes.c:882
bool(* wtap_block_foreach_func)(wtap_block_t block, unsigned option_id, wtap_opttype_e option_type, wtap_optval_t *option, void *user_data)
Callback type for iterating over block options.
Definition wtap_opttypes.h:1407
WS_DLL_PUBLIC bool wtap_block_foreach_option(wtap_block_t block, wtap_block_foreach_func func, void *user_data)
Iterate over all options in a block.
Definition wtap_opttypes.c:600
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
Get bytes option value for nth instance of a particular option in a block.
Definition wtap_opttypes.c:1320
WS_DLL_PUBLIC wtap_block_t wtap_block_create(wtap_block_type_t block_type)
Create a block by type.
Definition wtap_opttypes.c:318
struct wtapng_dsb_mandatory_s wtapng_dsb_mandatory_t
struct wtapng_nrb_mandatory_s wtapng_nrb_mandatory_t
struct wtapng_darwin_process_event_mandatory_s wtapng_darwin_process_event_mandatory_t
WS_DLL_PUBLIC wtap_block_t wtap_block_ref(wtap_block_t block)
Increase reference count of a block.
Definition wtap_opttypes.c:399
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
Get UINT64 option value from a block.
Definition wtap_opttypes.c:869
WS_DLL_PUBLIC wtap_opttype_return_val wtap_block_remove_nth_option_instance(wtap_block_t block, unsigned option_id, unsigned idx)
Remove the nth instance of an option from a block.
Definition wtap_opttypes.c:1687
WS_DLL_PUBLIC wtap_opttype_return_val wtap_block_add_ipv6_option(wtap_block_t block, unsigned option_id, ws_in6_addr *value)
Add IPv6 address option value to a block.
Definition wtap_opttypes.c:1038
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)
Add a bytes option to a block.
Definition wtap_opttypes.c:1244
WS_DLL_PUBLIC wtap_opttype_return_val wtap_block_set_uint32_option_value(wtap_block_t block, unsigned option_id, uint32_t value)
Set UINT32 option value in a block.
Definition wtap_opttypes.c:817
WS_DLL_PUBLIC wtap_opttype_return_val wtap_block_set_ipv6_option_value(wtap_block_t block, unsigned option_id, ws_in6_addr *value)
Set IPv6 option value in a block.
Definition wtap_opttypes.c:1051
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)
Add a binary custom option, with a particular Private Enterprise Number, to a block.
Definition wtap_opttypes.c:1507
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)
Add a binary custom option, with a particular Private Enterprise Number, to a block.
Definition wtap_opttypes.c:1492
WS_DLL_PUBLIC void wtap_opttypes_initialize(void)
Initialize block types.
Definition wtap_opttypes.c:1906
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
Get string option value from a block.
Definition wtap_opttypes.c:1218
WS_DLL_PUBLIC wtap_opttype_return_val wtap_block_set_ipv4_option_value(wtap_block_t block, unsigned option_id, uint32_t value)
Set IPv4 option value in a block.
Definition wtap_opttypes.c:1012
WS_DLL_PUBLIC wtap_opttype_return_val wtap_block_add_int32_option(wtap_block_t block, unsigned option_id, int32_t value)
Add INT32 option value to a block.
Definition wtap_opttypes.c:921
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
Get INT32 option value from a block.
Definition wtap_opttypes.c:947
if_filter_type_e
Type of capture filter.
Definition wtap_opttypes.h:484
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)
Set packet_verdict option value for the nth instance of a particular option in a block.
Definition wtap_opttypes.c:1601
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
Get INT8 option value from a block.
Definition wtap_opttypes.c:908
struct wtapng_if_descr_mandatory_s wtapng_if_descr_mandatory_t
wtap_opttype_return_val
Return codes for wtap block option access and mutation operations.
Definition wtap_opttypes.h:423
@ WTAP_OPTTYPE_ALREADY_EXISTS
Definition wtap_opttypes.h:429
@ WTAP_OPTTYPE_TYPE_MISMATCH
Definition wtap_opttypes.h:427
@ WTAP_OPTTYPE_NO_SUCH_OPTION
Definition wtap_opttypes.h:425
@ WTAP_OPTTYPE_NUMBER_MISMATCH
Definition wtap_opttypes.h:428
@ WTAP_OPTTYPE_SUCCESS
Definition wtap_opttypes.h:424
@ WTAP_OPTTYPE_BAD_BLOCK
Definition wtap_opttypes.h:430
@ WTAP_OPTTYPE_NOT_FOUND
Definition wtap_opttypes.h:426
@ WTAP_OPTTYPE_PEN_MISMATCH
Definition wtap_opttypes.h:431
WS_DLL_PUBLIC void wtap_block_array_ref(GArray *block_array)
Increment the reference count of an array of blocks.
Definition wtap_opttypes.c:450
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)
Set bytes option value for nth instance of a particular option in a block.
Definition wtap_opttypes.c:1293
struct wtapng_iface_descriptions_s wtapng_iface_descriptions_t
WS_DLL_PUBLIC void wtap_block_unref(wtap_block_t block)
Decrease reference count of a block.
Definition wtap_opttypes.c:412
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)
Add an if_filter option value to a block.
Definition wtap_opttypes.c:1544
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
Get string option value for the nth instance of a particular option in a block.
Definition wtap_opttypes.c:1231
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)
Set bytes option value in a block.
Definition wtap_opttypes.c:1270
WS_DLL_PUBLIC wtap_opttype_return_val wtap_block_set_string_option_value_format(wtap_block_t block, unsigned option_id, const char *format,...)
Set string option value in a block to a printf-formatted string.
Definition wtap_opttypes.c:1172
WS_DLL_PUBLIC wtap_opttype_return_val wtap_block_add_ipv4_option(wtap_block_t block, unsigned option_id, uint32_t value)
Add IPv4 address option value to a block.
Definition wtap_opttypes.c:999
WS_DLL_PUBLIC void wtap_opttypes_cleanup(void)
Cleanup the internal structures.
Definition wtap_opttypes.c:2403
WS_DLL_PUBLIC wtap_block_type_t wtap_block_get_type(wtap_block_t block)
Provide type of a block.
Definition wtap_opttypes.c:262
struct packet_verdict_opt_s packet_verdict_opt_t
Packet verdict option value, carrying a type-tagged verdict from the capture source.
WS_DLL_PUBLIC wtap_opttype_return_val wtap_block_set_int8_option_value(wtap_block_t block, unsigned option_id, int8_t value)
Set INT8 option value in a block.
Definition wtap_opttypes.c:895
WS_DLL_PUBLIC void * wtap_block_get_mandatory_data(wtap_block_t block)
Provide mandatory data of a block.
Definition wtap_opttypes.c:267
WS_DLL_PUBLIC void wtap_packet_verdict_free(packet_verdict_opt_t *verdict)
Free a packet verdict option value.
Definition wtap_opttypes.c:148
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)
Add UINT8 option value to a block.
Definition wtap_opttypes.c:765
WS_DLL_PUBLIC void wtap_block_copy(wtap_block_t dest_block, wtap_block_t src_block)
Copy a block to another.
Definition wtap_opttypes.c:480
WS_DLL_PUBLIC void wtap_block_array_free(GArray *block_array)
Free an array of blocks.
Definition wtap_opttypes.c:437
WS_DLL_PUBLIC void wtap_block_array_unref(GArray *block_array)
Decrement the reference count of an array of blocks.
Definition wtap_opttypes.c:463
WS_DLL_PUBLIC wtap_opttype_return_val wtap_block_add_bytes_option_borrow(wtap_block_t block, unsigned option_id, GBytes *value)
Add a bytes option to a block, borrowing the value from a GBytes.
Definition wtap_opttypes.c:1257
WS_DLL_PUBLIC wtap_opttype_return_val wtap_block_remove_option(wtap_block_t block, unsigned option_id)
Remove an option from a block.
Definition wtap_opttypes.c:1645
WS_DLL_PUBLIC wtap_opttype_return_val wtap_block_set_uint64_option_value(wtap_block_t block, unsigned option_id, uint64_t value)
Set UINT64 option value in a block.
Definition wtap_opttypes.c:856
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)
Add a packet_verdict option value to a block.
Definition wtap_opttypes.c:1588
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)
Get binary custom option value for the nth instance of a particular option, with a particular Private...
Definition wtap_opttypes.c:1525
WS_DLL_PUBLIC unsigned wtap_block_count_option(wtap_block_t block, unsigned option_id)
Count the number of times the given option appears in the block.
Definition wtap_opttypes.c:580
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
Get IPv4 option value from a block.
Definition wtap_opttypes.c:1025
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)
Add a string custom option, with a particular Private Enterprise Number, to a block.
Definition wtap_opttypes.c:1459