Lines Matching refs:nla
84 * <- nla_len(nla) -> ^
85 * nla_data(nla)----^ |
86 * nla_next(nla)-----------------------------'
118 * nla_nest_end(skb, nla) finalize a nested attribute
119 * nla_nest_cancel(skb, nla) cancel nested attribute construction
127 * nla_data(nla) head of attribute payload
128 * nla_len(nla) length of attribute payload
131 * nla_get_u8(nla) get payload for a u8 attribute
132 * nla_get_u16(nla) get payload for a u16 attribute
133 * nla_get_u32(nla) get payload for a u32 attribute
134 * nla_get_u64(nla) get payload for a u64 attribute
135 * nla_get_s8(nla) get payload for a s8 attribute
136 * nla_get_s16(nla) get payload for a s16 attribute
137 * nla_get_s32(nla) get payload for a s32 attribute
138 * nla_get_s64(nla) get payload for a s64 attribute
139 * nla_get_flag(nla) return 1 if flag is true
140 * nla_get_msecs(nla) get payload for a msecs attribute
143 * nla_memcpy(dest, nla, count) copy attribute into memory
144 * nla_memcmp(nla, data, size) compare attribute with memory area
145 * nla_strscpy(dst, nla, size) copy attribute to a sized string
146 * nla_strcmp(nla, str) compare attribute with string
149 * nla_ok(nla, remaining) does nla fit into remaining bytes?
150 * nla_next(nla, remaining) get next netlink attribute
521 ssize_t nla_strscpy(char *dst, const struct nlattr *nla, size_t dstsize);
522 char *nla_strdup(const struct nlattr *nla, gfp_t flags);
524 int nla_memcmp(const struct nlattr *nla, const void *data, size_t size);
525 int nla_strcmp(const struct nlattr *nla, const char *str);
1172 * @nla: netlink attribute
1174 static inline int nla_type(const struct nlattr *nla)
1176 return nla->nla_type & NLA_TYPE_MASK;
1181 * @nla: netlink attribute
1183 static inline void *nla_data(const struct nlattr *nla)
1185 return (char *) nla + NLA_HDRLEN;
1190 * @nla: netlink attribute
1192 static inline int nla_len(const struct nlattr *nla)
1194 return nla->nla_len - NLA_HDRLEN;
1199 * @nla: netlink attribute
1202 static inline int nla_ok(const struct nlattr *nla, int remaining)
1204 return remaining >= (int) sizeof(*nla) &&
1205 nla->nla_len >= sizeof(*nla) &&
1206 nla->nla_len <= remaining;
1211 * @nla: netlink attribute
1217 static inline struct nlattr *nla_next(const struct nlattr *nla, int *remaining)
1219 unsigned int totlen = NLA_ALIGN(nla->nla_len);
1222 return (struct nlattr *) ((char *) nla + totlen);
1227 * @nla: attribute containing the nested attributes
1233 nla_find_nested(const struct nlattr *nla, int attrtype)
1235 return nla_find(nla_data(nla), nla_len(nla), attrtype);
1242 * @nla: attribute containing the nested attributes
1249 const struct nlattr *nla,
1253 if (!(nla->nla_type & NLA_F_NESTED)) {
1254 NL_SET_ERR_MSG_ATTR(extack, nla, "NLA_F_NESTED is missing");
1258 return __nla_parse(tb, maxtype, nla_data(nla), nla_len(nla), policy,
1266 * @nla: attribute containing the nested attributes
1273 const struct nlattr *nla,
1277 return __nla_parse(tb, maxtype, nla_data(nla), nla_len(nla), policy,
1596 * @nla: u32 netlink attribute
1598 static inline u32 nla_get_u32(const struct nlattr *nla)
1600 return *(u32 *) nla_data(nla);
1605 * @nla: __be32 netlink attribute
1607 static inline __be32 nla_get_be32(const struct nlattr *nla)
1609 return *(__be32 *) nla_data(nla);
1614 * @nla: __le32 netlink attribute
1616 static inline __le32 nla_get_le32(const struct nlattr *nla)
1618 return *(__le32 *) nla_data(nla);
1623 * @nla: u16 netlink attribute
1625 static inline u16 nla_get_u16(const struct nlattr *nla)
1627 return *(u16 *) nla_data(nla);
1632 * @nla: __be16 netlink attribute
1634 static inline __be16 nla_get_be16(const struct nlattr *nla)
1636 return *(__be16 *) nla_data(nla);
1641 * @nla: __le16 netlink attribute
1643 static inline __le16 nla_get_le16(const struct nlattr *nla)
1645 return *(__le16 *) nla_data(nla);
1650 * @nla: u8 netlink attribute
1652 static inline u8 nla_get_u8(const struct nlattr *nla)
1654 return *(u8 *) nla_data(nla);
1659 * @nla: u64 netlink attribute
1661 static inline u64 nla_get_u64(const struct nlattr *nla)
1665 nla_memcpy(&tmp, nla, sizeof(tmp));
1672 * @nla: __be64 netlink attribute
1674 static inline __be64 nla_get_be64(const struct nlattr *nla)
1678 nla_memcpy(&tmp, nla, sizeof(tmp));
1685 * @nla: __le64 netlink attribute
1687 static inline __le64 nla_get_le64(const struct nlattr *nla)
1689 return *(__le64 *) nla_data(nla);
1694 * @nla: s32 netlink attribute
1696 static inline s32 nla_get_s32(const struct nlattr *nla)
1698 return *(s32 *) nla_data(nla);
1703 * @nla: s16 netlink attribute
1705 static inline s16 nla_get_s16(const struct nlattr *nla)
1707 return *(s16 *) nla_data(nla);
1712 * @nla: s8 netlink attribute
1714 static inline s8 nla_get_s8(const struct nlattr *nla)
1716 return *(s8 *) nla_data(nla);
1721 * @nla: s64 netlink attribute
1723 static inline s64 nla_get_s64(const struct nlattr *nla)
1727 nla_memcpy(&tmp, nla, sizeof(tmp));
1734 * @nla: flag netlink attribute
1736 static inline int nla_get_flag(const struct nlattr *nla)
1738 return !!nla;
1743 * @nla: msecs netlink attribute
1747 static inline unsigned long nla_get_msecs(const struct nlattr *nla)
1749 u64 msecs = nla_get_u64(nla);
1756 * @nla: IPv4 address netlink attribute
1758 static inline __be32 nla_get_in_addr(const struct nlattr *nla)
1760 return *(__be32 *) nla_data(nla);
1765 * @nla: IPv6 address netlink attribute
1767 static inline struct in6_addr nla_get_in6_addr(const struct nlattr *nla)
1771 nla_memcpy(&tmp, nla, sizeof(tmp));
1777 * @nla: nla_bitfield32 attribute
1779 static inline struct nla_bitfield32 nla_get_bitfield32(const struct nlattr *nla)
1783 nla_memcpy(&tmp, nla, sizeof(tmp));
1974 * @nla: attribute containing the nested attributes
1977 #define nla_for_each_nested(pos, nla, rem) \
1978 nla_for_each_attr(pos, nla_data(nla), nla_len(nla), rem)
1982 * @nla: attribute to test
1985 static inline bool nla_is_last(const struct nlattr *nla, int rem)
1987 return nla->nla_len == rem;