s3/rpc_client: Ensure max possible row buffer size is not exceeded
[samba.git] / source3 / rpc_client / cli_mdssvc_private.h
1 /*
2    Unix SMB/CIFS implementation.
3    mdssvc client functions
4
5    Copyright (C) Ralph Boehme                   2019
6
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 3 of the License, or
10    (at your option) any later version.
11
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.
16
17    You should have received a copy of the GNU General Public License
18    along with this program.  If not, see <http://www.gnu.org/licenses/>.
19 */
20
21 #ifndef _MDSCLI_PRIVATE_H_
22 #define _MDSCLI_PRIVATE_H_
23
24 struct mdsctx_id {
25         uint64_t id;
26         uint64_t connection;
27 };
28
29 struct mdscli_ctx {
30         uint64_t async_pending;
31
32         struct dcerpc_binding_handle *bh;
33         struct policy_handle ph;
34
35         struct mdsctx_id ctx_id;
36         size_t max_fragment_size;
37
38         /* Known fields used across multiple commands */
39         uint32_t dev;
40         uint32_t flags;
41
42         /* cmd specific or unknown fields */
43         struct {
44                 char share_path[1025];
45                 size_t share_path_len;
46                 uint32_t unkn2;
47                 uint32_t unkn3;
48         } mdscmd_open;
49         struct {
50                 uint32_t status;
51                 uint32_t unkn7;
52         } mdscmd_unknown1;
53         struct {
54                 uint32_t fragment;
55                 uint32_t unkn9;
56         } mdscmd_cmd;
57         struct {
58                 uint32_t status;
59         } mdscmd_close;
60
61         char *path_scope;
62         size_t path_scope_len;
63 };
64
65 struct mdscli_search_ctx {
66         struct mdscli_ctx *mdscli_ctx;
67         struct mdsctx_id ctx_id;
68         uint64_t unique_id;
69         bool live;
70         char *path_scope;
71         char *mds_query;
72 };
73
74 #endif /* _MDSCLI_PRIVATE_H_ */