24void wtap_init_file_type_subtypes(
void);
27int wtap_fstat(
wtap *wth, ws_statb64 *statb,
int *err);
29typedef bool (*subtype_read_func)(
struct wtap*,
wtap_rec *,
30 Buffer *,
int *,
char **, int64_t *);
31typedef bool (*subtype_seek_read_func)(
struct wtap*, int64_t,
wtap_rec *,
41 int file_type_subtype;
42 unsigned snapshot_length;
56 subtype_read_func subtype_read;
57 subtype_seek_read_func subtype_seek_read;
58 void (*subtype_sequential_close)(
struct wtap*);
59 void (*subtype_close)(
struct wtap*);
77 wtap_new_ipv6_callback_t add_new_ipv6;
93typedef bool (*subtype_write_func)(
struct wtap_dumper*,
95 const uint8_t*,
int*,
char**);
96typedef bool (*subtype_finish_func)(
struct wtap_dumper*,
int*,
char**);
100 int file_type_subtype;
108 wtap_compression_type compression_type;
110 int64_t bytes_dumped;
115 subtype_add_idb_func subtype_add_idb;
116 subtype_write_func subtype_write;
117 subtype_finish_func subtype_finish;
137WS_DLL_PUBLIC
bool wtap_dump_file_write(
wtap_dumper *wdh,
const void *buf,
138 size_t bufsize,
int *err);
139WS_DLL_PUBLIC int64_t wtap_dump_file_seek(
wtap_dumper *wdh, int64_t offset,
int whence,
int *err);
140WS_DLL_PUBLIC int64_t wtap_dump_file_tell(
wtap_dumper *wdh,
int *err);
142extern int wtap_num_file_types;
189#define phtons(p, v) \
191 (p)[0] = (uint8_t)((v) >> 8); \
192 (p)[1] = (uint8_t)((v) >> 0); \
197#define phton24(p, v) \
199 (p)[0] = (uint8_t)((v) >> 16); \
200 (p)[1] = (uint8_t)((v) >> 8); \
201 (p)[2] = (uint8_t)((v) >> 0); \
206#define phtonl(p, v) \
208 (p)[0] = (uint8_t)((v) >> 24); \
209 (p)[1] = (uint8_t)((v) >> 16); \
210 (p)[2] = (uint8_t)((v) >> 8); \
211 (p)[3] = (uint8_t)((v) >> 0); \
216#define phtonll(p, v) \
218 (p)[0] = (uint8_t)((v) >> 56); \
219 (p)[1] = (uint8_t)((v) >> 48); \
220 (p)[2] = (uint8_t)((v) >> 40); \
221 (p)[3] = (uint8_t)((v) >> 32); \
222 (p)[4] = (uint8_t)((v) >> 24); \
223 (p)[5] = (uint8_t)((v) >> 16); \
224 (p)[6] = (uint8_t)((v) >> 8); \
225 (p)[7] = (uint8_t)((v) >> 0); \
230#define phtole8(p, v) \
232 (p)[0] = (uint8_t)((v) >> 0); \
237#define phtoles(p, v) \
239 (p)[0] = (uint8_t)((v) >> 0); \
240 (p)[1] = (uint8_t)((v) >> 8); \
245#define phtole24(p, v) \
247 (p)[0] = (uint8_t)((v) >> 0); \
248 (p)[1] = (uint8_t)((v) >> 8); \
249 (p)[2] = (uint8_t)((v) >> 16); \
254#define phtolel(p, v) \
256 (p)[0] = (uint8_t)((v) >> 0); \
257 (p)[1] = (uint8_t)((v) >> 8); \
258 (p)[2] = (uint8_t)((v) >> 16); \
259 (p)[3] = (uint8_t)((v) >> 24); \
264#define phtolell(p, v) \
266 (p)[0] = (uint8_t)((v) >> 0); \
267 (p)[1] = (uint8_t)((v) >> 8); \
268 (p)[2] = (uint8_t)((v) >> 16); \
269 (p)[3] = (uint8_t)((v) >> 24); \
270 (p)[4] = (uint8_t)((v) >> 32); \
271 (p)[5] = (uint8_t)((v) >> 40); \
272 (p)[6] = (uint8_t)((v) >> 48); \
273 (p)[7] = (uint8_t)((v) >> 56); \
295wtap_read_bytes_or_eof(
FILE_T fh,
void *buf,
unsigned int count,
int *err,
313wtap_read_bytes(
FILE_T fh,
void *buf,
unsigned int count,
int *err,
327wtap_read_packet_bytes(
FILE_T fh,
Buffer *buf,
unsigned length,
int *err,
336 int *err,
char **err_info, int64_t *data_offset);
343wtap_full_file_seek_read(
wtap *wth, int64_t seek_off,
wtap_rec *rec,
Buffer *buf,
int *err,
char **err_info);
364wtap_register_compatibility_file_subtype_name(
const char *old_name,
365 const char *new_name);
368wtap_register_backwards_compatibility_lua_name(
const char *name,
int ft);
376const GArray *get_backwards_compatibility_lua_table(
void);
Definition wtap-int.h:370
Definition wtap_opttypes.c:85
unsigned nrbs_growing_written
Definition wtap-int.h:132
GArray * dsbs_initial
Definition wtap-int.h:123
GArray * interface_data
Definition wtap-int.h:122
const GArray * dsbs_growing
Definition wtap-int.h:130
const GArray * mevs_growing
Definition wtap-int.h:131
unsigned mevs_growing_written
Definition wtap-int.h:134
const GArray * shb_iface_to_global
Definition wtap-int.h:121
unsigned dsbs_growing_written
Definition wtap-int.h:133
addrinfo_lists_t * addrinfo_lists
Definition wtap-int.h:119
const GArray * nrbs_growing
Definition wtap-int.h:129
Definition file_wrappers.c:222
GArray * interface_data
Definition wtap-int.h:45
bool ispipe
Definition wtap-int.h:40
GArray * shb_iface_to_global
Definition wtap-int.h:44
FILE_T random_fh
Definition wtap-int.h:39
unsigned next_interface_data
Definition wtap-int.h:46
GArray * nrbs
Definition wtap-int.h:47
char * pathname
Definition wtap-int.h:51
GArray * meta_events
Definition wtap-int.h:49
GArray * dsbs
Definition wtap-int.h:48
void wtapng_process_nrb(wtap *wth, wtap_block_t nrb)
Definition wtap.c:1669
void wtapng_process_dsb(wtap *wth, wtap_block_t dsb)
Definition wtap.c:1693
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:1903
GArray * wtap_file_get_shb_for_new_file(wtap *wth)
Gets new section header block for new file, based on existing info.
Definition wtap.c:150
wtap_block_t wtap_dump_params_generate_idb(const wtap_dump_params *params)
Generate an IDB, given a set of dump parameters, using the parameters' encapsulation type,...
Definition wtap.c:617
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:351
void wtap_add_idb(wtap *wth, wtap_block_t idb)
Definition wtap.c:275
GArray * wtap_file_get_nrb_for_new_file(wtap *wth)
Gets new name resolution info for new file, based on existing info.
Definition wtap.c:521
void(* wtap_new_secrets_callback_t)(uint32_t secrets_type, const void *secrets, unsigned size)
Definition wtap.h:1901
void(* wtap_new_ipv4_callback_t)(const unsigned addr, const char *name, const bool static_entry)
Definition wtap.h:1889