* Hook disconnection. */
| 841 | * Hook disconnection. |
| 842 | */ |
| 843 | static int |
| 844 | ng_bridge_disconnect(hook_p hook) |
| 845 | { |
| 846 | const priv_p priv = NG_NODE_PRIVATE(NG_HOOK_NODE(hook)); |
| 847 | link_p link = NG_HOOK_PRIVATE(hook); |
| 848 | |
| 849 | /* Remove all hosts associated with this link */ |
| 850 | ng_bridge_remove_hosts(priv, link); |
| 851 | |
| 852 | /* Free associated link information */ |
| 853 | free(link, M_NETGRAPH_BRIDGE); |
| 854 | priv->numLinks--; |
| 855 | |
| 856 | /* If no more hooks, go away */ |
| 857 | if ((NG_NODE_NUMHOOKS(NG_HOOK_NODE(hook)) == 0) |
| 858 | && (NG_NODE_IS_VALID(NG_HOOK_NODE(hook))) |
| 859 | && !priv->persistent) { |
| 860 | ng_rmnode_self(NG_HOOK_NODE(hook)); |
| 861 | } |
| 862 | return (0); |
| 863 | } |
| 864 | |
| 865 | /****************************************************************** |
| 866 | HASH TABLE FUNCTIONS |
nothing calls this directly
no test coverage detected