45# include <sys/utsname.h>
55# include <sys/types.h>
56# include <sys/socket.h>
57# include <netinet/in.h>
58# include <arpa/inet.h>
98 <<
" DNS Gateway" <<
h1() <<
endl;
103 if(
ip != (*cgi).end()) {
113 <<
" - IP address must be of the form x.x.x.x"
121 <<
" - Host information for " <<
em((**
ip)) <<
" not found."
125 for(
p =
hp->h_addr_list; *
p != 0;
p++) {
133 <<
" - " <<
' ' <<
hp->h_name;
143 if(
name != (*cgi).end()) {
153 <<
" - Host information for " <<
em(**
name) <<
" not found."
157 for(
p =
hp->h_addr_list; *
p != 0;
p++) {
173 cout <<
p(
"Please enter an IP address or a hostname.") <<
endl;
177 cout <<
"<form method=\"post\" action=\""
178 <<
cgi.getEnvironment().getScriptName() <<
"\">" <<
endl;
182 cout <<
td().
set(
"class",
"data") <<
"<input type=\"text\" name=\"ip\"";
183 if(
ip != (*cgi).end())
184 cout <<
" value=\"" << **
ip <<
"\">";
189 cout <<
"<form method=\"post\" action=\""
190 <<
cgi.getEnvironment().getScriptName() <<
"\">" <<
endl;
195 <<
"<input type=\"text\" name=\"hostname\"";
196 if(
name != (*cgi).end())
197 cout <<
" value=\"" << **
name <<
"\">";
206 cout <<
"GNU cgi" <<
span(
"cc").
set(
"class",
"red") <<
" v"
208 cout <<
"Compiled at " <<
cgi.getCompileTime()
209 <<
" on " <<
cgi.getCompileDate() <<
br() <<
endl;
211 cout <<
"Configured for " <<
cgi.getHost();
216 cout <<
". Running on " <<
info.sysname;
217 cout <<
' ' <<
info.release <<
" (";
228 long us = ((
end.tv_sec -
start.tv_sec) * 1000000)
231 cout <<
br() <<
"Total time for request = " <<
us <<
" us";
232 cout <<
" (" <<
static_cast<double>(
us/1000000.0) <<
" s)";
242 catch(
const std::exception&
e) {
Platform and operating system specific macro definitions.
The main header file for the GNU cgicc library.
The header file containing HTML output classes.
The main class of the GNU cgicc library.
Template for concrete atomic HTMLElement subclasses.
HTMLAtomicElement()
Create a new empty atomic element.
Specifies the DTD of the HTML 4 document.
HTMLElement & set(const std::string &name)
Set an HTMLAttribute on this HTMLElement.
The namespace containing the cgicc library.
std::vector< FormEntry >::iterator form_iterator
A vector of FormEntry objects.
HTMLAttributeList set(const std::string &name)
Create a new HTMLAttributeList, and set an HTMLAttribute.