diff options
Diffstat (limited to 'gtk')
-rw-r--r-- | gtk/capture_file_dlg.c | 6 | ||||
-rw-r--r-- | gtk/export_object.c | 10 | ||||
-rw-r--r-- | gtk/firewall_dlg.c | 4 | ||||
-rw-r--r-- | gtk/follow_ssl.c | 33 | ||||
-rw-r--r-- | gtk/follow_stream.c | 12 | ||||
-rw-r--r-- | gtk/follow_tcp.c | 20 | ||||
-rw-r--r-- | gtk/graph_analysis.c | 18 | ||||
-rw-r--r-- | gtk/gui_utils.c | 2 | ||||
-rw-r--r-- | gtk/help_dlg.c | 1 | ||||
-rw-r--r-- | gtk/main.c | 18 | ||||
-rw-r--r-- | gtk/main_proto_draw.c | 32 | ||||
-rw-r--r-- | gtk/main_welcome.c | 8 | ||||
-rw-r--r-- | gtk/mcast_stream.c | 11 | ||||
-rw-r--r-- | gtk/print_dlg.c | 8 | ||||
-rw-r--r-- | gtk/print_win32.c | 22 | ||||
-rw-r--r-- | gtk/profile_dlg.c | 46 | ||||
-rw-r--r-- | gtk/recent.c | 14 | ||||
-rw-r--r-- | gtk/rtp_analysis.c | 108 | ||||
-rw-r--r-- | gtk/rtp_stream.c | 4 | ||||
-rw-r--r-- | gtk/text_page_utils.c | 6 | ||||
-rw-r--r-- | gtk/u3.c | 38 |
21 files changed, 209 insertions, 212 deletions
diff --git a/gtk/capture_file_dlg.c b/gtk/capture_file_dlg.c index fa09b9f70e..a5586f171c 100644 --- a/gtk/capture_file_dlg.c +++ b/gtk/capture_file_dlg.c @@ -47,7 +47,7 @@ #include "../color_filters.h" #include "../merge.h" #include "../util.h" -#include <wiretap/file_util.h> +#include <wsutil/file_util.h> #include "gtk/gtkglobals.h" #include "gtk/keys.h" @@ -1350,7 +1350,7 @@ static void file_save_as_exists_answered_cb(gpointer dialog _U_, gint btn, gpoin switch(btn) { case(ESD_BTN_OK): /* save file */ - eth_unlink(cf_name); + ws_unlink(cf_name); file_save_as_cb(NULL, data); break; case(ESD_BTN_CANCEL): @@ -1435,7 +1435,7 @@ file_save_as_ok_cb(GtkWidget *w _U_, gpointer fs) { /* the file exists, ask the user to remove it first */ dialog = simple_dialog(ESD_TYPE_CONFIRMATION, ESD_BTNS_OK_CANCEL, "%sA file named \"%s\" already exists.%s\n\n" - "Do you want to replace it with the capture you are saving?", + "Do you want to replace it with the capture you are saving?", simple_dialog_primary_start(), cf_name, simple_dialog_primary_end()); simple_dialog_set_cb(dialog, file_save_as_exists_answered_cb, fs); diff --git a/gtk/export_object.c b/gtk/export_object.c index 69a6a6c667..b73cb3bff7 100644 --- a/gtk/export_object.c +++ b/gtk/export_object.c @@ -44,7 +44,7 @@ #include <../alert_box.h> #include <../simple_dialog.h> -#include <wiretap/file_util.h> +#include <wsutil/file_util.h> #include <gtk/dlg_utils.h> #include <gtk/file_dlg.h> @@ -125,7 +125,7 @@ eo_save_entry(gchar *save_as_filename, export_object_entry_t *entry, gboolean sh { int to_fd; - to_fd = eth_open(save_as_filename, O_WRONLY | O_CREAT | O_EXCL | + to_fd = ws_open(save_as_filename, O_WRONLY | O_CREAT | O_EXCL | O_BINARY, 0644); if(to_fd == -1) { /* An error occurred */ if (show_err) @@ -134,15 +134,15 @@ eo_save_entry(gchar *save_as_filename, export_object_entry_t *entry, gboolean sh return FALSE; } - if(eth_write(to_fd, entry->payload_data, entry->payload_len) < 0) { + if(ws_write(to_fd, entry->payload_data, entry->payload_len) < 0) { if (show_err) write_failure_alert_box(save_as_filename, errno); - eth_close(to_fd); + ws_close(to_fd); g_free(save_as_filename); return FALSE; } - if (eth_close(to_fd) < 0) { + if (ws_close(to_fd) < 0) { if (show_err) write_failure_alert_box(save_as_filename, errno); g_free(save_as_filename); diff --git a/gtk/firewall_dlg.c b/gtk/firewall_dlg.c index 221b4e67cf..fa21e7f729 100644 --- a/gtk/firewall_dlg.c +++ b/gtk/firewall_dlg.c @@ -66,7 +66,7 @@ #include <../alert_box.h> #include <../simple_dialog.h> #include <../util.h> -#include <wiretap/file_util.h> +#include <wsutil/file_util.h> #include <gtk/main.h> #include <gtk/dlg_utils.h> @@ -747,7 +747,7 @@ firewall_save_as_ok_cb(GtkWidget * w _U_, gpointer fs) } rule_info = g_object_get_data(G_OBJECT(fs), WS_RULE_INFO_KEY); - fh = eth_fopen(to_name, "w"); + fh = ws_fopen(to_name, "w"); if (fh == NULL) { open_failure_alert_box(to_name, errno, TRUE); g_free(to_name); diff --git a/gtk/follow_ssl.c b/gtk/follow_ssl.c index e3256292e0..b682352805 100644 --- a/gtk/follow_ssl.c +++ b/gtk/follow_ssl.c @@ -52,7 +52,6 @@ #include <../alert_box.h> #include <../simple_dialog.h> #include <../util.h> -#include <wiretap/file_util.h> #include <gtk/color_utils.h> #include <gtk/main.h> @@ -87,7 +86,7 @@ ssl_queue_packet_data(void *tapdata, packet_info *pinfo, epan_dissect_t *edt _U_ int proto_ssl = (long) ssl; SslPacketInfo* pi = p_get_proto_data(pinfo->fd, proto_ssl); - /* skip packet without decrypted data payload*/ + /* skip packet without decrypted data payload*/ if (!pi || !pi->appl_data) return 0; @@ -95,10 +94,10 @@ ssl_queue_packet_data(void *tapdata, packet_info *pinfo, epan_dissect_t *edt _U_ total_len = 0; appl_data = pi->appl_data; do { - total_len += appl_data->plain_data.data_len; + total_len += appl_data->plain_data.data_len; appl_data = appl_data->next; } while (appl_data); - + /* compute packet direction */ rec = g_malloc(sizeof(SslDecryptedRecord) + total_len); @@ -109,20 +108,20 @@ ssl_queue_packet_data(void *tapdata, packet_info *pinfo, epan_dissect_t *edt _U_ if (ADDRESSES_EQUAL(&follow_info->client_ip, &pinfo->src) && follow_info->client_port == pinfo->srcport) rec->is_server = 0; - else + else rec->is_server = 1; /* update stream counter */ follow_info->bytes_written[rec->is_server] += total_len; - - /* extract decrypted data and queue it locally */ + + /* extract decrypted data and queue it locally */ rec->data.data = (guchar*)(rec + 1); rec->data.data_len = total_len; appl_data = pi->appl_data; p = rec->data.data; do { memcpy(p, appl_data->plain_data.data, appl_data->plain_data.data_len); - p += appl_data->plain_data.data_len; + p += appl_data->plain_data.data_len; appl_data = appl_data->next; } while (appl_data); follow_info->payload = g_list_append( @@ -131,7 +130,7 @@ ssl_queue_packet_data(void *tapdata, packet_info *pinfo, epan_dissect_t *edt _U_ return 0; } -extern gboolean +extern gboolean packet_is_ssl(epan_dissect_t* edt); @@ -238,22 +237,22 @@ follow_ssl_stream_cb(GtkWidget * w, gpointer data _U_) memcpy(&ipaddr, stats.ip_address[1], 4); hostname1 = get_hostname(ipaddr); } - + port0 = get_tcp_port(stats.port[0]); port1 = get_tcp_port(stats.port[1]); - + follow_info->is_ipv6 = stats.is_ipv6; /* Both Stream Directions */ both_directions_string = g_strdup_printf("Entire conversation (%u bytes)", follow_info->bytes_written[0] + follow_info->bytes_written[1]); - + if(follow_info->client_port == stats.port[0]) { server_to_client_string = g_strdup_printf("%s:%s --> %s:%s (%u bytes)", hostname0, port0, hostname1, port1, follow_info->bytes_written[0]); - + client_to_server_string = g_strdup_printf("%s:%s --> %s:%s (%u bytes)", hostname1, port1, @@ -265,14 +264,14 @@ follow_ssl_stream_cb(GtkWidget * w, gpointer data _U_) hostname1, port1, hostname0, port0, follow_info->bytes_written[0]); - + client_to_server_string = g_strdup_printf("%s:%s --> %s:%s (%u bytes)", hostname0, port0, hostname1, port1, follow_info->bytes_written[1]); } - + follow_stream("Follow SSL Stream", follow_info, both_directions_string, server_to_client_string, client_to_server_string); @@ -315,7 +314,7 @@ follow_read_ssl_stream(follow_info_t *follow_info, frs_return_t frs_return; iplen = (follow_info->is_ipv6) ? 16 : 4; - + for (cur = follow_info->payload; cur; cur = g_list_next(cur)) { SslDecryptedRecord* rec = cur->data; skip = FALSE; @@ -334,7 +333,7 @@ follow_read_ssl_stream(follow_info_t *follow_info, if (!skip) { size_t nchars = rec->data.data_len; gchar *buffer = g_memdup(rec->data.data, nchars); - + frs_return = follow_show(follow_info, print_line, buffer, nchars, rec->is_server, arg, global_pos, &server_packet_count, &client_packet_count); diff --git a/gtk/follow_stream.c b/gtk/follow_stream.c index 6e65784c71..14280907b6 100644 --- a/gtk/follow_stream.c +++ b/gtk/follow_stream.c @@ -45,7 +45,7 @@ #include <../isprint.h> #include <../print.h> #include <../simple_dialog.h> -#include <wiretap/file_util.h> +#include <wsutil/file_util.h> #include <gtk/color_utils.h> #include <gtk/stock_icons.h> @@ -476,7 +476,7 @@ follow_print_stream(GtkWidget * w _U_, gpointer data) print_mswin(print_dest); /* trash temp file */ - eth_remove(print_dest); + ws_remove(print_dest); } #endif return; @@ -495,7 +495,7 @@ follow_print_stream(GtkWidget * w _U_, gpointer data) #ifdef _WIN32 if (win_printer) { /* trash temp file */ - eth_remove(print_dest); + ws_remove(print_dest); } #endif } @@ -562,10 +562,10 @@ follow_save_as_ok_cb(GtkWidget * w _U_, gpointer fs) follow_info = g_object_get_data(G_OBJECT(fs), E_FOLLOW_INFO_KEY); if (follow_info->show_type == SHOW_RAW) { /* Write the data out as raw binary data */ - fh = eth_fopen(to_name, "wb"); + fh = ws_fopen(to_name, "wb"); } else { /* Write it out as text */ - fh = eth_fopen(to_name, "w"); + fh = ws_fopen(to_name, "w"); } if (fh == NULL) { open_failure_alert_box(to_name, errno, TRUE); @@ -895,7 +895,7 @@ follow_destroy_cb(GtkWidget *w, gpointer data _U_) switch(follow_info->follow_type) { case FOLLOW_TCP : - i = eth_unlink(follow_info->data_out_filename); + i = ws_unlink(follow_info->data_out_filename); if(i != 0) { g_warning("Follow: Couldn't remove temporary file: \"%s\", errno: %s (%u)", follow_info->data_out_filename, strerror(errno), errno); } diff --git a/gtk/follow_tcp.c b/gtk/follow_tcp.c index d516900f5d..8c18cf5922 100644 --- a/gtk/follow_tcp.c +++ b/gtk/follow_tcp.c @@ -55,7 +55,7 @@ #include "../alert_box.h" #include "../simple_dialog.h" #include "../tempfile.h" -#include "wiretap/file_util.h" +#include <wsutil/file_util.h> #include "gtk/color_utils.h" #include "gtk/follow_tcp.h" @@ -142,8 +142,8 @@ follow_tcp_stream_cb(GtkWidget * w, gpointer data _U_) simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK, "Could not create temporary file %s: %s", follow_info->data_out_filename, strerror(errno)); - eth_close(tmp_fd); - eth_unlink(follow_info->data_out_filename); + ws_close(tmp_fd); + ws_unlink(follow_info->data_out_filename); g_free(follow_info); return; } @@ -190,8 +190,8 @@ follow_tcp_stream_cb(GtkWidget * w, gpointer data _U_) if (empty_tcp_stream) { simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK, "The packets in the capture file for that stream have no data."); - eth_close(tmp_fd); - eth_unlink(follow_info->data_out_filename); + ws_close(tmp_fd); + ws_unlink(follow_info->data_out_filename); g_free(follow_info); return; } @@ -220,8 +220,8 @@ follow_tcp_stream_cb(GtkWidget * w, gpointer data _U_) (unsigned long)sizeof(sc), (unsigned long)nchars); } - eth_close(tmp_fd); - eth_unlink(follow_info->data_out_filename); + ws_close(tmp_fd); + ws_unlink(follow_info->data_out_filename); g_free(follow_info); return; } @@ -335,7 +335,7 @@ follow_read_tcp_stream(follow_info_t *follow_info, iplen = (follow_info->is_ipv6) ? 16 : 4; - data_out_file = eth_fopen(follow_info->data_out_filename, "rb"); + data_out_file = ws_fopen(follow_info->data_out_filename, "rb"); if (data_out_file == NULL) { simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK, "Could not open temporary file %s: %s", follow_info->data_out_filename, @@ -385,14 +385,14 @@ follow_read_tcp_stream(follow_info_t *follow_info, if (!skip) { frs_return = follow_show(follow_info, print_line, buffer, - nchars, is_server, arg, global_pos, + nchars, is_server, arg, global_pos, &server_packet_count, &client_packet_count); if(frs_return == FRS_PRINT_ERROR) { fclose(data_out_file); data_out_file = NULL; return frs_return; - + } } } diff --git a/gtk/graph_analysis.c b/gtk/graph_analysis.c index 7c0b445625..b99c6e0689 100644 --- a/gtk/graph_analysis.c +++ b/gtk/graph_analysis.c @@ -50,7 +50,7 @@ #include "../register.h" #include "../color.h" #include "../simple_dialog.h" -#include "wiretap/file_util.h" +#include <wsutil/file_util.h> #include "gtk/gtkglobals.h" #include "gtk/file_dlg.h" @@ -276,7 +276,7 @@ static gboolean dialog_graph_dump_to_file(graph_analysis_data_t* user_data) FILE *of; - of = eth_fopen(user_data->dlg.save_file,"w"); + of = ws_fopen(user_data->dlg.save_file,"w"); if (of==NULL){ return FALSE; } @@ -509,7 +509,7 @@ static void save_to_file_ok_cb(GtkWidget *ok_bt _U_, gpointer user_data _U_) /* check whether the file exists */ - file_test = eth_fopen(user_data_p->dlg.save_file,"r"); + file_test = ws_fopen(user_data_p->dlg.save_file,"r"); if (file_test!=NULL){ dialog = simple_dialog(ESD_TYPE_CONFIRMATION, ESD_BTNS_YES_NO, @@ -1216,7 +1216,7 @@ static gint configure_event(GtkWidget *widget, GdkEventConfigure *event _U_) user_data->dlg.bg_gc[i]=gdk_gc_new(user_data->dlg.pixmap); gdk_gc_set_rgb_fg_color(user_data->dlg.bg_gc[i], &col[i]); } - + dialog_graph_redraw(user_data); return TRUE; @@ -1505,13 +1505,13 @@ static void dialog_graph_create_window(graph_analysis_data_t* user_data) /****************************************************************************/ static gint add_or_get_node(graph_analysis_data_t* user_data, address* node) { guint i; - + if (node->type == AT_NONE) return NODE_OVERFLOW; - + for (i=0; i<MAX_NUM_NODES && i < user_data->num_nodes ; i++){ if ( CMP_ADDRESS(&(user_data->nodes[i]), node) == 0 ) return i; /* it is in the array */ } - + if (i == MAX_NUM_NODES) { return NODE_OVERFLOW; } else { @@ -1613,14 +1613,14 @@ void graph_analysis_redraw(graph_analysis_data_t* user_data) user_data->dlg.pixmap_width = user_data->num_nodes * NODE_WIDTH; gtk_widget_set_size_request(user_data->dlg.draw_area, user_data->dlg.pixmap_width, user_data->dlg.pixmap_height); - if ( user_data->num_nodes < 6) + if ( user_data->num_nodes < 6) gtk_widget_set_size_request(user_data->dlg.scroll_window, NODE_WIDTH*user_data->num_nodes, user_data->dlg.pixmap_height); else gtk_widget_set_size_request(user_data->dlg.scroll_window, NODE_WIDTH*5, user_data->dlg.pixmap_height); /* redraw the graph */ - dialog_graph_redraw(user_data); + dialog_graph_redraw(user_data); window_present(user_data->dlg.window); return; diff --git a/gtk/gui_utils.c b/gtk/gui_utils.c index 7bd5d78032..9ab636a486 100644 --- a/gtk/gui_utils.c +++ b/gtk/gui_utils.c @@ -37,7 +37,7 @@ #include "epan/epan.h" #include "../ui_util.h" -#include "wiretap/file_util.h" +#include <wsutil/file_util.h> #include "gtk/gtkglobals.h" #include "gtk/gui_utils.h" diff --git a/gtk/help_dlg.c b/gtk/help_dlg.c index dab97f48a0..5d53717df2 100644 --- a/gtk/help_dlg.c +++ b/gtk/help_dlg.c @@ -36,7 +36,6 @@ #include <epan/prefs.h> #include "../simple_dialog.h" -#include "wiretap/file_util.h" #include "gtk/help_dlg.h" #include "gtk/text_page_utils.h" diff --git a/gtk/main.c b/gtk/main.c index cadb1a330d..866ab2ddbf 100644 --- a/gtk/main.c +++ b/gtk/main.c @@ -100,7 +100,7 @@ #include "../alert_box.h" #include "../capture_ui_utils.h" #include "../log.h" -#include "../wiretap/file_util.h" +#include <wsutil/file_util.h> #ifdef HAVE_LIBPCAP @@ -1458,7 +1458,7 @@ main_cf_cb_file_safe_reload_finished(gpointer data _U_) set_menus_for_capture_file(&cfile); } -static void +static void main_cf_callback(gint event, gpointer data, gpointer user_data _U_) { switch(event) { @@ -2046,13 +2046,13 @@ main(int argc, char *argv[]) recent_read_static(&rf_path, &rf_open_errno); if (rf_path != NULL && rf_open_errno != 0) { simple_dialog(ESD_TYPE_WARN, ESD_BTN_OK, - "Could not open common recent file\n\"%s\": %s.", + "Could not open common recent file\n\"%s\": %s.", rf_path, strerror(rf_open_errno)); } recent_read_profile_static(&rf_path, &rf_open_errno); if (rf_path != NULL && rf_open_errno != 0) { simple_dialog(ESD_TYPE_WARN, ESD_BTN_OK, - "Could not open recent file\n\"%s\": %s.", + "Could not open recent file\n\"%s\": %s.", rf_path, strerror(rf_open_errno)); } @@ -2398,7 +2398,7 @@ main(int argc, char *argv[]) recent_read_dynamic(&rf_path, &rf_open_errno); if (rf_path != NULL && rf_open_errno != 0) { simple_dialog(ESD_TYPE_WARN, ESD_BTN_OK, - "Could not open recent file\n\"%s\": %s.", + "Could not open recent file\n\"%s\": %s.", rf_path, strerror(rf_open_errno)); } @@ -2663,9 +2663,9 @@ create_console(void) create one and make it the standard input, output, and error. */ if (!AllocConsole()) return; /* couldn't create console */ - eth_freopen("CONIN$", "r", stdin); - eth_freopen("CONOUT$", "w", stdout); - eth_freopen("CONOUT$", "w", stderr); + ws_freopen("CONIN$", "r", stdin); + ws_freopen("CONOUT$", "w", stdout); + ws_freopen("CONOUT$", "w", stderr); /* Well, we have a console now. */ has_console = TRUE; @@ -3241,7 +3241,7 @@ void change_configuration_profile (const gchar *profile_name) recent_read_profile_static(&rf_path, &rf_open_errno); if (rf_path != NULL && rf_open_errno != 0) { simple_dialog(ESD_TYPE_WARN, ESD_BTN_OK, - "Could not open common recent file\n\"%s\": %s.", + "Could not open common recent file\n\"%s\": %s.", rf_path, strerror(rf_open_errno)); } timestamp_set_type (recent.gui_time_format); diff --git a/gtk/main_proto_draw.c b/gtk/main_proto_draw.c index 445e3d9313..c45dceb71d 100644 --- a/gtk/main_proto_draw.c +++ b/gtk/main_proto_draw.c @@ -55,7 +55,7 @@ #include "../simple_dialog.h" #include "../progress_dlg.h" #include "../ui_util.h" -#include "wiretap/file_util.h" +#include <wsutil/file_util.h> #include "gtk/keys.h" #include "gtk/color_utils.h" @@ -695,7 +695,7 @@ static void copy_hex_all_info(GString* copy_buffer, const guint8* data_p, int da byte_line_part_length = (++i) % byte_line_length; if(i == data_len){ /* End of data - need to fill in spaces in hex string and then do "end of line". - * + * */ for(j = 0; append_text && (j < (byte_line_length - byte_line_part_length)); ++j) { g_string_append(hex_str," "); /* Three spaces for each missing byte */ @@ -704,7 +704,7 @@ static void copy_hex_all_info(GString* copy_buffer, const guint8* data_p, int da } else { end_of_line = (byte_line_part_length == 0 ? TRUE : FALSE); } - + if (end_of_line){ /* End of line */ @@ -725,7 +725,7 @@ static void copy_hex_all_info(GString* copy_buffer, const guint8* data_p, int da g_string_free(char_str, TRUE); } -static +static int copy_hex_bytes_text_only(GString* copy_buffer, const guint8* data_p, int data_len _U_) { @@ -742,7 +742,7 @@ int copy_hex_bytes_text_only(GString* copy_buffer, const guint8* data_p, int dat return 1; } -static +static int copy_hex_bytes_hex(GString* copy_buffer, const guint8* data_p, int data_len _U_) { g_string_append_printf(copy_buffer, "%02x", *data_p); @@ -777,7 +777,7 @@ copy_hex_cb(GtkWidget * w _U_, gpointer data _U_, copy_data_type data_type) if(flags & CD_FLAGS_SELECTEDONLY) { int start, end; - + /* Get the start and end of the highlighted bytes. * XXX The keys appear to be REVERSED start <-> end throughout this file! * Should this be fixed? There is one exception - packet_hex_reprint, @@ -826,12 +826,12 @@ copy_hex_cb(GtkWidget * w _U_, gpointer data _U_, copy_data_type data_type) } break; } - + if(copy_buffer->len > 0) { copy_to_clipboard(copy_buffer); } - g_string_free(copy_buffer, TRUE); + g_string_free(copy_buffer, TRUE); } /* save the current highlighted hex data */ @@ -872,17 +872,17 @@ savehex_save_clicked_cb(GtkWidget * w _U_, gpointer data _U_) return; } - fd = eth_open(file, O_WRONLY|O_CREAT|O_TRUNC|O_BINARY, 0666); + fd = ws_open(file, O_WRONLY|O_CREAT|O_TRUNC|O_BINARY, 0666); if (fd == -1) { open_failure_alert_box(file, errno, TRUE); return; } - if (eth_write(fd, data_p + start, end - start) < 0) { + if (ws_write(fd, data_p + start, end - start) < 0) { write_failure_alert_box(file, errno); - eth_close(fd); + ws_close(fd); return; } - if (eth_close(fd) < 0) { + if (ws_close(fd) < 0) { write_failure_alert_box(file, errno); return; } @@ -998,7 +998,7 @@ packet_hex_print_common(GtkWidget *bv, const guint8 *pd, int len, int bstart, gtk_text_buffer_set_text(buf, "", 0); gtk_text_buffer_get_start_iter(buf, &iter); - g_object_ref(buf); + g_object_ref(buf); gtk_text_view_set_buffer( bv_text_view, NULL); /* @@ -1172,7 +1172,7 @@ packet_hex_print_common(GtkWidget *bv, const guint8 *pd, int len, int bstart, if (reverse && (reverse != newreverse)) { gtk_text_buffer_insert_with_tags_by_name(buf, &iter, line, cur, revstyle, NULL); - + cur = 0; } if (i < k) { @@ -1214,12 +1214,12 @@ packet_hex_print_common(GtkWidget *bv, const guint8 *pd, int len, int bstart, "plain", NULL); } gtk_text_view_set_buffer( bv_text_view, buf); - + if (mark) { gtk_text_view_scroll_to_mark(bv_text_view, mark, 0.0, TRUE, 1.0, 0.0); gtk_text_buffer_delete_mark(buf, mark); } - g_object_unref(buf); + g_object_unref(buf); } void diff --git a/gtk/main_welcome.c b/gtk/main_welcome.c index a47ea2d598..89775a6e5f 100644 --- a/gtk/main_welcome.c +++ b/gtk/main_welcome.c @@ -40,7 +40,7 @@ #include "capture_opts.h" #include "capture_ui_utils.h" #include "simple_dialog.h" -#include "wiretap/file_util.h" +#include <wsutil/file_util.h> #include "gtk/gui_utils.h" #include "gtk/color_utils.h" @@ -113,7 +113,7 @@ scroll_box_dynamic_add(GtkWidget *parent_box) child_box = g_object_get_data(G_OBJECT(parent_box), SCROLL_BOX_CHILD_BOX); max_cnt = GPOINTER_TO_INT(g_object_get_data(G_OBJECT(parent_box), SCROLL_BOX_MAX_CHILDS)); - + /* get the current number of children */ childs = gtk_container_get_children(GTK_CONTAINER(child_box)); curr_cnt = g_list_length(childs); @@ -204,7 +204,7 @@ welcome_button(const gchar *stock_item, gtk_widget_modify_bg(eb, GTK_STATE_NORMAL, &topic_item_idle_bg); if(tooltip != NULL) { gtk_tooltips_set_tip(tooltips, eb, tooltip, ""); - } + } g_signal_connect(eb, "enter-notify-event", G_CALLBACK(welcome_item_enter_cb), NULL); g_signal_connect(eb, "leave-notify-event", G_CALLBACK(welcome_item_leave_cb), NULL); @@ -367,7 +367,7 @@ welcome_filename_link_new(const gchar *filename, GtkWidget **label) } /* add file size */ - err = eth_stat(filename, &stat_buf); + err = ws_stat(filename, &stat_buf); if(err == 0) { if (stat_buf.st_size/1024/1024 > 10) { g_string_append_printf(str, " %" G_GINT64_MODIFIER "dMB", (gint64) (stat_buf.st_size/1024/1024)); diff --git a/gtk/mcast_stream.c b/gtk/mcast_stream.c index 019e321104..e9e159ab23 100644 --- a/gtk/mcast_stream.c +++ b/gtk/mcast_stream.c @@ -1,7 +1,7 @@ /* mcast_stream.c * * Copyright 2006, Iskratel , Slovenia - * By Jakob Bratkovic <j.bratkovic@iskratel.si> and + * By Jakob Bratkovic <j.bratkovic@iskratel.si> and * Miha Jemec <m.jemec@iskratel.si> * * $Id$ @@ -54,7 +54,6 @@ #include "../register.h" #include "../alert_box.h" #include "../simple_dialog.h" -#include "wiretap/file_util.h" #include "gtk/mcast_stream.h" #include "gtk/mcast_stream_dlg.h" @@ -192,7 +191,7 @@ static int mcaststream_packet(void *arg, packet_info *pinfo, epan_dissect_t *edt /* not in the list? then create a new entry */ if (!strinfo) { - /*printf("nov sip %s sp %d dip %s dp %d\n", g_strdup(get_addr_name(&(pinfo->src))), + /*printf("nov sip %s sp %d dip %s dp %d\n", g_strdup(get_addr_name(&(pinfo->src))), pinfo->srcport, g_strdup(get_addr_name(&(pinfo->dst))), pinfo->destport);*/ tmp_strinfo.npackets = 0; tmp_strinfo.apackets = 0; @@ -230,7 +229,7 @@ static int mcaststream_packet(void *arg, packet_info *pinfo, epan_dissect_t *edt /* set time with the first packet */ if (tapinfo->npackets == 0) { tapinfo->allstreams = g_malloc(sizeof(mcast_stream_info_t)); - tapinfo->allstreams->element.buff = + tapinfo->allstreams->element.buff = (struct timeval *)g_malloc(buffsize * sizeof(struct timeval)); tapinfo->allstreams->start_rel_sec = (guint32) pinfo->fd->rel_ts.secs; tapinfo->allstreams->start_rel_usec = pinfo->fd->rel_ts.nsecs/1000; @@ -399,7 +398,7 @@ void buffusagecalc(mcast_stream_info_t *strinfo, packet_info *pinfo, double empt strinfo->element.buffusage-= (guint32) (timeelapsed * emptyspeed / 8); if(strinfo->element.buffusage < 0) strinfo->element.buffusage=0; - if(strinfo->element.buffusage > strinfo->element.topbuffusage) + if(strinfo->element.buffusage > strinfo->element.topbuffusage) strinfo->element.topbuffusage = strinfo->element.buffusage; /* check for buffer losses */ if((strinfo->element.buffusage >= bufferalarm) && (strinfo->element.buffstatus == 0)){ @@ -433,7 +432,7 @@ void slidingwindow(mcast_stream_info_t *strinfo, packet_info *pinfo) /* burst count */ buffer[strinfo->element.last].tv_sec = (guint32) pinfo->fd->rel_ts.secs; buffer[strinfo->element.last].tv_usec = pinfo->fd->rel_ts.nsecs/1000; - while(comparetimes((struct timeval *)&(buffer[strinfo->element.first]), + while(comparetimes((struct timeval *)&(buffer[strinfo->element.first]), (struct timeval *)&(buffer[strinfo->element.last]), burstint)){ strinfo->element.first++; if(strinfo->element.first >= buffsize) strinfo->element.first = strinfo->element.first % buffsize; diff --git a/gtk/print_dlg.c b/gtk/print_dlg.c index 8f2ebd0307..b50c27aadc 100644 --- a/gtk/print_dlg.c +++ b/gtk/print_dlg.c @@ -40,7 +40,7 @@ #include "../simple_dialog.h" #include "../tempfile.h" #include "../util.h" -#include "wiretap/file_util.h" +#include <wsutil/file_util.h> #include "gtk/gtkglobals.h" #include "gtk/keys.h" @@ -456,7 +456,7 @@ export_carrays_cmd_cb(GtkWidget *widget _U_, gpointer data _U_) /* init the printing range */ packet_range_init(&args->range); - export_carrays_win = open_print_dialog("Wireshark: Export as \"C Arrays\" File", + export_carrays_win = open_print_dialog("Wireshark: Export as \"C Arrays\" File", output_action_export_carrays, args); g_signal_connect(export_carrays_win, "destroy", G_CALLBACK(print_destroy_cb), &export_carrays_win); } @@ -970,7 +970,7 @@ print_ok_cb(GtkWidget *ok_bt, gpointer parent_w) /* remember to restore these values later! */ tmp_oldfile = args->file; args->file = g_strdup(tmp_namebuf); - eth_unlink(args->file); + ws_unlink(args->file); args->to_file = TRUE; #else g_free(args->cmd); @@ -1104,7 +1104,7 @@ print_ok_cb(GtkWidget *ok_bt, gpointer parent_w) print_mswin(args->file); /* trash temp file */ - eth_remove(args->file); + ws_remove(args->file); /* restore old settings */ args->to_file = FALSE; diff --git a/gtk/print_win32.c b/gtk/print_win32.c index 08bbec3aa0..bcef8e9633 100644 --- a/gtk/print_win32.c +++ b/gtk/print_win32.c @@ -36,7 +36,7 @@ #include <winspool.h> #include "gtk/print_win32.h" -#include "wiretap/file_util.h" +#include <wsutil/file_util.h> /* Some thoughts about a GTK win32 printer dialog: @@ -44,14 +44,14 @@ Some thoughts about a GTK win32 printer dialog: "EnumPrinters()", asking for information level 2 - the PRINTER_INFO_2 structure contains a pLocation string pointer, along with other information. - + "PrinterProperties", could be used to show a native printer property page?!? See - + http://msdn.microsoft.com/library/default.asp?url=/library/en-us/gdi/prntspol_62ia.asp - -for information on printer APIs. + +for information on printer APIs. */ BOOL CALLBACK abort_proc( HDC hDC, int Error ); @@ -123,15 +123,15 @@ void print_mswin(char *file_name) memset( &pdlg, 0, sizeof( PRINTDLG ) ); pdlg.lStructSize = sizeof( PRINTDLG ); /* Set the flag to return printer DC. */ - pdlg.Flags = + pdlg.Flags = /* return the device context we need */ - PD_RETURNDC | + PD_RETURNDC | /* disable the "Pages" radio button */ - PD_NOPAGENUMS | + PD_NOPAGENUMS | /* disable the "Selection" radio button */ - PD_NOSELECTION | + PD_NOSELECTION | /* let device print multiple pages (if requested) */ - PD_USEDEVMODECOPIESANDCOLLATE; + PD_USEDEVMODECOPIESANDCOLLATE; /* Invoke the printer dialog box. */ PrintDlg( &pdlg ); @@ -186,7 +186,7 @@ void print_file( char *file_name, HDC hdc) { SetMapMode (hdc, MM_TEXT); - fh1 = eth_fopen( file_name, "r" ); + fh1 = ws_fopen( file_name, "r" ); if( !fh1 ) { perror( "open failed on input file" ); return; diff --git a/gtk/profile_dlg.c b/gtk/profile_dlg.c index fdd57a0678..06f35da873 100644 --- a/gtk/profile_dlg.c +++ b/gtk/profile_dlg.c @@ -36,7 +36,7 @@ #include <epan/prefs.h> #include "../simple_dialog.h" -#include <wiretap/file_util.h> +#include <wsutil/file_util.h> #include "gtk/main.h" #include "gtk/profile_dlg.h" @@ -116,16 +116,16 @@ empty_profile_list(gboolean edit_list) while(*flpp) { *flpp = remove_profile_entry(*flpp, g_list_first(*flpp)); } - + g_assert(g_list_length(*flpp) == 0); - } + } flpp = ¤t_profiles; while(*flpp) { *flpp = remove_profile_entry(*flpp, g_list_first(*flpp)); } - + g_assert(g_list_length(*flpp) == 0); } @@ -144,7 +144,7 @@ copy_profile_list(void) while(flp_src) { profile = (flp_src)->data; - current_profiles = add_profile_entry(current_profiles, profile->name, + current_profiles = add_profile_entry(current_profiles, profile->name, profile->reference, profile->status); flp_src = g_list_next(flp_src); } @@ -164,22 +164,22 @@ fill_list(GtkWidget *main_w) const gchar *profile_name = get_profile_name (); const gchar *profiles_dir, *name; gchar *filename; - + profile_l = GTK_TREE_VIEW(g_object_get_data(G_OBJECT(main_w), E_PROF_PROFILE_L_KEY)); store = GTK_LIST_STORE(gtk_tree_view_get_model(profile_l)); - + fl_entry = add_to_profile_list(DEFAULT_PROFILE, DEFAULT_PROFILE, PROF_STAT_DEFAULT); gtk_list_store_append(store, &iter); gtk_list_store_set(store, &iter, 0, DEFAULT_PROFILE, 1, fl_entry, -1); if (strcmp (profile_name, DEFAULT_PROFILE)==0) { l_select = g_memdup(&iter, sizeof(iter)); } - + /* fill in data */ profiles_dir = get_profiles_dir(); - if ((dir = eth_dir_open(profiles_dir, 0, NULL)) != NULL) { - while ((file = eth_dir_read_name(dir)) != NULL) { - name = eth_dir_get_name(file); + if ((dir = ws_dir_open(profiles_dir, 0, NULL)) != NULL) { + while ((file = ws_dir_read_name(dir)) != NULL) { + name = ws_dir_get_name(file); filename = g_strdup_printf ("%s%s%s", profiles_dir, G_DIR_SEPARATOR_S, name); if (test_for_directory(filename) == EISDIR) { @@ -187,7 +187,7 @@ fill_list(GtkWidget *main_w) profile = (profile_def *) fl_entry->data; gtk_list_store_append(store, &iter); gtk_list_store_set(store, &iter, 0, profile->name, 1, fl_entry, -1); - + if (profile->name) { if (strcmp(profile_name, profile->name) == 0) { /* @@ -201,12 +201,12 @@ fill_list(GtkWidget *main_w) } g_free (filename); } - eth_dir_close (dir); + ws_dir_close (dir); } /* Make the current list an the edited list equal */ copy_profile_list (); - + return l_select; } @@ -269,7 +269,7 @@ profile_select(GtkWidget *main_w, GtkTreeView *profile_l, gboolean destroy) /* The new profile exists, change */ change_configuration_profile (profile->name); } else if (!profile_exists (get_profile_name())) { - /* The new profile does not exist, and the previous profile has + /* The new profile does not exist, and the previous profile has been deleted. Change to the default profile */ change_configuration_profile (NULL); } @@ -318,7 +318,7 @@ profile_apply(GtkWidget *main_w, GtkTreeView *profile_l, gboolean destroy) simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK, "Can't create directory\n\"%s\":\n%s.", pf_dir_path, strerror(errno)); - + g_free(pf_dir_path); } profile1->status = PROF_STAT_EXISTS; @@ -335,7 +335,7 @@ profile_apply(GtkWidget *main_w, GtkTreeView *profile_l, gboolean destroy) simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK, "Can't rename directory\n\"%s\" to\n\"%s\":\n%s.", pf_dir_path, pf_dir_path2, strerror(errno)); - + g_free(pf_dir_path); } profile1->status = PROF_STAT_EXISTS; @@ -385,7 +385,7 @@ profile_dlg_ok_cb(GtkWidget *ok_bt, gpointer data _U_) { GtkWidget *main_w = gtk_widget_get_toplevel(ok_bt); GtkTreeView *profile_l = GTK_TREE_VIEW(g_object_get_data(G_OBJECT(main_w), E_PROF_PROFILE_L_KEY)); - + /* * Apply the profile and destroy the dialog box. */ @@ -587,7 +587,7 @@ profile_name_te_changed_cb(GtkWidget *w, gpointer data _U_) gtk_tree_model_get(model, &iter, 1, &fl_entry, -1); if (fl_entry != NULL) { profile = (profile_def *) fl_entry->data; - + if (strlen(name) > 0 && profile) { if (profile->status != PROF_STAT_DEFAULT) { g_free(profile->name); @@ -662,16 +662,16 @@ profile_dialog_new(void) GtkTreeViewColumn *column; GtkTreeSelection *sel; GtkTreeIter *l_select; - + /* Get a pointer to a static variable holding the type of profile on which we're working, so we can pass that pointer to callback routines. */ - + tooltips = gtk_tooltips_new (); - + main_w = dlg_conf_window_new("Wireshark: Configuration Profiles"); gtk_window_set_default_size(GTK_WINDOW(main_w), 400, 400); - + main_vb = gtk_vbox_new(FALSE, 0); gtk_container_border_width(GTK_CONTAINER(main_vb), 5); gtk_container_add(GTK_CONTAINER(main_w), main_vb); diff --git a/gtk/recent.c b/gtk/recent.c index 8f860327a1..afa7334b9b 100644 --- a/gtk/recent.c +++ b/gtk/recent.c @@ -40,7 +40,7 @@ #include <epan/column.h> #include "../simple_dialog.h" -#include "wiretap/file_util.h" +#include <wsutil/file_util.h> #include "gtk/recent.h" #include "gtk/main.h" @@ -154,7 +154,7 @@ write_recent(void) } rf_path = get_persconffile_path(RECENT_COMMON_FILE_NAME, FALSE, TRUE); - if ((rf = eth_fopen(rf_path, "w")) == NULL) { + if ((rf = ws_fopen(rf_path, "w")) == NULL) { simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK, "Can't open recent file\n\"%s\": %s.", rf_path, strerror(errno)); @@ -265,7 +265,7 @@ write_profile_recent(void) } rf_path = get_persconffile_path(RECENT_FILE_NAME, TRUE, TRUE); - if ((rf = eth_fopen(rf_path, "w")) == NULL) { + if ((rf = ws_fopen(rf_path, "w")) == NULL) { simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK, "Can't open recent file\n\"%s\": %s.", rf_path, strerror(errno)); @@ -768,7 +768,7 @@ recent_read_static(char **rf_path_return, int *rf_errno_return) /* Read the user's recent file, if it exists. */ *rf_path_return = NULL; - if ((rf = eth_fopen(rf_path, "r")) != NULL) { + if ((rf = ws_fopen(rf_path, "r")) != NULL) { /* We succeeded in opening it; read it. */ read_prefs_file(rf_path, rf, read_set_recent_common_pair_static, NULL); @@ -826,13 +826,13 @@ recent_read_profile_static(char **rf_path_return, int *rf_errno_return) /* Read the user's recent file, if it exists. */ *rf_path_return = NULL; - if ((rf = eth_fopen(rf_path, "r")) != NULL) { + if ((rf = ws_fopen(rf_path, "r")) != NULL) { /* We succeeded in opening it; read it. */ read_prefs_file(rf_path, rf, read_set_recent_pair_static, NULL); fclose(rf); if (!recent.has_recent_common) { /* Read older common settings from recent file */ - rf = eth_fopen(rf_path, "r"); + rf = ws_fopen(rf_path, "r"); read_prefs_file(rf_path, rf, read_set_recent_common_pair_static, NULL); fclose(rf); } @@ -866,7 +866,7 @@ recent_read_dynamic(char **rf_path_return, int *rf_errno_return) /* Read the user's recent file, if it exists. */ *rf_path_return = NULL; - if ((rf = eth_fopen(rf_path, "r")) != NULL) { + if ((rf = ws_fopen(rf_path, "r")) != NULL) { /* We succeeded in opening it; read it. */ read_prefs_file(rf_path, rf, read_set_recent_pair_dynamic, NULL); /* set dfilter combobox to have an empty line */ diff --git a/gtk/rtp_analysis.c b/gtk/rtp_analysis.c index 173151057a..72eb6fbfe3 100644 --- a/gtk/rtp_analysis.c +++ b/gtk/rtp_analysis.c @@ -69,7 +69,7 @@ #include "../progress_dlg.h" #include "../color.h" #include "../tempfile.h" -#include "wiretap/file_util.h" +#include <wsutil/file_util.h> #include "gtk/gtkglobals.h" #include "gtk/dlg_utils.h" @@ -350,10 +350,10 @@ rtp_reset(void *user_data_arg) fclose(user_data->forward.saveinfo.fp); if (user_data->reversed.saveinfo.fp != NULL) fclose(user_data->reversed.saveinfo.fp); - user_data->forward.saveinfo.fp = eth_fopen(user_data->f_tempname, "wb"); + user_data->forward.saveinfo.fp = ws_fopen(user_data->f_tempname, "wb"); if (user_data->forward.saveinfo.fp == NULL) user_data->forward.saveinfo.error_type = TAP_RTP_FILE_OPEN_ERROR; - user_data->reversed.saveinfo.fp = eth_fopen(user_data->r_tempname, "wb"); + user_data->reversed.saveinfo.fp = ws_fopen(user_data->r_tempname, "wb"); if (user_data->reversed.saveinfo.fp == NULL) user_data->reversed.saveinfo.error_type = TAP_RTP_FILE_OPEN_ERROR; return; @@ -712,8 +712,8 @@ static void on_destroy(GtkWidget *win _U_, user_data_t *user_data _U_) if (user_data->reversed.saveinfo.fp != NULL) fclose(user_data->reversed.saveinfo.fp); /*XXX: test for error **/ - eth_remove(user_data->f_tempname); - eth_remove(user_data->r_tempname); + ws_remove(user_data->f_tempname); + ws_remove(user_data->r_tempname); /* destroy save_voice_as window if open */ if (user_data->dlg.save_voice_as_w != NULL) @@ -1869,7 +1869,7 @@ static void save_csv_as_ok_cb(GtkWidget *bt _U_, gpointer fs /*user_data_t *user user_data = (user_data_t*)g_object_get_data(G_OBJECT(bt), "user_data"); if (GTK_TOGGLE_BUTTON(forw)->active || GTK_TOGGLE_BUTTON(both)->active) { - fp = eth_fopen(g_dest, "w"); + fp = ws_fopen(g_dest, "w"); if (fp == NULL) { open_failure_alert_box(g_dest, errno, TRUE); return; @@ -1923,7 +1923,7 @@ static void save_csv_as_ok_cb(GtkWidget *bt _U_, gpointer fs /*user_data_t *user if (GTK_TOGGLE_BUTTON(rev)->active || GTK_TOGGLE_BUTTON(both)->active) { if (GTK_TOGGLE_BUTTON(both)->active) { - fp = eth_fopen(g_dest, "a"); + fp = ws_fopen(g_dest, "a"); if (fp == NULL) { open_failure_alert_box(g_dest, errno, TRUE); return; @@ -1935,7 +1935,7 @@ static void save_csv_as_ok_cb(GtkWidget *bt _U_, gpointer fs /*user_data_t *user return; } } else { - fp = eth_fopen(g_dest, "w"); + fp = ws_fopen(g_dest, "w"); if (fp == NULL) { open_failure_alert_box(g_dest, errno, TRUE); return; @@ -2099,20 +2099,20 @@ static gboolean copy_file(gchar *dest, gint channels, gint format, user_data_t * gboolean stop_flag = FALSE; size_t nchars; - forw_fd = eth_open(user_data->f_tempname, O_RDONLY | O_BINARY, 0000 /* no creation so don't matter */); + forw_fd = ws_open(user_data->f_tempname, O_RDONLY | O_BINARY, 0000 /* no creation so don't matter */); if (forw_fd < 0) return FALSE; - rev_fd = eth_open(user_data->r_tempname, O_RDONLY | O_BINARY, 0000 /* no creation so don't matter */); + rev_fd = ws_open(user_data->r_tempname, O_RDONLY | O_BINARY, 0000 /* no creation so don't matter */); if (rev_fd < 0) { - eth_close(forw_fd); + ws_close(forw_fd); return FALSE; } /* open file for saving */ - to_fd = eth_open(dest, O_WRONLY | O_CREAT | O_TRUNC | O_BINARY, 0644); + to_fd = ws_open(dest, O_WRONLY | O_CREAT | O_TRUNC | O_BINARY, 0644); if (to_fd < 0) { - eth_close(forw_fd); - eth_close(rev_fd); + ws_close(forw_fd); + ws_close(rev_fd); return FALSE; } @@ -2123,22 +2123,22 @@ static gboolean copy_file(gchar *dest, gint channels, gint format, user_data_t * /* First we write the .au header. XXX Hope this is endian independant */ /* the magic word 0x2e736e64 == .snd */ phtonl(pd, 0x2e736e64); - nchars=eth_write(to_fd, pd, 4); + nchars=ws_write(to_fd, pd, 4); /* header offset == 24 bytes */ phtonl(pd, 24); - nchars=eth_write(to_fd, pd, 4); + nchars=ws_write(to_fd, pd, 4); /* total length, it is permited to set this to 0xffffffff */ phtonl(pd, -1); - nchars=eth_write(to_fd, pd, 4); + nchars=ws_write(to_fd, pd, 4); /* encoding format == 16-bit linear PCM */ phtonl(pd, 3); - nchars=eth_write(to_fd, pd, 4); + nchars=ws_write(to_fd, pd, 4); /* sample rate == 8000 Hz */ phtonl(pd, 8000); - nchars=eth_write(to_fd, pd, 4); + nchars=ws_write(to_fd, pd, 4); /* channels == 1 */ phtonl(pd, 1); - nchars=eth_write(to_fd, pd, 4); + nchars=ws_write(to_fd, pd, 4); switch (channels) { @@ -2165,18 +2165,18 @@ static gboolean copy_file(gchar *dest, gint channels, gint format, user_data_t * phtons(pd, sample); } else{ - eth_close(forw_fd); - eth_close(rev_fd); - eth_close(to_fd); + ws_close(forw_fd); + ws_close(rev_fd); + ws_close(to_fd); destroy_progress_dlg(progbar); return FALSE; } - fwritten = eth_write(to_fd, pd, 2); + fwritten = ws_write(to_fd, pd, 2); if ((fwritten < 2) || (fwritten < 0) || (fread < 0)) { - eth_close(forw_fd); - eth_close(rev_fd); - eth_close(to_fd); + ws_close(forw_fd); + ws_close(rev_fd); + ws_close(to_fd); destroy_progress_dlg(progbar); return FALSE; } @@ -2206,18 +2206,18 @@ static gboolean copy_file(gchar *dest, gint channels, gint format, user_data_t * phtons(pd, sample); } else{ - eth_close(forw_fd); - eth_close(rev_fd); - eth_close(to_fd); + ws_close(forw_fd); + ws_close(rev_fd); + ws_close(to_fd); destroy_progress_dlg(progbar); return FALSE; } - rwritten = eth_write(to_fd, pd, 2); + rwritten = ws_write(to_fd, pd, 2); if ((rwritten < 2) || (rwritten < 0) || (rread < 0)) { - eth_close(forw_fd); - eth_close(rev_fd); - eth_close(to_fd); + ws_close(forw_fd); + ws_close(rev_fd); + ws_close(to_fd); destroy_progress_dlg(progbar); return FALSE; } @@ -2291,19 +2291,19 @@ static gboolean copy_file(gchar *dest, gint channels, gint format, user_data_t * } else { - eth_close(forw_fd); - eth_close(rev_fd); - eth_close(to_fd); + ws_close(forw_fd); + ws_close(rev_fd); + ws_close(to_fd); destroy_progress_dlg(progbar); return FALSE; } - rwritten = eth_write(to_fd, pd, 2); + rwritten = ws_write(to_fd, pd, 2); if ((rwritten < 2) || (rread < 0) || (fread < 0)) { - eth_close(forw_fd); - eth_close(rev_fd); - eth_close(to_fd); + ws_close(forw_fd); + ws_close(rev_fd); + ws_close(to_fd); destroy_progress_dlg(progbar); return FALSE; } @@ -2330,9 +2330,9 @@ static gboolean copy_file(gchar *dest, gint channels, gint format, user_data_t * break; } default: { - eth_close(forw_fd); - eth_close(rev_fd); - eth_close(to_fd); + ws_close(forw_fd); + ws_close(rev_fd); + ws_close(to_fd); destroy_progress_dlg(progbar); return FALSE; } @@ -2351,12 +2351,12 @@ static gboolean copy_file(gchar *dest, gint channels, gint format, user_data_t * } count++; - rwritten = eth_write(to_fd, pd, 1); + rwritten = ws_write(to_fd, pd, 1); if ((rwritten < rread) || (rwritten < 0) || (rread < 0)) { - eth_close(forw_fd); - eth_close(rev_fd); - eth_close(to_fd); + ws_close(forw_fd); + ws_close(rev_fd); + ws_close(to_fd); destroy_progress_dlg(progbar); return FALSE; } @@ -2364,9 +2364,9 @@ static gboolean copy_file(gchar *dest, gint channels, gint format, user_data_t * } destroy_progress_dlg(progbar); - eth_close(forw_fd); - eth_close(rev_fd); - eth_close(to_fd); + ws_close(forw_fd); + ws_close(rev_fd); + ws_close(to_fd); return TRUE; } @@ -3026,7 +3026,7 @@ static void create_rtp_dialog(user_data_t* user_data) gtk_container_add(GTK_CONTAINER(main_vb), notebook); g_object_set_data(G_OBJECT(window), "notebook", notebook); - user_data->dlg.notebook_signal_id = + user_data->dlg.notebook_signal_id = g_signal_connect(notebook, "switch_page", G_CALLBACK(on_notebook_switch_page), user_data); /* page for forward connection */ @@ -3276,10 +3276,10 @@ void rtp_analysis( /*XXX: check for errors*/ fd = create_tempfile(user_data->f_tempname, sizeof(user_data->f_tempname), "ether_rtp_f"); - eth_close(fd); + ws_close(fd); fd = create_tempfile(user_data->r_tempname, sizeof(user_data->r_tempname), "ether_rtp_r"); - eth_close(fd); + ws_close(fd); user_data->forward.saveinfo.fp = NULL; user_data->reversed.saveinfo.fp = NULL; user_data->dlg.save_voice_as_w = NULL; diff --git a/gtk/rtp_stream.c b/gtk/rtp_stream.c index 06a323c7e4..db51db16c3 100644 --- a/gtk/rtp_stream.c +++ b/gtk/rtp_stream.c @@ -50,7 +50,7 @@ #include "../alert_box.h" #include "../simple_dialog.h" #include "../tap-rtp-common.h" -#include "wiretap/file_util.h" +#include <wsutil/file_util.h> #include "gtk/rtp_stream.h" #include "gtk/rtp_stream_dlg.h" @@ -90,7 +90,7 @@ gboolean rtpstream_save(rtp_stream_info_t* stream, const gchar *filename) { gboolean was_registered = the_tapinfo_struct.is_registered; /* open file for saving */ - the_tapinfo_struct.save_file = eth_fopen(filename, "wb"); + the_tapinfo_struct.save_file = ws_fopen(filename, "wb"); if (the_tapinfo_struct.save_file==NULL) { open_failure_alert_box(filename, errno, TRUE); return FALSE; diff --git a/gtk/text_page_utils.c b/gtk/text_page_utils.c index f691cb0b01..3afd44478d 100644 --- a/gtk/text_page_utils.c +++ b/gtk/text_page_utils.c @@ -36,7 +36,7 @@ #include "epan/filesystem.h" #include "../simple_dialog.h" -#include "wiretap/file_util.h" +#include <wsutil/file_util.h> #include "gtk/text_page_utils.h" #include "gtk/gui_utils.h" @@ -59,7 +59,7 @@ GtkWidget * text_page_new(const char *absolute_path) page_vb = gtk_vbox_new(FALSE, 0); gtk_container_border_width(GTK_CONTAINER(page_vb), 1); txt_scrollw = scrolled_window_new(NULL, NULL); - gtk_scrolled_window_set_shadow_type(GTK_SCROLLED_WINDOW(txt_scrollw), + gtk_scrolled_window_set_shadow_type(GTK_SCROLLED_WINDOW(txt_scrollw), GTK_SHADOW_IN); gtk_box_pack_start(GTK_BOX(page_vb), txt_scrollw, TRUE, TRUE, 0); @@ -113,7 +113,7 @@ static void text_page_set_text(GtkWidget *page, const char *absolute_path) FILE *text_file; char line[4096+1]; /* XXX - size? */ - text_file = eth_fopen(absolute_path, "r"); + text_file = ws_fopen(absolute_path, "r"); if (text_file != NULL) { while (fgets(line, sizeof line, text_file) != NULL) { text_page_insert(page, line, strlen(line)); @@ -46,7 +46,7 @@ #include <process.h> /* getpid */ #endif -#include <wiretap/file_util.h> +#include <wsutil/file_util.h> #include <epan/filesystem.h> @@ -61,7 +61,7 @@ static gchar *newpath = NULL; static char *u3_change_path(char *path, const char *old, const char *new); -gboolean u3_active() +gboolean u3_active() { return ( @@ -69,7 +69,7 @@ gboolean u3_active() getenv_utf8 #else getenv -#endif +#endif ("U3_HOST_EXEC_PATH") != NULL); } @@ -80,12 +80,12 @@ void u3_runtime_info(GString *str) char *u3devicepath = NULL; char *u3deviceproduct = NULL; - if((u3deviceproduct = + if((u3deviceproduct = #ifdef _WIN32 getenv_utf8 #else getenv -#endif +#endif ("U3_DEVICE_PRODUCT")) != NULL) { g_string_append(str, " from the "); g_string_append(str, u3deviceproduct); @@ -95,12 +95,12 @@ void u3_runtime_info(GString *str) g_string_append(str, " U3 device"); - if((u3devicepath = + if((u3devicepath = #ifdef _WIN32 getenv_utf8 #else getenv -#endif +#endif ("U3_DEVICE_PATH")) != NULL) { g_string_append(str, " in drive "); g_string_append(str, u3devicepath); @@ -114,13 +114,13 @@ void u3_register_pid() int pid_fd; char *u3hostexecpath; int pf_size; - - if((u3hostexecpath = + + if((u3hostexecpath = #ifdef _WIN32 getenv_utf8 #else getenv -#endif +#endif ("U3_HOST_EXEC_PATH")) != NULL) { pid = getpid(); @@ -130,10 +130,10 @@ void u3_register_pid() g_snprintf(pid_file, pf_size, "%s\\%d.pid", u3hostexecpath, pid); - pid_fd = eth_open(pid_file, O_WRONLY | O_CREAT | O_TRUNC | O_BINARY, 0644); + pid_fd = ws_open(pid_file, O_WRONLY | O_CREAT | O_TRUNC | O_BINARY, 0644); if(pid_fd != -1) - eth_close(pid_fd); + ws_close(pid_fd); else { g_free(pid_file); pid_file = NULL; @@ -146,8 +146,8 @@ void u3_deregister_pid() { if(pid_file) { /* we don't care if we succeed or fail - u3utils may have deleted the file */ - eth_unlink(pid_file); - + ws_unlink(pid_file); + g_free(pid_file); pid_file = NULL; @@ -166,20 +166,20 @@ char *u3_contract_device_path(char *path) return u3_change_path(path, NULL, U3_DEVICE_PATH_VAR); } -static char *u3_change_path(char *path, const char *old, const char *new) +static char *u3_change_path(char *path, const char *old, const char *new) { if(u3devicepath == (char*)-1) { /* cache the device path */ - u3devicepath = + u3devicepath = #ifdef _WIN32 getenv_utf8 #else getenv -#endif +#endif ("U3_DEVICE_PATH"); } - + if(new == NULL) new = u3devicepath; if(old == NULL) @@ -191,7 +191,7 @@ static char *u3_change_path(char *path, const char *old, const char *new) } if((path != NULL) && (u3devicepath != NULL) && (strncmp(path, old, strlen(old)) == 0)) { - + newpath = g_strconcat(new, path + strlen(old), NULL); return newpath; |