From d77d183ddb8bdff5069ba5fa008406087162d117 Mon Sep 17 00:00:00 2001 From: "Jeremy T. Bouse" Date: Sun, 29 Jun 2003 06:36:55 +0000 Subject: Added address_family extern int variable to netutils to allow for -4 & -6 options for explicit connection protocol Added support for -4 & -6 options to check_ssh and check_tcp for testing git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@568 f882894a-f735-0410-b71e-b25c423dba1c --- plugins/check_ssh.c | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) (limited to 'plugins/check_ssh.c') diff --git a/plugins/check_ssh.c b/plugins/check_ssh.c index f3a351e6..421fc01c 100644 --- a/plugins/check_ssh.c +++ b/plugins/check_ssh.c @@ -68,6 +68,8 @@ process_arguments (int argc, char **argv) static struct option long_options[] = { {"version", no_argument, 0, 'V'}, {"help", no_argument, 0, 'h'}, + {"use-ipv4", no_argument, 0, '4'}, + {"use-ipv6", no_argument, 0, '6'}, {"verbose", no_argument, 0, 'v'}, {"timeout", required_argument, 0, 't'}, {"host", required_argument, 0, 'H'}, @@ -82,7 +84,7 @@ process_arguments (int argc, char **argv) strcpy (argv[c], "-t"); while (1) { - c = getopt_long (argc, argv, "+Vhvt:H:p:", long_options, &option_index); + c = getopt_long (argc, argv, "+Vhv46t:H:p:", long_options, &option_index); if (c == -1 || c == EOF) break; @@ -104,6 +106,12 @@ process_arguments (int argc, char **argv) usage ("Timeout Interval must be an integer!\n\n"); socket_timeout = atoi (optarg); break; + case '4': + address_family = AF_INET; + break; + case '6': + address_family = AF_INET6; + break; case 'H': /* host */ if (is_host (optarg) == FALSE) usage ("Invalid hostname/address\n"); @@ -217,7 +225,10 @@ print_usage (void) ("Usage:\n" " %s -t [timeout] -p [port] \n" " %s -V prints version info\n" - " %s -h prints more detailed help\n", progname, progname, progname); + " %s -4 use IPv4 connection\n" + " %s -6 use IPv6 connection\n" + " %s -h prints more detailed help\n", + progname, progname, progname, progname, progname); } /* end of check_ssh.c */ -- cgit v1.2.3-74-g34f1