X-Git-Url: http://git.archive.openwrt.org/?p=project%2Flibubox.git;a=blobdiff_plain;f=blob.h;h=37a572b0974940d1739590ea08a32d4d3c1d7e0e;hp=846de6e059d0b7b9cc190c7f87d338af05afe8e0;hb=93a4cb92c18334af6f102eb76a812d8e888510d4;hpb=be458596bd13f0a708d52efaa5c70bac2f8fe97d diff --git a/blob.h b/blob.h index 846de6e..37a572b 100644 --- a/blob.h +++ b/blob.h @@ -28,6 +28,8 @@ #include "utils.h" +#define BLOB_COOKIE 0x01234567 + enum { BLOB_ATTR_UNSPEC, BLOB_ATTR_NESTED, @@ -40,10 +42,11 @@ enum { BLOB_ATTR_LAST }; -#define BLOB_ATTR_ID_MASK 0xff000000 +#define BLOB_ATTR_ID_MASK 0x7f000000 #define BLOB_ATTR_ID_SHIFT 24 #define BLOB_ATTR_LEN_MASK 0x00ffffff #define BLOB_ATTR_ALIGN 4 +#define BLOB_ATTR_EXTENDED 0x80000000 struct blob_attr { uint32_t id_len; @@ -83,6 +86,12 @@ blob_id(const struct blob_attr *attr) return id; } +static inline bool +blob_is_extended(const struct blob_attr *attr) +{ + return !!(attr->id_len & cpu_to_be32(BLOB_ATTR_EXTENDED)); +} + /* * blob_len: returns the length of the attribute's payload */