aboutsummaryrefslogtreecommitdiff
path: root/bpf_attr_check.c
blob: cae1e71c5e25da61657f7624d6f04b42b3a37382 (plain)
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
/* Generated by ./gen_bpf_attr_check.sh from bpf_attr.h; do not edit. */
#include "defs.h"
#ifdef HAVE_LINUX_BPF_H
# include <linux/bpf.h>
# include "bpf_attr.h"
# include "static_assert.h"

# define SoM(type_, member_) (sizeof(((type_ *)0)->member_))

# ifdef HAVE_UNION_BPF_ATTR_MAP_TYPE
	static_assert(SoM(struct BPF_MAP_CREATE_struct, map_type) == SoM(union bpf_attr, map_type),
		      "BPF_MAP_CREATE_struct.map_type size mismatch");
	static_assert(offsetof(struct BPF_MAP_CREATE_struct, map_type) == offsetof(union bpf_attr, map_type),
		      "BPF_MAP_CREATE_struct.map_type offset mismatch");
# endif /* HAVE_UNION_BPF_ATTR_MAP_TYPE */

# ifdef HAVE_UNION_BPF_ATTR_KEY_SIZE
	static_assert(SoM(struct BPF_MAP_CREATE_struct, key_size) == SoM(union bpf_attr, key_size),
		      "BPF_MAP_CREATE_struct.key_size size mismatch");
	static_assert(offsetof(struct BPF_MAP_CREATE_struct, key_size) == offsetof(union bpf_attr, key_size),
		      "BPF_MAP_CREATE_struct.key_size offset mismatch");
# endif /* HAVE_UNION_BPF_ATTR_KEY_SIZE */

# ifdef HAVE_UNION_BPF_ATTR_VALUE_SIZE
	static_assert(SoM(struct BPF_MAP_CREATE_struct, value_size) == SoM(union bpf_attr, value_size),
		      "BPF_MAP_CREATE_struct.value_size size mismatch");
	static_assert(offsetof(struct BPF_MAP_CREATE_struct, value_size) == offsetof(union bpf_attr, value_size),
		      "BPF_MAP_CREATE_struct.value_size offset mismatch");
# endif /* HAVE_UNION_BPF_ATTR_VALUE_SIZE */

# ifdef HAVE_UNION_BPF_ATTR_MAX_ENTRIES
	static_assert(SoM(struct BPF_MAP_CREATE_struct, max_entries) == SoM(union bpf_attr, max_entries),
		      "BPF_MAP_CREATE_struct.max_entries size mismatch");
	static_assert(offsetof(struct BPF_MAP_CREATE_struct, max_entries) == offsetof(union bpf_attr, max_entries),
		      "BPF_MAP_CREATE_struct.max_entries offset mismatch");
# endif /* HAVE_UNION_BPF_ATTR_MAX_ENTRIES */

# ifdef HAVE_UNION_BPF_ATTR_MAP_FLAGS
	static_assert(SoM(struct BPF_MAP_CREATE_struct, map_flags) == SoM(union bpf_attr, map_flags),
		      "BPF_MAP_CREATE_struct.map_flags size mismatch");
	static_assert(offsetof(struct BPF_MAP_CREATE_struct, map_flags) == offsetof(union bpf_attr, map_flags),
		      "BPF_MAP_CREATE_struct.map_flags offset mismatch");
# endif /* HAVE_UNION_BPF_ATTR_MAP_FLAGS */

# ifdef HAVE_UNION_BPF_ATTR_INNER_MAP_FD
	static_assert(SoM(struct BPF_MAP_CREATE_struct, inner_map_fd) == SoM(union bpf_attr, inner_map_fd),
		      "BPF_MAP_CREATE_struct.inner_map_fd size mismatch");
	static_assert(offsetof(struct BPF_MAP_CREATE_struct, inner_map_fd) == offsetof(union bpf_attr, inner_map_fd),
		      "BPF_MAP_CREATE_struct.inner_map_fd offset mismatch");
# endif /* HAVE_UNION_BPF_ATTR_INNER_MAP_FD */

# ifdef HAVE_UNION_BPF_ATTR_NUMA_NODE
	static_assert(SoM(struct BPF_MAP_CREATE_struct, numa_node) == SoM(union bpf_attr, numa_node),
		      "BPF_MAP_CREATE_struct.numa_node size mismatch");
	static_assert(offsetof(struct BPF_MAP_CREATE_struct, numa_node) == offsetof(union bpf_attr, numa_node),
		      "BPF_MAP_CREATE_struct.numa_node offset mismatch");
# endif /* HAVE_UNION_BPF_ATTR_NUMA_NODE */

# ifdef HAVE_UNION_BPF_ATTR_MAP_NAME
	static_assert(SoM(struct BPF_MAP_CREATE_struct, map_name) == SoM(union bpf_attr, map_name),
		      "BPF_MAP_CREATE_struct.map_name size mismatch");
	static_assert(offsetof(struct BPF_MAP_CREATE_struct, map_name) == offsetof(union bpf_attr, map_name),
		      "BPF_MAP_CREATE_struct.map_name offset mismatch");
# endif /* HAVE_UNION_BPF_ATTR_MAP_NAME */

# ifdef HAVE_UNION_BPF_ATTR_MAP_IFINDEX
	static_assert(SoM(struct BPF_MAP_CREATE_struct, map_ifindex) == SoM(union bpf_attr, map_ifindex),
		      "BPF_MAP_CREATE_struct.map_ifindex size mismatch");
	static_assert(offsetof(struct BPF_MAP_CREATE_struct, map_ifindex) == offsetof(union bpf_attr, map_ifindex),
		      "BPF_MAP_CREATE_struct.map_ifindex offset mismatch");
# endif /* HAVE_UNION_BPF_ATTR_MAP_IFINDEX */

static_assert(BPF_MAP_CREATE_struct_size == expected_BPF_MAP_CREATE_struct_size,
	      "BPF_MAP_CREATE_struct_size mismatch");

# ifdef HAVE_UNION_BPF_ATTR_MAP_FD
	static_assert(SoM(struct BPF_MAP_LOOKUP_ELEM_struct, map_fd) == SoM(union bpf_attr, map_fd),
		      "BPF_MAP_LOOKUP_ELEM_struct.map_fd size mismatch");
	static_assert(offsetof(struct BPF_MAP_LOOKUP_ELEM_struct, map_fd) == offsetof(union bpf_attr, map_fd),
		      "BPF_MAP_LOOKUP_ELEM_struct.map_fd offset mismatch");
# endif /* HAVE_UNION_BPF_ATTR_MAP_FD */

# ifdef HAVE_UNION_BPF_ATTR_KEY
	static_assert(SoM(struct BPF_MAP_LOOKUP_ELEM_struct, key) == SoM(union bpf_attr, key),
		      "BPF_MAP_LOOKUP_ELEM_struct.key size mismatch");
	static_assert(offsetof(struct BPF_MAP_LOOKUP_ELEM_struct, key) == offsetof(union bpf_attr, key),
		      "BPF_MAP_LOOKUP_ELEM_struct.key offset mismatch");
# endif /* HAVE_UNION_BPF_ATTR_KEY */

# ifdef HAVE_UNION_BPF_ATTR_VALUE
	static_assert(SoM(struct BPF_MAP_LOOKUP_ELEM_struct, value) == SoM(union bpf_attr, value),
		      "BPF_MAP_LOOKUP_ELEM_struct.value size mismatch");
	static_assert(offsetof(struct BPF_MAP_LOOKUP_ELEM_struct, value) == offsetof(union bpf_attr, value),
		      "BPF_MAP_LOOKUP_ELEM_struct.value offset mismatch");
# endif /* HAVE_UNION_BPF_ATTR_VALUE */

static_assert(BPF_MAP_LOOKUP_ELEM_struct_size == expected_BPF_MAP_LOOKUP_ELEM_struct_size,
	      "BPF_MAP_LOOKUP_ELEM_struct_size mismatch");

# ifdef HAVE_UNION_BPF_ATTR_MAP_FD
	static_assert(SoM(struct BPF_MAP_UPDATE_ELEM_struct, map_fd) == SoM(union bpf_attr, map_fd),
		      "BPF_MAP_UPDATE_ELEM_struct.map_fd size mismatch");
	static_assert(offsetof(struct BPF_MAP_UPDATE_ELEM_struct, map_fd) == offsetof(union bpf_attr, map_fd),
		      "BPF_MAP_UPDATE_ELEM_struct.map_fd offset mismatch");
# endif /* HAVE_UNION_BPF_ATTR_MAP_FD */

# ifdef HAVE_UNION_BPF_ATTR_KEY
	static_assert(SoM(struct BPF_MAP_UPDATE_ELEM_struct, key) == SoM(union bpf_attr, key),
		      "BPF_MAP_UPDATE_ELEM_struct.key size mismatch");
	static_assert(offsetof(struct BPF_MAP_UPDATE_ELEM_struct, key) == offsetof(union bpf_attr, key),
		      "BPF_MAP_UPDATE_ELEM_struct.key offset mismatch");
# endif /* HAVE_UNION_BPF_ATTR_KEY */

# ifdef HAVE_UNION_BPF_ATTR_VALUE
	static_assert(SoM(struct BPF_MAP_UPDATE_ELEM_struct, value) == SoM(union bpf_attr, value),
		      "BPF_MAP_UPDATE_ELEM_struct.value size mismatch");
	static_assert(offsetof(struct BPF_MAP_UPDATE_ELEM_struct, value) == offsetof(union bpf_attr, value),
		      "BPF_MAP_UPDATE_ELEM_struct.value offset mismatch");
# endif /* HAVE_UNION_BPF_ATTR_VALUE */

# ifdef HAVE_UNION_BPF_ATTR_FLAGS
	static_assert(SoM(struct BPF_MAP_UPDATE_ELEM_struct, flags) == SoM(union bpf_attr, flags),
		      "BPF_MAP_UPDATE_ELEM_struct.flags size mismatch");
	static_assert(offsetof(struct BPF_MAP_UPDATE_ELEM_struct, flags) == offsetof(union bpf_attr, flags),
		      "BPF_MAP_UPDATE_ELEM_struct.flags offset mismatch");
# endif /* HAVE_UNION_BPF_ATTR_FLAGS */

static_assert(BPF_MAP_UPDATE_ELEM_struct_size == expected_BPF_MAP_UPDATE_ELEM_struct_size,
	      "BPF_MAP_UPDATE_ELEM_struct_size mismatch");

# ifdef HAVE_UNION_BPF_ATTR_MAP_FD
	static_assert(SoM(struct BPF_MAP_DELETE_ELEM_struct, map_fd) == SoM(union bpf_attr, map_fd),
		      "BPF_MAP_DELETE_ELEM_struct.map_fd size mismatch");
	static_assert(offsetof(struct BPF_MAP_DELETE_ELEM_struct, map_fd) == offsetof(union bpf_attr, map_fd),
		      "BPF_MAP_DELETE_ELEM_struct.map_fd offset mismatch");
# endif /* HAVE_UNION_BPF_ATTR_MAP_FD */

# ifdef HAVE_UNION_BPF_ATTR_KEY
	static_assert(SoM(struct BPF_MAP_DELETE_ELEM_struct, key) == SoM(union bpf_attr, key),
		      "BPF_MAP_DELETE_ELEM_struct.key size mismatch");
	static_assert(offsetof(struct BPF_MAP_DELETE_ELEM_struct, key) == offsetof(union bpf_attr, key),
		      "BPF_MAP_DELETE_ELEM_struct.key offset mismatch");
# endif /* HAVE_UNION_BPF_ATTR_KEY */

static_assert(BPF_MAP_DELETE_ELEM_struct_size == expected_BPF_MAP_DELETE_ELEM_struct_size,
	      "BPF_MAP_DELETE_ELEM_struct_size mismatch");

# ifdef HAVE_UNION_BPF_ATTR_MAP_FD
	static_assert(SoM(struct BPF_MAP_GET_NEXT_KEY_struct, map_fd) == SoM(union bpf_attr, map_fd),
		      "BPF_MAP_GET_NEXT_KEY_struct.map_fd size mismatch");
	static_assert(offsetof(struct BPF_MAP_GET_NEXT_KEY_struct, map_fd) == offsetof(union bpf_attr, map_fd),
		      "BPF_MAP_GET_NEXT_KEY_struct.map_fd offset mismatch");
# endif /* HAVE_UNION_BPF_ATTR_MAP_FD */

# ifdef HAVE_UNION_BPF_ATTR_KEY
	static_assert(SoM(struct BPF_MAP_GET_NEXT_KEY_struct, key) == SoM(union bpf_attr, key),
		      "BPF_MAP_GET_NEXT_KEY_struct.key size mismatch");
	static_assert(offsetof(struct BPF_MAP_GET_NEXT_KEY_struct, key) == offsetof(union bpf_attr, key),
		      "BPF_MAP_GET_NEXT_KEY_struct.key offset mismatch");
# endif /* HAVE_UNION_BPF_ATTR_KEY */

# ifdef HAVE_UNION_BPF_ATTR_NEXT_KEY
	static_assert(SoM(struct BPF_MAP_GET_NEXT_KEY_struct, next_key) == SoM(union bpf_attr, next_key),
		      "BPF_MAP_GET_NEXT_KEY_struct.next_key size mismatch");
	static_assert(offsetof(struct BPF_MAP_GET_NEXT_KEY_struct, next_key) == offsetof(union bpf_attr, next_key),
		      "BPF_MAP_GET_NEXT_KEY_struct.next_key offset mismatch");
# endif /* HAVE_UNION_BPF_ATTR_NEXT_KEY */

static_assert(BPF_MAP_GET_NEXT_KEY_struct_size == expected_BPF_MAP_GET_NEXT_KEY_struct_size,
	      "BPF_MAP_GET_NEXT_KEY_struct_size mismatch");

# ifdef HAVE_UNION_BPF_ATTR_PROG_TYPE
	static_assert(SoM(struct BPF_PROG_LOAD_struct, prog_type) == SoM(union bpf_attr, prog_type),
		      "BPF_PROG_LOAD_struct.prog_type size mismatch");
	static_assert(offsetof(struct BPF_PROG_LOAD_struct, prog_type) == offsetof(union bpf_attr, prog_type),
		      "BPF_PROG_LOAD_struct.prog_type offset mismatch");
# endif /* HAVE_UNION_BPF_ATTR_PROG_TYPE */

# ifdef HAVE_UNION_BPF_ATTR_INSN_CNT
	static_assert(SoM(struct BPF_PROG_LOAD_struct, insn_cnt) == SoM(union bpf_attr, insn_cnt),
		      "BPF_PROG_LOAD_struct.insn_cnt size mismatch");
	static_assert(offsetof(struct BPF_PROG_LOAD_struct, insn_cnt) == offsetof(union bpf_attr, insn_cnt),
		      "BPF_PROG_LOAD_struct.insn_cnt offset mismatch");
# endif /* HAVE_UNION_BPF_ATTR_INSN_CNT */

# ifdef HAVE_UNION_BPF_ATTR_INSNS
	static_assert(SoM(struct BPF_PROG_LOAD_struct, insns) == SoM(union bpf_attr, insns),
		      "BPF_PROG_LOAD_struct.insns size mismatch");
	static_assert(offsetof(struct BPF_PROG_LOAD_struct, insns) == offsetof(union bpf_attr, insns),
		      "BPF_PROG_LOAD_struct.insns offset mismatch");
# endif /* HAVE_UNION_BPF_ATTR_INSNS */

# ifdef HAVE_UNION_BPF_ATTR_LICENSE
	static_assert(SoM(struct BPF_PROG_LOAD_struct, license) == SoM(union bpf_attr, license),
		      "BPF_PROG_LOAD_struct.license size mismatch");
	static_assert(offsetof(struct BPF_PROG_LOAD_struct, license) == offsetof(union bpf_attr, license),
		      "BPF_PROG_LOAD_struct.license offset mismatch");
# endif /* HAVE_UNION_BPF_ATTR_LICENSE */

# ifdef HAVE_UNION_BPF_ATTR_LOG_LEVEL
	static_assert(SoM(struct BPF_PROG_LOAD_struct, log_level) == SoM(union bpf_attr, log_level),
		      "BPF_PROG_LOAD_struct.log_level size mismatch");
	static_assert(offsetof(struct BPF_PROG_LOAD_struct, log_level) == offsetof(union bpf_attr, log_level),
		      "BPF_PROG_LOAD_struct.log_level offset mismatch");
# endif /* HAVE_UNION_BPF_ATTR_LOG_LEVEL */

# ifdef HAVE_UNION_BPF_ATTR_LOG_SIZE
	static_assert(SoM(struct BPF_PROG_LOAD_struct, log_size) == SoM(union bpf_attr, log_size),
		      "BPF_PROG_LOAD_struct.log_size size mismatch");
	static_assert(offsetof(struct BPF_PROG_LOAD_struct, log_size) == offsetof(union bpf_attr, log_size),
		      "BPF_PROG_LOAD_struct.log_size offset mismatch");
# endif /* HAVE_UNION_BPF_ATTR_LOG_SIZE */

# ifdef HAVE_UNION_BPF_ATTR_LOG_BUF
	static_assert(SoM(struct BPF_PROG_LOAD_struct, log_buf) == SoM(union bpf_attr, log_buf),
		      "BPF_PROG_LOAD_struct.log_buf size mismatch");
	static_assert(offsetof(struct BPF_PROG_LOAD_struct, log_buf) == offsetof(union bpf_attr, log_buf),
		      "BPF_PROG_LOAD_struct.log_buf offset mismatch");
# endif /* HAVE_UNION_BPF_ATTR_LOG_BUF */

# ifdef HAVE_UNION_BPF_ATTR_KERN_VERSION
	static_assert(SoM(struct BPF_PROG_LOAD_struct, kern_version) == SoM(union bpf_attr, kern_version),
		      "BPF_PROG_LOAD_struct.kern_version size mismatch");
	static_assert(offsetof(struct BPF_PROG_LOAD_struct, kern_version) == offsetof(union bpf_attr, kern_version),
		      "BPF_PROG_LOAD_struct.kern_version offset mismatch");
# endif /* HAVE_UNION_BPF_ATTR_KERN_VERSION */

# ifdef HAVE_UNION_BPF_ATTR_PROG_FLAGS
	static_assert(SoM(struct BPF_PROG_LOAD_struct, prog_flags) == SoM(union bpf_attr, prog_flags),
		      "BPF_PROG_LOAD_struct.prog_flags size mismatch");
	static_assert(offsetof(struct BPF_PROG_LOAD_struct, prog_flags) == offsetof(union bpf_attr, prog_flags),
		      "BPF_PROG_LOAD_struct.prog_flags offset mismatch");
# endif /* HAVE_UNION_BPF_ATTR_PROG_FLAGS */

# ifdef HAVE_UNION_BPF_ATTR_PROG_NAME
	static_assert(SoM(struct BPF_PROG_LOAD_struct, prog_name) == SoM(union bpf_attr, prog_name),
		      "BPF_PROG_LOAD_struct.prog_name size mismatch");
	static_assert(offsetof(struct BPF_PROG_LOAD_struct, prog_name) == offsetof(union bpf_attr, prog_name),
		      "BPF_PROG_LOAD_struct.prog_name offset mismatch");
# endif /* HAVE_UNION_BPF_ATTR_PROG_NAME */

# ifdef HAVE_UNION_BPF_ATTR_PROG_IFINDEX
	static_assert(SoM(struct BPF_PROG_LOAD_struct, prog_ifindex) == SoM(union bpf_attr, prog_ifindex),
		      "BPF_PROG_LOAD_struct.prog_ifindex size mismatch");
	static_assert(offsetof(struct BPF_PROG_LOAD_struct, prog_ifindex) == offsetof(union bpf_attr, prog_ifindex),
		      "BPF_PROG_LOAD_struct.prog_ifindex offset mismatch");
# endif /* HAVE_UNION_BPF_ATTR_PROG_IFINDEX */

# ifdef HAVE_UNION_BPF_ATTR_EXPECTED_ATTACH_TYPE
	static_assert(SoM(struct BPF_PROG_LOAD_struct, expected_attach_type) == SoM(union bpf_attr, expected_attach_type),
		      "BPF_PROG_LOAD_struct.expected_attach_type size mismatch");
	static_assert(offsetof(struct BPF_PROG_LOAD_struct, expected_attach_type) == offsetof(union bpf_attr, expected_attach_type),
		      "BPF_PROG_LOAD_struct.expected_attach_type offset mismatch");
# endif /* HAVE_UNION_BPF_ATTR_EXPECTED_ATTACH_TYPE */

static_assert(BPF_PROG_LOAD_struct_size == expected_BPF_PROG_LOAD_struct_size,
	      "BPF_PROG_LOAD_struct_size mismatch");

# ifdef HAVE_UNION_BPF_ATTR_PATHNAME
	static_assert(SoM(struct BPF_OBJ_PIN_struct, pathname) == SoM(union bpf_attr, pathname),
		      "BPF_OBJ_PIN_struct.pathname size mismatch");
	static_assert(offsetof(struct BPF_OBJ_PIN_struct, pathname) == offsetof(union bpf_attr, pathname),
		      "BPF_OBJ_PIN_struct.pathname offset mismatch");
# endif /* HAVE_UNION_BPF_ATTR_PATHNAME */

# ifdef HAVE_UNION_BPF_ATTR_BPF_FD
	static_assert(SoM(struct BPF_OBJ_PIN_struct, bpf_fd) == SoM(union bpf_attr, bpf_fd),
		      "BPF_OBJ_PIN_struct.bpf_fd size mismatch");
	static_assert(offsetof(struct BPF_OBJ_PIN_struct, bpf_fd) == offsetof(union bpf_attr, bpf_fd),
		      "BPF_OBJ_PIN_struct.bpf_fd offset mismatch");
# endif /* HAVE_UNION_BPF_ATTR_BPF_FD */

# ifdef HAVE_UNION_BPF_ATTR_FILE_FLAGS
	static_assert(SoM(struct BPF_OBJ_PIN_struct, file_flags) == SoM(union bpf_attr, file_flags),
		      "BPF_OBJ_PIN_struct.file_flags size mismatch");
	static_assert(offsetof(struct BPF_OBJ_PIN_struct, file_flags) == offsetof(union bpf_attr, file_flags),
		      "BPF_OBJ_PIN_struct.file_flags offset mismatch");
# endif /* HAVE_UNION_BPF_ATTR_FILE_FLAGS */

static_assert(BPF_OBJ_PIN_struct_size == expected_BPF_OBJ_PIN_struct_size,
	      "BPF_OBJ_PIN_struct_size mismatch");

# ifdef HAVE_UNION_BPF_ATTR_TARGET_FD
	static_assert(SoM(struct BPF_PROG_ATTACH_struct, target_fd) == SoM(union bpf_attr, target_fd),
		      "BPF_PROG_ATTACH_struct.target_fd size mismatch");
	static_assert(offsetof(struct BPF_PROG_ATTACH_struct, target_fd) == offsetof(union bpf_attr, target_fd),
		      "BPF_PROG_ATTACH_struct.target_fd offset mismatch");
# endif /* HAVE_UNION_BPF_ATTR_TARGET_FD */

# ifdef HAVE_UNION_BPF_ATTR_ATTACH_BPF_FD
	static_assert(SoM(struct BPF_PROG_ATTACH_struct, attach_bpf_fd) == SoM(union bpf_attr, attach_bpf_fd),
		      "BPF_PROG_ATTACH_struct.attach_bpf_fd size mismatch");
	static_assert(offsetof(struct BPF_PROG_ATTACH_struct, attach_bpf_fd) == offsetof(union bpf_attr, attach_bpf_fd),
		      "BPF_PROG_ATTACH_struct.attach_bpf_fd offset mismatch");
# endif /* HAVE_UNION_BPF_ATTR_ATTACH_BPF_FD */

# ifdef HAVE_UNION_BPF_ATTR_ATTACH_TYPE
	static_assert(SoM(struct BPF_PROG_ATTACH_struct, attach_type) == SoM(union bpf_attr, attach_type),
		      "BPF_PROG_ATTACH_struct.attach_type size mismatch");
	static_assert(offsetof(struct BPF_PROG_ATTACH_struct, attach_type) == offsetof(union bpf_attr, attach_type),
		      "BPF_PROG_ATTACH_struct.attach_type offset mismatch");
# endif /* HAVE_UNION_BPF_ATTR_ATTACH_TYPE */

# ifdef HAVE_UNION_BPF_ATTR_ATTACH_FLAGS
	static_assert(SoM(struct BPF_PROG_ATTACH_struct, attach_flags) == SoM(union bpf_attr, attach_flags),
		      "BPF_PROG_ATTACH_struct.attach_flags size mismatch");
	static_assert(offsetof(struct BPF_PROG_ATTACH_struct, attach_flags) == offsetof(union bpf_attr, attach_flags),
		      "BPF_PROG_ATTACH_struct.attach_flags offset mismatch");
# endif /* HAVE_UNION_BPF_ATTR_ATTACH_FLAGS */

static_assert(BPF_PROG_ATTACH_struct_size == expected_BPF_PROG_ATTACH_struct_size,
	      "BPF_PROG_ATTACH_struct_size mismatch");

# ifdef HAVE_UNION_BPF_ATTR_TARGET_FD
	static_assert(SoM(struct BPF_PROG_DETACH_struct, target_fd) == SoM(union bpf_attr, target_fd),
		      "BPF_PROG_DETACH_struct.target_fd size mismatch");
	static_assert(offsetof(struct BPF_PROG_DETACH_struct, target_fd) == offsetof(union bpf_attr, target_fd),
		      "BPF_PROG_DETACH_struct.target_fd offset mismatch");
# endif /* HAVE_UNION_BPF_ATTR_TARGET_FD */

# ifdef HAVE_UNION_BPF_ATTR_DUMMY
	static_assert(SoM(struct BPF_PROG_DETACH_struct, dummy) == SoM(union bpf_attr, dummy),
		      "BPF_PROG_DETACH_struct.dummy size mismatch");
	static_assert(offsetof(struct BPF_PROG_DETACH_struct, dummy) == offsetof(union bpf_attr, dummy),
		      "BPF_PROG_DETACH_struct.dummy offset mismatch");
# endif /* HAVE_UNION_BPF_ATTR_DUMMY */

# ifdef HAVE_UNION_BPF_ATTR_ATTACH_TYPE
	static_assert(SoM(struct BPF_PROG_DETACH_struct, attach_type) == SoM(union bpf_attr, attach_type),
		      "BPF_PROG_DETACH_struct.attach_type size mismatch");
	static_assert(offsetof(struct BPF_PROG_DETACH_struct, attach_type) == offsetof(union bpf_attr, attach_type),
		      "BPF_PROG_DETACH_struct.attach_type offset mismatch");
# endif /* HAVE_UNION_BPF_ATTR_ATTACH_TYPE */

static_assert(BPF_PROG_DETACH_struct_size == expected_BPF_PROG_DETACH_struct_size,
	      "BPF_PROG_DETACH_struct_size mismatch");

# ifdef HAVE_UNION_BPF_ATTR_TEST_PROG_FD
	static_assert(SoM(struct BPF_PROG_TEST_RUN_struct, prog_fd) == SoM(union bpf_attr, test.prog_fd),
		      "BPF_PROG_TEST_RUN_struct.prog_fd size mismatch");
	static_assert(offsetof(struct BPF_PROG_TEST_RUN_struct, prog_fd) == offsetof(union bpf_attr, test.prog_fd),
		      "BPF_PROG_TEST_RUN_struct.prog_fd offset mismatch");
# endif /* HAVE_UNION_BPF_ATTR_TEST_PROG_FD */

# ifdef HAVE_UNION_BPF_ATTR_TEST_RETVAL
	static_assert(SoM(struct BPF_PROG_TEST_RUN_struct, retval) == SoM(union bpf_attr, test.retval),
		      "BPF_PROG_TEST_RUN_struct.retval size mismatch");
	static_assert(offsetof(struct BPF_PROG_TEST_RUN_struct, retval) == offsetof(union bpf_attr, test.retval),
		      "BPF_PROG_TEST_RUN_struct.retval offset mismatch");
# endif /* HAVE_UNION_BPF_ATTR_TEST_RETVAL */

# ifdef HAVE_UNION_BPF_ATTR_TEST_DATA_SIZE_IN
	static_assert(SoM(struct BPF_PROG_TEST_RUN_struct, data_size_in) == SoM(union bpf_attr, test.data_size_in),
		      "BPF_PROG_TEST_RUN_struct.data_size_in size mismatch");
	static_assert(offsetof(struct BPF_PROG_TEST_RUN_struct, data_size_in) == offsetof(union bpf_attr, test.data_size_in),
		      "BPF_PROG_TEST_RUN_struct.data_size_in offset mismatch");
# endif /* HAVE_UNION_BPF_ATTR_TEST_DATA_SIZE_IN */

# ifdef HAVE_UNION_BPF_ATTR_TEST_DATA_SIZE_OUT
	static_assert(SoM(struct BPF_PROG_TEST_RUN_struct, data_size_out) == SoM(union bpf_attr, test.data_size_out),
		      "BPF_PROG_TEST_RUN_struct.data_size_out size mismatch");
	static_assert(offsetof(struct BPF_PROG_TEST_RUN_struct, data_size_out) == offsetof(union bpf_attr, test.data_size_out),
		      "BPF_PROG_TEST_RUN_struct.data_size_out offset mismatch");
# endif /* HAVE_UNION_BPF_ATTR_TEST_DATA_SIZE_OUT */

# ifdef HAVE_UNION_BPF_ATTR_TEST_DATA_IN
	static_assert(SoM(struct BPF_PROG_TEST_RUN_struct, data_in) == SoM(union bpf_attr, test.data_in),
		      "BPF_PROG_TEST_RUN_struct.data_in size mismatch");
	static_assert(offsetof(struct BPF_PROG_TEST_RUN_struct, data_in) == offsetof(union bpf_attr, test.data_in),
		      "BPF_PROG_TEST_RUN_struct.data_in offset mismatch");
# endif /* HAVE_UNION_BPF_ATTR_TEST_DATA_IN */

# ifdef HAVE_UNION_BPF_ATTR_TEST_DATA_OUT
	static_assert(SoM(struct BPF_PROG_TEST_RUN_struct, data_out) == SoM(union bpf_attr, test.data_out),
		      "BPF_PROG_TEST_RUN_struct.data_out size mismatch");
	static_assert(offsetof(struct BPF_PROG_TEST_RUN_struct, data_out) == offsetof(union bpf_attr, test.data_out),
		      "BPF_PROG_TEST_RUN_struct.data_out offset mismatch");
# endif /* HAVE_UNION_BPF_ATTR_TEST_DATA_OUT */

# ifdef HAVE_UNION_BPF_ATTR_TEST_REPEAT
	static_assert(SoM(struct BPF_PROG_TEST_RUN_struct, repeat) == SoM(union bpf_attr, test.repeat),
		      "BPF_PROG_TEST_RUN_struct.repeat size mismatch");
	static_assert(offsetof(struct BPF_PROG_TEST_RUN_struct, repeat) == offsetof(union bpf_attr, test.repeat),
		      "BPF_PROG_TEST_RUN_struct.repeat offset mismatch");
# endif /* HAVE_UNION_BPF_ATTR_TEST_REPEAT */

# ifdef HAVE_UNION_BPF_ATTR_TEST_DURATION
	static_assert(SoM(struct BPF_PROG_TEST_RUN_struct, duration) == SoM(union bpf_attr, test.duration),
		      "BPF_PROG_TEST_RUN_struct.duration size mismatch");
	static_assert(offsetof(struct BPF_PROG_TEST_RUN_struct, duration) == offsetof(union bpf_attr, test.duration),
		      "BPF_PROG_TEST_RUN_struct.duration offset mismatch");
# endif /* HAVE_UNION_BPF_ATTR_TEST_DURATION */

static_assert(BPF_PROG_TEST_RUN_struct_size == expected_BPF_PROG_TEST_RUN_struct_size,
	      "BPF_PROG_TEST_RUN_struct_size mismatch");

# ifdef HAVE_UNION_BPF_ATTR_START_ID
	static_assert(SoM(struct BPF_PROG_GET_NEXT_ID_struct, start_id) == SoM(union bpf_attr, start_id),
		      "BPF_PROG_GET_NEXT_ID_struct.start_id size mismatch");
	static_assert(offsetof(struct BPF_PROG_GET_NEXT_ID_struct, start_id) == offsetof(union bpf_attr, start_id),
		      "BPF_PROG_GET_NEXT_ID_struct.start_id offset mismatch");
# endif /* HAVE_UNION_BPF_ATTR_START_ID */

# ifdef HAVE_UNION_BPF_ATTR_NEXT_ID
	static_assert(SoM(struct BPF_PROG_GET_NEXT_ID_struct, next_id) == SoM(union bpf_attr, next_id),
		      "BPF_PROG_GET_NEXT_ID_struct.next_id size mismatch");
	static_assert(offsetof(struct BPF_PROG_GET_NEXT_ID_struct, next_id) == offsetof(union bpf_attr, next_id),
		      "BPF_PROG_GET_NEXT_ID_struct.next_id offset mismatch");
# endif /* HAVE_UNION_BPF_ATTR_NEXT_ID */

# ifdef HAVE_UNION_BPF_ATTR_OPEN_FLAGS
	static_assert(SoM(struct BPF_PROG_GET_NEXT_ID_struct, open_flags) == SoM(union bpf_attr, open_flags),
		      "BPF_PROG_GET_NEXT_ID_struct.open_flags size mismatch");
	static_assert(offsetof(struct BPF_PROG_GET_NEXT_ID_struct, open_flags) == offsetof(union bpf_attr, open_flags),
		      "BPF_PROG_GET_NEXT_ID_struct.open_flags offset mismatch");
# endif /* HAVE_UNION_BPF_ATTR_OPEN_FLAGS */

static_assert(BPF_PROG_GET_NEXT_ID_struct_size == expected_BPF_PROG_GET_NEXT_ID_struct_size,
	      "BPF_PROG_GET_NEXT_ID_struct_size mismatch");

# ifdef HAVE_UNION_BPF_ATTR_PROG_ID
	static_assert(SoM(struct BPF_PROG_GET_FD_BY_ID_struct, prog_id) == SoM(union bpf_attr, prog_id),
		      "BPF_PROG_GET_FD_BY_ID_struct.prog_id size mismatch");
	static_assert(offsetof(struct BPF_PROG_GET_FD_BY_ID_struct, prog_id) == offsetof(union bpf_attr, prog_id),
		      "BPF_PROG_GET_FD_BY_ID_struct.prog_id offset mismatch");
# endif /* HAVE_UNION_BPF_ATTR_PROG_ID */

# ifdef HAVE_UNION_BPF_ATTR_NEXT_ID
	static_assert(SoM(struct BPF_PROG_GET_FD_BY_ID_struct, next_id) == SoM(union bpf_attr, next_id),
		      "BPF_PROG_GET_FD_BY_ID_struct.next_id size mismatch");
	static_assert(offsetof(struct BPF_PROG_GET_FD_BY_ID_struct, next_id) == offsetof(union bpf_attr, next_id),
		      "BPF_PROG_GET_FD_BY_ID_struct.next_id offset mismatch");
# endif /* HAVE_UNION_BPF_ATTR_NEXT_ID */

# ifdef HAVE_UNION_BPF_ATTR_OPEN_FLAGS
	static_assert(SoM(struct BPF_PROG_GET_FD_BY_ID_struct, open_flags) == SoM(union bpf_attr, open_flags),
		      "BPF_PROG_GET_FD_BY_ID_struct.open_flags size mismatch");
	static_assert(offsetof(struct BPF_PROG_GET_FD_BY_ID_struct, open_flags) == offsetof(union bpf_attr, open_flags),
		      "BPF_PROG_GET_FD_BY_ID_struct.open_flags offset mismatch");
# endif /* HAVE_UNION_BPF_ATTR_OPEN_FLAGS */

static_assert(BPF_PROG_GET_FD_BY_ID_struct_size == expected_BPF_PROG_GET_FD_BY_ID_struct_size,
	      "BPF_PROG_GET_FD_BY_ID_struct_size mismatch");

# ifdef HAVE_UNION_BPF_ATTR_MAP_ID
	static_assert(SoM(struct BPF_MAP_GET_FD_BY_ID_struct, map_id) == SoM(union bpf_attr, map_id),
		      "BPF_MAP_GET_FD_BY_ID_struct.map_id size mismatch");
	static_assert(offsetof(struct BPF_MAP_GET_FD_BY_ID_struct, map_id) == offsetof(union bpf_attr, map_id),
		      "BPF_MAP_GET_FD_BY_ID_struct.map_id offset mismatch");
# endif /* HAVE_UNION_BPF_ATTR_MAP_ID */

# ifdef HAVE_UNION_BPF_ATTR_NEXT_ID
	static_assert(SoM(struct BPF_MAP_GET_FD_BY_ID_struct, next_id) == SoM(union bpf_attr, next_id),
		      "BPF_MAP_GET_FD_BY_ID_struct.next_id size mismatch");
	static_assert(offsetof(struct BPF_MAP_GET_FD_BY_ID_struct, next_id) == offsetof(union bpf_attr, next_id),
		      "BPF_MAP_GET_FD_BY_ID_struct.next_id offset mismatch");
# endif /* HAVE_UNION_BPF_ATTR_NEXT_ID */

# ifdef HAVE_UNION_BPF_ATTR_OPEN_FLAGS
	static_assert(SoM(struct BPF_MAP_GET_FD_BY_ID_struct, open_flags) == SoM(union bpf_attr, open_flags),
		      "BPF_MAP_GET_FD_BY_ID_struct.open_flags size mismatch");
	static_assert(offsetof(struct BPF_MAP_GET_FD_BY_ID_struct, open_flags) == offsetof(union bpf_attr, open_flags),
		      "BPF_MAP_GET_FD_BY_ID_struct.open_flags offset mismatch");
# endif /* HAVE_UNION_BPF_ATTR_OPEN_FLAGS */

static_assert(BPF_MAP_GET_FD_BY_ID_struct_size == expected_BPF_MAP_GET_FD_BY_ID_struct_size,
	      "BPF_MAP_GET_FD_BY_ID_struct_size mismatch");

# ifdef HAVE_UNION_BPF_ATTR_INFO_BPF_FD
	static_assert(SoM(struct BPF_OBJ_GET_INFO_BY_FD_struct, bpf_fd) == SoM(union bpf_attr, info.bpf_fd),
		      "BPF_OBJ_GET_INFO_BY_FD_struct.bpf_fd size mismatch");
	static_assert(offsetof(struct BPF_OBJ_GET_INFO_BY_FD_struct, bpf_fd) == offsetof(union bpf_attr, info.bpf_fd),
		      "BPF_OBJ_GET_INFO_BY_FD_struct.bpf_fd offset mismatch");
# endif /* HAVE_UNION_BPF_ATTR_INFO_BPF_FD */

# ifdef HAVE_UNION_BPF_ATTR_INFO_INFO_LEN
	static_assert(SoM(struct BPF_OBJ_GET_INFO_BY_FD_struct, info_len) == SoM(union bpf_attr, info.info_len),
		      "BPF_OBJ_GET_INFO_BY_FD_struct.info_len size mismatch");
	static_assert(offsetof(struct BPF_OBJ_GET_INFO_BY_FD_struct, info_len) == offsetof(union bpf_attr, info.info_len),
		      "BPF_OBJ_GET_INFO_BY_FD_struct.info_len offset mismatch");
# endif /* HAVE_UNION_BPF_ATTR_INFO_INFO_LEN */

# ifdef HAVE_UNION_BPF_ATTR_INFO_INFO
	static_assert(SoM(struct BPF_OBJ_GET_INFO_BY_FD_struct, info) == SoM(union bpf_attr, info.info),
		      "BPF_OBJ_GET_INFO_BY_FD_struct.info size mismatch");
	static_assert(offsetof(struct BPF_OBJ_GET_INFO_BY_FD_struct, info) == offsetof(union bpf_attr, info.info),
		      "BPF_OBJ_GET_INFO_BY_FD_struct.info offset mismatch");
# endif /* HAVE_UNION_BPF_ATTR_INFO_INFO */

static_assert(BPF_OBJ_GET_INFO_BY_FD_struct_size == expected_BPF_OBJ_GET_INFO_BY_FD_struct_size,
	      "BPF_OBJ_GET_INFO_BY_FD_struct_size mismatch");

# ifdef HAVE_UNION_BPF_ATTR_QUERY_TARGET_FD
	static_assert(SoM(struct BPF_PROG_QUERY_struct, target_fd) == SoM(union bpf_attr, query.target_fd),
		      "BPF_PROG_QUERY_struct.target_fd size mismatch");
	static_assert(offsetof(struct BPF_PROG_QUERY_struct, target_fd) == offsetof(union bpf_attr, query.target_fd),
		      "BPF_PROG_QUERY_struct.target_fd offset mismatch");
# endif /* HAVE_UNION_BPF_ATTR_QUERY_TARGET_FD */

# ifdef HAVE_UNION_BPF_ATTR_QUERY_ATTACH_TYPE
	static_assert(SoM(struct BPF_PROG_QUERY_struct, attach_type) == SoM(union bpf_attr, query.attach_type),
		      "BPF_PROG_QUERY_struct.attach_type size mismatch");
	static_assert(offsetof(struct BPF_PROG_QUERY_struct, attach_type) == offsetof(union bpf_attr, query.attach_type),
		      "BPF_PROG_QUERY_struct.attach_type offset mismatch");
# endif /* HAVE_UNION_BPF_ATTR_QUERY_ATTACH_TYPE */

# ifdef HAVE_UNION_BPF_ATTR_QUERY_QUERY_FLAGS
	static_assert(SoM(struct BPF_PROG_QUERY_struct, query_flags) == SoM(union bpf_attr, query.query_flags),
		      "BPF_PROG_QUERY_struct.query_flags size mismatch");
	static_assert(offsetof(struct BPF_PROG_QUERY_struct, query_flags) == offsetof(union bpf_attr, query.query_flags),
		      "BPF_PROG_QUERY_struct.query_flags offset mismatch");
# endif /* HAVE_UNION_BPF_ATTR_QUERY_QUERY_FLAGS */

# ifdef HAVE_UNION_BPF_ATTR_QUERY_ATTACH_FLAGS
	static_assert(SoM(struct BPF_PROG_QUERY_struct, attach_flags) == SoM(union bpf_attr, query.attach_flags),
		      "BPF_PROG_QUERY_struct.attach_flags size mismatch");
	static_assert(offsetof(struct BPF_PROG_QUERY_struct, attach_flags) == offsetof(union bpf_attr, query.attach_flags),
		      "BPF_PROG_QUERY_struct.attach_flags offset mismatch");
# endif /* HAVE_UNION_BPF_ATTR_QUERY_ATTACH_FLAGS */

# ifdef HAVE_UNION_BPF_ATTR_QUERY_PROG_IDS
	static_assert(SoM(struct BPF_PROG_QUERY_struct, prog_ids) == SoM(union bpf_attr, query.prog_ids),
		      "BPF_PROG_QUERY_struct.prog_ids size mismatch");
	static_assert(offsetof(struct BPF_PROG_QUERY_struct, prog_ids) == offsetof(union bpf_attr, query.prog_ids),
		      "BPF_PROG_QUERY_struct.prog_ids offset mismatch");
# endif /* HAVE_UNION_BPF_ATTR_QUERY_PROG_IDS */

# ifdef HAVE_UNION_BPF_ATTR_QUERY_PROG_CNT
	static_assert(SoM(struct BPF_PROG_QUERY_struct, prog_cnt) == SoM(union bpf_attr, query.prog_cnt),
		      "BPF_PROG_QUERY_struct.prog_cnt size mismatch");
	static_assert(offsetof(struct BPF_PROG_QUERY_struct, prog_cnt) == offsetof(union bpf_attr, query.prog_cnt),
		      "BPF_PROG_QUERY_struct.prog_cnt offset mismatch");
# endif /* HAVE_UNION_BPF_ATTR_QUERY_PROG_CNT */

static_assert(BPF_PROG_QUERY_struct_size == expected_BPF_PROG_QUERY_struct_size,
	      "BPF_PROG_QUERY_struct_size mismatch");

# ifdef HAVE_UNION_BPF_ATTR_RAW_TRACEPOINT_NAME
	static_assert(SoM(struct BPF_RAW_TRACEPOINT_OPEN_struct, name) == SoM(union bpf_attr, raw_tracepoint.name),
		      "BPF_RAW_TRACEPOINT_OPEN_struct.name size mismatch");
	static_assert(offsetof(struct BPF_RAW_TRACEPOINT_OPEN_struct, name) == offsetof(union bpf_attr, raw_tracepoint.name),
		      "BPF_RAW_TRACEPOINT_OPEN_struct.name offset mismatch");
# endif /* HAVE_UNION_BPF_ATTR_RAW_TRACEPOINT_NAME */

# ifdef HAVE_UNION_BPF_ATTR_RAW_TRACEPOINT_PROG_FD
	static_assert(SoM(struct BPF_RAW_TRACEPOINT_OPEN_struct, prog_fd) == SoM(union bpf_attr, raw_tracepoint.prog_fd),
		      "BPF_RAW_TRACEPOINT_OPEN_struct.prog_fd size mismatch");
	static_assert(offsetof(struct BPF_RAW_TRACEPOINT_OPEN_struct, prog_fd) == offsetof(union bpf_attr, raw_tracepoint.prog_fd),
		      "BPF_RAW_TRACEPOINT_OPEN_struct.prog_fd offset mismatch");
# endif /* HAVE_UNION_BPF_ATTR_RAW_TRACEPOINT_PROG_FD */

static_assert(BPF_RAW_TRACEPOINT_OPEN_struct_size == expected_BPF_RAW_TRACEPOINT_OPEN_struct_size,
	      "BPF_RAW_TRACEPOINT_OPEN_struct_size mismatch");

# ifdef HAVE_STRUCT_BPF_MAP_INFO_TYPE
	static_assert(SoM(struct bpf_map_info_struct, type) == SoM(struct bpf_map_info, type),
		      "bpf_map_info_struct.type size mismatch");
	static_assert(offsetof(struct bpf_map_info_struct, type) == offsetof(struct bpf_map_info, type),
		      "bpf_map_info_struct.type offset mismatch");
# endif /* HAVE_STRUCT_BPF_MAP_INFO_TYPE */

# ifdef HAVE_STRUCT_BPF_MAP_INFO_ID
	static_assert(SoM(struct bpf_map_info_struct, id) == SoM(struct bpf_map_info, id),
		      "bpf_map_info_struct.id size mismatch");
	static_assert(offsetof(struct bpf_map_info_struct, id) == offsetof(struct bpf_map_info, id),
		      "bpf_map_info_struct.id offset mismatch");
# endif /* HAVE_STRUCT_BPF_MAP_INFO_ID */

# ifdef HAVE_STRUCT_BPF_MAP_INFO_KEY_SIZE
	static_assert(SoM(struct bpf_map_info_struct, key_size) == SoM(struct bpf_map_info, key_size),
		      "bpf_map_info_struct.key_size size mismatch");
	static_assert(offsetof(struct bpf_map_info_struct, key_size) == offsetof(struct bpf_map_info, key_size),
		      "bpf_map_info_struct.key_size offset mismatch");
# endif /* HAVE_STRUCT_BPF_MAP_INFO_KEY_SIZE */

# ifdef HAVE_STRUCT_BPF_MAP_INFO_VALUE_SIZE
	static_assert(SoM(struct bpf_map_info_struct, value_size) == SoM(struct bpf_map_info, value_size),
		      "bpf_map_info_struct.value_size size mismatch");
	static_assert(offsetof(struct bpf_map_info_struct, value_size) == offsetof(struct bpf_map_info, value_size),
		      "bpf_map_info_struct.value_size offset mismatch");
# endif /* HAVE_STRUCT_BPF_MAP_INFO_VALUE_SIZE */

# ifdef HAVE_STRUCT_BPF_MAP_INFO_MAX_ENTRIES
	static_assert(SoM(struct bpf_map_info_struct, max_entries) == SoM(struct bpf_map_info, max_entries),
		      "bpf_map_info_struct.max_entries size mismatch");
	static_assert(offsetof(struct bpf_map_info_struct, max_entries) == offsetof(struct bpf_map_info, max_entries),
		      "bpf_map_info_struct.max_entries offset mismatch");
# endif /* HAVE_STRUCT_BPF_MAP_INFO_MAX_ENTRIES */

# ifdef HAVE_STRUCT_BPF_MAP_INFO_MAP_FLAGS
	static_assert(SoM(struct bpf_map_info_struct, map_flags) == SoM(struct bpf_map_info, map_flags),
		      "bpf_map_info_struct.map_flags size mismatch");
	static_assert(offsetof(struct bpf_map_info_struct, map_flags) == offsetof(struct bpf_map_info, map_flags),
		      "bpf_map_info_struct.map_flags offset mismatch");
# endif /* HAVE_STRUCT_BPF_MAP_INFO_MAP_FLAGS */

# ifdef HAVE_STRUCT_BPF_MAP_INFO_NAME
	static_assert(SoM(struct bpf_map_info_struct, name) == SoM(struct bpf_map_info, name),
		      "bpf_map_info_struct.name size mismatch");
	static_assert(offsetof(struct bpf_map_info_struct, name) == offsetof(struct bpf_map_info, name),
		      "bpf_map_info_struct.name offset mismatch");
# endif /* HAVE_STRUCT_BPF_MAP_INFO_NAME */

# ifdef HAVE_STRUCT_BPF_MAP_INFO_IFINDEX
	static_assert(SoM(struct bpf_map_info_struct, ifindex) == SoM(struct bpf_map_info, ifindex),
		      "bpf_map_info_struct.ifindex size mismatch");
	static_assert(offsetof(struct bpf_map_info_struct, ifindex) == offsetof(struct bpf_map_info, ifindex),
		      "bpf_map_info_struct.ifindex offset mismatch");
# endif /* HAVE_STRUCT_BPF_MAP_INFO_IFINDEX */

static_assert(bpf_map_info_struct_size == expected_bpf_map_info_struct_size,
	      "bpf_map_info_struct_size mismatch");

# ifdef HAVE_STRUCT_BPF_PROG_INFO_TYPE
	static_assert(SoM(struct bpf_prog_info_struct, type) == SoM(struct bpf_prog_info, type),
		      "bpf_prog_info_struct.type size mismatch");
	static_assert(offsetof(struct bpf_prog_info_struct, type) == offsetof(struct bpf_prog_info, type),
		      "bpf_prog_info_struct.type offset mismatch");
# endif /* HAVE_STRUCT_BPF_PROG_INFO_TYPE */

# ifdef HAVE_STRUCT_BPF_PROG_INFO_ID
	static_assert(SoM(struct bpf_prog_info_struct, id) == SoM(struct bpf_prog_info, id),
		      "bpf_prog_info_struct.id size mismatch");
	static_assert(offsetof(struct bpf_prog_info_struct, id) == offsetof(struct bpf_prog_info, id),
		      "bpf_prog_info_struct.id offset mismatch");
# endif /* HAVE_STRUCT_BPF_PROG_INFO_ID */

# ifdef HAVE_STRUCT_BPF_PROG_INFO_TAG
	static_assert(SoM(struct bpf_prog_info_struct, tag) == SoM(struct bpf_prog_info, tag),
		      "bpf_prog_info_struct.tag size mismatch");
	static_assert(offsetof(struct bpf_prog_info_struct, tag) == offsetof(struct bpf_prog_info, tag),
		      "bpf_prog_info_struct.tag offset mismatch");
# endif /* HAVE_STRUCT_BPF_PROG_INFO_TAG */

# ifdef HAVE_STRUCT_BPF_PROG_INFO_JITED_PROG_LEN
	static_assert(SoM(struct bpf_prog_info_struct, jited_prog_len) == SoM(struct bpf_prog_info, jited_prog_len),
		      "bpf_prog_info_struct.jited_prog_len size mismatch");
	static_assert(offsetof(struct bpf_prog_info_struct, jited_prog_len) == offsetof(struct bpf_prog_info, jited_prog_len),
		      "bpf_prog_info_struct.jited_prog_len offset mismatch");
# endif /* HAVE_STRUCT_BPF_PROG_INFO_JITED_PROG_LEN */

# ifdef HAVE_STRUCT_BPF_PROG_INFO_XLATED_PROG_LEN
	static_assert(SoM(struct bpf_prog_info_struct, xlated_prog_len) == SoM(struct bpf_prog_info, xlated_prog_len),
		      "bpf_prog_info_struct.xlated_prog_len size mismatch");
	static_assert(offsetof(struct bpf_prog_info_struct, xlated_prog_len) == offsetof(struct bpf_prog_info, xlated_prog_len),
		      "bpf_prog_info_struct.xlated_prog_len offset mismatch");
# endif /* HAVE_STRUCT_BPF_PROG_INFO_XLATED_PROG_LEN */

# ifdef HAVE_STRUCT_BPF_PROG_INFO_JITED_PROG_INSNS
	static_assert(SoM(struct bpf_prog_info_struct, jited_prog_insns) == SoM(struct bpf_prog_info, jited_prog_insns),
		      "bpf_prog_info_struct.jited_prog_insns size mismatch");
	static_assert(offsetof(struct bpf_prog_info_struct, jited_prog_insns) == offsetof(struct bpf_prog_info, jited_prog_insns),
		      "bpf_prog_info_struct.jited_prog_insns offset mismatch");
# endif /* HAVE_STRUCT_BPF_PROG_INFO_JITED_PROG_INSNS */

# ifdef HAVE_STRUCT_BPF_PROG_INFO_XLATED_PROG_INSNS
	static_assert(SoM(struct bpf_prog_info_struct, xlated_prog_insns) == SoM(struct bpf_prog_info, xlated_prog_insns),
		      "bpf_prog_info_struct.xlated_prog_insns size mismatch");
	static_assert(offsetof(struct bpf_prog_info_struct, xlated_prog_insns) == offsetof(struct bpf_prog_info, xlated_prog_insns),
		      "bpf_prog_info_struct.xlated_prog_insns offset mismatch");
# endif /* HAVE_STRUCT_BPF_PROG_INFO_XLATED_PROG_INSNS */

# ifdef HAVE_STRUCT_BPF_PROG_INFO_LOAD_TIME
	static_assert(SoM(struct bpf_prog_info_struct, load_time) == SoM(struct bpf_prog_info, load_time),
		      "bpf_prog_info_struct.load_time size mismatch");
	static_assert(offsetof(struct bpf_prog_info_struct, load_time) == offsetof(struct bpf_prog_info, load_time),
		      "bpf_prog_info_struct.load_time offset mismatch");
# endif /* HAVE_STRUCT_BPF_PROG_INFO_LOAD_TIME */

# ifdef HAVE_STRUCT_BPF_PROG_INFO_CREATED_BY_UID
	static_assert(SoM(struct bpf_prog_info_struct, created_by_uid) == SoM(struct bpf_prog_info, created_by_uid),
		      "bpf_prog_info_struct.created_by_uid size mismatch");
	static_assert(offsetof(struct bpf_prog_info_struct, created_by_uid) == offsetof(struct bpf_prog_info, created_by_uid),
		      "bpf_prog_info_struct.created_by_uid offset mismatch");
# endif /* HAVE_STRUCT_BPF_PROG_INFO_CREATED_BY_UID */

# ifdef HAVE_STRUCT_BPF_PROG_INFO_NR_MAP_IDS
	static_assert(SoM(struct bpf_prog_info_struct, nr_map_ids) == SoM(struct bpf_prog_info, nr_map_ids),
		      "bpf_prog_info_struct.nr_map_ids size mismatch");
	static_assert(offsetof(struct bpf_prog_info_struct, nr_map_ids) == offsetof(struct bpf_prog_info, nr_map_ids),
		      "bpf_prog_info_struct.nr_map_ids offset mismatch");
# endif /* HAVE_STRUCT_BPF_PROG_INFO_NR_MAP_IDS */

# ifdef HAVE_STRUCT_BPF_PROG_INFO_MAP_IDS
	static_assert(SoM(struct bpf_prog_info_struct, map_ids) == SoM(struct bpf_prog_info, map_ids),
		      "bpf_prog_info_struct.map_ids size mismatch");
	static_assert(offsetof(struct bpf_prog_info_struct, map_ids) == offsetof(struct bpf_prog_info, map_ids),
		      "bpf_prog_info_struct.map_ids offset mismatch");
# endif /* HAVE_STRUCT_BPF_PROG_INFO_MAP_IDS */

# ifdef HAVE_STRUCT_BPF_PROG_INFO_NAME
	static_assert(SoM(struct bpf_prog_info_struct, name) == SoM(struct bpf_prog_info, name),
		      "bpf_prog_info_struct.name size mismatch");
	static_assert(offsetof(struct bpf_prog_info_struct, name) == offsetof(struct bpf_prog_info, name),
		      "bpf_prog_info_struct.name offset mismatch");
# endif /* HAVE_STRUCT_BPF_PROG_INFO_NAME */

# ifdef HAVE_STRUCT_BPF_PROG_INFO_IFINDEX
	static_assert(SoM(struct bpf_prog_info_struct, ifindex) == SoM(struct bpf_prog_info, ifindex),
		      "bpf_prog_info_struct.ifindex size mismatch");
	static_assert(offsetof(struct bpf_prog_info_struct, ifindex) == offsetof(struct bpf_prog_info, ifindex),
		      "bpf_prog_info_struct.ifindex offset mismatch");
# endif /* HAVE_STRUCT_BPF_PROG_INFO_IFINDEX */

static_assert(bpf_prog_info_struct_size == expected_bpf_prog_info_struct_size,
	      "bpf_prog_info_struct_size mismatch");

#endif /* HAVE_LINUX_BPF_H */