aboutsummaryrefslogtreecommitdiff
path: root/plugins/utils.c
diff options
context:
space:
mode:
authorGravatar Jeremy T. Bouse <undrgrid@users.sourceforge.net> 2003-03-15 01:25:35 +0000
committerGravatar Jeremy T. Bouse <undrgrid@users.sourceforge.net> 2003-03-15 01:25:35 +0000
commit11b35b92e3195d230bef359f6a0679ae4414716b (patch)
treef4911e5804c1f3037dcf63bbbf0b823c5ac19e5f /plugins/utils.c
parent6cf5fc3c74c0bdfef6c4cc1b627578378ad3a407 (diff)
downloadmonitoring-plugins-11b35b92e3195d230bef359f6a0679ae4414716b.tar.gz
Spent the day working on backwards compatability using getaddrinfo()
Moved getaddrinfo.? and gethostbyname.? from lib/ to plugins/ due to problems with compiling into the libnagiosplug.a as it required linking against socket libraries which are unneeded except for network based plugins. This code should hopefully happily work for all systems and has been tested prior to commit on Debian GNU/Linux, SPARC Solaris 7 and SPARC Solaris 9. git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@424 f882894a-f735-0410-b71e-b25c423dba1c
Diffstat (limited to 'plugins/utils.c')
-rw-r--r--plugins/utils.c81
1 files changed, 0 insertions, 81 deletions
diff --git a/plugins/utils.c b/plugins/utils.c
index 7361323f..e204e238 100644
--- a/plugins/utils.c
+++ b/plugins/utils.c
@@ -27,15 +27,6 @@ void print_revision (const char *, const char *);
void terminate (int, const char *fmt, ...);
RETSIGTYPE timeout_alarm_handler (int);
-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 *);
int is_intpos (char *);
int is_intneg (char *);
@@ -171,78 +162,6 @@ timeout_alarm_handler (int signo)
}
int
-is_host (char *address)
-{
- if (is_addr (address) || is_hostname (address))
- return (TRUE);
-
- return (FALSE);
-}
-
-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);
-}
-
-int
-resolve_host_or_addr (char *address, int family)
-{
- struct addrinfo hints;
- struct addrinfo *res;
- int retval;
-
- memset (&hints, 0, sizeof (hints));
- hints.ai_family = family;
- retval = getaddrinfo (address, NULL, &hints, &res);
-
- if (retval != 0)
- return FALSE;
- else {
- freeaddrinfo (res);
- return TRUE;
- }
-}
-
-int
-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
- *
- * The labels must follow the rules for ARPANET host names. They must
- * start with a letter, end with a letter or digit, and have as interior
- * characters only letters, digits, and hyphen. There are also some
- * restrictions on the length. Labels must be 63 characters or less. */
-
-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
is_numeric (char *number)
{
char tmp[1];