Source file ffi_generated.ml
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
module CI = Cstubs_internals
external async_ssl_stub_1_TLS_method : unit -> CI.voidp
= "async_ssl_stub_1_TLS_method"
external async_ssl_stub_2_TLSv1_method : unit -> CI.voidp
= "async_ssl_stub_2_TLSv1_method"
external async_ssl_stub_3_TLSv1_1_method : unit -> CI.voidp
= "async_ssl_stub_3_TLSv1_1_method"
external async_ssl_stub_4_TLSv1_2_method : unit -> CI.voidp
= "async_ssl_stub_4_TLSv1_2_method"
external async_ssl_stub_5_ERR_get_error : unit -> Unsigned.ulong
= "async_ssl_stub_5_ERR_get_error"
external async_ssl_stub_6_ERR_error_string_n
: Unsigned.ulong -> _ CI.fatptr -> int -> unit
= "async_ssl_stub_6_ERR_error_string_n"
external async_ssl_stub_7_OpenSSL_add_all_digests : unit -> unit
= "async_ssl_stub_7_OpenSSL_add_all_digests"
external async_ssl_stub_8_OpenSSL_add_all_ciphers : unit -> unit
= "async_ssl_stub_8_OpenSSL_add_all_ciphers"
external async_ssl_stub_9_OpenSSL_add_ssl_algorithms : unit -> unit
= "async_ssl_stub_9_OpenSSL_add_ssl_algorithms"
external async_ssl_stub_10_OPENSSL_config : _ CI.fatptr -> unit
= "async_ssl_stub_10_OPENSSL_config"
external async_ssl_stub_11_SSL_library_init : unit -> Unsigned.ulong
= "async_ssl_stub_11_SSL_library_init"
external async_ssl_stub_12_SSL_load_error_strings : unit -> unit
= "async_ssl_stub_12_SSL_load_error_strings"
external async_ssl_stub_13_ERR_load_crypto_strings : unit -> unit
= "async_ssl_stub_13_ERR_load_crypto_strings"
external async_ssl_stub_14_ENGINE_load_builtin_engines : unit -> unit
= "async_ssl_stub_14_ENGINE_load_builtin_engines"
external async_ssl_stub_15_ENGINE_register_all_complete : unit -> unit
= "async_ssl_stub_15_ENGINE_register_all_complete"
external async_ssl_stub_16_SSL_CTX_new : _ CI.fatptr -> CI.voidp
= "async_ssl_stub_16_SSL_CTX_new"
external async_ssl_stub_17_SSL_CTX_free : _ CI.fatptr -> unit
= "async_ssl_stub_17_SSL_CTX_free"
external async_ssl_stub_18_SSL_CTX_set_security_level
: _ CI.fatptr -> int -> unit
= "async_ssl_stub_18_SSL_CTX_set_security_level"
external async_ssl_stub_19_SSL_CTX_load_verify_locations
: _ CI.fatptr -> _ CI.fatptr -> _ CI.fatptr -> int
= "async_ssl_stub_19_SSL_CTX_load_verify_locations"
external async_ssl_stub_20_SSL_CTX_set_default_verify_paths
: _ CI.fatptr -> int = "async_ssl_stub_20_SSL_CTX_set_default_verify_paths"
external async_ssl_stub_21_SSL_CTX_set_session_id_context
: _ CI.fatptr -> _ CI.fatptr -> Unsigned.uint -> int
= "async_ssl_stub_21_SSL_CTX_set_session_id_context"
external async_ssl_stub_22_SSL_CTX_set_cipher_list
: _ CI.fatptr -> _ CI.fatptr -> int
= "async_ssl_stub_22_SSL_CTX_set_cipher_list"
external async_ssl_stub_23_SSL_CTX_set_options
: _ CI.fatptr -> Unsigned.ulong -> Unsigned.ulong
= "async_ssl_stub_23_SSL_CTX_set_options"
external async_ssl_stub_24_SSL_CTX_use_certificate_chain_file
: _ CI.fatptr -> _ CI.fatptr -> int
= "async_ssl_stub_24_SSL_CTX_use_certificate_chain_file"
external async_ssl_stub_25_SSL_CTX_use_certificate_file
: _ CI.fatptr -> _ CI.fatptr -> int -> int
= "async_ssl_stub_25_SSL_CTX_use_certificate_file"
external async_ssl_stub_26_SSL_CTX_use_PrivateKey_file
: _ CI.fatptr -> _ CI.fatptr -> int -> int
= "async_ssl_stub_26_SSL_CTX_use_PrivateKey_file"
external async_ssl_stub_27_SSL_CTX_set_alpn_protos
: _ CI.fatptr -> _ CI.fatptr -> Unsigned.uint -> int
= "async_ssl_stub_27_SSL_CTX_set_alpn_protos"
external async_ssl_stub_28_async_ssl__set_alpn_callback
: _ CI.fatptr -> _ CI.fatptr -> Unsigned.uint -> CI.voidp
= "async_ssl_stub_28_async_ssl__set_alpn_callback"
external async_ssl_stub_29_async_ssl__free_alpn_callback
: _ CI.fatptr -> unit = "async_ssl_stub_29_async_ssl__free_alpn_callback"
external async_ssl_stub_30_BIO_new : _ CI.fatptr -> CI.voidp
= "async_ssl_stub_30_BIO_new"
external async_ssl_stub_31_BIO_s_mem : unit -> CI.voidp
= "async_ssl_stub_31_BIO_s_mem"
external async_ssl_stub_32_BIO_read
: _ CI.fatptr -> _ CI.fatptr -> int -> int = "async_ssl_stub_32_BIO_read"
external async_ssl_stub_33_BIO_write
: _ CI.fatptr -> _ CI.fatptr -> int -> int = "async_ssl_stub_33_BIO_write"
external async_ssl_stub_34_OBJ_obj2nid : _ CI.fatptr -> int
= "async_ssl_stub_34_OBJ_obj2nid"
external async_ssl_stub_35_OBJ_nid2sn : int -> CI.voidp
= "async_ssl_stub_35_OBJ_nid2sn"
external async_ssl_stub_36_OBJ_txt2nid : _ CI.fatptr -> int
= "async_ssl_stub_36_OBJ_txt2nid"
external async_ssl_stub_37_ASN1_STRING_length : _ CI.fatptr -> int
= "async_ssl_stub_37_ASN1_STRING_length"
external async_ssl_stub_38_ASN1_STRING_data : _ CI.fatptr -> CI.voidp
= "async_ssl_stub_38_ASN1_STRING_data"
external async_ssl_stub_39_X509_NAME_ENTRY_get_object
: _ CI.fatptr -> CI.voidp = "async_ssl_stub_39_X509_NAME_ENTRY_get_object"
external async_ssl_stub_40_X509_NAME_ENTRY_get_data : _ CI.fatptr -> CI.voidp
= "async_ssl_stub_40_X509_NAME_ENTRY_get_data"
external async_ssl_stub_41_X509_NAME_entry_count : _ CI.fatptr -> int
= "async_ssl_stub_41_X509_NAME_entry_count"
external async_ssl_stub_42_X509_NAME_get_entry
: _ CI.fatptr -> int -> CI.voidp = "async_ssl_stub_42_X509_NAME_get_entry"
external async_ssl_stub_43_EVP_sha1 : unit -> CI.voidp
= "async_ssl_stub_43_EVP_sha1"
external async_ssl_stub_44_X509_get_subject_name : _ CI.fatptr -> CI.voidp
= "async_ssl_stub_44_X509_get_subject_name"
external async_ssl_stub_45_X509_verify_cert_error_string
: Signed.long -> CI.voidp
= "async_ssl_stub_45_X509_verify_cert_error_string"
external async_ssl_stub_46_X509_free : _ CI.fatptr -> unit
= "async_ssl_stub_46_X509_free"
external async_ssl_stub_47_async_ssl__subject_alt_names
: _ CI.fatptr -> CI.voidp
= "async_ssl_stub_47_async_ssl__subject_alt_names"
external async_ssl_stub_48_async_ssl__free_subject_alt_names
: _ CI.fatptr -> unit
= "async_ssl_stub_48_async_ssl__free_subject_alt_names"
external async_ssl_stub_49_X509_digest
: _ CI.fatptr -> _ CI.fatptr -> _ CI.fatptr -> _ CI.fatptr -> bool
= "async_ssl_stub_49_X509_digest"
external async_ssl_stub_50_X509_check_host
: _ CI.fatptr -> _ CI.fatptr -> int -> int -> _ CI.fatptr -> int
= "async_ssl_stub_50_X509_check_host"
external async_ssl_stub_51_X509_check_ip_asc
: _ CI.fatptr -> _ CI.fatptr -> int -> int
= "async_ssl_stub_51_X509_check_ip_asc"
external async_ssl_stub_52_SSL_SESSION_new : unit -> CI.voidp
= "async_ssl_stub_52_SSL_SESSION_new"
external async_ssl_stub_53_SSL_SESSION_free : _ CI.fatptr -> unit
= "async_ssl_stub_53_SSL_SESSION_free"
external async_ssl_stub_54_BN_new : unit -> CI.voidp
= "async_ssl_stub_54_BN_new"
external async_ssl_stub_55_BN_free : _ CI.fatptr -> unit
= "async_ssl_stub_55_BN_free"
external async_ssl_stub_56_BN_bin2bn
: _ CI.fatptr -> int -> _ CI.fatptr -> CI.voidp
= "async_ssl_stub_56_BN_bin2bn"
external async_ssl_stub_57_BN_hex2bn : _ CI.fatptr -> _ CI.fatptr -> int
= "async_ssl_stub_57_BN_hex2bn"
external async_ssl_stub_58_DH_new : unit -> CI.voidp
= "async_ssl_stub_58_DH_new"
external async_ssl_stub_59_DH_free : _ CI.fatptr -> unit
= "async_ssl_stub_59_DH_free"
external async_ssl_stub_60_DH_generate_parameters
: int -> int -> _ CI.fatfunptr -> _ CI.fatptr -> CI.voidp
= "async_ssl_stub_60_DH_generate_parameters"
external async_ssl_stub_61_SSL_new : _ CI.fatptr -> CI.voidp
= "async_ssl_stub_61_SSL_new"
external async_ssl_stub_62_SSL_free : _ CI.fatptr -> unit
= "async_ssl_stub_62_SSL_free"
external async_ssl_stub_63_SSL_set_ssl_method
: _ CI.fatptr -> _ CI.fatptr -> int
= "async_ssl_stub_63_SSL_set_ssl_method"
external async_ssl_stub_64_SSL_get_error : _ CI.fatptr -> int -> int
= "async_ssl_stub_64_SSL_get_error"
external async_ssl_stub_65_SSL_set_connect_state : _ CI.fatptr -> unit
= "async_ssl_stub_65_SSL_set_connect_state"
external async_ssl_stub_66_SSL_set_accept_state : _ CI.fatptr -> unit
= "async_ssl_stub_66_SSL_set_accept_state"
external async_ssl_stub_67_SSL_connect : _ CI.fatptr -> int
= "async_ssl_stub_67_SSL_connect"
external async_ssl_stub_68_SSL_accept : _ CI.fatptr -> int
= "async_ssl_stub_68_SSL_accept"
external async_ssl_stub_69_SSL_set_bio
: _ CI.fatptr -> _ CI.fatptr -> _ CI.fatptr -> unit
= "async_ssl_stub_69_SSL_set_bio"
external async_ssl_stub_70_SSL_read
: _ CI.fatptr -> _ CI.fatptr -> int -> int = "async_ssl_stub_70_SSL_read"
external async_ssl_stub_71_SSL_write
: _ CI.fatptr -> _ CI.fatptr -> int -> int = "async_ssl_stub_71_SSL_write"
external async_ssl_stub_72_SSL_set_verify
: _ CI.fatptr -> int -> _ CI.fatptr -> unit
= "async_ssl_stub_72_SSL_set_verify"
external async_ssl_stub_73_SSL_set_cipher_list
: _ CI.fatptr -> _ CI.fatptr -> int
= "async_ssl_stub_73_SSL_set_cipher_list"
external async_ssl_stub_74_SSL_get_cipher_list
: _ CI.fatptr -> int -> CI.voidp = "async_ssl_stub_74_SSL_get_cipher_list"
external async_ssl_stub_75_SSL_set1_groups_list
: _ CI.fatptr -> _ CI.fatptr -> int
= "async_ssl_stub_75_SSL_set1_groups_list"
external async_ssl_stub_76_SSL_get_peer_certificate : _ CI.fatptr -> CI.voidp
= "async_ssl_stub_76_SSL_get_peer_certificate"
external async_ssl_stub_77_SSL_get_verify_result : _ CI.fatptr -> Signed.long
= "async_ssl_stub_77_SSL_get_verify_result"
external async_ssl_stub_78_SSL_get_version : _ CI.fatptr -> CI.voidp
= "async_ssl_stub_78_SSL_get_version"
external async_ssl_stub_79_SSL_set_session
: _ CI.fatptr -> _ CI.fatptr -> int = "async_ssl_stub_79_SSL_set_session"
external async_ssl_stub_80_SSL_session_reused : _ CI.fatptr -> int
= "async_ssl_stub_80_SSL_session_reused"
external async_ssl_stub_81_SSL_get1_session : _ CI.fatptr -> CI.voidp
= "async_ssl_stub_81_SSL_get1_session"
external async_ssl_stub_82_SSL_check_private_key : _ CI.fatptr -> int
= "async_ssl_stub_82_SSL_check_private_key"
external async_ssl_stub_83_SSL_set_tlsext_host_name
: _ CI.fatptr -> _ CI.fatptr -> int
= "async_ssl_stub_83_SSL_set_tlsext_host_name"
external async_ssl_stub_84_async_ssl__pem_peer_certificate_chain
: _ CI.fatptr -> CI.voidp
= "async_ssl_stub_84_async_ssl__pem_peer_certificate_chain"
external async_ssl_stub_85_async_ssl__free_pem_peer_certificate_chain
: _ CI.fatptr -> unit
= "async_ssl_stub_85_async_ssl__free_pem_peer_certificate_chain"
external async_ssl_stub_86_SSL_get0_alpn_selected
: _ CI.fatptr -> _ CI.fatptr -> _ CI.fatptr -> unit
= "async_ssl_stub_86_SSL_get0_alpn_selected"
type 'a result = 'a
type 'a return = 'a
type 'a fn =
| Returns : 'a CI.typ -> 'a return fn
| Function : 'a CI.typ * 'b fn -> ('a -> 'b) fn
let map_result f x = f x
let returning t = Returns t
let (@->) f p = Function (f, p)
let foreign : type a b. string -> (a -> b) fn -> (a -> b) =
fun name t -> match t, name with
| Function
(CI.Pointer _,
Function (CI.Pointer _, Function (CI.Pointer _, Returns CI.Void))),
"SSL_get0_alpn_selected" ->
(fun x1 x3 x5 ->
let CI.CPointer x6 = x5 in
let CI.CPointer x4 = x3 in
let CI.CPointer x2 = x1 in
async_ssl_stub_86_SSL_get0_alpn_selected x2 x4 x6)
| Function (CI.Pointer _, Returns CI.Void),
"async_ssl__free_pem_peer_certificate_chain" ->
(fun x7 ->
let CI.CPointer x8 = x7 in
async_ssl_stub_85_async_ssl__free_pem_peer_certificate_chain x8)
| Function
(CI.Pointer _, Returns (CI.View {CI.ty = CI.Pointer x11; read = x12; _})),
"async_ssl__pem_peer_certificate_chain" ->
(fun x9 ->
let CI.CPointer x10 = x9 in
x12
(CI.make_ptr x11
(async_ssl_stub_84_async_ssl__pem_peer_certificate_chain x10)))
| Function
(CI.Pointer _, Function (CI.Pointer _, Returns (CI.Primitive CI.Int))),
"SSL_set_tlsext_host_name" ->
(fun x13 x15 ->
let CI.CPointer x16 = x15 in
let CI.CPointer x14 = x13 in
async_ssl_stub_83_SSL_set_tlsext_host_name x14 x16)
| Function (CI.Pointer _, Returns (CI.Primitive CI.Int)),
"SSL_check_private_key" ->
(fun x17 ->
let CI.CPointer x18 = x17 in async_ssl_stub_82_SSL_check_private_key x18)
| Function
(CI.Pointer _, Returns (CI.View {CI.ty = CI.Pointer x21; read = x22; _})),
"SSL_get1_session" ->
(fun x19 ->
let CI.CPointer x20 = x19 in
x22 (CI.make_ptr x21 (async_ssl_stub_81_SSL_get1_session x20)))
| Function (CI.Pointer _, Returns (CI.Primitive CI.Int)),
"SSL_session_reused" ->
(fun x23 ->
let CI.CPointer x24 = x23 in async_ssl_stub_80_SSL_session_reused x24)
| Function
(CI.Pointer _, Function (CI.Pointer _, Returns (CI.Primitive CI.Int))),
"SSL_set_session" ->
(fun x25 x27 ->
let CI.CPointer x28 = x27 in
let CI.CPointer x26 = x25 in async_ssl_stub_79_SSL_set_session x26 x28)
| Function
(CI.Pointer _, Returns (CI.View {CI.ty = CI.Pointer x31; read = x32; _})),
"SSL_get_version" ->
(fun x29 ->
let CI.CPointer x30 = x29 in
x32 (CI.make_ptr x31 (async_ssl_stub_78_SSL_get_version x30)))
| Function (CI.Pointer _, Returns (CI.Primitive CI.Long)),
"SSL_get_verify_result" ->
(fun x33 ->
let CI.CPointer x34 = x33 in async_ssl_stub_77_SSL_get_verify_result x34)
| Function
(CI.Pointer _, Returns (CI.View {CI.ty = CI.Pointer x37; read = x38; _})),
"SSL_get_peer_certificate" ->
(fun x35 ->
let CI.CPointer x36 = x35 in
x38 (CI.make_ptr x37 (async_ssl_stub_76_SSL_get_peer_certificate x36)))
| Function
(CI.Pointer _,
Function
(CI.View {CI.ty = CI.Pointer _; write = x42; _},
Returns (CI.Primitive CI.Int))),
"SSL_set1_groups_list" ->
(fun x39 x41 ->
let CI.CPointer x44 = x42 x41 in
let CI.CPointer x40 = x39 in
let x43 = x44 in async_ssl_stub_75_SSL_set1_groups_list x40 x43)
| Function
(CI.Pointer _,
Function
(CI.Primitive CI.Int,
Returns (CI.View {CI.ty = CI.Pointer x48; read = x49; _}))),
"SSL_get_cipher_list" ->
(fun x45 x47 ->
let CI.CPointer x46 = x45 in
x49 (CI.make_ptr x48 (async_ssl_stub_74_SSL_get_cipher_list x46 x47)))
| Function
(CI.Pointer _,
Function
(CI.View {CI.ty = CI.Pointer _; write = x53; _},
Returns (CI.Primitive CI.Int))),
"SSL_set_cipher_list" ->
(fun x50 x52 ->
let CI.CPointer x55 = x53 x52 in
let CI.CPointer x51 = x50 in
let x54 = x55 in async_ssl_stub_73_SSL_set_cipher_list x51 x54)
| Function
(CI.Pointer _,
Function (CI.Primitive CI.Int, Function (CI.Pointer _, Returns CI.Void))),
"SSL_set_verify" ->
(fun x56 x58 x59 ->
let CI.CPointer x60 = x59 in
let CI.CPointer x57 = x56 in async_ssl_stub_72_SSL_set_verify x57 x58 x60)
| Function
(CI.Pointer _,
Function
(CI.View {CI.ty = CI.Pointer _; write = x64; _},
Function (CI.Primitive CI.Int, Returns (CI.Primitive CI.Int)))),
"SSL_write" ->
(fun x61 x63 x67 ->
let CI.CPointer x66 = x64 x63 in
let CI.CPointer x62 = x61 in
let x65 = x66 in async_ssl_stub_71_SSL_write x62 x65 x67)
| Function
(CI.Pointer _,
Function
(CI.Pointer _,
Function (CI.Primitive CI.Int, Returns (CI.Primitive CI.Int)))),
"SSL_read" ->
(fun x68 x70 x72 ->
let CI.CPointer x71 = x70 in
let CI.CPointer x69 = x68 in async_ssl_stub_70_SSL_read x69 x71 x72)
| Function
(CI.Pointer _,
Function (CI.Pointer _, Function (CI.Pointer _, Returns CI.Void))),
"SSL_set_bio" ->
(fun x73 x75 x77 ->
let CI.CPointer x78 = x77 in
let CI.CPointer x76 = x75 in
let CI.CPointer x74 = x73 in async_ssl_stub_69_SSL_set_bio x74 x76 x78)
| Function (CI.Pointer _, Returns (CI.Primitive CI.Int)), "SSL_accept" ->
(fun x79 -> let CI.CPointer x80 = x79 in async_ssl_stub_68_SSL_accept x80)
| Function (CI.Pointer _, Returns (CI.Primitive CI.Int)), "SSL_connect" ->
(fun x81 -> let CI.CPointer x82 = x81 in async_ssl_stub_67_SSL_connect x82)
| Function (CI.Pointer _, Returns CI.Void), "SSL_set_accept_state" ->
(fun x83 ->
let CI.CPointer x84 = x83 in async_ssl_stub_66_SSL_set_accept_state x84)
| Function (CI.Pointer _, Returns CI.Void), "SSL_set_connect_state" ->
(fun x85 ->
let CI.CPointer x86 = x85 in async_ssl_stub_65_SSL_set_connect_state x86)
| Function
(CI.Pointer _,
Function (CI.Primitive CI.Int, Returns (CI.Primitive CI.Int))),
"SSL_get_error" ->
(fun x87 x89 ->
let CI.CPointer x88 = x87 in async_ssl_stub_64_SSL_get_error x88 x89)
| Function
(CI.Pointer _, Function (CI.Pointer _, Returns (CI.Primitive CI.Int))),
"SSL_set_ssl_method" ->
(fun x90 x92 ->
let CI.CPointer x93 = x92 in
let CI.CPointer x91 = x90 in async_ssl_stub_63_SSL_set_ssl_method x91 x93)
| Function (CI.Pointer _, Returns CI.Void), "SSL_free" ->
(fun x94 -> let CI.CPointer x95 = x94 in async_ssl_stub_62_SSL_free x95)
| Function
(CI.Pointer _, Returns (CI.View {CI.ty = CI.Pointer x98; read = x99; _})),
"SSL_new" ->
(fun x96 ->
let CI.CPointer x97 = x96 in
x99 (CI.make_ptr x98 (async_ssl_stub_61_SSL_new x97)))
| Function
(CI.Primitive CI.Int,
Function
(CI.Primitive CI.Int,
Function
(CI.View {CI.ty = CI.Funptr _; write = x103; _},
Function
(CI.Pointer _,
Returns (CI.View {CI.ty = CI.Pointer x108; read = x109; _}))))),
"DH_generate_parameters" ->
(fun x100 x101 x102 x106 ->
let CI.CPointer x107 = x106 in
let CI.Static_funptr x105 = x103 x102 in
let x104 = x105 in
x109
(CI.make_ptr x108
(async_ssl_stub_60_DH_generate_parameters x100 x101 x104 x107)))
| Function (CI.Pointer _, Returns CI.Void), "DH_free" ->
(fun x110 -> let CI.CPointer x111 = x110 in async_ssl_stub_59_DH_free x111)
| Function
(CI.Void, Returns (CI.View {CI.ty = CI.Pointer x113; read = x114; _})),
"DH_new" ->
(fun x112 -> x114 (CI.make_ptr x113 (async_ssl_stub_58_DH_new x112)))
| Function
(CI.Pointer _,
Function
(CI.View {CI.ty = CI.Pointer _; write = x118; _},
Returns (CI.Primitive CI.Int))),
"BN_hex2bn" ->
(fun x115 x117 ->
let CI.CPointer x120 = x118 x117 in
let CI.CPointer x116 = x115 in
let x119 = x120 in async_ssl_stub_57_BN_hex2bn x116 x119)
| Function
(CI.Pointer _,
Function
(CI.Primitive CI.Int,
Function (CI.Pointer _, Returns (CI.Pointer x126)))),
"BN_bin2bn" ->
(fun x121 x123 x124 ->
let CI.CPointer x125 = x124 in
let CI.CPointer x122 = x121 in
CI.make_ptr x126 (async_ssl_stub_56_BN_bin2bn x122 x123 x125))
| Function (CI.Pointer _, Returns CI.Void), "BN_free" ->
(fun x127 -> let CI.CPointer x128 = x127 in async_ssl_stub_55_BN_free x128)
| Function
(CI.Void, Returns (CI.View {CI.ty = CI.Pointer x130; read = x131; _})),
"BN_new" ->
(fun x129 -> x131 (CI.make_ptr x130 (async_ssl_stub_54_BN_new x129)))
| Function (CI.Pointer _, Returns CI.Void), "SSL_SESSION_free" ->
(fun x132 ->
let CI.CPointer x133 = x132 in async_ssl_stub_53_SSL_SESSION_free x133)
| Function
(CI.Void, Returns (CI.View {CI.ty = CI.Pointer x135; read = x136; _})),
"SSL_SESSION_new" ->
(fun x134 ->
x136 (CI.make_ptr x135 (async_ssl_stub_52_SSL_SESSION_new x134)))
| Function
(CI.Pointer _,
Function
(CI.View {CI.ty = CI.Pointer _; write = x140; _},
Function (CI.Primitive CI.Int, Returns (CI.Primitive CI.Int)))),
"X509_check_ip_asc" ->
(fun x137 x139 x143 ->
let CI.CPointer x142 = x140 x139 in
let CI.CPointer x138 = x137 in
let x141 = x142 in async_ssl_stub_51_X509_check_ip_asc x138 x141 x143)
| Function
(CI.Pointer _,
Function
(CI.View {CI.ty = CI.Pointer _; write = x147; _},
Function
(CI.Primitive CI.Int,
Function
(CI.Primitive CI.Int,
Function
(CI.View {CI.ty = CI.Pointer _; write = x153; _},
Returns (CI.Primitive CI.Int)))))),
"X509_check_host" ->
(fun x144 x146 x150 x151 x152 ->
let CI.CPointer x155 = x153 x152 in
let CI.CPointer x149 = x147 x146 in
let CI.CPointer x145 = x144 in
let x148 = x149 in
let x154 = x155 in
async_ssl_stub_50_X509_check_host x145 x148 x150 x151 x154)
| Function
(CI.Pointer _,
Function
(CI.Pointer _,
Function
(CI.Pointer _,
Function (CI.Pointer _, Returns (CI.Primitive CI.Bool))))),
"X509_digest" ->
(fun x156 x158 x160 x162 ->
let CI.CPointer x163 = x162 in
let CI.CPointer x161 = x160 in
let CI.CPointer x159 = x158 in
let CI.CPointer x157 = x156 in
async_ssl_stub_49_X509_digest x157 x159 x161 x163)
| Function (CI.Pointer _, Returns CI.Void),
"async_ssl__free_subject_alt_names" ->
(fun x164 ->
let CI.CPointer x165 = x164 in
async_ssl_stub_48_async_ssl__free_subject_alt_names x165)
| Function
(CI.Pointer _,
Returns (CI.View {CI.ty = CI.Pointer x168; read = x169; _})),
"async_ssl__subject_alt_names" ->
(fun x166 ->
let CI.CPointer x167 = x166 in
x169
(CI.make_ptr x168 (async_ssl_stub_47_async_ssl__subject_alt_names x167)))
| Function (CI.Pointer _, Returns CI.Void), "X509_free" ->
(fun x170 ->
let CI.CPointer x171 = x170 in async_ssl_stub_46_X509_free x171)
| Function
(CI.Primitive CI.Long,
Returns (CI.View {CI.ty = CI.Pointer x173; read = x174; _})),
"X509_verify_cert_error_string" ->
(fun x172 ->
x174
(CI.make_ptr x173 (async_ssl_stub_45_X509_verify_cert_error_string x172)))
| Function
(CI.Pointer _,
Returns (CI.View {CI.ty = CI.Pointer x177; read = x178; _})),
"X509_get_subject_name" ->
(fun x175 ->
let CI.CPointer x176 = x175 in
x178 (CI.make_ptr x177 (async_ssl_stub_44_X509_get_subject_name x176)))
| Function (CI.Void, Returns (CI.Pointer x180)), "EVP_sha1" ->
(fun x179 -> CI.make_ptr x180 (async_ssl_stub_43_EVP_sha1 x179))
| Function
(CI.Pointer _, Function (CI.Primitive CI.Int, Returns (CI.Pointer x184))),
"X509_NAME_get_entry" ->
(fun x181 x183 ->
let CI.CPointer x182 = x181 in
CI.make_ptr x184 (async_ssl_stub_42_X509_NAME_get_entry x182 x183))
| Function (CI.Pointer _, Returns (CI.Primitive CI.Int)),
"X509_NAME_entry_count" ->
(fun x185 ->
let CI.CPointer x186 = x185 in
async_ssl_stub_41_X509_NAME_entry_count x186)
| Function (CI.Pointer _, Returns (CI.Pointer x189)),
"X509_NAME_ENTRY_get_data" ->
(fun x187 ->
let CI.CPointer x188 = x187 in
CI.make_ptr x189 (async_ssl_stub_40_X509_NAME_ENTRY_get_data x188))
| Function (CI.Pointer _, Returns (CI.Pointer x192)),
"X509_NAME_ENTRY_get_object" ->
(fun x190 ->
let CI.CPointer x191 = x190 in
CI.make_ptr x192 (async_ssl_stub_39_X509_NAME_ENTRY_get_object x191))
| Function
(CI.Pointer _,
Returns (CI.View {CI.ty = CI.Pointer x195; read = x196; _})),
"ASN1_STRING_data" ->
(fun x193 ->
let CI.CPointer x194 = x193 in
x196 (CI.make_ptr x195 (async_ssl_stub_38_ASN1_STRING_data x194)))
| Function (CI.Pointer _, Returns (CI.Primitive CI.Int)),
"ASN1_STRING_length" ->
(fun x197 ->
let CI.CPointer x198 = x197 in async_ssl_stub_37_ASN1_STRING_length x198)
| Function
(CI.View {CI.ty = CI.Pointer _; write = x200; _},
Returns (CI.Primitive CI.Int)),
"OBJ_txt2nid" ->
(fun x199 ->
let CI.CPointer x202 = x200 x199 in
let x201 = x202 in async_ssl_stub_36_OBJ_txt2nid x201)
| Function
(CI.Primitive CI.Int,
Returns (CI.View {CI.ty = CI.Pointer x204; read = x205; _})),
"OBJ_nid2sn" ->
(fun x203 -> x205 (CI.make_ptr x204 (async_ssl_stub_35_OBJ_nid2sn x203)))
| Function (CI.Pointer _, Returns (CI.Primitive CI.Int)), "OBJ_obj2nid" ->
(fun x206 ->
let CI.CPointer x207 = x206 in async_ssl_stub_34_OBJ_obj2nid x207)
| Function
(CI.Pointer _,
Function
(CI.View {CI.ty = CI.Pointer _; write = x211; _},
Function (CI.Primitive CI.Int, Returns (CI.Primitive CI.Int)))),
"BIO_write" ->
(fun x208 x210 x214 ->
let CI.CPointer x213 = x211 x210 in
let CI.CPointer x209 = x208 in
let x212 = x213 in async_ssl_stub_33_BIO_write x209 x212 x214)
| Function
(CI.Pointer _,
Function
(CI.Pointer _,
Function (CI.Primitive CI.Int, Returns (CI.Primitive CI.Int)))),
"BIO_read" ->
(fun x215 x217 x219 ->
let CI.CPointer x218 = x217 in
let CI.CPointer x216 = x215 in async_ssl_stub_32_BIO_read x216 x218 x219)
| Function (CI.Void, Returns (CI.Pointer x221)), "BIO_s_mem" ->
(fun x220 -> CI.make_ptr x221 (async_ssl_stub_31_BIO_s_mem x220))
| Function (CI.Pointer _, Returns (CI.Pointer x224)), "BIO_new" ->
(fun x222 ->
let CI.CPointer x223 = x222 in
CI.make_ptr x224 (async_ssl_stub_30_BIO_new x223))
| Function (CI.Pointer _, Returns CI.Void), "async_ssl__free_alpn_callback" ->
(fun x225 ->
let CI.CPointer x226 = x225 in
async_ssl_stub_29_async_ssl__free_alpn_callback x226)
| Function
(CI.Pointer _,
Function
(CI.Pointer _,
Function (CI.Primitive CI.Uint, Returns (CI.Pointer x232)))),
"async_ssl__set_alpn_callback" ->
(fun x227 x229 x231 ->
let CI.CPointer x230 = x229 in
let CI.CPointer x228 = x227 in
CI.make_ptr x232
(async_ssl_stub_28_async_ssl__set_alpn_callback x228 x230 x231))
| Function
(CI.Pointer _,
Function
(CI.Pointer _,
Function (CI.Primitive CI.Uint, Returns (CI.Primitive CI.Int)))),
"SSL_CTX_set_alpn_protos" ->
(fun x233 x235 x237 ->
let CI.CPointer x236 = x235 in
let CI.CPointer x234 = x233 in
async_ssl_stub_27_SSL_CTX_set_alpn_protos x234 x236 x237)
| Function
(CI.Pointer _,
Function
(CI.View {CI.ty = CI.Pointer _; write = x241; _},
Function (CI.Primitive CI.Int, Returns (CI.Primitive CI.Int)))),
"SSL_CTX_use_PrivateKey_file" ->
(fun x238 x240 x244 ->
let CI.CPointer x243 = x241 x240 in
let CI.CPointer x239 = x238 in
let x242 = x243 in
async_ssl_stub_26_SSL_CTX_use_PrivateKey_file x239 x242 x244)
| Function
(CI.Pointer _,
Function
(CI.View {CI.ty = CI.Pointer _; write = x248; _},
Function (CI.Primitive CI.Int, Returns (CI.Primitive CI.Int)))),
"SSL_CTX_use_certificate_file" ->
(fun x245 x247 x251 ->
let CI.CPointer x250 = x248 x247 in
let CI.CPointer x246 = x245 in
let x249 = x250 in
async_ssl_stub_25_SSL_CTX_use_certificate_file x246 x249 x251)
| Function
(CI.Pointer _,
Function
(CI.View {CI.ty = CI.Pointer _; write = x255; _},
Returns (CI.Primitive CI.Int))),
"SSL_CTX_use_certificate_chain_file" ->
(fun x252 x254 ->
let CI.CPointer x257 = x255 x254 in
let CI.CPointer x253 = x252 in
let x256 = x257 in
async_ssl_stub_24_SSL_CTX_use_certificate_chain_file x253 x256)
| Function
(CI.Pointer _,
Function (CI.Primitive CI.Ulong, Returns (CI.Primitive CI.Ulong))),
"SSL_CTX_set_options" ->
(fun x258 x260 ->
let CI.CPointer x259 = x258 in
async_ssl_stub_23_SSL_CTX_set_options x259 x260)
| Function
(CI.Pointer _,
Function
(CI.View {CI.ty = CI.Pointer _; write = x264; _},
Returns (CI.Primitive CI.Int))),
"SSL_CTX_set_cipher_list" ->
(fun x261 x263 ->
let CI.CPointer x266 = x264 x263 in
let CI.CPointer x262 = x261 in
let x265 = x266 in async_ssl_stub_22_SSL_CTX_set_cipher_list x262 x265)
| Function
(CI.Pointer _,
Function
(CI.Pointer _,
Function (CI.Primitive CI.Uint, Returns (CI.Primitive CI.Int)))),
"SSL_CTX_set_session_id_context" ->
(fun x267 x269 x271 ->
let CI.CPointer x270 = x269 in
let CI.CPointer x268 = x267 in
async_ssl_stub_21_SSL_CTX_set_session_id_context x268 x270 x271)
| Function (CI.Pointer _, Returns (CI.Primitive CI.Int)),
"SSL_CTX_set_default_verify_paths" ->
(fun x272 ->
let CI.CPointer x273 = x272 in
async_ssl_stub_20_SSL_CTX_set_default_verify_paths x273)
| Function
(CI.Pointer _,
Function
(CI.View {CI.ty = CI.Pointer _; write = x277; _},
Function
(CI.View {CI.ty = CI.Pointer _; write = x281; _},
Returns (CI.Primitive CI.Int)))),
"SSL_CTX_load_verify_locations" ->
(fun x274 x276 x280 ->
let CI.CPointer x283 = x281 x280 in
let CI.CPointer x279 = x277 x276 in
let CI.CPointer x275 = x274 in
let x278 = x279 in
let x282 = x283 in
async_ssl_stub_19_SSL_CTX_load_verify_locations x275 x278 x282)
| Function (CI.Pointer _, Function (CI.Primitive CI.Int, Returns CI.Void)),
"SSL_CTX_set_security_level" ->
(fun x284 x286 ->
let CI.CPointer x285 = x284 in
async_ssl_stub_18_SSL_CTX_set_security_level x285 x286)
| Function (CI.Pointer _, Returns CI.Void), "SSL_CTX_free" ->
(fun x287 ->
let CI.CPointer x288 = x287 in async_ssl_stub_17_SSL_CTX_free x288)
| Function
(CI.Pointer _,
Returns (CI.View {CI.ty = CI.Pointer x291; read = x292; _})),
"SSL_CTX_new" ->
(fun x289 ->
let CI.CPointer x290 = x289 in
x292 (CI.make_ptr x291 (async_ssl_stub_16_SSL_CTX_new x290)))
| Function (CI.Void, Returns CI.Void), "ENGINE_register_all_complete" ->
async_ssl_stub_15_ENGINE_register_all_complete
| Function (CI.Void, Returns CI.Void), "ENGINE_load_builtin_engines" ->
async_ssl_stub_14_ENGINE_load_builtin_engines
| Function (CI.Void, Returns CI.Void), "ERR_load_crypto_strings" ->
async_ssl_stub_13_ERR_load_crypto_strings
| Function (CI.Void, Returns CI.Void), "SSL_load_error_strings" ->
async_ssl_stub_12_SSL_load_error_strings
| Function (CI.Void, Returns (CI.Primitive CI.Ulong)), "SSL_library_init" ->
async_ssl_stub_11_SSL_library_init
| Function (CI.View {CI.ty = CI.Pointer _; write = x299; _}, Returns CI.Void),
"OPENSSL_config" ->
(fun x298 ->
let CI.CPointer x301 = x299 x298 in
let x300 = x301 in async_ssl_stub_10_OPENSSL_config x300)
| Function (CI.Void, Returns CI.Void), "OpenSSL_add_ssl_algorithms" ->
async_ssl_stub_9_OpenSSL_add_ssl_algorithms
| Function (CI.Void, Returns CI.Void), "OpenSSL_add_all_ciphers" ->
async_ssl_stub_8_OpenSSL_add_all_ciphers
| Function (CI.Void, Returns CI.Void), "OpenSSL_add_all_digests" ->
async_ssl_stub_7_OpenSSL_add_all_digests
| Function
(CI.Primitive CI.Ulong,
Function (CI.Pointer _, Function (CI.Primitive CI.Int, Returns CI.Void))),
"ERR_error_string_n" ->
(fun x305 x306 x308 ->
let CI.CPointer x307 = x306 in
async_ssl_stub_6_ERR_error_string_n x305 x307 x308)
| Function (CI.Void, Returns (CI.Primitive CI.Ulong)), "ERR_get_error" ->
async_ssl_stub_5_ERR_get_error
| Function (CI.Void, Returns (CI.Pointer x311)), "TLSv1_2_method" ->
(fun x310 -> CI.make_ptr x311 (async_ssl_stub_4_TLSv1_2_method x310))
| Function (CI.Void, Returns (CI.Pointer x313)), "TLSv1_1_method" ->
(fun x312 -> CI.make_ptr x313 (async_ssl_stub_3_TLSv1_1_method x312))
| Function (CI.Void, Returns (CI.Pointer x315)), "TLSv1_method" ->
(fun x314 -> CI.make_ptr x315 (async_ssl_stub_2_TLSv1_method x314))
| Function (CI.Void, Returns (CI.Pointer x317)), "TLS_method" ->
(fun x316 -> CI.make_ptr x317 (async_ssl_stub_1_TLS_method x316))
| _, s -> Printf.ksprintf failwith "No match for %s" s
let foreign_value : type a. string -> a Ctypes.typ -> a Ctypes.ptr =
fun name t -> match t, name with
| _, s -> Printf.ksprintf failwith "No match for %s" s