12 #include <netlink-local.h>
13 #include <netlink/cli/utils.h>
15 static void print_usage(
void)
17 fprintf(stderr,
"Usage: nl-list-caches\n");
21 static char *id_attr_list(
struct nl_object_ops *ops,
char *buf,
size_t len)
23 if (ops->oo_attrs2str != NULL)
24 return ops->oo_attrs2str(ops->oo_id_attrs, buf, len);
36 " hdrsize: %d bytes\n" \
38 " request-update: %s\n" \
41 nl_nlfamily2str(ops->
co_protocol, buf,
sizeof(buf)),
47 const char *dump_names[NL_DUMP_MAX+1] = {
54 printf(
" cacheable object:\n" \
56 " size: %zu bytes\n" \
57 " constructor: %s\n" \
61 " id attributes: %s\n" \
68 id_attr_list(obj_ops, buf,
sizeof(buf)));
70 for (i = 0; i <= NL_DUMP_MAX; i++)
93 for (i = 0; i < genl_ops->
o_ncmds; i++) {
100 " attr-policy: %s\n",
109 int main(
int argc,
char *argv[])
111 if (argc > 1 && !strcasecmp(argv[1],
"-h"))