diff --git a/include/netlink/object.h b/include/netlink/object.h index ef1ed9f..7dc62ac 100644 --- a/include/netlink/object.h +++ b/include/netlink/object.h @@ -36,6 +36,7 @@ extern void nl_object_put(struct nl_object *); extern int nl_object_shared(struct nl_object *); extern void nl_object_dump(struct nl_object *, struct nl_dump_params *); +extern void nl_object_dump_buf(struct nl_object *, char *, size_t); extern int nl_object_identical(struct nl_object *, struct nl_object *); extern uint32_t nl_object_diff(struct nl_object *, diff --git a/lib/object.c b/lib/object.c index 4a1b356..3bf02ea 100644 --- a/lib/object.c +++ b/lib/object.c @@ -250,6 +250,16 @@ void nl_object_dump(struct nl_object *obj, struct nl_dump_params *params) dump_from_ops(obj, params); } +void nl_object_dump_buf(struct nl_object *obj, char *buf, size_t len) +{ + struct nl_dump_params dp = { + .dp_buf = buf, + .dp_buflen = len, + }; + + return nl_object_dump(obj, &dp); +} + /** * Check if the identifiers of two objects are identical * @arg a an object