Artifactspublic-v0

curl

master
ply4 git calls227 ms292 KiB2 cachedprotocol v2
393 lines15 KiBRaw
1#ifndef HEADER_CURL_SETUP_VMS_H
2#define HEADER_CURL_SETUP_VMS_H
3/***************************************************************************
4 * _ _ ____ _
5 * Project ___| | | | _ \| |
6 * / __| | | | |_) | |
7 * | (__| |_| | _ <| |___
8 * \___|\___/|_| \_\_____|
9 *
10 * Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
11 *
12 * This software is licensed as described in the file COPYING, which
13 * you should have received as part of this distribution. The terms
14 * are also available at https://curl.se/docs/copyright.html.
15 *
16 * You may opt to use, copy, modify, merge, publish, distribute and/or sell
17 * copies of the Software, and permit persons to whom the Software is
18 * furnished to do so, under the terms of the COPYING file.
19 *
20 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
21 * KIND, either express or implied.
22 *
23 * SPDX-License-Identifier: curl
24 *
25 ***************************************************************************/
27/* JEM, 2012-12-30, VMS now generates config.h, so only define wrappers for */
28/* getenv(), getpwuid() and provide is_vms_shell() */
29/* Also need upper case symbols for system services, and */
30/* OpenSSL, and some Kerberos image */
32#ifdef __DECC
33#pragma message save
34#pragma message disable dollarid
35#endif
37/* Hide the stuff we are overriding */
38#define getenv decc_getenv
39#ifdef __DECC
40# if __INITIAL_POINTER_SIZE != 64
41# define getpwuid decc_getpwuid
42# endif
43#endif
44#include <stdlib.h>
45char *decc$getenv(const char *__name);
46#include <pwd.h>
48#include <string.h>
49#include <unixlib.h>
51#undef getenv
52#undef getpwuid
53#define getenv vms_getenv
54#define getpwuid vms_getpwuid
56/* VAX needs these in upper case when compiling exact case */
57#define sys$assign SYS$ASSIGN
58#define sys$dassgn SYS$DASSGN
59#define sys$qiow SYS$QIOW
61#ifdef __DECC
62# if __INITIAL_POINTER_SIZE
63# pragma __pointer_size __save
64# endif
65#endif
67#if __USE_LONG_GID_T
68# define decc_getpwuid DECC$__LONG_GID_GETPWUID
69#else
70# if __INITIAL_POINTER_SIZE
71# define decc_getpwuid decc$__32_getpwuid
72# else
73# define decc_getpwuid decc$getpwuid
74# endif
75#endif
77struct passwd *decc_getpwuid(uid_t uid);
79#ifdef __DECC
80# if __INITIAL_POINTER_SIZE == 32
81/* Translate the path, but only if the path is a VMS file specification */
82/* The translation is usually only needed for older versions of VMS */
83static char *vms_translate_path(const char *path)
85 char *unix_path;
86 char *test_str;
88 /* See if the result is in VMS format, if not, we are done */
89 /* Assume that this is a PATH, not some data */
90 test_str = strpbrk(path, ":[<^");
91 if(!test_str) {
92 return (char *)path;
93 }
95 unix_path = decc$translate_vms(path);
97 if((int)unix_path <= 0) {
98 /* We can not translate it, so return the original string */
99 return (char *)path;
100 }
102# else
103 /* VMS translate path is actually not needed on the current 64-bit */
104 /* VMS platforms, so instead of figuring out the pointer settings */
105 /* Change it to a noop */
106# define vms_translate_path(__path) __path
107# endif
108#endif
110#ifdef __DECC
111# if __INITIAL_POINTER_SIZE
112# pragma __pointer_size __restore
113# endif
114#endif
116static char *vms_getenv(const char *envvar)
118 char *result;
119 char *vms_path;
121 /* first use the DECC getenv() function */
122 result = decc$getenv(envvar);
123 if(!result) {
124 return result;
125 }
127 vms_path = result;
128 result = vms_translate_path(vms_path);
130 /* note that if you backport this to use VAX C RTL, that the VAX C RTL */
131 /* may do a malloc(2048) for each call to getenv(), so you will need */
132 /* to add a free(vms_path) */
133 /* Do not do a free() for DEC C RTL builds, which should be used for */
134 /* VMS 5.5-2 and later, even if using GCC */
136 return result;
139static struct passwd vms_passwd_cache;
141static struct passwd *vms_getpwuid(uid_t uid)
143 struct passwd *my_passwd;
145/* Hack needed to support 64-bit builds, decc_getpwnam is 32-bit only */
146#ifdef __DECC
147# if __INITIAL_POINTER_SIZE
148 __char_ptr32 unix_path;
149# else
150 char *unix_path;
151# endif
152#else
153 char *unix_path;
154#endif
156 my_passwd = decc_getpwuid(uid);
157 if(!my_passwd) {
158 return my_passwd;
159 }
161 unix_path = vms_translate_path(my_passwd->pw_dir);
163 if((long)unix_path <= 0) {
164 /* We can not translate it, so return the original string */
165 return my_passwd;
166 }
168 /* If no changes needed, return it */
169 if(unix_path == my_passwd->pw_dir) {
170 return my_passwd;
171 }
173 /* Need to copy the structure returned */
174 /* Since curl is only using pw_dir, no need to fix up */
175 /* the pw_shell when running under Bash */
176 vms_passwd_cache.pw_name = my_passwd->pw_name;
177 vms_passwd_cache.pw_uid = my_passwd->pw_uid;
178 vms_passwd_cache.pw_gid = my_passwd->pw_uid;
179 vms_passwd_cache.pw_dir = unix_path;
180 vms_passwd_cache.pw_shell = my_passwd->pw_shell;
182 return &vms_passwd_cache;
185#ifdef __DECC
186#pragma message restore
187#endif
189/* Bug - VMS OpenSSL and Kerberos universal symbols are in uppercase only */
190/* VMS libraries should have universal symbols in exact and uppercase */
192#define ASN1_INTEGER_get ASN1_INTEGER_GET
193#define ASN1_STRING_data ASN1_STRING_DATA
194#define ASN1_STRING_length ASN1_STRING_LENGTH
195#define ASN1_STRING_print ASN1_STRING_PRINT
196#define ASN1_STRING_to_UTF8 ASN1_STRING_TO_UTF8
197#define ASN1_STRING_type ASN1_STRING_TYPE
198#define BIO_ctrl BIO_CTRL
199#define BIO_free BIO_FREE
200#define BIO_new BIO_NEW
201#define BIO_s_mem BIO_S_MEM
202#define BN_bn2bin BN_BN2BIN
203#define BN_num_bits BN_NUM_BITS
204#define CRYPTO_cleanup_all_ex_data CRYPTO_CLEANUP_ALL_EX_DATA
205#define CRYPTO_free CRYPTO_FREE
206#define CRYPTO_malloc CRYPTO_MALLOC
207#define CONF_modules_load_file CONF_MODULES_LOAD_FILE
208#ifdef __VAX
209# ifdef VMS_OLD_SSL
210 /* Ancient OpenSSL on VAX/VMS missing this constant */
211# define CONF_MFLAGS_IGNORE_MISSING_FILE 0x10
212# undef CONF_modules_load_file
213static int CONF_modules_load_file(const char *filename,
214 const char *appname,
215 unsigned long flags) {
216 return 1;
218# endif
219#endif
220#define DES_ecb_encrypt DES_ECB_ENCRYPT
221#define DES_set_key DES_SET_KEY
222#define DES_set_odd_parity DES_SET_ODD_PARITY
223#define ENGINE_ctrl ENGINE_CTRL
224#define ENGINE_ctrl_cmd ENGINE_CTRL_CMD
225#define ENGINE_finish ENGINE_FINISH
226#define ENGINE_free ENGINE_FREE
227#define ENGINE_get_first ENGINE_GET_FIRST
228#define ENGINE_get_id ENGINE_GET_ID
229#define ENGINE_get_next ENGINE_GET_NEXT
230#define ENGINE_init ENGINE_INIT
231#define ENGINE_load_builtin_engines ENGINE_LOAD_BUILTIN_ENGINES
232#define ENGINE_load_private_key ENGINE_LOAD_PRIVATE_KEY
233#define ENGINE_set_default ENGINE_SET_DEFAULT
234#define ERR_clear_error ERR_CLEAR_ERROR
235#define ERR_error_string ERR_ERROR_STRING
236#define ERR_error_string_n ERR_ERROR_STRING_N
237#define ERR_free_strings ERR_FREE_STRINGS
238#define ERR_get_error ERR_GET_ERROR
239#define ERR_peek_error ERR_PEEK_ERROR
240#define ERR_remove_state ERR_REMOVE_STATE
241#define EVP_PKEY_copy_parameters EVP_PKEY_COPY_PARAMETERS
242#define EVP_PKEY_free EVP_PKEY_FREE
243#define EVP_cleanup EVP_CLEANUP
244#define GENERAL_NAMES_free GENERAL_NAMES_FREE
245#define i2d_X509_PUBKEY I2D_X509_PUBKEY
246#define MD5_Final MD5_FINAL
247#define MD5_Init MD5_INIT
248#define MD5_Update MD5_UPDATE
249#define OPENSSL_add_all_algo_noconf OPENSSL_ADD_ALL_ALGO_NOCONF
250#ifndef __VAX
251#define OPENSSL_load_builtin_modules OPENSSL_LOAD_BUILTIN_MODULES
252#endif
253#define PEM_read_X509 PEM_READ_X509
254#define PEM_write_bio_X509 PEM_WRITE_BIO_X509
255#define PKCS12_free PKCS12_FREE
256#define PKCS12_parse PKCS12_PARSE
257#define RAND_add RAND_ADD
258#define RAND_bytes RAND_BYTES
259#define RAND_file_name RAND_FILE_NAME
260#define RAND_load_file RAND_LOAD_FILE
261#define RAND_status RAND_STATUS
262#define SSL_CIPHER_get_name SSL_CIPHER_GET_NAME
263#define SSL_CTX_add_client_CA SSL_CTX_ADD_CLIENT_CA
264#define SSL_CTX_callback_ctrl SSL_CTX_CALLBACK_CTRL
265#define SSL_CTX_check_private_key SSL_CTX_CHECK_PRIVATE_KEY
266#define SSL_CTX_ctrl SSL_CTX_CTRL
267#define SSL_CTX_free SSL_CTX_FREE
268#define SSL_CTX_get_cert_store SSL_CTX_GET_CERT_STORE
269#define SSL_CTX_load_verify_locations SSL_CTX_LOAD_VERIFY_LOCATIONS
270#define SSL_CTX_new SSL_CTX_NEW
271#define SSL_CTX_set_cipher_list SSL_CTX_SET_CIPHER_LIST
272#define SSL_CTX_set_def_passwd_cb_ud SSL_CTX_SET_DEF_PASSWD_CB_UD
273#define SSL_CTX_set_default_passwd_cb SSL_CTX_SET_DEFAULT_PASSWD_CB
274#define SSL_CTX_set_msg_callback SSL_CTX_SET_MSG_CALLBACK
275#define SSL_CTX_set_verify SSL_CTX_SET_VERIFY
276#define SSL_CTX_use_PrivateKey SSL_CTX_USE_PRIVATEKEY
277#define SSL_CTX_use_PrivateKey_file SSL_CTX_USE_PRIVATEKEY_FILE
278#define SSL_CTX_use_cert_chain_file SSL_CTX_USE_CERT_CHAIN_FILE
279#define SSL_CTX_use_certificate SSL_CTX_USE_CERTIFICATE
280#define SSL_CTX_use_certificate_file SSL_CTX_USE_CERTIFICATE_FILE
281#define SSL_SESSION_free SSL_SESSION_FREE
282#define SSL_connect SSL_CONNECT
283#define SSL_free SSL_FREE
284#define SSL_get1_session SSL_GET1_SESSION
285#define SSL_get_certificate SSL_GET_CERTIFICATE
286#define SSL_get_current_cipher SSL_GET_CURRENT_CIPHER
287#define SSL_get_error SSL_GET_ERROR
288#define SSL_get_peer_cert_chain SSL_GET_PEER_CERT_CHAIN
289#define SSL_get_peer_certificate SSL_GET_PEER_CERTIFICATE
290#define SSL_get_privatekey SSL_GET_PRIVATEKEY
291#define SSL_get_session SSL_GET_SESSION
292#define SSL_get_shutdown SSL_GET_SHUTDOWN
293#define SSL_get_verify_result SSL_GET_VERIFY_RESULT
294#define SSL_library_init SSL_LIBRARY_INIT
295#define SSL_load_error_strings SSL_LOAD_ERROR_STRINGS
296#define SSL_new SSL_NEW
297#define SSL_peek SSL_PEEK
298#define SSL_pending SSL_PENDING
299#define SSL_read SSL_READ
300#define SSL_set_connect_state SSL_SET_CONNECT_STATE
301#define SSL_set_fd SSL_SET_FD
302#define SSL_set_session SSL_SET_SESSION
303#define SSL_shutdown SSL_SHUTDOWN
304#define SSL_version SSL_VERSION
305#define SSL_write SSL_WRITE
306#define SSLeay SSLEAY
307#define SSLv23_client_method SSLV23_CLIENT_METHOD
308#define SSLv3_client_method SSLV3_CLIENT_METHOD
309#define TLSv1_client_method TLSV1_CLIENT_METHOD
310#define UI_create_method UI_CREATE_METHOD
311#define UI_destroy_method UI_DESTROY_METHOD
312#define UI_get0_user_data UI_GET0_USER_DATA
313#define UI_get_input_flags UI_GET_INPUT_FLAGS
314#define UI_get_string_type UI_GET_STRING_TYPE
315#define UI_create_method UI_CREATE_METHOD
316#define UI_destroy_method UI_DESTROY_METHOD
317#define UI_method_get_closer UI_METHOD_GET_CLOSER
318#define UI_method_get_opener UI_METHOD_GET_OPENER
319#define UI_method_get_reader UI_METHOD_GET_READER
320#define UI_method_get_writer UI_METHOD_GET_WRITER
321#define UI_method_set_closer UI_METHOD_SET_CLOSER
322#define UI_method_set_opener UI_METHOD_SET_OPENER
323#define UI_method_set_reader UI_METHOD_SET_READER
324#define UI_method_set_writer UI_METHOD_SET_WRITER
325#define UI_OpenSSL UI_OPENSSL
326#define UI_set_result UI_SET_RESULT
327#define X509V3_EXT_print X509V3_EXT_PRINT
328#define X509_EXTENSION_get_critical X509_EXTENSION_GET_CRITICAL
329#define X509_EXTENSION_get_data X509_EXTENSION_GET_DATA
330#define X509_EXTENSION_get_object X509_EXTENSION_GET_OBJECT
331#define X509_LOOKUP_file X509_LOOKUP_FILE
332#define X509_NAME_ENTRY_get_data X509_NAME_ENTRY_GET_DATA
333#define X509_NAME_get_entry X509_NAME_GET_ENTRY
334#define X509_NAME_get_index_by_NID X509_NAME_GET_INDEX_BY_NID
335#define X509_NAME_print_ex X509_NAME_PRINT_EX
336#define X509_STORE_CTX_get_current_cert X509_STORE_CTX_GET_CURRENT_CERT
337#define X509_STORE_add_lookup X509_STORE_ADD_LOOKUP
338#define X509_STORE_set_flags X509_STORE_SET_FLAGS
339#define X509_check_issued X509_CHECK_ISSUED
340#define X509_free X509_FREE
341#define X509_get_ext_d2i X509_GET_EXT_D2I
342#define X509_get_issuer_name X509_GET_ISSUER_NAME
343#define X509_get_pubkey X509_GET_PUBKEY
344#define X509_get_serialNumber X509_GET_SERIALNUMBER
345#define X509_get_subject_name X509_GET_SUBJECT_NAME
346#define X509_load_crl_file X509_LOAD_CRL_FILE
347#define X509_verify_cert_error_string X509_VERIFY_CERT_ERROR_STRING
348#define d2i_PKCS12_fp D2I_PKCS12_FP
349#define i2t_ASN1_OBJECT I2T_ASN1_OBJECT
350#define sk_num SK_NUM
351#define sk_pop SK_POP
352#define sk_pop_free SK_POP_FREE
353#define sk_value SK_VALUE
354#define SHA256_Final SHA256_FINAL
355#define SHA256_Init SHA256_INIT
356#define SHA256_Update SHA256_UPDATE
358#define USE_UPPERCASE_GSSAPI 1
359#define gss_seal GSS_SEAL
360#define gss_unseal GSS_UNSEAL
362#define USE_UPPERCASE_KRBAPI 1
364/* AI_NUMERICHOST needed for IP V6 support in curl */
365#ifdef HAVE_NETDB_H
366#include <netdb.h>
367#ifndef AI_NUMERICHOST
368#undef USE_IPV6
369#endif
370#endif
372/* VAX symbols are always in uppercase */
373#ifdef __VAX
374#define inflate INFLATE
375#define inflateEnd INFLATEEND
376#define inflateInit2_ INFLATEINIT2_
377#define inflateInit_ INFLATEINIT_
378#define zlibVersion ZLIBVERSION
379#endif
381/* Older VAX OpenSSL port defines these as Macros */
382/* Need to include the headers first and then redefine */
383/* that way a newer port will also work if some one has one */
384#ifdef __VAX
386# include <openssl/evp.h>
387# ifndef OpenSSL_add_all_algorithms
388# define OpenSSL_add_all_algorithms OPENSSL_ADD_ALL_ALGORITHMS
389 void OPENSSL_ADD_ALL_ALGORITHMS(void);
390# endif
391#endif
393#endif /* HEADER_CURL_SETUP_VMS_H */
Diagnostics4 git calls · 227 ms
CallStatusSizeTime0227 ms
discover200152 B4 ms
git.upload-pack discover
http.response.status_code=200
git.upstream.cf_ray=-
git.upstream.phase=fetch
git.upstream.dur_ms=2
git.response.bytes=152
git.server.agent=gitty/1.0
git.server.object_format=sha1
git.server.caps=agent ls-refs fetch object-format
git.server.fetch=shallow filter sideband-all
git.protocol.version=2
git.pkt.frames=8
git.pkt.data=6
git.pkt.flush=2
git.pkt.delim=0
git.pkt.bytes=152
git.pkt.payload.max=34
ls-refs200149 B · hit4 ms
git.upload-pack ls-refs
http.response.status_code=200
git.upstream.cf_ray=-
git.upstream.phase=ls-refs
git.upstream.dur_ms=4
git.response.bytes=149
git.response.cache=HIT
git.response.duration_ms=4
git.protocol.version=2
git.pkt.frames=3
git.pkt.data=2
git.pkt.flush=1
git.pkt.delim=0
git.pkt.bytes=149
git.pkt.payload.max=78
git.ls_refs.count=2
git.ls_refs.head=refs/heads/master
fetchblob:none · deepen 10200287 KiB · hit2 ms
git.upload-pack fetch
http.response.status_code=200
git.upstream.cf_ray=-
git.upstream.phase=fetch
git.upstream.dur_ms=221
git.response.bytes=293470
git.response.cache=HIT
git.response.duration_ms=2
git.fetch.filter=blob:none
git.fetch.filter.requested=tree:0
git.fetch.filter.fallback=blob:none
git.fetch.filter.learned=false
git.fetch.wants=31c911efe5652725e930f4d2e60c9060e5f6646d
git.fetch.haves.count=0
git.fetch.deepen=10
git.fetch.thin_pack=false
git.fetch.ofs_delta=true
git.protocol.version=2
git.pkt.frames=10
git.pkt.data=8
git.pkt.flush=1
git.pkt.delim=1
git.pkt.bytes=293470
git.pkt.payload.max=65516
git.sideband.band1.bytes=293354
git.sideband.band2.bytes=0
git.sideband.band3.bytes=0
git.pack.objects=87
git.pack.bytes=293354
git.pack.ofs_delta=0
git.pack.ref_delta=1
git.pack.chain.max=1
git.pack.trailer=6a646bcda6740bab42e321b51998b52ea15146c0
git.pack.full=86
Open pack map
fetch2005.0 KiB221 ms
git.upload-pack fetch
http.response.status_code=200
git.response.bytes=5095
git.response.cache=MISS
git.response.duration_ms=221
git.fetch.wants=542ad28b09b0fa037a50c8d9f6e2fefebea8a16c
git.fetch.haves.count=0
git.fetch.deepen=0
git.fetch.thin_pack=false
git.fetch.ofs_delta=true
git.protocol.version=2
git.pkt.frames=3
git.pkt.data=2
git.pkt.flush=1
git.pkt.delim=0
git.pkt.bytes=5095
git.pkt.payload.max=5074
git.sideband.band1.bytes=5073
git.sideband.band2.bytes=0
git.sideband.band3.bytes=0

Each row is one HTTP round trip ply made to the git server for this page, on one timeline. discover asks what the server speaks, ls-refs lists branch tips, fetch brings objects by id. A hit was served by Workers Cache. Tap a row for its wire details.

Remote
https://5ad2236b39de4c8bd8f6270ea63f3ea9.artifacts.cloudflare.net/git/public-v0/curl.git
Ref
refs/heads/master
Commit
31c911efe5652725e930f4d2e60c9060e5f6646d
cf-ray
a5e14c2adcd5a140
Request
bdd6e17f…
Protocol
v2 · sha1
Agent
gitty/1.0
Filter
advertised
Fetch
shallow filter sideband-all
Capabilities
agent ls-refs fetch object-format