-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathsettings.h
More file actions
96 lines (73 loc) · 1.81 KB
/
settings.h
File metadata and controls
96 lines (73 loc) · 1.81 KB
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
#ifndef _SETTINGS_H
# define _SETTINGS_H
#include "config.h"
#define DBG(msg, args...)\
if (s->verbose > 4) {\
fprintf(stderr, "%sDEBUG %s:%u: " msg "\n", s != NULL && s->output_sql ? SQL_COMMENT : "", __FILE__, __LINE__, ## args);\
}
#define ERR(msg, args...)\
fprintf(stderr, "%sERROR %s:%u: " msg "\n", s != NULL && s->output_sql ? SQL_COMMENT : "", __FILE__, __LINE__, ## args);
#define assert(f) \
if (! ( f ) ) { \
PANIC("Assertion `%s' fails", # f); \
}
#define PANIC(fmt, args...) \
do { \
\
fprintf(stderr, "PANIC at %s:%u " fmt "\n", __FILE__, __LINE__, ## args); \
if (s->verbose > 4) { \
fprintf(stderr, "Attach to pid %d , called from %s() %s:%d\n", getpid(), __FUNCTION__, __FILE__, __LINE__); \
pause(); \
} \
abort(); \
} while (0)
#define OUT(fmt, args...) \
do { \
if (s->output_sql) { \
fprintf(stdout, "--" fmt "\n", ## args); \
} \
else { \
fprintf(stdout, fmt "\n", ## args); \
} \
} while (0)
#define OUTSQL(fmt, args...) \
do { \
fprintf(stdout, fmt "\n", ## args); \
} while(0)
#define OUT_FLUSH fflush(stdout)
#define OUTPUT_FORWARD 1
#define OUTPUT_REVERSE 2
#define OUTPUT_ALIAS 3
typedef struct settings_t {
char *dictfile;
char *targets[MAX_TARGETS];
char *cur_target;
int verbose;
char *allowed; /* for brute force mode */
char *sillyhostname;
int mode;
#define MODE_BRUTE 1
#define MODE_REVERSE 2
#define MODE_DICT 3
int output_sql;
int ipv6_lookup;
int ipv4_lookup;
int discover;
int exact;
int filter_unique;
void *uniq;
unsigned int concurrency;
int async;
struct sockaddr_list_t **wc_list;
void *wc_sc;
int brute_lenmin;
int brute_lenmax;
struct sockaddr_storage netid;
struct sockaddr_storage netmask;
unsigned int cmask;
time_t start;
unsigned int replies;
unsigned int lookups;
} settings_t;
extern settings_t *s;
#endif