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

Function tap_nlattr_nested_start

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

* Start a nested netlink attribute. * It must be followed later by a call to tap_nlattr_nested_finish(). * * @param[in, out] msg * The netlink message where to edit the nested_tails metadata. * @param[in] type * The nested attribute type to append. * * @return * -1 if adding a nested netlink attribute failed, 0 otherwise. */

Source from the content-addressed store, hash-verified

367 * -1 if adding a nested netlink attribute failed, 0 otherwise.
368 */
369int
370tap_nlattr_nested_start(struct nlmsg *msg, uint16_t type)
371{
372 struct nested_tail *tail;
373
374 tail = rte_zmalloc(NULL, sizeof(struct nested_tail), 0);
375 if (!tail) {
376 TAP_LOG(ERR,
377 "Couldn't allocate memory for nested netlink attribute");
378 return -1;
379 }
380
381 tail->tail = (struct rtattr *)NLMSG_TAIL(&msg->nh);
382
383 tap_nlattr_add(&msg->nh, type, 0, NULL);
384
385 tail->prev = msg->nested_tails;
386
387 msg->nested_tails = tail;
388
389 return 0;
390}
391
392/**
393 * End a nested netlink attribute.

Callers 4

add_actionFunction · 0.85
add_actionsFunction · 0.85
priv_flow_processFunction · 0.85
rss_enableFunction · 0.85

Calls 2

rte_zmallocFunction · 0.85
tap_nlattr_addFunction · 0.85

Tested by

no test coverage detected