File: libssh2.rpgle.in

package info (click to toggle)
libssh2 1.11.1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 6,504 kB
  • sloc: ansic: 46,104; sh: 6,164; makefile: 348; cpp: 120; perl: 65; lisp: 33; awk: 23
file content (1962 lines) | stat: -rw-r--r-- 102,543 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
      * Copyright (C) Patrick Monnerat <patrick@monnerat.net>
      * All rights reserved.
      *
      * Redistribution and use in source and binary forms,
      * with or without modification, are permitted provided
      * that the following conditions are met:
      *
      *   Redistributions of source code must retain the above
      *   copyright notice, this list of conditions and the
      *   following disclaimer.
      *
      *   Redistributions in binary form must reproduce the above
      *   copyright notice, this list of conditions and the following
      *   disclaimer in the documentation and/or other materials
      *   provided with the distribution.
      *
      *   Neither the name of the copyright holder nor the names
      *   of any other contributors may be used to endorse or
      *   promote products derived from this software without
      *   specific prior written permission.
      *
      * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
      * CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
      * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
      * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
      * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
      * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
      * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
      * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
      * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
      * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
      * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
      * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
      * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
      * OF SUCH DAMAGE.
      *
      * SPDX-License-Identifier: BSD-3-Clause

      /if not defined(LIBSSH2_H_)
      /define LIBSSH2_H_

     d LIBSSH2_COPYRIGHT...
     d                 c                   'The libssh2 project and +
     d                                     its contributors.'

      * We use underscore instead of dash when appending DEV in dev versions
      * just to make the BANNER define (used by src/session.c) be a valid SSH
      * banner. Release versions have no appended strings and may of course not
      * have dashes either.
     d LIBSSH2_VERSION...
     d                 c                   '@LIBSSH2_VERSION@'

      * The numeric version number is also available "in parts" by using these
      * defines:
     d LIBSSH2_VERSION_MAJOR...
     d                 c                   @LIBSSH2_VERSION_MAJOR@
     d LIBSSH2_VERSION_MINOR...
     d                 c                   @LIBSSH2_VERSION_MINOR@
     d LIBSSH2_VERSION_PATCH...
     d                 c                   @LIBSSH2_VERSION_PATCH@

      * This is the numeric version of the libssh2 version number, meant for
      * easier parsing and comparisons by programs. The LIBSSH2_VERSION_NUM
      * define will always follow this syntax:
      *
      *  X'XXYYZZ'
      *
      * Where XX, YY and ZZ are the main version, release and patch numbers in
      * hexadecimal (using 8 bits each). All three numbers are always
      * represented using two digits.  1.2 would appear as "0x010200" while
      * version 9.11.7 appears as X'090b07'.
      *
      * This 6-digit (24 bits) hexadecimal number does not show pre-release
      * number, and it is always a greater number in a more recent release. It
      * makes comparisons with greater than and less than work.

     d LIBSSH2_VERSION_NUM...
     d                 c                   X'@LIBSSH2_VERSION_NUM@'

      * This is the date and time when the full source package was created. The
      * timestamp is not stored in the source code repo, as the timestamp is
      * properly set in the tarballs by the maketgz script.
      *
      * The format of the date should follow this template:
      *
      * "Mon Feb 12 11:35:33 UTC 2007"

     d LIBSSH2_TIMESTAMP...
     d                 c                   '@LIBSSH2_TIMESTAMP@'

     d libssh2_Cchar   s              3i 0 based(######typedef######)
     d libssh2_Cuchar  s              3u 0 based(######typedef######)
     d libssh2_Cshort  s              5i 0 based(######typedef######)
     d libssh2_Cushort...
     d                 s              5u 0 based(######typedef######)
     d libssh2_Cint    s             10i 0 based(######typedef######)
     d libssh2_CuInt   s             10u 0 based(######typedef######)
     d libssh2_Clong   s             10i 0 based(######typedef######)
     d libssh2_Culong  s             10u 0 based(######typedef######)
     d libssh2_Clonglong...
     d                 s             20i 0 based(######typedef######)
     d libssh2_Culonglong...
     d                 s             20u 0 based(######typedef######)
     d libssh2_Cenum   s             10i 0 based(######typedef######)
     d libssh2_Cssize_t...
     d                 s             10i 0 based(######typedef######)
     d libssh2_Csize_t...
     d                 s             10u 0 based(######typedef######)
     d libssh2_Cfloat  s              4f   based(######typedef######)
     d libssh2_Cdouble...
     d                 s              8f   based(######typedef######)

     d libssh2_uint8_t...
     d                 s              3u 0 based(######typedef######)
     d libssh2_uint16_t...
     d                 s              5u 0 based(######typedef######)
     d libssh2_uint32_t...
     d                 s             10u 0 based(######typedef######)
     d libssh2_int32_t...
     d                 s             10i 0 based(######typedef######)
     d libssh2_uint64_t...
     d                 s             20u 0 based(######typedef######)
     d libssh2_int64_t...
     d                 s             20i 0 based(######typedef######)

     d libssh2_socket_t...
     d                 s             10i 0 based(######typedef######)
     d LIBSSH2_INVALID_SOCKET...
     d                 c                   -1
     d LIBSSH2_SOCKET_CLOSE...
     d                 pr                  extproc('close')
     d                                     like(libssh2_Cint)
     d  s                                  value like(libssh2_socket_t)

     d libssh2_mode_t  s             10u 0 based(######typedef######)
     d libssh2_ino_t   s             10u 0 based(######typedef######)
     d libssh2_uid_t   s             10u 0 based(######typedef######)
     d libssh2_gid_t   s             10u 0 based(######typedef######)
     d libssh2_dev_t   s             10u 0 based(######typedef######)
     d libssh2_off_t   s             20i 0 based(######typedef######)           Use *IFS64IO
     d libssh2_time_t  s             10i 0 based(######typedef######)
     d libssh2_nlink_t...
     d                 s              5u 0 based(######typedef######)
     d libssh2_qp0l_objtype_t...                                                AS400 object type
     d                 s             11

     d libssh2_struct_stat_size...
     d                 s                   based(######typedef######)
     d                                     like(libssh2_off_t)

     d libssh2_struct_stat...
     d                 ds                  based(######typedef######)
     d                                     align qualified
     d  st_mode                            like(libssh2_mode_t)                 Mode flags
     d  st_ino                             like(libssh2_ino_t)                  File serial number
     d  st_nlink                           like(libssh2_nlink_t)                Number of links
     d  st_uid                             like(libssh2_uid_t)                  Owner ID
     d  st_gid                             like(libssh2_gid_t)                  Group ID
     d  st_size                            like(libssh2_off_t)                  File size
     d  st_atime                           like(libssh2_time_t)                 Last access time
     d  st_mtime                           like(libssh2_time_t)                 Last update time
     d  st_ctime                           like(libssh2_time_t)                 Creation time
     d  st_dev                             like(libssh2_dev_t)                  File root device
     d  st_blksize                         like(libssh2_Csize_t)                Block size
     d  st_allocsize                       like(libssh2_Culong)                 Allocation size
     d  st_objtype                         like(libssh2_qp0l_objtype_t)         AS400 object type
     d  st_codepage                        like(libssh2_Cushort)                Object data codepage
     d                               62                                         Reserved
     d  st_ino_gen_id                      like(libssh2_Cuint)                  File SN gen. ID

     d LIBSSH2_STRUCT_STAT_SIZE_FORMAT...
     d                 c                   '%lld'

      * Part of every banner, user specified or not.
     d LIBSSH2_SSH_BANNER...
     d                 c                   'SSH-2.0-libssh2_@LIBSSH2_VERSION@'
     d LIBSSH2_SSH_DEFAULT_BANNER...
     d                 c                   'SSH-2.0-libssh2_@LIBSSH2_VERSION@'

      * Default generate and safe prime sizes for
      * diffie-hellman-group-exchange-sha1.
     d LIBSSH2_DH_GEX_MINGROUP...
     d                 c                   1024
     d LIBSSH2_DH_GEX_OPTGROUP...
     d                 c                   1536
     d LIBSSH2_DH_GEX_MAXGROUP...
     d                 c                   2048

      * Defaults for pty requests.
     d LIBSSH2_TERM_WIDTH...
     d                 c                   80
     d LIBSSH2_TERM_HEIGHT...
     d                 c                   24
     d LIBSSH2_TERM_WIDTH_PX...
     d                 c                   0
     d LIBSSH2_TERM_HEIGHT_PX...
     d                 c                   0

      * 1/4 second.
     d LIBSSH2_SOCKET_POLL_UDELAY...
     d                 c                   250000
      * 0.25 * 120 == 30 seconds.
     d LIBSSH2_SOCKET_POLL_MAXLOOPS...
     d                 c                   120

      * Maximum size to allow a payload to compress to, plays it safe by
      * falling short of spec limits.
     d LIBSSH2_PACKET_MAXCOMP...
     d                 c                   32000

      * Maximum size to allow a payload to deccompress to, plays it safe by
      * allowing more than spec requires.
     d LIBSSH2_PACKET_MAXDECOMP...
     d                 c                   40000

      * Maximum size for an inbound compressed payload, plays it safe by
      * overshooting spec limits.
     d LIBSSH2_PACKET_MAXPAYLOAD...
     d                 c                   40000

     d LIBSSH2_USERAUTH_KBDINT_PROMPT...
     d                 ds                  based(######typedef######)
     d                                     align qualified
     d  text                           *                                        unsigned char *
     d  length                             like(libssh2_Csize_t)
     d  echo                               like(libssh2_Cuchar)

     d LIBSSH2_USERAUTH_KBDINT_RESPONSE...
     d                 ds                  based(######typedef######)
     d                                     align qualified
     d  text                           *                                        char *
     d  length                             like(libssh2_Cuint)

     d LIBSSH2_SK_SIG_INFO...
     d                 ds                  based(######typedef######)
     d                                     align qualified
     d  flags                              like(libssh2_uint8_t)
     d  counter                            like(libssh2_uint32_t)
     d  sig_r                          *                                        unsigned char *
     d  sig_r_len                          like(libssh2_Csize_t)
     d  sig_s                          *                                        unsigned char *
     d  sig_s_len                          like(libssh2_Csize_t)

      * Flags for SK authentication
     d LIBSSH2_SK_PRESENCE_REQUIRED...
     d                 c                   X'01'
     d LIBSSH2_SK_VERIFICATION_REQUIRED...
     d                 c                   X'04'

      * libssh2_session_callback_set() constants.
     d LIBSSH2_CALLBACK_IGNORE...
     d                 c                   0
     d LIBSSH2_CALLBACK_DEBUG...
     d                 c                   1
     d LIBSSH2_CALLBACK_DISCONNECT...
     d                 c                   2
     d LIBSSH2_CALLBACK_MACERROR...
     d                 c                   3
     d LIBSSH2_CALLBACK_X11...
     d                 c                   4
     d LIBSSH2_CALLBACK_SEND...
     d                 c                   5
     d LIBSSH2_CALLBACK_RECV...
     d                 c                   6
     d LIBSSH2_CALLBACK_AUTHAGENT...
     d                 c                   7
     d LIBSSH2_CALLBACK_AUTHAGENT_IDENTITIES...
     d                 c                   8
     d LIBSSH2_CALLBACK_AUTHAGENT_SIGN...
     d                 c                   9

      * libssh2_session_method_pref() constants.
     d LIBSSH2_METHOD_KEX...
     d                 c                   0
     d LIBSSH2_METHOD_HOSTKEY...
     d                 c                   1
     d LIBSSH2_METHOD_CRYPT_CS...
     d                 c                   2
     d LIBSSH2_METHOD_CRYPT_SC...
     d                 c                   3
     d LIBSSH2_METHOD_MAC_CS...
     d                 c                   4
     d LIBSSH2_METHOD_MAC_SC...
     d                 c                   5
     d LIBSSH2_METHOD_COMP_CS...
     d                 c                   6
     d LIBSSH2_METHOD_COMP_SC...
     d                 c                   7
     d LIBSSH2_METHOD_LANG_CS...
     d                 c                   8
     d LIBSSH2_METHOD_LANG_SC...
     d                 c                   9
     d LIBSSH2_METHOD_SIGN_ALGO...
     d                 c                   10

      * flags.
     d LIBSSH2_FLAG_SIGPIPE...
     d                 c                   X'0001'
     d LIBSSH2_FLAG_COMPRESS...
     d                 c                   X'0002'
     d LIBSSH2_FLAG_QUOTE_PATHS...
     d                 c                   X'0003'

      * SK signature callback
     d LIBSSH2_PRIVKEY_SK...
     d                 ds                  based(######typedef######)
     d                                     align qualified
     d  algorithm                          like(libssh2_Cint)
     d  flags                              like(libssh2_uint8_t)
     d  application                    *                                        const char *
     d  key_handle                     *                                        const uchar *
     d  handle_len                         like(libssh2_Csize_t)
     d  sign_callback                  *   procptr
     d  orig_abstract                  *                                        void **

     d libssh2_sign_sk...
     d                 pr                  extproc('libssh2_sign_sk')
     d                                     like(libssh2_Cint)
     d  session                        *   value                                LIBSSH2_SESSION *
     d  sig                            *                                        unsigned char *[]
     d  sig_len                            value like(libssh2_Csize_t)
     d  data                           *   value                                const uchar *
     d  data_len                           value like(libssh2_Csize_t)
     d  abstract                       *                                        void *

     d LIBSSH2_POLLFD  ds                  based(######typedef######)
     d                                     align qualified
     d  type                               like(libssh2_Cuchar)
     d  fd                             *                                        Union
     d   socket                            overlay(fd) like(libssh2_socket_t)
     d   channel                       *   overlay(fd)                          LIBSSH2_CHANNEL *
     d   listener                      *   overlay(fd)                          LIBSSH2_LISTENER *
     d  events                             like(libssh2_Culong)
     d  revents                            like(libssh2_Culong)

      * Poll FD Descriptor Types.
     d LIBSSH2_POLLFD_SOCKET...
     d                 c                   1
     d LIBSSH2_POLLFD_CHANNEL...
     d                 c                   2
     d LIBSSH2_POLLFD_LISTENER...
     d                 c                   3

      * Poll FD events/revents -- Match sys/poll.h where possible.
     d LIBSSH2_POLLFD_POLLIN...                                                 Input data ready or
     d                 c                   X'0001'                              connection available
     d LIBSSH2_POLLFD_POLLPRI...                                                Prio data ready to
     d                 c                   X'0002'                              be read. Socket only
     d LIBSSH2_POLLFD_POLLEXT...                                                Ext data ready to be
     d                 c                   X'0002'                              read. Channel only
     d LIBSSH2_POLLFD_POLLOUT...                                                Can may be written:
     d                 c                   X'0004'                              Socket/Channel

      * revents only.
     d LIBSSH2_POLLFD_POLLERR...                                                Error Condition:
     d                 c                   X'0008'                              Socket
     d LIBSSH2_POLLFD_POLLHUP...                                                HangUp/EOF
     d                 c                   X'0010'                              Socket
     d LIBSSH2_POLLFD_SESSION_CLOSED...                                         Session Disconnect
     d                 c                   X'0010'
     d LIBSSH2_POLLFD_POLLNVAL...                                               Invalid request
     d                 c                   X'0020'                              Socket
     d LIBSSH2_POLLFD_POLLEX...                                                 Exception Condition
     d                 c                   X'0040'                              Socket/Win32
     d LIBSSH2_POLLFD_CHANNEL_CLOSED...                                         Channel Disconnect
     d                 c                   X'0080'
     d LIBSSH2_POLLFD_LISTENER_CLOSED...                                        Listener Disconnect
     d                 c                   X'0080'

      /define HAVE_LIBSSH2_SESSION_BLOCK_DIRECTION
      * Block Direction Types.
     d LIBSSH2_SESSION_BLOCK_INBOUND...
     d                 c                   X'0001'
     d LIBSSH2_SESSION_BLOCK_OUTBOUND...
     d                 c                   X'0002'

      * Hash Types.
     d LIBSSH2_HOSTKEY_HASH_MD5...
     d                 c                   1
     d LIBSSH2_HOSTKEY_HASH_SHA1...
     d                 c                   2
     d LIBSSH2_HOSTKEY_HASH_SHA256...
     d                 c                   3

      * Hostkey Types.
     d LIBSSH2_HOSTKEY_TYPE_UNKNOWN...
     d                 c                   0
     d LIBSSH2_HOSTKEY_TYPE_RSA...
     d                 c                   1
     d LIBSSH2_HOSTKEY_TYPE_DSS...
     d                 c                   2
     d LIBSSH2_HOSTKEY_TYPE_ECDSA_256...
     d                 c                   3
     d LIBSSH2_HOSTKEY_TYPE_ECDSA_384...
     d                 c                   4
     d LIBSSH2_HOSTKEY_TYPE_ECDSA_521...
     d                 c                   5
     d LIBSSH2_HOSTKEY_TYPE_ED25519...
     d                 c                   6

      * Disconnect Codes (defined by SSH protocol).
     d SSH_DISCONNECT_HOST_NOT_ALLOWED_TO_CONNECT...
     d                 c                   1
     d SSH_DISCONNECT_PROTOCOL_ERROR...
     d                 c                   2
     d SSH_DISCONNECT_KEY_EXCHANGE_FAILED...
     d                 c                   3
     d SSH_DISCONNECT_RESERVED...
     d                 c                   4
     d SSH_DISCONNECT_MAC_ERROR...
     d                 c                   5
     d SSH_DISCONNECT_COMPRESSION_ERROR...
     d                 c                   6
     d SSH_DISCONNECT_SERVICE_NOT_AVAILABLE...
     d                 c                   7
     d SSH_DISCONNECT_PROTOCOL_VERSION_NOT_SUPPORTED...
     d                 c                   8
     d SSH_DISCONNECT_HOST_KEY_NOT_VERIFIABLE...
     d                 c                   9
     d SSH_DISCONNECT_CONNECTION_LOST...
     d                 c                   10
     d SSH_DISCONNECT_BY_APPLICATION...
     d                 c                   11
     d SSH_DISCONNECT_TOO_MANY_CONNECTIONS...
     d                 c                   12
     d SSH_DISCONNECT_AUTH_CANCELLED_BY_USER...
     d                 c                   13
     d SSH_DISCONNECT_NO_MORE_AUTH_METHODS_AVAILABLE...
     d                 c                   14
     d SSH_DISCONNECT_ILLEGAL_USER_NAME...
     d                 c                   15

      * Error Codes (defined by libssh2).
     d LIBSSH2_ERROR_NONE...
     d                 c                   0

      * The library once used -1 as a generic error return value on numerous
      * places through the code, which subsequently was converted to
      * LIBSSH2_ERROR_SOCKET_NONE uses over time. As this is a generic error
      * code, the goal is to never ever return this code but instead make sure
      * that a more accurate and descriptive error code is used.
     d  LIBSSH2_ERROR_SOCKET_NONE...
     d                 c                   -1

     d LIBSSH2_ERROR_BANNER_RECV...
     d                 c                   -2
     d LIBSSH2_ERROR_BANNER_SEND...
     d                 c                   -3
     d LIBSSH2_ERROR_INVALID_MAC...
     d                 c                   -4
     d LIBSSH2_ERROR_KEX_FAILURE...
     d                 c                   -5
     d LIBSSH2_ERROR_ALLOC...
     d                 c                   -6
     d LIBSSH2_ERROR_SOCKET_SEND...
     d                 c                   -7
     d LIBSSH2_ERROR_KEY_EXCHANGE_FAILURE...
     d                 c                   -8
     d LIBSSH2_ERROR_TIMEOUT...
     d                 c                   -9
     d LIBSSH2_ERROR_HOSTKEY_INIT...
     d                 c                   -10
     d LIBSSH2_ERROR_HOSTKEY_SIGN...
     d                 c                   -11
     d LIBSSH2_ERROR_DECRYPT...
     d                 c                   -12
     d LIBSSH2_ERROR_SOCKET_DISCONNECT...
     d                 c                   -13
     d LIBSSH2_ERROR_PROTO...
     d                 c                   -14
     d LIBSSH2_ERROR_PASSWORD_EXPIRED...
     d                 c                   -15
     d LIBSSH2_ERROR_FILE...
     d                 c                   -16
     d LIBSSH2_ERROR_METHOD_NONE...
     d                 c                   -17
     d LIBSSH2_ERROR_AUTHENTICATION_FAILED...
     d                 c                   -18
     d LIBSSH2_ERROR_PUBLICKEY_UNRECOGNIZED...
     d                 c                   -18
     d LIBSSH2_ERROR_PUBLICKEY_UNVERIFIED...
     d                 c                   -19
     d LIBSSH2_ERROR_CHANNEL_OUTOFORDER...
     d                 c                   -20
     d LIBSSH2_ERROR_CHANNEL_FAILURE...
     d                 c                   -21
     d LIBSSH2_ERROR_CHANNEL_REQUEST_DENIED...
     d                 c                   -22
     d LIBSSH2_ERROR_CHANNEL_UNKNOWN...
     d                 c                   -23
     d LIBSSH2_ERROR_CHANNEL_WINDOW_EXCEEDED...
     d                 c                   -24
     d LIBSSH2_ERROR_CHANNEL_PACKET_EXCEEDED...
     d                 c                   -25
     d LIBSSH2_ERROR_CHANNEL_CLOSED...
     d                 c                   -26
     d LIBSSH2_ERROR_CHANNEL_EOF_SENT...
     d                 c                   -27
     d LIBSSH2_ERROR_SCP_PROTOCOL...
     d                 c                   -28
     d LIBSSH2_ERROR_ZLIB...
     d                 c                   -29
     d LIBSSH2_ERROR_SOCKET_TIMEOUT...
     d                 c                   -30
     d LIBSSH2_ERROR_SFTP_PROTOCOL...
     d                 c                   -31
     d LIBSSH2_ERROR_REQUEST_DENIED...
     d                 c                   -32
     d LIBSSH2_ERROR_METHOD_NOT_SUPPORTED...
     d                 c                   -33
     d LIBSSH2_ERROR_INVAL...
     d                 c                   -34
     d LIBSSH2_ERROR_INVALID_POLL_TYPE...
     d                 c                   -35
     d LIBSSH2_ERROR_PUBLICKEY_PROTOCOL...
     d                 c                   -36
     d LIBSSH2_ERROR_EAGAIN...
     d                 c                   -37
     d LIBSSH2_ERROR_BUFFER_TOO_SMALL...
     d                 c                   -38
     d LIBSSH2_ERROR_BAD_USE...
     d                 c                   -39
     d LIBSSH2_ERROR_COMPRESS...
     d                 c                   -40
     d LIBSSH2_ERROR_OUT_OF_BOUNDARY...
     d                 c                   -41
     d LIBSSH2_ERROR_AGENT_PROTOCOL...
     d                 c                   -42
     d LIBSSH2_ERROR_SOCKET_RECV...
     d                 c                   -43
     d LIBSSH2_ERROR_ENCRYPT...
     d                 c                   -44
     d LIBSSH2_ERROR_BAD_SOCKET...
     d                 c                   -45
     d LIBSSH2_ERROR_KNOWN_HOSTS...
     d                 c                   -46
     d LIBSSH2_ERROR_CHANNEL_WINDOW_FULL...
     d                 c                   -47
     d LIBSSH2_ERROR_KEYFILE_AUTH_FAILED...
     d                 c                   -48
     d LIBSSH2_ERROR_RANDGEN...
     d                 c                   -49
     d LIBSSH2_ERROR_MISSING_USERAUTH_BANNER...
     d                 c                   -50
     d LIBSSH2_ERROR_ALGO_UNSUPPORTED...
     d                 c                   -51
     d LIBSSH2_ERROR_MAC_FAILURE...
     d                 c                   -52
     d LIBSSH2_ERROR_HASH_INIT...
     d                 c                   -53

      * this is a define to provide the old (<= 1.2.7) name.
     d LIBSSH2_ERROR_BANNER_NONE...
     d                 c                   -2

      * Global API.
     d LIBSSH2_INIT_NO_CRYPTO...
     d                 c                   X'0001'

      * libssh2_init()
      *
      * Initialize the libssh2 functions.  This typically initialize the
      * crypto library.  It uses a global state, and is not thread safe --
      * you must make sure this function is not called concurrently.
      *
      * Flags can be:
      * 0:                              Normal initialize
      * LIBSSH2_INIT_NO_CRYPTO:         Do not initialize the crypto library
      *                                 (ie. OPENSSL_add_cipher_algorithms() for
      *                                 OpenSSL)
      *
      * Returns 0 if succeeded, or a negative value for error.

     d libssh2_init    pr                  extproc('libssh2_init')
     d                                     like(libssh2_Cint)
     d  flags                              value like(libssh2_Cint)

      * libssh2_exit()
      *
      * Exit the libssh2 functions and free's all memory used internal.

     d libssh2_exit    pr                  extproc('libssh2_exit')

      * libssh2_free()
      *
      * Deallocate memory allocated by earlier call to libssh2 functions.

     d libssh2_free    pr                  extproc('libssh2_free')
     d  session                        *   value                                LIBSSH2_SESSION *
     d  ptr                            *   value                                void *

      * libssh2_session_supported_algs()
      *
      * Fills algs with a list of supported cryptographic algorithms. Returns a
      * non-negative number (number of supported algorithms) on success or a
      * negative number (an error code) on failure.
      *
      * NOTE: on success, algs must be deallocated (by calling libssh2_free)
      * when not needed anymore

     d libssh2_session_supported_algs...
     d                 pr                  extproc(
     d                                       'libssh2_session_supported_algs')
     d                                     like(libssh2_Cint)
     d  session                        *   value                                LIBSSH2_SESSION *
     d  method_type                        value like(libssh2_Cint)
     d  algs                           *                                        const char **(*)

      * Session API.
     d libssh2_session_init_ex...
     d                 pr              *   extproc('libssh2_session_init_ex')   LIBSSH2_SESSION *
     d  my_alloc                       *   value procptr
     d  my_free                        *   value procptr
     d  my_realloc                     *   value procptr
     d  abstract                       *   value                                void *

      * Implementation of C macro.
     d libssh2_session_init...
     d                 pr              *   extproc('libssh2_session_init')      LIBSSH2_SESSION *

     d libssh2_session_abstract...
     d                 pr              *   extproc('libssh2_session_abstract')  void * *
     d  session                        *   value                                LIBSSH2_SESSION *

     d libssh2_cb_generic_ptr...
     d                 s               *   based(######typedef######) procptr

     d libssh2_session_callback_set2...
     d                 pr                  extproc(
     d                                     'libssh2_session_callback_set2')
     d                                     like(libssh2_cb_generic_ptr)
     d  session                        *   value                                LIBSSH2_SESSION *
     d  cbtype                             value like(libssh2_Cint)
     d  callback                           value like(libssh2_cb_generic_ptr)

     d libssh2_session_callback_set...
     d                 pr              *   extproc(                             void *
     d                                     'libssh2_session_callback_set')
     d  session                        *   value                                LIBSSH2_SESSION *
     d  cbtype                             value like(libssh2_Cint)
     d  callback                       *   value                                void *

     d libssh2_session_banner_set...
     d                 pr                  extproc('libssh2_session_banner_set')
     d                                     like(libssh2_Cint)
     d  session                        *   value                                LIBSSH2_SESSION *
     d  banner                         *   value options(*string)               const char *

      /if not defined(LIBSSH2_NO_DEPRECATED)
     d libssh2_banner_set...
     d                 pr                  extproc('libssh2_banner_set')
     d                                     like(libssh2_Cint)
     d  session                        *   value                                LIBSSH2_SESSION *
     d  banner                         *   value options(*string)               const char *

     d libssh2_session_startup...
     d                 pr                  extproc('libssh2_session_startup')
     d                                     like(libssh2_Cint)
     d  session                        *   value                                LIBSSH2_SESSION *
     d  sock                               value like(libssh2_Cint)
      /endif

     d libssh2_session_handshake...
     d                 pr                  extproc('libssh2_session_handshake')
     d                                     like(libssh2_Cint)
     d  session                        *   value                                LIBSSH2_SESSION *
     d  sock                               value like(libssh2_socket_t)

     d libssh2_session_disconnect_ex...
     d                 pr                  extproc(
     d                                     'libssh2_session_disconnect_ex')
     d                                     like(libssh2_Cint)
     d  session                        *   value                                LIBSSH2_SESSION *
     d  reason                             value like(libssh2_Cint)
     d  description                    *   value options(*string)               const char *
     d  lang                           *   value options(*string)               const char *

      * Implementation of C macro.
     d libssh2_session_disconnect...
     d                 pr                  extproc('libssh2_session_disconnect')
     d                                     like(libssh2_Cint)
     d  session                        *   value                                LIBSSH2_SESSION *
     d  description                    *   value options(*string)               const char *

     d libssh2_session_free...
     d                 pr                  extproc('libssh2_session_free')
     d                                     like(libssh2_Cint)
     d  session                        *   value                                LIBSSH2_SESSION *

     d libssh2_hostkey_hash...
     d                 pr              *   extproc('libssh2_hostkey_hash')      const char *
     d  session                        *   value                                LIBSSH2_SESSION *
     d  hash_type                          value like(libssh2_Cint)

     d libssh2_session_hostkey...
     d                 pr              *   extproc('libssh2_session_hostkey')   const char *
     d  session                        *   value                                LIBSSH2_SESSION *
     d  len                                like(libssh2_Csize_t)
     d  type                               like(libssh2_Cint)

     d libssh2_session_method_pref...
     d                 pr                  extproc(
     d                                     'libssh2_session_method_pref')
     d                                     like(libssh2_Cint)
     d  session                        *   value                                LIBSSH2_SESSION *
     d  method_type                        value like(libssh2_Cint)
     d  prefs                          *   value options(*string)               const char *

     d libssh2_session_methods...
     d                 pr              *   extproc('libssh2_session_methods')   const char *
     d  session                        *   value                                LIBSSH2_SESSION *
     d  method_type                        value like(libssh2_Cint)

     d libssh2_session_last_error...
     d                 pr                  extproc('libssh2_session_last_error')
     d                                     like(libssh2_Cint)
     d  session                        *   value                                LIBSSH2_SESSION *
     d  errmsg                         *                                        char *(*)
     d  errmsg_len                         like(libssh2_Cint)
     d  want_buf                           value like(libssh2_Cint)

     d libssh2_session_last_errno...
     d                 pr                  extproc('libssh2_session_last_errno')
     d                                     like(libssh2_Cint)
     d  session                        *   value                                LIBSSH2_SESSION *

     d libssh2_session_set_last_error...
     d                 pr                  extproc(
     d                                     'libssh2_session_set_last_error')
     d                                     like(libssh2_Cint)
     d  session                        *   value                                LIBSSH2_SESSION *
     d  errcode                            value like(libssh2_Cint)
     d  errmsg                         *   value options(*string)               const char *

     d libssh2_session_block_directions...
     d                 pr                  extproc(
     d                                     'libssh2_session_block_directions')
     d                                     like(libssh2_Cint)
     d  session                        *   value                                LIBSSH2_SESSION *

     d libssh2_session_flag...
     d                 pr                  extproc('libssh2_session_flag')
     d                                     like(libssh2_Cint)
     d  session                        *   value                                LIBSSH2_SESSION *
     d  flag                               value like(libssh2_Cint)
     d  value                              value like(libssh2_Cint)

     d libssh2_session_banner_get...
     d                 pr              *   extproc('libssh2_session_banner_get') const char *
     d  session                        *   value                                LIBSSH2_SESSION *

      * Userauth API.

     d libssh2_userauth_list...
     d                 pr              *   extproc('libssh2_userauth_list')     char *
     d  session                        *   value                                LIBSSH2_SESSION *
     d  username                       *   value options(*string)               const char *
     d  username_len                       value like(libssh2_Cuint)

     d libssh2_userauth_banner...
     d                 pr                  extproc('libssh2_userauth_banner')
     d                                     like(libssh2_Cint)
     d  session                        *   value                                LIBSSH2_SESSION *
     d  banner                         *                                        char *

     d libssh2_userauth_authenticated...
     d                 pr                  extproc(
     d                                     'libssh2_userauth_authenticated')
     d                                     like(libssh2_Cint)
     d  session                        *   value                                LIBSSH2_SESSION *

     d libssh2_userauth_password_ex...
     d                 pr                  extproc(
     d                                     'libssh2_userauth_password_ex')
     d                                     like(libssh2_Cint)
     d  session                        *   value                                LIBSSH2_SESSION *
     d  username                       *   value options(*string)               const char *
     d  username_len                       value like(libssh2_Cuint)
     d  password                       *   value options(*string)               const char *
     d  password_len                       value like(libssh2_Cuint)
     d  passwd_change_cb...
     d                                 *   value procptr

      * Implementation of C macro.
     d libssh2_userauth_password...
     d                 pr                  extproc('libssh2_userauth_password')
     d                                     like(libssh2_Cint)
     d  session                        *   value                                LIBSSH2_SESSION *
     d  username                       *   value options(*string)               const char *
     d  password                       *   value options(*string)               const char *

     d libssh2_userauth_publickey_fromfile_ex...
     d                 pr                  extproc('libssh2_userauth_publickey_-
     d                                     fromfile_ex')
     d                                     like(libssh2_Cint)
     d  session                        *   value                                LIBSSH2_SESSION *
     d  username                       *   value options(*string)               const char *
     d  username_len                       value like(libssh2_Cuint)
     d  publickey                      *   value options(*string)               const char *
     d  privatekey                     *   value options(*string)               const char *
     d  passphrase                     *   value options(*string)               const char *

      * Implementation of C macro.
     d libssh2_userauth_publickey_fromfile...
     d                 pr                  extproc(
     d                                     'libssh2_userauth_publickey_fromfile'
     d                                     )
     d                                     like(libssh2_Cint)
     d  session                        *   value                                LIBSSH2_SESSION *
     d  username                       *   value options(*string)               const char *
     d  publickey                      *   value options(*string)               const char *
     d  privatekey                     *   value options(*string)               const char *
     d  passphrase                     *   value options(*string)               const char *

     d libssh2_userauth_publickey...
     d                 pr                  extproc('libssh2_userauth_publickey')
     d                                     like(libssh2_Cint)
     d  session                        *   value                                LIBSSH2_SESSION *
     d  username                       *   value options(*string)               const char *
     d  pubkeydata                     *   value options(*string)               const unsigned char*
     d  pubkeydata_len...
     d                                     value like(libssh2_Csize_t)
     d  sign_callback                  *   value procptr
     d  abstract                       *                                        void *(*)

     d libssh2_userauth_hostbased_fromfile_ex...
     d                 pr                  extproc('libssh2_userauth_hostbased_-
     d                                     fromfile_ex')
     d                                     like(libssh2_Cint)
     d  session                        *   value                                LIBSSH2_SESSION *
     d  username                       *   value options(*string)               const char *
     d  username_len                       value like(libssh2_Cuint)
     d  publickey                      *   value options(*string)               const char *
     d  privatekey                     *   value options(*string)               const char *
     d  passphrase                     *   value options(*string)               const char *
     d  hostname                       *   value options(*string)               const char *
     d  hostname_len                       value like(libssh2_Cuint)
     d  local_username...
     d                                 *   value options(*string)               const char *
     d  local_username_len...
     d                                     value like(libssh2_Cuint)

      * C macro implementation.
     d libssh2_userauth_hostbased_fromfile...
     d                 pr                  extproc(
     d                                     'libssh2_userauth_hostbased_fromfile'
     d                                     )
     d                                     like(libssh2_Cint)
     d  session                        *   value                                LIBSSH2_SESSION *
     d  username                       *   value options(*string)               const char *
     d  publickey                      *   value options(*string)               const char *
     d  privatekey                     *   value options(*string)               const char *
     d  passphrase                     *   value options(*string)               const char *
     d  hostname                       *   value options(*string)               const char *

     d libssh2_userauth_publickey_frommemory...
     d                 pr                  extproc('libssh2_userauth_publickey_-
     d                                     frommemory')
     d                                     like(libssh2_Cint)
     d  session                        *   value                                LIBSSH2_SESSION *
     d  username                       *   value options(*string)               const char *
     d  username_len                       value like(libssh2_Csize_t)
     d  publickeyfiledata...
     d                                 *   value options(*string)               const char *
     d  publickeyfiledata_len...
     d                                     value like(libssh2_Csize_t)
     d  privatekeyfiledata...
     d                                 *   value options(*string)               const char *
     d  privatekeyfiledata_len...
     d                                     value like(libssh2_Csize_t)
     d  passphrase                     *   value options(*string)               const char *

      * response_callback is provided with filled by library prompts array,
      * but client must allocate and fill individual responses. Responses
      * array is already allocated. Responses data will be freed by libssh2
      * after callback return, but before subsequent callback invocation.

     d libssh2_userauth_keyboard_interactive_ex...
     d                 pr                  extproc('libssh2_userauth_keyboard_i-
     d                                     nteractive_ex')
     d                                     like(libssh2_Cint)
     d  session                        *   value                                LIBSSH2_SESSION *
     d  username                       *   value options(*string)               const char *
     d  username_len                       value like(libssh2_Cuint)
     d  response_callback...
     d                                 *   value procptr

      * C macro implementation.
     d libssh2_userauth_keyboard_interactive...
     d                 pr                  extproc('libssh2_userauth_keyboard_i-
     d                                     nteractive')
     d                                     like(libssh2_Cint)
     d  session                        *   value                                LIBSSH2_SESSION *
     d  username                       *   value options(*string)               const char *
     d  response_callback...
     d                                 *   value procptr

     d libssh2_userauth_publickey_sk...
     d                 pr                  extproc(
     d                                     'libssh2_userauth_publickey_sk')
     d                                     like(libssh2_Cint)
     d  session                        *   value                                LIBSSH2_SESSION *
     d  username                       *   value options(*string)               const char *
     d  username_len                       value like(libssh2_Csize_t)
     d  pubkeydata                     *   value                                const uchar *
     d  pubkeydata_len...
     d                                     value like(libssh2_Csize_t)
     d  privatekeydata...
     d                                 *   value options(*string)               const char *
     d  privatekeydata_len...
     d                                     value like(libssh2_Csize_t)
     d  passphrase                     *   value options(*string)               const char *
     d  sign_callback                  *   value procptr
     d  abstract                       *                                        void *

     d libssh2_poll    pr                  extproc('libssh2_poll')
     d                                     like(libssh2_Cint)
     d  fds                            *   value                                LIBSSH2_POLLFD *
     d  nfds                               value like(libssh2_Cuint)
     d  timeout                            value like(libssh2_Clong)

      * Channel API.
     d LIBSSH2_CHANNEL_WINDOW_DEFAULT...
     d                 c                   X'00200000'
     d LIBSSH2_CHANNEL_PACKET_DEFAULT...
     d                 c                   32768
     d LIBSSH2_CHANNEL_MINADJUST...
     d                 c                   1024

      * Extended Data Handling.
     d LIBSSH2_CHANNEL_EXTENDED_DATA_NORMAL...
     d                 c                   0
     d LIBSSH2_CHANNEL_EXTENDED_DATA_IGNORE...
     d                 c                   1
     d LIBSSH2_CHANNEL_EXTENDED_DATA_MERGE...
     d                 c                   2

     d SSH_EXTENDED_DATA_STDERR...
     d                 c                   1

      * Returned by any function that would block during a read/write
      * operation.
     d LIBSSH2CHANNEL_EAGAIN...                                                 LIBSSH2_ERROR_EAGAIN
     d                 c                   -37

     d libssh2_channel_open_ex...
     d                 pr              *   extproc('libssh2_channel_open_ex')   LIBSSH2_CHANNEL *
     d  session                        *   value                                LIBSSH2_SESSION *
     d  channel_type                   *   value options(*string)               const char *
     d  channel_type_len...
     d                                     value like(libssh2_Cuint)
     d  window_size                        value like(libssh2_Cuint)
     d  packet_size                        value like(libssh2_Cuint)
     d  message                        *   value options(*string)               const char *
     d  message_len                        value like(libssh2_Cuint)

      * C macro implementation.
     d libssh2_channel_open_session...
     d                 pr              *   extproc(                             LIBSSH2_CHANNEL *
     d                                     'libssh2_channel_open_session')
     d  session                        *   value                                LIBSSH2_SESSION *

     d libssh2_channel_direct_tcpip_ex...
     d                 pr              *   extproc(                             LIBSSH2_CHANNEL *
     d                                     'libssh2_channel_direct_tcpip_ex')
     d  session                        *   value                                LIBSSH2_SESSION *
     d  host                           *   value options(*string)               const char *
     d  port                               value like(libssh2_Cint)
     d  shost                          *   value options(*string)               const char *
     d  sport                              value like(libssh2_Cint)

      * C macro implementation.
     d libssh2_channel_direct_tcpip...
     d                 pr              *   extproc(                             LIBSSH2_CHANNEL *
     d                                     'libssh2_channel_direct_tcpip')
     d  session                        *   value                                LIBSSH2_SESSION *
     d  host                           *   value options(*string)               const char *
     d  port                               value like(libssh2_Cint)

     d  libssh2_channel_direct_streamlocal_ex...
     d                 pr              *   extproc('libssh2_channel_direct-     LIBSSH2_CHANNEL *
     d                                     _streamlocal_ex')
     d  session                        *   value                                LIBSSH2_SESSION *
     d  socket_path                    *   value options(*string)               const char *
     d  shost                          *   value options(*string)               const char *
     d  sport                              value like(libssh2_Cint)

     d libssh2_channel_forward_listen_ex...
     d                 pr              *   extproc(                             LIBSSH2_LISTENER *
     d                                     'libssh2_channel_forward_listen_ex')
     d  session                        *   value                                LIBSSH2_SESSION *
     d  host                           *   value options(*string)               const char *
     d  port                               value like(libssh2_Cint)
     d  bound_port                         like(libssh2_Cint)
     d  queue_maxsize                      value like(libssh2_Cint)

      * C macro implementation.
     d libssh2_channel_forward_listen...
     d                 pr              *   extproc(                             LIBSSH2_LISTENER *
     d                                     'libssh2_channel_forward_listen')
     d  session                        *   value                                LIBSSH2_SESSION *
     d  port                               value like(libssh2_Cint)

     d libssh2_channel_forward_cancel...
     d                 pr                  extproc(
     d                                     'libssh2_channel_forward_cancel')
     d                                     like(libssh2_Cint)
     d  listener                       *   value                                LIBSSH2_LISTENER *

     d libssh2_channel_forward_accept...
     d                 pr              *   extproc(                             LIBSSH2_CHANNEL *
     d                                     'libssh2_channel_forward_accept')
     d  listener                       *   value                                LIBSSH2_LISTENER *

     d libssh2_channel_setenv_ex...
     d                 pr                  extproc('libssh2_channel_setenv_ex')
     d                                     like(libssh2_Cint)
     d  channel                        *   value                                LIBSSH2_CHANNEL *
     d  varname                        *   value options(*string)               const char *
     d  varname_len                        value like(libssh2_Cuint)
     d  value                          *   value options(*string)               const char *
     d  value_len                          value like(libssh2_Cuint)

      * C macro implementation.
     d libssh2_channel_setenv...
     d                 pr                  extproc('libssh2_channel_setenv')
     d                                     like(libssh2_Cint)
     d  channel                        *   value                                LIBSSH2_CHANNEL *
     d  varname                        *   value options(*string)               const char *
     d  value                          *   value options(*string)               const char *

     d libssh2_channel_request_auth_agent...
     d                 pr                  extproc(
     d                                     'libssh2_channel_request_auth_agent')
     d                                     like(libssh2_Cint)
     d  channel                        *   value                                LIBSSH2_CHANNEL *

     d libssh2_channel_request_pty_ex...
     d                 pr                  extproc(
     d                                     'libssh2_channel_request_pty_ex')
     d                                     like(libssh2_Cint)
     d  channel                        *   value                                LIBSSH2_CHANNEL *
     d  term                           *   value options(*string)               const char *
     d  term_len                           value like(libssh2_Cuint)
     d  modes                          *   value options(*string)               const char *
     d  modes_len                          value like(libssh2_Cuint)
     d  width                              value like(libssh2_Cint)
     d  height                             value like(libssh2_Cint)
     d  width_px                           value like(libssh2_Cint)
     d  height_px                          value like(libssh2_Cint)

      * C macro implementation.
     d libssh2_channel_request_pty...
     d                 pr                  extproc(
     d                                     'libssh2_channel_request_pty')
     d                                     like(libssh2_Cint)
     d  channel                        *   value                                LIBSSH2_CHANNEL *
     d  term                           *   value options(*string)               const char *

     d libssh2_channel_request_pty_size_ex...
     d                 pr                  extproc(
     d                                     'libssh2_channel_request_pty_size_ex'
     d                                     )
     d                                     like(libssh2_Cint)
     d  channel                        *   value                                LIBSSH2_CHANNEL *
     d  width                              value like(libssh2_Cint)
     d  height                             value like(libssh2_Cint)
     d  width_px                           value like(libssh2_Cint)
     d  height_px                          value like(libssh2_Cint)

      * C macro implementation.
     d libssh2_channel_request_pty_size...
     d                 pr                  extproc(
     d                                     'libssh2_channel_request_pty_size')
     d                                     like(libssh2_Cint)
     d  channel                        *   value                                LIBSSH2_CHANNEL *
     d  width                              value like(libssh2_Cint)
     d  height                             value like(libssh2_Cint)

     d libssh2_channel_x11_req_ex...
     d                 pr                  extproc('libssh2_channel_x11_req_ex')
     d                                     like(libssh2_Cint)
     d  channel                        *   value                                LIBSSH2_CHANNEL *
     d  single_connection...
     d                                     value like(libssh2_Cint)
     d  auth_proto                     *   value options(*string)               const char *
     d  auth_cookie                    *   value options(*string)               const char *
     d  screen_number                      value like(libssh2_Cint)

      * C macro implementation.
     d libssh2_channel_x11_req...
     d                 pr                  extproc('libssh2_channel_x11_req')
     d                                     like(libssh2_Cint)
     d  channel                        *   value                                LIBSSH2_CHANNEL *
     d  screen_number                      value like(libssh2_Cint)

     d libssh2_channel_signal_ex...
     d                 pr                  extproc('libssh2_channel_signal_ex')
     d                                     like(libssh2_Cint)
     d  channel                        *   value                                LIBSSH2_CHANNEL *
     d  signame                        *   value options(*string)               const char *
     d  signame_len                        value like(libssh2_Csize_t)

      * C macro implementation
     d libssh2_channel_signal...
     d                 pr                  extproc('libssh2_channel_signal_ex')
     d                                     like(libssh2_Cint)
     d  channel                        *   value                                LIBSSH2_CHANNEL *
     d  signame                        *   value options(*string)               const char *

     d libssh2_channel_process_startup...
     d                 pr                  extproc(
     d                                     'libssh2_channel_process_startup')
     d                                     like(libssh2_Cint)
     d  channel                        *   value                                LIBSSH2_CHANNEL *
     d  request                        *   value options(*string)               const char *
     d  request_len                        value like(libssh2_Cuint)
     d  message                        *   value options(*string)               const char *
     d  message_len                        value like(libssh2_Cuint)

      * C macro implementation.
     d libssh2_channel_shell...
     d                 pr                  extproc('libssh2_channel_shell')
     d                                     like(libssh2_Cint)
     d  channel                        *   value                                LIBSSH2_CHANNEL *

      * C macro implementation.
     d libssh2_channel_exec...
     d                 pr                  extproc('libssh2_channel_exec')
     d                                     like(libssh2_Cint)
     d  channel                        *   value                                LIBSSH2_CHANNEL *
     d  command                        *   value options(*string)               const char *

      * C macro implementation.
     d libssh2_channel_subsystem...
     d                 pr                  extproc('libssh2_channel_subsystem')
     d                                     like(libssh2_Cint)
     d  channel                        *   value                                LIBSSH2_CHANNEL *
     d  subsystem                      *   value options(*string)               const char *

     d libssh2_channel_read_ex...
     d                 pr                  extproc('libssh2_channel_read_ex')
     d                                     like(libssh2_Cssize_t)
     d  channel                        *   value                                LIBSSH2_CHANNEL *
     d  stream_id                          value like(libssh2_Cint)
     d  buf                            *   value                                char *
     d  buflen                             value like(libssh2_Csize_t)

      * C macro implementation.
     d libssh2_channel_read...
     d                 pr                  extproc('libssh2_channel_read')
     d                                     like(libssh2_Cssize_t)
     d  channel                        *   value                                LIBSSH2_CHANNEL *
     d  buf                            *   value                                char *
     d  buflen                             value like(libssh2_Csize_t)

      * C macro implementation.
     d libssh2_channel_read_stderr...
     d                 pr                  extproc(
     d                                     'libssh2_channel_read_stderr')
     d                                     like(libssh2_Cssize_t)
     d  channel                        *   value                                LIBSSH2_CHANNEL *
     d  buf                            *   value                                char *
     d  buflen                             value like(libssh2_Csize_t)

     d libssh2_poll_channel_read...
     d                 pr                  extproc('libssh2_poll_channel_read')
     d                                     like(libssh2_Cint)
     d  channel                        *   value                                LIBSSH2_CHANNEL *
     d  extended                           value like(libssh2_Cint)

     d libssh2_channel_window_read_ex...
     d                 pr                  extproc(
     d                                     'libssh2_channel_window_read_ex')
     d                                     like(libssh2_Culong)
     d  channel                        *   value                                LIBSSH2_CHANNEL *
     d  read_avail                         like(libssh2_Culong)
     d  window_size_initial...
     d                                     like(libssh2_Culong)

      * C macro implementation.
     d libssh2_channel_window_read...
     d                 pr                  extproc(
     d                                     'libssh2_channel_window_read')
     d                                     like(libssh2_Culong)
     d  channel                        *   value                                LIBSSH2_CHANNEL *

      /if not defined(LIBSSH2_NO_DEPRECATED)
     d libssh2_channel_receive_window_adjust...
     d                 pr                  extproc('libssh2_channel_receive_win-
     d                                     dow_adjust')
     d                                     like(libssh2_Culong)
     d  channel                        *   value                                LIBSSH2_CHANNEL *
     d  adjustment                         value like(libssh2_Culong)
     d  force                              value like(libssh2_Cuchar)
      /endif

     d libssh2_channel_receive_window_adjust2...
     d                 pr                  extproc('libssh2_channel_receive_win-
     d                                     dow_adjust2')
     d                                     like(libssh2_Cint)
     d  channel                        *   value                                LIBSSH2_CHANNEL *
     d  adjustment                         value like(libssh2_Culong)
     d  force                              value like(libssh2_Cuchar)
     d  storewindow                        like(libssh2_Cuint)

     d libssh2_channel_write_ex...
     d                 pr                  extproc('libssh2_channel_write_ex')
     d                                     like(libssh2_Cssize_t)
     d  channel                        *   value                                LIBSSH2_CHANNEL *
     d  stream_id                          value like(libssh2_Cint)
     d  buf                            *   value options(*string)               const char *
     d  buflen                             value like(libssh2_Csize_t)

      * C macro implementation.
     d libssh2_channel_write...
     d                 pr                  extproc('libssh2_channel_write')
     d                                     like(libssh2_Cssize_t)
     d  channel                        *   value                                LIBSSH2_CHANNEL *
     d  buf                            *   value options(*string)               const char *
     d  buflen                             value like(libssh2_Csize_t)

      * C macro implementation.
     d libssh2_channel_write_stderr...
     d                 pr                  extproc(
     d                                     'libssh2_channel_write_stderr')
     d                                     like(libssh2_Cssize_t)
     d  channel                        *   value                                LIBSSH2_CHANNEL *
     d  buf                            *   value options(*string)               const char *
     d  buflen                             value like(libssh2_Csize_t)

     d libssh2_channel_window_write_ex...
     d                 pr                  extproc(
     d                                     'libssh2_channel_window_write_ex')
     d                                     like(libssh2_Culong)
     d  channel                        *   value                                LIBSSH2_CHANNEL *
     d  window_size_initial...
     d                                     like(libssh2_Culong)

      * C macro implementation.
     d libssh2_channel_window_write...
     d                 pr                  extproc(
     d                                     'libssh2_channel_window_write')
     d                                     like(libssh2_Culong)
     d  channel                        *   value                                LIBSSH2_CHANNEL *

     d libssh2_session_set_blocking...
     d                 pr                  extproc(
     d                                     'libssh2_session_set_blocking')
     d  session                        *   value                                LIBSSH2_SESSION *
     d  blocking                           value like(libssh2_Cint)

     d libssh2_session_get_blocking...
     d                 pr                  extproc(
     d                                     'libssh2_session_get_blocking')
     d                                     like(libssh2_Cint)
     d  session                        *   value                                LIBSSH2_SESSION *

     d libssh2_channel_set_blocking...
     d                 pr                  extproc(
     d                                     'libssh2_channel_set_blocking')
     d  channel                        *   value                                LIBSSH2_CHANNEL *
     d  blocking                           value like(libssh2_Cint)

     d libssh2_session_set_timeout...
     d                 pr                  extproc(
     d                                     'libssh2_session_set_timeout')
     d  session                        *   value                                LIBSSH2_SESSION *
     d  timeout                            value like(libssh2_Clong)

     d libssh2_session_get_timeout...
     d                 pr                  extproc(
     d                                     'libssh2_session_get_timeout')
     d                                     like(libssh2_Clong)
     d  session                        *   value                                LIBSSH2_SESSION *

     d libssh2_session_set_read_timeout...
     d                 pr                  extproc(
     d                                     'libssh2_session_set_read_timeout')
     d  session                        *   value                                LIBSSH2_SESSION *
     d  timeout                            value like(libssh2_Clong)

     d libssh2_session_get_read_timeout...
     d                 pr                  extproc(
     d                                     'libssh2_session_get_read_timeout')
     d                                     like(libssh2_Clong)
     d  session                        *   value                                LIBSSH2_SESSION *

      /if not defined(LIBSSH2_NO_DEPRECATED)
     d libssh2_channel_handle_extended_data...
     d                 pr                  extproc('libssh2_channel_handle_exte-
     d                                     nded_data')
     d  channel                        *   value                                LIBSSH2_CHANNEL *
     d  ignore_mode                        value like(libssh2_Cint)
      /endif

     d libssh2_channel_handle_extended_data2...
     d                 pr                  extproc('libssh2_channel_handle_exte-
     d                                     nded_data2')
     d                                     like(libssh2_Cint)
     d  channel                        *   value                                LIBSSH2_CHANNEL *
     d  ignore_mode                        value like(libssh2_Cint)

      /if not defined(LIBSSH2_NO_DEPRECATED)
      * libssh2_channel_ignore_extended_data() is defined below for BC with
      * version 0.1.
      * C macro implementation.
     d libssh2_channel_ignore_extended_data...
     d                 pr                  extproc('libssh2_channel-
     d                                     _ignore_extended_data')
     d  channel                        *   value                                LIBSSH2_CHANNEL *
     d  ignore                             value like(libssh2_Cint)
      /endif

     d LIBSSH2_CHANNEL_FLUSH_EXTENDED_DATA...
     d                 c                   -1
     d LIBSSH2_CHANNEL_FLUSH_ALL...
     d                 c                   -2

     d libssh2_channel_flush_ex...
     d                 pr                  extproc('libssh2_channel_flush_ex')
     d                                     like(libssh2_Cint)
     d  channel                        *   value                                LIBSSH2_CHANNEL *
     d  streamid                           value like(libssh2_Cint)

      * C macro implementation.
     d libssh2_channel_flush...
     d                 pr                  extproc('libssh2_channel_flush')
     d                                     like(libssh2_Cint)
     d  channel                        *   value                                LIBSSH2_CHANNEL *

      * C macro implementation.
     d libssh2_channel_flush_stderr...
     d                 pr                  extproc(
     d                                     'libssh2_channel_flush_stderr')
     d                                     like(libssh2_Cint)
     d  channel                        *   value                                LIBSSH2_CHANNEL *

     d libssh2_channel_get_exit_status...
     d                 pr                  extproc(
     d                                     'libssh2_channel_get_exit_status')
     d                                     like(libssh2_Cint)
     d  channel                        *   value                                LIBSSH2_CHANNEL *

     d libssh2_channel_get_exit_signal...
     d                 pr                  extproc(
     d                                     'libssh2_channel_get_exit_signal')
     d                                     like(libssh2_Cint)
     d  channel                        *   value                                LIBSSH2_CHANNEL *
     d  exitsignal                     *                                        char *(*)
     d  exitsignal_len...
     d                                     like(libssh2_Csize_t)
     d  errmsg                         *                                        char *(*)
     d  errmsg_len                         like(libssh2_Csize_t)
     d  langtag                        *                                        char *(*)
     d  langtag_len                        like(libssh2_Csize_t)

     d libssh2_channel_send_eof...
     d                 pr                  extproc('libssh2_channel_send_eof')
     d                                     like(libssh2_Cint)
     d  channel                        *   value                                LIBSSH2_CHANNEL *

     d libssh2_channel_eof...
     d                 pr                  extproc('libssh2_channel_eof')
     d                                     like(libssh2_Cint)
     d  channel                        *   value                                LIBSSH2_CHANNEL *

     d libssh2_channel_wait_eof...
     d                 pr                  extproc('libssh2_channel_wait_eof')
     d                                     like(libssh2_Cint)
     d  channel                        *   value                                LIBSSH2_CHANNEL *

     d libssh2_channel_close...
     d                 pr                  extproc('libssh2_channel_close')
     d                                     like(libssh2_Cint)
     d  channel                        *   value                                LIBSSH2_CHANNEL *

     d libssh2_channel_wait_closed...
     d                 pr                  extproc(
     d                                     'libssh2_channel_wait_closed')
     d                                     like(libssh2_Cint)
     d  channel                        *   value                                LIBSSH2_CHANNEL *

     d libssh2_channel_free...
     d                 pr                  extproc('libssh2_channel_free')
     d                                     like(libssh2_Cint)
     d  channel                        *   value                                LIBSSH2_CHANNEL *

      /if not defined(LIBSSH2_NO_DEPRECATED)
     d libssh2_scp_recv...
     d                 pr              *   extproc('libssh2_scp_recv')          LIBSSH2_CHANNEL *
     d  session                        *   value                                LIBSSH2_SESSION *
     d  path                           *   value options(*string)               const char *
     d  sb                             *   value                                struct stat *
      /endif

      * Use libssh2_scp_recv2 for large (> 2GB) file support.
     d libssh2_scp_recv2...
     d                 pr              *   extproc('libssh2_scp_recv2')         LIBSSH2_CHANNEL *
     d  session                        *   value                                LIBSSH2_SESSION *
     d  path                           *   value options(*string)               const char *
     d  sb                                 likeds(libssh2_struct_stat)

     d libssh2_scp_send_ex...
     d                 pr              *   extproc('libssh2_scp_send_ex')       LIBSSH2_CHANNEL *
     d  session                        *   value                                LIBSSH2_SESSION *
     d  path                           *   value options(*string)               const char *
     d  mode                               value like(libssh2_Cint)
     d  size                               value like(libssh2_Csize_t)
     d  mtime                              value like(libssh2_Clong)
     d  atime                              value like(libssh2_Clong)

     d libssh2_scp_send64...
     d                 pr              *   extproc('libssh2_scp_send64')        LIBSSH2_CHANNEL *
     d  session                        *   value                                LIBSSH2_SESSION *
     d  path                           *   value options(*string)               const char *
     d  mode                               value like(libssh2_Cint)
     d  size                               value like(libssh2_int64_t)
     d  mtime                              value like(libssh2_time_t)
     d  atime                              value like(libssh2_time_t)

      * C macro implementation.
     d libssh2_scp_send...
     d                 pr              *   extproc('libssh2_scp_send')          LIBSSH2_CHANNEL *
     d  session                        *   value                                LIBSSH2_SESSION *
     d  path                           *   value options(*string)               const char *
     d  mode                               value like(libssh2_Cint)
     d  size                               value like(libssh2_int64_t)

      * DEPRECATED
     d libssh2_base64_decode...
     d                 pr                  extproc('libssh2_base64_decode')
     d                                     like(libssh2_Cint)
     d  session                        *   value                                LIBSSH2_SESSION *
     d  dest                           *   value                                char * *
     d  dest_len                       *   value                                unsigned int *
     d  src                            *   value options(*string)               const char *
     d  src_len                            value like(libssh2_Cuint)

      * Procedure libssh2_version renamed to avoid upper/lower case name clash.
     d libssh2_get_version...
     d                 pr              *   extproc('libssh2_version')           const char *
     d  req_version_num...
     d                                     value like(libssh2_Cint)

     d libssh2_crypto_engine_t...
     d                 s                   based(######typedef######)
     d                                     like(libssh2_Cenum)
     d  libssh2_no_crypto...
     d                 c                   0
     d  libssh2_openssl...
     d                 c                   1
     d  libssh2_gcrypt...
     d                 c                   2
     d  libssh2_mbedtls...
     d                 c                   3
     d  libssh2_wincng...
     d                 c                   4
     d  libssh2_os400qc3...
     d                 c                   5

     d libssh2_crypto_engine...
     d                 pr                  extproc('libssh2_crypto_engine')
     d                                     like(libssh2_crypto_engine_t)

     d HAVE_LIBSSH2_KNOWNHOST_API...                                            since 1.1.1
     d                 c                   X'010101'
     d HAVE_LIBSSH2_VERSION_API...                                              since 1.1
     d                 c                   X'010100'

     d libssh2_knownhost...
     d                 ds                  based(######typedef######)
     d                                     align qualified
     d  magic                              like(libssh2_Cuint)
     d  node                           *                                        void *
     d  name                           *                                        char *
     d  key                            *                                        char *
     d  typemask                           like(libssh2_Cint)

      * libssh2_knownhost_init
      *
      * Init a collection of known hosts. Returns the pointer to a collection.

     d libssh2_knownhost_init...
     d                 pr              *   extproc('libssh2_knownhost_init')    LIBSSH2_KNOWNHOSTS *
     d  session                        *   value                                LIBSSH2_SESSION *

      * libssh2_knownhost_add
      *
      * Add a host and its associated key to the collection of known hosts.
      *
      * The 'type' argument specifies on what format the given host and
      * keys are:
      *
      * plain  - ascii "hostname.domain.tld"
      * sha1   - SHA1(<salt> <host>) base64-encoded!
      * custom - another hash
      *
      * If 'sha1' is selected as type, the salt must be provided to the salt
      * argument. This too base64 encoded.
      *
      * The SHA-1 hash is what OpenSSH can be told to use in known_hosts files.
      * If a custom type is used, salt is ignored and you must provide the host
      * pre-hashed when checking for it in the libssh2_knownhost_check()
      * function.
      *
      * The keylen parameter may be omitted (zero) if the key is provided as a
      * NULL-terminated base64-encoded string.

      * host format (2 bits).
     d LIBSSH2_KNOWNHOST_TYPE_MASK...
     d                 c                   X'FFFF'
     d  LIBSSH2_KNOWNHOST_TYPE_PLAIN...
     d                 c                   1
     d LIBSSH2_KNOWNHOST_TYPE_SHA1...                                           always base64 ncoded
     d                 c                   2
     d LIBSSH2_KNOWNHOST_TYPE_CUSTOM...
     d                 c                   3

      * key format (2 bits).
     d LIBSSH2_KNOWNHOST_KEYENC_MASK...
     d                 c                   X'00030000'
     d LIBSSH2_KNOWNHOST_KEYENC_RAW...
     d                 c                   X'00010000'
     d LIBSSH2_KNOWNHOST_KEYENC_BASE64...
     d                 c                   X'00020000'

      * type of key (4 bits).
     d LIBSSH2_KNOWNHOST_KEY_MASK...
     d                 c                   X'003C0000'
     d LIBSSH2_KNOWNHOST_KEY_SHIFT...
     d                 c                   18
     d LIBSSH2_KNOWNHOST_KEY_RSA1...
     d                 c                   X'00040000'
     d LIBSSH2_KNOWNHOST_KEY_SSHRSA...
     d                 c                   X'00080000'
     d LIBSSH2_KNOWNHOST_KEY_SSHDSS...
     d                 c                   X'000C0000'
     d LIBSSH2_KNOWNHOST_KEY_ECDSA_256...
     d                 c                   X'00100000'
     d LIBSSH2_KNOWNHOST_KEY_ECDSA_384...
     d                 c                   X'00140000'
     d LIBSSH2_KNOWNHOST_KEY_ECDSA_521...
     d                 c                   X'00180000'
     d LIBSSH2_KNOWNHOST_KEY_ED25519...
     d                 c                   X'001C0000'
     d LIBSSH2_KNOWNHOST_KEY_UNKNOWN...
     d                 c                   X'003C0000'

     d libssh2_knownhost_add...
     d                 pr                  extproc('libssh2_knownhost_add')
     d                                     like(libssh2_Cint)
     d  hosts                          *   value                                LIBSSH2_KNOWNHOSTS *
     d  host                           *   value options(*string)               const char *
     d  salt                           *   value options(*string)               const char *
     d  key                            *   value options(*string)               const char *
     d  keylen                             value like(libssh2_Csize_t)
     d  typemask                           value like(libssh2_Cint)
     d  store                          *                                        libssh2_knownhost *

      * libssh2_knownhost_addc
      *
      * Add a host and its associated key to the collection of known hosts.
      *
      * Takes a comment argument that may be NULL.  A NULL comment indicates
      * there is no comment and the entry will end directly after the key
      * when written out to a file.  An empty string "" comment will indicate an
      * empty comment which will cause a single space to be written after the
      * key.
      *
      * The 'type' argument specifies on what format the given host and keys
      * are:
      *
      * plain  - ascii "hostname.domain.tld"
      * sha1   - SHA1(<salt> <host>) base64-encoded!
      * custom - another hash
      *
      * If 'sha1' is selected as type, the salt must be provided to the salt
      * argument. This too base64 encoded.
      *
      * The SHA-1 hash is what OpenSSH can be told to use in known_hosts files.
      * If a custom type is used, salt is ignored and you must provide the host
      * pre-hashed when checking for it in the libssh2_knownhost_check()
      * function.
      *
      * The keylen parameter may be omitted (zero) if the key is provided as a
      * NULL-terminated base64-encoded string.

     d libssh2_knownhost_addc...
     d                 pr                  extproc('libssh2_knownhost_addc')
     d                                     like(libssh2_Cint)
     d  hosts                          *   value                                LIBSSH2_KNOWNHOSTS *
     d  host                           *   value options(*string)               const char *
     d  salt                           *   value options(*string)               const char *
     d  key                            *   value options(*string)               const char *
     d  keylen                             value like(libssh2_Csize_t)
     d  comment                        *   value options(*string)               const char *
     d  commentlen                         value like(libssh2_Csize_t)
     d  typemask                           value like(libssh2_Cint)
     d  store                          *                                        libssh2_knownhost *


      * libssh2_knownhost_check
      *
      * Check a host and its associated key against the collection of known
      * hosts.
      *
      * The type is the type/format of the given host name.
      *
      * plain  - ascii "hostname.domain.tld"
      * custom - prehashed base64 encoded. Note that this cannot use any salts.
      *
      *
      * 'knownhost' may be set to NULL if you don't care about that info.
      *
      * Returns:
      *
      * LIBSSH2_KNOWNHOST_CHECK_* values, see below.

     d LIBSSH2_KNOWNHOST_CHECK_MATCH...
     d                 c                   0
     d LIBSSH2_KNOWNHOST_CHECK_MISMATCH...
     d                 c                   1
     d LIBSSH2_KNOWNHOST_CHECK_NOTFOUND...
     d                 c                   2
     d LIBSSH2_KNOWNHOST_CHECK_FAILURE...
     d                 c                   3

     d libssh2_knownhost_check...
     d                 pr                  extproc('libssh2_knownhost_check')
     d                                     like(libssh2_Cint)
     d  hosts                          *   value                                LIBSSH2_KNOWNHOSTS *
     d  host                           *   value options(*string)               const char *
     d  key                            *   value options(*string)               const char *
     d  keylen                             value like(libssh2_Csize_t)
     d  typemask                           value like(libssh2_Cint)
     d  knownhost                      *                                        libssh2_knownhost *

      * this function is identital to the above one, but also takes a port
      * argument that allows libssh2 to do a better check.
     d libssh2_knownhost_checkp...
     d                 pr                  extproc('libssh2_knownhost_checkp')
     d                                     like(libssh2_Cint)
     d  hosts                          *   value                                LIBSSH2_KNOWNHOSTS *
     d  host                           *   value options(*string)               const char *
     d  port                               value like(libssh2_Cint)
     d  key                            *   value options(*string)               const char *
     d  keylen                             value like(libssh2_Csize_t)
     d  typemask                           value like(libssh2_Cint)
     d  knownhost                      *                                        libssh2_knownhost *

      * libssh2_knownhost_del
      *
      * Remove a host from the collection of known hosts. The 'entry' struct is
      * retrieved by a call to libssh2_knownhost_check().

     d libssh2_knownhost_del...
     d                 pr                  extproc('libssh2_knownhost_del')
     d                                     like(libssh2_Cint)
     d  hosts                          *   value                                LIBSSH2_KNOWNHOSTS *
     d  entry                              likeds(libssh2_knownhost)

      * libssh2_knownhost_free
      *
      * Free an entire collection of known hosts.

     d libssh2_knownhost_free...
     d                 pr                  extproc('libssh2_knownhost_free')
     d  hosts                          *   value                                LIBSSH2_KNOWNHOSTS *

      * libssh2_knownhost_readline()
      *
      * Pass in a line of a file of 'type'. It makes libssh2 read this line.
      *
      * LIBSSH2_KNOWNHOST_FILE_OPENSSH is the only supported type.

     d libssh2_knownhost_readline...
     d                 pr                  extproc('libssh2_knownhost_readline')
     d                                     like(libssh2_Cint)
     d  hosts                          *   value                                LIBSSH2_KNOWNHOSTS *
     d  line                           *   value options(*string)               const char *
     d  len                                value like(libssh2_Csize_t)
     d  type                               value like(libssh2_Cint)

      * libssh2_knownhost_readfile
      *
      * Add hosts+key pairs from a given file.
      *
      * Returns a negative value for error or number of successfully added
      * hosts.
      *
      * This implementation currently only knows one 'type' (openssh), all
      * others are reserved for future use.

     d LIBSSH2_KNOWNHOST_FILE_OPENSSH...
     d                 c                   1

     d libssh2_knownhost_readfile...
     d                 pr                  extproc('libssh2_knownhost_readfile')
     d                                     like(libssh2_Cint)
     d  hosts                          *   value                                LIBSSH2_KNOWNHOSTS *
     d  filename                       *   value options(*string)               const char *
     d  type                               value like(libssh2_Cint)

      * libssh2_knownhost_writeline()
      *
      * Ask libssh2 to convert a known host to an output line for storage.
      *
      * Note that this function returns LIBSSH2_ERROR_BUFFER_TOO_SMALL if the
      * given output buffer is too small to hold the desired output.
      *
      * This implementation currently only knows one 'type' (openssh), all
      * others are reserved for future use.

     d libssh2_knownhost_writeline...
     d                 pr                  extproc(
     d                                     'libssh2_knownhost_writeline')
     d                                     like(libssh2_Cint)
     d  hosts                          *   value                                LIBSSH2_KNOWNHOSTS *
     d  known                              likeds(libssh2_knownhost)
     d  buffer                         *   value options(*string)               char *
     d  buflen                             value like(libssh2_Csize_t)
     d  outlen                             like(libssh2_Csize_t)                Written data amount
     d  type                               value like(libssh2_Cint)

      * libssh2_knownhost_writefile
      *
      * Write hosts+key pairs to a given file.
      *
      * This implementation currently only knows one 'type' (openssh), all
      * others are reserved for future use.

     d libssh2_knownhost_writefile...
     d                 pr                  extproc(
     d                                     'libssh2_knownhost_writefile')
     d                                     like(libssh2_Cint)
     d  hosts                          *   value                                LIBSSH2_KNOWNHOSTS *
     d  filename                       *   value options(*string)               const char *
     d  type                               value like(libssh2_Cint)

      * libssh2_knownhost_get()
      *
      * Traverse the internal list of known hosts. Pass NULL to 'prev' to get
      * the first one. Or pass a pointer to the previously returned one to
      * get the next.
      *
      * Returns:
      * 0 if a fine host was stored in 'store'
      * 1 if end of hosts
      * [negative] on errors

     d libssh2_knownhost_get...
     d                 pr                  extproc('libssh2_knownhost_get')
     d                                     like(libssh2_Cint)
     d  hosts                          *   value                                LIBSSH2_KNOWNHOSTS *
     d  store                          *                                        libssh2_knownhost *
     d  prev                               likeds(libssh2_knownhost)

     d HAVE_LIBSSH2_AGENT_API...                                                since 1.2.2
     d                 c                   X'010202'

     d libssh2_agent_publickey...
     d                 ds                  based(######typedef######)
     d                                     align qualified
     d  magic                              like(libssh2_Cuint)
     d  node                           *                                        void *
     d  blob                           *                                        unsigned char *
     d  blob_len                           like(libssh2_Csize_t)
     d  comment                        *                                        char *

      * libssh2_agent_init
      *
      * Init an ssh-agent handle. Returns the pointer to the handle.

     d libssh2_agent_init...
     d                 pr              *   extproc('libssh2_agent_init')        LIBSSH2_AGENT *
     d  session                        *   value                                LIBSSH2_SESSION *

      * libssh2_agent_connect()
      *
      * Connect to an ssh-agent.
      *
      * Returns 0 if succeeded, or a negative value for error.

     d libssh2_agent_connect...
     d                 pr                  extproc('libssh2_agent_connect')
     d                                     like(libssh2_Cint)
     d  agent                          *   value                                LIBSSH2_AGENT *

      * libssh2_agent_list_identities()
      *
      * Request an ssh-agent to list identities.
      *
      * Returns 0 if succeeded, or a negative value for error.

     d libssh2_agent_list_identities...
     d                 pr                  extproc(
     d                                     'libssh2_agent_list_identities')
     d                                     like(libssh2_Cint)
     d  agent                          *   value                                LIBSSH2_AGENT *

      * libssh2_agent_get_identity()
      *
      * Traverse the internal list of public keys. Pass NULL to 'prev' to get
      * the first one. Or pass a pointer to the previously returned one to
      * get the next.
      *
      * Returns:
      * 0 if a fine public key was stored in 'store'
      * 1 if end of public keys
      * [negative] on errors

     d libssh2_agent_get_identity...
     d                 pr                  extproc('libssh2_agent_get_identity')
     d                                     like(libssh2_Cint)
     d  agent                          *   value                                LIBSSH2_AGENT *
     d  store                          *                                        libssh2_agent_...
     d                                                                          publickey *(*)
     d  prev                               likeds(libssh2_agent_publickey)

      * libssh2_agent_userauth()
      *
      * Do publickey user authentication with the help of ssh-agent.
      *
      * Returns 0 if succeeded, or a negative value for error.

     d libssh2_agent_userauth...
     d                 pr                  extproc('libssh2_agent_userauth')
     d                                     like(libssh2_Cint)
     d  agent                          *   value                                LIBSSH2_AGENT *
     d  username                       *   value options(*string)               const char *
     d  identity                           likeds(libssh2_agent_publickey)

      * libssh2_agent_sign()
      *
      * Sign a payload using a system-installed ssh-agent.
      *
      * Returns 0 if succeeded, or a negative value for error.

     d libssh2_agent_sign...
     d                 pr                  extproc('libssh2_agent_sign')
     d                                     like(libssh2_Cint)
     d  agent                          *   value                                LIBSSH2_AGENT *
     d  identity                           likeds(libssh2_agent_publickey)
     d  sig                            *                                        unsigned char *
     d  s_len                              like(libssh2_Csize_t)
     d  data                           *   value                                const uchar *
     d  d_len                              value like(libssh2_Csize_t)
     d  method                         *   value options(*string)               const char *
     d  method_len                         value like(libssh2_Cuint)

      * libssh2_agent_disconnect()
      *
      * Close a connection to an ssh-agent.
      *
      * Returns 0 if succeeded, or a negative value for error.

     d libssh2_agent_disconnect...
     d                 pr                  extproc('libssh2_agent_disconnect')
     d                                     like(libssh2_Cint)
     d  agent                          *   value                                LIBSSH2_AGENT *

      * libssh2_agent_free()
      *
      * Free an ssh-agent handle. This function also frees the internal
      * collection of public keys.

     d libssh2_agent_free...
     d                 pr                  extproc('libssh2_agent_free')
     d  agent                          *   value                                LIBSSH2_AGENT *

      * libssh2_agent_set_identity_path()
      *
      * Allows a custom agent identity socket path beyond SSH_AUTH_SOCK env

     d libssh2_agent_set_identity_path...
     d                 pr                  extproc(
     d                                     'libssh2_agent_set_identity_path')
     d  agent                          *   value                                LIBSSH2_AGENT *
     d  path                           *   value options(*string)               const char *

      * libssh2_agent_get_identity_path()
      *
      * Returns the custom agent identity socket path if set

     d libssh2_agent_get_identity_path...
     d                 pr              *   extproc(                             const char *
     d                                     'libssh2_agent_get_identity_path')
     d  agent                          *   value                                LIBSSH2_AGENT *

      * libssh2_keepalive_config()
      *
      * Set how often keepalive messages should be sent.  WANT_REPLY
      * indicates whether the keepalive messages should request a response
      * from the server.  INTERVAL is number of seconds that can pass
      * without any I/O, use 0 (the default) to disable keepalives.  To
      * avoid some busy-loop corner-cases, if you specify an interval of 1
      * it will be treated as 2.
      *
      * Note that non-blocking applications are responsible for sending the
      * keepalive messages using libssh2_keepalive_send().

     d libssh2_keepalive_config...
     d                 pr                  extproc('libssh2_keepalive_config')
     d  session                        *   value                                LIBSSH2_SESSION *
     d  want_reply                         value like(libssh2_Cint)
     d  interval                           value like(libssh2_Cuint)

      * libssh2_keepalive_send()
      *
      * Send a keepalive message if needed.  SECONDS_TO_NEXT indicates how
      * many seconds you can sleep after this call before you need to call
      * it again.  Returns 0 on success, or LIBSSH2_ERROR_SOCKET_SEND on
      * I/O errors.

     d libssh2_keepalive_send...
     d                 pr                  extproc('libssh2_keepalive_send')
     d                                     like(libssh2_Cint)
     d  session                        *   value                                LIBSSH2_SESSION *
     d  seconds_to_next...
     d                                     like(libssh2_Cint)

      * NOTE NOTE NOTE
      * libssh2_trace() has no function in builds that aren't built with debug
      * enabled.

     d libssh2_trace   pr                  extproc('libssh2_trace')
     d                                     like(libssh2_Cint)
     d  session                        *   value                                LIBSSH2_SESSION *
     d  bitmask                            value like(libssh2_Cint)

     d LIBSSH2_TRACE_TRANS...
     d                 c                   X'0002'
     d LIBSSH2_TRACE_KEX...
     d                 c                   X'0004'
     d LIBSSH2_TRACE_AUTH...
     d                 c                   X'0008'
     d LIBSSH2_TRACE_CONN...
     d                 c                   X'0010'
     d LIBSSH2_TRACE_SCP...
     d                 c                   X'0020'
     d LIBSSH2_TRACE_SFTP...
     d                 c                   X'0040'
     d LIBSSH2_TRACE_ERROR...
     d                 c                   X'0080'
     d LIBSSH2_TRACE_PUBLICKEY...
     d                 c                   X'0100'
     d LIBSSH2_TRACE_SOCKET...
     d                 c                   X'0200'

     d libssh2_trace_handler_func...
     d                 s               *   based(######typedef######) procptr

     d libssh2_trace_sethandler...
     d                 pr                  extproc('libssh2_trace_sethandler')
     d                                     like(libssh2_Cint)
     d  session                        *   value                                LIBSSH2_SESSION *
     d  context                        *   value                                void *
     d  callback                           value
     d                                     like(libssh2_trace_handler_func)

      /endif                                                                    LIBSSH2_H_