forked from cnamejj/cli-tools
-
Notifications
You must be signed in to change notification settings - Fork 0
/
quipi.h
100 lines (78 loc) · 1.95 KB
/
quipi.h
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
#ifndef ___CNAMEjj_QUIPI_H__
#define ___CNAMEjj_QUIPI_H__
/* --- */
#define OK 0
#define NO_HOSTNAME "n/a"
#define NO_IP4_ADDR "0.0.0.0"
#define NO_IP6_ADDR "::0"
#define LOOKUP_FAILED "lookup-failed"
#define LOOKUP_NONAME "no-hostname"
#define ADDR_UNRECOG 0
#define ADDR_IPV4 1
#define ADDR_IPV6 2
/* --- */
#define OP_DEBUG 1
#define OP_HELP 2
#define OP_LOOKUP 3
#define FL_DEBUG "debug"
#define FL_HELP "help"
#define FL_LOOKUP "lookup"
#define DEF_DEBUG "0"
#define DEF_HELP "0"
#define DEF_LOOKUP ""
/* --- */
#define DEBUG_NONE 0
#define DEBUG_LOW1 1
#define DEBUG_LOW2 2
#define DEBUG_LOW3 3
#define DEBUG_MEDIUM1 4
#define DEBUG_MEDIUM2 5
#define DEBUG_MEDIUM3 6
#define DEBUG_HIGH1 7
#define DEBUG_HIGH2 8
#define DEBUG_HIGH3 9
#define DEBUG_NOISY1 10
#define DEBUG_NOISY2 11
#define DEBUG_NOISY3 12
/* --- */
#define HTML_RESP_HEADER "\
Content-Type: text/html\n\
\n\
<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\"\n\
\"http://www.w3.org/TR/html4/loose.dtd\">\n\
<html><head><title>QUick IP Info</title>\n\
</head>\n\
<body bgcolor=\"#ffffff\">\n\
"
#define HTML_RESP_START "\
<pre>\n\
"
#define HTML_RESP_CLOSE "\
</pre>\n\
</body>\n\
</html>\n\
"
#define HTTP_FORM_TEMPLATE "\
</pre>\n\
<br>Source for QUick-IP-Info (quipi) is available in the <a href=\"https://github.com/cnamejj/cli-tools\">cli-tools</a>\
repository on GitHub\n\
<br> <br>\n\
<form action=\"http://%s%s%s%s\" method=\"GET\">\n\
<br>List of hostnames and/or IP's\n\
<br><textarea name=\"lookup\" rows=\"10\" cols=\"80\">\n\
</textarea>\n\
<br>Show debug info: <input name=\"debug\" type=\"checkbox\" value=\"15\">\n\
<br><input type=\"submit\" value=\"Lookup\">\n\
</form>\n\
<pre>\n\
"
#define HTTP_FORM_GEN_ERROR "CGI environment error, can't determine server info required to generate input form.\n"
/* --- */
#define MSG_SHOW_SYNTAX "\n\
Syntax is: %s <options> host-or-ip1 host-or-ip2 ...\n\
Options are:\n\
<--help>\n\
<--debug level>\n\
"
/* --- */
#endif