* special case to send a message to self (e.g. destroy node) * Possibly indicate an arrival hook too. * Useful for removing that hook :-) */
| 3662 | * Useful for removing that hook :-) |
| 3663 | */ |
| 3664 | item_p |
| 3665 | ng_package_msg_self(node_p here, hook_p hook, struct ng_mesg *msg) |
| 3666 | { |
| 3667 | item_p item; |
| 3668 | |
| 3669 | /* |
| 3670 | * Find the target node. |
| 3671 | * If there is a HOOK argument, then use that in preference |
| 3672 | * to the address. |
| 3673 | */ |
| 3674 | if ((item = ng_alloc_item(NGQF_MESG, NG_NOFLAGS)) == NULL) { |
| 3675 | NG_FREE_MSG(msg); |
| 3676 | return (NULL); |
| 3677 | } |
| 3678 | |
| 3679 | /* Fill out the contents */ |
| 3680 | item->el_flags |= NGQF_WRITER; |
| 3681 | NG_NODE_REF(here); |
| 3682 | NGI_SET_NODE(item, here); |
| 3683 | if (hook) { |
| 3684 | NG_HOOK_REF(hook); |
| 3685 | NGI_SET_HOOK(item, hook); |
| 3686 | } |
| 3687 | NGI_MSG(item) = msg; |
| 3688 | NGI_RETADDR(item) = ng_node2ID(here); |
| 3689 | return (item); |
| 3690 | } |
| 3691 | |
| 3692 | /* |
| 3693 | * Send ng_item_fn function call to the specified node. |
nothing calls this directly
no test coverage detected