Logo Search packages:      
Sourcecode: libnl version File versions  Download package

int nla_put ( struct nl_msg *  n,
int  attrtype,
int  attrlen,
const void *  data 
)

Add a netlink attribute to a netlink message

  • n netlink message
  • attrtype attribute type
  • attrlen length of attribute payload
  • data head of attribute payload
Returns:
-1 if the tailroom of the skb is insufficient to store the attribute header and payload.

Definition at line 501 of file attr.c.

References nla_data(), and nla_reserve().

Referenced by nla_nest_start(), nla_put_addr(), nla_put_data(), nla_put_flag(), nla_put_nested(), nla_put_string(), nla_put_u16(), nla_put_u32(), nla_put_u64(), and nla_put_u8().

{
      struct nlattr *nla;

      nla = nla_reserve(n, attrtype, attrlen);
      if (!nla)
            return nl_errno(ENOMEM);

      memcpy(nla_data(nla), data, attrlen);

      return 0;
}


Generated by  Doxygen 1.6.0   Back to index