blobmsg: add a helper function to reset the name of a blobmsg attribute
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
This commit is contained in:
parent
bd388d2b6c
commit
f3977836af
1 changed files with 6 additions and 0 deletions
|
@ -51,6 +51,12 @@ static inline int blobmsg_hdrlen(unsigned int namelen)
|
|||
return BLOBMSG_PADDING(sizeof(struct blobmsg_hdr) + namelen + 1);
|
||||
}
|
||||
|
||||
static inline void blobmsg_clear_name(struct blob_attr *attr)
|
||||
{
|
||||
struct blobmsg_hdr *hdr = (struct blobmsg_hdr *) blob_data(attr);
|
||||
hdr->name[0] = 0;
|
||||
}
|
||||
|
||||
static inline const char *blobmsg_name(const struct blob_attr *attr)
|
||||
{
|
||||
struct blobmsg_hdr *hdr = (struct blobmsg_hdr *) blob_data(attr);
|
||||
|
|
Loading…
Reference in a new issue