2018-03-10 17:31:11 +03:00
/*
* 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 ,
2020-09-08 23:07:07 +03:00
size_t * pnum_names ,
2018-03-10 17:31:11 +03:00
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 ,
2020-09-08 23:07:07 +03:00
size_t * pnum_names ,
2018-03-10 17:31:11 +03:00
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 ) ;
2020-09-09 20:46:49 +03:00
size_t remove_duplicate_addrs2 ( struct samba_sockaddr * salist , size_t count ) ;
2018-03-10 17:31:11 +03:00
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 ,
2020-09-08 23:37:59 +03:00
struct sockaddr_storage * * addrs , size_t * num_addrs ,
2018-03-10 17:31:11 +03:00
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 ,
2020-09-08 23:37:59 +03:00
size_t * num_addrs , uint8_t * flags ) ;
2018-03-10 17:31:11 +03:00
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 ,
2020-09-08 23:37:59 +03:00
size_t * num_addrs ) ;
2020-07-21 03:56:48 +03:00
NTSTATUS name_resolve_bcast ( TALLOC_CTX * mem_ctx ,
const char * name ,
2018-03-10 17:31:11 +03:00
int name_type ,
struct sockaddr_storage * * return_iplist ,
2020-09-08 23:37:59 +03:00
size_t * return_count ) ;
2018-03-10 17:31:11 +03:00
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 ,
2020-09-08 23:37:59 +03:00
size_t * num_addrs , uint8_t * flags ) ;
2020-07-21 03:53:28 +03:00
NTSTATUS resolve_wins ( TALLOC_CTX * mem_ctx ,
const char * name ,
2018-03-10 17:31:11 +03:00
int name_type ,
struct sockaddr_storage * * return_iplist ,
2020-09-08 23:37:59 +03:00
size_t * return_count ) ;
2020-09-09 19:40:17 +03:00
NTSTATUS internal_resolve_name ( TALLOC_CTX * ctx ,
2020-09-09 19:32:23 +03:00
const char * name ,
int name_type ,
const char * sitename ,
struct samba_sockaddr * * return_salist ,
size_t * ret_count ,
const char * * resolve_order ) ;
2018-03-10 17:31:11 +03:00
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 ) ;
2020-09-09 04:07:28 +03:00
NTSTATUS get_sorted_dc_list ( TALLOC_CTX * ctx ,
2020-09-09 02:29:35 +03:00
const char * domain ,
const char * sitename ,
struct samba_sockaddr * * sa_list_ret ,
size_t * ret_count ,
bool ads_only ) ;
2020-09-09 02:24:25 +03:00
NTSTATUS get_kdc_list ( TALLOC_CTX * ctx ,
2020-09-09 02:09:53 +03:00
const char * realm ,
const char * sitename ,
struct samba_sockaddr * * sa_list_ret ,
size_t * ret_count ) ;
2018-03-10 17:31:11 +03:00
# endif