1 /* Generated by ./gen_bpf_attr_check.sh from bpf_attr.h; do not edit. */
2 #include "defs.h"
3 #ifdef HAVE_LINUX_BPF_H
4 # include <linux/bpf.h>
5 # include "bpf_attr.h"
6 # include "static_assert.h"
7 
8 # define SoM(type_, member_) (sizeof(((type_ *)0)->member_))
9 
10 # ifdef HAVE_UNION_BPF_ATTR_MAP_TYPE
11 	static_assert(SoM(struct BPF_MAP_CREATE_struct, map_type) == SoM(union bpf_attr, map_type),
12 		      "BPF_MAP_CREATE_struct.map_type size mismatch");
13 	static_assert(offsetof(struct BPF_MAP_CREATE_struct, map_type) == offsetof(union bpf_attr, map_type),
14 		      "BPF_MAP_CREATE_struct.map_type offset mismatch");
15 # endif /* HAVE_UNION_BPF_ATTR_MAP_TYPE */
16 
17 # ifdef HAVE_UNION_BPF_ATTR_KEY_SIZE
18 	static_assert(SoM(struct BPF_MAP_CREATE_struct, key_size) == SoM(union bpf_attr, key_size),
19 		      "BPF_MAP_CREATE_struct.key_size size mismatch");
20 	static_assert(offsetof(struct BPF_MAP_CREATE_struct, key_size) == offsetof(union bpf_attr, key_size),
21 		      "BPF_MAP_CREATE_struct.key_size offset mismatch");
22 # endif /* HAVE_UNION_BPF_ATTR_KEY_SIZE */
23 
24 # ifdef HAVE_UNION_BPF_ATTR_VALUE_SIZE
25 	static_assert(SoM(struct BPF_MAP_CREATE_struct, value_size) == SoM(union bpf_attr, value_size),
26 		      "BPF_MAP_CREATE_struct.value_size size mismatch");
27 	static_assert(offsetof(struct BPF_MAP_CREATE_struct, value_size) == offsetof(union bpf_attr, value_size),
28 		      "BPF_MAP_CREATE_struct.value_size offset mismatch");
29 # endif /* HAVE_UNION_BPF_ATTR_VALUE_SIZE */
30 
31 # ifdef HAVE_UNION_BPF_ATTR_MAX_ENTRIES
32 	static_assert(SoM(struct BPF_MAP_CREATE_struct, max_entries) == SoM(union bpf_attr, max_entries),
33 		      "BPF_MAP_CREATE_struct.max_entries size mismatch");
34 	static_assert(offsetof(struct BPF_MAP_CREATE_struct, max_entries) == offsetof(union bpf_attr, max_entries),
35 		      "BPF_MAP_CREATE_struct.max_entries offset mismatch");
36 # endif /* HAVE_UNION_BPF_ATTR_MAX_ENTRIES */
37 
38 # ifdef HAVE_UNION_BPF_ATTR_MAP_FLAGS
39 	static_assert(SoM(struct BPF_MAP_CREATE_struct, map_flags) == SoM(union bpf_attr, map_flags),
40 		      "BPF_MAP_CREATE_struct.map_flags size mismatch");
41 	static_assert(offsetof(struct BPF_MAP_CREATE_struct, map_flags) == offsetof(union bpf_attr, map_flags),
42 		      "BPF_MAP_CREATE_struct.map_flags offset mismatch");
43 # endif /* HAVE_UNION_BPF_ATTR_MAP_FLAGS */
44 
45 # ifdef HAVE_UNION_BPF_ATTR_INNER_MAP_FD
46 	static_assert(SoM(struct BPF_MAP_CREATE_struct, inner_map_fd) == SoM(union bpf_attr, inner_map_fd),
47 		      "BPF_MAP_CREATE_struct.inner_map_fd size mismatch");
48 	static_assert(offsetof(struct BPF_MAP_CREATE_struct, inner_map_fd) == offsetof(union bpf_attr, inner_map_fd),
49 		      "BPF_MAP_CREATE_struct.inner_map_fd offset mismatch");
50 # endif /* HAVE_UNION_BPF_ATTR_INNER_MAP_FD */
51 
52 # ifdef HAVE_UNION_BPF_ATTR_NUMA_NODE
53 	static_assert(SoM(struct BPF_MAP_CREATE_struct, numa_node) == SoM(union bpf_attr, numa_node),
54 		      "BPF_MAP_CREATE_struct.numa_node size mismatch");
55 	static_assert(offsetof(struct BPF_MAP_CREATE_struct, numa_node) == offsetof(union bpf_attr, numa_node),
56 		      "BPF_MAP_CREATE_struct.numa_node offset mismatch");
57 # endif /* HAVE_UNION_BPF_ATTR_NUMA_NODE */
58 
59 # ifdef HAVE_UNION_BPF_ATTR_MAP_NAME
60 	static_assert(SoM(struct BPF_MAP_CREATE_struct, map_name) == SoM(union bpf_attr, map_name),
61 		      "BPF_MAP_CREATE_struct.map_name size mismatch");
62 	static_assert(offsetof(struct BPF_MAP_CREATE_struct, map_name) == offsetof(union bpf_attr, map_name),
63 		      "BPF_MAP_CREATE_struct.map_name offset mismatch");
64 # endif /* HAVE_UNION_BPF_ATTR_MAP_NAME */
65 
66 # ifdef HAVE_UNION_BPF_ATTR_MAP_IFINDEX
67 	static_assert(SoM(struct BPF_MAP_CREATE_struct, map_ifindex) == SoM(union bpf_attr, map_ifindex),
68 		      "BPF_MAP_CREATE_struct.map_ifindex size mismatch");
69 	static_assert(offsetof(struct BPF_MAP_CREATE_struct, map_ifindex) == offsetof(union bpf_attr, map_ifindex),
70 		      "BPF_MAP_CREATE_struct.map_ifindex offset mismatch");
71 # endif /* HAVE_UNION_BPF_ATTR_MAP_IFINDEX */
72 
73 static_assert(BPF_MAP_CREATE_struct_size == expected_BPF_MAP_CREATE_struct_size,
74 	      "BPF_MAP_CREATE_struct_size mismatch");
75 
76 # ifdef HAVE_UNION_BPF_ATTR_MAP_FD
77 	static_assert(SoM(struct BPF_MAP_LOOKUP_ELEM_struct, map_fd) == SoM(union bpf_attr, map_fd),
78 		      "BPF_MAP_LOOKUP_ELEM_struct.map_fd size mismatch");
79 	static_assert(offsetof(struct BPF_MAP_LOOKUP_ELEM_struct, map_fd) == offsetof(union bpf_attr, map_fd),
80 		      "BPF_MAP_LOOKUP_ELEM_struct.map_fd offset mismatch");
81 # endif /* HAVE_UNION_BPF_ATTR_MAP_FD */
82 
83 # ifdef HAVE_UNION_BPF_ATTR_KEY
84 	static_assert(SoM(struct BPF_MAP_LOOKUP_ELEM_struct, key) == SoM(union bpf_attr, key),
85 		      "BPF_MAP_LOOKUP_ELEM_struct.key size mismatch");
86 	static_assert(offsetof(struct BPF_MAP_LOOKUP_ELEM_struct, key) == offsetof(union bpf_attr, key),
87 		      "BPF_MAP_LOOKUP_ELEM_struct.key offset mismatch");
88 # endif /* HAVE_UNION_BPF_ATTR_KEY */
89 
90 # ifdef HAVE_UNION_BPF_ATTR_VALUE
91 	static_assert(SoM(struct BPF_MAP_LOOKUP_ELEM_struct, value) == SoM(union bpf_attr, value),
92 		      "BPF_MAP_LOOKUP_ELEM_struct.value size mismatch");
93 	static_assert(offsetof(struct BPF_MAP_LOOKUP_ELEM_struct, value) == offsetof(union bpf_attr, value),
94 		      "BPF_MAP_LOOKUP_ELEM_struct.value offset mismatch");
95 # endif /* HAVE_UNION_BPF_ATTR_VALUE */
96 
97 static_assert(BPF_MAP_LOOKUP_ELEM_struct_size == expected_BPF_MAP_LOOKUP_ELEM_struct_size,
98 	      "BPF_MAP_LOOKUP_ELEM_struct_size mismatch");
99 
100 # ifdef HAVE_UNION_BPF_ATTR_MAP_FD
101 	static_assert(SoM(struct BPF_MAP_UPDATE_ELEM_struct, map_fd) == SoM(union bpf_attr, map_fd),
102 		      "BPF_MAP_UPDATE_ELEM_struct.map_fd size mismatch");
103 	static_assert(offsetof(struct BPF_MAP_UPDATE_ELEM_struct, map_fd) == offsetof(union bpf_attr, map_fd),
104 		      "BPF_MAP_UPDATE_ELEM_struct.map_fd offset mismatch");
105 # endif /* HAVE_UNION_BPF_ATTR_MAP_FD */
106 
107 # ifdef HAVE_UNION_BPF_ATTR_KEY
108 	static_assert(SoM(struct BPF_MAP_UPDATE_ELEM_struct, key) == SoM(union bpf_attr, key),
109 		      "BPF_MAP_UPDATE_ELEM_struct.key size mismatch");
110 	static_assert(offsetof(struct BPF_MAP_UPDATE_ELEM_struct, key) == offsetof(union bpf_attr, key),
111 		      "BPF_MAP_UPDATE_ELEM_struct.key offset mismatch");
112 # endif /* HAVE_UNION_BPF_ATTR_KEY */
113 
114 # ifdef HAVE_UNION_BPF_ATTR_VALUE
115 	static_assert(SoM(struct BPF_MAP_UPDATE_ELEM_struct, value) == SoM(union bpf_attr, value),
116 		      "BPF_MAP_UPDATE_ELEM_struct.value size mismatch");
117 	static_assert(offsetof(struct BPF_MAP_UPDATE_ELEM_struct, value) == offsetof(union bpf_attr, value),
118 		      "BPF_MAP_UPDATE_ELEM_struct.value offset mismatch");
119 # endif /* HAVE_UNION_BPF_ATTR_VALUE */
120 
121 # ifdef HAVE_UNION_BPF_ATTR_FLAGS
122 	static_assert(SoM(struct BPF_MAP_UPDATE_ELEM_struct, flags) == SoM(union bpf_attr, flags),
123 		      "BPF_MAP_UPDATE_ELEM_struct.flags size mismatch");
124 	static_assert(offsetof(struct BPF_MAP_UPDATE_ELEM_struct, flags) == offsetof(union bpf_attr, flags),
125 		      "BPF_MAP_UPDATE_ELEM_struct.flags offset mismatch");
126 # endif /* HAVE_UNION_BPF_ATTR_FLAGS */
127 
128 static_assert(BPF_MAP_UPDATE_ELEM_struct_size == expected_BPF_MAP_UPDATE_ELEM_struct_size,
129 	      "BPF_MAP_UPDATE_ELEM_struct_size mismatch");
130 
131 # ifdef HAVE_UNION_BPF_ATTR_MAP_FD
132 	static_assert(SoM(struct BPF_MAP_DELETE_ELEM_struct, map_fd) == SoM(union bpf_attr, map_fd),
133 		      "BPF_MAP_DELETE_ELEM_struct.map_fd size mismatch");
134 	static_assert(offsetof(struct BPF_MAP_DELETE_ELEM_struct, map_fd) == offsetof(union bpf_attr, map_fd),
135 		      "BPF_MAP_DELETE_ELEM_struct.map_fd offset mismatch");
136 # endif /* HAVE_UNION_BPF_ATTR_MAP_FD */
137 
138 # ifdef HAVE_UNION_BPF_ATTR_KEY
139 	static_assert(SoM(struct BPF_MAP_DELETE_ELEM_struct, key) == SoM(union bpf_attr, key),
140 		      "BPF_MAP_DELETE_ELEM_struct.key size mismatch");
141 	static_assert(offsetof(struct BPF_MAP_DELETE_ELEM_struct, key) == offsetof(union bpf_attr, key),
142 		      "BPF_MAP_DELETE_ELEM_struct.key offset mismatch");
143 # endif /* HAVE_UNION_BPF_ATTR_KEY */
144 
145 static_assert(BPF_MAP_DELETE_ELEM_struct_size == expected_BPF_MAP_DELETE_ELEM_struct_size,
146 	      "BPF_MAP_DELETE_ELEM_struct_size mismatch");
147 
148 # ifdef HAVE_UNION_BPF_ATTR_MAP_FD
149 	static_assert(SoM(struct BPF_MAP_GET_NEXT_KEY_struct, map_fd) == SoM(union bpf_attr, map_fd),
150 		      "BPF_MAP_GET_NEXT_KEY_struct.map_fd size mismatch");
151 	static_assert(offsetof(struct BPF_MAP_GET_NEXT_KEY_struct, map_fd) == offsetof(union bpf_attr, map_fd),
152 		      "BPF_MAP_GET_NEXT_KEY_struct.map_fd offset mismatch");
153 # endif /* HAVE_UNION_BPF_ATTR_MAP_FD */
154 
155 # ifdef HAVE_UNION_BPF_ATTR_KEY
156 	static_assert(SoM(struct BPF_MAP_GET_NEXT_KEY_struct, key) == SoM(union bpf_attr, key),
157 		      "BPF_MAP_GET_NEXT_KEY_struct.key size mismatch");
158 	static_assert(offsetof(struct BPF_MAP_GET_NEXT_KEY_struct, key) == offsetof(union bpf_attr, key),
159 		      "BPF_MAP_GET_NEXT_KEY_struct.key offset mismatch");
160 # endif /* HAVE_UNION_BPF_ATTR_KEY */
161 
162 # ifdef HAVE_UNION_BPF_ATTR_NEXT_KEY
163 	static_assert(SoM(struct BPF_MAP_GET_NEXT_KEY_struct, next_key) == SoM(union bpf_attr, next_key),
164 		      "BPF_MAP_GET_NEXT_KEY_struct.next_key size mismatch");
165 	static_assert(offsetof(struct BPF_MAP_GET_NEXT_KEY_struct, next_key) == offsetof(union bpf_attr, next_key),
166 		      "BPF_MAP_GET_NEXT_KEY_struct.next_key offset mismatch");
167 # endif /* HAVE_UNION_BPF_ATTR_NEXT_KEY */
168 
169 static_assert(BPF_MAP_GET_NEXT_KEY_struct_size == expected_BPF_MAP_GET_NEXT_KEY_struct_size,
170 	      "BPF_MAP_GET_NEXT_KEY_struct_size mismatch");
171 
172 # ifdef HAVE_UNION_BPF_ATTR_PROG_TYPE
173 	static_assert(SoM(struct BPF_PROG_LOAD_struct, prog_type) == SoM(union bpf_attr, prog_type),
174 		      "BPF_PROG_LOAD_struct.prog_type size mismatch");
175 	static_assert(offsetof(struct BPF_PROG_LOAD_struct, prog_type) == offsetof(union bpf_attr, prog_type),
176 		      "BPF_PROG_LOAD_struct.prog_type offset mismatch");
177 # endif /* HAVE_UNION_BPF_ATTR_PROG_TYPE */
178 
179 # ifdef HAVE_UNION_BPF_ATTR_INSN_CNT
180 	static_assert(SoM(struct BPF_PROG_LOAD_struct, insn_cnt) == SoM(union bpf_attr, insn_cnt),
181 		      "BPF_PROG_LOAD_struct.insn_cnt size mismatch");
182 	static_assert(offsetof(struct BPF_PROG_LOAD_struct, insn_cnt) == offsetof(union bpf_attr, insn_cnt),
183 		      "BPF_PROG_LOAD_struct.insn_cnt offset mismatch");
184 # endif /* HAVE_UNION_BPF_ATTR_INSN_CNT */
185 
186 # ifdef HAVE_UNION_BPF_ATTR_INSNS
187 	static_assert(SoM(struct BPF_PROG_LOAD_struct, insns) == SoM(union bpf_attr, insns),
188 		      "BPF_PROG_LOAD_struct.insns size mismatch");
189 	static_assert(offsetof(struct BPF_PROG_LOAD_struct, insns) == offsetof(union bpf_attr, insns),
190 		      "BPF_PROG_LOAD_struct.insns offset mismatch");
191 # endif /* HAVE_UNION_BPF_ATTR_INSNS */
192 
193 # ifdef HAVE_UNION_BPF_ATTR_LICENSE
194 	static_assert(SoM(struct BPF_PROG_LOAD_struct, license) == SoM(union bpf_attr, license),
195 		      "BPF_PROG_LOAD_struct.license size mismatch");
196 	static_assert(offsetof(struct BPF_PROG_LOAD_struct, license) == offsetof(union bpf_attr, license),
197 		      "BPF_PROG_LOAD_struct.license offset mismatch");
198 # endif /* HAVE_UNION_BPF_ATTR_LICENSE */
199 
200 # ifdef HAVE_UNION_BPF_ATTR_LOG_LEVEL
201 	static_assert(SoM(struct BPF_PROG_LOAD_struct, log_level) == SoM(union bpf_attr, log_level),
202 		      "BPF_PROG_LOAD_struct.log_level size mismatch");
203 	static_assert(offsetof(struct BPF_PROG_LOAD_struct, log_level) == offsetof(union bpf_attr, log_level),
204 		      "BPF_PROG_LOAD_struct.log_level offset mismatch");
205 # endif /* HAVE_UNION_BPF_ATTR_LOG_LEVEL */
206 
207 # ifdef HAVE_UNION_BPF_ATTR_LOG_SIZE
208 	static_assert(SoM(struct BPF_PROG_LOAD_struct, log_size) == SoM(union bpf_attr, log_size),
209 		      "BPF_PROG_LOAD_struct.log_size size mismatch");
210 	static_assert(offsetof(struct BPF_PROG_LOAD_struct, log_size) == offsetof(union bpf_attr, log_size),
211 		      "BPF_PROG_LOAD_struct.log_size offset mismatch");
212 # endif /* HAVE_UNION_BPF_ATTR_LOG_SIZE */
213 
214 # ifdef HAVE_UNION_BPF_ATTR_LOG_BUF
215 	static_assert(SoM(struct BPF_PROG_LOAD_struct, log_buf) == SoM(union bpf_attr, log_buf),
216 		      "BPF_PROG_LOAD_struct.log_buf size mismatch");
217 	static_assert(offsetof(struct BPF_PROG_LOAD_struct, log_buf) == offsetof(union bpf_attr, log_buf),
218 		      "BPF_PROG_LOAD_struct.log_buf offset mismatch");
219 # endif /* HAVE_UNION_BPF_ATTR_LOG_BUF */
220 
221 # ifdef HAVE_UNION_BPF_ATTR_KERN_VERSION
222 	static_assert(SoM(struct BPF_PROG_LOAD_struct, kern_version) == SoM(union bpf_attr, kern_version),
223 		      "BPF_PROG_LOAD_struct.kern_version size mismatch");
224 	static_assert(offsetof(struct BPF_PROG_LOAD_struct, kern_version) == offsetof(union bpf_attr, kern_version),
225 		      "BPF_PROG_LOAD_struct.kern_version offset mismatch");
226 # endif /* HAVE_UNION_BPF_ATTR_KERN_VERSION */
227 
228 # ifdef HAVE_UNION_BPF_ATTR_PROG_FLAGS
229 	static_assert(SoM(struct BPF_PROG_LOAD_struct, prog_flags) == SoM(union bpf_attr, prog_flags),
230 		      "BPF_PROG_LOAD_struct.prog_flags size mismatch");
231 	static_assert(offsetof(struct BPF_PROG_LOAD_struct, prog_flags) == offsetof(union bpf_attr, prog_flags),
232 		      "BPF_PROG_LOAD_struct.prog_flags offset mismatch");
233 # endif /* HAVE_UNION_BPF_ATTR_PROG_FLAGS */
234 
235 # ifdef HAVE_UNION_BPF_ATTR_PROG_NAME
236 	static_assert(SoM(struct BPF_PROG_LOAD_struct, prog_name) == SoM(union bpf_attr, prog_name),
237 		      "BPF_PROG_LOAD_struct.prog_name size mismatch");
238 	static_assert(offsetof(struct BPF_PROG_LOAD_struct, prog_name) == offsetof(union bpf_attr, prog_name),
239 		      "BPF_PROG_LOAD_struct.prog_name offset mismatch");
240 # endif /* HAVE_UNION_BPF_ATTR_PROG_NAME */
241 
242 # ifdef HAVE_UNION_BPF_ATTR_PROG_IFINDEX
243 	static_assert(SoM(struct BPF_PROG_LOAD_struct, prog_ifindex) == SoM(union bpf_attr, prog_ifindex),
244 		      "BPF_PROG_LOAD_struct.prog_ifindex size mismatch");
245 	static_assert(offsetof(struct BPF_PROG_LOAD_struct, prog_ifindex) == offsetof(union bpf_attr, prog_ifindex),
246 		      "BPF_PROG_LOAD_struct.prog_ifindex offset mismatch");
247 # endif /* HAVE_UNION_BPF_ATTR_PROG_IFINDEX */
248 
249 # ifdef HAVE_UNION_BPF_ATTR_EXPECTED_ATTACH_TYPE
250 	static_assert(SoM(struct BPF_PROG_LOAD_struct, expected_attach_type) == SoM(union bpf_attr, expected_attach_type),
251 		      "BPF_PROG_LOAD_struct.expected_attach_type size mismatch");
252 	static_assert(offsetof(struct BPF_PROG_LOAD_struct, expected_attach_type) == offsetof(union bpf_attr, expected_attach_type),
253 		      "BPF_PROG_LOAD_struct.expected_attach_type offset mismatch");
254 # endif /* HAVE_UNION_BPF_ATTR_EXPECTED_ATTACH_TYPE */
255 
256 static_assert(BPF_PROG_LOAD_struct_size == expected_BPF_PROG_LOAD_struct_size,
257 	      "BPF_PROG_LOAD_struct_size mismatch");
258 
259 # ifdef HAVE_UNION_BPF_ATTR_PATHNAME
260 	static_assert(SoM(struct BPF_OBJ_PIN_struct, pathname) == SoM(union bpf_attr, pathname),
261 		      "BPF_OBJ_PIN_struct.pathname size mismatch");
262 	static_assert(offsetof(struct BPF_OBJ_PIN_struct, pathname) == offsetof(union bpf_attr, pathname),
263 		      "BPF_OBJ_PIN_struct.pathname offset mismatch");
264 # endif /* HAVE_UNION_BPF_ATTR_PATHNAME */
265 
266 # ifdef HAVE_UNION_BPF_ATTR_BPF_FD
267 	static_assert(SoM(struct BPF_OBJ_PIN_struct, bpf_fd) == SoM(union bpf_attr, bpf_fd),
268 		      "BPF_OBJ_PIN_struct.bpf_fd size mismatch");
269 	static_assert(offsetof(struct BPF_OBJ_PIN_struct, bpf_fd) == offsetof(union bpf_attr, bpf_fd),
270 		      "BPF_OBJ_PIN_struct.bpf_fd offset mismatch");
271 # endif /* HAVE_UNION_BPF_ATTR_BPF_FD */
272 
273 # ifdef HAVE_UNION_BPF_ATTR_FILE_FLAGS
274 	static_assert(SoM(struct BPF_OBJ_PIN_struct, file_flags) == SoM(union bpf_attr, file_flags),
275 		      "BPF_OBJ_PIN_struct.file_flags size mismatch");
276 	static_assert(offsetof(struct BPF_OBJ_PIN_struct, file_flags) == offsetof(union bpf_attr, file_flags),
277 		      "BPF_OBJ_PIN_struct.file_flags offset mismatch");
278 # endif /* HAVE_UNION_BPF_ATTR_FILE_FLAGS */
279 
280 static_assert(BPF_OBJ_PIN_struct_size == expected_BPF_OBJ_PIN_struct_size,
281 	      "BPF_OBJ_PIN_struct_size mismatch");
282 
283 # ifdef HAVE_UNION_BPF_ATTR_TARGET_FD
284 	static_assert(SoM(struct BPF_PROG_ATTACH_struct, target_fd) == SoM(union bpf_attr, target_fd),
285 		      "BPF_PROG_ATTACH_struct.target_fd size mismatch");
286 	static_assert(offsetof(struct BPF_PROG_ATTACH_struct, target_fd) == offsetof(union bpf_attr, target_fd),
287 		      "BPF_PROG_ATTACH_struct.target_fd offset mismatch");
288 # endif /* HAVE_UNION_BPF_ATTR_TARGET_FD */
289 
290 # ifdef HAVE_UNION_BPF_ATTR_ATTACH_BPF_FD
291 	static_assert(SoM(struct BPF_PROG_ATTACH_struct, attach_bpf_fd) == SoM(union bpf_attr, attach_bpf_fd),
292 		      "BPF_PROG_ATTACH_struct.attach_bpf_fd size mismatch");
293 	static_assert(offsetof(struct BPF_PROG_ATTACH_struct, attach_bpf_fd) == offsetof(union bpf_attr, attach_bpf_fd),
294 		      "BPF_PROG_ATTACH_struct.attach_bpf_fd offset mismatch");
295 # endif /* HAVE_UNION_BPF_ATTR_ATTACH_BPF_FD */
296 
297 # ifdef HAVE_UNION_BPF_ATTR_ATTACH_TYPE
298 	static_assert(SoM(struct BPF_PROG_ATTACH_struct, attach_type) == SoM(union bpf_attr, attach_type),
299 		      "BPF_PROG_ATTACH_struct.attach_type size mismatch");
300 	static_assert(offsetof(struct BPF_PROG_ATTACH_struct, attach_type) == offsetof(union bpf_attr, attach_type),
301 		      "BPF_PROG_ATTACH_struct.attach_type offset mismatch");
302 # endif /* HAVE_UNION_BPF_ATTR_ATTACH_TYPE */
303 
304 # ifdef HAVE_UNION_BPF_ATTR_ATTACH_FLAGS
305 	static_assert(SoM(struct BPF_PROG_ATTACH_struct, attach_flags) == SoM(union bpf_attr, attach_flags),
306 		      "BPF_PROG_ATTACH_struct.attach_flags size mismatch");
307 	static_assert(offsetof(struct BPF_PROG_ATTACH_struct, attach_flags) == offsetof(union bpf_attr, attach_flags),
308 		      "BPF_PROG_ATTACH_struct.attach_flags offset mismatch");
309 # endif /* HAVE_UNION_BPF_ATTR_ATTACH_FLAGS */
310 
311 static_assert(BPF_PROG_ATTACH_struct_size == expected_BPF_PROG_ATTACH_struct_size,
312 	      "BPF_PROG_ATTACH_struct_size mismatch");
313 
314 # ifdef HAVE_UNION_BPF_ATTR_TARGET_FD
315 	static_assert(SoM(struct BPF_PROG_DETACH_struct, target_fd) == SoM(union bpf_attr, target_fd),
316 		      "BPF_PROG_DETACH_struct.target_fd size mismatch");
317 	static_assert(offsetof(struct BPF_PROG_DETACH_struct, target_fd) == offsetof(union bpf_attr, target_fd),
318 		      "BPF_PROG_DETACH_struct.target_fd offset mismatch");
319 # endif /* HAVE_UNION_BPF_ATTR_TARGET_FD */
320 
321 # ifdef HAVE_UNION_BPF_ATTR_DUMMY
322 	static_assert(SoM(struct BPF_PROG_DETACH_struct, dummy) == SoM(union bpf_attr, dummy),
323 		      "BPF_PROG_DETACH_struct.dummy size mismatch");
324 	static_assert(offsetof(struct BPF_PROG_DETACH_struct, dummy) == offsetof(union bpf_attr, dummy),
325 		      "BPF_PROG_DETACH_struct.dummy offset mismatch");
326 # endif /* HAVE_UNION_BPF_ATTR_DUMMY */
327 
328 # ifdef HAVE_UNION_BPF_ATTR_ATTACH_TYPE
329 	static_assert(SoM(struct BPF_PROG_DETACH_struct, attach_type) == SoM(union bpf_attr, attach_type),
330 		      "BPF_PROG_DETACH_struct.attach_type size mismatch");
331 	static_assert(offsetof(struct BPF_PROG_DETACH_struct, attach_type) == offsetof(union bpf_attr, attach_type),
332 		      "BPF_PROG_DETACH_struct.attach_type offset mismatch");
333 # endif /* HAVE_UNION_BPF_ATTR_ATTACH_TYPE */
334 
335 static_assert(BPF_PROG_DETACH_struct_size == expected_BPF_PROG_DETACH_struct_size,
336 	      "BPF_PROG_DETACH_struct_size mismatch");
337 
338 # ifdef HAVE_UNION_BPF_ATTR_TEST_PROG_FD
339 	static_assert(SoM(struct BPF_PROG_TEST_RUN_struct, prog_fd) == SoM(union bpf_attr, test.prog_fd),
340 		      "BPF_PROG_TEST_RUN_struct.prog_fd size mismatch");
341 	static_assert(offsetof(struct BPF_PROG_TEST_RUN_struct, prog_fd) == offsetof(union bpf_attr, test.prog_fd),
342 		      "BPF_PROG_TEST_RUN_struct.prog_fd offset mismatch");
343 # endif /* HAVE_UNION_BPF_ATTR_TEST_PROG_FD */
344 
345 # ifdef HAVE_UNION_BPF_ATTR_TEST_RETVAL
346 	static_assert(SoM(struct BPF_PROG_TEST_RUN_struct, retval) == SoM(union bpf_attr, test.retval),
347 		      "BPF_PROG_TEST_RUN_struct.retval size mismatch");
348 	static_assert(offsetof(struct BPF_PROG_TEST_RUN_struct, retval) == offsetof(union bpf_attr, test.retval),
349 		      "BPF_PROG_TEST_RUN_struct.retval offset mismatch");
350 # endif /* HAVE_UNION_BPF_ATTR_TEST_RETVAL */
351 
352 # ifdef HAVE_UNION_BPF_ATTR_TEST_DATA_SIZE_IN
353 	static_assert(SoM(struct BPF_PROG_TEST_RUN_struct, data_size_in) == SoM(union bpf_attr, test.data_size_in),
354 		      "BPF_PROG_TEST_RUN_struct.data_size_in size mismatch");
355 	static_assert(offsetof(struct BPF_PROG_TEST_RUN_struct, data_size_in) == offsetof(union bpf_attr, test.data_size_in),
356 		      "BPF_PROG_TEST_RUN_struct.data_size_in offset mismatch");
357 # endif /* HAVE_UNION_BPF_ATTR_TEST_DATA_SIZE_IN */
358 
359 # ifdef HAVE_UNION_BPF_ATTR_TEST_DATA_SIZE_OUT
360 	static_assert(SoM(struct BPF_PROG_TEST_RUN_struct, data_size_out) == SoM(union bpf_attr, test.data_size_out),
361 		      "BPF_PROG_TEST_RUN_struct.data_size_out size mismatch");
362 	static_assert(offsetof(struct BPF_PROG_TEST_RUN_struct, data_size_out) == offsetof(union bpf_attr, test.data_size_out),
363 		      "BPF_PROG_TEST_RUN_struct.data_size_out offset mismatch");
364 # endif /* HAVE_UNION_BPF_ATTR_TEST_DATA_SIZE_OUT */
365 
366 # ifdef HAVE_UNION_BPF_ATTR_TEST_DATA_IN
367 	static_assert(SoM(struct BPF_PROG_TEST_RUN_struct, data_in) == SoM(union bpf_attr, test.data_in),
368 		      "BPF_PROG_TEST_RUN_struct.data_in size mismatch");
369 	static_assert(offsetof(struct BPF_PROG_TEST_RUN_struct, data_in) == offsetof(union bpf_attr, test.data_in),
370 		      "BPF_PROG_TEST_RUN_struct.data_in offset mismatch");
371 # endif /* HAVE_UNION_BPF_ATTR_TEST_DATA_IN */
372 
373 # ifdef HAVE_UNION_BPF_ATTR_TEST_DATA_OUT
374 	static_assert(SoM(struct BPF_PROG_TEST_RUN_struct, data_out) == SoM(union bpf_attr, test.data_out),
375 		      "BPF_PROG_TEST_RUN_struct.data_out size mismatch");
376 	static_assert(offsetof(struct BPF_PROG_TEST_RUN_struct, data_out) == offsetof(union bpf_attr, test.data_out),
377 		      "BPF_PROG_TEST_RUN_struct.data_out offset mismatch");
378 # endif /* HAVE_UNION_BPF_ATTR_TEST_DATA_OUT */
379 
380 # ifdef HAVE_UNION_BPF_ATTR_TEST_REPEAT
381 	static_assert(SoM(struct BPF_PROG_TEST_RUN_struct, repeat) == SoM(union bpf_attr, test.repeat),
382 		      "BPF_PROG_TEST_RUN_struct.repeat size mismatch");
383 	static_assert(offsetof(struct BPF_PROG_TEST_RUN_struct, repeat) == offsetof(union bpf_attr, test.repeat),
384 		      "BPF_PROG_TEST_RUN_struct.repeat offset mismatch");
385 # endif /* HAVE_UNION_BPF_ATTR_TEST_REPEAT */
386 
387 # ifdef HAVE_UNION_BPF_ATTR_TEST_DURATION
388 	static_assert(SoM(struct BPF_PROG_TEST_RUN_struct, duration) == SoM(union bpf_attr, test.duration),
389 		      "BPF_PROG_TEST_RUN_struct.duration size mismatch");
390 	static_assert(offsetof(struct BPF_PROG_TEST_RUN_struct, duration) == offsetof(union bpf_attr, test.duration),
391 		      "BPF_PROG_TEST_RUN_struct.duration offset mismatch");
392 # endif /* HAVE_UNION_BPF_ATTR_TEST_DURATION */
393 
394 static_assert(BPF_PROG_TEST_RUN_struct_size == expected_BPF_PROG_TEST_RUN_struct_size,
395 	      "BPF_PROG_TEST_RUN_struct_size mismatch");
396 
397 # ifdef HAVE_UNION_BPF_ATTR_START_ID
398 	static_assert(SoM(struct BPF_PROG_GET_NEXT_ID_struct, start_id) == SoM(union bpf_attr, start_id),
399 		      "BPF_PROG_GET_NEXT_ID_struct.start_id size mismatch");
400 	static_assert(offsetof(struct BPF_PROG_GET_NEXT_ID_struct, start_id) == offsetof(union bpf_attr, start_id),
401 		      "BPF_PROG_GET_NEXT_ID_struct.start_id offset mismatch");
402 # endif /* HAVE_UNION_BPF_ATTR_START_ID */
403 
404 # ifdef HAVE_UNION_BPF_ATTR_NEXT_ID
405 	static_assert(SoM(struct BPF_PROG_GET_NEXT_ID_struct, next_id) == SoM(union bpf_attr, next_id),
406 		      "BPF_PROG_GET_NEXT_ID_struct.next_id size mismatch");
407 	static_assert(offsetof(struct BPF_PROG_GET_NEXT_ID_struct, next_id) == offsetof(union bpf_attr, next_id),
408 		      "BPF_PROG_GET_NEXT_ID_struct.next_id offset mismatch");
409 # endif /* HAVE_UNION_BPF_ATTR_NEXT_ID */
410 
411 # ifdef HAVE_UNION_BPF_ATTR_OPEN_FLAGS
412 	static_assert(SoM(struct BPF_PROG_GET_NEXT_ID_struct, open_flags) == SoM(union bpf_attr, open_flags),
413 		      "BPF_PROG_GET_NEXT_ID_struct.open_flags size mismatch");
414 	static_assert(offsetof(struct BPF_PROG_GET_NEXT_ID_struct, open_flags) == offsetof(union bpf_attr, open_flags),
415 		      "BPF_PROG_GET_NEXT_ID_struct.open_flags offset mismatch");
416 # endif /* HAVE_UNION_BPF_ATTR_OPEN_FLAGS */
417 
418 static_assert(BPF_PROG_GET_NEXT_ID_struct_size == expected_BPF_PROG_GET_NEXT_ID_struct_size,
419 	      "BPF_PROG_GET_NEXT_ID_struct_size mismatch");
420 
421 # ifdef HAVE_UNION_BPF_ATTR_PROG_ID
422 	static_assert(SoM(struct BPF_PROG_GET_FD_BY_ID_struct, prog_id) == SoM(union bpf_attr, prog_id),
423 		      "BPF_PROG_GET_FD_BY_ID_struct.prog_id size mismatch");
424 	static_assert(offsetof(struct BPF_PROG_GET_FD_BY_ID_struct, prog_id) == offsetof(union bpf_attr, prog_id),
425 		      "BPF_PROG_GET_FD_BY_ID_struct.prog_id offset mismatch");
426 # endif /* HAVE_UNION_BPF_ATTR_PROG_ID */
427 
428 # ifdef HAVE_UNION_BPF_ATTR_NEXT_ID
429 	static_assert(SoM(struct BPF_PROG_GET_FD_BY_ID_struct, next_id) == SoM(union bpf_attr, next_id),
430 		      "BPF_PROG_GET_FD_BY_ID_struct.next_id size mismatch");
431 	static_assert(offsetof(struct BPF_PROG_GET_FD_BY_ID_struct, next_id) == offsetof(union bpf_attr, next_id),
432 		      "BPF_PROG_GET_FD_BY_ID_struct.next_id offset mismatch");
433 # endif /* HAVE_UNION_BPF_ATTR_NEXT_ID */
434 
435 # ifdef HAVE_UNION_BPF_ATTR_OPEN_FLAGS
436 	static_assert(SoM(struct BPF_PROG_GET_FD_BY_ID_struct, open_flags) == SoM(union bpf_attr, open_flags),
437 		      "BPF_PROG_GET_FD_BY_ID_struct.open_flags size mismatch");
438 	static_assert(offsetof(struct BPF_PROG_GET_FD_BY_ID_struct, open_flags) == offsetof(union bpf_attr, open_flags),
439 		      "BPF_PROG_GET_FD_BY_ID_struct.open_flags offset mismatch");
440 # endif /* HAVE_UNION_BPF_ATTR_OPEN_FLAGS */
441 
442 static_assert(BPF_PROG_GET_FD_BY_ID_struct_size == expected_BPF_PROG_GET_FD_BY_ID_struct_size,
443 	      "BPF_PROG_GET_FD_BY_ID_struct_size mismatch");
444 
445 # ifdef HAVE_UNION_BPF_ATTR_MAP_ID
446 	static_assert(SoM(struct BPF_MAP_GET_FD_BY_ID_struct, map_id) == SoM(union bpf_attr, map_id),
447 		      "BPF_MAP_GET_FD_BY_ID_struct.map_id size mismatch");
448 	static_assert(offsetof(struct BPF_MAP_GET_FD_BY_ID_struct, map_id) == offsetof(union bpf_attr, map_id),
449 		      "BPF_MAP_GET_FD_BY_ID_struct.map_id offset mismatch");
450 # endif /* HAVE_UNION_BPF_ATTR_MAP_ID */
451 
452 # ifdef HAVE_UNION_BPF_ATTR_NEXT_ID
453 	static_assert(SoM(struct BPF_MAP_GET_FD_BY_ID_struct, next_id) == SoM(union bpf_attr, next_id),
454 		      "BPF_MAP_GET_FD_BY_ID_struct.next_id size mismatch");
455 	static_assert(offsetof(struct BPF_MAP_GET_FD_BY_ID_struct, next_id) == offsetof(union bpf_attr, next_id),
456 		      "BPF_MAP_GET_FD_BY_ID_struct.next_id offset mismatch");
457 # endif /* HAVE_UNION_BPF_ATTR_NEXT_ID */
458 
459 # ifdef HAVE_UNION_BPF_ATTR_OPEN_FLAGS
460 	static_assert(SoM(struct BPF_MAP_GET_FD_BY_ID_struct, open_flags) == SoM(union bpf_attr, open_flags),
461 		      "BPF_MAP_GET_FD_BY_ID_struct.open_flags size mismatch");
462 	static_assert(offsetof(struct BPF_MAP_GET_FD_BY_ID_struct, open_flags) == offsetof(union bpf_attr, open_flags),
463 		      "BPF_MAP_GET_FD_BY_ID_struct.open_flags offset mismatch");
464 # endif /* HAVE_UNION_BPF_ATTR_OPEN_FLAGS */
465 
466 static_assert(BPF_MAP_GET_FD_BY_ID_struct_size == expected_BPF_MAP_GET_FD_BY_ID_struct_size,
467 	      "BPF_MAP_GET_FD_BY_ID_struct_size mismatch");
468 
469 # ifdef HAVE_UNION_BPF_ATTR_INFO_BPF_FD
470 	static_assert(SoM(struct BPF_OBJ_GET_INFO_BY_FD_struct, bpf_fd) == SoM(union bpf_attr, info.bpf_fd),
471 		      "BPF_OBJ_GET_INFO_BY_FD_struct.bpf_fd size mismatch");
472 	static_assert(offsetof(struct BPF_OBJ_GET_INFO_BY_FD_struct, bpf_fd) == offsetof(union bpf_attr, info.bpf_fd),
473 		      "BPF_OBJ_GET_INFO_BY_FD_struct.bpf_fd offset mismatch");
474 # endif /* HAVE_UNION_BPF_ATTR_INFO_BPF_FD */
475 
476 # ifdef HAVE_UNION_BPF_ATTR_INFO_INFO_LEN
477 	static_assert(SoM(struct BPF_OBJ_GET_INFO_BY_FD_struct, info_len) == SoM(union bpf_attr, info.info_len),
478 		      "BPF_OBJ_GET_INFO_BY_FD_struct.info_len size mismatch");
479 	static_assert(offsetof(struct BPF_OBJ_GET_INFO_BY_FD_struct, info_len) == offsetof(union bpf_attr, info.info_len),
480 		      "BPF_OBJ_GET_INFO_BY_FD_struct.info_len offset mismatch");
481 # endif /* HAVE_UNION_BPF_ATTR_INFO_INFO_LEN */
482 
483 # ifdef HAVE_UNION_BPF_ATTR_INFO_INFO
484 	static_assert(SoM(struct BPF_OBJ_GET_INFO_BY_FD_struct, info) == SoM(union bpf_attr, info.info),
485 		      "BPF_OBJ_GET_INFO_BY_FD_struct.info size mismatch");
486 	static_assert(offsetof(struct BPF_OBJ_GET_INFO_BY_FD_struct, info) == offsetof(union bpf_attr, info.info),
487 		      "BPF_OBJ_GET_INFO_BY_FD_struct.info offset mismatch");
488 # endif /* HAVE_UNION_BPF_ATTR_INFO_INFO */
489 
490 static_assert(BPF_OBJ_GET_INFO_BY_FD_struct_size == expected_BPF_OBJ_GET_INFO_BY_FD_struct_size,
491 	      "BPF_OBJ_GET_INFO_BY_FD_struct_size mismatch");
492 
493 # ifdef HAVE_UNION_BPF_ATTR_QUERY_TARGET_FD
494 	static_assert(SoM(struct BPF_PROG_QUERY_struct, target_fd) == SoM(union bpf_attr, query.target_fd),
495 		      "BPF_PROG_QUERY_struct.target_fd size mismatch");
496 	static_assert(offsetof(struct BPF_PROG_QUERY_struct, target_fd) == offsetof(union bpf_attr, query.target_fd),
497 		      "BPF_PROG_QUERY_struct.target_fd offset mismatch");
498 # endif /* HAVE_UNION_BPF_ATTR_QUERY_TARGET_FD */
499 
500 # ifdef HAVE_UNION_BPF_ATTR_QUERY_ATTACH_TYPE
501 	static_assert(SoM(struct BPF_PROG_QUERY_struct, attach_type) == SoM(union bpf_attr, query.attach_type),
502 		      "BPF_PROG_QUERY_struct.attach_type size mismatch");
503 	static_assert(offsetof(struct BPF_PROG_QUERY_struct, attach_type) == offsetof(union bpf_attr, query.attach_type),
504 		      "BPF_PROG_QUERY_struct.attach_type offset mismatch");
505 # endif /* HAVE_UNION_BPF_ATTR_QUERY_ATTACH_TYPE */
506 
507 # ifdef HAVE_UNION_BPF_ATTR_QUERY_QUERY_FLAGS
508 	static_assert(SoM(struct BPF_PROG_QUERY_struct, query_flags) == SoM(union bpf_attr, query.query_flags),
509 		      "BPF_PROG_QUERY_struct.query_flags size mismatch");
510 	static_assert(offsetof(struct BPF_PROG_QUERY_struct, query_flags) == offsetof(union bpf_attr, query.query_flags),
511 		      "BPF_PROG_QUERY_struct.query_flags offset mismatch");
512 # endif /* HAVE_UNION_BPF_ATTR_QUERY_QUERY_FLAGS */
513 
514 # ifdef HAVE_UNION_BPF_ATTR_QUERY_ATTACH_FLAGS
515 	static_assert(SoM(struct BPF_PROG_QUERY_struct, attach_flags) == SoM(union bpf_attr, query.attach_flags),
516 		      "BPF_PROG_QUERY_struct.attach_flags size mismatch");
517 	static_assert(offsetof(struct BPF_PROG_QUERY_struct, attach_flags) == offsetof(union bpf_attr, query.attach_flags),
518 		      "BPF_PROG_QUERY_struct.attach_flags offset mismatch");
519 # endif /* HAVE_UNION_BPF_ATTR_QUERY_ATTACH_FLAGS */
520 
521 # ifdef HAVE_UNION_BPF_ATTR_QUERY_PROG_IDS
522 	static_assert(SoM(struct BPF_PROG_QUERY_struct, prog_ids) == SoM(union bpf_attr, query.prog_ids),
523 		      "BPF_PROG_QUERY_struct.prog_ids size mismatch");
524 	static_assert(offsetof(struct BPF_PROG_QUERY_struct, prog_ids) == offsetof(union bpf_attr, query.prog_ids),
525 		      "BPF_PROG_QUERY_struct.prog_ids offset mismatch");
526 # endif /* HAVE_UNION_BPF_ATTR_QUERY_PROG_IDS */
527 
528 # ifdef HAVE_UNION_BPF_ATTR_QUERY_PROG_CNT
529 	static_assert(SoM(struct BPF_PROG_QUERY_struct, prog_cnt) == SoM(union bpf_attr, query.prog_cnt),
530 		      "BPF_PROG_QUERY_struct.prog_cnt size mismatch");
531 	static_assert(offsetof(struct BPF_PROG_QUERY_struct, prog_cnt) == offsetof(union bpf_attr, query.prog_cnt),
532 		      "BPF_PROG_QUERY_struct.prog_cnt offset mismatch");
533 # endif /* HAVE_UNION_BPF_ATTR_QUERY_PROG_CNT */
534 
535 static_assert(BPF_PROG_QUERY_struct_size == expected_BPF_PROG_QUERY_struct_size,
536 	      "BPF_PROG_QUERY_struct_size mismatch");
537 
538 # ifdef HAVE_UNION_BPF_ATTR_RAW_TRACEPOINT_NAME
539 	static_assert(SoM(struct BPF_RAW_TRACEPOINT_OPEN_struct, name) == SoM(union bpf_attr, raw_tracepoint.name),
540 		      "BPF_RAW_TRACEPOINT_OPEN_struct.name size mismatch");
541 	static_assert(offsetof(struct BPF_RAW_TRACEPOINT_OPEN_struct, name) == offsetof(union bpf_attr, raw_tracepoint.name),
542 		      "BPF_RAW_TRACEPOINT_OPEN_struct.name offset mismatch");
543 # endif /* HAVE_UNION_BPF_ATTR_RAW_TRACEPOINT_NAME */
544 
545 # ifdef HAVE_UNION_BPF_ATTR_RAW_TRACEPOINT_PROG_FD
546 	static_assert(SoM(struct BPF_RAW_TRACEPOINT_OPEN_struct, prog_fd) == SoM(union bpf_attr, raw_tracepoint.prog_fd),
547 		      "BPF_RAW_TRACEPOINT_OPEN_struct.prog_fd size mismatch");
548 	static_assert(offsetof(struct BPF_RAW_TRACEPOINT_OPEN_struct, prog_fd) == offsetof(union bpf_attr, raw_tracepoint.prog_fd),
549 		      "BPF_RAW_TRACEPOINT_OPEN_struct.prog_fd offset mismatch");
550 # endif /* HAVE_UNION_BPF_ATTR_RAW_TRACEPOINT_PROG_FD */
551 
552 static_assert(BPF_RAW_TRACEPOINT_OPEN_struct_size == expected_BPF_RAW_TRACEPOINT_OPEN_struct_size,
553 	      "BPF_RAW_TRACEPOINT_OPEN_struct_size mismatch");
554 
555 # ifdef HAVE_STRUCT_BPF_MAP_INFO_TYPE
556 	static_assert(SoM(struct bpf_map_info_struct, type) == SoM(struct bpf_map_info, type),
557 		      "bpf_map_info_struct.type size mismatch");
558 	static_assert(offsetof(struct bpf_map_info_struct, type) == offsetof(struct bpf_map_info, type),
559 		      "bpf_map_info_struct.type offset mismatch");
560 # endif /* HAVE_STRUCT_BPF_MAP_INFO_TYPE */
561 
562 # ifdef HAVE_STRUCT_BPF_MAP_INFO_ID
563 	static_assert(SoM(struct bpf_map_info_struct, id) == SoM(struct bpf_map_info, id),
564 		      "bpf_map_info_struct.id size mismatch");
565 	static_assert(offsetof(struct bpf_map_info_struct, id) == offsetof(struct bpf_map_info, id),
566 		      "bpf_map_info_struct.id offset mismatch");
567 # endif /* HAVE_STRUCT_BPF_MAP_INFO_ID */
568 
569 # ifdef HAVE_STRUCT_BPF_MAP_INFO_KEY_SIZE
570 	static_assert(SoM(struct bpf_map_info_struct, key_size) == SoM(struct bpf_map_info, key_size),
571 		      "bpf_map_info_struct.key_size size mismatch");
572 	static_assert(offsetof(struct bpf_map_info_struct, key_size) == offsetof(struct bpf_map_info, key_size),
573 		      "bpf_map_info_struct.key_size offset mismatch");
574 # endif /* HAVE_STRUCT_BPF_MAP_INFO_KEY_SIZE */
575 
576 # ifdef HAVE_STRUCT_BPF_MAP_INFO_VALUE_SIZE
577 	static_assert(SoM(struct bpf_map_info_struct, value_size) == SoM(struct bpf_map_info, value_size),
578 		      "bpf_map_info_struct.value_size size mismatch");
579 	static_assert(offsetof(struct bpf_map_info_struct, value_size) == offsetof(struct bpf_map_info, value_size),
580 		      "bpf_map_info_struct.value_size offset mismatch");
581 # endif /* HAVE_STRUCT_BPF_MAP_INFO_VALUE_SIZE */
582 
583 # ifdef HAVE_STRUCT_BPF_MAP_INFO_MAX_ENTRIES
584 	static_assert(SoM(struct bpf_map_info_struct, max_entries) == SoM(struct bpf_map_info, max_entries),
585 		      "bpf_map_info_struct.max_entries size mismatch");
586 	static_assert(offsetof(struct bpf_map_info_struct, max_entries) == offsetof(struct bpf_map_info, max_entries),
587 		      "bpf_map_info_struct.max_entries offset mismatch");
588 # endif /* HAVE_STRUCT_BPF_MAP_INFO_MAX_ENTRIES */
589 
590 # ifdef HAVE_STRUCT_BPF_MAP_INFO_MAP_FLAGS
591 	static_assert(SoM(struct bpf_map_info_struct, map_flags) == SoM(struct bpf_map_info, map_flags),
592 		      "bpf_map_info_struct.map_flags size mismatch");
593 	static_assert(offsetof(struct bpf_map_info_struct, map_flags) == offsetof(struct bpf_map_info, map_flags),
594 		      "bpf_map_info_struct.map_flags offset mismatch");
595 # endif /* HAVE_STRUCT_BPF_MAP_INFO_MAP_FLAGS */
596 
597 # ifdef HAVE_STRUCT_BPF_MAP_INFO_NAME
598 	static_assert(SoM(struct bpf_map_info_struct, name) == SoM(struct bpf_map_info, name),
599 		      "bpf_map_info_struct.name size mismatch");
600 	static_assert(offsetof(struct bpf_map_info_struct, name) == offsetof(struct bpf_map_info, name),
601 		      "bpf_map_info_struct.name offset mismatch");
602 # endif /* HAVE_STRUCT_BPF_MAP_INFO_NAME */
603 
604 # ifdef HAVE_STRUCT_BPF_MAP_INFO_IFINDEX
605 	static_assert(SoM(struct bpf_map_info_struct, ifindex) == SoM(struct bpf_map_info, ifindex),
606 		      "bpf_map_info_struct.ifindex size mismatch");
607 	static_assert(offsetof(struct bpf_map_info_struct, ifindex) == offsetof(struct bpf_map_info, ifindex),
608 		      "bpf_map_info_struct.ifindex offset mismatch");
609 # endif /* HAVE_STRUCT_BPF_MAP_INFO_IFINDEX */
610 
611 static_assert(bpf_map_info_struct_size == expected_bpf_map_info_struct_size,
612 	      "bpf_map_info_struct_size mismatch");
613 
614 # ifdef HAVE_STRUCT_BPF_PROG_INFO_TYPE
615 	static_assert(SoM(struct bpf_prog_info_struct, type) == SoM(struct bpf_prog_info, type),
616 		      "bpf_prog_info_struct.type size mismatch");
617 	static_assert(offsetof(struct bpf_prog_info_struct, type) == offsetof(struct bpf_prog_info, type),
618 		      "bpf_prog_info_struct.type offset mismatch");
619 # endif /* HAVE_STRUCT_BPF_PROG_INFO_TYPE */
620 
621 # ifdef HAVE_STRUCT_BPF_PROG_INFO_ID
622 	static_assert(SoM(struct bpf_prog_info_struct, id) == SoM(struct bpf_prog_info, id),
623 		      "bpf_prog_info_struct.id size mismatch");
624 	static_assert(offsetof(struct bpf_prog_info_struct, id) == offsetof(struct bpf_prog_info, id),
625 		      "bpf_prog_info_struct.id offset mismatch");
626 # endif /* HAVE_STRUCT_BPF_PROG_INFO_ID */
627 
628 # ifdef HAVE_STRUCT_BPF_PROG_INFO_TAG
629 	static_assert(SoM(struct bpf_prog_info_struct, tag) == SoM(struct bpf_prog_info, tag),
630 		      "bpf_prog_info_struct.tag size mismatch");
631 	static_assert(offsetof(struct bpf_prog_info_struct, tag) == offsetof(struct bpf_prog_info, tag),
632 		      "bpf_prog_info_struct.tag offset mismatch");
633 # endif /* HAVE_STRUCT_BPF_PROG_INFO_TAG */
634 
635 # ifdef HAVE_STRUCT_BPF_PROG_INFO_JITED_PROG_LEN
636 	static_assert(SoM(struct bpf_prog_info_struct, jited_prog_len) == SoM(struct bpf_prog_info, jited_prog_len),
637 		      "bpf_prog_info_struct.jited_prog_len size mismatch");
638 	static_assert(offsetof(struct bpf_prog_info_struct, jited_prog_len) == offsetof(struct bpf_prog_info, jited_prog_len),
639 		      "bpf_prog_info_struct.jited_prog_len offset mismatch");
640 # endif /* HAVE_STRUCT_BPF_PROG_INFO_JITED_PROG_LEN */
641 
642 # ifdef HAVE_STRUCT_BPF_PROG_INFO_XLATED_PROG_LEN
643 	static_assert(SoM(struct bpf_prog_info_struct, xlated_prog_len) == SoM(struct bpf_prog_info, xlated_prog_len),
644 		      "bpf_prog_info_struct.xlated_prog_len size mismatch");
645 	static_assert(offsetof(struct bpf_prog_info_struct, xlated_prog_len) == offsetof(struct bpf_prog_info, xlated_prog_len),
646 		      "bpf_prog_info_struct.xlated_prog_len offset mismatch");
647 # endif /* HAVE_STRUCT_BPF_PROG_INFO_XLATED_PROG_LEN */
648 
649 # ifdef HAVE_STRUCT_BPF_PROG_INFO_JITED_PROG_INSNS
650 	static_assert(SoM(struct bpf_prog_info_struct, jited_prog_insns) == SoM(struct bpf_prog_info, jited_prog_insns),
651 		      "bpf_prog_info_struct.jited_prog_insns size mismatch");
652 	static_assert(offsetof(struct bpf_prog_info_struct, jited_prog_insns) == offsetof(struct bpf_prog_info, jited_prog_insns),
653 		      "bpf_prog_info_struct.jited_prog_insns offset mismatch");
654 # endif /* HAVE_STRUCT_BPF_PROG_INFO_JITED_PROG_INSNS */
655 
656 # ifdef HAVE_STRUCT_BPF_PROG_INFO_XLATED_PROG_INSNS
657 	static_assert(SoM(struct bpf_prog_info_struct, xlated_prog_insns) == SoM(struct bpf_prog_info, xlated_prog_insns),
658 		      "bpf_prog_info_struct.xlated_prog_insns size mismatch");
659 	static_assert(offsetof(struct bpf_prog_info_struct, xlated_prog_insns) == offsetof(struct bpf_prog_info, xlated_prog_insns),
660 		      "bpf_prog_info_struct.xlated_prog_insns offset mismatch");
661 # endif /* HAVE_STRUCT_BPF_PROG_INFO_XLATED_PROG_INSNS */
662 
663 # ifdef HAVE_STRUCT_BPF_PROG_INFO_LOAD_TIME
664 	static_assert(SoM(struct bpf_prog_info_struct, load_time) == SoM(struct bpf_prog_info, load_time),
665 		      "bpf_prog_info_struct.load_time size mismatch");
666 	static_assert(offsetof(struct bpf_prog_info_struct, load_time) == offsetof(struct bpf_prog_info, load_time),
667 		      "bpf_prog_info_struct.load_time offset mismatch");
668 # endif /* HAVE_STRUCT_BPF_PROG_INFO_LOAD_TIME */
669 
670 # ifdef HAVE_STRUCT_BPF_PROG_INFO_CREATED_BY_UID
671 	static_assert(SoM(struct bpf_prog_info_struct, created_by_uid) == SoM(struct bpf_prog_info, created_by_uid),
672 		      "bpf_prog_info_struct.created_by_uid size mismatch");
673 	static_assert(offsetof(struct bpf_prog_info_struct, created_by_uid) == offsetof(struct bpf_prog_info, created_by_uid),
674 		      "bpf_prog_info_struct.created_by_uid offset mismatch");
675 # endif /* HAVE_STRUCT_BPF_PROG_INFO_CREATED_BY_UID */
676 
677 # ifdef HAVE_STRUCT_BPF_PROG_INFO_NR_MAP_IDS
678 	static_assert(SoM(struct bpf_prog_info_struct, nr_map_ids) == SoM(struct bpf_prog_info, nr_map_ids),
679 		      "bpf_prog_info_struct.nr_map_ids size mismatch");
680 	static_assert(offsetof(struct bpf_prog_info_struct, nr_map_ids) == offsetof(struct bpf_prog_info, nr_map_ids),
681 		      "bpf_prog_info_struct.nr_map_ids offset mismatch");
682 # endif /* HAVE_STRUCT_BPF_PROG_INFO_NR_MAP_IDS */
683 
684 # ifdef HAVE_STRUCT_BPF_PROG_INFO_MAP_IDS
685 	static_assert(SoM(struct bpf_prog_info_struct, map_ids) == SoM(struct bpf_prog_info, map_ids),
686 		      "bpf_prog_info_struct.map_ids size mismatch");
687 	static_assert(offsetof(struct bpf_prog_info_struct, map_ids) == offsetof(struct bpf_prog_info, map_ids),
688 		      "bpf_prog_info_struct.map_ids offset mismatch");
689 # endif /* HAVE_STRUCT_BPF_PROG_INFO_MAP_IDS */
690 
691 # ifdef HAVE_STRUCT_BPF_PROG_INFO_NAME
692 	static_assert(SoM(struct bpf_prog_info_struct, name) == SoM(struct bpf_prog_info, name),
693 		      "bpf_prog_info_struct.name size mismatch");
694 	static_assert(offsetof(struct bpf_prog_info_struct, name) == offsetof(struct bpf_prog_info, name),
695 		      "bpf_prog_info_struct.name offset mismatch");
696 # endif /* HAVE_STRUCT_BPF_PROG_INFO_NAME */
697 
698 # ifdef HAVE_STRUCT_BPF_PROG_INFO_IFINDEX
699 	static_assert(SoM(struct bpf_prog_info_struct, ifindex) == SoM(struct bpf_prog_info, ifindex),
700 		      "bpf_prog_info_struct.ifindex size mismatch");
701 	static_assert(offsetof(struct bpf_prog_info_struct, ifindex) == offsetof(struct bpf_prog_info, ifindex),
702 		      "bpf_prog_info_struct.ifindex offset mismatch");
703 # endif /* HAVE_STRUCT_BPF_PROG_INFO_IFINDEX */
704 
705 static_assert(bpf_prog_info_struct_size == expected_bpf_prog_info_struct_size,
706 	      "bpf_prog_info_struct_size mismatch");
707 
708 #endif /* HAVE_LINUX_BPF_H */
709