static void destroy(void)
{
	 /* Destroy is called from the main process only,
	  * there is no need to close database here because
	  * it is closed in mod_init already
	  */
    if (!db_mode) {
	free_old_domain(&dom_buf[0]);
	free_old_domain(&dom_buf[1]);
    }
    destroy_tables();
}
void destroy_domain_control(pdp_t *pdp)
{
    if (pdp != NULL) {
        destroy_proxies(pdp);
        destroy_tables(pdp);
        destroy_transport(pdp->extt);
        destroy_transport(pdp->intt);
        destroy_transport(pdp->wrtt);

        mrp_free(pdp);
    }
}