master
2Implementation notes:
4 This is a true OS/400 ILE implementation, not a PASE implementation (for
5PASE, use AIX implementation).
7 The biggest problem with OS/400 is EBCDIC. libcurl implements an internal
8conversion mechanism, but it has been designed for computers that have a
9single native character set. OS/400 default native character set varies
10depending on the country for which it has been localized. Further, a job
11may dynamically alter its "native" character set.
12 Several characters that do not have fixed code in EBCDIC variants are
13used in libcurl strings. As a consequence, using the existing conversion
14mechanism would have lead in a localized binary library - not portable across
15countries.
16 For this reason, and because libcurl was originally designed for ASCII based
17operating systems, the current OS/400 implementation uses ASCII as internal
18character set. This has been accomplished using the QADRT library and
19include files, a C and system procedures ASCII wrapper library. See IBM QADRT
20description for more information.
21 This then results in libcurl being an ASCII library: any function string
22argument is taken/returned in ASCII and a C/C++ calling program built around
23QADRT may use libcurl functions as on any other platform.
24 QADRT does not define ASCII wrappers for all C/system procedures: the
25OS/400 configuration header file and an additional module (os400sys.c) define
26some more of them, that are used by libcurl and that QADRT left out.
27 To support all the different variants of EBCDIC, non-standard wrapper
28procedures have been added to libcurl on OS/400: they provide an additional
29CCSID (numeric Coded Character Set ID specific to OS/400) parameter for each
30string argument. Callback procedures arguments giving access to strings are
31NOT converted, so text gathered this way is (probably !) ASCII.
33 Another OS/400 problem comes from the fact that the last fixed argument of a
34vararg procedure may not be of type char, unsigned char, short or unsigned
35short. Enums that are internally implemented by the C compiler as one of these
36types are also forbidden. libcurl uses enums as vararg procedure tagfields...
37Happily, there is a pragma forcing enums to type "int". The original libcurl
38header files are thus altered during build process to use this pragma, in
39order to force libcurl enums of being type int (the pragma disposition in use
40before inclusion is restored before resuming the including unit compilation).
42 Non-standard EBCDIC wrapper prototypes are defined in an additional header
43file: ccsidcurl.h. These should be self-explanatory to an OS/400-aware
44designer. CCSID 0 can be used to select the current job's CCSID.
45 Wrapper procedures with variable arguments are described below:
47_ curl_easy_setopt_ccsid()
48 Variable arguments are a string pointer and a CCSID (unsigned int) for
49options:
50 CURLOPT_ABSTRACT_UNIX_SOCKET
51 CURLOPT_ACCEPT_ENCODING
52 CURLOPT_ALTSVC
53 CURLOPT_AWS_SIGV4
54 CURLOPT_CAINFO
55 CURLOPT_CAPATH
56 CURLOPT_COOKIE
57 CURLOPT_COOKIEFILE
58 CURLOPT_COOKIEJAR
59 CURLOPT_COOKIELIST
60 CURLOPT_CRLFILE
61 CURLOPT_CUSTOMREQUEST
62 CURLOPT_DEFAULT_PROTOCOL
63 CURLOPT_DNS_INTERFACE
64 CURLOPT_DNS_LOCAL_IP4
65 CURLOPT_DNS_LOCAL_IP6
66 CURLOPT_DNS_SERVERS
67 CURLOPT_DOH_URL
68 CURLOPT_EGDSOCKET
69 CURLOPT_FTPPORT
70 CURLOPT_FTP_ACCOUNT
71 CURLOPT_FTP_ALTERNATIVE_TO_USER
72 CURLOPT_HAPROXY_CLIENT_IP
73 CURLOPT_HSTS
74 CURLOPT_HTTPSIG_HEADERS
75 CURLOPT_HTTPSIG_KEY
76 CURLOPT_HTTPSIG_KEYID
77 CURLOPT_INTERFACE
78 CURLOPT_ISSUERCERT
79 CURLOPT_KEYPASSWD
80 CURLOPT_KRBLEVEL
81 CURLOPT_LOGIN_OPTIONS
82 CURLOPT_MAIL_AUTH
83 CURLOPT_MAIL_FROM
84 CURLOPT_NETRC_FILE
85 CURLOPT_NOPROXY
86 CURLOPT_PASSWORD
87 CURLOPT_PINNEDPUBLICKEY
88 CURLOPT_PRE_PROXY
89 CURLOPT_PROTOCOLS_STR
90 CURLOPT_PROXY
91 CURLOPT_PROXYPASSWORD
92 CURLOPT_PROXYUSERNAME
93 CURLOPT_PROXYUSERPWD
94 CURLOPT_PROXY_CAINFO
95 CURLOPT_PROXY_CAPATH
96 CURLOPT_PROXY_CRLFILE
97 CURLOPT_PROXY_ISSUERCERT
98 CURLOPT_PROXY_KEYPASSWD
99 CURLOPT_PROXY_PINNEDPUBLICKEY
100 CURLOPT_PROXY_SERVICE_NAME
101 CURLOPT_PROXY_SSLCERT
102 CURLOPT_PROXY_SSLCERTTYPE
103 CURLOPT_PROXY_SSLKEY
104 CURLOPT_PROXY_SSLKEYTYPE
105 CURLOPT_PROXY_SSL_CIPHER_LIST
106 CURLOPT_PROXY_TLS13_CIPHERS
107 CURLOPT_PROXY_TLSAUTH_PASSWORD
108 CURLOPT_PROXY_TLSAUTH_TYPE
109 CURLOPT_PROXY_TLSAUTH_USERNAME
110 CURLOPT_RANDOM_FILE
111 CURLOPT_RANGE
112 CURLOPT_REDIR_PROTOCOLS_STR
113 CURLOPT_REFERER
114 CURLOPT_REQUEST_TARGET
115 CURLOPT_RTSP_SESSION_ID
116 CURLOPT_RTSP_STREAM_URI
117 CURLOPT_RTSP_TRANSPORT
118 CURLOPT_SASL_AUTHZID
119 CURLOPT_SERVICE_NAME
120 CURLOPT_SOCKS5_GSSAPI_SERVICE
121 CURLOPT_SSH_HOST_PUBLIC_KEY_MD5
122 CURLOPT_SSH_HOST_PUBLIC_KEY_SHA256
123 CURLOPT_SSH_KNOWNHOSTS
124 CURLOPT_SSH_PRIVATE_KEYFILE
125 CURLOPT_SSH_PUBLIC_KEYFILE
126 CURLOPT_SSLCERT
127 CURLOPT_SSLCERTTYPE
128 CURLOPT_SSLENGINE
129 CURLOPT_SSLKEY
130 CURLOPT_SSLKEYTYPE
131 CURLOPT_SSL_CIPHER_LIST
132 CURLOPT_SSL_EC_CURVES
133 CURLOPT_SSL_SIGNATURE_ALGORITHMS
134 CURLOPT_TLS13_CIPHERS
135 CURLOPT_TLSAUTH_PASSWORD
136 CURLOPT_TLSAUTH_TYPE
137 CURLOPT_TLSAUTH_USERNAME
138 CURLOPT_UNIX_SOCKET_PATH
139 CURLOPT_URL
140 CURLOPT_USERAGENT
141 CURLOPT_USERNAME
142 CURLOPT_USERPWD
143 CURLOPT_XOAUTH2_BEARER
144 All blob options are also supported.
145 In all other cases, it ignores the ccsid parameter and behaves as
146curl_easy_setopt().
147 Note that CURLOPT_ERRORBUFFER is not in the list above, since it gives the
148address of an (empty) character buffer, not the address of a string.
149CURLOPT_POSTFIELDS stores the address of static binary data (of type void *)
150and thus is not converted. If CURLOPT_COPYPOSTFIELDS is issued after
151CURLOPT_POSTFIELDSIZE != -1, the data size is adjusted according to the
152CCSID conversion result length.
154_ curl_formadd_ccsid()
155 In the variable argument list, string pointers should be followed by a (long)
156CCSID for the following options:
157 CURLFORM_BUFFER
158 CURLFORM_CONTENTTYPE
159 CURLFORM_COPYCONTENTS
160 CURLFORM_COPYNAME
161 CURLFORM_FILE
162 CURLFORM_FILECONTENT
163 CURLFORM_FILENAME
164 CURLFORM_PTRNAME
165 If taken from an argument array, an additional array entry must follow each
166entry containing one of the above option. This additional entry holds the CCSID
167in its value field, and the option field is meaningless.
168 It is not possible to have a string pointer and its CCSID across a function
169parameter/array boundary.
170 A single call to this function describes a single field. To support
171old-style file data in multiple chunks, it is however possible to list
172data options more than once within a single call. Because each data
173option may be associated with a length option, these tuples must be
174separated from each other by a CURLFORM_CONTENTTYPE option that serves
175as a delimiter. In consequence, associated data and length options may not
176be separated by a CURLFORM_CONTENTTYPE option, whatever the data option
177count is. In all cases, the new-style multi-chunk file definition (several
178fields with the same name and filename) must be preferred.
179 Please note that CURLFORM_PTRCONTENTS and CURLFORM_BUFFERPTR are considered
180unconvertible strings and thus are NOT followed by a CCSID.
181 The form API is now deprecated by the MIME API and the latter should
182be preferred for new designs.
184_ curl_easy_getinfo_ccsid()
185 The following options are followed by a 'char * *' and a CCSID. Unlike
186curl_easy_getinfo(), the value returned in the pointer should be released with
187curl_free() after use:
188 CURLINFO_CONTENT_TYPE
189 CURLINFO_EFFECTIVE_URL
190 CURLINFO_FTP_ENTRY_PATH
191 CURLINFO_LOCAL_IP
192 CURLINFO_PRIMARY_IP
193 CURLINFO_REDIRECT_URL
194 CURLINFO_REFERER
195 CURLINFO_RTSP_SESSION_ID
196 CURLINFO_SCHEME
197 Likewise, the following options are followed by a struct curl_slist * * and a
198CCSID.
199 CURLINFO_COOKIELIST
200 CURLINFO_SSL_ENGINES
201Lists returned should be released with curl_slist_free_all() after use.
202 Option CURLINFO_CERTINFO is followed by a struct curl_certinfo * * and a
203CCSID. Returned structures should be freed with curl_certinfo_free_all()
204after use.
205 Other options are processed like in curl_easy_getinfo().
207_ curl_easy_strerror_ccsid(), curl_multi_strerror_ccsid(),
208curl_share_strerror_ccsid() and curl_url_strerror_ccsid() work as their
209non-ccsid version and return a string encoded in the additional ccsid
210parameter. These strings belong to libcurl and may not be freed by the caller.
211A subsequent call to the same procedure in the same thread invalidates the
212previous result.
214_ curl_pushheader_bynum_cssid() and curl_pushheader_byname_ccsid()
215 Although the prototypes are self-explanatory, the returned string pointer
216should be released with curl_free() after use, as opposite to the non-ccsid
217versions of these procedures.
218 Please note that HTTP2 is not (yet) implemented on OS/400, thus these
219functions always return NULL.
221_ curl_easy_option_by_name_ccsid() returns a pointer to an untranslated option
222metadata structure. As each curl_easyoption structure holds the option name in
223ASCII, the curl_easy_option_get_name_ccsid() function allows getting it in any
224supported ccsid. However the caller should release the returned pointer with
225curl_free() after use.
227_ curl_easy_header_ccsid() works as its non-CCSID counterpart but requires an
228additional ccsid parameter specifying the name parameter encoding. The output
229hout parameter is kept in libcurl's encoding and should not be altered.
231_ curl_from_ccsid() and curl_to_ccsid() are string encoding conversion
232functions between ASCII (latin1) and the given CCSID. The first parameter is
233the source string, the second is the CCSID and the returned value is a pointer
234to the dynamically allocated string. These functions do not impact on curl's
235behavior and are only provided for user convenience. After use, returned values
236must be released with curl_free().
239 Standard compilation environment does support neither autotools nor make; in
240fact, few common utilities are available. As a consequence, the config-os400.h
241has been coded manually and the compilation scripts are a set of shell scripts
242stored in subdirectory projects/OS400.
244 The test environment is currently not supported on OS/400.
247Protocols currently implemented on OS/400:
248_ DICT
249_ FILE
250_ FTP
251_ GOPHER
252_ HTTP
253_ IMAP
254_ LDAP
255_ MQTT
256_ POP3
257_ RTSP
258_ SCP if libssh2 is enabled
259_ SFTP if libssh2 is enabled
260_ SMTP
261_ TELNET
262_ TFTP
263_ WS
266Compiling on OS/400:
268 These instructions targets people who knows about OS/400, compiling, IFS and
269archive extraction. Do not ask questions about these subjects if you are not
270familiar with.
272_ As a prerequisite, QADRT development environment must be installed.
273 For more information on downloading and installing the QADRT development kit,
274 please see https://www.ibm.com/support/pages/node/6258183
275_ If data compression has to be supported, ZLIB development environment must
276 be installed.
277_ Likewise, if SCP and SFTP protocols have to be compiled in, LIBSSH2
278 development environment must be installed.
279_ Install the curl source directory in IFS. Do NOT install it in the
280 installation target directory (which defaults to /curl).
281_ Enter Qshell (QSH, not PASE)
282_ Change current directory to the curl installation directory
283_ Change current directory to ./projects/OS400
284- If you want to change the default configuration parameters like debug info
285 generation, optimization level, listing option, target library, ZLIB/LIBSSH2
286 availability and location, etc., copy file config400.default to
287 config400.override and edit the latter. Do not edit the original default file
288 as it might be overwritten by a subsequent source installation.
289_ Copy any file in the current directory to makelog (i.e.:
290 cp initscript.sh makelog): this is intended to create the makelog file with
291 an ASCII CCSID!
292_ Enter the command "sh makefile.sh > makelog 2>&1"
293_ Examine the makelog file to check for compilation errors. CZM0383 warnings on
294 C or system standard API come from QADRT inlining and can safely be ignored.
296 Without configuration parameters override, this produces the following
297OS/400 objects:
298_ libcurl. All other objects are stored in this library.
299_ Modules for all libcurl units.
300_ Binding directory CURL_A, to be used at calling program link time for
301 statically binding the modules (specify BNDSRVPGM(QADRTTS QGLDCLNT QGLDBRDR)
302 when creating a program using CURL_A).
303_ Service program CURL.<soname>, where <soname> is extracted from the
304 lib/Makefile.am VERSION variable. To be used at calling program runtime
305 when this program has dynamically bound curl at link time.
306_ Binding directory CURL. To be used to dynamically bind libcurl when linking a
307 calling program.
308- CLI tool bound program curl.
309- CLI command curl.
310_ Source file H. It contains all the include members needed to compile a C/C++
311 module using libcurl, and an ILE/RPG /copy member for support in this
312 language.
313_ Standard C/C++ libcurl include members in file H.
314_ CCSIDCURL member in file H. This defines the non-standard EBCDIC wrappers for
315 C and C++.
316_ CURL.INC member in file H. This defines everything needed by an ILE/RPG
317 program using libcurl.
318_ IFS directory /curl/include/curl containing the C header files for IFS source
319 C/C++ compilation and curl.inc.rpgle for IFS source ILE/RPG compilation.
320- IFS link /curl/bin/curl to CLI tool program.
323Special programming consideration:
325QADRT being used, the following points must be considered:
326_ If static binding is used, service program QADRTTS must be linked too.
327_ The EBCDIC CCSID used by QADRT is 37 by default, NOT THE JOB'S CCSID. If
328 another EBCDIC CCSID is required, it must be set via a locale through a call
329 to setlocale_a (QADRT's setlocale() ASCII wrapper) with category LC_ALL or
330 LC_CTYPE, or by setting environment variable QADRT_ENV_LOCALE to the locale
331 object path before executing the program.
332_ Do not use original source include files unless you know what you are doing.
333 Use the installed members instead (in /QSYS.LIB/CURL.LIB/H.FILE and
334 /curl/include/curl).
337ILE/RPG support:
339 Since most of the ILE OS/400 programmers use ILE/RPG exclusively, a
340definition /INCLUDE member is provided for this language. To include all
341libcurl definitions in an ILE/RPG module, line
343 h bnddir('CURL/CURL')
345must figure in the program header, and line
347 d/include curl/h,curl.inc
349in the global data section of the module's source code.
351 No vararg procedure support exists in ILE/RPG: for this reason, the following
352considerations apply:
353_ Procedures curl_easy_setopt_long(), curl_easy_setopt_object(),
354 curl_easy_setopt_function(), curl_easy_setopt_offset() and
355 curl_easy_setopt_blob() are all alias prototypes to curl_easy_setopt(), but
356 with different parameter lists.
357_ Procedures curl_easy_getinfo_string(), curl_easy_getinfo_long(),
358 curl_easy_getinfo_double(), curl_easy_getinfo_slist(),
359 curl_easy_getinfo_ptr(), curl_easy_getinfo_socket() and
360 curl_easy_getinfo_off_t() are all alias prototypes to curl_easy_getinfo(),
361 but with different parameter lists.
362_ Procedures curl_multi_setopt_long(), curl_multi_setopt_object(),
363 curl_multi_setopt_function() and curl_multi_setopt_offset() are all alias
364 prototypes to curl_multi_setopt(), but with different parameter lists.
365_ Procedures curl_share_setopt_int(), curl_share_setopt_ptr() and
366 curl_share_setopt_proc() are all alias prototypes to curl_share_setopt,
367 but with different parameter lists.
368_ Procedure curl_easy_setopt_blob_ccsid() is an alias of
369 curl_easy_setopt_ccsid() supporting blob encoding conversion.
370_ The prototype of procedure curl_formadd() allows specifying a pointer option
371 and the CURLFORM_END option. This makes possible to use an option array
372 without any additional definition. If some specific incompatible argument
373 list is used in the ILE/RPG program, the latter must define a specialised
374 alias. The same applies to curl_formadd_ccsid() too.
375_ Since V7R4M0, procedure overloading is used to emulate limited "vararg-like"
376 definitions of curl_easy_setopt(), curl_multi_setopt(), curl_share_setopt()
377 and curl_easy_getinfo(). Blob and CCSID alternatives are NOT included in
378 overloading.
380 Since RPG cannot cast a long to a pointer, procedure curl_form_long_value()
381is provided for that purpose: this allows storing a long value in the
382curl_forms array. Please note the form API is deprecated and the MIME API
383should be used instead.
386CLI tool:
388 The build system provides it as a bound program, an IFS link to it and a
389simple CL command. The latter however is not able to provide a different
390parameter for each option since there are too many of those; instead,
391parameters are entered in a single field subject to quoting and escaping, in
392the same form as expected by the standard CLI program.
393 Care must be taken about the program output encoding: by default, it is sent
394to the standard output and is thus subject to transcoding. It is therefore
395recommended to use option "--output" to redirect output to a specific IFS file.
396Similar problems may occur about the standard input encoding.
Diagnostics4 git calls · 41 ms
CallStatusSizeTime041 ms
discover200152 B2 ms
git.upload-pack discover http.response.status_code=200 git.upstream.cf_ray=- git.upstream.phase=ls-refs 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 · hit2 ms
git.upload-pack ls-refs http.response.status_code=200 git.upstream.cf_ray=- git.upstream.phase=ls-refs git.upstream.dur_ms=2 git.response.bytes=149 git.response.cache=HIT git.response.duration_ms=2 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 · hit3 ms
git.upload-pack fetch http.response.status_code=200 git.upstream.cf_ray=- git.upstream.phase=fetch git.upstream.dur_ms=3 git.response.bytes=293470 git.response.cache=HIT git.response.duration_ms=3 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=86Open pack map
fetch2006.6 KiB · hit36 ms
git.upload-pack fetch http.response.status_code=200 git.upstream.cf_ray=- git.upstream.phase=fetch git.upstream.dur_ms=34 git.response.bytes=6809 git.response.cache=HIT git.response.duration_ms=36 git.fetch.wants=d1551dcfe72b3994d3d167c7c055ae1271d1f082 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=6809 git.pkt.payload.max=6788 git.sideband.band1.bytes=6787 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
- a5e1c33b5b0436cd
- Request
- 21de881c…
- Protocol
- v2 · sha1
- Agent
- gitty/1.0
- Filter
- advertised
- Fetch
- shallow filter sideband-all
- Capabilities
- agent ls-refs fetch object-format