.off = 0, \
.imm = 0 })
-int bpf_parse_common(struct bpf_cfg_in *cfg, const struct bpf_cfg_ops *ops,
- void *nl);
+int bpf_parse_and_load_common(struct bpf_cfg_in *cfg,
+ const struct bpf_cfg_ops *ops, void *nl);
const char *bpf_prog_to_default_section(enum bpf_prog_type type);
return xdp_delete(&xdp);
}
- if (bpf_parse_common(&cfg, &bpf_cb_ops, &xdp))
+ if (bpf_parse_and_load_common(&cfg, &bpf_cb_ops, &xdp))
return -1;
*argc = cfg.argc;
int err;
nest = rta_nest(rta, len, attr);
- err = bpf_parse_common(&cfg, &bpf_cb_ops, &x);
+ err = bpf_parse_and_load_common(&cfg, &bpf_cb_ops, &x);
if (err < 0) {
fprintf(stderr, "Failed to parse eBPF program: %s\n",
strerror(-err));
return 0;
}
-int bpf_parse_common(struct bpf_cfg_in *cfg, const struct bpf_cfg_ops *ops,
- void *nl)
+int bpf_parse_and_load_common(struct bpf_cfg_in *cfg,
+ const struct bpf_cfg_ops *ops, void *nl)
{
bool opt_tbl[BPF_MODE_MAX] = {};
cfg.argc = argc;
cfg.argv = argv;
- if (bpf_parse_common(&cfg, &bpf_cb_ops, n))
+ if (bpf_parse_and_load_common(&cfg, &bpf_cb_ops, n))
return -1;
argc = cfg.argc;
cfg.argc = argc;
cfg.argv = argv;
- if (bpf_parse_common(&cfg, &bpf_cb_ops, n))
+ if (bpf_parse_and_load_common(&cfg, &bpf_cb_ops, n))
return -1;
argc = cfg.argc;