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
/* automatically generated by rust-bindgen 0.59.1 */

pub type __uint8_t = ::std::os::raw::c_uchar;
pub type __uint16_t = ::std::os::raw::c_ushort;
pub type __uint32_t = ::std::os::raw::c_uint;
pub type __int64_t = ::std::os::raw::c_longlong;
pub type __uint64_t = ::std::os::raw::c_ulonglong;
pub type sa_family_t = ::std::os::raw::c_ushort;
#[repr(C)]
#[derive(Debug, Default, Copy, Clone)]
pub struct sockaddr {
    pub sa_family: sa_family_t,
    pub sa_data: [::std::os::raw::c_char; 14usize],
}
#[test]
fn bindgen_test_layout_sockaddr() {
    assert_eq!(
        ::std::mem::size_of::<sockaddr>(),
        16usize,
        concat!("Size of: ", stringify!(sockaddr))
    );
    assert_eq!(
        ::std::mem::align_of::<sockaddr>(),
        2usize,
        concat!("Alignment of ", stringify!(sockaddr))
    );
    assert_eq!(
        unsafe { &(*(::std::ptr::null::<sockaddr>())).sa_family as *const _ as usize },
        0usize,
        concat!(
            "Offset of field: ",
            stringify!(sockaddr),
            "::",
            stringify!(sa_family)
        )
    );
    assert_eq!(
        unsafe { &(*(::std::ptr::null::<sockaddr>())).sa_data as *const _ as usize },
        2usize,
        concat!(
            "Offset of field: ",
            stringify!(sockaddr),
            "::",
            stringify!(sa_data)
        )
    );
}
pub type in_addr_t = u32;
#[repr(C)]
#[derive(Debug, Default, Copy, Clone)]
pub struct in_addr {
    pub s_addr: in_addr_t,
}
#[test]
fn bindgen_test_layout_in_addr() {
    assert_eq!(
        ::std::mem::size_of::<in_addr>(),
        4usize,
        concat!("Size of: ", stringify!(in_addr))
    );
    assert_eq!(
        ::std::mem::align_of::<in_addr>(),
        4usize,
        concat!("Alignment of ", stringify!(in_addr))
    );
    assert_eq!(
        unsafe { &(*(::std::ptr::null::<in_addr>())).s_addr as *const _ as usize },
        0usize,
        concat!(
            "Offset of field: ",
            stringify!(in_addr),
            "::",
            stringify!(s_addr)
        )
    );
}
pub type in_port_t = u16;
#[repr(C)]
#[derive(Copy, Clone)]
pub struct in6_addr {
    pub __in6_u: in6_addr__bindgen_ty_1,
}
#[repr(C)]
#[derive(Copy, Clone)]
pub union in6_addr__bindgen_ty_1 {
    pub __u6_addr8: [u8; 16usize],
    pub __u6_addr16: [u16; 8usize],
    pub __u6_addr32: [u32; 4usize],
}
#[test]
fn bindgen_test_layout_in6_addr__bindgen_ty_1() {
    assert_eq!(
        ::std::mem::size_of::<in6_addr__bindgen_ty_1>(),
        16usize,
        concat!("Size of: ", stringify!(in6_addr__bindgen_ty_1))
    );
    assert_eq!(
        ::std::mem::align_of::<in6_addr__bindgen_ty_1>(),
        4usize,
        concat!("Alignment of ", stringify!(in6_addr__bindgen_ty_1))
    );
    assert_eq!(
        unsafe {
            &(*(::std::ptr::null::<in6_addr__bindgen_ty_1>())).__u6_addr8 as *const _ as usize
        },
        0usize,
        concat!(
            "Offset of field: ",
            stringify!(in6_addr__bindgen_ty_1),
            "::",
            stringify!(__u6_addr8)
        )
    );
    assert_eq!(
        unsafe {
            &(*(::std::ptr::null::<in6_addr__bindgen_ty_1>())).__u6_addr16 as *const _ as usize
        },
        0usize,
        concat!(
            "Offset of field: ",
            stringify!(in6_addr__bindgen_ty_1),
            "::",
            stringify!(__u6_addr16)
        )
    );
    assert_eq!(
        unsafe {
            &(*(::std::ptr::null::<in6_addr__bindgen_ty_1>())).__u6_addr32 as *const _ as usize
        },
        0usize,
        concat!(
            "Offset of field: ",
            stringify!(in6_addr__bindgen_ty_1),
            "::",
            stringify!(__u6_addr32)
        )
    );
}
impl Default for in6_addr__bindgen_ty_1 {
    fn default() -> Self {
        let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
        unsafe {
            ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
            s.assume_init()
        }
    }
}
impl ::std::fmt::Debug for in6_addr__bindgen_ty_1 {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        write!(f, "in6_addr__bindgen_ty_1 {{ union }}")
    }
}
#[test]
fn bindgen_test_layout_in6_addr() {
    assert_eq!(
        ::std::mem::size_of::<in6_addr>(),
        16usize,
        concat!("Size of: ", stringify!(in6_addr))
    );
    assert_eq!(
        ::std::mem::align_of::<in6_addr>(),
        4usize,
        concat!("Alignment of ", stringify!(in6_addr))
    );
    assert_eq!(
        unsafe { &(*(::std::ptr::null::<in6_addr>())).__in6_u as *const _ as usize },
        0usize,
        concat!(
            "Offset of field: ",
            stringify!(in6_addr),
            "::",
            stringify!(__in6_u)
        )
    );
}
impl Default for in6_addr {
    fn default() -> Self {
        let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
        unsafe {
            ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
            s.assume_init()
        }
    }
}
impl ::std::fmt::Debug for in6_addr {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        write!(f, "in6_addr {{ __in6_u: {:?} }}", self.__in6_u)
    }
}
#[repr(C)]
#[derive(Debug, Default, Copy, Clone)]
pub struct sockaddr_in {
    pub sin_family: sa_family_t,
    pub sin_port: in_port_t,
    pub sin_addr: in_addr,
    pub sin_zero: [::std::os::raw::c_uchar; 8usize],
}
#[test]
fn bindgen_test_layout_sockaddr_in() {
    assert_eq!(
        ::std::mem::size_of::<sockaddr_in>(),
        16usize,
        concat!("Size of: ", stringify!(sockaddr_in))
    );
    assert_eq!(
        ::std::mem::align_of::<sockaddr_in>(),
        4usize,
        concat!("Alignment of ", stringify!(sockaddr_in))
    );
    assert_eq!(
        unsafe { &(*(::std::ptr::null::<sockaddr_in>())).sin_family as *const _ as usize },
        0usize,
        concat!(
            "Offset of field: ",
            stringify!(sockaddr_in),
            "::",
            stringify!(sin_family)
        )
    );
    assert_eq!(
        unsafe { &(*(::std::ptr::null::<sockaddr_in>())).sin_port as *const _ as usize },
        2usize,
        concat!(
            "Offset of field: ",
            stringify!(sockaddr_in),
            "::",
            stringify!(sin_port)
        )
    );
    assert_eq!(
        unsafe { &(*(::std::ptr::null::<sockaddr_in>())).sin_addr as *const _ as usize },
        4usize,
        concat!(
            "Offset of field: ",
            stringify!(sockaddr_in),
            "::",
            stringify!(sin_addr)
        )
    );
    assert_eq!(
        unsafe { &(*(::std::ptr::null::<sockaddr_in>())).sin_zero as *const _ as usize },
        8usize,
        concat!(
            "Offset of field: ",
            stringify!(sockaddr_in),
            "::",
            stringify!(sin_zero)
        )
    );
}
#[repr(C)]
#[derive(Copy, Clone)]
pub struct sockaddr_in6 {
    pub sin6_family: sa_family_t,
    pub sin6_port: in_port_t,
    pub sin6_flowinfo: u32,
    pub sin6_addr: in6_addr,
    pub sin6_scope_id: u32,
}
#[test]
fn bindgen_test_layout_sockaddr_in6() {
    assert_eq!(
        ::std::mem::size_of::<sockaddr_in6>(),
        28usize,
        concat!("Size of: ", stringify!(sockaddr_in6))
    );
    assert_eq!(
        ::std::mem::align_of::<sockaddr_in6>(),
        4usize,
        concat!("Alignment of ", stringify!(sockaddr_in6))
    );
    assert_eq!(
        unsafe { &(*(::std::ptr::null::<sockaddr_in6>())).sin6_family as *const _ as usize },
        0usize,
        concat!(
            "Offset of field: ",
            stringify!(sockaddr_in6),
            "::",
            stringify!(sin6_family)
        )
    );
    assert_eq!(
        unsafe { &(*(::std::ptr::null::<sockaddr_in6>())).sin6_port as *const _ as usize },
        2usize,
        concat!(
            "Offset of field: ",
            stringify!(sockaddr_in6),
            "::",
            stringify!(sin6_port)
        )
    );
    assert_eq!(
        unsafe { &(*(::std::ptr::null::<sockaddr_in6>())).sin6_flowinfo as *const _ as usize },
        4usize,
        concat!(
            "Offset of field: ",
            stringify!(sockaddr_in6),
            "::",
            stringify!(sin6_flowinfo)
        )
    );
    assert_eq!(
        unsafe { &(*(::std::ptr::null::<sockaddr_in6>())).sin6_addr as *const _ as usize },
        8usize,
        concat!(
            "Offset of field: ",
            stringify!(sockaddr_in6),
            "::",
            stringify!(sin6_addr)
        )
    );
    assert_eq!(
        unsafe { &(*(::std::ptr::null::<sockaddr_in6>())).sin6_scope_id as *const _ as usize },
        24usize,
        concat!(
            "Offset of field: ",
            stringify!(sockaddr_in6),
            "::",
            stringify!(sin6_scope_id)
        )
    );
}
impl Default for sockaddr_in6 {
    fn default() -> Self {
        let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
        unsafe {
            ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
            s.assume_init()
        }
    }
}
impl ::std::fmt::Debug for sockaddr_in6 {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        write ! (f , "sockaddr_in6 {{ sin6_family: {:?}, sin6_port: {:?}, sin6_flowinfo: {:?}, sin6_addr: {:?}, sin6_scope_id: {:?} }}" , self . sin6_family , self . sin6_port , self . sin6_flowinfo , self . sin6_addr , self . sin6_scope_id)
    }
}
pub type wg_key = [u8; 32usize];
pub type wg_key_b64_string = [::std::os::raw::c_char; 45usize];
#[repr(C)]
#[derive(Debug, Default, Copy, Clone)]
pub struct timespec64 {
    pub tv_sec: i64,
    pub tv_nsec: i64,
}
#[test]
fn bindgen_test_layout_timespec64() {
    assert_eq!(
        ::std::mem::size_of::<timespec64>(),
        16usize,
        concat!("Size of: ", stringify!(timespec64))
    );
    assert_eq!(
        ::std::mem::align_of::<timespec64>(),
        4usize,
        concat!("Alignment of ", stringify!(timespec64))
    );
    assert_eq!(
        unsafe { &(*(::std::ptr::null::<timespec64>())).tv_sec as *const _ as usize },
        0usize,
        concat!(
            "Offset of field: ",
            stringify!(timespec64),
            "::",
            stringify!(tv_sec)
        )
    );
    assert_eq!(
        unsafe { &(*(::std::ptr::null::<timespec64>())).tv_nsec as *const _ as usize },
        8usize,
        concat!(
            "Offset of field: ",
            stringify!(timespec64),
            "::",
            stringify!(tv_nsec)
        )
    );
}
#[repr(C)]
#[derive(Copy, Clone)]
pub struct wg_allowedip {
    pub family: u16,
    pub __bindgen_anon_1: wg_allowedip__bindgen_ty_1,
    pub cidr: u8,
    pub next_allowedip: *mut wg_allowedip,
}
#[repr(C)]
#[derive(Copy, Clone)]
pub union wg_allowedip__bindgen_ty_1 {
    pub ip4: in_addr,
    pub ip6: in6_addr,
}
#[test]
fn bindgen_test_layout_wg_allowedip__bindgen_ty_1() {
    assert_eq!(
        ::std::mem::size_of::<wg_allowedip__bindgen_ty_1>(),
        16usize,
        concat!("Size of: ", stringify!(wg_allowedip__bindgen_ty_1))
    );
    assert_eq!(
        ::std::mem::align_of::<wg_allowedip__bindgen_ty_1>(),
        4usize,
        concat!("Alignment of ", stringify!(wg_allowedip__bindgen_ty_1))
    );
    assert_eq!(
        unsafe { &(*(::std::ptr::null::<wg_allowedip__bindgen_ty_1>())).ip4 as *const _ as usize },
        0usize,
        concat!(
            "Offset of field: ",
            stringify!(wg_allowedip__bindgen_ty_1),
            "::",
            stringify!(ip4)
        )
    );
    assert_eq!(
        unsafe { &(*(::std::ptr::null::<wg_allowedip__bindgen_ty_1>())).ip6 as *const _ as usize },
        0usize,
        concat!(
            "Offset of field: ",
            stringify!(wg_allowedip__bindgen_ty_1),
            "::",
            stringify!(ip6)
        )
    );
}
impl Default for wg_allowedip__bindgen_ty_1 {
    fn default() -> Self {
        let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
        unsafe {
            ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
            s.assume_init()
        }
    }
}
impl ::std::fmt::Debug for wg_allowedip__bindgen_ty_1 {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        write!(f, "wg_allowedip__bindgen_ty_1 {{ union }}")
    }
}
#[test]
fn bindgen_test_layout_wg_allowedip() {
    assert_eq!(
        ::std::mem::size_of::<wg_allowedip>(),
        28usize,
        concat!("Size of: ", stringify!(wg_allowedip))
    );
    assert_eq!(
        ::std::mem::align_of::<wg_allowedip>(),
        4usize,
        concat!("Alignment of ", stringify!(wg_allowedip))
    );
    assert_eq!(
        unsafe { &(*(::std::ptr::null::<wg_allowedip>())).family as *const _ as usize },
        0usize,
        concat!(
            "Offset of field: ",
            stringify!(wg_allowedip),
            "::",
            stringify!(family)
        )
    );
    assert_eq!(
        unsafe { &(*(::std::ptr::null::<wg_allowedip>())).cidr as *const _ as usize },
        20usize,
        concat!(
            "Offset of field: ",
            stringify!(wg_allowedip),
            "::",
            stringify!(cidr)
        )
    );
    assert_eq!(
        unsafe { &(*(::std::ptr::null::<wg_allowedip>())).next_allowedip as *const _ as usize },
        24usize,
        concat!(
            "Offset of field: ",
            stringify!(wg_allowedip),
            "::",
            stringify!(next_allowedip)
        )
    );
}
impl Default for wg_allowedip {
    fn default() -> Self {
        let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
        unsafe {
            ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
            s.assume_init()
        }
    }
}
impl ::std::fmt::Debug for wg_allowedip {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        write ! (f , "wg_allowedip {{ family: {:?}, __bindgen_anon_1: {:?}, cidr: {:?}, next_allowedip: {:?} }}" , self . family , self . __bindgen_anon_1 , self . cidr , self . next_allowedip)
    }
}
impl wg_peer_flags {
    pub const WGPEER_REMOVE_ME: wg_peer_flags = wg_peer_flags(1);
}
impl wg_peer_flags {
    pub const WGPEER_REPLACE_ALLOWEDIPS: wg_peer_flags = wg_peer_flags(2);
}
impl wg_peer_flags {
    pub const WGPEER_HAS_PUBLIC_KEY: wg_peer_flags = wg_peer_flags(4);
}
impl wg_peer_flags {
    pub const WGPEER_HAS_PRESHARED_KEY: wg_peer_flags = wg_peer_flags(8);
}
impl wg_peer_flags {
    pub const WGPEER_HAS_PERSISTENT_KEEPALIVE_INTERVAL: wg_peer_flags = wg_peer_flags(16);
}
impl ::std::ops::BitOr<wg_peer_flags> for wg_peer_flags {
    type Output = Self;
    #[inline]
    fn bitor(self, other: Self) -> Self {
        wg_peer_flags(self.0 | other.0)
    }
}
impl ::std::ops::BitOrAssign for wg_peer_flags {
    #[inline]
    fn bitor_assign(&mut self, rhs: wg_peer_flags) {
        self.0 |= rhs.0;
    }
}
impl ::std::ops::BitAnd<wg_peer_flags> for wg_peer_flags {
    type Output = Self;
    #[inline]
    fn bitand(self, other: Self) -> Self {
        wg_peer_flags(self.0 & other.0)
    }
}
impl ::std::ops::BitAndAssign for wg_peer_flags {
    #[inline]
    fn bitand_assign(&mut self, rhs: wg_peer_flags) {
        self.0 &= rhs.0;
    }
}
#[repr(transparent)]
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
pub struct wg_peer_flags(pub ::std::os::raw::c_uint);
#[repr(C)]
#[derive(Copy, Clone)]
pub struct wg_peer {
    pub flags: wg_peer_flags,
    pub public_key: wg_key,
    pub preshared_key: wg_key,
    pub endpoint: wg_peer__bindgen_ty_1,
    pub last_handshake_time: timespec64,
    pub rx_bytes: u64,
    pub tx_bytes: u64,
    pub persistent_keepalive_interval: u16,
    pub first_allowedip: *mut wg_allowedip,
    pub last_allowedip: *mut wg_allowedip,
    pub next_peer: *mut wg_peer,
}
#[repr(C)]
#[derive(Copy, Clone)]
pub union wg_peer__bindgen_ty_1 {
    pub addr: sockaddr,
    pub addr4: sockaddr_in,
    pub addr6: sockaddr_in6,
}
#[test]
fn bindgen_test_layout_wg_peer__bindgen_ty_1() {
    assert_eq!(
        ::std::mem::size_of::<wg_peer__bindgen_ty_1>(),
        28usize,
        concat!("Size of: ", stringify!(wg_peer__bindgen_ty_1))
    );
    assert_eq!(
        ::std::mem::align_of::<wg_peer__bindgen_ty_1>(),
        4usize,
        concat!("Alignment of ", stringify!(wg_peer__bindgen_ty_1))
    );
    assert_eq!(
        unsafe { &(*(::std::ptr::null::<wg_peer__bindgen_ty_1>())).addr as *const _ as usize },
        0usize,
        concat!(
            "Offset of field: ",
            stringify!(wg_peer__bindgen_ty_1),
            "::",
            stringify!(addr)
        )
    );
    assert_eq!(
        unsafe { &(*(::std::ptr::null::<wg_peer__bindgen_ty_1>())).addr4 as *const _ as usize },
        0usize,
        concat!(
            "Offset of field: ",
            stringify!(wg_peer__bindgen_ty_1),
            "::",
            stringify!(addr4)
        )
    );
    assert_eq!(
        unsafe { &(*(::std::ptr::null::<wg_peer__bindgen_ty_1>())).addr6 as *const _ as usize },
        0usize,
        concat!(
            "Offset of field: ",
            stringify!(wg_peer__bindgen_ty_1),
            "::",
            stringify!(addr6)
        )
    );
}
impl Default for wg_peer__bindgen_ty_1 {
    fn default() -> Self {
        let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
        unsafe {
            ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
            s.assume_init()
        }
    }
}
impl ::std::fmt::Debug for wg_peer__bindgen_ty_1 {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        write!(f, "wg_peer__bindgen_ty_1 {{ union }}")
    }
}
#[test]
fn bindgen_test_layout_wg_peer() {
    assert_eq!(
        ::std::mem::size_of::<wg_peer>(),
        144usize,
        concat!("Size of: ", stringify!(wg_peer))
    );
    assert_eq!(
        ::std::mem::align_of::<wg_peer>(),
        4usize,
        concat!("Alignment of ", stringify!(wg_peer))
    );
    assert_eq!(
        unsafe { &(*(::std::ptr::null::<wg_peer>())).flags as *const _ as usize },
        0usize,
        concat!(
            "Offset of field: ",
            stringify!(wg_peer),
            "::",
            stringify!(flags)
        )
    );
    assert_eq!(
        unsafe { &(*(::std::ptr::null::<wg_peer>())).public_key as *const _ as usize },
        4usize,
        concat!(
            "Offset of field: ",
            stringify!(wg_peer),
            "::",
            stringify!(public_key)
        )
    );
    assert_eq!(
        unsafe { &(*(::std::ptr::null::<wg_peer>())).preshared_key as *const _ as usize },
        36usize,
        concat!(
            "Offset of field: ",
            stringify!(wg_peer),
            "::",
            stringify!(preshared_key)
        )
    );
    assert_eq!(
        unsafe { &(*(::std::ptr::null::<wg_peer>())).endpoint as *const _ as usize },
        68usize,
        concat!(
            "Offset of field: ",
            stringify!(wg_peer),
            "::",
            stringify!(endpoint)
        )
    );
    assert_eq!(
        unsafe { &(*(::std::ptr::null::<wg_peer>())).last_handshake_time as *const _ as usize },
        96usize,
        concat!(
            "Offset of field: ",
            stringify!(wg_peer),
            "::",
            stringify!(last_handshake_time)
        )
    );
    assert_eq!(
        unsafe { &(*(::std::ptr::null::<wg_peer>())).rx_bytes as *const _ as usize },
        112usize,
        concat!(
            "Offset of field: ",
            stringify!(wg_peer),
            "::",
            stringify!(rx_bytes)
        )
    );
    assert_eq!(
        unsafe { &(*(::std::ptr::null::<wg_peer>())).tx_bytes as *const _ as usize },
        120usize,
        concat!(
            "Offset of field: ",
            stringify!(wg_peer),
            "::",
            stringify!(tx_bytes)
        )
    );
    assert_eq!(
        unsafe {
            &(*(::std::ptr::null::<wg_peer>())).persistent_keepalive_interval as *const _ as usize
        },
        128usize,
        concat!(
            "Offset of field: ",
            stringify!(wg_peer),
            "::",
            stringify!(persistent_keepalive_interval)
        )
    );
    assert_eq!(
        unsafe { &(*(::std::ptr::null::<wg_peer>())).first_allowedip as *const _ as usize },
        132usize,
        concat!(
            "Offset of field: ",
            stringify!(wg_peer),
            "::",
            stringify!(first_allowedip)
        )
    );
    assert_eq!(
        unsafe { &(*(::std::ptr::null::<wg_peer>())).last_allowedip as *const _ as usize },
        136usize,
        concat!(
            "Offset of field: ",
            stringify!(wg_peer),
            "::",
            stringify!(last_allowedip)
        )
    );
    assert_eq!(
        unsafe { &(*(::std::ptr::null::<wg_peer>())).next_peer as *const _ as usize },
        140usize,
        concat!(
            "Offset of field: ",
            stringify!(wg_peer),
            "::",
            stringify!(next_peer)
        )
    );
}
impl Default for wg_peer {
    fn default() -> Self {
        let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
        unsafe {
            ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
            s.assume_init()
        }
    }
}
impl ::std::fmt::Debug for wg_peer {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        write ! (f , "wg_peer {{ flags: {:?}, public_key: [{}], preshared_key: [{}], endpoint: {:?}, last_handshake_time: {:?}, rx_bytes: {:?}, tx_bytes: {:?}, persistent_keepalive_interval: {:?}, first_allowedip: {:?}, last_allowedip: {:?}, next_peer: {:?} }}" , self . flags , self . public_key . iter () . enumerate () . map (| (i , v) | format ! ("{}{:?}" , if i > 0 { ", " } else { "" } , v)) . collect :: < String > () , self . preshared_key . iter () . enumerate () . map (| (i , v) | format ! ("{}{:?}" , if i > 0 { ", " } else { "" } , v)) . collect :: < String > () , self . endpoint , self . last_handshake_time , self . rx_bytes , self . tx_bytes , self . persistent_keepalive_interval , self . first_allowedip , self . last_allowedip , self . next_peer)
    }
}
impl wg_device_flags {
    pub const WGDEVICE_REPLACE_PEERS: wg_device_flags = wg_device_flags(1);
}
impl wg_device_flags {
    pub const WGDEVICE_HAS_PRIVATE_KEY: wg_device_flags = wg_device_flags(2);
}
impl wg_device_flags {
    pub const WGDEVICE_HAS_PUBLIC_KEY: wg_device_flags = wg_device_flags(4);
}
impl wg_device_flags {
    pub const WGDEVICE_HAS_LISTEN_PORT: wg_device_flags = wg_device_flags(8);
}
impl wg_device_flags {
    pub const WGDEVICE_HAS_FWMARK: wg_device_flags = wg_device_flags(16);
}
impl ::std::ops::BitOr<wg_device_flags> for wg_device_flags {
    type Output = Self;
    #[inline]
    fn bitor(self, other: Self) -> Self {
        wg_device_flags(self.0 | other.0)
    }
}
impl ::std::ops::BitOrAssign for wg_device_flags {
    #[inline]
    fn bitor_assign(&mut self, rhs: wg_device_flags) {
        self.0 |= rhs.0;
    }
}
impl ::std::ops::BitAnd<wg_device_flags> for wg_device_flags {
    type Output = Self;
    #[inline]
    fn bitand(self, other: Self) -> Self {
        wg_device_flags(self.0 & other.0)
    }
}
impl ::std::ops::BitAndAssign for wg_device_flags {
    #[inline]
    fn bitand_assign(&mut self, rhs: wg_device_flags) {
        self.0 &= rhs.0;
    }
}
#[repr(transparent)]
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
pub struct wg_device_flags(pub ::std::os::raw::c_uint);
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct wg_device {
    pub name: [::std::os::raw::c_char; 16usize],
    pub ifindex: u32,
    pub flags: wg_device_flags,
    pub public_key: wg_key,
    pub private_key: wg_key,
    pub fwmark: u32,
    pub listen_port: u16,
    pub first_peer: *mut wg_peer,
    pub last_peer: *mut wg_peer,
}
#[test]
fn bindgen_test_layout_wg_device() {
    assert_eq!(
        ::std::mem::size_of::<wg_device>(),
        104usize,
        concat!("Size of: ", stringify!(wg_device))
    );
    assert_eq!(
        ::std::mem::align_of::<wg_device>(),
        4usize,
        concat!("Alignment of ", stringify!(wg_device))
    );
    assert_eq!(
        unsafe { &(*(::std::ptr::null::<wg_device>())).name as *const _ as usize },
        0usize,
        concat!(
            "Offset of field: ",
            stringify!(wg_device),
            "::",
            stringify!(name)
        )
    );
    assert_eq!(
        unsafe { &(*(::std::ptr::null::<wg_device>())).ifindex as *const _ as usize },
        16usize,
        concat!(
            "Offset of field: ",
            stringify!(wg_device),
            "::",
            stringify!(ifindex)
        )
    );
    assert_eq!(
        unsafe { &(*(::std::ptr::null::<wg_device>())).flags as *const _ as usize },
        20usize,
        concat!(
            "Offset of field: ",
            stringify!(wg_device),
            "::",
            stringify!(flags)
        )
    );
    assert_eq!(
        unsafe { &(*(::std::ptr::null::<wg_device>())).public_key as *const _ as usize },
        24usize,
        concat!(
            "Offset of field: ",
            stringify!(wg_device),
            "::",
            stringify!(public_key)
        )
    );
    assert_eq!(
        unsafe { &(*(::std::ptr::null::<wg_device>())).private_key as *const _ as usize },
        56usize,
        concat!(
            "Offset of field: ",
            stringify!(wg_device),
            "::",
            stringify!(private_key)
        )
    );
    assert_eq!(
        unsafe { &(*(::std::ptr::null::<wg_device>())).fwmark as *const _ as usize },
        88usize,
        concat!(
            "Offset of field: ",
            stringify!(wg_device),
            "::",
            stringify!(fwmark)
        )
    );
    assert_eq!(
        unsafe { &(*(::std::ptr::null::<wg_device>())).listen_port as *const _ as usize },
        92usize,
        concat!(
            "Offset of field: ",
            stringify!(wg_device),
            "::",
            stringify!(listen_port)
        )
    );
    assert_eq!(
        unsafe { &(*(::std::ptr::null::<wg_device>())).first_peer as *const _ as usize },
        96usize,
        concat!(
            "Offset of field: ",
            stringify!(wg_device),
            "::",
            stringify!(first_peer)
        )
    );
    assert_eq!(
        unsafe { &(*(::std::ptr::null::<wg_device>())).last_peer as *const _ as usize },
        100usize,
        concat!(
            "Offset of field: ",
            stringify!(wg_device),
            "::",
            stringify!(last_peer)
        )
    );
}
impl Default for wg_device {
    fn default() -> Self {
        let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
        unsafe {
            ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
            s.assume_init()
        }
    }
}
extern "C" {
    pub fn wg_set_device(dev: *mut wg_device) -> ::std::os::raw::c_int;
}
extern "C" {
    pub fn wg_get_device(
        dev: *mut *mut wg_device,
        device_name: *const ::std::os::raw::c_char,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    pub fn wg_add_device(device_name: *const ::std::os::raw::c_char) -> ::std::os::raw::c_int;
}
extern "C" {
    pub fn wg_del_device(device_name: *const ::std::os::raw::c_char) -> ::std::os::raw::c_int;
}
extern "C" {
    pub fn wg_free_device(dev: *mut wg_device);
}
extern "C" {
    pub fn wg_list_device_names() -> *mut ::std::os::raw::c_char;
}
extern "C" {
    pub fn wg_key_to_base64(base64: *mut ::std::os::raw::c_char, key: *mut u8);
}
extern "C" {
    pub fn wg_key_from_base64(
        key: *mut u8,
        base64: *mut ::std::os::raw::c_char,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    pub fn wg_key_is_zero(key: *mut u8) -> bool;
}
extern "C" {
    pub fn wg_generate_public_key(public_key: *mut u8, private_key: *mut u8);
}
extern "C" {
    pub fn wg_generate_private_key(private_key: *mut u8);
}
extern "C" {
    pub fn wg_generate_preshared_key(preshared_key: *mut u8);
}