parent
86a5c21075
commit
8b582d6172
64
cfile.h
64
cfile.h
@ -67,54 +67,54 @@ struct packet_provider_data {
|
||||
typedef struct _capture_file {
|
||||
epan_t *epan;
|
||||
file_state state; /* Current state of capture file */
|
||||
gchar *filename; /* Name of capture file */
|
||||
gchar *source; /* Temp file source, e.g. "Pipe from elsewhere" */
|
||||
gboolean is_tempfile; /* Is capture file a temporary file? */
|
||||
gboolean unsaved_changes; /* Does the capture file have changes that have not been saved? */
|
||||
char *filename; /* Name of capture file */
|
||||
char *source; /* Temp file source, e.g. "Pipe from elsewhere" */
|
||||
bool is_tempfile; /* Is capture file a temporary file? */
|
||||
bool unsaved_changes; /* Does the capture file have changes that have not been saved? */
|
||||
bool stop_flag; /* Stop current processing (loading, searching, etc.) */
|
||||
|
||||
gint64 f_datalen; /* Size of capture file data (uncompressed) */
|
||||
guint16 cd_t; /* File type of capture file */
|
||||
int64_t f_datalen; /* Size of capture file data (uncompressed) */
|
||||
uint16_t cd_t; /* File type of capture file */
|
||||
unsigned int open_type; /* open_routine index+1 used, if selected, or WTAP_TYPE_AUTO */
|
||||
wtap_compression_type compression_type; /* Compression type of the file, or uncompressed */
|
||||
int lnk_t; /* File link-layer type; could be WTAP_ENCAP_PER_PACKET */
|
||||
GArray *linktypes; /* Array of packet link-layer types */
|
||||
guint32 count; /* Total number of frames */
|
||||
guint64 packet_comment_count; /* Number of comments in frames (could be >1 per frame... */
|
||||
guint32 displayed_count; /* Number of displayed frames */
|
||||
guint32 marked_count; /* Number of marked frames */
|
||||
guint32 ignored_count; /* Number of ignored frames */
|
||||
guint32 ref_time_count; /* Number of time referenced frames */
|
||||
gboolean drops_known; /* TRUE if we know how many packets were dropped */
|
||||
guint32 drops; /* Dropped packets */
|
||||
uint32_t count; /* Total number of frames */
|
||||
uint64_t packet_comment_count; /* Number of comments in frames (could be >1 per frame... */
|
||||
uint32_t displayed_count; /* Number of displayed frames */
|
||||
uint32_t marked_count; /* Number of marked frames */
|
||||
uint32_t ignored_count; /* Number of ignored frames */
|
||||
uint32_t ref_time_count; /* Number of time referenced frames */
|
||||
bool drops_known; /* true if we know how many packets were dropped */
|
||||
uint32_t drops; /* Dropped packets */
|
||||
nstime_t elapsed_time; /* Elapsed time */
|
||||
int snap; /* Maximum captured packet length; 0 if unknown */
|
||||
dfilter_t *rfcode; /* Compiled read filter program */
|
||||
dfilter_t *dfcode; /* Compiled display filter program */
|
||||
gchar *dfilter; /* Display filter string */
|
||||
gboolean redissecting; /* TRUE if currently redissecting (cf_redissect_packets) */
|
||||
gboolean read_lock; /* TRUE if currently processing a file (cf_read) */
|
||||
char *dfilter; /* Display filter string */
|
||||
bool redissecting; /* true if currently redissecting (cf_redissect_packets) */
|
||||
bool read_lock; /* true if currently processing a file (cf_read) */
|
||||
rescan_type redissection_queued; /* Queued redissection type. */
|
||||
/* search */
|
||||
gchar *sfilter; /* Filter, hex value, or string being searched */
|
||||
char *sfilter; /* Filter, hex value, or string being searched */
|
||||
/* XXX: Some of these booleans should be enums; they're exclusive cases */
|
||||
gboolean hex; /* TRUE if "Hex value" search was last selected */
|
||||
gboolean string; /* TRUE if "String" (or "Regex"?) search was last selected */
|
||||
gboolean summary_data; /* TRUE if "String" search in "Packet list" (Info column) was last selected */
|
||||
gboolean decode_data; /* TRUE if "String" search in "Packet details" was last selected */
|
||||
gboolean packet_data; /* TRUE if "String" search in "Packet data" was last selected */
|
||||
guint32 search_pos; /* Byte position of first byte found in a hex search */
|
||||
guint32 search_len; /* Length of bytes matching the search */
|
||||
gboolean case_type; /* TRUE if case-insensitive text search */
|
||||
bool hex; /* true if "Hex value" search was last selected */
|
||||
bool string; /* true if "String" (or "Regex"?) search was last selected */
|
||||
bool summary_data; /* true if "String" search in "Packet list" (Info column) was last selected */
|
||||
bool decode_data; /* true if "String" search in "Packet details" was last selected */
|
||||
bool packet_data; /* true if "String" search in "Packet data" was last selected */
|
||||
uint32_t search_pos; /* Byte position of first byte found in a hex search */
|
||||
uint32_t search_len; /* Length of bytes matching the search */
|
||||
bool case_type; /* true if case-insensitive text search */
|
||||
ws_regex_t *regex; /* Set if regular expression search */
|
||||
search_charset_t scs_type; /* Character set for text search */
|
||||
search_direction dir; /* Direction in which to do searches */
|
||||
gboolean search_in_progress; /* TRUE if user just clicked OK in the Find dialog or hit <control>N/B */
|
||||
bool search_in_progress; /* true if user just clicked OK in the Find dialog or hit <control>N/B */
|
||||
/* packet provider */
|
||||
struct packet_provider_data provider;
|
||||
/* frames */
|
||||
guint32 first_displayed; /* Frame number of first frame displayed */
|
||||
guint32 last_displayed; /* Frame number of last frame displayed */
|
||||
uint32_t first_displayed; /* Frame number of first frame displayed */
|
||||
uint32_t last_displayed; /* Frame number of last frame displayed */
|
||||
/* Data for currently selected frame */
|
||||
column_info cinfo; /* Column formatting information */
|
||||
frame_data *current_frame; /* Frame data */
|
||||
@ -123,10 +123,10 @@ typedef struct _capture_file {
|
||||
wtap_rec rec; /* Record header */
|
||||
Buffer buf; /* Record data */
|
||||
|
||||
gpointer window; /* Top-level window associated with file */
|
||||
gulong computed_elapsed; /* Elapsed time to load the file (in msec). */
|
||||
void * window; /* Top-level window associated with file */
|
||||
unsigned long computed_elapsed; /* Elapsed time to load the file (in msec). */
|
||||
|
||||
guint32 cum_bytes;
|
||||
uint32_t cum_bytes;
|
||||
} capture_file;
|
||||
|
||||
extern void cap_file_init(capture_file *cf);
|
||||
|
162
file.h
162
file.h
@ -70,7 +70,7 @@ typedef enum {
|
||||
cf_cb_file_save_stopped
|
||||
} cf_cbs;
|
||||
|
||||
typedef void (*cf_callback_t) (gint event, gpointer data, gpointer user_data);
|
||||
typedef void (*cf_callback_t) (int event, void *data, void *user_data);
|
||||
|
||||
typedef struct {
|
||||
const char *string;
|
||||
@ -78,8 +78,8 @@ typedef struct {
|
||||
capture_file *cf;
|
||||
field_info *finfo;
|
||||
field_info *prev_finfo;
|
||||
gboolean frame_matched;
|
||||
gboolean halt;
|
||||
bool frame_matched;
|
||||
bool halt;
|
||||
} match_data;
|
||||
|
||||
/**
|
||||
@ -88,7 +88,7 @@ typedef struct {
|
||||
* @param max_records maximum number of records to support.
|
||||
*/
|
||||
extern void
|
||||
cf_set_max_records(guint max_records);
|
||||
cf_set_max_records(unsigned max_records);
|
||||
|
||||
/**
|
||||
* Add a capture file event callback.
|
||||
@ -102,7 +102,7 @@ cf_set_max_records(guint max_records);
|
||||
*/
|
||||
|
||||
extern void
|
||||
cf_callback_add(cf_callback_t func, gpointer user_data);
|
||||
cf_callback_add(cf_callback_t func, void *user_data);
|
||||
|
||||
/**
|
||||
* Remove a capture file event callback.
|
||||
@ -112,7 +112,7 @@ cf_callback_add(cf_callback_t func, gpointer user_data);
|
||||
*/
|
||||
|
||||
extern void
|
||||
cf_callback_remove(cf_callback_t func, gpointer user_data);
|
||||
cf_callback_remove(cf_callback_t func, void *user_data);
|
||||
|
||||
/**
|
||||
* Open a capture file.
|
||||
@ -124,7 +124,7 @@ cf_callback_remove(cf_callback_t func, gpointer user_data);
|
||||
* @param err error code
|
||||
* @return one of cf_status_t
|
||||
*/
|
||||
cf_status_t cf_open(capture_file *cf, const char *fname, unsigned int type, gboolean is_tempfile, int *err);
|
||||
cf_status_t cf_open(capture_file *cf, const char *fname, unsigned int type, bool is_tempfile, int *err);
|
||||
|
||||
/**
|
||||
* Close a capture file.
|
||||
@ -148,7 +148,7 @@ cf_status_t cf_reload(capture_file *cf);
|
||||
* @param reloading reread asked for from cf_save_records()
|
||||
* @return one of cf_read_status_t
|
||||
*/
|
||||
cf_read_status_t cf_read(capture_file *cf, gboolean reloading);
|
||||
cf_read_status_t cf_read(capture_file *cf, bool reloading);
|
||||
|
||||
/**
|
||||
* Read the metadata and raw data for a record. It will pop
|
||||
@ -159,13 +159,13 @@ cf_read_status_t cf_read(capture_file *cf, gboolean reloading);
|
||||
* @param rec pointer to a wtap_rec structure to contain the
|
||||
* record's metadata
|
||||
* @param buf a Buffer into which to read the record's raw data
|
||||
* @return TRUE if the read succeeded, FALSE if there was an error
|
||||
* @return true if the read succeeded, false if there was an error
|
||||
*/
|
||||
gboolean cf_read_record(capture_file *cf, const frame_data *fdata,
|
||||
bool cf_read_record(capture_file *cf, const frame_data *fdata,
|
||||
wtap_rec *rec, Buffer *buf);
|
||||
|
||||
/** Same as cf_read_record() but does not pop alert box on error */
|
||||
gboolean cf_read_record_no_alert(capture_file *cf, const frame_data *fdata,
|
||||
bool cf_read_record_no_alert(capture_file *cf, const frame_data *fdata,
|
||||
wtap_rec *rec, Buffer *buf);
|
||||
|
||||
|
||||
@ -175,9 +175,9 @@ gboolean cf_read_record_no_alert(capture_file *cf, const frame_data *fdata,
|
||||
* It will pop up an alert box if there's an error.
|
||||
*
|
||||
* @param cf the capture file from which to read the record
|
||||
* @return TRUE if the read succeeded, FALSE if there was an error
|
||||
* @return true if the read succeeded, false if there was an error
|
||||
*/
|
||||
gboolean cf_read_current_record(capture_file *cf);
|
||||
bool cf_read_current_record(capture_file *cf);
|
||||
|
||||
/**
|
||||
* Read packets from the "end" of a capture file.
|
||||
@ -218,34 +218,34 @@ cf_read_status_t cf_finish_tail(capture_file *cf, wtap_rec *rec,
|
||||
* in any format using Wiretap rather than by copying the raw data.
|
||||
*
|
||||
* @param cf the capture file to check
|
||||
* @return TRUE if it can be written, FALSE if it can't
|
||||
* @return true if it can be written, false if it can't
|
||||
*/
|
||||
gboolean cf_can_write_with_wiretap(capture_file *cf);
|
||||
bool cf_can_write_with_wiretap(capture_file *cf);
|
||||
|
||||
/**
|
||||
* Determine whether this capture file can be saved with a "save" operation;
|
||||
* if there's nothing unsaved, it can't.
|
||||
*
|
||||
* @param cf the capture file to check
|
||||
* @return TRUE if it can be saved, FALSE if it can't
|
||||
* @return true if it can be saved, false if it can't
|
||||
*/
|
||||
gboolean cf_can_save(capture_file *cf);
|
||||
bool cf_can_save(capture_file *cf);
|
||||
|
||||
/**
|
||||
* Determine whether this capture file can be saved with a "save as" operation.
|
||||
*
|
||||
* @param cf the capture file to check
|
||||
* @return TRUE if it can be saved, FALSE if it can't
|
||||
* @return true if it can be saved, false if it can't
|
||||
*/
|
||||
gboolean cf_can_save_as(capture_file *cf);
|
||||
bool cf_can_save_as(capture_file *cf);
|
||||
|
||||
/**
|
||||
* Determine whether this capture file has unsaved data.
|
||||
*
|
||||
* @param cf the capture file to check
|
||||
* @return TRUE if it has unsaved data, FALSE if it doesn't
|
||||
* @return true if it has unsaved data, false if it doesn't
|
||||
*/
|
||||
gboolean cf_has_unsaved_data(capture_file *cf);
|
||||
bool cf_has_unsaved_data(capture_file *cf);
|
||||
|
||||
/**
|
||||
* Save all packets in a capture file to a new file, and, if that succeeds,
|
||||
@ -258,18 +258,18 @@ gboolean cf_has_unsaved_data(capture_file *cf);
|
||||
* @param fname the filename to save to
|
||||
* @param save_format the format of the file to save (libpcap, ...)
|
||||
* @param compression_type type of compression to use when writing, if any
|
||||
* @param discard_comments TRUE if we should discard comments if the save
|
||||
* @param discard_comments true if we should discard comments if the save
|
||||
* succeeds (because we saved in a format that doesn't support
|
||||
* comments)
|
||||
* @param dont_reopen TRUE if it shouldn't reopen and make that file the
|
||||
* @param dont_reopen true if it shouldn't reopen and make that file the
|
||||
* current capture file
|
||||
* @return one of cf_write_status_t
|
||||
*/
|
||||
cf_write_status_t cf_save_records(capture_file * cf, const char *fname,
|
||||
guint save_format,
|
||||
unsigned save_format,
|
||||
wtap_compression_type compression_type,
|
||||
gboolean discard_comments,
|
||||
gboolean dont_reopen);
|
||||
bool discard_comments,
|
||||
bool dont_reopen);
|
||||
|
||||
/**
|
||||
* Export some or all packets from a capture file to a new file. If there's
|
||||
@ -288,7 +288,7 @@ cf_write_status_t cf_save_records(capture_file * cf, const char *fname,
|
||||
cf_write_status_t cf_export_specified_packets(capture_file *cf,
|
||||
const char *fname,
|
||||
packet_range_t *range,
|
||||
guint save_format,
|
||||
unsigned save_format,
|
||||
wtap_compression_type compression_type);
|
||||
|
||||
/**
|
||||
@ -297,7 +297,7 @@ cf_write_status_t cf_export_specified_packets(capture_file *cf,
|
||||
* @param cf the capture file
|
||||
* @return the displayable name (must be g_free'd)
|
||||
*/
|
||||
gchar *cf_get_display_name(capture_file *cf);
|
||||
char *cf_get_display_name(capture_file *cf);
|
||||
|
||||
/**
|
||||
* Get a name that can be used to generate a file name from the
|
||||
@ -308,7 +308,7 @@ gchar *cf_get_display_name(capture_file *cf);
|
||||
* @param cf the capture file
|
||||
* @return the base name (must be g_free'd)
|
||||
*/
|
||||
gchar *cf_get_basename(capture_file *cf);
|
||||
char *cf_get_basename(capture_file *cf);
|
||||
|
||||
/**
|
||||
* Set the source of the capture data for temporary files, e.g.
|
||||
@ -317,7 +317,7 @@ gchar *cf_get_basename(capture_file *cf);
|
||||
* @param cf the capture file
|
||||
* @param source the source description. this will be copied internally.
|
||||
*/
|
||||
void cf_set_tempfile_source(capture_file *cf, gchar *source);
|
||||
void cf_set_tempfile_source(capture_file *cf, char *source);
|
||||
|
||||
/**
|
||||
* Get the source of the capture data for temporary files. Guaranteed to
|
||||
@ -325,7 +325,7 @@ void cf_set_tempfile_source(capture_file *cf, gchar *source);
|
||||
*
|
||||
* @param cf the capture file
|
||||
*/
|
||||
const gchar *cf_get_tempfile_source(capture_file *cf);
|
||||
const char *cf_get_tempfile_source(capture_file *cf);
|
||||
|
||||
/**
|
||||
* Get the number of packets in the capture file.
|
||||
@ -339,22 +339,22 @@ int cf_get_packet_count(capture_file *cf);
|
||||
* Is this capture file a temporary file?
|
||||
*
|
||||
* @param cf the capture file
|
||||
* @return TRUE if it's a temporary file, FALSE otherwise
|
||||
* @return true if it's a temporary file, false otherwise
|
||||
*/
|
||||
gboolean cf_is_tempfile(capture_file *cf);
|
||||
bool cf_is_tempfile(capture_file *cf);
|
||||
|
||||
/**
|
||||
* Set flag, that this file is a tempfile.
|
||||
*/
|
||||
void cf_set_tempfile(capture_file *cf, gboolean is_tempfile);
|
||||
void cf_set_tempfile(capture_file *cf, bool is_tempfile);
|
||||
|
||||
/**
|
||||
* Set flag, if the number of packet drops while capturing are known or not.
|
||||
*
|
||||
* @param cf the capture file
|
||||
* @param drops_known TRUE if the number of packet drops are known, FALSE otherwise
|
||||
* @param drops_known true if the number of packet drops are known, false otherwise
|
||||
*/
|
||||
void cf_set_drops_known(capture_file *cf, gboolean drops_known);
|
||||
void cf_set_drops_known(capture_file *cf, bool drops_known);
|
||||
|
||||
/**
|
||||
* Set the number of packet drops while capturing.
|
||||
@ -362,15 +362,15 @@ void cf_set_drops_known(capture_file *cf, gboolean drops_known);
|
||||
* @param cf the capture file
|
||||
* @param drops the number of packet drops occurred while capturing
|
||||
*/
|
||||
void cf_set_drops(capture_file *cf, guint32 drops);
|
||||
void cf_set_drops(capture_file *cf, uint32_t drops);
|
||||
|
||||
/**
|
||||
* Get flag state, if the number of packet drops while capturing are known or not.
|
||||
*
|
||||
* @param cf the capture file
|
||||
* @return TRUE if the number of packet drops are known, FALSE otherwise
|
||||
* @return true if the number of packet drops are known, false otherwise
|
||||
*/
|
||||
gboolean cf_get_drops_known(capture_file *cf);
|
||||
bool cf_get_drops_known(capture_file *cf);
|
||||
|
||||
/**
|
||||
* Get the number of packet drops while capturing.
|
||||
@ -378,7 +378,7 @@ gboolean cf_get_drops_known(capture_file *cf);
|
||||
* @param cf the capture file
|
||||
* @return the number of packet drops occurred while capturing
|
||||
*/
|
||||
guint32 cf_get_drops(capture_file *cf);
|
||||
uint32_t cf_get_drops(capture_file *cf);
|
||||
|
||||
/**
|
||||
* Set the read filter.
|
||||
@ -394,10 +394,10 @@ void cf_set_rfcode(capture_file *cf, dfilter_t *rfcode);
|
||||
*
|
||||
* @param cf the capture file
|
||||
* @param dfilter the display filter
|
||||
* @param force TRUE if do in any case, FALSE only if dfilter changed
|
||||
* @param force true if do in any case, false only if dfilter changed
|
||||
* @return one of cf_status_t
|
||||
*/
|
||||
cf_status_t cf_filter_packets(capture_file *cf, gchar *dfilter, gboolean force);
|
||||
cf_status_t cf_filter_packets(capture_file *cf, char *dfilter, bool force);
|
||||
|
||||
/**
|
||||
* Scan through all frame data and recalculate the ref time
|
||||
@ -410,7 +410,7 @@ void cf_reftime_packets(capture_file *cf);
|
||||
/**
|
||||
* Return the time it took to load the file (in msec).
|
||||
*/
|
||||
gulong cf_get_computed_elapsed(capture_file *cf);
|
||||
unsigned long cf_get_computed_elapsed(capture_file *cf);
|
||||
|
||||
/**
|
||||
* "Something" has changed, rescan all packets.
|
||||
@ -438,18 +438,18 @@ typedef enum {
|
||||
typedef struct {
|
||||
print_stream_t *stream; /* the stream to which we're printing */
|
||||
print_format_e format; /* plain text or PostScript */
|
||||
gboolean to_file; /* TRUE if we're printing to a file */
|
||||
bool to_file; /* true if we're printing to a file */
|
||||
char *file; /* file output pathname */
|
||||
char *cmd; /* print command string (not win32) */
|
||||
packet_range_t range;
|
||||
|
||||
gboolean print_summary; /* TRUE if we should print summary line. */
|
||||
gboolean print_col_headings; /* TRUE if we should print column headings */
|
||||
bool print_summary; /* true if we should print summary line. */
|
||||
bool print_col_headings; /* true if we should print column headings */
|
||||
print_dissections_e print_dissections;
|
||||
gboolean print_hex; /* TRUE if we should print hex data;
|
||||
* FALSE if we should print only if not dissected. */
|
||||
guint hexdump_options; /* Hexdump options if print_hex is TRUE. */
|
||||
gboolean print_formfeed; /* TRUE if a formfeed should be printed before
|
||||
bool print_hex; /* true if we should print hex data;
|
||||
* false if we should print only if not dissected. */
|
||||
unsigned hexdump_options; /* Hexdump options if print_hex is true. */
|
||||
bool print_formfeed; /* true if a formfeed should be printed before
|
||||
* each new packet */
|
||||
} print_args_t;
|
||||
|
||||
@ -458,11 +458,11 @@ typedef struct {
|
||||
*
|
||||
* @param cf the capture file
|
||||
* @param print_args the arguments what and how to print
|
||||
* @param show_progress_bar TRUE if a progress bar is to be shown
|
||||
* @param show_progress_bar true if a progress bar is to be shown
|
||||
* @return one of cf_print_status_t
|
||||
*/
|
||||
cf_print_status_t cf_print_packets(capture_file *cf, print_args_t *print_args,
|
||||
gboolean show_progress_bar);
|
||||
bool show_progress_bar);
|
||||
|
||||
/**
|
||||
* Print (export) the capture file into PDML format.
|
||||
@ -517,9 +517,9 @@ cf_print_status_t cf_write_json_packets(capture_file *cf, print_args_t *print_ar
|
||||
* @param dir direction in which to search
|
||||
* @param multiple whether to look for the next occurrence of the same string
|
||||
* in the current packet, or to only match once per frame
|
||||
* @return TRUE if a packet was found, FALSE otherwise
|
||||
* @return true if a packet was found, false otherwise
|
||||
*/
|
||||
gboolean cf_find_packet_protocol_tree(capture_file *cf, const char *string,
|
||||
bool cf_find_packet_protocol_tree(capture_file *cf, const char *string,
|
||||
search_direction dir, bool multiple);
|
||||
|
||||
/**
|
||||
@ -538,9 +538,9 @@ extern field_info* cf_find_string_protocol_tree(capture_file *cf, proto_tree *tr
|
||||
* @param cf the capture file
|
||||
* @param string the string to find
|
||||
* @param dir direction in which to search
|
||||
* @return TRUE if a packet was found, FALSE otherwise
|
||||
* @return true if a packet was found, false otherwise
|
||||
*/
|
||||
gboolean cf_find_packet_summary_line(capture_file *cf, const char *string,
|
||||
bool cf_find_packet_summary_line(capture_file *cf, const char *string,
|
||||
search_direction dir);
|
||||
|
||||
/**
|
||||
@ -552,9 +552,9 @@ gboolean cf_find_packet_summary_line(capture_file *cf, const char *string,
|
||||
* @param dir direction in which to search
|
||||
* @param multiple whether to look for the next occurrence of the same string
|
||||
* in the current packet, or to only match once per frame
|
||||
* @return TRUE if a packet was found, FALSE otherwise
|
||||
* @return true if a packet was found, false otherwise
|
||||
*/
|
||||
gboolean cf_find_packet_data(capture_file *cf, const guint8 *string,
|
||||
bool cf_find_packet_data(capture_file *cf, const uint8_t *string,
|
||||
size_t string_size, search_direction dir,
|
||||
bool multiple);
|
||||
|
||||
@ -564,9 +564,9 @@ gboolean cf_find_packet_data(capture_file *cf, const guint8 *string,
|
||||
* @param cf the capture file
|
||||
* @param sfcode the display filter to match
|
||||
* @param dir direction in which to search
|
||||
* @return TRUE if a packet was found, FALSE otherwise
|
||||
* @return true if a packet was found, false otherwise
|
||||
*/
|
||||
gboolean cf_find_packet_dfilter(capture_file *cf, dfilter_t *sfcode,
|
||||
bool cf_find_packet_dfilter(capture_file *cf, dfilter_t *sfcode,
|
||||
search_direction dir);
|
||||
|
||||
/**
|
||||
@ -575,9 +575,9 @@ gboolean cf_find_packet_dfilter(capture_file *cf, dfilter_t *sfcode,
|
||||
* @param cf the capture file
|
||||
* @param filter the display filter to match
|
||||
* @param dir direction in which to search
|
||||
* @return TRUE if a packet was found, FALSE otherwise
|
||||
* @return true if a packet was found, false otherwise
|
||||
*/
|
||||
gboolean
|
||||
bool
|
||||
cf_find_packet_dfilter_string(capture_file *cf, const char *filter,
|
||||
search_direction dir);
|
||||
|
||||
@ -586,29 +586,29 @@ cf_find_packet_dfilter_string(capture_file *cf, const char *filter,
|
||||
*
|
||||
* @param cf the capture file
|
||||
* @param dir direction in which to search
|
||||
* @return TRUE if a packet was found, FALSE otherwise
|
||||
* @return true if a packet was found, false otherwise
|
||||
*/
|
||||
gboolean cf_find_packet_marked(capture_file *cf, search_direction dir);
|
||||
bool cf_find_packet_marked(capture_file *cf, search_direction dir);
|
||||
|
||||
/**
|
||||
* Find time-reference packet.
|
||||
*
|
||||
* @param cf the capture file
|
||||
* @param dir direction in which to search
|
||||
* @return TRUE if a packet was found, FALSE otherwise
|
||||
* @return true if a packet was found, false otherwise
|
||||
*/
|
||||
gboolean cf_find_packet_time_reference(capture_file *cf, search_direction dir);
|
||||
bool cf_find_packet_time_reference(capture_file *cf, search_direction dir);
|
||||
|
||||
/**
|
||||
* GoTo Packet with the given row.
|
||||
*
|
||||
* @param cf the capture file
|
||||
* @param row the row to go to
|
||||
* @param exact if TRUE, fail if the row exists and is filtered (not displayed)
|
||||
* if FALSE, go to the nearest displayed packet instead
|
||||
* @return TRUE if this row exists, FALSE otherwise
|
||||
* @param exact if true, fail if the row exists and is filtered (not displayed)
|
||||
* if false, go to the nearest displayed packet instead
|
||||
* @return true if this row exists, false otherwise
|
||||
*/
|
||||
gboolean cf_goto_frame(capture_file *cf, guint row, gboolean exact);
|
||||
bool cf_goto_frame(capture_file *cf, unsigned row, bool exact);
|
||||
|
||||
/**
|
||||
* Go to frame specified by currently selected protocol tree field.
|
||||
@ -616,9 +616,9 @@ gboolean cf_goto_frame(capture_file *cf, guint row, gboolean exact);
|
||||
* @todo this is ugly and should be improved!
|
||||
*
|
||||
* @param cf the capture file
|
||||
* @return TRUE if this packet exists, FALSE otherwise
|
||||
* @return true if this packet exists, false otherwise
|
||||
*/
|
||||
gboolean cf_goto_framenum(capture_file *cf);
|
||||
bool cf_goto_framenum(capture_file *cf);
|
||||
|
||||
/**
|
||||
* Select the packet in the given row.
|
||||
@ -677,13 +677,13 @@ void cf_unignore_frame(capture_file *cf, frame_data *frame);
|
||||
* @param in_file_count the number of input files to merge
|
||||
* @param in_filenames array of input filenames
|
||||
* @param file_type the output filetype
|
||||
* @param do_append FALSE to merge chronologically, TRUE simply append
|
||||
* @param do_append false to merge chronologically, true simply append
|
||||
* @return one of cf_status_t
|
||||
*/
|
||||
cf_status_t
|
||||
cf_merge_files_to_tempfile(gpointer pd_window, const char *temp_dir, char **out_filenamep,
|
||||
cf_merge_files_to_tempfile(void *pd_window, const char *temp_dir, char **out_filenamep,
|
||||
int in_file_count, const char *const *in_filenames,
|
||||
int file_type, gboolean do_append);
|
||||
int file_type, bool do_append);
|
||||
|
||||
/**
|
||||
* Update(replace) the comment on a capture from the SHB data block
|
||||
@ -692,7 +692,7 @@ cf_merge_files_to_tempfile(gpointer pd_window, const char *temp_dir, char **out_
|
||||
* @param cf the capture file
|
||||
* @param comment the string replacing the old comment
|
||||
*/
|
||||
void cf_update_section_comment(capture_file *cf, gchar *comment);
|
||||
void cf_update_section_comment(capture_file *cf, char *comment);
|
||||
|
||||
/**
|
||||
* Update(replace) the comments on a capture from the SHB data block
|
||||
@ -722,11 +722,11 @@ wtap_block_t cf_get_packet_block(capture_file *cf, const frame_data *fd);
|
||||
* @param fd the frame_data structure for the frame
|
||||
* @param new_block the block replacing the old block
|
||||
*
|
||||
* @return TRUE if the block is modified for the first time. FALSE if
|
||||
* @return true if the block is modified for the first time. false if
|
||||
* the block was already modified before, in which case the caller is
|
||||
* responsible for updating the comment count.
|
||||
*/
|
||||
gboolean cf_set_modified_block(capture_file *cf, frame_data *fd, const wtap_block_t new_block);
|
||||
bool cf_set_modified_block(capture_file *cf, frame_data *fd, const wtap_block_t new_block);
|
||||
|
||||
/**
|
||||
* What types of comments does this file have?
|
||||
@ -734,7 +734,7 @@ gboolean cf_set_modified_block(capture_file *cf, frame_data *fd, const wtap_bloc
|
||||
* @param cf the capture file
|
||||
* @return bitset of WTAP_COMMENT_ values
|
||||
*/
|
||||
guint32 cf_comment_types(capture_file *cf);
|
||||
uint32_t cf_comment_types(capture_file *cf);
|
||||
|
||||
/**
|
||||
* Add a resolved address to this file's list of resolved addresses.
|
||||
@ -742,9 +742,9 @@ guint32 cf_comment_types(capture_file *cf);
|
||||
* @param cf the capture file
|
||||
* @param addr a string representing an IPv4 or IPv6 address
|
||||
* @param name a string containing a name corresponding to that address
|
||||
* @return TRUE if it succeeds, FALSE if not
|
||||
* @return true if it succeeds, false if not
|
||||
*/
|
||||
gboolean cf_add_ip_name_from_string(capture_file *cf, const char *addr, const char *name);
|
||||
bool cf_add_ip_name_from_string(capture_file *cf, const char *addr, const char *name);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
4
sharkd.c
4
sharkd.c
@ -390,7 +390,7 @@ load_cap_file(capture_file *cf, int max_packet_count, gint64 max_byte_count)
|
||||
}
|
||||
|
||||
cf_status_t
|
||||
cf_open(capture_file *cf, const char *fname, unsigned int type, gboolean is_tempfile, int *err)
|
||||
cf_open(capture_file *cf, const char *fname, unsigned int type, bool is_tempfile, int *err)
|
||||
{
|
||||
wtap *wth;
|
||||
gchar *err_info;
|
||||
@ -465,7 +465,7 @@ sharkd_cmdarg_err_cont(const char *msg_format, va_list ap)
|
||||
}
|
||||
|
||||
cf_status_t
|
||||
sharkd_cf_open(const char *fname, unsigned int type, gboolean is_tempfile, int *err)
|
||||
sharkd_cf_open(const char *fname, unsigned int type, bool is_tempfile, int *err)
|
||||
{
|
||||
return cf_open(&cfile, fname, type, is_tempfile, err);
|
||||
}
|
||||
|
2
sharkd.h
2
sharkd.h
@ -29,7 +29,7 @@
|
||||
typedef void (*sharkd_dissect_func_t)(epan_dissect_t *edt, proto_tree *tree, struct epan_column_info *cinfo, const GSList *data_src, void *data);
|
||||
|
||||
/* sharkd.c */
|
||||
cf_status_t sharkd_cf_open(const char *fname, unsigned int type, gboolean is_tempfile, int *err);
|
||||
cf_status_t sharkd_cf_open(const char *fname, unsigned int type, bool is_tempfile, int *err);
|
||||
int sharkd_load_cap_file(void);
|
||||
int sharkd_retap(void);
|
||||
int sharkd_filter(const char *dftext, guint8 **result);
|
||||
|
@ -1178,7 +1178,7 @@ sharkd_session_process_load(const char *buf, const jsmntok_t *tokens, int count)
|
||||
|
||||
fprintf(stderr, "load: filename=%s\n", tok_file);
|
||||
|
||||
if (sharkd_cf_open(tok_file, WTAP_TYPE_AUTO, FALSE, &err) != CF_OK)
|
||||
if (sharkd_cf_open(tok_file, WTAP_TYPE_AUTO, false, &err) != CF_OK)
|
||||
{
|
||||
sharkd_json_error(
|
||||
rpcid, -2001, NULL,
|
||||
|
@ -915,7 +915,7 @@ main(int argc, char *argv[])
|
||||
|
||||
/* TODO: if tfshark is ever changed to give the user a choice of which
|
||||
open_routine reader to use, then the following needs to change. */
|
||||
if (cf_open(&cfile, cf_name, WTAP_TYPE_AUTO, FALSE, &err) != CF_OK) {
|
||||
if (cf_open(&cfile, cf_name, WTAP_TYPE_AUTO, false, &err) != CF_OK) {
|
||||
exit_status = WS_EXIT_OPEN_ERROR;
|
||||
goto clean_exit;
|
||||
}
|
||||
@ -1990,7 +1990,7 @@ write_finale(void)
|
||||
}
|
||||
|
||||
cf_status_t
|
||||
cf_open(capture_file *cf, const char *fname, unsigned int type, gboolean is_tempfile, int *err _U_)
|
||||
cf_open(capture_file *cf, const char *fname, unsigned int type, bool is_tempfile, int *err _U_)
|
||||
{
|
||||
/* The open isn't implemented yet. Fill in the information for this file. */
|
||||
|
||||
|
10
tshark.c
10
tshark.c
@ -2450,7 +2450,7 @@ main(int argc, char *argv[])
|
||||
/*
|
||||
* We're reading a capture file.
|
||||
*/
|
||||
if (cf_open(&cfile, cf_name, in_file_type, FALSE, &err) != CF_OK) {
|
||||
if (cf_open(&cfile, cf_name, in_file_type, false, &err) != CF_OK) {
|
||||
epan_cleanup();
|
||||
extcap_cleanup();
|
||||
exit_status = WS_EXIT_INVALID_FILE;
|
||||
@ -2963,7 +2963,7 @@ capture_input_new_file(capture_session *cap_session, gchar *new_file)
|
||||
{
|
||||
capture_options *capture_opts = cap_session->capture_opts;
|
||||
capture_file *cf = cap_session->cf;
|
||||
gboolean is_tempfile;
|
||||
bool is_tempfile;
|
||||
int err;
|
||||
|
||||
if (really_quiet == FALSE) {
|
||||
@ -2984,13 +2984,13 @@ capture_input_new_file(capture_session *cap_session, gchar *new_file)
|
||||
}
|
||||
|
||||
g_free(capture_opts->save_file);
|
||||
is_tempfile = FALSE;
|
||||
is_tempfile = false;
|
||||
|
||||
epan_free(cf->epan);
|
||||
cf->epan = tshark_epan_new(cf);
|
||||
} else {
|
||||
/* we didn't had a save_file before, must be a tempfile */
|
||||
is_tempfile = TRUE;
|
||||
is_tempfile = true;
|
||||
}
|
||||
|
||||
/* save the new filename */
|
||||
@ -4811,7 +4811,7 @@ cf_close(capture_file *cf)
|
||||
}
|
||||
|
||||
cf_status_t
|
||||
cf_open(capture_file *cf, const char *fname, unsigned int type, gboolean is_tempfile, int *err)
|
||||
cf_open(capture_file *cf, const char *fname, unsigned int type, bool is_tempfile, int *err)
|
||||
{
|
||||
wtap *wth;
|
||||
gchar *err_info;
|
||||
|
Loading…
x
Reference in New Issue
Block a user