1 /* Sniffit Structs File                                                       */
2 
3 #ifndef _SN_STRUCTS_H_
4 #define _SN_STRUCTS_H_
5 
6 #include <stdio.h>
7 #include "sn_packetstructs.h"
8 
9 /**** Global data **********************************************************/
10 struct file_info
11 {
12         char proto, filename[50];
13         FILE *f;
14         unsigned long bytes;
15         _32_bit exp_seq;     /* expected seq to avoid double logging */
16 	int time_out;
17 	char log;                      /* log=0  : do nothing        */
18 	                               /* log=1  : log 'login'       */
19 	                               /* log=2  : 'login' logged    */
20 	                               /* log=3  : log password      */
21 	                               /* log=4  : password logged   */
22 	                               /* log=99 : no more detection */
23 	char scroll_buf[SCBUF+1];                  /* scroll buffer */
24 	char *buffer;			     /* pointer to a buffer */
25 	struct file_info *next;
26 };
27 
28 /**** Global data (config) **************************************************/
29 struct cfg_file_contense
30 {
31 unsigned char host[16];
32 unsigned int priority;
33 unsigned char wildcard;
34 unsigned short port;
35 };
36 
37 /**** Global data (plugins) *************************************************/
38 struct Plugin_data {
39 	struct unwrap PL_info;
40 	struct IP_header PL_iphead;
41 	struct TCP_header PL_tcphead;
42 	struct UDP_header PL_udphead;
43 	unsigned char PL_data[MTU];
44 	unsigned char PL_packet[MTU];
45 };
46 
47 /**** Global data (interactive) *********************************************/
48 #ifdef INCLUDE_INTERFACE
49 #include "sn_curses.h"
50 
51 struct box_window
52 {
53 	WINDOW *main_window, *work_window;
54 };
55 
56 
57 struct shared_conn_data           /* shared memory connection datastructure */
58   {
59   char connection [CONN_NAMELEN];                 /* full ID string of conn */
60   char desc [DESC_BYTES];                         /* connection description */
61   int timeout;
62   };
63 struct shared_logged_conn            /* shared memory logging datastructure */
64   {
65   char log_enter [CONN_NAMELEN];                          /* normal logging */
66   };
67 struct snif_mask                                         /* struct for mask */
68   {
69   _32_bit source_ip, destination_ip;
70   _16_bit source_port, destination_port;
71   };
72 
73 /* (packet generation) */
74 struct generate_mask
75 {
76 	_32_bit dest_ip, source_ip;
77 	_16_bit	dest_port, source_port;
78 	_32_bit 	pkt_no;
79 };
80 
81 struct sp_data_exchange {
82         int fd;                                /* Sh!t from transmit_TCP  */
83         char *data;
84         int datalen;
85         _32_bit source; unsigned short source_port;
86         _32_bit dest;   unsigned short dest_port;
87         _32_bit seq, ack;
88         unsigned short flags;
89         char *buffer;               /* work buffer */
90         int IP_optlen;             /* IP options length in bytes  */
91         int TCP_optlen;            /* TCP options length in bytes */
92         };
93 #endif
94 
95 #endif
96