[Nagiosplug-checkins] nagiosplug/plugins check_ntp.c,1.1,1.2

M. Sean Finney seanius at users.sourceforge.net
Mon Mar 20 09:19:04 CET 2006


Update of /cvsroot/nagiosplug/nagiosplug/plugins
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32290

Modified Files:
	check_ntp.c 
Log Message:
ipv6 support for c-version of check_ntp


Index: check_ntp.c
===================================================================
RCS file: /cvsroot/nagiosplug/nagiosplug/plugins/check_ntp.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- check_ntp.c	18 Mar 2006 19:00:43 -0000	1.1
+++ check_ntp.c	20 Mar 2006 17:18:44 -0000	1.2
@@ -191,7 +191,7 @@
 		{"help", no_argument, 0, 'h'},
 		{"verbose", no_argument, 0, 'v'},
 		{"use-ipv4", no_argument, 0, '4'},
-/*		{"use-ipv6", no_argument, 0, '6'}, */
+		{"use-ipv6", no_argument, 0, '6'},
 		{"warning", required_argument, 0, 'w'},
 		{"critical", required_argument, 0, 'c'},
 		{"zero-offset", no_argument, 0, 'O'},
@@ -207,7 +207,7 @@
 		usage ("\n");
 
 	while (1) {
-		c = getopt_long (argc, argv, "Vhv4w:c:Oj:k:t:H:", longopts, &option);
+		c = getopt_long (argc, argv, "Vhv46w:c:Oj:k:t:H:", longopts, &option);
 		if (c == -1 || c == EOF || c == 1)
 			break;
 
@@ -248,6 +248,16 @@
 		case 'O':
 			zero_offset_bad=1;
 			break;
+		case '4':
+			address_family = AF_INET;
+			break;
+		case '6':
+#ifdef USE_IPV6
+			address_family = AF_INET6;
+#else
+			usage4 (_("IPv6 support not available"));
+#endif
+			break;
 		case '?':
 			/* print short usage statement if args not parsable */
 			usage2 (_("Unknown argument"), optarg);





More information about the Commits mailing list