summaryrefslogtreecommitdiffstats
path: root/source3/torture
diff options
context:
space:
mode:
Diffstat (limited to 'source3/torture')
-rw-r--r--source3/torture/vfstest.c24
-rw-r--r--source3/torture/vfstest.h4
2 files changed, 28 insertions, 0 deletions
diff --git a/source3/torture/vfstest.c b/source3/torture/vfstest.c
index 6e25b34dee..53b5ee99d9 100644
--- a/source3/torture/vfstest.c
+++ b/source3/torture/vfstest.c
@@ -416,6 +416,30 @@ void exit_server_cleanly(const char *const reason)
exit_server("normal exit");
}
+struct smb_request *vfstest_get_smbreq(TALLOC_CTX *mem_ctx,
+ struct vfs_state *vfs)
+{
+ struct smb_request *result;
+
+ result = talloc_zero(mem_ctx, struct smb_request);
+ if (result == NULL) {
+ return NULL;
+ }
+ result->sconn = vfs->conn->sconn;
+ result->mid = ++vfs->mid;
+
+ result->inbuf = talloc_array(result, uint8_t, smb_size);
+ if (result->inbuf == NULL) {
+ goto fail;
+ }
+ SSVAL(result->inbuf, smb_mid, result->mid);
+ smb_setlen(result->inbuf, smb_size-4);
+ return result;
+fail:
+ TALLOC_FREE(result);
+ return NULL;
+}
+
/* Main function */
int main(int argc, char *argv[])
diff --git a/source3/torture/vfstest.h b/source3/torture/vfstest.h
index 0d71facea9..0c57d5633a 100644
--- a/source3/torture/vfstest.h
+++ b/source3/torture/vfstest.h
@@ -29,12 +29,16 @@ struct func_entry {
struct vfs_state {
struct connection_struct *conn;
+ uint64_t mid;
struct files_struct *files[1024];
DIR *currentdir;
void *data;
size_t data_size;
};
+struct smb_request *vfstest_get_smbreq(TALLOC_CTX *mem_ctx,
+ struct vfs_state *vfs);
+
struct cmd_set {
const char *name;
NTSTATUS (*fn)(struct vfs_state *vfs, TALLOC_CTX *mem_ctx, int argc,