source: branches/samba-3.2.x/source/rpc_client/init_srvsvc.c

Last change on this file was 133, checked in by Paul Smedley, 17 years ago

Update trunk to 3.2.0pre3

File size: 11.5 KB
Line 
1/*
2 * Unix SMB/CIFS implementation.
3 * RPC Pipe client / server routines
4 * Copyright (C) Guenther Deschner 2008.
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 3 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, see <http://www.gnu.org/licenses/>.
18 */
19
20#include "includes.h"
21
22/*******************************************************************
23 inits a srvsvc_NetSrvInfo102 structure
24********************************************************************/
25
26void init_srvsvc_NetSrvInfo102(struct srvsvc_NetSrvInfo102 *r,
27 enum srvsvc_PlatformId platform_id,
28 const char *server_name,
29 uint32_t version_major,
30 uint32_t version_minor,
31 uint32_t server_type,
32 const char *comment,
33 uint32_t users,
34 uint32_t disc,
35 uint32_t hidden,
36 uint32_t announce,
37 uint32_t anndelta,
38 uint32_t licenses,
39 const char *userpath)
40{
41 r->platform_id = platform_id;
42 r->server_name = server_name;
43 r->version_major = version_major;
44 r->version_minor = version_minor;
45 r->server_type = server_type;
46 r->comment = comment;
47 r->users = users;
48 r->disc = disc;
49 r->hidden = hidden;
50 r->announce = announce;
51 r->anndelta = anndelta;
52 r->licenses = licenses;
53 r->userpath = userpath;
54}
55
56/*******************************************************************
57 inits a srvsvc_NetSrvInfo101 structure
58********************************************************************/
59
60void init_srvsvc_NetSrvInfo101(struct srvsvc_NetSrvInfo101 *r,
61 enum srvsvc_PlatformId platform_id,
62 const char *server_name,
63 uint32_t version_major,
64 uint32_t version_minor,
65 uint32_t server_type,
66 const char *comment)
67{
68 r->platform_id = platform_id;
69 r->server_name = server_name;
70 r->version_major = version_major;
71 r->version_minor = version_minor;
72 r->server_type = server_type;
73 r->comment = comment;
74}
75
76/*******************************************************************
77 inits a srvsvc_NetSrvInfo100 structure
78********************************************************************/
79
80void init_srvsvc_NetSrvInfo100(struct srvsvc_NetSrvInfo100 *r,
81 enum srvsvc_PlatformId platform_id,
82 const char *server_name)
83{
84 r->platform_id = platform_id;
85 r->server_name = server_name;
86}
87
88/*******************************************************************
89 inits a srvsvc_NetShareInfo0 structure
90********************************************************************/
91
92void init_srvsvc_NetShareInfo0(struct srvsvc_NetShareInfo0 *r,
93 const char *name)
94{
95 r->name = name;
96}
97
98/*******************************************************************
99 inits a srvsvc_NetShareInfo1 structure
100********************************************************************/
101
102void init_srvsvc_NetShareInfo1(struct srvsvc_NetShareInfo1 *r,
103 const char *name,
104 enum srvsvc_ShareType type,
105 const char *comment)
106{
107 r->name = name;
108 r->type = type;
109 r->comment = comment;
110}
111
112/*******************************************************************
113 inits a srvsvc_NetShareInfo2 structure
114********************************************************************/
115
116void init_srvsvc_NetShareInfo2(struct srvsvc_NetShareInfo2 *r,
117 const char *name,
118 enum srvsvc_ShareType type,
119 const char *comment,
120 uint32_t permissions,
121 uint32_t max_users,
122 uint32_t current_users,
123 const char *path,
124 const char *password)
125{
126 r->name = name;
127 r->type = type;
128 r->comment = comment;
129 r->permissions = permissions;
130 r->max_users = max_users;
131 r->current_users = current_users;
132 r->path = path;
133 r->password = password;
134}
135
136/*******************************************************************
137 inits a srvsvc_NetShareInfo501 structure
138********************************************************************/
139
140void init_srvsvc_NetShareInfo501(struct srvsvc_NetShareInfo501 *r,
141 const char *name,
142 enum srvsvc_ShareType type,
143 const char *comment,
144 uint32_t csc_policy)
145{
146 r->name = name;
147 r->type = type;
148 r->comment = comment;
149 r->csc_policy = csc_policy;
150}
151
152/*******************************************************************
153 inits a srvsvc_NetShareInfo502 structure
154********************************************************************/
155
156void init_srvsvc_NetShareInfo502(struct srvsvc_NetShareInfo502 *r,
157 const char *name,
158 enum srvsvc_ShareType type,
159 const char *comment,
160 uint32_t permissions,
161 uint32_t max_users,
162 uint32_t current_users,
163 const char *path,
164 const char *password,
165 struct sec_desc_buf *sd_buf)
166{
167 r->name = name;
168 r->type = type;
169 r->comment = comment;
170 r->permissions = permissions;
171 r->max_users = max_users;
172 r->current_users = current_users;
173 r->path = path;
174 r->password = password;
175 r->sd_buf = *sd_buf;
176}
177
178/*******************************************************************
179 inits a srvsvc_NetShareInfo1004 structure
180********************************************************************/
181
182void init_srvsvc_NetShareInfo1004(struct srvsvc_NetShareInfo1004 *r,
183 const char *comment)
184{
185 r->comment = comment;
186}
187
188/*******************************************************************
189 inits a srvsvc_NetShareInfo1005 structure
190********************************************************************/
191
192void init_srvsvc_NetShareInfo1005(struct srvsvc_NetShareInfo1005 *r,
193 uint32_t dfs_flags)
194{
195 r->dfs_flags = dfs_flags;
196}
197
198/*******************************************************************
199 inits a srvsvc_NetShareInfo1006 structure
200********************************************************************/
201
202void init_srvsvc_NetShareInfo1006(struct srvsvc_NetShareInfo1006 *r,
203 uint32_t max_users)
204{
205 r->max_users = max_users;
206}
207
208/*******************************************************************
209 inits a srvsvc_NetShareInfo1007 structure
210********************************************************************/
211
212void init_srvsvc_NetShareInfo1007(struct srvsvc_NetShareInfo1007 *r,
213 uint32_t flags,
214 const char *alternate_directory_name)
215{
216 r->flags = flags;
217 r->alternate_directory_name = alternate_directory_name;
218}
219
220/*******************************************************************
221 inits a srvsvc_NetRemoteTODInfo structure
222 ********************************************************************/
223
224void init_srvsvc_NetRemoteTODInfo(struct srvsvc_NetRemoteTODInfo *r,
225 uint32_t elapsed,
226 uint32_t msecs,
227 uint32_t hours,
228 uint32_t mins,
229 uint32_t secs,
230 uint32_t hunds,
231 int32_t ttimezone,
232 uint32_t tinterval,
233 uint32_t day,
234 uint32_t month,
235 uint32_t year,
236 uint32_t weekday)
237{
238 r->elapsed = elapsed;
239 r->msecs = msecs;
240 r->hours = hours;
241 r->mins = mins;
242 r->secs = secs;
243 r->hunds = hunds;
244 r->timezone = ttimezone;
245 r->tinterval = tinterval;
246 r->day = day;
247 r->month = month;
248 r->year = year;
249 r->weekday = weekday;
250}
251
252/*******************************************************************
253 inits a srvsvc_NetSessInfo0 structure
254 ********************************************************************/
255
256void init_srvsvc_NetSessInfo0(struct srvsvc_NetSessInfo0 *r,
257 const char *client)
258{
259 r->client = client;
260}
261
262/*******************************************************************
263 inits a srvsvc_NetSessInfo1 structure
264 ********************************************************************/
265
266void init_srvsvc_NetSessInfo1(struct srvsvc_NetSessInfo1 *r,
267 const char *client,
268 const char *user,
269 uint32_t num_open,
270 uint32_t _time,
271 uint32_t idle_time,
272 uint32_t user_flags)
273{
274 r->client = client;
275 r->user = user;
276 r->num_open = num_open;
277 r->time = _time;
278 r->idle_time = idle_time;
279 r->user_flags = user_flags;
280}
281
282/*******************************************************************
283 inits a srvsvc_NetSessInfo2 structure
284 ********************************************************************/
285
286void init_srvsvc_NetSessInfo2(struct srvsvc_NetSessInfo2 *r,
287 const char *client,
288 const char *user,
289 uint32_t num_open,
290 uint32_t _time,
291 uint32_t idle_time,
292 uint32_t user_flags,
293 const char *client_type)
294{
295 r->client = client;
296 r->user = user;
297 r->num_open = num_open;
298 r->time = _time;
299 r->idle_time = idle_time;
300 r->user_flags = user_flags;
301 r->client_type = client_type;
302}
303
304/*******************************************************************
305 inits a srvsvc_NetSessInfo10 structure
306 ********************************************************************/
307
308void init_srvsvc_NetSessInfo10(struct srvsvc_NetSessInfo10 *r,
309 const char *client,
310 const char *user,
311 uint32_t _time,
312 uint32_t idle_time)
313{
314 r->client = client;
315 r->user = user;
316 r->time = _time;
317 r->idle_time = idle_time;
318}
319
320/*******************************************************************
321 inits a srvsvc_NetSessInfo502 structure
322 ********************************************************************/
323
324void init_srvsvc_NetSessInfo502(struct srvsvc_NetSessInfo502 *r,
325 const char *client,
326 const char *user,
327 uint32_t num_open,
328 uint32_t _time,
329 uint32_t idle_time,
330 uint32_t user_flags,
331 const char *client_type,
332 const char *transport)
333{
334 r->client = client;
335 r->user = user;
336 r->num_open = num_open;
337 r->time = _time;
338 r->idle_time = idle_time;
339 r->user_flags = user_flags;
340 r->client_type = client_type;
341 r->transport = transport;
342}
343
344/*******************************************************************
345 inits a srvsvc_NetFileInfo2 structure
346 ********************************************************************/
347
348void init_srvsvc_NetFileInfo2(struct srvsvc_NetFileInfo2 *r,
349 uint32_t fid)
350{
351 r->fid = fid;
352}
353
354/*******************************************************************
355 inits a srvsvc_NetFileInfo3 structure
356 ********************************************************************/
357
358void init_srvsvc_NetFileInfo3(struct srvsvc_NetFileInfo3 *r,
359 uint32_t fid,
360 uint32_t permissions,
361 uint32_t num_locks,
362 const char *path,
363 const char *user)
364{
365 r->fid = fid;
366 r->permissions = permissions;
367 r->num_locks = num_locks;
368 r->path = path;
369 r->user = user;
370}
371
372/*******************************************************************
373 inits a srvsvc_NetConnInfo0 structure
374 ********************************************************************/
375
376void init_srvsvc_NetConnInfo0(struct srvsvc_NetConnInfo0 *r,
377 uint32_t conn_id)
378{
379 r->conn_id = conn_id;
380}
381
382/*******************************************************************
383 inits a srvsvc_NetConnInfo1 structure
384 ********************************************************************/
385
386void init_srvsvc_NetConnInfo1(struct srvsvc_NetConnInfo1 *r,
387 uint32_t conn_id,
388 uint32_t conn_type,
389 uint32_t num_open,
390 uint32_t num_users,
391 uint32_t conn_time,
392 const char *user,
393 const char *share)
394{
395 r->conn_id = conn_id;
396 r->conn_type = conn_type;
397 r->num_open = num_open;
398 r->num_users = num_users;
399 r->conn_time = conn_time;
400 r->user = user;
401 r->share = share;
402}
Note: See TracBrowser for help on using the repository browser.