/*
Authors:
Pavel Březina <pbrezina@redhat.com>
Copyright (C) 2013 Red Hat
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include <string.h>
#include <talloc.h>
#include <tevent.h>
#include <unistd.h>
#include <limits.h>
#include "resolv/async_resolv.h"
struct resolv_get_domain_state {
char *fqdn;
char *hostname;
};
struct tevent_req *
struct tevent_context *ev,
struct resolv_ctx *resolv_ctx,
const char *hostname,
enum host_database *host_dbs,
enum restrict_family family_order)
{
struct resolv_get_domain_state);
return NULL;
}
/* use system hostname */
if (ret) {
goto immediately;
}
}
goto immediately;
}
return NULL;
}
return req;
return req;
}
{
int resolv_status;
"Could not get fully qualified name for host name %s "
"error [%d]: %s, resolver returned: [%d]: %s\n",
} else {
}
}
struct tevent_req *req,
char **_dns_domain)
{
/* If the FQDN did not contain a dot or the dot was the last character
* (broken DNS server perhaps) */
} else {
}
if (*_dns_domain == NULL) {
return ENOMEM;
}
return EOK;
}
struct resolv_discover_srv_state {
const char *service;
const char *protocol;
const char **discovery_domains;
int domain_index;
};
struct tevent_context *ev,
struct resolv_ctx *resolv_ctx,
const char *service,
const char *protocol,
const char **discovery_domains)
{
struct resolv_discover_srv_state);
return NULL;
}
|| discovery_domains == NULL) {
goto immediately;
}
state->domain_index = 0;
goto immediately;
}
return req;
} else {
}
return req;
}
{
goto done;
}
goto done;
}
goto done;
}
state->domain_index++;
done:
}
return ret;
}
{
int status;
if (status == ARES_ENOTFOUND) {
/* continue with next discovery domain */
/* there are no more domains to try */
}
goto done;
}
/* critical error when fetching SRV record */
goto done;
}
done:
}
return;
}
struct tevent_req *req,
struct ares_srv_reply **_reply_list,
char **_dns_domain)
{
if (_dns_domain != NULL) {
/* domain_index now points to selected domain + 1 */
return ENOMEM;
}
*_dns_domain = domain;
}
if (_reply_list != NULL) {
}
}
return EOK;
}