1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-24 21:34:56 +03:00
samba-mirror/source3/libsmb/namequery.h
Jeremy Allison aa20df217c s3: libsmb: Change remove_duplicate_addrs2() to take and return size_t, not int.
Will make converting _internal_resolve_name() to return a size_t easier.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Noel Power <npower@samba.org>
2020-09-07 13:23:42 +00:00

125 lines
4.5 KiB
C

/*
* Unix SMB/CIFS implementation.
* Copyright (C) Volker Lendecke 2018
*
* This program is free software; you can redistribute it and/or modify
* 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/>.
*/
#ifndef __LIBSMB_NAMEQUERY_H__
#define __LIBSMB_NAMEQUERY_H__
#include "includes.h"
#include <tevent.h>
/* The following definitions come from libsmb/namequery.c */
bool sockaddr_storage_to_samba_sockaddr(struct samba_sockaddr *sa,
const struct sockaddr_storage *ss);
bool saf_store( const char *domain, const char *servername );
bool saf_join_store( const char *domain, const char *servername );
bool saf_delete( const char *domain );
char *saf_fetch(TALLOC_CTX *mem_ctx, const char *domain );
struct tevent_req *node_status_query_send(TALLOC_CTX *mem_ctx,
struct tevent_context *ev,
struct nmb_name *name,
const struct sockaddr_storage *addr);
NTSTATUS node_status_query_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx,
struct node_status **pnode_status,
int *pnum_names,
struct node_status_extra *extra);
NTSTATUS node_status_query(TALLOC_CTX *mem_ctx, struct nmb_name *name,
const struct sockaddr_storage *addr,
struct node_status **pnode_status,
int *pnum_names,
struct node_status_extra *extra);
bool name_status_find(const char *q_name,
int q_type,
int type,
const struct sockaddr_storage *to_ss,
fstring name);
size_t remove_duplicate_addrs2(struct ip_service *iplist, size_t count );
struct tevent_req *name_query_send(TALLOC_CTX *mem_ctx,
struct tevent_context *ev,
const char *name, int name_type,
bool bcast, bool recurse,
const struct sockaddr_storage *addr);
NTSTATUS name_query_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx,
struct sockaddr_storage **addrs, int *num_addrs,
uint8_t *flags);
NTSTATUS name_query(const char *name, int name_type,
bool bcast, bool recurse,
const struct sockaddr_storage *to_ss,
TALLOC_CTX *mem_ctx,
struct sockaddr_storage **addrs,
int *num_addrs, uint8_t *flags);
struct tevent_req *name_resolve_bcast_send(TALLOC_CTX *mem_ctx,
struct tevent_context *ev,
const char *name,
int name_type);
NTSTATUS name_resolve_bcast_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx,
struct sockaddr_storage **addrs,
int *num_addrs);
NTSTATUS name_resolve_bcast(TALLOC_CTX *mem_ctx,
const char *name,
int name_type,
struct sockaddr_storage **return_iplist,
int *return_count);
struct tevent_req *resolve_wins_send(TALLOC_CTX *mem_ctx,
struct tevent_context *ev,
const char *name,
int name_type);
NTSTATUS resolve_wins_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx,
struct sockaddr_storage **addrs,
int *num_addrs, uint8_t *flags);
NTSTATUS resolve_wins(TALLOC_CTX *mem_ctx,
const char *name,
int name_type,
struct sockaddr_storage **return_iplist,
int *return_count);
NTSTATUS dns_lookup_list_async(TALLOC_CTX *ctx,
size_t num_dns_names,
const char **dns_lookup_names,
size_t *p_num_addrs,
struct samba_sockaddr **pp_addrs,
char ***pp_dns_names);
NTSTATUS internal_resolve_name(TALLOC_CTX *ctx,
const char *name,
int name_type,
const char *sitename,
struct ip_service **return_iplist,
size_t *ret_count,
const char **resolve_order);
bool resolve_name(const char *name,
struct sockaddr_storage *return_ss,
int name_type,
bool prefer_ipv4);
NTSTATUS resolve_name_list(TALLOC_CTX *ctx,
const char *name,
int name_type,
struct sockaddr_storage **return_ss_arr,
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(TALLOC_CTX *ctx,
const char *domain,
const char *sitename,
struct ip_service **ip_list_ret,
size_t *ret_count,
bool ads_only);
NTSTATUS get_kdc_list(TALLOC_CTX *ctx,
const char *realm,
const char *sitename,
struct ip_service **ip_list_ret,
size_t *ret_count);
#endif