Example #1
0
int gc_open(void) {
	if ((data = malloc(maxTTL * sizeof(int))))
		memset(data, -1, maxTTL * sizeof(int));
	else {
		fprintf(stderr, "gc_open: malloc() failed\n");
		return 0;
	}

	timeout = POS_ROUND(WaitTime * USECONDS);
	gettimeofday(&lasttime, NULL);

	params.graph_type = (args[ARG_GRAPH_TYPE] > 0) ? args[ARG_GRAPH_TYPE] : 0;
	params.period = (args[ARG_PERIOD] > 0) ? args[ARG_PERIOD] : 0;
	params.enable_legend = args[ARG_LEGEND] ? 1 : 0;
	params.enable_multipath = (args[ARG_MULTIPATH] > 0) ? 1 : 0;
	params.jitter_graph = (args[ARG_JITTER_GRAPH] > 0) ? 1 : 0;
	params.cols_max = SAVED_PINGS;
	params.path_max = MAXPATH;
	params.label_max = MAXLABELS;

	if (!cr_open(&params))
		return 0;

	if (params.enable_legend) {
		if (params.jitter_graph == 1)
			strcpy(fld_active, "DR AGJMXI");
		mtr_curses_data_fields(legend_hd[LEGEND_HEADER_STATIC]);
		curses_cols = cr_recalc(hostinfo_max);
		mtr_curses_init();
	}

	return 1;
}
Example #2
0
void mtr_curses_open(void)
{
  initscr();
  raw();
  noecho(); 

  mtr_curses_init();
  mtr_curses_redraw();
}
Example #3
0
void mtr_curses_open(void)
{
  initscr();
  raw();
  noecho(); 
  start_color();
  int i;
  for (i = 0; i < 8; i++)
      init_pair(i+1, i, 0);

  mtr_curses_init();
  mtr_curses_redraw();
}
Example #4
0
void mtr_curses_open(void)
{
  initscr();
  raw();
  noecho(); 
  start_color();
#ifdef HAVE_USE_DEFAULT_COLORS
  use_default_colors();
#endif
  int i;
  for (i = 0; i < 8; i++)
      init_pair(i+1, i, 0);

  mtr_curses_init();
  mtr_curses_redraw();
}