From: msweet Date: Tue, 12 Jan 2016 17:21:23 +0000 (+0000) Subject: Add "-4" and "-6" options to tlscheck. X-Git-Tag: v2.2b1~127 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=23abf279d8f74ab77754f2c4382e99a883ef7ec7;p=thirdparty%2Fcups.git Add "-4" and "-6" options to tlscheck. git-svn-id: svn+ssh://src.apple.com/svn/cups/cups.org/trunk@13041 a1ca3aef-8c08-0410-bb20-df032aa958be --- diff --git a/cups/tlscheck.c b/cups/tlscheck.c index 861222ef2a..e78bf28c62 100644 --- a/cups/tlscheck.c +++ b/cups/tlscheck.c @@ -53,7 +53,8 @@ main(int argc, /* I - Number of command-line arguments */ host[256], /* Hostname */ userpass[256], /* Username/password */ resource[256]; /* Resource path */ - int tls_options = _HTTP_TLS_NONE, + int af = AF_UNSPEC, /* Address family */ + tls_options = _HTTP_TLS_NONE, /* TLS options */ verbose = 0; /* Verbosity */ ipp_t *request, /* IPP Get-Printer-Attributes request */ @@ -95,6 +96,14 @@ main(int argc, /* I - Number of command-line arguments */ { verbose = 1; } + else if (!strcmp(argv[i], "-4")) + { + af = AF_INET; + } + else if (!strcmp(argv[i], "-6")) + { + af = AF_INET6; + } else if (argv[i][0] == '-') { printf("tlscheck: Unknown option '%s'.\n", argv[i]); @@ -135,7 +144,7 @@ main(int argc, /* I - Number of command-line arguments */ _httpTLSSetOptions(tls_options); - http = httpConnect2(server, port, NULL, AF_UNSPEC, HTTP_ENCRYPTION_ALWAYS, 1, 30000, NULL); + http = httpConnect2(server, port, NULL, af, HTTP_ENCRYPTION_ALWAYS, 1, 30000, NULL); if (!http) { printf("%s: ERROR (%s)\n", server, cupsLastErrorString()); @@ -725,6 +734,8 @@ usage(void) puts(" --no-tls10 Disable TLS/1.0"); puts(" --rc4 Allow RC4 encryption"); puts(" --verbose Be verbose"); + puts(" -4 Connect using IPv4 addresses only"); + puts(" -6 Connect using IPv6 addresses only"); puts(" -v Be verbose"); puts(""); puts("The default port is 631.");