2 Unix SMB/CIFS implementation.
3 client message handling routines
4 Copyright (C) Andrew Tridgell 1994-1998
5 Copyright (C) James J Myers 2003 <myersjj@samba.org>
7 This program is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation; either version 2 of the License, or
10 (at your option) any later version.
12 This program is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
17 You should have received a copy of the GNU General Public License
18 along with this program; if not, write to the Free Software
19 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
25 /****************************************************************************
26 start a message sequence
27 ****************************************************************************/
28 BOOL cli_message_start(struct cli_tree *tree, char *host, char *username,
31 struct cli_request *req;
33 req = cli_request_setup(tree, SMBsendstrt, 0, 0);
34 cli_req_append_string(req, username, STR_TERMINATE);
35 cli_req_append_string(req, host, STR_TERMINATE);
36 if (!cli_request_send(req) ||
37 !cli_request_receive(req) ||
39 cli_request_destroy(req);
43 *grp = SVAL(req->in.vwv, VWV(0));
44 cli_request_destroy(req);
50 /****************************************************************************
52 ****************************************************************************/
53 BOOL cli_message_text(struct cli_tree *tree, char *msg, int len, int grp)
55 struct cli_request *req;
57 req = cli_request_setup(tree, SMBsendtxt, 1, 0);
58 SSVAL(req->out.vwv, VWV(0), grp);
60 cli_req_append_bytes(req, msg, len);
62 if (!cli_request_send(req) ||
63 !cli_request_receive(req) ||
65 cli_request_destroy(req);
69 cli_request_destroy(req);
73 /****************************************************************************
75 ****************************************************************************/
76 BOOL cli_message_end(struct cli_tree *tree, int grp)
78 struct cli_request *req;
80 req = cli_request_setup(tree, SMBsendend, 1, 0);
81 SSVAL(req->out.vwv, VWV(0), grp);
83 if (!cli_request_send(req) ||
84 !cli_request_receive(req) ||
86 cli_request_destroy(req);
90 cli_request_destroy(req);