home *** CD-ROM | disk | FTP | other *** search
/ Power Hacker 2003 / Power_Hacker_2003.iso / E-zine / Magazines / crh / freebsd / rootkit / sniffit.0.3.5 / sn_packetstructs.h.orig < prev    next >
Encoding:
Text File  |  2002-05-27  |  1.4 KB  |  52 lines

  1. /* Sniffit Packet Discription File                             */
  2.  
  3. #include <sys/time.h>
  4.  
  5. struct packetheader
  6. {
  7.         struct timeval ts;      /* time stamp */
  8.         unsigned long caplen;          /* length of portion present */
  9.         unsigned long len;             /* length this packet (off wire) */
  10. };           
  11.  
  12. struct IP_header                        /* The IPheader (without options) */
  13. {
  14.     unsigned char verlen, type;
  15.     unsigned short length, ID, flag_offset;
  16.     unsigned char TTL, protocol;
  17.     unsigned short checksum;
  18.     unsigned long int source, destination;
  19. };
  20.  
  21. struct pseudo_IP_header 
  22. {
  23.         unsigned long int source, destination;
  24.         char zero_byte, protocol;
  25.         unsigned short TCP_UDP_len;
  26. };            
  27.  
  28. struct TCP_header                       /* The TCP header (without options) */
  29. {
  30.     unsigned short source, destination;
  31.     unsigned long int seq_nr, ACK_nr;
  32.     unsigned short offset_flag, window, checksum, urgent; 
  33. };
  34.  
  35. struct ICMP_header                                /* The ICMP header */ 
  36. {
  37.     unsigned char type, code;
  38.     unsigned short checksum; 
  39. };
  40.  
  41. struct UDP_header                                /* The UDP header */ 
  42. {
  43.     unsigned short source, destination;
  44.     unsigned short length, checksum;
  45. };
  46.  
  47. struct unwrap                                           /* some extra info */
  48. {
  49.     int IP_len, TCP_len, ICMP_len, UDP_len;         /* header lengths */ 
  50.     int DATA_len;
  51. };
  52.