diff -ru ettercap-NG-0.7.3/src/ec_parser.c ettercap-NG-0.7.3.patched/src/ec_parser.c --- ettercap-NG-0.7.3/src/ec_parser.c 2004-07-20 11:53:53.000000000 +0200 +++ ettercap-NG-0.7.3.patched/src/ec_parser.c 2007-03-26 18:50:41.000000000 +0200 @@ -73,12 +73,16 @@ fprintf(stdout, " -t, --proto <proto> sniff only this proto (default is all)\n"); fprintf(stdout, "\nUser Interface Type:\n"); - fprintf(stdout, " -T, --text use text only GUI\n"); + fprintf(stdout, " -T, --text use text only UI\n"); fprintf(stdout, " -q, --quiet do not display packet contents\n"); fprintf(stdout, " -s, --script <CMD> issue these commands to the GUI\n"); - fprintf(stdout, " -C, --curses use curses GUI\n"); +#ifdef HAVE_NCURSES + fprintf(stdout, " -C, --curses use curses UI\n"); +#endif +#ifdef HAVE_GTK fprintf(stdout, " -G, --gtk use GTK+ GUI\n"); - fprintf(stdout, " -D, --daemon daemonize ettercap (no GUI)\n"); +#endif + fprintf(stdout, " -D, --daemon daemonize ettercap (no UI)\n"); fprintf(stdout, "\nLogging options:\n"); fprintf(stdout, " -w, --write <file> write sniffed data to pcapfile <file>\n"); @@ -173,6 +177,18 @@ { 0 , 0 , 0 , 0} }; + +#ifdef HAVE_GTK + if (strcmp(argv[0], "ettercap-gtk") == 0) + select_gtk_interface(); +#endif +#ifdef HAVE_NCURSES + if (strcmp(argv[0], "ettercap-curses") == 0) + select_curses_interface(); +#endif + if (strcmp(argv[0], "ettercap-text") == 0) + select_text_interface(); + for (c = 0; c < argc; c++) DEBUG_MSG("parse_options -- [%d] [%s]", c, argv[c]); @@ -215,11 +231,20 @@ break; case 'C': +#ifdef HAVE_NCURSES select_curses_interface(); +#else + fprintf(stdout, "\nncurses-interface not supported.\n\n"); + clean_exit(-1); +#endif break; - case 'G': +#ifdef HAVE_GTK select_gtk_interface(); +#else + fprintf(stdout, "\nGTK-Interface not supported.\n\n"); + clean_exit(-1); +#endif break; case 'D': @@ -429,8 +454,9 @@ if (GBL_OPTIONS->read && GBL_OPTIONS->mitm) FATAL_ERROR("Cannot use mitm attacks while reading from file"); - if (GBL_UI->init == NULL) + if (GBL_UI->init == NULL) { FATAL_ERROR("Please select an User Interface"); + } /* force text interface for only mitm attack */ if (GBL_OPTIONS->only_mitm) {