Make sure we don't clobber the stack when response consists of the empty
[Samba/gebeck_regimport.git] / source3 / include / rpc_dfs.h
blob39316a5d5410de3a881b633fb0a63c2a8f88b306
1 /*
2 Unix SMB/CIFS implementation.
3 Samba parameters and setup
4 Copyright (C) Andrew Tridgell 1992-2000
5 Copyright (C) Luke Kenneth Casson Leighton 1996 - 2000
6 Copyright (C) Shirish Kalele 2000
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 #ifndef _RPC_DFS_H
24 #define _RPC_DFS_H
26 /* NETDFS pipe: calls */
27 #define DFS_EXIST 0x00
28 #define DFS_ADD 0x01
29 #define DFS_REMOVE 0x02
30 #define DFS_GET_INFO 0x04
31 #define DFS_ENUM 0x05
33 /* dfsadd flags */
34 #define DFSFLAG_ADD_VOLUME 0x00000001
35 #define DFSFLAG_RESTORE_VOLUME 0x00000002
37 typedef struct dfs_q_dfs_exist
39 uint32 dummy;
41 DFS_Q_DFS_EXIST;
43 /* status == 1 if dfs exists. */
44 typedef struct dfs_r_dfs_exist
46 uint32 status; /* Not a WERROR or NTSTATUS code */
48 DFS_R_DFS_EXIST;
50 typedef struct dfs_q_dfs_add
52 uint32 ptr_DfsEntryPath;
53 UNISTR2 DfsEntryPath;
54 uint32 ptr_ServerName;
55 UNISTR2 ServerName;
56 uint32 ptr_ShareName;
57 UNISTR2 ShareName;
58 uint32 ptr_Comment;
59 UNISTR2 Comment;
60 uint32 Flags;
62 DFS_Q_DFS_ADD;
64 typedef struct dfs_r_dfs_add
66 WERROR status;
68 DFS_R_DFS_ADD;
70 /********************************************/
71 typedef struct dfs_q_dfs_remove
73 UNISTR2 DfsEntryPath;
74 uint32 ptr_ServerName;
75 UNISTR2 ServerName;
76 uint32 ptr_ShareName;
77 UNISTR2 ShareName;
79 DFS_Q_DFS_REMOVE;
81 typedef struct dfs_r_dfs_remove
83 WERROR status;
85 DFS_R_DFS_REMOVE;
87 /********************************************/
88 typedef struct dfs_info_1
90 uint32 ptr_entrypath;
91 UNISTR2 entrypath;
93 DFS_INFO_1;
95 typedef struct dfs_info_2
97 uint32 ptr_entrypath;
98 UNISTR2 entrypath;
99 uint32 ptr_comment;
100 UNISTR2 comment;
101 uint32 state;
102 uint32 num_storages;
104 DFS_INFO_2;
106 typedef struct dfs_storage_info
108 uint32 state;
109 uint32 ptr_servername;
110 UNISTR2 servername;
111 uint32 ptr_sharename;
112 UNISTR2 sharename;
114 DFS_STORAGE_INFO;
116 typedef struct dfs_info_3
118 uint32 ptr_entrypath;
119 UNISTR2 entrypath;
120 uint32 ptr_comment;
121 UNISTR2 comment;
122 uint32 state;
123 uint32 num_storages;
124 uint32 ptr_storages;
125 uint32 num_storage_infos;
126 DFS_STORAGE_INFO* storages;
128 DFS_INFO_3;
130 typedef struct dfs_info_ctr
133 uint32 switch_value;
134 uint32 num_entries;
135 uint32 ptr_dfs_ctr; /* pointer to dfs info union */
136 union
138 DFS_INFO_1 *info1;
139 DFS_INFO_2 *info2;
140 DFS_INFO_3 *info3;
141 } dfs;
143 DFS_INFO_CTR;
145 typedef struct dfs_q_dfs_get_info
147 UNISTR2 uni_path;
149 uint32 ptr_server;
150 UNISTR2 uni_server;
152 uint32 ptr_share;
153 UNISTR2 uni_share;
155 uint32 level;
157 DFS_Q_DFS_GET_INFO;
159 typedef struct dfs_r_dfs_get_info
161 uint32 level;
162 uint32 ptr_ctr;
163 DFS_INFO_CTR ctr;
164 WERROR status;
166 DFS_R_DFS_GET_INFO;
168 typedef struct dfs_q_dfs_enum
170 uint32 level;
171 uint32 maxpreflen;
172 uint32 ptr_buffer;
173 uint32 level2;
174 uint32 ptr_num_entries;
175 uint32 num_entries;
176 uint32 ptr_num_entries2;
177 uint32 num_entries2;
178 ENUM_HND reshnd;
180 DFS_Q_DFS_ENUM;
182 typedef struct dfs_r_dfs_enum
184 DFS_INFO_CTR *ctr;
185 uint32 ptr_buffer;
186 uint32 level;
187 uint32 level2;
188 uint32 ptr_num_entries;
189 uint32 num_entries;
190 uint32 ptr_num_entries2;
191 uint32 num_entries2;
192 ENUM_HND reshnd;
193 WERROR status;
195 DFS_R_DFS_ENUM;
197 #endif