Пример #1
0
static NTSTATUS scerpc__op_dispatch(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx, void *r)
{
	uint16_t opnum = dce_call->pkt.u.request.opnum;

	switch (opnum) {
	case 0: {
		struct scerpc_Unknown0 *r2 = (struct scerpc_Unknown0 *)r;
		if (DEBUGLEVEL >= 10) {
			NDR_PRINT_FUNCTION_DEBUG(scerpc_Unknown0, NDR_IN, r2);
		}
		r2->out.result = dcesrv_scerpc_Unknown0(dce_call, mem_ctx, r2);
		if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
			DEBUG(5,("function scerpc_Unknown0 will reply async\n"));
		}
		break;
	}

	default:
		dce_call->fault_code = DCERPC_FAULT_OP_RNG_ERROR;
		break;
	}

	if (dce_call->fault_code != 0) {
		dcerpc_log_packet(dce_call->conn->packet_log_dir, 
		          &ndr_table_scerpc, opnum, NDR_IN,
				  &dce_call->pkt.u.request.stub_and_verifier);
		return NT_STATUS_NET_WRITE_FAULT;
	}

	return NT_STATUS_OK;
}
Пример #2
0
static NTSTATUS dnsp__op_reply(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx, void *r)
{
	uint16_t opnum = dce_call->pkt.u.request.opnum;

	switch (opnum) {
	case 0: {
		struct decode_DnssrvRpcRecord *r2 = (struct decode_DnssrvRpcRecord *)r;
		if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
			DEBUG(5,("function decode_DnssrvRpcRecord replied async\n"));
		}
		if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
			NDR_PRINT_FUNCTION_DEBUG(decode_DnssrvRpcRecord, NDR_OUT | NDR_SET_VALUES, r2);
		}
		if (dce_call->fault_code != 0) {
			DEBUG(2,("dcerpc_fault %s in decode_DnssrvRpcRecord\n", dcerpc_errstr(mem_ctx, dce_call->fault_code)));
		}
		break;
	}

	default:
		dce_call->fault_code = DCERPC_FAULT_OP_RNG_ERROR;
		break;
	}

	if (dce_call->fault_code != 0) {
		dcerpc_log_packet(dce_call->conn->packet_log_dir,
		          &ndr_table_dnsp, opnum, NDR_IN,
				  &dce_call->pkt.u.request.stub_and_verifier);
		return NT_STATUS_NET_WRITE_FAULT;
	}

	return NT_STATUS_OK;
}
Пример #3
0
static NTSTATUS w32time__op_ndr_pull(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx, struct ndr_pull *pull, void **r)
{
	enum ndr_err_code ndr_err;
	uint16_t opnum = dce_call->pkt.u.request.opnum;

	dce_call->fault_code = 0;

	if (opnum >= ndr_table_w32time.num_calls) {
		dce_call->fault_code = DCERPC_FAULT_OP_RNG_ERROR;
		return NT_STATUS_NET_WRITE_FAULT;
	}

	*r = talloc_named(mem_ctx,
			  ndr_table_w32time.calls[opnum].struct_size,
			  "struct %s",
			  ndr_table_w32time.calls[opnum].name);
	NT_STATUS_HAVE_NO_MEMORY(*r);

        /* unravel the NDR for the packet */
	ndr_err = ndr_table_w32time.calls[opnum].ndr_pull(pull, NDR_IN, *r);
	if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
		dcerpc_log_packet(dce_call->conn->packet_log_dir, 
				  &ndr_table_w32time, opnum, NDR_IN,
				  &dce_call->pkt.u.request.stub_and_verifier);
		dce_call->fault_code = DCERPC_FAULT_NDR;
		return NT_STATUS_NET_WRITE_FAULT;
	}

	return NT_STATUS_OK;
}
Пример #4
0
static NTSTATUS w32time__op_reply(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx, void *r)
{
	uint16_t opnum = dce_call->pkt.u.request.opnum;

	switch (opnum) {
	case 0: {
		struct w32time_SyncTime *r2 = (struct w32time_SyncTime *)r;
		if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
			DEBUG(5,("function w32time_SyncTime replied async\n"));
		}
		if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
			NDR_PRINT_FUNCTION_DEBUG(w32time_SyncTime, NDR_OUT | NDR_SET_VALUES, r2);
		}
		if (dce_call->fault_code != 0) {
			DEBUG(2,("dcerpc_fault %s in w32time_SyncTime\n", dcerpc_errstr(mem_ctx, dce_call->fault_code)));
		}
		break;
	}
	case 1: {
		struct w32time_GetNetLogonServiceBits *r2 = (struct w32time_GetNetLogonServiceBits *)r;
		if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
			DEBUG(5,("function w32time_GetNetLogonServiceBits replied async\n"));
		}
		if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
			NDR_PRINT_FUNCTION_DEBUG(w32time_GetNetLogonServiceBits, NDR_OUT | NDR_SET_VALUES, r2);
		}
		if (dce_call->fault_code != 0) {
			DEBUG(2,("dcerpc_fault %s in w32time_GetNetLogonServiceBits\n", dcerpc_errstr(mem_ctx, dce_call->fault_code)));
		}
		break;
	}
	case 2: {
		struct w32time_QueryProviderStatus *r2 = (struct w32time_QueryProviderStatus *)r;
		if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
			DEBUG(5,("function w32time_QueryProviderStatus replied async\n"));
		}
		if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
			NDR_PRINT_FUNCTION_DEBUG(w32time_QueryProviderStatus, NDR_OUT | NDR_SET_VALUES, r2);
		}
		if (dce_call->fault_code != 0) {
			DEBUG(2,("dcerpc_fault %s in w32time_QueryProviderStatus\n", dcerpc_errstr(mem_ctx, dce_call->fault_code)));
		}
		break;
	}

	default:
		dce_call->fault_code = DCERPC_FAULT_OP_RNG_ERROR;
		break;
	}

	if (dce_call->fault_code != 0) {
		dcerpc_log_packet(dce_call->conn->packet_log_dir,
		          &ndr_table_w32time, opnum, NDR_IN,
				  &dce_call->pkt.u.request.stub_and_verifier);
		return NT_STATUS_NET_WRITE_FAULT;
	}

	return NT_STATUS_OK;
}
Пример #5
0
static NTSTATUS ntprinting__op_dispatch(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx, void *r)
{
	uint16_t opnum = dce_call->pkt.u.request.opnum;

	switch (opnum) {
	case 0: {
		struct decode_ntprinting_form *r2 = (struct decode_ntprinting_form *)r;
		if (DEBUGLEVEL >= 10) {
			NDR_PRINT_FUNCTION_DEBUG(decode_ntprinting_form, NDR_IN, r2);
		}
		dcesrv_decode_ntprinting_form(dce_call, mem_ctx, r2);
		if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
			DEBUG(5,("function decode_ntprinting_form will reply async\n"));
		}
		break;
	}
	case 1: {
		struct decode_ntprinting_driver *r2 = (struct decode_ntprinting_driver *)r;
		if (DEBUGLEVEL >= 10) {
			NDR_PRINT_FUNCTION_DEBUG(decode_ntprinting_driver, NDR_IN, r2);
		}
		dcesrv_decode_ntprinting_driver(dce_call, mem_ctx, r2);
		if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
			DEBUG(5,("function decode_ntprinting_driver will reply async\n"));
		}
		break;
	}
	case 2: {
		struct decode_ntprinting_printer *r2 = (struct decode_ntprinting_printer *)r;
		if (DEBUGLEVEL >= 10) {
			NDR_PRINT_FUNCTION_DEBUG(decode_ntprinting_printer, NDR_IN, r2);
		}
		dcesrv_decode_ntprinting_printer(dce_call, mem_ctx, r2);
		if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
			DEBUG(5,("function decode_ntprinting_printer will reply async\n"));
		}
		break;
	}

	default:
		dce_call->fault_code = DCERPC_FAULT_OP_RNG_ERROR;
		break;
	}

	if (dce_call->fault_code != 0) {
		dcerpc_log_packet(dce_call->conn->packet_log_dir, 
		          &ndr_table_ntprinting, opnum, NDR_IN,
				  &dce_call->pkt.u.request.stub_and_verifier);
		return NT_STATUS_NET_WRITE_FAULT;
	}

	return NT_STATUS_OK;
}
Пример #6
0
static NTSTATUS remote_op_ndr_pull(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx, struct ndr_pull *pull, void **r)
{
	enum ndr_err_code ndr_err;
	const struct ndr_interface_table *table = (const struct ndr_interface_table *)dce_call->context->iface->private_data;
	uint16_t opnum = dce_call->pkt.u.request.opnum;

	dce_call->fault_code = 0;

	if (opnum >= table->num_calls) {
		dce_call->fault_code = DCERPC_FAULT_OP_RNG_ERROR;
		return NT_STATUS_NET_WRITE_FAULT;
	}

	/*
	 * We don't have support for calls with pipes.
	 */
	if (table->calls[opnum].in_pipes.num_pipes != 0) {
		dce_call->fault_code = DCERPC_FAULT_OP_RNG_ERROR;
		return NT_STATUS_NET_WRITE_FAULT;
	}
	if (table->calls[opnum].out_pipes.num_pipes != 0) {
		dce_call->fault_code = DCERPC_FAULT_OP_RNG_ERROR;
		return NT_STATUS_NET_WRITE_FAULT;
	}

	*r = talloc_size(mem_ctx, table->calls[opnum].struct_size);
	if (!*r) {
		return NT_STATUS_NO_MEMORY;
	}

        /* unravel the NDR for the packet */
	ndr_err = table->calls[opnum].ndr_pull(pull, NDR_IN, *r);
	if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
		dcerpc_log_packet(dce_call->conn->packet_log_dir,
						  table, opnum, NDR_IN,
				  &dce_call->pkt.u.request.stub_and_verifier);
		dce_call->fault_code = DCERPC_FAULT_NDR;
		return NT_STATUS_NET_WRITE_FAULT;
	}

	return NT_STATUS_OK;
}
Пример #7
0
static NTSTATUS ntlmssp__op_dispatch(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx, void *r)
{
	uint16_t opnum = dce_call->pkt.u.request.opnum;

	switch (opnum) {
	case 0: {
		struct decode_NEGOTIATE_MESSAGE *r2 = (struct decode_NEGOTIATE_MESSAGE *)r;
		if (DEBUGLEVEL >= 10) {
			NDR_PRINT_FUNCTION_DEBUG(decode_NEGOTIATE_MESSAGE, NDR_IN, r2);
		}
		dcesrv_decode_NEGOTIATE_MESSAGE(dce_call, mem_ctx, r2);
		if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
			DEBUG(5,("function decode_NEGOTIATE_MESSAGE will reply async\n"));
		}
		break;
	}
	case 1: {
		struct decode_CHALLENGE_MESSAGE *r2 = (struct decode_CHALLENGE_MESSAGE *)r;
		if (DEBUGLEVEL >= 10) {
			NDR_PRINT_FUNCTION_DEBUG(decode_CHALLENGE_MESSAGE, NDR_IN, r2);
		}
		dcesrv_decode_CHALLENGE_MESSAGE(dce_call, mem_ctx, r2);
		if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
			DEBUG(5,("function decode_CHALLENGE_MESSAGE will reply async\n"));
		}
		break;
	}
	case 2: {
		struct decode_AUTHENTICATE_MESSAGE *r2 = (struct decode_AUTHENTICATE_MESSAGE *)r;
		if (DEBUGLEVEL >= 10) {
			NDR_PRINT_FUNCTION_DEBUG(decode_AUTHENTICATE_MESSAGE, NDR_IN, r2);
		}
		dcesrv_decode_AUTHENTICATE_MESSAGE(dce_call, mem_ctx, r2);
		if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
			DEBUG(5,("function decode_AUTHENTICATE_MESSAGE will reply async\n"));
		}
		break;
	}
	case 3: {
		struct decode_NTLMv2_CLIENT_CHALLENGE *r2 = (struct decode_NTLMv2_CLIENT_CHALLENGE *)r;
		if (DEBUGLEVEL >= 10) {
			NDR_PRINT_FUNCTION_DEBUG(decode_NTLMv2_CLIENT_CHALLENGE, NDR_IN, r2);
		}
		dcesrv_decode_NTLMv2_CLIENT_CHALLENGE(dce_call, mem_ctx, r2);
		if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
			DEBUG(5,("function decode_NTLMv2_CLIENT_CHALLENGE will reply async\n"));
		}
		break;
	}
	case 4: {
		struct decode_NTLMv2_RESPONSE *r2 = (struct decode_NTLMv2_RESPONSE *)r;
		if (DEBUGLEVEL >= 10) {
			NDR_PRINT_FUNCTION_DEBUG(decode_NTLMv2_RESPONSE, NDR_IN, r2);
		}
		dcesrv_decode_NTLMv2_RESPONSE(dce_call, mem_ctx, r2);
		if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
			DEBUG(5,("function decode_NTLMv2_RESPONSE will reply async\n"));
		}
		break;
	}

	default:
		dce_call->fault_code = DCERPC_FAULT_OP_RNG_ERROR;
		break;
	}

	if (dce_call->fault_code != 0) {
		dcerpc_log_packet(dce_call->conn->packet_log_dir, 
		          &ndr_table_ntlmssp, opnum, NDR_IN,
				  &dce_call->pkt.u.request.stub_and_verifier);
		return NT_STATUS_NET_WRITE_FAULT;
	}

	return NT_STATUS_OK;
}
Пример #8
0
static NTSTATUS wkssvc__op_dispatch(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx, void *r)
{
	uint16_t opnum = dce_call->pkt.u.request.opnum;

	switch (opnum) {
	case 0: {
		struct wkssvc_NetWkstaGetInfo *r2 = (struct wkssvc_NetWkstaGetInfo *)r;
		if (DEBUGLEVEL >= 10) {
			NDR_PRINT_FUNCTION_DEBUG(wkssvc_NetWkstaGetInfo, NDR_IN, r2);
		}
		r2->out.result = dcesrv_wkssvc_NetWkstaGetInfo(dce_call, mem_ctx, r2);
		if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
			DEBUG(5,("function wkssvc_NetWkstaGetInfo will reply async\n"));
		}
		break;
	}
	case 1: {
		struct wkssvc_NetWkstaSetInfo *r2 = (struct wkssvc_NetWkstaSetInfo *)r;
		if (DEBUGLEVEL >= 10) {
			NDR_PRINT_FUNCTION_DEBUG(wkssvc_NetWkstaSetInfo, NDR_IN, r2);
		}
		r2->out.result = dcesrv_wkssvc_NetWkstaSetInfo(dce_call, mem_ctx, r2);
		if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
			DEBUG(5,("function wkssvc_NetWkstaSetInfo will reply async\n"));
		}
		break;
	}
	case 2: {
		struct wkssvc_NetWkstaEnumUsers *r2 = (struct wkssvc_NetWkstaEnumUsers *)r;
		if (DEBUGLEVEL >= 10) {
			NDR_PRINT_FUNCTION_DEBUG(wkssvc_NetWkstaEnumUsers, NDR_IN, r2);
		}
		r2->out.result = dcesrv_wkssvc_NetWkstaEnumUsers(dce_call, mem_ctx, r2);
		if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
			DEBUG(5,("function wkssvc_NetWkstaEnumUsers will reply async\n"));
		}
		break;
	}
	case 3: {
		struct wkssvc_NetrWkstaUserGetInfo *r2 = (struct wkssvc_NetrWkstaUserGetInfo *)r;
		if (DEBUGLEVEL >= 10) {
			NDR_PRINT_FUNCTION_DEBUG(wkssvc_NetrWkstaUserGetInfo, NDR_IN, r2);
		}
		r2->out.result = dcesrv_wkssvc_NetrWkstaUserGetInfo(dce_call, mem_ctx, r2);
		if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
			DEBUG(5,("function wkssvc_NetrWkstaUserGetInfo will reply async\n"));
		}
		break;
	}
	case 4: {
		struct wkssvc_NetrWkstaUserSetInfo *r2 = (struct wkssvc_NetrWkstaUserSetInfo *)r;
		if (DEBUGLEVEL >= 10) {
			NDR_PRINT_FUNCTION_DEBUG(wkssvc_NetrWkstaUserSetInfo, NDR_IN, r2);
		}
		r2->out.result = dcesrv_wkssvc_NetrWkstaUserSetInfo(dce_call, mem_ctx, r2);
		if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
			DEBUG(5,("function wkssvc_NetrWkstaUserSetInfo will reply async\n"));
		}
		break;
	}
	case 5: {
		struct wkssvc_NetWkstaTransportEnum *r2 = (struct wkssvc_NetWkstaTransportEnum *)r;
		if (DEBUGLEVEL >= 10) {
			NDR_PRINT_FUNCTION_DEBUG(wkssvc_NetWkstaTransportEnum, NDR_IN, r2);
		}
		r2->out.result = dcesrv_wkssvc_NetWkstaTransportEnum(dce_call, mem_ctx, r2);
		if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
			DEBUG(5,("function wkssvc_NetWkstaTransportEnum will reply async\n"));
		}
		break;
	}
	case 6: {
		struct wkssvc_NetrWkstaTransportAdd *r2 = (struct wkssvc_NetrWkstaTransportAdd *)r;
		if (DEBUGLEVEL >= 10) {
			NDR_PRINT_FUNCTION_DEBUG(wkssvc_NetrWkstaTransportAdd, NDR_IN, r2);
		}
		r2->out.result = dcesrv_wkssvc_NetrWkstaTransportAdd(dce_call, mem_ctx, r2);
		if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
			DEBUG(5,("function wkssvc_NetrWkstaTransportAdd will reply async\n"));
		}
		break;
	}
	case 7: {
		struct wkssvc_NetrWkstaTransportDel *r2 = (struct wkssvc_NetrWkstaTransportDel *)r;
		if (DEBUGLEVEL >= 10) {
			NDR_PRINT_FUNCTION_DEBUG(wkssvc_NetrWkstaTransportDel, NDR_IN, r2);
		}
		r2->out.result = dcesrv_wkssvc_NetrWkstaTransportDel(dce_call, mem_ctx, r2);
		if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
			DEBUG(5,("function wkssvc_NetrWkstaTransportDel will reply async\n"));
		}
		break;
	}
	case 8: {
		struct wkssvc_NetrUseAdd *r2 = (struct wkssvc_NetrUseAdd *)r;
		if (DEBUGLEVEL >= 10) {
			NDR_PRINT_FUNCTION_DEBUG(wkssvc_NetrUseAdd, NDR_IN, r2);
		}
		r2->out.result = dcesrv_wkssvc_NetrUseAdd(dce_call, mem_ctx, r2);
		if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
			DEBUG(5,("function wkssvc_NetrUseAdd will reply async\n"));
		}
		break;
	}
	case 9: {
		struct wkssvc_NetrUseGetInfo *r2 = (struct wkssvc_NetrUseGetInfo *)r;
		if (DEBUGLEVEL >= 10) {
			NDR_PRINT_FUNCTION_DEBUG(wkssvc_NetrUseGetInfo, NDR_IN, r2);
		}
		r2->out.result = dcesrv_wkssvc_NetrUseGetInfo(dce_call, mem_ctx, r2);
		if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
			DEBUG(5,("function wkssvc_NetrUseGetInfo will reply async\n"));
		}
		break;
	}
	case 10: {
		struct wkssvc_NetrUseDel *r2 = (struct wkssvc_NetrUseDel *)r;
		if (DEBUGLEVEL >= 10) {
			NDR_PRINT_FUNCTION_DEBUG(wkssvc_NetrUseDel, NDR_IN, r2);
		}
		r2->out.result = dcesrv_wkssvc_NetrUseDel(dce_call, mem_ctx, r2);
		if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
			DEBUG(5,("function wkssvc_NetrUseDel will reply async\n"));
		}
		break;
	}
	case 11: {
		struct wkssvc_NetrUseEnum *r2 = (struct wkssvc_NetrUseEnum *)r;
		if (DEBUGLEVEL >= 10) {
			NDR_PRINT_FUNCTION_DEBUG(wkssvc_NetrUseEnum, NDR_IN, r2);
		}
		r2->out.result = dcesrv_wkssvc_NetrUseEnum(dce_call, mem_ctx, r2);
		if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
			DEBUG(5,("function wkssvc_NetrUseEnum will reply async\n"));
		}
		break;
	}
	case 12: {
		struct wkssvc_NetrMessageBufferSend *r2 = (struct wkssvc_NetrMessageBufferSend *)r;
		if (DEBUGLEVEL >= 10) {
			NDR_PRINT_FUNCTION_DEBUG(wkssvc_NetrMessageBufferSend, NDR_IN, r2);
		}
		r2->out.result = dcesrv_wkssvc_NetrMessageBufferSend(dce_call, mem_ctx, r2);
		if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
			DEBUG(5,("function wkssvc_NetrMessageBufferSend will reply async\n"));
		}
		break;
	}
	case 13: {
		struct wkssvc_NetrWorkstationStatisticsGet *r2 = (struct wkssvc_NetrWorkstationStatisticsGet *)r;
		if (DEBUGLEVEL >= 10) {
			NDR_PRINT_FUNCTION_DEBUG(wkssvc_NetrWorkstationStatisticsGet, NDR_IN, r2);
		}
		r2->out.result = dcesrv_wkssvc_NetrWorkstationStatisticsGet(dce_call, mem_ctx, r2);
		if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
			DEBUG(5,("function wkssvc_NetrWorkstationStatisticsGet will reply async\n"));
		}
		break;
	}
	case 14: {
		struct wkssvc_NetrLogonDomainNameAdd *r2 = (struct wkssvc_NetrLogonDomainNameAdd *)r;
		if (DEBUGLEVEL >= 10) {
			NDR_PRINT_FUNCTION_DEBUG(wkssvc_NetrLogonDomainNameAdd, NDR_IN, r2);
		}
		r2->out.result = dcesrv_wkssvc_NetrLogonDomainNameAdd(dce_call, mem_ctx, r2);
		if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
			DEBUG(5,("function wkssvc_NetrLogonDomainNameAdd will reply async\n"));
		}
		break;
	}
	case 15: {
		struct wkssvc_NetrLogonDomainNameDel *r2 = (struct wkssvc_NetrLogonDomainNameDel *)r;
		if (DEBUGLEVEL >= 10) {
			NDR_PRINT_FUNCTION_DEBUG(wkssvc_NetrLogonDomainNameDel, NDR_IN, r2);
		}
		r2->out.result = dcesrv_wkssvc_NetrLogonDomainNameDel(dce_call, mem_ctx, r2);
		if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
			DEBUG(5,("function wkssvc_NetrLogonDomainNameDel will reply async\n"));
		}
		break;
	}
	case 16: {
		struct wkssvc_NetrJoinDomain *r2 = (struct wkssvc_NetrJoinDomain *)r;
		if (DEBUGLEVEL >= 10) {
			NDR_PRINT_FUNCTION_DEBUG(wkssvc_NetrJoinDomain, NDR_IN, r2);
		}
		r2->out.result = dcesrv_wkssvc_NetrJoinDomain(dce_call, mem_ctx, r2);
		if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
			DEBUG(5,("function wkssvc_NetrJoinDomain will reply async\n"));
		}
		break;
	}
	case 17: {
		struct wkssvc_NetrUnjoinDomain *r2 = (struct wkssvc_NetrUnjoinDomain *)r;
		if (DEBUGLEVEL >= 10) {
			NDR_PRINT_FUNCTION_DEBUG(wkssvc_NetrUnjoinDomain, NDR_IN, r2);
		}
		r2->out.result = dcesrv_wkssvc_NetrUnjoinDomain(dce_call, mem_ctx, r2);
		if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
			DEBUG(5,("function wkssvc_NetrUnjoinDomain will reply async\n"));
		}
		break;
	}
	case 18: {
		struct wkssvc_NetrRenameMachineInDomain *r2 = (struct wkssvc_NetrRenameMachineInDomain *)r;
		if (DEBUGLEVEL >= 10) {
			NDR_PRINT_FUNCTION_DEBUG(wkssvc_NetrRenameMachineInDomain, NDR_IN, r2);
		}
		r2->out.result = dcesrv_wkssvc_NetrRenameMachineInDomain(dce_call, mem_ctx, r2);
		if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
			DEBUG(5,("function wkssvc_NetrRenameMachineInDomain will reply async\n"));
		}
		break;
	}
	case 19: {
		struct wkssvc_NetrValidateName *r2 = (struct wkssvc_NetrValidateName *)r;
		if (DEBUGLEVEL >= 10) {
			NDR_PRINT_FUNCTION_DEBUG(wkssvc_NetrValidateName, NDR_IN, r2);
		}
		r2->out.result = dcesrv_wkssvc_NetrValidateName(dce_call, mem_ctx, r2);
		if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
			DEBUG(5,("function wkssvc_NetrValidateName will reply async\n"));
		}
		break;
	}
	case 20: {
		struct wkssvc_NetrGetJoinInformation *r2 = (struct wkssvc_NetrGetJoinInformation *)r;
		if (DEBUGLEVEL >= 10) {
			NDR_PRINT_FUNCTION_DEBUG(wkssvc_NetrGetJoinInformation, NDR_IN, r2);
		}
		r2->out.result = dcesrv_wkssvc_NetrGetJoinInformation(dce_call, mem_ctx, r2);
		if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
			DEBUG(5,("function wkssvc_NetrGetJoinInformation will reply async\n"));
		}
		break;
	}
	case 21: {
		struct wkssvc_NetrGetJoinableOus *r2 = (struct wkssvc_NetrGetJoinableOus *)r;
		if (DEBUGLEVEL >= 10) {
			NDR_PRINT_FUNCTION_DEBUG(wkssvc_NetrGetJoinableOus, NDR_IN, r2);
		}
		r2->out.result = dcesrv_wkssvc_NetrGetJoinableOus(dce_call, mem_ctx, r2);
		if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
			DEBUG(5,("function wkssvc_NetrGetJoinableOus will reply async\n"));
		}
		break;
	}
	case 22: {
		struct wkssvc_NetrJoinDomain2 *r2 = (struct wkssvc_NetrJoinDomain2 *)r;
		if (DEBUGLEVEL >= 10) {
			NDR_PRINT_FUNCTION_DEBUG(wkssvc_NetrJoinDomain2, NDR_IN, r2);
		}
		r2->out.result = dcesrv_wkssvc_NetrJoinDomain2(dce_call, mem_ctx, r2);
		if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
			DEBUG(5,("function wkssvc_NetrJoinDomain2 will reply async\n"));
		}
		break;
	}
	case 23: {
		struct wkssvc_NetrUnjoinDomain2 *r2 = (struct wkssvc_NetrUnjoinDomain2 *)r;
		if (DEBUGLEVEL >= 10) {
			NDR_PRINT_FUNCTION_DEBUG(wkssvc_NetrUnjoinDomain2, NDR_IN, r2);
		}
		r2->out.result = dcesrv_wkssvc_NetrUnjoinDomain2(dce_call, mem_ctx, r2);
		if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
			DEBUG(5,("function wkssvc_NetrUnjoinDomain2 will reply async\n"));
		}
		break;
	}
	case 24: {
		struct wkssvc_NetrRenameMachineInDomain2 *r2 = (struct wkssvc_NetrRenameMachineInDomain2 *)r;
		if (DEBUGLEVEL >= 10) {
			NDR_PRINT_FUNCTION_DEBUG(wkssvc_NetrRenameMachineInDomain2, NDR_IN, r2);
		}
		r2->out.result = dcesrv_wkssvc_NetrRenameMachineInDomain2(dce_call, mem_ctx, r2);
		if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
			DEBUG(5,("function wkssvc_NetrRenameMachineInDomain2 will reply async\n"));
		}
		break;
	}
	case 25: {
		struct wkssvc_NetrValidateName2 *r2 = (struct wkssvc_NetrValidateName2 *)r;
		if (DEBUGLEVEL >= 10) {
			NDR_PRINT_FUNCTION_DEBUG(wkssvc_NetrValidateName2, NDR_IN, r2);
		}
		r2->out.result = dcesrv_wkssvc_NetrValidateName2(dce_call, mem_ctx, r2);
		if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
			DEBUG(5,("function wkssvc_NetrValidateName2 will reply async\n"));
		}
		break;
	}
	case 26: {
		struct wkssvc_NetrGetJoinableOus2 *r2 = (struct wkssvc_NetrGetJoinableOus2 *)r;
		if (DEBUGLEVEL >= 10) {
			NDR_PRINT_FUNCTION_DEBUG(wkssvc_NetrGetJoinableOus2, NDR_IN, r2);
		}
		r2->out.result = dcesrv_wkssvc_NetrGetJoinableOus2(dce_call, mem_ctx, r2);
		if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
			DEBUG(5,("function wkssvc_NetrGetJoinableOus2 will reply async\n"));
		}
		break;
	}
	case 27: {
		struct wkssvc_NetrAddAlternateComputerName *r2 = (struct wkssvc_NetrAddAlternateComputerName *)r;
		if (DEBUGLEVEL >= 10) {
			NDR_PRINT_FUNCTION_DEBUG(wkssvc_NetrAddAlternateComputerName, NDR_IN, r2);
		}
		r2->out.result = dcesrv_wkssvc_NetrAddAlternateComputerName(dce_call, mem_ctx, r2);
		if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
			DEBUG(5,("function wkssvc_NetrAddAlternateComputerName will reply async\n"));
		}
		break;
	}
	case 28: {
		struct wkssvc_NetrRemoveAlternateComputerName *r2 = (struct wkssvc_NetrRemoveAlternateComputerName *)r;
		if (DEBUGLEVEL >= 10) {
			NDR_PRINT_FUNCTION_DEBUG(wkssvc_NetrRemoveAlternateComputerName, NDR_IN, r2);
		}
		r2->out.result = dcesrv_wkssvc_NetrRemoveAlternateComputerName(dce_call, mem_ctx, r2);
		if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
			DEBUG(5,("function wkssvc_NetrRemoveAlternateComputerName will reply async\n"));
		}
		break;
	}
	case 29: {
		struct wkssvc_NetrSetPrimaryComputername *r2 = (struct wkssvc_NetrSetPrimaryComputername *)r;
		if (DEBUGLEVEL >= 10) {
			NDR_PRINT_FUNCTION_DEBUG(wkssvc_NetrSetPrimaryComputername, NDR_IN, r2);
		}
		r2->out.result = dcesrv_wkssvc_NetrSetPrimaryComputername(dce_call, mem_ctx, r2);
		if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
			DEBUG(5,("function wkssvc_NetrSetPrimaryComputername will reply async\n"));
		}
		break;
	}
	case 30: {
		struct wkssvc_NetrEnumerateComputerNames *r2 = (struct wkssvc_NetrEnumerateComputerNames *)r;
		if (DEBUGLEVEL >= 10) {
			NDR_PRINT_FUNCTION_DEBUG(wkssvc_NetrEnumerateComputerNames, NDR_IN, r2);
		}
		r2->out.result = dcesrv_wkssvc_NetrEnumerateComputerNames(dce_call, mem_ctx, r2);
		if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
			DEBUG(5,("function wkssvc_NetrEnumerateComputerNames will reply async\n"));
		}
		break;
	}

	default:
		dce_call->fault_code = DCERPC_FAULT_OP_RNG_ERROR;
		break;
	}

	if (dce_call->fault_code != 0) {
		dcerpc_log_packet(dce_call->conn->packet_log_dir, 
		          &ndr_table_wkssvc, opnum, NDR_IN,
				  &dce_call->pkt.u.request.stub_and_verifier);
		return NT_STATUS_NET_WRITE_FAULT;
	}

	return NT_STATUS_OK;
}
Пример #9
0
static NTSTATUS eventlog6__op_dispatch(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx, void *r)
{
	uint16_t opnum = dce_call->pkt.u.request.opnum;

	switch (opnum) {
	case 0: {
		struct eventlog6_EvtRpcRegisterRemoteSubscription *r2 = (struct eventlog6_EvtRpcRegisterRemoteSubscription *)r;
		if (DEBUGLEVEL >= 10) {
			NDR_PRINT_FUNCTION_DEBUG(eventlog6_EvtRpcRegisterRemoteSubscription, NDR_IN, r2);
		}
		r2->out.result = dcesrv_eventlog6_EvtRpcRegisterRemoteSubscription(dce_call, mem_ctx, r2);
		if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
			DEBUG(5,("function eventlog6_EvtRpcRegisterRemoteSubscription will reply async\n"));
		}
		break;
	}
	case 1: {
		struct eventlog6_EvtRpcRemoteSubscriptionNextAsync *r2 = (struct eventlog6_EvtRpcRemoteSubscriptionNextAsync *)r;
		if (DEBUGLEVEL >= 10) {
			NDR_PRINT_FUNCTION_DEBUG(eventlog6_EvtRpcRemoteSubscriptionNextAsync, NDR_IN, r2);
		}
		r2->out.result = dcesrv_eventlog6_EvtRpcRemoteSubscriptionNextAsync(dce_call, mem_ctx, r2);
		if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
			DEBUG(5,("function eventlog6_EvtRpcRemoteSubscriptionNextAsync will reply async\n"));
		}
		break;
	}
	case 2: {
		struct eventlog6_EvtRpcRemoteSubscriptionNext *r2 = (struct eventlog6_EvtRpcRemoteSubscriptionNext *)r;
		if (DEBUGLEVEL >= 10) {
			NDR_PRINT_FUNCTION_DEBUG(eventlog6_EvtRpcRemoteSubscriptionNext, NDR_IN, r2);
		}
		r2->out.result = dcesrv_eventlog6_EvtRpcRemoteSubscriptionNext(dce_call, mem_ctx, r2);
		if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
			DEBUG(5,("function eventlog6_EvtRpcRemoteSubscriptionNext will reply async\n"));
		}
		break;
	}
	case 3: {
		struct eventlog6_EvtRpcRemoteSubscriptionWaitAsync *r2 = (struct eventlog6_EvtRpcRemoteSubscriptionWaitAsync *)r;
		if (DEBUGLEVEL >= 10) {
			NDR_PRINT_FUNCTION_DEBUG(eventlog6_EvtRpcRemoteSubscriptionWaitAsync, NDR_IN, r2);
		}
		r2->out.result = dcesrv_eventlog6_EvtRpcRemoteSubscriptionWaitAsync(dce_call, mem_ctx, r2);
		if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
			DEBUG(5,("function eventlog6_EvtRpcRemoteSubscriptionWaitAsync will reply async\n"));
		}
		break;
	}
	case 4: {
		struct eventlog6_EvtRpcRegisterControllableOperation *r2 = (struct eventlog6_EvtRpcRegisterControllableOperation *)r;
		if (DEBUGLEVEL >= 10) {
			NDR_PRINT_FUNCTION_DEBUG(eventlog6_EvtRpcRegisterControllableOperation, NDR_IN, r2);
		}
		r2->out.result = dcesrv_eventlog6_EvtRpcRegisterControllableOperation(dce_call, mem_ctx, r2);
		if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
			DEBUG(5,("function eventlog6_EvtRpcRegisterControllableOperation will reply async\n"));
		}
		break;
	}
	case 5: {
		struct eventlog6_EvtRpcRegisterLogQuery *r2 = (struct eventlog6_EvtRpcRegisterLogQuery *)r;
		if (DEBUGLEVEL >= 10) {
			NDR_PRINT_FUNCTION_DEBUG(eventlog6_EvtRpcRegisterLogQuery, NDR_IN, r2);
		}
		r2->out.result = dcesrv_eventlog6_EvtRpcRegisterLogQuery(dce_call, mem_ctx, r2);
		if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
			DEBUG(5,("function eventlog6_EvtRpcRegisterLogQuery will reply async\n"));
		}
		break;
	}
	case 6: {
		struct eventlog6_EvtRpcClearLog *r2 = (struct eventlog6_EvtRpcClearLog *)r;
		if (DEBUGLEVEL >= 10) {
			NDR_PRINT_FUNCTION_DEBUG(eventlog6_EvtRpcClearLog, NDR_IN, r2);
		}
		r2->out.result = dcesrv_eventlog6_EvtRpcClearLog(dce_call, mem_ctx, r2);
		if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
			DEBUG(5,("function eventlog6_EvtRpcClearLog will reply async\n"));
		}
		break;
	}
	case 7: {
		struct eventlog6_EvtRpcExportLog *r2 = (struct eventlog6_EvtRpcExportLog *)r;
		if (DEBUGLEVEL >= 10) {
			NDR_PRINT_FUNCTION_DEBUG(eventlog6_EvtRpcExportLog, NDR_IN, r2);
		}
		r2->out.result = dcesrv_eventlog6_EvtRpcExportLog(dce_call, mem_ctx, r2);
		if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
			DEBUG(5,("function eventlog6_EvtRpcExportLog will reply async\n"));
		}
		break;
	}
	case 8: {
		struct eventlog6_EvtRpcLocalizeExportLog *r2 = (struct eventlog6_EvtRpcLocalizeExportLog *)r;
		if (DEBUGLEVEL >= 10) {
			NDR_PRINT_FUNCTION_DEBUG(eventlog6_EvtRpcLocalizeExportLog, NDR_IN, r2);
		}
		r2->out.result = dcesrv_eventlog6_EvtRpcLocalizeExportLog(dce_call, mem_ctx, r2);
		if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
			DEBUG(5,("function eventlog6_EvtRpcLocalizeExportLog will reply async\n"));
		}
		break;
	}
	case 9: {
		struct eventlog6_EvtRpcMessageRender *r2 = (struct eventlog6_EvtRpcMessageRender *)r;
		if (DEBUGLEVEL >= 10) {
			NDR_PRINT_FUNCTION_DEBUG(eventlog6_EvtRpcMessageRender, NDR_IN, r2);
		}
		r2->out.result = dcesrv_eventlog6_EvtRpcMessageRender(dce_call, mem_ctx, r2);
		if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
			DEBUG(5,("function eventlog6_EvtRpcMessageRender will reply async\n"));
		}
		break;
	}
	case 10: {
		struct eventlog6_EvtRpcMessageRenderDefault *r2 = (struct eventlog6_EvtRpcMessageRenderDefault *)r;
		if (DEBUGLEVEL >= 10) {
			NDR_PRINT_FUNCTION_DEBUG(eventlog6_EvtRpcMessageRenderDefault, NDR_IN, r2);
		}
		r2->out.result = dcesrv_eventlog6_EvtRpcMessageRenderDefault(dce_call, mem_ctx, r2);
		if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
			DEBUG(5,("function eventlog6_EvtRpcMessageRenderDefault will reply async\n"));
		}
		break;
	}
	case 11: {
		struct eventlog6_EvtRpcQueryNext *r2 = (struct eventlog6_EvtRpcQueryNext *)r;
		if (DEBUGLEVEL >= 10) {
			NDR_PRINT_FUNCTION_DEBUG(eventlog6_EvtRpcQueryNext, NDR_IN, r2);
		}
		r2->out.result = dcesrv_eventlog6_EvtRpcQueryNext(dce_call, mem_ctx, r2);
		if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
			DEBUG(5,("function eventlog6_EvtRpcQueryNext will reply async\n"));
		}
		break;
	}
	case 12: {
		struct eventlog6_EvtRpcQuerySeek *r2 = (struct eventlog6_EvtRpcQuerySeek *)r;
		if (DEBUGLEVEL >= 10) {
			NDR_PRINT_FUNCTION_DEBUG(eventlog6_EvtRpcQuerySeek, NDR_IN, r2);
		}
		r2->out.result = dcesrv_eventlog6_EvtRpcQuerySeek(dce_call, mem_ctx, r2);
		if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
			DEBUG(5,("function eventlog6_EvtRpcQuerySeek will reply async\n"));
		}
		break;
	}
	case 13: {
		struct eventlog6_EvtRpcClose *r2 = (struct eventlog6_EvtRpcClose *)r;
		if (DEBUGLEVEL >= 10) {
			NDR_PRINT_FUNCTION_DEBUG(eventlog6_EvtRpcClose, NDR_IN, r2);
		}
		r2->out.result = dcesrv_eventlog6_EvtRpcClose(dce_call, mem_ctx, r2);
		if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
			DEBUG(5,("function eventlog6_EvtRpcClose will reply async\n"));
		}
		break;
	}
	case 14: {
		struct eventlog6_EvtRpcCancel *r2 = (struct eventlog6_EvtRpcCancel *)r;
		if (DEBUGLEVEL >= 10) {
			NDR_PRINT_FUNCTION_DEBUG(eventlog6_EvtRpcCancel, NDR_IN, r2);
		}
		r2->out.result = dcesrv_eventlog6_EvtRpcCancel(dce_call, mem_ctx, r2);
		if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
			DEBUG(5,("function eventlog6_EvtRpcCancel will reply async\n"));
		}
		break;
	}
	case 15: {
		struct eventlog6_EvtRpcAssertConfig *r2 = (struct eventlog6_EvtRpcAssertConfig *)r;
		if (DEBUGLEVEL >= 10) {
			NDR_PRINT_FUNCTION_DEBUG(eventlog6_EvtRpcAssertConfig, NDR_IN, r2);
		}
		r2->out.result = dcesrv_eventlog6_EvtRpcAssertConfig(dce_call, mem_ctx, r2);
		if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
			DEBUG(5,("function eventlog6_EvtRpcAssertConfig will reply async\n"));
		}
		break;
	}
	case 16: {
		struct eventlog6_EvtRpcRetractConfig *r2 = (struct eventlog6_EvtRpcRetractConfig *)r;
		if (DEBUGLEVEL >= 10) {
			NDR_PRINT_FUNCTION_DEBUG(eventlog6_EvtRpcRetractConfig, NDR_IN, r2);
		}
		r2->out.result = dcesrv_eventlog6_EvtRpcRetractConfig(dce_call, mem_ctx, r2);
		if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
			DEBUG(5,("function eventlog6_EvtRpcRetractConfig will reply async\n"));
		}
		break;
	}
	case 17: {
		struct eventlog6_EvtRpcOpenLogHandle *r2 = (struct eventlog6_EvtRpcOpenLogHandle *)r;
		if (DEBUGLEVEL >= 10) {
			NDR_PRINT_FUNCTION_DEBUG(eventlog6_EvtRpcOpenLogHandle, NDR_IN, r2);
		}
		r2->out.result = dcesrv_eventlog6_EvtRpcOpenLogHandle(dce_call, mem_ctx, r2);
		if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
			DEBUG(5,("function eventlog6_EvtRpcOpenLogHandle will reply async\n"));
		}
		break;
	}
	case 18: {
		struct eventlog6_EvtRpcGetLogFileInfo *r2 = (struct eventlog6_EvtRpcGetLogFileInfo *)r;
		if (DEBUGLEVEL >= 10) {
			NDR_PRINT_FUNCTION_DEBUG(eventlog6_EvtRpcGetLogFileInfo, NDR_IN, r2);
		}
		r2->out.result = dcesrv_eventlog6_EvtRpcGetLogFileInfo(dce_call, mem_ctx, r2);
		if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
			DEBUG(5,("function eventlog6_EvtRpcGetLogFileInfo will reply async\n"));
		}
		break;
	}
	case 19: {
		struct eventlog6_EvtRpcGetChannelList *r2 = (struct eventlog6_EvtRpcGetChannelList *)r;
		if (DEBUGLEVEL >= 10) {
			NDR_PRINT_FUNCTION_DEBUG(eventlog6_EvtRpcGetChannelList, NDR_IN, r2);
		}
		r2->out.result = dcesrv_eventlog6_EvtRpcGetChannelList(dce_call, mem_ctx, r2);
		if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
			DEBUG(5,("function eventlog6_EvtRpcGetChannelList will reply async\n"));
		}
		break;
	}
	case 20: {
		struct eventlog6_EvtRpcGetChannelConfig *r2 = (struct eventlog6_EvtRpcGetChannelConfig *)r;
		if (DEBUGLEVEL >= 10) {
			NDR_PRINT_FUNCTION_DEBUG(eventlog6_EvtRpcGetChannelConfig, NDR_IN, r2);
		}
		r2->out.result = dcesrv_eventlog6_EvtRpcGetChannelConfig(dce_call, mem_ctx, r2);
		if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
			DEBUG(5,("function eventlog6_EvtRpcGetChannelConfig will reply async\n"));
		}
		break;
	}
	case 21: {
		struct eventlog6_EvtRpcPutChannelConfig *r2 = (struct eventlog6_EvtRpcPutChannelConfig *)r;
		if (DEBUGLEVEL >= 10) {
			NDR_PRINT_FUNCTION_DEBUG(eventlog6_EvtRpcPutChannelConfig, NDR_IN, r2);
		}
		r2->out.result = dcesrv_eventlog6_EvtRpcPutChannelConfig(dce_call, mem_ctx, r2);
		if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
			DEBUG(5,("function eventlog6_EvtRpcPutChannelConfig will reply async\n"));
		}
		break;
	}
	case 22: {
		struct eventlog6_EvtRpcGetPublisherList *r2 = (struct eventlog6_EvtRpcGetPublisherList *)r;
		if (DEBUGLEVEL >= 10) {
			NDR_PRINT_FUNCTION_DEBUG(eventlog6_EvtRpcGetPublisherList, NDR_IN, r2);
		}
		r2->out.result = dcesrv_eventlog6_EvtRpcGetPublisherList(dce_call, mem_ctx, r2);
		if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
			DEBUG(5,("function eventlog6_EvtRpcGetPublisherList will reply async\n"));
		}
		break;
	}
	case 23: {
		struct eventlog6_EvtRpcGetPublisherListForChannel *r2 = (struct eventlog6_EvtRpcGetPublisherListForChannel *)r;
		if (DEBUGLEVEL >= 10) {
			NDR_PRINT_FUNCTION_DEBUG(eventlog6_EvtRpcGetPublisherListForChannel, NDR_IN, r2);
		}
		r2->out.result = dcesrv_eventlog6_EvtRpcGetPublisherListForChannel(dce_call, mem_ctx, r2);
		if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
			DEBUG(5,("function eventlog6_EvtRpcGetPublisherListForChannel will reply async\n"));
		}
		break;
	}
	case 24: {
		struct eventlog6_EvtRpcGetPublisherMetadata *r2 = (struct eventlog6_EvtRpcGetPublisherMetadata *)r;
		if (DEBUGLEVEL >= 10) {
			NDR_PRINT_FUNCTION_DEBUG(eventlog6_EvtRpcGetPublisherMetadata, NDR_IN, r2);
		}
		r2->out.result = dcesrv_eventlog6_EvtRpcGetPublisherMetadata(dce_call, mem_ctx, r2);
		if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
			DEBUG(5,("function eventlog6_EvtRpcGetPublisherMetadata will reply async\n"));
		}
		break;
	}
	case 25: {
		struct eventlog6_EvtRpcGetPublisherResourceMetadata *r2 = (struct eventlog6_EvtRpcGetPublisherResourceMetadata *)r;
		if (DEBUGLEVEL >= 10) {
			NDR_PRINT_FUNCTION_DEBUG(eventlog6_EvtRpcGetPublisherResourceMetadata, NDR_IN, r2);
		}
		r2->out.result = dcesrv_eventlog6_EvtRpcGetPublisherResourceMetadata(dce_call, mem_ctx, r2);
		if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
			DEBUG(5,("function eventlog6_EvtRpcGetPublisherResourceMetadata will reply async\n"));
		}
		break;
	}
	case 26: {
		struct eventlog6_EvtRpcGetEventMetadataEnum *r2 = (struct eventlog6_EvtRpcGetEventMetadataEnum *)r;
		if (DEBUGLEVEL >= 10) {
			NDR_PRINT_FUNCTION_DEBUG(eventlog6_EvtRpcGetEventMetadataEnum, NDR_IN, r2);
		}
		r2->out.result = dcesrv_eventlog6_EvtRpcGetEventMetadataEnum(dce_call, mem_ctx, r2);
		if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
			DEBUG(5,("function eventlog6_EvtRpcGetEventMetadataEnum will reply async\n"));
		}
		break;
	}
	case 27: {
		struct eventlog6_EvtRpcGetNextEventMetadata *r2 = (struct eventlog6_EvtRpcGetNextEventMetadata *)r;
		if (DEBUGLEVEL >= 10) {
			NDR_PRINT_FUNCTION_DEBUG(eventlog6_EvtRpcGetNextEventMetadata, NDR_IN, r2);
		}
		r2->out.result = dcesrv_eventlog6_EvtRpcGetNextEventMetadata(dce_call, mem_ctx, r2);
		if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
			DEBUG(5,("function eventlog6_EvtRpcGetNextEventMetadata will reply async\n"));
		}
		break;
	}
	case 28: {
		struct eventlog6_EvtRpcGetClassicLogDisplayName *r2 = (struct eventlog6_EvtRpcGetClassicLogDisplayName *)r;
		if (DEBUGLEVEL >= 10) {
			NDR_PRINT_FUNCTION_DEBUG(eventlog6_EvtRpcGetClassicLogDisplayName, NDR_IN, r2);
		}
		r2->out.result = dcesrv_eventlog6_EvtRpcGetClassicLogDisplayName(dce_call, mem_ctx, r2);
		if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
			DEBUG(5,("function eventlog6_EvtRpcGetClassicLogDisplayName will reply async\n"));
		}
		break;
	}

	default:
		dce_call->fault_code = DCERPC_FAULT_OP_RNG_ERROR;
		break;
	}

	if (dce_call->fault_code != 0) {
		dcerpc_log_packet(dce_call->conn->packet_log_dir, 
		          &ndr_table_eventlog6, opnum, NDR_IN,
				  &dce_call->pkt.u.request.stub_and_verifier);
		return NT_STATUS_NET_WRITE_FAULT;
	}

	return NT_STATUS_OK;
}
Пример #10
0
static NTSTATUS eventlog6__op_reply(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx, void *r)
{
	uint16_t opnum = dce_call->pkt.u.request.opnum;

	switch (opnum) {
	case 0: {
		struct eventlog6_EvtRpcRegisterRemoteSubscription *r2 = (struct eventlog6_EvtRpcRegisterRemoteSubscription *)r;
		if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
			DEBUG(5,("function eventlog6_EvtRpcRegisterRemoteSubscription replied async\n"));
		}
		if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
			NDR_PRINT_FUNCTION_DEBUG(eventlog6_EvtRpcRegisterRemoteSubscription, NDR_OUT | NDR_SET_VALUES, r2);
		}
		if (dce_call->fault_code != 0) {
			DEBUG(2,("dcerpc_fault %s in eventlog6_EvtRpcRegisterRemoteSubscription\n", dcerpc_errstr(mem_ctx, dce_call->fault_code)));
		}
		break;
	}
	case 1: {
		struct eventlog6_EvtRpcRemoteSubscriptionNextAsync *r2 = (struct eventlog6_EvtRpcRemoteSubscriptionNextAsync *)r;
		if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
			DEBUG(5,("function eventlog6_EvtRpcRemoteSubscriptionNextAsync replied async\n"));
		}
		if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
			NDR_PRINT_FUNCTION_DEBUG(eventlog6_EvtRpcRemoteSubscriptionNextAsync, NDR_OUT | NDR_SET_VALUES, r2);
		}
		if (dce_call->fault_code != 0) {
			DEBUG(2,("dcerpc_fault %s in eventlog6_EvtRpcRemoteSubscriptionNextAsync\n", dcerpc_errstr(mem_ctx, dce_call->fault_code)));
		}
		break;
	}
	case 2: {
		struct eventlog6_EvtRpcRemoteSubscriptionNext *r2 = (struct eventlog6_EvtRpcRemoteSubscriptionNext *)r;
		if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
			DEBUG(5,("function eventlog6_EvtRpcRemoteSubscriptionNext replied async\n"));
		}
		if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
			NDR_PRINT_FUNCTION_DEBUG(eventlog6_EvtRpcRemoteSubscriptionNext, NDR_OUT | NDR_SET_VALUES, r2);
		}
		if (dce_call->fault_code != 0) {
			DEBUG(2,("dcerpc_fault %s in eventlog6_EvtRpcRemoteSubscriptionNext\n", dcerpc_errstr(mem_ctx, dce_call->fault_code)));
		}
		break;
	}
	case 3: {
		struct eventlog6_EvtRpcRemoteSubscriptionWaitAsync *r2 = (struct eventlog6_EvtRpcRemoteSubscriptionWaitAsync *)r;
		if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
			DEBUG(5,("function eventlog6_EvtRpcRemoteSubscriptionWaitAsync replied async\n"));
		}
		if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
			NDR_PRINT_FUNCTION_DEBUG(eventlog6_EvtRpcRemoteSubscriptionWaitAsync, NDR_OUT | NDR_SET_VALUES, r2);
		}
		if (dce_call->fault_code != 0) {
			DEBUG(2,("dcerpc_fault %s in eventlog6_EvtRpcRemoteSubscriptionWaitAsync\n", dcerpc_errstr(mem_ctx, dce_call->fault_code)));
		}
		break;
	}
	case 4: {
		struct eventlog6_EvtRpcRegisterControllableOperation *r2 = (struct eventlog6_EvtRpcRegisterControllableOperation *)r;
		if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
			DEBUG(5,("function eventlog6_EvtRpcRegisterControllableOperation replied async\n"));
		}
		if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
			NDR_PRINT_FUNCTION_DEBUG(eventlog6_EvtRpcRegisterControllableOperation, NDR_OUT | NDR_SET_VALUES, r2);
		}
		if (dce_call->fault_code != 0) {
			DEBUG(2,("dcerpc_fault %s in eventlog6_EvtRpcRegisterControllableOperation\n", dcerpc_errstr(mem_ctx, dce_call->fault_code)));
		}
		break;
	}
	case 5: {
		struct eventlog6_EvtRpcRegisterLogQuery *r2 = (struct eventlog6_EvtRpcRegisterLogQuery *)r;
		if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
			DEBUG(5,("function eventlog6_EvtRpcRegisterLogQuery replied async\n"));
		}
		if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
			NDR_PRINT_FUNCTION_DEBUG(eventlog6_EvtRpcRegisterLogQuery, NDR_OUT | NDR_SET_VALUES, r2);
		}
		if (dce_call->fault_code != 0) {
			DEBUG(2,("dcerpc_fault %s in eventlog6_EvtRpcRegisterLogQuery\n", dcerpc_errstr(mem_ctx, dce_call->fault_code)));
		}
		break;
	}
	case 6: {
		struct eventlog6_EvtRpcClearLog *r2 = (struct eventlog6_EvtRpcClearLog *)r;
		if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
			DEBUG(5,("function eventlog6_EvtRpcClearLog replied async\n"));
		}
		if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
			NDR_PRINT_FUNCTION_DEBUG(eventlog6_EvtRpcClearLog, NDR_OUT | NDR_SET_VALUES, r2);
		}
		if (dce_call->fault_code != 0) {
			DEBUG(2,("dcerpc_fault %s in eventlog6_EvtRpcClearLog\n", dcerpc_errstr(mem_ctx, dce_call->fault_code)));
		}
		break;
	}
	case 7: {
		struct eventlog6_EvtRpcExportLog *r2 = (struct eventlog6_EvtRpcExportLog *)r;
		if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
			DEBUG(5,("function eventlog6_EvtRpcExportLog replied async\n"));
		}
		if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
			NDR_PRINT_FUNCTION_DEBUG(eventlog6_EvtRpcExportLog, NDR_OUT | NDR_SET_VALUES, r2);
		}
		if (dce_call->fault_code != 0) {
			DEBUG(2,("dcerpc_fault %s in eventlog6_EvtRpcExportLog\n", dcerpc_errstr(mem_ctx, dce_call->fault_code)));
		}
		break;
	}
	case 8: {
		struct eventlog6_EvtRpcLocalizeExportLog *r2 = (struct eventlog6_EvtRpcLocalizeExportLog *)r;
		if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
			DEBUG(5,("function eventlog6_EvtRpcLocalizeExportLog replied async\n"));
		}
		if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
			NDR_PRINT_FUNCTION_DEBUG(eventlog6_EvtRpcLocalizeExportLog, NDR_OUT | NDR_SET_VALUES, r2);
		}
		if (dce_call->fault_code != 0) {
			DEBUG(2,("dcerpc_fault %s in eventlog6_EvtRpcLocalizeExportLog\n", dcerpc_errstr(mem_ctx, dce_call->fault_code)));
		}
		break;
	}
	case 9: {
		struct eventlog6_EvtRpcMessageRender *r2 = (struct eventlog6_EvtRpcMessageRender *)r;
		if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
			DEBUG(5,("function eventlog6_EvtRpcMessageRender replied async\n"));
		}
		if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
			NDR_PRINT_FUNCTION_DEBUG(eventlog6_EvtRpcMessageRender, NDR_OUT | NDR_SET_VALUES, r2);
		}
		if (dce_call->fault_code != 0) {
			DEBUG(2,("dcerpc_fault %s in eventlog6_EvtRpcMessageRender\n", dcerpc_errstr(mem_ctx, dce_call->fault_code)));
		}
		break;
	}
	case 10: {
		struct eventlog6_EvtRpcMessageRenderDefault *r2 = (struct eventlog6_EvtRpcMessageRenderDefault *)r;
		if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
			DEBUG(5,("function eventlog6_EvtRpcMessageRenderDefault replied async\n"));
		}
		if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
			NDR_PRINT_FUNCTION_DEBUG(eventlog6_EvtRpcMessageRenderDefault, NDR_OUT | NDR_SET_VALUES, r2);
		}
		if (dce_call->fault_code != 0) {
			DEBUG(2,("dcerpc_fault %s in eventlog6_EvtRpcMessageRenderDefault\n", dcerpc_errstr(mem_ctx, dce_call->fault_code)));
		}
		break;
	}
	case 11: {
		struct eventlog6_EvtRpcQueryNext *r2 = (struct eventlog6_EvtRpcQueryNext *)r;
		if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
			DEBUG(5,("function eventlog6_EvtRpcQueryNext replied async\n"));
		}
		if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
			NDR_PRINT_FUNCTION_DEBUG(eventlog6_EvtRpcQueryNext, NDR_OUT | NDR_SET_VALUES, r2);
		}
		if (dce_call->fault_code != 0) {
			DEBUG(2,("dcerpc_fault %s in eventlog6_EvtRpcQueryNext\n", dcerpc_errstr(mem_ctx, dce_call->fault_code)));
		}
		break;
	}
	case 12: {
		struct eventlog6_EvtRpcQuerySeek *r2 = (struct eventlog6_EvtRpcQuerySeek *)r;
		if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
			DEBUG(5,("function eventlog6_EvtRpcQuerySeek replied async\n"));
		}
		if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
			NDR_PRINT_FUNCTION_DEBUG(eventlog6_EvtRpcQuerySeek, NDR_OUT | NDR_SET_VALUES, r2);
		}
		if (dce_call->fault_code != 0) {
			DEBUG(2,("dcerpc_fault %s in eventlog6_EvtRpcQuerySeek\n", dcerpc_errstr(mem_ctx, dce_call->fault_code)));
		}
		break;
	}
	case 13: {
		struct eventlog6_EvtRpcClose *r2 = (struct eventlog6_EvtRpcClose *)r;
		if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
			DEBUG(5,("function eventlog6_EvtRpcClose replied async\n"));
		}
		if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
			NDR_PRINT_FUNCTION_DEBUG(eventlog6_EvtRpcClose, NDR_OUT | NDR_SET_VALUES, r2);
		}
		if (dce_call->fault_code != 0) {
			DEBUG(2,("dcerpc_fault %s in eventlog6_EvtRpcClose\n", dcerpc_errstr(mem_ctx, dce_call->fault_code)));
		}
		break;
	}
	case 14: {
		struct eventlog6_EvtRpcCancel *r2 = (struct eventlog6_EvtRpcCancel *)r;
		if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
			DEBUG(5,("function eventlog6_EvtRpcCancel replied async\n"));
		}
		if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
			NDR_PRINT_FUNCTION_DEBUG(eventlog6_EvtRpcCancel, NDR_OUT | NDR_SET_VALUES, r2);
		}
		if (dce_call->fault_code != 0) {
			DEBUG(2,("dcerpc_fault %s in eventlog6_EvtRpcCancel\n", dcerpc_errstr(mem_ctx, dce_call->fault_code)));
		}
		break;
	}
	case 15: {
		struct eventlog6_EvtRpcAssertConfig *r2 = (struct eventlog6_EvtRpcAssertConfig *)r;
		if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
			DEBUG(5,("function eventlog6_EvtRpcAssertConfig replied async\n"));
		}
		if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
			NDR_PRINT_FUNCTION_DEBUG(eventlog6_EvtRpcAssertConfig, NDR_OUT | NDR_SET_VALUES, r2);
		}
		if (dce_call->fault_code != 0) {
			DEBUG(2,("dcerpc_fault %s in eventlog6_EvtRpcAssertConfig\n", dcerpc_errstr(mem_ctx, dce_call->fault_code)));
		}
		break;
	}
	case 16: {
		struct eventlog6_EvtRpcRetractConfig *r2 = (struct eventlog6_EvtRpcRetractConfig *)r;
		if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
			DEBUG(5,("function eventlog6_EvtRpcRetractConfig replied async\n"));
		}
		if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
			NDR_PRINT_FUNCTION_DEBUG(eventlog6_EvtRpcRetractConfig, NDR_OUT | NDR_SET_VALUES, r2);
		}
		if (dce_call->fault_code != 0) {
			DEBUG(2,("dcerpc_fault %s in eventlog6_EvtRpcRetractConfig\n", dcerpc_errstr(mem_ctx, dce_call->fault_code)));
		}
		break;
	}
	case 17: {
		struct eventlog6_EvtRpcOpenLogHandle *r2 = (struct eventlog6_EvtRpcOpenLogHandle *)r;
		if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
			DEBUG(5,("function eventlog6_EvtRpcOpenLogHandle replied async\n"));
		}
		if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
			NDR_PRINT_FUNCTION_DEBUG(eventlog6_EvtRpcOpenLogHandle, NDR_OUT | NDR_SET_VALUES, r2);
		}
		if (dce_call->fault_code != 0) {
			DEBUG(2,("dcerpc_fault %s in eventlog6_EvtRpcOpenLogHandle\n", dcerpc_errstr(mem_ctx, dce_call->fault_code)));
		}
		break;
	}
	case 18: {
		struct eventlog6_EvtRpcGetLogFileInfo *r2 = (struct eventlog6_EvtRpcGetLogFileInfo *)r;
		if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
			DEBUG(5,("function eventlog6_EvtRpcGetLogFileInfo replied async\n"));
		}
		if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
			NDR_PRINT_FUNCTION_DEBUG(eventlog6_EvtRpcGetLogFileInfo, NDR_OUT | NDR_SET_VALUES, r2);
		}
		if (dce_call->fault_code != 0) {
			DEBUG(2,("dcerpc_fault %s in eventlog6_EvtRpcGetLogFileInfo\n", dcerpc_errstr(mem_ctx, dce_call->fault_code)));
		}
		break;
	}
	case 19: {
		struct eventlog6_EvtRpcGetChannelList *r2 = (struct eventlog6_EvtRpcGetChannelList *)r;
		if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
			DEBUG(5,("function eventlog6_EvtRpcGetChannelList replied async\n"));
		}
		if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
			NDR_PRINT_FUNCTION_DEBUG(eventlog6_EvtRpcGetChannelList, NDR_OUT | NDR_SET_VALUES, r2);
		}
		if (dce_call->fault_code != 0) {
			DEBUG(2,("dcerpc_fault %s in eventlog6_EvtRpcGetChannelList\n", dcerpc_errstr(mem_ctx, dce_call->fault_code)));
		}
		break;
	}
	case 20: {
		struct eventlog6_EvtRpcGetChannelConfig *r2 = (struct eventlog6_EvtRpcGetChannelConfig *)r;
		if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
			DEBUG(5,("function eventlog6_EvtRpcGetChannelConfig replied async\n"));
		}
		if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
			NDR_PRINT_FUNCTION_DEBUG(eventlog6_EvtRpcGetChannelConfig, NDR_OUT | NDR_SET_VALUES, r2);
		}
		if (dce_call->fault_code != 0) {
			DEBUG(2,("dcerpc_fault %s in eventlog6_EvtRpcGetChannelConfig\n", dcerpc_errstr(mem_ctx, dce_call->fault_code)));
		}
		break;
	}
	case 21: {
		struct eventlog6_EvtRpcPutChannelConfig *r2 = (struct eventlog6_EvtRpcPutChannelConfig *)r;
		if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
			DEBUG(5,("function eventlog6_EvtRpcPutChannelConfig replied async\n"));
		}
		if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
			NDR_PRINT_FUNCTION_DEBUG(eventlog6_EvtRpcPutChannelConfig, NDR_OUT | NDR_SET_VALUES, r2);
		}
		if (dce_call->fault_code != 0) {
			DEBUG(2,("dcerpc_fault %s in eventlog6_EvtRpcPutChannelConfig\n", dcerpc_errstr(mem_ctx, dce_call->fault_code)));
		}
		break;
	}
	case 22: {
		struct eventlog6_EvtRpcGetPublisherList *r2 = (struct eventlog6_EvtRpcGetPublisherList *)r;
		if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
			DEBUG(5,("function eventlog6_EvtRpcGetPublisherList replied async\n"));
		}
		if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
			NDR_PRINT_FUNCTION_DEBUG(eventlog6_EvtRpcGetPublisherList, NDR_OUT | NDR_SET_VALUES, r2);
		}
		if (dce_call->fault_code != 0) {
			DEBUG(2,("dcerpc_fault %s in eventlog6_EvtRpcGetPublisherList\n", dcerpc_errstr(mem_ctx, dce_call->fault_code)));
		}
		break;
	}
	case 23: {
		struct eventlog6_EvtRpcGetPublisherListForChannel *r2 = (struct eventlog6_EvtRpcGetPublisherListForChannel *)r;
		if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
			DEBUG(5,("function eventlog6_EvtRpcGetPublisherListForChannel replied async\n"));
		}
		if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
			NDR_PRINT_FUNCTION_DEBUG(eventlog6_EvtRpcGetPublisherListForChannel, NDR_OUT | NDR_SET_VALUES, r2);
		}
		if (dce_call->fault_code != 0) {
			DEBUG(2,("dcerpc_fault %s in eventlog6_EvtRpcGetPublisherListForChannel\n", dcerpc_errstr(mem_ctx, dce_call->fault_code)));
		}
		break;
	}
	case 24: {
		struct eventlog6_EvtRpcGetPublisherMetadata *r2 = (struct eventlog6_EvtRpcGetPublisherMetadata *)r;
		if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
			DEBUG(5,("function eventlog6_EvtRpcGetPublisherMetadata replied async\n"));
		}
		if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
			NDR_PRINT_FUNCTION_DEBUG(eventlog6_EvtRpcGetPublisherMetadata, NDR_OUT | NDR_SET_VALUES, r2);
		}
		if (dce_call->fault_code != 0) {
			DEBUG(2,("dcerpc_fault %s in eventlog6_EvtRpcGetPublisherMetadata\n", dcerpc_errstr(mem_ctx, dce_call->fault_code)));
		}
		break;
	}
	case 25: {
		struct eventlog6_EvtRpcGetPublisherResourceMetadata *r2 = (struct eventlog6_EvtRpcGetPublisherResourceMetadata *)r;
		if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
			DEBUG(5,("function eventlog6_EvtRpcGetPublisherResourceMetadata replied async\n"));
		}
		if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
			NDR_PRINT_FUNCTION_DEBUG(eventlog6_EvtRpcGetPublisherResourceMetadata, NDR_OUT | NDR_SET_VALUES, r2);
		}
		if (dce_call->fault_code != 0) {
			DEBUG(2,("dcerpc_fault %s in eventlog6_EvtRpcGetPublisherResourceMetadata\n", dcerpc_errstr(mem_ctx, dce_call->fault_code)));
		}
		break;
	}
	case 26: {
		struct eventlog6_EvtRpcGetEventMetadataEnum *r2 = (struct eventlog6_EvtRpcGetEventMetadataEnum *)r;
		if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
			DEBUG(5,("function eventlog6_EvtRpcGetEventMetadataEnum replied async\n"));
		}
		if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
			NDR_PRINT_FUNCTION_DEBUG(eventlog6_EvtRpcGetEventMetadataEnum, NDR_OUT | NDR_SET_VALUES, r2);
		}
		if (dce_call->fault_code != 0) {
			DEBUG(2,("dcerpc_fault %s in eventlog6_EvtRpcGetEventMetadataEnum\n", dcerpc_errstr(mem_ctx, dce_call->fault_code)));
		}
		break;
	}
	case 27: {
		struct eventlog6_EvtRpcGetNextEventMetadata *r2 = (struct eventlog6_EvtRpcGetNextEventMetadata *)r;
		if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
			DEBUG(5,("function eventlog6_EvtRpcGetNextEventMetadata replied async\n"));
		}
		if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
			NDR_PRINT_FUNCTION_DEBUG(eventlog6_EvtRpcGetNextEventMetadata, NDR_OUT | NDR_SET_VALUES, r2);
		}
		if (dce_call->fault_code != 0) {
			DEBUG(2,("dcerpc_fault %s in eventlog6_EvtRpcGetNextEventMetadata\n", dcerpc_errstr(mem_ctx, dce_call->fault_code)));
		}
		break;
	}
	case 28: {
		struct eventlog6_EvtRpcGetClassicLogDisplayName *r2 = (struct eventlog6_EvtRpcGetClassicLogDisplayName *)r;
		if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
			DEBUG(5,("function eventlog6_EvtRpcGetClassicLogDisplayName replied async\n"));
		}
		if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
			NDR_PRINT_FUNCTION_DEBUG(eventlog6_EvtRpcGetClassicLogDisplayName, NDR_OUT | NDR_SET_VALUES, r2);
		}
		if (dce_call->fault_code != 0) {
			DEBUG(2,("dcerpc_fault %s in eventlog6_EvtRpcGetClassicLogDisplayName\n", dcerpc_errstr(mem_ctx, dce_call->fault_code)));
		}
		break;
	}

	default:
		dce_call->fault_code = DCERPC_FAULT_OP_RNG_ERROR;
		break;
	}

	if (dce_call->fault_code != 0) {
		dcerpc_log_packet(dce_call->conn->packet_log_dir,
		          &ndr_table_eventlog6, opnum, NDR_IN,
				  &dce_call->pkt.u.request.stub_and_verifier);
		return NT_STATUS_NET_WRITE_FAULT;
	}

	return NT_STATUS_OK;
}
Пример #11
0
static NTSTATUS mgmt__op_dispatch(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx, void *r)
{
	uint16_t opnum = dce_call->pkt.u.request.opnum;

	switch (opnum) {
	case 0: {
		struct mgmt_inq_if_ids *r2 = (struct mgmt_inq_if_ids *)r;
		if (DEBUGLEVEL >= 10) {
			NDR_PRINT_FUNCTION_DEBUG(mgmt_inq_if_ids, NDR_IN, r2);
		}
		r2->out.result = dcesrv_mgmt_inq_if_ids(dce_call, mem_ctx, r2);
		if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
			DEBUG(5,("function mgmt_inq_if_ids will reply async\n"));
		}
		break;
	}
	case 1: {
		struct mgmt_inq_stats *r2 = (struct mgmt_inq_stats *)r;
		if (DEBUGLEVEL >= 10) {
			NDR_PRINT_FUNCTION_DEBUG(mgmt_inq_stats, NDR_IN, r2);
		}
		r2->out.result = dcesrv_mgmt_inq_stats(dce_call, mem_ctx, r2);
		if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
			DEBUG(5,("function mgmt_inq_stats will reply async\n"));
		}
		break;
	}
	case 2: {
		struct mgmt_is_server_listening *r2 = (struct mgmt_is_server_listening *)r;
		if (DEBUGLEVEL >= 10) {
			NDR_PRINT_FUNCTION_DEBUG(mgmt_is_server_listening, NDR_IN, r2);
		}
		r2->out.result = dcesrv_mgmt_is_server_listening(dce_call, mem_ctx, r2);
		if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
			DEBUG(5,("function mgmt_is_server_listening will reply async\n"));
		}
		break;
	}
	case 3: {
		struct mgmt_stop_server_listening *r2 = (struct mgmt_stop_server_listening *)r;
		if (DEBUGLEVEL >= 10) {
			NDR_PRINT_FUNCTION_DEBUG(mgmt_stop_server_listening, NDR_IN, r2);
		}
		r2->out.result = dcesrv_mgmt_stop_server_listening(dce_call, mem_ctx, r2);
		if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
			DEBUG(5,("function mgmt_stop_server_listening will reply async\n"));
		}
		break;
	}
	case 4: {
		struct mgmt_inq_princ_name *r2 = (struct mgmt_inq_princ_name *)r;
		if (DEBUGLEVEL >= 10) {
			NDR_PRINT_FUNCTION_DEBUG(mgmt_inq_princ_name, NDR_IN, r2);
		}
		r2->out.result = dcesrv_mgmt_inq_princ_name(dce_call, mem_ctx, r2);
		if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
			DEBUG(5,("function mgmt_inq_princ_name will reply async\n"));
		}
		break;
	}

	default:
		dce_call->fault_code = DCERPC_FAULT_OP_RNG_ERROR;
		break;
	}

	if (dce_call->fault_code != 0) {
		dcerpc_log_packet(dce_call->conn->packet_log_dir, 
		          &ndr_table_mgmt, opnum, NDR_IN,
				  &dce_call->pkt.u.request.stub_and_verifier);
		return NT_STATUS_NET_WRITE_FAULT;
	}

	return NT_STATUS_OK;
}
Пример #12
0
static NTSTATUS FileServerVssAgent__op_dispatch(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx, void *r)
{
	uint16_t opnum = dce_call->pkt.u.request.opnum;

	switch (opnum) {
	case 0: {
		struct fss_GetSupportedVersion *r2 = (struct fss_GetSupportedVersion *)r;
		if (DEBUGLEVEL >= 10) {
			NDR_PRINT_FUNCTION_DEBUG(fss_GetSupportedVersion, NDR_IN, r2);
		}
		r2->out.result = dcesrv_fss_GetSupportedVersion(dce_call, mem_ctx, r2);
		if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
			DEBUG(5,("function fss_GetSupportedVersion will reply async\n"));
		}
		break;
	}
	case 1: {
		struct fss_SetContext *r2 = (struct fss_SetContext *)r;
		if (DEBUGLEVEL >= 10) {
			NDR_PRINT_FUNCTION_DEBUG(fss_SetContext, NDR_IN, r2);
		}
		r2->out.result = dcesrv_fss_SetContext(dce_call, mem_ctx, r2);
		if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
			DEBUG(5,("function fss_SetContext will reply async\n"));
		}
		break;
	}
	case 2: {
		struct fss_StartShadowCopySet *r2 = (struct fss_StartShadowCopySet *)r;
		if (DEBUGLEVEL >= 10) {
			NDR_PRINT_FUNCTION_DEBUG(fss_StartShadowCopySet, NDR_IN, r2);
		}
		r2->out.result = dcesrv_fss_StartShadowCopySet(dce_call, mem_ctx, r2);
		if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
			DEBUG(5,("function fss_StartShadowCopySet will reply async\n"));
		}
		break;
	}
	case 3: {
		struct fss_AddToShadowCopySet *r2 = (struct fss_AddToShadowCopySet *)r;
		if (DEBUGLEVEL >= 10) {
			NDR_PRINT_FUNCTION_DEBUG(fss_AddToShadowCopySet, NDR_IN, r2);
		}
		r2->out.result = dcesrv_fss_AddToShadowCopySet(dce_call, mem_ctx, r2);
		if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
			DEBUG(5,("function fss_AddToShadowCopySet will reply async\n"));
		}
		break;
	}
	case 4: {
		struct fss_CommitShadowCopySet *r2 = (struct fss_CommitShadowCopySet *)r;
		if (DEBUGLEVEL >= 10) {
			NDR_PRINT_FUNCTION_DEBUG(fss_CommitShadowCopySet, NDR_IN, r2);
		}
		r2->out.result = dcesrv_fss_CommitShadowCopySet(dce_call, mem_ctx, r2);
		if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
			DEBUG(5,("function fss_CommitShadowCopySet will reply async\n"));
		}
		break;
	}
	case 5: {
		struct fss_ExposeShadowCopySet *r2 = (struct fss_ExposeShadowCopySet *)r;
		if (DEBUGLEVEL >= 10) {
			NDR_PRINT_FUNCTION_DEBUG(fss_ExposeShadowCopySet, NDR_IN, r2);
		}
		r2->out.result = dcesrv_fss_ExposeShadowCopySet(dce_call, mem_ctx, r2);
		if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
			DEBUG(5,("function fss_ExposeShadowCopySet will reply async\n"));
		}
		break;
	}
	case 6: {
		struct fss_RecoveryCompleteShadowCopySet *r2 = (struct fss_RecoveryCompleteShadowCopySet *)r;
		if (DEBUGLEVEL >= 10) {
			NDR_PRINT_FUNCTION_DEBUG(fss_RecoveryCompleteShadowCopySet, NDR_IN, r2);
		}
		r2->out.result = dcesrv_fss_RecoveryCompleteShadowCopySet(dce_call, mem_ctx, r2);
		if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
			DEBUG(5,("function fss_RecoveryCompleteShadowCopySet will reply async\n"));
		}
		break;
	}
	case 7: {
		struct fss_AbortShadowCopySet *r2 = (struct fss_AbortShadowCopySet *)r;
		if (DEBUGLEVEL >= 10) {
			NDR_PRINT_FUNCTION_DEBUG(fss_AbortShadowCopySet, NDR_IN, r2);
		}
		r2->out.result = dcesrv_fss_AbortShadowCopySet(dce_call, mem_ctx, r2);
		if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
			DEBUG(5,("function fss_AbortShadowCopySet will reply async\n"));
		}
		break;
	}
	case 8: {
		struct fss_IsPathSupported *r2 = (struct fss_IsPathSupported *)r;
		if (DEBUGLEVEL >= 10) {
			NDR_PRINT_FUNCTION_DEBUG(fss_IsPathSupported, NDR_IN, r2);
		}
		r2->out.result = dcesrv_fss_IsPathSupported(dce_call, mem_ctx, r2);
		if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
			DEBUG(5,("function fss_IsPathSupported will reply async\n"));
		}
		break;
	}
	case 9: {
		struct fss_IsPathShadowCopied *r2 = (struct fss_IsPathShadowCopied *)r;
		if (DEBUGLEVEL >= 10) {
			NDR_PRINT_FUNCTION_DEBUG(fss_IsPathShadowCopied, NDR_IN, r2);
		}
		r2->out.result = dcesrv_fss_IsPathShadowCopied(dce_call, mem_ctx, r2);
		if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
			DEBUG(5,("function fss_IsPathShadowCopied will reply async\n"));
		}
		break;
	}
	case 10: {
		struct fss_GetShareMapping *r2 = (struct fss_GetShareMapping *)r;
		if (DEBUGLEVEL >= 10) {
			NDR_PRINT_FUNCTION_DEBUG(fss_GetShareMapping, NDR_IN, r2);
		}
		r2->out.result = dcesrv_fss_GetShareMapping(dce_call, mem_ctx, r2);
		if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
			DEBUG(5,("function fss_GetShareMapping will reply async\n"));
		}
		break;
	}
	case 11: {
		struct fss_DeleteShareMapping *r2 = (struct fss_DeleteShareMapping *)r;
		if (DEBUGLEVEL >= 10) {
			NDR_PRINT_FUNCTION_DEBUG(fss_DeleteShareMapping, NDR_IN, r2);
		}
		r2->out.result = dcesrv_fss_DeleteShareMapping(dce_call, mem_ctx, r2);
		if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
			DEBUG(5,("function fss_DeleteShareMapping will reply async\n"));
		}
		break;
	}
	case 12: {
		struct fss_PrepareShadowCopySet *r2 = (struct fss_PrepareShadowCopySet *)r;
		if (DEBUGLEVEL >= 10) {
			NDR_PRINT_FUNCTION_DEBUG(fss_PrepareShadowCopySet, NDR_IN, r2);
		}
		r2->out.result = dcesrv_fss_PrepareShadowCopySet(dce_call, mem_ctx, r2);
		if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
			DEBUG(5,("function fss_PrepareShadowCopySet will reply async\n"));
		}
		break;
	}

	default:
		dce_call->fault_code = DCERPC_FAULT_OP_RNG_ERROR;
		break;
	}

	if (dce_call->fault_code != 0) {
		dcerpc_log_packet(dce_call->conn->packet_log_dir, 
		          &ndr_table_FileServerVssAgent, opnum, NDR_IN,
				  &dce_call->pkt.u.request.stub_and_verifier);
		return NT_STATUS_NET_WRITE_FAULT;
	}

	return NT_STATUS_OK;
}
Пример #13
0
static NTSTATUS rot__op_reply(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx, void *r)
{
	uint16_t opnum = dce_call->pkt.u.request.opnum;

	switch (opnum) {
	case 0: {
		struct rot_add *r2 = (struct rot_add *)r;
		if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
			DEBUG(5,("function rot_add replied async\n"));
		}
		if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
			NDR_PRINT_FUNCTION_DEBUG(rot_add, NDR_OUT | NDR_SET_VALUES, r2);
		}
		if (dce_call->fault_code != 0) {
			DEBUG(2,("dcerpc_fault %s in rot_add\n", dcerpc_errstr(mem_ctx, dce_call->fault_code)));
		}
		break;
	}
	case 1: {
		struct rot_remove *r2 = (struct rot_remove *)r;
		if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
			DEBUG(5,("function rot_remove replied async\n"));
		}
		if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
			NDR_PRINT_FUNCTION_DEBUG(rot_remove, NDR_OUT | NDR_SET_VALUES, r2);
		}
		if (dce_call->fault_code != 0) {
			DEBUG(2,("dcerpc_fault %s in rot_remove\n", dcerpc_errstr(mem_ctx, dce_call->fault_code)));
		}
		break;
	}
	case 2: {
		struct rot_is_listed *r2 = (struct rot_is_listed *)r;
		if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
			DEBUG(5,("function rot_is_listed replied async\n"));
		}
		if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
			NDR_PRINT_FUNCTION_DEBUG(rot_is_listed, NDR_OUT | NDR_SET_VALUES, r2);
		}
		if (dce_call->fault_code != 0) {
			DEBUG(2,("dcerpc_fault %s in rot_is_listed\n", dcerpc_errstr(mem_ctx, dce_call->fault_code)));
		}
		break;
	}
	case 3: {
		struct rot_get_interface_pointer *r2 = (struct rot_get_interface_pointer *)r;
		if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
			DEBUG(5,("function rot_get_interface_pointer replied async\n"));
		}
		if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
			NDR_PRINT_FUNCTION_DEBUG(rot_get_interface_pointer, NDR_OUT | NDR_SET_VALUES, r2);
		}
		if (dce_call->fault_code != 0) {
			DEBUG(2,("dcerpc_fault %s in rot_get_interface_pointer\n", dcerpc_errstr(mem_ctx, dce_call->fault_code)));
		}
		break;
	}
	case 4: {
		struct rot_set_modification_time *r2 = (struct rot_set_modification_time *)r;
		if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
			DEBUG(5,("function rot_set_modification_time replied async\n"));
		}
		if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
			NDR_PRINT_FUNCTION_DEBUG(rot_set_modification_time, NDR_OUT | NDR_SET_VALUES, r2);
		}
		if (dce_call->fault_code != 0) {
			DEBUG(2,("dcerpc_fault %s in rot_set_modification_time\n", dcerpc_errstr(mem_ctx, dce_call->fault_code)));
		}
		break;
	}
	case 5: {
		struct rot_get_modification_time *r2 = (struct rot_get_modification_time *)r;
		if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
			DEBUG(5,("function rot_get_modification_time replied async\n"));
		}
		if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
			NDR_PRINT_FUNCTION_DEBUG(rot_get_modification_time, NDR_OUT | NDR_SET_VALUES, r2);
		}
		if (dce_call->fault_code != 0) {
			DEBUG(2,("dcerpc_fault %s in rot_get_modification_time\n", dcerpc_errstr(mem_ctx, dce_call->fault_code)));
		}
		break;
	}
	case 6: {
		struct rot_enum *r2 = (struct rot_enum *)r;
		if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
			DEBUG(5,("function rot_enum replied async\n"));
		}
		if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
			NDR_PRINT_FUNCTION_DEBUG(rot_enum, NDR_OUT | NDR_SET_VALUES, r2);
		}
		if (dce_call->fault_code != 0) {
			DEBUG(2,("dcerpc_fault %s in rot_enum\n", dcerpc_errstr(mem_ctx, dce_call->fault_code)));
		}
		break;
	}

	default:
		dce_call->fault_code = DCERPC_FAULT_OP_RNG_ERROR;
		break;
	}

	if (dce_call->fault_code != 0) {
		dcerpc_log_packet(dce_call->conn->packet_log_dir,
		          &ndr_table_rot, opnum, NDR_IN,
				  &dce_call->pkt.u.request.stub_and_verifier);
		return NT_STATUS_NET_WRITE_FAULT;
	}

	return NT_STATUS_OK;
}
Пример #14
0
static NTSTATUS rot__op_dispatch(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx, void *r)
{
	uint16_t opnum = dce_call->pkt.u.request.opnum;

	switch (opnum) {
	case 0: {
		struct rot_add *r2 = (struct rot_add *)r;
		if (DEBUGLEVEL >= 10) {
			NDR_PRINT_FUNCTION_DEBUG(rot_add, NDR_IN, r2);
		}
		r2->out.result = dcesrv_rot_add(dce_call, mem_ctx, r2);
		if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
			DEBUG(5,("function rot_add will reply async\n"));
		}
		break;
	}
	case 1: {
		struct rot_remove *r2 = (struct rot_remove *)r;
		if (DEBUGLEVEL >= 10) {
			NDR_PRINT_FUNCTION_DEBUG(rot_remove, NDR_IN, r2);
		}
		r2->out.result = dcesrv_rot_remove(dce_call, mem_ctx, r2);
		if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
			DEBUG(5,("function rot_remove will reply async\n"));
		}
		break;
	}
	case 2: {
		struct rot_is_listed *r2 = (struct rot_is_listed *)r;
		if (DEBUGLEVEL >= 10) {
			NDR_PRINT_FUNCTION_DEBUG(rot_is_listed, NDR_IN, r2);
		}
		r2->out.result = dcesrv_rot_is_listed(dce_call, mem_ctx, r2);
		if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
			DEBUG(5,("function rot_is_listed will reply async\n"));
		}
		break;
	}
	case 3: {
		struct rot_get_interface_pointer *r2 = (struct rot_get_interface_pointer *)r;
		if (DEBUGLEVEL >= 10) {
			NDR_PRINT_FUNCTION_DEBUG(rot_get_interface_pointer, NDR_IN, r2);
		}
		r2->out.result = dcesrv_rot_get_interface_pointer(dce_call, mem_ctx, r2);
		if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
			DEBUG(5,("function rot_get_interface_pointer will reply async\n"));
		}
		break;
	}
	case 4: {
		struct rot_set_modification_time *r2 = (struct rot_set_modification_time *)r;
		if (DEBUGLEVEL >= 10) {
			NDR_PRINT_FUNCTION_DEBUG(rot_set_modification_time, NDR_IN, r2);
		}
		r2->out.result = dcesrv_rot_set_modification_time(dce_call, mem_ctx, r2);
		if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
			DEBUG(5,("function rot_set_modification_time will reply async\n"));
		}
		break;
	}
	case 5: {
		struct rot_get_modification_time *r2 = (struct rot_get_modification_time *)r;
		if (DEBUGLEVEL >= 10) {
			NDR_PRINT_FUNCTION_DEBUG(rot_get_modification_time, NDR_IN, r2);
		}
		r2->out.result = dcesrv_rot_get_modification_time(dce_call, mem_ctx, r2);
		if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
			DEBUG(5,("function rot_get_modification_time will reply async\n"));
		}
		break;
	}
	case 6: {
		struct rot_enum *r2 = (struct rot_enum *)r;
		if (DEBUGLEVEL >= 10) {
			NDR_PRINT_FUNCTION_DEBUG(rot_enum, NDR_IN, r2);
		}
		r2->out.result = dcesrv_rot_enum(dce_call, mem_ctx, r2);
		if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
			DEBUG(5,("function rot_enum will reply async\n"));
		}
		break;
	}

	default:
		dce_call->fault_code = DCERPC_FAULT_OP_RNG_ERROR;
		break;
	}

	if (dce_call->fault_code != 0) {
		dcerpc_log_packet(dce_call->conn->packet_log_dir, 
		          &ndr_table_rot, opnum, NDR_IN,
				  &dce_call->pkt.u.request.stub_and_verifier);
		return NT_STATUS_NET_WRITE_FAULT;
	}

	return NT_STATUS_OK;
}
Пример #15
0
static NTSTATUS rpcecho__op_dispatch(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx, void *r)
{
	uint16_t opnum = dce_call->pkt.u.request.opnum;

	switch (opnum) {
	case 0: {
		struct echo_AddOne *r2 = (struct echo_AddOne *)r;
		if (DEBUGLEVEL >= 10) {
			NDR_PRINT_FUNCTION_DEBUG(echo_AddOne, NDR_IN, r2);
		}
		dcesrv_echo_AddOne(dce_call, mem_ctx, r2);
		if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
			DEBUG(5,("function echo_AddOne will reply async\n"));
		}
		break;
	}
	case 1: {
		struct echo_EchoData *r2 = (struct echo_EchoData *)r;
		if (DEBUGLEVEL >= 10) {
			NDR_PRINT_FUNCTION_DEBUG(echo_EchoData, NDR_IN, r2);
		}
		dcesrv_echo_EchoData(dce_call, mem_ctx, r2);
		if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
			DEBUG(5,("function echo_EchoData will reply async\n"));
		}
		break;
	}
	case 2: {
		struct echo_SinkData *r2 = (struct echo_SinkData *)r;
		if (DEBUGLEVEL >= 10) {
			NDR_PRINT_FUNCTION_DEBUG(echo_SinkData, NDR_IN, r2);
		}
		dcesrv_echo_SinkData(dce_call, mem_ctx, r2);
		if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
			DEBUG(5,("function echo_SinkData will reply async\n"));
		}
		break;
	}
	case 3: {
		struct echo_SourceData *r2 = (struct echo_SourceData *)r;
		if (DEBUGLEVEL >= 10) {
			NDR_PRINT_FUNCTION_DEBUG(echo_SourceData, NDR_IN, r2);
		}
		dcesrv_echo_SourceData(dce_call, mem_ctx, r2);
		if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
			DEBUG(5,("function echo_SourceData will reply async\n"));
		}
		break;
	}
	case 4: {
		struct echo_TestCall *r2 = (struct echo_TestCall *)r;
		if (DEBUGLEVEL >= 10) {
			NDR_PRINT_FUNCTION_DEBUG(echo_TestCall, NDR_IN, r2);
		}
		dcesrv_echo_TestCall(dce_call, mem_ctx, r2);
		if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
			DEBUG(5,("function echo_TestCall will reply async\n"));
		}
		break;
	}
	case 5: {
		struct echo_TestCall2 *r2 = (struct echo_TestCall2 *)r;
		if (DEBUGLEVEL >= 10) {
			NDR_PRINT_FUNCTION_DEBUG(echo_TestCall2, NDR_IN, r2);
		}
		r2->out.result = dcesrv_echo_TestCall2(dce_call, mem_ctx, r2);
		if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
			DEBUG(5,("function echo_TestCall2 will reply async\n"));
		}
		break;
	}
	case 6: {
		struct echo_TestSleep *r2 = (struct echo_TestSleep *)r;
		if (DEBUGLEVEL >= 10) {
			NDR_PRINT_FUNCTION_DEBUG(echo_TestSleep, NDR_IN, r2);
		}
		r2->out.result = dcesrv_echo_TestSleep(dce_call, mem_ctx, r2);
		if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
			DEBUG(5,("function echo_TestSleep will reply async\n"));
		}
		break;
	}
	case 7: {
		struct echo_TestEnum *r2 = (struct echo_TestEnum *)r;
		if (DEBUGLEVEL >= 10) {
			NDR_PRINT_FUNCTION_DEBUG(echo_TestEnum, NDR_IN, r2);
		}
		dcesrv_echo_TestEnum(dce_call, mem_ctx, r2);
		if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
			DEBUG(5,("function echo_TestEnum will reply async\n"));
		}
		break;
	}
	case 8: {
		struct echo_TestSurrounding *r2 = (struct echo_TestSurrounding *)r;
		if (DEBUGLEVEL >= 10) {
			NDR_PRINT_FUNCTION_DEBUG(echo_TestSurrounding, NDR_IN, r2);
		}
		dcesrv_echo_TestSurrounding(dce_call, mem_ctx, r2);
		if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
			DEBUG(5,("function echo_TestSurrounding will reply async\n"));
		}
		break;
	}
	case 9: {
		struct echo_TestDoublePointer *r2 = (struct echo_TestDoublePointer *)r;
		if (DEBUGLEVEL >= 10) {
			NDR_PRINT_FUNCTION_DEBUG(echo_TestDoublePointer, NDR_IN, r2);
		}
		r2->out.result = dcesrv_echo_TestDoublePointer(dce_call, mem_ctx, r2);
		if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
			DEBUG(5,("function echo_TestDoublePointer will reply async\n"));
		}
		break;
	}

	default:
		dce_call->fault_code = DCERPC_FAULT_OP_RNG_ERROR;
		break;
	}

	if (dce_call->fault_code != 0) {
		dcerpc_log_packet(dce_call->conn->packet_log_dir, 
		          &ndr_table_rpcecho, opnum, NDR_IN,
				  &dce_call->pkt.u.request.stub_and_verifier);
		return NT_STATUS_NET_WRITE_FAULT;
	}

	return NT_STATUS_OK;
}
Пример #16
0
static NTSTATUS epmapper__op_reply(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx, void *r)
{
	uint16_t opnum = dce_call->pkt.u.request.opnum;

	switch (opnum) {
	case 0: {
		struct epm_Insert *r2 = (struct epm_Insert *)r;
		if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
			DEBUG(5,("function epm_Insert replied async\n"));
		}
		if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
			NDR_PRINT_FUNCTION_DEBUG(epm_Insert, NDR_OUT | NDR_SET_VALUES, r2);
		}
		if (dce_call->fault_code != 0) {
			DEBUG(2,("dcerpc_fault %s in epm_Insert\n", dcerpc_errstr(mem_ctx, dce_call->fault_code)));
		}
		break;
	}
	case 1: {
		struct epm_Delete *r2 = (struct epm_Delete *)r;
		if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
			DEBUG(5,("function epm_Delete replied async\n"));
		}
		if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
			NDR_PRINT_FUNCTION_DEBUG(epm_Delete, NDR_OUT | NDR_SET_VALUES, r2);
		}
		if (dce_call->fault_code != 0) {
			DEBUG(2,("dcerpc_fault %s in epm_Delete\n", dcerpc_errstr(mem_ctx, dce_call->fault_code)));
		}
		break;
	}
	case 2: {
		struct epm_Lookup *r2 = (struct epm_Lookup *)r;
		if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
			DEBUG(5,("function epm_Lookup replied async\n"));
		}
		if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
			NDR_PRINT_FUNCTION_DEBUG(epm_Lookup, NDR_OUT | NDR_SET_VALUES, r2);
		}
		if (dce_call->fault_code != 0) {
			DEBUG(2,("dcerpc_fault %s in epm_Lookup\n", dcerpc_errstr(mem_ctx, dce_call->fault_code)));
		}
		break;
	}
	case 3: {
		struct epm_Map *r2 = (struct epm_Map *)r;
		if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
			DEBUG(5,("function epm_Map replied async\n"));
		}
		if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
			NDR_PRINT_FUNCTION_DEBUG(epm_Map, NDR_OUT | NDR_SET_VALUES, r2);
		}
		if (dce_call->fault_code != 0) {
			DEBUG(2,("dcerpc_fault %s in epm_Map\n", dcerpc_errstr(mem_ctx, dce_call->fault_code)));
		}
		break;
	}
	case 4: {
		struct epm_LookupHandleFree *r2 = (struct epm_LookupHandleFree *)r;
		if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
			DEBUG(5,("function epm_LookupHandleFree replied async\n"));
		}
		if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
			NDR_PRINT_FUNCTION_DEBUG(epm_LookupHandleFree, NDR_OUT | NDR_SET_VALUES, r2);
		}
		if (dce_call->fault_code != 0) {
			DEBUG(2,("dcerpc_fault %s in epm_LookupHandleFree\n", dcerpc_errstr(mem_ctx, dce_call->fault_code)));
		}
		break;
	}
	case 5: {
		struct epm_InqObject *r2 = (struct epm_InqObject *)r;
		if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
			DEBUG(5,("function epm_InqObject replied async\n"));
		}
		if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
			NDR_PRINT_FUNCTION_DEBUG(epm_InqObject, NDR_OUT | NDR_SET_VALUES, r2);
		}
		if (dce_call->fault_code != 0) {
			DEBUG(2,("dcerpc_fault %s in epm_InqObject\n", dcerpc_errstr(mem_ctx, dce_call->fault_code)));
		}
		break;
	}
	case 6: {
		struct epm_MgmtDelete *r2 = (struct epm_MgmtDelete *)r;
		if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
			DEBUG(5,("function epm_MgmtDelete replied async\n"));
		}
		if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
			NDR_PRINT_FUNCTION_DEBUG(epm_MgmtDelete, NDR_OUT | NDR_SET_VALUES, r2);
		}
		if (dce_call->fault_code != 0) {
			DEBUG(2,("dcerpc_fault %s in epm_MgmtDelete\n", dcerpc_errstr(mem_ctx, dce_call->fault_code)));
		}
		break;
	}
	case 7: {
		struct epm_MapAuth *r2 = (struct epm_MapAuth *)r;
		if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
			DEBUG(5,("function epm_MapAuth replied async\n"));
		}
		if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
			NDR_PRINT_FUNCTION_DEBUG(epm_MapAuth, NDR_OUT | NDR_SET_VALUES, r2);
		}
		if (dce_call->fault_code != 0) {
			DEBUG(2,("dcerpc_fault %s in epm_MapAuth\n", dcerpc_errstr(mem_ctx, dce_call->fault_code)));
		}
		break;
	}

	default:
		dce_call->fault_code = DCERPC_FAULT_OP_RNG_ERROR;
		break;
	}

	if (dce_call->fault_code != 0) {
		dcerpc_log_packet(dce_call->conn->packet_log_dir,
		          &ndr_table_epmapper, opnum, NDR_IN,
				  &dce_call->pkt.u.request.stub_and_verifier);
		return NT_STATUS_NET_WRITE_FAULT;
	}

	return NT_STATUS_OK;
}
Пример #17
0
static NTSTATUS dssetup__op_dispatch(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx, void *r)
{
	uint16_t opnum = dce_call->pkt.u.request.opnum;

	switch (opnum) {
	case 0: {
		struct dssetup_DsRoleGetPrimaryDomainInformation *r2 = (struct dssetup_DsRoleGetPrimaryDomainInformation *)r;
		if (DEBUGLEVEL >= 10) {
			NDR_PRINT_FUNCTION_DEBUG(dssetup_DsRoleGetPrimaryDomainInformation, NDR_IN, r2);
		}
		r2->out.result = dcesrv_dssetup_DsRoleGetPrimaryDomainInformation(dce_call, mem_ctx, r2);
		if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
			DEBUG(5,("function dssetup_DsRoleGetPrimaryDomainInformation will reply async\n"));
		}
		break;
	}
	case 1: {
		struct dssetup_DsRoleDnsNameToFlatName *r2 = (struct dssetup_DsRoleDnsNameToFlatName *)r;
		if (DEBUGLEVEL >= 10) {
			NDR_PRINT_FUNCTION_DEBUG(dssetup_DsRoleDnsNameToFlatName, NDR_IN, r2);
		}
		r2->out.result = dcesrv_dssetup_DsRoleDnsNameToFlatName(dce_call, mem_ctx, r2);
		if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
			DEBUG(5,("function dssetup_DsRoleDnsNameToFlatName will reply async\n"));
		}
		break;
	}
	case 2: {
		struct dssetup_DsRoleDcAsDc *r2 = (struct dssetup_DsRoleDcAsDc *)r;
		if (DEBUGLEVEL >= 10) {
			NDR_PRINT_FUNCTION_DEBUG(dssetup_DsRoleDcAsDc, NDR_IN, r2);
		}
		r2->out.result = dcesrv_dssetup_DsRoleDcAsDc(dce_call, mem_ctx, r2);
		if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
			DEBUG(5,("function dssetup_DsRoleDcAsDc will reply async\n"));
		}
		break;
	}
	case 3: {
		struct dssetup_DsRoleDcAsReplica *r2 = (struct dssetup_DsRoleDcAsReplica *)r;
		if (DEBUGLEVEL >= 10) {
			NDR_PRINT_FUNCTION_DEBUG(dssetup_DsRoleDcAsReplica, NDR_IN, r2);
		}
		r2->out.result = dcesrv_dssetup_DsRoleDcAsReplica(dce_call, mem_ctx, r2);
		if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
			DEBUG(5,("function dssetup_DsRoleDcAsReplica will reply async\n"));
		}
		break;
	}
	case 4: {
		struct dssetup_DsRoleDemoteDc *r2 = (struct dssetup_DsRoleDemoteDc *)r;
		if (DEBUGLEVEL >= 10) {
			NDR_PRINT_FUNCTION_DEBUG(dssetup_DsRoleDemoteDc, NDR_IN, r2);
		}
		r2->out.result = dcesrv_dssetup_DsRoleDemoteDc(dce_call, mem_ctx, r2);
		if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
			DEBUG(5,("function dssetup_DsRoleDemoteDc will reply async\n"));
		}
		break;
	}
	case 5: {
		struct dssetup_DsRoleGetDcOperationProgress *r2 = (struct dssetup_DsRoleGetDcOperationProgress *)r;
		if (DEBUGLEVEL >= 10) {
			NDR_PRINT_FUNCTION_DEBUG(dssetup_DsRoleGetDcOperationProgress, NDR_IN, r2);
		}
		r2->out.result = dcesrv_dssetup_DsRoleGetDcOperationProgress(dce_call, mem_ctx, r2);
		if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
			DEBUG(5,("function dssetup_DsRoleGetDcOperationProgress will reply async\n"));
		}
		break;
	}
	case 6: {
		struct dssetup_DsRoleGetDcOperationResults *r2 = (struct dssetup_DsRoleGetDcOperationResults *)r;
		if (DEBUGLEVEL >= 10) {
			NDR_PRINT_FUNCTION_DEBUG(dssetup_DsRoleGetDcOperationResults, NDR_IN, r2);
		}
		r2->out.result = dcesrv_dssetup_DsRoleGetDcOperationResults(dce_call, mem_ctx, r2);
		if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
			DEBUG(5,("function dssetup_DsRoleGetDcOperationResults will reply async\n"));
		}
		break;
	}
	case 7: {
		struct dssetup_DsRoleCancel *r2 = (struct dssetup_DsRoleCancel *)r;
		if (DEBUGLEVEL >= 10) {
			NDR_PRINT_FUNCTION_DEBUG(dssetup_DsRoleCancel, NDR_IN, r2);
		}
		r2->out.result = dcesrv_dssetup_DsRoleCancel(dce_call, mem_ctx, r2);
		if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
			DEBUG(5,("function dssetup_DsRoleCancel will reply async\n"));
		}
		break;
	}
	case 8: {
		struct dssetup_DsRoleServerSaveStateForUpgrade *r2 = (struct dssetup_DsRoleServerSaveStateForUpgrade *)r;
		if (DEBUGLEVEL >= 10) {
			NDR_PRINT_FUNCTION_DEBUG(dssetup_DsRoleServerSaveStateForUpgrade, NDR_IN, r2);
		}
		r2->out.result = dcesrv_dssetup_DsRoleServerSaveStateForUpgrade(dce_call, mem_ctx, r2);
		if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
			DEBUG(5,("function dssetup_DsRoleServerSaveStateForUpgrade will reply async\n"));
		}
		break;
	}
	case 9: {
		struct dssetup_DsRoleUpgradeDownlevelServer *r2 = (struct dssetup_DsRoleUpgradeDownlevelServer *)r;
		if (DEBUGLEVEL >= 10) {
			NDR_PRINT_FUNCTION_DEBUG(dssetup_DsRoleUpgradeDownlevelServer, NDR_IN, r2);
		}
		r2->out.result = dcesrv_dssetup_DsRoleUpgradeDownlevelServer(dce_call, mem_ctx, r2);
		if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
			DEBUG(5,("function dssetup_DsRoleUpgradeDownlevelServer will reply async\n"));
		}
		break;
	}
	case 10: {
		struct dssetup_DsRoleAbortDownlevelServerUpgrade *r2 = (struct dssetup_DsRoleAbortDownlevelServerUpgrade *)r;
		if (DEBUGLEVEL >= 10) {
			NDR_PRINT_FUNCTION_DEBUG(dssetup_DsRoleAbortDownlevelServerUpgrade, NDR_IN, r2);
		}
		r2->out.result = dcesrv_dssetup_DsRoleAbortDownlevelServerUpgrade(dce_call, mem_ctx, r2);
		if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
			DEBUG(5,("function dssetup_DsRoleAbortDownlevelServerUpgrade will reply async\n"));
		}
		break;
	}

	default:
		dce_call->fault_code = DCERPC_FAULT_OP_RNG_ERROR;
		break;
	}

	if (dce_call->fault_code != 0) {
		dcerpc_log_packet(dce_call->conn->packet_log_dir, 
		          &ndr_table_dssetup, opnum, NDR_IN,
				  &dce_call->pkt.u.request.stub_and_verifier);
		return NT_STATUS_NET_WRITE_FAULT;
	}

	return NT_STATUS_OK;
}
Пример #18
0
static NTSTATUS atsvc__op_dispatch(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx, void *r)
{
	uint16_t opnum = dce_call->pkt.u.request.opnum;

	switch (opnum) {
	case 0: {
		struct atsvc_JobAdd *r2 = (struct atsvc_JobAdd *)r;
		if (DEBUGLEVEL >= 10) {
			NDR_PRINT_FUNCTION_DEBUG(atsvc_JobAdd, NDR_IN, r2);
		}
		r2->out.result = dcesrv_atsvc_JobAdd(dce_call, mem_ctx, r2);
		if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
			DEBUG(5,("function atsvc_JobAdd will reply async\n"));
		}
		break;
	}
	case 1: {
		struct atsvc_JobDel *r2 = (struct atsvc_JobDel *)r;
		if (DEBUGLEVEL >= 10) {
			NDR_PRINT_FUNCTION_DEBUG(atsvc_JobDel, NDR_IN, r2);
		}
		r2->out.result = dcesrv_atsvc_JobDel(dce_call, mem_ctx, r2);
		if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
			DEBUG(5,("function atsvc_JobDel will reply async\n"));
		}
		break;
	}
	case 2: {
		struct atsvc_JobEnum *r2 = (struct atsvc_JobEnum *)r;
		if (DEBUGLEVEL >= 10) {
			NDR_PRINT_FUNCTION_DEBUG(atsvc_JobEnum, NDR_IN, r2);
		}
		r2->out.result = dcesrv_atsvc_JobEnum(dce_call, mem_ctx, r2);
		if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
			DEBUG(5,("function atsvc_JobEnum will reply async\n"));
		}
		break;
	}
	case 3: {
		struct atsvc_JobGetInfo *r2 = (struct atsvc_JobGetInfo *)r;
		if (DEBUGLEVEL >= 10) {
			NDR_PRINT_FUNCTION_DEBUG(atsvc_JobGetInfo, NDR_IN, r2);
		}
		r2->out.result = dcesrv_atsvc_JobGetInfo(dce_call, mem_ctx, r2);
		if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
			DEBUG(5,("function atsvc_JobGetInfo will reply async\n"));
		}
		break;
	}

	default:
		dce_call->fault_code = DCERPC_FAULT_OP_RNG_ERROR;
		break;
	}

	if (dce_call->fault_code != 0) {
		dcerpc_log_packet(dce_call->conn->packet_log_dir, 
		          &ndr_table_atsvc, opnum, NDR_IN,
				  &dce_call->pkt.u.request.stub_and_verifier);
		return NT_STATUS_NET_WRITE_FAULT;
	}

	return NT_STATUS_OK;
}
Пример #19
0
static NTSTATUS epmapper__op_dispatch(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx, void *r)
{
	uint16_t opnum = dce_call->pkt.u.request.opnum;

	switch (opnum) {
	case 0: {
		struct epm_Insert *r2 = (struct epm_Insert *)r;
		if (DEBUGLEVEL >= 10) {
			NDR_PRINT_FUNCTION_DEBUG(epm_Insert, NDR_IN, r2);
		}
		r2->out.result = dcesrv_epm_Insert(dce_call, mem_ctx, r2);
		if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
			DEBUG(5,("function epm_Insert will reply async\n"));
		}
		break;
	}
	case 1: {
		struct epm_Delete *r2 = (struct epm_Delete *)r;
		if (DEBUGLEVEL >= 10) {
			NDR_PRINT_FUNCTION_DEBUG(epm_Delete, NDR_IN, r2);
		}
		r2->out.result = dcesrv_epm_Delete(dce_call, mem_ctx, r2);
		if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
			DEBUG(5,("function epm_Delete will reply async\n"));
		}
		break;
	}
	case 2: {
		struct epm_Lookup *r2 = (struct epm_Lookup *)r;
		if (DEBUGLEVEL >= 10) {
			NDR_PRINT_FUNCTION_DEBUG(epm_Lookup, NDR_IN, r2);
		}
		r2->out.result = dcesrv_epm_Lookup(dce_call, mem_ctx, r2);
		if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
			DEBUG(5,("function epm_Lookup will reply async\n"));
		}
		break;
	}
	case 3: {
		struct epm_Map *r2 = (struct epm_Map *)r;
		if (DEBUGLEVEL >= 10) {
			NDR_PRINT_FUNCTION_DEBUG(epm_Map, NDR_IN, r2);
		}
		r2->out.result = dcesrv_epm_Map(dce_call, mem_ctx, r2);
		if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
			DEBUG(5,("function epm_Map will reply async\n"));
		}
		break;
	}
	case 4: {
		struct epm_LookupHandleFree *r2 = (struct epm_LookupHandleFree *)r;
		if (DEBUGLEVEL >= 10) {
			NDR_PRINT_FUNCTION_DEBUG(epm_LookupHandleFree, NDR_IN, r2);
		}
		r2->out.result = dcesrv_epm_LookupHandleFree(dce_call, mem_ctx, r2);
		if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
			DEBUG(5,("function epm_LookupHandleFree will reply async\n"));
		}
		break;
	}
	case 5: {
		struct epm_InqObject *r2 = (struct epm_InqObject *)r;
		if (DEBUGLEVEL >= 10) {
			NDR_PRINT_FUNCTION_DEBUG(epm_InqObject, NDR_IN, r2);
		}
		r2->out.result = dcesrv_epm_InqObject(dce_call, mem_ctx, r2);
		if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
			DEBUG(5,("function epm_InqObject will reply async\n"));
		}
		break;
	}
	case 6: {
		struct epm_MgmtDelete *r2 = (struct epm_MgmtDelete *)r;
		if (DEBUGLEVEL >= 10) {
			NDR_PRINT_FUNCTION_DEBUG(epm_MgmtDelete, NDR_IN, r2);
		}
		r2->out.result = dcesrv_epm_MgmtDelete(dce_call, mem_ctx, r2);
		if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
			DEBUG(5,("function epm_MgmtDelete will reply async\n"));
		}
		break;
	}
	case 7: {
		struct epm_MapAuth *r2 = (struct epm_MapAuth *)r;
		if (DEBUGLEVEL >= 10) {
			NDR_PRINT_FUNCTION_DEBUG(epm_MapAuth, NDR_IN, r2);
		}
		r2->out.result = dcesrv_epm_MapAuth(dce_call, mem_ctx, r2);
		if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
			DEBUG(5,("function epm_MapAuth will reply async\n"));
		}
		break;
	}

	default:
		dce_call->fault_code = DCERPC_FAULT_OP_RNG_ERROR;
		break;
	}

	if (dce_call->fault_code != 0) {
		dcerpc_log_packet(dce_call->conn->packet_log_dir, 
		          &ndr_table_epmapper, opnum, NDR_IN,
				  &dce_call->pkt.u.request.stub_and_verifier);
		return NT_STATUS_NET_WRITE_FAULT;
	}

	return NT_STATUS_OK;
}
Пример #20
0
/*
  receive the answer from a dcerpc_ndr_request_send()
*/
_PUBLIC_ NTSTATUS dcerpc_ndr_request_recv(struct rpc_request *req)
{
	struct dcerpc_pipe *p = req->p;
	NTSTATUS status;
	DATA_BLOB response;
	struct ndr_pull *pull;
	unsigned int flags;
	TALLOC_CTX *mem_ctx = req->ndr.mem_ctx;
	void *r = req->ndr.struct_ptr;
	uint32_t opnum = req->ndr.opnum;
	const struct ndr_interface_table *table = req->ndr.table;
	const struct ndr_interface_call *call = &table->calls[opnum];
	enum ndr_err_code ndr_err;

	/* make sure the recv code doesn't free the request, as we
	   need to grab the flags element before it is freed */
	if (talloc_reference(p, req) == NULL) {
		return NT_STATUS_NO_MEMORY;
	}

	status = dcerpc_request_recv(req, mem_ctx, &response);
	if (!NT_STATUS_IS_OK(status)) {
		talloc_unlink(p, req);
		return status;
	}

	flags = req->flags;

	/* prepare for ndr_pull_* */
	pull = ndr_pull_init_flags(p->conn, &response, mem_ctx);
	if (!pull) {
		talloc_unlink(p, req);
		return NT_STATUS_NO_MEMORY;
	}

	if (pull->data) {
		pull->data = talloc_steal(pull, pull->data);
	}
	talloc_unlink(p, req);

	if (flags & DCERPC_PULL_BIGENDIAN) {
		pull->flags |= LIBNDR_FLAG_BIGENDIAN;
	}

	DEBUG(10,("rpc reply data:\n"));
	dump_data(10, pull->data, pull->data_size);

	/* pull the structure from the blob */
	ndr_err = call->ndr_pull(pull, NDR_OUT, r);
	if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
		status = ndr_map_error2ntstatus(ndr_err);
		dcerpc_log_packet(p->conn->packet_log_dir,
						  table, opnum, NDR_OUT, 
						  &response);
		return status;
	}

	if (p->conn->flags & DCERPC_DEBUG_VALIDATE_OUT) {
		status = dcerpc_ndr_validate_out(p->conn, pull, r, call->struct_size, 
						 call->ndr_push, call->ndr_pull, 
						 call->ndr_print);
		if (!NT_STATUS_IS_OK(status)) {
			dcerpc_log_packet(p->conn->packet_log_dir, 
							  table, opnum, NDR_OUT, 
				  &response);
			return status;
		}
	}

	if (pull->offset != pull->data_size) {
		DEBUG(0,("Warning! ignoring %d unread bytes in rpc packet!\n", 
			 pull->data_size - pull->offset));
		/* we used to return NT_STATUS_INFO_LENGTH_MISMATCH here,
		   but it turns out that early versions of NT
		   (specifically NT3.1) add junk onto the end of rpc
		   packets, so if we want to interoperate at all with
		   those versions then we need to ignore this error */
	}

	/* TODO: make pull context independent from the output mem_ctx and free the pull context */

	return NT_STATUS_OK;
}
Пример #21
0
static NTSTATUS rpcecho__op_reply(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx, void *r)
{
	uint16_t opnum = dce_call->pkt.u.request.opnum;

	switch (opnum) {
	case 0: {
		struct echo_AddOne *r2 = (struct echo_AddOne *)r;
		if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
			DEBUG(5,("function echo_AddOne replied async\n"));
		}
		if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
			NDR_PRINT_FUNCTION_DEBUG(echo_AddOne, NDR_OUT | NDR_SET_VALUES, r2);
		}
		if (dce_call->fault_code != 0) {
			DEBUG(2,("dcerpc_fault %s in echo_AddOne\n", dcerpc_errstr(mem_ctx, dce_call->fault_code)));
		}
		break;
	}
	case 1: {
		struct echo_EchoData *r2 = (struct echo_EchoData *)r;
		if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
			DEBUG(5,("function echo_EchoData replied async\n"));
		}
		if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
			NDR_PRINT_FUNCTION_DEBUG(echo_EchoData, NDR_OUT | NDR_SET_VALUES, r2);
		}
		if (dce_call->fault_code != 0) {
			DEBUG(2,("dcerpc_fault %s in echo_EchoData\n", dcerpc_errstr(mem_ctx, dce_call->fault_code)));
		}
		break;
	}
	case 2: {
		struct echo_SinkData *r2 = (struct echo_SinkData *)r;
		if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
			DEBUG(5,("function echo_SinkData replied async\n"));
		}
		if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
			NDR_PRINT_FUNCTION_DEBUG(echo_SinkData, NDR_OUT | NDR_SET_VALUES, r2);
		}
		if (dce_call->fault_code != 0) {
			DEBUG(2,("dcerpc_fault %s in echo_SinkData\n", dcerpc_errstr(mem_ctx, dce_call->fault_code)));
		}
		break;
	}
	case 3: {
		struct echo_SourceData *r2 = (struct echo_SourceData *)r;
		if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
			DEBUG(5,("function echo_SourceData replied async\n"));
		}
		if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
			NDR_PRINT_FUNCTION_DEBUG(echo_SourceData, NDR_OUT | NDR_SET_VALUES, r2);
		}
		if (dce_call->fault_code != 0) {
			DEBUG(2,("dcerpc_fault %s in echo_SourceData\n", dcerpc_errstr(mem_ctx, dce_call->fault_code)));
		}
		break;
	}
	case 4: {
		struct echo_TestCall *r2 = (struct echo_TestCall *)r;
		if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
			DEBUG(5,("function echo_TestCall replied async\n"));
		}
		if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
			NDR_PRINT_FUNCTION_DEBUG(echo_TestCall, NDR_OUT | NDR_SET_VALUES, r2);
		}
		if (dce_call->fault_code != 0) {
			DEBUG(2,("dcerpc_fault %s in echo_TestCall\n", dcerpc_errstr(mem_ctx, dce_call->fault_code)));
		}
		break;
	}
	case 5: {
		struct echo_TestCall2 *r2 = (struct echo_TestCall2 *)r;
		if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
			DEBUG(5,("function echo_TestCall2 replied async\n"));
		}
		if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
			NDR_PRINT_FUNCTION_DEBUG(echo_TestCall2, NDR_OUT | NDR_SET_VALUES, r2);
		}
		if (dce_call->fault_code != 0) {
			DEBUG(2,("dcerpc_fault %s in echo_TestCall2\n", dcerpc_errstr(mem_ctx, dce_call->fault_code)));
		}
		break;
	}
	case 6: {
		struct echo_TestSleep *r2 = (struct echo_TestSleep *)r;
		if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
			DEBUG(5,("function echo_TestSleep replied async\n"));
		}
		if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
			NDR_PRINT_FUNCTION_DEBUG(echo_TestSleep, NDR_OUT | NDR_SET_VALUES, r2);
		}
		if (dce_call->fault_code != 0) {
			DEBUG(2,("dcerpc_fault %s in echo_TestSleep\n", dcerpc_errstr(mem_ctx, dce_call->fault_code)));
		}
		break;
	}
	case 7: {
		struct echo_TestEnum *r2 = (struct echo_TestEnum *)r;
		if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
			DEBUG(5,("function echo_TestEnum replied async\n"));
		}
		if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
			NDR_PRINT_FUNCTION_DEBUG(echo_TestEnum, NDR_OUT | NDR_SET_VALUES, r2);
		}
		if (dce_call->fault_code != 0) {
			DEBUG(2,("dcerpc_fault %s in echo_TestEnum\n", dcerpc_errstr(mem_ctx, dce_call->fault_code)));
		}
		break;
	}
	case 8: {
		struct echo_TestSurrounding *r2 = (struct echo_TestSurrounding *)r;
		if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
			DEBUG(5,("function echo_TestSurrounding replied async\n"));
		}
		if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
			NDR_PRINT_FUNCTION_DEBUG(echo_TestSurrounding, NDR_OUT | NDR_SET_VALUES, r2);
		}
		if (dce_call->fault_code != 0) {
			DEBUG(2,("dcerpc_fault %s in echo_TestSurrounding\n", dcerpc_errstr(mem_ctx, dce_call->fault_code)));
		}
		break;
	}
	case 9: {
		struct echo_TestDoublePointer *r2 = (struct echo_TestDoublePointer *)r;
		if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
			DEBUG(5,("function echo_TestDoublePointer replied async\n"));
		}
		if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
			NDR_PRINT_FUNCTION_DEBUG(echo_TestDoublePointer, NDR_OUT | NDR_SET_VALUES, r2);
		}
		if (dce_call->fault_code != 0) {
			DEBUG(2,("dcerpc_fault %s in echo_TestDoublePointer\n", dcerpc_errstr(mem_ctx, dce_call->fault_code)));
		}
		break;
	}

	default:
		dce_call->fault_code = DCERPC_FAULT_OP_RNG_ERROR;
		break;
	}

	if (dce_call->fault_code != 0) {
		dcerpc_log_packet(dce_call->conn->packet_log_dir,
		          &ndr_table_rpcecho, opnum, NDR_IN,
				  &dce_call->pkt.u.request.stub_and_verifier);
		return NT_STATUS_NET_WRITE_FAULT;
	}

	return NT_STATUS_OK;
}