From 1e935fcbde889a0f3735d4698e61bde6b93eaa39 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Fri, 25 Nov 2005 11:51:15 +0000 Subject: r11906: opcode 13 appears to be keepalive. Metze guessed this one :-) (This used to be commit afe2323dc10748b97e6b30dc0c783dbe04446d8c) --- source4/libcli/smb2/keepalive.c | 67 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 67 insertions(+) create mode 100644 source4/libcli/smb2/keepalive.c (limited to 'source4/libcli/smb2/keepalive.c') diff --git a/source4/libcli/smb2/keepalive.c b/source4/libcli/smb2/keepalive.c new file mode 100644 index 0000000000..64ed847757 --- /dev/null +++ b/source4/libcli/smb2/keepalive.c @@ -0,0 +1,67 @@ +/* + Unix SMB/CIFS implementation. + + SMB2 client keepalive handling + + Copyright (C) Andrew Tridgell 2005 + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +*/ + +#include "includes.h" +#include "libcli/raw/libcliraw.h" +#include "libcli/smb2/smb2.h" +#include "libcli/smb2/smb2_calls.h" + +/* + send a keepalive request +*/ +struct smb2_request *smb2_keepalive_send(struct smb2_tree *tree) +{ + struct smb2_request *req; + + req = smb2_request_init_tree(tree, SMB2_OP_KEEPALIVE, 0x04, 0); + if (req == NULL) return NULL; + + SSVAL(req->out.body, 0x02, 0); + + smb2_transport_send(req); + + return req; +} + + +/* + recv a keepalive reply +*/ +NTSTATUS smb2_keepalive_recv(struct smb2_request *req) +{ + if (!smb2_request_receive(req) || + smb2_request_is_error(req)) { + return smb2_request_destroy(req); + } + + SMB2_CHECK_PACKET_RECV(req, 0x04, False); + return smb2_request_destroy(req); +} + +/* + sync keepalive request +*/ +NTSTATUS smb2_keepalive(struct smb2_tree *tree) +{ + struct smb2_request *req = smb2_keepalive_send(tree); + return smb2_keepalive_recv(req); +} -- cgit From 89f5d66dfeb02ad626ad21c4c4c7800560f83676 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Wed, 7 Dec 2005 07:28:43 +0000 Subject: r12114: - smb2_keepalive() acts on the smb2_transport - smb2_logoff() acts on the smb2_session metze (This used to be commit ae1ca2bb4affefff1026c03f0765faf28c2b316b) --- source4/libcli/smb2/keepalive.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'source4/libcli/smb2/keepalive.c') diff --git a/source4/libcli/smb2/keepalive.c b/source4/libcli/smb2/keepalive.c index 64ed847757..4017623a61 100644 --- a/source4/libcli/smb2/keepalive.c +++ b/source4/libcli/smb2/keepalive.c @@ -28,11 +28,11 @@ /* send a keepalive request */ -struct smb2_request *smb2_keepalive_send(struct smb2_tree *tree) +struct smb2_request *smb2_keepalive_send(struct smb2_transport *transport) { struct smb2_request *req; - req = smb2_request_init_tree(tree, SMB2_OP_KEEPALIVE, 0x04, 0); + req = smb2_request_init(transport, SMB2_OP_KEEPALIVE, 0x04, 0); if (req == NULL) return NULL; SSVAL(req->out.body, 0x02, 0); @@ -60,8 +60,8 @@ NTSTATUS smb2_keepalive_recv(struct smb2_request *req) /* sync keepalive request */ -NTSTATUS smb2_keepalive(struct smb2_tree *tree) +NTSTATUS smb2_keepalive(struct smb2_transport *transport) { - struct smb2_request *req = smb2_keepalive_send(tree); + struct smb2_request *req = smb2_keepalive_send(transport); return smb2_keepalive_recv(req); } -- cgit From d4de4c2d210d2e8c9b5aedf70695594809ad6a0b Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Fri, 30 Dec 2005 13:16:54 +0000 Subject: r12608: Remove some unused #include lines. (This used to be commit 70e7449318aa0e9d2639c76730a7d1683b2f4981) --- source4/libcli/smb2/keepalive.c | 2 -- 1 file changed, 2 deletions(-) (limited to 'source4/libcli/smb2/keepalive.c') diff --git a/source4/libcli/smb2/keepalive.c b/source4/libcli/smb2/keepalive.c index 4017623a61..99d9dd3ae9 100644 --- a/source4/libcli/smb2/keepalive.c +++ b/source4/libcli/smb2/keepalive.c @@ -21,9 +21,7 @@ */ #include "includes.h" -#include "libcli/raw/libcliraw.h" #include "libcli/smb2/smb2.h" -#include "libcli/smb2/smb2_calls.h" /* send a keepalive request -- cgit From 63d718e243fd03e6ea24c47e7442975ec088a5b5 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Tue, 3 Jan 2006 17:27:33 +0000 Subject: r12696: Reduce the size of include/structs.h (This used to be commit 63917616016133c623fc6ff59454bc313ee7dd8f) --- source4/libcli/smb2/keepalive.c | 1 + 1 file changed, 1 insertion(+) (limited to 'source4/libcli/smb2/keepalive.c') diff --git a/source4/libcli/smb2/keepalive.c b/source4/libcli/smb2/keepalive.c index 99d9dd3ae9..b800bdb3b1 100644 --- a/source4/libcli/smb2/keepalive.c +++ b/source4/libcli/smb2/keepalive.c @@ -22,6 +22,7 @@ #include "includes.h" #include "libcli/smb2/smb2.h" +#include "libcli/smb2/smb2_calls.h" /* send a keepalive request -- cgit From dc86ab3e454d7219608d01879145dec5609acaa3 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Thu, 11 May 2006 10:47:37 +0000 Subject: r15532: add a BOOL body_dynamic_present, because the body_dynamic_size can be 0 also if the dynamic flag should be set metze (This used to be commit 7829100e1ee79f4f5d24004af221288e19c09b3e) --- source4/libcli/smb2/keepalive.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source4/libcli/smb2/keepalive.c') diff --git a/source4/libcli/smb2/keepalive.c b/source4/libcli/smb2/keepalive.c index b800bdb3b1..ac31afd4dc 100644 --- a/source4/libcli/smb2/keepalive.c +++ b/source4/libcli/smb2/keepalive.c @@ -31,7 +31,7 @@ struct smb2_request *smb2_keepalive_send(struct smb2_transport *transport) { struct smb2_request *req; - req = smb2_request_init(transport, SMB2_OP_KEEPALIVE, 0x04, 0); + req = smb2_request_init(transport, SMB2_OP_KEEPALIVE, 0x04, False, 0); if (req == NULL) return NULL; SSVAL(req->out.body, 0x02, 0); -- cgit From bd1efc1235b647f6845fb7d6218cf2b4068e9f0a Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Thu, 29 Jun 2006 11:08:27 +0000 Subject: r16669: this calls don't expect any valid error codes than NT_STATUS_OK metze (This used to be commit 429215113bd999466141df0a2e3b3097d677df1f) --- source4/libcli/smb2/keepalive.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source4/libcli/smb2/keepalive.c') diff --git a/source4/libcli/smb2/keepalive.c b/source4/libcli/smb2/keepalive.c index ac31afd4dc..75161d8fb5 100644 --- a/source4/libcli/smb2/keepalive.c +++ b/source4/libcli/smb2/keepalive.c @@ -48,7 +48,7 @@ struct smb2_request *smb2_keepalive_send(struct smb2_transport *transport) NTSTATUS smb2_keepalive_recv(struct smb2_request *req) { if (!smb2_request_receive(req) || - smb2_request_is_error(req)) { + !smb2_request_is_ok(req)) { return smb2_request_destroy(req); } -- cgit From 0479a2f1cbae51fcd8dbdc3c148c808421fb4d25 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Tue, 10 Jul 2007 02:07:03 +0000 Subject: r23792: convert Samba4 to GPLv3 There are still a few tidyups of old FSF addresses to come (in both s3 and s4). More commits soon. (This used to be commit fcf38a38ac691abd0fa51b89dc951a08e89fdafa) --- source4/libcli/smb2/keepalive.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'source4/libcli/smb2/keepalive.c') diff --git a/source4/libcli/smb2/keepalive.c b/source4/libcli/smb2/keepalive.c index 75161d8fb5..e2b7c83b8a 100644 --- a/source4/libcli/smb2/keepalive.c +++ b/source4/libcli/smb2/keepalive.c @@ -7,7 +7,7 @@ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or + the Free Software Foundation; either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, @@ -16,8 +16,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + along with this program. If not, see . */ #include "includes.h" -- cgit From 2151cde58014ea2e822c13d2f8a369b45dc19ca8 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Sat, 6 Oct 2007 22:28:14 +0000 Subject: r25554: Convert last instances of BOOL, True and False to the standard types. (This used to be commit 566aa14139510788548a874e9213d91317f83ca9) --- source4/libcli/smb2/keepalive.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'source4/libcli/smb2/keepalive.c') diff --git a/source4/libcli/smb2/keepalive.c b/source4/libcli/smb2/keepalive.c index e2b7c83b8a..402b063e81 100644 --- a/source4/libcli/smb2/keepalive.c +++ b/source4/libcli/smb2/keepalive.c @@ -30,7 +30,7 @@ struct smb2_request *smb2_keepalive_send(struct smb2_transport *transport) { struct smb2_request *req; - req = smb2_request_init(transport, SMB2_OP_KEEPALIVE, 0x04, False, 0); + req = smb2_request_init(transport, SMB2_OP_KEEPALIVE, 0x04, false, 0); if (req == NULL) return NULL; SSVAL(req->out.body, 0x02, 0); @@ -51,7 +51,7 @@ NTSTATUS smb2_keepalive_recv(struct smb2_request *req) return smb2_request_destroy(req); } - SMB2_CHECK_PACKET_RECV(req, 0x04, False); + SMB2_CHECK_PACKET_RECV(req, 0x04, false); return smb2_request_destroy(req); } -- cgit