summaryrefslogtreecommitdiffstats
path: root/plugins/check_smtp.c
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/check_smtp.c')
-rw-r--r--plugins/check_smtp.c20
1 files changed, 18 insertions, 2 deletions
diff --git a/plugins/check_smtp.c b/plugins/check_smtp.c
index dd9f19b..7562c4c 100644
--- a/plugins/check_smtp.c
+++ b/plugins/check_smtp.c
@@ -33,11 +33,15 @@ STATE_WARNING return values.\n";
33 33
34const char *option_summary = "\ 34const char *option_summary = "\
35-H host [-p port] [-e expect] [-C command] [-f from addr]\n\ 35-H host [-p port] [-e expect] [-C command] [-f from addr]\n\
36 [-w warn] [-c crit] [-t timeout] [-n] [-v]"; 36 [-w warn] [-c crit] [-t timeout] [-n] [-v] [-4|-6]";
37 37
38const char *options = "\ 38const char *options = "\
39 -H, --hostname=STRING or IPADDRESS\n\ 39 -H, --hostname=STRING or IPADDRESS\n\
40 Check server on the indicated host\n\ 40 Check server on the indicated host\n\
41 -4, --use-ipv4\n\
42 Use IPv4 protocol\n\
43 -6, --use-ipv6\n\
44 Use IPv6 protocol\n\
41 -p, --port=INTEGER\n\ 45 -p, --port=INTEGER\n\
42 Make connection on the indicated port (default: %d)\n\ 46 Make connection on the indicated port (default: %d)\n\
43 -e, --expect=STRING\n\ 47 -e, --expect=STRING\n\
@@ -233,6 +237,8 @@ process_arguments (int argc, char **argv)
233 {"nocommand", required_argument, 0, 'n'}, 237 {"nocommand", required_argument, 0, 'n'},
234 {"verbose", no_argument, 0, 'v'}, 238 {"verbose", no_argument, 0, 'v'},
235 {"version", no_argument, 0, 'V'}, 239 {"version", no_argument, 0, 'V'},
240 {"use-ipv4", no_argument, 0, '4'},
241 {"use-ipv6", no_argument, 0, '6'},
236 {"help", no_argument, 0, 'h'}, 242 {"help", no_argument, 0, 'h'},
237 {0, 0, 0, 0} 243 {0, 0, 0, 0}
238 }; 244 };
@@ -250,7 +256,7 @@ process_arguments (int argc, char **argv)
250 } 256 }
251 257
252 while (1) { 258 while (1) {
253 c = getopt_long (argc, argv, "+hVvt:p:f:e:c:w:H:C:", 259 c = getopt_long (argc, argv, "+hVv46t:p:f:e:c:w:H:C:",
254 long_options, &option_index); 260 long_options, &option_index);
255 261
256 if (c == -1 || c == EOF) 262 if (c == -1 || c == EOF)
@@ -315,6 +321,16 @@ process_arguments (int argc, char **argv)
315 usage ("Time interval must be a nonnegative integer\n"); 321 usage ("Time interval must be a nonnegative integer\n");
316 } 322 }
317 break; 323 break;
324 case '4':
325 address_family = AF_INET;
326 break;
327 case '6':
328#ifdef USE_IPV6
329 address_family = AF_INET6;
330#else
331 usage ("IPv6 support not available\n");
332#endif
333 break;
318 case 'V': /* version */ 334 case 'V': /* version */
319 print_revision (progname, revision); 335 print_revision (progname, revision);
320 exit (STATE_OK); 336 exit (STATE_OK);