Lines Matching defs:msg
21 #include "netlink/msg.h"
75 struct nlattr *nla_nest_start(struct nl_msg *msg, int attrtype)
77 struct nlattr *start = (struct nlattr *)nlmsg_tail(msg->nm_nlh);
80 rc = nla_put(msg, attrtype, 0, NULL);
88 int nla_nest_end(struct nl_msg *msg, struct nlattr *start)
91 start->nla_len = (unsigned char *)nlmsg_tail(nlmsg_hdr(msg)) -
151 int nla_put(struct nl_msg *msg, int attrtype, int datalen, const void *data)
156 nla = nla_reserve(msg, attrtype, datalen);
166 int nla_put_u8(struct nl_msg *msg, int attrtype, uint8_t value)
168 return nla_put(msg, attrtype, sizeof(uint8_t), &value);
172 int nla_put_u16(struct nl_msg *msg, int attrtype, uint16_t value)
174 return nla_put(msg, attrtype, sizeof(uint16_t), &value);
178 int nla_put_u32(struct nl_msg *msg, int attrtype, uint32_t value)
180 return nla_put(msg, attrtype, sizeof(uint32_t), &value);
184 int nla_put_u64(struct nl_msg *msg, int attrtype, uint64_t value)
186 return nla_put(msg, attrtype, sizeof(uint64_t), &value);
191 * to the message msg nested in a container of the type attrtype. The
193 int nla_put_nested(struct nl_msg *msg, int attrtype, struct nl_msg *nested)
197 rc = nla_put(msg, attrtype, nlmsg_attrlen(nlmsg_hdr(nested), 0),
211 struct nlattr *nla_reserve(struct nl_msg *msg, int attrtype, int data_len)
215 const unsigned int NEW_SIZE = NLMSG_ALIGN(msg->nm_nlh->nlmsg_len) +
219 if (NEW_SIZE > msg->nm_size)
222 nla = (struct nlattr *)nlmsg_tail(msg->nm_nlh);
226 msg->nm_nlh->nlmsg_len = NEW_SIZE;