aboutsummaryrefslogtreecommitdiffstats
path: root/include/net/netlink.h
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@g5.osdl.org>2006-09-25 20:39:55 -0400
committerLinus Torvalds <torvalds@g5.osdl.org>2006-09-25 20:39:55 -0400
commit7e4720201ad44ace85a443f41d668a62a737e7d0 (patch)
tree8b9118dffcfd9511d9ce31b87776e04095f9acf1 /include/net/netlink.h
parent7b29122f9ec54db5c38a66a11127d94db0817c17 (diff)
parent4cc6773508299377099aa30cf30e6a2196c5872d (diff)
Merge master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6
* master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6: [NetLabel]: update docs with website information [NetLabel]: rework the Netlink attribute handling (part 2) [NetLabel]: rework the Netlink attribute handling (part 1) [Netlink]: add nla_validate_nested() [NETLINK]: add nla_for_each_nested() to the interface list [NetLabel]: change the SELinux permissions [NetLabel]: make the CIPSOv4 cache spinlocks bottom half safe [NetLabel]: correct improper handling of non-NetLabel peer contexts [TCP]: make cubic the default [TCP]: default congestion control menu [ATM] he: Fix __init/__devinit conflict [NETFILTER]: Add dscp,DSCP headers to header-y [DCCP]: Introduce dccp_probe [DCCP]: Use constants for CCIDs [DCCP]: Introduce constants for CCID numbers [DCCP]: Allow default/fallback service code.
Diffstat (limited to 'include/net/netlink.h')
-rw-r--r--include/net/netlink.h20
1 files changed, 20 insertions, 0 deletions
diff --git a/include/net/netlink.h b/include/net/netlink.h
index 11dc2e7f679a..4ab68a7a636a 100644
--- a/include/net/netlink.h
+++ b/include/net/netlink.h
@@ -146,11 +146,13 @@
146 * nla_ok(nla, remaining) does nla fit into remaining bytes? 146 * nla_ok(nla, remaining) does nla fit into remaining bytes?
147 * nla_next(nla, remaining) get next netlink attribute 147 * nla_next(nla, remaining) get next netlink attribute
148 * nla_validate() validate a stream of attributes 148 * nla_validate() validate a stream of attributes
149 * nla_validate_nested() validate a stream of nested attributes
149 * nla_find() find attribute in stream of attributes 150 * nla_find() find attribute in stream of attributes
150 * nla_find_nested() find attribute in nested attributes 151 * nla_find_nested() find attribute in nested attributes
151 * nla_parse() parse and validate stream of attrs 152 * nla_parse() parse and validate stream of attrs
152 * nla_parse_nested() parse nested attribuets 153 * nla_parse_nested() parse nested attribuets
153 * nla_for_each_attr() loop over all attributes 154 * nla_for_each_attr() loop over all attributes
155 * nla_for_each_nested() loop over the nested attributes
154 *========================================================================= 156 *=========================================================================
155 */ 157 */
156 158
@@ -950,6 +952,24 @@ static inline int nla_nest_cancel(struct sk_buff *skb, struct nlattr *start)
950} 952}
951 953
952/** 954/**
955 * nla_validate_nested - Validate a stream of nested attributes
956 * @start: container attribute
957 * @maxtype: maximum attribute type to be expected
958 * @policy: validation policy
959 *
960 * Validates all attributes in the nested attribute stream against the
961 * specified policy. Attributes with a type exceeding maxtype will be
962 * ignored. See documenation of struct nla_policy for more details.
963 *
964 * Returns 0 on success or a negative error code.
965 */
966static inline int nla_validate_nested(struct nlattr *start, int maxtype,
967 struct nla_policy *policy)
968{
969 return nla_validate(nla_data(start), nla_len(start), maxtype, policy);
970}
971
972/**
953 * nla_for_each_attr - iterate over a stream of attributes 973 * nla_for_each_attr - iterate over a stream of attributes
954 * @pos: loop counter, set to current attribute 974 * @pos: loop counter, set to current attribute
955 * @head: head of attribute stream 975 * @head: head of attribute stream