diff options
Diffstat (limited to 'source4/smb_server/request.c')
-rw-r--r-- | source4/smb_server/request.c | 48 |
1 files changed, 24 insertions, 24 deletions
diff --git a/source4/smb_server/request.c b/source4/smb_server/request.c index 6361325f22..d845a78c0d 100644 --- a/source4/smb_server/request.c +++ b/source4/smb_server/request.c @@ -19,7 +19,7 @@ */ /* - this file implements functions for manipulating the 'struct request_context' structure in smbd + this file implements functions for manipulating the 'struct smbsrv_request' structure in smbd */ #include "includes.h" @@ -28,7 +28,7 @@ #define REQ_OVER_ALLOCATION 256 /* destroy a request structure */ -void req_destroy(struct request_context *req) +void req_destroy(struct smbsrv_request *req) { /* the request might be marked protected. This is done by the * SMBecho code for example */ @@ -45,9 +45,9 @@ void req_destroy(struct request_context *req) construct a basic request packet, mostly used to construct async packets such as change notify and oplock break requests ****************************************************************************/ -struct request_context *init_smb_request(struct smbsrv_context *smb_ctx) +struct smbsrv_request *init_smb_request(struct smbsrv_context *smb_ctx) { - struct request_context *req; + struct smbsrv_request *req; TALLOC_CTX *mem_ctx; /* each request gets its own talloc context. The request @@ -79,7 +79,7 @@ struct request_context *init_smb_request(struct smbsrv_context *smb_ctx) /* setup a chained reply in req->out with the given word count and initial data buffer size. */ -static void req_setup_chain_reply(struct request_context *req, uint_t wct, uint_t buflen) +static void req_setup_chain_reply(struct smbsrv_request *req, uint_t wct, uint_t buflen) { uint32_t chain_base_size = req->out.size; @@ -111,7 +111,7 @@ static void req_setup_chain_reply(struct request_context *req, uint_t wct, uint_ the caller will then fill in the command words and data before calling req_send_reply() to send the reply on its way */ -void req_setup_reply(struct request_context *req, uint_t wct, uint_t buflen) +void req_setup_reply(struct smbsrv_request *req, uint_t wct, uint_t buflen) { if (req->chain_count != 0) { req_setup_chain_reply(req, wct, buflen); @@ -172,7 +172,7 @@ void req_setup_reply(struct request_context *req, uint_t wct, uint_t buflen) note that this is deliberately a signed integer reply */ -int req_max_data(struct request_context *req) +int req_max_data(struct smbsrv_request *req) { int ret; ret = req->smb_ctx->negotiate.max_send; @@ -190,7 +190,7 @@ int req_max_data(struct request_context *req) To cope with this req->out.ptr is supplied. This will be updated to point at the same offset into the packet as before this call */ -static void req_grow_allocation(struct request_context *req, uint_t new_size) +static void req_grow_allocation(struct smbsrv_request *req, uint_t new_size) { int delta; char *buf2; @@ -231,7 +231,7 @@ static void req_grow_allocation(struct request_context *req, uint_t new_size) To cope with this req->out.ptr is supplied. This will be updated to point at the same offset into the packet as before this call */ -void req_grow_data(struct request_context *req, uint_t new_size) +void req_grow_data(struct smbsrv_request *req, uint_t new_size) { int delta; @@ -256,7 +256,7 @@ void req_grow_data(struct request_context *req, uint_t new_size) note that this only looks at req->out.buffer and req->out.size, allowing manually constructed packets to be sent */ -void req_send_reply_nosign(struct request_context *req) +void req_send_reply_nosign(struct smbsrv_request *req) { if (req->out.size > NBT_HDR_SIZE) { _smb_setlen(req->out.buffer, req->out.size - NBT_HDR_SIZE); @@ -275,7 +275,7 @@ void req_send_reply_nosign(struct request_context *req) note that this only looks at req->out.buffer and req->out.size, allowing manually constructed packets to be sent */ -void req_send_reply(struct request_context *req) +void req_send_reply(struct smbsrv_request *req) { req_sign_packet(req); @@ -288,7 +288,7 @@ void req_send_reply(struct request_context *req) construct and send an error packet with a forced DOS error code this is needed to match win2000 behaviour for some parts of the protocol */ -void req_reply_dos_error(struct request_context *req, uint8_t eclass, uint16_t ecode) +void req_reply_dos_error(struct smbsrv_request *req, uint8_t eclass, uint16_t ecode) { /* if the basic packet hasn't been setup yet then do it now */ if (req->out.buffer == NULL) { @@ -304,7 +304,7 @@ void req_reply_dos_error(struct request_context *req, uint8_t eclass, uint16_t e /* setup the header of a reply to include an NTSTATUS code */ -void req_setup_error(struct request_context *req, NTSTATUS status) +void req_setup_error(struct smbsrv_request *req, NTSTATUS status) { if (!lp_nt_status_support() || !(req->smb_ctx->negotiate.client_caps & CAP_STATUS32)) { /* convert to DOS error codes */ @@ -332,7 +332,7 @@ void req_setup_error(struct request_context *req, NTSTATUS status) construct and send an error packet, then destroy the request auto-converts to DOS error format when appropriate */ -void req_reply_error(struct request_context *req, NTSTATUS status) +void req_reply_error(struct smbsrv_request *req, NTSTATUS status) { req_setup_reply(req, 0, 0); @@ -352,7 +352,7 @@ void req_reply_error(struct request_context *req, NTSTATUS status) if dest_len is -1 then no limit applies */ -size_t req_push_str(struct request_context *req, char *dest, const char *str, int dest_len, uint_t flags) +size_t req_push_str(struct smbsrv_request *req, char *dest, const char *str, int dest_len, uint_t flags) { size_t len; uint_t grow_size; @@ -397,7 +397,7 @@ size_t req_push_str(struct request_context *req, char *dest, const char *str, in append raw bytes into the data portion of the request packet return the number of bytes added */ -size_t req_append_bytes(struct request_context *req, +size_t req_append_bytes(struct smbsrv_request *req, const uint8_t *bytes, size_t byte_len) { req_grow_allocation(req, byte_len + req->out.data_size); @@ -409,7 +409,7 @@ size_t req_append_bytes(struct request_context *req, append variable block (type 5 buffer) into the data portion of the request packet return the number of bytes added */ -size_t req_append_var_block(struct request_context *req, +size_t req_append_var_block(struct smbsrv_request *req, const uint8_t *bytes, uint16_t byte_len) { req_grow_allocation(req, byte_len + 3 + req->out.data_size); @@ -434,7 +434,7 @@ size_t req_append_var_block(struct request_context *req, on failure zero is returned and *dest is set to NULL, otherwise the number of bytes consumed in the packet is returned */ -static size_t req_pull_ucs2(struct request_context *req, const char **dest, const char *src, int byte_len, uint_t flags) +static size_t req_pull_ucs2(struct smbsrv_request *req, const char **dest, const char *src, int byte_len, uint_t flags) { int src_len, src_len2, alignment=0; ssize_t ret; @@ -491,7 +491,7 @@ static size_t req_pull_ucs2(struct request_context *req, const char **dest, cons on failure zero is returned and *dest is set to NULL, otherwise the number of bytes consumed in the packet is returned */ -static size_t req_pull_ascii(struct request_context *req, const char **dest, const char *src, int byte_len, uint_t flags) +static size_t req_pull_ascii(struct smbsrv_request *req, const char **dest, const char *src, int byte_len, uint_t flags) { int src_len, src_len2; ssize_t ret; @@ -538,7 +538,7 @@ static size_t req_pull_ascii(struct request_context *req, const char **dest, con on failure zero is returned and *dest is set to NULL, otherwise the number of bytes consumed in the packet is returned */ -size_t req_pull_string(struct request_context *req, const char **dest, const char *src, int byte_len, uint_t flags) +size_t req_pull_string(struct smbsrv_request *req, const char **dest, const char *src, int byte_len, uint_t flags) { if (!(flags & STR_ASCII) && (((flags & STR_UNICODE) || (req->flags2 & FLAGS2_UNICODE_STRINGS)))) { @@ -558,7 +558,7 @@ size_t req_pull_string(struct request_context *req, const char **dest, const cha on failure *dest is set to the zero length string. This seems to match win2000 behaviour */ -size_t req_pull_ascii4(struct request_context *req, const char **dest, const char *src, uint_t flags) +size_t req_pull_ascii4(struct smbsrv_request *req, const char **dest, const char *src, uint_t flags) { ssize_t ret; @@ -587,7 +587,7 @@ size_t req_pull_ascii4(struct request_context *req, const char **dest, const cha return False if any part is outside the data portion of the packet */ -BOOL req_pull_blob(struct request_context *req, const char *src, int len, DATA_BLOB *blob) +BOOL req_pull_blob(struct smbsrv_request *req, const char *src, int len, DATA_BLOB *blob) { if (len != 0 && req_data_oob(req, src, len)) { return False; @@ -600,7 +600,7 @@ BOOL req_pull_blob(struct request_context *req, const char *src, int len, DATA_B /* check that a lump of data in a request is within the bounds of the data section of the packet */ -BOOL req_data_oob(struct request_context *req, const char *ptr, uint32_t count) +BOOL req_data_oob(struct smbsrv_request *req, const char *ptr, uint32_t count) { if (count == 0) { return False; @@ -620,7 +620,7 @@ BOOL req_data_oob(struct request_context *req, const char *ptr, uint32_t count) /* pull an open file handle from a packet, taking account of the chained_fnum */ -uint16_t req_fnum(struct request_context *req, const char *base, uint_t offset) +uint16_t req_fnum(struct smbsrv_request *req, const char *base, uint_t offset) { if (req->chained_fnum != -1) { return req->chained_fnum; |