17int main(
int argc,
char* argv[])
26 JParser<> zap(
"Example program to print IP address.");
28 zap[
'H'] =
make_field(host_name) =
"localhost";
32 catch(
const exception &error) {
33 FATAL(error.what() << endl);
37 int ip = getIPnumber(host_name);
39 cout <<
"IP number " << ip << endl;
40 cout <<
"IP address " << getIPaddress(ip) << endl;
41 cout <<
"host name " << getHostname(ip) << endl;
43 << dec << getSubaddress(ip) <<
" (dec)" <<
' '
44 << hex << getSubaddress(ip) <<
" (hex)" << endl;
50 for (vector<string>::const_iterator i = result.begin(); i != result.end(); ++i) {
51 cout <<
"IP address " << *i << endl;