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_strlcpy(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
509 size_t nla_strlcpy(char *dst, const struct nlattr *nla, size_t dstsize);
510 char *nla_strdup(const struct nlattr *nla, gfp_t flags);
512 int nla_memcmp(const struct nlattr *nla, const void *data, size_t size);
513 int nla_strcmp(const struct nlattr *nla, const char *str);
1126 * @nla: netlink attribute
1128 static inline int nla_type(const struct nlattr *nla)
1130 return nla->nla_type & NLA_TYPE_MASK;
1135 * @nla: netlink attribute
1137 static inline void *nla_data(const struct nlattr *nla)
1139 return (char *) nla + NLA_HDRLEN;
1144 * @nla: netlink attribute
1146 static inline int nla_len(const struct nlattr *nla)
1148 return nla->nla_len - NLA_HDRLEN;
1153 * @nla: netlink attribute
1156 static inline int nla_ok(const struct nlattr *nla, int remaining)
1158 return remaining >= (int) sizeof(*nla) &&
1159 nla->nla_len >= sizeof(*nla) &&
1160 nla->nla_len <= remaining;
1165 * @nla: netlink attribute
1171 static inline struct nlattr *nla_next(const struct nlattr *nla, int *remaining)
1173 unsigned int totlen = NLA_ALIGN(nla->nla_len);
1176 return (struct nlattr *) ((char *) nla + totlen);
1181 * @nla: attribute containing the nested attributes
1187 nla_find_nested(const struct nlattr *nla, int attrtype)
1189 return nla_find(nla_data(nla), nla_len(nla), attrtype);
1196 * @nla: attribute containing the nested attributes
1203 const struct nlattr *nla,
1207 if (!(nla->nla_type & NLA_F_NESTED)) {
1208 NL_SET_ERR_MSG_ATTR(extack, nla, "NLA_F_NESTED is missing");
1212 return __nla_parse(tb, maxtype, nla_data(nla), nla_len(nla), policy,
1220 * @nla: attribute containing the nested attributes
1227 const struct nlattr *nla,
1231 return __nla_parse(tb, maxtype, nla_data(nla), nla_len(nla), policy,
1550 * @nla: u32 netlink attribute
1552 static inline u32 nla_get_u32(const struct nlattr *nla)
1554 return *(u32 *) nla_data(nla);
1559 * @nla: __be32 netlink attribute
1561 static inline __be32 nla_get_be32(const struct nlattr *nla)
1563 return *(__be32 *) nla_data(nla);
1568 * @nla: __le32 netlink attribute
1570 static inline __le32 nla_get_le32(const struct nlattr *nla)
1572 return *(__le32 *) nla_data(nla);
1577 * @nla: u16 netlink attribute
1579 static inline u16 nla_get_u16(const struct nlattr *nla)
1581 return *(u16 *) nla_data(nla);
1586 * @nla: __be16 netlink attribute
1588 static inline __be16 nla_get_be16(const struct nlattr *nla)
1590 return *(__be16 *) nla_data(nla);
1595 * @nla: __le16 netlink attribute
1597 static inline __le16 nla_get_le16(const struct nlattr *nla)
1599 return *(__le16 *) nla_data(nla);
1604 * @nla: u8 netlink attribute
1606 static inline u8 nla_get_u8(const struct nlattr *nla)
1608 return *(u8 *) nla_data(nla);
1613 * @nla: u64 netlink attribute
1615 static inline u64 nla_get_u64(const struct nlattr *nla)
1619 nla_memcpy(&tmp, nla, sizeof(tmp));
1626 * @nla: __be64 netlink attribute
1628 static inline __be64 nla_get_be64(const struct nlattr *nla)
1632 nla_memcpy(&tmp, nla, sizeof(tmp));
1639 * @nla: __le64 netlink attribute
1641 static inline __le64 nla_get_le64(const struct nlattr *nla)
1643 return *(__le64 *) nla_data(nla);
1648 * @nla: s32 netlink attribute
1650 static inline s32 nla_get_s32(const struct nlattr *nla)
1652 return *(s32 *) nla_data(nla);
1657 * @nla: s16 netlink attribute
1659 static inline s16 nla_get_s16(const struct nlattr *nla)
1661 return *(s16 *) nla_data(nla);
1666 * @nla: s8 netlink attribute
1668 static inline s8 nla_get_s8(const struct nlattr *nla)
1670 return *(s8 *) nla_data(nla);
1675 * @nla: s64 netlink attribute
1677 static inline s64 nla_get_s64(const struct nlattr *nla)
1681 nla_memcpy(&tmp, nla, sizeof(tmp));
1688 * @nla: flag netlink attribute
1690 static inline int nla_get_flag(const struct nlattr *nla)
1692 return !!nla;
1697 * @nla: msecs netlink attribute
1701 static inline unsigned long nla_get_msecs(const struct nlattr *nla)
1703 u64 msecs = nla_get_u64(nla);
1710 * @nla: IPv4 address netlink attribute
1712 static inline __be32 nla_get_in_addr(const struct nlattr *nla)
1714 return *(__be32 *) nla_data(nla);
1719 * @nla: IPv6 address netlink attribute
1721 static inline struct in6_addr nla_get_in6_addr(const struct nlattr *nla)
1725 nla_memcpy(&tmp, nla, sizeof(tmp));
1731 * @nla: nla_bitfield32 attribute
1733 static inline struct nla_bitfield32 nla_get_bitfield32(const struct nlattr *nla)
1737 nla_memcpy(&tmp, nla, sizeof(tmp));
1928 * @nla: attribute containing the nested attributes
1931 #define nla_for_each_nested(pos, nla, rem) \
1932 nla_for_each_attr(pos, nla_data(nla), nla_len(nla), rem)
1936 * @nla: attribute to test
1939 static inline bool nla_is_last(const struct nlattr *nla, int rem)
1941 return nla->nla_len == rem;