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
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct bpf_map_def {
pub type_: ::std::os::raw::c_uint,
pub key_size: ::std::os::raw::c_uint,
pub value_size: ::std::os::raw::c_uint,
pub max_entries: ::std::os::raw::c_uint,
pub map_flags: ::std::os::raw::c_uint,
}
#[test]
fn bindgen_test_layout_bpf_map_def() {
assert_eq!(
::std::mem::size_of::<bpf_map_def>(),
20usize,
concat!("Size of: ", stringify!(bpf_map_def))
);
assert_eq!(
::std::mem::align_of::<bpf_map_def>(),
4usize,
concat!("Alignment of ", stringify!(bpf_map_def))
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<bpf_map_def>())).type_ as *const _ as usize },
0usize,
concat!(
"Offset of field: ",
stringify!(bpf_map_def),
"::",
stringify!(type_)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<bpf_map_def>())).key_size as *const _ as usize },
4usize,
concat!(
"Offset of field: ",
stringify!(bpf_map_def),
"::",
stringify!(key_size)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<bpf_map_def>())).value_size as *const _ as usize },
8usize,
concat!(
"Offset of field: ",
stringify!(bpf_map_def),
"::",
stringify!(value_size)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<bpf_map_def>())).max_entries as *const _ as usize },
12usize,
concat!(
"Offset of field: ",
stringify!(bpf_map_def),
"::",
stringify!(max_entries)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<bpf_map_def>())).map_flags as *const _ as usize },
16usize,
concat!(
"Offset of field: ",
stringify!(bpf_map_def),
"::",
stringify!(map_flags)
)
);
}