s4:libcli:smb2: add a smb2_connect_ext variant of smb2_connect that takes a previous_...
authorMichael Adam <obnox@samba.org>
Sun, 26 Feb 2012 00:45:00 +0000 (01:45 +0100)
committerMichael Adam <obnox@samba.org>
Mon, 27 Feb 2012 23:08:54 +0000 (00:08 +0100)
source4/libcli/smb2/connect.c

index d9d430ddd5549680b689273401a3e8b746c89e6f..c743b90ce57fdee6d2f5b9f822e068871c0c5ca2 100644 (file)
@@ -269,17 +269,18 @@ NTSTATUS smb2_connect_recv(struct tevent_req *req,
 /*
   sync version of smb2_connect
 */
-NTSTATUS smb2_connect(TALLOC_CTX *mem_ctx,
-                     const char *host,
-                     const char **ports,
-                     const char *share,
-                     struct resolve_context *resolve_ctx,
-                     struct cli_credentials *credentials,
-                     struct smb2_tree **tree,
-                     struct tevent_context *ev,
-                     struct smbcli_options *options,
-                     const char *socket_options,
-                     struct gensec_settings *gensec_settings)
+NTSTATUS smb2_connect_ext(TALLOC_CTX *mem_ctx,
+                         const char *host,
+                         const char **ports,
+                         const char *share,
+                         struct resolve_context *resolve_ctx,
+                         struct cli_credentials *credentials,
+                         uint64_t previous_session_id,
+                         struct smb2_tree **tree,
+                         struct tevent_context *ev,
+                         struct smbcli_options *options,
+                         const char *socket_options,
+                         struct gensec_settings *gensec_settings)
 {
        struct tevent_req *subreq;
        NTSTATUS status;
@@ -297,7 +298,7 @@ NTSTATUS smb2_connect(TALLOC_CTX *mem_ctx,
                                   share,
                                   resolve_ctx,
                                   credentials,
-                                  0, /* previous_session_id */
+                                  previous_session_id,
                                   options,
                                   socket_options,
                                   gensec_settings);
@@ -323,3 +324,26 @@ NTSTATUS smb2_connect(TALLOC_CTX *mem_ctx,
        TALLOC_FREE(frame);
        return NT_STATUS_OK;
 }
+
+NTSTATUS smb2_connect(TALLOC_CTX *mem_ctx,
+                     const char *host,
+                     const char **ports,
+                     const char *share,
+                     struct resolve_context *resolve_ctx,
+                     struct cli_credentials *credentials,
+                     struct smb2_tree **tree,
+                     struct tevent_context *ev,
+                     struct smbcli_options *options,
+                     const char *socket_options,
+                     struct gensec_settings *gensec_settings)
+{
+       NTSTATUS status;
+
+       status = smb2_connect_ext(mem_ctx, host, ports, share, resolve_ctx,
+                                 credentials,
+                                 0, /* previous_session_id */
+                                 tree, ev, options, socket_options,
+                                 gensec_settings);
+
+       return status;
+}