/** * print_tcp_stat_screen() * ------------------- * displays the main background screen **/ void print_tcp_stat_screen(WINDOW ** statwin, PANEL ** statpanel, int card, char *iface) { if (GUI_DEBUG) fprintf(stderr,"making overall window\n"); /** make the overall wireless traffic monitor box window **/ *statwin = newwin(LINES - 2, COLS, 1, 0); *statpanel = new_panel(*statwin); stdwinset(*statwin); wtimeout(*statwin, -1); wattrset(*statwin, BOXATTR); colorwin(*statwin); box(*statwin, ACS_VLINE, ACS_HLINE); wmove(*statwin, 0, 1); if (card == AIRONET) wprintw(*statwin, " TCP Performance Analysis: listening using Cisco Aironet (%s) ", iface); else if (card == PRISMII) wprintw(*statwin, " TCP Performance Analysis: listening using PrismII-compatible (%s) ", iface); else if (card == HOSTAP) wprintw(*statwin, " TCP Performance Analysis: listening using HostAP driver (%s) ", iface); else if (card == HERMES) wprintw(*statwin, " TCP Performance Analysis: listening using Hermes-compatible (%s) ", iface); else if (card == WLANNG) wprintw(*statwin, " TCP Performance Analysis: listening using Wlan-ng driver (%s) ", iface); wattrset(*statwin, STDATTR); update_panels(); doupdate(); }
void initfields(struct FIELDLIST *list, int leny, int lenx, int begy, int begx) { list->list = NULL; list->fieldwin = newwin(leny, lenx, begy, begx); list->fieldpanel = new_panel(list->fieldwin); stdwinset(list->fieldwin); wtimeout(list->fieldwin, -1); wattrset(list->fieldwin, STDATTR); colorwin(list->fieldwin); update_panels(); doupdate(); }
void start_ids_mon(char *iface) { WINDOW *statwin; PANEL *statpanel; WINDOW *overallwin; PANEL *overallpanel; WINDOW *helpwin; PANEL *helppanel; /** stat display information **/ int stat_page = 0; int ch; int exitloop; int paused = 0; ids_t *ids_info = NULL; MAX_STAT_ROW = LINES * 0.6 - 2; overallwin = newwin(LINES -2, COLS, 1, 0); overallpanel = new_panel(overallwin); stdwinset(overallwin); wtimeout(overallwin, -1); wattrset(overallwin, BOXATTR); colorwin(overallwin); box(overallwin, ACS_VLINE, ACS_HLINE); /** make the ids list based on mac addresses **/ statwin = newwin(LINES * 0.6, COLS, 1, 0); statpanel = new_panel(statwin); stdwinset(statwin); wtimeout(statwin, -1); wattrset(statwin, BOXATTR); colorwin(statwin); box(statwin, ACS_VLINE, ACS_HLINE); wmove(statwin, 0, 1); wprintw(statwin, " IDS Statistics for %s ", iface); print_ids_labels(statwin); print_ids_details(statwin, NULL, 0); /** make ids help window **/ helpwin = newwin(LINES * 0.4 - 1, COLS, LINES * 0.6 + 1, 0); helppanel = new_panel(helpwin); wattrset(helpwin, BOXATTR); colorwin(helpwin); box(helpwin, ACS_VLINE, ACS_HLINE); print_help_win(helpwin); /** make the bottom key binding panel **/ move(LINES - 1, 1); scrollkeyhelp(); stdexitkeyhelp(); update_panels(); doupdate(); leaveok(statwin, TRUE); exitloop = 1; /** * Data-gathering loop */ while(!exitloop){ ch = ERR; if (check_for_keystroke() != ERR) ch = wgetch(statwin); if (ch != ERR) { switch (ch) { case KEY_UP: if (stat_page > 0){ stat_page --; colorwin(statwin); } break; case KEY_DOWN: if (((stat_page +1) * MAX_STAT_ROW) < ids_info->node_count){ stat_page ++; colorwin(statwin); } break; case KEY_PPAGE: case '-': //scroll_nodewin(nodewin, SCROLLDOWN); // pageethwin(nodewin, SCROLLDOWN); break; case KEY_NPAGE: case ' ': //scroll_nodewin(nodewin, SCROLLUP); // pageethwin(nodewin, SCROLLUP); break; case 'p': case 'P': switch (paused) { case 0: paused = 1; break; case 1: paused = 0; break; } // markactive(curwin, nodeborder, paused); update_panels(); doupdate(); break; case 12: case 'l': case 'L': refresh_screen(); break; case 'Q': case 'q': case 'X': case 'x': case 24: case 27: exitloop = 1; break; default: break; } } if (!paused){ // blah do stuff print_ids_details(statwin, ids_info, stat_page); } } // end loop del_panel(statpanel); delwin(statwin); del_panel(helppanel); delwin(helpwin); del_panel(overallpanel); delwin(overallwin); update_panels(); doupdate(); }