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
174/*
175 * Currently supported blocks; these are not the pcapng block type values
176 * for them, they're identifiers used internally, and more than one
177 * pcapng block type may use a given block type.
178 *
179 * Note that, in a given file format, this information won't necessarily
180 * appear in the form of blocks in the file, even though they're presented
181 * to the caller of libwiretap as blocks when reading and are presented
182 * by the caller of libwiretap as blocks when writing. See, for example,
183 * the iptrace file format, in which the interface name is given as part
184 * of the packet record header; we synthesize those blocks when reading
185 * (we don't currently support writing that format, but if we did, we'd
186 * get the interface name from the block and put it in the packet record
187 * header).
188 *
189 * WTAP_BLOCK_IF_ID_AND_INFO is a block that not only gives
190 * descriptive information about an interface but *also* assigns an
191 * ID to the interface, so that every packet has either an explicit
192 * or implicit interface ID indicating on which the packet arrived.
193 *
194 * It does *not* refer to information about interfaces that does not
195 * allow identification of the interface on which a packet arrives
196 * (I'm looking at *you*, Microsoft Network Monitor...). Do *not*
197 * indicate support for that block if your capture format merely
198 * gives a list of interface information without having every packet
199 * explicitly or implicitly (as in, for example, the pcapng Simple
200 * Packet Block) indicate on which of those interfaces the packet
201 * arrived.
202 *
203 * WTAP_BLOCK_PACKET (which corresponds to the Enhanced Packet Block,
204 * the Simple Packet Block, and the deprecated Packet Block) is not
205 * currently used; it's reserved for future use. The same applies
206 * to WTAP_BLOCK_SYSTEMD_JOURNAL_EXPORT.
207 *
208 * WTAP_BLOCK_FT_SPECIFIC_EVENT contains filetype-specific "events",
209 * such as "carrier lost" or "moved to a new channel". The "events"
210 * are commonly time-stamped.
211 *
212 * WTAP_BLOCK_FT_SPECIFIC_REPORT contains filetype-specific "reports"
213 * such as "number of times the carrier has been lost".
214 * Similarly to "events", the "reports" are commonly time-stamped;
215 * in addition, the "reports" may include the "duration".
216 *
217 * WTAP_BLOCK_FT_SPECIFIC_INFORMATION contains filetype-specific
218 * "information", which is NOT timestamped.
219 *
220 * The distinction between the "events", "reports" and "information"
221 * is that both the "events" and "reports" describe something
222 * that has happened at some point in time, whereas the "information"
223 * does not have a time coordinate. Further, the "events" differ
224 * from the "reports" in the significance of the time coordinate.
225 * For the "events", the time stamp represents a state change,
226 * so that everything that happened before the "event" is
227 * qualitatively different from everything that followed.
228 * On the other hand, the time coordinates of "reports"
229 * do not have the same significance.
230 *
231 * WTAP_BLOCK_FT_SPECIFIC_INFORMATION is a block that contains
232 * information
233 */
234typedef enum {
235 WTAP_BLOCK_SECTION = 0,
236 WTAP_BLOCK_IF_ID_AND_INFO,
237 WTAP_BLOCK_NAME_RESOLUTION,
238 WTAP_BLOCK_IF_STATISTICS,
239 WTAP_BLOCK_DECRYPTION_SECRETS,
240 WTAP_BLOCK_PACKET,
241 WTAP_BLOCK_FT_SPECIFIC_REPORT,
242 WTAP_BLOCK_FT_SPECIFIC_EVENT,
243 WTAP_BLOCK_SYSDIG_EVENT,
244 WTAP_BLOCK_META_EVENT,
245 WTAP_BLOCK_SYSTEMD_JOURNAL_EXPORT,
246 WTAP_BLOCK_CUSTOM,
247 WTAP_BLOCK_FT_SPECIFIC_INFORMATION,
248 MAX_WTAP_BLOCK_TYPE_VALUE
249} wtap_block_type_t;
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 {
262 wtap_block_type_t block_type;
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
395/*
396 * Currently supported option types. These are not option types
397 * in the sense that each one corresponds to a particular option,
398 * they are data types for the data of an option, so, for example,
399 * all options with a 32-bit unsigned integer value have the type
400 * WTAP_OPTTYPE_UINT32.
401 */
402typedef enum {
403 WTAP_OPTTYPE_UINT8,
404 WTAP_OPTTYPE_UINT32,
405 WTAP_OPTTYPE_UINT64,
406 WTAP_OPTTYPE_STRING,
407 WTAP_OPTTYPE_BYTES,
408 WTAP_OPTTYPE_IPv4,
409 WTAP_OPTTYPE_IPv6,
410 WTAP_OPTTYPE_CUSTOM_STRING,
411 WTAP_OPTTYPE_CUSTOM_BINARY,
412 WTAP_OPTTYPE_IF_FILTER,
413 WTAP_OPTTYPE_PACKET_VERDICT,
414 WTAP_OPTTYPE_PACKET_HASH,
415 WTAP_OPTTYPE_INT8,
416 WTAP_OPTTYPE_INT32,
417 WTAP_OPTTYPE_INT64,
418} wtap_opttype_e;
419
420typedef enum {
421 WTAP_OPTTYPE_SUCCESS = 0,
422 WTAP_OPTTYPE_NO_SUCH_OPTION = -1,
423 WTAP_OPTTYPE_NOT_FOUND = -2,
424 WTAP_OPTTYPE_TYPE_MISMATCH = -3,
425 WTAP_OPTTYPE_NUMBER_MISMATCH = -4,
426 WTAP_OPTTYPE_ALREADY_EXISTS = -5,
427 WTAP_OPTTYPE_BAD_BLOCK = -6,
428 WTAP_OPTTYPE_PEN_MISMATCH = -7,
429} wtap_opttype_return_val;
430
431/* https://www.iana.org/assignments/enterprise-numbers/enterprise-numbers */
432#define PEN_VCTR 46254
433
434/*
435 * Structure giving the value of a custom string option; the value
436 * includes both the Private Enterprise Number and the data following it.
437 */
438typedef struct custom_string_opt_s {
439 uint32_t pen; /* Private Enterprise Number of this option */
440 char* string;
442
443/*
444 * Structure giving the data of a custom binary option.
445 */
446typedef struct binary_optdata {
447 size_t custom_data_len;
448 void* custom_data;
450
451/*
452 * Structure giving the value of a custom binary option; the value
453 * includes both the Private Enterprise Number and the data following it.
454 */
455typedef struct custom_binary_opt_s {
456 uint32_t pen; /* Private Enterprise Number of this option */
457 binary_optdata_t data;
459
460/* Interface description data - if_filter option structure */
461
462/* BPF instruction */
463typedef struct wtap_bpf_insn_s {
464 uint16_t code;
465 uint8_t jt;
466 uint8_t jf;
467 uint32_t k;
469
470/*
471 * Type of filter.
472 */
473typedef enum {
474 if_filter_pcap = 0, /* pcap filter string */
475 if_filter_bpf = 1 /* BPF program */
476} if_filter_type_e;
477
478typedef struct if_filter_opt_s {
479 if_filter_type_e type;
480 union {
482 struct wtap_bpf_insns {
483 unsigned bpf_prog_len;
486 } data;
488
489/* Packet - packet_verdict option structure */
490
491/*
492 * Type of verdict.
493 */
494typedef enum {
495 packet_verdict_hardware = 0, /* array of octets */
496 packet_verdict_linux_ebpf_tc = 1, /* 64-bit unsigned integer TC_ACT_ value */
497 packet_verdict_linux_ebpf_xdp = 2 /* 64-bit unsigned integer xdp_action value */
498} packet_verdict_type_e;
499
500typedef struct packet_verdict_opt_s {
501 packet_verdict_type_e type;
502 union {
503 GByteArray *verdict_bytes;
504 uint64_t verdict_linux_ebpf_tc;
505 uint64_t verdict_linux_ebpf_xdp;
506 } data;
508
509typedef struct packet_hash_opt_s {
510 uint8_t type;
511 GByteArray *hash_bytes;
513
514/*
515 * Structure describing a value of an option.
516 */
517typedef union {
518 uint8_t uint8val;
519 uint32_t uint32val;
520 uint64_t uint64val;
521 int8_t int8val;
522 int32_t int32val;
523 int64_t int64val;
524 ws_in4_addr ipv4val; /* network byte order */
525 ws_in6_addr ipv6val;
526 char *stringval;
527 GBytes *byteval;
528 custom_string_opt_t custom_stringval;
529 custom_binary_opt_t custom_binaryval;
530 if_filter_opt_t if_filterval;
531 packet_verdict_opt_t packet_verdictval;
532 packet_hash_opt_t packet_hash;
534
535/*
536 * Structure describing an option in a block.
537 */
538typedef struct {
539 unsigned option_id;
542
543typedef void (*wtap_block_create_func)(wtap_block_t block);
544typedef void (*wtap_mand_free_func)(wtap_block_t block);
545typedef void (*wtap_mand_copy_func)(wtap_block_t dest_block, wtap_block_t src_block);
546
547/*
548 * Structure describing a type of option.
549 */
550typedef struct {
551 const char* name;
552 const char* description;
553 wtap_opttype_e data_type;
554 unsigned flags;
556
557#define GET_OPTION_TYPE(options, option_id) \
558 (const wtap_opttype_t *)g_hash_table_lookup((options), GUINT_TO_POINTER(option_id))
559
566WS_DLL_PUBLIC void
568
576WS_DLL_PUBLIC wtap_block_t
577wtap_block_create(wtap_block_type_t block_type);
578
586WS_DLL_PUBLIC wtap_block_t
588
595WS_DLL_PUBLIC void
597
606WS_DLL_PUBLIC void
607wtap_block_array_free(GArray* block_array);
608
619WS_DLL_PUBLIC void
620wtap_block_array_unref(GArray* block_array);
621
629WS_DLL_PUBLIC void
630wtap_block_array_ref(GArray* block_array);
631
636WS_DLL_PUBLIC void
638
644WS_DLL_PUBLIC wtap_block_type_t
646
652WS_DLL_PUBLIC void*
654
661WS_DLL_PUBLIC unsigned
662wtap_block_count_option(wtap_block_t block, unsigned option_id);
663
672WS_DLL_PUBLIC wtap_opttype_return_val
673wtap_block_add_uint8_option(wtap_block_t block, unsigned option_id, uint8_t value);
674
683WS_DLL_PUBLIC wtap_opttype_return_val
684wtap_block_set_uint8_option_value(wtap_block_t block, unsigned option_id, uint8_t value);
685
694WS_DLL_PUBLIC wtap_opttype_return_val
695wtap_block_get_uint8_option_value(wtap_block_t block, unsigned option_id, uint8_t* value) G_GNUC_WARN_UNUSED_RESULT;
696
705WS_DLL_PUBLIC wtap_opttype_return_val
706wtap_block_add_uint32_option(wtap_block_t block, unsigned option_id, uint32_t value);
707
716WS_DLL_PUBLIC wtap_opttype_return_val
717wtap_block_set_uint32_option_value(wtap_block_t block, unsigned option_id, uint32_t value);
718
727WS_DLL_PUBLIC wtap_opttype_return_val
728wtap_block_get_uint32_option_value(wtap_block_t block, unsigned option_id, uint32_t* value) G_GNUC_WARN_UNUSED_RESULT;
729
738WS_DLL_PUBLIC wtap_opttype_return_val
739wtap_block_add_uint64_option(wtap_block_t block, unsigned option_id, uint64_t value);
740
749WS_DLL_PUBLIC wtap_opttype_return_val
750wtap_block_set_uint64_option_value(wtap_block_t block, unsigned option_id, uint64_t value);
751
760WS_DLL_PUBLIC wtap_opttype_return_val
761wtap_block_get_uint64_option_value(wtap_block_t block, unsigned option_id, uint64_t* value) G_GNUC_WARN_UNUSED_RESULT;
762
771WS_DLL_PUBLIC wtap_opttype_return_val
772wtap_block_add_int8_option(wtap_block_t block, unsigned option_id, int8_t value);
773
782WS_DLL_PUBLIC wtap_opttype_return_val
783wtap_block_set_int8_option_value(wtap_block_t block, unsigned option_id, int8_t value);
784
793WS_DLL_PUBLIC wtap_opttype_return_val
794wtap_block_get_int8_option_value(wtap_block_t block, unsigned option_id, int8_t* value) G_GNUC_WARN_UNUSED_RESULT;
795
804WS_DLL_PUBLIC wtap_opttype_return_val
805wtap_block_add_int32_option(wtap_block_t block, unsigned option_id, int32_t value);
806
815WS_DLL_PUBLIC wtap_opttype_return_val
816wtap_block_set_int32_option_value(wtap_block_t block, unsigned option_id, int32_t value);
817
826WS_DLL_PUBLIC wtap_opttype_return_val
827wtap_block_get_int32_option_value(wtap_block_t block, unsigned option_id, int32_t* value) G_GNUC_WARN_UNUSED_RESULT;
828
837WS_DLL_PUBLIC wtap_opttype_return_val
838wtap_block_add_int64_option(wtap_block_t block, unsigned option_id, int64_t value);
839
848WS_DLL_PUBLIC wtap_opttype_return_val
849wtap_block_set_int64_option_value(wtap_block_t block, unsigned option_id, int64_t value);
850
859WS_DLL_PUBLIC wtap_opttype_return_val
860wtap_block_get_int64_option_value(wtap_block_t block, unsigned option_id, int64_t* value) G_GNUC_WARN_UNUSED_RESULT;
861
870WS_DLL_PUBLIC wtap_opttype_return_val
871wtap_block_add_ipv4_option(wtap_block_t block, unsigned option_id, uint32_t value);
872
881WS_DLL_PUBLIC wtap_opttype_return_val
882wtap_block_set_ipv4_option_value(wtap_block_t block, unsigned option_id, uint32_t value);
883
892WS_DLL_PUBLIC wtap_opttype_return_val
893wtap_block_get_ipv4_option_value(wtap_block_t block, unsigned option_id, uint32_t* value) G_GNUC_WARN_UNUSED_RESULT;
894
903WS_DLL_PUBLIC wtap_opttype_return_val
904wtap_block_add_ipv6_option(wtap_block_t block, unsigned option_id, ws_in6_addr *value);
905
914WS_DLL_PUBLIC wtap_opttype_return_val
915wtap_block_set_ipv6_option_value(wtap_block_t block, unsigned option_id, ws_in6_addr *value);
916
925WS_DLL_PUBLIC wtap_opttype_return_val
926wtap_block_get_ipv6_option_value(wtap_block_t block, unsigned option_id, ws_in6_addr* value) G_GNUC_WARN_UNUSED_RESULT;
927
937WS_DLL_PUBLIC wtap_opttype_return_val
938wtap_block_add_string_option(wtap_block_t block, unsigned option_id, const char *value, size_t value_length);
939
949WS_DLL_PUBLIC wtap_opttype_return_val
950wtap_block_add_string_option_owned(wtap_block_t block, unsigned option_id, char *value) G_GNUC_WARN_UNUSED_RESULT;
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
1125WS_DLL_PUBLIC wtap_opttype_return_val
1126wtap_block_add_custom_string_option(wtap_block_t block, unsigned option_id, uint32_t pen, const char *value, size_t value_length);
1127
1138WS_DLL_PUBLIC wtap_opttype_return_val
1139wtap_block_add_custom_binary_option(wtap_block_t block, unsigned option_id, uint32_t pen, binary_optdata_t *value);
1140
1152WS_DLL_PUBLIC wtap_opttype_return_val
1153wtap_block_add_custom_binary_option_from_data(wtap_block_t block, unsigned option_id, uint32_t pen, const void *data, size_t data_size);
1154
1166WS_DLL_PUBLIC wtap_opttype_return_val
1167wtap_block_get_nth_custom_binary_option_value(wtap_block_t block, unsigned option_id, uint32_t pen, unsigned idx, binary_optdata_t *value);
1168
1177WS_DLL_PUBLIC wtap_opttype_return_val
1178wtap_block_add_if_filter_option(wtap_block_t block, unsigned option_id, if_filter_opt_t* value);
1179
1188WS_DLL_PUBLIC wtap_opttype_return_val
1189wtap_block_set_if_filter_option_value(wtap_block_t block, unsigned option_id, if_filter_opt_t* value);
1190
1199WS_DLL_PUBLIC wtap_opttype_return_val
1200wtap_block_get_if_filter_option_value(wtap_block_t block, unsigned option_id, if_filter_opt_t* value) G_GNUC_WARN_UNUSED_RESULT;
1201
1210WS_DLL_PUBLIC wtap_opttype_return_val
1212
1223WS_DLL_PUBLIC wtap_opttype_return_val
1224wtap_block_set_nth_packet_verdict_option_value(wtap_block_t block, unsigned option_id, unsigned idx, packet_verdict_opt_t* value);
1225
1236WS_DLL_PUBLIC wtap_opttype_return_val
1237wtap_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;
1238
1239WS_DLL_PUBLIC void
1240wtap_packet_verdict_free(packet_verdict_opt_t* verdict);
1241
1250WS_DLL_PUBLIC wtap_opttype_return_val
1251wtap_block_add_packet_hash_option(wtap_block_t block, unsigned option_id, packet_hash_opt_t* value);
1252
1253WS_DLL_PUBLIC void
1254wtap_packet_hash_free(packet_hash_opt_t* hash);
1255
1263WS_DLL_PUBLIC wtap_opttype_return_val
1264wtap_block_remove_option(wtap_block_t block, unsigned option_id);
1265
1274WS_DLL_PUBLIC wtap_opttype_return_val
1275wtap_block_remove_nth_option_instance(wtap_block_t block, unsigned option_id, unsigned idx);
1276
1285WS_DLL_PUBLIC void
1286wtap_block_copy(wtap_block_t dest_block, wtap_block_t src_block);
1287
1293WS_DLL_PUBLIC wtap_block_t
1295
1296typedef bool (*wtap_block_foreach_func)(wtap_block_t block, unsigned option_id, wtap_opttype_e option_type, wtap_optval_t *option, void *user_data);
1297WS_DLL_PUBLIC bool
1298wtap_block_foreach_option(wtap_block_t block, wtap_block_foreach_func func, void* user_data);
1299
1302WS_DLL_PUBLIC void
1304
1305#ifdef __cplusplus
1306}
1307#endif /* __cplusplus */
1308
1309#endif /* WTAP_OPT_TYPES_H */
uint32_t ws_in4_addr
Definition inet_addr.h:22
Definition wtap_opttypes.h:446
Definition wtap_opttypes.h:455
Definition wtap_opttypes.h:438
Definition inet_addr.h:27
Definition wtap_opttypes.h:478
char * filter_str
Definition wtap_opttypes.h:481
unsigned bpf_prog_len
Definition wtap_opttypes.h:483
wtap_bpf_insn_t * bpf_prog
Definition wtap_opttypes.h:484
Definition file-pcapng.h:57
Definition wtap_opttypes.h:509
Definition wtap_opttypes.h:500
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
Definition wtap_opttypes.h:463
Definition wtap_opttypes.h:538
wtap_optval_t value
Definition wtap_opttypes.h:540
unsigned option_id
Definition wtap_opttypes.h:539
Definition wtap_opttypes.h:550
wtap_opttype_e data_type
Definition wtap_opttypes.h:553
const char * description
Definition wtap_opttypes.h:552
const char * name
Definition wtap_opttypes.h:551
unsigned flags
Definition wtap_opttypes.h:554
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
Definition wtap_opttypes.h:517
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: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
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)
Definition wtap_opttypes.c:778
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:960
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: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
Definition wtap_opttypes.c:1619
WS_DLL_PUBLIC wtap_block_t wtap_block_make_copy(wtap_block_t block)
Definition wtap_opttypes.c:570
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:791
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: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
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)
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)
Definition wtap_opttypes.c:804
WS_DLL_PUBLIC void wtap_opttype_block_register(wtap_blocktype_t *blocktype)
Definition wtap_opttypes.c:185
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:1218
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: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
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
Definition wtap_opttypes.c:1575
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)
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
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)
Definition wtap_opttypes.c:1632
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:973
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:882
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:1320
WS_DLL_PUBLIC wtap_block_t wtap_block_create(wtap_block_type_t block_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)
Definition wtap_opttypes.c:399
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:869
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:1687
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: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)
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)
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)
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)
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)
Definition wtap_opttypes.c:1492
WS_DLL_PUBLIC void wtap_opttypes_initialize(void)
Definition wtap_opttypes.c:1906
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:1012
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: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
Definition wtap_opttypes.c:947
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:1601
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:908
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:450
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:1135
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:1293
struct wtapng_iface_descriptions_s wtapng_iface_descriptions_t
WS_DLL_PUBLIC void wtap_block_unref(wtap_block_t 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)
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
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)
Definition wtap_opttypes.c:1270
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:999
WS_DLL_PUBLIC void wtap_opttypes_cleanup(void)
Definition wtap_opttypes.c:2403
WS_DLL_PUBLIC wtap_block_type_t wtap_block_get_type(wtap_block_t block)
Definition wtap_opttypes.c:262
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:895
WS_DLL_PUBLIC void * wtap_block_get_mandatory_data(wtap_block_t block)
Definition wtap_opttypes.c:267
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:765
WS_DLL_PUBLIC void wtap_block_copy(wtap_block_t dest_block, wtap_block_t src_block)
Definition wtap_opttypes.c:480
WS_DLL_PUBLIC void wtap_block_array_free(GArray *block_array)
Definition wtap_opttypes.c:437
WS_DLL_PUBLIC void wtap_block_array_unref(GArray *block_array)
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)
Definition wtap_opttypes.c:1257
WS_DLL_PUBLIC wtap_opttype_return_val wtap_block_remove_option(wtap_block_t block, unsigned option_id)
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)
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)
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)
Definition wtap_opttypes.c:1525
WS_DLL_PUBLIC unsigned wtap_block_count_option(wtap_block_t block, unsigned option_id)
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
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)
Definition wtap_opttypes.c:1459