LCOV - code coverage report
Current view: top level - bin/default/librpc/gen_ndr - ndr_drsuapi_s.c (source / functions) Hit Total Coverage
Test: coverage report for master 2f515e9b Lines: 204 503 40.6 %
Date: 2024-04-21 15:09:00 Functions: 8 11 72.7 %

          Line data    Source code
       1             : /* server functions auto-generated by pidl */
       2             : #include "bin/default/librpc/gen_ndr/ndr_drsuapi.h"
       3             : #include <util/debug.h>
       4             : 
       5             : NTSTATUS dcerpc_server_drsuapi_init(TALLOC_CTX *);
       6             : 
       7             : /* drsuapi - dcerpc server boilerplate generated by pidl */
       8             : 
       9             : 
      10        2234 : static NTSTATUS drsuapi__op_bind(struct dcesrv_connection_context *context, const struct dcesrv_interface *iface)
      11             : {
      12             : #ifdef DCESRV_INTERFACE_DRSUAPI_BIND
      13        2234 :         return DCESRV_INTERFACE_DRSUAPI_BIND(context,iface);
      14             : #else
      15             :         return NT_STATUS_OK;
      16             : #endif
      17             : }
      18             : 
      19        2265 : static void drsuapi__op_unbind(struct dcesrv_connection_context *context, const struct dcesrv_interface *iface)
      20             : {
      21             : #ifdef DCESRV_INTERFACE_DRSUAPI_UNBIND
      22             :         DCESRV_INTERFACE_DRSUAPI_UNBIND(context, iface);
      23             : #else
      24        2265 :         return;
      25             : #endif
      26             : }
      27             : 
      28       17545 : static NTSTATUS drsuapi__op_ndr_pull(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx, struct ndr_pull *pull, void **r)
      29             : {
      30         220 :         enum ndr_err_code ndr_err;
      31       17545 :         uint16_t opnum = dce_call->pkt.u.request.opnum;
      32             : 
      33       17545 :         dce_call->fault_code = 0;
      34             : 
      35       17545 :         if (opnum >= ndr_table_drsuapi.num_calls) {
      36           0 :                 dce_call->fault_code = DCERPC_FAULT_OP_RNG_ERROR;
      37           0 :                 return NT_STATUS_NET_WRITE_FAULT;
      38             :         }
      39             : 
      40       35090 :         *r = talloc_named(mem_ctx,
      41       17545 :                           ndr_table_drsuapi.calls[opnum].struct_size,
      42             :                           "struct %s",
      43       17545 :                           ndr_table_drsuapi.calls[opnum].name);
      44       17545 :         NT_STATUS_HAVE_NO_MEMORY(*r);
      45             : 
      46             :         /* unravel the NDR for the packet */
      47       17545 :         ndr_err = ndr_table_drsuapi.calls[opnum].ndr_pull(pull, NDR_IN, *r);
      48       17545 :         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
      49           0 :                 dce_call->fault_code = DCERPC_FAULT_NDR;
      50           0 :                 return NT_STATUS_NET_WRITE_FAULT;
      51             :         }
      52             : 
      53       17545 :         return NT_STATUS_OK;
      54             : }
      55             : 
      56       17545 : static NTSTATUS drsuapi__op_dispatch(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx, void *r)
      57             : {
      58       17545 :         uint16_t opnum = dce_call->pkt.u.request.opnum;
      59             : 
      60       17545 :         switch (opnum) {
      61        2208 :         case 0: {
      62        2208 :                 struct drsuapi_DsBind *r2 = (struct drsuapi_DsBind *)r;
      63        2208 :                 if (DEBUGLEVEL >= 10) {
      64           0 :                         NDR_PRINT_FUNCTION_DEBUG(drsuapi_DsBind, NDR_IN, r2);
      65             :                 }
      66        2208 :                 r2->out.result = dcesrv_drsuapi_DsBind(dce_call, mem_ctx, r2);
      67        2208 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
      68           0 :                         DEBUG(5,("function drsuapi_DsBind will reply async\n"));
      69             :                 }
      70        2135 :                 break;
      71             :         }
      72          25 :         case 1: {
      73          25 :                 struct drsuapi_DsUnbind *r2 = (struct drsuapi_DsUnbind *)r;
      74          25 :                 if (DEBUGLEVEL >= 10) {
      75           0 :                         NDR_PRINT_FUNCTION_DEBUG(drsuapi_DsUnbind, NDR_IN, r2);
      76             :                 }
      77          25 :                 r2->out.result = dcesrv_drsuapi_DsUnbind(dce_call, mem_ctx, r2);
      78          25 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
      79           0 :                         DEBUG(5,("function drsuapi_DsUnbind will reply async\n"));
      80             :                 }
      81          22 :                 break;
      82             :         }
      83        2101 :         case 2: {
      84        2101 :                 struct drsuapi_DsReplicaSync *r2 = (struct drsuapi_DsReplicaSync *)r;
      85        2101 :                 if (DEBUGLEVEL >= 10) {
      86           0 :                         NDR_PRINT_FUNCTION_DEBUG(drsuapi_DsReplicaSync, NDR_IN, r2);
      87             :                 }
      88        2101 :                 r2->out.result = dcesrv_drsuapi_DsReplicaSync(dce_call, mem_ctx, r2);
      89        2101 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
      90        2101 :                         DEBUG(5,("function drsuapi_DsReplicaSync will reply async\n"));
      91             :                 }
      92        2101 :                 break;
      93             :         }
      94       10071 :         case 3: {
      95       10071 :                 struct drsuapi_DsGetNCChanges *r2 = (struct drsuapi_DsGetNCChanges *)r;
      96       10071 :                 if (DEBUGLEVEL >= 10) {
      97           0 :                         NDR_PRINT_FUNCTION_DEBUG(drsuapi_DsGetNCChanges, NDR_IN, r2);
      98             :                 }
      99       10071 :                 r2->out.result = dcesrv_drsuapi_DsGetNCChanges(dce_call, mem_ctx, r2);
     100       10071 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
     101           0 :                         DEBUG(5,("function drsuapi_DsGetNCChanges will reply async\n"));
     102             :                 }
     103       10071 :                 break;
     104             :         }
     105        1619 :         case 4: {
     106        1619 :                 struct drsuapi_DsReplicaUpdateRefs *r2 = (struct drsuapi_DsReplicaUpdateRefs *)r;
     107        1619 :                 if (DEBUGLEVEL >= 10) {
     108           0 :                         NDR_PRINT_FUNCTION_DEBUG(drsuapi_DsReplicaUpdateRefs, NDR_IN, r2);
     109             :                 }
     110        1619 :                 r2->out.result = dcesrv_drsuapi_DsReplicaUpdateRefs(dce_call, mem_ctx, r2);
     111        1619 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
     112           0 :                         DEBUG(5,("function drsuapi_DsReplicaUpdateRefs will reply async\n"));
     113             :                 }
     114        1619 :                 break;
     115             :         }
     116           0 :         case 5: {
     117           0 :                 struct drsuapi_DsReplicaAdd *r2 = (struct drsuapi_DsReplicaAdd *)r;
     118           0 :                 if (DEBUGLEVEL >= 10) {
     119           0 :                         NDR_PRINT_FUNCTION_DEBUG(drsuapi_DsReplicaAdd, NDR_IN, r2);
     120             :                 }
     121           0 :                 r2->out.result = dcesrv_drsuapi_DsReplicaAdd(dce_call, mem_ctx, r2);
     122           0 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
     123           0 :                         DEBUG(5,("function drsuapi_DsReplicaAdd will reply async\n"));
     124             :                 }
     125           0 :                 break;
     126             :         }
     127           0 :         case 6: {
     128           0 :                 struct drsuapi_DsReplicaDel *r2 = (struct drsuapi_DsReplicaDel *)r;
     129           0 :                 if (DEBUGLEVEL >= 10) {
     130           0 :                         NDR_PRINT_FUNCTION_DEBUG(drsuapi_DsReplicaDel, NDR_IN, r2);
     131             :                 }
     132           0 :                 r2->out.result = dcesrv_drsuapi_DsReplicaDel(dce_call, mem_ctx, r2);
     133           0 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
     134           0 :                         DEBUG(5,("function drsuapi_DsReplicaDel will reply async\n"));
     135             :                 }
     136           0 :                 break;
     137             :         }
     138           0 :         case 7: {
     139           0 :                 struct drsuapi_DsReplicaMod *r2 = (struct drsuapi_DsReplicaMod *)r;
     140           0 :                 if (DEBUGLEVEL >= 10) {
     141           0 :                         NDR_PRINT_FUNCTION_DEBUG(drsuapi_DsReplicaMod, NDR_IN, r2);
     142             :                 }
     143           0 :                 r2->out.result = dcesrv_drsuapi_DsReplicaMod(dce_call, mem_ctx, r2);
     144           0 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
     145           0 :                         DEBUG(5,("function drsuapi_DsReplicaMod will reply async\n"));
     146             :                 }
     147           0 :                 break;
     148             :         }
     149           0 :         case 8: {
     150           0 :                 struct DRSUAPI_VERIFY_NAMES *r2 = (struct DRSUAPI_VERIFY_NAMES *)r;
     151           0 :                 if (DEBUGLEVEL >= 10) {
     152           0 :                         NDR_PRINT_FUNCTION_DEBUG(DRSUAPI_VERIFY_NAMES, NDR_IN, r2);
     153             :                 }
     154           0 :                 r2->out.result = dcesrv_DRSUAPI_VERIFY_NAMES(dce_call, mem_ctx, r2);
     155           0 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
     156           0 :                         DEBUG(5,("function DRSUAPI_VERIFY_NAMES will reply async\n"));
     157             :                 }
     158           0 :                 break;
     159             :         }
     160           0 :         case 9: {
     161           0 :                 struct drsuapi_DsGetMemberships *r2 = (struct drsuapi_DsGetMemberships *)r;
     162           0 :                 if (DEBUGLEVEL >= 10) {
     163           0 :                         NDR_PRINT_FUNCTION_DEBUG(drsuapi_DsGetMemberships, NDR_IN, r2);
     164             :                 }
     165           0 :                 r2->out.result = dcesrv_drsuapi_DsGetMemberships(dce_call, mem_ctx, r2);
     166           0 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
     167           0 :                         DEBUG(5,("function drsuapi_DsGetMemberships will reply async\n"));
     168             :                 }
     169           0 :                 break;
     170             :         }
     171           0 :         case 10: {
     172           0 :                 struct DRSUAPI_INTER_DOMAIN_MOVE *r2 = (struct DRSUAPI_INTER_DOMAIN_MOVE *)r;
     173           0 :                 if (DEBUGLEVEL >= 10) {
     174           0 :                         NDR_PRINT_FUNCTION_DEBUG(DRSUAPI_INTER_DOMAIN_MOVE, NDR_IN, r2);
     175             :                 }
     176           0 :                 r2->out.result = dcesrv_DRSUAPI_INTER_DOMAIN_MOVE(dce_call, mem_ctx, r2);
     177           0 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
     178           0 :                         DEBUG(5,("function DRSUAPI_INTER_DOMAIN_MOVE will reply async\n"));
     179             :                 }
     180           0 :                 break;
     181             :         }
     182           3 :         case 11: {
     183           3 :                 struct drsuapi_DsGetNT4ChangeLog *r2 = (struct drsuapi_DsGetNT4ChangeLog *)r;
     184           3 :                 if (DEBUGLEVEL >= 10) {
     185           0 :                         NDR_PRINT_FUNCTION_DEBUG(drsuapi_DsGetNT4ChangeLog, NDR_IN, r2);
     186             :                 }
     187           3 :                 r2->out.result = dcesrv_drsuapi_DsGetNT4ChangeLog(dce_call, mem_ctx, r2);
     188           3 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
     189           0 :                         DEBUG(5,("function drsuapi_DsGetNT4ChangeLog will reply async\n"));
     190             :                 }
     191           3 :                 break;
     192             :         }
     193        1395 :         case 12: {
     194        1395 :                 struct drsuapi_DsCrackNames *r2 = (struct drsuapi_DsCrackNames *)r;
     195        1395 :                 if (DEBUGLEVEL >= 10) {
     196           0 :                         NDR_PRINT_FUNCTION_DEBUG(drsuapi_DsCrackNames, NDR_IN, r2);
     197             :                 }
     198        1395 :                 r2->out.result = dcesrv_drsuapi_DsCrackNames(dce_call, mem_ctx, r2);
     199        1395 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
     200           0 :                         DEBUG(5,("function drsuapi_DsCrackNames will reply async\n"));
     201             :                 }
     202        1251 :                 break;
     203             :         }
     204           4 :         case 13: {
     205           4 :                 struct drsuapi_DsWriteAccountSpn *r2 = (struct drsuapi_DsWriteAccountSpn *)r;
     206           4 :                 if (DEBUGLEVEL >= 10) {
     207           0 :                         NDR_PRINT_FUNCTION_DEBUG(drsuapi_DsWriteAccountSpn, NDR_IN, r2);
     208             :                 }
     209           4 :                 r2->out.result = dcesrv_drsuapi_DsWriteAccountSpn(dce_call, mem_ctx, r2);
     210           4 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
     211           0 :                         DEBUG(5,("function drsuapi_DsWriteAccountSpn will reply async\n"));
     212             :                 }
     213           4 :                 break;
     214             :         }
     215           7 :         case 14: {
     216           7 :                 struct drsuapi_DsRemoveDSServer *r2 = (struct drsuapi_DsRemoveDSServer *)r;
     217           7 :                 if (DEBUGLEVEL >= 10) {
     218           0 :                         NDR_PRINT_FUNCTION_DEBUG(drsuapi_DsRemoveDSServer, NDR_IN, r2);
     219             :                 }
     220           7 :                 r2->out.result = dcesrv_drsuapi_DsRemoveDSServer(dce_call, mem_ctx, r2);
     221           7 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
     222           0 :                         DEBUG(5,("function drsuapi_DsRemoveDSServer will reply async\n"));
     223             :                 }
     224           7 :                 break;
     225             :         }
     226           0 :         case 15: {
     227           0 :                 struct DRSUAPI_REMOVE_DS_DOMAIN *r2 = (struct DRSUAPI_REMOVE_DS_DOMAIN *)r;
     228           0 :                 if (DEBUGLEVEL >= 10) {
     229           0 :                         NDR_PRINT_FUNCTION_DEBUG(DRSUAPI_REMOVE_DS_DOMAIN, NDR_IN, r2);
     230             :                 }
     231           0 :                 r2->out.result = dcesrv_DRSUAPI_REMOVE_DS_DOMAIN(dce_call, mem_ctx, r2);
     232           0 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
     233           0 :                         DEBUG(5,("function DRSUAPI_REMOVE_DS_DOMAIN will reply async\n"));
     234             :                 }
     235           0 :                 break;
     236             :         }
     237           6 :         case 16: {
     238           6 :                 struct drsuapi_DsGetDomainControllerInfo *r2 = (struct drsuapi_DsGetDomainControllerInfo *)r;
     239           6 :                 if (DEBUGLEVEL >= 10) {
     240           0 :                         NDR_PRINT_FUNCTION_DEBUG(drsuapi_DsGetDomainControllerInfo, NDR_IN, r2);
     241             :                 }
     242           6 :                 r2->out.result = dcesrv_drsuapi_DsGetDomainControllerInfo(dce_call, mem_ctx, r2);
     243           6 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
     244           0 :                         DEBUG(5,("function drsuapi_DsGetDomainControllerInfo will reply async\n"));
     245             :                 }
     246           6 :                 break;
     247             :         }
     248          94 :         case 17: {
     249          94 :                 struct drsuapi_DsAddEntry *r2 = (struct drsuapi_DsAddEntry *)r;
     250          94 :                 if (DEBUGLEVEL >= 10) {
     251           0 :                         NDR_PRINT_FUNCTION_DEBUG(drsuapi_DsAddEntry, NDR_IN, r2);
     252             :                 }
     253          94 :                 r2->out.result = dcesrv_drsuapi_DsAddEntry(dce_call, mem_ctx, r2);
     254          94 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
     255           0 :                         DEBUG(5,("function drsuapi_DsAddEntry will reply async\n"));
     256             :                 }
     257          94 :                 break;
     258             :         }
     259           2 :         case 18: {
     260           2 :                 struct drsuapi_DsExecuteKCC *r2 = (struct drsuapi_DsExecuteKCC *)r;
     261           2 :                 if (DEBUGLEVEL >= 10) {
     262           0 :                         NDR_PRINT_FUNCTION_DEBUG(drsuapi_DsExecuteKCC, NDR_IN, r2);
     263             :                 }
     264           2 :                 r2->out.result = dcesrv_drsuapi_DsExecuteKCC(dce_call, mem_ctx, r2);
     265           2 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
     266           2 :                         DEBUG(5,("function drsuapi_DsExecuteKCC will reply async\n"));
     267             :                 }
     268           2 :                 break;
     269             :         }
     270          10 :         case 19: {
     271          10 :                 struct drsuapi_DsReplicaGetInfo *r2 = (struct drsuapi_DsReplicaGetInfo *)r;
     272          10 :                 if (DEBUGLEVEL >= 10) {
     273           0 :                         NDR_PRINT_FUNCTION_DEBUG(drsuapi_DsReplicaGetInfo, NDR_IN, r2);
     274             :                 }
     275          10 :                 r2->out.result = dcesrv_drsuapi_DsReplicaGetInfo(dce_call, mem_ctx, r2);
     276          10 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
     277          10 :                         DEBUG(5,("function drsuapi_DsReplicaGetInfo will reply async\n"));
     278             :                 }
     279          10 :                 break;
     280             :         }
     281           0 :         case 20: {
     282           0 :                 struct DRSUAPI_ADD_SID_HISTORY *r2 = (struct DRSUAPI_ADD_SID_HISTORY *)r;
     283           0 :                 if (DEBUGLEVEL >= 10) {
     284           0 :                         NDR_PRINT_FUNCTION_DEBUG(DRSUAPI_ADD_SID_HISTORY, NDR_IN, r2);
     285             :                 }
     286           0 :                 r2->out.result = dcesrv_DRSUAPI_ADD_SID_HISTORY(dce_call, mem_ctx, r2);
     287           0 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
     288           0 :                         DEBUG(5,("function DRSUAPI_ADD_SID_HISTORY will reply async\n"));
     289             :                 }
     290           0 :                 break;
     291             :         }
     292           0 :         case 21: {
     293           0 :                 struct drsuapi_DsGetMemberships2 *r2 = (struct drsuapi_DsGetMemberships2 *)r;
     294           0 :                 if (DEBUGLEVEL >= 10) {
     295           0 :                         NDR_PRINT_FUNCTION_DEBUG(drsuapi_DsGetMemberships2, NDR_IN, r2);
     296             :                 }
     297           0 :                 r2->out.result = dcesrv_drsuapi_DsGetMemberships2(dce_call, mem_ctx, r2);
     298           0 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
     299           0 :                         DEBUG(5,("function drsuapi_DsGetMemberships2 will reply async\n"));
     300             :                 }
     301           0 :                 break;
     302             :         }
     303           0 :         case 22: {
     304           0 :                 struct DRSUAPI_REPLICA_VERIFY_OBJECTS *r2 = (struct DRSUAPI_REPLICA_VERIFY_OBJECTS *)r;
     305           0 :                 if (DEBUGLEVEL >= 10) {
     306           0 :                         NDR_PRINT_FUNCTION_DEBUG(DRSUAPI_REPLICA_VERIFY_OBJECTS, NDR_IN, r2);
     307             :                 }
     308           0 :                 r2->out.result = dcesrv_DRSUAPI_REPLICA_VERIFY_OBJECTS(dce_call, mem_ctx, r2);
     309           0 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
     310           0 :                         DEBUG(5,("function DRSUAPI_REPLICA_VERIFY_OBJECTS will reply async\n"));
     311             :                 }
     312           0 :                 break;
     313             :         }
     314           0 :         case 23: {
     315           0 :                 struct DRSUAPI_GET_OBJECT_EXISTENCE *r2 = (struct DRSUAPI_GET_OBJECT_EXISTENCE *)r;
     316           0 :                 if (DEBUGLEVEL >= 10) {
     317           0 :                         NDR_PRINT_FUNCTION_DEBUG(DRSUAPI_GET_OBJECT_EXISTENCE, NDR_IN, r2);
     318             :                 }
     319           0 :                 r2->out.result = dcesrv_DRSUAPI_GET_OBJECT_EXISTENCE(dce_call, mem_ctx, r2);
     320           0 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
     321           0 :                         DEBUG(5,("function DRSUAPI_GET_OBJECT_EXISTENCE will reply async\n"));
     322             :                 }
     323           0 :                 break;
     324             :         }
     325           0 :         case 24: {
     326           0 :                 struct drsuapi_QuerySitesByCost *r2 = (struct drsuapi_QuerySitesByCost *)r;
     327           0 :                 if (DEBUGLEVEL >= 10) {
     328           0 :                         NDR_PRINT_FUNCTION_DEBUG(drsuapi_QuerySitesByCost, NDR_IN, r2);
     329             :                 }
     330           0 :                 r2->out.result = dcesrv_drsuapi_QuerySitesByCost(dce_call, mem_ctx, r2);
     331           0 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
     332           0 :                         DEBUG(5,("function drsuapi_QuerySitesByCost will reply async\n"));
     333             :                 }
     334           0 :                 break;
     335             :         }
     336             : 
     337           0 :         default:
     338           0 :                 dce_call->fault_code = DCERPC_FAULT_OP_RNG_ERROR;
     339           0 :                 break;
     340             :         }
     341             : 
     342       17545 :         if (dce_call->fault_code != 0) {
     343          11 :                 return NT_STATUS_NET_WRITE_FAULT;
     344             :         }
     345             : 
     346       17534 :         return NT_STATUS_OK;
     347             : }
     348             : 
     349       17534 : static NTSTATUS drsuapi__op_reply(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx, void *r)
     350             : {
     351       17534 :         uint16_t opnum = dce_call->pkt.u.request.opnum;
     352             : 
     353       17534 :         switch (opnum) {
     354        2208 :         case 0: {
     355        2208 :                 struct drsuapi_DsBind *r2 = (struct drsuapi_DsBind *)r;
     356        2208 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
     357           0 :                         DEBUG(5,("function drsuapi_DsBind replied async\n"));
     358             :                 }
     359        2208 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
     360           0 :                         NDR_PRINT_FUNCTION_DEBUG(drsuapi_DsBind, NDR_OUT | NDR_SET_VALUES, r2);
     361             :                 }
     362        2208 :                 if (dce_call->fault_code != 0) {
     363           0 :                         DEBUG(2,("dcerpc_fault %s in drsuapi_DsBind\n", dcerpc_errstr(mem_ctx, dce_call->fault_code)));
     364             :                 }
     365        2135 :                 break;
     366             :         }
     367          17 :         case 1: {
     368          17 :                 struct drsuapi_DsUnbind *r2 = (struct drsuapi_DsUnbind *)r;
     369          17 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
     370           0 :                         DEBUG(5,("function drsuapi_DsUnbind replied async\n"));
     371             :                 }
     372          17 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
     373           0 :                         NDR_PRINT_FUNCTION_DEBUG(drsuapi_DsUnbind, NDR_OUT | NDR_SET_VALUES, r2);
     374             :                 }
     375          17 :                 if (dce_call->fault_code != 0) {
     376           0 :                         DEBUG(2,("dcerpc_fault %s in drsuapi_DsUnbind\n", dcerpc_errstr(mem_ctx, dce_call->fault_code)));
     377             :                 }
     378          16 :                 break;
     379             :         }
     380        2101 :         case 2: {
     381        2101 :                 struct drsuapi_DsReplicaSync *r2 = (struct drsuapi_DsReplicaSync *)r;
     382        2101 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
     383        2101 :                         DEBUG(5,("function drsuapi_DsReplicaSync replied async\n"));
     384             :                 }
     385        2101 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
     386           0 :                         NDR_PRINT_FUNCTION_DEBUG(drsuapi_DsReplicaSync, NDR_OUT | NDR_SET_VALUES, r2);
     387             :                 }
     388        2101 :                 if (dce_call->fault_code != 0) {
     389           0 :                         DEBUG(2,("dcerpc_fault %s in drsuapi_DsReplicaSync\n", dcerpc_errstr(mem_ctx, dce_call->fault_code)));
     390             :                 }
     391        2101 :                 break;
     392             :         }
     393       10071 :         case 3: {
     394       10071 :                 struct drsuapi_DsGetNCChanges *r2 = (struct drsuapi_DsGetNCChanges *)r;
     395       10071 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
     396           0 :                         DEBUG(5,("function drsuapi_DsGetNCChanges replied async\n"));
     397             :                 }
     398       10071 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
     399           0 :                         NDR_PRINT_FUNCTION_DEBUG(drsuapi_DsGetNCChanges, NDR_OUT | NDR_SET_VALUES, r2);
     400             :                 }
     401       10071 :                 if (dce_call->fault_code != 0) {
     402           0 :                         DEBUG(2,("dcerpc_fault %s in drsuapi_DsGetNCChanges\n", dcerpc_errstr(mem_ctx, dce_call->fault_code)));
     403             :                 }
     404       10071 :                 break;
     405             :         }
     406        1619 :         case 4: {
     407        1619 :                 struct drsuapi_DsReplicaUpdateRefs *r2 = (struct drsuapi_DsReplicaUpdateRefs *)r;
     408        1619 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
     409           0 :                         DEBUG(5,("function drsuapi_DsReplicaUpdateRefs replied async\n"));
     410             :                 }
     411        1619 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
     412           0 :                         NDR_PRINT_FUNCTION_DEBUG(drsuapi_DsReplicaUpdateRefs, NDR_OUT | NDR_SET_VALUES, r2);
     413             :                 }
     414        1619 :                 if (dce_call->fault_code != 0) {
     415           0 :                         DEBUG(2,("dcerpc_fault %s in drsuapi_DsReplicaUpdateRefs\n", dcerpc_errstr(mem_ctx, dce_call->fault_code)));
     416             :                 }
     417        1619 :                 break;
     418             :         }
     419           0 :         case 5: {
     420           0 :                 struct drsuapi_DsReplicaAdd *r2 = (struct drsuapi_DsReplicaAdd *)r;
     421           0 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
     422           0 :                         DEBUG(5,("function drsuapi_DsReplicaAdd replied async\n"));
     423             :                 }
     424           0 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
     425           0 :                         NDR_PRINT_FUNCTION_DEBUG(drsuapi_DsReplicaAdd, NDR_OUT | NDR_SET_VALUES, r2);
     426             :                 }
     427           0 :                 if (dce_call->fault_code != 0) {
     428           0 :                         DEBUG(2,("dcerpc_fault %s in drsuapi_DsReplicaAdd\n", dcerpc_errstr(mem_ctx, dce_call->fault_code)));
     429             :                 }
     430           0 :                 break;
     431             :         }
     432           0 :         case 6: {
     433           0 :                 struct drsuapi_DsReplicaDel *r2 = (struct drsuapi_DsReplicaDel *)r;
     434           0 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
     435           0 :                         DEBUG(5,("function drsuapi_DsReplicaDel replied async\n"));
     436             :                 }
     437           0 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
     438           0 :                         NDR_PRINT_FUNCTION_DEBUG(drsuapi_DsReplicaDel, NDR_OUT | NDR_SET_VALUES, r2);
     439             :                 }
     440           0 :                 if (dce_call->fault_code != 0) {
     441           0 :                         DEBUG(2,("dcerpc_fault %s in drsuapi_DsReplicaDel\n", dcerpc_errstr(mem_ctx, dce_call->fault_code)));
     442             :                 }
     443           0 :                 break;
     444             :         }
     445           0 :         case 7: {
     446           0 :                 struct drsuapi_DsReplicaMod *r2 = (struct drsuapi_DsReplicaMod *)r;
     447           0 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
     448           0 :                         DEBUG(5,("function drsuapi_DsReplicaMod replied async\n"));
     449             :                 }
     450           0 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
     451           0 :                         NDR_PRINT_FUNCTION_DEBUG(drsuapi_DsReplicaMod, NDR_OUT | NDR_SET_VALUES, r2);
     452             :                 }
     453           0 :                 if (dce_call->fault_code != 0) {
     454           0 :                         DEBUG(2,("dcerpc_fault %s in drsuapi_DsReplicaMod\n", dcerpc_errstr(mem_ctx, dce_call->fault_code)));
     455             :                 }
     456           0 :                 break;
     457             :         }
     458           0 :         case 8: {
     459           0 :                 struct DRSUAPI_VERIFY_NAMES *r2 = (struct DRSUAPI_VERIFY_NAMES *)r;
     460           0 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
     461           0 :                         DEBUG(5,("function DRSUAPI_VERIFY_NAMES replied async\n"));
     462             :                 }
     463           0 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
     464           0 :                         NDR_PRINT_FUNCTION_DEBUG(DRSUAPI_VERIFY_NAMES, NDR_OUT | NDR_SET_VALUES, r2);
     465             :                 }
     466           0 :                 if (dce_call->fault_code != 0) {
     467           0 :                         DEBUG(2,("dcerpc_fault %s in DRSUAPI_VERIFY_NAMES\n", dcerpc_errstr(mem_ctx, dce_call->fault_code)));
     468             :                 }
     469           0 :                 break;
     470             :         }
     471           0 :         case 9: {
     472           0 :                 struct drsuapi_DsGetMemberships *r2 = (struct drsuapi_DsGetMemberships *)r;
     473           0 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
     474           0 :                         DEBUG(5,("function drsuapi_DsGetMemberships replied async\n"));
     475             :                 }
     476           0 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
     477           0 :                         NDR_PRINT_FUNCTION_DEBUG(drsuapi_DsGetMemberships, NDR_OUT | NDR_SET_VALUES, r2);
     478             :                 }
     479           0 :                 if (dce_call->fault_code != 0) {
     480           0 :                         DEBUG(2,("dcerpc_fault %s in drsuapi_DsGetMemberships\n", dcerpc_errstr(mem_ctx, dce_call->fault_code)));
     481             :                 }
     482           0 :                 break;
     483             :         }
     484           0 :         case 10: {
     485           0 :                 struct DRSUAPI_INTER_DOMAIN_MOVE *r2 = (struct DRSUAPI_INTER_DOMAIN_MOVE *)r;
     486           0 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
     487           0 :                         DEBUG(5,("function DRSUAPI_INTER_DOMAIN_MOVE replied async\n"));
     488             :                 }
     489           0 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
     490           0 :                         NDR_PRINT_FUNCTION_DEBUG(DRSUAPI_INTER_DOMAIN_MOVE, NDR_OUT | NDR_SET_VALUES, r2);
     491             :                 }
     492           0 :                 if (dce_call->fault_code != 0) {
     493           0 :                         DEBUG(2,("dcerpc_fault %s in DRSUAPI_INTER_DOMAIN_MOVE\n", dcerpc_errstr(mem_ctx, dce_call->fault_code)));
     494             :                 }
     495           0 :                 break;
     496             :         }
     497           0 :         case 11: {
     498           0 :                 struct drsuapi_DsGetNT4ChangeLog *r2 = (struct drsuapi_DsGetNT4ChangeLog *)r;
     499           0 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
     500           0 :                         DEBUG(5,("function drsuapi_DsGetNT4ChangeLog replied async\n"));
     501             :                 }
     502           0 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
     503           0 :                         NDR_PRINT_FUNCTION_DEBUG(drsuapi_DsGetNT4ChangeLog, NDR_OUT | NDR_SET_VALUES, r2);
     504             :                 }
     505           0 :                 if (dce_call->fault_code != 0) {
     506           0 :                         DEBUG(2,("dcerpc_fault %s in drsuapi_DsGetNT4ChangeLog\n", dcerpc_errstr(mem_ctx, dce_call->fault_code)));
     507             :                 }
     508           0 :                 break;
     509             :         }
     510        1395 :         case 12: {
     511        1395 :                 struct drsuapi_DsCrackNames *r2 = (struct drsuapi_DsCrackNames *)r;
     512        1395 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
     513           0 :                         DEBUG(5,("function drsuapi_DsCrackNames replied async\n"));
     514             :                 }
     515        1395 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
     516           0 :                         NDR_PRINT_FUNCTION_DEBUG(drsuapi_DsCrackNames, NDR_OUT | NDR_SET_VALUES, r2);
     517             :                 }
     518        1395 :                 if (dce_call->fault_code != 0) {
     519           0 :                         DEBUG(2,("dcerpc_fault %s in drsuapi_DsCrackNames\n", dcerpc_errstr(mem_ctx, dce_call->fault_code)));
     520             :                 }
     521        1251 :                 break;
     522             :         }
     523           4 :         case 13: {
     524           4 :                 struct drsuapi_DsWriteAccountSpn *r2 = (struct drsuapi_DsWriteAccountSpn *)r;
     525           4 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
     526           0 :                         DEBUG(5,("function drsuapi_DsWriteAccountSpn replied async\n"));
     527             :                 }
     528           4 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
     529           0 :                         NDR_PRINT_FUNCTION_DEBUG(drsuapi_DsWriteAccountSpn, NDR_OUT | NDR_SET_VALUES, r2);
     530             :                 }
     531           4 :                 if (dce_call->fault_code != 0) {
     532           0 :                         DEBUG(2,("dcerpc_fault %s in drsuapi_DsWriteAccountSpn\n", dcerpc_errstr(mem_ctx, dce_call->fault_code)));
     533             :                 }
     534           4 :                 break;
     535             :         }
     536           7 :         case 14: {
     537           7 :                 struct drsuapi_DsRemoveDSServer *r2 = (struct drsuapi_DsRemoveDSServer *)r;
     538           7 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
     539           0 :                         DEBUG(5,("function drsuapi_DsRemoveDSServer replied async\n"));
     540             :                 }
     541           7 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
     542           0 :                         NDR_PRINT_FUNCTION_DEBUG(drsuapi_DsRemoveDSServer, NDR_OUT | NDR_SET_VALUES, r2);
     543             :                 }
     544           7 :                 if (dce_call->fault_code != 0) {
     545           0 :                         DEBUG(2,("dcerpc_fault %s in drsuapi_DsRemoveDSServer\n", dcerpc_errstr(mem_ctx, dce_call->fault_code)));
     546             :                 }
     547           7 :                 break;
     548             :         }
     549           0 :         case 15: {
     550           0 :                 struct DRSUAPI_REMOVE_DS_DOMAIN *r2 = (struct DRSUAPI_REMOVE_DS_DOMAIN *)r;
     551           0 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
     552           0 :                         DEBUG(5,("function DRSUAPI_REMOVE_DS_DOMAIN replied async\n"));
     553             :                 }
     554           0 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
     555           0 :                         NDR_PRINT_FUNCTION_DEBUG(DRSUAPI_REMOVE_DS_DOMAIN, NDR_OUT | NDR_SET_VALUES, r2);
     556             :                 }
     557           0 :                 if (dce_call->fault_code != 0) {
     558           0 :                         DEBUG(2,("dcerpc_fault %s in DRSUAPI_REMOVE_DS_DOMAIN\n", dcerpc_errstr(mem_ctx, dce_call->fault_code)));
     559             :                 }
     560           0 :                 break;
     561             :         }
     562           6 :         case 16: {
     563           6 :                 struct drsuapi_DsGetDomainControllerInfo *r2 = (struct drsuapi_DsGetDomainControllerInfo *)r;
     564           6 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
     565           0 :                         DEBUG(5,("function drsuapi_DsGetDomainControllerInfo replied async\n"));
     566             :                 }
     567           6 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
     568           0 :                         NDR_PRINT_FUNCTION_DEBUG(drsuapi_DsGetDomainControllerInfo, NDR_OUT | NDR_SET_VALUES, r2);
     569             :                 }
     570           6 :                 if (dce_call->fault_code != 0) {
     571           0 :                         DEBUG(2,("dcerpc_fault %s in drsuapi_DsGetDomainControllerInfo\n", dcerpc_errstr(mem_ctx, dce_call->fault_code)));
     572             :                 }
     573           6 :                 break;
     574             :         }
     575          94 :         case 17: {
     576          94 :                 struct drsuapi_DsAddEntry *r2 = (struct drsuapi_DsAddEntry *)r;
     577          94 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
     578           0 :                         DEBUG(5,("function drsuapi_DsAddEntry replied async\n"));
     579             :                 }
     580          94 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
     581           0 :                         NDR_PRINT_FUNCTION_DEBUG(drsuapi_DsAddEntry, NDR_OUT | NDR_SET_VALUES, r2);
     582             :                 }
     583          94 :                 if (dce_call->fault_code != 0) {
     584           0 :                         DEBUG(2,("dcerpc_fault %s in drsuapi_DsAddEntry\n", dcerpc_errstr(mem_ctx, dce_call->fault_code)));
     585             :                 }
     586          94 :                 break;
     587             :         }
     588           2 :         case 18: {
     589           2 :                 struct drsuapi_DsExecuteKCC *r2 = (struct drsuapi_DsExecuteKCC *)r;
     590           2 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
     591           2 :                         DEBUG(5,("function drsuapi_DsExecuteKCC replied async\n"));
     592             :                 }
     593           2 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
     594           0 :                         NDR_PRINT_FUNCTION_DEBUG(drsuapi_DsExecuteKCC, NDR_OUT | NDR_SET_VALUES, r2);
     595             :                 }
     596           2 :                 if (dce_call->fault_code != 0) {
     597           0 :                         DEBUG(2,("dcerpc_fault %s in drsuapi_DsExecuteKCC\n", dcerpc_errstr(mem_ctx, dce_call->fault_code)));
     598             :                 }
     599           2 :                 break;
     600             :         }
     601          10 :         case 19: {
     602          10 :                 struct drsuapi_DsReplicaGetInfo *r2 = (struct drsuapi_DsReplicaGetInfo *)r;
     603          10 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
     604          10 :                         DEBUG(5,("function drsuapi_DsReplicaGetInfo replied async\n"));
     605             :                 }
     606          10 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
     607           0 :                         NDR_PRINT_FUNCTION_DEBUG(drsuapi_DsReplicaGetInfo, NDR_OUT | NDR_SET_VALUES, r2);
     608             :                 }
     609          10 :                 if (dce_call->fault_code != 0) {
     610           0 :                         DEBUG(2,("dcerpc_fault %s in drsuapi_DsReplicaGetInfo\n", dcerpc_errstr(mem_ctx, dce_call->fault_code)));
     611             :                 }
     612          10 :                 break;
     613             :         }
     614           0 :         case 20: {
     615           0 :                 struct DRSUAPI_ADD_SID_HISTORY *r2 = (struct DRSUAPI_ADD_SID_HISTORY *)r;
     616           0 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
     617           0 :                         DEBUG(5,("function DRSUAPI_ADD_SID_HISTORY replied async\n"));
     618             :                 }
     619           0 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
     620           0 :                         NDR_PRINT_FUNCTION_DEBUG(DRSUAPI_ADD_SID_HISTORY, NDR_OUT | NDR_SET_VALUES, r2);
     621             :                 }
     622           0 :                 if (dce_call->fault_code != 0) {
     623           0 :                         DEBUG(2,("dcerpc_fault %s in DRSUAPI_ADD_SID_HISTORY\n", dcerpc_errstr(mem_ctx, dce_call->fault_code)));
     624             :                 }
     625           0 :                 break;
     626             :         }
     627           0 :         case 21: {
     628           0 :                 struct drsuapi_DsGetMemberships2 *r2 = (struct drsuapi_DsGetMemberships2 *)r;
     629           0 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
     630           0 :                         DEBUG(5,("function drsuapi_DsGetMemberships2 replied async\n"));
     631             :                 }
     632           0 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
     633           0 :                         NDR_PRINT_FUNCTION_DEBUG(drsuapi_DsGetMemberships2, NDR_OUT | NDR_SET_VALUES, r2);
     634             :                 }
     635           0 :                 if (dce_call->fault_code != 0) {
     636           0 :                         DEBUG(2,("dcerpc_fault %s in drsuapi_DsGetMemberships2\n", dcerpc_errstr(mem_ctx, dce_call->fault_code)));
     637             :                 }
     638           0 :                 break;
     639             :         }
     640           0 :         case 22: {
     641           0 :                 struct DRSUAPI_REPLICA_VERIFY_OBJECTS *r2 = (struct DRSUAPI_REPLICA_VERIFY_OBJECTS *)r;
     642           0 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
     643           0 :                         DEBUG(5,("function DRSUAPI_REPLICA_VERIFY_OBJECTS replied async\n"));
     644             :                 }
     645           0 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
     646           0 :                         NDR_PRINT_FUNCTION_DEBUG(DRSUAPI_REPLICA_VERIFY_OBJECTS, NDR_OUT | NDR_SET_VALUES, r2);
     647             :                 }
     648           0 :                 if (dce_call->fault_code != 0) {
     649           0 :                         DEBUG(2,("dcerpc_fault %s in DRSUAPI_REPLICA_VERIFY_OBJECTS\n", dcerpc_errstr(mem_ctx, dce_call->fault_code)));
     650             :                 }
     651           0 :                 break;
     652             :         }
     653           0 :         case 23: {
     654           0 :                 struct DRSUAPI_GET_OBJECT_EXISTENCE *r2 = (struct DRSUAPI_GET_OBJECT_EXISTENCE *)r;
     655           0 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
     656           0 :                         DEBUG(5,("function DRSUAPI_GET_OBJECT_EXISTENCE replied async\n"));
     657             :                 }
     658           0 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
     659           0 :                         NDR_PRINT_FUNCTION_DEBUG(DRSUAPI_GET_OBJECT_EXISTENCE, NDR_OUT | NDR_SET_VALUES, r2);
     660             :                 }
     661           0 :                 if (dce_call->fault_code != 0) {
     662           0 :                         DEBUG(2,("dcerpc_fault %s in DRSUAPI_GET_OBJECT_EXISTENCE\n", dcerpc_errstr(mem_ctx, dce_call->fault_code)));
     663             :                 }
     664           0 :                 break;
     665             :         }
     666           0 :         case 24: {
     667           0 :                 struct drsuapi_QuerySitesByCost *r2 = (struct drsuapi_QuerySitesByCost *)r;
     668           0 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
     669           0 :                         DEBUG(5,("function drsuapi_QuerySitesByCost replied async\n"));
     670             :                 }
     671           0 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
     672           0 :                         NDR_PRINT_FUNCTION_DEBUG(drsuapi_QuerySitesByCost, NDR_OUT | NDR_SET_VALUES, r2);
     673             :                 }
     674           0 :                 if (dce_call->fault_code != 0) {
     675           0 :                         DEBUG(2,("dcerpc_fault %s in drsuapi_QuerySitesByCost\n", dcerpc_errstr(mem_ctx, dce_call->fault_code)));
     676             :                 }
     677           0 :                 break;
     678             :         }
     679             : 
     680           0 :         default:
     681           0 :                 dce_call->fault_code = DCERPC_FAULT_OP_RNG_ERROR;
     682           0 :                 break;
     683             :         }
     684             : 
     685       17534 :         if (dce_call->fault_code != 0) {
     686           0 :                 return NT_STATUS_NET_WRITE_FAULT;
     687             :         }
     688             : 
     689       17534 :         return NT_STATUS_OK;
     690             : }
     691             : 
     692       17534 : static NTSTATUS drsuapi__op_ndr_push(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx, struct ndr_push *push, const void *r)
     693             : {
     694         218 :         enum ndr_err_code ndr_err;
     695       17534 :         uint16_t opnum = dce_call->pkt.u.request.opnum;
     696             : 
     697       17534 :         ndr_err = ndr_table_drsuapi.calls[opnum].ndr_push(push, NDR_OUT, r);
     698       17534 :         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
     699           0 :                 dce_call->fault_code = DCERPC_FAULT_NDR;
     700           0 :                 return NT_STATUS_NET_WRITE_FAULT;
     701             :         }
     702             : 
     703       17534 :         return NT_STATUS_OK;
     704             : }
     705             : 
     706             : static const struct dcesrv_interface dcesrv_drsuapi_interface = {
     707             :         .name               = "drsuapi",
     708             :         .syntax_id          = {{0xe3514235,0x4b06,0x11d1,{0xab,0x04},{0x00,0xc0,0x4f,0xc2,0xdc,0xd2}},4.0},
     709             :         .bind               = drsuapi__op_bind,
     710             :         .unbind             = drsuapi__op_unbind,
     711             :         .ndr_pull           = drsuapi__op_ndr_pull,
     712             :         .dispatch           = drsuapi__op_dispatch,
     713             :         .reply              = drsuapi__op_reply,
     714             :         .ndr_push           = drsuapi__op_ndr_push,
     715             :         .local              = NULL,
     716             : #ifdef DCESRV_INTERFACE_DRSUAPI_FLAGS
     717             :         .flags              = DCESRV_INTERFACE_DRSUAPI_FLAGS
     718             : #else
     719             :         .flags              = 0
     720             : #endif
     721             : };
     722             : 
     723             : 
     724          64 : static NTSTATUS drsuapi__op_init_server(struct dcesrv_context *dce_ctx, const struct dcesrv_endpoint_server *ep_server)
     725             : {
     726           2 :         int i;
     727             : #ifdef DCESRV_INTERFACE_DRSUAPI_NCACN_NP_SECONDARY_ENDPOINT
     728             :         const char *ncacn_np_secondary_endpoint =
     729             :                 DCESRV_INTERFACE_DRSUAPI_NCACN_NP_SECONDARY_ENDPOINT;
     730             : #else
     731          64 :         const char *ncacn_np_secondary_endpoint = NULL;
     732             : #endif
     733             : 
     734         320 :         for (i=0;i<ndr_table_drsuapi.endpoints->count;i++) {
     735           8 :                 NTSTATUS ret;
     736         256 :                 const char *name = ndr_table_drsuapi.endpoints->names[i];
     737             : 
     738         256 :                 ret = dcesrv_interface_register(dce_ctx,
     739             :                                                 name,
     740             :                                                 ncacn_np_secondary_endpoint,
     741             :                                                 &dcesrv_drsuapi_interface,
     742             :                                                 NULL);
     743         256 :                 if (!NT_STATUS_IS_OK(ret)) {
     744           0 :                         DEBUG(1,("drsuapi_op_init_server: failed to register endpoint '%s'\n",name));
     745           0 :                         return ret;
     746             :                 }
     747             :         }
     748             : 
     749          64 :         return NT_STATUS_OK;
     750             : }
     751             : 
     752           0 : static NTSTATUS drsuapi__op_shutdown_server(struct dcesrv_context *dce_ctx, const struct dcesrv_endpoint_server *ep_server)
     753             : {
     754           0 :         return NT_STATUS_OK;
     755             : }
     756             : 
     757           0 : static bool drsuapi__op_interface_by_uuid(struct dcesrv_interface *iface, const struct GUID *uuid, uint32_t if_version)
     758             : {
     759           0 :         if (dcesrv_drsuapi_interface.syntax_id.if_version == if_version &&
     760           0 :                 GUID_equal(&dcesrv_drsuapi_interface.syntax_id.uuid, uuid)) {
     761           0 :                 memcpy(iface,&dcesrv_drsuapi_interface, sizeof(*iface));
     762           0 :                 return true;
     763             :         }
     764             : 
     765           0 :         return false;
     766             : }
     767             : 
     768           0 : static bool drsuapi__op_interface_by_name(struct dcesrv_interface *iface, const char *name)
     769             : {
     770           0 :         if (strcmp(dcesrv_drsuapi_interface.name, name)==0) {
     771           0 :                 memcpy(iface, &dcesrv_drsuapi_interface, sizeof(*iface));
     772           0 :                 return true;
     773             :         }
     774             : 
     775           0 :         return false;
     776             : }
     777             : 
     778          66 : NTSTATUS dcerpc_server_drsuapi_init(TALLOC_CTX *ctx)
     779             : {
     780           2 :         NTSTATUS ret;
     781           2 :         static const struct dcesrv_endpoint_server ep_server = {
     782             :             /* fill in our name */
     783             :             .name = "drsuapi",
     784             : 
     785             :             /* Initialization flag */
     786             :             .initialized = false,
     787             : 
     788             :             /* fill in all the operations */
     789             : #ifdef DCESRV_INTERFACE_DRSUAPI_INIT_SERVER
     790             :             .init_server = DCESRV_INTERFACE_DRSUAPI_INIT_SERVER,
     791             : #else
     792             :             .init_server = drsuapi__op_init_server,
     793             : #endif
     794             : #ifdef DCESRV_INTERFACE_DRSUAPI_SHUTDOWN_SERVER
     795             :             .shutdown_server = DCESRV_INTERFACE_DRSUAPI_SHUTDOWN_SERVER,
     796             : #else
     797             :             .shutdown_server = drsuapi__op_shutdown_server,
     798             : #endif
     799             :             .interface_by_uuid = drsuapi__op_interface_by_uuid,
     800             :             .interface_by_name = drsuapi__op_interface_by_name
     801             :         };
     802             :         /* register ourselves with the DCERPC subsystem. */
     803          66 :         ret = dcerpc_register_ep_server(&ep_server);
     804             : 
     805          66 :         if (!NT_STATUS_IS_OK(ret)) {
     806           0 :                 DEBUG(0,("Failed to register 'drsuapi' endpoint server!\n"));
     807           0 :                 return ret;
     808             :         }
     809             : 
     810          66 :         return ret;
     811             : }
     812             : 

Generated by: LCOV version 1.14