ktls_sys/
bindings.rs

1/* automatically generated by rust-bindgen 0.60.1 */
2
3#[repr(C)]
4#[derive(Default)]
5pub struct __IncompleteArrayField<T>(::std::marker::PhantomData<T>, [T; 0]);
6impl<T> __IncompleteArrayField<T> {
7    #[inline]
8    pub const fn new() -> Self {
9        __IncompleteArrayField(::std::marker::PhantomData, [])
10    }
11    #[inline]
12    pub fn as_ptr(&self) -> *const T {
13        self as *const _ as *const T
14    }
15    #[inline]
16    pub fn as_mut_ptr(&mut self) -> *mut T {
17        self as *mut _ as *mut T
18    }
19    #[inline]
20    pub unsafe fn as_slice(&self, len: usize) -> &[T] {
21        ::std::slice::from_raw_parts(self.as_ptr(), len)
22    }
23    #[inline]
24    pub unsafe fn as_mut_slice(&mut self, len: usize) -> &mut [T] {
25        ::std::slice::from_raw_parts_mut(self.as_mut_ptr(), len)
26    }
27}
28impl<T> ::std::fmt::Debug for __IncompleteArrayField<T> {
29    fn fmt(&self, fmt: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
30        fmt.write_str("__IncompleteArrayField")
31    }
32}
33pub const __BITS_PER_LONG: u32 = 64;
34pub const __FD_SETSIZE: u32 = 1024;
35pub const TLS_TX: u32 = 1;
36pub const TLS_RX: u32 = 2;
37pub const TLS_TX_ZEROCOPY_RO: u32 = 3;
38pub const TLS_RX_EXPECT_NO_PAD: u32 = 4;
39pub const TLS_1_2_VERSION_MAJOR: u32 = 3;
40pub const TLS_1_2_VERSION_MINOR: u32 = 3;
41pub const TLS_1_3_VERSION_MAJOR: u32 = 3;
42pub const TLS_1_3_VERSION_MINOR: u32 = 4;
43pub const TLS_CIPHER_AES_GCM_128: u32 = 51;
44pub const TLS_CIPHER_AES_GCM_128_IV_SIZE: u32 = 8;
45pub const TLS_CIPHER_AES_GCM_128_KEY_SIZE: u32 = 16;
46pub const TLS_CIPHER_AES_GCM_128_SALT_SIZE: u32 = 4;
47pub const TLS_CIPHER_AES_GCM_128_TAG_SIZE: u32 = 16;
48pub const TLS_CIPHER_AES_GCM_128_REC_SEQ_SIZE: u32 = 8;
49pub const TLS_CIPHER_AES_GCM_256: u32 = 52;
50pub const TLS_CIPHER_AES_GCM_256_IV_SIZE: u32 = 8;
51pub const TLS_CIPHER_AES_GCM_256_KEY_SIZE: u32 = 32;
52pub const TLS_CIPHER_AES_GCM_256_SALT_SIZE: u32 = 4;
53pub const TLS_CIPHER_AES_GCM_256_TAG_SIZE: u32 = 16;
54pub const TLS_CIPHER_AES_GCM_256_REC_SEQ_SIZE: u32 = 8;
55pub const TLS_CIPHER_AES_CCM_128: u32 = 53;
56pub const TLS_CIPHER_AES_CCM_128_IV_SIZE: u32 = 8;
57pub const TLS_CIPHER_AES_CCM_128_KEY_SIZE: u32 = 16;
58pub const TLS_CIPHER_AES_CCM_128_SALT_SIZE: u32 = 4;
59pub const TLS_CIPHER_AES_CCM_128_TAG_SIZE: u32 = 16;
60pub const TLS_CIPHER_AES_CCM_128_REC_SEQ_SIZE: u32 = 8;
61pub const TLS_CIPHER_CHACHA20_POLY1305: u32 = 54;
62pub const TLS_CIPHER_CHACHA20_POLY1305_IV_SIZE: u32 = 12;
63pub const TLS_CIPHER_CHACHA20_POLY1305_KEY_SIZE: u32 = 32;
64pub const TLS_CIPHER_CHACHA20_POLY1305_SALT_SIZE: u32 = 0;
65pub const TLS_CIPHER_CHACHA20_POLY1305_TAG_SIZE: u32 = 16;
66pub const TLS_CIPHER_CHACHA20_POLY1305_REC_SEQ_SIZE: u32 = 8;
67pub const TLS_CIPHER_SM4_GCM: u32 = 55;
68pub const TLS_CIPHER_SM4_GCM_IV_SIZE: u32 = 8;
69pub const TLS_CIPHER_SM4_GCM_KEY_SIZE: u32 = 16;
70pub const TLS_CIPHER_SM4_GCM_SALT_SIZE: u32 = 4;
71pub const TLS_CIPHER_SM4_GCM_TAG_SIZE: u32 = 16;
72pub const TLS_CIPHER_SM4_GCM_REC_SEQ_SIZE: u32 = 8;
73pub const TLS_CIPHER_SM4_CCM: u32 = 56;
74pub const TLS_CIPHER_SM4_CCM_IV_SIZE: u32 = 8;
75pub const TLS_CIPHER_SM4_CCM_KEY_SIZE: u32 = 16;
76pub const TLS_CIPHER_SM4_CCM_SALT_SIZE: u32 = 4;
77pub const TLS_CIPHER_SM4_CCM_TAG_SIZE: u32 = 16;
78pub const TLS_CIPHER_SM4_CCM_REC_SEQ_SIZE: u32 = 8;
79pub const TLS_SET_RECORD_TYPE: u32 = 1;
80pub const TLS_GET_RECORD_TYPE: u32 = 2;
81pub const TLS_CONF_BASE: u32 = 1;
82pub const TLS_CONF_SW: u32 = 2;
83pub const TLS_CONF_HW: u32 = 3;
84pub const TLS_CONF_HW_RECORD: u32 = 4;
85pub type __s8 = ::std::os::raw::c_schar;
86pub type __u8 = ::std::os::raw::c_uchar;
87pub type __s16 = ::std::os::raw::c_short;
88pub type __u16 = ::std::os::raw::c_ushort;
89pub type __s32 = ::std::os::raw::c_int;
90pub type __u32 = ::std::os::raw::c_uint;
91pub type __s64 = ::std::os::raw::c_longlong;
92pub type __u64 = ::std::os::raw::c_ulonglong;
93#[repr(C)]
94#[derive(Debug, Copy, Clone)]
95pub struct __kernel_fd_set {
96    pub fds_bits: [::std::os::raw::c_ulong; 16usize],
97}
98#[test]
99fn bindgen_test_layout___kernel_fd_set() {
100    assert_eq!(
101        ::std::mem::size_of::<__kernel_fd_set>(),
102        128usize,
103        concat!("Size of: ", stringify!(__kernel_fd_set))
104    );
105    assert_eq!(
106        ::std::mem::align_of::<__kernel_fd_set>(),
107        8usize,
108        concat!("Alignment of ", stringify!(__kernel_fd_set))
109    );
110    fn test_field_fds_bits() {
111        assert_eq!(
112            unsafe {
113                let uninit = ::std::mem::MaybeUninit::<__kernel_fd_set>::uninit();
114                let ptr = uninit.as_ptr();
115                ::std::ptr::addr_of!((*ptr).fds_bits) as usize - ptr as usize
116            },
117            0usize,
118            concat!(
119                "Offset of field: ",
120                stringify!(__kernel_fd_set),
121                "::",
122                stringify!(fds_bits)
123            )
124        );
125    }
126    test_field_fds_bits();
127}
128pub type __kernel_sighandler_t =
129    ::std::option::Option<unsafe extern "C" fn(arg1: ::std::os::raw::c_int)>;
130pub type __kernel_key_t = ::std::os::raw::c_int;
131pub type __kernel_mqd_t = ::std::os::raw::c_int;
132pub type __kernel_old_uid_t = ::std::os::raw::c_ushort;
133pub type __kernel_old_gid_t = ::std::os::raw::c_ushort;
134pub type __kernel_old_dev_t = ::std::os::raw::c_ulong;
135pub type __kernel_long_t = ::std::os::raw::c_long;
136pub type __kernel_ulong_t = ::std::os::raw::c_ulong;
137pub type __kernel_ino_t = __kernel_ulong_t;
138pub type __kernel_mode_t = ::std::os::raw::c_uint;
139pub type __kernel_pid_t = ::std::os::raw::c_int;
140pub type __kernel_ipc_pid_t = ::std::os::raw::c_int;
141pub type __kernel_uid_t = ::std::os::raw::c_uint;
142pub type __kernel_gid_t = ::std::os::raw::c_uint;
143pub type __kernel_suseconds_t = __kernel_long_t;
144pub type __kernel_daddr_t = ::std::os::raw::c_int;
145pub type __kernel_uid32_t = ::std::os::raw::c_uint;
146pub type __kernel_gid32_t = ::std::os::raw::c_uint;
147pub type __kernel_size_t = __kernel_ulong_t;
148pub type __kernel_ssize_t = __kernel_long_t;
149pub type __kernel_ptrdiff_t = __kernel_long_t;
150#[repr(C)]
151#[derive(Debug, Copy, Clone)]
152pub struct __kernel_fsid_t {
153    pub val: [::std::os::raw::c_int; 2usize],
154}
155#[test]
156fn bindgen_test_layout___kernel_fsid_t() {
157    assert_eq!(
158        ::std::mem::size_of::<__kernel_fsid_t>(),
159        8usize,
160        concat!("Size of: ", stringify!(__kernel_fsid_t))
161    );
162    assert_eq!(
163        ::std::mem::align_of::<__kernel_fsid_t>(),
164        4usize,
165        concat!("Alignment of ", stringify!(__kernel_fsid_t))
166    );
167    fn test_field_val() {
168        assert_eq!(
169            unsafe {
170                let uninit = ::std::mem::MaybeUninit::<__kernel_fsid_t>::uninit();
171                let ptr = uninit.as_ptr();
172                ::std::ptr::addr_of!((*ptr).val) as usize - ptr as usize
173            },
174            0usize,
175            concat!(
176                "Offset of field: ",
177                stringify!(__kernel_fsid_t),
178                "::",
179                stringify!(val)
180            )
181        );
182    }
183    test_field_val();
184}
185pub type __kernel_off_t = __kernel_long_t;
186pub type __kernel_loff_t = ::std::os::raw::c_longlong;
187pub type __kernel_old_time_t = __kernel_long_t;
188pub type __kernel_time_t = __kernel_long_t;
189pub type __kernel_time64_t = ::std::os::raw::c_longlong;
190pub type __kernel_clock_t = __kernel_long_t;
191pub type __kernel_timer_t = ::std::os::raw::c_int;
192pub type __kernel_clockid_t = ::std::os::raw::c_int;
193pub type __kernel_caddr_t = *mut ::std::os::raw::c_char;
194pub type __kernel_uid16_t = ::std::os::raw::c_ushort;
195pub type __kernel_gid16_t = ::std::os::raw::c_ushort;
196pub type __le16 = __u16;
197pub type __be16 = __u16;
198pub type __le32 = __u32;
199pub type __be32 = __u32;
200pub type __le64 = __u64;
201pub type __be64 = __u64;
202pub type __sum16 = __u16;
203pub type __wsum = __u32;
204pub type __poll_t = ::std::os::raw::c_uint;
205#[repr(C)]
206#[derive(Debug, Copy, Clone)]
207pub struct tls_crypto_info {
208    pub version: __u16,
209    pub cipher_type: __u16,
210}
211#[test]
212fn bindgen_test_layout_tls_crypto_info() {
213    assert_eq!(
214        ::std::mem::size_of::<tls_crypto_info>(),
215        4usize,
216        concat!("Size of: ", stringify!(tls_crypto_info))
217    );
218    assert_eq!(
219        ::std::mem::align_of::<tls_crypto_info>(),
220        2usize,
221        concat!("Alignment of ", stringify!(tls_crypto_info))
222    );
223    fn test_field_version() {
224        assert_eq!(
225            unsafe {
226                let uninit = ::std::mem::MaybeUninit::<tls_crypto_info>::uninit();
227                let ptr = uninit.as_ptr();
228                ::std::ptr::addr_of!((*ptr).version) as usize - ptr as usize
229            },
230            0usize,
231            concat!(
232                "Offset of field: ",
233                stringify!(tls_crypto_info),
234                "::",
235                stringify!(version)
236            )
237        );
238    }
239    test_field_version();
240    fn test_field_cipher_type() {
241        assert_eq!(
242            unsafe {
243                let uninit = ::std::mem::MaybeUninit::<tls_crypto_info>::uninit();
244                let ptr = uninit.as_ptr();
245                ::std::ptr::addr_of!((*ptr).cipher_type) as usize - ptr as usize
246            },
247            2usize,
248            concat!(
249                "Offset of field: ",
250                stringify!(tls_crypto_info),
251                "::",
252                stringify!(cipher_type)
253            )
254        );
255    }
256    test_field_cipher_type();
257}
258#[repr(C)]
259#[derive(Debug, Copy, Clone)]
260pub struct tls12_crypto_info_aes_gcm_128 {
261    pub info: tls_crypto_info,
262    pub iv: [::std::os::raw::c_uchar; 8usize],
263    pub key: [::std::os::raw::c_uchar; 16usize],
264    pub salt: [::std::os::raw::c_uchar; 4usize],
265    pub rec_seq: [::std::os::raw::c_uchar; 8usize],
266}
267#[test]
268fn bindgen_test_layout_tls12_crypto_info_aes_gcm_128() {
269    assert_eq!(
270        ::std::mem::size_of::<tls12_crypto_info_aes_gcm_128>(),
271        40usize,
272        concat!("Size of: ", stringify!(tls12_crypto_info_aes_gcm_128))
273    );
274    assert_eq!(
275        ::std::mem::align_of::<tls12_crypto_info_aes_gcm_128>(),
276        2usize,
277        concat!("Alignment of ", stringify!(tls12_crypto_info_aes_gcm_128))
278    );
279    fn test_field_info() {
280        assert_eq!(
281            unsafe {
282                let uninit = ::std::mem::MaybeUninit::<tls12_crypto_info_aes_gcm_128>::uninit();
283                let ptr = uninit.as_ptr();
284                ::std::ptr::addr_of!((*ptr).info) as usize - ptr as usize
285            },
286            0usize,
287            concat!(
288                "Offset of field: ",
289                stringify!(tls12_crypto_info_aes_gcm_128),
290                "::",
291                stringify!(info)
292            )
293        );
294    }
295    test_field_info();
296    fn test_field_iv() {
297        assert_eq!(
298            unsafe {
299                let uninit = ::std::mem::MaybeUninit::<tls12_crypto_info_aes_gcm_128>::uninit();
300                let ptr = uninit.as_ptr();
301                ::std::ptr::addr_of!((*ptr).iv) as usize - ptr as usize
302            },
303            4usize,
304            concat!(
305                "Offset of field: ",
306                stringify!(tls12_crypto_info_aes_gcm_128),
307                "::",
308                stringify!(iv)
309            )
310        );
311    }
312    test_field_iv();
313    fn test_field_key() {
314        assert_eq!(
315            unsafe {
316                let uninit = ::std::mem::MaybeUninit::<tls12_crypto_info_aes_gcm_128>::uninit();
317                let ptr = uninit.as_ptr();
318                ::std::ptr::addr_of!((*ptr).key) as usize - ptr as usize
319            },
320            12usize,
321            concat!(
322                "Offset of field: ",
323                stringify!(tls12_crypto_info_aes_gcm_128),
324                "::",
325                stringify!(key)
326            )
327        );
328    }
329    test_field_key();
330    fn test_field_salt() {
331        assert_eq!(
332            unsafe {
333                let uninit = ::std::mem::MaybeUninit::<tls12_crypto_info_aes_gcm_128>::uninit();
334                let ptr = uninit.as_ptr();
335                ::std::ptr::addr_of!((*ptr).salt) as usize - ptr as usize
336            },
337            28usize,
338            concat!(
339                "Offset of field: ",
340                stringify!(tls12_crypto_info_aes_gcm_128),
341                "::",
342                stringify!(salt)
343            )
344        );
345    }
346    test_field_salt();
347    fn test_field_rec_seq() {
348        assert_eq!(
349            unsafe {
350                let uninit = ::std::mem::MaybeUninit::<tls12_crypto_info_aes_gcm_128>::uninit();
351                let ptr = uninit.as_ptr();
352                ::std::ptr::addr_of!((*ptr).rec_seq) as usize - ptr as usize
353            },
354            32usize,
355            concat!(
356                "Offset of field: ",
357                stringify!(tls12_crypto_info_aes_gcm_128),
358                "::",
359                stringify!(rec_seq)
360            )
361        );
362    }
363    test_field_rec_seq();
364}
365#[repr(C)]
366#[derive(Debug, Copy, Clone)]
367pub struct tls12_crypto_info_aes_gcm_256 {
368    pub info: tls_crypto_info,
369    pub iv: [::std::os::raw::c_uchar; 8usize],
370    pub key: [::std::os::raw::c_uchar; 32usize],
371    pub salt: [::std::os::raw::c_uchar; 4usize],
372    pub rec_seq: [::std::os::raw::c_uchar; 8usize],
373}
374#[test]
375fn bindgen_test_layout_tls12_crypto_info_aes_gcm_256() {
376    assert_eq!(
377        ::std::mem::size_of::<tls12_crypto_info_aes_gcm_256>(),
378        56usize,
379        concat!("Size of: ", stringify!(tls12_crypto_info_aes_gcm_256))
380    );
381    assert_eq!(
382        ::std::mem::align_of::<tls12_crypto_info_aes_gcm_256>(),
383        2usize,
384        concat!("Alignment of ", stringify!(tls12_crypto_info_aes_gcm_256))
385    );
386    fn test_field_info() {
387        assert_eq!(
388            unsafe {
389                let uninit = ::std::mem::MaybeUninit::<tls12_crypto_info_aes_gcm_256>::uninit();
390                let ptr = uninit.as_ptr();
391                ::std::ptr::addr_of!((*ptr).info) as usize - ptr as usize
392            },
393            0usize,
394            concat!(
395                "Offset of field: ",
396                stringify!(tls12_crypto_info_aes_gcm_256),
397                "::",
398                stringify!(info)
399            )
400        );
401    }
402    test_field_info();
403    fn test_field_iv() {
404        assert_eq!(
405            unsafe {
406                let uninit = ::std::mem::MaybeUninit::<tls12_crypto_info_aes_gcm_256>::uninit();
407                let ptr = uninit.as_ptr();
408                ::std::ptr::addr_of!((*ptr).iv) as usize - ptr as usize
409            },
410            4usize,
411            concat!(
412                "Offset of field: ",
413                stringify!(tls12_crypto_info_aes_gcm_256),
414                "::",
415                stringify!(iv)
416            )
417        );
418    }
419    test_field_iv();
420    fn test_field_key() {
421        assert_eq!(
422            unsafe {
423                let uninit = ::std::mem::MaybeUninit::<tls12_crypto_info_aes_gcm_256>::uninit();
424                let ptr = uninit.as_ptr();
425                ::std::ptr::addr_of!((*ptr).key) as usize - ptr as usize
426            },
427            12usize,
428            concat!(
429                "Offset of field: ",
430                stringify!(tls12_crypto_info_aes_gcm_256),
431                "::",
432                stringify!(key)
433            )
434        );
435    }
436    test_field_key();
437    fn test_field_salt() {
438        assert_eq!(
439            unsafe {
440                let uninit = ::std::mem::MaybeUninit::<tls12_crypto_info_aes_gcm_256>::uninit();
441                let ptr = uninit.as_ptr();
442                ::std::ptr::addr_of!((*ptr).salt) as usize - ptr as usize
443            },
444            44usize,
445            concat!(
446                "Offset of field: ",
447                stringify!(tls12_crypto_info_aes_gcm_256),
448                "::",
449                stringify!(salt)
450            )
451        );
452    }
453    test_field_salt();
454    fn test_field_rec_seq() {
455        assert_eq!(
456            unsafe {
457                let uninit = ::std::mem::MaybeUninit::<tls12_crypto_info_aes_gcm_256>::uninit();
458                let ptr = uninit.as_ptr();
459                ::std::ptr::addr_of!((*ptr).rec_seq) as usize - ptr as usize
460            },
461            48usize,
462            concat!(
463                "Offset of field: ",
464                stringify!(tls12_crypto_info_aes_gcm_256),
465                "::",
466                stringify!(rec_seq)
467            )
468        );
469    }
470    test_field_rec_seq();
471}
472#[repr(C)]
473#[derive(Debug, Copy, Clone)]
474pub struct tls12_crypto_info_aes_ccm_128 {
475    pub info: tls_crypto_info,
476    pub iv: [::std::os::raw::c_uchar; 8usize],
477    pub key: [::std::os::raw::c_uchar; 16usize],
478    pub salt: [::std::os::raw::c_uchar; 4usize],
479    pub rec_seq: [::std::os::raw::c_uchar; 8usize],
480}
481#[test]
482fn bindgen_test_layout_tls12_crypto_info_aes_ccm_128() {
483    assert_eq!(
484        ::std::mem::size_of::<tls12_crypto_info_aes_ccm_128>(),
485        40usize,
486        concat!("Size of: ", stringify!(tls12_crypto_info_aes_ccm_128))
487    );
488    assert_eq!(
489        ::std::mem::align_of::<tls12_crypto_info_aes_ccm_128>(),
490        2usize,
491        concat!("Alignment of ", stringify!(tls12_crypto_info_aes_ccm_128))
492    );
493    fn test_field_info() {
494        assert_eq!(
495            unsafe {
496                let uninit = ::std::mem::MaybeUninit::<tls12_crypto_info_aes_ccm_128>::uninit();
497                let ptr = uninit.as_ptr();
498                ::std::ptr::addr_of!((*ptr).info) as usize - ptr as usize
499            },
500            0usize,
501            concat!(
502                "Offset of field: ",
503                stringify!(tls12_crypto_info_aes_ccm_128),
504                "::",
505                stringify!(info)
506            )
507        );
508    }
509    test_field_info();
510    fn test_field_iv() {
511        assert_eq!(
512            unsafe {
513                let uninit = ::std::mem::MaybeUninit::<tls12_crypto_info_aes_ccm_128>::uninit();
514                let ptr = uninit.as_ptr();
515                ::std::ptr::addr_of!((*ptr).iv) as usize - ptr as usize
516            },
517            4usize,
518            concat!(
519                "Offset of field: ",
520                stringify!(tls12_crypto_info_aes_ccm_128),
521                "::",
522                stringify!(iv)
523            )
524        );
525    }
526    test_field_iv();
527    fn test_field_key() {
528        assert_eq!(
529            unsafe {
530                let uninit = ::std::mem::MaybeUninit::<tls12_crypto_info_aes_ccm_128>::uninit();
531                let ptr = uninit.as_ptr();
532                ::std::ptr::addr_of!((*ptr).key) as usize - ptr as usize
533            },
534            12usize,
535            concat!(
536                "Offset of field: ",
537                stringify!(tls12_crypto_info_aes_ccm_128),
538                "::",
539                stringify!(key)
540            )
541        );
542    }
543    test_field_key();
544    fn test_field_salt() {
545        assert_eq!(
546            unsafe {
547                let uninit = ::std::mem::MaybeUninit::<tls12_crypto_info_aes_ccm_128>::uninit();
548                let ptr = uninit.as_ptr();
549                ::std::ptr::addr_of!((*ptr).salt) as usize - ptr as usize
550            },
551            28usize,
552            concat!(
553                "Offset of field: ",
554                stringify!(tls12_crypto_info_aes_ccm_128),
555                "::",
556                stringify!(salt)
557            )
558        );
559    }
560    test_field_salt();
561    fn test_field_rec_seq() {
562        assert_eq!(
563            unsafe {
564                let uninit = ::std::mem::MaybeUninit::<tls12_crypto_info_aes_ccm_128>::uninit();
565                let ptr = uninit.as_ptr();
566                ::std::ptr::addr_of!((*ptr).rec_seq) as usize - ptr as usize
567            },
568            32usize,
569            concat!(
570                "Offset of field: ",
571                stringify!(tls12_crypto_info_aes_ccm_128),
572                "::",
573                stringify!(rec_seq)
574            )
575        );
576    }
577    test_field_rec_seq();
578}
579#[repr(C)]
580#[derive(Debug)]
581pub struct tls12_crypto_info_chacha20_poly1305 {
582    pub info: tls_crypto_info,
583    pub iv: [::std::os::raw::c_uchar; 12usize],
584    pub key: [::std::os::raw::c_uchar; 32usize],
585    pub salt: __IncompleteArrayField<::std::os::raw::c_uchar>,
586    pub rec_seq: [::std::os::raw::c_uchar; 8usize],
587}
588#[test]
589fn bindgen_test_layout_tls12_crypto_info_chacha20_poly1305() {
590    assert_eq!(
591        ::std::mem::size_of::<tls12_crypto_info_chacha20_poly1305>(),
592        56usize,
593        concat!("Size of: ", stringify!(tls12_crypto_info_chacha20_poly1305))
594    );
595    assert_eq!(
596        ::std::mem::align_of::<tls12_crypto_info_chacha20_poly1305>(),
597        2usize,
598        concat!(
599            "Alignment of ",
600            stringify!(tls12_crypto_info_chacha20_poly1305)
601        )
602    );
603    fn test_field_info() {
604        assert_eq!(
605            unsafe {
606                let uninit =
607                    ::std::mem::MaybeUninit::<tls12_crypto_info_chacha20_poly1305>::uninit();
608                let ptr = uninit.as_ptr();
609                ::std::ptr::addr_of!((*ptr).info) as usize - ptr as usize
610            },
611            0usize,
612            concat!(
613                "Offset of field: ",
614                stringify!(tls12_crypto_info_chacha20_poly1305),
615                "::",
616                stringify!(info)
617            )
618        );
619    }
620    test_field_info();
621    fn test_field_iv() {
622        assert_eq!(
623            unsafe {
624                let uninit =
625                    ::std::mem::MaybeUninit::<tls12_crypto_info_chacha20_poly1305>::uninit();
626                let ptr = uninit.as_ptr();
627                ::std::ptr::addr_of!((*ptr).iv) as usize - ptr as usize
628            },
629            4usize,
630            concat!(
631                "Offset of field: ",
632                stringify!(tls12_crypto_info_chacha20_poly1305),
633                "::",
634                stringify!(iv)
635            )
636        );
637    }
638    test_field_iv();
639    fn test_field_key() {
640        assert_eq!(
641            unsafe {
642                let uninit =
643                    ::std::mem::MaybeUninit::<tls12_crypto_info_chacha20_poly1305>::uninit();
644                let ptr = uninit.as_ptr();
645                ::std::ptr::addr_of!((*ptr).key) as usize - ptr as usize
646            },
647            16usize,
648            concat!(
649                "Offset of field: ",
650                stringify!(tls12_crypto_info_chacha20_poly1305),
651                "::",
652                stringify!(key)
653            )
654        );
655    }
656    test_field_key();
657    fn test_field_salt() {
658        assert_eq!(
659            unsafe {
660                let uninit =
661                    ::std::mem::MaybeUninit::<tls12_crypto_info_chacha20_poly1305>::uninit();
662                let ptr = uninit.as_ptr();
663                ::std::ptr::addr_of!((*ptr).salt) as usize - ptr as usize
664            },
665            48usize,
666            concat!(
667                "Offset of field: ",
668                stringify!(tls12_crypto_info_chacha20_poly1305),
669                "::",
670                stringify!(salt)
671            )
672        );
673    }
674    test_field_salt();
675    fn test_field_rec_seq() {
676        assert_eq!(
677            unsafe {
678                let uninit =
679                    ::std::mem::MaybeUninit::<tls12_crypto_info_chacha20_poly1305>::uninit();
680                let ptr = uninit.as_ptr();
681                ::std::ptr::addr_of!((*ptr).rec_seq) as usize - ptr as usize
682            },
683            48usize,
684            concat!(
685                "Offset of field: ",
686                stringify!(tls12_crypto_info_chacha20_poly1305),
687                "::",
688                stringify!(rec_seq)
689            )
690        );
691    }
692    test_field_rec_seq();
693}
694#[repr(C)]
695#[derive(Debug, Copy, Clone)]
696pub struct tls12_crypto_info_sm4_gcm {
697    pub info: tls_crypto_info,
698    pub iv: [::std::os::raw::c_uchar; 8usize],
699    pub key: [::std::os::raw::c_uchar; 16usize],
700    pub salt: [::std::os::raw::c_uchar; 4usize],
701    pub rec_seq: [::std::os::raw::c_uchar; 8usize],
702}
703#[test]
704fn bindgen_test_layout_tls12_crypto_info_sm4_gcm() {
705    assert_eq!(
706        ::std::mem::size_of::<tls12_crypto_info_sm4_gcm>(),
707        40usize,
708        concat!("Size of: ", stringify!(tls12_crypto_info_sm4_gcm))
709    );
710    assert_eq!(
711        ::std::mem::align_of::<tls12_crypto_info_sm4_gcm>(),
712        2usize,
713        concat!("Alignment of ", stringify!(tls12_crypto_info_sm4_gcm))
714    );
715    fn test_field_info() {
716        assert_eq!(
717            unsafe {
718                let uninit = ::std::mem::MaybeUninit::<tls12_crypto_info_sm4_gcm>::uninit();
719                let ptr = uninit.as_ptr();
720                ::std::ptr::addr_of!((*ptr).info) as usize - ptr as usize
721            },
722            0usize,
723            concat!(
724                "Offset of field: ",
725                stringify!(tls12_crypto_info_sm4_gcm),
726                "::",
727                stringify!(info)
728            )
729        );
730    }
731    test_field_info();
732    fn test_field_iv() {
733        assert_eq!(
734            unsafe {
735                let uninit = ::std::mem::MaybeUninit::<tls12_crypto_info_sm4_gcm>::uninit();
736                let ptr = uninit.as_ptr();
737                ::std::ptr::addr_of!((*ptr).iv) as usize - ptr as usize
738            },
739            4usize,
740            concat!(
741                "Offset of field: ",
742                stringify!(tls12_crypto_info_sm4_gcm),
743                "::",
744                stringify!(iv)
745            )
746        );
747    }
748    test_field_iv();
749    fn test_field_key() {
750        assert_eq!(
751            unsafe {
752                let uninit = ::std::mem::MaybeUninit::<tls12_crypto_info_sm4_gcm>::uninit();
753                let ptr = uninit.as_ptr();
754                ::std::ptr::addr_of!((*ptr).key) as usize - ptr as usize
755            },
756            12usize,
757            concat!(
758                "Offset of field: ",
759                stringify!(tls12_crypto_info_sm4_gcm),
760                "::",
761                stringify!(key)
762            )
763        );
764    }
765    test_field_key();
766    fn test_field_salt() {
767        assert_eq!(
768            unsafe {
769                let uninit = ::std::mem::MaybeUninit::<tls12_crypto_info_sm4_gcm>::uninit();
770                let ptr = uninit.as_ptr();
771                ::std::ptr::addr_of!((*ptr).salt) as usize - ptr as usize
772            },
773            28usize,
774            concat!(
775                "Offset of field: ",
776                stringify!(tls12_crypto_info_sm4_gcm),
777                "::",
778                stringify!(salt)
779            )
780        );
781    }
782    test_field_salt();
783    fn test_field_rec_seq() {
784        assert_eq!(
785            unsafe {
786                let uninit = ::std::mem::MaybeUninit::<tls12_crypto_info_sm4_gcm>::uninit();
787                let ptr = uninit.as_ptr();
788                ::std::ptr::addr_of!((*ptr).rec_seq) as usize - ptr as usize
789            },
790            32usize,
791            concat!(
792                "Offset of field: ",
793                stringify!(tls12_crypto_info_sm4_gcm),
794                "::",
795                stringify!(rec_seq)
796            )
797        );
798    }
799    test_field_rec_seq();
800}
801#[repr(C)]
802#[derive(Debug, Copy, Clone)]
803pub struct tls12_crypto_info_sm4_ccm {
804    pub info: tls_crypto_info,
805    pub iv: [::std::os::raw::c_uchar; 8usize],
806    pub key: [::std::os::raw::c_uchar; 16usize],
807    pub salt: [::std::os::raw::c_uchar; 4usize],
808    pub rec_seq: [::std::os::raw::c_uchar; 8usize],
809}
810#[test]
811fn bindgen_test_layout_tls12_crypto_info_sm4_ccm() {
812    assert_eq!(
813        ::std::mem::size_of::<tls12_crypto_info_sm4_ccm>(),
814        40usize,
815        concat!("Size of: ", stringify!(tls12_crypto_info_sm4_ccm))
816    );
817    assert_eq!(
818        ::std::mem::align_of::<tls12_crypto_info_sm4_ccm>(),
819        2usize,
820        concat!("Alignment of ", stringify!(tls12_crypto_info_sm4_ccm))
821    );
822    fn test_field_info() {
823        assert_eq!(
824            unsafe {
825                let uninit = ::std::mem::MaybeUninit::<tls12_crypto_info_sm4_ccm>::uninit();
826                let ptr = uninit.as_ptr();
827                ::std::ptr::addr_of!((*ptr).info) as usize - ptr as usize
828            },
829            0usize,
830            concat!(
831                "Offset of field: ",
832                stringify!(tls12_crypto_info_sm4_ccm),
833                "::",
834                stringify!(info)
835            )
836        );
837    }
838    test_field_info();
839    fn test_field_iv() {
840        assert_eq!(
841            unsafe {
842                let uninit = ::std::mem::MaybeUninit::<tls12_crypto_info_sm4_ccm>::uninit();
843                let ptr = uninit.as_ptr();
844                ::std::ptr::addr_of!((*ptr).iv) as usize - ptr as usize
845            },
846            4usize,
847            concat!(
848                "Offset of field: ",
849                stringify!(tls12_crypto_info_sm4_ccm),
850                "::",
851                stringify!(iv)
852            )
853        );
854    }
855    test_field_iv();
856    fn test_field_key() {
857        assert_eq!(
858            unsafe {
859                let uninit = ::std::mem::MaybeUninit::<tls12_crypto_info_sm4_ccm>::uninit();
860                let ptr = uninit.as_ptr();
861                ::std::ptr::addr_of!((*ptr).key) as usize - ptr as usize
862            },
863            12usize,
864            concat!(
865                "Offset of field: ",
866                stringify!(tls12_crypto_info_sm4_ccm),
867                "::",
868                stringify!(key)
869            )
870        );
871    }
872    test_field_key();
873    fn test_field_salt() {
874        assert_eq!(
875            unsafe {
876                let uninit = ::std::mem::MaybeUninit::<tls12_crypto_info_sm4_ccm>::uninit();
877                let ptr = uninit.as_ptr();
878                ::std::ptr::addr_of!((*ptr).salt) as usize - ptr as usize
879            },
880            28usize,
881            concat!(
882                "Offset of field: ",
883                stringify!(tls12_crypto_info_sm4_ccm),
884                "::",
885                stringify!(salt)
886            )
887        );
888    }
889    test_field_salt();
890    fn test_field_rec_seq() {
891        assert_eq!(
892            unsafe {
893                let uninit = ::std::mem::MaybeUninit::<tls12_crypto_info_sm4_ccm>::uninit();
894                let ptr = uninit.as_ptr();
895                ::std::ptr::addr_of!((*ptr).rec_seq) as usize - ptr as usize
896            },
897            32usize,
898            concat!(
899                "Offset of field: ",
900                stringify!(tls12_crypto_info_sm4_ccm),
901                "::",
902                stringify!(rec_seq)
903            )
904        );
905    }
906    test_field_rec_seq();
907}
908pub const TLS_INFO_UNSPEC: _bindgen_ty_1 = 0;
909pub const TLS_INFO_VERSION: _bindgen_ty_1 = 1;
910pub const TLS_INFO_CIPHER: _bindgen_ty_1 = 2;
911pub const TLS_INFO_TXCONF: _bindgen_ty_1 = 3;
912pub const TLS_INFO_RXCONF: _bindgen_ty_1 = 4;
913pub const TLS_INFO_ZC_RO_TX: _bindgen_ty_1 = 5;
914pub const TLS_INFO_RX_NO_PAD: _bindgen_ty_1 = 6;
915pub const __TLS_INFO_MAX: _bindgen_ty_1 = 7;
916pub type _bindgen_ty_1 = ::std::os::raw::c_uint;