home *** CD-ROM | disk | FTP | other *** search
/ The Pier Shareware 6 / The_Pier_Shareware_Number_6_(The_Pier_Exchange)_(1995).iso / 024 / psi110g.zip / ARCDUMP.C < prev    next >
C/C++ Source or Header  |  1994-04-17  |  918b  |  47 lines

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