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_data.h < prev    next >
Encoding:
C/C++ Source or Header  |  2002-05-27  |  4.3 KB  |  131 lines

  1. /* Sniffit Data File                                                         */
  2.  
  3. /**** Network Devices *******************************************************/
  4.  
  5. #define PPP_DEV_NR      1
  6. char *PPP_DEV[]={"ppp"};
  7.  
  8. #ifdef LINUX
  9. #define ETH_DEV_NR      1
  10. char *ETH_DEV[]={"eth"};
  11. #endif
  12.  
  13. #ifdef SUNOS
  14. #define ETH_DEV_NR      2
  15. char *ETH_DEV[]={"le","hme"};
  16. #endif
  17.  
  18. #ifdef IRIX
  19. #define ETH_DEV_NR      1
  20. char *ETH_DEV[]={"et"};
  21. #endif
  22.  
  23. #ifdef FREEBSD
  24. #define ETH_DEV_NR      1
  25. char *ETH_DEV[]={"ed"};
  26. #endif
  27.  
  28. #ifdef BSDI
  29. #define ETH_DEV_NR      1
  30. char *ETH_DEV[]={"ef"};
  31. #endif
  32.  
  33. /**** Global data **********************************************************/ 
  34. pcap_t *dev_desc;
  35. void *start_dynam;
  36. int dynam_len;
  37. char Logfile[250];                                      /* name of logfile */
  38. FILE *LogFILE;                                           /* logfile stream */
  39. char *IP;
  40. unsigned long SNIFLEN;                            /* bytes we need to snif */
  41. short DEST_PORT;                                       /* destination port */
  42. char non_printable, *logging_device;
  43.  
  44. /**** Global data (packets) *************************************************/
  45. int PROTO_HEAD;    /* Base Protocol head length (ethernet, PPP ,....) */
  46.  
  47. char *IP_TYPE_precedence[8]=
  48.         {"Routine", "Priority", "Immediate", "Flash", "Flash override",
  49.         "Critical", "Internetwork control", "Network control"};
  50.  
  51. char *IP_PROTOCOL_number[34]=
  52.      
  53. {"Reserved","ICMP","IGMP","GGP","Unassigned","ST","TCP","UCL","EGP","IGP",
  54.       "BBN-MON","NVP-II","PUP","ARGUS","EMCOM","XNET","CHAOS","UDP","MUX",
  55.       "DCN-MEAS","HMP","PRM","XNS-IDP","TRUNK-1","TRUNK-2","LEAF-1","LEAF-2",
  56.       "RDP","IRTP","ISO-TP4","NETBLT","MFE-NSP","MERIT-INP","SEP"};
  57.  
  58.  
  59. char *ICMP_type_3_code[6]=
  60.         {"Net unreachable", "Host unreachable", "Protocol unreachable",
  61.         "Port unreachable", "Fragmentation needed and DF set",
  62.         "Source route failed"};
  63. char *ICMP_type_5_code[4]=
  64.         {"Redirect datagrams for the network",
  65.         "Redirect datagrams for the host",
  66.         "Redirect datagrams for the \'type of service\' and the network",
  67.         "Redirect datagrams for the \'type of service\' and the host"};
  68. char *ICMP_type_11_code[2]=
  69.         {"Time-to-live exceeded in transmit",
  70.         "Fragment reassembly time exceeded"};         
  71.  
  72. /**** Global data (config) **************************************************/ 
  73. struct cfg_file_contense *select_from_list;     /* pointers for cfg lists */
  74. struct cfg_file_contense *select_to_list;
  75. struct cfg_file_contense *deselect_from_list;
  76. struct cfg_file_contense *deselect_to_list;
  77.  
  78. int select_from_length=0;                         /* length of cfg lists  */
  79. int select_to_length=0;
  80. int deselect_from_length=0;
  81. int deselect_to_length=0;
  82. int Priority=0;             /* The higher the priority, the more important */
  83. char dot_notation[20];                            /* for easy working, Q&D */
  84.  
  85. /**** Global data (plugins) *************************************************/
  86. char Plugin_Active[10];
  87.  
  88. /**** Global data (interactive) *********************************************/ 
  89. #ifdef INCLUDE_INTERFACE                               
  90.  
  91. /**** shared memory pointers ************************************************/ 
  92. char *SHARED, *connection_data, *timing, *running_connections, 
  93.                           *logged_connections; 
  94. int *LISTlength, *DATAlength, memory_id;
  95. unsigned int  *TCP_nr_of_packets, *ICMP_nr_of_packets, *UDP_nr_of_packets;
  96. unsigned int  *IP_nr_of_packets;
  97. unsigned long *TCP_bytes_in_packets, *UDP_bytes_in_packets;
  98.  
  99. /**** data structures *******************************************************/ 
  100. struct snif_mask *mask;
  101. struct shared_logged_conn *log_conn;
  102. FILE *log_dev_stream;
  103. struct stat log_dev_stat;
  104.  
  105. volatile int LOGGING=0, screen_busy=0;
  106. char PACKET_INFO;
  107. int POINTpos=0, LISTpos=0;
  108. unsigned char COLOR_AVAIL=0;
  109.  
  110. /**** screen  **************************************************************/ 
  111. int MASK_WINDOW_ROWS, MASK_WINDOW_COLS;
  112. int MAIN_WINDOW_ROWS, MAIN_WINDOW_COLS;
  113. int INFO_WINDOW_ROWS, INFO_WINDOW_COLS;
  114. int DATA_WINDOW_ROWS, DATA_WINDOW_COLS;
  115. int INFO_WINDOW_X, INFO_WINDOW_Y;
  116. int MASK_WINDOW_X, MASK_WINDOW_Y;
  117. int DATA_WINDOW_X, DATA_WINDOW_Y;    
  118.  
  119. WINDOW *menu_window;
  120. struct box_window data_box, main_box, mask_box, packets_box;
  121. int Pid=0;
  122. #endif
  123.  
  124. /* DEBUG section */
  125. #ifdef DEBUG
  126. FILE *debug_dev;
  127. unsigned int debug_cnt=0;
  128. #endif
  129.  
  130.                   
  131.