Huge thanks to our Platinum Members Endace and LiveAction,
and our Silver Member Veeam, for supporting the Wireshark Foundation and project.

Ethereal-dev: [Ethereal-dev] [PATCH] Add interface labels to main and capture window

Note: This archive is from the project's previous web site, ethereal.com. This list is no longer active.

From: Jon Oberheide <jon@xxxxxxxxxxxxx>
Date: Mon, 12 Apr 2004 22:30:10 -0400
<< Patch Attached >>

Regards,
Jon Oberheide
jon@xxxxxxxxxxxxx


On Mon, 2004-04-12 at 13:57, Michael Tuexen wrote:
> Dear all,
> 
> I often running multiple instances of Ethereal sniffing on different 
> interfaces.
> Therefore it would be very helpful to have on the main window and on 
> the capture
> window an indication on which interface packets are/were captured. Once 
> it is saved
> to a file this information is not needed anymore.
> 
> Any thoughts, anyone interested in implementing it?
> 
> Best regards
> Michael 
> 
> _______________________________________________
> Ethereal-dev mailing list
> Ethereal-dev@xxxxxxxxxxxx
> http://www.ethereal.com/mailman/listinfo/ethereal-dev
diff -ur ethereal-0.10.3.old/capture.c ethereal-0.10.3.new/capture.c
--- ethereal-0.10.3.old/capture.c	2004-03-25 17:21:15.000000000 -0500
+++ ethereal-0.10.3.new/capture.c	2004-04-12 22:16:32.908535200 -0400
@@ -1756,7 +1756,7 @@
   /* start capture info dialog */
   capture_ui.callback_data  = &ld;
   capture_ui.counts         = &ld.counts;
-  capture_info_create(&capture_ui);
+  capture_info_create(&capture_ui, cfile.iface);
 
   start_time = time(NULL);
   upd_time = time(NULL);
diff -ur ethereal-0.10.3.old/capture.h ethereal-0.10.3.new/capture.h
--- ethereal-0.10.3.old/capture.h	2004-03-17 23:05:31.000000000 -0500
+++ ethereal-0.10.3.new/capture.h	2004-04-12 22:12:05.010261928 -0400
@@ -101,7 +101,8 @@
 
 /* create the capture info dialog */
 extern void capture_info_create(
-capture_info    *cinfo);
+capture_info    *cinfo,
+gchar           *iface);
 
 /* Update the capture info counters in the dialog */
 extern void capture_info_update(
diff -ur ethereal-0.10.3.old/file.c ethereal-0.10.3.new/file.c
--- ethereal-0.10.3.old/file.c	2004-03-10 09:53:02.000000000 -0500
+++ ethereal-0.10.3.new/file.c	2004-04-12 21:52:05.851561760 -0400
@@ -529,6 +529,7 @@
 cf_start_tail(char *fname, gboolean is_tempfile, capture_file *cf)
 {
   int     err;
+  gchar *capture_msg;
 
   err = cf_open(fname, is_tempfile, cf);
   if (err == 0) {
@@ -540,7 +541,9 @@
        packets (yes, I know, we don't have any *yet*). */
     set_menus_for_captured_packets(TRUE);
 
-    statusbar_push_file_msg(" <live capture in progress>");
+    capture_msg = g_strdup_printf(" %s: <live capture in progress>", cf->iface);
+
+    statusbar_push_file_msg(capture_msg);
   }
   return err;
 }
diff -ur ethereal-0.10.3.old/gtk/capture_info_dlg.c ethereal-0.10.3.new/gtk/capture_info_dlg.c
--- ethereal-0.10.3.old/gtk/capture_info_dlg.c	2004-03-17 23:05:34.000000000 -0500
+++ ethereal-0.10.3.new/gtk/capture_info_dlg.c	2004-04-12 22:12:40.321893744 -0400
@@ -84,12 +84,14 @@
 /* create the capture info dialog */
 /* will keep pointers to the fields in the counts parameter */
 void capture_info_create(
-capture_info    *cinfo)
+capture_info    *cinfo,
+gchar           *iface)
 {
   unsigned int      i;
   GtkWidget         *main_vb, *stop_bt, *counts_tb;
   GtkWidget         *counts_fr, *running_tb, *running_label, *bbox;
   capture_info_ui_t *info;
+  gchar             *cap_w_title;
 
   info = g_malloc0(sizeof(capture_info_ui_t));
   info->counts[0].title = "Total";
@@ -117,7 +119,9 @@
   info->counts[11].title = "Other";
   info->counts[11].value_ptr = &(cinfo->counts->other);
 
-  info->cap_w = dlg_window_new("Ethereal: Capture");
+  cap_w_title = g_strdup_printf("Ethereal: Capture - Interface %s", iface);
+
+  info->cap_w = dlg_window_new(cap_w_title);
   gtk_window_set_modal(GTK_WINDOW(info->cap_w), TRUE);
 
   /* Container for capture display widgets */