예제 #1
0
파일: detstats.c 프로젝트: rogerhu/dd-wrt
static void printdetails(struct ifcounts *ifcounts, WINDOW * win)
{
	wattrset(win, HIGHATTR);
	/* Print totals on the IP protocols */
	printstatrow_proto(win, 4, &ifcounts->total);
	printstatrow_proto(win, 5, &ifcounts->ipv4);
	printstatrow_proto(win, 6, &ifcounts->ipv6);
	printstatrow_proto(win, 7, &ifcounts->tcp);
	printstatrow_proto(win, 8, &ifcounts->udp);
	printstatrow_proto(win, 9, &ifcounts->icmp);
	printstatrow_proto(win, 10, &ifcounts->other);

	/* Print non-IP totals */

	printstatrow_proto(win, 11, &ifcounts->nonip);

	/* Broadcast totals */
	wmove(win, 14, 67);
	printlargenum(ifcounts->bcast.pc_packets, win);
	wmove(win, 15, 67);
	printlargenum(ifcounts->bcast.pc_bytes, win);

	/* Bad packet count */

	mvwprintw(win, 19, 68, "%8lu", ifcounts->bad.pc_packets);
}
예제 #2
0
파일: ifstats.c 프로젝트: ebichu/dd-wrt
static void printifentry(struct iflist *ptmp, WINDOW * win, unsigned int idx)
{
	unsigned int target_row;

	if ((ptmp->index < idx) || (ptmp->index > idx + (LINES - 5)))
		return;

	target_row = ptmp->index - idx;

	wattrset(win, STDATTR);
	wmove(win, target_row, 1);
	wprintw(win, "%s", ptmp->ifname);
	wattrset(win, HIGHATTR);
	wmove(win, target_row, 14 * COLS / 80);
	printlargenum(ptmp->total, win);
	wmove(win, target_row, 24 * COLS / 80);
	printlargenum(ptmp->iptotal, win);
	wmove(win, target_row, 34 * COLS / 80);
	printlargenum(ptmp->ip6total, win);
	wmove(win, target_row, 44 * COLS / 80);
	printlargenum(ptmp->noniptotal, win);
	wmove(win, target_row, 53 * COLS / 80);
	wprintw(win, "%7lu", ptmp->badtotal);
}
예제 #3
0
파일: hostmon.c 프로젝트: rogerhu/dd-wrt
static void printethent(struct ethtab *table, struct ethtabent *entry,
			unsigned int idx)
{
	unsigned int target_row;

	if ((entry->index < idx) || (entry->index > idx + LINES - 5))
		return;

	target_row = entry->index - idx;

	if (entry->type == 0) {
		wmove(table->tabwin, target_row, 1);
		wattrset(table->tabwin, STDATTR);

		if (entry->un.desc.linktype == ARPHRD_ETHER)
			wprintw(table->tabwin, "Ethernet");
		else if (entry->un.desc.linktype == ARPHRD_FDDI)
			wprintw(table->tabwin, "FDDI");

		wprintw(table->tabwin, " HW addr: %s", entry->un.desc.ascaddr);

		if (entry->un.desc.withdesc)
			wprintw(table->tabwin, " (%s)", entry->un.desc.desc);

		wprintw(table->tabwin, " on %s       ", entry->un.desc.ifname);

		entry->un.desc.printed = 1;
	} else {
		wattrset(table->tabwin, PTRATTR);
		wmove(table->tabwin, target_row, 1);
		waddch(table->tabwin, ACS_LLCORNER);

		wattrset(table->tabwin, HIGHATTR);

		/* Inbound traffic counts */

		wmove(table->tabwin, target_row, 2 * COLS / 80);
		printlargenum(entry->un.figs.inpcount, table->tabwin);
		wmove(table->tabwin, target_row, 12 * COLS / 80);
		printlargenum(entry->un.figs.inippcount, table->tabwin);
		wmove(table->tabwin, target_row, 22 * COLS / 80);
		printlargenum(entry->un.figs.inbcount, table->tabwin);

		/* Outbound traffic counts */

		wmove(table->tabwin, target_row, 40 * COLS / 80);
		printlargenum(entry->un.figs.outpcount, table->tabwin);
		wmove(table->tabwin, target_row, 50 * COLS / 80);
		printlargenum(entry->un.figs.outippcount, table->tabwin);
		wmove(table->tabwin, target_row, 60 * COLS / 80);
		printlargenum(entry->un.figs.outbcount, table->tabwin);
	}
}
예제 #4
0
파일: detstats.c 프로젝트: rogerhu/dd-wrt
static void printstatrow(WINDOW * win, int row, unsigned long long total,
		  unsigned long long btotal, unsigned long long total_in,
		  unsigned long long btotal_in, unsigned long long total_out,
		  unsigned long long btotal_out)
{
	wmove(win, row, 12);
	printlargenum(total, win);
	wmove(win, row, 23);
	printlargenum(btotal, win);
	wmove(win, row, 35);
	printlargenum(total_in, win);
	wmove(win, row, 46);
	printlargenum(btotal_in, win);
	wmove(win, row, 58);
	printlargenum(total_out, win);
	wmove(win, row, 69);
	printlargenum(btotal_out, win);
}