Exemplo n.º 1
0
status_t
uninit_stack()
{
    TRACE(("Unloading network stack\n"));

    put_module(NET_SOCKET_MODULE_NAME);
    uninit_timers();
    uninit_device_interfaces();
    uninit_interfaces();
    uninit_domains();
    uninit_notifications();

    mutex_destroy(&sChainLock);
    mutex_destroy(&sInitializeChainLock);

    // remove chains and families

    chain::DeleteChains(sProtocolChains);
    chain::DeleteChains(sDatalinkProtocolChains);
    chain::DeleteChains(sReceivingProtocolChains);

    uint32 cookie = 0;
    while (true) {
        struct family* family = (struct family*)hash_remove_first(sFamilies,
                                &cookie);
        if (family == NULL)
            break;

        delete family;
    }

    hash_uninit(sProtocolChains);
    hash_uninit(sDatalinkProtocolChains);
    hash_uninit(sReceivingProtocolChains);
    hash_uninit(sFamilies);

    return B_OK;
}
Exemplo n.º 2
0
status_t
uninit_stack()
{
	TRACE(("Unloading network stack\n"));

	put_module(NET_SOCKET_MODULE_NAME);
	uninit_timers();
	uninit_device_interfaces();
	uninit_interfaces();
	uninit_domains();
	uninit_notifications();

	mutex_destroy(&sChainLock);
	mutex_destroy(&sInitializeChainLock);

	// remove chains and families

	chain::DeleteChains(sProtocolChains);
	chain::DeleteChains(sDatalinkProtocolChains);
	chain::DeleteChains(sReceivingProtocolChains);

	struct family* current;
	current = sFamilies->Clear(true);
	while (current) {
		struct family* next = current->next;

		delete current;
		current = next;
	}

	delete sProtocolChains;
	delete sDatalinkProtocolChains;
	delete sReceivingProtocolChains;
	delete sFamilies;

	return B_OK;
}