Text   |  XML   |  ReML   |   Visible Warnings:

Unused Value  at hostlist_table.c:794

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

init_hostlist_table_page

(/home/sate/Testcases/c/cve/wireshark-1.2.0/gtk/hostlist_table.c)expand/collapse
Show more  
 746  init_hostlist_table_page(hostlist_table *hosttable, GtkWidget *vbox, gboolean hide_ports, const char *table_name, const char *tap_name, const char *filter, tap_packet_cb packet_func)
 747  {
 748      guint i;
 749      column_arrows *col_arrows;
 750      GtkStyle *win_style;
 751      GtkWidget *column_lb;
 752      GString *error_string;
 753      char title[256];
 754   
 755      hosttable->num_columns=NUM_HOSTLIST_COLS;
 756      hosttable->default_titles[0]  = "Address";
 757      hosttable->default_titles[1]  = "Port";
 758      hosttable->default_titles[2]  = "Packets";
 759      hosttable->default_titles[3]  = "Bytes";
 760      hosttable->default_titles[4]  = "Tx Packets";
 761      hosttable->default_titles[5]  = "Tx Bytes";
 762      hosttable->default_titles[6]  = "Rx Packets";
 763      hosttable->default_titles[7]  = "Rx Bytes";
 764   
 765  #ifdef HAVE_GEOIP 
 766      for (i = 0; i < NUM_GEOIP_COLS; i++) {
 767          if (i < geoip_db_num_dbs()) {
 768              hosttable->default_titles[NUM_BUILTIN_COLS + i]  = geoip_db_name(i);
 769          } else {
 770              hosttable->default_titles[NUM_BUILTIN_COLS + i]  = "";
 771          }
 772      }
 773  #endif /* HAVE_GEOIP */
 774   
 775      if (strcmp(table_name, "NCP")==0) {
 776          hosttable->default_titles[1] = "Connection";
 777      }
 778   
 779      hosttable->has_ports=!hide_ports;
 780      hosttable->num_hosts = 0;
 781      hosttable->resolve_names=TRUE;
 782      hosttable->page_lb = NULL;
 783   
 784      g_snprintf(title, sizeof(title), "%s Endpoints", table_name);
 785      hosttable->name_lb = gtk_label_new(title);
 786      gtk_box_pack_start(GTK_BOX(vbox), hosttable->name_lb, FALSE, FALSE, 0);
 787   
 788      hosttable->scrolled_window=scrolled_window_new(NULL, NULL);
 789      gtk_box_pack_start(GTK_BOX(vbox), hosttable->scrolled_window, TRUE, TRUE, 0);
 790   
 791      hosttable->table=(GtkCList *)gtk_clist_new(NUM_HOSTLIST_COLS);
 792   
 793      col_arrows = (column_arrows *) g_malloc(sizeof(column_arrows) * NUM_HOSTLIST_COLS);
 794      win_style = gtk_widget_get_style(hosttable->scrolled_window);
 795      for (i = 0; i < NUM_HOSTLIST_COLS; i++) {
 796          col_arrows[i].table = gtk_table_new(2, 2, FALSE);
 797          gtk_table_set_col_spacings(GTK_TABLE(col_arrows[i].table), 5);
 798          column_lb = gtk_label_new(hosttable->default_titles[i]);
 799          gtk_table_attach(GTK_TABLE(col_arrows[i].table), column_lb, 0, 1, 0, 2, GTK_SHRINK, GTK_SHRINK, 0, 0);
 800          gtk_widget_show(column_lb);
 801   
 802          col_arrows[i].ascend_pm = xpm_to_widget((const char **) clist_ascend_xpm);
 803          gtk_table_attach(GTK_TABLE(col_arrows[i].table), col_arrows[i].ascend_pm, 1, 2, 1, 2, GTK_SHRINK, GTK_SHRINK, 0, 0);
 804          col_arrows[i].descend_pm = xpm_to_widget((const char **) clist_descend_xpm);
 805          gtk_table_attach(GTK_TABLE(col_arrows[i].table), col_arrows[i].descend_pm, 1, 2, 0, 1, GTK_SHRINK, GTK_SHRINK, 0, 0);
 806          /* make total frames be the default sort order */
 807          if (i == 4) {
 808              gtk_widget_show(col_arrows[i].descend_pm);
 809          }
 810          gtk_clist_set_column_widget(GTK_CLIST(hosttable->table), i, col_arrows[i].table);
 811          gtk_widget_show(col_arrows[i].table);
 812      }
 813      gtk_clist_column_titles_show(GTK_CLIST(hosttable->table));
 814   
 815      gtk_clist_set_compare_func(hosttable->table, hostlist_sort_column);
 816      gtk_clist_set_sort_column(hosttable->table, 4);
 817      gtk_clist_set_sort_type(hosttable->table, GTK_SORT_DESCENDING);
 818   
 819      for (i = 0; i < NUM_HOSTLIST_COLS; i++) {
 820          gtk_clist_set_column_auto_resize(hosttable->table, i, TRUE);
 821      }
 822   
 823      gtk_clist_set_shadow_type(hosttable->table, GTK_SHADOW_IN);
 824      gtk_clist_column_titles_show(hosttable->table);
 825      gtk_container_add(GTK_CONTAINER(hosttable->scrolled_window), (GtkWidget *)hosttable->table);
 826   
 827      g_signal_connect(hosttable->table, "click-column", G_CALLBACK(hostlist_click_column_cb), col_arrows);
 828   
 829      hosttable->num_hosts=0;
 830      hosttable->hosts=NULL;
 831   
 832      /* hide srcport and dstport if we don't use ports */
 833      if(hide_ports){
 834          gtk_clist_set_column_visibility(hosttable->table, 1, FALSE);
 835      }
 836   
 837  #ifdef HAVE_GEOIP 
 838      /* Hide all of the GeoIP columns initially */
 839      for (i = 0; i < NUM_GEOIP_COLS; i++) {
 840          gtk_clist_set_column_visibility(hosttable->table, NUM_BUILTIN_COLS + i, FALSE);
 841      }
 842  #endif /* HAVE_GEOIP */
 843   
 844      /* create popup menu for this table */
 845      hostlist_create_popup_menu(hosttable);
 846   
 847      /* register the tap and rerun the taps on the packet list */
 848      error_string=register_tap_listener(tap_name, hosttable, filter, reset_hostlist_table_data_cb, packet_func, draw_hostlist_table_data_cb);
 849      if(error_string){
 850          simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK, "%s", error_string->str);
 851          g_string_free(error_string, TRUE);
 852          g_free(hosttable);
 853          return FALSE;
 854      }
 855   
 856      return TRUE;
 857  }
Show more  




Change Warning 4122.30842 : Unused Value

Priority:
State:
Finding:
Owner:
Note: