diff options
author | Guy Harris <guy@alum.mit.edu> | 2014-05-09 05:18:49 +0000 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2014-05-09 05:21:01 +0000 |
commit | a1b1c8bed54b1576e4f0e9e7f583844a12d142bf (patch) | |
tree | fcadd72c61f9d936451163e83cc1be843073f3b4 /wiretap/wtap-int.h | |
parent | a651f3e5edb2f148a0e5f495b5cba0e7fa43e002 (diff) |
Revert "Refactor Wiretap"
This reverts commit 1abeb277f5e6bd27fbaebfecc8184e37ba9d008a.
This isn't building, and looks as if it requires significant work to fix.
Change-Id: I622b1bb243e353e874883a302ab419532b7601f2
Reviewed-on: https://code.wireshark.org/review/1568
Reviewed-by: Guy Harris <guy@alum.mit.edu>
Diffstat (limited to 'wiretap/wtap-int.h')
-rw-r--r-- | wiretap/wtap-int.h | 54 |
1 files changed, 54 insertions, 0 deletions
diff --git a/wiretap/wtap-int.h b/wiretap/wtap-int.h index 8e4de0fbc6..1d47f25423 100644 --- a/wiretap/wtap-int.h +++ b/wiretap/wtap-int.h @@ -37,17 +37,45 @@ #include "wtap.h" +WS_DLL_PUBLIC +int wtap_fstat(wtap *wth, ws_statb64 *statb, int *err); + +typedef gboolean (*subtype_read_func)(struct wtap*, int*, char**, gint64*); +typedef gboolean (*subtype_seek_read_func)(struct wtap*, gint64, + struct wtap_pkthdr *, Buffer *buf, + int *, char **); /** * Struct holding data of the currently read file. */ struct wtap { + FILE_T fh; + FILE_T random_fh; /**< Secondary FILE_T for random access */ + int file_type_subtype; + guint snapshot_length; + struct Buffer *frame_buffer; struct wtap_pkthdr phdr; struct wtapng_section_s shb_hdr; guint number_of_interfaces; /**< The number of interfaces a capture was made on, number of IDB:s in a pcapng file or equivalent(?)*/ GArray *interface_data; /**< An array holding the interface data from pcapng IDB:s or equivalent(?)*/ + void *priv; /* this one holds per-file state and is free'd automatically by wtap_close() */ + void *wslua_data; /* this one holds wslua state info and is not free'd */ + + subtype_read_func subtype_read; + subtype_seek_read_func subtype_seek_read; + void (*subtype_sequential_close)(struct wtap*); + void (*subtype_close)(struct wtap*); + int file_encap; /* per-file, for those + * file formats that have + * per-file encapsulation + * types + */ + int tsprecision; /* timestamp precision of the lower 32bits + * e.g. WTAP_FILE_TSPREC_USEC + */ wtap_new_ipv4_callback_t add_new_ipv4; wtap_new_ipv6_callback_t add_new_ipv6; + GPtrArray *fast_seek; }; struct wtap_dumper; @@ -57,14 +85,40 @@ struct wtap_dumper; */ typedef void *WFILE_T; +typedef gboolean (*subtype_write_func)(struct wtap_dumper*, + const struct wtap_pkthdr*, + const guint8*, int*); +typedef gboolean (*subtype_close_func)(struct wtap_dumper*, int*); struct wtap_dumper { + WFILE_T fh; + int file_type_subtype; + int snaplen; + int encap; + gboolean compressed; + gint64 bytes_dumped; + + void *priv; /* this one holds per-file state and is free'd automatically by wtap_dump_close() */ + void *wslua_data; /* this one holds wslua state info and is not free'd */ + + subtype_write_func subtype_write; + subtype_close_func subtype_close; + + int tsprecision; /**< timestamp precision of the lower 32bits + * e.g. WTAP_FILE_TSPREC_USEC + */ addrinfo_lists_t *addrinfo_lists; /**< Struct containing lists of resolved addresses */ struct wtapng_section_s *shb_hdr; guint number_of_interfaces; /**< The number of interfaces a capture was made on, number of IDB:s in a pcapng file or equivalent(?)*/ GArray *interface_data; /**< An array holding the interface data from pcapng IDB:s or equivalent(?) NULL if not present.*/ }; +WS_DLL_PUBLIC gboolean wtap_dump_file_write(wtap_dumper *wdh, const void *buf, + size_t bufsize, int *err); +WS_DLL_PUBLIC gint64 wtap_dump_file_seek(wtap_dumper *wdh, gint64 offset, int whence, int *err); +WS_DLL_PUBLIC gint64 wtap_dump_file_tell(wtap_dumper *wdh, int *err); + + extern gint wtap_num_file_types; #include <wsutil/pint.h> |