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 gboolean (*subtype_read_func)(
struct wtap*,
wtap_rec *,
29 Buffer *,
int *,
char **, gint64 *);
30 typedef gboolean (*subtype_seek_read_func)(
struct wtap*, gint64,
wtap_rec *,
40 int file_type_subtype;
41 guint snapshot_length;
54 subtype_read_func subtype_read;
55 subtype_seek_read_func subtype_seek_read;
56 void (*subtype_sequential_close)(
struct wtap*);
57 void (*subtype_close)(
struct wtap*);
75 wtap_new_ipv6_callback_t add_new_ipv6;
85 typedef void *WFILE_T;
90 typedef gboolean (*subtype_write_func)(
struct wtap_dumper*,
92 const guint8*,
int*, gchar**);
93 typedef gboolean (*subtype_finish_func)(
struct wtap_dumper*,
int*, gchar**);
97 int file_type_subtype;
105 wtap_compression_type compression_type;
106 gboolean needs_reload;
112 subtype_add_idb_func subtype_add_idb;
113 subtype_write_func subtype_write;
114 subtype_finish_func subtype_finish;
133 WS_DLL_PUBLIC gboolean wtap_dump_file_write(
wtap_dumper *wdh,
const void *buf,
134 size_t bufsize,
int *err);
135 WS_DLL_PUBLIC gint64 wtap_dump_file_seek(
wtap_dumper *wdh, gint64 offset,
int whence,
int *err);
136 WS_DLL_PUBLIC gint64 wtap_dump_file_tell(
wtap_dumper *wdh,
int *err);
138 extern gint wtap_num_file_types;
145 #define PBSWAP64(p) \
161 #define PBSWAP32(p) \
171 #define PBSWAP16(p) \
185 #define phtons(p, v) \
187 (p)[0] = (guint8)((v) >> 8); \
188 (p)[1] = (guint8)((v) >> 0); \
193 #define phton24(p, v) \
195 (p)[0] = (guint8)((v) >> 16); \
196 (p)[1] = (guint8)((v) >> 8); \
197 (p)[2] = (guint8)((v) >> 0); \
202 #define phtonl(p, v) \
204 (p)[0] = (guint8)((v) >> 24); \
205 (p)[1] = (guint8)((v) >> 16); \
206 (p)[2] = (guint8)((v) >> 8); \
207 (p)[3] = (guint8)((v) >> 0); \
212 #define phtonll(p, v) \
214 (p)[0] = (guint8)((v) >> 56); \
215 (p)[1] = (guint8)((v) >> 48); \
216 (p)[2] = (guint8)((v) >> 40); \
217 (p)[3] = (guint8)((v) >> 32); \
218 (p)[4] = (guint8)((v) >> 24); \
219 (p)[5] = (guint8)((v) >> 16); \
220 (p)[6] = (guint8)((v) >> 8); \
221 (p)[7] = (guint8)((v) >> 0); \
226 #define phtole8(p, v) \
228 (p)[0] = (guint8)((v) >> 0); \
233 #define phtoles(p, v) \
235 (p)[0] = (guint8)((v) >> 0); \
236 (p)[1] = (guint8)((v) >> 8); \
241 #define phtole24(p, v) \
243 (p)[0] = (guint8)((v) >> 0); \
244 (p)[1] = (guint8)((v) >> 8); \
245 (p)[2] = (guint8)((v) >> 16); \
250 #define phtolel(p, v) \
252 (p)[0] = (guint8)((v) >> 0); \
253 (p)[1] = (guint8)((v) >> 8); \
254 (p)[2] = (guint8)((v) >> 16); \
255 (p)[3] = (guint8)((v) >> 24); \
260 #define phtolell(p, v) \
262 (p)[0] = (guint8)((v) >> 0); \
263 (p)[1] = (guint8)((v) >> 8); \
264 (p)[2] = (guint8)((v) >> 16); \
265 (p)[3] = (guint8)((v) >> 24); \
266 (p)[4] = (guint8)((v) >> 32); \
267 (p)[5] = (guint8)((v) >> 40); \
268 (p)[6] = (guint8)((v) >> 48); \
269 (p)[7] = (guint8)((v) >> 56); \
274 #ifndef g_ptr_array_len
275 #define g_ptr_array_len(a) ((a)->len)
296 wtap_read_bytes_or_eof(
FILE_T fh,
void *buf,
unsigned int count,
int *err,
314 wtap_read_bytes(
FILE_T fh,
void *buf,
unsigned int count,
int *err,
328 wtap_read_packet_bytes(
FILE_T fh,
Buffer *buf, guint length,
int *err,
337 int *err, gchar **err_info, gint64 *data_offset);
344 wtap_full_file_seek_read(
wtap *wth, gint64 seek_off,
wtap_rec *rec,
Buffer *buf,
int *err, gchar **err_info);
365 wtap_register_compatibility_file_subtype_name(
const char *old_name,
366 const char *new_name);
369 wtap_register_backwards_compatibility_lua_name(
const char *name,
int ft);
377 const GArray *get_backwards_compatibility_lua_table(
void);
Definition: wtap-int.h:371
Definition: wtap_opttypes.c:86
Definition: wtap-int.h:95
GArray * dsbs_initial
Definition: wtap-int.h:119
GArray * interface_data
Definition: wtap-int.h:118
guint nrbs_growing_written
Definition: wtap-int.h:128
const GArray * dsbs_growing
Definition: wtap-int.h:126
const GArray * mevs_growing
Definition: wtap-int.h:127
guint mevs_growing_written
Definition: wtap-int.h:130
addrinfo_lists_t * addrinfo_lists
Definition: wtap-int.h:116
const GArray * nrbs_growing
Definition: wtap-int.h:125
guint dsbs_growing_written
Definition: wtap-int.h:129
Definition: file_wrappers.c:168
Definition: wtap-int.h:36
GArray * interface_data
Definition: wtap-int.h:43
gboolean ispipe
Definition: wtap-int.h:39
FILE_T random_fh
Definition: wtap-int.h:38
GArray * nrbs
Definition: wtap-int.h:45
char * pathname
Definition: wtap-int.h:49
GArray * meta_events
Definition: wtap-int.h:47
guint next_interface_data
Definition: wtap-int.h:44
GArray * dsbs
Definition: wtap-int.h:46
void wtapng_process_nrb(wtap *wth, wtap_block_t nrb)
Definition: wtap.c:1623
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:138
void wtapng_process_dsb(wtap *wth, wtap_block_t dsb)
Definition: wtap.c:1647
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:484
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:1857
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:578
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:321
void wtap_add_idb(wtap *wth, wtap_block_t idb)
Definition: wtap.c:245
void(* wtap_new_ipv4_callback_t)(const guint addr, const gchar *name, const gboolean static_entry)
Definition: wtap.h:1833
void(* wtap_new_secrets_callback_t)(guint32 secrets_type, const void *secrets, guint size)
Definition: wtap.h:1845