static uc_value_t *
uc_bpf_set_tc_hook(uc_value_t *ifname, uc_value_t *type, uc_value_t *prio,
- int fd)
+ uc_value_t *classid, int fd)
{
DECLARE_LIBBPF_OPTS(bpf_tc_hook, hook);
DECLARE_LIBBPF_OPTS(bpf_tc_opts, attach_tc,
goto out;
attach_tc.prog_fd = fd;
+ attach_tc.classid = ucv_int64_get(classid);
if (bpf_tc_attach(&hook, &attach_tc) < 0)
goto error;
uc_value_t *ifname = uc_fn_arg(0);
uc_value_t *type = uc_fn_arg(1);
uc_value_t *prio = uc_fn_arg(2);
+ uc_value_t *classid = uc_fn_arg(3);
if (!f)
err_return(EINVAL, NULL);
- return uc_bpf_set_tc_hook(ifname, type, prio, f->fd);
+ return uc_bpf_set_tc_hook(ifname, type, prio, classid, f->fd);
}
static uc_value_t *
uc_value_t *type = uc_fn_arg(1);
uc_value_t *prio = uc_fn_arg(2);
- return uc_bpf_set_tc_hook(ifname, type, prio, -1);
+ return uc_bpf_set_tc_hook(ifname, type, prio, NULL, -1);
}
static int