1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
|
/*
* 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 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,
size_t *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,
size_t *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 samba_sockaddr *salist, 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, size_t *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,
size_t *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,
size_t *num_addrs);
NTSTATUS name_resolve_bcast(TALLOC_CTX *mem_ctx,
const char *name,
int name_type,
struct sockaddr_storage **return_iplist,
size_t *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,
size_t *num_addrs, uint8_t *flags);
NTSTATUS resolve_wins(TALLOC_CTX *mem_ctx,
const char *name,
int name_type,
struct sockaddr_storage **return_iplist,
size_t *return_count);
NTSTATUS internal_resolve_name(TALLOC_CTX *ctx,
const char *name,
int name_type,
const char *sitename,
struct samba_sockaddr **return_salist,
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 samba_sockaddr **sa_list_ret,
size_t *ret_count,
bool ads_only);
NTSTATUS get_kdc_list(TALLOC_CTX *ctx,
const char *realm,
const char *sitename,
struct samba_sockaddr **sa_list_ret,
size_t *ret_count);
#endif
|