1
/* server functions auto-generated by pidl */
2
#include "librpc/gen_ndr/ndr_initshutdown.h"
4
/* initshutdown - dcerpc server boilerplate generated by pidl */
7
static NTSTATUS initshutdown__op_bind(struct dcesrv_call_state *dce_call, const struct dcesrv_interface *iface, uint32_t if_version)
9
#ifdef DCESRV_INTERFACE_INITSHUTDOWN_BIND
10
return DCESRV_INTERFACE_INITSHUTDOWN_BIND(dce_call,iface);
16
static void initshutdown__op_unbind(struct dcesrv_connection_context *context, const struct dcesrv_interface *iface)
18
#ifdef DCESRV_INTERFACE_INITSHUTDOWN_UNBIND
19
DCESRV_INTERFACE_INITSHUTDOWN_UNBIND(context, iface);
25
static NTSTATUS initshutdown__op_ndr_pull(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx, struct ndr_pull *pull, void **r)
27
enum ndr_err_code ndr_err;
28
uint16_t opnum = dce_call->pkt.u.request.opnum;
30
dce_call->fault_code = 0;
32
if (opnum >= ndr_table_initshutdown.num_calls) {
33
dce_call->fault_code = DCERPC_FAULT_OP_RNG_ERROR;
34
return NT_STATUS_NET_WRITE_FAULT;
37
*r = talloc_named(mem_ctx,
38
ndr_table_initshutdown.calls[opnum].struct_size,
40
ndr_table_initshutdown.calls[opnum].name);
41
NT_STATUS_HAVE_NO_MEMORY(*r);
43
/* unravel the NDR for the packet */
44
ndr_err = ndr_table_initshutdown.calls[opnum].ndr_pull(pull, NDR_IN, *r);
45
if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
46
dcerpc_log_packet(dce_call->conn->packet_log_dir,
47
&ndr_table_initshutdown, opnum, NDR_IN,
48
&dce_call->pkt.u.request.stub_and_verifier);
49
dce_call->fault_code = DCERPC_FAULT_NDR;
50
return NT_STATUS_NET_WRITE_FAULT;
56
static NTSTATUS initshutdown__op_dispatch(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx, void *r)
58
uint16_t opnum = dce_call->pkt.u.request.opnum;
62
struct initshutdown_Init *r2 = (struct initshutdown_Init *)r;
63
if (DEBUGLEVEL >= 10) {
64
NDR_PRINT_FUNCTION_DEBUG(initshutdown_Init, NDR_IN, r2);
66
r2->out.result = dcesrv_initshutdown_Init(dce_call, mem_ctx, r2);
67
if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
68
DEBUG(5,("function initshutdown_Init will reply async\n"));
73
struct initshutdown_Abort *r2 = (struct initshutdown_Abort *)r;
74
if (DEBUGLEVEL >= 10) {
75
NDR_PRINT_FUNCTION_DEBUG(initshutdown_Abort, NDR_IN, r2);
77
r2->out.result = dcesrv_initshutdown_Abort(dce_call, mem_ctx, r2);
78
if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
79
DEBUG(5,("function initshutdown_Abort will reply async\n"));
84
struct initshutdown_InitEx *r2 = (struct initshutdown_InitEx *)r;
85
if (DEBUGLEVEL >= 10) {
86
NDR_PRINT_FUNCTION_DEBUG(initshutdown_InitEx, NDR_IN, r2);
88
r2->out.result = dcesrv_initshutdown_InitEx(dce_call, mem_ctx, r2);
89
if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
90
DEBUG(5,("function initshutdown_InitEx will reply async\n"));
96
dce_call->fault_code = DCERPC_FAULT_OP_RNG_ERROR;
100
if (dce_call->fault_code != 0) {
101
dcerpc_log_packet(dce_call->conn->packet_log_dir,
102
&ndr_table_initshutdown, opnum, NDR_IN,
103
&dce_call->pkt.u.request.stub_and_verifier);
104
return NT_STATUS_NET_WRITE_FAULT;
110
static NTSTATUS initshutdown__op_reply(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx, void *r)
112
uint16_t opnum = dce_call->pkt.u.request.opnum;
116
struct initshutdown_Init *r2 = (struct initshutdown_Init *)r;
117
if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
118
DEBUG(5,("function initshutdown_Init replied async\n"));
120
if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
121
NDR_PRINT_FUNCTION_DEBUG(initshutdown_Init, NDR_OUT | NDR_SET_VALUES, r2);
123
if (dce_call->fault_code != 0) {
124
DEBUG(2,("dcerpc_fault %s in initshutdown_Init\n", dcerpc_errstr(mem_ctx, dce_call->fault_code)));
129
struct initshutdown_Abort *r2 = (struct initshutdown_Abort *)r;
130
if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
131
DEBUG(5,("function initshutdown_Abort replied async\n"));
133
if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
134
NDR_PRINT_FUNCTION_DEBUG(initshutdown_Abort, NDR_OUT | NDR_SET_VALUES, r2);
136
if (dce_call->fault_code != 0) {
137
DEBUG(2,("dcerpc_fault %s in initshutdown_Abort\n", dcerpc_errstr(mem_ctx, dce_call->fault_code)));
142
struct initshutdown_InitEx *r2 = (struct initshutdown_InitEx *)r;
143
if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
144
DEBUG(5,("function initshutdown_InitEx replied async\n"));
146
if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
147
NDR_PRINT_FUNCTION_DEBUG(initshutdown_InitEx, NDR_OUT | NDR_SET_VALUES, r2);
149
if (dce_call->fault_code != 0) {
150
DEBUG(2,("dcerpc_fault %s in initshutdown_InitEx\n", dcerpc_errstr(mem_ctx, dce_call->fault_code)));
156
dce_call->fault_code = DCERPC_FAULT_OP_RNG_ERROR;
160
if (dce_call->fault_code != 0) {
161
dcerpc_log_packet(dce_call->conn->packet_log_dir,
162
&ndr_table_initshutdown, opnum, NDR_IN,
163
&dce_call->pkt.u.request.stub_and_verifier);
164
return NT_STATUS_NET_WRITE_FAULT;
170
static NTSTATUS initshutdown__op_ndr_push(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx, struct ndr_push *push, const void *r)
172
enum ndr_err_code ndr_err;
173
uint16_t opnum = dce_call->pkt.u.request.opnum;
175
ndr_err = ndr_table_initshutdown.calls[opnum].ndr_push(push, NDR_OUT, r);
176
if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
177
dce_call->fault_code = DCERPC_FAULT_NDR;
178
return NT_STATUS_NET_WRITE_FAULT;
184
const struct dcesrv_interface dcesrv_initshutdown_interface = {
185
.name = "initshutdown",
186
.syntax_id = {{0x894de0c0,0x0d55,0x11d3,{0xa3,0x22},{0x00,0xc0,0x4f,0xa3,0x21,0xa1}},1.0},
187
.bind = initshutdown__op_bind,
188
.unbind = initshutdown__op_unbind,
189
.ndr_pull = initshutdown__op_ndr_pull,
190
.dispatch = initshutdown__op_dispatch,
191
.reply = initshutdown__op_reply,
192
.ndr_push = initshutdown__op_ndr_push
196
static NTSTATUS initshutdown__op_init_server(struct dcesrv_context *dce_ctx, const struct dcesrv_endpoint_server *ep_server)
200
for (i=0;i<ndr_table_initshutdown.endpoints->count;i++) {
202
const char *name = ndr_table_initshutdown.endpoints->names[i];
204
ret = dcesrv_interface_register(dce_ctx, name, &dcesrv_initshutdown_interface, NULL);
205
if (!NT_STATUS_IS_OK(ret)) {
206
DEBUG(1,("initshutdown_op_init_server: failed to register endpoint '%s'\n",name));
214
static bool initshutdown__op_interface_by_uuid(struct dcesrv_interface *iface, const struct GUID *uuid, uint32_t if_version)
216
if (dcesrv_initshutdown_interface.syntax_id.if_version == if_version &&
217
GUID_equal(&dcesrv_initshutdown_interface.syntax_id.uuid, uuid)) {
218
memcpy(iface,&dcesrv_initshutdown_interface, sizeof(*iface));
225
static bool initshutdown__op_interface_by_name(struct dcesrv_interface *iface, const char *name)
227
if (strcmp(dcesrv_initshutdown_interface.name, name)==0) {
228
memcpy(iface, &dcesrv_initshutdown_interface, sizeof(*iface));
235
NTSTATUS dcerpc_server_initshutdown_init(void)
238
struct dcesrv_endpoint_server ep_server;
240
/* fill in our name */
241
ep_server.name = "initshutdown";
243
/* fill in all the operations */
244
ep_server.init_server = initshutdown__op_init_server;
246
ep_server.interface_by_uuid = initshutdown__op_interface_by_uuid;
247
ep_server.interface_by_name = initshutdown__op_interface_by_name;
249
/* register ourselves with the DCERPC subsystem. */
250
ret = dcerpc_register_ep_server(&ep_server);
252
if (!NT_STATUS_IS_OK(ret)) {
253
DEBUG(0,("Failed to register 'initshutdown' endpoint server!\n"));