pan_bindings 1.0.11

FFI bindings for the SCION PAN Path Aware Networking library
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
/* automatically generated by rust-bindgen 0.65.1 */

#[derive(PartialEq, Copy, Clone, Hash, Debug, Default)]
#[repr(C)]
pub struct __BindgenComplex<T> {
    pub re: T,
    pub im: T,
}
pub const _STDINT_H: u32 = 1;
pub const _FEATURES_H: u32 = 1;
pub const _DEFAULT_SOURCE: u32 = 1;
pub const __GLIBC_USE_ISOC2X: u32 = 0;
pub const __USE_ISOC11: u32 = 1;
pub const __USE_ISOC99: u32 = 1;
pub const __USE_ISOC95: u32 = 1;
pub const __USE_POSIX_IMPLICITLY: u32 = 1;
pub const _POSIX_SOURCE: u32 = 1;
pub const _POSIX_C_SOURCE: u32 = 200809;
pub const __USE_POSIX: u32 = 1;
pub const __USE_POSIX2: u32 = 1;
pub const __USE_POSIX199309: u32 = 1;
pub const __USE_POSIX199506: u32 = 1;
pub const __USE_XOPEN2K: u32 = 1;
pub const __USE_XOPEN2K8: u32 = 1;
pub const _ATFILE_SOURCE: u32 = 1;
pub const __WORDSIZE: u32 = 64;
pub const __WORDSIZE_TIME64_COMPAT32: u32 = 1;
pub const __SYSCALL_WORDSIZE: u32 = 64;
pub const __TIMESIZE: u32 = 64;
pub const __USE_MISC: u32 = 1;
pub const __USE_ATFILE: u32 = 1;
pub const __USE_FORTIFY_LEVEL: u32 = 0;
pub const __GLIBC_USE_DEPRECATED_GETS: u32 = 0;
pub const __GLIBC_USE_DEPRECATED_SCANF: u32 = 0;
pub const __GLIBC_USE_C2X_STRTOL: u32 = 0;
pub const _STDC_PREDEF_H: u32 = 1;
pub const __STDC_IEC_559__: u32 = 1;
pub const __STDC_IEC_60559_BFP__: u32 = 201404;
pub const __STDC_IEC_559_COMPLEX__: u32 = 1;
pub const __STDC_IEC_60559_COMPLEX__: u32 = 201404;
pub const __STDC_ISO_10646__: u32 = 201706;
pub const __GNU_LIBRARY__: u32 = 6;
pub const __GLIBC__: u32 = 2;
pub const __GLIBC_MINOR__: u32 = 38;
pub const _SYS_CDEFS_H: u32 = 1;
pub const __glibc_c99_flexarr_available: u32 = 1;
pub const __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI: u32 = 0;
pub const __HAVE_GENERIC_SELECTION: u32 = 1;
pub const __GLIBC_USE_LIB_EXT2: u32 = 0;
pub const __GLIBC_USE_IEC_60559_BFP_EXT: u32 = 0;
pub const __GLIBC_USE_IEC_60559_BFP_EXT_C2X: u32 = 0;
pub const __GLIBC_USE_IEC_60559_EXT: u32 = 0;
pub const __GLIBC_USE_IEC_60559_FUNCS_EXT: u32 = 0;
pub const __GLIBC_USE_IEC_60559_FUNCS_EXT_C2X: u32 = 0;
pub const __GLIBC_USE_IEC_60559_TYPES_EXT: u32 = 0;
pub const _BITS_TYPES_H: u32 = 1;
pub const _BITS_TYPESIZES_H: u32 = 1;
pub const __OFF_T_MATCHES_OFF64_T: u32 = 1;
pub const __INO_T_MATCHES_INO64_T: u32 = 1;
pub const __RLIM_T_MATCHES_RLIM64_T: u32 = 1;
pub const __STATFS_MATCHES_STATFS64: u32 = 1;
pub const __KERNEL_OLD_TIMEVAL_MATCHES_TIMEVAL64: u32 = 1;
pub const __FD_SETSIZE: u32 = 1024;
pub const _BITS_TIME64_H: u32 = 1;
pub const _BITS_WCHAR_H: u32 = 1;
pub const _BITS_STDINT_INTN_H: u32 = 1;
pub const _BITS_STDINT_UINTN_H: u32 = 1;
pub const INT8_MIN: i32 = -128;
pub const INT16_MIN: i32 = -32768;
pub const INT32_MIN: i32 = -2147483648;
pub const INT8_MAX: u32 = 127;
pub const INT16_MAX: u32 = 32767;
pub const INT32_MAX: u32 = 2147483647;
pub const UINT8_MAX: u32 = 255;
pub const UINT16_MAX: u32 = 65535;
pub const UINT32_MAX: u32 = 4294967295;
pub const INT_LEAST8_MIN: i32 = -128;
pub const INT_LEAST16_MIN: i32 = -32768;
pub const INT_LEAST32_MIN: i32 = -2147483648;
pub const INT_LEAST8_MAX: u32 = 127;
pub const INT_LEAST16_MAX: u32 = 32767;
pub const INT_LEAST32_MAX: u32 = 2147483647;
pub const UINT_LEAST8_MAX: u32 = 255;
pub const UINT_LEAST16_MAX: u32 = 65535;
pub const UINT_LEAST32_MAX: u32 = 4294967295;
pub const INT_FAST8_MIN: i32 = -128;
pub const INT_FAST16_MIN: i64 = -9223372036854775808;
pub const INT_FAST32_MIN: i64 = -9223372036854775808;
pub const INT_FAST8_MAX: u32 = 127;
pub const INT_FAST16_MAX: u64 = 9223372036854775807;
pub const INT_FAST32_MAX: u64 = 9223372036854775807;
pub const UINT_FAST8_MAX: u32 = 255;
pub const UINT_FAST16_MAX: i32 = -1;
pub const UINT_FAST32_MAX: i32 = -1;
pub const INTPTR_MIN: i64 = -9223372036854775808;
pub const INTPTR_MAX: u64 = 9223372036854775807;
pub const UINTPTR_MAX: i32 = -1;
pub const PTRDIFF_MIN: i64 = -9223372036854775808;
pub const PTRDIFF_MAX: u64 = 9223372036854775807;
pub const SIG_ATOMIC_MIN: i32 = -2147483648;
pub const SIG_ATOMIC_MAX: u32 = 2147483647;
pub const SIZE_MAX: i32 = -1;
pub const WINT_MIN: u32 = 0;
pub const WINT_MAX: u32 = 4294967295;
pub const PAN_INVALID_HANDLE: u32 = 0;
pub const PAN_ERR_OK: u32 = 0;
pub const PAN_ERR_FAILED: u32 = 1;
pub const PAN_ERR_DEADLINE: u32 = 2;
pub const PAN_ERR_NO_PATH: u32 = 3;
pub const PAN_ERR_ADDR_SYNTAX: u32 = 4;
pub const PAN_ERR_ADDR_RESOLUTION: u32 = 5;
pub const PAN_ERR_WOULDBLOCK: u32 = 6;
pub const PAN_ERR_HOSTNOTFOUND: u32 = 7;
pub const PAN_STREAM_HDR_SIZE: u32 = 4;
pub const PAN_ADDR_HDR_SIZE: u32 = 32;
pub type wchar_t = ::std::os::raw::c_int;
#[repr(C)]
#[repr(align(16))]
#[derive(Debug, Copy, Clone)]
pub struct max_align_t {
    pub __clang_max_align_nonce1: ::std::os::raw::c_longlong,
    pub __bindgen_padding_0: u64,
    pub __clang_max_align_nonce2: u128,
}
#[test]
fn bindgen_test_layout_max_align_t() {
    const UNINIT: ::std::mem::MaybeUninit<max_align_t> = ::std::mem::MaybeUninit::uninit();
    let ptr = UNINIT.as_ptr();
    assert_eq!(
        ::std::mem::size_of::<max_align_t>(),
        32usize,
        concat!("Size of: ", stringify!(max_align_t))
    );
    assert_eq!(
        ::std::mem::align_of::<max_align_t>(),
        16usize,
        concat!("Alignment of ", stringify!(max_align_t))
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).__clang_max_align_nonce1) as usize - ptr as usize },
        0usize,
        concat!(
            "Offset of field: ",
            stringify!(max_align_t),
            "::",
            stringify!(__clang_max_align_nonce1)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).__clang_max_align_nonce2) as usize - ptr as usize },
        16usize,
        concat!(
            "Offset of field: ",
            stringify!(max_align_t),
            "::",
            stringify!(__clang_max_align_nonce2)
        )
    );
}
pub type __u_char = ::std::os::raw::c_uchar;
pub type __u_short = ::std::os::raw::c_ushort;
pub type __u_int = ::std::os::raw::c_uint;
pub type __u_long = ::std::os::raw::c_ulong;
pub type __int8_t = ::std::os::raw::c_schar;
pub type __uint8_t = ::std::os::raw::c_uchar;
pub type __int16_t = ::std::os::raw::c_short;
pub type __uint16_t = ::std::os::raw::c_ushort;
pub type __int32_t = ::std::os::raw::c_int;
pub type __uint32_t = ::std::os::raw::c_uint;
pub type __int64_t = ::std::os::raw::c_long;
pub type __uint64_t = ::std::os::raw::c_ulong;
pub type __int_least8_t = __int8_t;
pub type __uint_least8_t = __uint8_t;
pub type __int_least16_t = __int16_t;
pub type __uint_least16_t = __uint16_t;
pub type __int_least32_t = __int32_t;
pub type __uint_least32_t = __uint32_t;
pub type __int_least64_t = __int64_t;
pub type __uint_least64_t = __uint64_t;
pub type __quad_t = ::std::os::raw::c_long;
pub type __u_quad_t = ::std::os::raw::c_ulong;
pub type __intmax_t = ::std::os::raw::c_long;
pub type __uintmax_t = ::std::os::raw::c_ulong;
pub type __dev_t = ::std::os::raw::c_ulong;
pub type __uid_t = ::std::os::raw::c_uint;
pub type __gid_t = ::std::os::raw::c_uint;
pub type __ino_t = ::std::os::raw::c_ulong;
pub type __ino64_t = ::std::os::raw::c_ulong;
pub type __mode_t = ::std::os::raw::c_uint;
pub type __nlink_t = ::std::os::raw::c_ulong;
pub type __off_t = ::std::os::raw::c_long;
pub type __off64_t = ::std::os::raw::c_long;
pub type __pid_t = ::std::os::raw::c_int;
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct __fsid_t {
    pub __val: [::std::os::raw::c_int; 2usize],
}
#[test]
fn bindgen_test_layout___fsid_t() {
    const UNINIT: ::std::mem::MaybeUninit<__fsid_t> = ::std::mem::MaybeUninit::uninit();
    let ptr = UNINIT.as_ptr();
    assert_eq!(
        ::std::mem::size_of::<__fsid_t>(),
        8usize,
        concat!("Size of: ", stringify!(__fsid_t))
    );
    assert_eq!(
        ::std::mem::align_of::<__fsid_t>(),
        4usize,
        concat!("Alignment of ", stringify!(__fsid_t))
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).__val) as usize - ptr as usize },
        0usize,
        concat!(
            "Offset of field: ",
            stringify!(__fsid_t),
            "::",
            stringify!(__val)
        )
    );
}
pub type __clock_t = ::std::os::raw::c_long;
pub type __rlim_t = ::std::os::raw::c_ulong;
pub type __rlim64_t = ::std::os::raw::c_ulong;
pub type __id_t = ::std::os::raw::c_uint;
pub type __time_t = ::std::os::raw::c_long;
pub type __useconds_t = ::std::os::raw::c_uint;
pub type __suseconds_t = ::std::os::raw::c_long;
pub type __suseconds64_t = ::std::os::raw::c_long;
pub type __daddr_t = ::std::os::raw::c_int;
pub type __key_t = ::std::os::raw::c_int;
pub type __clockid_t = ::std::os::raw::c_int;
pub type __timer_t = *mut ::std::os::raw::c_void;
pub type __blksize_t = ::std::os::raw::c_long;
pub type __blkcnt_t = ::std::os::raw::c_long;
pub type __blkcnt64_t = ::std::os::raw::c_long;
pub type __fsblkcnt_t = ::std::os::raw::c_ulong;
pub type __fsblkcnt64_t = ::std::os::raw::c_ulong;
pub type __fsfilcnt_t = ::std::os::raw::c_ulong;
pub type __fsfilcnt64_t = ::std::os::raw::c_ulong;
pub type __fsword_t = ::std::os::raw::c_long;
pub type __ssize_t = ::std::os::raw::c_long;
pub type __syscall_slong_t = ::std::os::raw::c_long;
pub type __syscall_ulong_t = ::std::os::raw::c_ulong;
pub type __loff_t = __off64_t;
pub type __caddr_t = *mut ::std::os::raw::c_char;
pub type __intptr_t = ::std::os::raw::c_long;
pub type __socklen_t = ::std::os::raw::c_uint;
pub type __sig_atomic_t = ::std::os::raw::c_int;
pub type int_least8_t = __int_least8_t;
pub type int_least16_t = __int_least16_t;
pub type int_least32_t = __int_least32_t;
pub type int_least64_t = __int_least64_t;
pub type uint_least8_t = __uint_least8_t;
pub type uint_least16_t = __uint_least16_t;
pub type uint_least32_t = __uint_least32_t;
pub type uint_least64_t = __uint_least64_t;
pub type int_fast8_t = ::std::os::raw::c_schar;
pub type int_fast16_t = ::std::os::raw::c_long;
pub type int_fast32_t = ::std::os::raw::c_long;
pub type int_fast64_t = ::std::os::raw::c_long;
pub type uint_fast8_t = ::std::os::raw::c_uchar;
pub type uint_fast16_t = ::std::os::raw::c_ulong;
pub type uint_fast32_t = ::std::os::raw::c_ulong;
pub type uint_fast64_t = ::std::os::raw::c_ulong;
pub type intmax_t = __intmax_t;
pub type uintmax_t = __uintmax_t;
pub type cvoid_t = ::std::os::raw::c_void;
pub type cchar_t = ::std::os::raw::c_char;
pub type cuint8_t = u8;
pub type cuint64_t = u64;
pub type PanError = u32;
pub type PanUDPAddr = usize;
pub type PanConn = usize;
pub type PanListenConn = usize;
pub type PanScionSocket = usize;
pub type PanPath = usize;
pub type PanPathFingerprint = usize;
pub type PanPathInterface = usize;
pub type PanPolicy = usize;
pub type PanSelector = usize;
pub type PanReplySelector = usize;
pub type PanConnSockAdapter = usize;
pub type PanConnSSockAdapter = usize;
pub type PanListenSockAdapter = usize;
pub type PanListenSSockAdapter = usize;
pub type OnCompletionWaker =
    ::std::option::Option<unsafe extern "C" fn(arg1: *mut ::std::os::raw::c_void, arg2: PanError)>;
pub type PanPolicyFilterFn = ::std::option::Option<
    unsafe extern "C" fn(paths: *mut PanPath, count: usize, user: usize) -> PanPath,
>;
pub type PanSelectorPathFn = ::std::option::Option<unsafe extern "C" fn(user: usize) -> PanPath>;
#[doc = " Handles must be deleted by callee."]
pub type PanSelectorInitializeFn = ::std::option::Option<
    unsafe extern "C" fn(
        local: PanUDPAddr,
        remote: PanUDPAddr,
        paths: *mut PanPath,
        count: usize,
        user: usize,
    ),
>;
#[doc = " Handles must be deleted by callee."]
pub type PanSelectorRefreshFn =
    ::std::option::Option<unsafe extern "C" fn(paths: *mut PanPath, count: usize, user: usize)>;
#[doc = " Handles must be deleted by callee."]
pub type PanSelectorPathDownFn = ::std::option::Option<
    unsafe extern "C" fn(pf: PanPathFingerprint, pi: PanPathInterface, user: usize),
>;
pub type PanSelectorClose = ::std::option::Option<unsafe extern "C" fn(user: usize)>;
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct PanSelectorCallbacks {
    pub path: PanSelectorPathFn,
    pub initialize: PanSelectorInitializeFn,
    pub refresh: PanSelectorRefreshFn,
    pub pathDown: PanSelectorPathDownFn,
    pub close: PanSelectorClose,
}
#[test]
fn bindgen_test_layout_PanSelectorCallbacks() {
    const UNINIT: ::std::mem::MaybeUninit<PanSelectorCallbacks> = ::std::mem::MaybeUninit::uninit();
    let ptr = UNINIT.as_ptr();
    assert_eq!(
        ::std::mem::size_of::<PanSelectorCallbacks>(),
        40usize,
        concat!("Size of: ", stringify!(PanSelectorCallbacks))
    );
    assert_eq!(
        ::std::mem::align_of::<PanSelectorCallbacks>(),
        8usize,
        concat!("Alignment of ", stringify!(PanSelectorCallbacks))
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).path) as usize - ptr as usize },
        0usize,
        concat!(
            "Offset of field: ",
            stringify!(PanSelectorCallbacks),
            "::",
            stringify!(path)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).initialize) as usize - ptr as usize },
        8usize,
        concat!(
            "Offset of field: ",
            stringify!(PanSelectorCallbacks),
            "::",
            stringify!(initialize)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).refresh) as usize - ptr as usize },
        16usize,
        concat!(
            "Offset of field: ",
            stringify!(PanSelectorCallbacks),
            "::",
            stringify!(refresh)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).pathDown) as usize - ptr as usize },
        24usize,
        concat!(
            "Offset of field: ",
            stringify!(PanSelectorCallbacks),
            "::",
            stringify!(pathDown)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).close) as usize - ptr as usize },
        32usize,
        concat!(
            "Offset of field: ",
            stringify!(PanSelectorCallbacks),
            "::",
            stringify!(close)
        )
    );
}
#[doc = " Handles must be deleted by callee."]
pub type PanReplySelPathFn =
    ::std::option::Option<unsafe extern "C" fn(remote: PanUDPAddr, user: usize) -> PanPath>;
pub type PanReplySelInitializeFn =
    ::std::option::Option<unsafe extern "C" fn(local: u64, user: usize)>;
#[doc = " Handles must be deleted by callee."]
pub type PanReplySelRecordFn =
    ::std::option::Option<unsafe extern "C" fn(remote: PanUDPAddr, path: PanPath, user: usize)>;
#[doc = " Handles must be deleted by callee."]
pub type PanReplySelPathDownFn = ::std::option::Option<
    unsafe extern "C" fn(pf: PanPathFingerprint, pi: PanPathInterface, user: usize),
>;
pub type PanReplySelCloseFn = ::std::option::Option<unsafe extern "C" fn(user: usize)>;
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct PanReplySelCallbacks {
    pub path: PanReplySelPathFn,
    pub initialize: PanReplySelInitializeFn,
    pub record: PanReplySelRecordFn,
    pub pathDown: PanReplySelPathDownFn,
    pub close: PanReplySelCloseFn,
}
#[test]
fn bindgen_test_layout_PanReplySelCallbacks() {
    const UNINIT: ::std::mem::MaybeUninit<PanReplySelCallbacks> = ::std::mem::MaybeUninit::uninit();
    let ptr = UNINIT.as_ptr();
    assert_eq!(
        ::std::mem::size_of::<PanReplySelCallbacks>(),
        40usize,
        concat!("Size of: ", stringify!(PanReplySelCallbacks))
    );
    assert_eq!(
        ::std::mem::align_of::<PanReplySelCallbacks>(),
        8usize,
        concat!("Alignment of ", stringify!(PanReplySelCallbacks))
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).path) as usize - ptr as usize },
        0usize,
        concat!(
            "Offset of field: ",
            stringify!(PanReplySelCallbacks),
            "::",
            stringify!(path)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).initialize) as usize - ptr as usize },
        8usize,
        concat!(
            "Offset of field: ",
            stringify!(PanReplySelCallbacks),
            "::",
            stringify!(initialize)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).record) as usize - ptr as usize },
        16usize,
        concat!(
            "Offset of field: ",
            stringify!(PanReplySelCallbacks),
            "::",
            stringify!(record)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).pathDown) as usize - ptr as usize },
        24usize,
        concat!(
            "Offset of field: ",
            stringify!(PanReplySelCallbacks),
            "::",
            stringify!(pathDown)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).close) as usize - ptr as usize },
        32usize,
        concat!(
            "Offset of field: ",
            stringify!(PanReplySelCallbacks),
            "::",
            stringify!(close)
        )
    );
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct _GoString_ {
    pub p: *const ::std::os::raw::c_char,
    pub n: isize,
}
#[test]
fn bindgen_test_layout__GoString_() {
    const UNINIT: ::std::mem::MaybeUninit<_GoString_> = ::std::mem::MaybeUninit::uninit();
    let ptr = UNINIT.as_ptr();
    assert_eq!(
        ::std::mem::size_of::<_GoString_>(),
        16usize,
        concat!("Size of: ", stringify!(_GoString_))
    );
    assert_eq!(
        ::std::mem::align_of::<_GoString_>(),
        8usize,
        concat!("Alignment of ", stringify!(_GoString_))
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).p) as usize - ptr as usize },
        0usize,
        concat!(
            "Offset of field: ",
            stringify!(_GoString_),
            "::",
            stringify!(p)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).n) as usize - ptr as usize },
        8usize,
        concat!(
            "Offset of field: ",
            stringify!(_GoString_),
            "::",
            stringify!(n)
        )
    );
}
pub type GoInt8 = ::std::os::raw::c_schar;
pub type GoUint8 = ::std::os::raw::c_uchar;
pub type GoInt16 = ::std::os::raw::c_short;
pub type GoUint16 = ::std::os::raw::c_ushort;
pub type GoInt32 = ::std::os::raw::c_int;
pub type GoUint32 = ::std::os::raw::c_uint;
pub type GoInt64 = ::std::os::raw::c_longlong;
pub type GoUint64 = ::std::os::raw::c_ulonglong;
pub type GoInt = GoInt64;
pub type GoUint = GoUint64;
pub type GoUintptr = usize;
pub type GoFloat32 = f32;
pub type GoFloat64 = f64;
pub type GoComplex64 = __BindgenComplex<f32>;
pub type GoComplex128 = __BindgenComplex<f64>;
pub type _check_for_64_bit_pointer_matching_GoInt = [::std::os::raw::c_char; 1usize];
pub type GoString = _GoString_;
pub type GoMap = *mut ::std::os::raw::c_void;
pub type GoChan = *mut ::std::os::raw::c_void;
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct GoInterface {
    pub t: *mut ::std::os::raw::c_void,
    pub v: *mut ::std::os::raw::c_void,
}
#[test]
fn bindgen_test_layout_GoInterface() {
    const UNINIT: ::std::mem::MaybeUninit<GoInterface> = ::std::mem::MaybeUninit::uninit();
    let ptr = UNINIT.as_ptr();
    assert_eq!(
        ::std::mem::size_of::<GoInterface>(),
        16usize,
        concat!("Size of: ", stringify!(GoInterface))
    );
    assert_eq!(
        ::std::mem::align_of::<GoInterface>(),
        8usize,
        concat!("Alignment of ", stringify!(GoInterface))
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).t) as usize - ptr as usize },
        0usize,
        concat!(
            "Offset of field: ",
            stringify!(GoInterface),
            "::",
            stringify!(t)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).v) as usize - ptr as usize },
        8usize,
        concat!(
            "Offset of field: ",
            stringify!(GoInterface),
            "::",
            stringify!(v)
        )
    );
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct GoSlice {
    pub data: *mut ::std::os::raw::c_void,
    pub len: GoInt,
    pub cap: GoInt,
}
#[test]
fn bindgen_test_layout_GoSlice() {
    const UNINIT: ::std::mem::MaybeUninit<GoSlice> = ::std::mem::MaybeUninit::uninit();
    let ptr = UNINIT.as_ptr();
    assert_eq!(
        ::std::mem::size_of::<GoSlice>(),
        24usize,
        concat!("Size of: ", stringify!(GoSlice))
    );
    assert_eq!(
        ::std::mem::align_of::<GoSlice>(),
        8usize,
        concat!("Alignment of ", stringify!(GoSlice))
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).data) as usize - ptr as usize },
        0usize,
        concat!(
            "Offset of field: ",
            stringify!(GoSlice),
            "::",
            stringify!(data)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).len) as usize - ptr as usize },
        8usize,
        concat!(
            "Offset of field: ",
            stringify!(GoSlice),
            "::",
            stringify!(len)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).cap) as usize - ptr as usize },
        16usize,
        concat!(
            "Offset of field: ",
            stringify!(GoSlice),
            "::",
            stringify!(cap)
        )
    );
}
extern "C" {
    #[doc = "\\brief Duplicate a cgo handle.\n\\ingroup handle"]
    pub fn PanDuplicateHandle(handle: usize) -> usize;
}
extern "C" {
    #[doc = "\\brief Delete a handle obtained from cgo.\n\\ingroup handle"]
    pub fn PanDeleteHandle(handle: usize);
}
extern "C" {
    #[doc = "\\brief Wrapper for `pan.ResolveUDPAddr`\nA handle to the resolved address is returned in `resolved`.\n\\attention deprecated in favour of PanResolveUDPAddrN\nReason:\tconversion of C to Go string with func C.GoString(p *_Ctype_char) string\nhas been repeatedly found to be unreliable and cause bugs.\n\\ingroup addresses"]
    pub fn PanResolveUDPAddr(
        address: *const ::std::os::raw::c_char,
        resolved: *mut PanUDPAddr,
    ) -> PanError;
}
extern "C" {
    pub fn PanResolveUDPAddrN(
        address: *const ::std::os::raw::c_char,
        len: ::std::os::raw::c_int,
        resolved: *mut PanUDPAddr,
    ) -> PanError;
}
extern "C" {
    #[doc = "\\brief Create a PanUDPAddr from ISD, ASN, IP and UDP port.\n\\param[in] ia Pointer to the ISD and AS number packed as 8 bytes in big-endian\nbyte order. Must not be NULL.\n\\param[in] ip Pointer to the IP address in big-endian byte order. Must not be\nNULL.\n\\param[in] ip_len Length of the IP address in bytes. Must be 4 or 16.\n\\param[in] port UDP port number\n\\return UDPAddr handle. A null handle is returned if \\p ip_len is not 4 or 16.\n\\ingroup addresses"]
    pub fn PanUDPAddrNew(
        ia: *const ::std::os::raw::c_ulong,
        ip: *const ::std::os::raw::c_uchar,
        ip_len: ::std::os::raw::c_int,
        port: u16,
    ) -> PanUDPAddr;
}
extern "C" {
    #[doc = "\\brief Get the ISD (2 bytes) and ASN (6 bytes) of the address.\n\\param[out] Pointer to 8 bytes that will receive the ISD and AS number in\nbig-endian byte order. Function is a no-op if this is `NULL`.\n\\ingroup addresses"]
    pub fn PanUDPAddrGetIA(addr: PanUDPAddr, ia: *mut u64);
}
extern "C" {
    #[doc = "\\brief Returns whether the IP-part of the address is IPv6 (including mapped IPv4\naddresses).\n\\return `0` for IPv4 addresses, non-zero otherwise.\n\\ingroup addresses"]
    pub fn PanUDPAddrIsIPv6(addr: PanUDPAddr) -> ::std::os::raw::c_int;
}
extern "C" {
    #[doc = "\\brief Get the IP part of the address. Fails if the address is not an IPv4\nor IPv4-in-IPv6 address.\n\\param[out] ipv4 Pointer to a 4-byte array that will receive the IP address.\nFunction is a no-op if this is `NULL`.\n\\return `PAN_ERR_OK` if no error occurred.\n`PAN_ERR_FAILED` if the address cannot be represented in 4 bytes.\n\\ingroup addresses"]
    pub fn PanUDPAddrGetIPv4(addr: PanUDPAddr, ip4: *mut u8) -> PanError;
}
extern "C" {
    #[doc = "\\brief Get the IP part of the address. IPv4 addresses are returned in\nIPv6-mapped form.\n\\param[out] ipv6 Pointer to a 16-byte array that will receive the IP address.\nFunction is a no-op if this is `NULL`.\n\\return `PAN_ERR_OK` if no error occurred.\n\\ingroup addresses"]
    pub fn PanUDPAddrGetIPv6(addr: PanUDPAddr, ip6: *mut u8) -> PanError;
}
extern "C" {
    #[doc = "\\brief Get the UDP port as integer in host byte order.\n\\ingroup addresses"]
    pub fn PanUDPAddrGetPort(addr: PanUDPAddr) -> u16;
}
extern "C" {
    #[doc = "\\brief Returns a string representation of the given SCION address.\nThe returned string must be freed with free().\n\\ingroup addresses"]
    pub fn PanUDPAddrToString(addr: PanUDPAddr) -> *mut ::std::os::raw::c_char;
}
extern "C" {
    #[doc = "\\brief Return a string representing the path.\nThe returned string must be freed with free().\n\\ingroup path"]
    pub fn PanPathToString(path: PanPath) -> *mut ::std::os::raw::c_char;
}
extern "C" {
    #[doc = "\\brief Get the fingerprint of the path.\n\\ingroup path"]
    pub fn PanPathGetFingerprint(path: PanPath) -> PanPathFingerprint;
}
extern "C" {
    #[doc = "\\brief Check whether a path contains a certain AS interface.\n\\ingroup path"]
    pub fn PanPathContainsInterface(
        path: PanPath,
        iface: PanPathInterface,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    #[doc = "\\brief Check whether two path fingerprints compare equal.\n\\ingroup path_fingerprint"]
    pub fn PanPathFingerprintAreEqual(
        fp_a: PanPathFingerprint,
        fp_b: PanPathFingerprint,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    #[doc = "\\brief Create a new path policy from a filter function.\n\\param[in] filter Filter callback.\n\\param[in] user User data that will be passed to the callback.\n\\ingroup policy"]
    pub fn PanNewCPolicy(filter: PanPolicyFilterFn, user: usize) -> PanPolicy;
}
extern "C" {
    pub fn PanCPolicyTest(policy: PanPolicy);
}
extern "C" {
    #[doc = "\\brief Create a new path selector.\n\\param[in] callbacks Callbacks for the methods of the path selector.\n\\param[in] user User data that will be passed to the callback.\n\\ingroup selector"]
    pub fn PanNewCSelector(callbacks: *mut PanSelectorCallbacks, user: usize) -> PanSelector;
}
extern "C" {
    #[doc = "\\brief Create a new reply selector.\n\\param[in] callbacks Callbacks for the methods of the reply selector.\n\\param[in] user User data that will be passed to the callback.\n\\ingroup reply_selector"]
    pub fn PanNewCReplySelector(
        callbacks: *mut PanReplySelCallbacks,
        user: usize,
    ) -> PanReplySelector;
}
extern "C" {
    pub fn PanNewScionSocket(
        listen: *const ::std::os::raw::c_char,
        n: ::std::os::raw::c_int,
    ) -> PanScionSocket;
}
extern "C" {
    pub fn PanNewScionSocket2() -> PanScionSocket;
}
extern "C" {
    pub fn PanScionSocketBind(
        socket: PanScionSocket,
        listen: *const ::std::os::raw::c_char,
    ) -> PanError;
}
extern "C" {
    pub fn PanScionSocketGetLocalAddr(socket: PanScionSocket) -> *mut ::std::os::raw::c_char;
}
extern "C" {
    pub fn PanScionSocketReadFromAsync(
        conn: PanScionSocket,
        buffer: *mut ::std::os::raw::c_void,
        len: ::std::os::raw::c_int,
        from: *mut PanUDPAddr,
        n: *mut ::std::os::raw::c_int,
        timeout_duration: ::std::os::raw::c_int,
        waker: OnCompletionWaker,
        arc_conn: *mut ::std::os::raw::c_void,
    ) -> PanError;
}
extern "C" {
    pub fn PanScionSocketWriteToAsync(
        conn: PanScionSocket,
        buffer: *const ::std::os::raw::c_void,
        len: ::std::os::raw::c_int,
        to: PanUDPAddr,
        n: *mut ::std::os::raw::c_int,
        timeout: ::std::os::raw::c_int,
        waker: OnCompletionWaker,
        arc_conn: *mut ::std::os::raw::c_void,
    ) -> PanError;
}
extern "C" {
    pub fn PanScionSocketWriteToViaAsync(
        conn: PanScionSocket,
        buffer: *const ::std::os::raw::c_void,
        len: ::std::os::raw::c_int,
        to: PanUDPAddr,
        path: PanPath,
        n: *mut ::std::os::raw::c_int,
        timeout: ::std::os::raw::c_int,
        waker: OnCompletionWaker,
        arc_conn: *mut ::std::os::raw::c_void,
    ) -> PanError;
}
extern "C" {
    pub fn PanScionSocketReadFromAsyncVia(
        conn: PanScionSocket,
        buffer: *mut ::std::os::raw::c_void,
        len: ::std::os::raw::c_int,
        from: *mut PanUDPAddr,
        path: *mut PanPath,
        n: *mut ::std::os::raw::c_int,
        timeout_duration: ::std::os::raw::c_int,
        waker: OnCompletionWaker,
        arc_conn: *mut ::std::os::raw::c_void,
    ) -> PanError;
}
extern "C" {
    pub fn PanScionSocketClose(conn: PanScionSocket) -> PanError;
}
extern "C" {
    #[doc = "\\brief Wrapper for `(pan.ListenConn).SetDeadline`\n\\param[in] conn Connection to set the deadline on.\n\\param[in] t is the number milliseconds the deadline is set in the future.\n\\ingroup listen_conn"]
    pub fn PanScionSocketSetDeadline(conn: PanScionSocket, t: u32) -> PanError;
}
extern "C" {
    #[doc = "\\brief Wrapper for `(pan.ListenConn).SetReadDeadline`\n\\param[in] conn Connection to set the deadline on.\n\\param[in] t is the number milliseconds the deadline is set in the future.\n\\ingroup listen_conn"]
    pub fn PanScionSocketSetReadDeadline(conn: PanScionSocket, t: u32) -> PanError;
}
extern "C" {
    #[doc = "\\brief Wrapper for `(pan.ListenConn).SetWriteDeadline`\n\\param[in] conn Connection to set the deadline on.\n\\param[in] t is the number milliseconds the deadline is set in the future.\n\\ingroup listen_conn"]
    pub fn PanScionSocketSetWriteDeadline(conn: PanScionSocket, t: u32) -> PanError;
}
extern "C" {
    #[doc = "\\brief Open a UDP socket and listen for connections.\n\\param[in] listen is the local IP and port to listen on as a null-terminated\nstring (e.g., \"127.0.0.1:8000\").\n\\param[in] selector Reply path selector. May be a PAN_INVALID_HANDLE to use the\ndefault selector.\n\\param[out] conn The value pointed to by \\p conn receives the listening\nconnection handle if the call is successful.\n\\ingroup listen_conn\n\\return `PAN_ERR_OK` on success.\n`PAN_ERR_ADDR_SYNTAX` is the listen address has an invalid format.\n`PAN_ERR_FAILED` if binding and listening on the socket failed."]
    pub fn PanListenUDP(
        listen: *const ::std::os::raw::c_char,
        selector: PanReplySelector,
        conn: *mut PanListenConn,
    ) -> PanError;
}
extern "C" {
    #[doc = "\\brief Wrapper for `(pan.ListenConn).ReadFrom`\n\\param[in] conn Listening connection.\n\\param[in] buffer Pointer to a buffer that will receive the packet.\n\\param[in] len Size of \\p buffer in bytes.\n\\param[out] from Host from which data was received. Can be NULL to ignore.\n\\param[out] n Number of bytes read. Can be NULL to ignore.\n\\return `PAN_ERR_OK` on success.\n`PAN_ERR_DEADLINE` if the deadline was exceeded.\n`PAN_ERR_FAILED` if the operation failed.\n\\ingroup listen_conn"]
    pub fn PanListenConnReadFrom(
        conn: PanListenConn,
        buffer: *mut ::std::os::raw::c_void,
        len: ::std::os::raw::c_int,
        from: *mut PanUDPAddr,
        n: *mut ::std::os::raw::c_int,
    ) -> PanError;
}
extern "C" {
    #[doc = "\\brief Wrapper for `(pan.ListenConn).ReadFrom`\n\\param[in] conn Listening connection.\n\\param[in] buffer Pointer to a buffer that will receive the packet.\n\\param[in] len Size of \\p buffer in bytes.\n\\param[out] from Host from which data was received. Can be NULL to ignore.\n\\param[out] n Number of bytes read. Can be NULL to ignore.\n\\return `PAN_ERR_OK` on success.\n`PAN_ERR_DEADLINE` if the deadline was exceeded.\n`PAN_ERR_FAILED` if the operation failed.\n\\ingroup listen_conn"]
    pub fn PanListenConnReadFromAsync(
        conn: PanListenConn,
        buffer: *mut ::std::os::raw::c_void,
        len: ::std::os::raw::c_int,
        from: *mut PanUDPAddr,
        n: *mut ::std::os::raw::c_int,
        timeout_duration: ::std::os::raw::c_int,
        waker: OnCompletionWaker,
        arc_conn: *mut ::std::os::raw::c_void,
    ) -> PanError;
}
extern "C" {
    pub fn PanListenConnReadFromAsyncVia(
        conn: PanListenConn,
        buffer: *mut ::std::os::raw::c_void,
        len: ::std::os::raw::c_int,
        from: *mut PanUDPAddr,
        path: *mut PanPath,
        n: *mut ::std::os::raw::c_int,
        timeout_duration: ::std::os::raw::c_int,
        waker: OnCompletionWaker,
        arc_conn: *mut ::std::os::raw::c_void,
    ) -> PanError;
}
extern "C" {
    #[doc = "\\brief Wrapper for `(pan.ListenConn).ReadFromVia`\n\\param[in] conn Listening connection.\n\\param[in] buffer Pointer to a buffer that will receive the packet.\n\\param[in] len Size of \\p buffer in bytes.\n\\param[out] from Host from which data was received. Can be NULL to ignore.\n\\param[out] path Path of the received packet. Can be NULL to ignore.\n\\param[out] n Number of bytes read. Can be NULL to ignore.\n\\return `PAN_ERR_OK` on success.\n`PAN_ERR_DEADLINE` if the deadline was exceeded.\n`PAN_ERR_FAILED` if the operation failed.\n\\ingroup listen_conn"]
    pub fn PanListenConnReadFromVia(
        conn: PanListenConn,
        buffer: *mut ::std::os::raw::c_void,
        len: ::std::os::raw::c_int,
        from: *mut PanUDPAddr,
        path: *mut PanPath,
        n: *mut ::std::os::raw::c_int,
    ) -> PanError;
}
extern "C" {
    #[doc = "\\briefWrapper for `(pan.ListenConn).WriteTo`\n\\param[in] conn Listening connection.\n\\param[in] buffer Pointer to a buffer containing the message.\n\\param[in] len Length of the message in \\p buffer in bytes.\n\\param[in] to Destination address.\n\\param[out] n Number of bytes written. Can be NULL to ignore.\n\\return `PAN_ERR_OK` on success.\n`PAN_ERR_DEADLINE` if the deadline was exceeded.\n`PAN_ERR_NO_PATH` if no path to the destination is known.\n`PAN_ERR_FAILED` if the operation failed in some other way.\n\\ingroup listen_conn"]
    pub fn PanListenConnWriteTo(
        conn: PanListenConn,
        buffer: *const ::std::os::raw::c_void,
        len: ::std::os::raw::c_int,
        to: PanUDPAddr,
        n: *mut ::std::os::raw::c_int,
    ) -> PanError;
}
extern "C" {
    pub fn PanListenConnWriteToAsync(
        conn: PanListenConn,
        buffer: *const ::std::os::raw::c_void,
        len: ::std::os::raw::c_int,
        to: PanUDPAddr,
        n: *mut ::std::os::raw::c_int,
        timeout: ::std::os::raw::c_int,
        waker: OnCompletionWaker,
        arc_conn: *mut ::std::os::raw::c_void,
    ) -> PanError;
}
extern "C" {
    pub fn PanListenConnWriteToViaAsync(
        conn: PanListenConn,
        buffer: *const ::std::os::raw::c_void,
        len: ::std::os::raw::c_int,
        to: PanUDPAddr,
        path: PanPath,
        n: *mut ::std::os::raw::c_int,
        timeout: ::std::os::raw::c_int,
        waker: OnCompletionWaker,
        arc_conn: *mut ::std::os::raw::c_void,
    ) -> PanError;
}
extern "C" {
    #[doc = "\\brief Wrapper for `(pan.ListenConn).WriteToVia`\n\\param[in] conn Listening connection.\n\\param[in] buffer Pointer to a buffer containing the message.\n\\param[in] len Length of the message in \\p buffer in bytes.\n\\param[in] to Destination address.\n\\param[in] path Path to take to the destination.\n\\param[out] n Number of bytes written. Can be NULL to ignore.\n\\return `PAN_ERR_OK` on success.\n`PAN_ERR_DEADLINE` if the deadline was exceeded.\n`PAN_ERR_FAILED` if the operation failed.\n\\ingroup listen_conn"]
    pub fn PanListenConnWriteToVia(
        conn: PanListenConn,
        buffer: *const ::std::os::raw::c_void,
        len: ::std::os::raw::c_int,
        to: PanUDPAddr,
        path: PanPath,
        n: *mut ::std::os::raw::c_int,
    ) -> PanError;
}
extern "C" {
    #[doc = "\\brief Wrapper for `(pan.ListenConn).LocalAddr`\n\\ingroup listen_conn"]
    pub fn PanListenConnLocalAddr(conn: PanListenConn) -> PanUDPAddr;
}
extern "C" {
    #[doc = "\\brief Wrapper for `(pan.ListenConn).SetDeadline`\n\\param[in] conn Connection to set the deadline on.\n\\param[in] t is the number milliseconds the deadline is set in the future.\n\\ingroup listen_conn"]
    pub fn PanListenConnSetDeadline(conn: PanListenConn, t: u32) -> PanError;
}
extern "C" {
    #[doc = "\\brief Wrapper for `(pan.ListenConn).SetReadDeadline`\n\\param[in] conn Connection to set the deadline on.\n\\param[in] t is the number milliseconds the deadline is set in the future.\n\\ingroup listen_conn"]
    pub fn PanListenConnSetReadDeadline(conn: PanListenConn, t: u32) -> PanError;
}
extern "C" {
    #[doc = "\\brief Wrapper for `(pan.ListenConn).SetWriteDeadline`\n\\param[in] conn Connection to set the deadline on.\n\\param[in] t is the number milliseconds the deadline is set in the future.\n\\ingroup listen_conn"]
    pub fn PanListenConnSetWriteDeadline(conn: PanListenConn, t: u32) -> PanError;
}
extern "C" {
    #[doc = "\\brief Close a listening socket. The handle must still be deleted with\nPanDeleteHandle().\n\\ingroup listen_conn"]
    pub fn PanListenConnClose(conn: PanListenConn) -> PanError;
}
extern "C" {
    #[doc = "\\brief Wrapper for `pan.DialUDP`\n\\param[in] local is the local IP and port as string. Can be NULL to automatically\nchoose.\n\\param[in] remote is the SCION address of the remote host.\n\\param[in] policy Path policy. May be a PAN_INVALID_HANDLE to use the default\npolicy.\n\\param[in] selector Path selector. May be a PAN_INVALID_HANDLE to use the\ndefault selector.\n\\param[out] conn The value pointed to by \\p conn receives the connection handle\nif the call is successful.\n\\return `PAN_ERR_OK` on success.\n`PAN_ERR_ADDR_SYNTAX` is the local address has an invalid format.\n`PAN_ERR_FAILED` if dialing failed.\n\\ingroup conn"]
    pub fn PanDialUDP(
        local: *const ::std::os::raw::c_char,
        remote: PanUDPAddr,
        policy: PanPolicy,
        selector: PanSelector,
        conn: *mut PanConn,
    ) -> PanError;
}
extern "C" {
    #[doc = "\\brief Wrapper for `(pan.Conn).Read`\n\\param[in] conn Connection\n\\param[in] buffer Pointer to a buffer that will receive the packet.\n\\param[in] len Size of \\p buffer in bytes.\n\\param[out] n Number of bytes read. Can be NULL to ignore.\n\\return `PAN_ERR_OK` on success.\n`PAN_ERR_DEADLINE` if the deadline was exceeded.\n`PAN_ERR_FAILED` if the operation failed.\n\\ingroup conn"]
    pub fn PanConnRead(
        conn: PanConn,
        buffer: *mut ::std::os::raw::c_void,
        len: ::std::os::raw::c_int,
        n: *mut ::std::os::raw::c_int,
    ) -> PanError;
}
extern "C" {
    #[doc = "\\brief Wrapper for `(pan.Conn).ReadVia`\n\\param[in] conn Connection\n\\param[in] buffer Pointer to a buffer that will receive the packet.\n\\param[in] len Size of \\p buffer in bytes.\n\\param[out] path Path of the received packet. Can be NULL to ignore.\n\\param[out] n Number of bytes read. Can be NULL to ignore.\n\\return `PAN_ERR_OK` on success.\n`PAN_ERR_DEADLINE` if the deadline was exceeded.\n`PAN_ERR_FAILED` if the operation failed.\n\\ingroup conn"]
    pub fn PanConnReadVia(
        conn: PanConn,
        buffer: *mut ::std::os::raw::c_void,
        len: ::std::os::raw::c_int,
        path: *mut PanPath,
        n: *mut ::std::os::raw::c_int,
    ) -> PanError;
}
extern "C" {
    pub fn PanConnReadViaAsync(
        conn: PanConn,
        buffer: *mut ::std::os::raw::c_void,
        len: ::std::os::raw::c_int,
        path: *mut PanPath,
        n: *mut ::std::os::raw::c_int,
        timeout: ::std::os::raw::c_int,
        waker: OnCompletionWaker,
        arc_conn: *mut ::std::os::raw::c_void,
    ) -> PanError;
}
extern "C" {
    #[doc = "\\brief Wrapper for `(pan.Conn).Write`\n\\param[in] conn Connection\n\\param[in] buffer Pointer to a buffer containing the message.\n\\param[in] len Length of the message in \\p buffer in bytes.\n\\param[out] n Number of bytes written. Can be NULL to ignore.\n\\return `PAN_ERR_OK` on success.\n`PAN_ERR_DEADLINE` if the deadline was exceeded.\n`PAN_ERR_NO_PATH` if no path to the destination is known.\n`PAN_ERR_FAILED` if the operation failed in some other way.\n\\ingroup conn"]
    pub fn PanConnWrite(
        conn: PanListenConn,
        buffer: *const ::std::os::raw::c_void,
        len: ::std::os::raw::c_int,
        n: *mut ::std::os::raw::c_int,
    ) -> PanError;
}
extern "C" {
    pub fn PanConnWriteAsync(
        conn: PanListenConn,
        buffer: *const ::std::os::raw::c_void,
        len: ::std::os::raw::c_int,
        n: *mut ::std::os::raw::c_int,
        timeout: ::std::os::raw::c_int,
        waker: OnCompletionWaker,
        arc_conn: *mut ::std::os::raw::c_void,
    ) -> PanError;
}
extern "C" {
    pub fn GetLocalIA(do_panic: GoUint8) -> GoUint64;
}
extern "C" {
    #[doc = "\\brief Wrapper for `(pan.Conn).WriteVia`\n\\param[in] conn Connection\n\\param[in] buffer Pointer to a buffer containing the message.\n\\param[in] len Length of the message in \\p buffer in bytes.\n\\param[in] path Path to take to the destination.\n\\param[out] n Number of bytes written. Can be NULL to ignore.\n\\return `PAN_ERR_OK` on success.\n`PAN_ERR_DEADLINE` if the deadline was exceeded.\n`PAN_ERR_FAILED` if the operation failed.\n\\ingroup conn"]
    pub fn PanConnWriteVia(
        conn: PanListenConn,
        buffer: *const ::std::os::raw::c_void,
        len: ::std::os::raw::c_int,
        path: PanPath,
        n: *mut ::std::os::raw::c_int,
    ) -> PanError;
}
extern "C" {
    pub fn PanConnWriteViaAsync(
        conn: PanListenConn,
        buffer: *const ::std::os::raw::c_void,
        len: ::std::os::raw::c_int,
        path: PanPath,
        n: *mut ::std::os::raw::c_int,
        timeout: ::std::os::raw::c_int,
        waker: OnCompletionWaker,
        arc_conn: *mut ::std::os::raw::c_void,
    ) -> PanError;
}
extern "C" {
    #[doc = "\\brief Wrapper for (pan.Conn).LocalAddr\n\\ingroup conn"]
    pub fn PanConnLocalAddr(conn: PanConn) -> PanUDPAddr;
}
extern "C" {
    #[doc = "\\brief Wrapper for `(pan.Conn).RemoteAddr`\n\\ingroup conn"]
    pub fn PanConnRemoteAddr(conn: PanConn) -> PanUDPAddr;
}
extern "C" {
    #[doc = "\\brief Wrapper for `(pan.Conn).SetDeadline`\n\\param[in] conn Connection to set the deadline on.\n\\param[in] t is the number milliseconds the deadline is set in the future.\n\\ingroup conn"]
    pub fn PanConnSetDeadline(conn: PanConn, t: u32) -> PanError;
}
extern "C" {
    #[doc = "\\brief Wrapper for `(pan.Conn).SetReadDeadline`\n\\param[in] conn Connection to set the deadline on.\n\\param[in] t is the number milliseconds the deadline is set in the future.\n\\ingroup conn"]
    pub fn PanConnSetReadDeadline(conn: PanConn, t: u32) -> PanError;
}
extern "C" {
    #[doc = "\\brief Wrapper for `(pan.Conn).SetWriteDeadline`\n\\param[in] conn Connection to set the deadline on.\n\\param[in] t is the number milliseconds the deadline is set in the future.\n\\ingroup conn"]
    pub fn PanConnSetWriteDeadline(conn: PanConn, t: u32) -> PanError;
}
extern "C" {
    #[doc = "\\brief Close a connection. The handle must still be deleted with\nPanDeleteHandle().\n\\ingroup conn"]
    pub fn PanConnClose(conn: PanConn) -> PanError;
}
extern "C" {
    #[doc = "\\brief Open a Unix datagram socket at `listen_addr` as proxy for `pan_conn` or scion_socket (any SocketLike type).\n\\attention deprecated in favour of PanNewListenSockAdapter2\nReason:\tconversion of C to Go string with func C.GoString(p *_Ctype_char) string has been repeatedly found to be unreliable and cause bugs.\nAll packets received by `pan_conn` are forwarded from `listen_addr` to `client_addr`.\nAll packets received from the Unix socket are forwarded to `pan_conn`.\nThe SCION address of the source or destination is prepended to the payload in a\n32 byte header:\n\\verbatim\nbyte 0       1       2       3       4       5       6       7\n+-------+-------+-------+-------+-------+-------+-------+-------+\n0 |    ISD (BE)   |                     ASN (BE)                  |\n+-------+-------+-------+-------+-------+-------+-------+-------+\n8 |    Host Addr. Length (LE)     |                               |\n+-------+-------+-------+-------+                               |\n16 |                         Host Address (BE)                     |\n+                               +-------+-------+-------+-------+\n24 |                               | UDP Port (LE) |       0       |\n+-------+-------+-------+-------+-------+-------+-------+-------+\nBE = big-endian\nLE = little-endian\n\\endverbatim\n\n\\param[in] pan_conn Listening PAN connection or ScionSocket (any type that implements SocketLike).\n\\param[in] listen_addr Local address of the socket in the file system.\nOn the 'FFI caller' side a unix domain socket must have been constructed an bound to this address\nbefore the adapter is constructed.\n\\param[in] client_addr Address of the other end of the connection in the C part\nof the program.\n\\param[out] adapter Socket adapter object.\n\\ingroup adapter"]
    pub fn PanNewListenSockAdapter(
        pan_conn: PanListenConn,
        listen_addr: *const ::std::os::raw::c_char,
        client_addr: *const ::std::os::raw::c_char,
        adapter: *mut PanListenSockAdapter,
    ) -> PanError;
}
extern "C" {
    pub fn PanNewListenSockAdapter2(
        pan_conn: PanListenConn,
        listen_addr: *const ::std::os::raw::c_char,
        len1: ::std::os::raw::c_int,
        client_addr: *const ::std::os::raw::c_char,
        len2: ::std::os::raw::c_int,
        adapter: *mut PanListenSockAdapter,
    ) -> PanError;
}
extern "C" {
    #[doc = "\\brief Close the Unix domain socket **and the PAN connection**.\n\\ingroup adapter"]
    pub fn PanListenSockAdapterClose(adapter: PanListenSockAdapter) -> PanError;
}
extern "C" {
    #[doc = "\\brief Open a Unix datagram socket at `listen_addr` as proxy for `pan_conn`.\n\nAll packets received by pan_conn are forwarded from `listen_addr` to `client_addr`.\nAll packets received from the unix socket are forwarded to `pan_conn`.\n\n\\param[in] pan_conn Connected PAN connection.\n\\param[in] listen_addr Local address of the unix socket in the file system.\n\\param[in] client_addr Address of the other end of the connection in the C part\nof the program.\n\\param[out] adapter Socket adapter object.\n\\ingroup adapter"]
    pub fn PanNewConnSockAdapter(
        pan_conn: PanConn,
        listen_addr: *const ::std::os::raw::c_char,
        client_addr: *const ::std::os::raw::c_char,
        adapter: *mut PanConnSockAdapter,
    ) -> PanError;
}
extern "C" {
    #[doc = "\\brief Close the Unix domain socket **and the PAN connection**.\n\\ingroup adapter"]
    pub fn PanConnSockAdapterClose(adapter: PanConnSockAdapter) -> PanError;
}
extern "C" {
    #[doc = "\\brief Open a Unix stream socket at `listen_addr` as proxy for `pan_conn` or 'scion_socket'(any SocketLike).\n\nBehaves identical to `PanNewListenSockAdapter` except that a stream socket is\nused instead of a datagram socket. Packet borders in the stream are determined\nby prepending a four byte message length (little endian) in front of every\npacket sent or received on the Unix socket.\n\nWhen initially created, the socket will listens for and accept exactly one\nconnection.\n\nThe stream variants of the socket adapters are intended for systems lacking\nsupport for Unix datagram sockets, e.g., Windows. A more native solution on\nWindows might be named pipes, however they have a very different API from\nsockets.\n\n\\param[in] pan_conn Listening PAN connection.\n\\param[in] listen_addr Local address of the socket in the file system.\n\\param[out] adapter Socket adapter object.\n\\ingroup adapter"]
    pub fn PanNewListenSSockAdapter(
        pan_conn: PanListenConn,
        listen_addr: *const ::std::os::raw::c_char,
        adapter: *mut PanListenSSockAdapter,
    ) -> PanError;
}
extern "C" {
    #[doc = "\\brief Close the Unix domain socket **and the PAN connection**.\n\\ingroup adapter"]
    pub fn PanListenSSockAdapterClose(adapter: PanListenSSockAdapter) -> PanError;
}
extern "C" {
    #[doc = "\\brief Open a Unix stream socket at `listen_addr` as proxy for `pan_conn`.\n\nBehaves identical to `PanNewConnSockAdapter` except that a stream socket is\nused instead of a datagram socket. Packet borders in the stream are determined\nby prepending a four byte message length (little endian) in front of every\npacket sent or received on the Unix socket.\n\nWhen initially created, the socket will listens for and accept exactly one\nconnection.\n\nThe stream variants of the socket adapters are intended for systems lacking\nsupport for Unix datagram sockets, e.g., Windows. A more native solution on\nWindows might be named pipes, however they have a very different API from\nsockets.\n\n\\param[in] pan_conn Connected PAN connection.\n\\param[in] listen_addr Local address of the Unix socket in the file system.\n\\param[out] adapter Socket adapter object.\n\\ingroup adapter"]
    pub fn PanNewConnSSockAdapter(
        pan_conn: PanConn,
        listen_addr: *const ::std::os::raw::c_char,
        adapter: *mut PanConnSSockAdapter,
    ) -> PanError;
}
extern "C" {
    #[doc = "\\brief Close the Unix domain socket **and the PAN connection**.\n\\ingroup adapter"]
    pub fn PanConnSSockAdapterClose(adapter: PanConnSSockAdapter) -> PanError;
}