Exemplo n.º 1
0
Arquivo: gnet.c Projeto: draringi/gini
/*
 * destroyInterface(): remove the specified interface from the router.
 * The router should remove associated route table information, ARP entries,
 * and stop the threads (only fromXDevice thread).
 */
int destroyInterface(interface_t *iface)
{

	// nothing to do if iface is NULL
	if (iface == NULL)
		return EXIT_FAILURE;

	verbose(2, "[destroyInterface]:: entering the function..");
	// remove the routing table entries...
	deleteRouteEntryByInterface(route_tbl, iface->interface_id);

	// remove the ARP table entries
	ARPDeleteEntry(iface->ip_addr);

	verbose(2, "[destroyInterface]:: cancelling the fromdev handler.. ");
	if (iface->state == INTERFACE_UP)
	{
		pthread_cancel(iface->threadid);        // cancel the running thread
		// close socket
		close(iface->iface_fd);
	}

	verbose(2, "[destroyInterface]:: cancelling the shadow thread.. ");
	if (iface->mode == IFACE_SERVER_MODE)
	{
		pthread_cancel(iface->sdwthread);      // cancel the shadow thread
		unlink(iface->sock_name);
	}

	// remove interface from table...
	deleteInterface(iface->interface_id);

	return EXIT_SUCCESS;
}
Exemplo n.º 2
0
void QAccessibleCache::objectDestroyed(QObject* obj)
{
    QAccessible::Id id = objectToId.value(obj);
    if (id) {
        Q_ASSERT_X(idToInterface.contains(id), "", "QObject with accessible interface deleted, where interface not in cache!");
        deleteInterface(id, obj);
    }
}
Exemplo n.º 3
0
void NetctlHelper::updateConfiguration()
{
    if (debug) qDebug() << PDEBUG;

    deleteInterface();
    if ((system) || (!QFile(configPath).exists()))
        configuration = getSettings(QString("/etc/netctl-gui.conf"));
    else
        configuration = getSettings(configPath);
    createInterface();
}
Exemplo n.º 4
0
NetctlHelper::~NetctlHelper()
{
    if (debug) qDebug() << PDEBUG;

    deleteInterface();
}