diff options
author | Jeremy Allison <jra@samba.org> | 2000-02-23 02:02:33 +0000 |
---|---|---|
committer | Jeremy Allison <jra@samba.org> | 2000-02-23 02:02:33 +0000 |
commit | 9db96b7646aa36aa5b4ff309419235fe20bef78a (patch) | |
tree | 9d545a8cfd5029dae7f984e760ed0d78dd2e8db5 /source3/rpc_server | |
parent | f7324464b1adcac67e620a75f2fd51ef8e615173 (diff) | |
download | samba-9db96b7646aa36aa5b4ff309419235fe20bef78a.tar.gz samba-9db96b7646aa36aa5b4ff309419235fe20bef78a.tar.bz2 samba-9db96b7646aa36aa5b4ff309419235fe20bef78a.zip |
lib/system.c: Fixed gcc warnings.
nmbd/nmbd_processlogon.c: Use "True" and "False" instead of 1 and 0.
Others - preparing for multiple pdu write code.
Jeremy.
(This used to be commit 9f879ec396230deba34fbe5e82d8a65f92137c54)
Diffstat (limited to 'source3/rpc_server')
-rw-r--r-- | source3/rpc_server/srv_pipe_hnd.c | 46 | ||||
-rw-r--r-- | source3/rpc_server/srv_pipe_srv.c | 40 |
2 files changed, 43 insertions, 43 deletions
diff --git a/source3/rpc_server/srv_pipe_hnd.c b/source3/rpc_server/srv_pipe_hnd.c index b8e7c1946a..32a804d5d5 100644 --- a/source3/rpc_server/srv_pipe_hnd.c +++ b/source3/rpc_server/srv_pipe_hnd.c @@ -78,27 +78,27 @@ void init_rpc_pipe_hnd(void) Initialise an outgoing packet. ****************************************************************************/ -BOOL pipe_init_outgoing_data( pipes_struct *p) +BOOL pipe_init_outgoing_data(output_data *out_data) { - memset(p->current_pdu, '\0', sizeof(p->current_pdu)); + memset(out_data->current_pdu, '\0', sizeof(out_data->current_pdu)); /* Free any memory in the current return data buffer. */ - prs_mem_free(&p->rdata); + prs_mem_free(&out_data->rdata); /* * Initialize the outgoing RPC data buffer. * we will use this as the raw data area for replying to rpc requests. */ - if(!prs_init(&p->rdata, 1024, 4, MARSHALL)) { + if(!prs_init(&out_data->rdata, 1024, 4, MARSHALL)) { DEBUG(0,("pipe_init_outgoing_data: malloc fail.\n")); return False; } /* Reset the offset counters. */ - p->data_sent_length = 0; - p->current_pdu_len = 0; - p->current_pdu_sent = 0; + out_data->data_sent_length = 0; + out_data->current_pdu_len = 0; + out_data->current_pdu_sent = 0; return True; } @@ -188,7 +188,7 @@ pipes_struct *open_rpc_pipe_p(char *pipe_name, /* * Initialize the RPC and PDU data buffers with no memory. */ - prs_init(&p->rdata, 0, 4, MARSHALL); + prs_init(&p->out_data.rdata, 0, 4, MARSHALL); DLIST_ADD(Pipes, p); @@ -213,9 +213,9 @@ pipes_struct *open_rpc_pipe_p(char *pipe_name, p->ntlmssp_auth_validated = False; p->ntlmssp_auth_requested = False; - p->current_pdu_len = 0; - p->current_pdu_sent = 0; - p->data_sent_length = 0; + p->out_data.current_pdu_len = 0; + p->out_data.current_pdu_sent = 0; + p->out_data.data_sent_length = 0; p->uid = (uid_t)-1; p->gid = (gid_t)-1; @@ -303,15 +303,15 @@ only service %d sized reads.\n", n, p->name, MAX_PDU_FRAG_LEN )); * PDU. */ - if((pdu_remaining = p->current_pdu_len - p->current_pdu_sent) > 0) { + if((pdu_remaining = p->out_data.current_pdu_len - p->out_data.current_pdu_sent) > 0) { data_returned = MIN(n, pdu_remaining); DEBUG(10,("read_from_pipe: %s: current_pdu_len = %u, current_pdu_sent = %u \ -returning %d bytes.\n", p->name, (unsigned int)p->current_pdu_len, - (unsigned int)p->current_pdu_sent, (int)data_returned)); +returning %d bytes.\n", p->name, (unsigned int)p->out_data.current_pdu_len, + (unsigned int)p->out_data.current_pdu_sent, (int)data_returned)); - memcpy( data, &p->current_pdu[p->current_pdu_sent], (size_t)data_returned); - p->current_pdu_sent += (uint32)data_returned; + memcpy( data, &p->out_data.current_pdu[p->out_data.current_pdu_sent], (size_t)data_returned); + p->out_data.current_pdu_sent += (uint32)data_returned; return data_returned; } @@ -320,10 +320,10 @@ returning %d bytes.\n", p->name, (unsigned int)p->current_pdu_len, * may of course be zero if this is the first return fragment. */ - DEBUG(10,("read_from_pipe: %s: data_sent_length = %u, prs_offset(&p->rdata) = %u.\n", - p->name, (unsigned int)p->data_sent_length, (unsigned int)prs_offset(&p->rdata) )); + DEBUG(10,("read_from_pipe: %s: data_sent_length = %u, prs_offset(&p->out_data.rdata) = %u.\n", + p->name, (unsigned int)p->out_data.data_sent_length, (unsigned int)prs_offset(&p->out_data.rdata) )); - if(p->data_sent_length >= prs_offset(&p->rdata)) { + if(p->out_data.data_sent_length >= prs_offset(&p->out_data.rdata)) { /* * We have sent all possible data. Return 0. */ @@ -343,10 +343,10 @@ returning %d bytes.\n", p->name, (unsigned int)p->current_pdu_len, return -1; } - data_returned = MIN(n, p->current_pdu_len); + data_returned = MIN(n, p->out_data.current_pdu_len); - memcpy( data, p->current_pdu, (size_t)data_returned); - p->current_pdu_sent += (uint32)data_returned; + memcpy( data, p->out_data.current_pdu, (size_t)data_returned); + p->out_data.current_pdu_sent += (uint32)data_returned; return data_returned; } @@ -409,7 +409,7 @@ BOOL close_rpc_pipe_hnd(pipes_struct *p, connection_struct *conn) return False; } - prs_mem_free(&p->rdata); + prs_mem_free(&p->out_data.rdata); bitmap_clear(bmap, p->pnum - pipe_handle_offset); diff --git a/source3/rpc_server/srv_pipe_srv.c b/source3/rpc_server/srv_pipe_srv.c index 6e8b306760..86cc9e47e6 100644 --- a/source3/rpc_server/srv_pipe_srv.c +++ b/source3/rpc_server/srv_pipe_srv.c @@ -94,7 +94,7 @@ BOOL create_next_pdu(pipes_struct *p) p->hdr.pkt_type = RPC_RESPONSE; /* Set up rpc header flags. */ - if (p->data_sent_length == 0) + if (p->out_data.data_sent_length == 0) p->hdr.flags = RPC_FLG_FIRST; else p->hdr.flags = 0; @@ -103,7 +103,7 @@ BOOL create_next_pdu(pipes_struct *p) * Work out how much we can fit in a sigle PDU. */ - data_space_available = sizeof(p->current_pdu) - RPC_HEADER_LEN - RPC_HDR_RESP_LEN; + data_space_available = sizeof(p->out_data.current_pdu) - RPC_HEADER_LEN - RPC_HDR_RESP_LEN; if(p->ntlmssp_auth_validated) data_space_available -= (RPC_HDR_AUTH_LEN + RPC_AUTH_NTLMSSP_CHK_LEN); @@ -112,7 +112,7 @@ BOOL create_next_pdu(pipes_struct *p) * space and the amount left to send. */ - data_len_left = prs_offset(&p->rdata) - p->data_sent_length; + data_len_left = prs_offset(&p->out_data.rdata) - p->out_data.data_sent_length; /* * Ensure there really is data left to send. @@ -149,7 +149,7 @@ BOOL create_next_pdu(pipes_struct *p) * Work out if this PDU will be the last. */ - if(p->data_sent_length + data_len >= prs_offset(&p->rdata)) + if(p->out_data.data_sent_length + data_len >= prs_offset(&p->out_data.rdata)) p->hdr.flags |= RPC_FLG_LAST; /* @@ -158,7 +158,7 @@ BOOL create_next_pdu(pipes_struct *p) */ prs_init( &outgoing_pdu, 0, 4, MARSHALL); - prs_give_memory( &outgoing_pdu, (char *)p->current_pdu, sizeof(p->current_pdu), False); + prs_give_memory( &outgoing_pdu, (char *)p->out_data.current_pdu, sizeof(p->out_data.current_pdu), False); /* Store the header in the data stream. */ if(!smb_io_rpc_hdr("hdr", &p->hdr, &outgoing_pdu, 0)) { @@ -175,7 +175,7 @@ BOOL create_next_pdu(pipes_struct *p) data_pos = prs_offset(&outgoing_pdu); /* Copy the data into the PDU. */ - data_from = prs_data_p(&p->rdata) + p->data_sent_length; + data_from = prs_data_p(&p->out_data.rdata) + p->out_data.data_sent_length; if(!prs_append_data(&outgoing_pdu, data_from, data_len)) { DEBUG(0,("create_next_pdu: failed to copy %u bytes of data.\n", (unsigned int)data_len)); @@ -230,9 +230,9 @@ BOOL create_next_pdu(pipes_struct *p) * Setup the counts for this PDU. */ - p->data_sent_length += data_len; - p->current_pdu_len = p->hdr.frag_len; - p->current_pdu_sent = 0; + p->out_data.data_sent_length += data_len; + p->out_data.current_pdu_len = p->hdr.frag_len; + p->out_data.current_pdu_sent = 0; return True; } @@ -549,7 +549,7 @@ static BOOL setup_bind_nak(pipes_struct *p, prs_struct *pd) */ prs_init( &outgoing_rpc, 0, 4, MARSHALL); - prs_give_memory( &outgoing_rpc, (char *)p->current_pdu, sizeof(p->current_pdu), False); + prs_give_memory( &outgoing_rpc, (char *)p->out_data.current_pdu, sizeof(p->out_data.current_pdu), False); /* @@ -575,9 +575,9 @@ static BOOL setup_bind_nak(pipes_struct *p, prs_struct *pd) if(!prs_uint16("reject code", &outgoing_rpc, 0, &zero)) return False; - p->data_sent_length = 0; - p->current_pdu_len = prs_offset(&outgoing_rpc); - p->current_pdu_sent = 0; + p->out_data.data_sent_length = 0; + p->out_data.current_pdu_len = prs_offset(&outgoing_rpc); + p->out_data.current_pdu_sent = 0; return True; } @@ -710,7 +710,7 @@ static BOOL api_pipe_bind_and_alt_req(pipes_struct *p, prs_struct *pd, enum RPC_ */ prs_init( &outgoing_rpc, 0, 4, MARSHALL); - prs_give_memory( &outgoing_rpc, (char *)p->current_pdu, sizeof(p->current_pdu), False); + prs_give_memory( &outgoing_rpc, (char *)p->out_data.current_pdu, sizeof(p->out_data.current_pdu), False); /* * Setup the memory to marshall the ba header, and the @@ -828,9 +828,9 @@ static BOOL api_pipe_bind_and_alt_req(pipes_struct *p, prs_struct *pd, enum RPC_ * Setup the lengths for the initial reply. */ - p->data_sent_length = 0; - p->current_pdu_len = prs_offset(&outgoing_rpc); - p->current_pdu_sent = 0; + p->out_data.data_sent_length = 0; + p->out_data.current_pdu_len = prs_offset(&outgoing_rpc); + p->out_data.current_pdu_sent = 0; prs_mem_free(&out_hdr_ba); prs_mem_free(&out_auth); @@ -1038,7 +1038,7 @@ BOOL rpc_command(pipes_struct *p, char *input_data, int data_len) * Create the response data buffer. */ - if(!pipe_init_outgoing_data(p)) { + if(!pipe_init_outgoing_data(&p->out_data)) { DEBUG(0,("rpc_command: failed to unmarshall RPC_HDR.\n")); return False; } @@ -1104,9 +1104,9 @@ BOOL api_rpcTNP(pipes_struct *p, char *rpc_name, struct api_struct *api_rpc_cmds } /* do the actual command */ - if(!api_rpc_cmds[fn_num].fn(p->vuid, rpc_in, &p->rdata)) { + if(!api_rpc_cmds[fn_num].fn(p->vuid, rpc_in, &p->out_data.rdata)) { DEBUG(0,("api_rpcTNP: %s: failed.\n", rpc_name)); - prs_mem_free(&p->rdata); + prs_mem_free(&p->out_data.rdata); return False; } |