add blobmsg_name()

This commit is contained in:
Felix Fietkau 2011-01-23 20:06:03 +01:00
parent 71f0be5e11
commit fcee2d56bc

View file

@ -49,6 +49,12 @@ static inline int blobmsg_hdrlen(int namelen)
return BLOBMSG_PADDING(sizeof(struct blobmsg_hdr) + namelen + 1); return BLOBMSG_PADDING(sizeof(struct blobmsg_hdr) + namelen + 1);
} }
static inline void *blobmsg_name(struct blob_attr *attr)
{
struct blobmsg_hdr *hdr = blob_data(attr);
return &hdr->name;
}
static inline void *blobmsg_data(struct blob_attr *attr) static inline void *blobmsg_data(struct blob_attr *attr)
{ {
struct blobmsg_hdr *hdr = blob_data(attr); struct blobmsg_hdr *hdr = blob_data(attr);