File: gcc-10

package info (click to toggle)
nast 0.2.0-12
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 1,804 kB
  • sloc: ansic: 7,516; sh: 2,768; makefile: 63
file content (327 lines) | stat: -rw-r--r-- 6,256 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
--- a/include/nast.h
+++ b/include/nast.h
@@ -95,32 +95,32 @@
 void init_scr(void);
 
 /* variable */
-FILE *logd;
-short offset;
-int npkt;
-u_char *packet;
-u_char *buf;
-struct pcap_pkthdr hdr;
-pcap_t* descr;
-pcap_dumper_t *dumper;
-struct pcap_stat statistic;
-bpf_u_int32 maskp;          /* subnet mask               */
-bpf_u_int32 netp;  	    /* ip                        */
-int datalink;
-struct bpf_program fp;      /* hold compiled program     */
-char *logname;
-char *tcpdl;
-u_short tr,tl;
-u_short graph;              /* global var for ncurses mode */
-u_short cont;
+extern FILE *logd;
+extern short offset;
+extern int npkt;
+extern u_char *packet;
+extern u_char *buf;
+extern struct pcap_pkthdr hdr;
+extern pcap_t* descr;
+extern pcap_dumper_t *dumper;
+extern struct pcap_stat statistic;
+extern bpf_u_int32 maskp;          /* subnet mask               */
+extern bpf_u_int32 netp;  	    /* ip                        */
+extern int datalink;
+extern struct bpf_program fp;      /* hold compiled program     */
+extern char *logname;
+extern char *tcpdl;
+extern u_short tr,tl;
+extern u_short graph;              /* global var for ncurses mode */
+extern u_short cont;
 /* golbal var*/
-int stream_glob;
-int bc_glob;
-int sniff_glob;
-int rst_glob;
-int arp_glob;
-pthread_t pt[2];
-int lg;
+extern int stream_glob;
+extern int bc_glob;
+extern int sniff_glob;
+extern int rst_glob;
+extern int arp_glob;
+extern pthread_t pt[2];
+extern int lg;
 
 struct host
 {
@@ -129,13 +129,13 @@
 };
 
 /* time variable */
-time_t tm;
-char timed[60];
+extern time_t tm;
+extern char timed[60];
 
 /* for demonize nast */
-u_short demonize;
+extern u_short demonize;
 
-int line_s;
-int row_s;
+extern int line_s;
+extern int row_s;
 
 
--- a/main.c
+++ b/main.c
@@ -26,6 +26,43 @@
 # include "missing/getopt.h"
 #endif
 
+/* variable */
+FILE *logd;
+short offset;
+int npkt;
+u_char *packet;
+u_char *buf;
+struct pcap_pkthdr hdr;
+pcap_t* descr;
+struct pcap_stat statistic;
+bpf_u_int32 maskp;          /* subnet mask               */
+bpf_u_int32 netp;  	    /* ip                        */
+int datalink;
+struct bpf_program fp;      /* hold compiled program     */
+char *logname;
+char *tcpdl;
+u_short tr,tl;
+u_short graph;              /* global var for ncurses mode */
+u_short cont;
+/* golbal var*/
+int stream_glob;
+int bc_glob;
+int sniff_glob;
+int rst_glob;
+int arp_glob;
+pthread_t pt[2];
+int lg;
+
+/* time variable */
+time_t tm;
+char timed[60];
+
+/* for demonize nast */
+u_short demonize;
+
+int line_s;
+int row_s;
+
 void usage(char *name);
 
 int main(int argc,char **argv)
--- a/ncurses/n_nast.c
+++ b/ncurses/n_nast.c
@@ -21,6 +21,48 @@
 
 #ifdef HAVE_LIBNCURSES
 
+WINDOW *query;
+WINDOW *werror;
+WINDOW *help;
+N_SCROLLWIN *princ;
+N_SCROLLWIN *winfo;
+N_SCROLLWIN *wstream;
+N_SCROLLWIN *wconn;
+
+MENU *my_nmenu;
+ITEM *curr_item;
+WINDOW *my_nmenu_win;
+WINDOW *pop_up;
+
+u_short mvar;
+u_short promisc,hex,ascii,ld,f,lr,l;
+u_short flg;
+int linm;
+int fileds;
+char dev[10];
+char n_filter[60];
+char ldfile[50];
+char tcpdfile[50];
+char reportl[50];
+char logfile[50];
+/*descriptor for stream*/
+pcap_t* str;
+pcap_dumper_t *dumper;
+
+/* thread for database connections */
+pthread_t thID[7];
+
+struct thread_conn th_data[1];
+struct thread_conn_rst th_r_data[1];
+struct thread_arp th_arp_data[1];
+
+struct connections c_inf[30];
+
+struct cnn sf[30];
+
+/* num max of db connections */
+int nmax;
+
 void init_curs(void);
 void title(void);
 int get_info(void);
--- a/ncurses/n_nast.h
+++ b/ncurses/n_nast.h
@@ -84,36 +84,36 @@
 int shutdown_thread(void);
 void help_win(void);
 
-WINDOW *query;
-WINDOW *werror;
-WINDOW *help;
-N_SCROLLWIN *princ;
-N_SCROLLWIN *winfo;
-N_SCROLLWIN *wstream;
-N_SCROLLWIN *wconn;
-
-MENU *my_nmenu;
-ITEM *curr_item;
-WINDOW *my_nmenu_win;
-WINDOW *pop_up;
-
-u_short mvar;
-u_short promisc,hex,ascii,ld,f,lr,l;
-u_short flg;
-int linm;
-int fileds;
-char dev[10];
-char n_filter[60];
-char ldfile[50];
-char tcpdfile[50];
-char reportl[50];
-char logfile[50];
+extern WINDOW *query;
+extern WINDOW *werror;
+extern WINDOW *help;
+extern N_SCROLLWIN *princ;
+extern N_SCROLLWIN *winfo;
+extern N_SCROLLWIN *wstream;
+extern N_SCROLLWIN *wconn;
+
+extern MENU *my_nmenu;
+extern ITEM *curr_item;
+extern WINDOW *my_nmenu_win;
+extern WINDOW *pop_up;
+
+extern u_short mvar;
+extern u_short promisc,hex,ascii,ld,f,lr,l;
+extern u_short flg;
+extern int linm;
+extern int fileds;
+extern char dev[10];
+extern char n_filter[60];
+extern char ldfile[50];
+extern char tcpdfile[50];
+extern char reportl[50];
+extern char logfile[50];
 /*descriptor for stream*/
-pcap_t* str;
-pcap_dumper_t *dumper;
+extern pcap_t* str;
+extern pcap_dumper_t *dumper;
 
 /* thread for database connections */
-pthread_t thID[7];
+extern pthread_t thID[7];
 
 struct thread_conn
 {
@@ -141,9 +141,9 @@
    int thread_id;
 };
 
-struct thread_conn th_data[1];
-struct thread_conn_rst th_r_data[1];
-struct thread_arp th_arp_data[1];
+extern struct thread_conn th_data[1];
+extern struct thread_conn_rst th_r_data[1];
+extern struct thread_arp th_arp_data[1];
 
 struct connections
 {
@@ -157,8 +157,9 @@
    int pr;
    int set;
 
-}
-c_inf[30];
+};
+
+extern struct connections c_inf[30];
 
 /* connection struct */
 struct cnn
@@ -173,11 +174,12 @@
    u_short s_port;
    u_short d_port;
    int cont;
-}
-sf[30];
+};
+
+extern struct cnn sf[30];
 
 /* num max of db connections */
-int nmax;
+extern int nmax;
 
 #endif
 
--- a/map.c
+++ b/map.c
@@ -40,7 +40,7 @@
 struct host * map_lan(char *dev, u_short mode, u_short * n);
 u_int scan_ulong(char *s, u_long *u);
 
-int line;
+extern int line;
 
 u_char enet_dst[6] =        /* broadcast */
 {
--- a/ncurses/n_conn.c
+++ b/ncurses/n_conn.c
@@ -31,7 +31,7 @@
 int lines = 1;
 
 int z = 0;
-int tmp;
+extern int tmp;
 
 int connection(char *dev,u_long ip_src,u_long ip_dst,u_short sport,u_short dport)
 {
--- a/ncurses/n_stream.c
+++ b/ncurses/n_stream.c
@@ -28,7 +28,7 @@
 
 int line = 1;
 int col = 3;
-int tmp;
+extern int tmp;
 
 struct stream_thread
 {
--- a/rst.c
+++ b/rst.c
@@ -24,7 +24,7 @@
    u_long seq;
    u_long ack;
 };
-char errbuf[256];
+extern char errbuf[256];
 struct pkt info;
 
 /* reset a connection */