1 /* Sniffit Defines File */ 2 3 #include "sn_config.h" 4 5 /*** typedefs ******************/ 6 7 #ifdef USE_32_LONG_INT 8 typedef unsigned long int _32_bit; 9 #endif 10 #ifdef USE_32_INT 11 typedef unsigned int _32_bit; 12 #endif 13 typedef unsigned short _16_bit; 14 15 /*** Normal Sniffit operations */ 16 17 #define VERSION "0.5" /* Program Version */ 18 #define SNAPLEN MTU /* Ethernet Packet Length */ 19 #define MSDELAY 1000 /* pcap timeout */ 20 #define PACKETS 1 /* pcap dispatch */ 21 #define CNT -1 /* pcap loop count */ 22 #define LENGTH_OF_INTERPROC_DATA 5*SNAPLEN /* buffer capacity */ 23 #define SCBUF 30 /* scroll buffer length */ 24 #define LOG_PASS_BUF 20+1 /* login/pwd buffer length */ 25 #define TELNET_ENTER 0x0d /* Enter in telnet login session */ 26 #define FTP_ENTER 0x0d /* first char of Enter in FTP login session */ 27 28 #define DEST 0 29 #define SOURCE 1 30 #define BOTH 2 31 #define INTERACTIVE 99 32 33 /* Packet examining defines (finish) */ 34 /* 0-9 : TCP */ 35 /* 10-19: ICMP */ 36 /* 20-29: UDP */ 37 #define DROP_PACKET -2 /* Skip Packet completely */ 38 #define DONT_EXAMINE -1 /* Skip Packet */ 39 #define TCP_EXAMINE 0 /* TCP - 'for us' */ 40 #define TCP_FINISH 1 /* TCP - end connection */ 41 #define TCP_EX_FRAG_HEAD 2 /* defined lower */ 42 #define TCP_EX_FRAG_NF 3 43 #define ICMP_EXAMINE 10 /* ICMP - examine */ 44 #define UDP_EXAMINE 20 /* UDP - examine */ 45 46 #define F_TCP 1 /* Flags for PROTOCOLS */ 47 #define F_ICMP 2 48 #define F_UDP 4 49 #define F_IP 8 50 51 /*** Logparam defines */ 52 53 #define LOGPARAM_LOG_ON 1 54 #define LOGPARAM_RAW 2 55 #define LOGPARAM_NORM 4 56 #define LOGPARAM_TELNET 8 57 #define LOGPARAM_FTP 16 58 #define LOGPARAM_MAIL 32 59 60 /*** Interface defines */ 61 62 #ifdef INCLUDE_INTERFACE 63 #define ENTER 13 64 65 #define WIN_COLOR_NORMAL 1 /* Color pairs for various functions */ 66 #define WIN_COLOR_POINT 2 67 #define WIN_COLOR_DATA 3 68 #define WIN_COLOR_INPUT 4 69 #define WIN_COLOR_MENU 5 70 #define WIN_COLOR_PACKET_INFO 6 71 #define WIN_COLOR_PKTCNT 7 72 73 #define CONN_NAMELEN 56 /* length of string */ 74 #define DESC_BYTES 60 /* length of description */ 75 76 #define MENU " Masks: F1-Source IP F2-Dest. IP F3-Source Port F4-Dest. Port" 77 #endif 78 79 /* First undefine all Plugins, just to be sure */ 80 81 #undef PLUGIN0_NAME 82 #undef PLUGIN1_NAME 83 #undef PLUGIN2_NAME 84 #undef PLUGIN3_NAME 85 #undef PLUGIN4_NAME 86 #undef PLUGIN5_NAME 87 #undef PLUGIN6_NAME 88 #undef PLUGIN7_NAME 89 #undef PLUGIN8_NAME 90 #undef PLUGIN9_NAME 91 92 93 #define IP_VERSION 4 94 95 #define URG 32 /*TCP-flags */ 96 #define ACK 16 97 #define PSH 8 98 #define RST 4 99 #define SYN 2 100 #define FIN 1 101 102 /* unwrap packet */ 103 #define NOT_SUPPORTED -1 104 #define NO_IP 0 105 #define NO_IP_4 1000 106 #define CORRUPT_IP 1001 107 #define TCP_FRAG_HEAD 1002 108 #define UDP_FRAG_HEAD 1003 109 #define ICMP_FRAG_HEAD 1004 110 #define ICMP 1 /* Protocol Numbers */ 111 #define TCP 6 112 #define UDP 17 113 114 #define ICMP_HEADLENGTH 4 /* fixed ICMP header length */ 115 #define UDP_HEADLENGTH 8 /* fixed UDP header length */ 116 117 #define IP_DELAY 32 118 #define IP_THROUGHPUT 16 119 #define IP_RELIABILITY 8 120 121 #define IP_DF 2 122 #define IP_MF 1 123 124 /*** ICMP types ********************************************************/ 125 #define ICMP_TYPE_0 "Echo reply" 126 #define ICMP_TYPE_3 "Destination unreachable" 127 #define ICMP_TYPE_4 "Source quench" 128 #define ICMP_TYPE_5 "Redirect" 129 #define ICMP_TYPE_8 "Echo" 130 #define ICMP_TYPE_11 "Time exceeded" 131 #define ICMP_TYPE_12 "Parameter problem" 132 #define ICMP_TYPE_13 "Timestamp" 133 #define ICMP_TYPE_14 "Timestamp reply" 134 #define ICMP_TYPE_15 "Information request" 135 #define ICMP_TYPE_16 "Information reply" 136 #define ICMP_TYPE_17 "Address mask request" 137 #define ICMP_TYPE_18 "Address mask reply" 138 139 /*** Services (standardised) *******************************************/ 140 #define FTP_DATA_1 20 141 #define FTP_1 21 142 #define SSH_1 22 143 #define TELNET_1 23 144 #define MAIL_1 25 145 #define IDENT_1 113 146 #define HTTP_1 80 147 #define HTTP_2 80 148 #define HTTP_3 80 149 #define HTTP_4 80 150 #define IRC_1 6667 151 #define X11_1 6000 152 153