home *** CD-ROM | disk | FTP | other *** search
/ Source Code 1992 March / Source_Code_CD-ROM_Walnut_Creek_March_1992.iso / usenet / altsrcs / 1 / 1893 / ptrace.c < prev    next >
Encoding:
C/C++ Source or Header  |  1990-12-28  |  549 b   |  33 lines

  1. /*
  2.  * ptrace.c
  3.  *
  4.  * Reads trace file and prints it (filter)
  5.  */
  6.  
  7. #include <sys/types.h>
  8. #include <sys/time.h>
  9. #include <sys/socket.h>
  10. #include <netinet/in_systm.h>
  11. #include <netinet/in.h>
  12. #include <netinet/ip.h>
  13. #include <stdio.h>
  14. #include "ntrace.h"
  15.  
  16. #define    BUFITEMS 1024
  17. struct NetTrace nettrace[BUFITEMS];
  18.  
  19. main()
  20. {
  21.     int count;
  22.     struct NetTrace *ntp;
  23.  
  24.     while ((count = read(0, nettrace, sizeof(nettrace))) > 0) {
  25.         count = count/sizeof(struct NetTrace);
  26.         ntp = nettrace;
  27.         while (count-- > 0) {
  28.             PrintNetTrace(ntp);
  29.             ntp++;
  30.         }
  31.     }
  32. }
  33.