9#ifndef __WTAP_MODULE_H__
10#define __WTAP_MODULE_H__
40 int* err,
char** err_info, int64_t* offset);
53 int* err,
char** err_info);
137 int* err,
char** err_info);
149 int* err,
char** err_info);
217 size_t bufsize,
int *err);
233 int whence,
int *err);
286 int *err,
char **err_info);
340 int64_t *data_offset);
356 int *err,
char **err_info);
415 const char *new_name);
A dynamic byte buffer with adjustable start and end positions.
Definition buffer.h:30
Wiretap dumper handle and associated state.
Definition wtap_module.h:166
void * wslua_data
Definition wtap_module.h:181
unsigned nrbs_growing_written
Definition wtap_module.h:201
GArray * dsbs_initial
Definition wtap_module.h:191
bool needs_reload
Definition wtap_module.h:177
GArray * interface_data
Definition wtap_module.h:190
const GArray * dsbs_growing
Definition wtap_module.h:198
subtype_write_func subtype_write
Definition wtap_module.h:184
WFILE_T fh
Definition wtap_module.h:167
const GArray * mevs_growing
Definition wtap_module.h:199
unsigned mevs_growing_written
Definition wtap_module.h:203
int snaplen
Definition wtap_module.h:169
const GArray * shb_iface_to_global
Definition wtap_module.h:189
ws_compression_type compression_type
Definition wtap_module.h:176
unsigned pibs_growing_written
Definition wtap_module.h:204
unsigned dsbs_growing_written
Definition wtap_module.h:202
addrinfo_lists_t * addrinfo_lists
Definition wtap_module.h:187
const GArray * pibs_growing
Definition wtap_module.h:200
int file_type_subtype
Definition wtap_module.h:168
const GArray * nrbs_growing
Definition wtap_module.h:197
uint64_t bytes_dumped
Definition wtap_module.h:178
void * priv
Definition wtap_module.h:180
subtype_finish_func subtype_finish
Definition wtap_module.h:185
subtype_add_idb_func subtype_add_idb
Definition wtap_module.h:183
GArray * shb_hdrs
Definition wtap_module.h:188
Represents a single capture record read from or written to a capture file, regardless of record type.
Definition wtap.h:1601
Definition wtap_module.h:58
GArray * interface_data
Definition wtap_module.h:66
GArray * pibs
Definition wtap_module.h:71
bool ispipe
Definition wtap_module.h:61
nstime_t file_start_ts
Definition wtap_module.h:100
wtap_pcapng_block_callback_t pcapng_block_cb
Definition wtap_module.h:115
wtap_new_secrets_callback_t add_new_secrets
Definition wtap_module.h:114
int file_tsprec
Definition wtap_module.h:90
const char * app_env_var_prefix
Definition wtap_module.h:75
subtype_read_func subtype_read
Definition wtap_module.h:80
nstime_t file_end_ts
Definition wtap_module.h:106
GArray * shb_iface_to_global
Definition wtap_module.h:65
unsigned snapshot_length
Definition wtap_module.h:63
GPtrArray * fast_seek
Definition wtap_module.h:117
GArray * pib_offsets
Definition wtap_module.h:73
subtype_seek_read_func subtype_seek_read
Definition wtap_module.h:81
int file_encap
Definition wtap_module.h:84
void(* subtype_sequential_close)(struct wtap *)
Definition wtap_module.h:82
FILE_T random_fh
Definition wtap_module.h:60
FILE_T fh
Definition wtap_module.h:59
unsigned next_interface_data
Definition wtap_module.h:67
GArray * nrbs
Definition wtap_module.h:68
GHashTable * pibs_by_pid
Definition wtap_module.h:72
GArray * shb_hdrs
Definition wtap_module.h:64
char * pathname
Definition wtap_module.h:74
int file_type_subtype
Definition wtap_module.h:62
wtap_new_ipv4_callback_t add_new_ipv4
Definition wtap_module.h:112
void * pcapng_block_cb_data
Definition wtap_module.h:116
GArray * meta_events
Definition wtap_module.h:70
wtap_new_ipv6_callback_t add_new_ipv6
Definition wtap_module.h:113
void * priv
Definition wtap_module.h:77
void * wslua_data
Definition wtap_module.h:78
void(* subtype_close)(struct wtap *)
Definition wtap_module.h:83
GArray * dsbs
Definition wtap_module.h:69
void(* wtap_new_secrets_callback_t)(uint32_t secrets_type, const void *secrets, unsigned size)
Callback type for receiving new decryption secrets.
Definition wtap.h:2205
void(* wtap_pcapng_block_callback_t)(uint32_t block_type, const uint8_t *block_body, uint32_t block_body_length, void *user_data)
Callback for Sysdig/Falco pcapng metadata blocks.
Definition wtap.h:2233
void(* wtap_new_ipv6_callback_t)(const ws_in6_addr *addrp, const char *name, const bool static_entry)
Callback type for registering new IPv6 hostnames.
Definition wtap.h:2181
struct addrinfo_lists addrinfo_lists_t
Aggregates lists of resolved IPv4 and IPv6 addresses for writing into a pcapng Name Resolution Block ...
void(* wtap_new_ipv4_callback_t)(const unsigned addr, const char *name, const bool static_entry)
Callback type for registering new IPv4 hostnames.
Definition wtap.h:2157
void wtap_register_backwards_compatibility_lua_name(const char *name, int ft)
Register a backwards compatibility Lua name for a file type.
Definition file_access.c:2893
WS_DLL_PUBLIC bool wtap_dump_file_write(wtap_dumper *wdh, const void *buf, size_t bufsize, int *err)
Write raw data to the dump file.
Definition file_access.c:2746
void wtapng_process_nrb(wtap *wth, wtap_block_t nrb)
Invoke the registered callback with a Name Resolution Block (NRB).
Definition wtap.c:1838
WS_DLL_PUBLIC bool wtap_read_bytes_or_eof_buffer(FILE_T fh, Buffer *buf, unsigned int count, int *err, char **err_info)
Read a specified number of bytes into a Buffer, growing it as needed.
bool wtap_full_file_read(wtap *wth, wtap_rec *rec, int *err, char **err_info, int64_t *data_offset)
Read entire file contents as a single packet (sequential mode).
Definition wtap.c:2395
bool(* subtype_seek_read_func)(struct wtap *wtap, int64_t seek_off, wtap_rec *rec, int *err, char **err_info)
Function pointer type for seeking and reading a record.
Definition wtap_module.h:52
bool(* subtype_read_func)(struct wtap *wtap, wtap_rec *rec, int *err, char **err_info, int64_t *offset)
Function pointer type for reading a record.
Definition wtap_module.h:39
void wtapng_process_dsb(wtap *wth, wtap_block_t dsb)
Invoke the registered callback with a Decryption Secrets Block (DSB).
Definition wtap.c:1862
void wtap_add_pib(wtap *wth, wtap_block_t pib, int64_t offset)
Add a process information block to the pibs list for a file.
Definition wtap.c:323
WS_DLL_PUBLIC int wtap_fstat(wtap *wth, ws_statb64 *statb, int *err)
Retrieve file statistics for a wiretap handle.
Definition wtap.c:95
void * WFILE_T
Abstract file handle for writing.
Definition wtap_module.h:125
WS_DLL_PUBLIC bool wtap_read_bytes_or_eof(FILE_T fh, void *buf, unsigned int count, int *err, char **err_info)
Read a specified number of bytes from a file or discard them.
Definition wtap.c:2106
wtap_block_t wtap_rec_generate_idb(const wtap_rec *rec)
Generate an IDB, given a packet record, using the records's encapsulation type and time stamp resolut...
Definition wtap.c:2281
WS_DLL_PUBLIC bool wtap_read_bytes_buffer(FILE_T fh, Buffer *buf, unsigned length, int *err, char **err_info)
Read a specified number of bytes into a Buffer, growing it as needed.
Definition wtap.c:2200
bool wtap_full_file_seek_read(wtap *wth, int64_t seek_off, wtap_rec *rec, int *err, char **err_info)
Read entire file contents as a single packet (seek mode).
Definition wtap.c:2411
WS_DLL_PUBLIC int64_t wtap_dump_file_seek(wtap_dumper *wdh, int64_t offset, int whence, int *err)
Seek to a position in the dump file.
Definition file_access.c:2813
bool(* subtype_write_func)(struct wtap_dumper *dumper, const wtap_rec *rec, int *err, char **err_info)
Function pointer type for writing a record.
Definition wtap_module.h:148
WS_DLL_PUBLIC int64_t wtap_dump_file_tell(wtap_dumper *wdh, int *err)
Get current position in the dump file.
Definition file_access.c:2833
WS_DLL_PUBLIC bool wtap_read_bytes(FILE_T fh, void *buf, unsigned int count, int *err, char **err_info)
Read a specified number of bytes from a file or discard them.
Definition wtap.c:2168
WS_DLL_PUBLIC void wtap_add_generated_idb(wtap *wth)
Generate an IDB, given a wiretap handle for the file, using the file's encapsulation type,...
Definition wtap.c:486
bool(* subtype_add_idb_func)(struct wtap_dumper *dumper, wtap_block_t idb, int *err, char **err_info)
Function pointer type for adding an Interface Description Block (IDB).
Definition wtap_module.h:136
bool(* subtype_finish_func)(struct wtap_dumper *dumper, int *err, char **err_info)
Function pointer type for finalizing a dump file.
Definition wtap_module.h:159
void wtap_add_idb(wtap *wth, wtap_block_t idb)
Add an Interface Description Block (IDB) to a wiretap handle.
Definition wtap.c:291
void wtap_register_compatibility_file_subtype_name(const char *old_name, const char *new_name)
Register a compatibility alias for a file subtype name.
Definition file_access.c:1659