forked from robertdavidgraham/masscan
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathout-null.c
85 lines (76 loc) · 2.79 KB
/
out-null.c
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
#include "output.h"
#include "masscan.h"
/****************************************************************************
* This function doesn't really "open" the file. Instead, the purpose of
* this function is to initialize the file by printing header information.
****************************************************************************/
static void
null_out_open(struct Output *out, FILE *fp)
{
UNUSEDPARM(out);
UNUSEDPARM(fp);
}
/****************************************************************************
* This function doesn't really "close" the file. Instead, it's purpose
* is to print trailing information to the file. This is pretty much only
* a concern for XML files that need stuff appeneded to the end.
****************************************************************************/
static void
null_out_close(struct Output *out, FILE *fp)
{
UNUSEDPARM(out);
UNUSEDPARM(fp);
}
/****************************************************************************
* Prints out the status of a port, which is almost always just "open"
* or "closed".
****************************************************************************/
static void
null_out_status(struct Output *out, FILE *fp, time_t timestamp,
int status, unsigned ip, unsigned ip_proto, unsigned port, unsigned reason, unsigned ttl)
{
UNUSEDPARM(timestamp);
UNUSEDPARM(out);
UNUSEDPARM(fp);
UNUSEDPARM(status);
UNUSEDPARM(ip_proto);
UNUSEDPARM(ip);
UNUSEDPARM(port);
UNUSEDPARM(reason);
UNUSEDPARM(ttl);
}
/****************************************************************************
* Prints out "banner" information for a port. This is done when there is
* a protocol defined for a port, and we do some interaction to find out
* more information about which protocol is running on a port, it's version,
* and other useful information.
****************************************************************************/
static void
null_out_banner(struct Output *out, FILE *fp, time_t timestamp,
unsigned ip, unsigned ip_proto, unsigned port,
enum ApplicationProtocol proto, unsigned ttl,
const unsigned char *px, unsigned length)
{
UNUSEDPARM(ttl);
UNUSEDPARM(timestamp);
UNUSEDPARM(out);
UNUSEDPARM(fp);
UNUSEDPARM(ip);
UNUSEDPARM(ip_proto);
UNUSEDPARM(port);
UNUSEDPARM(proto);
UNUSEDPARM(px);
UNUSEDPARM(length);
}
/****************************************************************************
* This is the only structure exposed to the rest of the system. Everything
* else in the file is defined 'static' or 'private'.
****************************************************************************/
const struct OutputType null_output = {
"null",
0,
null_out_open,
null_out_close,
null_out_status,
null_out_banner
};