void display_open(void) { switch(DisplayMode) { case DisplayReport: report_open(); break; case DisplayTXT: txt_open(); break; case DisplayXML: xml_open(); break; case DisplayJSON: json_open(); break; case DisplayCSV: csv_open(); break; case DisplayCurses: mtr_curses_open(); #ifdef IPINFO if (ipinfo_no >= 0) asn_open(); #endif break; case DisplaySplit: split_open(); break; case DisplayGTK: gtk_open(); break; } }
void ii_parsearg(char *arg) { if (!hash) asn_open(); char* args[II_ITEM_MAX + 1]; memset(args, 0, sizeof(args)); if (arg) { args[0] = strdup(arg); split_with_sep((char**)&args, II_ITEM_MAX + 1, II_ARGS_SEP); int no = atoi(args[0]); if ((no > 0) && (no <= (sizeof(origins)/sizeof(origins[0])))) origin_no = no - 1; } int i, j; for (i = 1, j = 0; (j < II_ITEM_MAX) && (i <= II_ITEM_MAX); i++) if (args[i]) { int no = atoi(args[i]); if ((no > 0) && (no <= origins[origin_no].fields)) ipinfo_no[j++] = no - 1; } for (i = j; i < II_ITEM_MAX; i++) ipinfo_no[i] = -1; if (ipinfo_no[0] < 0) ipinfo_no[0] = 0; if (args[0]) free(args[0]); enable_ipinfo = 1; IIDEBUG_MSG((LOG_INFO, "ii origin: \"%s\" \"%s\"", origins[origin_no].ip4zone, origins[origin_no].ip6zone)); }
void ii_action(int action_asn) { if (!hash) asn_open(); if (ipinfo_no[0] >= 0) { if (action_asn) enable_ipinfo = !enable_ipinfo; else { int i; for (i = 0; (i < II_ITEM_MAX) && (ipinfo_no[i] >= 0); i++) { ipinfo_no[i]++; if (!i) enable_ipinfo = (ipinfo_no[0] < ipinfo_max) ? 1 : 0; if (ipinfo_no[i] >= ipinfo_max) ipinfo_no[i] = 0; } } } else // init ii_parsearg(NULL); }