aboutsummaryrefslogtreecommitdiffstats
path: root/gtk
diff options
context:
space:
mode:
Diffstat (limited to 'gtk')
-rw-r--r--gtk/bootp_stat.c2
-rw-r--r--gtk/color_dlg.c6
-rw-r--r--gtk/conversations_table.c4
-rw-r--r--gtk/dcerpc_stat.c2
-rw-r--r--gtk/decode_as_dlg.c6
-rw-r--r--gtk/fc_stat.c2
-rw-r--r--gtk/file_dlg.c22
-rw-r--r--gtk/find_dlg.c22
-rw-r--r--gtk/goto_dlg.c8
-rw-r--r--gtk/graph_analysis.c2
-rw-r--r--gtk/h225_counter.c2
-rw-r--r--gtk/h225_ras_srt.c2
-rw-r--r--gtk/h323_analysis.c4
-rw-r--r--gtk/h323_conversations_dlg.c2
-rw-r--r--gtk/hostlist_table.c4
-rw-r--r--gtk/http_stat.c2
-rw-r--r--gtk/io_stat.c6
-rw-r--r--gtk/ldap_stat.c2
-rw-r--r--gtk/main.c38
-rw-r--r--gtk/main.h2
-rw-r--r--gtk/menu.c10
-rw-r--r--gtk/mgcp_stat.c2
-rw-r--r--gtk/packet_history.c4
-rw-r--r--gtk/packet_list.c10
-rw-r--r--gtk/prefs_dlg.c8
-rw-r--r--gtk/print_dlg.c14
-rw-r--r--gtk/proto_dlg.c8
-rw-r--r--gtk/proto_draw.c4
-rw-r--r--gtk/rpc_progs.c2
-rw-r--r--gtk/rpc_stat.c2
-rw-r--r--gtk/rtp_analysis.c8
-rw-r--r--gtk/rtp_stream.c8
-rw-r--r--gtk/rtp_stream_dlg.c2
-rw-r--r--gtk/sctp_error_dlg.c2
-rw-r--r--gtk/sctp_stat_dlg.c2
-rw-r--r--gtk/sip_stat.c2
-rw-r--r--gtk/smb_stat.c2
-rw-r--r--gtk/tcp_graph.c4
-rw-r--r--gtk/voip_calls_dlg.c2
-rw-r--r--gtk/wsp_stat.c2
40 files changed, 121 insertions, 117 deletions
diff --git a/gtk/bootp_stat.c b/gtk/bootp_stat.c
index d7b718e7ca..cf8e910ca9 100644
--- a/gtk/bootp_stat.c
+++ b/gtk/bootp_stat.c
@@ -268,7 +268,7 @@ dhcpstat_init(char *optarg)
window_present(sp->win);
- retap_packets(&cfile);
+ cf_retap_packets(&cfile);
}
static tap_dfilter_dlg dhcp_stat_dlg = {
diff --git a/gtk/color_dlg.c b/gtk/color_dlg.c
index 6cb2b5dc64..99a4182a29 100644
--- a/gtk/color_dlg.c
+++ b/gtk/color_dlg.c
@@ -1073,7 +1073,7 @@ color_clear_cmd(GtkWidget *widget)
"Could not delete filter file: %s", strerror(errno));
/* colorize list */
- colorize_packets(&cfile);
+ cf_colorize_packets(&cfile);
/* Destroy the dialog box. */
/* XXX: is this useful? user might want to continue with editing new colors */
@@ -1113,7 +1113,7 @@ static void
color_ok_cb(GtkButton *button _U_, gpointer user_data _U_)
{
/* colorize list */
- colorize_packets(&cfile);
+ cf_colorize_packets(&cfile);
/* Destroy the dialog box. */
window_destroy(colorize_win);
@@ -1132,7 +1132,7 @@ color_cancel_cb(GtkWidget *widget _U_, gpointer user_data _U_)
static void
color_apply_cb(GtkButton *button _U_, gpointer user_data _U_)
{
- colorize_packets(&cfile);
+ cf_colorize_packets(&cfile);
}
/* Create an "Edit Color Filter" dialog for a given color filter, and
diff --git a/gtk/conversations_table.c b/gtk/conversations_table.c
index d1ae9785dc..e8766d26ae 100644
--- a/gtk/conversations_table.c
+++ b/gtk/conversations_table.c
@@ -1283,7 +1283,7 @@ init_conversation_table(gboolean hide_ports, char *table_name, char *tap_name, c
gtk_widget_show_all(conversations->win);
window_present(conversations->win);
- retap_packets(&cfile);
+ cf_retap_packets(&cfile);
/* Keep clist frozen to cause modifications to the clist (inserts, appends, others that are extremely slow
@@ -1471,7 +1471,7 @@ init_conversation_notebook_cb(GtkWidget *w _U_, gpointer d _U_)
gtk_widget_show_all(win);
window_present(win);
- retap_packets(&cfile);
+ cf_retap_packets(&cfile);
/* after retapping, redraw table */
for (page=1; page<=GPOINTER_TO_INT(pages[0]); page++) {
diff --git a/gtk/dcerpc_stat.c b/gtk/dcerpc_stat.c
index 34e95fee8f..3ef040435d 100644
--- a/gtk/dcerpc_stat.c
+++ b/gtk/dcerpc_stat.c
@@ -331,7 +331,7 @@ gtk_dcerpcstat_init(char *optarg)
gtk_widget_show_all(rs->win);
window_present(rs->win);
- retap_packets(&cfile);
+ cf_retap_packets(&cfile);
}
diff --git a/gtk/decode_as_dlg.c b/gtk/decode_as_dlg.c
index 59043eb203..0c0347ab37 100644
--- a/gtk/decode_as_dlg.c
+++ b/gtk/decode_as_dlg.c
@@ -437,7 +437,7 @@ decode_clear_all(void)
decode_dcerpc_reset_all();
- redissect_packets(&cfile);
+ cf_redissect_packets(&cfile);
}
@@ -905,7 +905,7 @@ decode_ok_cb (GtkWidget *ok_bt _U_, gpointer parent_w)
g_slist_free(decode_dimmable);
decode_dimmable = NULL;
- redissect_packets(&cfile);
+ cf_redissect_packets(&cfile);
}
/*
@@ -934,7 +934,7 @@ decode_apply_cb (GtkWidget *apply_bt _U_, gpointer parent_w)
func = OBJECT_GET_DATA(notebook_pg, E_PAGE_ACTION);
func(notebook_pg);
- redissect_packets(&cfile);
+ cf_redissect_packets(&cfile);
}
/*
diff --git a/gtk/fc_stat.c b/gtk/fc_stat.c
index c62b355bd3..376b8abf56 100644
--- a/gtk/fc_stat.c
+++ b/gtk/fc_stat.c
@@ -196,7 +196,7 @@ gtk_fcstat_init(char *optarg)
gtk_widget_show_all(fc->win);
window_present(fc->win);
- retap_packets(&cfile);
+ cf_retap_packets(&cfile);
}
diff --git a/gtk/file_dlg.c b/gtk/file_dlg.c
index b4c3cf8546..8f35fd916f 100644
--- a/gtk/file_dlg.c
+++ b/gtk/file_dlg.c
@@ -676,7 +676,7 @@ file_open_ok_cb(GtkWidget *w, gpointer fs) {
}
/* Try to open the capture file. */
- if ((err = cf_open(cf_name, FALSE, &cfile)) != 0) {
+ if (cf_open(&cfile, cf_name, FALSE, &err) != CF_OK) {
/* We couldn't open it; don't dismiss the open dialog box,
just leave it around so that the user can, after they
dismiss the alert box popped up for the open error,
@@ -715,14 +715,14 @@ file_open_ok_cb(GtkWidget *w, gpointer fs) {
switch (cf_read(&cfile)) {
- case READ_SUCCESS:
- case READ_ERROR:
+ case CF_OK:
+ case CF_ERROR:
/* Just because we got an error, that doesn't mean we were unable
to read any of the file; we handle what we could get from the
file. */
break;
- case READ_ABORTED:
+ case CF_ABORTED:
/* The user bailed out of re-reading the capture file; the
capture file has been closed - just free the capture file name
string and return (without changing the last containing
@@ -1069,7 +1069,7 @@ file_merge_ok_cb(GtkWidget *w, gpointer fs) {
window_destroy(GTK_WIDGET (fs));
/* Try to open the merged capture file. */
- if ((err = cf_open(tmpname, TRUE /* temporary file */, &cfile)) != 0) {
+ if (cf_open(&cfile, tmpname, TRUE /* temporary file */, &err) != CF_OK) {
/* We couldn't open it; don't dismiss the open dialog box,
just leave it around so that the user can, after they
dismiss the alert box popped up for the open error,
@@ -1086,14 +1086,14 @@ file_merge_ok_cb(GtkWidget *w, gpointer fs) {
switch (cf_read(&cfile)) {
- case READ_SUCCESS:
- case READ_ERROR:
+ case CF_OK:
+ case CF_ERROR:
/* Just because we got an error, that doesn't mean we were unable
to read any of the file; we handle what we could get from the
file. */
break;
- case READ_ABORTED:
+ case CF_ABORTED:
/* The user bailed out of re-reading the capture file; the
capture file has been closed - just free the capture file name
string and return (without changing the last containing
@@ -1440,7 +1440,7 @@ file_save_as_ok_cb(GtkWidget *w _U_, gpointer fs) {
/* Write out the packets (all, or only the ones from the current
range) to the file with the specified name. */
- if (! cf_save(cf_name, &cfile, &range, filetype)) {
+ if (cf_save(&cfile, cf_name, &range, filetype) != CF_OK) {
/* The write failed; don't dismiss the open dialog box,
just leave it around so that the user can, after they
dismiss the alert box popped up for the error, try again. */
@@ -1458,7 +1458,7 @@ file_save_as_ok_cb(GtkWidget *w _U_, gpointer fs) {
}
/* The write succeeded; get rid of the file selection box. */
- /* cf_save might already closed our dialog! */
+ /* cf_save() might already closed our dialog! */
if (file_save_as_w)
window_destroy(GTK_WIDGET (fs));
@@ -1518,7 +1518,7 @@ file_save_as_destroy_cb(GtkWidget *win _U_, gpointer user_data _U_)
/* Reload a file using the current read and display filters */
void
file_reload_cmd_cb(GtkWidget *w _U_, gpointer data _U_) {
- cf_reload();
+ cf_reload(&cfile);
}
/******************** Color Filters *********************************/
diff --git a/gtk/find_dlg.c b/gtk/find_dlg.c
index 44260c02d0..cfc5867495 100644
--- a/gtk/find_dlg.c
+++ b/gtk/find_dlg.c
@@ -633,7 +633,7 @@ find_frame_ok_cb(GtkWidget *ok_bt _U_, gpointer parent_w)
cfile.summary_data = summary_data;
if (cfile.hex) {
- found_packet = find_packet_data(&cfile, bytes, nbytes);
+ found_packet = cf_find_packet_data(&cfile, bytes, nbytes);
g_free(bytes);
if (!found_packet) {
/* We didn't find a packet */
@@ -648,7 +648,7 @@ find_frame_ok_cb(GtkWidget *ok_bt _U_, gpointer parent_w)
/* OK, what are we searching? */
if (cfile.decode_data) {
/* The text in the protocol tree */
- found_packet = find_packet_protocol_tree(&cfile, string);
+ found_packet = cf_find_packet_protocol_tree(&cfile, string);
g_free(string);
if (!found_packet) {
/* We didn't find the packet. */
@@ -660,7 +660,7 @@ find_frame_ok_cb(GtkWidget *ok_bt _U_, gpointer parent_w)
}
} else if (cfile.summary_data) {
/* The text in the summary line */
- found_packet = find_packet_summary_line(&cfile, string);
+ found_packet = cf_find_packet_summary_line(&cfile, string);
g_free(string);
if (!found_packet) {
/* We didn't find the packet. */
@@ -672,7 +672,7 @@ find_frame_ok_cb(GtkWidget *ok_bt _U_, gpointer parent_w)
}
} else {
/* The raw packet data */
- found_packet = find_packet_data(&cfile, string, strlen(string));
+ found_packet = cf_find_packet_data(&cfile, string, strlen(string));
g_free(string);
if (!found_packet) {
/* We didn't find the packet. */
@@ -684,7 +684,7 @@ find_frame_ok_cb(GtkWidget *ok_bt _U_, gpointer parent_w)
}
}
} else {
- found_packet = find_packet_dfilter(&cfile, sfcode);
+ found_packet = cf_find_packet_dfilter(&cfile, sfcode);
dfilter_free(sfcode);
if (!found_packet) {
/* We didn't find a packet */
@@ -732,20 +732,20 @@ find_previous_next(GtkWidget *w, gpointer d, gboolean sens)
*/
return;
}
- find_packet_data(&cfile, bytes, nbytes);
+ cf_find_packet_data(&cfile, bytes, nbytes);
g_free(bytes);
} else if (cfile.string) {
string = convert_string_case(cfile.sfilter, cfile.case_type);
/* OK, what are we searching? */
if (cfile.decode_data) {
/* The text in the protocol tree */
- find_packet_protocol_tree(&cfile, string);
+ cf_find_packet_protocol_tree(&cfile, string);
} else if (cfile.summary_data) {
/* The text in the summary line */
- find_packet_summary_line(&cfile, string);
+ cf_find_packet_summary_line(&cfile, string);
} else {
/* The raw packet data */
- find_packet_data(&cfile, string, strlen(string));
+ cf_find_packet_data(&cfile, string, strlen(string));
}
g_free(string);
} else {
@@ -763,7 +763,7 @@ find_previous_next(GtkWidget *w, gpointer d, gboolean sens)
*/
return;
}
- find_packet_dfilter(&cfile, sfcode);
+ cf_find_packet_dfilter(&cfile, sfcode);
dfilter_free(sfcode);
}
} else
@@ -807,7 +807,7 @@ find_previous_next_frame_with_filter(char *filter, gboolean backwards)
*/
return;
}
- find_packet_dfilter(&cfile, sfcode);
+ cf_find_packet_dfilter(&cfile, sfcode);
dfilter_free(sfcode);
cfile.sbackward=sbackwards_saved;
}
diff --git a/gtk/goto_dlg.c b/gtk/goto_dlg.c
index 8b60491606..259d8dd15e 100644
--- a/gtk/goto_dlg.c
+++ b/gtk/goto_dlg.c
@@ -134,7 +134,7 @@ goto_frame_ok_cb(GtkWidget *ok_bt _U_, gpointer parent_w)
return;
}
- if (goto_frame(&cfile, fnumber)) {
+ if (cf_goto_frame(&cfile, fnumber)) {
/* We succeeded in going to that frame; we're done. */
window_destroy(GTK_WIDGET(parent_w));
}
@@ -146,19 +146,19 @@ goto_frame_ok_cb(GtkWidget *ok_bt _U_, gpointer parent_w)
void
goto_framenum_cb(GtkWidget *w _U_, gpointer data _U_)
{
- goto_framenum(&cfile);
+ cf_goto_framenum(&cfile);
}
void
goto_top_frame_cb(GtkWidget *w _U_, gpointer d _U_)
{
- goto_top_frame(&cfile);
+ cf_goto_top_frame(&cfile);
}
void
goto_bottom_frame_cb(GtkWidget *w _U_, gpointer d _U_)
{
- goto_bottom_frame(&cfile);
+ cf_goto_bottom_frame(&cfile);
}
diff --git a/gtk/graph_analysis.c b/gtk/graph_analysis.c
index ed88a32c50..76342fef93 100644
--- a/gtk/graph_analysis.c
+++ b/gtk/graph_analysis.c
@@ -668,7 +668,7 @@ static gint button_press_event(GtkWidget *widget, GdkEventButton *event _U_)
user_data->dlg.needs_redraw=TRUE;
dialog_graph_draw(user_data);
- goto_frame(&cfile, user_data->dlg.items[item].frame_num);
+ cf_goto_frame(&cfile, user_data->dlg.items[item].frame_num);
return TRUE;
}
diff --git a/gtk/h225_counter.c b/gtk/h225_counter.c
index d746343eb7..df45102b1f 100644
--- a/gtk/h225_counter.c
+++ b/gtk/h225_counter.c
@@ -556,7 +556,7 @@ gtk_h225counter_init(char *optarg)
gtk_widget_show_all(hs->win);
window_present(hs->win);
- retap_packets(&cfile);
+ cf_retap_packets(&cfile);
}
void
diff --git a/gtk/h225_ras_srt.c b/gtk/h225_ras_srt.c
index 4aff0d1695..daedacccae 100644
--- a/gtk/h225_ras_srt.c
+++ b/gtk/h225_ras_srt.c
@@ -336,7 +336,7 @@ gtk_h225rassrt_init(char *optarg)
gtk_widget_show_all(hs->win);
window_present(hs->win);
- retap_packets(&cfile);
+ cf_retap_packets(&cfile);
}
void
diff --git a/gtk/h323_analysis.c b/gtk/h323_analysis.c
index 349d3cfafe..6f70b3cc35 100644
--- a/gtk/h323_analysis.c
+++ b/gtk/h323_analysis.c
@@ -333,7 +333,7 @@ static void on_goto_bt_clicked(GtkWidget *bt _U_, user_data_t *user_data _U_)
if (user_data->selected_clist1!=NULL) {
fnumber = GPOINTER_TO_UINT(gtk_clist_get_row_data(
GTK_CLIST(user_data->selected_clist1), user_data->selected_row) );
- goto_frame(&cfile, fnumber);
+ cf_goto_frame(&cfile, fnumber);
}
}
@@ -408,7 +408,7 @@ static void on_refresh_bt_clicked(GtkWidget *bt _U_, user_data_t *user_data _U_)
}
/* retap all packets */
- retap_packets(&cfile);
+ cf_retap_packets(&cfile);
/* remove tap listener again */
protect_thread_critical_region();
diff --git a/gtk/h323_conversations_dlg.c b/gtk/h323_conversations_dlg.c
index dfcc0ecdba..84c5b5b0bc 100644
--- a/gtk/h323_conversations_dlg.c
+++ b/gtk/h323_conversations_dlg.c
@@ -570,7 +570,7 @@ h323conversations_init_tap(char *dummy _U_)
h245conversations_init_tap();
/* Scan for H323 conversations conversationss (redissect all packets) */
- retap_packets(&cfile);
+ cf_retap_packets(&cfile);
/* Show the dialog box with the list of conversationss */
h323conversations_dlg_show(h323conversations_get_info()->strinfo_list);
diff --git a/gtk/hostlist_table.c b/gtk/hostlist_table.c
index b9f2a21ac1..1bba285cdc 100644
--- a/gtk/hostlist_table.c
+++ b/gtk/hostlist_table.c
@@ -768,7 +768,7 @@ init_hostlist_table(gboolean hide_ports, char *table_name, char *tap_name, char
gtk_widget_show_all(hosttable->win);
window_present(hosttable->win);
- retap_packets(&cfile);
+ cf_retap_packets(&cfile);
/* Keep clist frozen to cause modifications to the clist (inserts, appends, others that are extremely slow
in GTK2) to not be drawn, allow refreshes to occur at strategic points for performance */
@@ -956,7 +956,7 @@ init_hostlist_notebook_cb(GtkWidget *w _U_, gpointer d _U_)
gtk_widget_show_all(win);
window_present(win);
- retap_packets(&cfile);
+ cf_retap_packets(&cfile);
/* after retapping, redraw table */
for (page=1; page<=GPOINTER_TO_INT(pages[0]); page++) {
diff --git a/gtk/http_stat.c b/gtk/http_stat.c
index 1aceaf69d8..d034c98ab3 100644
--- a/gtk/http_stat.c
+++ b/gtk/http_stat.c
@@ -502,7 +502,7 @@ gtk_httpstat_init(char *optarg)
window_present(sp->win);
http_init_hash(sp);
- retap_packets(&cfile);
+ cf_retap_packets(&cfile);
}
static tap_dfilter_dlg http_stat_dlg = {
diff --git a/gtk/io_stat.c b/gtk/io_stat.c
index c05c22a450..8bb636789a 100644
--- a/gtk/io_stat.c
+++ b/gtk/io_stat.c
@@ -1110,7 +1110,7 @@ gtk_iostat_init(char *optarg _U_)
/* build the GUI */
init_io_stat_window(io);
- retap_packets(&cfile);
+ cf_retap_packets(&cfile);
io_stat_redraw(io);
}
@@ -1270,7 +1270,7 @@ tick_interval_select(GtkWidget *item, gpointer key)
val=(int)OBJECT_GET_DATA(item, "tick_interval");
io->interval=val;
- retap_packets(&cfile);
+ cf_retap_packets(&cfile);
io_stat_redraw(io);
}
@@ -1634,7 +1634,7 @@ filter_callback(GtkWidget *widget _U_, io_stat_graph_t *gio)
io_stat_reset(gio->io);
enable_graph(gio, filter, field);
- retap_packets(&cfile);
+ cf_retap_packets(&cfile);
io_stat_redraw(gio->io);
return 0;
diff --git a/gtk/ldap_stat.c b/gtk/ldap_stat.c
index 595a26140e..2b6e638a43 100644
--- a/gtk/ldap_stat.c
+++ b/gtk/ldap_stat.c
@@ -231,7 +231,7 @@ gtk_ldapstat_init(char *optarg)
gtk_widget_show_all(ldap->win);
window_present(ldap->win);
- retap_packets(&cfile);
+ cf_retap_packets(&cfile);
}
diff --git a/gtk/main.c b/gtk/main.c
index 26fe478a3d..215edd560b 100644
--- a/gtk/main.c
+++ b/gtk/main.c
@@ -501,7 +501,7 @@ dfilter_combo_add_recent(gchar *s) {
}
-/* call filter_packets() and add this filter string to the recent filter list */
+/* call cf_filter_packets() and add this filter string to the recent filter list */
gboolean
main_filter_packets(capture_file *cf, const gchar *dftext, gboolean force)
{
@@ -511,14 +511,14 @@ main_filter_packets(capture_file *cf, const gchar *dftext, gboolean force)
gboolean add_filter = TRUE;
gboolean free_filter = TRUE;
char *s;
- gboolean filter_packets_ret;
-
+ cf_status_t cf_status;
s = g_strdup(dftext);
/* GtkCombos don't let us get at their list contents easily, so we maintain
our own filter list, and feed it to gtk_combo_set_popdown_strings when
a new filter is added. */
- if ((filter_packets_ret = filter_packets(cf, s, force))) {
+ cf_status = cf_filter_packets(cf, s, force);
+ if (cf_status == CF_OK) {
li = g_list_first(filter_list);
while (li) {
if (li->data && strcmp(s, li->data) == 0)
@@ -542,7 +542,11 @@ main_filter_packets(capture_file *cf, const gchar *dftext, gboolean force)
if (free_filter)
g_free(s);
- return filter_packets_ret;
+ if (cf_status == CF_OK) {
+ return TRUE;
+ } else {
+ return FALSE;
+ }
}
@@ -580,7 +584,7 @@ set_frame_reftime(gboolean set, frame_data *frame, gint row) {
} else {
frame->flags.ref_time=0;
}
- reftime_packets(&cfile);
+ cf_reftime_packets(&cfile);
}
void
@@ -643,7 +647,7 @@ tree_view_selection_changed_cb(GtkTreeSelection *sel, gpointer user_data _U_)
if (byte_data == NULL)
return; /* none */
- unselect_field(&cfile);
+ cf_unselect_field(&cfile);
packet_hex_print(GTK_TEXT_VIEW(byte_view), byte_data,
cfile.current_frame, NULL, byte_len);
return;
@@ -740,7 +744,7 @@ tree_view_unselect_row_cb(GtkCTree *ctree _U_, GList *node _U_, gint column _U_,
if (data == NULL)
return; /* none */
- unselect_field(&cfile);
+ cf_unselect_field(&cfile);
packet_hex_print(GTK_TEXT(byte_view), data, cfile.current_frame,
NULL, len);
}
@@ -1432,7 +1436,7 @@ dnd_merge_files(int in_file_count, char **in_filenames)
cf_close(&cfile);
/* Try to open the merged capture file. */
- if ((err = cf_open(tmpname, TRUE /* temporary file */, &cfile)) != 0) {
+ if (cf_open(&cfile, tmpname, TRUE /* temporary file */, &err) != CF_OK) {
/* We couldn't open it; don't dismiss the open dialog box,
just leave it around so that the user can, after they
dismiss the alert box popped up for the open error,
@@ -1442,14 +1446,14 @@ dnd_merge_files(int in_file_count, char **in_filenames)
switch (cf_read(&cfile)) {
- case READ_SUCCESS:
- case READ_ERROR:
+ case CF_OK:
+ case CF_ERROR:
/* Just because we got an error, that doesn't mean we were unable
to read any of the file; we handle what we could get from the
file. */
break;
- case READ_ABORTED:
+ case CF_ABORTED:
/* The user bailed out of re-reading the capture file; the
capture file has been closed - just free the capture file name
string and return (without changing the last containing
@@ -1517,7 +1521,7 @@ dnd_open_file_cmd(GtkSelectionData *selection_data)
break;
case(1):
/* open and read the capture file (this will close an existing file) */
- if ((err = cf_open(in_filenames[0], FALSE, &cfile)) == 0) {
+ if (cf_open(&cfile, in_filenames[0], FALSE, &err) == CF_OK) {
cf_read(&cfile);
add_menu_recent_capture_file(in_filenames[0]);
} else {
@@ -2563,7 +2567,7 @@ main(int argc, char *argv[])
}
}
if (!rfilter_parse_failed) {
- if ((err = cf_open(cf_name, FALSE, &cfile)) == 0) {
+ if (cf_open(&cfile, cf_name, FALSE, &err) == CF_OK) {
/* "cf_open()" succeeded, so it closed the previous
capture file, and thus destroyed any previous read filter
attached to "cf". */
@@ -2580,14 +2584,14 @@ main(int argc, char *argv[])
/* Read the capture file. */
switch (cf_read(&cfile)) {
- case READ_SUCCESS:
- case READ_ERROR:
+ case CF_OK:
+ case CF_ERROR:
/* Just because we got an error, that doesn't mean we were unable
to read any of the file; we handle what we could get from the
file. */
break;
- case READ_ABORTED:
+ case CF_ABORTED:
/* Exit now. */
gtk_exit(0);
break;
diff --git a/gtk/main.h b/gtk/main.h
index 4d58bb7534..cad3fe317f 100644
--- a/gtk/main.h
+++ b/gtk/main.h
@@ -252,7 +252,7 @@ extern void main_widgets_rearrange(void);
extern void main_widgets_show_or_hide(void);
/** Apply a new filter string.
- * Call filter_packets() and add this filter string to the recent filter list.
+ * Call cf_filter_packets() and add this filter string to the recent filter list.
*
* @param cf the capture file
* @param dftext the new filter string
diff --git a/gtk/menu.c b/gtk/menu.c
index 45f201787c..8bab6c73bb 100644
--- a/gtk/menu.c
+++ b/gtk/menu.c
@@ -990,7 +990,7 @@ menu_open_recent_file_cmd(GtkWidget *w)
gtk_label_get(GTK_LABEL(menu_item_child), &cf_name);
/* open and read the capture file (this will close an existing file) */
- if ((err = cf_open(cf_name, FALSE, &cfile)) == 0) {
+ if (cf_open(&cfile, cf_name, FALSE, &err) == CF_OK) {
cf_read(&cfile);
} else {
/* the capture file isn't existing any longer, remove menu item */
@@ -1245,7 +1245,7 @@ timestamp_absolute_cb(GtkWidget *w _U_, gpointer d _U_)
if (recent.gui_time_format != TS_ABSOLUTE) {
set_timestamp_setting(TS_ABSOLUTE);
recent.gui_time_format = TS_ABSOLUTE;
- change_time_formats(&cfile);
+ cf_change_time_formats(&cfile);
}
}
@@ -1255,7 +1255,7 @@ timestamp_absolute_date_cb(GtkWidget *w _U_, gpointer d _U_)
if (recent.gui_time_format != TS_ABSOLUTE_WITH_DATE) {
set_timestamp_setting(TS_ABSOLUTE_WITH_DATE);
recent.gui_time_format = TS_ABSOLUTE_WITH_DATE;
- change_time_formats(&cfile);
+ cf_change_time_formats(&cfile);
}
}
@@ -1265,7 +1265,7 @@ timestamp_relative_cb(GtkWidget *w _U_, gpointer d _U_)
if (recent.gui_time_format != TS_RELATIVE) {
set_timestamp_setting(TS_RELATIVE);
recent.gui_time_format = TS_RELATIVE;
- change_time_formats(&cfile);
+ cf_change_time_formats(&cfile);
}
}
@@ -1275,7 +1275,7 @@ timestamp_delta_cb(GtkWidget *w _U_, gpointer d _U_)
if (recent.gui_time_format != TS_DELTA) {
set_timestamp_setting(TS_DELTA);
recent.gui_time_format = TS_DELTA;
- change_time_formats(&cfile);
+ cf_change_time_formats(&cfile);
}
}
diff --git a/gtk/mgcp_stat.c b/gtk/mgcp_stat.c
index 188b335db2..5e1b9215ae 100644
--- a/gtk/mgcp_stat.c
+++ b/gtk/mgcp_stat.c
@@ -311,7 +311,7 @@ gtk_mgcpstat_init(char *optarg)
gtk_widget_show_all(ms->win);
window_present(ms->win);
- retap_packets(&cfile);
+ cf_retap_packets(&cfile);
}
static tap_dfilter_dlg mgcp_srt_dlg = {
diff --git a/gtk/packet_history.c b/gtk/packet_history.c
index 421a63a79c..b52a9f9ac6 100644
--- a/gtk/packet_history.c
+++ b/gtk/packet_history.c
@@ -142,7 +142,7 @@ void packet_history_back(void) {
/* goto that packet but don't change history */
ignore_jump = TRUE;
- goto_frame(&cfile, GPOINTER_TO_INT(previous->data) +1);
+ cf_goto_frame(&cfile, GPOINTER_TO_INT(previous->data) +1);
ignore_jump = FALSE;
}
}
@@ -163,7 +163,7 @@ void packet_history_forward(void) {
/* goto that packet but don't change history */
ignore_jump = TRUE;
- goto_frame(&cfile, GPOINTER_TO_INT(next->data) +1);
+ cf_goto_frame(&cfile, GPOINTER_TO_INT(next->data) +1);
ignore_jump = FALSE;
}
}
diff --git a/gtk/packet_list.c b/gtk/packet_list.c
index 7065fb41a6..56f1c9f9cf 100644
--- a/gtk/packet_list.c
+++ b/gtk/packet_list.c
@@ -268,7 +268,7 @@ packet_list_select_cb(GtkWidget *w _U_, gint row, gint col _U_, gpointer evt _U_
while( (gtk_notebook_get_nth_page( GTK_NOTEBOOK(byte_nb_ptr), 0)))
gtk_notebook_remove_page( GTK_NOTEBOOK(byte_nb_ptr), 0);
- select_packet(&cfile, row);
+ cf_select_packet(&cfile, row);
gtk_widget_grab_focus(packet_list);
packet_history_add(row);
}
@@ -276,7 +276,7 @@ packet_list_select_cb(GtkWidget *w _U_, gint row, gint col _U_, gpointer evt _U_
static void
packet_list_unselect_cb(GtkWidget *w _U_, gint row _U_, gint col _U_, gpointer evt _U_) {
- unselect_packet(&cfile);
+ cf_unselect_packet(&cfile);
}
/* mark packets */
@@ -287,7 +287,7 @@ set_frame_mark(gboolean set, frame_data *frame, gint row) {
if (row == -1)
return;
if (set) {
- mark_frame(&cfile, frame);
+ cf_mark_frame(&cfile, frame);
color_t_to_gdkcolor(&fg, &prefs.gui_marked_fg);
color_t_to_gdkcolor(&bg, &prefs.gui_marked_bg);
eth_clist_set_foreground(ETH_CLIST(packet_list), row, &fg);
@@ -295,7 +295,7 @@ set_frame_mark(gboolean set, frame_data *frame, gint row) {
} else {
color_filter_t *cfilter = frame->color_filter;
- unmark_frame(&cfile, frame);
+ cf_unmark_frame(&cfile, frame);
/* Restore the color from the matching color filter if any */
if (cfilter) { /* The packet matches a color filter */
color_t_to_gdkcolor(&fg, &cfilter->fg_color);
@@ -446,7 +446,7 @@ set_plist_sel_browse(gboolean val)
}
if (cfile.finfo_selected)
- unselect_packet(&cfile);
+ cf_unselect_packet(&cfile);
mode = new_mode;
eth_clist_set_selection_mode(ETH_CLIST(packet_list), mode);
diff --git a/gtk/prefs_dlg.c b/gtk/prefs_dlg.c
index 39b82b801b..6c42bfba18 100644
--- a/gtk/prefs_dlg.c
+++ b/gtk/prefs_dlg.c
@@ -1216,7 +1216,7 @@ prefs_main_ok_cb(GtkWidget *ok_bt _U_, gpointer parent_w)
if (must_redissect) {
/* Redissect all the packets, and re-evaluate the display filter. */
- redissect_packets(&cfile);
+ cf_redissect_packets(&cfile);
}
}
@@ -1232,7 +1232,7 @@ prefs_main_apply_cb(GtkWidget *apply_bt _U_, gpointer parent_w)
if (must_redissect) {
/* Redissect all the packets, and re-evaluate the display filter. */
- redissect_packets(&cfile);
+ cf_redissect_packets(&cfile);
}
}
@@ -1283,7 +1283,7 @@ prefs_main_save_cb(GtkWidget *save_bt _U_, gpointer parent_w)
if (must_redissect) {
/* Redissect all the packets, and re-evaluate the display filter. */
- redissect_packets(&cfile);
+ cf_redissect_packets(&cfile);
}
}
@@ -1379,7 +1379,7 @@ prefs_main_cancel_cb(GtkWidget *cancel_bt _U_, gpointer parent_w)
if (must_redissect) {
/* Redissect all the packets, and re-evaluate the display filter. */
- redissect_packets(&cfile);
+ cf_redissect_packets(&cfile);
}
}
diff --git a/gtk/print_dlg.c b/gtk/print_dlg.c
index 114917a3f9..5163db6fbc 100644
--- a/gtk/print_dlg.c
+++ b/gtk/print_dlg.c
@@ -769,7 +769,7 @@ print_ok_cb(GtkWidget *ok_bt, gpointer parent_w)
#ifdef _WIN32
gboolean win_printer = FALSE;
#endif
- pp_return_t status;
+ cf_status_t status;
args = (print_args_t *)OBJECT_GET_DATA(ok_bt, PRINT_ARGS_KEY);
@@ -857,9 +857,9 @@ print_ok_cb(GtkWidget *ok_bt, gpointer parent_w)
/* Now print/export the packets */
if (export_as_pdml)
- status = write_pdml_packets(&cfile, args);
+ status = cf_write_pdml_packets(&cfile, args);
else if (export_as_psml)
- status = write_psml_packets(&cfile, args);
+ status = cf_write_psml_packets(&cfile, args);
else {
switch (args->format) {
@@ -899,14 +899,14 @@ print_ok_cb(GtkWidget *ok_bt, gpointer parent_w)
g_assert_not_reached();
return;
}
- status = print_packets(&cfile, args);
+ status = cf_print_packets(&cfile, args);
}
switch (status) {
- case PP_OK:
+ case CF_OK:
break;
- case PP_OPEN_ERROR:
+ case CF_PRINT_OPEN_ERROR:
if (args->to_file)
open_failure_alert_box(args->file, errno, TRUE);
else
@@ -914,7 +914,7 @@ print_ok_cb(GtkWidget *ok_bt, gpointer parent_w)
args->cmd);
break;
- case PP_WRITE_ERROR:
+ case CF_PRINT_WRITE_ERROR:
if (args->to_file)
write_failure_alert_box(args->file, errno);
else
diff --git a/gtk/proto_dlg.c b/gtk/proto_dlg.c
index a173131917..446eeeaf83 100644
--- a/gtk/proto_dlg.c
+++ b/gtk/proto_dlg.c
@@ -416,14 +416,14 @@ proto_ok_cb(GtkWidget *ok_bt _U_, gpointer parent_w)
redissect = set_proto_selection(GTK_WIDGET(parent_w));
window_destroy(GTK_WIDGET(parent_w));
if (redissect)
- redissect_packets(&cfile);
+ cf_redissect_packets(&cfile);
}
static void
proto_apply_cb(GtkWidget *apply_bt _U_, gpointer parent_w)
{
if (set_proto_selection(GTK_WIDGET(parent_w)))
- redissect_packets(&cfile);
+ cf_redissect_packets(&cfile);
}
static void
@@ -458,7 +458,7 @@ proto_save_cb(GtkWidget *save_bt _U_, gpointer parent_w)
if (must_redissect) {
/* Redissect all the packets, and re-evaluate the display filter. */
- redissect_packets(&cfile);
+ cf_redissect_packets(&cfile);
}
}
@@ -470,7 +470,7 @@ proto_cancel_cb(GtkWidget *cancel_bt _U_, gpointer parent_w)
redissect = revert_proto_selection();
window_destroy(GTK_WIDGET(parent_w));
if (redissect)
- redissect_packets(&cfile);
+ cf_redissect_packets(&cfile);
}
static gboolean
diff --git a/gtk/proto_draw.c b/gtk/proto_draw.c
index b2ddfb9a6c..7c14c98f08 100644
--- a/gtk/proto_draw.c
+++ b/gtk/proto_draw.c
@@ -235,7 +235,7 @@ redraw_hex_dump_all(void)
The only workaround is to freshly select the frame, which will remove any
existing notebook tabs and "restart" the whole byte view again. */
if (cfile.current_frame != NULL)
- goto_frame(&cfile, cfile.current_frame->num);
+ cf_goto_frame(&cfile, cfile.current_frame->num);
#endif
}
@@ -1768,7 +1768,7 @@ void
tree_view_follow_link(field_info *fi)
{
if(fi->hfinfo->type == FT_FRAMENUM) {
- goto_frame(&cfile, fi->value.value.integer);
+ cf_goto_frame(&cfile, fi->value.value.integer);
}
}
diff --git a/gtk/rpc_progs.c b/gtk/rpc_progs.c
index 2567b8b898..f585c49070 100644
--- a/gtk/rpc_progs.c
+++ b/gtk/rpc_progs.c
@@ -406,7 +406,7 @@ gtk_rpcprogs_init(char *optarg _U_)
gtk_widget_show_all(win);
window_present(win);
- redissect_packets(&cfile);
+ cf_redissect_packets(&cfile);
}
static void
diff --git a/gtk/rpc_stat.c b/gtk/rpc_stat.c
index 2c192976b8..5da4615889 100644
--- a/gtk/rpc_stat.c
+++ b/gtk/rpc_stat.c
@@ -307,7 +307,7 @@ gtk_rpcstat_init(char *optarg)
gtk_widget_show_all(rs->win);
window_present(rs->win);
- retap_packets(&cfile);
+ cf_retap_packets(&cfile);
}
diff --git a/gtk/rtp_analysis.c b/gtk/rtp_analysis.c
index d63070d4cf..d8c9231f90 100644
--- a/gtk/rtp_analysis.c
+++ b/gtk/rtp_analysis.c
@@ -1832,7 +1832,7 @@ static gint filter_callback(GtkWidget *widget _U_, dialog_graph_graph_t *dgg)
}
enable_graph(dgg);
- retap_packets(&cfile);
+ cf_retap_packets(&cfile);
dialog_graph_redraw(dgg->ud);
return 0;
@@ -1951,7 +1951,7 @@ static void tick_interval_select(GtkWidget *item, gpointer key)
val=(int)OBJECT_GET_DATA(item, "tick_interval");
user_data->dlg.dialog_graph.interval=val;
- retap_packets(&cfile);
+ cf_retap_packets(&cfile);
dialog_graph_redraw(user_data);
}
@@ -2156,7 +2156,7 @@ static void on_goto_bt_clicked(GtkWidget *bt _U_, user_data_t *user_data _U_)
if (user_data->dlg.selected_clist!=NULL) {
fnumber = GPOINTER_TO_UINT(gtk_clist_get_row_data(
GTK_CLIST(user_data->dlg.selected_clist), user_data->dlg.selected_row) );
- goto_frame(&cfile, fnumber);
+ cf_goto_frame(&cfile, fnumber);
}
}
@@ -2244,7 +2244,7 @@ static void on_refresh_bt_clicked(GtkWidget *bt _U_, user_data_t *user_data _U_)
}
/* retap all packets */
- retap_packets(&cfile);
+ cf_retap_packets(&cfile);
/* draw statistics info */
draw_stat(user_data);
diff --git a/gtk/rtp_stream.c b/gtk/rtp_stream.c
index 7d58c16d97..7861870d9d 100644
--- a/gtk/rtp_stream.c
+++ b/gtk/rtp_stream.c
@@ -286,7 +286,7 @@ static int rtpstream_packet(void *arg, packet_info *pinfo, epan_dissect_t *edt _
if (rtp_stream_info_cmp(&tmp_strinfo, tapinfo->filter_stream_fwd)==0
|| rtp_stream_info_cmp(&tmp_strinfo, tapinfo->filter_stream_rev)==0)
{
- mark_frame(&cfile, pinfo->fd);
+ cf_mark_frame(&cfile, pinfo->fd);
}
}
@@ -302,7 +302,7 @@ void rtpstream_scan(void)
register_tap_listener_rtp_stream();
the_tapinfo_struct.mode = TAP_ANALYSE;
- retap_packets(&cfile);
+ cf_retap_packets(&cfile);
if (!was_registered)
remove_tap_listener_rtp_stream();
@@ -333,7 +333,7 @@ gboolean rtpstream_save(rtp_stream_info_t* stream, const gchar *filename)
the_tapinfo_struct.mode = TAP_SAVE;
the_tapinfo_struct.filter_stream_fwd = stream;
- retap_packets(&cfile);
+ cf_retap_packets(&cfile);
the_tapinfo_struct.mode = TAP_ANALYSE;
if (!was_registered)
@@ -364,7 +364,7 @@ void rtpstream_mark(rtp_stream_info_t* stream_fwd, rtp_stream_info_t* stream_rev
the_tapinfo_struct.mode = TAP_MARK;
the_tapinfo_struct.filter_stream_fwd = stream_fwd;
the_tapinfo_struct.filter_stream_rev = stream_rev;
- retap_packets(&cfile);
+ cf_retap_packets(&cfile);
the_tapinfo_struct.mode = TAP_ANALYSE;
if (!was_registered)
diff --git a/gtk/rtp_stream_dlg.c b/gtk/rtp_stream_dlg.c
index 0476e7f21d..f585a68c21 100644
--- a/gtk/rtp_stream_dlg.c
+++ b/gtk/rtp_stream_dlg.c
@@ -261,7 +261,7 @@ rtpstream_on_goto (GtkButton *button _U_,
{
if (selected_stream_fwd)
{
- goto_frame(&cfile, selected_stream_fwd->first_frame_num);
+ cf_goto_frame(&cfile, selected_stream_fwd->first_frame_num);
}
}
*/
diff --git a/gtk/sctp_error_dlg.c b/gtk/sctp_error_dlg.c
index 53f6fc8a07..95be56d2c4 100644
--- a/gtk/sctp_error_dlg.c
+++ b/gtk/sctp_error_dlg.c
@@ -136,7 +136,7 @@ sctp_error_on_frame (GtkButton *button _U_, gpointer user_data _U_)
return;
if (selected_packet)
- goto_frame(&cfile, selected_packet->frame_number);
+ cf_goto_frame(&cfile, selected_packet->frame_number);
}
diff --git a/gtk/sctp_stat_dlg.c b/gtk/sctp_stat_dlg.c
index 7cedb5ca6c..3cbdaac2d9 100644
--- a/gtk/sctp_stat_dlg.c
+++ b/gtk/sctp_stat_dlg.c
@@ -535,7 +535,7 @@ int i;
SIGNAL_CONNECT(bt_close, "clicked", sctp_stat_on_close, NULL);
sctp_stat_dlg = sctp_stat_dlg_w;
- retap_packets(&cfile);
+ cf_retap_packets(&cfile);
}
diff --git a/gtk/sip_stat.c b/gtk/sip_stat.c
index ca43e640ef..9560bf321b 100644
--- a/gtk/sip_stat.c
+++ b/gtk/sip_stat.c
@@ -648,7 +648,7 @@ gtk_sipstat_init(char *optarg)
window_present(sp->win);
sip_init_hash(sp);
- retap_packets(&cfile);
+ cf_retap_packets(&cfile);
}
static tap_dfilter_dlg sip_stat_dlg = {
diff --git a/gtk/smb_stat.c b/gtk/smb_stat.c
index 4c36dea76b..240cbfb0d7 100644
--- a/gtk/smb_stat.c
+++ b/gtk/smb_stat.c
@@ -234,7 +234,7 @@ gtk_smbstat_init(char *optarg)
gtk_widget_show_all(ss->win);
window_present(ss->win);
- retap_packets(&cfile);
+ cf_retap_packets(&cfile);
}
diff --git a/gtk/tcp_graph.c b/gtk/tcp_graph.c
index 37d2b7c0b8..a244f1d2d4 100644
--- a/gtk/tcp_graph.c
+++ b/gtk/tcp_graph.c
@@ -2613,11 +2613,11 @@ static void graph_select_segment (struct graph *g, int x, int y)
break;
case ELMT_LINE:
if (line_detect_collision (e, x, y))
- goto_frame(&cfile, e->parent->num);
+ cf_goto_frame(&cfile, e->parent->num);
break;
case ELMT_ARC:
if (arc_detect_collision (e, x, y))
- goto_frame(&cfile, e->parent->num);
+ cf_goto_frame(&cfile, e->parent->num);
break;
default:
break;
diff --git a/gtk/voip_calls_dlg.c b/gtk/voip_calls_dlg.c
index dc388d359f..e5a1cae037 100644
--- a/gtk/voip_calls_dlg.c
+++ b/gtk/voip_calls_dlg.c
@@ -688,7 +688,7 @@ voip_calls_init_tap(char *dummy _U_)
}
/* Scan for VoIP calls calls (redissect all packets) */
- retap_packets(&cfile);
+ cf_retap_packets(&cfile);
/* Tap listener will be removed and cleaned up in voip_calls_on_destroy */
}
diff --git a/gtk/wsp_stat.c b/gtk/wsp_stat.c
index 9319a12bde..6a9e143f19 100644
--- a/gtk/wsp_stat.c
+++ b/gtk/wsp_stat.c
@@ -412,7 +412,7 @@ gtk_wspstat_init(char *optarg)
gtk_widget_show_all(sp->win);
window_present(sp->win);
- retap_packets(&cfile);
+ cf_retap_packets(&cfile);
}
static tap_dfilter_dlg wsp_stat_dlg = {