* special case to send a message to self (e.g. destroy node) * Possibly indicate an arrival hook too. * Useful for removing that hook :-) */
| 3692 | * Useful for removing that hook :-) |
| 3693 | */ |
| 3694 | item_p |
| 3695 | ng_package_msg_self(node_p here, hook_p hook, struct ng_mesg *msg) |
| 3696 | { |
| 3697 | item_p item; |
| 3698 | |
| 3699 | /* |
| 3700 | * Find the target node. |
| 3701 | * If there is a HOOK argument, then use that in preference |
| 3702 | * to the address. |
| 3703 | */ |
| 3704 | if ((item = ng_alloc_item(NGQF_MESG, NG_NOFLAGS)) == NULL) { |
| 3705 | NG_FREE_MSG(msg); |
| 3706 | return (NULL); |
| 3707 | } |
| 3708 | |
| 3709 | /* Fill out the contents */ |
| 3710 | item->el_flags |= NGQF_WRITER; |
| 3711 | NG_NODE_REF(here); |
| 3712 | NGI_SET_NODE(item, here); |
| 3713 | if (hook) { |
| 3714 | NG_HOOK_REF(hook); |
| 3715 | NGI_SET_HOOK(item, hook); |
| 3716 | } |
| 3717 | NGI_MSG(item) = msg; |
| 3718 | NGI_RETADDR(item) = ng_node2ID(here); |
| 3719 | return (item); |
| 3720 | } |
| 3721 | |
| 3722 | /* |
| 3723 | * Send ng_item_fn function call to the specified node. |
nothing calls this directly
no test coverage detected