4
This program is free software; you can redistribute it and/or modify
5
it under the terms of the GNU General Public License as published by
6
the Free Software Foundation; either version 2 of the License, or
7
(at your option) any later version.
9
This program is distributed in the hope that it will be useful,
10
but WITHOUT ANY WARRANTY; without even the implied warranty of
11
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
GNU General Public License for more details.
14
You should have received a copy of the GNU General Public License
15
along with this program; if not, write to the Free Software
16
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
20
#include "../include/nast.h"
22
#ifdef HAVE_LIBNCURSES /*don't compile if we haven't ncurses*/
26
# define SAFE_WREFRESH(x) do { wrefresh(x); } while(0)
28
# define SAFE_WIN_REFRESH(x) do { wrefresh(x->win); } while(0)
29
# define SAFE_FREE(x) do{ if(x) { free(x); x = NULL; } }while(0)
31
# define SAFE_SCROLL_REFRESH(sx) do { \
32
pnoutrefresh(sx->win, sx->y_scroll, 0, sx->y + 1, sx->x + 1, sx->y + sx->lines - 2, sx->cols - 1 ); \
33
wnoutrefresh(sx->out); \
37
# define POLL_WGETCH(x, y) do { \
38
struct pollfd poll_fd = { \
42
poll(&poll_fd, 1, 1); \
43
if (poll_fd.revents & POLLIN) \
49
struct scrolling_window
61
typedef struct scrolling_window N_SCROLLWIN;
63
N_SCROLLWIN *newscrollwin(int lines, int cols, int y, int x, char *title, int maxlines);
64
void redrawscrollwin(N_SCROLLWIN *win, int focus);
65
void drawscroller(N_SCROLLWIN *win);
66
void winscroll(N_SCROLLWIN *win, int delta);
67
void delscrollwin(N_SCROLLWIN **win);
70
int sniffer_menu(void);
71
int analyzer_menu(void);
72
int options_menu(void);
73
void pop_up_win(void);
74
void *conn_db(void *threadarg);
75
void *conn_db_r(void *threadarg);
76
int connection(char *dev,u_long ip_src,u_long ip_dst,u_short sport,u_short dport);
77
int rst_connection_db(char *dev,u_long ip_src,u_long ip_dst,u_short sport,u_short dport);
78
int reset_conn(char *dev,u_long s_ip, u_long d_ip, u_short s_port, u_short d_port,u_long seq, u_long ack);
79
int streamg (char *dev,char *sfilter);
80
void data_sniffo_stream (char *data_info, u_int len);
82
int reset(char *dev, char *sfilter);
83
int check_pthread(void);
84
int shutdown_thread(void);
101
u_short promisc,hex,ascii,ld,f,lr,l;
111
/*descriptor for stream*/
113
pcap_dumper_t *dumper;
115
/* thread for database connections */
134
struct thread_conn_rst
144
struct thread_conn th_data[1];
145
struct thread_conn_rst th_r_data[1];
146
struct thread_arp th_arp_data[1];
152
unsigned short s_port;
153
unsigned short d_port;
163
/* connection struct */
167
/*filter for tcp stream*/
179
/* num max of db connections */