s3: Do not reference ndr_table when calling rpc_srv_register
[samba.git] / librpc / gen_ndr / srv_dssetup.c
index dfa46e800b7f35317241d5920e7cb3ec3a6442d2..361fbaaf87d8f8d28ec756b1e7386f763624e013 100644 (file)
@@ -15,7 +15,7 @@ static bool api_dssetup_DsRoleGetPrimaryDomainInformation(pipes_struct *p)
        DATA_BLOB blob;
        struct dssetup_DsRoleGetPrimaryDomainInformation *r;
 
-       call = &ndr_table_dssetup.calls[NDR_DSSETUP_DSROLEGETPRIMARYDOMAININFORMATION];
+       call = &p->interface->calls[NDR_DSSETUP_DSROLEGETPRIMARYDOMAININFORMATION];
 
        r = talloc(talloc_tos(), struct dssetup_DsRoleGetPrimaryDomainInformation);
        if (r == NULL) {
@@ -95,7 +95,7 @@ static bool api_dssetup_DsRoleDnsNameToFlatName(pipes_struct *p)
        DATA_BLOB blob;
        struct dssetup_DsRoleDnsNameToFlatName *r;
 
-       call = &ndr_table_dssetup.calls[NDR_DSSETUP_DSROLEDNSNAMETOFLATNAME];
+       call = &p->interface->calls[NDR_DSSETUP_DSROLEDNSNAMETOFLATNAME];
 
        r = talloc(talloc_tos(), struct dssetup_DsRoleDnsNameToFlatName);
        if (r == NULL) {
@@ -168,7 +168,7 @@ static bool api_dssetup_DsRoleDcAsDc(pipes_struct *p)
        DATA_BLOB blob;
        struct dssetup_DsRoleDcAsDc *r;
 
-       call = &ndr_table_dssetup.calls[NDR_DSSETUP_DSROLEDCASDC];
+       call = &p->interface->calls[NDR_DSSETUP_DSROLEDCASDC];
 
        r = talloc(talloc_tos(), struct dssetup_DsRoleDcAsDc);
        if (r == NULL) {
@@ -241,7 +241,7 @@ static bool api_dssetup_DsRoleDcAsReplica(pipes_struct *p)
        DATA_BLOB blob;
        struct dssetup_DsRoleDcAsReplica *r;
 
-       call = &ndr_table_dssetup.calls[NDR_DSSETUP_DSROLEDCASREPLICA];
+       call = &p->interface->calls[NDR_DSSETUP_DSROLEDCASREPLICA];
 
        r = talloc(talloc_tos(), struct dssetup_DsRoleDcAsReplica);
        if (r == NULL) {
@@ -314,7 +314,7 @@ static bool api_dssetup_DsRoleDemoteDc(pipes_struct *p)
        DATA_BLOB blob;
        struct dssetup_DsRoleDemoteDc *r;
 
-       call = &ndr_table_dssetup.calls[NDR_DSSETUP_DSROLEDEMOTEDC];
+       call = &p->interface->calls[NDR_DSSETUP_DSROLEDEMOTEDC];
 
        r = talloc(talloc_tos(), struct dssetup_DsRoleDemoteDc);
        if (r == NULL) {
@@ -387,7 +387,7 @@ static bool api_dssetup_DsRoleGetDcOperationProgress(pipes_struct *p)
        DATA_BLOB blob;
        struct dssetup_DsRoleGetDcOperationProgress *r;
 
-       call = &ndr_table_dssetup.calls[NDR_DSSETUP_DSROLEGETDCOPERATIONPROGRESS];
+       call = &p->interface->calls[NDR_DSSETUP_DSROLEGETDCOPERATIONPROGRESS];
 
        r = talloc(talloc_tos(), struct dssetup_DsRoleGetDcOperationProgress);
        if (r == NULL) {
@@ -460,7 +460,7 @@ static bool api_dssetup_DsRoleGetDcOperationResults(pipes_struct *p)
        DATA_BLOB blob;
        struct dssetup_DsRoleGetDcOperationResults *r;
 
-       call = &ndr_table_dssetup.calls[NDR_DSSETUP_DSROLEGETDCOPERATIONRESULTS];
+       call = &p->interface->calls[NDR_DSSETUP_DSROLEGETDCOPERATIONRESULTS];
 
        r = talloc(talloc_tos(), struct dssetup_DsRoleGetDcOperationResults);
        if (r == NULL) {
@@ -533,7 +533,7 @@ static bool api_dssetup_DsRoleCancel(pipes_struct *p)
        DATA_BLOB blob;
        struct dssetup_DsRoleCancel *r;
 
-       call = &ndr_table_dssetup.calls[NDR_DSSETUP_DSROLECANCEL];
+       call = &p->interface->calls[NDR_DSSETUP_DSROLECANCEL];
 
        r = talloc(talloc_tos(), struct dssetup_DsRoleCancel);
        if (r == NULL) {
@@ -606,7 +606,7 @@ static bool api_dssetup_DsRoleServerSaveStateForUpgrade(pipes_struct *p)
        DATA_BLOB blob;
        struct dssetup_DsRoleServerSaveStateForUpgrade *r;
 
-       call = &ndr_table_dssetup.calls[NDR_DSSETUP_DSROLESERVERSAVESTATEFORUPGRADE];
+       call = &p->interface->calls[NDR_DSSETUP_DSROLESERVERSAVESTATEFORUPGRADE];
 
        r = talloc(talloc_tos(), struct dssetup_DsRoleServerSaveStateForUpgrade);
        if (r == NULL) {
@@ -679,7 +679,7 @@ static bool api_dssetup_DsRoleUpgradeDownlevelServer(pipes_struct *p)
        DATA_BLOB blob;
        struct dssetup_DsRoleUpgradeDownlevelServer *r;
 
-       call = &ndr_table_dssetup.calls[NDR_DSSETUP_DSROLEUPGRADEDOWNLEVELSERVER];
+       call = &p->interface->calls[NDR_DSSETUP_DSROLEUPGRADEDOWNLEVELSERVER];
 
        r = talloc(talloc_tos(), struct dssetup_DsRoleUpgradeDownlevelServer);
        if (r == NULL) {
@@ -752,7 +752,7 @@ static bool api_dssetup_DsRoleAbortDownlevelServerUpgrade(pipes_struct *p)
        DATA_BLOB blob;
        struct dssetup_DsRoleAbortDownlevelServerUpgrade *r;
 
-       call = &ndr_table_dssetup.calls[NDR_DSSETUP_DSROLEABORTDOWNLEVELSERVERUPGRADE];
+       call = &p->interface->calls[NDR_DSSETUP_DSROLEABORTDOWNLEVELSERVERUPGRADE];
 
        r = talloc(talloc_tos(), struct dssetup_DsRoleAbortDownlevelServerUpgrade);
        if (r == NULL) {
@@ -839,7 +839,7 @@ void dssetup_get_pipe_fns(struct api_struct **fns, int *n_fns)
        *n_fns = sizeof(api_dssetup_cmds) / sizeof(struct api_struct);
 }
 
-NTSTATUS rpc_dssetup_dispatch(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, const struct ndr_interface_table *table, uint32_t opnum, void *_r)
+NTSTATUS rpc_dssetup_dispatch(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, const char *interface, uint32_t interface_version, uint32_t opnum, void *_r)
 {
        if (cli->pipes_struct == NULL) {
                return NT_STATUS_INVALID_PARAMETER;
@@ -848,7 +848,7 @@ NTSTATUS rpc_dssetup_dispatch(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx,
        switch (opnum)
        {
                case NDR_DSSETUP_DSROLEGETPRIMARYDOMAININFORMATION: {
-                       struct dssetup_DsRoleGetPrimaryDomainInformation *r = _r;
+                       struct dssetup_DsRoleGetPrimaryDomainInformation *r = (struct dssetup_DsRoleGetPrimaryDomainInformation *)_r;
                        ZERO_STRUCT(r->out);
                        r->out.info = talloc_zero(mem_ctx, union dssetup_DsRoleInfo);
                        if (r->out.info == NULL) {
@@ -860,61 +860,61 @@ NTSTATUS rpc_dssetup_dispatch(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx,
                }
 
                case NDR_DSSETUP_DSROLEDNSNAMETOFLATNAME: {
-                       struct dssetup_DsRoleDnsNameToFlatName *r = _r;
+                       struct dssetup_DsRoleDnsNameToFlatName *r = (struct dssetup_DsRoleDnsNameToFlatName *)_r;
                        r->out.result = _dssetup_DsRoleDnsNameToFlatName(cli->pipes_struct, r);
                        return NT_STATUS_OK;
                }
 
                case NDR_DSSETUP_DSROLEDCASDC: {
-                       struct dssetup_DsRoleDcAsDc *r = _r;
+                       struct dssetup_DsRoleDcAsDc *r = (struct dssetup_DsRoleDcAsDc *)_r;
                        r->out.result = _dssetup_DsRoleDcAsDc(cli->pipes_struct, r);
                        return NT_STATUS_OK;
                }
 
                case NDR_DSSETUP_DSROLEDCASREPLICA: {
-                       struct dssetup_DsRoleDcAsReplica *r = _r;
+                       struct dssetup_DsRoleDcAsReplica *r = (struct dssetup_DsRoleDcAsReplica *)_r;
                        r->out.result = _dssetup_DsRoleDcAsReplica(cli->pipes_struct, r);
                        return NT_STATUS_OK;
                }
 
                case NDR_DSSETUP_DSROLEDEMOTEDC: {
-                       struct dssetup_DsRoleDemoteDc *r = _r;
+                       struct dssetup_DsRoleDemoteDc *r = (struct dssetup_DsRoleDemoteDc *)_r;
                        r->out.result = _dssetup_DsRoleDemoteDc(cli->pipes_struct, r);
                        return NT_STATUS_OK;
                }
 
                case NDR_DSSETUP_DSROLEGETDCOPERATIONPROGRESS: {
-                       struct dssetup_DsRoleGetDcOperationProgress *r = _r;
+                       struct dssetup_DsRoleGetDcOperationProgress *r = (struct dssetup_DsRoleGetDcOperationProgress *)_r;
                        r->out.result = _dssetup_DsRoleGetDcOperationProgress(cli->pipes_struct, r);
                        return NT_STATUS_OK;
                }
 
                case NDR_DSSETUP_DSROLEGETDCOPERATIONRESULTS: {
-                       struct dssetup_DsRoleGetDcOperationResults *r = _r;
+                       struct dssetup_DsRoleGetDcOperationResults *r = (struct dssetup_DsRoleGetDcOperationResults *)_r;
                        r->out.result = _dssetup_DsRoleGetDcOperationResults(cli->pipes_struct, r);
                        return NT_STATUS_OK;
                }
 
                case NDR_DSSETUP_DSROLECANCEL: {
-                       struct dssetup_DsRoleCancel *r = _r;
+                       struct dssetup_DsRoleCancel *r = (struct dssetup_DsRoleCancel *)_r;
                        r->out.result = _dssetup_DsRoleCancel(cli->pipes_struct, r);
                        return NT_STATUS_OK;
                }
 
                case NDR_DSSETUP_DSROLESERVERSAVESTATEFORUPGRADE: {
-                       struct dssetup_DsRoleServerSaveStateForUpgrade *r = _r;
+                       struct dssetup_DsRoleServerSaveStateForUpgrade *r = (struct dssetup_DsRoleServerSaveStateForUpgrade *)_r;
                        r->out.result = _dssetup_DsRoleServerSaveStateForUpgrade(cli->pipes_struct, r);
                        return NT_STATUS_OK;
                }
 
                case NDR_DSSETUP_DSROLEUPGRADEDOWNLEVELSERVER: {
-                       struct dssetup_DsRoleUpgradeDownlevelServer *r = _r;
+                       struct dssetup_DsRoleUpgradeDownlevelServer *r = (struct dssetup_DsRoleUpgradeDownlevelServer *)_r;
                        r->out.result = _dssetup_DsRoleUpgradeDownlevelServer(cli->pipes_struct, r);
                        return NT_STATUS_OK;
                }
 
                case NDR_DSSETUP_DSROLEABORTDOWNLEVELSERVERUPGRADE: {
-                       struct dssetup_DsRoleAbortDownlevelServerUpgrade *r = _r;
+                       struct dssetup_DsRoleAbortDownlevelServerUpgrade *r = (struct dssetup_DsRoleAbortDownlevelServerUpgrade *)_r;
                        r->out.result = _dssetup_DsRoleAbortDownlevelServerUpgrade(cli->pipes_struct, r);
                        return NT_STATUS_OK;
                }
@@ -926,5 +926,5 @@ NTSTATUS rpc_dssetup_dispatch(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx,
 
 NTSTATUS rpc_dssetup_init(void)
 {
-       return rpc_srv_register(SMB_RPC_INTERFACE_VERSION, "dssetup", "dssetup", &ndr_table_dssetup, api_dssetup_cmds, sizeof(api_dssetup_cmds) / sizeof(struct api_struct));
+       return rpc_srv_register(SMB_RPC_INTERFACE_VERSION, "dssetup", "dssetup", NDR_DSSETUP_UUID, NDR_DSSETUP_VERSION, api_dssetup_cmds, sizeof(api_dssetup_cmds) / sizeof(struct api_struct));
 }