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

Function ng_package_msg

freebsd/netgraph/ng_base.c:3534–3555  ·  view source on GitHub ↗

* Allocate a queue item and put items into it.. * Evaluate the address as this will be needed to queue it and * to work out what some of the fields should be. * Hook and node references will be removed when the item is dequeued. * (or equivalent) */

Source from the content-addressed store, hash-verified

3532 * (or equivalent)
3533 */
3534item_p
3535ng_package_msg(struct ng_mesg *msg, int flags)
3536{
3537 item_p item;
3538
3539 if ((item = ng_alloc_item(NGQF_MESG, flags)) == NULL) {
3540 NG_FREE_MSG(msg);
3541 return (NULL);
3542 }
3543 ITEM_DEBUG_CHECKS;
3544 /* Messages items count as writers unless explicitly exempted. */
3545 if (msg->header.cmd & NGM_READONLY)
3546 item->el_flags |= NGQF_READER;
3547 else
3548 item->el_flags |= NGQF_WRITER;
3549 /*
3550 * Set the current lasthook into the queue item
3551 */
3552 NGI_MSG(item) = msg;
3553 NGI_RETADDR(item) = 0;
3554 return (item);
3555}
3556
3557#define SET_RETADDR(item, here, retaddr) \
3558 do { /* Data or fn items don't have retaddrs */ \

Callers 1

ngc_sendFunction · 0.70

Calls 1

ng_alloc_itemFunction · 0.70

Tested by

no test coverage detected