home *** CD-ROM | disk | FTP | other *** search
/ High Voltage Shareware / high1.zip / high1 / DIR3 / KA9Q212.ZIP / ECCMD.C < prev    next >
C/C++ Source or Header  |  1993-07-16  |  1KB  |  45 lines

  1. /* 3C501 commands
  2.  * Copyright 1991 Phil Karn, KA9Q
  3.  */
  4.  
  5. /****************************************************************************
  6. *    $Id: eccmd.c 1.2 93/07/16 11:44:31 ROOT_DOS Exp $
  7. *    15 Jul 93    1.2        GT    Fix warnings.                                    *
  8. ****************************************************************************/
  9.  
  10. #include <stdio.h>
  11. #include "global.h"
  12. #include "mbuf.h"
  13. #include "iface.h"
  14. #include "ec.h"
  15. #include "enet.h"
  16. #include "ip.h"
  17.  
  18. int
  19. doetherstat(argc,argv,p)
  20. int argc;
  21. char *argv[];
  22. void *p;
  23. {
  24.     register struct ec *ecp;
  25.     char buf[20];
  26.  
  27.     for(ecp = Ec;ecp < &Ec[Nec]; ecp++){
  28.         pether(buf,ecp->iface->hwaddr);
  29.         tprintf("Controller %u, Ethernet address %s\n",ecp-Ec,buf);
  30.  
  31.         tprintf("recv      bad       overf     drop      nomem     intrpt\n");
  32.         tprintf("%-10lu%-10lu%-10lu%-10lu%-10lu%-10lu\n",
  33.          ecp->estats.recv,ecp->estats.bad,ecp->estats.over,
  34.          ecp->estats.drop,ecp->estats.nomem,ecp->estats.intrpt);
  35.  
  36.         tprintf("xmit      timeout   jam       jam16\n");
  37.         if(tprintf("%-10lu%-10lu%-10lu%-10lu\n",
  38.          ecp->estats.xmit,ecp->estats.timeout,ecp->estats.jam,
  39.          ecp->estats.jam16) == EOF)
  40.             break;
  41.     }
  42.     return 0;
  43. }
  44.  
  45.