| Wireshark 4.7.0 The Wireshark network protocol analyzer

Loading...
Searching...
No Matches
Classes | Macros | Typedefs | Enumerations | Functions
wtap_opttypes.h File Reference
`#include "ws_symbol_export.h"`
`#include <wsutil/inet_addr.h>`

Go to the source code of this file.

## Classes
struct | wtap_blocktype_t
struct | wtap_block
struct | wtapng_section_mandatory_s
struct | wtapng_iface_descriptions_s
struct | wtapng_dpib_lookup_info_s
struct | wtapng_if_descr_mandatory_s
struct | wtapng_nrb_mandatory_s
struct | wtapng_if_stats_mandatory_s
struct | wtapng_dsb_mandatory_s
struct | wtapng_meta_event_mandatory_s
struct | wtapng_darwin_process_event_mandatory_s
struct | wtapng_ft_specific_mandatory_s
struct | custom_string_opt_s
struct | binary_optdata
struct | custom_binary_opt_s
struct | wtap_bpf_insn_s
| Berkeley Packet Filter (BPF) instruction. More...
struct | if_filter_opt_s
struct | packet_verdict_opt_s
struct | packet_hash_opt_s
union | wtap_optval_t
struct | wtap_option_t
struct | wtap_opttype_t

## Macros
#define | OPT_EOFOPT 0
#define | OPT_COMMENT 1
#define | OPT_CUSTOM_STR_COPY 2988
#define | OPT_CUSTOM_BIN_COPY 2989
#define | OPT_CUSTOM_STR_NO_COPY 19372
#define | OPT_CUSTOM_BIN_NO_COPY 19373
#define | OPT_SHB_HARDWARE 2
#define | OPT_SHB_OS 3
#define | OPT_SHB_USERAPPL 4
#define | OPT_IDB_NAME 2
#define | OPT_IDB_DESCRIPTION 3
#define | OPT_IDB_IP4ADDR 4
#define | OPT_IDB_IP6ADDR 5
#define | OPT_IDB_MACADDR 6
#define | OPT_IDB_EUIADDR 7
#define | OPT_IDB_SPEED 8
#define | OPT_IDB_TSRESOL 9
#define | OPT_IDB_TZONE 10
#define | OPT_IDB_FILTER 11
#define | OPT_IDB_OS 12
#define | OPT_IDB_FCSLEN 13
#define | OPT_IDB_TSOFFSET 14
#define | OPT_IDB_HARDWARE 15
#define | OPT_IDB_TXSPEED 16
#define | OPT_IDB_RXSPEED 17
#define | OPT_IDB_IANA_TZNAME 18
#define | OPT_PKT_FLAGS 2
#define | OPT_PKT_HASH 3
#define | OPT_PKT_DROPCOUNT 4
#define | OPT_PKT_PACKETID 5
#define | OPT_PKT_QUEUE 6
#define | OPT_PKT_VERDICT 7
#define | OPT_PKT_PROCIDTHRDID 8
#define | OPT_NS_DNSNAME 2
#define | OPT_NS_DNSIP4ADDR 3
#define | OPT_NS_DNSIP6ADDR 4
#define | OPT_ISB_STARTTIME 2
#define | OPT_ISB_ENDTIME 3
#define | OPT_ISB_IFRECV 4
#define | OPT_ISB_IFDROP 5
#define | OPT_ISB_FILTERACCEPT 6
#define | OPT_ISB_OSDROP 7
#define | OPT_ISB_USRDELIV 8
#define | OPT_DPIB_NAME 2
#define | OPT_DPIB_UUID 4
#define | OPT_PKT_DARWIN_PIB_ID 32769
#define | OPT_PKT_DARWIN_SVC_CODE 32770
#define | OPT_PKT_DARWIN_EFFECTIVE_PIB_ID 32771
#define | OPT_PKT_DARWIN_MD_FLAGS 32772
#define | OPT_PKT_DARWIN_FLOW_ID 32773
#define | OPT_PKT_DARWIN_TRACE_TAG 32774
#define | OPT_PKT_DARWIN_DROP_REASON 32775
#define | OPT_PKT_DARWIN_DROP_LINE 32776
#define | OPT_PKT_DARWIN_DROP_FUNC 32777
#define | OPT_PKT_DARWIN_COMP_GENCNT 32778
#define | PEN_VCTR 46254
#define | GET_OPTION_TYPE(options, option_id) (const wtap_opttype_t *)g_hash_table_lookup((options), GUINT_TO_POINTER(option_id))

## Typedefs
typedef struct wtap_block * | wtap_block_t
typedef void(* | wtap_block_create_func) (wtap_block_t block)
typedef void(* | wtap_mand_free_func) (wtap_block_t block)
typedef void(* | wtap_mand_copy_func) (wtap_block_t dest_block, wtap_block_t src_block)
typedef struct wtap_blocktype_t | wtap_blocktype_t
typedef struct wtapng_section_mandatory_s | wtapng_section_mandatory_t
typedef struct wtapng_iface_descriptions_s | wtapng_iface_descriptions_t
typedef struct wtapng_dpib_lookup_info_s | wtapng_dpib_lookup_info_t
typedef struct wtapng_if_descr_mandatory_s | wtapng_if_descr_mandatory_t
typedef struct wtapng_nrb_mandatory_s | wtapng_nrb_mandatory_t
typedef struct wtapng_if_stats_mandatory_s | wtapng_if_stats_mandatory_t
typedef struct wtapng_dsb_mandatory_s | wtapng_dsb_mandatory_t
typedef struct wtapng_meta_event_mandatory_s | wtapng_meta_event_mandatory_t
typedef struct wtapng_darwin_process_event_mandatory_s | wtapng_darwin_process_event_mandatory_t
typedef struct wtapng_ft_specific_mandatory_s | wtapng_ft_specific_mandatory_t
typedef struct custom_string_opt_s | custom_string_opt_t
typedef struct binary_optdata | binary_optdata_t
typedef struct custom_binary_opt_s | custom_binary_opt_t
typedef struct wtap_bpf_insn_s | wtap_bpf_insn_t
| Berkeley Packet Filter (BPF) instruction.
typedef struct if_filter_opt_s | if_filter_opt_t
typedef struct packet_verdict_opt_s | packet_verdict_opt_t
typedef struct packet_hash_opt_s | packet_hash_opt_t
typedef 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.

## Enumerations
enum | wtap_block_type_t { WTAP_BLOCK_SECTION = 0 , WTAP_BLOCK_IF_ID_AND_INFO , WTAP_BLOCK_NAME_RESOLUTION , WTAP_BLOCK_IF_STATISTICS , WTAP_BLOCK_DECRYPTION_SECRETS , WTAP_BLOCK_PACKET , WTAP_BLOCK_FT_SPECIFIC_REPORT , WTAP_BLOCK_FT_SPECIFIC_EVENT , WTAP_BLOCK_SYSDIG_EVENT , WTAP_BLOCK_META_EVENT , WTAP_BLOCK_SYSTEMD_JOURNAL_EXPORT , WTAP_BLOCK_CUSTOM , WTAP_BLOCK_FT_SPECIFIC_INFORMATION , MAX_WTAP_BLOCK_TYPE_VALUE }
enum | wtap_opttype_e { WTAP_OPTTYPE_UINT8 , WTAP_OPTTYPE_UINT32 , WTAP_OPTTYPE_UINT64 , WTAP_OPTTYPE_STRING , WTAP_OPTTYPE_BYTES , WTAP_OPTTYPE_IPv4 , WTAP_OPTTYPE_IPv6 , WTAP_OPTTYPE_CUSTOM_STRING , WTAP_OPTTYPE_CUSTOM_BINARY , WTAP_OPTTYPE_IF_FILTER , WTAP_OPTTYPE_PACKET_VERDICT , WTAP_OPTTYPE_PACKET_HASH , WTAP_OPTTYPE_INT8 , WTAP_OPTTYPE_INT32 , WTAP_OPTTYPE_INT64 }
enum | wtap_opttype_return_val { WTAP_OPTTYPE_SUCCESS = 0 , WTAP_OPTTYPE_NO_SUCH_OPTION = -1 , WTAP_OPTTYPE_NOT_FOUND = -2 , WTAP_OPTTYPE_TYPE_MISMATCH = -3 , WTAP_OPTTYPE_NUMBER_MISMATCH = -4 , WTAP_OPTTYPE_ALREADY_EXISTS = -5 , WTAP_OPTTYPE_BAD_BLOCK = -6 , WTAP_OPTTYPE_PEN_MISMATCH = -7 }
enum | if_filter_type_e { if_filter_pcap = 0 , if_filter_bpf = 1 }
| Type of capture filter. More...
enum | packet_verdict_type_e { packet_verdict_hardware = 0 , packet_verdict_linux_ebpf_tc = 1 , packet_verdict_linux_ebpf_xdp = 2 }

## Functions
WS_DLL_PUBLIC void | wtap_opttypes_initialize (void)
| Initialize block types.
WS_DLL_PUBLIC wtap_block_t | wtap_block_create (wtap_block_type_t block_type)
| Create a block by type.
WS_DLL_PUBLIC wtap_block_t | wtap_block_ref (wtap_block_t block)
| Increase reference count of a block.
WS_DLL_PUBLIC void | wtap_block_unref (wtap_block_t block)
| Decrease reference count of a block.
WS_DLL_PUBLIC void | wtap_block_array_free (GArray *block_array)
| Free an array of blocks.
WS_DLL_PUBLIC void | wtap_block_array_unref (GArray *block_array)
| Decrement the reference count of an array of blocks.
WS_DLL_PUBLIC void | wtap_block_array_ref (GArray *block_array)
| Increment the reference count of an array of blocks.
WS_DLL_PUBLIC void | wtap_opttype_block_register (wtap_blocktype_t *blocktype)
| Register a block type handler.
WS_DLL_PUBLIC wtap_block_type_t | wtap_block_get_type (wtap_block_t block)
| Provide type of a block.
WS_DLL_PUBLIC void * | wtap_block_get_mandatory_data (wtap_block_t block)
| Provide mandatory data of a block.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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 string.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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 Enterprise Number, in a block.
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.
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.
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.
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.
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.
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.
WS_DLL_PUBLIC void | wtap_packet_verdict_free (packet_verdict_opt_t *verdict)
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.
WS_DLL_PUBLIC void | wtap_packet_hash_free (packet_hash_opt_t *hash)
WS_DLL_PUBLIC wtap_opttype_return_val | wtap_block_remove_option (wtap_block_t block, unsigned option_id)
| Remove an option from a block.
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.
WS_DLL_PUBLIC void | wtap_block_copy (wtap_block_t dest_block, wtap_block_t src_block)
| Copy a block to another.
WS_DLL_PUBLIC wtap_block_t | wtap_block_make_copy (wtap_block_t block)
| Make a copy of a block.
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.
WS_DLL_PUBLIC void | wtap_opttypes_cleanup (void)
| Cleanup the internal structures.

## Detailed Description

Wireshark - Network traffic analyzer By Gerald Combs geral.nosp@m.d@wi.nosp@m.resha.nosp@m.rk.o.nosp@m.rg Copyright 2001 Gerald Combs

SPDX-License-Identifier: GPL-2.0-or-later

## Macro Definition Documentation

## ◆ OPT_COMMENT

#define OPT_COMMENT 1

A UTF-8 string containing a human-readable comment.

## ◆ OPT_CUSTOM_BIN_COPY

#define OPT_CUSTOM_BIN_COPY 2989

A custom option containing binary data, copying allowed.

## ◆ OPT_CUSTOM_BIN_NO_COPY

#define OPT_CUSTOM_BIN_NO_COPY 19373

A custom option containing binary data, copying not allowed.

## ◆ OPT_CUSTOM_STR_COPY

#define OPT_CUSTOM_STR_COPY 2988

A custom option containing a UTF-8 string, copying allowed.

## ◆ OPT_CUSTOM_STR_NO_COPY

#define OPT_CUSTOM_STR_NO_COPY 19372

A custom option containing a UTF-8 string, copying not allowed.

## ◆ OPT_DPIB_NAME

#define OPT_DPIB_NAME 2

Process name: NUL-terminated UTF8 string (limited to 16 characters including the NUL)

## ◆ OPT_DPIB_UUID

#define OPT_DPIB_UUID 4

Process UUID: 16 byte

## ◆ OPT_EOFOPT

#define OPT_EOFOPT 0

Appears in pcapng files, but not in blocks.

## ◆ OPT_IDB_DESCRIPTION

#define OPT_IDB_DESCRIPTION 3

A UTF-8 string containing the description of the device used to capture data. "Wi-Fi" / "Local Area Connection" / "Wireless Network Connection" / "First Ethernet Interface"

## ◆ OPT_IDB_EUIADDR

#define OPT_IDB_EUIADDR 7

XXX: if_EUIaddr Interface Hardware EUI address (64 bits)

## ◆ OPT_IDB_FCSLEN

#define OPT_IDB_FCSLEN 13

An integer value that specified the length of the Frame Check Sequence (in bits) for this interface. For link layers whose FCS length can change during time, the Packet Block Flags Word can be used (see Appendix A (Packet Block Flags Word))

## ◆ OPT_IDB_FILTER

#define OPT_IDB_FILTER 11

The filter (e.g. "capture only TCP traffic") used to capture traffic. The first byte of the Option Data keeps a code of the filter used (e.g. if this is a libpcap string, or BPF bytecode, and more). More details about this format will be presented in Appendix XXX (TODO). (TODO: better use different options for different fields? e.g. if_filter_pcap, if_filter_bpf, ...) 00 "tcp port 23 and host 10.0.0.5"

## ◆ OPT_IDB_HARDWARE

#define OPT_IDB_HARDWARE 15

A UTF-8 string containing the description of the hardware of the device used to capture data. "Broadcom NetXtreme" / "Intel(R) PRO/1000 MT Network Connection" / "NETGEAR WNA1000Mv2 N150 Wireless USB Micro Adapter"

## ◆ OPT_IDB_IANA_TZNAME

#define OPT_IDB_IANA_TZNAME 18

A UTF-8 string that indicates the IANA time zone database timezone name for the IANA database timezone in which the interface is located.

## ◆ OPT_IDB_IP4ADDR

#define OPT_IDB_IP4ADDR 4

XXX: if_IPv4addr Interface network address and netmask. This option can be repeated multiple times within the same Interface Description Block when multiple IPv4 addresses are assigned to the interface. 192 168 1 1 255 255 255 0

## ◆ OPT_IDB_IP6ADDR

#define OPT_IDB_IP6ADDR 5

XXX: if_IPv6addr Interface network address and prefix length (stored in the last byte). This option can be repeated multiple times within the same Interface Description Block when multiple IPv6 addresses are assigned to the interface. 2001:0db8:85a3:08d3:1319:8a2e:0370:7344/64 is written (in hex) as "20 01 0d b8 85 a3 08 d3 13 19 8a 2e 03 70 73 44 40"

## ◆ OPT_IDB_MACADDR

#define OPT_IDB_MACADDR 6

XXX: if_MACaddr Interface Hardware MAC address (48 bits).

## ◆ OPT_IDB_NAME

#define OPT_IDB_NAME 2

A UTF-8 string containing the name of the device used to capture data. "eth0" / "\Device\NPF_{AD1CE675-96D0-47C5-ADD0-2504B9126B68}"

## ◆ OPT_IDB_OS

#define OPT_IDB_OS 12

A UTF-8 string containing the name of the operating system of the machine in which this interface is installed. This can be different from the same information that can be contained by the Section Header Block (Section 3.1 (Section Header Block (mandatory))) because the capture can have been done on a remote machine. "Windows XP SP2" / "openSUSE 10.2"

## ◆ OPT_IDB_RXSPEED

#define OPT_IDB_RXSPEED 17

A 64-bit unsigned integer indicating the interface receive speed in bits per second.

## ◆ OPT_IDB_SPEED

#define OPT_IDB_SPEED 8

Interface speed (in bps). 100000000 for 100Mbps

## ◆ OPT_IDB_TSOFFSET

#define OPT_IDB_TSOFFSET 14

A 64-bit signed integer value that specifies an offset (in seconds) that must be added to the timestamp of each packet to obtain the absolute timestamp of a packet. If the option is not present, an offset of 0 is assumed (i.e., timestamps in blocks are absolute timestamps).

This offset is not intended to be used as an offset between local time and UTC; for this purpose, the if_iana_tzname option SHOULD be used to specify a timezone.

## ◆ OPT_IDB_TSRESOL

#define OPT_IDB_TSRESOL 9

Resolution of timestamps. If the Most Significant Bit is equal to zero, the remaining bits indicates the resolution of the timestamp as a negative power of 10 (e.g. 6 means microsecond resolution, timestamps are the number of microseconds since 1/1/1970). If the Most Significant Bit is equal to one, the remaining bits indicates the resolution has a negative power of 2 (e.g. 10 means 1/1024 of second). If this option is not present, a resolution of 10^-6 is assumed (i.e. timestamps have the same resolution of the standard 'libpcap' timestamps).

## ◆ OPT_IDB_TXSPEED

#define OPT_IDB_TXSPEED 16

A 64-bit unsigned integer indicating the interface transmit speed in bits per second.

## ◆ OPT_IDB_TZONE

#define OPT_IDB_TZONE 10

Time zone for GMT support. This option has neer been specified in greater detail and, unless it were to identify something such as an IANA time zone database timezone, would be insufficient for converting between UTC and local time. Therefore, it SHOULD NOT be used; instead, the if_iana_tzname option SHOULD be used if time zone information is to be specified.

## ◆ OPT_PKT_DARWIN_COMP_GENCNT

#define OPT_PKT_DARWIN_COMP_GENCNT 32778

32-bit current value of the compression generation count (epoch).

## ◆ OPT_PKT_DARWIN_DROP_FUNC

#define OPT_PKT_DARWIN_DROP_FUNC 32777

NUL-terminated name of the dropping function.

## ◆ OPT_PKT_DARWIN_DROP_LINE

#define OPT_PKT_DARWIN_DROP_LINE 32776

16-bit drop line.

## ◆ OPT_PKT_DARWIN_DROP_REASON

#define OPT_PKT_DARWIN_DROP_REASON 32775

32-bit drop reason.

## ◆ OPT_PKT_DARWIN_EFFECTIVE_PIB_ID

#define OPT_PKT_DARWIN_EFFECTIVE_PIB_ID 32771

32-bit number of the Darwin PIB that describes the Effective Process ID.

## ◆ OPT_PKT_DARWIN_FLOW_ID

#define OPT_PKT_DARWIN_FLOW_ID 32773

32-bit opaque flow identifier.

## ◆ OPT_PKT_DARWIN_MD_FLAGS

#define OPT_PKT_DARWIN_MD_FLAGS 32772

32-bit bitmask containing the packet metadata flags.

## ◆ OPT_PKT_DARWIN_PIB_ID

#define OPT_PKT_DARWIN_PIB_ID 32769

32-bit number of the Darwin PIB that describes the Process ID.

## ◆ OPT_PKT_DARWIN_SVC_CODE

#define OPT_PKT_DARWIN_SVC_CODE 32770

32-bit type of service code.

## ◆ OPT_PKT_DARWIN_TRACE_TAG

#define OPT_PKT_DARWIN_TRACE_TAG 32774

16-bit opaque trace tag.

## ◆ OPT_SHB_HARDWARE

#define OPT_SHB_HARDWARE 2

A UTF-8 string containing the description of the hardware used to create this section.

## ◆ OPT_SHB_OS

#define OPT_SHB_OS 3

A UTF-8 string containing the name of the operating system used to create this section.

## ◆ OPT_SHB_USERAPPL

#define OPT_SHB_USERAPPL 4

A UTF-8 string containing the name of the application used to create this section.

## Typedef Documentation

## ◆ wtap_block_foreach_func

wtap_block_foreach_func

Callback type for iterating over block options.

Called once for each option in a block. Returning false stops iteration.

Parameters

  block | The block being inspected.
  option_id | The ID of the current option.
  option_type | The type of the option.
  option | Pointer to the option value.
  user_data | User-defined context passed to the callback.

Returns
  true to continue iteration; false to stop.

## ◆ wtap_bpf_insn_t

typedef struct wtap_bpf_insn_s wtap_bpf_insn_t

Berkeley Packet Filter (BPF) instruction.

Represents a single BPF instruction used for packet filtering. Each instruction includes an opcode, jump targets, and a constant.

## ◆ wtapng_darwin_process_event_mandatory_t

typedef struct wtapng_darwin_process_event_mandatory_s wtapng_darwin_process_event_mandatory_t

Holds the required data from a WTAP_BLOCK_PACKET. This includes Enhanced Packet Block, Simple Packet Block, and the deprecated Packet Block. NB. I'm not including the packet data here since Wireshark handles it in other ways. If we were to add it we'd need to implement copy and free routines in wtap_opttypes.c Holds the required data from a WTAP_BLOCK_LEGACY_DARWIN_PROCESS_EVENT.

## ◆ wtapng_dpib_lookup_info_t

typedef struct wtapng_dpib_lookup_info_s wtapng_dpib_lookup_info_t

struct holding the information to lookup a Darwin PIB. the dpibs array holds an array of wtap_block_t representing Darwin PIBs, one per PIB.

## ◆ wtapng_dsb_mandatory_t

typedef struct wtapng_dsb_mandatory_s wtapng_dsb_mandatory_t

Holds the required data from a WTAP_BLOCK_DECRYPTION_SECRETS.

## ◆ wtapng_ft_specific_mandatory_t

typedef struct wtapng_ft_specific_mandatory_s wtapng_ft_specific_mandatory_t

Holds the required data from a WTAP_BLOCK_FT_SPECIFIC_REPORT.

## ◆ wtapng_if_descr_mandatory_t

typedef struct wtapng_if_descr_mandatory_s wtapng_if_descr_mandatory_t

Holds the required data from a WTAP_BLOCK_IF_ID_AND_INFO.

## ◆ wtapng_if_stats_mandatory_t

typedef struct wtapng_if_stats_mandatory_s wtapng_if_stats_mandatory_t

Holds the required data from a WTAP_BLOCK_IF_STATISTICS.

## ◆ wtapng_iface_descriptions_t

typedef struct wtapng_iface_descriptions_s wtapng_iface_descriptions_t

struct holding the information to build a WTAP_BLOCK_IF_ID_AND_INFO. the interface_data array holds an array of wtap_block_t representing interfaces, one per interface.

## ◆ wtapng_meta_event_mandatory_t

typedef struct wtapng_meta_event_mandatory_s wtapng_meta_event_mandatory_t

Holds the required data from a WTAP_BLOCK_META_EVENT.

## ◆ wtapng_nrb_mandatory_t

typedef struct wtapng_nrb_mandatory_s wtapng_nrb_mandatory_t

Holds the required data from a WTAP_BLOCK_NAME_RESOLUTION.

## ◆ wtapng_section_mandatory_t

typedef struct wtapng_section_mandatory_s wtapng_section_mandatory_t

Holds the required data from a WTAP_BLOCK_SECTION.

## Enumeration Type Documentation

## ◆ if_filter_type_e

enum if_filter_type_e

Type of capture filter.

Specifies the format used to define a filter for an interface.

## Function Documentation

## ◆ wtap_block_add_bytes_option()

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.

Parameters

  [in] | block | Block to which to add the option
  [in] | option_id | Identifier value for option
  [in] | value | Value of option to copy
  [in] | value_length | Number of bytes to copy

Returns
  wtap_opttype_return_val - WTAP_OPTTYPE_SUCCESS if successful, error code otherwise

## ◆ wtap_block_add_bytes_option_borrow()

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.

Parameters

  [in] | block | Block to which to add the option
  [in] | option_id | Identifier value for option
  [in] | value | Value of option as a GBytes

Returns
  wtap_opttype_return_val - WTAP_OPTTYPE_SUCCESS if successful, error code otherwise

## ◆ wtap_block_add_custom_binary_option()

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.

Parameters

  [in] | block | Block to which to add the option
  [in] | option_id | Identifier value for option
  [in] | pen | Private Enterprise Number value for option
  [in] | value | Value of option

Returns
  wtap_opttype_return_val - WTAP_OPTTYPE_SUCCESS if successful, error code otherwise

## ◆ wtap_block_add_custom_binary_option_from_data()

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.

Parameters

  [in] | block | Block to which to add the option
  [in] | option_id | Identifier value for option
  [in] | pen | Private Enterprise Number value for option
  [in] | data | Raw data of option
  [in] | data_size | Size of raw data

Returns
  wtap_opttype_return_val - WTAP_OPTTYPE_SUCCESS if successful, error code otherwise

## ◆ wtap_block_add_custom_string_option()

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.

Parameters

  [in] | block | Block to which to add the option
  [in] | option_id | Identifier value for option
  [in] | pen | Private Enterprise Number value for option
  [in] | value | Value of option
  [in] | value_length | Maximum length of string to copy.

Returns
  wtap_opttype_return_val - WTAP_OPTTYPE_SUCCESS if successful, error code otherwise

## ◆ wtap_block_add_if_filter_option()

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.

Parameters

  [in] | block | Block to which to add the option
  [in] | option_id | Identifier value for option
  [in] | value | Value of option

Returns
  wtap_opttype_return_val - WTAP_OPTTYPE_SUCCESS if successful, error code otherwise

## ◆ wtap_block_add_int32_option()

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.

Parameters

  [in] | block | Block to which to add the option
  [in] | option_id | Identifier value for option
  [in] | value | Value of option

Returns
  wtap_opttype_return_val - WTAP_OPTTYPE_SUCCESS if successful, error code otherwise

## ◆ wtap_block_add_int64_option()

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.

Parameters

  [in] | block | Block to which to add the option
  [in] | option_id | Identifier value for option
  [in] | value | Value of option

Returns
  wtap_opttype_return_val - WTAP_OPTTYPE_SUCCESS if successful, error code otherwise

## ◆ wtap_block_add_int8_option()

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.

Parameters

  [in] | block | Block to which to add the option
  [in] | option_id | Identifier value for option
  [in] | value | Value of option

Returns
  wtap_opttype_return_val - WTAP_OPTTYPE_SUCCESS if successful, error code otherwise

## ◆ wtap_block_add_ipv4_option()

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.

Parameters

  [in] | block | Block to which to add the option
  [in] | option_id | Identifier value for option
  [in] | value | Value of option

Returns
  wtap_opttype_return_val - WTAP_OPTTYPE_SUCCESS if successful, error code otherwise

## ◆ wtap_block_add_ipv6_option()

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.

Parameters

  [in] | block | Block to which to add the option
  [in] | option_id | Identifier value for option
  [in] | value | Value of option

Returns
  wtap_opttype_return_val - WTAP_OPTTYPE_SUCCESS if successful, error code otherwise

## ◆ wtap_block_add_packet_hash_option()

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.

Parameters

  [in] | block | Block to which to add the option
  [in] | option_id | Identifier value for option
  [in] | value | Value of option

Returns
  wtap_opttype_return_val - WTAP_OPTTYPE_SUCCESS if successful, error code otherwise

## ◆ wtap_block_add_packet_verdict_option()

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.

Parameters

  [in] | block | Block to which to add the option
  [in] | option_id | Identifier value for option
  [in] | value | Value of option

Returns
  wtap_opttype_return_val - WTAP_OPTTYPE_SUCCESS if successful, error code otherwise

## ◆ wtap_block_add_string_option()

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.

Parameters

  [in] | block | Block to which to add the option
  [in] | option_id | Identifier value for option
  [in] | value | Value of option
  [in] | value_length | Maximum length of string to copy.

Returns
  wtap_opttype_return_val - WTAP_OPTTYPE_SUCCESS if successful, error code otherwise

## ◆ wtap_block_add_string_option_format()

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.

Parameters

  [in] | block | Block to which to add the option
  [in] | option_id | Identifier value for option
  [in] | format | printf-like format string

Returns
  wtap_opttype_return_val - WTAP_OPTTYPE_SUCCESS if successful, error code otherwise

## ◆ wtap_block_add_string_option_owned()

WS_DLL_PUBLIC wtap_opttype_return_val wtap_block_add_string_option_owned | ( | wtap_block_t | block,
|  | unsigned | option_id,
|  | char * | value
| ) |  |

Add a string option to a block taking ownership of the null-terminated string.

Parameters

  [in] | block | Block to which to add the option
  [in] | option_id | Identifier value for option
  [in] | value | Value of option

Returns
  wtap_opttype_return_val - WTAP_OPTTYPE_SUCCESS if successful (caller no longer owns `value`), error code otherwise (caller still owns `value`)

Note
  To avoid memory leaks, the caller must examine the return status to determine ownership of `value`.

## ◆ wtap_block_add_uint32_option()

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.

Parameters

  [in] | block | Block to which to add the option
  [in] | option_id | Identifier value for option
  [in] | value | Value of option

Returns
  wtap_opttype_return_val - WTAP_OPTTYPE_SUCCESS if successful, error code otherwise

## ◆ wtap_block_add_uint64_option()

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.

Parameters

  [in] | block | Block to which to add the option
  [in] | option_id | Identifier value for option
  [in] | value | Value of option

Returns
  wtap_opttype_return_val - WTAP_OPTTYPE_SUCCESS if successful, error code otherwise

## ◆ wtap_block_add_uint8_option()

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.

Parameters

  [in] | block | Block to which to add the option
  [in] | option_id | Identifier value for option
  [in] | value | Value of option

Returns
  wtap_opttype_return_val - WTAP_OPTTYPE_SUCCESS if successful, error code otherwise

## ◆ wtap_block_array_free()

WS_DLL_PUBLIC void wtap_block_array_free | ( | GArray * | block_array | ) |

Free an array of blocks.

Needs to be called to clean up blocks allocated through GArray (for multiple blocks of same type) Includes freeing the GArray

Parameters

  [in] | block_array | Array of blocks to be freed

## ◆ wtap_block_array_ref()

WS_DLL_PUBLIC void wtap_block_array_ref | ( | GArray * | block_array | ) |

Increment the reference count of an array of blocks.

Increment the reference count of each block in the array and the GArray itself.

Parameters

  [in] | block_array | Array of blocks to be referenced

## ◆ wtap_block_array_unref()

WS_DLL_PUBLIC void wtap_block_array_unref | ( | GArray * | block_array | ) |

Decrement the reference count of an array of blocks.

Decrement the reference count of each block in the array and the GArray itself. Any element whose reference count drops to 0 will be freed. If the GArray and every block has a reference count of 1, this is the same as wtap_block_array_free().

Parameters

  [in] | block_array | Array of blocks to be dereferenced

## ◆ wtap_block_copy()

WS_DLL_PUBLIC void wtap_block_copy | ( | wtap_block_t | dest_block,
|  | wtap_block_t | src_block
| ) |  |

Copy a block to another.

Any options that are in the destination but not the source are not removed. Options that are just in source will be added to destination

Parameters

  [in] | dest_block | Block to be copied to
  [in] | src_block | Block to be copied from

## ◆ wtap_block_count_option()

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.

Parameters

  [in] | block | Block to which to add the option
  [in] | option_id | Identifier value for option

Returns
  unsigned - the number of times the option was found

## ◆ wtap_block_create()

WS_DLL_PUBLIC wtap_block_t wtap_block_create | ( | wtap_block_type_t | block_type | ) |

Create a block by type.

Return a newly allocated block with default options provided

Parameters

  [in] | block_type | Block type to be created

Returns
  Newly allocated block

## ◆ wtap_block_foreach_option()

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.

Invokes the given callback for each option in the block. Stops early if the callback returns false.

Parameters

  block | The block to inspect.
  func | Callback to invoke for each option.
  user_data | User-defined context passed to the callback.

Returns
  true if all options were visited; false if iteration was stopped early.

## ◆ wtap_block_get_bytes_option_value()

WS_DLL_PUBLIC wtap_opttype_return_val wtap_block_get_bytes_option_value | ( | wtap_block_t | block,
|  | unsigned | option_id,
|  | GBytes ** | value
| ) |  |

Get bytes option value from a block.

Parameters

  [in] | block | Block from which to get the option value
  [in] | option_id | Identifier value for option
  [out] | value | Returned value of option

Returns
  wtap_opttype_return_val - WTAP_OPTTYPE_SUCCESS if successful, error code otherwise

Note
  You should call g_bytes_ref() on value if you plan to keep it around (and then g_bytes_unref() when you're done with it).

## ◆ wtap_block_get_if_filter_option_value()

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
| ) |  |

Get an if_filter option value from a block.

Parameters

  [in] | block | Block from which to get the option value
  [in] | option_id | Identifier value for option
  [out] | value | Returned value of option value

Returns
  wtap_opttype_return_val - WTAP_OPTTYPE_SUCCESS if successful, error code otherwise

## ◆ wtap_block_get_int32_option_value()

WS_DLL_PUBLIC wtap_opttype_return_val wtap_block_get_int32_option_value | ( | wtap_block_t | block,
|  | unsigned | option_id,
|  | int32_t * | value
| ) |  |

Get INT32 option value from a block.

Parameters

  [in] | block | Block from which to get the option value
  [in] | option_id | Identifier value for option
  [out] | value | Returned value of option

Returns
  wtap_opttype_return_val - WTAP_OPTTYPE_SUCCESS if successful, error code otherwise

## ◆ wtap_block_get_int64_option_value()

WS_DLL_PUBLIC wtap_opttype_return_val wtap_block_get_int64_option_value | ( | wtap_block_t | block,
|  | unsigned | option_id,
|  | int64_t * | value
| ) |  |

Get INT64 option value from a block.

Parameters

  [in] | block | Block from which to get the option value
  [in] | option_id | Identifier value for option
  [out] | value | Returned value of option

Returns
  wtap_opttype_return_val - WTAP_OPTTYPE_SUCCESS if successful, error code otherwise

## ◆ wtap_block_get_int8_option_value()

WS_DLL_PUBLIC wtap_opttype_return_val wtap_block_get_int8_option_value | ( | wtap_block_t | block,
|  | unsigned | option_id,
|  | int8_t * | value
| ) |  |

Get INT8 option value from a block.

Parameters

  [in] | block | Block from which to get the option value
  [in] | option_id | Identifier value for option
  [out] | value | Returned value of option

Returns
  wtap_opttype_return_val - WTAP_OPTTYPE_SUCCESS if successful, error code otherwise

## ◆ wtap_block_get_ipv4_option_value()

WS_DLL_PUBLIC wtap_opttype_return_val wtap_block_get_ipv4_option_value | ( | wtap_block_t | block,
|  | unsigned | option_id,
|  | uint32_t * | value
| ) |  |

Get IPv4 option value from a block.

Parameters

  [in] | block | Block from which to get the option value
  [in] | option_id | Identifier value for option
  [out] | value | Returned value of option

Returns
  wtap_opttype_return_val - WTAP_OPTTYPE_SUCCESS if successful, error code otherwise

## ◆ wtap_block_get_ipv6_option_value()

WS_DLL_PUBLIC wtap_opttype_return_val wtap_block_get_ipv6_option_value | ( | wtap_block_t | block,
|  | unsigned | option_id,
|  | ws_in6_addr * | value
| ) |  |

Get IPv6 option value from a block.

Parameters

  [in] | block | Block from which to get the option value
  [in] | option_id | Identifier value for option
  [out] | value | Returned value of option

Returns
  wtap_opttype_return_val - WTAP_OPTTYPE_SUCCESS if successful, error code otherwise

## ◆ wtap_block_get_mandatory_data()

WS_DLL_PUBLIC void * wtap_block_get_mandatory_data | ( | wtap_block_t | block | ) |

Provide mandatory data of a block.

Parameters

  [in] | block | Block from which to retrieve mandatory data

Returns
  Block mandatory data. Structure varies based on block type

## ◆ wtap_block_get_nth_bytes_option_value()

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
| ) |  |

Get bytes option value for nth instance of a particular option in a block.

Parameters

  [in] | block | Block from which to get the option value
  [in] | option_id | Identifier value for option
  [in] | idx | Instance number of option with that ID
  [out] | value | Returned value of option

Returns
  wtap_opttype_return_val - WTAP_OPTTYPE_SUCCESS if successful, error code otherwise

Note
  You should call g_bytes_ref() on value if you plan to keep it around (and then g_bytes_unref() when you're done with it).

## ◆ wtap_block_get_nth_custom_binary_option_value()

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 Enterprise Number, in a block.

Parameters

  [in] | block | Block from which to get the option value
  [in] | option_id | Identifier value for option
  [in] | pen | Private Enterprise Number value for option
  [in] | idx | Instance number of option with that ID
  [out] | value | Returned value of option

Returns
  wtap_opttype_return_val - WTAP_OPTTYPE_SUCCESS if successful, error code otherwise

## ◆ wtap_block_get_nth_packet_verdict_option_value()

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
| ) |  |

Get packet_verdict option value for the nth instance of a particular option in a block.

Parameters

  [in] | block | Block from which to get the option value
  [in] | option_id | Identifier value for option
  [in] | idx | Instance number of option with that ID
  [out] | value | Returned value of option value

Returns
  wtap_opttype_return_val - WTAP_OPTTYPE_SUCCESS if successful, error code otherwise

## ◆ wtap_block_get_nth_string_option_value()

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
| ) |  |

Get string option value for the nth instance of a particular option in a block.

Parameters

  [in] | block | Block from which to get the option value
  [in] | option_id | Identifier value for option
  [in] | idx | Instance number of option with that ID
  [out] | value | Returned value of option

Returns
  wtap_opttype_return_val - WTAP_OPTTYPE_SUCCESS if successful, error code otherwise

## ◆ wtap_block_get_string_option_value()

WS_DLL_PUBLIC wtap_opttype_return_val wtap_block_get_string_option_value | ( | wtap_block_t | block,
|  | unsigned | option_id,
|  | char ** | value
| ) |  |

Get string option value from a block.

Parameters

  [in] | block | Block from which to get the option value
  [in] | option_id | Identifier value for option
  [out] | value | Returned value of option

Returns
  wtap_opttype_return_val - WTAP_OPTTYPE_SUCCESS if successful, error code otherwise

## ◆ wtap_block_get_type()

WS_DLL_PUBLIC wtap_block_type_t wtap_block_get_type | ( | wtap_block_t | block | ) |

Provide type of a block.

Parameters

  [in] | block | Block from which to retrieve mandatory data

Returns
  Block type.

## ◆ wtap_block_get_uint32_option_value()

WS_DLL_PUBLIC wtap_opttype_return_val wtap_block_get_uint32_option_value | ( | wtap_block_t | block,
|  | unsigned | option_id,
|  | uint32_t * | value
| ) |  |

Get UINT32 option value from a block.

Parameters

  [in] | block | Block from which to get the option value
  [in] | option_id | Identifier value for option
  [out] | value | Returned value of option

Returns
  wtap_opttype_return_val - WTAP_OPTTYPE_SUCCESS if successful, error code otherwise

## ◆ wtap_block_get_uint64_option_value()

WS_DLL_PUBLIC wtap_opttype_return_val wtap_block_get_uint64_option_value | ( | wtap_block_t | block,
|  | unsigned | option_id,
|  | uint64_t * | value
| ) |  |

Get UINT64 option value from a block.

Parameters

  [in] | block | Block from which to get the option value
  [in] | option_id | Identifier value for option
  [out] | value | Returned value of option

Returns
  wtap_opttype_return_val - WTAP_OPTTYPE_SUCCESS if successful, error code otherwise

## ◆ wtap_block_get_uint8_option_value()

WS_DLL_PUBLIC wtap_opttype_return_val wtap_block_get_uint8_option_value | ( | wtap_block_t | block,
|  | unsigned | option_id,
|  | uint8_t * | value
| ) |  |

Get UINT8 option value from a block.

Parameters

  [in] | block | Block from which to get the option value
  [in] | option_id | Identifier value for option
  [out] | value | Returned value of option

Returns
  wtap_opttype_return_val - WTAP_OPTTYPE_SUCCESS if successful, error code otherwise

## ◆ wtap_block_make_copy()

WS_DLL_PUBLIC wtap_block_t wtap_block_make_copy | ( | wtap_block_t | block | ) |

Make a copy of a block.

Parameters

  [in] | block | Block to be copied from

Returns
  Newly allocated copy of that block

## ◆ wtap_block_ref()

WS_DLL_PUBLIC wtap_block_t wtap_block_ref | ( | wtap_block_t | block | ) |

Increase reference count of a block.

Call when taking a copy of a block

Parameters

  [in] | block | Block add ref to

Returns
  The block

## ◆ wtap_block_remove_nth_option_instance()

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.

Parameters

  [in] | block | Block from which to remove the option instance
  [in] | option_id | Identifier value for option
  [in] | idx | Instance number of option with that ID

Returns
  wtap_opttype_return_val - WTAP_OPTTYPE_SUCCESS if successful, error code otherwise

## ◆ wtap_block_remove_option()

WS_DLL_PUBLIC wtap_opttype_return_val wtap_block_remove_option | ( | wtap_block_t | block,
|  | unsigned | option_id
| ) |  |

Remove an option from a block.

Parameters

  [in] | block | Block from which to remove the option
  [in] | option_id | Identifier value for option

Returns
  wtap_opttype_return_val - WTAP_OPTTYPE_SUCCESS if successful, error code otherwise

## ◆ wtap_block_set_bytes_option_value()

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.

Parameters

  [in] | block | Block in which to set the option value
  [in] | option_id | Identifier value for option
  [in] | value | New value of option
  [in] | value_length | Number of bytes to copy.

Returns
  wtap_opttype_return_val - WTAP_OPTTYPE_SUCCESS if successful, error code otherwise

## ◆ wtap_block_set_if_filter_option_value()

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.

Parameters

  [in] | block | Block in which to set the option value
  [in] | option_id | Identifier value for option
  [in] | value | New value of option

Returns
  wtap_opttype_return_val - WTAP_OPTTYPE_SUCCESS if successful, error code otherwise

## ◆ wtap_block_set_int32_option_value()

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.

Parameters

  [in] | block | Block in which to set the option value
  [in] | option_id | Identifier value for option
  [in] | value | New value of option

Returns
  wtap_opttype_return_val - WTAP_OPTTYPE_SUCCESS if successful, error code otherwise

## ◆ wtap_block_set_int64_option_value()

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.

Parameters

  [in] | block | Block in which to set the option value
  [in] | option_id | Identifier value for option
  [in] | value | New value of option

Returns
  wtap_opttype_return_val - WTAP_OPTTYPE_SUCCESS if successful, error code otherwise

## ◆ wtap_block_set_int8_option_value()

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.

Parameters

  [in] | block | Block in which to set the option value
  [in] | option_id | Identifier value for option
  [in] | value | New value of option

Returns
  wtap_opttype_return_val - WTAP_OPTTYPE_SUCCESS if successful, error code otherwise

## ◆ wtap_block_set_ipv4_option_value()

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.

Parameters

  [in] | block | Block in which to set the option value
  [in] | option_id | Identifier value for option
  [in] | value | New value of option

Returns
  wtap_opttype_return_val - WTAP_OPTTYPE_SUCCESS if successful, error code otherwise

## ◆ wtap_block_set_ipv6_option_value()

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.

Parameters

  [in] | block | Block in which to set the option value
  [in] | option_id | Identifier value for option
  [in] | value | New value of option

Returns
  wtap_opttype_return_val - WTAP_OPTTYPE_SUCCESS if successful, error code otherwise

## ◆ wtap_block_set_nth_bytes_option_value()

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.

Parameters

  [in] | block | Block in which to set the option value
  [in] | option_id | Identifier value for option
  [in] | idx | Instance number of option with that ID
  [in] | value | New value of option

Returns
  wtap_opttype_return_val - WTAP_OPTTYPE_SUCCESS if successful, error code otherwise

## ◆ wtap_block_set_nth_packet_verdict_option_value()

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.

Parameters

  [in] | block | Block in which to set the option value
  [in] | option_id | Identifier value for option
  [in] | idx | Instance number of option with that ID
  [in] | value | New value of option

Returns
  wtap_opttype_return_val - WTAP_OPTTYPE_SUCCESS if successful, error code otherwise

## ◆ wtap_block_set_nth_string_option_value()

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.

Parameters

  [in] | block | Block in which to set the option value
  [in] | option_id | Identifier value for option
  [in] | idx | Instance number of option with that ID
  [in] | value | New value of option
  [in] | value_length | Maximum length of string to copy.

Returns
  wtap_opttype_return_val - WTAP_OPTTYPE_SUCCESS if successful, error code otherwise

## ◆ wtap_block_set_nth_string_option_value_format()

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 string.

Parameters

  [in] | block | Block in which to set the option value
  [in] | option_id | Identifier value for option
  [in] | idx | Instance number of option with that ID
  [in] | format | printf-like format string

Returns
  wtap_opttype_return_val - WTAP_OPTTYPE_SUCCESS if successful, error code otherwise

## ◆ wtap_block_set_string_option_value()

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.

Parameters

  [in] | block | Block in which to set the option value
  [in] | option_id | Identifier value for option
  [in] | value | New value of option
  [in] | value_length | Maximum length of string to copy.

Returns
  wtap_opttype_return_val - WTAP_OPTTYPE_SUCCESS if successful, error code otherwise

## ◆ wtap_block_set_string_option_value_format()

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.

Parameters

  [in] | block | Block in which to set the option value
  [in] | option_id | Identifier value for option
  [in] | format | printf-like format string

Returns
  wtap_opttype_return_val - WTAP_OPTTYPE_SUCCESS if successful, error code otherwise

## ◆ wtap_block_set_uint32_option_value()

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.

Parameters

  [in] | block | Block in which to set the option value
  [in] | option_id | Identifier value for option
  [in] | value | New value of option

Returns
  wtap_opttype_return_val - WTAP_OPTTYPE_SUCCESS if successful, error code otherwise

## ◆ wtap_block_set_uint64_option_value()

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.

Parameters

  [in] | block | Block in which to set the option value
  [in] | option_id | Identifier value for option
  [in] | value | New value of option

Returns
  wtap_opttype_return_val - WTAP_OPTTYPE_SUCCESS if successful, error code otherwise

## ◆ wtap_block_set_uint8_option_value()

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.

Parameters

  [in] | block | Block in which to set the option value
  [in] | option_id | Identifier value for option
  [in] | value | New value of option

Returns
  wtap_opttype_return_val - WTAP_OPTTYPE_SUCCESS if successful, error code otherwise

## ◆ wtap_block_unref()

WS_DLL_PUBLIC void wtap_block_unref | ( | wtap_block_t | block | ) |

Decrease reference count of a block.

Needs to be called on any block once you're done with it

Parameters

  [in] | block | Block to be deref'd

## ◆ wtap_opttype_block_register()

WS_DLL_PUBLIC void wtap_opttype_block_register | ( | wtap_blocktype_t * | blocktype | ) |

Register a block type handler.

Parameters

  [in] | blocktype | Block type to be registered

< A UTF-8 string containing a human-readable comment.

< A custom option containing a UTF-8 string, copying allowed.

< A custom option containing binary data, copying allowed.

< A custom option containing a UTF-8 string, copying not allowed.

< A custom option containing binary data, copying not allowed.

## ◆ wtap_opttypes_initialize()

WS_DLL_PUBLIC void wtap_opttypes_initialize | ( | void |  | ) |

Initialize block types.

This is currently just a placeholder as nothing needs to be initialized yet. Should handle "registration" when code is refactored to do so.

< A UTF-8 string containing the description of the * hardware used to create this section.

< A UTF-8 string containing the * name of the operating system used to create this section.

< A UTF-8 string containing the * name of the application used to create this section.

< A UTF-8 string containing the name * of the device used to capture data. * "eth0" / "\Device\NPF_{AD1CE675-96D0-47C5-ADD0-2504B9126B68}"

< A UTF-8 string containing the description * of the device used to capture data. * "Wi-Fi" / "Local Area Connection" / * "Wireless Network Connection" / * "First Ethernet Interface"

< Interface speed (in bps). 100000000 for 100Mbps

< Resolution of timestamps. If the Most Significant Bit is equal to zero, * the remaining bits indicates the resolution of the timestamp as a * negative power of 10 (e.g. 6 means microsecond resolution, timestamps * are the number of microseconds since 1/1/1970). If the Most Significant Bit * is equal to one, the remaining bits indicates the resolution has a * negative power of 2 (e.g. 10 means 1/1024 of second). * If this option is not present, a resolution of 10^-6 is assumed * (i.e. timestamps have the same resolution of the standard 'libpcap' timestamps).

< The filter (e.g. "capture only TCP traffic") used to capture traffic. * The first byte of the Option Data keeps a code of the filter used * (e.g. if this is a libpcap string, or BPF bytecode, and more). * More details about this format will be presented in Appendix XXX (TODO). * (TODO: better use different options for different fields? * e.g. if_filter_pcap, if_filter_bpf, ...) 00 "tcp port 23 and host 10.0.0.5"

< A UTF-8 string containing the name of the operating system of the * machine in which this interface is installed. * This can be different from the same information that can be * contained by the Section Header Block * (Section 3.1 (Section Header Block (mandatory))) because * the capture can have been done on a remote machine. * "Windows XP SP2" / "openSUSE 10.2"

< An integer value that specified the length of the * Frame Check Sequence (in bits) for this interface. * For link layers whose FCS length can change during time, * the Packet Block Flags Word can be used (see Appendix A (Packet Block Flags Word))

< A 64-bit signed integer value that specifies an offset (in seconds) * that must be added to the timestamp of each packet to obtain * the absolute timestamp of a packet. If the option is not present, * an offset of 0 is assumed (i.e., timestamps in blocks are absolute * timestamps). * * This offset is not intended to be used as an offset between local * time and UTC; for this purpose, the if_iana_tzname option SHOULD be * used to specify a timezone.

< A UTF-8 string containing the description * of the hardware of the device used * to capture data. * "Broadcom NetXtreme" / * "Intel(R) PRO/1000 MT Network Connection" / * "NETGEAR WNA1000Mv2 N150 Wireless USB Micro Adapter"

< A 64-bit unsigned integer indicating the interface transmit speed in * bits per second.

< A 64-bit unsigned integer indicating the interface transmit speed in * bits per second.

< A UTF-8 string that indicates the IANA time zone database timezone name * for the IANA database timezone in which the interface is located.

< 32-bit number of the Darwin PIB that describes the Process ID.

< 32-bit type of service code.

< 32-bit number of the Darwin PIB that describes the Effective Process ID.

< 32-bit bitmask containing the packet metadata flags.

< 32-bit opaque flow identifier.

< 16-bit opaque trace tag.

< 32-bit drop reason.

< 16-bit drop line.

< NUL-terminated name of the dropping function.

< 32-bit current value of the compression generation count (epoch).