summaryrefslogtreecommitdiff
path: root/source4/libcli/raw/rawnegotiate.c
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2005-01-15 11:58:52 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:08:50 -0500
commit61a3d370b98ca4b75cd61e22f0d6b0f3fb7561b3 (patch)
tree64923e274b14c4b238e341b2c5a54b536c80e88e /source4/libcli/raw/rawnegotiate.c
parente89fd49df7e63dcf37ee1aa7e2f50965851725c9 (diff)
downloadsamba-61a3d370b98ca4b75cd61e22f0d6b0f3fb7561b3.tar.gz
r4758: - added async support to the session request code
- added async support to the negprot client code - removed two unused parameters from smbcli_full_connection() code - converted smbclient to use smbcli_full_connection() rather than reinventing everything itself (This used to be commit 71cbe2873473e039b4511511302cb63f1c50bce8)
Diffstat (limited to 'source4/libcli/raw/rawnegotiate.c')
-rw-r--r--source4/libcli/raw/rawnegotiate.c36
1 files changed, 22 insertions, 14 deletions
diff --git a/source4/libcli/raw/rawnegotiate.c b/source4/libcli/raw/rawnegotiate.c
index a8cf603d46f..d2d6b66d597 100644
--- a/source4/libcli/raw/rawnegotiate.c
+++ b/source4/libcli/raw/rawnegotiate.c
@@ -1,7 +1,9 @@
/*
Unix SMB/CIFS implementation.
+
SMB client negotiate context management functions
- Copyright (C) Andrew Tridgell 1994-1998
+
+ Copyright (C) Andrew Tridgell 1994-2005
Copyright (C) James Myers 2003 <myersjj@samba.org>
This program is free software; you can redistribute it and/or modify
@@ -40,10 +42,11 @@ static const struct {
{PROTOCOL_NT1,"NT LM 0.12"},
};
-/****************************************************************************
- Send a negprot command.
-****************************************************************************/
-struct smbcli_request *smb_negprot_send(struct smbcli_transport *transport, int maxprotocol)
+/*
+ Send a negprot command.
+*/
+struct smbcli_request *smb_raw_negotiate_send(struct smbcli_transport *transport,
+ int maxprotocol)
{
struct smbcli_request *req;
int i;
@@ -82,19 +85,14 @@ struct smbcli_request *smb_negprot_send(struct smbcli_transport *transport, int
return req;
}
-/****************************************************************************
+/*
Send a negprot command.
-****************************************************************************/
-NTSTATUS smb_raw_negotiate(struct smbcli_transport *transport)
+*/
+NTSTATUS smb_raw_negotiate_recv(struct smbcli_request *req)
{
- struct smbcli_request *req;
+ struct smbcli_transport *transport = req->transport;
int protocol;
- req = smb_negprot_send(transport, lp_maxprotocol());
- if (!req) {
- return NT_STATUS_UNSUCCESSFUL;
- }
-
if (!smbcli_request_receive(req) ||
smbcli_request_is_error(req)) {
return smbcli_request_destroy(req);
@@ -183,3 +181,13 @@ NTSTATUS smb_raw_negotiate(struct smbcli_transport *transport)
failed:
return smbcli_request_destroy(req);
}
+
+
+/*
+ Send a negprot command (sync interface)
+*/
+NTSTATUS smb_raw_negotiate(struct smbcli_transport *transport, int maxprotocol)
+{
+ struct smbcli_request *req = smb_raw_negotiate_send(transport, maxprotocol);
+ return smb_raw_negotiate_recv(req);
+}