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 */
26 bool saf_store( const char *domain
, const char *servername
);
27 bool saf_join_store( const char *domain
, const char *servername
);
28 bool saf_delete( const char *domain
);
29 char *saf_fetch(TALLOC_CTX
*mem_ctx
, const char *domain
);
30 struct tevent_req
*node_status_query_send(TALLOC_CTX
*mem_ctx
,
31 struct tevent_context
*ev
,
32 struct nmb_name
*name
,
33 const struct sockaddr_storage
*addr
);
34 NTSTATUS
node_status_query_recv(struct tevent_req
*req
, TALLOC_CTX
*mem_ctx
,
35 struct node_status
**pnode_status
,
37 struct node_status_extra
*extra
);
38 NTSTATUS
node_status_query(TALLOC_CTX
*mem_ctx
, struct nmb_name
*name
,
39 const struct sockaddr_storage
*addr
,
40 struct node_status
**pnode_status
,
42 struct node_status_extra
*extra
);
43 bool name_status_find(const char *q_name
,
46 const struct sockaddr_storage
*to_ss
,
48 size_t remove_duplicate_addrs2(struct samba_sockaddr
*salist
, size_t count
);
49 struct tevent_req
*name_query_send(TALLOC_CTX
*mem_ctx
,
50 struct tevent_context
*ev
,
51 const char *name
, int name_type
,
52 bool bcast
, bool recurse
,
53 const struct sockaddr_storage
*addr
);
54 NTSTATUS
name_query_recv(struct tevent_req
*req
, TALLOC_CTX
*mem_ctx
,
55 struct sockaddr_storage
**addrs
, size_t *num_addrs
,
57 NTSTATUS
name_query(const char *name
, int name_type
,
58 bool bcast
, bool recurse
,
59 const struct sockaddr_storage
*to_ss
,
61 struct sockaddr_storage
**addrs
,
62 size_t *num_addrs
, uint8_t *flags
);
63 struct tevent_req
*name_resolve_bcast_send(TALLOC_CTX
*mem_ctx
,
64 struct tevent_context
*ev
,
67 NTSTATUS
name_resolve_bcast_recv(struct tevent_req
*req
, TALLOC_CTX
*mem_ctx
,
68 struct sockaddr_storage
**addrs
,
70 NTSTATUS
name_resolve_bcast(TALLOC_CTX
*mem_ctx
,
73 struct sockaddr_storage
**return_iplist
,
74 size_t *return_count
);
75 struct tevent_req
*resolve_wins_send(TALLOC_CTX
*mem_ctx
,
76 struct tevent_context
*ev
,
79 NTSTATUS
resolve_wins_recv(struct tevent_req
*req
, TALLOC_CTX
*mem_ctx
,
80 struct sockaddr_storage
**addrs
,
81 size_t *num_addrs
, uint8_t *flags
);
82 NTSTATUS
resolve_wins(TALLOC_CTX
*mem_ctx
,
85 struct sockaddr_storage
**return_iplist
,
86 size_t *return_count
);
87 NTSTATUS
internal_resolve_name(TALLOC_CTX
*ctx
,
91 struct samba_sockaddr
**return_salist
,
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(TALLOC_CTX
*ctx
,
107 const char *sitename
,
108 struct samba_sockaddr
**sa_list_ret
,
111 NTSTATUS
get_kdc_list(TALLOC_CTX
*ctx
,
113 const char *sitename
,
114 struct samba_sockaddr
**sa_list_ret
,