ethstatus-0.4.3ubuntu1/0000775000000000000000000000000011634124770011763 5ustar ethstatus-0.4.3ubuntu1/ethstatus.c0000664000000000000000000006027010515773664014171 0ustar /*************************************************************************** ethstatus.c - description begin : Mar 13 1999 original author : Gabriel Montenegro current maintainer : Christoph Haas *************************************************************************** * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the Free Software * * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, * * USA. * * * ***************************************************************************/ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "ethstatus.h" /*-----------------------------------------------------------------------* * IP_ADDRESS - Gets local IP address * *-----------------------------------------------------------------------*/ void ip_address(int display) { struct ifreq ifr; struct sockaddr_in *skt; if((eth_s = socket(AF_INET, SOCK_DGRAM, 0)) < 0) { perror("socket"); exit(0); } strcpy(ifr.ifr_name, interface); if(ioctl(eth_s, SIOCGIFADDR, &ifr) < 0); skt = (struct sockaddr_in*)&ifr.ifr_addr; if(skt->sin_addr.s_addr) stats.ip_addr_rtrn = inet_ntoa(skt->sin_addr); else stats.ip_addr_rtrn = "Unknown"; if(display) { chcolor(colors.data[0], colors.data[1]); mvprintw(17, 27, "%s", stats.ip_addr_rtrn); refresh(); } } /*-----------------------------------------------------------------------* * CHECK_EMAIL - Check for new emails * *-----------------------------------------------------------------------*/ void check_email(void) { FILE *email_box; int rtrn = 0; char location[128], buf[128]; sprintf(location, MAIL_PATH "%s", stats.user_box); if(!stat(location, &st)) rtrn = st.st_size; stats.email = 0; chcolor(colors.data[0], colors.data[1]); if(rtrn){ if((email_box = fopen(location, "r"))) { while(!feof(email_box)) { fgets(buf, 128, email_box); if(!strncmp(buf, "From ", 5)) stats.email++; } if(stats.email < 10) mvprintw(17, 65, "0%d ", stats.email); else mvprintw(17, 65, "%d ", stats.email); fclose(email_box); } else mvprintw(17, 65, "Can't check"); } else mvprintw(17, 65, "00 "); refresh(); } /*-----------------------------------------------------------------------* * CENTER - Put a string in center * *-----------------------------------------------------------------------*/ void center(short int line, char *strg, ...) { short int where; char *final; va_list trans; final = malloc(80); va_start(trans, strg); (void)vsnprintf(final, 80, strg, trans); va_end(trans); where = (int)(40 - (strlen(final) / 2)); if(line != 0 && line != 24) { move(line, 20); hline(32, 50); } mvprintw(line, where, "%s",final); free(final); } /*-----------------------------------------------------------------------* * IS_ONLINE - Check if the connection is active * *-----------------------------------------------------------------------*/ int is_online(short int force, short int only_check) { int rtrn = 0; char check[256], red_tmp[256], *tmp; FILE *routefile; char b_rx[32], b_tx[32], e_rx[32], e_tx[32], p_rx[32], p_tx[32]; if((routefile = fopen(PATH_PROC_NET_DEV, "r")) == NULL) { sprintf(red_tmp, "Error! Unable to open %s\n" "Check in your Kernel Configuration if /proc filesystem" " is supported\n\n", PATH_PROC_NET_DEV); close_eths(red_tmp); } while(!feof(routefile)) { fgets(check, 256, routefile); if(strstr(check, interface)){ tmp=check; while(*tmp!=':') tmp++; tmp++; sscanf(tmp, "%s %s %s %s %s %s %s %s %s %s %s", b_rx, p_rx, e_rx, red_tmp, red_tmp, red_tmp, red_tmp, red_tmp, b_tx, p_tx, e_tx); stats.tx_packets[0] = (double)atof(p_tx); stats.tx_bytes[0] = (double)atof(b_tx); stats.tx_errors[0] = (double)atoi(e_tx); stats.rx_packets[0] = (double)atof(p_rx); stats.rx_bytes[0] = (double)atof(b_rx); stats.rx_errors[0] = (double)atoi(e_rx); online = rtrn = 1; break; } } fclose(routefile); /* LED POWER ON/OFF */ if(!only_check) { if(rtrn) { if(!con || (force && con)){ chcolor(colors.power_led[0],colors.power_led[1]); move(12, 10); hline(CHAR,3); con = 1; discon = 0; refresh(); } } else{ if(!discon || (force && discon)) { chcolor(colors.power_led[2], colors.power_led[3]); move(12, 10); hline(CHAR, 3); con = online = 0; discon = 1; refresh(); } } } return rtrn; } /*-----------------------------------------------------------------------* * UPDATE_INFO - Puts TX/RX Packets, Bytes, Erros on the screen * *-----------------------------------------------------------------------*/ void update_info(void) { chcolor(colors.data[0] ,colors.data[1]); mvprintw(20, 27, "%.0f", stats.rx_packets[0]); mvprintw(20, 65, "%.0f", stats.tx_packets[0]); mvprintw(22, 27, "%ld", stats.rx_errors[0]); mvprintw(22, 65, "%ld", stats.tx_errors[0]); /* Calculate the measures automagically */ chcolor(colors.labels[0], colors.labels[1]); autoscale(autoscalebytes, stats.rx_bytes[0]); mvprintw(21, 6, "Received: "); chcolor(colors.data[0], colors.data[1]); mvprintw(21, 27, "%sB", autoscalebytes); chcolor(colors.labels[0], colors.labels[1]); autoscale(autoscalebytes, stats.tx_bytes[0]); mvprintw(21,41, "Transmitted: "); chcolor(colors.data[0], colors.data[1]); mvprintw(21, 65, "%sB", autoscalebytes); } /*-------------------------------------------------------------------------* * CLEAR_INFO - Clear TX/RX Packets, Bytes, Erros... * *-------------------------------------------------------------------------*/ void clear_info(void) { chcolor(colors.background ,0); mvprintw(19, 65, " "); mvprintw(19, 27, " "); mvprintw(20, 27, " "); mvprintw(20, 65, " "); mvprintw(22, 27, " "); mvprintw(22, 65, " "); mvprintw(21, 27, " "); mvprintw(21, 65, " "); mvprintw(16, 22, " "); mvprintw(17, 27, " "); } /*-----------------------------------------------------------------------* * DO_EXIT * *-----------------------------------------------------------------------*/ void do_exit(int x, short int line) { fprintf(stderr, "\n\nEthStatus-v%s - %s", VERSION,AUTHOR); /* if(!x) fprintf(stderr, "\n%s: Have no value in line %d\n\n", RC_FILENAME, line); else fprintf(stderr, "\n%s contains an invalid value on line %d.\n\n", RC_FILENAME, line); */ fprintf(stdout, "Exiting...\n\n"); exit(0); } /*-----------------------------------------------------------------------* * OPT_ANALISER - For cfgs files * *-----------------------------------------------------------------------*/ char *opt_analiser(char *in) { char real[256], temp[256], *rt; short int a, value = 0; bzero(temp, strlen(in)); sprintf(temp, "%s", in); bzero(real, strlen(real)); for(a = 0; a < strlen(temp)-1; a++){ switch(temp[a]) { case '\t': real[a] = '\0'; break; case '#': value++; real[a] = '\0'; break; default: if(!value) real[a] = temp[a]; } } real[a] = '\0'; rt = malloc(strlen(real)); rt = (char *)real; return rt; free(rt); } /*-----------------------------------------------------------------------* * GET_OPTION * *-----------------------------------------------------------------------*/ char *get_option(char *in) { short int b = 0, a; char real[256], get[256], *rt; sprintf(real, "%s", in); for(a = 0; a <= strlen(real)-1; a++) if(real[a] == '=') { while(real[a+1] != '\0') { if(real[a+1] != ' ') get[b] = real[a+1]; else b--; b++; a++; } get[b] = '\0'; break; } rt = malloc(strlen(get)); rt = (char *)get; return rt; free(rt); } /*-----------------------------------------------------------------------* * LED_ON/OFF - Show the leds on the screen * *-----------------------------------------------------------------------*/ void led_on(unsigned int who) { if(who == LED_RX){ chcolor(colors.ingoing[0], colors.ingoing[1]); move(12, 37); hline(CHAR, 2); } else if(who == LED_TX){ chcolor(colors.outgoing[0], colors.outgoing[1]); move(12, 41); hline(CHAR, 2); } } void led_off(unsigned int who) { if(who == LED_RX){ chcolor(colors.labels[0], colors.labels[1]); mvprintw(12, 37, " "); } else if(who == LED_TX){ chcolor(colors.labels[0], colors.labels[1]); mvprintw(12, 41, " "); } } /*-----------------------------------------------------------------------* * UPDATE_STAT - Update The Graphical Statistic * *-----------------------------------------------------------------------*/ void update_stat(int reload) { int x, y; int bps[2], pps[2]; int ps; float makegraph_in = 0, makegraph_out = 0, ks; /* Putting in the last hline the new statistic */ if(!stats.rx_bytes_comp) stats.rx_bytes_comp = stats.rx_bytes[0]; if(!stats.tx_bytes_comp) stats.tx_bytes_comp = stats.tx_bytes[0]; if(!stats.tx_packets_comp[1]) stats.tx_packets_comp[1] = stats.tx_packets[0]; if(!stats.rx_packets_comp[1]) stats.rx_packets_comp[1] = stats.rx_packets[0]; bps[0] = (stats.rx_bytes[0] - stats.rx_bytes_comp); bps[1] = (stats.tx_bytes[0] - stats.tx_bytes_comp); pps[0] = (stats.rx_packets[0] - stats.rx_packets_comp[1]); pps[1] = (stats.tx_packets[0] - stats.tx_packets_comp[1]); /* ks variable gets the speed in k/s of the connection */ ks = (float)(bps[0] + bps[1]); ks /= 1024; ps = pps[0] + pps[1]; autoscale(autoscalebytes, ks * 1024); center(14, "%sB/s %d Packets/s", autoscalebytes, ps); /* center(14, "%.2f KB/s %d Packets/s", ks, ps); */ if(ks > stats.top_speed) { mvprintw(19, 27, " "); mvprintw(19, 27, "%sB/s", autoscalebytes); /* mvprintw(19, 27, "%.2f KB/s", ks); */ stats.top_speed = ks; } if(ps > stats.top_packet) { mvprintw(19, 65, " "); mvprintw(19, 65, "%d", ps); stats.top_packet = ps; } stats.rx_bytes_comp = stats.rx_bytes[0]; stats.tx_bytes_comp = stats.tx_bytes[0]; stats.rx_packets_comp[1] = stats.rx_packets[0]; stats.tx_packets_comp[1] = stats.tx_packets[0]; /* makegraph variable gets the amplitude of line bar */ /* [0] = incoming / [1] = outgoing */ /* SPEED = factor from command line */ /* y = height of vertical bar */ /* y=10 -> (1 KB/sec * factor) */ for(y = 0; y < 10; y++) { if( ( (float)bps[0] > (float)(SPEED[0] * 102.4) * y ) && ( (float)bps[0] <= (float)(SPEED[0] * 102.4) * (y+1)) ) makegraph_in = y + 1; else if((float)bps[0] > (float)(SPEED[0] * 1024)) makegraph_in = 10; if( ( (float)bps[1] > (float)(SPEED[1] * 102.4) * y ) && ( (float)bps[1] <= (float)(SPEED[1] * 102.4) * (y+1)) ) makegraph_out = y + 1; else if((float)bps[1] > (float)(SPEED[1] * 1024)) makegraph_out = 10; } for(x = 0; x != 10; x++) { graph[x].hline[75] = 0; } if(makegraph_in > 10) makegraph_in = 10; if(makegraph_out > 10) makegraph_out = 10; for(x = 0; x < makegraph_in; x++) graph[x].hline[75] = 1; for(x = 0; x < makegraph_out; x++) { if(graph[x].hline[75] == 1) graph[x].hline[75] = 3; else graph[x].hline[75] = 2; } for(y = 0; y != 10; y++) { for(x = 0; x != 76; x++) { /* Move the graphic to the left) */ if(!reload) if(x) graph[y].hline[x-1] = graph[y].hline[x]; /* Print the graphic on screen */ if(graph[y].hline[x] == 3) /* intersection color */ { chcolor(colors.intersection[0], colors.intersection[1]); move((y+10)-(2*y), x+2); hline(CHAR, 1); } else if(graph[y].hline[x] == 1) /* ingoing color */ { chcolor(colors.ingoing[0], colors.ingoing[1]); move((y+10)-(2*y), x+2); hline(CHAR, 1); } else if(graph[y].hline[x] == 2) /* outgoing color */ { chcolor(colors.outgoing[0], colors.outgoing[1]); move((y+10)-(2*y), x+2); hline(CHAR, 1); } else { chcolor(colors.background, 0); mvaddstr((y+10)-(2*y), x+2, " "); } } } } /*--------------------------------------------------------------------------* * SHOW_USAGE - Print the right usage on the screen * *--------------------------------------------------------------------------*/ void show_usage(char *name) { fprintf(stderr, "\nEthStatus v" VERSION " - " AUTHOR "\n" "Usage: %s\n" " [-i interface] interface name\n" " [-v [vga|mono]] video display mode\n" " [-S speed[k|m|g]] line speed in [K|M|G]bps\n" " [-s [10|100|64|128|256|768|1540]] line speed (backward compatibility)\n" "\n" , name); } /*--------------------------------------------------------------------------* * CHCOLOR - Change the Color * *--------------------------------------------------------------------------*/ void chcolor(int x, int y) { init_pair(1, COLOR_BLACK, colors.background); init_pair(2, COLOR_RED, colors.background); init_pair(3, COLOR_GREEN, colors.background); init_pair(4, COLOR_YELLOW, colors.background); init_pair(5, COLOR_BLUE, colors.background); init_pair(6, COLOR_MAGENTA, colors.background); init_pair(7, COLOR_CYAN, colors.background); init_pair(8, COLOR_WHITE, colors.background); if(!y) attrset(COLOR_PAIR(x+1)); if(y) attrset(COLOR_PAIR(x+1)|A_BOLD); } /*---------------------------------------------------------------------------* * CLOSE_ETHS * *---------------------------------------------------------------------------*/ void close_eths(char *errmsg, ...) { va_list trans; char *final; final = malloc(strlen(errmsg)); va_start(trans, errmsg); (void)vsnprintf(final, strlen(errmsg), errmsg, trans); va_end(trans); endwin(); curs_set(1); system("clear"); fprintf(stderr, "%s", final); free(final); exit(0); } /*---------------------------------------------------------------------------* * FACE - Draw the face of the program * *---------------------------------------------------------------------------*/ void face(void) { short int x, y; chcolor(colors.background, 0); for(x = 0; x <= 24; x++) for(y = 0; y <= 80; y++) mvprintw(x, y, " "); refresh(); chcolor(colors.border[0], colors.border[1]); border(0, 0, 0, 0, 0, 0, 0, 0); /*center(24, ".Author : Gabriel Montenegro .");*/ refresh(); chcolor(colors.labels[0], colors.labels[1]); mvprintw(17, 6,"IP Address:"); /* if(check) mvprintw(17, 41, "New email(s):"); */ mvprintw(20, 6, "Received Packets:"); mvprintw(22, 6, "Errors on Receiving:"); mvprintw(20, 41,"Transmited Packets:"); mvprintw(22, 41,"Errors on Transmission:"); mvprintw(13, 37,"RX"); mvprintw(13, 41,"TX"); mvprintw(18, 6,"Interface name:"); mvprintw(18, 41, "Graphic Using Speed:"); mvprintw(13, 9, "ON/OFF"); mvprintw(19, 6, "Top Speed:"); mvprintw(19, 41, "Top Packets/s:"); refresh(); chcolor(colors.version[0], colors.version[1]); mvprintw(00, 31,".EthStatus v" VERSION "."); refresh(); chcolor(colors.data[0], colors.data[1]); mvprintw(18, 27, "%s", interface); /* technically incorrect - should be 1024 */ autoscale(autoscalebytes, SPEED[0] * (double) 1000 ); mvprintw(18, 65, "%sB/s", autoscalebytes); mvprintw(19, 27, "0.00 KB/s"); mvprintw(19, 65, "0"); refresh(); } /*--------------------------------------------------------------------------* * M A I N - The head of the program * *--------------------------------------------------------------------------*/ int main(int argc, char *argv[]) { short int x, y, key_pressed, first = 1, reload = FALSE; time_t cron; cron = time(NULL); stats.start_time = ctime(&cron); /* variables for -S option */ int bps; char modifier; long int KBps; /* set the default colors */ colors.ingoing[0] = COLOR_GREEN; colors.ingoing[1] = 1; colors.outgoing[0] = COLOR_YELLOW; colors.outgoing[1] = 1; colors.intersection[0] = COLOR_GREEN; colors.intersection[1] = 0; colors.background = COLOR_BLACK; colors.data[0] = COLOR_CYAN; colors.data[1] = 0; colors.border[0] = COLOR_WHITE; colors.data[1] = 0; colors.labels[0] = COLOR_WHITE; colors.labels[1] = 0; colors.version[0] = COLOR_WHITE; colors.labels[1] = 1; colors.power_led[0] = COLOR_GREEN; colors.power_led[1] = 1; /* LED on */ colors.power_led[2] = COLOR_RED; colors.power_led[3] = 0; /* LED off */ /* read command line options */ int option; while ((option = getopt (argc, argv, "hi:s:S:v:")) != -1) { switch (option) { case 'h': show_usage(argv[0]); exit(0); break; case 'i': if(strlen(optarg) > 5) { show_usage(argv[0]); exit(10); } interface = optarg; break; case 'v' : if(!strcmp(optarg, "mono")) { VGA = 0; break; } if(!strcmp(optarg, "vga")) { VGA = 1; break; } else { show_usage(argv[0]); exit(10); } break; case 'S': /* incoming/outgoing bandwidth */ /* the format is e.g. 10m or 64k or 1g */ if (!sscanf(optarg, "%i%c", &bps, &modifier)) { show_usage(argv[0]); exit(10); } if (bps > 1024) { show_usage(argv[0]); exit(10); } /* printf("Number=%i, Modifier=%c\n", bps, modifier); */ KBps = bps; /* consider the modifier (k/m/g/) */ if (modifier == 'k' || modifier == 'K') KBps *= 1; else if (modifier == 'm' || modifier == 'm') KBps *= 1024; else if (modifier == 'g' || modifier == 'g') KBps *= (1024*1024); else { show_usage(argv[0]); exit(10); } /* convert bits per second into KB per second */ KBps /= 8; if (KBps == 0) { show_usage(argv[0]); fprintf(stdout, "ERROR: bandwidth set too low\n"); exit(10); } /*printf("KB/sec=%i\n", KBps); exit(0);*/ SPEED[0]=(float) KBps; SPEED[1]=(float) KBps; break; case 's' : if(!strcmp(optarg, "100") || !strcmp(optarg, "10")) SPEED[0] = SPEED[1] = (atof(optarg) / 8) * 1024; else if(!strcmp(optarg, "64") || !strcmp(optarg, "128")) SPEED[0] = SPEED[1] = atof(optarg); else if(!strcmp(optarg, "256")) { SPEED[0] = atof(optarg); SPEED[1] = 64; } else if(!strcmp(optarg, "768")) { SPEED[0] = atof(optarg); SPEED[1] = 128; } else if(!strcmp(optarg, "1540")) { SPEED[0] = atof(optarg); SPEED[1] = 256; } else { show_usage(argv[0]); exit(10); } break; case '?': show_usage(argv[0]); exit(10); break; } } /* Initialize some info variables */ stats.tx_packets[0] = 0; stats.tx_bytes[0] = 0; stats.tx_errors[0] = 0; stats.rx_packets[0] = 0; stats.rx_bytes[0] = 0; stats.rx_errors[0] = 0; stats.tx_bytes_comp = 0; stats.tx_bytes_comp = 0; fprintf(stderr, "Running EthStatus v%s...", VERSION); printf("\e(U"); /* Thanks kspoon */ initscr(); intrflush(stdscr, FALSE); if(VGA) start_color(); init_color(1, COLOR_RED, COLOR_GREEN, COLOR_BLUE); curs_set(0); /* Toggle the cursor off */ nonl(); noecho(); cbreak(); nodelay(stdscr, TRUE); face(); update_info(); /* if(check) check_email(); */ while(1){ if(is_online(0, 0)) { if(disconnected) { clear_info(); for(y = 0; y != 10; y++) for(x = 0; x != 75; x++) graph[y].hline[x] = 0; stats.top_speed = stats.top_packet = stats.rx_bytes_comp = stats.tx_bytes_comp = stats.rx_packets_comp[0] = stats.tx_packets_comp[0] = stats.tx_packets_comp[1] = stats.rx_packets_comp[1] = 0; update_stat(0); } cron = time(NULL); localt = *localtime(&cron); /* In case of a new RX Packet... the RX Led Turn on * Else... Turn off */ if(stats.rx_packets[0] != stats.rx_packets_comp[0]) led_on(LED_RX); else led_off(LED_RX); /* In case of a new TX Packet... the TX Led Turn on * Else... Turn off */ if(stats.tx_packets[0] != stats.tx_packets_comp[0]) led_on(LED_TX); else led_off(LED_TX); stats.rx_packets_comp[0] = stats.rx_packets[0]; stats.tx_packets_comp[0] = stats.tx_packets[0]; update_info(); if((sec_value == 0 && first) || disconnected) { sec_value = localt.tm_sec; stats.log_value = localt.tm_sec + (localt.tm_min * 60) + (localt.tm_hour * 3600); ip_address(1); update_stat(0); first = 0; disconnected = 0; } if((stats.log_value + stats.log_time) == localt.tm_sec + (localt.tm_min * 60) + (localt.tm_hour * 3600)) { stats.log_value = localt.tm_sec + (localt.tm_min * 60) + (localt.tm_hour * 3600); } if(localt.tm_sec != sec_value) { if(check) check_email(); update_stat(0); sec_value = localt.tm_sec; } usleep(10L); } else usleep(100000L); key_pressed = getch(); if(key_pressed != ERR && tolower(key_pressed) == 'q') break; else if(key_pressed != ERR && tolower(key_pressed) == 'r') { face(); is_online(1, 0); ip_address(1); if(check) check_email(); update_stat(1); reload = TRUE; } } endwin(); system("clear"); curs_set(1); fprintf(stdout, "EthStatus v" VERSION " - " AUTHOR "\n\n"); return 0; } /****** * autoscale * input: any byte or bytes/sec count * output: string holding a value with kilo,mega,giga... ******/ void autoscale(char *str, double bytes) { if (bytes > (double) 1024*1024*1024) sprintf(str, "%.2f G", (bytes/ (double) (1024*1024*1024))); else if (bytes > (double) 1024*1024) sprintf(str, "%.2f M", (bytes/ (double) (1024*1024))); else if (bytes > (double) 1024) sprintf(str, "%.2f K", (bytes/ (double) (1024))); else sprintf(str, "%.2f ", bytes); } ethstatus-0.4.3ubuntu1/Makefile0000664000000000000000000000100111634124770013413 0ustar # Makefile for EthStatus # Edited for Debian GNU/Linux. DESTDIR = LDFLAGS = -lncurses CFLAGS = -O2 -Wall #CFLAGS = -Wall -g BIN = ethstatus SRC = ethstatus.c # Edited for Debian GNU/Linux. INSTDIR = $(DESTDIR)/usr/bin INSTALL=/usr/bin/install INSTALL_PARMS=-o 0 -g 0 -m 0755 all : ethstatus ethstatus : ethstatus.c ethstatus.h gcc $(CFLAGS) -o ${BIN} ${SRC} $(LDFLAGS) clean: rm -f ${BIN} *.o core *~ install: # Edited for Debian GNU/Linux. $(INSTALL) $(INSTALL_PARMS) ethstatus $(DESTDIR)/usr/bin ethstatus-0.4.3ubuntu1/ethstatus.h0000664000000000000000000000662707771355475014212 0ustar #define VERSION "0.4a" #define AUTHOR "Gabriel Montenegro / Christoph Haas" #define LED_RX 1 #define LED_TX 2 #define LED_POWER 3 #ifndef TRUE #define TRUE 1 #endif #ifndef FALSE #define FALSE 0 #endif #define COLOR_BLACK 0 #define COLOR_RED 1 #define COLOR_GREEN 2 #define COLOR_YELLOW 3 #define COLOR_BLUE 4 #define COLOR_MAGENTA 5 #define COLOR_CYAN 6 #define COLOR_WHITE 7 /* Edited for Debian GNU/Linux. */ /* #define ROOTandRUNONBOOTcfgPATH "/etc" */ #define RC_FILENAME "ethstatus.cfg" #define PATH_PROC_NET_DEV "/proc/net/dev" /* Edited for Debian GNU/Linux. */ #define MAIL_PATH "/var/mail/" #define LOG_PATH "/var/log/" /* This will put the statistic coordinates (THIS WILL WORK WITH 0 or 1) */ typedef struct statvline { int hline[76]; /* This will be the horzontal lines */ } statvline[10]; /* ... and this will be vertical lines */ statvline graph; struct tm localt; typedef struct theme { int background; int border[2]; int labels[2]; int data[2]; int version[2]; int outgoing[2]; int ingoing[2]; int intersection[2]; int power_led[4]; } theme; theme colors; /* This structure stays the INFO variables */ typedef struct DataStats { double rx_packets[2]; /* This is for RX LED/TX PACKETS INFO */ unsigned long rx_errors[2]; /* Shows how many erros has ocurred on receive */ double rx_bytes[2]; /* How many bytes has received */ /* --------------------------------------------------------------------- */ double tx_packets[2]; /* This is for TX LED/TX PACKETS INFO */ unsigned long tx_errors[2]; /* Shows how many erros has ocurred on transmition */ double tx_bytes[2]; /* How many Bytes has sent */ /* --------------------COMPARATION-VARIABLES---------------------------- */ double rx_packets_comp[2]; double tx_packets_comp[2]; double rx_bytes_comp; double tx_bytes_comp; /* --------------------------------------------------------------------- */ unsigned long connect_time; unsigned long current_time; float top_speed; int top_packet; unsigned long log_time; unsigned long log_value; char *ip_addr_rtrn; char user_box[32]; int email; char *start_time; } DataStats; DataStats stats; struct stat st; /* Functions Declarations */ void close_eths(char *errmsg, ...); void chcolor(int x, int y); void the_face(void); void update_stat(int reload); void update_info(void); void led_on(unsigned int who); void led_off(unsigned int who); int is_online(short int force, short int only_check); void clear_info(void); void show_usage(char *name); void get_time(); void ip_address(int display); /* int log(int quit); */ void check_email(void); void autoscale(char *, double); /* End of Functions Declarations */ /* Variables Declarations */ char home[128]; char *interface = "eth0"; /* eth0... Default interface */ char data_type[6] = "bytes"; char mth[12][4] = { "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" }; int eth_s = -1; int CHAR = '#'; /* Bars character */ int sec_value = 0; /* allocate memory for using the autoscale() subroutine */ char autoscalebytes[15]; float SPEED[2] = {10240, 10240} ; unsigned short int VGA = 1; unsigned short int con = 0; unsigned short int discon = 0; unsigned short int disconnected = 0; unsigned short int check = 0; unsigned short int online = 0; unsigned short int first_log = 1, lsnumber = 1; /* for logging info */ /* End of Variables Declarations */ ethstatus-0.4.3ubuntu1/debian/0000775000000000000000000000000012655610443013206 5ustar ethstatus-0.4.3ubuntu1/debian/rules0000775000000000000000000000230310516003025014246 0ustar #!/usr/bin/make -f # Uncomment this to turn on verbose mode. #export DH_VERBOSE=1 CFLAGS = -Wall -g ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS))) CFLAGS += -O0 else CFLAGS += -O2 endif ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS))) INSTALL_PROGRAM += -s endif build: build-stamp build-stamp: dh_testdir # Add here commands to compile the package. $(MAKE) CFLAGS="$(CFLAGS)" touch build-stamp clean: dh_testdir dh_testroot rm -f build-stamp # Add here commands to clean up after the build process. -$(MAKE) clean dh_clean install: build dh_testdir dh_testroot dh_clean -k dh_installdirs # Add here commands to install the package into debian/ethstatus. $(MAKE) install DESTDIR=$(CURDIR)/debian/ethstatus # Build architecture-independent files here. binary-indep: build install # We have nothing to do by default. # Build architecture-dependent files here. binary-arch: build install dh_testdir dh_testroot dh_installdocs dh_installchangelogs CHANGELOG dh_link dh_strip dh_installman dh_compress dh_fixperms dh_installdeb dh_shlibdeps dh_gencontrol dh_md5sums dh_builddeb binary: binary-indep binary-arch .PHONY: build clean binary-indep binary-arch binary install ethstatus-0.4.3ubuntu1/debian/docs0000664000000000000000000000001610515773453014062 0ustar README THANKS ethstatus-0.4.3ubuntu1/debian/dirs0000664000000000000000000000003310515773453014072 0ustar usr/bin usr/share/man/man1 ethstatus-0.4.3ubuntu1/debian/copyright0000664000000000000000000000230210515774405015140 0ustar This package was debianized by Christoph Haas on Sat, 10 May 2003 15:48:17 +0200. It was originally written by Gabriel Montenegro (johnpetrucci@users.sourceforge.net) and received a few feature additions and bug fixes by Christoph Haas. Upstream Author: Christoph Haas (email@christoph-haas.de) Copyright: Ethstatus is copyright (c) 2000-2001 by Gabriel Montenegro and copyright (c) 2002-2003 by Christoph Haas This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License with your Debian GNU system, in /usr/share/common-licenses/GPL, or with the Debian GNU source package as the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. ethstatus-0.4.3ubuntu1/debian/compat0000664000000000000000000000000210515773453014410 0ustar 4 ethstatus-0.4.3ubuntu1/debian/control0000664000000000000000000000114111634124770014605 0ustar Source: ethstatus Section: net Priority: optional Maintainer: Ubuntu Developers XSBC-Original-Maintainer: Aurélien GÉRÔME Build-Depends: debhelper (>> 4.0.0), libncurses5-dev Standards-Version: 3.7.2 Package: ethstatus Architecture: any Depends: ${shlibs:Depends} Description: console-based ethernet statistics monitor Ethstatus is a console-based monitoring utility for displaying statistical data of the ethernet interface on a quantity basis. It is similar to iptraf but is meant to run as a permanent console task to monitor the network load. ethstatus-0.4.3ubuntu1/debian/README.Debian0000664000000000000000000000047510515773453015261 0ustar Ethstatus for Debian -------------------- The upstream maintainer is no longer actively supporting this package. This release consists of 95% original source code from Gabriel Montenegro and 5% bug fixes and additions by Chrsitoph Haas. -- Christoph Haas , Sat, 10 May 2003 15:48:17 +0200 ethstatus-0.4.3ubuntu1/debian/ethstatus.manpages0000664000000000000000000000001410515773453016746 0ustar ethstatus.1 ethstatus-0.4.3ubuntu1/debian/changelog0000644000000000000000000000713012655610443015057 0ustar ethstatus (0.4.3ubuntu2) xenial; urgency=medium * No-change rebuild for ncurses6 transition. -- Matthias Klose Sun, 07 Feb 2016 09:40:51 +0000 ethstatus (0.4.3ubuntu1) oneiric; urgency=low * Makefile: reorder LDFLAGS to fix FTBFS from new DSO linking (LP: #770833) -- Alex Chiang Mon, 12 Sep 2011 21:35:25 -0600 ethstatus (0.4.3) unstable; urgency=low * New maintainer. (Closes: #394092) * Upstream is the same as Debian maintainer. Therefore, build a native Debian package. * Update Standards-Version to 3.7.2. * New FSF address in COPYRIGHT and debian/copyright. * Conform to policy by using "-Wall -g -O2" as CFLAGS. -- Aurélien GÉRÔME Fri, 20 Oct 2006 00:10:20 +0200 ethstatus (0.4.2-2) unstable; urgency=low * raised the standards version to 3.6.1 * removed old comments from the rules file (gzip for manpages) -- Christoph Haas Sun, 21 Dec 2003 22:44:33 +0100 ethstatus (0.4.2-1) unstable; urgency=low * New upstream release * added myself to the copyright * CFLAGS is now exported in the rules file * lazy uploaders removed ;) * manpage is now provided in the upstream archive instead of the diff.gz -- Christoph Haas Sun, 21 Dec 2003 18:36:35 +0100 ethstatus (0.4.1-2) unstable; urgency=low * Removed the 'dh_installchangelogs' file that was left in the build directory accidentally. (Thanks to Joe Nahmias .) -- Christoph Haas Fri, 12 Dec 2003 15:50:22 +0100 ethstatus (0.4.1-1) unstable; urgency=low * New upstream release * Now values larger than 1024 (up to 1024^2) can be used with the -S option (closes: #214711) -- Christoph Haas Fri, 14 Nov 2003 22:56:50 +0100 ethstatus (0.4-2) unstable; urgency=low * Fixed the copyright note (did not contain the full GPL). * Man page is now installed by dh_installman using 'ethstatus.manpages' * Typos fixed (inconsistent uppercase/lowercase use of ethstatus, Ethstatus and EthStatus). * Removed unused parts of the rules file. * Updated the standards version to 3.6.0. -- Christoph Haas Wed, 6 Aug 2003 20:25:51 +0200 ethstatus (0.4-1) unstable; urgency=low * Christoph Haas is now also upstream maintainer as the original author is no longer actively supporting and developing this application * Interface names are no longer restricted to eth* * Command line options displayed when running with "-h" or when running with invalid arguments * Interface speed now also selectable in absolute values by using the "-S" option (e.g. -S 128k) * Removed the "runonboot" program (you are free to start ethstatus manually from the /etc/inittab if you miss this feature) * Removed global configuration file /etc/ethstatus.cfg (ethstatus runs well with command line options only) * Removed email check * Scaling of bytes/KB/MB units is computed automatically * Uses getopt to prevent segmentation faults when parsing command-line argument * Removed the options "--bytes", "--packets", "--errors" and "--ipaddress" as this information can be fetched with ifconfig. -- Christoph Haas Fri, 16 May 2003 21:49:21 +0200 ethstatus (0.3.0-2) unstable; urgency=low * Build-depends fixed (closes: #193262) -- Christoph Haas Wed, 14 May 2003 18:16:28 +0200 ethstatus (0.3.0-1) unstable; urgency=low * Initial Release (closes: #126200). -- Christoph Haas Sat, 10 May 2003 15:48:17 +0200 ethstatus-0.4.3ubuntu1/COPYRIGHT0000664000000000000000000004306610515774523013273 0ustar GNU GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 1989, 1991 Free Software Foundation, Inc. 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This General Public License applies to most of the Free Software Foundation's software and to any other program whose authors commit to using it. (Some other Free Software Foundation software is covered by the GNU Library General Public License instead.) You can apply it to your programs, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it. For example, if you distribute copies of such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software. Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations. Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that redistributors of a free program will individually obtain patent licenses, in effect making the program proprietary. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. The precise terms and conditions for copying, distribution and modification follow. GNU GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any derivative work under copyright law: that is to say, a work containing the Program or a portion of it, either verbatim or with modifications and/or translated into another language. (Hereinafter, translation is included without limitation in the term "modification".) Each licensee is addressed as "you". Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running the Program is not restricted, and the output from the Program is covered only if its contents constitute a work based on the Program (independent of having been made by running the Program). Whether that is true depends on what the Program does. 1. You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and give any other recipients of the Program a copy of this License along with the Program. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Program or any portion of it, thus forming a work based on the Program, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) You must cause the modified files to carry prominent notices stating that you changed the files and the date of any change. b) You must cause any work that you distribute or publish, that in whole or in part contains or is derived from the Program or any part thereof, to be licensed as a whole at no charge to all third parties under the terms of this License. c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the most ordinary way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this License. (Exception: if the Program itself is interactive but does not normally print such an announcement, your work based on the Program is not required to print an announcement.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Program, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Program, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Program. In addition, mere aggregation of another work not based on the Program with the Program (or with a work based on the Program) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may copy and distribute the Program (or a work based on it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you also do one of the following: a) Accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, b) Accompany it with a written offer, valid for at least three years, to give any third party, for a charge no more than your cost of physically performing source distribution, a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, c) Accompany it with the information you received as to the offer to distribute corresponding source code. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form with such an offer, in accord with Subsection b above.) The source code for a work means the preferred form of the work for making modifications to it. For an executable work, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the executable. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. If distribution of executable or object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code. 4. You may not copy, modify, sublicense, or distribute the Program except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense or distribute the Program is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 5. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Program or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Program (or any work based on the Program), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Program or works based on it. 6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License. 7. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Program at all. For example, if a patent license would not permit royalty-free redistribution of the Program by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Program. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system, which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 8. If the distribution and/or use of the Program is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Program under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 9. The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of this License, you may choose any version ever published by the Free Software Foundation. 10. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS Appendix: How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) 19yy This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. Also add information on how to contact you by electronic and paper mail. If the program is interactive, make it output a short notice like this when it starts in an interactive mode: Gnomovision version 69, Copyright (C) 19yy name of author Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, the commands you use may be called something other than `show w' and `show c'; they could even be mouse-clicks or menu items--whatever suits your program. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the program, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the program `Gnomovision' (which makes passes at compilers) written by James Hacker. , 1 April 1989 Ty Coon, President of Vice This General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Library General Public License instead of this License. ethstatus-0.4.3ubuntu1/ethstatus.10000664000000000000000000000402410515773660014076 0ustar .\" Hey, EMACS: -*- nroff -*- .\" First parameter, NAME, should be all caps .\" Second parameter, SECTION, should be 1-8, maybe w/ subsection .\" other parameters are allowed: see man(7), man(1) .TH ETHSTATUS 1 "May 1, 2003" .\" Please adjust this date whenever revising the manpage. .\" .\" Some roff macros, for reference: .\" .nh disable hyphenation .\" .hy enable hyphenation .\" .ad l left justify .\" .ad b justify to both left and right margins .\" .nf disable filling .\" .fi enable filling .\" .br insert line break .\" .sp insert n+1 empty lines .\" for manpage-specific macros, see man(7) .SH NAME ethstatus \- Console-based ethernet statistics monitor .SH SYNOPSIS .B ethstatus [ -h ] [ -i interface ] [ -v videomode ] [ -S bps[k|m|g] ] [ -s speed ] (backward compatibility) .SH DESCRIPTION .B ethstatus is a console-based monitoring utility for displaying statistical data of the ethernet interface on a quantity basis. .SH OPTIONS The following options can be provided: .TP .B \-i Specify the ethernet interface which shall be monitored. Default is 'eth0'. .TP .B \-v Set the video mode used by curses. Possible choices are 'vga' (the default) and 'mono' (useful for black-and-white monitors). .TP .B \-S Set the maximum network speed in bits per second. ethstatus knows about the kilo (k), mega (m) and giga (g) modifiers. So you can specify the speed as e.g. 64k or 100m or 1g. .TP .B \-s Set the maximum network speed. Possible values are '10' (=10 Mbps), \'100' (=100 Mbps), '64' (=64 kbps), '128' (=128 kbps), 256 (=256 kbps), \'768' (=768 kbps) or '1540' (=1540 kbps). This option is provided for backward compatibility to prior versions of ethstatus. Please use the -S parameter instead. .TP .SH AUTHORS The original program was written by Gabriel Montenegro . Bug fixes, code cleanup, different improvements and this manual page were provided by Christoph Haas for the Debian GNU/Linux system. ethstatus-0.4.3ubuntu1/CHANGELOG0000664000000000000000000000223210516002133013156 0ustar v0.4.3 * Update FSF address in COPYRIGHT. * Rebuild the tarball with Debian packaging system. v0.4.2 * Manpage added v0.4.1 * Minor code cleanups v0.4.0 Improved and bug fixed version by Christoph Haas . * Interface names are no longer restricted to eth* * Command line options displayed when running with "-h" or when running with invalid arguments * Interface speed now also selectable in absolute values by using the "-S" option (e.g. -S 128k) * Removed the "runonboot" program (you are free to start ethstatus manually from the /etc/inittab if you miss this feature) * Removed global configuration file /etc/ethstatus.cfg (ethstatus runs well with command line options only) * Removed email check * Scaling of bytes/KB/MB units is computed automatically * Uses getopt to prevent segmentation faults when parsing command-line argument * Removed the options "--bytes", "--packets", "--errors" and "--ipaddress" as this information can be fetched with ifconfig. v0.3.0 Released Version With some Changes: Graphic is now calibrated Added 64kbyte and 128kbyte connection v0.2.0 First Release ethstatus-0.4.3ubuntu1/THANKS0000664000000000000000000000010207661236244012674 0ustar I want to thank Miguel Cavazos for all the supports on his boxes. ethstatus-0.4.3ubuntu1/README0000664000000000000000000000321110515773706012646 0ustar EthStatus ========= Original author: Gabriel Montenegro Code maintainer: Christoph Haas Copyright (c) 2000-2001 by Gabriel Montenegro. This program is free software which I release under the GNU General Public License. Read the COPYRIGHT file for more info. Description =========== Ethstatus was developed for Linux users that are usually in console mode. It is a simple, easy to use program for displaying commonly needed/wanted statistics in real time of incoming and outgoing traffic. It is similar to the famous "iptraf" software but aims to show bandwidth usage and packet counters on a realtime quantity basis. Features ======== -> Simulates RX/TX data LEDs -> 76x10 block graphic graph - updated every second -> Constant change of speed, for better graphic interaction -> Interface selection (eth0, eth1 ...) -> Selection beetween two exibition modes: Monochrome, VGA -> Log file stores data of all connections Requirements ============ For the instalation of EthStatus, you will need the following -ncurses library -GNU make Installation ============ For creating and installing the binaries from source you can plainly use do - make - make install (as root) Configuration File / Command line options ========================================= Please consult the man page that is shipped with Ethstatus. Bug reports =========== The current version of Ethstatus is distributed as a native Debian package. As the original author is no longer actively supporting this program please use the BTS (http://bugs.debian.org) in case you find a bug.