From cecbf0cd8b99f7019a83def88baec889d6a06e6f Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Tue, 11 Nov 2003 04:04:36 +0000 Subject: automatically generate ndr_print_*() functions for every IDL structure. This allows easy debug and test tool writing without having to write functions that print every element of complex structures. (This used to be commit 81d6181172e36c6fbae0907550a29511ce708574) --- source4/torture/rpc/lsa.c | 82 +++++++++++------------------------------------ 1 file changed, 18 insertions(+), 64 deletions(-) (limited to 'source4/torture/rpc') diff --git a/source4/torture/rpc/lsa.c b/source4/torture/rpc/lsa.c index ca8c25bdd6..ece5212ee6 100644 --- a/source4/torture/rpc/lsa.c +++ b/source4/torture/rpc/lsa.c @@ -21,6 +21,7 @@ #include "includes.h" + /* these really shouldn't be here .... */ @@ -189,23 +190,12 @@ static BOOL test_LookupNames(struct dcerpc_pipe *p, } if (r.out.domains) { - printf("lookup gave %d domains (max_count=%d)\n", - r.out.domains->count, - r.out.domains->max_count); - for (i=0;icount;i++) { - printf("name='%s' sid=%s\n", - r.out.domains->domains[i].name.name, - lsa_sid_string_talloc(mem_ctx, r.out.domains->domains[i].sid)); - } + NDR_PRINT_DEBUG(lsa_RefDomainList, r.out.domains); } printf("lookup gave %d sids (sids.count=%d)\n", count, sids.count); - for (i=0;icount, - r.out.domains->max_count); - for (i=0;icount;i++) { - printf("name='%s' sid=%s\n", - r.out.domains->domains[i].name.name, - lsa_sid_string_talloc(mem_ctx, r.out.domains->domains[i].sid)); - } + NDR_PRINT_DEBUG(lsa_RefDomainList, r.out.domains); } - printf("lookup gave %d names (names.count=%d)\n", count, names.count); - for (i=0;iname); + NDR_PRINT_DEBUG(lsa_Name, r.out.name); return True; } @@ -316,15 +293,11 @@ static BOOL test_EnumPrivsAccount(struct dcerpc_pipe *p, r.out.privs?r.out.privs->count:0, r.out.unknown); if (r.out.privs) { - struct lsa_PrivilegeSet *privs = r.out.privs; int i; - for (i=0;icount;i++) { - printf("luid=%08x-%08x attribute=0x%08x ", - privs->set[i].luid.low, - privs->set[i].luid.high, - privs->set[i].attribute); + NDR_PRINT_DEBUG(lsa_PrivilegeSet, r.out.privs); + for (i=0;icount;i++) { test_LookupPrivName(p, mem_ctx, handle, - &privs->set[i].luid); + &r.out.privs->set[i].luid); } } @@ -353,10 +326,7 @@ static BOOL test_EnumAccountRights(struct dcerpc_pipe *p, return False; } - printf("received %d rights\n", rights.count); - for (i=0;icount;i++) { - printf("name='%s' sid=%s\n", - domains.domains[i].name.name, - lsa_sid_string_talloc(mem_ctx, domains.domains[i].sid)); - } + + NDR_PRINT_DEBUG(lsa_DomainList, r.out.domains); return True; } @@ -546,15 +508,7 @@ static BOOL test_QueryInfoPolicy(struct dcerpc_pipe *p, return False; } - { - struct lsa_AuditLogInfo *u = &r.out.info->audit_log; - printf("percent_full=%d log_size=%d retention_time=%s\n", - u->percent_full, u->log_size, - nt_time_string(mem_ctx, &u->retention_time)); - printf("shutdown_in_progress=%d time_to_shutdown=%s next_audit_record=%d unknown=0x%x\n", - u->shutdown_in_progress, nt_time_string(mem_ctx, &u->time_to_shutdown), - u->next_audit_record, u->unknown); - } + NDR_PRINT_DEBUG(lsa_AuditLogInfo, &r.out.info->audit_log); return True; } -- cgit