From 61a3d370b98ca4b75cd61e22f0d6b0f3fb7561b3 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Sat, 15 Jan 2005 11:58:52 +0000 Subject: 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) --- source4/libcli/raw/rawnegotiate.c | 36 ++++++++++++++++++++++-------------- 1 file changed, 22 insertions(+), 14 deletions(-) (limited to 'source4/libcli/raw/rawnegotiate.c') diff --git a/source4/libcli/raw/rawnegotiate.c b/source4/libcli/raw/rawnegotiate.c index a8cf603d46..d2d6b66d59 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 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); +} -- cgit