2 Unix SMB/CIFS implementation.
4 composite request interfaces
6 Copyright (C) Andrew Tridgell 2005
8 This program is free software; you can redistribute it and/or modify
9 it under the terms of the GNU General Public License as published by
10 the Free Software Foundation; either version 2 of the License, or
11 (at your option) any later version.
13 This program is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 GNU General Public License for more details.
18 You should have received a copy of the GNU General Public License
19 along with this program; if not, write to the Free Software
20 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
23 #include "libcli/raw/interfaces.h"
26 this defines the structures associated with "composite"
27 requests. Composite requests are libcli requests that are internally
28 implemented as multiple async calls, but can be treated as a
29 single call via these composite calls. The composite calls are
30 particularly designed to be used in async applications.
31 you can also stack multiple level of composite call
35 a composite call moves between the following 3 states.
37 enum composite_state { COMPOSITE_STATE_INIT, /* we are creating the request */
38 COMPOSITE_STATE_IN_PROGRESS, /* the request is in the outgoing socket Q */
39 COMPOSITE_STATE_DONE, /* the request is received by the caller finished */
40 COMPOSITE_STATE_ERROR }; /* a packet or transport level error has occurred */
42 /* the context of one "composite" call */
43 struct composite_context {
44 /* the external state - will be queried by the caller */
45 enum composite_state state;
47 /* a private pointer for use by the composite function
51 /* status code when finished */
54 /* the event context we are using */
55 struct event_context *event_ctx;
57 /* information on what to do on completion */
59 void (*fn)(struct composite_context *);
67 struct smbcli_request;
70 struct nbt_name_request;
72 #include "libcli/composite/proto.h"