2 * Unix SMB/CIFS implementation.
3 * Copyright (C) Volker Lendecke 2018
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 3 of the License, or
8 * (at your option) any later version.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, see <http://www.gnu.org/licenses/>.
19 #ifndef __LIBSMB_NAMEQUERY_H__
20 #define __LIBSMB_NAMEQUERY_H__
25 /* The following definitions come from libsmb/namequery.c */
27 bool saf_store( const char *domain
, const char *servername
);
28 bool saf_join_store( const char *domain
, const char *servername
);
29 bool saf_delete( const char *domain
);
30 char *saf_fetch(TALLOC_CTX
*mem_ctx
, const char *domain
);
31 struct tevent_req
*node_status_query_send(TALLOC_CTX
*mem_ctx
,
32 struct tevent_context
*ev
,
33 struct nmb_name
*name
,
34 const struct sockaddr_storage
*addr
);
35 NTSTATUS
node_status_query_recv(struct tevent_req
*req
, TALLOC_CTX
*mem_ctx
,
36 struct node_status
**pnode_status
,
38 struct node_status_extra
*extra
);
39 NTSTATUS
node_status_query(TALLOC_CTX
*mem_ctx
, struct nmb_name
*name
,
40 const struct sockaddr_storage
*addr
,
41 struct node_status
**pnode_status
,
43 struct node_status_extra
*extra
);
44 bool name_status_find(const char *q_name
,
47 const struct sockaddr_storage
*to_ss
,
49 int remove_duplicate_addrs2(struct ip_service
*iplist
, int count
);
50 struct tevent_req
*name_query_send(TALLOC_CTX
*mem_ctx
,
51 struct tevent_context
*ev
,
52 const char *name
, int name_type
,
53 bool bcast
, bool recurse
,
54 const struct sockaddr_storage
*addr
);
55 NTSTATUS
name_query_recv(struct tevent_req
*req
, TALLOC_CTX
*mem_ctx
,
56 struct sockaddr_storage
**addrs
, int *num_addrs
,
58 NTSTATUS
name_query(const char *name
, int name_type
,
59 bool bcast
, bool recurse
,
60 const struct sockaddr_storage
*to_ss
,
62 struct sockaddr_storage
**addrs
,
63 int *num_addrs
, uint8_t *flags
);
64 struct tevent_req
*name_resolve_bcast_send(TALLOC_CTX
*mem_ctx
,
65 struct tevent_context
*ev
,
68 NTSTATUS
name_resolve_bcast_recv(struct tevent_req
*req
, TALLOC_CTX
*mem_ctx
,
69 struct sockaddr_storage
**addrs
,
71 NTSTATUS
name_resolve_bcast(const char *name
,
74 struct sockaddr_storage
**return_iplist
,
76 struct tevent_req
*resolve_wins_send(TALLOC_CTX
*mem_ctx
,
77 struct tevent_context
*ev
,
80 NTSTATUS
resolve_wins_recv(struct tevent_req
*req
, TALLOC_CTX
*mem_ctx
,
81 struct sockaddr_storage
**addrs
,
82 int *num_addrs
, uint8_t *flags
);
83 NTSTATUS
resolve_wins(const char *name
,
86 struct sockaddr_storage
**return_iplist
,
88 NTSTATUS
internal_resolve_name(const char *name
,
91 struct ip_service
**return_iplist
,
93 const char **resolve_order
);
94 bool resolve_name(const char *name
,
95 struct sockaddr_storage
*return_ss
,
98 NTSTATUS
resolve_name_list(TALLOC_CTX
*ctx
,
101 struct sockaddr_storage
**return_ss_arr
,
102 unsigned int *p_num_entries
);
103 bool find_master_ip(const char *group
, struct sockaddr_storage
*master_ss
);
104 bool get_pdc_ip(const char *domain
, struct sockaddr_storage
*pss
);
105 NTSTATUS
get_sorted_dc_list( const char *domain
,
106 const char *sitename
,
107 struct ip_service
**ip_list
,
110 NTSTATUS
get_kdc_list( const char *realm
,
111 const char *sitename
,
112 struct ip_service
**ip_list
,