nlattr.c (5a94296bc02ac616336da7b5332b86d2ca8827f0) | nlattr.c (9dbbc3b9d09d6deba9f3b9e1d5b355032ed46a75) |
---|---|
1// SPDX-License-Identifier: GPL-2.0 2/* 3 * NETLINK Netlink attributes 4 * 5 * Authors: Thomas Graf <tgraf@suug.ch> 6 * Alexey Kuznetsov <kuznet@ms2.inr.ac.ru> 7 */ 8 --- 605 unchanged lines hidden (view full) --- 614 * @maxtype: maximum attribute type to be expected 615 * @policy: validation policy 616 * @validate: validation strictness 617 * @extack: extended ACK report struct 618 * 619 * Validates all attributes in the specified attribute stream against the 620 * specified policy. Validation depends on the validate flags passed, see 621 * &enum netlink_validation for more details on that. | 1// SPDX-License-Identifier: GPL-2.0 2/* 3 * NETLINK Netlink attributes 4 * 5 * Authors: Thomas Graf <tgraf@suug.ch> 6 * Alexey Kuznetsov <kuznet@ms2.inr.ac.ru> 7 */ 8 --- 605 unchanged lines hidden (view full) --- 614 * @maxtype: maximum attribute type to be expected 615 * @policy: validation policy 616 * @validate: validation strictness 617 * @extack: extended ACK report struct 618 * 619 * Validates all attributes in the specified attribute stream against the 620 * specified policy. Validation depends on the validate flags passed, see 621 * &enum netlink_validation for more details on that. |
622 * See documenation of struct nla_policy for more details. | 622 * See documentation of struct nla_policy for more details. |
623 * 624 * Returns 0 on success or a negative error code. 625 */ 626int __nla_validate(const struct nlattr *head, int len, int maxtype, 627 const struct nla_policy *policy, unsigned int validate, 628 struct netlink_ext_ack *extack) 629{ 630 return __nla_validate_parse(head, len, maxtype, policy, validate, 631 extack, NULL, 0); 632} 633EXPORT_SYMBOL(__nla_validate); 634 635/** | 623 * 624 * Returns 0 on success or a negative error code. 625 */ 626int __nla_validate(const struct nlattr *head, int len, int maxtype, 627 const struct nla_policy *policy, unsigned int validate, 628 struct netlink_ext_ack *extack) 629{ 630 return __nla_validate_parse(head, len, maxtype, policy, validate, 631 extack, NULL, 0); 632} 633EXPORT_SYMBOL(__nla_validate); 634 635/** |
636 * nla_policy_len - Determin the max. length of a policy | 636 * nla_policy_len - Determine the max. length of a policy |
637 * @policy: policy to use 638 * @n: number of policies 639 * 640 * Determines the max. length of the policy. It is currently used 641 * to allocated Netlink buffers roughly the size of the actual 642 * message. 643 * 644 * Returns 0 on success or a negative error code. --- 478 unchanged lines hidden --- | 637 * @policy: policy to use 638 * @n: number of policies 639 * 640 * Determines the max. length of the policy. It is currently used 641 * to allocated Netlink buffers roughly the size of the actual 642 * message. 643 * 644 * Returns 0 on success or a negative error code. --- 478 unchanged lines hidden --- |