LCOV - code coverage report
Current view: top level - source3/winbindd - winbindd_ndr.c (source / functions) Hit Total Coverage
Test: coverage report for master 2f515e9b Lines: 0 78 0.0 %
Date: 2024-04-21 15:09:00 Functions: 0 4 0.0 %

          Line data    Source code
       1             : /*
       2             :  *  Unix SMB/CIFS implementation.
       3             :  *  winbindd debug helper
       4             :  *  Copyright (C) Guenther Deschner 2008
       5             :  *
       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.
      10             :  *
      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.
      15             :  *
      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/>.
      18             :  */
      19             : 
      20             : #include "includes.h"
      21             : #include "winbindd.h"
      22             : #include "../librpc/gen_ndr/ndr_netlogon.h"
      23             : #include "../librpc/gen_ndr/ndr_security.h"
      24             : #include "../librpc/gen_ndr/ndr_lsa.h"
      25             : #include "../librpc/ndr/libndr.h"
      26             : 
      27             : #undef DBGC_CLASS
      28             : #define DBGC_CLASS DBGC_WINBIND
      29             : 
      30             : /****************************************************************
      31             : ****************************************************************/
      32             : 
      33           0 : void ndr_print_winbindd_child(struct ndr_print *ndr,
      34             :                               const char *name,
      35             :                               const struct winbindd_child *r)
      36             : {
      37           0 :         ndr_print_struct(ndr, name, "winbindd_child");
      38           0 :         ndr->depth++;
      39           0 :         ndr_print_uint32(ndr, "pid", (uint32_t)r->pid);
      40             : #if 0
      41             :         ndr_print_winbindd_domain(ndr, "domain", r->domain);
      42             : #else
      43           0 :         ndr_print_ptr(ndr, "domain", r->domain);
      44             : #endif
      45           0 :         ndr_print_string(ndr, "logfilename", r->logfilename);
      46             :         /* struct fd_event event; */
      47           0 :         ndr_print_ptr(ndr, "lockout_policy_event", r->lockout_policy_event);
      48           0 :         ndr->depth--;
      49           0 : }
      50             : 
      51             : /****************************************************************
      52             : ****************************************************************/
      53             : 
      54           0 : void ndr_print_winbindd_cm_conn(struct ndr_print *ndr,
      55             :                                 const char *name,
      56             :                                 const struct winbindd_cm_conn *r)
      57             : {
      58           0 :         ndr_print_struct(ndr, name, "winbindd_cm_conn");
      59           0 :         ndr->depth++;
      60           0 :         ndr_print_ptr(ndr, "cli", r->cli);
      61           0 :         ndr_print_ptr(ndr, "samr_pipe", r->samr_pipe);
      62           0 :         ndr_print_policy_handle(ndr, "sam_connect_handle", &r->sam_connect_handle);
      63           0 :         ndr_print_policy_handle(ndr, "sam_domain_handle", &r->sam_domain_handle);
      64           0 :         ndr_print_ptr(ndr, "lsa_pipe", r->lsa_pipe);
      65           0 :         ndr_print_policy_handle(ndr, "lsa_policy", &r->lsa_policy);
      66           0 :         ndr_print_ptr(ndr, "netlogon_pipe", r->netlogon_pipe);
      67           0 :         ndr->depth--;
      68           0 : }
      69             : 
      70             : /****************************************************************
      71             : ****************************************************************/
      72             : 
      73             : #ifdef HAVE_ADS
      74             : extern struct winbindd_methods ads_methods;
      75             : extern struct winbindd_methods reconnect_ads_methods;
      76             : #endif
      77             : extern struct winbindd_methods msrpc_methods;
      78             : extern struct winbindd_methods builtin_passdb_methods;
      79             : extern struct winbindd_methods sam_passdb_methods;
      80             : extern struct winbindd_methods reconnect_methods;
      81             : 
      82           0 : void ndr_print_winbindd_methods(struct ndr_print *ndr,
      83             :                                 const char *name,
      84             :                                 const struct winbindd_methods *r)
      85             : {
      86           0 :         ndr_print_struct(ndr, name, "winbindd_methods");
      87           0 :         ndr->depth++;
      88             : 
      89           0 :         if (r == NULL) {
      90           0 :                 ndr_print_string(ndr, name, "(NULL)");
      91           0 :                 ndr->depth--;
      92           0 :                 return;
      93             :         }
      94             : 
      95           0 :         if (r == &msrpc_methods) {
      96           0 :                 ndr_print_string(ndr, name, "msrpc_methods");
      97             : #ifdef HAVE_ADS
      98           0 :         } else if (r == &ads_methods) {
      99           0 :                 ndr_print_string(ndr, name, "ads_methods");
     100           0 :         } else if (r == &reconnect_ads_methods) {
     101           0 :                 ndr_print_string(ndr, name, "reconnect_ads_methods");
     102             : #endif
     103           0 :         } else if (r == &builtin_passdb_methods) {
     104           0 :                 ndr_print_string(ndr, name, "builtin_passdb_methods");
     105           0 :         } else if (r == &sam_passdb_methods) {
     106           0 :                 ndr_print_string(ndr, name, "sam_passdb_methods");
     107           0 :         } else if (r == &reconnect_methods) {
     108           0 :                 ndr_print_string(ndr, name, "reconnect_methods");
     109             :         } else {
     110           0 :                 ndr_print_string(ndr, name, "UNKNOWN");
     111             :         }
     112           0 :         ndr->depth--;
     113             : }
     114             : 
     115             : /****************************************************************
     116             : ****************************************************************/
     117             : 
     118           0 : void ndr_print_winbindd_domain(struct ndr_print *ndr,
     119             :                                const char *name,
     120             :                                const struct winbindd_domain *r)
     121             : {
     122           0 :         int i;
     123           0 :         if (!r) {
     124           0 :                 return;
     125             :         }
     126             : 
     127           0 :         ndr_print_struct(ndr, name, "winbindd_domain");
     128           0 :         ndr->depth++;
     129           0 :         ndr_print_string(ndr, "name", r->name);
     130           0 :         ndr_print_string(ndr, "alt_name", r->alt_name);
     131           0 :         ndr_print_string(ndr, "forest_name", r->forest_name);
     132           0 :         ndr_print_dom_sid(ndr, "sid", &r->sid);
     133           0 :         ndr_print_netr_TrustFlags(ndr, "domain_flags", r->domain_flags);
     134           0 :         ndr_print_lsa_TrustType(ndr, "domain_type", r->domain_type);
     135           0 :         ndr_print_lsa_TrustAttributes(ndr, "domain_trust_attribs", r->domain_trust_attribs);
     136           0 :         ndr_print_bool(ndr, "initialized", r->initialized);
     137           0 :         ndr_print_bool(ndr, "native_mode", r->native_mode);
     138           0 :         ndr_print_bool(ndr, "active_directory", r->active_directory);
     139           0 :         ndr_print_bool(ndr, "primary", r->primary);
     140           0 :         ndr_print_bool(ndr, "internal", r->internal);
     141           0 :         ndr_print_bool(ndr, "online", r->online);
     142           0 :         ndr_print_time_t(ndr, "startup_time", r->startup_time);
     143           0 :         ndr_print_bool(ndr, "startup", r->startup);
     144           0 :         ndr_print_winbindd_methods(ndr, "backend", r->backend);
     145           0 :         ndr_print_ptr(ndr,
     146             :                       "backend_data.samr_pipes",
     147           0 :                       r->backend_data.samr_pipes);
     148           0 :         ndr_print_ptr(ndr,
     149             :                       "backend_data.ads_conn",
     150           0 :                       r->backend_data.ads_conn);
     151           0 :         ndr_print_string(ndr, "dcname", r->dcname);
     152           0 :         ndr_print_sockaddr_storage(ndr, "dcaddr", &r->dcaddr);
     153           0 :         ndr_print_time_t(ndr, "last_seq_check", r->last_seq_check);
     154           0 :         ndr_print_uint32(ndr, "sequence_number", r->sequence_number);
     155           0 :         ndr_print_NTSTATUS(ndr, "last_status", r->last_status);
     156           0 :         ndr_print_winbindd_cm_conn(ndr, "conn", &r->conn);
     157           0 :         for (i=0; i<talloc_array_length(r->children); i++) {
     158           0 :                 ndr_print_winbindd_child(ndr, "children", &r->children[i]);
     159             :         }
     160           0 :         ndr_print_ptr(ndr, "check_online_event", r->check_online_event);
     161           0 :         ndr->depth--;
     162             : }

Generated by: LCOV version 1.14