Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:lib\nlattr.c Create Date:2022-07-28 07:16:23
Last Modify:2020-03-12 14:18:49 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:__nla_validate_parse

Proto: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)

Type:int

Parameter:

TypeParameterName
const struct nlattr *head
intlen
intmaxtype
const struct nla_policy *policy
unsigned intvalidate
struct netlink_ext_ack *extack
struct nlattr **tb
366  If tb Then memset(tb, 0, size of * * (maxtype + 1))
370  type = la_type - attribute type*@nla: netlink attribute
372  If type == 0 || type > maxtype Then
373  If validate & NL_VALIDATE_MAXTYPE Then
374  NL_SET_ERR_MSG_ATTR(extack, nla, "Unknown attribute type")
376  Return -EINVAL
378  Continue
380  If policy Then
381  err = validate_nla(nla, maxtype, policy, validate, extack)
384  If err < 0 Then Return err
388  If tb Then tb[type] = nla
392  If Value for the false possibility is greater at compile time(rem > 0) Then
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  If validate & NL_VALIDATE_TRAILING Then Return -EINVAL
400  Return 0
Caller
NameDescribe
__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