2 * Routines for capture file summary window
6 * Wireshark - Network traffic analyzer
7 * By Gerald Combs <gerald@wireshark.org>
8 * Copyright 1998 Gerald Combs
10 * This program is free software; you can redistribute it and/or
11 * modify it under the terms of the GNU General Public License
12 * as published by the Free Software Foundation; either version 2
13 * of the License, or (at your option) any later version.
15 * This program is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU General Public License for more details.
20 * You should have received a copy of the GNU General Public License
21 * along with this program; if not, write to the Free Software
22 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
29 #ifdef HAVE_SYS_TYPES_H
30 #include <sys/types.h>
37 #include <epan/strutil.h>
39 #include <wiretap/wtap.h>
41 #include "../globals.h"
43 #include "../summary.h"
44 #include "../capture-pcap-util.h"
46 #include "../capture.h"
47 #include "ui/gtk/main.h"
48 #include "ui/gtk/capture_globals.h"
51 #include "ui/gtk/summary_dlg.h"
52 #include "ui/gtk/dlg_utils.h"
53 #include "ui/gtk/gui_utils.h"
54 #include "ui/gtk/help_dlg.h"
56 #define SUM_STR_MAX 1024
57 #define FILTER_SNIP_LEN 50
58 #define SHB_STR_SNIP_LEN 50
62 add_string_to_table_sensitive(GtkWidget *list, guint *row, const gchar *title, const gchar *value, gboolean sensitive)
67 if(strlen(value) != 0) {
68 indent = g_strdup_printf(" %s", title);
70 indent = g_strdup(title);
72 label = gtk_label_new(indent);
73 if (strlen(value) == 0) {
74 gchar *message = g_strdup_printf("<span weight=\"bold\">%s</span>", title);
75 gtk_label_set_markup(GTK_LABEL(label), message);
79 gtk_misc_set_alignment(GTK_MISC(label), 0.0f, 0.5f);
80 gtk_widget_set_sensitive(label, sensitive);
81 gtk_table_attach_defaults(GTK_TABLE(list), label, 0, 1, *row, *row+1);
83 label = gtk_label_new(value);
84 gtk_misc_set_alignment(GTK_MISC(label), 0.0f, 0.5f);
85 gtk_widget_set_sensitive(label, sensitive);
86 gtk_table_attach_defaults(GTK_TABLE(list), label, 1, 2, *row, *row+1);
92 add_string_to_table(GtkWidget *list, guint *row, gchar *title, gchar *value)
94 add_string_to_table_sensitive(list, row, title, value, TRUE);
99 add_string_to_list(GtkWidget *list, gchar *title, gchar *captured, gchar *displayed, gchar *marked)
101 simple_list_append(list, 0, title, 1, captured, 2, displayed, 3, marked, -1);
105 time_to_string(char *string_buff, gulong string_buff_size, time_t ti_time)
110 /* calling localtime() on MSVC 2005 with huge values causes it to crash */
111 /* XXX - find the exact value that still does work */
112 /* XXX - using _USE_32BIT_TIME_T might be another way to circumvent this problem */
113 if (ti_time > 2000000000) {
117 ti_tm = localtime(&ti_time);
119 g_snprintf(string_buff, string_buff_size, "Not representable");
122 g_snprintf(string_buff, string_buff_size,
123 "%04d-%02d-%02d %02d:%02d:%02d",
124 ti_tm->tm_year + 1900,
133 summary_comment_text_buff_save_cb(GtkWidget *w _U_, GtkWidget *view)
135 GtkTextBuffer *buffer;
136 GtkTextIter start_iter;
137 GtkTextIter end_iter;
138 gchar *new_comment = NULL;
140 buffer = gtk_text_view_get_buffer (GTK_TEXT_VIEW (view));
141 gtk_text_buffer_get_start_iter (buffer, &start_iter);
142 gtk_text_buffer_get_end_iter (buffer, &end_iter);
144 new_comment = gtk_text_buffer_get_text (buffer, &start_iter, &end_iter, FALSE /* whether to include invisible text */);
146 /*g_warning("The new comment is '%s'",new_packet_comment);*/
148 summary_update_comment(&cfile, new_comment);
153 summary_comment_text_buff_clear_cb(GtkWidget *w _U_, GtkWidget *view)
155 GtkTextBuffer *buffer;
157 buffer = gtk_text_view_get_buffer (GTK_TEXT_VIEW (view));
158 gtk_text_buffer_set_text (buffer, "", -1);
163 summary_open_cb(GtkWidget *w _U_, gpointer d _U_)
165 summary_tally summary;
166 GtkWidget *sum_open_w,
167 *main_vb, *bbox, *close_bt, *help_bt;
168 GtkWidget *table, *scrolled_window;
169 GtkWidget *list, *treeview;
172 GtkCellRenderer *renderer;
173 GtkTreeViewColumn *column;
175 const char *dl_description;
177 static const char *titles[] = { "Traffic", "Captured", "Displayed", "Marked" };
179 gchar string_buff[SUM_STR_MAX];
180 gchar string_buff2[SUM_STR_MAX];
181 gchar string_buff3[SUM_STR_MAX];
182 gchar string_buff4[SUM_STR_MAX];
183 gchar string_buff5[SUM_STR_MAX];
187 double marked_seconds;
194 unsigned int elapsed_time;
198 /* initial computations */
199 summary_fill_in(&cfile, &summary);
201 summary_fill_in_capture(&cfile, &global_capture_opts, &summary);
204 * Note: the start and stop times are initialized to 0, so if we
205 * have zero or one packets of the type in question that have
206 * time stamps, the elapsed times will be zero, just as if we
207 * have both start and stop time stamps but they're the same.
208 * That means we can avoid some checks for whether we have more
209 * than one packet of the type in question with time stamps.
211 seconds = summary.stop_time - summary.start_time;
212 disp_seconds = summary.filtered_stop - summary.filtered_start;
213 marked_seconds = summary.marked_stop - summary.marked_start;
215 sum_open_w = window_new(GTK_WINDOW_TOPLEVEL, "Wireshark: Summary");
217 /* Container for each row of widgets */
218 main_vb = gtk_vbox_new(FALSE, 12);
219 gtk_container_set_border_width(GTK_CONTAINER(main_vb), 12);
220 gtk_container_add(GTK_CONTAINER(sum_open_w), main_vb);
223 table = gtk_table_new(1, 2, FALSE);
224 gtk_table_set_col_spacings(GTK_TABLE(table), 6);
225 gtk_table_set_row_spacings(GTK_TABLE(table), 3);
226 gtk_container_add(GTK_CONTAINER(main_vb), table);
231 add_string_to_table(table, &row, "File", "");
234 g_snprintf(string_buff, SUM_STR_MAX, "%s", summary.filename);
235 add_string_to_table(table, &row, "Name:", string_buff);
238 g_snprintf(string_buff, SUM_STR_MAX, "%" G_GINT64_MODIFIER "d bytes", summary.file_length);
239 add_string_to_table(table, &row, "Length:", string_buff);
242 g_snprintf(string_buff, SUM_STR_MAX, "%s", wtap_file_type_string(summary.file_type));
243 add_string_to_table(table, &row, "Format:", string_buff);
246 g_snprintf(string_buff, SUM_STR_MAX, "%s", wtap_encap_string(summary.encap_type));
247 add_string_to_table(table, &row, "Encapsulation:", string_buff);
249 if (summary.has_snap) {
250 /* snapshot length */
251 g_snprintf(string_buff, SUM_STR_MAX, "%u bytes", summary.snap);
252 add_string_to_table(table, &row, "Packet size limit:", string_buff);
255 /* Only allow editing of comment if filetype is PCAPNG */
256 if(summary.file_type == WTAP_FILE_PCAPNG){
257 GtkWidget *comment_vbox;
259 GtkTextBuffer *buffer = NULL;
260 const gchar *buf_str;
261 GtkWidget *save_bt, *clear_bt;
263 comment_vbox = gtk_vbox_new (FALSE, 0);
264 gtk_container_add (GTK_CONTAINER (main_vb), comment_vbox);
265 gtk_widget_show (comment_vbox);
267 view = gtk_text_view_new ();
268 buffer = gtk_text_view_get_buffer (GTK_TEXT_VIEW (view));
269 if(summary.opt_comment == NULL){
270 buf_str = g_strdup_printf("[None]");
272 buf_str = g_strdup_printf("%s", summary.opt_comment);
274 gtk_text_buffer_set_text (buffer, buf_str, -1);
275 gtk_container_add(GTK_CONTAINER(comment_vbox), view);
276 gtk_widget_show (view);
279 bbox = dlg_button_row_new (GTK_STOCK_SAVE, GTK_STOCK_CLEAR, NULL);
280 gtk_box_pack_end (GTK_BOX(comment_vbox), bbox, FALSE, FALSE, 0);
282 save_bt = g_object_get_data (G_OBJECT(bbox), GTK_STOCK_SAVE);
283 g_signal_connect (save_bt, "clicked", G_CALLBACK(summary_comment_text_buff_save_cb), view);
284 gtk_widget_set_sensitive (save_bt, TRUE);
285 gtk_widget_set_tooltip_text(save_bt,
286 "You need to save the the capture file as well to save the updated comment");
289 clear_bt = g_object_get_data(G_OBJECT(bbox), GTK_STOCK_CLEAR);
290 g_signal_connect(clear_bt, "clicked", G_CALLBACK(summary_comment_text_buff_clear_cb), view);
291 gtk_widget_set_tooltip_text(clear_bt,
292 "Clears the text from the box, not the capture");
294 gtk_widget_grab_default (save_bt);
297 if (summary.opt_comment != NULL) {
299 add_string_to_table(table, &row, "Comment:", summary.opt_comment);
304 * We must have no un-time-stamped packets (i.e., the number of
305 * time-stamped packets must be the same as the number of packets),
306 * and at least one time-stamped packet, in order for the start
307 * and stop times to be valid.
309 if (summary.packet_count_ts == summary.packet_count &&
310 summary.packet_count >= 1) {
312 add_string_to_table(table, &row, "", "");
313 add_string_to_table(table, &row, "Time", "");
316 time_to_string(string_buff, SUM_STR_MAX, (time_t)summary.start_time);
317 add_string_to_table(table, &row, "First packet:", string_buff);
320 time_to_string(string_buff, SUM_STR_MAX, (time_t)summary.stop_time);
321 add_string_to_table(table, &row, "Last packet:", string_buff);
324 * We must have at least two time-stamped packets for the elapsed time
327 if (summary.packet_count_ts >= 2) {
328 /* elapsed seconds */
329 elapsed_time = (unsigned int)summary.elapsed_time;
330 if(elapsed_time/86400) {
331 g_snprintf(string_buff, SUM_STR_MAX, "%02u days %02u:%02u:%02u",
332 elapsed_time/86400, elapsed_time%86400/3600, elapsed_time%3600/60, elapsed_time%60);
334 g_snprintf(string_buff, SUM_STR_MAX, "%02u:%02u:%02u",
335 elapsed_time%86400/3600, elapsed_time%3600/60, elapsed_time%60);
337 add_string_to_table(table, &row, "Elapsed:", string_buff);
342 add_string_to_table(table, &row, "", "");
343 add_string_to_table_sensitive(table, &row, "Capture", "", (summary.ifaces->len > 0));
344 if(summary.shb_hardware){
345 /* trucate the string to a reasonable length */
346 g_snprintf(string_buff, SHB_STR_SNIP_LEN, "%s",summary.shb_hardware);
347 add_string_to_table(table, &row, "Capture HW:",string_buff);
350 /* trucate the strings to a reasonable length */
351 g_snprintf(string_buff, SHB_STR_SNIP_LEN, "%s",summary.shb_os);
352 add_string_to_table(table, &row, "OS:", string_buff);
354 if(summary.shb_user_appl){
355 /* trucate the string to a reasonable length */
356 g_snprintf(string_buff, SHB_STR_SNIP_LEN, "%s",summary.shb_user_appl);
357 add_string_to_table(table, &row, "Capture application:", string_buff);
359 scrolled_window = gtk_scrolled_window_new (NULL, NULL);
360 gtk_container_set_border_width (GTK_CONTAINER (scrolled_window), 5);
361 gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrolled_window),
362 GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);
363 gtk_widget_set_size_request(scrolled_window, -1, 120);
365 treeview = gtk_tree_view_new();
366 renderer = gtk_cell_renderer_text_new();
367 column = gtk_tree_view_column_new_with_attributes("Interface", renderer, "text", 0, NULL);
368 gtk_tree_view_append_column(GTK_TREE_VIEW(treeview), column);
369 renderer = gtk_cell_renderer_text_new();
370 column = gtk_tree_view_column_new_with_attributes("Dropped Packets", renderer, "text", 1, NULL);
371 gtk_tree_view_append_column(GTK_TREE_VIEW(treeview), column);
372 renderer = gtk_cell_renderer_text_new();
373 column = gtk_tree_view_column_new_with_attributes("Capture Filter", renderer, "text", 2, NULL);
374 gtk_tree_view_append_column(GTK_TREE_VIEW(treeview), column);
375 renderer = gtk_cell_renderer_text_new();
376 column = gtk_tree_view_column_new_with_attributes("Link type", renderer, "text", 3, NULL);
377 gtk_tree_view_append_column(GTK_TREE_VIEW(treeview), column);
378 renderer = gtk_cell_renderer_text_new();
379 column = gtk_tree_view_column_new_with_attributes("Packet size limit", renderer, "text", 4, NULL);
380 gtk_tree_view_append_column(GTK_TREE_VIEW(treeview), column);
382 store = gtk_list_store_new(5, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_STRING);
383 for (i = 0; i < summary.ifaces->len; i++) {
384 iface = g_array_index(summary.ifaces, iface_options, i);
387 g_snprintf(string_buff, SUM_STR_MAX, "%s", iface.descr);
388 } else if (iface.name) {
389 g_snprintf(string_buff, SUM_STR_MAX, "%s", iface.name);
391 g_snprintf(string_buff, SUM_STR_MAX, "unknown");
394 if (iface.drops_known) {
395 g_snprintf(string_buff2, SUM_STR_MAX, "%" G_GINT64_MODIFIER "u", iface.drops);
397 g_snprintf(string_buff2, SUM_STR_MAX, "unknown");
401 if (iface.cfilter && iface.cfilter[0] != '\0') {
402 g_snprintf(string_buff3, SUM_STR_MAX, "%s", iface.cfilter);
405 g_snprintf(string_buff3, SUM_STR_MAX, "none");
407 g_snprintf(string_buff3, SUM_STR_MAX, "unknown");
410 dl_description = pcap_datalink_val_to_description(iface.linktype);
411 if (dl_description != NULL)
412 g_snprintf(string_buff4, SUM_STR_MAX, "%s", dl_description);
414 g_snprintf(string_buff4, SUM_STR_MAX, "DLT %d", iface.linktype);
416 g_snprintf(string_buff3, SUM_STR_MAX, "unknown");
417 g_snprintf(string_buff4, SUM_STR_MAX, "unknown");
419 g_snprintf(string_buff5, SUM_STR_MAX, "%u bytes", iface.snap);
420 gtk_list_store_append(store, &iter);
421 gtk_list_store_set(store, &iter, 0, string_buff, 1, string_buff2, 2, string_buff3, 3, string_buff4, 4, string_buff5,-1);
423 gtk_tree_view_set_model(GTK_TREE_VIEW(treeview), GTK_TREE_MODEL(store));
424 g_object_unref (store);
425 gtk_container_add(GTK_CONTAINER(scrolled_window), treeview);
426 gtk_container_add(GTK_CONTAINER(main_vb),scrolled_window);
427 gtk_widget_show_all (scrolled_window);
428 table = gtk_table_new(1, 2, FALSE);
429 gtk_table_set_col_spacings(GTK_TABLE(table), 6);
430 gtk_table_set_row_spacings(GTK_TABLE(table), 3);
431 gtk_container_add(GTK_CONTAINER(main_vb), table);
436 add_string_to_table(table, &row, "", "");
437 add_string_to_table(table, &row, "Display", "");
439 if (summary.dfilter) {
441 /* limit each row to some reasonable length */
442 str_dup = g_strdup_printf("%s", summary.dfilter);
443 str_work = g_strdup(str_dup);
446 while(strlen(str_work) > FILTER_SNIP_LEN) {
447 str_work[FILTER_SNIP_LEN] = '\0';
448 add_string_to_table(table, &row, (snip == 0) ? "Display filter:" : "", str_work);
450 offset+=FILTER_SNIP_LEN;
451 str_work = g_strdup(&str_dup[offset]);
455 add_string_to_table(table, &row, (snip == 0) ? "Display filter:" : "", str_work);
460 add_string_to_table(table, &row, "Display filter:", "none");
463 /* Ignored packet count */
464 g_snprintf(string_buff, SUM_STR_MAX, "%i", summary.ignored_count);
465 add_string_to_table(table, &row, "Ignored packets:", string_buff);
468 list = simple_list_new(4, titles);
469 gtk_container_add(GTK_CONTAINER(main_vb), list);
472 g_snprintf(string_buff, SUM_STR_MAX, "%i", summary.packet_count);
473 if (summary.dfilter) {
474 g_snprintf(string_buff2, SUM_STR_MAX, "%i", summary.filtered_count);
476 g_strlcpy(string_buff2, string_buff, SUM_STR_MAX);
478 g_snprintf(string_buff3, SUM_STR_MAX, "%i", summary.marked_count);
479 add_string_to_list(list, "Packets", string_buff, string_buff2, string_buff3);
481 /* Time between first and last */
483 g_snprintf(string_buff, SUM_STR_MAX, "%.3f sec", seconds);
485 string_buff[0] = '\0';
487 if (summary.dfilter && disp_seconds > 0) {
488 g_snprintf(string_buff2, SUM_STR_MAX, "%.3f sec", disp_seconds);
490 string_buff2[0] = '\0';
492 if (summary.marked_count && marked_seconds > 0) {
493 g_snprintf(string_buff3, SUM_STR_MAX, "%.3f sec", marked_seconds);
495 string_buff3[0] = '\0';
497 if (string_buff[0] != '\0' || string_buff2[0] != '\0' || string_buff3[0] != '\0')
498 add_string_to_list(list, "Between first and last packet", string_buff, string_buff2, string_buff3);
500 /* Packets per second */
502 g_snprintf(string_buff, SUM_STR_MAX, "%.3f", summary.packet_count/seconds);
504 string_buff[0] = '\0';
506 if(summary.dfilter && disp_seconds > 0) {
507 g_snprintf(string_buff2, SUM_STR_MAX, "%.3f", summary.filtered_count/disp_seconds);
509 string_buff2[0] = '\0';
511 if(summary.marked_count && marked_seconds > 0) {
512 g_snprintf(string_buff3, SUM_STR_MAX, "%.3f", summary.marked_count/marked_seconds);
514 string_buff3[0] = '\0';
516 if (string_buff[0] != '\0' || string_buff2[0] != '\0' || string_buff3[0] != '\0')
517 add_string_to_list(list, "Avg. packets/sec", string_buff, string_buff2, string_buff3);
520 if (summary.packet_count > 1) {
521 g_snprintf(string_buff, SUM_STR_MAX, "%.3f bytes",
522 /* MSVC cannot convert from unsigned __int64 to float, so first convert to signed __int64 */
523 (float) ((gint64) summary.bytes)/summary.packet_count);
525 string_buff[0] = '\0';
527 if (summary.dfilter && summary.filtered_count > 1) {
528 g_snprintf(string_buff2, SUM_STR_MAX, "%.3f bytes",
529 /* MSVC cannot convert from unsigned __int64 to float, so first convert to signed __int64 */
530 (float) ((gint64) summary.filtered_bytes)/summary.filtered_count);
532 string_buff2[0] = '\0';
534 if (summary.marked_count > 1) {
535 g_snprintf(string_buff3, SUM_STR_MAX, "%.3f bytes",
536 /* MSVC cannot convert from unsigned __int64 to float, so first convert to signed __int64 */
537 (float) ((gint64) summary.marked_bytes)/summary.marked_count);
539 string_buff3[0] = '\0';
541 if (string_buff[0] != '\0' || string_buff2[0] != '\0' || string_buff3[0] != '\0')
542 add_string_to_list(list, "Avg. packet size", string_buff, string_buff2, string_buff3);
545 g_snprintf(string_buff, SUM_STR_MAX, "%" G_GINT64_MODIFIER "u", summary.bytes);
546 if (summary.dfilter && summary.filtered_count > 0) {
547 g_snprintf(string_buff2, SUM_STR_MAX, "%" G_GINT64_MODIFIER "u", summary.filtered_bytes);
549 string_buff2[0] = '\0';
551 if (summary.marked_count) {
552 g_snprintf(string_buff3, SUM_STR_MAX, "%" G_GINT64_MODIFIER "u", summary.marked_bytes);
554 string_buff3[0] = '\0';
556 if (string_buff[0] != '\0' || string_buff2[0] != '\0' || string_buff3[0] != '\0')
557 add_string_to_list(list, "Bytes", string_buff, string_buff2, string_buff3);
559 /* Bytes per second */
561 /* MSVC cannot convert from unsigned __int64 to float, so first convert to signed __int64 */
562 g_snprintf(string_buff, SUM_STR_MAX, "%.3f", ((gint64) summary.bytes)/seconds);
564 string_buff[0] = '\0';
566 if (summary.dfilter && disp_seconds > 0) {
567 /* MSVC cannot convert from unsigned __int64 to float, so first convert to signed __int64 */
568 g_snprintf(string_buff2, SUM_STR_MAX, "%.3f", ((gint64) summary.filtered_bytes)/disp_seconds);
570 string_buff2[0] = '\0';
572 if (summary.marked_count && marked_seconds > 0) {
573 /* MSVC cannot convert from unsigned __int64 to float, so first convert to signed __int64 */
574 g_snprintf(string_buff3, SUM_STR_MAX, "%.3f", ((gint64) summary.marked_bytes)/marked_seconds);
576 string_buff3[0] = '\0';
578 if (string_buff[0] != '\0' || string_buff2[0] != '\0' || string_buff3[0] != '\0')
579 add_string_to_list(list, "Avg. bytes/sec", string_buff, string_buff2, string_buff3);
581 /* MBit per second */
583 g_snprintf(string_buff, SUM_STR_MAX, "%.3f",
584 /* MSVC cannot convert from unsigned __int64 to float, so first convert to signed __int64 */
585 ((gint64) summary.bytes) * 8.0 / (seconds * 1000.0 * 1000.0));
587 string_buff[0] = '\0';
589 if (summary.dfilter && disp_seconds > 0) {
590 g_snprintf(string_buff2, SUM_STR_MAX, "%.3f",
591 /* MSVC cannot convert from unsigned __int64 to float, so first convert to signed __int64 */
592 ((gint64) summary.filtered_bytes) * 8.0 / (disp_seconds * 1000.0 * 1000.0));
594 string_buff2[0] = '\0';
596 if (summary.marked_count && marked_seconds > 0) {
597 g_snprintf(string_buff3, SUM_STR_MAX, "%.3f",
598 /* MSVC cannot convert from unsigned __int64 to float, so first convert to signed __int64 */
599 ((gint64) summary.marked_bytes) * 8.0 / (marked_seconds * 1000.0 * 1000.0));
601 string_buff3[0] = '\0';
603 if (string_buff[0] != '\0' || string_buff2[0] != '\0' || string_buff3[0] != '\0')
604 add_string_to_list(list, "Avg. MBit/sec", string_buff, string_buff2, string_buff3);
608 bbox = dlg_button_row_new(GTK_STOCK_CLOSE, GTK_STOCK_HELP, NULL);
609 gtk_container_add(GTK_CONTAINER(main_vb), bbox);
611 close_bt = g_object_get_data(G_OBJECT(bbox), GTK_STOCK_CLOSE);
612 window_set_cancel_button(sum_open_w, close_bt, window_cancel_button_cb);
614 help_bt = g_object_get_data(G_OBJECT(bbox), GTK_STOCK_HELP);
615 g_signal_connect(help_bt, "clicked", G_CALLBACK(topic_cb), (gpointer)HELP_STATS_SUMMARY_DIALOG);
617 gtk_widget_grab_focus(close_bt);
619 g_signal_connect(sum_open_w, "delete_event", G_CALLBACK(window_delete_event_cb), NULL);
621 gtk_widget_show_all(sum_open_w);
622 window_present(sum_open_w);