diff options
Diffstat (limited to 'src/udata.c')
-rw-r--r-- | src/udata.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/udata.c b/src/udata.c index 60c2f34..d679dd0 100644 --- a/src/udata.c +++ b/src/udata.c @@ -94,6 +94,13 @@ bool nftnl_udata_put_strz(struct nftnl_udata_buf *buf, uint8_t type, } EXPORT_SYMBOL(nftnl_udata_put_strz); +bool nftnl_udata_put_u32(struct nftnl_udata_buf *buf, uint8_t type, + uint32_t data) +{ + return nftnl_udata_put(buf, type, sizeof(data), &data); +} +EXPORT_SYMBOL(nftnl_udata_put_u32); + uint8_t nftnl_udata_type(const struct nftnl_udata *attr) { return attr->type; @@ -112,6 +119,14 @@ void *nftnl_udata_get(const struct nftnl_udata *attr) } EXPORT_SYMBOL(nftnl_udata_get); +uint32_t nftnl_udata_get_u32(const struct nftnl_udata *attr) +{ + uint32_t *data = (uint32_t *)attr->value; + + return *data; +} +EXPORT_SYMBOL(nftnl_udata_get_u32); + struct nftnl_udata *nftnl_udata_next(const struct nftnl_udata *attr) { return (struct nftnl_udata *)&attr->value[attr->len]; |