ipa_srv.c revision 88275cccddf39892e01682b39b02292eb74729bd
/*
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 "resolv/async_resolv.h"
#include "providers/fail_over_srv.h"
#define IPA_DNS_LOCATION "_location"
struct ipa_srv_plugin_ctx {
struct resolv_ctx *resolv_ctx;
const char *hostname;
const char *ipa_domain;
};
struct ipa_srv_plugin_ctx *
struct resolv_ctx *resolv_ctx,
const char *hostname,
const char *ipa_domain)
{
return NULL;
}
goto fail;
}
goto fail;
}
return ctx;
fail:
return NULL;
}
struct ipa_srv_plugin_state {
struct tevent_context *ev;
struct ipa_srv_plugin_ctx *ctx;
const char *service;
const char *protocol;
const char *discovery_domain;
char *dns_domain;
struct fo_server_info *primary_servers;
struct fo_server_info *backup_servers;
};
/* If IPA server supports sites, we will use
* _locations.hostname.discovery_domain for primary servers and
* discovery_domain for backup servers. If the server does not support sites or
* client's SRV record is not found, we will use the latter for primary
* servers, setting backup servers to NULL */
struct tevent_context *ev,
const char *service,
const char *protocol,
const char *discovery_domain,
void *pvt)
{
struct ipa_srv_plugin_state);
return NULL;
}
goto immediately;
}
if (discovery_domain != NULL) {
} else {
}
goto immediately;
}
goto immediately;
}
/* not FQDN, append domain name */
} else {
}
goto immediately;
}
goto immediately;
}
return req;
return req;
}
{
&state->dns_domain,
goto done;
}
/* IPA server does not support sites or this host is in default site */
state->num_backup_servers = 0;
goto done;
}
goto done;
}
goto done;
}
done:
}
return;
}
{
/* we have successfully fetched primary servers, so we will
* finish the request normally */
}
return;
}
}
struct tevent_req *req,
char **_dns_domain,
struct fo_server_info **_primary_servers,
struct fo_server_info **_backup_servers,
{
if (_primary_servers) {
}
if (_num_primary_servers) {
}
if (_backup_servers) {
}
if (_num_backup_servers) {
}
if (_dns_domain) {
}
return EOK;
}