1      * Copyright (c) 2015 Patrick Monnerat, D+H <patrick.monnerat@dh.com>
2      * All rights reserved.
3      *
4      * Redistribution and use in source and binary forms,
5      * with or without modification, are permitted provided
6      * that the following conditions are met:
7      *
8      *   Redistributions of source code must retain the above
9      *   copyright notice, this list of conditions and the
10      *   following disclaimer.
11      *
12      *   Redistributions in binary form must reproduce the above
13      *   copyright notice, this list of conditions and the following
14      *   disclaimer in the documentation and/or other materials
15      *   provided with the distribution.
16      *
17      *   Neither the name of the copyright holder nor the names
18      *   of any other contributors may be used to endorse or
19      *   promote products derived from this software without
20      *   specific prior written permission.
21      *
22      * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
23      * CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
24      * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
25      * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
26      * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
27      * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
28      * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
29      * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
30      * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
31      * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
32      * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
33      * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
34      * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
35      * OF SUCH DAMAGE.
36
37      /if not defined(LIBSSH2_H_)
38      /define LIBSSH2_H_
39
40     d LIBSSH2_COPYRIGHT...
41     d                 c                   '2004-2015 The libssh2 project and +
42     d                                     its contributors.'
43
44      * We use underscore instead of dash when appending DEV in dev versions
45      * just to make the BANNER define (used by src/session.c) be a valid SSH
46      * banner. Release versions have no appended strings and may of course not
47      * have dashes either.
48     d LIBSSH2_VERSION...
49     d                 c                   '@LIBSSH2_VERSION@'
50
51      * The numeric version number is also available "in parts" by using these
52      * defines:
53     d LIBSSH2_VERSION_MAJOR...
54     d                 c                   @LIBSSH2_VERSION_MAJOR@
55     d LIBSSH2_VERSION_MINOR...
56     d                 c                   @LIBSSH2_VERSION_MINOR@
57     d LIBSSH2_VERSION_PATCH...
58     d                 c                   @LIBSSH2_VERSION_PATCH@
59
60      * This is the numeric version of the libssh2 version number, meant for
61      * easier parsing and comparions by programs. The LIBSSH2_VERSION_NUM
62      * define will always follow this syntax:
63      *
64      *  X'XXYYZZ'
65      *
66      * Where XX, YY and ZZ are the main version, release and patch numbers in
67      * hexadecimal (using 8 bits each). All three numbers are always
68      * represented using two digits.  1.2 would appear as "0x010200" while
69      * version 9.11.7 appears as X'090b07'.
70      *
71      * This 6-digit (24 bits) hexadecimal number does not show pre-release
72      * number, and it is always a greater number in a more recent release. It
73      * makes comparisons with greater than and less than work.
74
75     d LIBSSH2_VERSION_NUM...
76     d                 c                   X'@LIBSSH2_VERSION_NUM@'
77
78      * This is the date and time when the full source package was created. The
79      * timestamp is not stored in the source code repo, as the timestamp is
80      * properly set in the tarballs by the maketgz script.
81      *
82      * The format of the date should follow this template:
83      *
84      * "Mon Feb 12 11:35:33 UTC 2007"
85
86     d LIBSSH2_TIMESTAMP...
87     d                 c                   '@LIBSSH2_TIMESTAMP@'
88
89     d libssh2_Cchar   s              3i 0 based(######typedef######)
90     d libssh2_Cuchar  s              3u 0 based(######typedef######)
91     d libssh2_Cshort  s              5i 0 based(######typedef######)
92     d libssh2_Cushort...
93     d                 s              5u 0 based(######typedef######)
94     d libssh2_Cint    s             10i 0 based(######typedef######)
95     d libssh2_CuInt   s             10u 0 based(######typedef######)
96     d libssh2_Clong   s             10i 0 based(######typedef######)
97     d libssh2_Culong  s             10u 0 based(######typedef######)
98     d libssh2_Clonglong...
99     d                 s             20i 0 based(######typedef######)
100     d libssh2_Culonglong...
101     d                 s             20u 0 based(######typedef######)
102     d libssh2_Cenum   s             10i 0 based(######typedef######)
103     d libssh2_Cssize_t...
104     d                 s             10i 0 based(######typedef######)
105     d libssh2_Csize_t...
106     d                 s             10u 0 based(######typedef######)
107     d libssh2_Cfloat  s              4f   based(######typedef######)
108     d libssh2_Cdouble...
109     d                 s              8f   based(######typedef######)
110
111     d libssh2_uint8_t...
112     d                 s              3u 0 based(######typedef######)
113     d libssh2_uint32_t...
114     d                 s             10u 0 based(######typedef######)
115     d libssh2_uint64_t...
116     d                 s             20u 0 based(######typedef######)
117     d libssh2_int64_t...
118     d                 s             20i 0 based(######typedef######)
119
120     d libssh2_socket_t...
121     d                 s             10i 0 based(######typedef######)
122     d LIBSSH2_INVALID_SOCKET...
123     d                 c                   -1
124
125     d libssh2_mode_t  s             10u 0 based(######typedef######)
126     d libssh2_ino_t   s             10u 0 based(######typedef######)
127     d libssh2_uid_t   s             10u 0 based(######typedef######)
128     d libssh2_gid_t   s             10u 0 based(######typedef######)
129     d libssh2_dev_t   s             10u 0 based(######typedef######)
130     d libssh2_off_t   s             20i 0 based(######typedef######)           Use *IFS64IO
131     d libssh2_time_t  s             10i 0 based(######typedef######)
132     d libssh2_nlink_t...
133     d                 s              5u 0 based(######typedef######)
134     d libssh2_qp0l_objtype_t...                                                AS400 object type
135     d                 s             11
136
137     d libssh2_struct_stat_size...
138     d                 s                   based(######typedef######)
139     d                                     like(libssh2_off_t)
140
141     d libssh2_struct_stat...
142     d                 ds                  based(######typedef######)
143     d                                     align qualified
144     d  st_mode                            like(libssh2_mode_t)                 Mode flags
145     d  st_ino                             like(libssh2_ino_t)                  File serial number
146     d  st_nlink                           like(libssh2_nlink_t)                Number of links
147     d  st_uid                             like(libssh2_uid_t)                  Owner ID
148     d  st_gid                             like(libssh2_gid_t)                  Group ID
149     d  st_size                            like(libssh2_off_t)                  File size
150     d  st_atime                           like(libssh2_time_t)                 Last access time
151     d  st_mtime                           like(libssh2_time_t)                 Last update time
152     d  st_ctime                           like(libssh2_time_t)                 Creation time
153     d  st_dev                             like(libssh2_dev_t)                  File root device
154     d  st_blksize                         like(libssh2_Csize_t)                Block size
155     d  st_allocsize                       like(libssh2_Culong)                 Allocation size
156     d  st_objtype                         like(libssh2_qp0l_objtype_t)         AS400 object type
157     d  st_codepage                        like(libssh2_Cushort)                Object data codepage
158     d                               62                                         Reserved
159     d  st_ino_gen_id                      like(libssh2_Cuint)                  File SN gen. ID
160
161     d LIBSSH2_STRUCT_STAT_SIZE_FORMAT...
162     d                 c                   '%lld'
163
164      * Part of every banner, user specified or not.
165     d LIBSSH2_SSH_BANNER...
166     d                 c                   'SSH-2.0-libssh2_1.6.1_DEV'
167     d LIBSSH2_SSH_DEFAULT_BANNER...
168     d                 c                   'SSH-2.0-libssh2_1.6.1_DEV'
169
170      * Default generate and safe prime sizes for
171      * diffie-hellman-group-exchange-sha1.
172     d LIBSSH2_DH_GEX_MINGROUP...
173     d                 c                   1024
174     d LIBSSH2_DH_GEX_OPTGROUP...
175     d                 c                   1536
176     d LIBSSH2_DH_GEX_MAXGROUP...
177     d                 c                   2048
178
179      * Defaults for pty requests.
180     d LIBSSH2_TERM_WIDTH...
181     d                 c                   80
182     d LIBSSH2_TERM_HEIGHT...
183     d                 c                   24
184     d LIBSSH2_TERM_WIDTH_PX...
185     d                 c                   0
186     d LIBSSH2_TERM_HEIGHT_PX...
187     d                 c                   0
188
189      * 1/4 second.
190     d LIBSSH2_SOCKET_POLL_UDELAY...
191     d                 c                   250000
192      * 0.25 * 120 == 30 seconds.
193     d LIBSSH2_SOCKET_POLL_MAXLOOPS...
194     d                 c                   120
195
196      * Maximum size to allow a payload to compress to, plays it safe by
197      * falling short of spec limits.
198     d LIBSSH2_PACKET_MAXCOMP...
199     d                 c                   32000
200
201      * Maximum size to allow a payload to deccompress to, plays it safe by
202      * allowing more than spec requires.
203     d LIBSSH2_PACKET_MAXDECOMP...
204     d                 c                   40000
205
206      * Maximum size for an inbound compressed payload, plays it safe by
207      * overshooting spec limits.
208     d LIBSSH2_PACKET_MAXPAYLOAD...
209     d                 c                   40000
210
211     d LIBSSH2_USERAUTH_KBDINT_PROMPT...
212     d                 ds                  based(######typedef######)
213     d                                     align qualified
214     d  text                           *                                        char *
215     d  length                             like(libssh2_Cuint)
216     d  echo                               like(libssh2_Cuchar)
217
218     d LIBSSH2_USERAUTH_KBDINT_RESPONSE...
219     d                 ds                  based(######typedef######)
220     d                                     align qualified
221     d  text                           *                                        char *
222     d  length                             like(libssh2_Cuint)
223
224      * libssh2_session_callback_set() constants.
225     d LIBSSH2_CALLBACK_IGNORE...
226     d                 c                   0
227     d LIBSSH2_CALLBACK_DEBUG...
228     d                 c                   1
229     d LIBSSH2_CALLBACK_DISCONNECT...
230     d                 c                   2
231     d LIBSSH2_CALLBACK_MACERROR...
232     d                 c                   3
233     d LIBSSH2_CALLBACK_X11...
234     d                 c                   4
235     d LIBSSH2_CALLBACK_SEND...
236     d                 c                   5
237     d LIBSSH2_CALLBACK_RECV...
238     d                 c                   6
239
240      * libssh2_session_method_pref() constants.
241     d LIBSSH2_METHOD_KEX...
242     d                 c                   0
243     d LIBSSH2_METHOD_HOSTKEY...
244     d                 c                   1
245     d LIBSSH2_METHOD_CRYPT_CS...
246     d                 c                   2
247     d LIBSSH2_METHOD_CRYPT_SC...
248     d                 c                   3
249     d LIBSSH2_METHOD_MAC_CS...
250     d                 c                   4
251     d LIBSSH2_METHOD_MAC_SC...
252     d                 c                   5
253     d LIBSSH2_METHOD_COMP_CS...
254     d                 c                   6
255     d LIBSSH2_METHOD_COMP_SC...
256     d                 c                   7
257     d LIBSSH2_METHOD_LANG_CS...
258     d                 c                   8
259     d LIBSSH2_METHOD_LANG_SC...
260     d                 c                   9
261
262      * flags.
263     d LIBSSH2_FLAG_SIGPIPE...
264     d                 c                   X'0001'
265     d LIBSSH2_FLAG_COMPRESS...
266     d                 c                   X'0002'
267
268     d LIBSSH2_POLLFD  ds                  based(######typedef######)
269     d                                     align qualified
270     d  type                               like(libssh2_Cuchar)
271     d  fd                             *                                        Union
272     d   socket                            overlay(fd) like(libssh2_socket_t)
273     d   channel                       *   overlay(fd)                          LIBSSH2_CHANNEL *
274     d   listener                      *   overlay(fd)                          LIBSSH2_LISTENER *
275     d  events                             like(libssh2_Culong)
276     d  revents                            like(libssh2_Culong)
277
278      * Poll FD Descriptor Types.
279     d LIBSSH2_POLLFD_SOCKET...
280     d                 c                   1
281     d LIBSSH2_POLLFD_CHANNEL...
282     d                 c                   2
283     d LIBSSH2_POLLFD_LISTENER...
284     d                 c                   3
285
286      * Poll FD events/revents -- Match sys/poll.h where possible.
287     d LIBSSH2_POLLFD_POLLIN...                                                 Input data ready or
288     d                 c                   X'0001'                              connection available
289     d LIBSSH2_POLLFD_POLLPRI...                                                Prio data ready to
290     d                 c                   X'0002'                              be read. Socket only
291     d LIBSSH2_POLLFD_POLLEXT...                                                Ext data ready to be
292     d                 c                   X'0002'                              read. Channel only
293     d LIBSSH2_POLLFD_POLLOUT...                                                Can may be written:
294     d                 c                   X'0004'                              Socket/Channel
295
296      * revents only.
297     d LIBSSH2_POLLFD_POLLERR...                                                Error Condition:
298     d                 c                   X'0008'                              Socket
299     d LIBSSH2_POLLFD_POLLHUP...                                                HangUp/EOF
300     d                 c                   X'0010'                              Socket
301     d LIBSSH2_POLLFD_SESSION_CLOSED...                                         Session Disconnect
302     d                 c                   X'0010'
303     d LIBSSH2_POLLFD_POLLNVAL...                                               Invalid request
304     d                 c                   X'0020'                              Socket
305     d LIBSSH2_POLLFD_POLLEX...                                                 Exception Condition
306     d                 c                   X'0040'                              Socket/Win32
307     d LIBSSH2_POLLFD_CHANNEL_CLOSED...                                         Channel Disconnect
308     d                 c                   X'0080'
309     d LIBSSH2_POLLFD_LISTENER_CLOSED...                                        Listener Disconnect
310     d                 c                   X'0080'
311
312      /define HAVE_LIBSSH2_SESSION_BLOCK_DIRECTION
313      * Block Direction Types.
314     d LIBSSH2_SESSION_BLOCK_INBOUND...
315     d                 c                   X'0001'
316     d LIBSSH2_SESSION_BLOCK_OUTBOUND...
317     d                 c                   X'0002'
318
319      * Hash Types.
320     d LIBSSH2_HOSTKEY_HASH_MD5...
321     d                 c                   1
322     d LIBSSH2_HOSTKEY_HASH_SHA1...
323     d                 c                   2
324
325      * Hostkey Types.
326     d LIBSSH2_HOSTKEY_TYPE_UNKNOWN...
327     d                 c                   0
328     d LIBSSH2_HOSTKEY_TYPE_RSA...
329     d                 c                   1
330     d LIBSSH2_HOSTKEY_TYPE_DSS...
331     d                 c                   2
332
333      * Disconnect Codes (defined by SSH protocol).
334     d SSH_DISCONNECT_HOST_NOT_ALLOWED_TO_CONNECT...
335     d                 c                   1
336     d SSH_DISCONNECT_PROTOCOL_ERROR...
337     d                 c                   2
338     d SSH_DISCONNECT_KEY_EXCHANGE_FAILED...
339     d                 c                   3
340     d SSH_DISCONNECT_RESERVED...
341     d                 c                   4
342     d SSH_DISCONNECT_MAC_ERROR...
343     d                 c                   5
344     d SSH_DISCONNECT_COMPRESSION_ERROR...
345     d                 c                   6
346     d SSH_DISCONNECT_SERVICE_NOT_AVAILABLE...
347     d                 c                   7
348     d SSH_DISCONNECT_PROTOCOL_VERSION_NOT_SUPPORTED...
349     d                 c                   8
350     d SSH_DISCONNECT_HOST_KEY_NOT_VERIFIABLE...
351     d                 c                   9
352     d SSH_DISCONNECT_CONNECTION_LOST...
353     d                 c                   10
354     d SSH_DISCONNECT_BY_APPLICATION...
355     d                 c                   11
356     d SSH_DISCONNECT_TOO_MANY_CONNECTIONS...
357     d                 c                   12
358     d SSH_DISCONNECT_AUTH_CANCELLED_BY_USER...
359     d                 c                   13
360     d SSH_DISCONNECT_NO_MORE_AUTH_METHODS_AVAILABLE...
361     d                 c                   14
362     d SSH_DISCONNECT_ILLEGAL_USER_NAME...
363     d                 c                   15
364
365      * Error Codes (defined by libssh2).
366     d LIBSSH2_ERROR_NONE...
367     d                 c                   0
368
369      * The library once used -1 as a generic error return value on numerous
370      * places through the code, which subsequently was converted to
371      * LIBSSH2_ERROR_SOCKET_NONE uses over time. As this is a generic error
372      * code, the goal is to never ever return this code but instead make sure
373      * that a more accurate and descriptive error code is used.
374     d  LIBSSH2_ERROR_SOCKET_NONE...
375     d                 c                   -1
376
377     d LIBSSH2_ERROR_BANNER_RECV...
378     d                 c                   -2
379     d LIBSSH2_ERROR_BANNER_SEND...
380     d                 c                   -3
381     d LIBSSH2_ERROR_INVALID_MAC...
382     d                 c                   -4
383     d LIBSSH2_ERROR_KEX_FAILURE...
384     d                 c                   -5
385     d LIBSSH2_ERROR_ALLOC...
386     d                 c                   -6
387     d LIBSSH2_ERROR_SOCKET_SEND...
388     d                 c                   -7
389     d LIBSSH2_ERROR_KEY_EXCHANGE_FAILURE...
390     d                 c                   -8
391     d LIBSSH2_ERROR_TIMEOUT...
392     d                 c                   -9
393     d LIBSSH2_ERROR_HOSTKEY_INIT...
394     d                 c                   -10
395     d LIBSSH2_ERROR_HOSTKEY_SIGN...
396     d                 c                   -11
397     d LIBSSH2_ERROR_DECRYPT...
398     d                 c                   -12
399     d LIBSSH2_ERROR_SOCKET_DISCONNECT...
400     d                 c                   -13
401     d LIBSSH2_ERROR_PROTO...
402     d                 c                   -14
403     d LIBSSH2_ERROR_PASSWORD_EXPIRED...
404     d                 c                   -15
405     d LIBSSH2_ERROR_FILE...
406     d                 c                   -16
407     d LIBSSH2_ERROR_METHOD_NONE...
408     d                 c                   -17
409     d LIBSSH2_ERROR_AUTHENTICATION_FAILED...
410     d                 c                   -18
411     d LIBSSH2_ERROR_PUBLICKEY_UNRECOGNIZED...
412     d                 c                   -18
413     d LIBSSH2_ERROR_PUBLICKEY_UNVERIFIED...
414     d                 c                   -19
415     d LIBSSH2_ERROR_CHANNEL_OUTOFORDER...
416     d                 c                   -20
417     d LIBSSH2_ERROR_CHANNEL_FAILURE...
418     d                 c                   -21
419     d LIBSSH2_ERROR_CHANNEL_REQUEST_DENIED...
420     d                 c                   -22
421     d LIBSSH2_ERROR_CHANNEL_UNKNOWN...
422     d                 c                   -23
423     d LIBSSH2_ERROR_CHANNEL_WINDOW_EXCEEDED...
424     d                 c                   -24
425     d LIBSSH2_ERROR_CHANNEL_PACKET_EXCEEDED...
426     d                 c                   -25
427     d LIBSSH2_ERROR_CHANNEL_CLOSED...
428     d                 c                   -26
429     d LIBSSH2_ERROR_CHANNEL_EOF_SENT...
430     d                 c                   -27
431     d LIBSSH2_ERROR_SCP_PROTOCOL...
432     d                 c                   -28
433     d LIBSSH2_ERROR_ZLIB...
434     d                 c                   -29
435     d LIBSSH2_ERROR_SOCKET_TIMEOUT...
436     d                 c                   -30
437     d LIBSSH2_ERROR_SFTP_PROTOCOL...
438     d                 c                   -31
439     d LIBSSH2_ERROR_REQUEST_DENIED...
440     d                 c                   -32
441     d LIBSSH2_ERROR_METHOD_NOT_SUPPORTED...
442     d                 c                   -33
443     d LIBSSH2_ERROR_INVAL...
444     d                 c                   -34
445     d LIBSSH2_ERROR_INVALID_POLL_TYPE...
446     d                 c                   -35
447     d LIBSSH2_ERROR_PUBLICKEY_PROTOCOL...
448     d                 c                   -36
449     d LIBSSH2_ERROR_EAGAIN...
450     d                 c                   -37
451     d LIBSSH2_ERROR_BUFFER_TOO_SMALL...
452     d                 c                   -38
453     d LIBSSH2_ERROR_BAD_USE...
454     d                 c                   -39
455     d LIBSSH2_ERROR_COMPRESS...
456     d                 c                   -40
457     d LIBSSH2_ERROR_OUT_OF_BOUNDARY...
458     d                 c                   -41
459     d LIBSSH2_ERROR_AGENT_PROTOCOL...
460     d                 c                   -42
461     d LIBSSH2_ERROR_SOCKET_RECV...
462     d                 c                   -43
463     d LIBSSH2_ERROR_ENCRYPT...
464     d                 c                   -44
465     d LIBSSH2_ERROR_BAD_SOCKET...
466     d                 c                   -45
467     d LIBSSH2_ERROR_KNOWN_HOSTS...
468     d                 c                   -46
469
470      * this is a define to provide the old (<= 1.2.7) name.
471     d LIBSSH2_ERROR_BANNER_NONE...
472     d                 c                   -2
473
474      * Global API.
475     d LIBSSH2_INIT_NO_CRYPTO...
476     d                 c                   X'0001'
477
478      * libssh2_init()
479      *
480      * Initialize the libssh2 functions.  This typically initialize the
481      * crypto library.  It uses a global state, and is not thread safe --
482      * you must make sure this function is not called concurrently.
483      *
484      * Flags can be:
485      * 0:                              Normal initialize
486      * LIBSSH2_INIT_NO_CRYPTO:         Do not initialize the crypto library
487      *                                 (ie. OPENSSL_add_cipher_algorithms() for
488      *                                 OpenSSL)
489      *
490      * Returns 0 if succeeded, or a negative value for error.
491
492     d libssh2_init    pr                  extproc('libssh2_init')
493     d                                     like(libssh2_Cint)
494     d  flags                              value like(libssh2_Cint)
495
496      * libssh2_exit()
497      *
498      * Exit the libssh2 functions and free's all memory used internal.
499
500     d libssh2_exit    pr                  extproc('libssh2_exit')
501
502      * libssh2_free()
503      *
504      * Deallocate memory allocated by earlier call to libssh2 functions.
505
506     d libssh2_free    pr                  extproc('libssh2_free')
507     d  session                        *   value                                LIBSSH2_SESSION *
508     d  ptr                            *   value                                void *
509
510      * libssh2_session_supported_algs()
511      *
512      * Fills algs with a list of supported cryptographic algorithms. Returns a
513      * non-negative number (number of supported algorithms) on success or a
514      * negative number (an eror code) on failure.
515      *
516      * NOTE: on success, algs must be deallocated (by calling libssh2_free)
517      * when not needed anymore
518
519     d libssh2_session_supported_algs...
520     d                 pr                  extproc(
521     d                                       'libssh2_session_supported_algs')
522     d                                     like(libssh2_Cint)
523     d  session                        *   value                                LIBSSH2_SESSION *
524     d  method_type                        value like(libssh2_Cint)
525     d  algs                           *                                        const char **(*)
526
527      * Session API.
528     d libssh2_session_init_ex...
529     d                 pr              *   extproc('libssh2_session_init_ex')   LIBSSH2_SESSION *
530     d  my_alloc                       *   value procptr
531     d  my_free                        *   value procptr
532     d  my_realloc                     *   value procptr
533     d  abstract                       *   value                                void *
534
535      * Implementation of C macro.
536     d libssh2_session_init...
537     d                 pr              *   extproc('libssh2_session_init')      LIBSSH2_SESSION *
538
539     d libssh2_session_abstract...
540     d                 pr              *   extproc('libssh2_session_abstract')  void * *
541     d  session                        *   value                                LIBSSH2_SESSION *
542
543     d libssh2_session_callback_set...
544     d                 pr              *   extproc(                             void *
545     d                                     'libssh2_session_callback_set')
546     d  session                        *   value                                LIBSSH2_SESSION *
547     d  cbtype                             value like(libssh2_Cint)
548     d  callback                       *   value                                void *
549
550     d libssh2_session_banner_set...
551     d                 pr                  extproc('libssh2_session_banner_set')
552     d                                     like(libssh2_Cint)
553     d  session                        *   value                                LIBSSH2_SESSION *
554     d  banner                         *   value options(*string)               const char *
555
556     d libssh2_banner_set...
557     d                 pr                  extproc('libssh2_banner_set')
558     d                                     like(libssh2_Cint)
559     d  session                        *   value                                LIBSSH2_SESSION *
560     d  banner                         *   value options(*string)               const char *
561
562     d libssh2_session_startup...
563     d                 pr                  extproc('libssh2_session_startup')
564     d                                     like(libssh2_Cint)
565     d  session                        *   value                                LIBSSH2_SESSION *
566     d  sock                               value like(libssh2_Cint)
567
568     d libssh2_session_handshake...
569     d                 pr                  extproc('libssh2_session_handshake')
570     d                                     like(libssh2_Cint)
571     d  session                        *   value                                LIBSSH2_SESSION *
572     d  sock                               value like(libssh2_socket_t)
573
574     d libssh2_session_disconnect_ex...
575     d                 pr                  extproc(
576     d                                     'libssh2_session_disconnect_ex')
577     d                                     like(libssh2_Cint)
578     d  session                        *   value                                LIBSSH2_SESSION *
579     d  reason                             value like(libssh2_Cint)
580     d  description                    *   value options(*string)               const char *
581     d  lang                           *   value options(*string)               const char *
582
583      * Implementation of C macro.
584     d libssh2_session_disconnect...
585     d                 pr                  extproc('libssh2_session_disconnect')
586     d                                     like(libssh2_Cint)
587     d  session                        *   value                                LIBSSH2_SESSION *
588     d  description                    *   value options(*string)               const char *
589
590     d libssh2_session_free...
591     d                 pr                  extproc('libssh2_session_free')
592     d                                     like(libssh2_Cint)
593     d  session                        *   value                                LIBSSH2_SESSION *
594
595     d libssh2_hostkey_hash...
596     d                 pr              *   extproc('libssh2_hostkey_hash')      const char *
597     d  session                        *   value                                LIBSSH2_SESSION *
598     d  hash_type                          value like(libssh2_Cint)
599
600     d libssh2_session_hostkey...
601     d                 pr              *   extproc('libssh2_session_hostkey')   const char *
602     d  session                        *   value                                LIBSSH2_SESSION *
603     d  len                                like(libssh2_Csize_t)
604     d  type                               like(libssh2_Cint)
605
606     d libssh2_session_method_pref...
607     d                 pr                  extproc(
608     d                                     'libssh2_session_method_pref')
609     d                                     like(libssh2_Cint)
610     d  session                        *   value                                LIBSSH2_SESSION *
611     d  method_type                        value like(libssh2_Cint)
612     d  prefs                          *   value options(*string)               const char *
613
614     d libssh2_session_methods...
615     d                 pr              *   extproc('libssh2_session_methods')   const char *
616     d  session                        *   value                                LIBSSH2_SESSION *
617     d  method_type                        value like(libssh2_Cint)
618
619     d libssh2_session_last_error...
620     d                 pr                  extproc('libssh2_session_last_error')
621     d                                     like(libssh2_Cint)
622     d  session                        *   value                                LIBSSH2_SESSION *
623     d  errmsg                         *                                        char *(*)
624     d  errmsg_len                         like(libssh2_Cint)
625     d  want_buf                           value like(libssh2_Cint)
626
627     d libssh2_session_last_errno...
628     d                 pr                  extproc('libssh2_session_last_errno')
629     d                                     like(libssh2_Cint)
630     d  session                        *   value                                LIBSSH2_SESSION *
631
632     d libssh2_session_set_last_error...
633     d                 pr                  extproc(
634     d                                     'libssh2_session_set_last_error')
635     d                                     like(libssh2_Cint)
636     d  session                        *   value                                LIBSSH2_SESSION *
637     d  errcode                            value like(libssh2_Cint)
638     d  errmsg                         *   value options(*string)               const char *
639
640     d libssh2_session_block_directions...
641     d                 pr                  extproc(
642     d                                     'libssh2_session_block_directions')
643     d                                     like(libssh2_Cint)
644     d  session                        *   value                                LIBSSH2_SESSION *
645
646     d libssh2_session_flag...
647     d                 pr                  extproc('libssh2_session_flag')
648     d                                     like(libssh2_Cint)
649     d  session                        *   value                                LIBSSH2_SESSION *
650     d  flag                               value like(libssh2_Cint)
651     d  value                              value like(libssh2_Cint)
652
653     d libssh2_session_banner_get...
654     d                 pr              *   extproc('libssh2_session_banner_get') const char *
655     d  session                        *   value                                LIBSSH2_SESSION *
656
657      * Userauth API.
658
659     d libssh2_userauth_list...
660     d                 pr              *   extproc('libssh2_userauth_list')     char *
661     d  session                        *   value                                LIBSSH2_SESSION *
662     d  username                       *   value options(*string)               const char *
663     d  username_len                       value like(libssh2_Cuint)
664
665     d libssh2_userauth_authenticated...
666     d                 pr                  extproc(
667     d                                     'libssh2_userauth_authenticated')
668     d                                     like(libssh2_Cint)
669     d  session                        *   value                                LIBSSH2_SESSION *
670
671     d libssh2_userauth_password_ex...
672     d                 pr                  extproc(
673     d                                     'libssh2_userauth_password_ex')
674     d                                     like(libssh2_Cint)
675     d  session                        *   value                                LIBSSH2_SESSION *
676     d  username                       *   value options(*string)               const char *
677     d  username_len                       value like(libssh2_Cuint)
678     d  password                       *   value options(*string)               const char *
679     d  password_len                       value like(libssh2_Cuint)
680     d  passwd_change_cb...
681     d                                 *   value procptr
682
683      * Implementation of C macro.
684     d libssh2_userauth_password...
685     d                 pr                  extproc('libssh2_userauth_password')
686     d                                     like(libssh2_Cint)
687     d  session                        *   value                                LIBSSH2_SESSION *
688     d  username                       *   value options(*string)               const char *
689     d  password                       *   value options(*string)               const char *
690
691     d libssh2_userauth_publickey_fromfile_ex...
692     d                 pr                  extproc('libssh2_userauth_publickey_-
693     d                                     fromfile_ex')
694     d                                     like(libssh2_Cint)
695     d  session                        *   value                                LIBSSH2_SESSION *
696     d  username                       *   value options(*string)               const char *
697     d  username_len                       value like(libssh2_Cuint)
698     d  publickey                      *   value options(*string)               const char *
699     d  privatekey                     *   value options(*string)               const char *
700     d  passphrase                     *   value options(*string)               const char *
701
702      * Implementation of C macro.
703     d libssh2_userauth_publickey_fromfile...
704     d                 pr                  extproc(
705     d                                     'libssh2_userauth_publickey_fromfile'
706     d                                     )
707     d                                     like(libssh2_Cint)
708     d  session                        *   value                                LIBSSH2_SESSION *
709     d  username                       *   value options(*string)               const char *
710     d  publickey                      *   value options(*string)               const char *
711     d  privatekey                     *   value options(*string)               const char *
712     d  passphrase                     *   value options(*string)               const char *
713
714     d libssh2_userauth_publickey...
715     d                 pr                  extproc('libssh2_userauth_publickey')
716     d                                     like(libssh2_Cint)
717     d  session                        *   value                                LIBSSH2_SESSION *
718     d  username                       *   value options(*string)               const char *
719     d  pubkeydata                     *   value options(*string)               const unsigned char*
720     d  pubkeydata_len...
721     d                                     value like(libssh2_Csize_t)
722     d  sign_callback                  *   value procptr
723     d  abstract                       *                                        void *(*)
724
725     d libssh2_userauth_hostbased_fromfile_ex...
726     d                 pr                  extproc('libssh2_userauth_hostbased_-
727     d                                     fromfile_ex')
728     d                                     like(libssh2_Cint)
729     d  session                        *   value                                LIBSSH2_SESSION *
730     d  username                       *   value options(*string)               const char *
731     d  username_len                       value like(libssh2_Cuint)
732     d  publickey                      *   value options(*string)               const char *
733     d  privatekey                     *   value options(*string)               const char *
734     d  passphrase                     *   value options(*string)               const char *
735     d  hostname                       *   value options(*string)               const char *
736     d  hostname_len                       value like(libssh2_Cuint)
737     d  local_username...
738     d                                 *   value options(*string)               const char *
739     d  local_username_len...
740     d                                     value like(libssh2_Cuint)
741
742      * C macro implementation.
743     d libssh2_userauth_hostbased_fromfile...
744     d                 pr                  extproc(
745     d                                     'libssh2_userauth_hostbased_fromfile'
746     d                                     )
747     d                                     like(libssh2_Cint)
748     d  session                        *   value                                LIBSSH2_SESSION *
749     d  username                       *   value options(*string)               const char *
750     d  publickey                      *   value options(*string)               const char *
751     d  privatekey                     *   value options(*string)               const char *
752     d  passphrase                     *   value options(*string)               const char *
753     d  hostname                       *   value options(*string)               const char *
754
755     d libssh2_userauth_publickey_frommemory...
756     d                 pr                  extproc('libssh2_userauth_publickey_-
757     d                                     frommemory')
758     d                                     like(libssh2_Cint)
759     d  session                        *   value                                LIBSSH2_SESSION *
760     d  username                       *   value options(*string)               const char *
761     d  username_len                       value like(libssh2_Csize_t)
762     d  publickeyfiledata...
763     d                                 *   value options(*string)               const char *
764     d  publickeyfiledata_len...
765     d                                     value like(libssh2_Csize_t)
766     d  privatekeyfiledata...
767     d                                 *   value options(*string)               const char *
768     d  privatekeyfiledata_len...
769     d                                     value like(libssh2_Csize_t)
770     d  passphrase                     *   value options(*string)               const char *
771
772      * response_callback is provided with filled by library prompts array,
773      * but client must allocate and fill individual responses. Responses
774      * array is already allocated. Responses data will be freed by libssh2
775      * after callback return, but before subsequent callback invokation.
776
777     d libssh2_userauth_keyboard_interactive_ex...
778     d                 pr                  extproc('libssh2_userauth_keyboard_i-
779     d                                     nteractive_ex')
780     d                                     like(libssh2_Cint)
781     d  session                        *   value                                LIBSSH2_SESSION *
782     d  username                       *   value options(*string)               const char *
783     d  username_len                       value like(libssh2_Cuint)
784     d  response_callback...
785     d                                 *   value procptr
786
787      * C macro implementation.
788     d libssh2_userauth_keyboard_interactive...
789     d                 pr                  extproc('libssh2_userauth_keyboard_i-
790     d                                     nteractive')
791     d                                     like(libssh2_Cint)
792     d  session                        *   value                                LIBSSH2_SESSION *
793     d  username                       *   value options(*string)               const char *
794     d  response_callback...
795     d                                 *   value procptr
796
797     d libssh2_poll    pr                  extproc('libssh2_poll')
798     d                                     like(libssh2_Cint)
799     d  fds                            *   value                                LIBSSH2_POLLFD *
800     d  nfds                               value like(libssh2_Cuint)
801     d  timeout                            value like(libssh2_Clong)
802
803      * Channel API.
804     d LIBSSH2_CHANNEL_WINDOW_DEFAULT...
805     d                 c                   X'00200000'
806     d LIBSSH2_CHANNEL_PACKET_DEFAULT...
807     d                 c                   32768
808     d LIBSSH2_CHANNEL_MINADJUST...
809     d                 c                   1024
810
811      * Extended Data Handling.
812     d LIBSSH2_CHANNEL_EXTENDED_DATA_NORMAL...
813     d                 c                   0
814     d LIBSSH2_CHANNEL_EXTENDED_DATA_IGNORE...
815     d                 c                   1
816     d LIBSSH2_CHANNEL_EXTENDED_DATA_MERGE...
817     d                 c                   2
818
819     d SSH_EXTENDED_DATA_STDERR...
820     d                 c                   1
821
822      * Returned by any function that would block during a read/write
823      * operation.
824     d LIBSSH2CHANNEL_EAGAIN...                                                 LIBSSH2_ERROR_EAGAIN
825     d                 c                   -37
826
827     d libssh2_channel_open_ex...
828     d                 pr              *   extproc('libssh2_channel_open_ex')   LIBSSH2_CHANNEL *
829     d  session                        *   value                                LIBSSH2_SESSION *
830     d  channel_type                   *   value options(*string)               const char *
831     d  channel_type_len...
832     d                                     value like(libssh2_Cuint)
833     d  window_size                        value like(libssh2_Cuint)
834     d  packet_size                        value like(libssh2_Cuint)
835     d  message                        *   value options(*string)               const char *
836     d  message_len                        value like(libssh2_Cuint)
837
838      * C macro implementation.
839     d libssh2_channel_open_session...
840     d                 pr              *   extproc(                             LIBSSH2_CHANNEL *
841     d                                     'libssh2_channel_open_session')
842     d  session                        *   value                                LIBSSH2_SESSION *
843
844     d libssh2_channel_direct_tcpip_ex...
845     d                 pr              *   extproc(                             LIBSSH2_CHANNEL *
846     d                                     'libssh2_channel_direct_tcpip_ex')
847     d  session                        *   value                                LIBSSH2_SESSION *
848     d  host                           *   value options(*string)               const char *
849     d  port                               value like(libssh2_Cint)
850     d  shost                          *   value options(*string)               const char *
851     d  sport                              value like(libssh2_Cint)
852
853      * C macro implementation.
854     d libssh2_channel_direct_tcpip...
855     d                 pr              *   extproc(                             LIBSSH2_CHANNEL *
856     d                                     'libssh2_channel_direct_tcpip')
857     d  session                        *   value                                LIBSSH2_SESSION *
858     d  host                           *   value options(*string)               const char *
859     d  port                               value like(libssh2_Cint)
860
861     d libssh2_channel_forward_listen_ex...
862     d                 pr              *   extproc(                             LIBSSH2_LISTENER *
863     d                                     'libssh2_channel_forward_listen_ex')
864     d  session                        *   value                                LIBSSH2_SESSION *
865     d  host                           *   value options(*string)               const char *
866     d  port                               value like(libssh2_Cint)
867     d  bound_port                         like(libssh2_Cint)
868     d  queue_maxsize                      value like(libssh2_Cint)
869
870      * C macro implementation.
871     d libssh2_channel_forward_listen...
872     d                 pr              *   extproc(                             LIBSSH2_LISTENER *
873     d                                     'libssh2_channel_forward_listen')
874     d  session                        *   value                                LIBSSH2_SESSION *
875     d  port                               value like(libssh2_Cint)
876
877     d libssh2_channel_forward_cancel...
878     d                 pr                  extproc(
879     d                                     'libssh2_channel_forward_cancel')
880     d                                     like(libssh2_Cint)
881     d  listener                       *   value                                LIBSSH2_LISTENER *
882
883     d libssh2_channel_forward_accept...
884     d                 pr              *   extproc(                             LIBSSH2_CHANNEL *
885     d                                     'libssh2_channel_forward_accept')
886     d  listener                       *   value                                LIBSSH2_LISTENER *
887
888     d libssh2_channel_setenv_ex...
889     d                 pr                  extproc('libssh2_channel_setenv_ex')
890     d                                     like(libssh2_Cint)
891     d  channel                        *   value                                LIBSSH2_CHANNEL *
892     d  varname                        *   value options(*string)               const char *
893     d  varname_len                        value like(libssh2_Cuint)
894     d  value                          *   value options(*string)               const char *
895     d  value_len                          value like(libssh2_Cuint)
896
897      * C macro implementation.
898     d libssh2_channel_setenv...
899     d                 pr                  extproc('libssh2_channel_setenv')
900     d                                     like(libssh2_Cint)
901     d  channel                        *   value                                LIBSSH2_CHANNEL *
902     d  varname                        *   value options(*string)               const char *
903     d  value                          *   value options(*string)               const char *
904
905     d libssh2_channel_request_pty_ex...
906     d                 pr                  extproc(
907     d                                     'libssh2_channel_request_pty_ex')
908     d                                     like(libssh2_Cint)
909     d  channel                        *   value                                LIBSSH2_CHANNEL *
910     d  term                           *   value options(*string)               const char *
911     d  term_len                           value like(libssh2_Cuint)
912     d  modes                          *   value options(*string)               const char *
913     d  modes_len                          value like(libssh2_Cuint)
914     d  width                              value like(libssh2_Cint)
915     d  height                             value like(libssh2_Cint)
916     d  width_px                           value like(libssh2_Cint)
917     d  height_px                          value like(libssh2_Cint)
918
919      * C macro implementation.
920     d libssh2_channel_request_pty...
921     d                 pr                  extproc(
922     d                                     'libssh2_channel_request_pty')
923     d                                     like(libssh2_Cint)
924     d  channel                        *   value                                LIBSSH2_CHANNEL *
925     d  term                           *   value options(*string)               const char *
926
927     d libssh2_channel_request_pty_size_ex...
928     d                 pr                  extproc(
929     d                                     'libssh2_channel_request_pty_size_ex'
930     d                                     )
931     d                                     like(libssh2_Cint)
932     d  channel                        *   value                                LIBSSH2_CHANNEL *
933     d  width                              value like(libssh2_Cint)
934     d  height                             value like(libssh2_Cint)
935     d  width_px                           value like(libssh2_Cint)
936     d  height_px                          value like(libssh2_Cint)
937
938      * C macro implementation.
939     d libssh2_channel_request_pty_size...
940     d                 pr                  extproc(
941     d                                     'libssh2_channel_request_pty_size')
942     d                                     like(libssh2_Cint)
943     d  channel                        *   value                                LIBSSH2_CHANNEL *
944     d  width                              value like(libssh2_Cint)
945     d  height                             value like(libssh2_Cint)
946
947     d libssh2_channel_x11_req_ex...
948     d                 pr                  extproc('libssh2_channel_x11_req_ex')
949     d                                     like(libssh2_Cint)
950     d  channel                        *   value                                LIBSSH2_CHANNEL *
951     d  single_connection...
952     d                                     value like(libssh2_Cint)
953     d  auth_proto                     *   value options(*string)               const char *
954     d  auth_cookie                    *   value options(*string)               const char *
955     d  screen_number                      value like(libssh2_Cint)
956
957      * C macro implementation.
958     d libssh2_channel_x11_req...
959     d                 pr                  extproc('libssh2_channel_x11_req')
960     d                                     like(libssh2_Cint)
961     d  channel                        *   value                                LIBSSH2_CHANNEL *
962     d  screen_number                      value like(libssh2_Cint)
963
964     d libssh2_channel_process_startup...
965     d                 pr                  extproc(
966     d                                     'libssh2_channel_process_startup')
967     d                                     like(libssh2_Cint)
968     d  channel                        *   value                                LIBSSH2_CHANNEL *
969     d  request                        *   value options(*string)               const char *
970     d  request_len                        value like(libssh2_Cuint)
971     d  message                        *   value options(*string)               const char *
972     d  message_len                        value like(libssh2_Cuint)
973
974      * C macro implementation.
975     d libssh2_channel_shell...
976     d                 pr                  extproc('libssh2_channel_shell')
977     d                                     like(libssh2_Cint)
978     d  channel                        *   value                                LIBSSH2_CHANNEL *
979
980      * C macro implementation.
981     d libssh2_channel_exec...
982     d                 pr                  extproc('libssh2_channel_exec')
983     d                                     like(libssh2_Cint)
984     d  channel                        *   value                                LIBSSH2_CHANNEL *
985     d  command                        *   value options(*string)               const char *
986
987      * C macro implementation.
988     d libssh2_channel_subsystem...
989     d                 pr                  extproc('libssh2_channel_subsystem')
990     d                                     like(libssh2_Cint)
991     d  channel                        *   value                                LIBSSH2_CHANNEL *
992     d  subsystem                      *   value options(*string)               const char *
993
994     d libssh2_channel_read_ex...
995     d                 pr                  extproc('libssh2_channel_read_ex')
996     d                                     like(libssh2_Cssize_t)
997     d  channel                        *   value                                LIBSSH2_CHANNEL *
998     d  stream_id                          value like(libssh2_Cint)
999     d  buf                            *   value                                char *
1000     d  buflen                             value like(libssh2_Csize_t)
1001
1002      * C macro implementation.
1003     d libssh2_channel_read...
1004     d                 pr                  extproc('libssh2_channel_read')
1005     d                                     like(libssh2_Cssize_t)
1006     d  channel                        *   value                                LIBSSH2_CHANNEL *
1007     d  buf                            *   value                                char *
1008     d  buflen                             value like(libssh2_Csize_t)
1009
1010      * C macro implementation.
1011     d libssh2_channel_read_stderr...
1012     d                 pr                  extproc(
1013     d                                     'libssh2_channel_read_stderr')
1014     d                                     like(libssh2_Cssize_t)
1015     d  channel                        *   value                                LIBSSH2_CHANNEL *
1016     d  buf                            *   value                                char *
1017     d  buflen                             value like(libssh2_Csize_t)
1018
1019     d libssh2_poll_channel_read...
1020     d                 pr                  extproc('libssh2_poll_channel_read')
1021     d                                     like(libssh2_Cint)
1022     d  channel                        *   value                                LIBSSH2_CHANNEL *
1023     d  extended                           value like(libssh2_Cint)
1024
1025     d libssh2_channel_window_read_ex...
1026     d                 pr                  extproc(
1027     d                                     'libssh2_channel_window_read_ex')
1028     d                                     like(libssh2_Culong)
1029     d  channel                        *   value                                LIBSSH2_CHANNEL *
1030     d  read_avail                         like(libssh2_Culong)
1031     d  window_size_initial...
1032     d                                     like(libssh2_Culong)
1033
1034      * C macro implementation.
1035     d libssh2_channel_window_read...
1036     d                 pr                  extproc(
1037     d                                     'libssh2_channel_window_read')
1038     d                                     like(libssh2_Culong)
1039     d  channel                        *   value                                LIBSSH2_CHANNEL *
1040
1041     d libssh2_channel_receive_window_adjust2...
1042     d                 pr                  extproc('libssh2_channel_receive_win-
1043     d                                     dow_adjust2')
1044     d                                     like(libssh2_Cint)
1045     d  channel                        *   value                                LIBSSH2_CHANNEL *
1046     d  adjustment                         value like(libssh2_Culong)
1047     d  force                              value like(libssh2_Cuchar)
1048     d  storewindow                        like(libssh2_Cuint)
1049
1050     d libssh2_channel_write_ex...
1051     d                 pr                  extproc('libssh2_channel_write_ex')
1052     d                                     like(libssh2_Cssize_t)
1053     d  channel                        *   value                                LIBSSH2_CHANNEL *
1054     d  stream_id                          value like(libssh2_Cint)
1055     d  buf                            *   value options(*string)               const char *
1056     d  buflen                             value like(libssh2_Csize_t)
1057
1058      * C macro implementation.
1059     d libssh2_channel_write...
1060     d                 pr                  extproc('libssh2_channel_write')
1061     d                                     like(libssh2_Cssize_t)
1062     d  channel                        *   value                                LIBSSH2_CHANNEL *
1063     d  buf                            *   value options(*string)               const char *
1064     d  buflen                             value like(libssh2_Csize_t)
1065
1066      * C macro implementation.
1067     d libssh2_channel_write_stderr...
1068     d                 pr                  extproc(
1069     d                                     'libssh2_channel_write_stderr')
1070     d                                     like(libssh2_Cssize_t)
1071     d  channel                        *   value                                LIBSSH2_CHANNEL *
1072     d  buf                            *   value options(*string)               const char *
1073     d  buflen                             value like(libssh2_Csize_t)
1074
1075     d libssh2_channel_window_write_ex...
1076     d                 pr                  extproc(
1077     d                                     'libssh2_channel_window_write_ex')
1078     d                                     like(libssh2_Culong)
1079     d  channel                        *   value                                LIBSSH2_CHANNEL *
1080     d  window_size_initial...
1081     d                                     like(libssh2_Culong)
1082
1083      * C macro implementation.
1084     d libssh2_channel_window_write...
1085     d                 pr                  extproc(
1086     d                                     'libssh2_channel_window_write')
1087     d                                     like(libssh2_Culong)
1088     d  channel                        *   value                                LIBSSH2_CHANNEL *
1089
1090     d libssh2_session_set_blocking...
1091     d                 pr                  extproc(
1092     d                                     'libssh2_session_set_blocking')
1093     d  session                        *   value                                LIBSSH2_SESSION *
1094     d  blocking                           value like(libssh2_Cint)
1095
1096     d libssh2_session_get_blocking...
1097     d                 pr                  extproc(
1098     d                                     'libssh2_session_get_blocking')
1099     d                                     like(libssh2_Cint)
1100     d  session                        *   value                                LIBSSH2_SESSION *
1101
1102     d libssh2_channel_set_blocking...
1103     d                 pr                  extproc(
1104     d                                     'libssh2_channel_set_blocking')
1105     d  channel                        *   value                                LIBSSH2_CHANNEL *
1106     d  blocking                           value like(libssh2_Cint)
1107
1108     d libssh2_session_set_timeout...
1109     d                 pr                  extproc(
1110     d                                     'libssh2_session_set_timeout')
1111     d  session                        *   value                                LIBSSH2_SESSION *
1112     d  timeout                            value like(libssh2_Clong)
1113
1114     d libssh2_session_get_timeout...
1115     d                 pr                  extproc(
1116     d                                     'libssh2_session_get_timeout')
1117     d                                     like(libssh2_Clong)
1118     d  session                        *   value                                LIBSSH2_SESSION *
1119
1120     d libssh2_channel_handle_extended_data2...
1121     d                 pr                  extproc('libssh2_channel_handle_exte-
1122     d                                     nded_data2')
1123     d                                     like(libssh2_Cint)
1124     d  channel                        *   value                                LIBSSH2_CHANNEL *
1125     d  ignore_mode                        value like(libssh2_Cint)
1126
1127      * libssh2_channel_ignore_extended_data() is defined below for BC with
1128      * version 0.1.
1129
1130     d LIBSSH2_CHANNEL_FLUSH_EXTENDED_DATA...
1131     d                 c                   -1
1132     d LIBSSH2_CHANNEL_FLUSH_ALL...
1133     d                 c                   -2
1134
1135     d libssh2_channel_flush_ex...
1136     d                 pr                  extproc('libssh2_channel_flush_ex')
1137     d                                     like(libssh2_Cint)
1138     d  channel                        *   value                                LIBSSH2_CHANNEL *
1139     d  streamid                           value like(libssh2_Cint)
1140
1141      * C macro implementation.
1142     d libssh2_channel_flush...
1143     d                 pr                  extproc('libssh2_channel_flush')
1144     d                                     like(libssh2_Cint)
1145     d  channel                        *   value                                LIBSSH2_CHANNEL *
1146
1147      * C macro implementation.
1148     d libssh2_channel_flush_stderr...
1149     d                 pr                  extproc(
1150     d                                     'libssh2_channel_flush_stderr')
1151     d                                     like(libssh2_Cint)
1152     d  channel                        *   value                                LIBSSH2_CHANNEL *
1153
1154     d libssh2_channel_get_exit_status...
1155     d                 pr                  extproc(
1156     d                                     'libssh2_channel_get_exit_status')
1157     d                                     like(libssh2_Cint)
1158     d  channel                        *   value                                LIBSSH2_CHANNEL *
1159
1160     d libssh2_channel_get_exit_signal...
1161     d                 pr                  extproc(
1162     d                                     'libssh2_channel_get_exit_signal')
1163     d                                     like(libssh2_Cint)
1164     d  channel                        *   value                                LIBSSH2_CHANNEL *
1165     d  exitsignal                     *                                        char *(*)
1166     d  exitsignal_len...
1167     d                                     like(libssh2_Csize_t)
1168     d  errmsg                         *                                        char *(*)
1169     d  errmsg_len                         like(libssh2_Csize_t)
1170     d  langtag                        *                                        char *(*)
1171     d  langtag_len                        like(libssh2_Csize_t)
1172
1173     d libssh2_channel_send_eof...
1174     d                 pr                  extproc('libssh2_channel_send_eof')
1175     d                                     like(libssh2_Cint)
1176     d  channel                        *   value                                LIBSSH2_CHANNEL *
1177
1178     d libssh2_channel_eof...
1179     d                 pr                  extproc('libssh2_channel_eof')
1180     d                                     like(libssh2_Cint)
1181     d  channel                        *   value                                LIBSSH2_CHANNEL *
1182
1183     d libssh2_channel_wait_eof...
1184     d                 pr                  extproc('libssh2_channel_wait_eof')
1185     d                                     like(libssh2_Cint)
1186     d  channel                        *   value                                LIBSSH2_CHANNEL *
1187
1188     d libssh2_channel_close...
1189     d                 pr                  extproc('libssh2_channel_close')
1190     d                                     like(libssh2_Cint)
1191     d  channel                        *   value                                LIBSSH2_CHANNEL *
1192
1193     d libssh2_channel_wait_closed...
1194     d                 pr                  extproc(
1195     d                                     'libssh2_channel_wait_closed')
1196     d                                     like(libssh2_Cint)
1197     d  channel                        *   value                                LIBSSH2_CHANNEL *
1198
1199     d libssh2_channel_free...
1200     d                 pr                  extproc('libssh2_channel_free')
1201     d                                     like(libssh2_Cint)
1202     d  channel                        *   value                                LIBSSH2_CHANNEL *
1203
1204      * Use libssh2_scp_recv2 for large (> 2GB) file support.
1205     d libssh2_scp_recv2...
1206     d                 pr              *   extproc('libssh2_scp_recv2')         LIBSSH2_CHANNEL *
1207     d  session                        *   value                                LIBSSH2_SESSION *
1208     d  path                           *   value options(*string)               const char *
1209     d  sb                                 likeds(libssh2_struct_stat)
1210
1211     d libssh2_scp_send_ex...
1212     d                 pr              *   extproc('libssh2_scp_send_ex')       LIBSSH2_CHANNEL *
1213     d  session                        *   value                                LIBSSH2_SESSION *
1214     d  path                           *   value options(*string)               const char *
1215     d  mode                               value like(libssh2_Cint)
1216     d  size                               value like(libssh2_Csize_t)
1217     d  mtime                              value like(libssh2_Clong)
1218     d  atime                              value like(libssh2_Clong)
1219
1220     d libssh2_scp_send64...
1221     d                 pr              *   extproc('libssh2_scp_send64')        LIBSSH2_CHANNEL *
1222     d  session                        *   value                                LIBSSH2_SESSION *
1223     d  path                           *   value options(*string)               const char *
1224     d  mode                               value like(libssh2_Cint)
1225     d  size                               value like(libssh2_int64_t)
1226     d  mtime                              value like(libssh2_time_t)
1227     d  atime                              value like(libssh2_time_t)
1228
1229      * C macro implementation.
1230     d libssh2_scp_send...
1231     d                 pr              *   extproc('libssh2_scp_send')          LIBSSH2_CHANNEL *
1232     d  session                        *   value                                LIBSSH2_SESSION *
1233     d  path                           *   value options(*string)               const char *
1234     d  mode                               value like(libssh2_Cint)
1235     d  size                               value like(libssh2_int64_t)
1236
1237     d libssh2_base64_decode...
1238     d                 pr                  extproc('libssh2_base64_decode')
1239     d                                     like(libssh2_Cint)
1240     d  session                        *   value                                LIBSSH2_SESSION *
1241     d  dest                           *   value                                char * *
1242     d  dest_len                       *   value                                unsigned int *
1243     d  src                            *   value options(*string)               const char *
1244     d  src_len                            value like(libssh2_Cuint)
1245
1246      * Procedure libssh2_version renamed to avoid upper/lower case name clash.
1247     d libssh2_get_version...
1248     d                 pr              *   extproc('libssh2_version')           const char *
1249     d  req_version_num...
1250     d                                     value like(libssh2_Cint)
1251
1252     d HAVE_LIBSSH2_KNOWNHOST_API...                                            since 1.1.1
1253     d                 c                   X'010101'
1254     d HAVE_LIBSSH2_VERSION_API...                                              since 1.1
1255     d                 c                   X'010100'
1256
1257     d libssh2_knownhost...
1258     d                 ds                  based(######typedef######)
1259     d                                     align qualified
1260     d  magic                              like(libssh2_Cuint)
1261     d  node                           *                                        void *
1262     d  name                           *                                        char *
1263     d  key                            *                                        char *
1264     d  typemask                           like(libssh2_Cint)
1265
1266      * libssh2_knownhost_init
1267      *
1268      * Init a collection of known hosts. Returns the pointer to a collection.
1269
1270     d libssh2_knownhost_init...
1271     d                 pr              *   extproc('libssh2_knownhost_init')    LIBSSH2_KNOWNHOSTS *
1272     d  session                        *   value                                LIBSSH2_SESSION *
1273
1274      * libssh2_knownhost_add
1275      *
1276      * Add a host and its associated key to the collection of known hosts.
1277      *
1278      * The 'type' argument specifies on what format the given host and
1279      * keys are:
1280      *
1281      * plain  - ascii "hostname.domain.tld"
1282      * sha1   - SHA1(<salt> <host>) base64-encoded!
1283      * custom - another hash
1284      *
1285      * If 'sha1' is selected as type, the salt must be provided to the salt
1286      * argument. This too base64 encoded.
1287      *
1288      * The SHA-1 hash is what OpenSSH can be told to use in known_hosts files.
1289      * If a custom type is used, salt is ignored and you must provide the host
1290      * pre-hashed when checking for it in the libssh2_knownhost_check()
1291      * function.
1292      *
1293      * The keylen parameter may be omitted (zero) if the key is provided as a
1294      * NULL-terminated base64-encoded string.
1295
1296      * host format (2 bits).
1297     d LIBSSH2_KNOWNHOST_TYPE_MASK...
1298     d                 c                   X'FFFF'
1299     d  LIBSSH2_KNOWNHOST_TYPE_PLAIN...
1300     d                 c                   1
1301     d LIBSSH2_KNOWNHOST_TYPE_SHA1...                                           always base64 ncoded
1302     d                 c                   2
1303     d LIBSSH2_KNOWNHOST_TYPE_CUSTOM...
1304     d                 c                   3
1305
1306      * key format (2 bits).
1307     d LIBSSH2_KNOWNHOST_KEYENC_MASK...
1308     d                 c                   X'00030000'
1309     d LIBSSH2_KNOWNHOST_KEYENC_RAW...
1310     d                 c                   X'00010000'
1311     d LIBSSH2_KNOWNHOST_KEYENC_BASE64...
1312     d                 c                   X'00020000'
1313
1314      * type of key (3 bits).
1315     d LIBSSH2_KNOWNHOST_KEY_MASK...
1316     d                 c                   X'001C0000'
1317     d LIBSSH2_KNOWNHOST_KEY_SHIFT...
1318     d                 c                   18
1319     d LIBSSH2_KNOWNHOST_KEY_RSA1...
1320     d                 c                   X'00040000'
1321     d LIBSSH2_KNOWNHOST_KEY_SSHRSA...
1322     d                 c                   X'00080000'
1323     d LIBSSH2_KNOWNHOST_KEY_SSHDSS...
1324     d                 c                   X'000C0000'
1325     d LIBSSH2_KNOWNHOST_KEY_UNKNOWN...
1326     d                 c                   X'001C0000'
1327
1328     d libssh2_knownhost_add...
1329     d                 pr                  extproc('libssh2_knownhost_add')
1330     d                                     like(libssh2_Cint)
1331     d  hosts                          *   value                                LIBSSH2_KNOWNHOSTS *
1332     d  host                           *   value options(*string)               const char *
1333     d  salt                           *   value options(*string)               const char *
1334     d  key                            *   value options(*string)               const char *
1335     d  keylen                             value like(libssh2_Csize_t)
1336     d  typemask                           value like(libssh2_Cint)
1337     d  store                          *                                        libssh2_knownhost *
1338
1339      * libssh2_knownhost_addc
1340      *
1341      * Add a host and its associated key to the collection of known hosts.
1342      *
1343      * Takes a comment argument that may be NULL.  A NULL comment indicates
1344      * there is no comment and the entry will end directly after the key
1345      * when written out to a file.  An empty string "" comment will indicate an
1346      * empty comment which will cause a single space to be written after the
1347      * key.
1348      *
1349      * The 'type' argument specifies on what format the given host and keys
1350      * are:
1351      *
1352      * plain  - ascii "hostname.domain.tld"
1353      * sha1   - SHA1(<salt> <host>) base64-encoded!
1354      * custom - another hash
1355      *
1356      * If 'sha1' is selected as type, the salt must be provided to the salt
1357      * argument. This too base64 encoded.
1358      *
1359      * The SHA-1 hash is what OpenSSH can be told to use in known_hosts files.
1360      * If a custom type is used, salt is ignored and you must provide the host
1361      * pre-hashed when checking for it in the libssh2_knownhost_check()
1362      * function.
1363      *
1364      * The keylen parameter may be omitted (zero) if the key is provided as a
1365      * NULL-terminated base64-encoded string.
1366
1367     d libssh2_knownhost_addc...
1368     d                 pr                  extproc('libssh2_knownhost_addc')
1369     d                                     like(libssh2_Cint)
1370     d  hosts                          *   value                                LIBSSH2_KNOWNHOSTS *
1371     d  host                           *   value options(*string)               const char *
1372     d  salt                           *   value options(*string)               const char *
1373     d  key                            *   value options(*string)               const char *
1374     d  keylen                             value like(libssh2_Csize_t)
1375     d  comment                        *   value options(*string)               const char *
1376     d  commentlen                         value like(libssh2_Csize_t)
1377     d  typemask                           value like(libssh2_Cint)
1378     d  store                          *                                        libssh2_knownhost *
1379
1380
1381      * libssh2_knownhost_check
1382      *
1383      * Check a host and its associated key against the collection of known
1384      * hosts.
1385      *
1386      * The type is the type/format of the given host name.
1387      *
1388      * plain  - ascii "hostname.domain.tld"
1389      * custom - prehashed base64 encoded. Note that this cannot use any salts.
1390      *
1391      *
1392      * 'knownhost' may be set to NULL if you don't care about that info.
1393      *
1394      * Returns:
1395      *
1396      * LIBSSH2_KNOWNHOST_CHECK_* values, see below.
1397
1398     d LIBSSH2_KNOWNHOST_CHECK_MATCH...
1399     d                 c                   0
1400     d LIBSSH2_KNOWNHOST_CHECK_MISMATCH...
1401     d                 c                   1
1402     d LIBSSH2_KNOWNHOST_CHECK_NOTFOUND...
1403     d                 c                   2
1404     d LIBSSH2_KNOWNHOST_CHECK_FAILURE...
1405     d                 c                   3
1406
1407     d libssh2_knownhost_check...
1408     d                 pr                  extproc('libssh2_knownhost_check')
1409     d                                     like(libssh2_Cint)
1410     d  hosts                          *   value                                LIBSSH2_KNOWNHOSTS *
1411     d  host                           *   value options(*string)               const char *
1412     d  key                            *   value options(*string)               const char *
1413     d  keylen                             value like(libssh2_Csize_t)
1414     d  typemask                           value like(libssh2_Cint)
1415     d  knownhost                      *                                        libssh2_knownhost *
1416
1417      * this function is identital to the above one, but also takes a port
1418      * argument that allows libssh2 to do a better check.
1419     d libssh2_knownhost_checkp...
1420     d                 pr                  extproc('libssh2_knownhost_checkp')
1421     d                                     like(libssh2_Cint)
1422     d  hosts                          *   value                                LIBSSH2_KNOWNHOSTS *
1423     d  host                           *   value options(*string)               const char *
1424     d  port                               value like(libssh2_Cint)
1425     d  key                            *   value options(*string)               const char *
1426     d  keylen                             value like(libssh2_Csize_t)
1427     d  typemask                           value like(libssh2_Cint)
1428     d  knownhost                      *                                        libssh2_knownhost *
1429
1430      * libssh2_knownhost_del
1431      *
1432      * Remove a host from the collection of known hosts. The 'entry' struct is
1433      * retrieved by a call to libssh2_knownhost_check().
1434
1435     d libssh2_knownhost_del...
1436     d                 pr                  extproc('libssh2_knownhost_del')
1437     d                                     like(libssh2_Cint)
1438     d  hosts                          *   value                                LIBSSH2_KNOWNHOSTS *
1439     d  entry                              likeds(libssh2_knownhost)
1440
1441      * libssh2_knownhost_free
1442      *
1443      * Free an entire collection of known hosts.
1444
1445     d libssh2_knownhost_free...
1446     d                 pr                  extproc('libssh2_knownhost_free')
1447     d  hosts                          *   value                                LIBSSH2_KNOWNHOSTS *
1448
1449      * libssh2_knownhost_readline()
1450      *
1451      * Pass in a line of a file of 'type'. It makes libssh2 read this line.
1452      *
1453      * LIBSSH2_KNOWNHOST_FILE_OPENSSH is the only supported type.
1454
1455     d libssh2_knownhost_readline...
1456     d                 pr                  extproc('libssh2_knownhost_readline')
1457     d                                     like(libssh2_Cint)
1458     d  hosts                          *   value                                LIBSSH2_KNOWNHOSTS *
1459     d  line                           *   value options(*string)               const char *
1460     d  len                                value like(libssh2_Csize_t)
1461     d  type                               value like(libssh2_Cint)
1462
1463      * libssh2_knownhost_readfile
1464      *
1465      * Add hosts+key pairs from a given file.
1466      *
1467      * Returns a negative value for error or number of successfully added
1468      * hosts.
1469      *
1470      * This implementation currently only knows one 'type' (openssh), all
1471      * others are reserved for future use.
1472
1473     d LIBSSH2_KNOWNHOST_FILE_OPENSSH...
1474     d                 c                   1
1475
1476     d libssh2_knownhost_readfile...
1477     d                 pr                  extproc('libssh2_knownhost_readfile')
1478     d                                     like(libssh2_Cint)
1479     d  hosts                          *   value                                LIBSSH2_KNOWNHOSTS *
1480     d  filename                       *   value options(*string)               const char *
1481     d  type                               value like(libssh2_Cint)
1482
1483      * libssh2_knownhost_writeline()
1484      *
1485      * Ask libssh2 to convert a known host to an output line for storage.
1486      *
1487      * Note that this function returns LIBSSH2_ERROR_BUFFER_TOO_SMALL if the
1488      * given output buffer is too small to hold the desired output.
1489      *
1490      * This implementation currently only knows one 'type' (openssh), all
1491      * others are reserved for future use.
1492
1493     d libssh2_knownhost_writeline...
1494     d                 pr                  extproc(
1495     d                                     'libssh2_knownhost_writeline')
1496     d                                     like(libssh2_Cint)
1497     d  hosts                          *   value                                LIBSSH2_KNOWNHOSTS *
1498     d  known                              likeds(libssh2_knownhost)
1499     d  buffer                         *   value options(*string)               char *
1500     d  buflen                             value like(libssh2_Csize_t)
1501     d  outlen                             like(libssh2_Csize_t)                Written data amount
1502     d  type                               value like(libssh2_Cint)
1503
1504      * libssh2_knownhost_writefile
1505      *
1506      * Write hosts+key pairs to a given file.
1507      *
1508      * This implementation currently only knows one 'type' (openssh), all
1509      * others are reserved for future use.
1510
1511     d libssh2_knownhost_writefile...
1512     d                 pr                  extproc(
1513     d                                     'libssh2_knownhost_writefile')
1514     d                                     like(libssh2_Cint)
1515     d  hosts                          *   value                                LIBSSH2_KNOWNHOSTS *
1516     d  filename                       *   value options(*string)               const char *
1517     d  type                               value like(libssh2_Cint)
1518
1519      * libssh2_knownhost_get()
1520      *
1521      * Traverse the internal list of known hosts. Pass NULL to 'prev' to get
1522      * the first one. Or pass a poiner to the previously returned one to
1523      * get the next.
1524      *
1525      * Returns:
1526      * 0 if a fine host was stored in 'store'
1527      * 1 if end of hosts
1528      * [negative] on errors
1529
1530     d libssh2_knownhost_get...
1531     d                 pr                  extproc('libssh2_knownhost_get')
1532     d                                     like(libssh2_Cint)
1533     d  hosts                          *   value                                LIBSSH2_KNOWNHOSTS *
1534     d  store                          *                                        libssh2_knownhost *
1535     d  prev                               likeds(libssh2_knownhost)
1536
1537     d HAVE_LIBSSH2_AGENT_API...                                                since 1.2.2
1538     d                 c                   X'010202'
1539
1540     d libssh2_agent_publickey...
1541     d                 ds                  based(######typedef######)
1542     d                                     align qualified
1543     d  magic                              like(libssh2_Cuint)
1544     d  node                           *                                        void *
1545     d  blob                           *                                        unsigned char *
1546     d  blob_len                           like(libssh2_Csize_t)
1547     d  comment                        *                                        char *
1548
1549      * libssh2_agent_init
1550      *
1551      * Init an ssh-agent handle. Returns the pointer to the handle.
1552
1553     d libssh2_agent_init...
1554     d                 pr              *   extproc('libssh2_agent_init')        LIBSSH2_AGENT *
1555     d  session                        *   value                                LIBSSH2_SESSION *
1556
1557      * libssh2_agent_connect()
1558      *
1559      * Connect to an ssh-agent.
1560      *
1561      * Returns 0 if succeeded, or a negative value for error.
1562
1563     d libssh2_agent_connect...
1564     d                 pr                  extproc('libssh2_agent_connect')
1565     d                                     like(libssh2_Cint)
1566     d  agent                          *   value                                LIBSSH2_AGENT *
1567
1568      * libssh2_agent_list_identities()
1569      *
1570      * Request an ssh-agent to list identities.
1571      *
1572      * Returns 0 if succeeded, or a negative value for error.
1573
1574     d libssh2_agent_list_identities...
1575     d                 pr                  extproc(
1576     d                                     'libssh2_agent_list_identities')
1577     d                                     like(libssh2_Cint)
1578     d  agent                          *   value                                LIBSSH2_AGENT *
1579
1580      * libssh2_agent_get_identity()
1581      *
1582      * Traverse the internal list of public keys. Pass NULL to 'prev' to get
1583      * the first one. Or pass a poiner to the previously returned one to
1584      * get the next.
1585      *
1586      * Returns:
1587      * 0 if a fine public key was stored in 'store'
1588      * 1 if end of public keys
1589      * [negative] on errors
1590
1591     d libssh2_agent_get_identity...
1592     d                 pr                  extproc('libssh2_agent_get_identity')
1593     d                                     like(libssh2_Cint)
1594     d  agent                          *   value                                LIBSSH2_AGENT *
1595     d  store                          *                                        libssh2_agent_...
1596     d                                                                          publickey *(*)
1597     d  prev                               likeds(libssh2_agent_publickey)
1598
1599      * libssh2_agent_userauth()
1600      *
1601      * Do publickey user authentication with the help of ssh-agent.
1602      *
1603      * Returns 0 if succeeded, or a negative value for error.
1604
1605     d libssh2_agent_userauth...
1606     d                 pr                  extproc('libssh2_agent_userauth')
1607     d                                     like(libssh2_Cint)
1608     d  agent                          *   value                                LIBSSH2_AGENT *
1609     d  username                       *   value options(*string)               const char *
1610     d  identity                           likeds(libssh2_agent_publickey)
1611
1612      * libssh2_agent_disconnect()
1613      *
1614      * Close a connection to an ssh-agent.
1615      *
1616      * Returns 0 if succeeded, or a negative value for error.
1617
1618     d libssh2_agent_disconnect...
1619     d                 pr                  extproc('libssh2_agent_disconnect')
1620     d                                     like(libssh2_Cint)
1621     d  agent                          *   value                                LIBSSH2_AGENT *
1622
1623      * libssh2_agent_free()
1624      *
1625      * Free an ssh-agent handle. This function also frees the internal
1626      * collection of public keys.
1627
1628     d libssh2_agent_free...
1629     d                 pr                  extproc('libssh2_agent_free')
1630     d  agent                          *   value                                LIBSSH2_AGENT *
1631
1632
1633      * libssh2_keepalive_config()
1634      *
1635      * Set how often keepalive messages should be sent.  WANT_REPLY
1636      * indicates whether the keepalive messages should request a response
1637      * from the server.  INTERVAL is number of seconds that can pass
1638      * without any I/O, use 0 (the default) to disable keepalives.  To
1639      * avoid some busy-loop corner-cases, if you specify an interval of 1
1640      * it will be treated as 2.
1641      *
1642      * Note that non-blocking applications are responsible for sending the
1643      * keepalive messages using libssh2_keepalive_send().
1644
1645     d libssh2_keepalive_config...
1646     d                 pr                  extproc('libssh2_keepalive_config')
1647     d  session                        *   value                                LIBSSH2_SESSION *
1648     d  want_reply                         value like(libssh2_Cint)
1649     d  interval                           value like(libssh2_Cuint)
1650
1651      * libssh2_keepalive_send()
1652      *
1653      * Send a keepalive message if needed.  SECONDS_TO_NEXT indicates how
1654      * many seconds you can sleep after this call before you need to call
1655      * it again.  Returns 0 on success, or LIBSSH2_ERROR_SOCKET_SEND on
1656      * I/O errors.
1657
1658     d libssh2_keepalive_send...
1659     d                 pr                  extproc('libssh2_keepalive_send')
1660     d                                     like(libssh2_Cint)
1661     d  session                        *   value                                LIBSSH2_SESSION *
1662     d  seconds_to_next...
1663     d                                     like(libssh2_Cint)
1664
1665      * NOTE NOTE NOTE
1666      * libssh2_trace() has no function in builds that aren't built with debug
1667      * enabled.
1668
1669     d libssh2_trace   pr                  extproc('libssh2_trace')
1670     d                                     like(libssh2_Cint)
1671     d  session                        *   value                                LIBSSH2_SESSION *
1672     d  bitmask                            value like(libssh2_Cint)
1673
1674     d LIBSSH2_TRACE_TRANS...
1675     d                 c                   X'0002'
1676     d LIBSSH2_TRACE_KEX...
1677     d                 c                   X'0004'
1678     d LIBSSH2_TRACE_AUTH...
1679     d                 c                   X'0008'
1680     d LIBSSH2_TRACE_CONN...
1681     d                 c                   X'0010'
1682     d LIBSSH2_TRACE_SCP...
1683     d                 c                   X'0020'
1684     d LIBSSH2_TRACE_SFTP...
1685     d                 c                   X'0040'
1686     d LIBSSH2_TRACE_ERROR...
1687     d                 c                   X'0080'
1688     d LIBSSH2_TRACE_PUBLICKEY...
1689     d                 c                   X'0100'
1690     d LIBSSH2_TRACE_SOCKET...
1691     d                 c                   X'0200'
1692
1693     d libssh2_trace_handler_func...
1694     d                 s               *   based(######typedef######) procptr
1695
1696     d libssh2_trace_sethandler...
1697     d                 pr                  extproc('libssh2_trace_sethandler')
1698     d                                     like(libssh2_Cint)
1699     d  session                        *   value                                LIBSSH2_SESSION *
1700     d  context                        *   value                                void *
1701     d  callback                           value
1702     d                                     like(libssh2_trace_handler_func)
1703
1704      /endif                                                                    LIBSSH2_H_
1705