10 #define __WTAP_INT_H__
23 void wtap_init_file_type_subtypes(
void);
26 int wtap_fstat(
wtap *wth, ws_statb64 *statb,
int *err);
28 typedef bool (*subtype_read_func)(
struct wtap*,
wtap_rec *,
29 Buffer *,
int *,
char **, int64_t *);
30 typedef bool (*subtype_seek_read_func)(
struct wtap*, int64_t,
wtap_rec *,
40 int file_type_subtype;
41 unsigned snapshot_length;
55 subtype_read_func subtype_read;
56 subtype_seek_read_func subtype_seek_read;
57 void (*subtype_sequential_close)(
struct wtap*);
58 void (*subtype_close)(
struct wtap*);
76 wtap_new_ipv6_callback_t add_new_ipv6;
86 typedef void *WFILE_T;
91 typedef bool (*subtype_write_func)(
struct wtap_dumper*,
93 const uint8_t*,
int*,
char**);
94 typedef bool (*subtype_finish_func)(
struct wtap_dumper*,
int*,
char**);
98 int file_type_subtype;
106 wtap_compression_type compression_type;
108 int64_t bytes_dumped;
113 subtype_add_idb_func subtype_add_idb;
114 subtype_write_func subtype_write;
115 subtype_finish_func subtype_finish;
135 WS_DLL_PUBLIC
bool wtap_dump_file_write(
wtap_dumper *wdh,
const void *buf,
136 size_t bufsize,
int *err);
137 WS_DLL_PUBLIC int64_t wtap_dump_file_seek(
wtap_dumper *wdh, int64_t offset,
int whence,
int *err);
138 WS_DLL_PUBLIC int64_t wtap_dump_file_tell(
wtap_dumper *wdh,
int *err);
140 extern int wtap_num_file_types;
147 #define PBSWAP64(p) \
163 #define PBSWAP32(p) \
173 #define PBSWAP16(p) \
187 #define phtons(p, v) \
189 (p)[0] = (uint8_t)((v) >> 8); \
190 (p)[1] = (uint8_t)((v) >> 0); \
195 #define phton24(p, v) \
197 (p)[0] = (uint8_t)((v) >> 16); \
198 (p)[1] = (uint8_t)((v) >> 8); \
199 (p)[2] = (uint8_t)((v) >> 0); \
204 #define phtonl(p, v) \
206 (p)[0] = (uint8_t)((v) >> 24); \
207 (p)[1] = (uint8_t)((v) >> 16); \
208 (p)[2] = (uint8_t)((v) >> 8); \
209 (p)[3] = (uint8_t)((v) >> 0); \
214 #define phtonll(p, v) \
216 (p)[0] = (uint8_t)((v) >> 56); \
217 (p)[1] = (uint8_t)((v) >> 48); \
218 (p)[2] = (uint8_t)((v) >> 40); \
219 (p)[3] = (uint8_t)((v) >> 32); \
220 (p)[4] = (uint8_t)((v) >> 24); \
221 (p)[5] = (uint8_t)((v) >> 16); \
222 (p)[6] = (uint8_t)((v) >> 8); \
223 (p)[7] = (uint8_t)((v) >> 0); \
228 #define phtole8(p, v) \
230 (p)[0] = (uint8_t)((v) >> 0); \
235 #define phtoles(p, v) \
237 (p)[0] = (uint8_t)((v) >> 0); \
238 (p)[1] = (uint8_t)((v) >> 8); \
243 #define phtole24(p, v) \
245 (p)[0] = (uint8_t)((v) >> 0); \
246 (p)[1] = (uint8_t)((v) >> 8); \
247 (p)[2] = (uint8_t)((v) >> 16); \
252 #define phtolel(p, v) \
254 (p)[0] = (uint8_t)((v) >> 0); \
255 (p)[1] = (uint8_t)((v) >> 8); \
256 (p)[2] = (uint8_t)((v) >> 16); \
257 (p)[3] = (uint8_t)((v) >> 24); \
262 #define phtolell(p, v) \
264 (p)[0] = (uint8_t)((v) >> 0); \
265 (p)[1] = (uint8_t)((v) >> 8); \
266 (p)[2] = (uint8_t)((v) >> 16); \
267 (p)[3] = (uint8_t)((v) >> 24); \
268 (p)[4] = (uint8_t)((v) >> 32); \
269 (p)[5] = (uint8_t)((v) >> 40); \
270 (p)[6] = (uint8_t)((v) >> 48); \
271 (p)[7] = (uint8_t)((v) >> 56); \
276 #ifndef g_ptr_array_len
277 #define g_ptr_array_len(a) ((a)->len)
298 wtap_read_bytes_or_eof(
FILE_T fh,
void *buf,
unsigned int count,
int *err,
316 wtap_read_bytes(
FILE_T fh,
void *buf,
unsigned int count,
int *err,
330 wtap_read_packet_bytes(
FILE_T fh,
Buffer *buf,
unsigned length,
int *err,
339 int *err,
char **err_info, int64_t *data_offset);
346 wtap_full_file_seek_read(
wtap *wth, int64_t seek_off,
wtap_rec *rec,
Buffer *buf,
int *err,
char **err_info);
367 wtap_register_compatibility_file_subtype_name(
const char *old_name,
368 const char *new_name);
371 wtap_register_backwards_compatibility_lua_name(
const char *name,
int ft);
379 const GArray *get_backwards_compatibility_lua_table(
void);
Definition: wtap-int.h:373
Definition: wtap_opttypes.c:85
Definition: wtap-int.h:96
unsigned nrbs_growing_written
Definition: wtap-int.h:130
GArray * dsbs_initial
Definition: wtap-int.h:121
GArray * interface_data
Definition: wtap-int.h:120
const GArray * dsbs_growing
Definition: wtap-int.h:128
const GArray * mevs_growing
Definition: wtap-int.h:129
unsigned mevs_growing_written
Definition: wtap-int.h:132
const GArray * shb_iface_to_global
Definition: wtap-int.h:119
unsigned dsbs_growing_written
Definition: wtap-int.h:131
addrinfo_lists_t * addrinfo_lists
Definition: wtap-int.h:117
const GArray * nrbs_growing
Definition: wtap-int.h:127
Definition: file_wrappers.c:168
Definition: wtap-int.h:36
GArray * interface_data
Definition: wtap-int.h:44
bool ispipe
Definition: wtap-int.h:39
GArray * shb_iface_to_global
Definition: wtap-int.h:43
FILE_T random_fh
Definition: wtap-int.h:38
unsigned next_interface_data
Definition: wtap-int.h:45
GArray * nrbs
Definition: wtap-int.h:46
char * pathname
Definition: wtap-int.h:50
GArray * meta_events
Definition: wtap-int.h:48
GArray * dsbs
Definition: wtap-int.h:47
void wtapng_process_nrb(wtap *wth, wtap_block_t nrb)
Definition: wtap.c:1668
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:149
void wtapng_process_dsb(wtap *wth, wtap_block_t dsb)
Definition: wtap.c:1692
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:520
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:1902
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:616
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:350
void wtap_add_idb(wtap *wth, wtap_block_t idb)
Definition: wtap.c:274
void(* wtap_new_secrets_callback_t)(uint32_t secrets_type, const void *secrets, unsigned size)
Definition: wtap.h:1854
void(* wtap_new_ipv4_callback_t)(const unsigned addr, const char *name, const bool static_entry)
Definition: wtap.h:1842