1
/*****************************************************************************
1
/***************************************************************************
3
3
* Project ___| | | | _ \| |
4
4
* / __| | | | |_) | |
5
5
* | (__| |_| | _ <| |___
6
6
* \___|\___/|_| \_\_____|
8
* Copyright (C) 2002, Daniel Stenberg, <daniel@haxx.se>, et al.
10
* In order to be useful for every potential user, curl and libcurl are
11
* dual-licensed under the MPL and the MIT/X-derivate licenses.
8
* Copyright (C) 1998 - 2004, Daniel Stenberg, <daniel@haxx.se>, et al.
10
* This software is licensed as described in the file COPYING, which
11
* you should have received as part of this distribution. The terms
12
* are also available at http://curl.haxx.se/docs/copyright.html.
13
14
* You may opt to use, copy, modify, merge, publish, distribute and/or sell
14
15
* copies of the Software, and permit persons to whom the Software is
15
* furnished to do so, under the terms of the MPL or the MIT/X-derivate
16
* licenses. You may pick one of these licenses.
16
* furnished to do so, under the terms of the COPYING file.
18
18
* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
19
19
* KIND, either express or implied.
21
* $Id: version.c,v 1.15 2002/01/16 17:45:08 bagder Exp $
22
*****************************************************************************/
21
* $Id: version.c,v 1.35 2004/03/08 07:46:26 bagder Exp $
22
***************************************************************************/
44
43
unsigned long ssleay_value;
46
45
ssleay_value=SSLeay();
47
47
if(ssleay_value < 0x906000) {
48
48
ssleay_value=SSLEAY_VERSION_NUMBER;
52
52
if(ssleay_value&0xff0) {
53
sub[0]=((ssleay_value>>4)&0xff) + 'a' -1;
53
sub[0]=(char)((ssleay_value>>4)&0xff) + 'a' -1;
59
sprintf(ptr, " (OpenSSL %lx.%lx.%lx%s)",
59
sprintf(ptr, " OpenSSL/%lx.%lx.%lx%s",
60
60
(ssleay_value>>28)&0xf,
61
61
(ssleay_value>>20)&0xff,
62
62
(ssleay_value>>12)&0xff,
67
*num = SSLEAY_VERSION_NUMBER;
67
68
#if (SSLEAY_VERSION_NUMBER >= 0x900000)
68
sprintf(ptr, " (SSL %lx.%lx.%lx)",
69
sprintf(ptr, " OpenSSL/%lx.%lx.%lx",
69
70
(SSLEAY_VERSION_NUMBER>>28)&0xff,
70
71
(SSLEAY_VERSION_NUMBER>>20)&0xff,
71
72
(SSLEAY_VERSION_NUMBER>>12)&0xf);
82
sprintf(ptr, " (SSL %x.%x.%x%s)",
83
sprintf(ptr, " SSL/%x.%x.%x%s",
83
84
(SSLEAY_VERSION_NUMBER>>12)&0xff,
84
85
(SSLEAY_VERSION_NUMBER>>8)&0xf,
85
86
(SSLEAY_VERSION_NUMBER>>4)&0xf, sub);
89
ptr=strchr(ptr, '\0');
92
#if defined(KRB4) || defined(ENABLE_IPV6)
96
sprintf(ptr, "krb4 ");
94
char *curl_version(void)
96
static char version[200];
98
strcpy(version, LIBCURL_NAME "/" LIBCURL_VERSION );
99
ptr=strchr(version, '\0');
104
getssl_version(ptr, &num);
105
ptr=strchr(version, '\0');
110
sprintf(ptr, " krb4");
97
111
ptr += strlen(ptr);
99
113
#ifdef ENABLE_IPV6
100
sprintf(ptr, "ipv6 ");
103
sprintf(ptr, "enabled)");
108
sprintf(ptr, " (zlib %s)", zlibVersion());
114
sprintf(ptr, " ipv6");
118
sprintf(ptr, " zlib/%s", zlibVersion());
122
sprintf(ptr, " GSS");
126
/* this function is only present in c-ares, not in the original ares */
127
sprintf(ptr, " c-ares/%s", ares_version(NULL));
109
128
ptr += strlen(ptr);
117
* eval: (load-file "../curl-mode.el")
120
* vim: et sw=2 ts=2 sts=2 tw=78
134
/* data for curl_version_info */
136
static const char *protocols[] = {
137
#ifndef CURL_DISABLE_FTP
140
#ifndef CURL_DISABLE_GOPHER
143
#ifndef CURL_DISABLE_TELNET
146
#ifndef CURL_DISABLE_DICT
149
#ifndef CURL_DISABLE_LDAP
152
#ifndef CURL_DISABLE_HTTP
155
#ifndef CURL_DISABLE_FILE
160
#ifndef CURL_DISABLE_HTTP
163
#ifndef CURL_DISABLE_FTP
170
static curl_version_info_data version_info = {
174
OS, /* as found by configure or set by hand at build-time */
175
0 /* features is 0 by default */
180
| CURL_VERSION_KERBEROS4
184
| CURL_VERSION_NTLM /* since this requires OpenSSL */
190
| CURL_VERSION_GSSNEGOTIATE
196
| CURL_VERSION_ASYNCHDNS
199
| CURL_VERSION_SPNEGO
201
#if defined(ENABLE_64BIT) && (SIZEOF_CURL_OFF_T > 4)
202
| CURL_VERSION_LARGEFILE
205
NULL, /* ssl_version */
206
0, /* ssl_version_num */
207
NULL, /* zlib_version */
209
NULL, /* c-ares version */
210
0, /* c-ares version numerical */
213
curl_version_info_data *curl_version_info(CURLversion stamp)
216
static char ssl_buffer[80];
218
getssl_version(ssl_buffer, &num);
220
version_info.ssl_version = ssl_buffer;
221
version_info.ssl_version_num = num;
222
/* SSL stuff is left zero if undefined */
226
version_info.libz_version = zlibVersion();
227
/* libz left NULL if non-existing */
232
version_info.ares = ares_version(&aresnum);
233
version_info.ares_num = aresnum;
236
(void)stamp; /* avoid compiler warnings, we don't use this */
238
return &version_info;