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

  1. /* ARCNET trace routines
  2.  * Copyright 1990 Russ Nelson
  3.  */
  4.  
  5. /****************************************************************************
  6. *    $Id: arcdump.c 1.2 93/07/16 11:41:42 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 "arcnet.h"
  14. #include "trace.h"
  15. #include "ip.h"
  16.  
  17. void
  18. arc_dump(fp,bpp,check)
  19. FILE *fp;
  20. struct mbuf **bpp;
  21. int check;    /* Not used */
  22. {
  23.     struct arc ahdr;
  24.     char s[20],d[20];
  25.  
  26.     ntoharc(&ahdr,bpp);
  27.     parc(s,ahdr.source);
  28.     parc(d,ahdr.dest);
  29.     fprintf(fp,"Arcnet: len %u %s->%s",ARCLEN + len_p(*bpp),s,d);
  30.  
  31.     switch(uchar(ahdr.type)){
  32.         case ARC_IP:
  33.             fprintf(fp," type IP\n");
  34.             ip_dump(fp,bpp,1);
  35.             break;
  36.         case ARC_ARP:
  37.             fprintf(fp," type ARP\n");
  38.             arp_dump(fp,bpp);
  39.             break;
  40.         default:
  41.             fprintf(fp," type 0x%x\n",ahdr.type);
  42.             break;
  43.     }
  44. }
  45. int
  46. arc_forus(iface,bp)
  47. struct iface *iface;
  48. struct mbuf *bp;
  49. {
  50.     return 1;
  51. }
  52.