Lines Matching defs:opts

173 		   const struct bpf_map_create_opts *opts)
183 if (!OPTS_VALID(opts, bpf_map_create_opts))
193 attr.btf_fd = OPTS_GET(opts, btf_fd, 0);
194 attr.btf_key_type_id = OPTS_GET(opts, btf_key_type_id, 0);
195 attr.btf_value_type_id = OPTS_GET(opts, btf_value_type_id, 0);
196 attr.btf_vmlinux_value_type_id = OPTS_GET(opts, btf_vmlinux_value_type_id, 0);
197 attr.value_type_btf_obj_fd = OPTS_GET(opts, value_type_btf_obj_fd, 0);
199 attr.inner_map_fd = OPTS_GET(opts, inner_map_fd, 0);
200 attr.map_flags = OPTS_GET(opts, map_flags, 0);
201 attr.map_extra = OPTS_GET(opts, map_extra, 0);
202 attr.numa_node = OPTS_GET(opts, numa_node, 0);
203 attr.map_ifindex = OPTS_GET(opts, map_ifindex, 0);
205 attr.map_token_fd = OPTS_GET(opts, token_fd, 0);
239 struct bpf_prog_load_opts *opts)
252 if (!OPTS_VALID(opts, bpf_prog_load_opts))
255 attempts = OPTS_GET(opts, attempts, 0);
264 attr.expected_attach_type = OPTS_GET(opts, expected_attach_type, 0);
266 attr.prog_btf_fd = OPTS_GET(opts, prog_btf_fd, 0);
267 attr.prog_flags = OPTS_GET(opts, prog_flags, 0);
268 attr.prog_ifindex = OPTS_GET(opts, prog_ifindex, 0);
269 attr.kern_version = OPTS_GET(opts, kern_version, 0);
270 attr.prog_token_fd = OPTS_GET(opts, token_fd, 0);
282 attach_prog_fd = OPTS_GET(opts, attach_prog_fd, 0);
283 attach_btf_obj_fd = OPTS_GET(opts, attach_btf_obj_fd, 0);
288 attr.attach_btf_id = OPTS_GET(opts, attach_btf_id, 0);
294 log_buf = OPTS_GET(opts, log_buf, NULL);
295 log_size = OPTS_GET(opts, log_size, 0);
296 log_level = OPTS_GET(opts, log_level, 0);
301 func_info_rec_size = OPTS_GET(opts, func_info_rec_size, 0);
302 func_info = OPTS_GET(opts, func_info, NULL);
305 attr.func_info_cnt = OPTS_GET(opts, func_info_cnt, 0);
307 line_info_rec_size = OPTS_GET(opts, line_info_rec_size, 0);
308 line_info = OPTS_GET(opts, line_info, NULL);
311 attr.line_info_cnt = OPTS_GET(opts, line_info_cnt, 0);
313 attr.fd_array = ptr_to_u64(OPTS_GET(opts, fd_array, NULL));
322 OPTS_SET(opts, log_true_size, attr.log_true_size);
363 OPTS_SET(opts, log_true_size, attr.log_true_size);
378 OPTS_SET(opts, log_true_size, attr.log_true_size);
526 const struct bpf_map_batch_opts *opts)
532 if (!OPTS_VALID(opts, bpf_map_batch_opts))
542 attr.batch.elem_flags = OPTS_GET(opts, elem_flags, 0);
543 attr.batch.flags = OPTS_GET(opts, flags, 0);
552 const struct bpf_map_batch_opts *opts)
555 NULL, (void *)keys, NULL, count, opts);
560 const struct bpf_map_batch_opts *opts)
563 out_batch, keys, values, count, opts);
568 const struct bpf_map_batch_opts *opts)
572 count, opts);
576 const struct bpf_map_batch_opts *opts)
579 (void *)keys, (void *)values, count, opts);
582 int bpf_obj_pin_opts(int fd, const char *pathname, const struct bpf_obj_pin_opts *opts)
588 if (!OPTS_VALID(opts, bpf_obj_pin_opts))
592 attr.path_fd = OPTS_GET(opts, path_fd, 0);
594 attr.file_flags = OPTS_GET(opts, file_flags, 0);
611 int bpf_obj_get_opts(const char *pathname, const struct bpf_obj_get_opts *opts)
617 if (!OPTS_VALID(opts, bpf_obj_get_opts))
621 attr.path_fd = OPTS_GET(opts, path_fd, 0);
623 attr.file_flags = OPTS_GET(opts, file_flags, 0);
632 DECLARE_LIBBPF_OPTS(bpf_prog_attach_opts, opts,
636 return bpf_prog_attach_opts(prog_fd, target_fd, type, &opts);
640 const struct bpf_prog_attach_opts *opts)
647 if (!OPTS_VALID(opts, bpf_prog_attach_opts))
650 relative_id = OPTS_GET(opts, relative_id, 0);
651 relative_fd = OPTS_GET(opts, relative_fd, 0);
652 flags = OPTS_GET(opts, flags, 0);
662 attr.replace_bpf_fd = OPTS_GET(opts, replace_fd, 0);
663 attr.expected_revision = OPTS_GET(opts, expected_revision, 0);
678 const struct bpf_prog_detach_opts *opts)
685 if (!OPTS_VALID(opts, bpf_prog_detach_opts))
688 relative_id = OPTS_GET(opts, relative_id, 0);
689 relative_fd = OPTS_GET(opts, relative_fd, 0);
690 flags = OPTS_GET(opts, flags, 0);
700 attr.expected_revision = OPTS_GET(opts, expected_revision, 0);
726 const struct bpf_link_create_opts *opts)
733 if (!OPTS_VALID(opts, bpf_link_create_opts))
736 iter_info_len = OPTS_GET(opts, iter_info_len, 0);
737 target_btf_id = OPTS_GET(opts, target_btf_id, 0);
743 if (!OPTS_ZEROED(opts, target_btf_id))
751 attr.link_create.flags = OPTS_GET(opts, flags, 0);
760 attr.link_create.iter_info = ptr_to_u64(OPTS_GET(opts, iter_info, (void *)0));
764 attr.link_create.perf_event.bpf_cookie = OPTS_GET(opts, perf_event.bpf_cookie, 0);
765 if (!OPTS_ZEROED(opts, perf_event))
769 attr.link_create.kprobe_multi.flags = OPTS_GET(opts, kprobe_multi.flags, 0);
770 attr.link_create.kprobe_multi.cnt = OPTS_GET(opts, kprobe_multi.cnt, 0);
771 attr.link_create.kprobe_multi.syms = ptr_to_u64(OPTS_GET(opts, kprobe_multi.syms, 0));
772 attr.link_create.kprobe_multi.addrs = ptr_to_u64(OPTS_GET(opts, kprobe_multi.addrs, 0));
773 attr.link_create.kprobe_multi.cookies = ptr_to_u64(OPTS_GET(opts, kprobe_multi.cookies, 0));
774 if (!OPTS_ZEROED(opts, kprobe_multi))
778 attr.link_create.uprobe_multi.flags = OPTS_GET(opts, uprobe_multi.flags, 0);
779 attr.link_create.uprobe_multi.cnt = OPTS_GET(opts, uprobe_multi.cnt, 0);
780 attr.link_create.uprobe_multi.path = ptr_to_u64(OPTS_GET(opts, uprobe_multi.path, 0));
781 attr.link_create.uprobe_multi.offsets = ptr_to_u64(OPTS_GET(opts, uprobe_multi.offsets, 0));
782 attr.link_create.uprobe_multi.ref_ctr_offsets = ptr_to_u64(OPTS_GET(opts, uprobe_multi.ref_ctr_offsets, 0));
783 attr.link_create.uprobe_multi.cookies = ptr_to_u64(OPTS_GET(opts, uprobe_multi.cookies, 0));
784 attr.link_create.uprobe_multi.pid = OPTS_GET(opts, uprobe_multi.pid, 0);
785 if (!OPTS_ZEROED(opts, uprobe_multi))
792 attr.link_create.tracing.cookie = OPTS_GET(opts, tracing.cookie, 0);
793 if (!OPTS_ZEROED(opts, tracing))
797 attr.link_create.netfilter.pf = OPTS_GET(opts, netfilter.pf, 0);
798 attr.link_create.netfilter.hooknum = OPTS_GET(opts, netfilter.hooknum, 0);
799 attr.link_create.netfilter.priority = OPTS_GET(opts, netfilter.priority, 0);
800 attr.link_create.netfilter.flags = OPTS_GET(opts, netfilter.flags, 0);
801 if (!OPTS_ZEROED(opts, netfilter))
806 relative_fd = OPTS_GET(opts, tcx.relative_fd, 0);
807 relative_id = OPTS_GET(opts, tcx.relative_id, 0);
816 attr.link_create.tcx.expected_revision = OPTS_GET(opts, tcx.expected_revision, 0);
817 if (!OPTS_ZEROED(opts, tcx))
822 relative_fd = OPTS_GET(opts, netkit.relative_fd, 0);
823 relative_id = OPTS_GET(opts, netkit.relative_id, 0);
832 attr.link_create.netkit.expected_revision = OPTS_GET(opts, netkit.expected_revision, 0);
833 if (!OPTS_ZEROED(opts, netkit))
837 if (!OPTS_ZEROED(opts, flags))
857 if (!OPTS_ZEROED(opts, sz))
890 const struct bpf_link_update_opts *opts)
896 if (!OPTS_VALID(opts, bpf_link_update_opts))
899 if (OPTS_GET(opts, old_prog_fd, 0) && OPTS_GET(opts, old_map_fd, 0))
905 attr.link_update.flags = OPTS_GET(opts, flags, 0);
906 if (OPTS_GET(opts, old_prog_fd, 0))
907 attr.link_update.old_prog_fd = OPTS_GET(opts, old_prog_fd, 0);
908 else if (OPTS_GET(opts, old_map_fd, 0))
909 attr.link_update.old_map_fd = OPTS_GET(opts, old_map_fd, 0);
929 struct bpf_prog_query_opts *opts)
935 if (!OPTS_VALID(opts, bpf_prog_query_opts))
941 attr.query.query_flags = OPTS_GET(opts, query_flags, 0);
942 attr.query.count = OPTS_GET(opts, count, 0);
943 attr.query.prog_ids = ptr_to_u64(OPTS_GET(opts, prog_ids, NULL));
944 attr.query.link_ids = ptr_to_u64(OPTS_GET(opts, link_ids, NULL));
945 attr.query.prog_attach_flags = ptr_to_u64(OPTS_GET(opts, prog_attach_flags, NULL));
946 attr.query.link_attach_flags = ptr_to_u64(OPTS_GET(opts, link_attach_flags, NULL));
950 OPTS_SET(opts, attach_flags, attr.query.attach_flags);
951 OPTS_SET(opts, revision, attr.query.revision);
952 OPTS_SET(opts, count, attr.query.count);
960 LIBBPF_OPTS(bpf_prog_query_opts, opts);
963 opts.query_flags = query_flags;
964 opts.prog_ids = prog_ids;
965 opts.prog_cnt = *prog_cnt;
967 ret = bpf_prog_query_opts(target_fd, type, &opts);
970 *attach_flags = opts.attach_flags;
971 *prog_cnt = opts.prog_cnt;
976 int bpf_prog_test_run_opts(int prog_fd, struct bpf_test_run_opts *opts)
982 if (!OPTS_VALID(opts, bpf_test_run_opts))
987 attr.test.batch_size = OPTS_GET(opts, batch_size, 0);
988 attr.test.cpu = OPTS_GET(opts, cpu, 0);
989 attr.test.flags = OPTS_GET(opts, flags, 0);
990 attr.test.repeat = OPTS_GET(opts, repeat, 0);
991 attr.test.duration = OPTS_GET(opts, duration, 0);
992 attr.test.ctx_size_in = OPTS_GET(opts, ctx_size_in, 0);
993 attr.test.ctx_size_out = OPTS_GET(opts, ctx_size_out, 0);
994 attr.test.data_size_in = OPTS_GET(opts, data_size_in, 0);
995 attr.test.data_size_out = OPTS_GET(opts, data_size_out, 0);
996 attr.test.ctx_in = ptr_to_u64(OPTS_GET(opts, ctx_in, NULL));
997 attr.test.ctx_out = ptr_to_u64(OPTS_GET(opts, ctx_out, NULL));
998 attr.test.data_in = ptr_to_u64(OPTS_GET(opts, data_in, NULL));
999 attr.test.data_out = ptr_to_u64(OPTS_GET(opts, data_out, NULL));
1003 OPTS_SET(opts, data_size_out, attr.test.data_size_out);
1004 OPTS_SET(opts, ctx_size_out, attr.test.ctx_size_out);
1005 OPTS_SET(opts, duration, attr.test.duration);
1006 OPTS_SET(opts, retval, attr.test.retval);
1048 const struct bpf_get_fd_by_id_opts *opts)
1054 if (!OPTS_VALID(opts, bpf_get_fd_by_id_opts))
1059 attr.open_flags = OPTS_GET(opts, open_flags, 0);
1071 const struct bpf_get_fd_by_id_opts *opts)
1077 if (!OPTS_VALID(opts, bpf_get_fd_by_id_opts))
1082 attr.open_flags = OPTS_GET(opts, open_flags, 0);
1094 const struct bpf_get_fd_by_id_opts *opts)
1100 if (!OPTS_VALID(opts, bpf_get_fd_by_id_opts))
1105 attr.open_flags = OPTS_GET(opts, open_flags, 0);
1117 const struct bpf_get_fd_by_id_opts *opts)
1123 if (!OPTS_VALID(opts, bpf_get_fd_by_id_opts))
1128 attr.open_flags = OPTS_GET(opts, open_flags, 0);
1190 int bpf_btf_load(const void *btf_data, size_t btf_size, struct bpf_btf_load_opts *opts)
1203 if (!OPTS_VALID(opts, bpf_btf_load_opts))
1206 log_buf = OPTS_GET(opts, log_buf, NULL);
1207 log_size = OPTS_GET(opts, log_size, 0);
1208 log_level = OPTS_GET(opts, log_level, 0);
1218 attr.btf_flags = OPTS_GET(opts, btf_flags, 0);
1219 attr.btf_token_fd = OPTS_GET(opts, token_fd, 0);
1240 OPTS_SET(opts, log_true_size, attr.btf_log_true_size);
1284 const struct bpf_prog_bind_opts *opts)
1290 if (!OPTS_VALID(opts, bpf_prog_bind_opts))
1296 attr.prog_bind_map.flags = OPTS_GET(opts, flags, 0);
1302 int bpf_token_create(int bpffs_fd, struct bpf_token_create_opts *opts)
1308 if (!OPTS_VALID(opts, bpf_token_create_opts))
1313 attr.token_create.flags = OPTS_GET(opts, flags, 0);