summaryrefslogtreecommitdiff
path: root/source3/smbd/globals.h
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2009-05-14 14:17:28 +0200
committerStefan Metzmacher <metze@samba.org>2009-05-20 15:42:24 +0200
commit688945a994660fa905836b55a995bb90c3e8e67a (patch)
treeea93ad930f089ef6048156c6a1f4df88ec010650 /source3/smbd/globals.h
parentd23a1935e8180090474cbbba878d5bc5903579c6 (diff)
downloadsamba-688945a994660fa905836b55a995bb90c3e8e67a.tar.gz
samba-688945a994660fa905836b55a995bb90c3e8e67a.tar.bz2
samba-688945a994660fa905836b55a995bb90c3e8e67a.zip
s3:smbd: add infrastructure for SMB2 support
This is disabled by default and activated by "max protocol = SMB2". metze
Diffstat (limited to 'source3/smbd/globals.h')
-rw-r--r--source3/smbd/globals.h76
1 files changed, 76 insertions, 0 deletions
diff --git a/source3/smbd/globals.h b/source3/smbd/globals.h
index b646bc30fd..e69243f4b4 100644
--- a/source3/smbd/globals.h
+++ b/source3/smbd/globals.h
@@ -199,11 +199,87 @@ struct child_pid;
extern struct child_pid *children;
extern int num_children;
+struct tstream_context;
+struct smbd_smb2_request;
+
+bool smbd_is_smb2_header(const uint8_t *inbuf, size_t size);
+
+void smbd_smb2_first_negprot(struct smbd_server_connection *conn,
+ const uint8_t *inbuf, size_t size);
+
+NTSTATUS smbd_smb2_request_error_ex(struct smbd_smb2_request *req,
+ NTSTATUS status, DATA_BLOB *info);
+NTSTATUS smbd_smb2_request_error(struct smbd_smb2_request *req,
+ NTSTATUS status);
+NTSTATUS smbd_smb2_request_done(struct smbd_smb2_request *req,
+ DATA_BLOB body, DATA_BLOB *dyn);
+
+struct smbd_smb2_request {
+ TALLOC_CTX *mem_pool;
+
+ struct smbd_server_connection *conn;
+
+ int current_idx;
+
+ struct {
+ /* the NBT header is not allocated */
+ uint8_t nbt_hdr[4];
+ /*
+ * vector[0] NBT
+ * .
+ * vector[1] SMB2
+ * vector[2] fixed body
+ * vector[3] dynamic body
+ * .
+ * .
+ * .
+ * vector[4] SMB2
+ * vector[5] fixed body
+ * vector[6] dynamic body
+ * .
+ * .
+ * .
+ */
+ struct iovec *vector;
+ int vector_count;
+ } in;
+ struct {
+ /* the NBT header is not allocated */
+ uint8_t nbt_hdr[4];
+ /*
+ * vector[0] NBT
+ * .
+ * vector[1] SMB2
+ * vector[2] fixed body
+ * vector[3] dynamic body
+ * .
+ * .
+ * .
+ * vector[4] SMB2
+ * vector[5] fixed body
+ * vector[6] dynamic body
+ * .
+ * .
+ * .
+ */
+ struct iovec *vector;
+ int vector_count;
+ } out;
+};
+
struct smbd_server_connection {
struct fd_event *fde;
uint64_t num_requests;
struct smb_signing_state *signing_state;
+ bool allow_smb2;
+ struct {
+ struct tevent_context *event_ctx;
+ struct tevent_queue *recv_queue;
+ struct tevent_queue *send_queue;
+ struct tstream_context *stream;
+ } smb2;
};
+
extern struct smbd_server_connection *smbd_server_conn;
void smbd_init_globals(void);