aboutsummaryrefslogtreecommitdiff
path: root/plugins/utils.c
diff options
context:
space:
mode:
authorGravatar Jeremy T. Bouse <undrgrid@users.sourceforge.net> 2003-03-12 17:11:20 +0000
committerGravatar Jeremy T. Bouse <undrgrid@users.sourceforge.net> 2003-03-12 17:11:20 +0000
commit48442b777389cfecb95f07b800d69dbac24130f0 (patch)
tree89503205708962a022c89c26fc0f5159ec3b9f62 /plugins/utils.c
parent46b0e78076a4c712f9c58b4f7804ba50b5895f46 (diff)
downloadmonitoring-plugins-48442b777389cfecb95f07b800d69dbac24130f0.tar.gz
Added autogen.sh script that rebuilds using autotools and runs configure
Modified configure.in to include some debug build option info at the end of the scripts execution. Can be removed by release time. Modified configure.in to include a --with-ipv6 option Default build is without IPv6 support now to enable you need to use the --with-ipv6 command line option to configure. Modified plugins/utils.* to use USE_IPV6 git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@410 f882894a-f735-0410-b71e-b25c423dba1c
Diffstat (limited to 'plugins/utils.c')
-rw-r--r--plugins/utils.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/plugins/utils.c b/plugins/utils.c
index 0d250677..9ac5596e 100644
--- a/plugins/utils.c
+++ b/plugins/utils.c
@@ -32,7 +32,9 @@ int is_host (char *);
int is_addr (char *);
int resolve_host_or_addr (char *, int);
int is_inet_addr (char *);
+#ifdef USE_IPV6
int is_inet6_addr (char *);
+#endif
int is_hostname (char *);
int is_integer (char *);
@@ -181,7 +183,11 @@ is_host (char *address)
int
is_addr (char *address)
{
+#ifdef USE_IPV6
if (is_inet_addr (address) || is_inet6_addr (address))
+#else
+ if (is_inet_addr (address))
+#endif
return (TRUE);
return (FALSE);
@@ -212,11 +218,13 @@ is_inet_addr (char *address)
return resolve_host_or_addr (address, AF_INET);
}
+#ifdef USE_IPV6
int
is_inet6_addr (char *address)
{
return resolve_host_or_addr (address, AF_INET6);
}
+#endif
/* from RFC-1035
*
@@ -228,7 +236,11 @@ is_inet6_addr (char *address)
int
is_hostname (char *s1)
{
+#ifdef USE_IPV6
return resolve_host_or_addr (s1, AF_UNSPEC);
+#else
+ return resolve_host_or_addr (s1, AF_INET);
+#endif
}
int