Wireshark 4.7.4
The Wireshark network protocol analyzer
Loading...
Searching...
No Matches
wtap_opttypes.h
Go to the documentation of this file.
1
9
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
32
33/* Section Header block (SHB) */
34#define OPT_SHB_HARDWARE 2
37#define OPT_SHB_OS 3
40#define OPT_SHB_USERAPPL 4
43
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
131
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
145
146/* Name Resolution Block (NRB) */
147#define OPT_NS_DNSNAME 2
148#define OPT_NS_DNSIP4ADDR 3
149#define OPT_NS_DNSIP6ADDR 4
150
151/* Interface Statistics Block (ISB) */
152#define OPT_ISB_STARTTIME 2
153#define OPT_ISB_ENDTIME 3
154#define OPT_ISB_IFRECV 4
155#define OPT_ISB_IFDROP 5
156#define OPT_ISB_FILTERACCEPT 6
157#define OPT_ISB_OSDROP 7
158#define OPT_ISB_USRDELIV 8
159
160/* Process Information Block (PIB) */
161#define OPT_PIB_NAME 2
162#define OPT_PIB_PATH 3
163#define OPT_PIB_CMDLINE 4
164#define OPT_PIB_PPID 5
165#define OPT_PIB_UID 6
166#define OPT_PIB_USER 7
167#define OPT_PIB_UUID 8
168#define OPT_PIB_STARTTIME 9
169
170/* Darwin-specific options for EPB */
171#define OPT_PKT_DARWIN_PIB_ID 32769
172#define OPT_PKT_DARWIN_SVC_CODE 32770
173#define OPT_PKT_DARWIN_EFFECTIVE_PIB_ID 32771
174#define OPT_PKT_DARWIN_MD_FLAGS 32772
175#define OPT_PKT_DARWIN_FLOW_ID 32773
176#define OPT_PKT_DARWIN_TRACE_TAG 32774
177#define OPT_PKT_DARWIN_DROP_REASON 32775
178#define OPT_PKT_DARWIN_DROP_LINE 32776
179#define OPT_PKT_DARWIN_DROP_FUNC 32777
180#define OPT_PKT_DARWIN_COMP_GENCNT 32778
181
182
260
261struct wtap_block;
262typedef struct wtap_block* wtap_block_t;
263
264typedef void (*wtap_block_create_func)(wtap_block_t block);
265typedef void (*wtap_mand_free_func)(wtap_block_t block);
266typedef void (*wtap_mand_copy_func)(wtap_block_t dest_block, wtap_block_t src_block);
267
280
287 GArray *options;
289#ifdef DEBUG_COUNT_REFS
290 unsigned id;
291#endif
292};
293
307
313 GArray *interface_data;
315
321 uint64_t time_units_per_second;
323
324 uint32_t snap_len;
325
326 uint8_t num_stat_entries;
330
335 GList *ipv4_addr_list;
336 GList *ipv6_addr_list;
338
343 uint32_t interface_id;
344 uint32_t ts_high;
345 uint32_t ts_low;
347
352 uint32_t secrets_type;
353 uint32_t secrets_len;
354 uint8_t *secrets_data;
356
361 uint32_t mev_block_type;
362 unsigned mev_data_len;
363 uint8_t *mev_data;
365
372#if 0
373/* Commented out for now, there's no mandatory data that isn't handled by
374 * Wireshark in other ways.
375 */
376typedef struct wtapng_packet_mandatory_s {
377 uint32_t interface_id;
378 uint32_t ts_high;
379 uint32_t ts_low;
380 uint32_t captured_len;
381 uint32_t orig_len;
382} wtapng_packet_mandatory_t;
383#endif
384
396
401 unsigned record_type; /* the type of record this is - file type-specific value */
403
428
442
443/* https://www.iana.org/assignments/enterprise-numbers/enterprise-numbers */
444#define PEN_VCTR 46254
445
453
454
462
470
471/* Interface description data - if_filter option structure */
472
479typedef struct wtap_bpf_insn_s {
480 uint16_t code;
481 uint8_t jt;
482 uint8_t jf;
483 uint32_t k;
485
486
492typedef enum {
493 if_filter_pcap = 0, /* pcap filter string */
494 if_filter_bpf = 1 /* BPF program */
496
500typedef struct if_filter_opt_s {
502
506 union {
508
512 struct wtap_bpf_insns {
513 unsigned bpf_prog_len;
516 } data;
518
519/* Packet - packet_verdict option structure */
520
529
530
542
543
547typedef struct packet_hash_opt_s {
548 uint8_t type;
549 GByteArray *hash_bytes;
551
552
576
580typedef struct {
581 unsigned option_id;
584
589typedef void (*wtap_block_create_func)(wtap_block_t block);
590
595typedef void (*wtap_mand_free_func)(wtap_block_t block);
596
602typedef void (*wtap_mand_copy_func)(wtap_block_t dest_block, wtap_block_t src_block);
603
607typedef struct {
608 const char *name;
609 const char *description;
611 unsigned flags;
613
614#define GET_OPTION_TYPE(options, option_id) \
615 (const wtap_opttype_t *)g_hash_table_lookup((options), GUINT_TO_POINTER(option_id))
616
624WS_DLL_PUBLIC void
626
635WS_DLL_PUBLIC wtap_block_t
637
646WS_DLL_PUBLIC wtap_block_t
647wtap_block_ref(wtap_block_t block);
648
656WS_DLL_PUBLIC void
657wtap_block_unref(wtap_block_t block);
658
668WS_DLL_PUBLIC void
669wtap_block_array_free(GArray* block_array);
670
682WS_DLL_PUBLIC void
683wtap_block_array_unref(GArray* block_array);
684
693WS_DLL_PUBLIC void
694wtap_block_array_ref(GArray* block_array);
695
701WS_DLL_PUBLIC void
703
710WS_DLL_PUBLIC wtap_block_type_t
711wtap_block_get_type(wtap_block_t block);
712
719WS_DLL_PUBLIC void*
720wtap_block_get_mandatory_data(wtap_block_t block);
721
729WS_DLL_PUBLIC unsigned
730wtap_block_count_option(wtap_block_t block, unsigned option_id);
731
741WS_DLL_PUBLIC wtap_opttype_return_val
742wtap_block_add_uint8_option(wtap_block_t block, unsigned option_id, uint8_t value);
743
753WS_DLL_PUBLIC wtap_opttype_return_val
754wtap_block_set_uint8_option_value(wtap_block_t block, unsigned option_id, uint8_t value);
755
765WS_DLL_PUBLIC wtap_opttype_return_val
766wtap_block_get_uint8_option_value(wtap_block_t block, unsigned option_id, uint8_t* value) G_GNUC_WARN_UNUSED_RESULT;
767
777WS_DLL_PUBLIC wtap_opttype_return_val
778wtap_block_add_uint32_option(wtap_block_t block, unsigned option_id, uint32_t value);
779
789WS_DLL_PUBLIC wtap_opttype_return_val
790wtap_block_set_uint32_option_value(wtap_block_t block, unsigned option_id, uint32_t value);
791
801WS_DLL_PUBLIC wtap_opttype_return_val
802wtap_block_get_uint32_option_value(wtap_block_t block, unsigned option_id, uint32_t* value) G_GNUC_WARN_UNUSED_RESULT;
803
813WS_DLL_PUBLIC wtap_opttype_return_val
814wtap_block_add_uint64_option(wtap_block_t block, unsigned option_id, uint64_t value);
815
825WS_DLL_PUBLIC wtap_opttype_return_val
826wtap_block_set_uint64_option_value(wtap_block_t block, unsigned option_id, uint64_t value);
827
837WS_DLL_PUBLIC wtap_opttype_return_val
838wtap_block_get_uint64_option_value(wtap_block_t block, unsigned option_id, uint64_t* value) G_GNUC_WARN_UNUSED_RESULT;
839
849WS_DLL_PUBLIC wtap_opttype_return_val
850wtap_block_get_nth_uint64_option_value(wtap_block_t block, unsigned option_id, unsigned idx, uint64_t *value) G_GNUC_WARN_UNUSED_RESULT;
851
861WS_DLL_PUBLIC wtap_opttype_return_val
862wtap_block_add_int8_option(wtap_block_t block, unsigned option_id, int8_t value);
863
873WS_DLL_PUBLIC wtap_opttype_return_val
874wtap_block_set_int8_option_value(wtap_block_t block, unsigned option_id, int8_t value);
875
885WS_DLL_PUBLIC wtap_opttype_return_val
886wtap_block_get_int8_option_value(wtap_block_t block, unsigned option_id, int8_t* value) G_GNUC_WARN_UNUSED_RESULT;
887
897WS_DLL_PUBLIC wtap_opttype_return_val
898wtap_block_add_int32_option(wtap_block_t block, unsigned option_id, int32_t value);
899
909WS_DLL_PUBLIC wtap_opttype_return_val
910wtap_block_set_int32_option_value(wtap_block_t block, unsigned option_id, int32_t value);
911
921WS_DLL_PUBLIC wtap_opttype_return_val
922wtap_block_get_int32_option_value(wtap_block_t block, unsigned option_id, int32_t* value) G_GNUC_WARN_UNUSED_RESULT;
923
933WS_DLL_PUBLIC wtap_opttype_return_val
934wtap_block_add_int64_option(wtap_block_t block, unsigned option_id, int64_t value);
935
945WS_DLL_PUBLIC wtap_opttype_return_val
946wtap_block_set_int64_option_value(wtap_block_t block, unsigned option_id, int64_t value);
947
957WS_DLL_PUBLIC wtap_opttype_return_val
958wtap_block_get_int64_option_value(wtap_block_t block, unsigned option_id, int64_t* value) G_GNUC_WARN_UNUSED_RESULT;
959
969WS_DLL_PUBLIC wtap_opttype_return_val
970wtap_block_add_ipv4_option(wtap_block_t block, unsigned option_id, uint32_t value);
971
981WS_DLL_PUBLIC wtap_opttype_return_val
982wtap_block_set_ipv4_option_value(wtap_block_t block, unsigned option_id, uint32_t value);
983
993WS_DLL_PUBLIC wtap_opttype_return_val
994wtap_block_get_ipv4_option_value(wtap_block_t block, unsigned option_id, uint32_t* value) G_GNUC_WARN_UNUSED_RESULT;
995
1005WS_DLL_PUBLIC wtap_opttype_return_val
1006wtap_block_add_ipv6_option(wtap_block_t block, unsigned option_id, ws_in6_addr *value);
1007
1017WS_DLL_PUBLIC wtap_opttype_return_val
1018wtap_block_set_ipv6_option_value(wtap_block_t block, unsigned option_id, ws_in6_addr *value);
1019
1029WS_DLL_PUBLIC wtap_opttype_return_val
1030wtap_block_get_ipv6_option_value(wtap_block_t block, unsigned option_id, ws_in6_addr* value) G_GNUC_WARN_UNUSED_RESULT;
1031
1042WS_DLL_PUBLIC wtap_opttype_return_val
1043wtap_block_add_string_option(wtap_block_t block, unsigned option_id, const char *value, size_t value_length);
1044
1055WS_DLL_PUBLIC wtap_opttype_return_val
1056wtap_block_add_string_option_owned(wtap_block_t block, unsigned option_id, char *value) G_GNUC_WARN_UNUSED_RESULT;
1057
1067WS_DLL_PUBLIC wtap_opttype_return_val
1068wtap_block_add_string_option_format(wtap_block_t block, unsigned option_id, const char *format, ...)
1069 G_GNUC_PRINTF(3,4);
1070
1081WS_DLL_PUBLIC wtap_opttype_return_val
1082wtap_block_set_string_option_value(wtap_block_t block, unsigned option_id, const char* value, size_t value_length);
1083
1096WS_DLL_PUBLIC wtap_opttype_return_val
1097wtap_block_set_nth_string_option_value(wtap_block_t block, unsigned option_id, unsigned idx, const char* value, size_t value_length);
1098
1108WS_DLL_PUBLIC wtap_opttype_return_val
1109wtap_block_set_string_option_value_format(wtap_block_t block, unsigned option_id, const char *format, ...)
1110 G_GNUC_PRINTF(3,4);
1111
1123WS_DLL_PUBLIC wtap_opttype_return_val
1124wtap_block_set_nth_string_option_value_format(wtap_block_t block, unsigned option_id, unsigned idx, const char *format, ...)
1125 G_GNUC_PRINTF(4,5);
1126
1136WS_DLL_PUBLIC wtap_opttype_return_val
1137wtap_block_get_string_option_value(wtap_block_t block, unsigned option_id, char** value) G_GNUC_WARN_UNUSED_RESULT;
1138
1150WS_DLL_PUBLIC wtap_opttype_return_val
1151wtap_block_get_nth_string_option_value(wtap_block_t block, unsigned option_id, unsigned idx, char** value) G_GNUC_WARN_UNUSED_RESULT;
1152
1163WS_DLL_PUBLIC wtap_opttype_return_val
1164wtap_block_add_bytes_option(wtap_block_t block, unsigned option_id, const uint8_t *value, size_t value_length);
1165
1175WS_DLL_PUBLIC wtap_opttype_return_val
1176wtap_block_add_bytes_option_borrow(wtap_block_t block, unsigned option_id, GBytes *value);
1177
1188WS_DLL_PUBLIC wtap_opttype_return_val
1189wtap_block_set_bytes_option_value(wtap_block_t block, unsigned option_id, const uint8_t* value, size_t value_length);
1190
1201WS_DLL_PUBLIC wtap_opttype_return_val
1202wtap_block_set_nth_bytes_option_value(wtap_block_t block, unsigned option_id, unsigned idx, GBytes* value);
1203
1215WS_DLL_PUBLIC wtap_opttype_return_val
1216wtap_block_get_bytes_option_value(wtap_block_t block, unsigned option_id, GBytes** value) G_GNUC_WARN_UNUSED_RESULT;
1217
1230WS_DLL_PUBLIC wtap_opttype_return_val
1231wtap_block_get_nth_bytes_option_value(wtap_block_t block, unsigned option_id, unsigned idx, GBytes** value) G_GNUC_WARN_UNUSED_RESULT;
1232
1245WS_DLL_PUBLIC wtap_opttype_return_val
1246wtap_block_add_custom_string_option(wtap_block_t block, unsigned option_id, uint32_t pen, const char *value, size_t value_length);
1247
1259WS_DLL_PUBLIC wtap_opttype_return_val
1260wtap_block_add_custom_binary_option(wtap_block_t block, unsigned option_id, uint32_t pen, binary_optdata_t *value);
1261
1274WS_DLL_PUBLIC wtap_opttype_return_val
1275wtap_block_add_custom_binary_option_from_data(wtap_block_t block, unsigned option_id, uint32_t pen, const void *data, size_t data_size);
1276
1289WS_DLL_PUBLIC wtap_opttype_return_val
1290wtap_block_get_nth_custom_binary_option_value(wtap_block_t block, unsigned option_id, uint32_t pen, unsigned idx, binary_optdata_t *value);
1291
1301WS_DLL_PUBLIC wtap_opttype_return_val
1302wtap_block_add_if_filter_option(wtap_block_t block, unsigned option_id, if_filter_opt_t* value);
1303
1313WS_DLL_PUBLIC wtap_opttype_return_val
1314wtap_block_set_if_filter_option_value(wtap_block_t block, unsigned option_id, if_filter_opt_t* value);
1315
1325WS_DLL_PUBLIC wtap_opttype_return_val
1326wtap_block_get_if_filter_option_value(wtap_block_t block, unsigned option_id, if_filter_opt_t* value) G_GNUC_WARN_UNUSED_RESULT;
1327
1337WS_DLL_PUBLIC wtap_opttype_return_val
1338wtap_block_add_packet_verdict_option(wtap_block_t block, unsigned option_id, packet_verdict_opt_t* value);
1339
1351WS_DLL_PUBLIC wtap_opttype_return_val
1352wtap_block_set_nth_packet_verdict_option_value(wtap_block_t block, unsigned option_id, unsigned idx, packet_verdict_opt_t* value);
1353
1365WS_DLL_PUBLIC wtap_opttype_return_val
1366wtap_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;
1367
1373WS_DLL_PUBLIC void
1374wtap_packet_verdict_free(packet_verdict_opt_t* verdict);
1375
1385WS_DLL_PUBLIC wtap_opttype_return_val
1386wtap_block_add_packet_hash_option(wtap_block_t block, unsigned option_id, packet_hash_opt_t* value);
1387
1393WS_DLL_PUBLIC void
1394wtap_packet_hash_free(packet_hash_opt_t* hash);
1395
1404WS_DLL_PUBLIC wtap_opttype_return_val
1405wtap_block_remove_option(wtap_block_t block, unsigned option_id);
1406
1416WS_DLL_PUBLIC wtap_opttype_return_val
1417wtap_block_remove_nth_option_instance(wtap_block_t block, unsigned option_id, unsigned idx);
1418
1428WS_DLL_PUBLIC void
1429wtap_block_copy(wtap_block_t dest_block, wtap_block_t src_block);
1430
1437WS_DLL_PUBLIC wtap_block_t
1438wtap_block_make_copy(wtap_block_t block);
1439
1453typedef bool (*wtap_block_foreach_func)(wtap_block_t block, unsigned option_id,
1454 wtap_opttype_e option_type, wtap_optval_t *option,
1455 void *user_data);
1456
1467WS_DLL_PUBLIC bool
1468wtap_block_foreach_option(wtap_block_t block, wtap_block_foreach_func func, void* user_data);
1469
1473WS_DLL_PUBLIC void
1474wtap_opttypes_cleanup(void);
1475
1476#ifdef __cplusplus
1477}
1478#endif /* __cplusplus */
1479
1480#endif /* WTAP_OPT_TYPES_H */
struct e_in6_addr ws_in6_addr
Represents a 128-bit IPv6 address.
uint32_t ws_in4_addr
Represents a 32-bit IPv4 address in network byte order.
Definition inet_addr.h:22
Holds the raw binary payload of a custom binary option.
Definition wtap_opttypes.h:458
size_t custom_data_len
Definition wtap_opttypes.h:459
void * custom_data
Definition wtap_opttypes.h:460
Holds the value of a custom binary option, combining a Private Enterprise Number with its associated ...
Definition wtap_opttypes.h:466
binary_optdata_t data
Definition wtap_opttypes.h:468
uint32_t pen
Definition wtap_opttypes.h:467
Holds the value of a custom string option, combining a Private Enterprise Number with its associated ...
Definition wtap_opttypes.h:449
uint32_t pen
Definition wtap_opttypes.h:450
char * string
Definition wtap_opttypes.h:451
Holds the value of an interface filter option, expressed as either a pcap filter string or a compiled...
Definition wtap_opttypes.h:500
char * filter_str
Definition wtap_opttypes.h:507
if_filter_type_e type
Definition wtap_opttypes.h:501
unsigned bpf_prog_len
Definition wtap_opttypes.h:513
wtap_bpf_insn_t * bpf_prog
Definition wtap_opttypes.h:514
Packet hash option value, carrying a typed digest of the packet contents.
Definition wtap_opttypes.h:547
GByteArray * hash_bytes
Definition wtap_opttypes.h:549
uint8_t type
Definition wtap_opttypes.h:548
Packet verdict option value, carrying a type-tagged verdict from the capture source.
Definition wtap_opttypes.h:534
GByteArray * verdict_bytes
Definition wtap_opttypes.h:537
packet_verdict_type_e type
Definition wtap_opttypes.h:535
uint64_t verdict_linux_ebpf_tc
Definition wtap_opttypes.h:538
uint64_t verdict_linux_ebpf_xdp
Definition wtap_opttypes.h:539
A single instance of a pcapng block, holding its type descriptor, mandatory data payload,...
Definition wtap_opttypes.h:284
void * mandatory_data
Definition wtap_opttypes.h:286
GArray * options
Definition wtap_opttypes.h:287
struct wtap_blocktype_t * info
Definition wtap_opttypes.h:285
int ref_count
Definition wtap_opttypes.h:288
Describes a registered pcapng block type, including its identity, human-readable metadata,...
Definition wtap_opttypes.h:271
wtap_block_create_func create
Definition wtap_opttypes.h:275
const char * description
Definition wtap_opttypes.h:274
wtap_mand_copy_func copy_mand
Definition wtap_opttypes.h:277
GHashTable * options
Definition wtap_opttypes.h:278
const char * name
Definition wtap_opttypes.h:273
wtap_mand_free_func free_mand
Definition wtap_opttypes.h:276
wtap_block_type_t block_type
Definition wtap_opttypes.h:272
Berkeley Packet Filter (BPF) instruction.
Definition wtap_opttypes.h:479
uint32_t k
Definition wtap_opttypes.h:483
uint8_t jf
Definition wtap_opttypes.h:482
uint8_t jt
Definition wtap_opttypes.h:481
uint16_t code
Definition wtap_opttypes.h:480
Represents a single option instance within a pcapng block, pairing an option code with its value.
Definition wtap_opttypes.h:580
wtap_optval_t value
Definition wtap_opttypes.h:582
unsigned option_id
Definition wtap_opttypes.h:581
Describes a registered option type, including its identity, human-readable metadata,...
Definition wtap_opttypes.h:607
wtap_opttype_e data_type
Definition wtap_opttypes.h:610
const char * description
Definition wtap_opttypes.h:609
const char * name
Definition wtap_opttypes.h:608
unsigned flags
Definition wtap_opttypes.h:611
Definition wtap_opttypes.h:351
uint32_t secrets_len
Definition wtap_opttypes.h:353
uint8_t * secrets_data
Definition wtap_opttypes.h:354
Definition wtap_opttypes.h:400
Definition wtap_opttypes.h:319
GArray * interface_statistics
Definition wtap_opttypes.h:327
int tsprecision
Definition wtap_opttypes.h:322
int wtap_encap
Definition wtap_opttypes.h:320
Definition wtap_opttypes.h:342
Definition wtap_opttypes.h:312
Definition wtap_opttypes.h:360
unsigned mev_data_len
Definition wtap_opttypes.h:362
uint8_t * mev_data
Definition wtap_opttypes.h:363
Definition wtap_opttypes.h:334
Definition wtap_opttypes.h:388
uint32_t process_id
Definition wtap_opttypes.h:389
uint32_t block_type
Definition wtap_opttypes.h:390
Definition wtap_opttypes.h:297
uint64_t section_length
Definition wtap_opttypes.h:298
Discriminated union holding the value of any Wiretap option type.
Definition wtap_opttypes.h:559
packet_verdict_opt_t packet_verdictval
Definition wtap_opttypes.h:573
if_filter_opt_t if_filterval
Definition wtap_opttypes.h:572
char * stringval
Definition wtap_opttypes.h:568
int8_t int8val
Definition wtap_opttypes.h:563
GBytes * byteval
Definition wtap_opttypes.h:569
custom_binary_opt_t custom_binaryval
Definition wtap_opttypes.h:571
custom_string_opt_t custom_stringval
Definition wtap_opttypes.h:570
packet_hash_opt_t packet_hash
Definition wtap_opttypes.h:574
ws_in4_addr ipv4val
Definition wtap_opttypes.h:566
uint64_t uint64val
Definition wtap_opttypes.h:562
int32_t int32val
Definition wtap_opttypes.h:564
uint32_t uint32val
Definition wtap_opttypes.h:561
uint8_t uint8val
Definition wtap_opttypes.h:560
int64_t int64val
Definition wtap_opttypes.h:565
ws_in6_addr ipv6val
Definition wtap_opttypes.h:567
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
struct custom_binary_opt_s custom_binary_opt_t
Holds the value of a custom binary option, combining a Private Enterprise Number with its associated ...
wtap_block_type_t
Currently supported blocks; these are not the pcapng block type values for them, they're identifiers ...
Definition wtap_opttypes.h:243
@ WTAP_BLOCK_PROCESS_INFORMATION
Definition wtap_opttypes.h:257
@ WTAP_BLOCK_PACKET
Definition wtap_opttypes.h:249
@ WTAP_BLOCK_SYSDIG_EVENT
Definition wtap_opttypes.h:252
@ WTAP_BLOCK_FT_SPECIFIC_REPORT
Definition wtap_opttypes.h:250
@ WTAP_BLOCK_CUSTOM
Definition wtap_opttypes.h:255
@ WTAP_BLOCK_IF_ID_AND_INFO
Definition wtap_opttypes.h:245
@ WTAP_BLOCK_SECTION
Definition wtap_opttypes.h:244
@ WTAP_BLOCK_DECRYPTION_SECRETS
Definition wtap_opttypes.h:248
@ WTAP_BLOCK_FT_SPECIFIC_EVENT
Definition wtap_opttypes.h:251
@ WTAP_BLOCK_FT_SPECIFIC_INFORMATION
Definition wtap_opttypes.h:256
@ WTAP_BLOCK_IF_STATISTICS
Definition wtap_opttypes.h:247
@ WTAP_BLOCK_META_EVENT
Definition wtap_opttypes.h:253
@ MAX_WTAP_BLOCK_TYPE_VALUE
Definition wtap_opttypes.h:258
@ WTAP_BLOCK_SYSTEMD_JOURNAL_EXPORT
Definition wtap_opttypes.h:254
@ WTAP_BLOCK_NAME_RESOLUTION
Definition wtap_opttypes.h:246
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:973
WS_DLL_PUBLIC wtap_opttype_return_val wtap_block_get_nth_uint64_option_value(wtap_block_t block, unsigned option_id, unsigned idx, uint64_t *value) G_GNUC_WARN_UNUSED_RESULT
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:1453
wtap_opttype_e
Data types for option values stored within a wtap block.
Definition wtap_opttypes.h:411
@ WTAP_OPTTYPE_UINT32
Definition wtap_opttypes.h:413
@ WTAP_OPTTYPE_CUSTOM_STRING
Definition wtap_opttypes.h:419
@ WTAP_OPTTYPE_IPv6
Definition wtap_opttypes.h:418
@ WTAP_OPTTYPE_STRING
Definition wtap_opttypes.h:415
@ WTAP_OPTTYPE_IPv4
Definition wtap_opttypes.h:417
@ WTAP_OPTTYPE_BYTES
Definition wtap_opttypes.h:416
@ WTAP_OPTTYPE_INT8
Definition wtap_opttypes.h:424
@ WTAP_OPTTYPE_INT64
Definition wtap_opttypes.h:426
@ WTAP_OPTTYPE_IF_FILTER
Definition wtap_opttypes.h:421
@ WTAP_OPTTYPE_UINT64
Definition wtap_opttypes.h:414
@ WTAP_OPTTYPE_INT32
Definition wtap_opttypes.h:425
@ WTAP_OPTTYPE_PACKET_VERDICT
Definition wtap_opttypes.h:422
@ WTAP_OPTTYPE_CUSTOM_BINARY
Definition wtap_opttypes.h:420
@ WTAP_OPTTYPE_PACKET_HASH
Definition wtap_opttypes.h:423
@ WTAP_OPTTYPE_UINT8
Definition wtap_opttypes.h:412
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
struct wtap_bpf_insn_s wtap_bpf_insn_t
Berkeley Packet Filter (BPF) instruction.
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:1132
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:947
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:999
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:1090
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
void(* wtap_mand_free_func)(wtap_block_t block)
Callback invoked to release resources held by a block's mandatory data during destruction.
Definition wtap_opttypes.h:265
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:1077
packet_verdict_type_e
Discriminator tag identifying the encoding of a packet verdict option.
Definition wtap_opttypes.h:524
@ packet_verdict_hardware
Definition wtap_opttypes.h:525
@ packet_verdict_linux_ebpf_tc
Definition wtap_opttypes.h:526
@ packet_verdict_linux_ebpf_xdp
Definition wtap_opttypes.h:527
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) G_GNUC_WARN_UNUSED_RESULT
Add a string option to a block taking ownership of the null-terminated string.
Definition wtap_opttypes.c:1104
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:986
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:895
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
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_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:1051
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:1064
WS_DLL_PUBLIC void wtap_opttypes_initialize(void)
Initialize block types.
Definition wtap_opttypes.c:1930
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:1025
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:934
struct custom_string_opt_s custom_string_opt_t
Holds the value of a custom string option, combining a Private Enterprise Number with its associated ...
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:960
if_filter_type_e
Type of capture filter.
Definition wtap_opttypes.h:492
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:921
struct binary_optdata binary_optdata_t
Holds the raw binary payload of a custom binary option.
struct wtapng_process_info_mandatory_s wtapng_process_info_mandatory_t
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:432
@ WTAP_OPTTYPE_ALREADY_EXISTS
Definition wtap_opttypes.h:438
@ WTAP_OPTTYPE_TYPE_MISMATCH
Definition wtap_opttypes.h:436
@ WTAP_OPTTYPE_NO_SUCH_OPTION
Definition wtap_opttypes.h:434
@ WTAP_OPTTYPE_NUMBER_MISMATCH
Definition wtap_opttypes.h:437
@ WTAP_OPTTYPE_SUCCESS
Definition wtap_opttypes.h:433
@ WTAP_OPTTYPE_BAD_BLOCK
Definition wtap_opttypes.h:439
@ WTAP_OPTTYPE_NOT_FOUND
Definition wtap_opttypes.h:435
@ WTAP_OPTTYPE_PEN_MISMATCH
Definition wtap_opttypes.h:440
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
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_ipv4_option(wtap_block_t block, unsigned option_id, uint32_t value)
Add IPv4 address option value to a block.
Definition wtap_opttypes.c:1012
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:908
WS_DLL_PUBLIC void * wtap_block_get_mandatory_data(wtap_block_t block)
Provide mandatory data of a block.
Definition wtap_opttypes.c:267
void(* wtap_mand_copy_func)(wtap_block_t dest_block, wtap_block_t src_block)
Callback invoked to deep-copy mandatory data from one block into another.
Definition wtap_opttypes.h:266
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
struct if_filter_opt_s if_filter_opt_t
Holds the value of an interface filter option, expressed as either a pcap filter string or a compiled...
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_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
void(* wtap_block_create_func)(wtap_block_t block)
Callback invoked to allocate and initialize the mandatory data for a newly created block.
Definition wtap_opttypes.h:264
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:1038