nftnl_obj_set_u32(nlo, NFTNL_OBJ_FAMILY, h->family);
nftnl_obj_set_str(nlo, NFTNL_OBJ_TABLE, h->table.name);
- if (h->obj != NULL)
- nftnl_obj_set_str(nlo, NFTNL_OBJ_NAME, h->obj);
+ if (h->obj.name != NULL)
+ nftnl_obj_set_str(nlo, NFTNL_OBJ_NAME, h->obj.name);
nftnl_obj_set_u32(nlo, NFTNL_OBJ_TYPE, type);
if (h->handle.id)
obj->handle.family = nftnl_obj_get_u32(nlo, NFTNL_OBJ_FAMILY);
obj->handle.table.name =
xstrdup(nftnl_obj_get_str(nlo, NFTNL_OBJ_TABLE));
- obj->handle.obj =
+ obj->handle.obj.name =
xstrdup(nftnl_obj_get_str(nlo, NFTNL_OBJ_NAME));
obj->handle.handle.id =
nftnl_obj_get_u64(nlo, NFTNL_OBJ_HANDLE);
int err;
obj_cache = mnl_nft_obj_dump(ctx, h->family,
- h->table.name, h->obj, type, dump, true);
+ h->table.name, h->obj.name, type, dump, true);
if (obj_cache == NULL)
return -1;
dst->set.name = xstrdup(src->set.name);
if (dst->flowtable == NULL && src->flowtable != NULL)
dst->flowtable = xstrdup(src->flowtable);
- if (dst->obj == NULL && src->obj != NULL)
- dst->obj = xstrdup(src->obj);
+ if (dst->obj.name == NULL && src->obj.name != NULL)
+ dst->obj.name = xstrdup(src->obj.name);
if (dst->handle.id == 0)
dst->handle = src->handle;
if (dst->position.id == 0)
struct obj *obj;
list_for_each_entry(obj, &table->objs, list) {
- if (!strcmp(obj->handle.obj, name) &&
+ if (!strcmp(obj->handle.obj.name, name) &&
obj->type == type)
return obj;
}
{
switch (obj->type) {
case NFT_OBJECT_COUNTER:
- nft_print(octx, " %s {", obj->handle.obj);
+ nft_print(octx, " %s {", obj->handle.obj.name);
if (octx->handle > 0)
nft_print(octx, " # handle %" PRIu64, obj->handle.handle.id);
nft_print(octx, "%s%s%s", opts->nl, opts->tab, opts->tab);
const char *data_unit;
uint64_t bytes;
- nft_print(octx, " %s {", obj->handle.obj);
+ nft_print(octx, " %s {", obj->handle.obj.name);
if (octx->handle > 0)
nft_print(octx, " # handle %" PRIu64, obj->handle.handle.id);
nft_print(octx, "%s%s%s", opts->nl, opts->tab, opts->tab);
}
break;
case NFT_OBJECT_CT_HELPER:
- nft_print(octx, "ct helper %s {", obj->handle.obj);
+ nft_print(octx, "ct helper %s {", obj->handle.obj.name);
if (octx->handle > 0)
nft_print(octx, " # handle %" PRIu64, obj->handle.handle.id);
nft_print(octx, "%s", opts->nl);
const char *data_unit;
uint64_t rate;
- nft_print(octx, " %s {", obj->handle.obj);
+ nft_print(octx, " %s {", obj->handle.obj.name);
if (octx->handle > 0)
nft_print(octx, " # handle %" PRIu64, obj->handle.handle.id);
nft_print(octx, "%s%s%s", opts->nl, opts->tab, opts->tab);
list_for_each_entry(obj, &table->objs, list) {
if (obj->type != type ||
- (cmd->handle.obj != NULL &&
- strcmp(cmd->handle.obj, obj->handle.obj)))
+ (cmd->handle.obj.name != NULL &&
+ strcmp(cmd->handle.obj.name, obj->handle.obj.name)))
continue;
obj_print_declaration(obj, &opts, ctx->octx);