MCPcopy Create free account
hub / github.com/F-Stack/f-stack / tap_nlattr_add

Function tap_nlattr_add

dpdk/drivers/net/tap/tap_netlink.c:294–307  ·  view source on GitHub ↗

* Append a netlink attribute to a message. * * @param[in, out] nh * The netlink message to parse, received from the kernel. * @param[in] type * The type of attribute to append. * @param[in] data_len * The length of the data to append. * @param[in] data * The data to append. */

Source from the content-addressed store, hash-verified

292 * The data to append.
293 */
294void
295tap_nlattr_add(struct nlmsghdr *nh, unsigned short type,
296 unsigned int data_len, const void *data)
297{
298 /* see man 3 rtnetlink */
299 struct rtattr *rta;
300
301 rta = (struct rtattr *)NLMSG_TAIL(nh);
302 rta->rta_len = RTA_LENGTH(data_len);
303 rta->rta_type = type;
304 if (data_len > 0)
305 memcpy(RTA_DATA(rta), data, data_len);
306 nh->nlmsg_len = NLMSG_ALIGN(nh->nlmsg_len) + RTA_ALIGN(rta->rta_len);
307}
308
309/**
310 * Append a uint8_t netlink attribute to a message.

Callers 11

qdisc_add_multiqFunction · 0.85
qdisc_add_ingressFunction · 0.85
tap_flow_create_ethFunction · 0.85
tap_flow_create_ipv6Function · 0.85
add_actionFunction · 0.85
priv_flow_processFunction · 0.85
rss_enableFunction · 0.85
tap_nlattr_add8Function · 0.85
tap_nlattr_add16Function · 0.85
tap_nlattr_add32Function · 0.85
tap_nlattr_nested_startFunction · 0.85

Calls 1

memcpyFunction · 0.50

Tested by

no test coverage detected