2011-06-10 17:05:09 +04:00
/*
Unix SMB / CIFS implementation .
ads ( active directory ) utility library
Copyright ( C ) Andrew Tridgell 2001
Copyright ( C ) Remus Koos 2001
Copyright ( C ) Jim McDonough < jmcd @ us . ibm . com > 2002
Copyright ( C ) Guenther Deschner 2005
Copyright ( C ) Gerald Carter 2006
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 _LIBADS_ADS_LDAP_PROTOS_H_
# define _LIBADS_ADS_LDAP_PROTOS_H_
2011-11-17 03:55:04 +04:00
# ifdef HAVE_LDAP_INIT_FD
int ldap_init_fd ( ber_socket_t fd , int proto , char * uri , LDAP * * ldp ) ;
# endif
2006-09-04 01:07:16 +04:00
/*
* Prototypes for ads
*/
2011-11-17 03:55:04 +04:00
LDAP * ldap_open_with_timeout ( const char * server ,
struct sockaddr_storage * ss ,
int port , unsigned int to ) ;
2006-09-04 01:07:16 +04:00
void ads_msgfree ( ADS_STRUCT * ads , LDAPMessage * msg ) ;
2009-03-18 09:35:03 +03:00
char * ads_get_dn ( ADS_STRUCT * ads , TALLOC_CTX * mem_ctx , LDAPMessage * msg ) ;
2006-09-04 01:07:16 +04:00
char * ads_pull_string ( ADS_STRUCT * ads , TALLOC_CTX * mem_ctx , LDAPMessage * msg ,
const char * field ) ;
char * * ads_pull_strings ( ADS_STRUCT * ads , TALLOC_CTX * mem_ctx ,
LDAPMessage * msg , const char * field ,
size_t * num_values ) ;
2010-05-31 14:51:29 +04:00
char * * ads_pull_strings_range ( ADS_STRUCT * ads ,
2006-09-04 01:07:16 +04:00
TALLOC_CTX * mem_ctx ,
LDAPMessage * msg , const char * field ,
char * * current_strings ,
const char * * next_attribute ,
size_t * num_strings ,
2007-10-19 04:40:25 +04:00
bool * more_strings ) ;
bool ads_pull_uint32 ( ADS_STRUCT * ads , LDAPMessage * msg , const char * field ,
2006-09-04 01:07:16 +04:00
uint32 * v ) ;
2007-10-19 04:40:25 +04:00
bool ads_pull_guid ( ADS_STRUCT * ads , LDAPMessage * msg , struct GUID * guid ) ;
bool ads_pull_sid ( ADS_STRUCT * ads , LDAPMessage * msg , const char * field ,
2010-05-21 05:25:01 +04:00
struct dom_sid * sid ) ;
2006-09-04 01:07:16 +04:00
int ads_pull_sids ( ADS_STRUCT * ads , TALLOC_CTX * mem_ctx ,
2010-05-21 05:25:01 +04:00
LDAPMessage * msg , const char * field , struct dom_sid * * sids ) ;
2007-10-19 04:40:25 +04:00
bool ads_pull_sd ( ADS_STRUCT * ads , TALLOC_CTX * mem_ctx ,
2010-05-18 12:29:34 +04:00
LDAPMessage * msg , const char * field , struct security_descriptor * * sd ) ;
2006-09-04 01:07:16 +04:00
char * ads_pull_username ( ADS_STRUCT * ads , TALLOC_CTX * mem_ctx ,
LDAPMessage * msg ) ;
ADS_STATUS ads_find_machine_acct ( ADS_STRUCT * ads , LDAPMessage * * res ,
const char * machine ) ;
ADS_STATUS ads_find_printer_on_server ( ADS_STRUCT * ads , LDAPMessage * * res ,
const char * printer ,
const char * servername ) ;
ADS_STATUS ads_find_printers ( ADS_STRUCT * ads , LDAPMessage * * res ) ;
ADS_STATUS ads_find_user_acct ( ADS_STRUCT * ads , LDAPMessage * * res ,
const char * user ) ;
2010-05-31 14:51:29 +04:00
ADS_STATUS ads_do_search ( ADS_STRUCT * ads , const char * bind_path , int scope ,
2006-09-04 01:07:16 +04:00
const char * expr ,
const char * * attrs , LDAPMessage * * res ) ;
2010-05-31 14:51:29 +04:00
ADS_STATUS ads_search ( ADS_STRUCT * ads , LDAPMessage * * res ,
2006-09-04 01:07:16 +04:00
const char * expr , const char * * attrs ) ;
2010-05-31 14:51:29 +04:00
ADS_STATUS ads_search_dn ( ADS_STRUCT * ads , LDAPMessage * * res ,
2006-09-04 01:07:16 +04:00
const char * dn , const char * * attrs ) ;
ADS_STATUS ads_do_search_all_args ( ADS_STRUCT * ads , const char * bind_path ,
int scope , const char * expr ,
const char * * attrs , void * args ,
LDAPMessage * * res ) ;
ADS_STATUS ads_do_search_all ( ADS_STRUCT * ads , const char * bind_path ,
int scope , const char * expr ,
const char * * attrs , LDAPMessage * * res ) ;
ADS_STATUS ads_do_search_retry ( ADS_STRUCT * ads , const char * bind_path ,
2010-05-31 14:51:29 +04:00
int scope ,
2006-09-04 01:07:16 +04:00
const char * expr ,
const char * * attrs , LDAPMessage * * res ) ;
2010-05-31 14:51:29 +04:00
ADS_STATUS ads_search_retry ( ADS_STRUCT * ads , LDAPMessage * * res ,
2006-09-04 01:07:16 +04:00
const char * expr , const char * * attrs ) ;
2010-05-31 14:51:29 +04:00
ADS_STATUS ads_search_retry_dn ( ADS_STRUCT * ads , LDAPMessage * * res ,
const char * dn ,
2006-09-04 01:07:16 +04:00
const char * * attrs ) ;
2010-05-31 14:51:29 +04:00
ADS_STATUS ads_search_retry_extended_dn_ranged ( ADS_STRUCT * ads , TALLOC_CTX * mem_ctx ,
const char * dn ,
2007-04-22 20:45:03 +04:00
const char * * attrs ,
enum ads_extended_dn_flags flags ,
char * * * strings ,
size_t * num_strings ) ;
2010-05-31 14:51:29 +04:00
ADS_STATUS ads_search_retry_sid ( ADS_STRUCT * ads , LDAPMessage * * res ,
2010-05-21 05:25:01 +04:00
const struct dom_sid * sid ,
2006-09-04 01:07:16 +04:00
const char * * attrs ) ;
LDAPMessage * ads_first_entry ( ADS_STRUCT * ads , LDAPMessage * res ) ;
LDAPMessage * ads_next_entry ( ADS_STRUCT * ads , LDAPMessage * res ) ;
2008-04-26 05:34:46 +04:00
LDAPMessage * ads_first_message ( ADS_STRUCT * ads , LDAPMessage * res ) ;
LDAPMessage * ads_next_message ( ADS_STRUCT * ads , LDAPMessage * res ) ;
2006-09-04 01:07:16 +04:00
void ads_process_results ( ADS_STRUCT * ads , LDAPMessage * res ,
2007-10-19 04:40:25 +04:00
bool ( * fn ) ( ADS_STRUCT * , char * , void * * , void * ) ,
2006-09-04 01:07:16 +04:00
void * data_area ) ;
void ads_dump ( ADS_STRUCT * ads , LDAPMessage * res ) ;
2006-09-24 07:15:58 +04:00
2010-05-10 02:07:10 +04:00
struct GROUP_POLICY_OBJECT ;
2006-09-24 07:15:58 +04:00
ADS_STATUS ads_parse_gpo ( ADS_STRUCT * ads ,
TALLOC_CTX * mem_ctx ,
LDAPMessage * res ,
const char * gpo_dn ,
struct GROUP_POLICY_OBJECT * gpo ) ;
2010-05-31 14:51:29 +04:00
ADS_STATUS ads_search_retry_dn_sd_flags ( ADS_STRUCT * ads , LDAPMessage * * res ,
2007-05-11 16:52:48 +04:00
uint32 sd_flags ,
2010-05-31 14:51:29 +04:00
const char * dn ,
2007-05-11 16:52:48 +04:00
const char * * attrs ) ;
ADS_STATUS ads_do_search_all_sd_flags ( ADS_STRUCT * ads , const char * bind_path ,
int scope , const char * expr ,
2010-05-31 14:51:29 +04:00
const char * * attrs , uint32 sd_flags ,
2007-05-11 16:52:48 +04:00
LDAPMessage * * res ) ;
2007-05-11 17:33:37 +04:00
ADS_STATUS ads_get_tokensids ( ADS_STRUCT * ads ,
TALLOC_CTX * mem_ctx ,
const char * dn ,
2010-05-21 05:25:01 +04:00
struct dom_sid * user_sid ,
struct dom_sid * primary_group_sid ,
struct dom_sid * * sids ,
2007-05-11 17:33:37 +04:00
size_t * num_sids ) ;
2008-01-03 19:28:09 +03:00
ADS_STATUS ads_get_joinable_ous ( ADS_STRUCT * ads ,
TALLOC_CTX * mem_ctx ,
char * * * ous ,
size_t * num_ous ) ;
2011-06-10 17:05:09 +04:00
# endif /* _LIBADS_ADS_LDAP_PROTOS_H_ */