summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVolker Lendecke <vl@samba.org>2009-01-17 17:53:05 +0100
committerVolker Lendecke <vl@samba.org>2009-01-18 15:40:45 +0100
commit3f9f188877de8a4c0b2883e2360f2834c41b66c1 (patch)
tree5ec86bc87af45aeea3c00d1d0747ce5afd3cfeae
parent396ed3b36359367e1efd49395cd9e6dc6f7c98fc (diff)
downloadsamba-3f9f188877de8a4c0b2883e2360f2834c41b66c1.tar.gz
Remove sync rpc_api_pipe_req
-rw-r--r--source3/rpc_client/cli_pipe.c170
1 files changed, 0 insertions, 170 deletions
diff --git a/source3/rpc_client/cli_pipe.c b/source3/rpc_client/cli_pipe.c
index bedd652fd68..35c3a9301f2 100644
--- a/source3/rpc_client/cli_pipe.c
+++ b/source3/rpc_client/cli_pipe.c
@@ -2170,176 +2170,6 @@ static uint32 calculate_data_len_tosend(struct rpc_pipe_client *cli,
and deals with signing/sealing details.
********************************************************************/
-#if 0
-
-NTSTATUS rpc_api_pipe_req(TALLOC_CTX *mem_ctx, struct rpc_pipe_client *cli,
- uint8 op_num,
- prs_struct *in_data,
- prs_struct *out_data)
-{
- NTSTATUS ret;
- uint32 data_left = prs_offset(in_data);
- uint32 alloc_hint = prs_offset(in_data);
- uint32 data_sent_thistime = 0;
- uint32 current_data_offset = 0;
- uint32 call_id = get_rpc_call_id();
- char pad[8];
- prs_struct outgoing_pdu;
-
- memset(pad, '\0', 8);
-
- if (cli->max_xmit_frag < RPC_HEADER_LEN + RPC_HDR_REQ_LEN + RPC_MAX_SIGN_SIZE) {
- /* Server is screwed up ! */
- return NT_STATUS_INVALID_PARAMETER;
- }
-
- if (!prs_init(&outgoing_pdu, cli->max_xmit_frag, prs_get_mem_context(in_data), MARSHALL))
- return NT_STATUS_NO_MEMORY;
-
- while (1) {
- RPC_HDR hdr;
- RPC_HDR_REQ hdr_req;
- uint16 auth_len = 0;
- uint16 frag_len = 0;
- uint8 flags = 0;
- uint32 ss_padding = 0;
- ssize_t num_written;
-
- data_sent_thistime = calculate_data_len_tosend(cli, data_left,
- &frag_len, &auth_len, &ss_padding);
-
- if (current_data_offset == 0) {
- flags = RPC_FLG_FIRST;
- }
-
- if (data_sent_thistime == data_left) {
- flags |= RPC_FLG_LAST;
- }
-
- /* Create and marshall the header and request header. */
- init_rpc_hdr(&hdr, RPC_REQUEST, flags, call_id, frag_len, auth_len);
-
- if(!smb_io_rpc_hdr("hdr ", &hdr, &outgoing_pdu, 0)) {
- prs_mem_free(&outgoing_pdu);
- return NT_STATUS_NO_MEMORY;
- }
-
- /* Create the rpc request RPC_HDR_REQ */
- init_rpc_hdr_req(&hdr_req, alloc_hint, op_num);
-
- if(!smb_io_rpc_hdr_req("hdr_req", &hdr_req, &outgoing_pdu, 0)) {
- prs_mem_free(&outgoing_pdu);
- return NT_STATUS_NO_MEMORY;
- }
-
- /* Copy in the data, plus any ss padding. */
- if (!prs_append_some_prs_data(&outgoing_pdu, in_data, current_data_offset, data_sent_thistime)) {
- prs_mem_free(&outgoing_pdu);
- return NT_STATUS_NO_MEMORY;
- }
-
- /* Copy the sign/seal padding data. */
- if (ss_padding) {
- if (!prs_copy_data_in(&outgoing_pdu, pad, ss_padding)) {
- prs_mem_free(&outgoing_pdu);
- return NT_STATUS_NO_MEMORY;
- }
- }
-
- /* Generate any auth sign/seal and add the auth footer. */
- if (auth_len) {
- switch (cli->auth->auth_type) {
- case PIPE_AUTH_TYPE_NONE:
- break;
- case PIPE_AUTH_TYPE_NTLMSSP:
- case PIPE_AUTH_TYPE_SPNEGO_NTLMSSP:
- ret = add_ntlmssp_auth_footer(cli, &hdr, ss_padding, &outgoing_pdu);
- if (!NT_STATUS_IS_OK(ret)) {
- prs_mem_free(&outgoing_pdu);
- return ret;
- }
- break;
- case PIPE_AUTH_TYPE_SCHANNEL:
- ret = add_schannel_auth_footer(cli, &hdr, ss_padding, &outgoing_pdu);
- if (!NT_STATUS_IS_OK(ret)) {
- prs_mem_free(&outgoing_pdu);
- return ret;
- }
- break;
- default:
- smb_panic("bad auth type");
- break; /* notreached */
- }
- }
-
- /* Actually send the packet. */
- if (flags & RPC_FLG_LAST) {
- /* Last packet - send the data, get the reply and return. */
- ret = rpc_api_pipe(mem_ctx, cli, &outgoing_pdu,
- out_data, RPC_RESPONSE);
- prs_mem_free(&outgoing_pdu);
-
- if ((DEBUGLEVEL >= 50)
- && (cli->transport_type == NCACN_NP)) {
- char *dump_name = NULL;
- /* Also capture received data */
- if (asprintf(&dump_name, "%s/reply_%s_%d",
- get_dyn_LOGFILEBASE(),
- cli->trans.np.pipe_name, op_num) > 0) {
- prs_dump(dump_name, op_num, out_data);
- SAFE_FREE(dump_name);
- }
- }
-
- return ret;
- }
-
- switch (cli->transport_type) {
- case NCACN_NP:
- num_written = cli_write(cli->trans.np.cli,
- cli->trans.np.fnum,
- 8, /* 8 means message mode. */
- prs_data_p(&outgoing_pdu),
- (off_t)0,
- (size_t)hdr.frag_len);
-
- if (num_written != hdr.frag_len) {
- prs_mem_free(&outgoing_pdu);
- return cli_get_nt_error(cli->trans.np.cli);
- }
- break;
- case NCACN_IP_TCP:
- case NCACN_UNIX_STREAM:
- num_written = write_data(
- cli->trans.sock.fd,
- prs_data_p(&outgoing_pdu),
- (size_t)hdr.frag_len);
- if (num_written != hdr.frag_len) {
- NTSTATUS status;
- status = map_nt_error_from_unix(errno);
- prs_mem_free(&outgoing_pdu);
- return status;
- }
- break;
- default:
- DEBUG(0, ("unknown transport type %d\n",
- cli->transport_type));
- return NT_STATUS_INTERNAL_ERROR;
- }
-
- current_data_offset += data_sent_thistime;
- data_left -= data_sent_thistime;
-
- /* Reset the marshalling position back to zero. */
- if (!prs_set_offset(&outgoing_pdu, 0)) {
- prs_mem_free(&outgoing_pdu);
- return NT_STATUS_NO_MEMORY;
- }
- }
-}
-
-#endif
-
struct rpc_api_pipe_req_state {
struct event_context *ev;
struct rpc_pipe_client *cli;