函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:lib\nlattr.c Create Date:2022-07-27 08:14:50
Last Modify:2020-03-12 14:18:49 Copyright©Brick
首页 函数Tree
注解内核,赢得工具下载SCCTEnglish

函数名称:__nla_validate_parse

函数原型:static int __nla_validate_parse(const struct nlattr *head, int len, int maxtype, const struct nla_policy *policy, unsigned int validate, struct netlink_ext_ack *extack, struct nlattr **tb)

返回类型:int

参数:

类型参数名称
const struct nlattr *head
intlen
intmaxtype
const struct nla_policy *policy
unsigned intvalidate
struct netlink_ext_ack *extack
struct nlattr **tb
366  如果tbmemset(tb, 0, *的长度 * (maxtype + 1))
370  type等于属性类型
372  如果type恒等于0或type大于maxtype
373  如果validate按位与NL_VALIDATE_MAXTYPE
374  NL_SET_ERR_MSG_ATTR(extack, nla, "Unknown attribute type")
376  返回:负EINVAL
378  继续下一循环
380  如果policy
381  err等于validate_nla(nla, maxtype, policy, validate, extack)
384  如果err小于0则返回:err
388  如果tbtb[type]等于nla
392  如果此条件成立可能性小(为编译器优化)(rem > 0)则
393  pr_warn_ratelimited("netlink: %d bytes leftover after parsing attributes in process `%s'.\n", rem, comm)
395  Always use this macro, this allows later putting the* message into a separate section or such for things* like translation or listing all possible messages.* Currently string formatting is not supported (due* to the lack of an output buffer.)(extack, "bytes leftover after parsing attributes")
396  如果validate按位与NL_VALIDATE_TRAILING则返回:负EINVAL
400  返回:0
调用者
名称描述
__nla_validate__nla_validate - Validate a stream of attributes*@head: head of attribute stream*@len: length of attribute stream*@maxtype: maximum attribute type to be expected*@policy: validation policy*@validate: validation strictness*@extack: extended ACK report
__nla_parse__nla_parse - Parse a stream of attributes into a tb buffer*@tb: destination array with maxtype+1 elements*@maxtype: maximum attribute type to be expected*@head: head of attribute stream*@len: length of attribute stream*@policy: validation