Text   |  XML   |  ReML   |   Visible Warnings:

Unused Value  at prefs_capture.c:189

No properties have been set. | edit properties
Jump to warning location ↓ warning details...
Show Events | Options

capture_prefs_show

(/home/sate/Testcases/c/cve/wireshark-1.2.0/gtk/prefs_capture.c)expand/collapse
Show more  
 90  GtkWidget*
 91  capture_prefs_show(void)
 92  {
 93          GtkWidget       *main_tb, *main_vb;
 94          GtkWidget       *if_cb, *if_lb, *promisc_cb, *pcap_ng_cb, *sync_cb, *auto_scroll_cb, *show_info_cb;
 95          GtkWidget       *ifopts_lb, *ifopts_bt;
 96          GList           *if_list, *combo_list;
 97          int             err;
 98          int             row = 0;
 99          GtkTooltips     *tooltips = gtk_tooltips_new();
 100   
 101          /* Main vertical box */
 102          main_vb = gtk_vbox_new(FALSE, 7);
 103          gtk_container_set_border_width(GTK_CONTAINER(main_vb), 5);
 104   
 105          /* Main table */
 106          main_tb = gtk_table_new(CAPTURE_TABLE_ROWS, 2, FALSE);
 107          gtk_box_pack_start(GTK_BOX(main_vb), main_tb, FALSE, FALSE, 0);
 108          gtk_table_set_row_spacings(GTK_TABLE(main_tb), 10);
 109          gtk_table_set_col_spacings(GTK_TABLE(main_tb), 15);
 110          gtk_widget_show(main_tb);
 111   
 112          /* Default device */
 113          if_lb = gtk_label_new("Default interface:");
 114          gtk_table_attach_defaults(GTK_TABLE(main_tb), if_lb, 0, 1, row, row+1);
 115          gtk_misc_set_alignment(GTK_MISC(if_lb), 1.0f, 0.5f);
 116          gtk_widget_show(if_lb);
 117   
 118          if_cb = gtk_combo_new();
 119          /*
 120           * XXX - what if we can't get the list?
 121           */
 122          if_list = capture_interface_list(&err, NULL);
 123          combo_list = build_capture_combo_list(if_list, FALSE);
 124          free_interface_list(if_list);
 125          if (combo_list != NULL) {
 126                  gtk_combo_set_popdown_strings(GTK_COMBO(if_cb), combo_list);
 127                  free_capture_combo_list(combo_list);
 128          }
 129          if (prefs.capture_device)
 130                  gtk_entry_set_text(GTK_ENTRY(GTK_COMBO(if_cb)->entry),
 131                      prefs.capture_device);
 132          gtk_table_attach_defaults(GTK_TABLE(main_tb), if_cb, 1, 2, row, row+1);
 133          gtk_tooltips_set_tip(tooltips, GTK_COMBO(if_cb)->entry,
 134              "The default interface to be captured from.", NULL);
 135          gtk_widget_show(if_cb);
 136          g_object_set_data(G_OBJECT(main_vb), DEVICE_KEY, if_cb);
 137          row++;
 138   
 139          /* Interface properties */
 140          ifopts_lb = gtk_label_new("Interfaces:");
 141          gtk_table_attach_defaults(GTK_TABLE(main_tb), ifopts_lb, 0, 1, row, row+1);
 142          gtk_misc_set_alignment(GTK_MISC(ifopts_lb), 1.0f, 0.5f);
 143          gtk_widget_show(ifopts_lb);
 144   
 145          ifopts_bt = gtk_button_new_from_stock(WIRESHARK_STOCK_EDIT);
 146          gtk_tooltips_set_tip(tooltips, ifopts_bt,
 147              "Open a dialog box to set various interface options.", NULL);
 148          g_signal_connect(ifopts_bt, "clicked", G_CALLBACK(ifopts_edit_cb), NULL);
 149          gtk_table_attach_defaults(GTK_TABLE(main_tb), ifopts_bt, 1, 2, row, row+1);
 150          row++;
 151   
 152          /* Promiscuous mode */
 153          promisc_cb = create_preference_check_button(main_tb, row++,
 154              "Capture packets in promiscuous mode:", NULL,
 155              prefs.capture_prom_mode);
 156          gtk_tooltips_set_tip(tooltips, promisc_cb,
 157              "Usually a network card will only capture the traffic sent to its own network address. "
 158              "If you want to capture all traffic that the network card can \"see\", mark this option. "
 159              "See the FAQ for some more details of capturing packets from a switched network.", NULL);
 160          g_object_set_data(G_OBJECT(main_vb), PROM_MODE_KEY, promisc_cb);
 161   
 162          /* Pcap-NG format */
 163          pcap_ng_cb = create_preference_check_button(main_tb, row++,
 164              "Capture packets in pcap-ng format:", NULL,
 165              prefs.capture_pcap_ng);
 166          gtk_tooltips_set_tip(tooltips, pcap_ng_cb,
 167               "Capture packets in the next-generation capture file format. "
 168               "This is still experimental.", NULL);
 169          g_object_set_data(G_OBJECT(main_vb), PCAP_NG_KEY, pcap_ng_cb);
 170   
 171          /* Real-time capture */
 172          sync_cb = create_preference_check_button(main_tb, row++,
 173              "Update list of packets in real time:", NULL,
 174              prefs.capture_real_time);
 175          gtk_tooltips_set_tip(tooltips, sync_cb,
 176          "Update the list of packets while capture is in progress. "
 177          "Don't use this option if you notice packet drops.", NULL);
 178          g_object_set_data(G_OBJECT(main_vb), CAPTURE_REAL_TIME_KEY, sync_cb);
 179   
 180          /* Auto-scroll real-time capture */
 181          auto_scroll_cb = create_preference_check_button(main_tb, row++,
 182              "Automatic scrolling in live capture:", NULL,
 183              prefs.capture_auto_scroll);
 184          gtk_tooltips_set_tip(tooltips, auto_scroll_cb,
 185          "Automatic scrolling of the packet list while live capture is in progress. ", NULL);
 186          g_object_set_data(G_OBJECT(main_vb), AUTO_SCROLL_KEY, auto_scroll_cb);
 187   
 188          /* Show capture info dialog */
 189          show_info_cb = create_preference_check_button(main_tb, row++,
 190              "Hide capture info dialog:", NULL,
 191              !prefs.capture_show_info);
 192          gtk_tooltips_set_tip(tooltips, show_info_cb,
 193              "Hide the capture info dialog while capturing. ", NULL);
 194          g_object_set_data(G_OBJECT(main_vb), SHOW_INFO_KEY, show_info_cb);
 195   
 196          /* Show 'em what we got */
 197          gtk_widget_show_all(main_vb);
 198   
 199          return(main_vb);
 200  }
Show more  




Change Warning 4199.30609 : Unused Value

Priority:
State:
Finding:
Owner:
Note: