From 58aec3c59a53147c7d924c823f7405218fb5f555 Mon Sep 17 00:00:00 2001 From: Felix Fietkau Date: Wed, 12 Mar 2014 20:08:27 +0100 Subject: blobmsg: allow data/length iterator/accessor functions to work on non-blobmsg elements This primarily helps with simplifying the ubus APIs. blobmsg header presence is indicated by the BLOB_ATTR_EXTENDED bit in the id_len field. This changes the format ABI, but not the API. Signed-off-by: Felix Fietkau --- blobmsg.c | 1 + 1 file changed, 1 insertion(+) (limited to 'blobmsg.c') diff --git a/blobmsg.c b/blobmsg.c index 3076620..47ee9e7 100644 --- a/blobmsg.c +++ b/blobmsg.c @@ -181,6 +181,7 @@ blobmsg_new(struct blob_buf *buf, int type, const char *name, int payload_len, v if (!attr) return NULL; + attr->id_len |= be32_to_cpu(BLOB_ATTR_EXTENDED); hdr = blob_data(attr); hdr->namelen = cpu_to_be16(namelen); strcpy((char *) hdr->name, (const char *)name); -- cgit v1.2.3