1 /* Sniffit Data File */ 2 3 /**** Network Devices *******************************************************/ 4 5 6 /* Older configuration system of Sniffit */ 7 /* ether: 14 */ 8 /* ppp : 4 */ 9 /* slip : 16 */ 10 /* lo : 4 */ 11 12 #ifdef LINUX 13 /* 14 #define NETDEV_NR 3 15 char *NETDEV[]={"lo","ppp","eth"}; 16 int HEADSIZE []={4 ,0 ,14}; 17 */ 18 #define NETDEV_NR 3 19 char *NETDEV[]={"ppp","slip","eth"}; /* echo on loopback */ 20 int HEADSIZE []={0 ,0 ,14}; /* slip needs testing */ 21 #endif 22 23 #ifdef SUNOS 24 #define NETDEV_NR 3 25 char *NETDEV[]={"le","hme"}; 26 int HEADSIZE[]={14 ,14}; /* ppp: 4 or 0 or nothing? */ 27 #endif 28 29 #ifdef IRIX 30 #define NETDEV_NR 2 31 char *NETDEV[]={"ppp","et"}; 32 int HEADSIZE[]={0 ,14}; /* ppp: 4 or 0 or nothing */ 33 #endif 34 35 #ifdef FREEBSD /* ppp: 4 or 0 ? */ 36 /* 37 #define NETDEV_NR 2 38 char *NETDEV[]={"ppp","ed"}; 39 int HEADSIZE[]={4 ,14}; 40 */ 41 +#define NETDEV_NR 6 42 +char *NETDEV[]={"fxp","re","em","ppp","tun","lo"}; 43 +int HEADSIZE[]={14 ,14 ,14 ,4 ,4 ,4 }; 44 #endif 45 46 #ifdef BSDI /* ppp: 4 or 0 ? */ 47 /* 48 #define NETDEV_NR 2 49 char *NETDEV[]={"ppp","ef"}; 50 int HEADSIZE[]={4 ,14}; 51 */ 52 #define NETDEV_NR 1 53 char *NETDEV[]={"ef"}; 54 int HEADSIZE[]={14}; 55 #endif 56 57 #ifdef DEC_OSF 58 #define NETDEV_NR 1 59 char *NETDEV[]={"ln"}; 60 int HEADSIZE[]={14}; 61 #endif 62 63 #ifdef NETBSD 64 #ifdef i386 65 #define NETDEV_NR 21 66 char *NETDEV[]={"ppp","ai","de","ec","ef","eg","el","en","ep","fe","fea","fpa","fxp","ix","iy","lc","le","ne","sm","tl","we"}; 67 int HEADSIZE[]={4 ,14 ,14 ,14 ,14 ,14 ,14 ,14 ,14 ,14 ,14 ,14 ,14 ,14 ,14 ,14 ,14 ,14 ,14 ,14 ,14 }; 68 #elif defined(sparc) 69 #define NETDEV_NR 3 70 char *NETDEV[]={"ppp","le","ie"}; 71 int HEADSIZE[]={4 ,14 ,14}; 72 #elif defined(amiga) 73 #define ETH_DEV_NR 6 74 char *NETDEV[]={"ppp","bah","ed","es","le","qn"}; 75 int HEADSIZE[]={4 ,14 ,14 ,14 ,14 ,14}; 76 #else 77 #error Unknown network devices for this NetBSD architecture. 78 #endif 79 #endif 80 81 #ifdef AIX /* only for the AIX powerpack ;) */ 82 #define NETDEV_NR 4 /* not usefull without it */ 83 char *NETDEV[]={"en","et","tr","fi"}; 84 int HEADSIZE[]={14 ,22 ,22 ,24}; 85 #endif 86 87 #ifdef HPUX /* only for the HPUX powerpack ;) */ 88 #define NETDEV_NR 2 /* not usefull without it */ 89 char *NETDEV[]={"le","sam"}; 90 int HEADSIZE[]={14 ,14 }; 91 #endif 92 93 /**** Global data **********************************************************/ 94 pcap_t *dev_desc; 95 pcap_dumper_t *dev_dump; 96 void *start_dynam; 97 int dynam_len; 98 char Logfile[250]; /* name of logfile */ 99 FILE *LogFILE; /* logfile stream */ 100 /* char *IP; *//* was with older '-p' */ 101 char IP[256]; 102 unsigned long SNIFLEN; /* bytes we need to snif */ 103 short DEST_PORT, SRC_PORT; /* destination port */ 104 char non_printable, *logging_device; 105 106 /**** Global data (packets) *************************************************/ 107 int PROTO_HEAD; /* Base Protocol head length (ethernet, PPP ,....) */ 108 109 char *IP_TYPE_precedence[8]= 110 {"Routine", "Priority", "Immediate", "Flash", "Flash override", 111 "Critical", "Internetwork control", "Network control"}; 112 113 char *IP_PROTOCOL_number[34]= 114 115 {"Reserved","ICMP","IGMP","GGP","Unassigned","ST","TCP","UCL","EGP","IGP", 116 "BBN-MON","NVP-II","PUP","ARGUS","EMCOM","XNET","CHAOS","UDP","MUX", 117 "DCN-MEAS","HMP","PRM","XNS-IDP","TRUNK-1","TRUNK-2","LEAF-1","LEAF-2", 118 "RDP","IRTP","ISO-TP4","NETBLT","MFE-NSP","MERIT-INP","SEP"}; 119 120 121 char *ICMP_type_3_code[6]= 122 {"Net unreachable", "Host unreachable", "Protocol unreachable", 123 "Port unreachable", "Fragmentation needed and DF set", 124 "Source route failed"}; 125 char *ICMP_type_5_code[4]= 126 {"Redirect datagrams for the network", 127 "Redirect datagrams for the host", 128 "Redirect datagrams for the \'type of service\' and the network", 129 "Redirect datagrams for the \'type of service\' and the host"}; 130 char *ICMP_type_11_code[2]= 131 {"Time-to-live exceeded in transmit", 132 "Fragment reassembly time exceeded"}; 133 134 /**** Global data (config) **************************************************/ 135 struct cfg_file_contense *select_from_list; /* pointers for cfg lists */ 136 struct cfg_file_contense *select_to_list; 137 struct cfg_file_contense *deselect_from_list; 138 struct cfg_file_contense *deselect_to_list; 139 140 int select_from_length=0; /* length of cfg lists */ 141 int select_to_length=0; 142 int deselect_from_length=0; 143 int deselect_to_length=0; 144 int Priority=0; /* The higher the priority, the more important */ 145 char dot_notation[20]; /* for easy working, Q&D */ 146 147 /**** Global data (plugins) *************************************************/ 148 char Plugin_Active[10]; 149 150 /**** Global data (interactive) *********************************************/ 151 #ifdef INCLUDE_INTERFACE 152 153 /**** shared memory pointers ************************************************/ 154 char *SHARED, *connection_data, *timing, *running_connections, 155 *logged_connections; 156 int *LISTlength, *DATAlength, memory_id; 157 unsigned int *TCP_nr_of_packets, *ICMP_nr_of_packets, *UDP_nr_of_packets; 158 unsigned int *IP_nr_of_packets; 159 unsigned long *TCP_bytes_in_packets, *UDP_bytes_in_packets; 160 int *DESC_LEN; 161 162 /**** data structures *******************************************************/ 163 struct snif_mask *mask; 164 struct shared_logged_conn *log_conn; 165 FILE *log_dev_stream; 166 struct stat log_dev_stat; 167 168 volatile int LOGGING=0, screen_busy=0; 169 char PACKET_INFO; 170 int POINTpos=0, LISTpos=0; 171 unsigned char COLOR_AVAIL=0; 172 173 /**** screen **************************************************************/ 174 int MASK_WINDOW_ROWS, MASK_WINDOW_COLS; 175 int MAIN_WINDOW_ROWS, MAIN_WINDOW_COLS; 176 int INFO_WINDOW_ROWS, INFO_WINDOW_COLS; 177 int DATA_WINDOW_ROWS, DATA_WINDOW_COLS; 178 int INFO_WINDOW_X, INFO_WINDOW_Y; 179 int MASK_WINDOW_X, MASK_WINDOW_Y; 180 int DATA_WINDOW_X, DATA_WINDOW_Y; 181 182 WINDOW *menu_window; 183 struct box_window data_box, main_box, mask_box, packets_box; 184 int Pid=0; 185 #endif 186 187 /* DEBUG section */ 188 #ifdef DEBUG 189 FILE *debug_dev; 190 unsigned int debug_cnt=0; 191 #endif 192 193 194