return status;
}
-/*********************************************************************
- Small wrapper function to get the DC list and sort it if neccessary.
-*********************************************************************/
-
-NTSTATUS get_sorted_dc_list( const char *domain,
- const char *sitename,
- struct ip_service **ip_list,
- int *count,
- bool ads_only )
-{
- bool ordered = false;
- NTSTATUS status;
- enum dc_lookup_type lookup_type = DC_NORMAL_LOOKUP;
-
- *ip_list = NULL;
- *count = 0;
-
- DEBUG(8,("get_sorted_dc_list: attempting lookup "
- "for name %s (sitename %s)\n",
- domain,
- sitename ? sitename : "NULL"));
-
- if (ads_only) {
- lookup_type = DC_ADS_ONLY;
- }
-
- status = get_dc_list(domain, sitename, ip_list,
- count, lookup_type, &ordered);
- if (NT_STATUS_EQUAL(status, NT_STATUS_NO_LOGON_SERVERS)
- && sitename) {
- DEBUG(3,("get_sorted_dc_list: no server for name %s available"
- " in site %s, fallback to all servers\n",
- domain, sitename));
- status = get_dc_list(domain, NULL, ip_list,
- count, lookup_type, &ordered);
- }
-
- if (!NT_STATUS_IS_OK(status)) {
- SAFE_FREE(*ip_list);
- *count = 0;
- return status;
- }
-
- /* only sort if we don't already have an ordered list */
- if (!ordered) {
- sort_service_list(*ip_list, *count);
- }
-
- return NT_STATUS_OK;
-}
-
/*********************************************************************
Talloc version.
Small wrapper function to get the DC list and sort it if neccessary.
unsigned int *p_num_entries);
bool find_master_ip(const char *group, struct sockaddr_storage *master_ss);
bool get_pdc_ip(const char *domain, struct sockaddr_storage *pss);
-NTSTATUS get_sorted_dc_list( const char *domain,
- const char *sitename,
- struct ip_service **ip_list,
- int *count,
- bool ads_only );
NTSTATUS get_sorted_dc_list_talloc(TALLOC_CTX *ctx,
const char *domain,
const char *sitename,