s3:smbd: add smbd_smb2_fake_smb_request()
[ira/wip.git] / source3 / smbd / globals.h
index 2f9f7afd65941a8fd50e572031fa275cd07ded3b..6cf5439a3fa30ac5a320fd51b623b8e743d8175d 100644 (file)
@@ -42,11 +42,6 @@ struct smbd_dmapi_context;
 extern struct smbd_dmapi_context *dmapi_ctx;
 #endif
 
-extern connection_struct *Connections;
-/* number of open connections */
-extern struct bitmap *bmap;
-extern int num_open;
-
 extern bool dfree_broken;
 
 extern struct bitmap *dptr_bmap;
@@ -91,39 +86,8 @@ extern char *last_to;
 struct msg_state;
 extern struct msg_state *smbd_msg_state;
 
-extern bool global_encrypted_passwords_negotiated;
-extern bool global_spnego_negotiated;
-extern struct auth_context *negprot_global_auth_context;
-extern bool done_negprot;
-
 extern bool logged_ioctl_message;
 
-/* users from session setup */
-extern char *session_userlist;
-/* workgroup from session setup. */
-extern char *session_workgroup;
-/* this holds info on user ids that are already validated for this VC */
-extern user_struct *validated_users;
-extern uint16_t next_vuid;
-extern int num_validated_vuids;
-#ifdef HAVE_NETGROUP
-extern char *my_yp_domain;
-#endif
-
-extern bool already_got_session;
-
-/*
- * Size of data we can send to client. Set
- *  by the client for all protocols above CORE.
- *  Set by us for CORE protocol.
- */
-extern int max_send;
-/*
- * Size of the data we can receive. Set by us.
- * Can be modified by the max xmit parameter.
- */
-extern int max_recv;
-extern uint16 last_session_tag;
 extern int trans_num;
 
 extern pid_t mypid;
@@ -158,12 +122,6 @@ extern uint16_t last_flags;
 extern struct db_context *session_db_ctx_ptr;
 
 extern uint32_t global_client_caps;
-extern bool done_sesssetup;
-/****************************************************************************
- List to store partial SPNEGO auth fragments.
-****************************************************************************/
-struct pending_auth_data;
-extern struct pending_auth_data *pd_list;
 
 extern uint16_t fnf_handle;
 
@@ -231,6 +189,8 @@ NTSTATUS smbd_smb2_request_done(struct smbd_smb2_request *req,
 NTSTATUS smbd_smb2_request_check_session(struct smbd_smb2_request *req);
 NTSTATUS smbd_smb2_request_check_tcon(struct smbd_smb2_request *req);
 
+struct smb_request *smbd_smb2_fake_smb_request(struct smbd_smb2_request *req);
+
 NTSTATUS smbd_smb2_request_process_negprot(struct smbd_smb2_request *req);
 NTSTATUS smbd_smb2_request_process_sesssetup(struct smbd_smb2_request *req);
 NTSTATUS smbd_smb2_request_process_logoff(struct smbd_smb2_request *req);
@@ -310,6 +270,8 @@ struct smbd_smb2_session {
        DATA_BLOB session_key;
        bool do_signing;
 
+       user_struct *compat_vuser;
+
        struct {
                /* an id tree used to allocate tids */
                struct idr_context *idtree;
@@ -326,14 +288,65 @@ struct smbd_smb2_tcon {
        struct smbd_smb2_session *session;
        uint32_t tid;
        int snum;
+       connection_struct *compat_conn;
 };
 
+struct pending_auth_data;
+
 struct smbd_server_connection {
+       struct {
+               bool got_session;
+       } nbt;
        bool allow_smb2;
        struct {
                struct fd_event *fde;
                uint64_t num_requests;
+               struct {
+                       bool encrypted_passwords;
+                       bool spnego;
+                       struct auth_context *auth_context;
+                       bool done;
+                       /*
+                        * Size of the data we can receive. Set by us.
+                        * Can be modified by the max xmit parameter.
+                        */
+                       int max_recv;
+               } negprot;
+
+               struct {
+                       bool done_sesssetup;
+                       /*
+                        * Size of data we can send to client. Set
+                        *  by the client for all protocols above CORE.
+                        *  Set by us for CORE protocol.
+                        */
+                       int max_send;
+                       uint16_t last_session_tag;
+
+                       /* users from session setup */
+                       char *session_userlist;
+                       /* workgroup from session setup. */
+                       char *session_workgroup;
+                       /*
+                        * this holds info on user ids that are already
+                        * validated for this VC
+                        */
+                       user_struct *validated_users;
+                       uint16_t next_vuid;
+                       int num_validated_vuids;
+#ifdef HAVE_NETGROUP
+                       char *my_yp_domain;
+#endif
+               } sessions;
+               struct {
+                       connection_struct *Connections;
+                       /* number of open connections */
+                       struct bitmap *bmap;
+                       int num_open;
+               } tcons;
                struct smb_signing_state *signing_state;
+               /* List to store partial SPNEGO auth fragments. */
+               struct pending_auth_data *pd_list;
        } smb1;
        struct {
                struct tevent_context *event_ctx;