LCOV - code coverage report
Current view: top level - bin/default/librpc/gen_ndr - ndr_netlogon_scompat.c (source / functions) Hit Total Coverage
Test: coverage report for master 2f515e9b Lines: 224 1186 18.9 %
Date: 2024-04-21 15:09:00 Functions: 10 13 76.9 %

          Line data    Source code
       1             : /* s3 compat server functions auto-generated by pidl */
       2             : #include "bin/default/librpc/gen_ndr/ndr_netlogon.h"
       3             : #include "bin/default/librpc/gen_ndr/ndr_netlogon_scompat.h"
       4             : #include <librpc/rpc/dcesrv_core.h>
       5             : #include <rpc_server/rpc_config.h>
       6             : #include <rpc_server/rpc_server.h>
       7             : #include <util/debug.h>
       8             : 
       9             : enum s3compat_rpc_dispatch {
      10             :         S3COMPAT_RPC_DISPATCH_EXTERNAL = 0x00000001,
      11             :         S3COMPAT_RPC_DISPATCH_INTERNAL = 0x00000002,
      12             : };
      13             : 
      14             : /* netlogon - dcerpc server boilerplate generated by pidl */
      15         266 : static NTSTATUS netlogon__op_bind(struct dcesrv_connection_context *context, const struct dcesrv_interface *iface)
      16             : {
      17             : #ifdef DCESRV_INTERFACE_NETLOGON_BIND
      18         266 :         return DCESRV_INTERFACE_NETLOGON_BIND(context,iface);
      19             : #else
      20             :         return NT_STATUS_OK;
      21             : #endif
      22             : }
      23             : 
      24         266 : static void netlogon__op_unbind(struct dcesrv_connection_context *context, const struct dcesrv_interface *iface)
      25             : {
      26             : #ifdef DCESRV_INTERFACE_NETLOGON_UNBIND
      27             :         DCESRV_INTERFACE_NETLOGON_UNBIND(context, iface);
      28             : #else
      29         266 :         return;
      30             : #endif
      31             : }
      32             : 
      33        4981 : NTSTATUS netlogon__op_ndr_pull(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx, struct ndr_pull *pull, void **r)
      34             : {
      35           0 :         enum ndr_err_code ndr_err;
      36        4981 :         uint16_t opnum = dce_call->pkt.u.request.opnum;
      37             : 
      38        4981 :         dce_call->fault_code = 0;
      39             : 
      40        4981 :         if (opnum >= ndr_table_netlogon.num_calls) {
      41           0 :                 dce_call->fault_code = DCERPC_FAULT_OP_RNG_ERROR;
      42           0 :                 return NT_STATUS_NET_WRITE_FAULT;
      43             :         }
      44             : 
      45        4981 :         *r = talloc_named(mem_ctx, ndr_table_netlogon.calls[opnum].struct_size, "struct %s", ndr_table_netlogon.calls[opnum].name);
      46        4981 :         NT_STATUS_HAVE_NO_MEMORY(*r);
      47             : 
      48             :         /* unravel the NDR for the packet */
      49        4981 :         ndr_err = ndr_table_netlogon.calls[opnum].ndr_pull(pull, NDR_IN, *r);
      50        4981 :         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
      51           0 :                 dce_call->fault_code = DCERPC_FAULT_NDR;
      52           0 :                 return NT_STATUS_NET_WRITE_FAULT;
      53             :         }
      54             : 
      55        4981 :         return NT_STATUS_OK;
      56             : }
      57             : 
      58        4981 : static NTSTATUS netlogon__op_dispatch_internal(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx, void *r, enum s3compat_rpc_dispatch dispatch)
      59             : {
      60        4981 :         uint16_t opnum = dce_call->pkt.u.request.opnum;
      61        4981 :         struct pipes_struct *p = NULL;
      62        4981 :         NTSTATUS status = NT_STATUS_OK;
      63        4981 :         bool impersonated = false;
      64             : 
      65             :         /* Retrieve pipes struct */
      66        4981 :         p = dcesrv_get_pipes_struct(dce_call->conn);
      67        4981 :         p->dce_call = dce_call;
      68        4981 :         p->mem_ctx = mem_ctx;
      69             :         /* Reset pipes struct fault state */
      70        4981 :         p->fault_state = 0;
      71             : 
      72             :         /* Impersonate */
      73        4981 :         if (dispatch == S3COMPAT_RPC_DISPATCH_EXTERNAL) {
      74        4981 :                 impersonated = become_authenticated_pipe_user(dce_call->auth_state->session_info);
      75        4981 :                 if (!impersonated) {
      76           0 :                         dce_call->fault_code = DCERPC_FAULT_ACCESS_DENIED;
      77           0 :                         status = NT_STATUS_NET_WRITE_FAULT;
      78           0 :                         goto fail;
      79             :                 }
      80             :         }
      81             : 
      82        4981 :         switch (opnum) {
      83           0 :         case 0: { /* netr_LogonUasLogon */
      84           0 :                 struct netr_LogonUasLogon *r2 = (struct netr_LogonUasLogon *)r;
      85           0 :                 if (DEBUGLEVEL >= 10) {
      86           0 :                         NDR_PRINT_FUNCTION_DEBUG(netr_LogonUasLogon, NDR_IN, r2);
      87             :                 }
      88           0 :                 NDR_ZERO_STRUCT(r2->out);
      89           0 :                 r2->out.info = talloc_zero(r2, struct netr_UasInfo *);
      90           0 :                 if (r2->out.info == NULL) {
      91           0 :                         status = NT_STATUS_NO_MEMORY;
      92           0 :                         p->fault_state = DCERPC_FAULT_CANT_PERFORM;
      93           0 :                         goto fail;
      94             :                 }
      95             : 
      96           0 :                 r2->out.result = _netr_LogonUasLogon(p, r2);
      97           0 :                 break;
      98             :         }
      99           0 :         case 1: { /* netr_LogonUasLogoff */
     100           0 :                 struct netr_LogonUasLogoff *r2 = (struct netr_LogonUasLogoff *)r;
     101           0 :                 if (DEBUGLEVEL >= 10) {
     102           0 :                         NDR_PRINT_FUNCTION_DEBUG(netr_LogonUasLogoff, NDR_IN, r2);
     103             :                 }
     104           0 :                 NDR_ZERO_STRUCT(r2->out);
     105           0 :                 r2->out.info = talloc_zero(r2, struct netr_UasLogoffInfo);
     106           0 :                 if (r2->out.info == NULL) {
     107           0 :                         status = NT_STATUS_NO_MEMORY;
     108           0 :                         p->fault_state = DCERPC_FAULT_CANT_PERFORM;
     109           0 :                         goto fail;
     110             :                 }
     111             : 
     112           0 :                 r2->out.result = _netr_LogonUasLogoff(p, r2);
     113           0 :                 break;
     114             :         }
     115         824 :         case 2: { /* netr_LogonSamLogon */
     116         824 :                 struct netr_LogonSamLogon *r2 = (struct netr_LogonSamLogon *)r;
     117         824 :                 if (DEBUGLEVEL >= 10) {
     118           0 :                         NDR_PRINT_FUNCTION_DEBUG(netr_LogonSamLogon, NDR_IN, r2);
     119             :                 }
     120         824 :                 NDR_ZERO_STRUCT(r2->out);
     121         824 :                 r2->out.return_authenticator = r2->in.return_authenticator;
     122         824 :                 r2->out.validation = talloc_zero(r2, union netr_Validation);
     123         824 :                 if (r2->out.validation == NULL) {
     124           0 :                         status = NT_STATUS_NO_MEMORY;
     125           0 :                         p->fault_state = DCERPC_FAULT_CANT_PERFORM;
     126           0 :                         goto fail;
     127             :                 }
     128             : 
     129         824 :                 r2->out.authoritative = talloc_zero(r2, uint8_t);
     130         824 :                 if (r2->out.authoritative == NULL) {
     131           0 :                         status = NT_STATUS_NO_MEMORY;
     132           0 :                         p->fault_state = DCERPC_FAULT_CANT_PERFORM;
     133           0 :                         goto fail;
     134             :                 }
     135             : 
     136         824 :                 r2->out.result = _netr_LogonSamLogon(p, r2);
     137         824 :                 break;
     138             :         }
     139           0 :         case 3: { /* netr_LogonSamLogoff */
     140           0 :                 struct netr_LogonSamLogoff *r2 = (struct netr_LogonSamLogoff *)r;
     141           0 :                 if (DEBUGLEVEL >= 10) {
     142           0 :                         NDR_PRINT_FUNCTION_DEBUG(netr_LogonSamLogoff, NDR_IN, r2);
     143             :                 }
     144           0 :                 NDR_ZERO_STRUCT(r2->out);
     145           0 :                 r2->out.return_authenticator = r2->in.return_authenticator;
     146           0 :                 r2->out.result = _netr_LogonSamLogoff(p, r2);
     147           0 :                 break;
     148             :         }
     149        2115 :         case 4: { /* netr_ServerReqChallenge */
     150        2115 :                 struct netr_ServerReqChallenge *r2 = (struct netr_ServerReqChallenge *)r;
     151        2115 :                 if (DEBUGLEVEL >= 10) {
     152           0 :                         NDR_PRINT_FUNCTION_DEBUG(netr_ServerReqChallenge, NDR_IN, r2);
     153             :                 }
     154        2115 :                 NDR_ZERO_STRUCT(r2->out);
     155        2115 :                 r2->out.return_credentials = talloc_zero(r2, struct netr_Credential);
     156        2115 :                 if (r2->out.return_credentials == NULL) {
     157           0 :                         status = NT_STATUS_NO_MEMORY;
     158           0 :                         p->fault_state = DCERPC_FAULT_CANT_PERFORM;
     159           0 :                         goto fail;
     160             :                 }
     161             : 
     162        2115 :                 r2->out.result = _netr_ServerReqChallenge(p, r2);
     163        2115 :                 break;
     164             :         }
     165           0 :         case 5: { /* netr_ServerAuthenticate */
     166           0 :                 struct netr_ServerAuthenticate *r2 = (struct netr_ServerAuthenticate *)r;
     167           0 :                 if (DEBUGLEVEL >= 10) {
     168           0 :                         NDR_PRINT_FUNCTION_DEBUG(netr_ServerAuthenticate, NDR_IN, r2);
     169             :                 }
     170           0 :                 NDR_ZERO_STRUCT(r2->out);
     171           0 :                 r2->out.return_credentials = talloc_zero(r2, struct netr_Credential);
     172           0 :                 if (r2->out.return_credentials == NULL) {
     173           0 :                         status = NT_STATUS_NO_MEMORY;
     174           0 :                         p->fault_state = DCERPC_FAULT_CANT_PERFORM;
     175           0 :                         goto fail;
     176             :                 }
     177             : 
     178           0 :                 r2->out.result = _netr_ServerAuthenticate(p, r2);
     179           0 :                 break;
     180             :         }
     181          12 :         case 6: { /* netr_ServerPasswordSet */
     182          12 :                 struct netr_ServerPasswordSet *r2 = (struct netr_ServerPasswordSet *)r;
     183          12 :                 if (DEBUGLEVEL >= 10) {
     184           0 :                         NDR_PRINT_FUNCTION_DEBUG(netr_ServerPasswordSet, NDR_IN, r2);
     185             :                 }
     186          12 :                 NDR_ZERO_STRUCT(r2->out);
     187          12 :                 r2->out.return_authenticator = talloc_zero(r2, struct netr_Authenticator);
     188          12 :                 if (r2->out.return_authenticator == NULL) {
     189           0 :                         status = NT_STATUS_NO_MEMORY;
     190           0 :                         p->fault_state = DCERPC_FAULT_CANT_PERFORM;
     191           0 :                         goto fail;
     192             :                 }
     193             : 
     194          12 :                 r2->out.result = _netr_ServerPasswordSet(p, r2);
     195          12 :                 break;
     196             :         }
     197           0 :         case 7: { /* netr_DatabaseDeltas */
     198           0 :                 struct netr_DatabaseDeltas *r2 = (struct netr_DatabaseDeltas *)r;
     199           0 :                 if (DEBUGLEVEL >= 10) {
     200           0 :                         NDR_PRINT_FUNCTION_DEBUG(netr_DatabaseDeltas, NDR_IN, r2);
     201             :                 }
     202           0 :                 NDR_ZERO_STRUCT(r2->out);
     203           0 :                 r2->out.return_authenticator = r2->in.return_authenticator;
     204           0 :                 r2->out.sequence_num = r2->in.sequence_num;
     205           0 :                 r2->out.delta_enum_array = talloc_zero(r2, struct netr_DELTA_ENUM_ARRAY *);
     206           0 :                 if (r2->out.delta_enum_array == NULL) {
     207           0 :                         status = NT_STATUS_NO_MEMORY;
     208           0 :                         p->fault_state = DCERPC_FAULT_CANT_PERFORM;
     209           0 :                         goto fail;
     210             :                 }
     211             : 
     212           0 :                 r2->out.result = _netr_DatabaseDeltas(p, r2);
     213           0 :                 break;
     214             :         }
     215           0 :         case 8: { /* netr_DatabaseSync */
     216           0 :                 struct netr_DatabaseSync *r2 = (struct netr_DatabaseSync *)r;
     217           0 :                 if (DEBUGLEVEL >= 10) {
     218           0 :                         NDR_PRINT_FUNCTION_DEBUG(netr_DatabaseSync, NDR_IN, r2);
     219             :                 }
     220           0 :                 NDR_ZERO_STRUCT(r2->out);
     221           0 :                 r2->out.return_authenticator = r2->in.return_authenticator;
     222           0 :                 r2->out.sync_context = r2->in.sync_context;
     223           0 :                 r2->out.delta_enum_array = talloc_zero(r2, struct netr_DELTA_ENUM_ARRAY *);
     224           0 :                 if (r2->out.delta_enum_array == NULL) {
     225           0 :                         status = NT_STATUS_NO_MEMORY;
     226           0 :                         p->fault_state = DCERPC_FAULT_CANT_PERFORM;
     227           0 :                         goto fail;
     228             :                 }
     229             : 
     230           0 :                 r2->out.result = _netr_DatabaseSync(p, r2);
     231           0 :                 break;
     232             :         }
     233           0 :         case 9: { /* netr_AccountDeltas */
     234           0 :                 struct netr_AccountDeltas *r2 = (struct netr_AccountDeltas *)r;
     235           0 :                 if (DEBUGLEVEL >= 10) {
     236           0 :                         NDR_PRINT_FUNCTION_DEBUG(netr_AccountDeltas, NDR_IN, r2);
     237             :                 }
     238           0 :                 NDR_ZERO_STRUCT(r2->out);
     239           0 :                 r2->out.return_authenticator = r2->in.return_authenticator;
     240           0 :                 r2->out.buffer = talloc_zero(r2, struct netr_AccountBuffer);
     241           0 :                 if (r2->out.buffer == NULL) {
     242           0 :                         status = NT_STATUS_NO_MEMORY;
     243           0 :                         p->fault_state = DCERPC_FAULT_CANT_PERFORM;
     244           0 :                         goto fail;
     245             :                 }
     246             : 
     247           0 :                 r2->out.count_returned = talloc_zero(r2, uint32_t);
     248           0 :                 if (r2->out.count_returned == NULL) {
     249           0 :                         status = NT_STATUS_NO_MEMORY;
     250           0 :                         p->fault_state = DCERPC_FAULT_CANT_PERFORM;
     251           0 :                         goto fail;
     252             :                 }
     253             : 
     254           0 :                 r2->out.total_entries = talloc_zero(r2, uint32_t);
     255           0 :                 if (r2->out.total_entries == NULL) {
     256           0 :                         status = NT_STATUS_NO_MEMORY;
     257           0 :                         p->fault_state = DCERPC_FAULT_CANT_PERFORM;
     258           0 :                         goto fail;
     259             :                 }
     260             : 
     261           0 :                 r2->out.recordid = talloc_zero(r2, struct netr_UAS_INFO_0);
     262           0 :                 if (r2->out.recordid == NULL) {
     263           0 :                         status = NT_STATUS_NO_MEMORY;
     264           0 :                         p->fault_state = DCERPC_FAULT_CANT_PERFORM;
     265           0 :                         goto fail;
     266             :                 }
     267             : 
     268           0 :                 r2->out.result = _netr_AccountDeltas(p, r2);
     269           0 :                 break;
     270             :         }
     271           0 :         case 10: { /* netr_AccountSync */
     272           0 :                 struct netr_AccountSync *r2 = (struct netr_AccountSync *)r;
     273           0 :                 if (DEBUGLEVEL >= 10) {
     274           0 :                         NDR_PRINT_FUNCTION_DEBUG(netr_AccountSync, NDR_IN, r2);
     275             :                 }
     276           0 :                 NDR_ZERO_STRUCT(r2->out);
     277           0 :                 r2->out.return_authenticator = r2->in.return_authenticator;
     278           0 :                 r2->out.recordid = r2->in.recordid;
     279           0 :                 r2->out.buffer = talloc_zero(r2, struct netr_AccountBuffer);
     280           0 :                 if (r2->out.buffer == NULL) {
     281           0 :                         status = NT_STATUS_NO_MEMORY;
     282           0 :                         p->fault_state = DCERPC_FAULT_CANT_PERFORM;
     283           0 :                         goto fail;
     284             :                 }
     285             : 
     286           0 :                 r2->out.count_returned = talloc_zero(r2, uint32_t);
     287           0 :                 if (r2->out.count_returned == NULL) {
     288           0 :                         status = NT_STATUS_NO_MEMORY;
     289           0 :                         p->fault_state = DCERPC_FAULT_CANT_PERFORM;
     290           0 :                         goto fail;
     291             :                 }
     292             : 
     293           0 :                 r2->out.total_entries = talloc_zero(r2, uint32_t);
     294           0 :                 if (r2->out.total_entries == NULL) {
     295           0 :                         status = NT_STATUS_NO_MEMORY;
     296           0 :                         p->fault_state = DCERPC_FAULT_CANT_PERFORM;
     297           0 :                         goto fail;
     298             :                 }
     299             : 
     300           0 :                 r2->out.next_reference = talloc_zero(r2, uint32_t);
     301           0 :                 if (r2->out.next_reference == NULL) {
     302           0 :                         status = NT_STATUS_NO_MEMORY;
     303           0 :                         p->fault_state = DCERPC_FAULT_CANT_PERFORM;
     304           0 :                         goto fail;
     305             :                 }
     306             : 
     307           0 :                 r2->out.result = _netr_AccountSync(p, r2);
     308           0 :                 break;
     309             :         }
     310           0 :         case 11: { /* netr_GetDcName */
     311           0 :                 struct netr_GetDcName *r2 = (struct netr_GetDcName *)r;
     312           0 :                 if (DEBUGLEVEL >= 10) {
     313           0 :                         NDR_PRINT_FUNCTION_DEBUG(netr_GetDcName, NDR_IN, r2);
     314             :                 }
     315           0 :                 NDR_ZERO_STRUCT(r2->out);
     316           0 :                 r2->out.dcname = talloc_zero(r2, const char *);
     317           0 :                 if (r2->out.dcname == NULL) {
     318           0 :                         status = NT_STATUS_NO_MEMORY;
     319           0 :                         p->fault_state = DCERPC_FAULT_CANT_PERFORM;
     320           0 :                         goto fail;
     321             :                 }
     322             : 
     323           0 :                 r2->out.result = _netr_GetDcName(p, r2);
     324           0 :                 break;
     325             :         }
     326         396 :         case 12: { /* netr_LogonControl */
     327         396 :                 struct netr_LogonControl *r2 = (struct netr_LogonControl *)r;
     328         396 :                 if (DEBUGLEVEL >= 10) {
     329           0 :                         NDR_PRINT_FUNCTION_DEBUG(netr_LogonControl, NDR_IN, r2);
     330             :                 }
     331         396 :                 NDR_ZERO_STRUCT(r2->out);
     332         396 :                 r2->out.query = talloc_zero(r2, union netr_CONTROL_QUERY_INFORMATION);
     333         396 :                 if (r2->out.query == NULL) {
     334           0 :                         status = NT_STATUS_NO_MEMORY;
     335           0 :                         p->fault_state = DCERPC_FAULT_CANT_PERFORM;
     336           0 :                         goto fail;
     337             :                 }
     338             : 
     339         396 :                 r2->out.result = _netr_LogonControl(p, r2);
     340         396 :                 break;
     341             :         }
     342           0 :         case 13: { /* netr_GetAnyDCName */
     343           0 :                 struct netr_GetAnyDCName *r2 = (struct netr_GetAnyDCName *)r;
     344           0 :                 if (DEBUGLEVEL >= 10) {
     345           0 :                         NDR_PRINT_FUNCTION_DEBUG(netr_GetAnyDCName, NDR_IN, r2);
     346             :                 }
     347           0 :                 NDR_ZERO_STRUCT(r2->out);
     348           0 :                 r2->out.dcname = talloc_zero(r2, const char *);
     349           0 :                 if (r2->out.dcname == NULL) {
     350           0 :                         status = NT_STATUS_NO_MEMORY;
     351           0 :                         p->fault_state = DCERPC_FAULT_CANT_PERFORM;
     352           0 :                         goto fail;
     353             :                 }
     354             : 
     355           0 :                 r2->out.result = _netr_GetAnyDCName(p, r2);
     356           0 :                 break;
     357             :         }
     358          84 :         case 14: { /* netr_LogonControl2 */
     359          84 :                 struct netr_LogonControl2 *r2 = (struct netr_LogonControl2 *)r;
     360          84 :                 if (DEBUGLEVEL >= 10) {
     361           0 :                         NDR_PRINT_FUNCTION_DEBUG(netr_LogonControl2, NDR_IN, r2);
     362             :                 }
     363          84 :                 NDR_ZERO_STRUCT(r2->out);
     364          84 :                 r2->out.query = talloc_zero(r2, union netr_CONTROL_QUERY_INFORMATION);
     365          84 :                 if (r2->out.query == NULL) {
     366           0 :                         status = NT_STATUS_NO_MEMORY;
     367           0 :                         p->fault_state = DCERPC_FAULT_CANT_PERFORM;
     368           0 :                         goto fail;
     369             :                 }
     370             : 
     371          84 :                 r2->out.result = _netr_LogonControl2(p, r2);
     372          84 :                 break;
     373             :         }
     374          62 :         case 15: { /* netr_ServerAuthenticate2 */
     375          62 :                 struct netr_ServerAuthenticate2 *r2 = (struct netr_ServerAuthenticate2 *)r;
     376          62 :                 if (DEBUGLEVEL >= 10) {
     377           0 :                         NDR_PRINT_FUNCTION_DEBUG(netr_ServerAuthenticate2, NDR_IN, r2);
     378             :                 }
     379          62 :                 NDR_ZERO_STRUCT(r2->out);
     380          62 :                 r2->out.negotiate_flags = r2->in.negotiate_flags;
     381          62 :                 r2->out.return_credentials = talloc_zero(r2, struct netr_Credential);
     382          62 :                 if (r2->out.return_credentials == NULL) {
     383           0 :                         status = NT_STATUS_NO_MEMORY;
     384           0 :                         p->fault_state = DCERPC_FAULT_CANT_PERFORM;
     385           0 :                         goto fail;
     386             :                 }
     387             : 
     388          62 :                 r2->out.result = _netr_ServerAuthenticate2(p, r2);
     389          62 :                 break;
     390             :         }
     391           0 :         case 16: { /* netr_DatabaseSync2 */
     392           0 :                 struct netr_DatabaseSync2 *r2 = (struct netr_DatabaseSync2 *)r;
     393           0 :                 if (DEBUGLEVEL >= 10) {
     394           0 :                         NDR_PRINT_FUNCTION_DEBUG(netr_DatabaseSync2, NDR_IN, r2);
     395             :                 }
     396           0 :                 NDR_ZERO_STRUCT(r2->out);
     397           0 :                 r2->out.return_authenticator = r2->in.return_authenticator;
     398           0 :                 r2->out.sync_context = r2->in.sync_context;
     399           0 :                 r2->out.delta_enum_array = talloc_zero(r2, struct netr_DELTA_ENUM_ARRAY *);
     400           0 :                 if (r2->out.delta_enum_array == NULL) {
     401           0 :                         status = NT_STATUS_NO_MEMORY;
     402           0 :                         p->fault_state = DCERPC_FAULT_CANT_PERFORM;
     403           0 :                         goto fail;
     404             :                 }
     405             : 
     406           0 :                 r2->out.result = _netr_DatabaseSync2(p, r2);
     407           0 :                 break;
     408             :         }
     409           0 :         case 17: { /* netr_DatabaseRedo */
     410           0 :                 struct netr_DatabaseRedo *r2 = (struct netr_DatabaseRedo *)r;
     411           0 :                 if (DEBUGLEVEL >= 10) {
     412           0 :                         NDR_PRINT_FUNCTION_DEBUG(netr_DatabaseRedo, NDR_IN, r2);
     413             :                 }
     414           0 :                 NDR_ZERO_STRUCT(r2->out);
     415           0 :                 r2->out.return_authenticator = r2->in.return_authenticator;
     416           0 :                 r2->out.delta_enum_array = talloc_zero(r2, struct netr_DELTA_ENUM_ARRAY *);
     417           0 :                 if (r2->out.delta_enum_array == NULL) {
     418           0 :                         status = NT_STATUS_NO_MEMORY;
     419           0 :                         p->fault_state = DCERPC_FAULT_CANT_PERFORM;
     420           0 :                         goto fail;
     421             :                 }
     422             : 
     423           0 :                 r2->out.result = _netr_DatabaseRedo(p, r2);
     424           0 :                 break;
     425             :         }
     426          84 :         case 18: { /* netr_LogonControl2Ex */
     427          84 :                 struct netr_LogonControl2Ex *r2 = (struct netr_LogonControl2Ex *)r;
     428          84 :                 if (DEBUGLEVEL >= 10) {
     429           0 :                         NDR_PRINT_FUNCTION_DEBUG(netr_LogonControl2Ex, NDR_IN, r2);
     430             :                 }
     431          84 :                 NDR_ZERO_STRUCT(r2->out);
     432          84 :                 r2->out.query = talloc_zero(r2, union netr_CONTROL_QUERY_INFORMATION);
     433          84 :                 if (r2->out.query == NULL) {
     434           0 :                         status = NT_STATUS_NO_MEMORY;
     435           0 :                         p->fault_state = DCERPC_FAULT_CANT_PERFORM;
     436           0 :                         goto fail;
     437             :                 }
     438             : 
     439          84 :                 r2->out.result = _netr_LogonControl2Ex(p, r2);
     440          84 :                 break;
     441             :         }
     442           0 :         case 19: { /* netr_NetrEnumerateTrustedDomains */
     443           0 :                 struct netr_NetrEnumerateTrustedDomains *r2 = (struct netr_NetrEnumerateTrustedDomains *)r;
     444           0 :                 if (DEBUGLEVEL >= 10) {
     445           0 :                         NDR_PRINT_FUNCTION_DEBUG(netr_NetrEnumerateTrustedDomains, NDR_IN, r2);
     446             :                 }
     447           0 :                 NDR_ZERO_STRUCT(r2->out);
     448           0 :                 r2->out.trusted_domains_blob = talloc_zero(r2, struct netr_Blob);
     449           0 :                 if (r2->out.trusted_domains_blob == NULL) {
     450           0 :                         status = NT_STATUS_NO_MEMORY;
     451           0 :                         p->fault_state = DCERPC_FAULT_CANT_PERFORM;
     452           0 :                         goto fail;
     453             :                 }
     454             : 
     455           0 :                 r2->out.result = _netr_NetrEnumerateTrustedDomains(p, r2);
     456           0 :                 break;
     457             :         }
     458           0 :         case 20: { /* netr_DsRGetDCName */
     459           0 :                 struct netr_DsRGetDCName *r2 = (struct netr_DsRGetDCName *)r;
     460           0 :                 if (DEBUGLEVEL >= 10) {
     461           0 :                         NDR_PRINT_FUNCTION_DEBUG(netr_DsRGetDCName, NDR_IN, r2);
     462             :                 }
     463           0 :                 NDR_ZERO_STRUCT(r2->out);
     464           0 :                 r2->out.info = talloc_zero(r2, struct netr_DsRGetDCNameInfo *);
     465           0 :                 if (r2->out.info == NULL) {
     466           0 :                         status = NT_STATUS_NO_MEMORY;
     467           0 :                         p->fault_state = DCERPC_FAULT_CANT_PERFORM;
     468           0 :                         goto fail;
     469             :                 }
     470             : 
     471           0 :                 r2->out.result = _netr_DsRGetDCName(p, r2);
     472           0 :                 break;
     473             :         }
     474         246 :         case 21: { /* netr_LogonGetCapabilities */
     475         246 :                 struct netr_LogonGetCapabilities *r2 = (struct netr_LogonGetCapabilities *)r;
     476         246 :                 if (DEBUGLEVEL >= 10) {
     477           0 :                         NDR_PRINT_FUNCTION_DEBUG(netr_LogonGetCapabilities, NDR_IN, r2);
     478             :                 }
     479         246 :                 NDR_ZERO_STRUCT(r2->out);
     480         246 :                 r2->out.return_authenticator = r2->in.return_authenticator;
     481         246 :                 r2->out.capabilities = talloc_zero(r2, union netr_Capabilities);
     482         246 :                 if (r2->out.capabilities == NULL) {
     483           0 :                         status = NT_STATUS_NO_MEMORY;
     484           0 :                         p->fault_state = DCERPC_FAULT_CANT_PERFORM;
     485           0 :                         goto fail;
     486             :                 }
     487             : 
     488         246 :                 r2->out.result = _netr_LogonGetCapabilities(p, r2);
     489         246 :                 break;
     490             :         }
     491           0 :         case 22: { /* netr_NETRLOGONSETSERVICEBITS */
     492           0 :                 struct netr_NETRLOGONSETSERVICEBITS *r2 = (struct netr_NETRLOGONSETSERVICEBITS *)r;
     493           0 :                 if (DEBUGLEVEL >= 10) {
     494           0 :                         NDR_PRINT_FUNCTION_DEBUG(netr_NETRLOGONSETSERVICEBITS, NDR_IN, r2);
     495             :                 }
     496           0 :                 r2->out.result = _netr_NETRLOGONSETSERVICEBITS(p, r2);
     497           0 :                 break;
     498             :         }
     499           0 :         case 23: { /* netr_LogonGetTrustRid */
     500           0 :                 struct netr_LogonGetTrustRid *r2 = (struct netr_LogonGetTrustRid *)r;
     501           0 :                 if (DEBUGLEVEL >= 10) {
     502           0 :                         NDR_PRINT_FUNCTION_DEBUG(netr_LogonGetTrustRid, NDR_IN, r2);
     503             :                 }
     504           0 :                 NDR_ZERO_STRUCT(r2->out);
     505           0 :                 r2->out.rid = talloc_zero(r2, uint32_t);
     506           0 :                 if (r2->out.rid == NULL) {
     507           0 :                         status = NT_STATUS_NO_MEMORY;
     508           0 :                         p->fault_state = DCERPC_FAULT_CANT_PERFORM;
     509           0 :                         goto fail;
     510             :                 }
     511             : 
     512           0 :                 r2->out.result = _netr_LogonGetTrustRid(p, r2);
     513           0 :                 break;
     514             :         }
     515           0 :         case 24: { /* netr_NETRLOGONCOMPUTESERVERDIGEST */
     516           0 :                 struct netr_NETRLOGONCOMPUTESERVERDIGEST *r2 = (struct netr_NETRLOGONCOMPUTESERVERDIGEST *)r;
     517           0 :                 if (DEBUGLEVEL >= 10) {
     518           0 :                         NDR_PRINT_FUNCTION_DEBUG(netr_NETRLOGONCOMPUTESERVERDIGEST, NDR_IN, r2);
     519             :                 }
     520           0 :                 r2->out.result = _netr_NETRLOGONCOMPUTESERVERDIGEST(p, r2);
     521           0 :                 break;
     522             :         }
     523           0 :         case 25: { /* netr_NETRLOGONCOMPUTECLIENTDIGEST */
     524           0 :                 struct netr_NETRLOGONCOMPUTECLIENTDIGEST *r2 = (struct netr_NETRLOGONCOMPUTECLIENTDIGEST *)r;
     525           0 :                 if (DEBUGLEVEL >= 10) {
     526           0 :                         NDR_PRINT_FUNCTION_DEBUG(netr_NETRLOGONCOMPUTECLIENTDIGEST, NDR_IN, r2);
     527             :                 }
     528           0 :                 r2->out.result = _netr_NETRLOGONCOMPUTECLIENTDIGEST(p, r2);
     529           0 :                 break;
     530             :         }
     531          86 :         case 26: { /* netr_ServerAuthenticate3 */
     532          86 :                 struct netr_ServerAuthenticate3 *r2 = (struct netr_ServerAuthenticate3 *)r;
     533          86 :                 if (DEBUGLEVEL >= 10) {
     534           0 :                         NDR_PRINT_FUNCTION_DEBUG(netr_ServerAuthenticate3, NDR_IN, r2);
     535             :                 }
     536          86 :                 NDR_ZERO_STRUCT(r2->out);
     537          86 :                 r2->out.negotiate_flags = r2->in.negotiate_flags;
     538          86 :                 r2->out.return_credentials = talloc_zero(r2, struct netr_Credential);
     539          86 :                 if (r2->out.return_credentials == NULL) {
     540           0 :                         status = NT_STATUS_NO_MEMORY;
     541           0 :                         p->fault_state = DCERPC_FAULT_CANT_PERFORM;
     542           0 :                         goto fail;
     543             :                 }
     544             : 
     545          86 :                 r2->out.rid = talloc_zero(r2, uint32_t);
     546          86 :                 if (r2->out.rid == NULL) {
     547           0 :                         status = NT_STATUS_NO_MEMORY;
     548           0 :                         p->fault_state = DCERPC_FAULT_CANT_PERFORM;
     549           0 :                         goto fail;
     550             :                 }
     551             : 
     552          86 :                 r2->out.result = _netr_ServerAuthenticate3(p, r2);
     553          86 :                 break;
     554             :         }
     555           0 :         case 27: { /* netr_DsRGetDCNameEx */
     556           0 :                 struct netr_DsRGetDCNameEx *r2 = (struct netr_DsRGetDCNameEx *)r;
     557           0 :                 if (DEBUGLEVEL >= 10) {
     558           0 :                         NDR_PRINT_FUNCTION_DEBUG(netr_DsRGetDCNameEx, NDR_IN, r2);
     559             :                 }
     560           0 :                 NDR_ZERO_STRUCT(r2->out);
     561           0 :                 r2->out.info = talloc_zero(r2, struct netr_DsRGetDCNameInfo *);
     562           0 :                 if (r2->out.info == NULL) {
     563           0 :                         status = NT_STATUS_NO_MEMORY;
     564           0 :                         p->fault_state = DCERPC_FAULT_CANT_PERFORM;
     565           0 :                         goto fail;
     566             :                 }
     567             : 
     568           0 :                 r2->out.result = _netr_DsRGetDCNameEx(p, r2);
     569           0 :                 break;
     570             :         }
     571           0 :         case 28: { /* netr_DsRGetSiteName */
     572           0 :                 struct netr_DsRGetSiteName *r2 = (struct netr_DsRGetSiteName *)r;
     573           0 :                 if (DEBUGLEVEL >= 10) {
     574           0 :                         NDR_PRINT_FUNCTION_DEBUG(netr_DsRGetSiteName, NDR_IN, r2);
     575             :                 }
     576           0 :                 NDR_ZERO_STRUCT(r2->out);
     577           0 :                 r2->out.site = talloc_zero(r2, const char *);
     578           0 :                 if (r2->out.site == NULL) {
     579           0 :                         status = NT_STATUS_NO_MEMORY;
     580           0 :                         p->fault_state = DCERPC_FAULT_CANT_PERFORM;
     581           0 :                         goto fail;
     582             :                 }
     583             : 
     584           0 :                 r2->out.result = _netr_DsRGetSiteName(p, r2);
     585           0 :                 break;
     586             :         }
     587           0 :         case 29: { /* netr_LogonGetDomainInfo */
     588           0 :                 struct netr_LogonGetDomainInfo *r2 = (struct netr_LogonGetDomainInfo *)r;
     589           0 :                 if (DEBUGLEVEL >= 10) {
     590           0 :                         NDR_PRINT_FUNCTION_DEBUG(netr_LogonGetDomainInfo, NDR_IN, r2);
     591             :                 }
     592           0 :                 NDR_ZERO_STRUCT(r2->out);
     593           0 :                 r2->out.return_authenticator = r2->in.return_authenticator;
     594           0 :                 r2->out.info = talloc_zero(r2, union netr_DomainInfo);
     595           0 :                 if (r2->out.info == NULL) {
     596           0 :                         status = NT_STATUS_NO_MEMORY;
     597           0 :                         p->fault_state = DCERPC_FAULT_CANT_PERFORM;
     598           0 :                         goto fail;
     599             :                 }
     600             : 
     601           0 :                 r2->out.result = _netr_LogonGetDomainInfo(p, r2);
     602           0 :                 break;
     603             :         }
     604          32 :         case 30: { /* netr_ServerPasswordSet2 */
     605          32 :                 struct netr_ServerPasswordSet2 *r2 = (struct netr_ServerPasswordSet2 *)r;
     606          32 :                 if (DEBUGLEVEL >= 10) {
     607           0 :                         NDR_PRINT_FUNCTION_DEBUG(netr_ServerPasswordSet2, NDR_IN, r2);
     608             :                 }
     609          32 :                 NDR_ZERO_STRUCT(r2->out);
     610          32 :                 r2->out.return_authenticator = talloc_zero(r2, struct netr_Authenticator);
     611          32 :                 if (r2->out.return_authenticator == NULL) {
     612           0 :                         status = NT_STATUS_NO_MEMORY;
     613           0 :                         p->fault_state = DCERPC_FAULT_CANT_PERFORM;
     614           0 :                         goto fail;
     615             :                 }
     616             : 
     617          32 :                 r2->out.result = _netr_ServerPasswordSet2(p, r2);
     618          32 :                 break;
     619             :         }
     620           0 :         case 31: { /* netr_ServerPasswordGet */
     621           0 :                 struct netr_ServerPasswordGet *r2 = (struct netr_ServerPasswordGet *)r;
     622           0 :                 if (DEBUGLEVEL >= 10) {
     623           0 :                         NDR_PRINT_FUNCTION_DEBUG(netr_ServerPasswordGet, NDR_IN, r2);
     624             :                 }
     625           0 :                 NDR_ZERO_STRUCT(r2->out);
     626           0 :                 r2->out.return_authenticator = talloc_zero(r2, struct netr_Authenticator);
     627           0 :                 if (r2->out.return_authenticator == NULL) {
     628           0 :                         status = NT_STATUS_NO_MEMORY;
     629           0 :                         p->fault_state = DCERPC_FAULT_CANT_PERFORM;
     630           0 :                         goto fail;
     631             :                 }
     632             : 
     633           0 :                 r2->out.password = talloc_zero(r2, struct samr_Password);
     634           0 :                 if (r2->out.password == NULL) {
     635           0 :                         status = NT_STATUS_NO_MEMORY;
     636           0 :                         p->fault_state = DCERPC_FAULT_CANT_PERFORM;
     637           0 :                         goto fail;
     638             :                 }
     639             : 
     640           0 :                 r2->out.result = _netr_ServerPasswordGet(p, r2);
     641           0 :                 break;
     642             :         }
     643           0 :         case 32: { /* netr_NetrLogonSendToSam */
     644           0 :                 struct netr_NetrLogonSendToSam *r2 = (struct netr_NetrLogonSendToSam *)r;
     645           0 :                 if (DEBUGLEVEL >= 10) {
     646           0 :                         NDR_PRINT_FUNCTION_DEBUG(netr_NetrLogonSendToSam, NDR_IN, r2);
     647             :                 }
     648           0 :                 NDR_ZERO_STRUCT(r2->out);
     649           0 :                 r2->out.return_authenticator = talloc_zero(r2, struct netr_Authenticator);
     650           0 :                 if (r2->out.return_authenticator == NULL) {
     651           0 :                         status = NT_STATUS_NO_MEMORY;
     652           0 :                         p->fault_state = DCERPC_FAULT_CANT_PERFORM;
     653           0 :                         goto fail;
     654             :                 }
     655             : 
     656           0 :                 r2->out.result = _netr_NetrLogonSendToSam(p, r2);
     657           0 :                 break;
     658             :         }
     659           0 :         case 33: { /* netr_DsRAddressToSitenamesW */
     660           0 :                 struct netr_DsRAddressToSitenamesW *r2 = (struct netr_DsRAddressToSitenamesW *)r;
     661           0 :                 if (DEBUGLEVEL >= 10) {
     662           0 :                         NDR_PRINT_FUNCTION_DEBUG(netr_DsRAddressToSitenamesW, NDR_IN, r2);
     663             :                 }
     664           0 :                 NDR_ZERO_STRUCT(r2->out);
     665           0 :                 r2->out.ctr = talloc_zero(r2, struct netr_DsRAddressToSitenamesWCtr *);
     666           0 :                 if (r2->out.ctr == NULL) {
     667           0 :                         status = NT_STATUS_NO_MEMORY;
     668           0 :                         p->fault_state = DCERPC_FAULT_CANT_PERFORM;
     669           0 :                         goto fail;
     670             :                 }
     671             : 
     672           0 :                 r2->out.result = _netr_DsRAddressToSitenamesW(p, r2);
     673           0 :                 break;
     674             :         }
     675           0 :         case 34: { /* netr_DsRGetDCNameEx2 */
     676           0 :                 struct netr_DsRGetDCNameEx2 *r2 = (struct netr_DsRGetDCNameEx2 *)r;
     677           0 :                 if (DEBUGLEVEL >= 10) {
     678           0 :                         NDR_PRINT_FUNCTION_DEBUG(netr_DsRGetDCNameEx2, NDR_IN, r2);
     679             :                 }
     680           0 :                 NDR_ZERO_STRUCT(r2->out);
     681           0 :                 r2->out.info = talloc_zero(r2, struct netr_DsRGetDCNameInfo *);
     682           0 :                 if (r2->out.info == NULL) {
     683           0 :                         status = NT_STATUS_NO_MEMORY;
     684           0 :                         p->fault_state = DCERPC_FAULT_CANT_PERFORM;
     685           0 :                         goto fail;
     686             :                 }
     687             : 
     688           0 :                 r2->out.result = _netr_DsRGetDCNameEx2(p, r2);
     689           0 :                 break;
     690             :         }
     691           0 :         case 35: { /* netr_NETRLOGONGETTIMESERVICEPARENTDOMAIN */
     692           0 :                 struct netr_NETRLOGONGETTIMESERVICEPARENTDOMAIN *r2 = (struct netr_NETRLOGONGETTIMESERVICEPARENTDOMAIN *)r;
     693           0 :                 if (DEBUGLEVEL >= 10) {
     694           0 :                         NDR_PRINT_FUNCTION_DEBUG(netr_NETRLOGONGETTIMESERVICEPARENTDOMAIN, NDR_IN, r2);
     695             :                 }
     696           0 :                 r2->out.result = _netr_NETRLOGONGETTIMESERVICEPARENTDOMAIN(p, r2);
     697           0 :                 break;
     698             :         }
     699           0 :         case 36: { /* netr_NetrEnumerateTrustedDomainsEx */
     700           0 :                 struct netr_NetrEnumerateTrustedDomainsEx *r2 = (struct netr_NetrEnumerateTrustedDomainsEx *)r;
     701           0 :                 if (DEBUGLEVEL >= 10) {
     702           0 :                         NDR_PRINT_FUNCTION_DEBUG(netr_NetrEnumerateTrustedDomainsEx, NDR_IN, r2);
     703             :                 }
     704           0 :                 NDR_ZERO_STRUCT(r2->out);
     705           0 :                 r2->out.dom_trust_list = talloc_zero(r2, struct netr_DomainTrustList);
     706           0 :                 if (r2->out.dom_trust_list == NULL) {
     707           0 :                         status = NT_STATUS_NO_MEMORY;
     708           0 :                         p->fault_state = DCERPC_FAULT_CANT_PERFORM;
     709           0 :                         goto fail;
     710             :                 }
     711             : 
     712           0 :                 r2->out.result = _netr_NetrEnumerateTrustedDomainsEx(p, r2);
     713           0 :                 break;
     714             :         }
     715           0 :         case 37: { /* netr_DsRAddressToSitenamesExW */
     716           0 :                 struct netr_DsRAddressToSitenamesExW *r2 = (struct netr_DsRAddressToSitenamesExW *)r;
     717           0 :                 if (DEBUGLEVEL >= 10) {
     718           0 :                         NDR_PRINT_FUNCTION_DEBUG(netr_DsRAddressToSitenamesExW, NDR_IN, r2);
     719             :                 }
     720           0 :                 NDR_ZERO_STRUCT(r2->out);
     721           0 :                 r2->out.ctr = talloc_zero(r2, struct netr_DsRAddressToSitenamesExWCtr *);
     722           0 :                 if (r2->out.ctr == NULL) {
     723           0 :                         status = NT_STATUS_NO_MEMORY;
     724           0 :                         p->fault_state = DCERPC_FAULT_CANT_PERFORM;
     725           0 :                         goto fail;
     726             :                 }
     727             : 
     728           0 :                 r2->out.result = _netr_DsRAddressToSitenamesExW(p, r2);
     729           0 :                 break;
     730             :         }
     731           0 :         case 38: { /* netr_DsrGetDcSiteCoverageW */
     732           0 :                 struct netr_DsrGetDcSiteCoverageW *r2 = (struct netr_DsrGetDcSiteCoverageW *)r;
     733           0 :                 if (DEBUGLEVEL >= 10) {
     734           0 :                         NDR_PRINT_FUNCTION_DEBUG(netr_DsrGetDcSiteCoverageW, NDR_IN, r2);
     735             :                 }
     736           0 :                 NDR_ZERO_STRUCT(r2->out);
     737           0 :                 r2->out.ctr = talloc_zero(r2, struct DcSitesCtr *);
     738           0 :                 if (r2->out.ctr == NULL) {
     739           0 :                         status = NT_STATUS_NO_MEMORY;
     740           0 :                         p->fault_state = DCERPC_FAULT_CANT_PERFORM;
     741           0 :                         goto fail;
     742             :                 }
     743             : 
     744           0 :                 r2->out.result = _netr_DsrGetDcSiteCoverageW(p, r2);
     745           0 :                 break;
     746             :         }
     747        1040 :         case 39: { /* netr_LogonSamLogonEx */
     748        1040 :                 struct netr_LogonSamLogonEx *r2 = (struct netr_LogonSamLogonEx *)r;
     749        1040 :                 if (DEBUGLEVEL >= 10) {
     750           0 :                         NDR_PRINT_FUNCTION_DEBUG(netr_LogonSamLogonEx, NDR_IN, r2);
     751             :                 }
     752        1040 :                 NDR_ZERO_STRUCT(r2->out);
     753        1040 :                 r2->out.flags = r2->in.flags;
     754        1040 :                 r2->out.validation = talloc_zero(r2, union netr_Validation);
     755        1040 :                 if (r2->out.validation == NULL) {
     756           0 :                         status = NT_STATUS_NO_MEMORY;
     757           0 :                         p->fault_state = DCERPC_FAULT_CANT_PERFORM;
     758           0 :                         goto fail;
     759             :                 }
     760             : 
     761        1040 :                 r2->out.authoritative = talloc_zero(r2, uint8_t);
     762        1040 :                 if (r2->out.authoritative == NULL) {
     763           0 :                         status = NT_STATUS_NO_MEMORY;
     764           0 :                         p->fault_state = DCERPC_FAULT_CANT_PERFORM;
     765           0 :                         goto fail;
     766             :                 }
     767             : 
     768        1040 :                 r2->out.result = _netr_LogonSamLogonEx(p, r2);
     769        1040 :                 break;
     770             :         }
     771           0 :         case 40: { /* netr_DsrEnumerateDomainTrusts */
     772           0 :                 struct netr_DsrEnumerateDomainTrusts *r2 = (struct netr_DsrEnumerateDomainTrusts *)r;
     773           0 :                 if (DEBUGLEVEL >= 10) {
     774           0 :                         NDR_PRINT_FUNCTION_DEBUG(netr_DsrEnumerateDomainTrusts, NDR_IN, r2);
     775             :                 }
     776           0 :                 NDR_ZERO_STRUCT(r2->out);
     777           0 :                 r2->out.trusts = talloc_zero(r2, struct netr_DomainTrustList);
     778           0 :                 if (r2->out.trusts == NULL) {
     779           0 :                         status = NT_STATUS_NO_MEMORY;
     780           0 :                         p->fault_state = DCERPC_FAULT_CANT_PERFORM;
     781           0 :                         goto fail;
     782             :                 }
     783             : 
     784           0 :                 r2->out.result = _netr_DsrEnumerateDomainTrusts(p, r2);
     785           0 :                 break;
     786             :         }
     787           0 :         case 41: { /* netr_DsrDeregisterDNSHostRecords */
     788           0 :                 struct netr_DsrDeregisterDNSHostRecords *r2 = (struct netr_DsrDeregisterDNSHostRecords *)r;
     789           0 :                 if (DEBUGLEVEL >= 10) {
     790           0 :                         NDR_PRINT_FUNCTION_DEBUG(netr_DsrDeregisterDNSHostRecords, NDR_IN, r2);
     791             :                 }
     792           0 :                 r2->out.result = _netr_DsrDeregisterDNSHostRecords(p, r2);
     793           0 :                 break;
     794             :         }
     795           0 :         case 42: { /* netr_ServerTrustPasswordsGet */
     796           0 :                 struct netr_ServerTrustPasswordsGet *r2 = (struct netr_ServerTrustPasswordsGet *)r;
     797           0 :                 if (DEBUGLEVEL >= 10) {
     798           0 :                         NDR_PRINT_FUNCTION_DEBUG(netr_ServerTrustPasswordsGet, NDR_IN, r2);
     799             :                 }
     800           0 :                 NDR_ZERO_STRUCT(r2->out);
     801           0 :                 r2->out.return_authenticator = talloc_zero(r2, struct netr_Authenticator);
     802           0 :                 if (r2->out.return_authenticator == NULL) {
     803           0 :                         status = NT_STATUS_NO_MEMORY;
     804           0 :                         p->fault_state = DCERPC_FAULT_CANT_PERFORM;
     805           0 :                         goto fail;
     806             :                 }
     807             : 
     808           0 :                 r2->out.new_owf_password = talloc_zero(r2, struct samr_Password);
     809           0 :                 if (r2->out.new_owf_password == NULL) {
     810           0 :                         status = NT_STATUS_NO_MEMORY;
     811           0 :                         p->fault_state = DCERPC_FAULT_CANT_PERFORM;
     812           0 :                         goto fail;
     813             :                 }
     814             : 
     815           0 :                 r2->out.old_owf_password = talloc_zero(r2, struct samr_Password);
     816           0 :                 if (r2->out.old_owf_password == NULL) {
     817           0 :                         status = NT_STATUS_NO_MEMORY;
     818           0 :                         p->fault_state = DCERPC_FAULT_CANT_PERFORM;
     819           0 :                         goto fail;
     820             :                 }
     821             : 
     822           0 :                 r2->out.result = _netr_ServerTrustPasswordsGet(p, r2);
     823           0 :                 break;
     824             :         }
     825           0 :         case 43: { /* netr_DsRGetForestTrustInformation */
     826           0 :                 struct netr_DsRGetForestTrustInformation *r2 = (struct netr_DsRGetForestTrustInformation *)r;
     827           0 :                 if (DEBUGLEVEL >= 10) {
     828           0 :                         NDR_PRINT_FUNCTION_DEBUG(netr_DsRGetForestTrustInformation, NDR_IN, r2);
     829             :                 }
     830           0 :                 NDR_ZERO_STRUCT(r2->out);
     831           0 :                 r2->out.forest_trust_info = talloc_zero(r2, struct lsa_ForestTrustInformation *);
     832           0 :                 if (r2->out.forest_trust_info == NULL) {
     833           0 :                         status = NT_STATUS_NO_MEMORY;
     834           0 :                         p->fault_state = DCERPC_FAULT_CANT_PERFORM;
     835           0 :                         goto fail;
     836             :                 }
     837             : 
     838           0 :                 r2->out.result = _netr_DsRGetForestTrustInformation(p, r2);
     839           0 :                 break;
     840             :         }
     841           0 :         case 44: { /* netr_GetForestTrustInformation */
     842           0 :                 struct netr_GetForestTrustInformation *r2 = (struct netr_GetForestTrustInformation *)r;
     843           0 :                 if (DEBUGLEVEL >= 10) {
     844           0 :                         NDR_PRINT_FUNCTION_DEBUG(netr_GetForestTrustInformation, NDR_IN, r2);
     845             :                 }
     846           0 :                 NDR_ZERO_STRUCT(r2->out);
     847           0 :                 r2->out.return_authenticator = talloc_zero(r2, struct netr_Authenticator);
     848           0 :                 if (r2->out.return_authenticator == NULL) {
     849           0 :                         status = NT_STATUS_NO_MEMORY;
     850           0 :                         p->fault_state = DCERPC_FAULT_CANT_PERFORM;
     851           0 :                         goto fail;
     852             :                 }
     853             : 
     854           0 :                 r2->out.forest_trust_info = talloc_zero(r2, struct lsa_ForestTrustInformation *);
     855           0 :                 if (r2->out.forest_trust_info == NULL) {
     856           0 :                         status = NT_STATUS_NO_MEMORY;
     857           0 :                         p->fault_state = DCERPC_FAULT_CANT_PERFORM;
     858           0 :                         goto fail;
     859             :                 }
     860             : 
     861           0 :                 r2->out.result = _netr_GetForestTrustInformation(p, r2);
     862           0 :                 break;
     863             :         }
     864           0 :         case 45: { /* netr_LogonSamLogonWithFlags */
     865           0 :                 struct netr_LogonSamLogonWithFlags *r2 = (struct netr_LogonSamLogonWithFlags *)r;
     866           0 :                 if (DEBUGLEVEL >= 10) {
     867           0 :                         NDR_PRINT_FUNCTION_DEBUG(netr_LogonSamLogonWithFlags, NDR_IN, r2);
     868             :                 }
     869           0 :                 NDR_ZERO_STRUCT(r2->out);
     870           0 :                 r2->out.return_authenticator = r2->in.return_authenticator;
     871           0 :                 r2->out.flags = r2->in.flags;
     872           0 :                 r2->out.validation = talloc_zero(r2, union netr_Validation);
     873           0 :                 if (r2->out.validation == NULL) {
     874           0 :                         status = NT_STATUS_NO_MEMORY;
     875           0 :                         p->fault_state = DCERPC_FAULT_CANT_PERFORM;
     876           0 :                         goto fail;
     877             :                 }
     878             : 
     879           0 :                 r2->out.authoritative = talloc_zero(r2, uint8_t);
     880           0 :                 if (r2->out.authoritative == NULL) {
     881           0 :                         status = NT_STATUS_NO_MEMORY;
     882           0 :                         p->fault_state = DCERPC_FAULT_CANT_PERFORM;
     883           0 :                         goto fail;
     884             :                 }
     885             : 
     886           0 :                 r2->out.result = _netr_LogonSamLogonWithFlags(p, r2);
     887           0 :                 break;
     888             :         }
     889           0 :         case 46: { /* netr_ServerGetTrustInfo */
     890           0 :                 struct netr_ServerGetTrustInfo *r2 = (struct netr_ServerGetTrustInfo *)r;
     891           0 :                 if (DEBUGLEVEL >= 10) {
     892           0 :                         NDR_PRINT_FUNCTION_DEBUG(netr_ServerGetTrustInfo, NDR_IN, r2);
     893             :                 }
     894           0 :                 NDR_ZERO_STRUCT(r2->out);
     895           0 :                 r2->out.return_authenticator = talloc_zero(r2, struct netr_Authenticator);
     896           0 :                 if (r2->out.return_authenticator == NULL) {
     897           0 :                         status = NT_STATUS_NO_MEMORY;
     898           0 :                         p->fault_state = DCERPC_FAULT_CANT_PERFORM;
     899           0 :                         goto fail;
     900             :                 }
     901             : 
     902           0 :                 r2->out.new_owf_password = talloc_zero(r2, struct samr_Password);
     903           0 :                 if (r2->out.new_owf_password == NULL) {
     904           0 :                         status = NT_STATUS_NO_MEMORY;
     905           0 :                         p->fault_state = DCERPC_FAULT_CANT_PERFORM;
     906           0 :                         goto fail;
     907             :                 }
     908             : 
     909           0 :                 r2->out.old_owf_password = talloc_zero(r2, struct samr_Password);
     910           0 :                 if (r2->out.old_owf_password == NULL) {
     911           0 :                         status = NT_STATUS_NO_MEMORY;
     912           0 :                         p->fault_state = DCERPC_FAULT_CANT_PERFORM;
     913           0 :                         goto fail;
     914             :                 }
     915             : 
     916           0 :                 r2->out.trust_info = talloc_zero(r2, struct netr_TrustInfo *);
     917           0 :                 if (r2->out.trust_info == NULL) {
     918           0 :                         status = NT_STATUS_NO_MEMORY;
     919           0 :                         p->fault_state = DCERPC_FAULT_CANT_PERFORM;
     920           0 :                         goto fail;
     921             :                 }
     922             : 
     923           0 :                 r2->out.result = _netr_ServerGetTrustInfo(p, r2);
     924           0 :                 break;
     925             :         }
     926           0 :         case 47: { /* netr_Unused47 */
     927           0 :                 struct netr_Unused47 *r2 = (struct netr_Unused47 *)r;
     928           0 :                 if (DEBUGLEVEL >= 10) {
     929           0 :                         NDR_PRINT_FUNCTION_DEBUG(netr_Unused47, NDR_IN, r2);
     930             :                 }
     931           0 :                 r2->out.result = _netr_Unused47(p, r2);
     932           0 :                 break;
     933             :         }
     934           0 :         case 48: { /* netr_DsrUpdateReadOnlyServerDnsRecords */
     935           0 :                 struct netr_DsrUpdateReadOnlyServerDnsRecords *r2 = (struct netr_DsrUpdateReadOnlyServerDnsRecords *)r;
     936           0 :                 if (DEBUGLEVEL >= 10) {
     937           0 :                         NDR_PRINT_FUNCTION_DEBUG(netr_DsrUpdateReadOnlyServerDnsRecords, NDR_IN, r2);
     938             :                 }
     939           0 :                 NDR_ZERO_STRUCT(r2->out);
     940           0 :                 r2->out.dns_names = r2->in.dns_names;
     941           0 :                 r2->out.return_authenticator = talloc_zero(r2, struct netr_Authenticator);
     942           0 :                 if (r2->out.return_authenticator == NULL) {
     943           0 :                         status = NT_STATUS_NO_MEMORY;
     944           0 :                         p->fault_state = DCERPC_FAULT_CANT_PERFORM;
     945           0 :                         goto fail;
     946             :                 }
     947             : 
     948           0 :                 r2->out.result = _netr_DsrUpdateReadOnlyServerDnsRecords(p, r2);
     949           0 :                 break;
     950             :         }
     951           0 :         default:
     952           0 :                 dce_call->fault_code = DCERPC_FAULT_OP_RNG_ERROR;
     953           0 :                 break;
     954             :         }
     955             : 
     956        4981 : fail:
     957             :         /* Unimpersonate */
     958        4981 :         if (impersonated) {
     959        4981 :                 unbecome_authenticated_pipe_user();
     960             :         }
     961             : 
     962        4981 :         p->dce_call = NULL;
     963        4981 :         p->mem_ctx = NULL;
     964             :         /* Check pipes struct fault state */
     965        4981 :         if (p->fault_state != 0) {
     966         144 :                 dce_call->fault_code = p->fault_state;
     967             :         }
     968        4981 :         if (dce_call->fault_code != 0) {
     969         144 :                 status = NT_STATUS_NET_WRITE_FAULT;
     970             :         }
     971             : 
     972        4981 :         return status;
     973             : }
     974             : 
     975        4981 : NTSTATUS netlogon__op_dispatch(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx, void *r)
     976             : {
     977        4981 :         return netlogon__op_dispatch_internal(dce_call, mem_ctx, r, S3COMPAT_RPC_DISPATCH_EXTERNAL);
     978             : }
     979             : 
     980        4837 : NTSTATUS netlogon__op_reply(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx, void *r)
     981             : {
     982        4837 :         uint16_t opnum = dce_call->pkt.u.request.opnum;
     983             : 
     984        4837 :         switch (opnum) {
     985           0 :         case 0: { /* netr_LogonUasLogon */
     986           0 :                 struct netr_LogonUasLogon *r2 = (struct netr_LogonUasLogon *)r;
     987           0 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
     988           0 :                         DEBUG(5,("function netr_LogonUasLogon replied async\n"));
     989             :                 }
     990           0 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
     991           0 :                         NDR_PRINT_FUNCTION_DEBUG(netr_LogonUasLogon, NDR_OUT | NDR_SET_VALUES, r2);
     992             :                 }
     993           0 :                 if (dce_call->fault_code != 0) {
     994           0 :                         DBG_WARNING("dcerpc_fault %s in netr_LogonUasLogon\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
     995             :                 }
     996           0 :                 break;
     997             :         }
     998           0 :         case 1: { /* netr_LogonUasLogoff */
     999           0 :                 struct netr_LogonUasLogoff *r2 = (struct netr_LogonUasLogoff *)r;
    1000           0 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
    1001           0 :                         DEBUG(5,("function netr_LogonUasLogoff replied async\n"));
    1002             :                 }
    1003           0 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
    1004           0 :                         NDR_PRINT_FUNCTION_DEBUG(netr_LogonUasLogoff, NDR_OUT | NDR_SET_VALUES, r2);
    1005             :                 }
    1006           0 :                 if (dce_call->fault_code != 0) {
    1007           0 :                         DBG_WARNING("dcerpc_fault %s in netr_LogonUasLogoff\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
    1008             :                 }
    1009           0 :                 break;
    1010             :         }
    1011         824 :         case 2: { /* netr_LogonSamLogon */
    1012         824 :                 struct netr_LogonSamLogon *r2 = (struct netr_LogonSamLogon *)r;
    1013         824 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
    1014           0 :                         DEBUG(5,("function netr_LogonSamLogon replied async\n"));
    1015             :                 }
    1016         824 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
    1017           0 :                         NDR_PRINT_FUNCTION_DEBUG(netr_LogonSamLogon, NDR_OUT | NDR_SET_VALUES, r2);
    1018             :                 }
    1019         824 :                 if (dce_call->fault_code != 0) {
    1020           0 :                         DBG_WARNING("dcerpc_fault %s in netr_LogonSamLogon\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
    1021             :                 }
    1022         824 :                 break;
    1023             :         }
    1024           0 :         case 3: { /* netr_LogonSamLogoff */
    1025           0 :                 struct netr_LogonSamLogoff *r2 = (struct netr_LogonSamLogoff *)r;
    1026           0 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
    1027           0 :                         DEBUG(5,("function netr_LogonSamLogoff replied async\n"));
    1028             :                 }
    1029           0 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
    1030           0 :                         NDR_PRINT_FUNCTION_DEBUG(netr_LogonSamLogoff, NDR_OUT | NDR_SET_VALUES, r2);
    1031             :                 }
    1032           0 :                 if (dce_call->fault_code != 0) {
    1033           0 :                         DBG_WARNING("dcerpc_fault %s in netr_LogonSamLogoff\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
    1034             :                 }
    1035           0 :                 break;
    1036             :         }
    1037        2115 :         case 4: { /* netr_ServerReqChallenge */
    1038        2115 :                 struct netr_ServerReqChallenge *r2 = (struct netr_ServerReqChallenge *)r;
    1039        2115 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
    1040           0 :                         DEBUG(5,("function netr_ServerReqChallenge replied async\n"));
    1041             :                 }
    1042        2115 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
    1043           0 :                         NDR_PRINT_FUNCTION_DEBUG(netr_ServerReqChallenge, NDR_OUT | NDR_SET_VALUES, r2);
    1044             :                 }
    1045        2115 :                 if (dce_call->fault_code != 0) {
    1046           0 :                         DBG_WARNING("dcerpc_fault %s in netr_ServerReqChallenge\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
    1047             :                 }
    1048        2115 :                 break;
    1049             :         }
    1050           0 :         case 5: { /* netr_ServerAuthenticate */
    1051           0 :                 struct netr_ServerAuthenticate *r2 = (struct netr_ServerAuthenticate *)r;
    1052           0 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
    1053           0 :                         DEBUG(5,("function netr_ServerAuthenticate replied async\n"));
    1054             :                 }
    1055           0 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
    1056           0 :                         NDR_PRINT_FUNCTION_DEBUG(netr_ServerAuthenticate, NDR_OUT | NDR_SET_VALUES, r2);
    1057             :                 }
    1058           0 :                 if (dce_call->fault_code != 0) {
    1059           0 :                         DBG_WARNING("dcerpc_fault %s in netr_ServerAuthenticate\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
    1060             :                 }
    1061           0 :                 break;
    1062             :         }
    1063          12 :         case 6: { /* netr_ServerPasswordSet */
    1064          12 :                 struct netr_ServerPasswordSet *r2 = (struct netr_ServerPasswordSet *)r;
    1065          12 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
    1066           0 :                         DEBUG(5,("function netr_ServerPasswordSet replied async\n"));
    1067             :                 }
    1068          12 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
    1069           0 :                         NDR_PRINT_FUNCTION_DEBUG(netr_ServerPasswordSet, NDR_OUT | NDR_SET_VALUES, r2);
    1070             :                 }
    1071          12 :                 if (dce_call->fault_code != 0) {
    1072           0 :                         DBG_WARNING("dcerpc_fault %s in netr_ServerPasswordSet\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
    1073             :                 }
    1074          12 :                 break;
    1075             :         }
    1076           0 :         case 7: { /* netr_DatabaseDeltas */
    1077           0 :                 struct netr_DatabaseDeltas *r2 = (struct netr_DatabaseDeltas *)r;
    1078           0 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
    1079           0 :                         DEBUG(5,("function netr_DatabaseDeltas replied async\n"));
    1080             :                 }
    1081           0 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
    1082           0 :                         NDR_PRINT_FUNCTION_DEBUG(netr_DatabaseDeltas, NDR_OUT | NDR_SET_VALUES, r2);
    1083             :                 }
    1084           0 :                 if (dce_call->fault_code != 0) {
    1085           0 :                         DBG_WARNING("dcerpc_fault %s in netr_DatabaseDeltas\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
    1086             :                 }
    1087           0 :                 break;
    1088             :         }
    1089           0 :         case 8: { /* netr_DatabaseSync */
    1090           0 :                 struct netr_DatabaseSync *r2 = (struct netr_DatabaseSync *)r;
    1091           0 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
    1092           0 :                         DEBUG(5,("function netr_DatabaseSync replied async\n"));
    1093             :                 }
    1094           0 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
    1095           0 :                         NDR_PRINT_FUNCTION_DEBUG(netr_DatabaseSync, NDR_OUT | NDR_SET_VALUES, r2);
    1096             :                 }
    1097           0 :                 if (dce_call->fault_code != 0) {
    1098           0 :                         DBG_WARNING("dcerpc_fault %s in netr_DatabaseSync\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
    1099             :                 }
    1100           0 :                 break;
    1101             :         }
    1102           0 :         case 9: { /* netr_AccountDeltas */
    1103           0 :                 struct netr_AccountDeltas *r2 = (struct netr_AccountDeltas *)r;
    1104           0 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
    1105           0 :                         DEBUG(5,("function netr_AccountDeltas replied async\n"));
    1106             :                 }
    1107           0 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
    1108           0 :                         NDR_PRINT_FUNCTION_DEBUG(netr_AccountDeltas, NDR_OUT | NDR_SET_VALUES, r2);
    1109             :                 }
    1110           0 :                 if (dce_call->fault_code != 0) {
    1111           0 :                         DBG_WARNING("dcerpc_fault %s in netr_AccountDeltas\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
    1112             :                 }
    1113           0 :                 break;
    1114             :         }
    1115           0 :         case 10: { /* netr_AccountSync */
    1116           0 :                 struct netr_AccountSync *r2 = (struct netr_AccountSync *)r;
    1117           0 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
    1118           0 :                         DEBUG(5,("function netr_AccountSync replied async\n"));
    1119             :                 }
    1120           0 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
    1121           0 :                         NDR_PRINT_FUNCTION_DEBUG(netr_AccountSync, NDR_OUT | NDR_SET_VALUES, r2);
    1122             :                 }
    1123           0 :                 if (dce_call->fault_code != 0) {
    1124           0 :                         DBG_WARNING("dcerpc_fault %s in netr_AccountSync\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
    1125             :                 }
    1126           0 :                 break;
    1127             :         }
    1128           0 :         case 11: { /* netr_GetDcName */
    1129           0 :                 struct netr_GetDcName *r2 = (struct netr_GetDcName *)r;
    1130           0 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
    1131           0 :                         DEBUG(5,("function netr_GetDcName replied async\n"));
    1132             :                 }
    1133           0 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
    1134           0 :                         NDR_PRINT_FUNCTION_DEBUG(netr_GetDcName, NDR_OUT | NDR_SET_VALUES, r2);
    1135             :                 }
    1136           0 :                 if (dce_call->fault_code != 0) {
    1137           0 :                         DBG_WARNING("dcerpc_fault %s in netr_GetDcName\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
    1138             :                 }
    1139           0 :                 break;
    1140             :         }
    1141         396 :         case 12: { /* netr_LogonControl */
    1142         396 :                 struct netr_LogonControl *r2 = (struct netr_LogonControl *)r;
    1143         396 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
    1144           0 :                         DEBUG(5,("function netr_LogonControl replied async\n"));
    1145             :                 }
    1146         396 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
    1147           0 :                         NDR_PRINT_FUNCTION_DEBUG(netr_LogonControl, NDR_OUT | NDR_SET_VALUES, r2);
    1148             :                 }
    1149         396 :                 if (dce_call->fault_code != 0) {
    1150           0 :                         DBG_WARNING("dcerpc_fault %s in netr_LogonControl\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
    1151             :                 }
    1152         396 :                 break;
    1153             :         }
    1154           0 :         case 13: { /* netr_GetAnyDCName */
    1155           0 :                 struct netr_GetAnyDCName *r2 = (struct netr_GetAnyDCName *)r;
    1156           0 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
    1157           0 :                         DEBUG(5,("function netr_GetAnyDCName replied async\n"));
    1158             :                 }
    1159           0 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
    1160           0 :                         NDR_PRINT_FUNCTION_DEBUG(netr_GetAnyDCName, NDR_OUT | NDR_SET_VALUES, r2);
    1161             :                 }
    1162           0 :                 if (dce_call->fault_code != 0) {
    1163           0 :                         DBG_WARNING("dcerpc_fault %s in netr_GetAnyDCName\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
    1164             :                 }
    1165           0 :                 break;
    1166             :         }
    1167          84 :         case 14: { /* netr_LogonControl2 */
    1168          84 :                 struct netr_LogonControl2 *r2 = (struct netr_LogonControl2 *)r;
    1169          84 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
    1170           0 :                         DEBUG(5,("function netr_LogonControl2 replied async\n"));
    1171             :                 }
    1172          84 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
    1173           0 :                         NDR_PRINT_FUNCTION_DEBUG(netr_LogonControl2, NDR_OUT | NDR_SET_VALUES, r2);
    1174             :                 }
    1175          84 :                 if (dce_call->fault_code != 0) {
    1176           0 :                         DBG_WARNING("dcerpc_fault %s in netr_LogonControl2\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
    1177             :                 }
    1178          84 :                 break;
    1179             :         }
    1180          62 :         case 15: { /* netr_ServerAuthenticate2 */
    1181          62 :                 struct netr_ServerAuthenticate2 *r2 = (struct netr_ServerAuthenticate2 *)r;
    1182          62 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
    1183           0 :                         DEBUG(5,("function netr_ServerAuthenticate2 replied async\n"));
    1184             :                 }
    1185          62 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
    1186           0 :                         NDR_PRINT_FUNCTION_DEBUG(netr_ServerAuthenticate2, NDR_OUT | NDR_SET_VALUES, r2);
    1187             :                 }
    1188          62 :                 if (dce_call->fault_code != 0) {
    1189           0 :                         DBG_WARNING("dcerpc_fault %s in netr_ServerAuthenticate2\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
    1190             :                 }
    1191          62 :                 break;
    1192             :         }
    1193           0 :         case 16: { /* netr_DatabaseSync2 */
    1194           0 :                 struct netr_DatabaseSync2 *r2 = (struct netr_DatabaseSync2 *)r;
    1195           0 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
    1196           0 :                         DEBUG(5,("function netr_DatabaseSync2 replied async\n"));
    1197             :                 }
    1198           0 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
    1199           0 :                         NDR_PRINT_FUNCTION_DEBUG(netr_DatabaseSync2, NDR_OUT | NDR_SET_VALUES, r2);
    1200             :                 }
    1201           0 :                 if (dce_call->fault_code != 0) {
    1202           0 :                         DBG_WARNING("dcerpc_fault %s in netr_DatabaseSync2\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
    1203             :                 }
    1204           0 :                 break;
    1205             :         }
    1206           0 :         case 17: { /* netr_DatabaseRedo */
    1207           0 :                 struct netr_DatabaseRedo *r2 = (struct netr_DatabaseRedo *)r;
    1208           0 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
    1209           0 :                         DEBUG(5,("function netr_DatabaseRedo replied async\n"));
    1210             :                 }
    1211           0 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
    1212           0 :                         NDR_PRINT_FUNCTION_DEBUG(netr_DatabaseRedo, NDR_OUT | NDR_SET_VALUES, r2);
    1213             :                 }
    1214           0 :                 if (dce_call->fault_code != 0) {
    1215           0 :                         DBG_WARNING("dcerpc_fault %s in netr_DatabaseRedo\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
    1216             :                 }
    1217           0 :                 break;
    1218             :         }
    1219          84 :         case 18: { /* netr_LogonControl2Ex */
    1220          84 :                 struct netr_LogonControl2Ex *r2 = (struct netr_LogonControl2Ex *)r;
    1221          84 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
    1222           0 :                         DEBUG(5,("function netr_LogonControl2Ex replied async\n"));
    1223             :                 }
    1224          84 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
    1225           0 :                         NDR_PRINT_FUNCTION_DEBUG(netr_LogonControl2Ex, NDR_OUT | NDR_SET_VALUES, r2);
    1226             :                 }
    1227          84 :                 if (dce_call->fault_code != 0) {
    1228           0 :                         DBG_WARNING("dcerpc_fault %s in netr_LogonControl2Ex\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
    1229             :                 }
    1230          84 :                 break;
    1231             :         }
    1232           0 :         case 19: { /* netr_NetrEnumerateTrustedDomains */
    1233           0 :                 struct netr_NetrEnumerateTrustedDomains *r2 = (struct netr_NetrEnumerateTrustedDomains *)r;
    1234           0 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
    1235           0 :                         DEBUG(5,("function netr_NetrEnumerateTrustedDomains replied async\n"));
    1236             :                 }
    1237           0 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
    1238           0 :                         NDR_PRINT_FUNCTION_DEBUG(netr_NetrEnumerateTrustedDomains, NDR_OUT | NDR_SET_VALUES, r2);
    1239             :                 }
    1240           0 :                 if (dce_call->fault_code != 0) {
    1241           0 :                         DBG_WARNING("dcerpc_fault %s in netr_NetrEnumerateTrustedDomains\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
    1242             :                 }
    1243           0 :                 break;
    1244             :         }
    1245           0 :         case 20: { /* netr_DsRGetDCName */
    1246           0 :                 struct netr_DsRGetDCName *r2 = (struct netr_DsRGetDCName *)r;
    1247           0 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
    1248           0 :                         DEBUG(5,("function netr_DsRGetDCName replied async\n"));
    1249             :                 }
    1250           0 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
    1251           0 :                         NDR_PRINT_FUNCTION_DEBUG(netr_DsRGetDCName, NDR_OUT | NDR_SET_VALUES, r2);
    1252             :                 }
    1253           0 :                 if (dce_call->fault_code != 0) {
    1254           0 :                         DBG_WARNING("dcerpc_fault %s in netr_DsRGetDCName\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
    1255             :                 }
    1256           0 :                 break;
    1257             :         }
    1258         102 :         case 21: { /* netr_LogonGetCapabilities */
    1259         102 :                 struct netr_LogonGetCapabilities *r2 = (struct netr_LogonGetCapabilities *)r;
    1260         102 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
    1261           0 :                         DEBUG(5,("function netr_LogonGetCapabilities replied async\n"));
    1262             :                 }
    1263         102 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
    1264           0 :                         NDR_PRINT_FUNCTION_DEBUG(netr_LogonGetCapabilities, NDR_OUT | NDR_SET_VALUES, r2);
    1265             :                 }
    1266         102 :                 if (dce_call->fault_code != 0) {
    1267           0 :                         DBG_WARNING("dcerpc_fault %s in netr_LogonGetCapabilities\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
    1268             :                 }
    1269         102 :                 break;
    1270             :         }
    1271           0 :         case 22: { /* netr_NETRLOGONSETSERVICEBITS */
    1272           0 :                 struct netr_NETRLOGONSETSERVICEBITS *r2 = (struct netr_NETRLOGONSETSERVICEBITS *)r;
    1273           0 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
    1274           0 :                         DEBUG(5,("function netr_NETRLOGONSETSERVICEBITS replied async\n"));
    1275             :                 }
    1276           0 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
    1277           0 :                         NDR_PRINT_FUNCTION_DEBUG(netr_NETRLOGONSETSERVICEBITS, NDR_OUT | NDR_SET_VALUES, r2);
    1278             :                 }
    1279           0 :                 if (dce_call->fault_code != 0) {
    1280           0 :                         DBG_WARNING("dcerpc_fault %s in netr_NETRLOGONSETSERVICEBITS\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
    1281             :                 }
    1282           0 :                 break;
    1283             :         }
    1284           0 :         case 23: { /* netr_LogonGetTrustRid */
    1285           0 :                 struct netr_LogonGetTrustRid *r2 = (struct netr_LogonGetTrustRid *)r;
    1286           0 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
    1287           0 :                         DEBUG(5,("function netr_LogonGetTrustRid replied async\n"));
    1288             :                 }
    1289           0 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
    1290           0 :                         NDR_PRINT_FUNCTION_DEBUG(netr_LogonGetTrustRid, NDR_OUT | NDR_SET_VALUES, r2);
    1291             :                 }
    1292           0 :                 if (dce_call->fault_code != 0) {
    1293           0 :                         DBG_WARNING("dcerpc_fault %s in netr_LogonGetTrustRid\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
    1294             :                 }
    1295           0 :                 break;
    1296             :         }
    1297           0 :         case 24: { /* netr_NETRLOGONCOMPUTESERVERDIGEST */
    1298           0 :                 struct netr_NETRLOGONCOMPUTESERVERDIGEST *r2 = (struct netr_NETRLOGONCOMPUTESERVERDIGEST *)r;
    1299           0 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
    1300           0 :                         DEBUG(5,("function netr_NETRLOGONCOMPUTESERVERDIGEST replied async\n"));
    1301             :                 }
    1302           0 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
    1303           0 :                         NDR_PRINT_FUNCTION_DEBUG(netr_NETRLOGONCOMPUTESERVERDIGEST, NDR_OUT | NDR_SET_VALUES, r2);
    1304             :                 }
    1305           0 :                 if (dce_call->fault_code != 0) {
    1306           0 :                         DBG_WARNING("dcerpc_fault %s in netr_NETRLOGONCOMPUTESERVERDIGEST\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
    1307             :                 }
    1308           0 :                 break;
    1309             :         }
    1310           0 :         case 25: { /* netr_NETRLOGONCOMPUTECLIENTDIGEST */
    1311           0 :                 struct netr_NETRLOGONCOMPUTECLIENTDIGEST *r2 = (struct netr_NETRLOGONCOMPUTECLIENTDIGEST *)r;
    1312           0 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
    1313           0 :                         DEBUG(5,("function netr_NETRLOGONCOMPUTECLIENTDIGEST replied async\n"));
    1314             :                 }
    1315           0 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
    1316           0 :                         NDR_PRINT_FUNCTION_DEBUG(netr_NETRLOGONCOMPUTECLIENTDIGEST, NDR_OUT | NDR_SET_VALUES, r2);
    1317             :                 }
    1318           0 :                 if (dce_call->fault_code != 0) {
    1319           0 :                         DBG_WARNING("dcerpc_fault %s in netr_NETRLOGONCOMPUTECLIENTDIGEST\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
    1320             :                 }
    1321           0 :                 break;
    1322             :         }
    1323          86 :         case 26: { /* netr_ServerAuthenticate3 */
    1324          86 :                 struct netr_ServerAuthenticate3 *r2 = (struct netr_ServerAuthenticate3 *)r;
    1325          86 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
    1326           0 :                         DEBUG(5,("function netr_ServerAuthenticate3 replied async\n"));
    1327             :                 }
    1328          86 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
    1329           0 :                         NDR_PRINT_FUNCTION_DEBUG(netr_ServerAuthenticate3, NDR_OUT | NDR_SET_VALUES, r2);
    1330             :                 }
    1331          86 :                 if (dce_call->fault_code != 0) {
    1332           0 :                         DBG_WARNING("dcerpc_fault %s in netr_ServerAuthenticate3\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
    1333             :                 }
    1334          86 :                 break;
    1335             :         }
    1336           0 :         case 27: { /* netr_DsRGetDCNameEx */
    1337           0 :                 struct netr_DsRGetDCNameEx *r2 = (struct netr_DsRGetDCNameEx *)r;
    1338           0 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
    1339           0 :                         DEBUG(5,("function netr_DsRGetDCNameEx replied async\n"));
    1340             :                 }
    1341           0 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
    1342           0 :                         NDR_PRINT_FUNCTION_DEBUG(netr_DsRGetDCNameEx, NDR_OUT | NDR_SET_VALUES, r2);
    1343             :                 }
    1344           0 :                 if (dce_call->fault_code != 0) {
    1345           0 :                         DBG_WARNING("dcerpc_fault %s in netr_DsRGetDCNameEx\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
    1346             :                 }
    1347           0 :                 break;
    1348             :         }
    1349           0 :         case 28: { /* netr_DsRGetSiteName */
    1350           0 :                 struct netr_DsRGetSiteName *r2 = (struct netr_DsRGetSiteName *)r;
    1351           0 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
    1352           0 :                         DEBUG(5,("function netr_DsRGetSiteName replied async\n"));
    1353             :                 }
    1354           0 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
    1355           0 :                         NDR_PRINT_FUNCTION_DEBUG(netr_DsRGetSiteName, NDR_OUT | NDR_SET_VALUES, r2);
    1356             :                 }
    1357           0 :                 if (dce_call->fault_code != 0) {
    1358           0 :                         DBG_WARNING("dcerpc_fault %s in netr_DsRGetSiteName\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
    1359             :                 }
    1360           0 :                 break;
    1361             :         }
    1362           0 :         case 29: { /* netr_LogonGetDomainInfo */
    1363           0 :                 struct netr_LogonGetDomainInfo *r2 = (struct netr_LogonGetDomainInfo *)r;
    1364           0 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
    1365           0 :                         DEBUG(5,("function netr_LogonGetDomainInfo replied async\n"));
    1366             :                 }
    1367           0 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
    1368           0 :                         NDR_PRINT_FUNCTION_DEBUG(netr_LogonGetDomainInfo, NDR_OUT | NDR_SET_VALUES, r2);
    1369             :                 }
    1370           0 :                 if (dce_call->fault_code != 0) {
    1371           0 :                         DBG_WARNING("dcerpc_fault %s in netr_LogonGetDomainInfo\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
    1372             :                 }
    1373           0 :                 break;
    1374             :         }
    1375          32 :         case 30: { /* netr_ServerPasswordSet2 */
    1376          32 :                 struct netr_ServerPasswordSet2 *r2 = (struct netr_ServerPasswordSet2 *)r;
    1377          32 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
    1378           0 :                         DEBUG(5,("function netr_ServerPasswordSet2 replied async\n"));
    1379             :                 }
    1380          32 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
    1381           0 :                         NDR_PRINT_FUNCTION_DEBUG(netr_ServerPasswordSet2, NDR_OUT | NDR_SET_VALUES, r2);
    1382             :                 }
    1383          32 :                 if (dce_call->fault_code != 0) {
    1384           0 :                         DBG_WARNING("dcerpc_fault %s in netr_ServerPasswordSet2\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
    1385             :                 }
    1386          32 :                 break;
    1387             :         }
    1388           0 :         case 31: { /* netr_ServerPasswordGet */
    1389           0 :                 struct netr_ServerPasswordGet *r2 = (struct netr_ServerPasswordGet *)r;
    1390           0 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
    1391           0 :                         DEBUG(5,("function netr_ServerPasswordGet replied async\n"));
    1392             :                 }
    1393           0 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
    1394           0 :                         NDR_PRINT_FUNCTION_DEBUG(netr_ServerPasswordGet, NDR_OUT | NDR_SET_VALUES, r2);
    1395             :                 }
    1396           0 :                 if (dce_call->fault_code != 0) {
    1397           0 :                         DBG_WARNING("dcerpc_fault %s in netr_ServerPasswordGet\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
    1398             :                 }
    1399           0 :                 break;
    1400             :         }
    1401           0 :         case 32: { /* netr_NetrLogonSendToSam */
    1402           0 :                 struct netr_NetrLogonSendToSam *r2 = (struct netr_NetrLogonSendToSam *)r;
    1403           0 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
    1404           0 :                         DEBUG(5,("function netr_NetrLogonSendToSam replied async\n"));
    1405             :                 }
    1406           0 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
    1407           0 :                         NDR_PRINT_FUNCTION_DEBUG(netr_NetrLogonSendToSam, NDR_OUT | NDR_SET_VALUES, r2);
    1408             :                 }
    1409           0 :                 if (dce_call->fault_code != 0) {
    1410           0 :                         DBG_WARNING("dcerpc_fault %s in netr_NetrLogonSendToSam\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
    1411             :                 }
    1412           0 :                 break;
    1413             :         }
    1414           0 :         case 33: { /* netr_DsRAddressToSitenamesW */
    1415           0 :                 struct netr_DsRAddressToSitenamesW *r2 = (struct netr_DsRAddressToSitenamesW *)r;
    1416           0 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
    1417           0 :                         DEBUG(5,("function netr_DsRAddressToSitenamesW replied async\n"));
    1418             :                 }
    1419           0 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
    1420           0 :                         NDR_PRINT_FUNCTION_DEBUG(netr_DsRAddressToSitenamesW, NDR_OUT | NDR_SET_VALUES, r2);
    1421             :                 }
    1422           0 :                 if (dce_call->fault_code != 0) {
    1423           0 :                         DBG_WARNING("dcerpc_fault %s in netr_DsRAddressToSitenamesW\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
    1424             :                 }
    1425           0 :                 break;
    1426             :         }
    1427           0 :         case 34: { /* netr_DsRGetDCNameEx2 */
    1428           0 :                 struct netr_DsRGetDCNameEx2 *r2 = (struct netr_DsRGetDCNameEx2 *)r;
    1429           0 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
    1430           0 :                         DEBUG(5,("function netr_DsRGetDCNameEx2 replied async\n"));
    1431             :                 }
    1432           0 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
    1433           0 :                         NDR_PRINT_FUNCTION_DEBUG(netr_DsRGetDCNameEx2, NDR_OUT | NDR_SET_VALUES, r2);
    1434             :                 }
    1435           0 :                 if (dce_call->fault_code != 0) {
    1436           0 :                         DBG_WARNING("dcerpc_fault %s in netr_DsRGetDCNameEx2\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
    1437             :                 }
    1438           0 :                 break;
    1439             :         }
    1440           0 :         case 35: { /* netr_NETRLOGONGETTIMESERVICEPARENTDOMAIN */
    1441           0 :                 struct netr_NETRLOGONGETTIMESERVICEPARENTDOMAIN *r2 = (struct netr_NETRLOGONGETTIMESERVICEPARENTDOMAIN *)r;
    1442           0 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
    1443           0 :                         DEBUG(5,("function netr_NETRLOGONGETTIMESERVICEPARENTDOMAIN replied async\n"));
    1444             :                 }
    1445           0 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
    1446           0 :                         NDR_PRINT_FUNCTION_DEBUG(netr_NETRLOGONGETTIMESERVICEPARENTDOMAIN, NDR_OUT | NDR_SET_VALUES, r2);
    1447             :                 }
    1448           0 :                 if (dce_call->fault_code != 0) {
    1449           0 :                         DBG_WARNING("dcerpc_fault %s in netr_NETRLOGONGETTIMESERVICEPARENTDOMAIN\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
    1450             :                 }
    1451           0 :                 break;
    1452             :         }
    1453           0 :         case 36: { /* netr_NetrEnumerateTrustedDomainsEx */
    1454           0 :                 struct netr_NetrEnumerateTrustedDomainsEx *r2 = (struct netr_NetrEnumerateTrustedDomainsEx *)r;
    1455           0 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
    1456           0 :                         DEBUG(5,("function netr_NetrEnumerateTrustedDomainsEx replied async\n"));
    1457             :                 }
    1458           0 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
    1459           0 :                         NDR_PRINT_FUNCTION_DEBUG(netr_NetrEnumerateTrustedDomainsEx, NDR_OUT | NDR_SET_VALUES, r2);
    1460             :                 }
    1461           0 :                 if (dce_call->fault_code != 0) {
    1462           0 :                         DBG_WARNING("dcerpc_fault %s in netr_NetrEnumerateTrustedDomainsEx\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
    1463             :                 }
    1464           0 :                 break;
    1465             :         }
    1466           0 :         case 37: { /* netr_DsRAddressToSitenamesExW */
    1467           0 :                 struct netr_DsRAddressToSitenamesExW *r2 = (struct netr_DsRAddressToSitenamesExW *)r;
    1468           0 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
    1469           0 :                         DEBUG(5,("function netr_DsRAddressToSitenamesExW replied async\n"));
    1470             :                 }
    1471           0 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
    1472           0 :                         NDR_PRINT_FUNCTION_DEBUG(netr_DsRAddressToSitenamesExW, NDR_OUT | NDR_SET_VALUES, r2);
    1473             :                 }
    1474           0 :                 if (dce_call->fault_code != 0) {
    1475           0 :                         DBG_WARNING("dcerpc_fault %s in netr_DsRAddressToSitenamesExW\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
    1476             :                 }
    1477           0 :                 break;
    1478             :         }
    1479           0 :         case 38: { /* netr_DsrGetDcSiteCoverageW */
    1480           0 :                 struct netr_DsrGetDcSiteCoverageW *r2 = (struct netr_DsrGetDcSiteCoverageW *)r;
    1481           0 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
    1482           0 :                         DEBUG(5,("function netr_DsrGetDcSiteCoverageW replied async\n"));
    1483             :                 }
    1484           0 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
    1485           0 :                         NDR_PRINT_FUNCTION_DEBUG(netr_DsrGetDcSiteCoverageW, NDR_OUT | NDR_SET_VALUES, r2);
    1486             :                 }
    1487           0 :                 if (dce_call->fault_code != 0) {
    1488           0 :                         DBG_WARNING("dcerpc_fault %s in netr_DsrGetDcSiteCoverageW\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
    1489             :                 }
    1490           0 :                 break;
    1491             :         }
    1492        1040 :         case 39: { /* netr_LogonSamLogonEx */
    1493        1040 :                 struct netr_LogonSamLogonEx *r2 = (struct netr_LogonSamLogonEx *)r;
    1494        1040 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
    1495           0 :                         DEBUG(5,("function netr_LogonSamLogonEx replied async\n"));
    1496             :                 }
    1497        1040 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
    1498           0 :                         NDR_PRINT_FUNCTION_DEBUG(netr_LogonSamLogonEx, NDR_OUT | NDR_SET_VALUES, r2);
    1499             :                 }
    1500        1040 :                 if (dce_call->fault_code != 0) {
    1501           0 :                         DBG_WARNING("dcerpc_fault %s in netr_LogonSamLogonEx\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
    1502             :                 }
    1503        1040 :                 break;
    1504             :         }
    1505           0 :         case 40: { /* netr_DsrEnumerateDomainTrusts */
    1506           0 :                 struct netr_DsrEnumerateDomainTrusts *r2 = (struct netr_DsrEnumerateDomainTrusts *)r;
    1507           0 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
    1508           0 :                         DEBUG(5,("function netr_DsrEnumerateDomainTrusts replied async\n"));
    1509             :                 }
    1510           0 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
    1511           0 :                         NDR_PRINT_FUNCTION_DEBUG(netr_DsrEnumerateDomainTrusts, NDR_OUT | NDR_SET_VALUES, r2);
    1512             :                 }
    1513           0 :                 if (dce_call->fault_code != 0) {
    1514           0 :                         DBG_WARNING("dcerpc_fault %s in netr_DsrEnumerateDomainTrusts\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
    1515             :                 }
    1516           0 :                 break;
    1517             :         }
    1518           0 :         case 41: { /* netr_DsrDeregisterDNSHostRecords */
    1519           0 :                 struct netr_DsrDeregisterDNSHostRecords *r2 = (struct netr_DsrDeregisterDNSHostRecords *)r;
    1520           0 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
    1521           0 :                         DEBUG(5,("function netr_DsrDeregisterDNSHostRecords replied async\n"));
    1522             :                 }
    1523           0 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
    1524           0 :                         NDR_PRINT_FUNCTION_DEBUG(netr_DsrDeregisterDNSHostRecords, NDR_OUT | NDR_SET_VALUES, r2);
    1525             :                 }
    1526           0 :                 if (dce_call->fault_code != 0) {
    1527           0 :                         DBG_WARNING("dcerpc_fault %s in netr_DsrDeregisterDNSHostRecords\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
    1528             :                 }
    1529           0 :                 break;
    1530             :         }
    1531           0 :         case 42: { /* netr_ServerTrustPasswordsGet */
    1532           0 :                 struct netr_ServerTrustPasswordsGet *r2 = (struct netr_ServerTrustPasswordsGet *)r;
    1533           0 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
    1534           0 :                         DEBUG(5,("function netr_ServerTrustPasswordsGet replied async\n"));
    1535             :                 }
    1536           0 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
    1537           0 :                         NDR_PRINT_FUNCTION_DEBUG(netr_ServerTrustPasswordsGet, NDR_OUT | NDR_SET_VALUES, r2);
    1538             :                 }
    1539           0 :                 if (dce_call->fault_code != 0) {
    1540           0 :                         DBG_WARNING("dcerpc_fault %s in netr_ServerTrustPasswordsGet\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
    1541             :                 }
    1542           0 :                 break;
    1543             :         }
    1544           0 :         case 43: { /* netr_DsRGetForestTrustInformation */
    1545           0 :                 struct netr_DsRGetForestTrustInformation *r2 = (struct netr_DsRGetForestTrustInformation *)r;
    1546           0 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
    1547           0 :                         DEBUG(5,("function netr_DsRGetForestTrustInformation replied async\n"));
    1548             :                 }
    1549           0 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
    1550           0 :                         NDR_PRINT_FUNCTION_DEBUG(netr_DsRGetForestTrustInformation, NDR_OUT | NDR_SET_VALUES, r2);
    1551             :                 }
    1552           0 :                 if (dce_call->fault_code != 0) {
    1553           0 :                         DBG_WARNING("dcerpc_fault %s in netr_DsRGetForestTrustInformation\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
    1554             :                 }
    1555           0 :                 break;
    1556             :         }
    1557           0 :         case 44: { /* netr_GetForestTrustInformation */
    1558           0 :                 struct netr_GetForestTrustInformation *r2 = (struct netr_GetForestTrustInformation *)r;
    1559           0 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
    1560           0 :                         DEBUG(5,("function netr_GetForestTrustInformation replied async\n"));
    1561             :                 }
    1562           0 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
    1563           0 :                         NDR_PRINT_FUNCTION_DEBUG(netr_GetForestTrustInformation, NDR_OUT | NDR_SET_VALUES, r2);
    1564             :                 }
    1565           0 :                 if (dce_call->fault_code != 0) {
    1566           0 :                         DBG_WARNING("dcerpc_fault %s in netr_GetForestTrustInformation\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
    1567             :                 }
    1568           0 :                 break;
    1569             :         }
    1570           0 :         case 45: { /* netr_LogonSamLogonWithFlags */
    1571           0 :                 struct netr_LogonSamLogonWithFlags *r2 = (struct netr_LogonSamLogonWithFlags *)r;
    1572           0 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
    1573           0 :                         DEBUG(5,("function netr_LogonSamLogonWithFlags replied async\n"));
    1574             :                 }
    1575           0 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
    1576           0 :                         NDR_PRINT_FUNCTION_DEBUG(netr_LogonSamLogonWithFlags, NDR_OUT | NDR_SET_VALUES, r2);
    1577             :                 }
    1578           0 :                 if (dce_call->fault_code != 0) {
    1579           0 :                         DBG_WARNING("dcerpc_fault %s in netr_LogonSamLogonWithFlags\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
    1580             :                 }
    1581           0 :                 break;
    1582             :         }
    1583           0 :         case 46: { /* netr_ServerGetTrustInfo */
    1584           0 :                 struct netr_ServerGetTrustInfo *r2 = (struct netr_ServerGetTrustInfo *)r;
    1585           0 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
    1586           0 :                         DEBUG(5,("function netr_ServerGetTrustInfo replied async\n"));
    1587             :                 }
    1588           0 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
    1589           0 :                         NDR_PRINT_FUNCTION_DEBUG(netr_ServerGetTrustInfo, NDR_OUT | NDR_SET_VALUES, r2);
    1590             :                 }
    1591           0 :                 if (dce_call->fault_code != 0) {
    1592           0 :                         DBG_WARNING("dcerpc_fault %s in netr_ServerGetTrustInfo\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
    1593             :                 }
    1594           0 :                 break;
    1595             :         }
    1596           0 :         case 47: { /* netr_Unused47 */
    1597           0 :                 struct netr_Unused47 *r2 = (struct netr_Unused47 *)r;
    1598           0 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
    1599           0 :                         DEBUG(5,("function netr_Unused47 replied async\n"));
    1600             :                 }
    1601           0 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
    1602           0 :                         NDR_PRINT_FUNCTION_DEBUG(netr_Unused47, NDR_OUT | NDR_SET_VALUES, r2);
    1603             :                 }
    1604           0 :                 if (dce_call->fault_code != 0) {
    1605           0 :                         DBG_WARNING("dcerpc_fault %s in netr_Unused47\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
    1606             :                 }
    1607           0 :                 break;
    1608             :         }
    1609           0 :         case 48: { /* netr_DsrUpdateReadOnlyServerDnsRecords */
    1610           0 :                 struct netr_DsrUpdateReadOnlyServerDnsRecords *r2 = (struct netr_DsrUpdateReadOnlyServerDnsRecords *)r;
    1611           0 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
    1612           0 :                         DEBUG(5,("function netr_DsrUpdateReadOnlyServerDnsRecords replied async\n"));
    1613             :                 }
    1614           0 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
    1615           0 :                         NDR_PRINT_FUNCTION_DEBUG(netr_DsrUpdateReadOnlyServerDnsRecords, NDR_OUT | NDR_SET_VALUES, r2);
    1616             :                 }
    1617           0 :                 if (dce_call->fault_code != 0) {
    1618           0 :                         DBG_WARNING("dcerpc_fault %s in netr_DsrUpdateReadOnlyServerDnsRecords\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
    1619             :                 }
    1620           0 :                 break;
    1621             :         }
    1622           0 :         default:
    1623           0 :                 dce_call->fault_code = DCERPC_FAULT_OP_RNG_ERROR;
    1624           0 :                 break;
    1625             :         }
    1626             : 
    1627        4837 :         if (dce_call->fault_code != 0) {
    1628           0 :                 return NT_STATUS_NET_WRITE_FAULT;
    1629             :         }
    1630             : 
    1631        4837 :         return NT_STATUS_OK;
    1632             : }
    1633             : 
    1634        4837 : NTSTATUS netlogon__op_ndr_push(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx, struct ndr_push *push, const void *r)
    1635             : {
    1636           0 :         enum ndr_err_code ndr_err;
    1637        4837 :         uint16_t opnum = dce_call->pkt.u.request.opnum;
    1638             : 
    1639        4837 :         ndr_err = ndr_table_netlogon.calls[opnum].ndr_push(push, NDR_OUT, r);
    1640        4837 :         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
    1641           0 :                 dce_call->fault_code = DCERPC_FAULT_NDR;
    1642           0 :                 return NT_STATUS_NET_WRITE_FAULT;
    1643             :         }
    1644             : 
    1645        4837 :         return NT_STATUS_OK;
    1646             : }
    1647             : 
    1648           0 : NTSTATUS netlogon__op_local(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx, void *r)
    1649             : {
    1650           0 :         return netlogon__op_dispatch_internal(dce_call, mem_ctx, r, S3COMPAT_RPC_DISPATCH_INTERNAL);
    1651             : }
    1652             : 
    1653             : static const struct dcesrv_interface dcesrv_netlogon_interface = {
    1654             :         .name      = "netlogon",
    1655             :         .syntax_id = {{0x12345678,0x1234,0xabcd,{0xef,0x00},{0x01,0x23,0x45,0x67,0xcf,0xfb}},1.0},
    1656             :         .bind      = netlogon__op_bind,
    1657             :         .unbind    = netlogon__op_unbind,
    1658             :         .ndr_pull  = netlogon__op_ndr_pull,
    1659             :         .dispatch  = netlogon__op_dispatch,
    1660             :         .reply     = netlogon__op_reply,
    1661             :         .ndr_push  = netlogon__op_ndr_push,
    1662             :         .local     = netlogon__op_local,
    1663             : #ifdef DCESRV_INTERFACE_NETLOGON_FLAGS
    1664             :         .flags     = DCESRV_INTERFACE_NETLOGON_FLAGS
    1665             : #else
    1666             :         .flags     = 0
    1667             : #endif
    1668             : };
    1669             : 
    1670         127 : static NTSTATUS netlogon__op_init_server(struct dcesrv_context *dce_ctx, const struct dcesrv_endpoint_server *ep_server)
    1671             : {
    1672           0 :         uint32_t i;
    1673           0 :         NTSTATUS ret;
    1674             : 
    1675             : #ifdef DCESRV_INTERFACE_NETLOGON_NCACN_NP_SECONDARY_ENDPOINT
    1676             :         const char *ncacn_np_secondary_endpoint = DCESRV_INTERFACE_NETLOGON_NCACN_NP_SECONDARY_ENDPOINT;
    1677             : #else
    1678         127 :         const char *ncacn_np_secondary_endpoint = NULL;
    1679             : #endif
    1680             : 
    1681         508 :         for (i=0;i<ndr_table_netlogon.endpoints->count;i++) {
    1682         381 :                 const char *name = ndr_table_netlogon.endpoints->names[i];
    1683             : 
    1684         381 :                 ret = dcesrv_interface_register(dce_ctx, name, ncacn_np_secondary_endpoint, &dcesrv_netlogon_interface, NULL);
    1685         381 :                 if (!NT_STATUS_IS_OK(ret)) {
    1686           0 :                         DBG_ERR("Failed to register endpoint '%s'\n",name);
    1687           0 :                         return ret;
    1688             :                 }
    1689             :         }
    1690             : 
    1691         127 :         return NT_STATUS_OK;
    1692             : }
    1693             : 
    1694         127 : static NTSTATUS netlogon__op_shutdown_server(struct dcesrv_context *dce_ctx, const struct dcesrv_endpoint_server *ep_server)
    1695             : {
    1696         127 :         return NT_STATUS_OK;
    1697             : }
    1698             : 
    1699           0 : static bool netlogon__op_interface_by_uuid(struct dcesrv_interface *iface, const struct GUID *uuid, uint32_t if_version)
    1700             : {
    1701           0 :         if (dcesrv_netlogon_interface.syntax_id.if_version == if_version && GUID_equal(&dcesrv_netlogon_interface.syntax_id.uuid, uuid)) {
    1702           0 :                 memcpy(iface,&dcesrv_netlogon_interface, sizeof(*iface));
    1703           0 :                 return true;
    1704             :         }
    1705             : 
    1706           0 :         return false;
    1707             : }
    1708             : 
    1709           0 : static bool netlogon__op_interface_by_name(struct dcesrv_interface *iface, const char *name)
    1710             : {
    1711           0 :         if (strcmp(dcesrv_netlogon_interface.name, name)==0) {
    1712           0 :                 memcpy(iface, &dcesrv_netlogon_interface, sizeof(*iface));
    1713           0 :                 return true;
    1714             :         }
    1715             : 
    1716           0 :         return false;
    1717             : }
    1718             : 
    1719             : static const struct dcesrv_endpoint_server netlogon_ep_server = {
    1720             :         /* fill in our name */
    1721             :         .name = "netlogon",
    1722             : 
    1723             :         /* Initialization flag */
    1724             :         .initialized = false,
    1725             : 
    1726             :         /* fill in all the operations */
    1727             : #ifdef DCESRV_INTERFACE_NETLOGON_INIT_SERVER
    1728             :         .init_server = DCESRV_INTERFACE_NETLOGON_INIT_SERVER,
    1729             : #else
    1730             :         .init_server = netlogon__op_init_server,
    1731             : #endif
    1732             : #ifdef DCESRV_INTERFACE_NETLOGON_SHUTDOWN_SERVER
    1733             :         .shutdown_server = DCESRV_INTERFACE_NETLOGON_SHUTDOWN_SERVER,
    1734             : #else
    1735             :         .shutdown_server = netlogon__op_shutdown_server,
    1736             : #endif
    1737             :         .interface_by_uuid = netlogon__op_interface_by_uuid,
    1738             :         .interface_by_name = netlogon__op_interface_by_name
    1739             : };
    1740             : 
    1741         215 : const struct dcesrv_endpoint_server *netlogon_get_ep_server(void)
    1742             : {
    1743         215 :         return &netlogon_ep_server;
    1744             : }

Generated by: LCOV version 1.14