Lines Matching +full:attribute +full:- +full:set

1 /* SPDX-License-Identifier: GPL-2.0 */
12 * ------------------------------------------------------------------------
14 * ------------------------------------------------------------------------
17 * <--- nlmsg_total_size(payload) --->
18 * <-- nlmsg_msg_size(payload) ->
19 * +----------+- - -+-------------+- - -+-------- - -
21 * +----------+- - -+-------------+- - -+-------- - -
22 * nlmsg_data(nlh)---^ ^
23 * nlmsg_next(nlh)-----------------------+
26 * <---------------------- nlmsg_len(nlh) --------------------->
27 * <------ hdrlen ------> <- nlmsg_attrlen(nlh, hdrlen) ->
28 * +----------------------+- - -+--------------------------------+
30 * +----------------------+- - -+--------------------------------+
31 * nlmsg_attrdata(nlh, hdrlen)---^
67 * nlmsg_find_attr() find an attribute in a message
75 * ------------------------------------------------------------------------
77 * ------------------------------------------------------------------------
79 * Attribute Format:
80 * <------- nla_total_size(payload) ------->
81 * <---- nla_attr_size(payload) ----->
82 * +----------+- - -+- - - - - - - - - +- - -+-------- - -
84 * +----------+- - -+- - - - - - - - - +- - -+-------- - -
85 * <- nla_len(nla) -> ^
86 * nla_data(nla)----^ |
87 * nla_next(nla)-----------------------------'
90 * struct nlattr netlink attribute header
92 * Attribute Construction:
93 * nla_reserve(skb, type, len) reserve room for an attribute
94 * nla_reserve_nohdr(skb, len) reserve room for an attribute w/o hdr
95 * nla_put(skb, type, len, data) add attribute to skb
96 * nla_put_nohdr(skb, len, data) add attribute w/o hdr
99 * Attribute Construction for Basic Types:
100 * nla_put_u8(skb, type, value) add u8 attribute to skb
101 * nla_put_u16(skb, type, value) add u16 attribute to skb
102 * nla_put_u32(skb, type, value) add u32 attribute to skb
104 * value, padattr) add u64 attribute to skb
105 * nla_put_s8(skb, type, value) add s8 attribute to skb
106 * nla_put_s16(skb, type, value) add s16 attribute to skb
107 * nla_put_s32(skb, type, value) add s32 attribute to skb
109 * padattr) add s64 attribute to skb
110 * nla_put_string(skb, type, str) add string attribute to skb
111 * nla_put_flag(skb, type) add flag attribute to skb
113 * padattr) add msecs attribute to skb
114 * nla_put_in_addr(skb, type, addr) add IPv4 address attribute to skb
115 * nla_put_in6_addr(skb, type, addr) add IPv6 address attribute to skb
118 * nla_nest_start(skb, type) start a nested attribute
119 * nla_nest_end(skb, nla) finalize a nested attribute
120 * nla_nest_cancel(skb, nla) cancel nested attribute construction
123 * Attribute Length Calculations:
124 * nla_attr_size(payload) length of attribute w/o padding
125 * nla_total_size(payload) length of attribute w/ padding
128 * Attribute Payload Access:
129 * nla_data(nla) head of attribute payload
130 * nla_len(nla) length of attribute payload
132 * Attribute Payload Access for Basic Types:
133 * nla_get_uint(nla) get payload for a uint attribute
134 * nla_get_sint(nla) get payload for a sint attribute
135 * nla_get_u8(nla) get payload for a u8 attribute
136 * nla_get_u16(nla) get payload for a u16 attribute
137 * nla_get_u32(nla) get payload for a u32 attribute
138 * nla_get_u64(nla) get payload for a u64 attribute
139 * nla_get_s8(nla) get payload for a s8 attribute
140 * nla_get_s16(nla) get payload for a s16 attribute
141 * nla_get_s32(nla) get payload for a s32 attribute
142 * nla_get_s64(nla) get payload for a s64 attribute
144 * nla_get_msecs(nla) get payload for a msecs attribute
148 * Attribute Misc:
149 * nla_memcpy(dest, nla, count) copy attribute into memory
150 * nla_memcmp(nla, data, size) compare attribute with memory area
151 * nla_strscpy(dst, nla, size) copy attribute to a sized string
152 * nla_strcmp(nla, str) compare attribute with string
154 * Attribute Parsing:
156 * nla_next(nla, remaining) get next netlink attribute
159 * nla_find() find attribute in stream of attributes
160 * nla_find_nested() find attribute in nested attributes
173 * Standard attribute types to specify validation policy
201 #define NLA_TYPE_MAX (__NLA_TYPE_MAX - 1)
223 * struct nla_policy - attribute validation policy
224 * @type: Type of attribute or NLA_UNSPEC
225 * @validation_type: type of attribute validation done in addition to
226 * type-specific validation (e.g. range, function call), see
231 * accessible by attribute type up to the highest identifier to be expected.
237 * NLA_BINARY Maximum length of attribute payload
255 * All other Minimum length of attribute payload
258 * NLA_BITFIELD32 This is a 32-bit bitmap/bitselector attribute and
260 * NLA_REJECT This attribute is always rejected and `reject_message'
264 * also set `len' to the max attribute number. Use the
267 * parse, the nested sub-policies.
269 * must also set `len' to the max attribute number. Use
274 * level down and the attribute types directly in the
290 * the value of the integer attribute.
294 * of s16 - do that using the NLA_POLICY_FULL_RANGE()
302 * NLA_U64 If the validation_type field instead is set to
311 * NLA_S64 If the validation_type field instead is set to
319 * integers) of the attribute is enforced.
321 * All other Unused - but note that it's a union
324 * NLA_BINARY Validation function called for the attribute.
325 * All other Unused - but note that it's a union
344 * @strict_start_type: first attribute to validate strictly
346 * This entry is special, and used for the attribute at index 0
349 * starts for any attribute types >= this value, also, strict
358 * For completely new families it should be set to 1 so that the
360 * it should be set at least when new attributes are added to
361 * the enum used by the policy, and be set to the new value that
366 /* private: use NLA_POLICY_*() to set */
389 _NLA_POLICY_NESTED(ARRAY_SIZE(policy) - 1, policy)
391 _NLA_POLICY_NESTED_ARRAY(ARRAY_SIZE(policy) - 1, policy)
478 * struct nl_info - netlink source information
483 * @skip_notify_kernel: Skip selected in-kernel notifications
494 * enum netlink_validation - netlink message/attribute validation levels
495 * @NL_VALIDATE_LIBERAL: Old-style "be liberal" validation, not caring about
498 * @NL_VALIDATE_TRAILING: Reject junk data encountered after attribute parsing.
502 * This can safely be set by the kernel when the given policy has no
505 * @NL_VALIDATE_STRICT_ATTRS: strict attribute policy parsing (e.g.
507 * @NL_VALIDATE_NESTED: Check that NLA_F_NESTED is set for NLA_NESTED(_ARRAY)
570 * nlmsg_msg_size - length of netlink message not including padding
579 * nlmsg_total_size - length of netlink message including padding
588 * nlmsg_padlen - length of padding at the message's tail
593 return nlmsg_total_size(payload) - nlmsg_msg_size(payload); in nlmsg_padlen()
597 * nlmsg_data - head of message payload
606 * nlmsg_len - length of message payload
611 return nlh->nlmsg_len - NLMSG_HDRLEN; in nlmsg_len()
615 * nlmsg_attrdata - head of attributes data
627 * nlmsg_attrlen - length of attributes data
633 return nlmsg_len(nlh) - NLMSG_ALIGN(hdrlen); in nlmsg_attrlen()
637 * nlmsg_ok - check if the netlink message fits into the remaining bytes
644 nlh->nlmsg_len >= sizeof(struct nlmsghdr) && in nlmsg_ok()
645 nlh->nlmsg_len <= remaining); in nlmsg_ok()
649 * nlmsg_next - next netlink message in message stream
659 int totlen = NLMSG_ALIGN(nlh->nlmsg_len); in nlmsg_next()
661 *remaining -= totlen; in nlmsg_next()
667 * nla_parse - Parse a stream of attributes into a tb buffer
669 * @maxtype: maximum attribute type to be expected
670 * @head: head of attribute stream
671 * @len: length of attribute stream
675 * Parses a stream of attributes and stores a pointer to each attribute in
676 * the tb array accessible via the attribute type. Attributes with a type
692 * nla_parse_deprecated - Parse a stream of attributes into a tb buffer
694 * @maxtype: maximum attribute type to be expected
695 * @head: head of attribute stream
696 * @len: length of attribute stream
700 * Parses a stream of attributes and stores a pointer to each attribute in
701 * the tb array accessible via the attribute type. Attributes with a type
717 * nla_parse_deprecated_strict - Parse a stream of attributes into a tb buffer
719 * @maxtype: maximum attribute type to be expected
720 * @head: head of attribute stream
721 * @len: length of attribute stream
725 * Parses a stream of attributes and stores a pointer to each attribute in
726 * the tb array accessible via the attribute type. Attributes with a type
743 * __nlmsg_parse - parse attributes of a netlink message
747 * @maxtype: maximum attribute type to be expected
760 if (nlh->nlmsg_len < nlmsg_msg_size(hdrlen)) { in __nlmsg_parse()
762 return -EINVAL; in __nlmsg_parse()
771 * nlmsg_parse - parse attributes of a netlink message
775 * @maxtype: maximum attribute type to be expected
791 * nlmsg_parse_deprecated - parse attributes of a netlink message
795 * @maxtype: maximum attribute type to be expected
811 * nlmsg_parse_deprecated_strict - parse attributes of a netlink message
815 * @maxtype: maximum attribute type to be expected
832 * nlmsg_find_attr - find a specific attribute in a netlink message
835 * @attrtype: type of attribute to look for
837 * Returns: the first attribute which matches the specified type.
847 * nla_validate_deprecated - Validate a stream of attributes
848 * @head: head of attribute stream
849 * @len: length of attribute stream
850 * @maxtype: maximum attribute type to be expected
854 * Validates all attributes in the specified attribute stream against the
870 * nla_validate - Validate a stream of attributes
871 * @head: head of attribute stream
872 * @len: length of attribute stream
873 * @maxtype: maximum attribute type to be expected
877 * Validates all attributes in the specified attribute stream against the
892 * nlmsg_validate_deprecated - validate a netlink message including attributes
895 * @maxtype: maximum attribute type to be expected
904 if (nlh->nlmsg_len < nlmsg_msg_size(hdrlen)) in nlmsg_validate_deprecated()
905 return -EINVAL; in nlmsg_validate_deprecated()
915 * nlmsg_report - need to report back to application?
922 return nlh ? !!(nlh->nlmsg_flags & NLM_F_ECHO) : 0; in nlmsg_report()
926 * nlmsg_seq - return the seq number of netlink message
933 return nlh ? nlh->nlmsg_seq : 0; in nlmsg_seq()
937 * nlmsg_for_each_attr - iterate over a stream of attributes
938 * @pos: loop counter, set to current attribute
948 * nlmsg_put - Add a new netlink message to an skb
969 * nlmsg_append - Add more data to a nlmsg in a skb
974 * with multiple fixed-format headers (which is rare).
983 if (NLMSG_ALIGN(size) - size) in nlmsg_append()
985 NLMSG_ALIGN(size) - size); in nlmsg_append()
990 * nlmsg_put_answer - Add a new callback based netlink message to an skb
1005 return nlmsg_put(skb, NETLINK_CB(cb->skb).portid, cb->nlh->nlmsg_seq, in nlmsg_put_answer()
1010 * nlmsg_new - Allocate a new netlink message
1023 * nlmsg_new_large - Allocate a new netlink message with non-contiguous
1027 * The allocated skb is unable to have frag page for shinfo->frags*,
1028 * as the NULL setting for skb->head in netlink_skb_destructor() will
1037 * nlmsg_end - Finalize a netlink message
1047 nlh->nlmsg_len = skb_tail_pointer(skb) - (unsigned char *)nlh; in nlmsg_end()
1051 * nlmsg_get_pos - return current position in netlink message
1062 * nlmsg_trim - Trim message to a mark
1071 WARN_ON((unsigned char *) mark < skb->data); in nlmsg_trim()
1072 skb_trim(skb, (unsigned char *) mark - skb->data); in nlmsg_trim()
1077 * nlmsg_cancel - Cancel construction of a netlink message
1090 * nlmsg_free - drop a netlink message
1099 * nlmsg_consume - free a netlink message
1108 * nlmsg_multicast_filtered - multicast a netlink message with filter function
1138 * nlmsg_multicast - multicast a netlink message
1153 * nlmsg_unicast - unicast a netlink message
1170 * nlmsg_for_each_msg - iterate over a stream of messages
1171 * @pos: loop counter, set to current message
1182 * nl_dump_check_consistent - check if sequence is consistent and advertise if not
1189 * The correct way to use it is to set cb->seq to the generation counter when
1200 if (cb->prev_seq && cb->seq != cb->prev_seq) in nl_dump_check_consistent()
1201 nlh->nlmsg_flags |= NLM_F_DUMP_INTR; in nl_dump_check_consistent()
1202 cb->prev_seq = cb->seq; in nl_dump_check_consistent()
1210 * nla_attr_size - length of attribute not including padding
1219 * nla_total_size - total length of attribute including padding
1228 * nla_padlen - length of padding at the tail of attribute
1233 return nla_total_size(payload) - nla_attr_size(payload); in nla_padlen()
1237 * nla_type - attribute type
1238 * @nla: netlink attribute
1242 return nla->nla_type & NLA_TYPE_MASK; in nla_type()
1246 * nla_data - head of payload
1247 * @nla: netlink attribute
1255 * nla_len - length of payload
1256 * @nla: netlink attribute
1260 return nla->nla_len - NLA_HDRLEN; in nla_len()
1264 * nla_ok - check if the netlink attribute fits into the remaining bytes
1265 * @nla: netlink attribute
1266 * @remaining: number of bytes remaining in attribute stream
1271 nla->nla_len >= sizeof(*nla) && in nla_ok()
1272 nla->nla_len <= remaining; in nla_ok()
1276 * nla_next - next netlink attribute in attribute stream
1277 * @nla: netlink attribute
1278 * @remaining: number of bytes remaining in attribute stream
1280 * Returns: the next netlink attribute in the attribute stream and
1281 * decrements remaining by the size of the current attribute.
1285 unsigned int totlen = NLA_ALIGN(nla->nla_len); in nla_next()
1287 *remaining -= totlen; in nla_next()
1292 * nla_find_nested - find attribute in a set of nested attributes
1293 * @nla: attribute containing the nested attributes
1294 * @attrtype: type of attribute to look for
1296 * Returns: the first attribute which matches the specified type.
1305 * nla_parse_nested - parse nested attributes
1307 * @maxtype: maximum attribute type to be expected
1308 * @nla: attribute containing the nested attributes
1319 if (!(nla->nla_type & NLA_F_NESTED)) { in nla_parse_nested()
1321 return -EINVAL; in nla_parse_nested()
1329 * nla_parse_nested_deprecated - parse nested attributes
1331 * @maxtype: maximum attribute type to be expected
1332 * @nla: attribute containing the nested attributes
1348 * nla_put_u8 - Add a u8 netlink attribute to a socket buffer
1349 * @skb: socket buffer to add attribute to
1350 * @attrtype: attribute type
1355 /* temporary variables to work around GCC PR81715 with asan-stack=1 */ in nla_put_u8()
1362 * nla_put_u16 - Add a u16 netlink attribute to a socket buffer
1363 * @skb: socket buffer to add attribute to
1364 * @attrtype: attribute type
1375 * nla_put_be16 - Add a __be16 netlink attribute to a socket buffer
1376 * @skb: socket buffer to add attribute to
1377 * @attrtype: attribute type
1388 * nla_put_net16 - Add 16-bit network byte order netlink attribute to a socket buffer
1389 * @skb: socket buffer to add attribute to
1390 * @attrtype: attribute type
1401 * nla_put_le16 - Add a __le16 netlink attribute to a socket buffer
1402 * @skb: socket buffer to add attribute to
1403 * @attrtype: attribute type
1414 * nla_put_u32 - Add a u32 netlink attribute to a socket buffer
1415 * @skb: socket buffer to add attribute to
1416 * @attrtype: attribute type
1427 * nla_put_uint - Add a variable-size unsigned int to a socket buffer
1428 * @skb: socket buffer to add attribute to
1429 * @attrtype: attribute type
1443 * nla_put_be32 - Add a __be32 netlink attribute to a socket buffer
1444 * @skb: socket buffer to add attribute to
1445 * @attrtype: attribute type
1456 * nla_put_net32 - Add 32-bit network byte order netlink attribute to a socket buffer
1457 * @skb: socket buffer to add attribute to
1458 * @attrtype: attribute type
1469 * nla_put_le32 - Add a __le32 netlink attribute to a socket buffer
1470 * @skb: socket buffer to add attribute to
1471 * @attrtype: attribute type
1482 * nla_put_u64_64bit - Add a u64 netlink attribute to a skb and align it
1483 * @skb: socket buffer to add attribute to
1484 * @attrtype: attribute type
1486 * @padattr: attribute type for the padding
1497 * nla_put_be64 - Add a __be64 netlink attribute to a socket buffer and align it
1498 * @skb: socket buffer to add attribute to
1499 * @attrtype: attribute type
1501 * @padattr: attribute type for the padding
1512 * nla_put_net64 - Add 64-bit network byte order nlattr to a skb and align it
1513 * @skb: socket buffer to add attribute to
1514 * @attrtype: attribute type
1516 * @padattr: attribute type for the padding
1528 * nla_put_le64 - Add a __le64 netlink attribute to a socket buffer and align it
1529 * @skb: socket buffer to add attribute to
1530 * @attrtype: attribute type
1532 * @padattr: attribute type for the padding
1543 * nla_put_s8 - Add a s8 netlink attribute to a socket buffer
1544 * @skb: socket buffer to add attribute to
1545 * @attrtype: attribute type
1556 * nla_put_s16 - Add a s16 netlink attribute to a socket buffer
1557 * @skb: socket buffer to add attribute to
1558 * @attrtype: attribute type
1569 * nla_put_s32 - Add a s32 netlink attribute to a socket buffer
1570 * @skb: socket buffer to add attribute to
1571 * @attrtype: attribute type
1582 * nla_put_s64 - Add a s64 netlink attribute to a socket buffer and align it
1583 * @skb: socket buffer to add attribute to
1584 * @attrtype: attribute type
1586 * @padattr: attribute type for the padding
1597 * nla_put_sint - Add a variable-size signed int to a socket buffer
1598 * @skb: socket buffer to add attribute to
1599 * @attrtype: attribute type
1613 * nla_put_string - Add a string netlink attribute to a socket buffer
1614 * @skb: socket buffer to add attribute to
1615 * @attrtype: attribute type
1625 * nla_put_flag - Add a flag netlink attribute to a socket buffer
1626 * @skb: socket buffer to add attribute to
1627 * @attrtype: attribute type
1635 * nla_put_msecs - Add a msecs netlink attribute to a skb and align it
1636 * @skb: socket buffer to add attribute to
1637 * @attrtype: attribute type
1639 * @padattr: attribute type for the padding
1650 * nla_put_in_addr - Add an IPv4 address netlink attribute to a socket
1652 * @skb: socket buffer to add attribute to
1653 * @attrtype: attribute type
1665 * nla_put_in6_addr - Add an IPv6 address netlink attribute to a socket
1667 * @skb: socket buffer to add attribute to
1668 * @attrtype: attribute type
1678 * nla_put_bitfield32 - Add a bitfield32 netlink attribute to a socket buffer
1679 * @skb: socket buffer to add attribute to
1680 * @attrtype: attribute type
1693 * nla_get_u32 - return payload of u32 attribute
1694 * @nla: u32 netlink attribute
1702 * nla_get_u32_default - return payload of u32 attribute or default
1703 * @nla: u32 netlink attribute, may be %NULL
1706 * Return: the value of the attribute, or the default value if not present
1716 * nla_get_be32 - return payload of __be32 attribute
1717 * @nla: __be32 netlink attribute
1725 * nla_get_be32_default - return payload of be32 attribute or default
1726 * @nla: __be32 netlink attribute, may be %NULL
1729 * Return: the value of the attribute, or the default value if not present
1740 * nla_get_le32 - return payload of __le32 attribute
1741 * @nla: __le32 netlink attribute
1749 * nla_get_le32_default - return payload of le32 attribute or default
1750 * @nla: __le32 netlink attribute, may be %NULL
1753 * Return: the value of the attribute, or the default value if not present
1764 * nla_get_u16 - return payload of u16 attribute
1765 * @nla: u16 netlink attribute
1773 * nla_get_u16_default - return payload of u16 attribute or default
1774 * @nla: u16 netlink attribute, may be %NULL
1777 * Return: the value of the attribute, or the default value if not present
1787 * nla_get_be16 - return payload of __be16 attribute
1788 * @nla: __be16 netlink attribute
1796 * nla_get_be16_default - return payload of be16 attribute or default
1797 * @nla: __be16 netlink attribute, may be %NULL
1800 * Return: the value of the attribute, or the default value if not present
1811 * nla_get_le16 - return payload of __le16 attribute
1812 * @nla: __le16 netlink attribute
1820 * nla_get_le16_default - return payload of le16 attribute or default
1821 * @nla: __le16 netlink attribute, may be %NULL
1824 * Return: the value of the attribute, or the default value if not present
1835 * nla_get_u8 - return payload of u8 attribute
1836 * @nla: u8 netlink attribute
1844 * nla_get_u8_default - return payload of u8 attribute or default
1845 * @nla: u8 netlink attribute, may be %NULL
1848 * Return: the value of the attribute, or the default value if not present
1858 * nla_get_u64 - return payload of u64 attribute
1859 * @nla: u64 netlink attribute
1871 * nla_get_u64_default - return payload of u64 attribute or default
1872 * @nla: u64 netlink attribute, may be %NULL
1875 * Return: the value of the attribute, or the default value if not present
1885 * nla_get_uint - return payload of uint attribute
1886 * @nla: uint netlink attribute
1896 * nla_get_uint_default - return payload of uint attribute or default
1897 * @nla: uint netlink attribute, may be %NULL
1900 * Return: the value of the attribute, or the default value if not present
1910 * nla_get_be64 - return payload of __be64 attribute
1911 * @nla: __be64 netlink attribute
1923 * nla_get_be64_default - return payload of be64 attribute or default
1924 * @nla: __be64 netlink attribute, may be %NULL
1927 * Return: the value of the attribute, or the default value if not present
1938 * nla_get_le64 - return payload of __le64 attribute
1939 * @nla: __le64 netlink attribute
1947 * nla_get_le64_default - return payload of le64 attribute or default
1948 * @nla: __le64 netlink attribute, may be %NULL
1951 * Return: the value of the attribute, or the default value if not present
1962 * nla_get_s32 - return payload of s32 attribute
1963 * @nla: s32 netlink attribute
1971 * nla_get_s32_default - return payload of s32 attribute or default
1972 * @nla: s32 netlink attribute, may be %NULL
1975 * Return: the value of the attribute, or the default value if not present
1985 * nla_get_s16 - return payload of s16 attribute
1986 * @nla: s16 netlink attribute
1994 * nla_get_s16_default - return payload of s16 attribute or default
1995 * @nla: s16 netlink attribute, may be %NULL
1998 * Return: the value of the attribute, or the default value if not present
2008 * nla_get_s8 - return payload of s8 attribute
2009 * @nla: s8 netlink attribute
2017 * nla_get_s8_default - return payload of s8 attribute or default
2018 * @nla: s8 netlink attribute, may be %NULL
2021 * Return: the value of the attribute, or the default value if not present
2031 * nla_get_s64 - return payload of s64 attribute
2032 * @nla: s64 netlink attribute
2044 * nla_get_s64_default - return payload of s64 attribute or default
2045 * @nla: s64 netlink attribute, may be %NULL
2048 * Return: the value of the attribute, or the default value if not present
2058 * nla_get_sint - return payload of uint attribute
2059 * @nla: uint netlink attribute
2069 * nla_get_sint_default - return payload of sint attribute or default
2070 * @nla: sint netlink attribute, may be %NULL
2073 * Return: the value of the attribute, or the default value if not present
2083 * nla_get_flag - return payload of flag attribute
2084 * @nla: flag netlink attribute
2092 * nla_get_msecs - return payload of msecs attribute
2093 * @nla: msecs netlink attribute
2105 * nla_get_msecs_default - return payload of msecs attribute or default
2106 * @nla: msecs netlink attribute, may be %NULL
2109 * Return: the value of the attribute, or the default value if not present
2120 * nla_get_in_addr - return payload of IPv4 address attribute
2121 * @nla: IPv4 address netlink attribute
2129 * nla_get_in_addr_default - return payload of be32 attribute or default
2130 * @nla: IPv4 address netlink attribute, may be %NULL
2133 * Return: the value of the attribute, or the default value if not present
2144 * nla_get_in6_addr - return payload of IPv6 address attribute
2145 * @nla: IPv6 address netlink attribute
2156 * nla_get_bitfield32 - return payload of 32 bitfield attribute
2157 * @nla: nla_bitfield32 attribute
2168 * nla_memdup - duplicate attribute memory (kmemdup)
2169 * @src: netlink attribute to duplicate from
2179 * nla_nest_start_noflag - Start a new level of nested attributes
2181 * @attrtype: attribute type of container
2187 * Returns: the container attribute or NULL on error
2201 * nla_nest_start - Start a new level of nested attributes, with NLA_F_NESTED
2203 * @attrtype: attribute type of container
2205 * Unlike nla_nest_start_noflag(), mark the nest attribute with NLA_F_NESTED
2208 * Returns: the container attribute or NULL on error
2216 * nla_nest_end - Finalize nesting of attributes
2218 * @start: container attribute
2220 * Corrects the container attribute header to include the all
2227 start->nla_len = skb_tail_pointer(skb) - (unsigned char *)start; in nla_nest_end()
2228 return skb->len; in nla_nest_end()
2232 * nla_nest_cancel - Cancel nesting of attributes
2234 * @start: container attribute
2236 * Removes the container attribute and including all nested
2237 * attributes. Returns -EMSGSIZE
2245 * nla_put_empty_nest - Create an empty nest
2247 * @attrtype: attribute type of the container
2251 * Returns: 0 when successful or -EMSGSIZE on failure.
2255 return nla_nest_start(skb, attrtype) ? 0 : -EMSGSIZE; in nla_put_empty_nest()
2259 * __nla_validate_nested - Validate a stream of nested attributes
2260 * @start: container attribute
2261 * @maxtype: maximum attribute type to be expected
2266 * Validates all attributes in the nested attribute stream against the
2300 * nla_need_padding_for_64bit - test 64-bit alignment of the next attribute
2303 * Return: true if padding is needed to align the next attribute (nla_data()) to
2304 * a 64-bit aligned area.
2310 * if the skb->data _is_ aligned. A NOP attribute, plus in nla_need_padding_for_64bit()
2311 * nlattr header for next attribute, will make nla_data() in nla_need_padding_for_64bit()
2312 * 8-byte aligned. in nla_need_padding_for_64bit()
2321 * nla_align_64bit - 64-bit align the nla_data() of next attribute
2323 * @padattr: attribute type for the padding
2325 * Conditionally emit a padding netlink attribute in order to make
2326 * the next attribute we emit have a 64-bit aligned nla_data() area.
2336 return -EMSGSIZE; in nla_align_64bit()
2342 * nla_total_size_64bit - total length of attribute including padding
2355 * nla_for_each_attr - iterate over a stream of attributes
2356 * @pos: loop counter, set to current attribute
2357 * @head: head of attribute stream
2358 * @len: length of attribute stream
2367 * nla_for_each_attr_type - iterate over a stream of attributes
2368 * @pos: loop counter, set to current attribute
2369 * @type: required attribute type for @pos
2370 * @head: head of attribute stream
2371 * @len: length of attribute stream
2379 * nla_for_each_nested - iterate over nested attributes
2380 * @pos: loop counter, set to current attribute
2381 * @nla: attribute containing the nested attributes
2388 * nla_for_each_nested_type - iterate over nested attributes
2389 * @pos: loop counter, set to current attribute
2390 * @type: required attribute type for @pos
2391 * @nla: attribute containing the nested attributes
2399 * nla_is_last - Test if attribute is last in stream
2400 * @nla: attribute to test
2405 return nla->nla_len == rem; in nla_is_last()