コード例 #1
0
ファイル: tcptable.c プロジェクト: josarlo84/iptraf
void init_tcp_table(struct tcptable *table)
{
	int i;

	table->bmaxy = LINES * 0.6;	/* 60% of total screen */
	table->imaxy = table->bmaxy - 2;

	table->borderwin = newwin(table->bmaxy, COLS, 1, 0);
	table->borderpanel = new_panel(table->borderwin);

	wattrset(table->borderwin, BOXATTR);
	tx_box(table->borderwin, ACS_VLINE, ACS_HLINE);
	mvwprintw(table->borderwin, 0, 1, " TCP Connections (Source Host:Port) ");

	setlabels(table->borderwin, 0);	/* initially use mode 0 */

	mvwprintw(table->borderwin, 0, 65 * COLS / 80, " Flag ");
	mvwprintw(table->borderwin, 0, 70 * COLS / 80, " Iface ");
	update_panels();
	doupdate();
	table->ifnamew = COLS - (70 * COLS / 80) - 3;
	if (table->ifnamew < 7)
		table->ifnamew = 7;
	if (table->ifnamew > IFNAMSIZ)
		table->ifnamew = IFNAMSIZ;

	table->head = table->tail = NULL;
	table->firstvisible = table->lastvisible = NULL;
	table->tcpscreen = newwin(table->imaxy, COLS - 2, 2, 1);
	table->tcppanel = new_panel(table->tcpscreen);
	table->closedentries = table->closedtail = NULL;
	wattrset(table->tcpscreen, BOXATTR);
	tx_colorwin(table->tcpscreen);
	table->lastpos = 0;
	table->count = 0;

	wtimeout(table->tcpscreen, -1);
	tx_stdwinset(table->tcpscreen);
	print_tcp_num_entries(table);

	/* 
	 * Initialize hash table to nulls
	 */

	for (i = 0; i <= ENTRIES_IN_HASH_TABLE - 1; i++) {
		table->hash_table[i] = NULL;
		table->hash_tails[i] = NULL;
	}
	table->barptr = NULL;
	table->baridx = 0;
}
コード例 #2
0
ファイル: tcptable.c プロジェクト: josarlo84/iptraf
void refreshtcpwin(struct tcptable *table, unsigned int idx, int mode)
{
	struct tcptableent *ptmp;

	setlabels(table->borderwin, mode);
	wattrset(table->tcpscreen, STDATTR);
	tx_colorwin(table->tcpscreen);
	ptmp = table->firstvisible;

	while ((ptmp != NULL) && (ptmp->prev_entry != table->lastvisible)) {
		printentry(table, ptmp, idx, mode);
		ptmp = ptmp->next_entry;
	}

	wmove(table->borderwin, table->bmaxy - 1, 1);

	print_tcp_num_entries(table);

	update_panels();
	doupdate();
}
コード例 #3
0
ファイル: muse_tui.cpp プロジェクト: dyne/MuSE
void muse_tui::start()
{
	int i;

	setlabels();
	//setdialogs();

	for (i=0;i< MAX_CHANNELS;i++)
	{
		if (i%2 == 0) { //tutti a sinistraaaa ehehhhhh
			chan[i].init (f.screen(),1,i);
		} else { //e tutti a destra ohhohhhhh
			chan[i].init (f.screen(), f.width()/2, i);
		}
	}


	f.refresh();
	chan[0].show();
	chan[1].show();
	setactivechan (0);
	userinput();
}
コード例 #4
0
ファイル: muse_tui.cpp プロジェクト: dyne/MuSE
void
muse_tui::refresh ()
{
  //int i;
  setlabels ();
  /*
  for (i = 0; i < MAX_CHANNELS; i++)
    {
      if (i % 2 == 0)		//tutti a sinistraaaa ehehhhhh
	chan[i].init (f.screen (), 1, i);
      else			//e tutti a destra ohhohhhhh
	chan[i].init (f.screen (), f.width () / 2, i);
    }
    */

  f.refresh ();
  setactivechan (activechan);
  /*
  chan[0].show ();
  chan[1].show ();
  */
  // setactivechan (0);
}