2008-01-24 18:10:18 +03:00
/*
* Unix SMB / CIFS implementation .
* winbindd debug helper
* Copyright ( C ) Guenther Deschner 2008
*
* 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/>.
*/
# include "includes.h"
# include "winbindd.h"
2010-05-05 03:39:16 +04:00
# include "../librpc/gen_ndr/ndr_netlogon.h"
2010-05-28 04:19:32 +04:00
# include "../librpc/gen_ndr/ndr_security.h"
2014-09-23 21:02:57 +04:00
# include "../librpc/gen_ndr/ndr_lsa.h"
2011-05-31 14:03:07 +04:00
# include "../librpc/ndr/libndr.h"
2008-01-24 18:10:18 +03:00
# undef DBGC_CLASS
# define DBGC_CLASS DBGC_WINBIND
/****************************************************************
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
void ndr_print_winbindd_child ( struct ndr_print * ndr ,
const char * name ,
const struct winbindd_child * r )
{
ndr_print_struct ( ndr , name , " winbindd_child " ) ;
ndr - > depth + + ;
ndr_print_uint32 ( ndr , " pid " , ( uint32_t ) r - > pid ) ;
#if 0
ndr_print_winbindd_domain ( ndr , " domain " , r - > domain ) ;
# else
ndr_print_ptr ( ndr , " domain " , r - > domain ) ;
# endif
ndr_print_string ( ndr , " logfilename " , r - > logfilename ) ;
/* struct fd_event event; */
ndr_print_ptr ( ndr , " lockout_policy_event " , r - > lockout_policy_event ) ;
ndr - > depth - - ;
}
/****************************************************************
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
void ndr_print_winbindd_cm_conn ( struct ndr_print * ndr ,
const char * name ,
const struct winbindd_cm_conn * r )
{
ndr_print_struct ( ndr , name , " winbindd_cm_conn " ) ;
ndr - > depth + + ;
ndr_print_ptr ( ndr , " cli " , r - > cli ) ;
ndr_print_ptr ( ndr , " samr_pipe " , r - > samr_pipe ) ;
ndr_print_policy_handle ( ndr , " sam_connect_handle " , & r - > sam_connect_handle ) ;
ndr_print_policy_handle ( ndr , " sam_domain_handle " , & r - > sam_domain_handle ) ;
ndr_print_ptr ( ndr , " lsa_pipe " , r - > lsa_pipe ) ;
ndr_print_policy_handle ( ndr , " lsa_policy " , & r - > lsa_policy ) ;
ndr_print_ptr ( ndr , " netlogon_pipe " , r - > netlogon_pipe ) ;
ndr - > depth - - ;
}
/****************************************************************
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
2008-03-19 18:08:24 +03:00
# ifdef HAVE_ADS
extern struct winbindd_methods ads_methods ;
2016-01-06 00:37:30 +03:00
extern struct winbindd_methods reconnect_ads_methods ;
2008-03-19 18:08:24 +03:00
# endif
extern struct winbindd_methods msrpc_methods ;
2008-05-31 10:49:36 +04:00
extern struct winbindd_methods builtin_passdb_methods ;
extern struct winbindd_methods sam_passdb_methods ;
2008-03-19 18:08:24 +03:00
extern struct winbindd_methods reconnect_methods ;
2008-01-24 18:10:18 +03:00
void ndr_print_winbindd_methods ( struct ndr_print * ndr ,
const char * name ,
const struct winbindd_methods * r )
{
ndr_print_struct ( ndr , name , " winbindd_methods " ) ;
ndr - > depth + + ;
if ( r = = NULL ) {
ndr_print_string ( ndr , name , " (NULL) " ) ;
ndr - > depth - - ;
return ;
}
2008-01-24 19:39:29 +03:00
if ( r = = & msrpc_methods ) {
2008-01-24 18:10:18 +03:00
ndr_print_string ( ndr , name , " msrpc_methods " ) ;
2008-01-24 19:39:29 +03:00
# ifdef HAVE_ADS
} else if ( r = = & ads_methods ) {
ndr_print_string ( ndr , name , " ads_methods " ) ;
2016-01-06 00:37:30 +03:00
} else if ( r = = & reconnect_ads_methods ) {
ndr_print_string ( ndr , name , " reconnect_ads_methods " ) ;
2008-01-24 19:39:29 +03:00
# endif
2008-05-31 10:49:36 +04:00
} else if ( r = = & builtin_passdb_methods ) {
ndr_print_string ( ndr , name , " builtin_passdb_methods " ) ;
} else if ( r = = & sam_passdb_methods ) {
ndr_print_string ( ndr , name , " sam_passdb_methods " ) ;
2008-01-24 18:10:18 +03:00
} else if ( r = = & reconnect_methods ) {
ndr_print_string ( ndr , name , " reconnect_methods " ) ;
} else {
ndr_print_string ( ndr , name , " UNKNOWN " ) ;
}
ndr - > depth - - ;
}
/****************************************************************
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
void ndr_print_winbindd_domain ( struct ndr_print * ndr ,
const char * name ,
const struct winbindd_domain * r )
{
2010-04-07 19:45:12 +04:00
int i ;
2008-01-24 18:10:18 +03:00
if ( ! r ) {
return ;
}
ndr_print_struct ( ndr , name , " winbindd_domain " ) ;
ndr - > depth + + ;
ndr_print_string ( ndr , " name " , r - > name ) ;
ndr_print_string ( ndr , " alt_name " , r - > alt_name ) ;
ndr_print_string ( ndr , " forest_name " , r - > forest_name ) ;
ndr_print_dom_sid ( ndr , " sid " , & r - > sid ) ;
ndr_print_netr_TrustFlags ( ndr , " domain_flags " , r - > domain_flags ) ;
2014-09-23 21:02:57 +04:00
ndr_print_lsa_TrustType ( ndr , " domain_type " , r - > domain_type ) ;
ndr_print_lsa_TrustAttributes ( ndr , " domain_trust_attribs " , r - > domain_trust_attribs ) ;
2008-01-24 18:10:18 +03:00
ndr_print_bool ( ndr , " initialized " , r - > initialized ) ;
ndr_print_bool ( ndr , " native_mode " , r - > native_mode ) ;
ndr_print_bool ( ndr , " active_directory " , r - > active_directory ) ;
ndr_print_bool ( ndr , " primary " , r - > primary ) ;
ndr_print_bool ( ndr , " internal " , r - > internal ) ;
ndr_print_bool ( ndr , " online " , r - > online ) ;
ndr_print_time_t ( ndr , " startup_time " , r - > startup_time ) ;
ndr_print_bool ( ndr , " startup " , r - > startup ) ;
ndr_print_winbindd_methods ( ndr , " backend " , r - > backend ) ;
2022-04-13 12:01:00 +03:00
ndr_print_ptr ( ndr ,
" backend_data.samr_pipes " ,
r - > backend_data . samr_pipes ) ;
2022-04-13 12:31:45 +03:00
ndr_print_ptr ( ndr ,
" backend_data.ads_conn " ,
r - > backend_data . ads_conn ) ;
2008-01-24 18:10:18 +03:00
ndr_print_string ( ndr , " dcname " , r - > dcname ) ;
ndr_print_sockaddr_storage ( ndr , " dcaddr " , & r - > dcaddr ) ;
ndr_print_time_t ( ndr , " last_seq_check " , r - > last_seq_check ) ;
ndr_print_uint32 ( ndr , " sequence_number " , r - > sequence_number ) ;
ndr_print_NTSTATUS ( ndr , " last_status " , r - > last_status ) ;
ndr_print_winbindd_cm_conn ( ndr , " conn " , & r - > conn ) ;
2010-04-07 19:45:12 +04:00
for ( i = 0 ; i < lp_winbind_max_domain_connections ( ) ; i + + ) {
ndr_print_winbindd_child ( ndr , " children " , & r - > children [ i ] ) ;
}
2008-01-24 18:10:18 +03:00
ndr_print_ptr ( ndr , " check_online_event " , r - > check_online_event ) ;
ndr - > depth - - ;
}