Merge branch 'master' of /home/tridge/samba/git/combined
[Samba/aatanasov.git] / source3 / winbindd / winbindd_ndr.c
blob80a071103ace67f179298cc797ff626f569526f5
1 /*
2 * Unix SMB/CIFS implementation.
3 * winbindd debug helper
4 * Copyright (C) Guenther Deschner 2008
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 3 of the License, or
9 * (at your option) any later version.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, see <http://www.gnu.org/licenses/>.
20 #include "includes.h"
21 #include "winbindd.h"
23 #undef DBGC_CLASS
24 #define DBGC_CLASS DBGC_WINBIND
26 /****************************************************************
27 ****************************************************************/
29 void ndr_print_winbindd_child(struct ndr_print *ndr,
30 const char *name,
31 const struct winbindd_child *r)
33 ndr_print_struct(ndr, name, "winbindd_child");
34 ndr->depth++;
35 ndr_print_ptr(ndr, "next", r->next);
36 ndr_print_ptr(ndr, "prev", r->prev);
37 ndr_print_uint32(ndr, "pid", (uint32_t)r->pid);
38 #if 0
39 ndr_print_winbindd_domain(ndr, "domain", r->domain);
40 #else
41 ndr_print_ptr(ndr, "domain", r->domain);
42 #endif
43 ndr_print_string(ndr, "logfilename", r->logfilename);
44 /* struct fd_event event; */
45 ndr_print_ptr(ndr, "lockout_policy_event", r->lockout_policy_event);
46 ndr_print_ptr(ndr, "table", r->table);
47 ndr->depth--;
50 /****************************************************************
51 ****************************************************************/
53 void ndr_print_winbindd_cm_conn(struct ndr_print *ndr,
54 const char *name,
55 const struct winbindd_cm_conn *r)
57 ndr_print_struct(ndr, name, "winbindd_cm_conn");
58 ndr->depth++;
59 ndr_print_ptr(ndr, "cli", r->cli);
60 ndr_print_ptr(ndr, "samr_pipe", r->samr_pipe);
61 ndr_print_policy_handle(ndr, "sam_connect_handle", &r->sam_connect_handle);
62 ndr_print_policy_handle(ndr, "sam_domain_handle", &r->sam_domain_handle);
63 ndr_print_ptr(ndr, "lsa_pipe", r->lsa_pipe);
64 ndr_print_policy_handle(ndr, "lsa_policy", &r->lsa_policy);
65 ndr_print_ptr(ndr, "netlogon_pipe", r->netlogon_pipe);
66 ndr->depth--;
69 /****************************************************************
70 ****************************************************************/
72 #ifdef HAVE_ADS
73 extern struct winbindd_methods ads_methods;
74 #endif
75 extern struct winbindd_methods msrpc_methods;
76 extern struct winbindd_methods builtin_passdb_methods;
77 extern struct winbindd_methods sam_passdb_methods;
78 extern struct winbindd_methods reconnect_methods;
79 extern struct winbindd_methods cache_methods;
81 void ndr_print_winbindd_methods(struct ndr_print *ndr,
82 const char *name,
83 const struct winbindd_methods *r)
85 ndr_print_struct(ndr, name, "winbindd_methods");
86 ndr->depth++;
88 if (r == NULL) {
89 ndr_print_string(ndr, name, "(NULL)");
90 ndr->depth--;
91 return;
94 if (r == &msrpc_methods) {
95 ndr_print_string(ndr, name, "msrpc_methods");
96 #ifdef HAVE_ADS
97 } else if (r == &ads_methods) {
98 ndr_print_string(ndr, name, "ads_methods");
99 #endif
100 } else if (r == &builtin_passdb_methods) {
101 ndr_print_string(ndr, name, "builtin_passdb_methods");
102 } else if (r == &sam_passdb_methods) {
103 ndr_print_string(ndr, name, "sam_passdb_methods");
104 } else if (r == &reconnect_methods) {
105 ndr_print_string(ndr, name, "reconnect_methods");
106 } else if (r == &cache_methods) {
107 ndr_print_string(ndr, name, "cache_methods");
108 } else {
109 ndr_print_string(ndr, name, "UNKNOWN");
111 ndr->depth--;
114 /****************************************************************
115 ****************************************************************/
117 void ndr_print_winbindd_domain(struct ndr_print *ndr,
118 const char *name,
119 const struct winbindd_domain *r)
121 if (!r) {
122 return;
125 ndr_print_struct(ndr, name, "winbindd_domain");
126 ndr->depth++;
127 ndr_print_string(ndr, "name", r->name);
128 ndr_print_string(ndr, "alt_name", r->alt_name);
129 ndr_print_string(ndr, "forest_name", r->forest_name);
130 ndr_print_dom_sid(ndr, "sid", &r->sid);
131 ndr_print_netr_TrustFlags(ndr, "domain_flags", r->domain_flags);
132 ndr_print_netr_TrustType(ndr, "domain_type", r->domain_type);
133 ndr_print_netr_TrustAttributes(ndr, "domain_trust_attribs", r->domain_trust_attribs);
134 ndr_print_bool(ndr, "initialized", r->initialized);
135 ndr_print_bool(ndr, "native_mode", r->native_mode);
136 ndr_print_bool(ndr, "active_directory", r->active_directory);
137 ndr_print_bool(ndr, "primary", r->primary);
138 ndr_print_bool(ndr, "internal", r->internal);
139 ndr_print_bool(ndr, "online", r->online);
140 ndr_print_time_t(ndr, "startup_time", r->startup_time);
141 ndr_print_bool(ndr, "startup", r->startup);
142 ndr_print_winbindd_methods(ndr, "methods", r->methods);
143 ndr_print_winbindd_methods(ndr, "backend", r->backend);
144 ndr_print_ptr(ndr, "private_data", r->private_data);
145 ndr_print_string(ndr, "dcname", r->dcname);
146 ndr_print_sockaddr_storage(ndr, "dcaddr", &r->dcaddr);
147 ndr_print_time_t(ndr, "last_seq_check", r->last_seq_check);
148 ndr_print_uint32(ndr, "sequence_number", r->sequence_number);
149 ndr_print_NTSTATUS(ndr, "last_status", r->last_status);
150 ndr_print_winbindd_cm_conn(ndr, "conn", &r->conn);
151 ndr_print_winbindd_child(ndr, "child", &r->child);
152 ndr_print_uint32(ndr, "check_online_timeout", r->check_online_timeout);
153 ndr_print_ptr(ndr, "check_online_event", r->check_online_event);
154 ndr->depth--;