2 * Unix SMB/CIFS implementation.
3 * RPC Pipe client / server routines
4 * Copyright (C) Guenther Deschner 2008.
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.
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.
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/>.
22 /*******************************************************************
23 inits a srvsvc_NetSrvInfo102 structure
24 ********************************************************************/
26 void 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
,
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
;
50 r
->announce
= announce
;
51 r
->anndelta
= anndelta
;
52 r
->licenses
= licenses
;
53 r
->userpath
= userpath
;
56 /*******************************************************************
57 inits a srvsvc_NetSrvInfo101 structure
58 ********************************************************************/
60 void 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
,
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
;
76 /*******************************************************************
77 inits a srvsvc_NetSrvInfo100 structure
78 ********************************************************************/
80 void init_srvsvc_NetSrvInfo100(struct srvsvc_NetSrvInfo100
*r
,
81 enum srvsvc_PlatformId platform_id
,
82 const char *server_name
)
84 r
->platform_id
= platform_id
;
85 r
->server_name
= server_name
;
88 /*******************************************************************
89 inits a srvsvc_NetShareInfo0 structure
90 ********************************************************************/
92 void init_srvsvc_NetShareInfo0(struct srvsvc_NetShareInfo0
*r
,
98 /*******************************************************************
99 inits a srvsvc_NetShareInfo1 structure
100 ********************************************************************/
102 void init_srvsvc_NetShareInfo1(struct srvsvc_NetShareInfo1
*r
,
104 enum srvsvc_ShareType type
,
109 r
->comment
= comment
;
112 /*******************************************************************
113 inits a srvsvc_NetShareInfo2 structure
114 ********************************************************************/
116 void init_srvsvc_NetShareInfo2(struct srvsvc_NetShareInfo2
*r
,
118 enum srvsvc_ShareType type
,
120 uint32_t permissions
,
122 uint32_t current_users
,
124 const char *password
)
128 r
->comment
= comment
;
129 r
->permissions
= permissions
;
130 r
->max_users
= max_users
;
131 r
->current_users
= current_users
;
133 r
->password
= password
;
136 /*******************************************************************
137 inits a srvsvc_NetShareInfo501 structure
138 ********************************************************************/
140 void init_srvsvc_NetShareInfo501(struct srvsvc_NetShareInfo501
*r
,
142 enum srvsvc_ShareType type
,
148 r
->comment
= comment
;
149 r
->csc_policy
= csc_policy
;
152 /*******************************************************************
153 inits a srvsvc_NetShareInfo502 structure
154 ********************************************************************/
156 void init_srvsvc_NetShareInfo502(struct srvsvc_NetShareInfo502
*r
,
158 enum srvsvc_ShareType type
,
160 uint32_t permissions
,
162 uint32_t current_users
,
164 const char *password
,
165 struct sec_desc_buf
*sd_buf
)
169 r
->comment
= comment
;
170 r
->permissions
= permissions
;
171 r
->max_users
= max_users
;
172 r
->current_users
= current_users
;
174 r
->password
= password
;
178 /*******************************************************************
179 inits a srvsvc_NetShareInfo1004 structure
180 ********************************************************************/
182 void init_srvsvc_NetShareInfo1004(struct srvsvc_NetShareInfo1004
*r
,
185 r
->comment
= comment
;
188 /*******************************************************************
189 inits a srvsvc_NetShareInfo1005 structure
190 ********************************************************************/
192 void init_srvsvc_NetShareInfo1005(struct srvsvc_NetShareInfo1005
*r
,
195 r
->dfs_flags
= dfs_flags
;
198 /*******************************************************************
199 inits a srvsvc_NetShareInfo1006 structure
200 ********************************************************************/
202 void init_srvsvc_NetShareInfo1006(struct srvsvc_NetShareInfo1006
*r
,
205 r
->max_users
= max_users
;
208 /*******************************************************************
209 inits a srvsvc_NetShareInfo1007 structure
210 ********************************************************************/
212 void init_srvsvc_NetShareInfo1007(struct srvsvc_NetShareInfo1007
*r
,
214 const char *alternate_directory_name
)
217 r
->alternate_directory_name
= alternate_directory_name
;
220 /*******************************************************************
221 inits a srvsvc_NetRemoteTODInfo structure
222 ********************************************************************/
224 void init_srvsvc_NetRemoteTODInfo(struct srvsvc_NetRemoteTODInfo
*r
,
238 r
->elapsed
= elapsed
;
244 r
->timezone
= ttimezone
;
245 r
->tinterval
= tinterval
;
249 r
->weekday
= weekday
;
252 /*******************************************************************
253 inits a srvsvc_NetSessInfo0 structure
254 ********************************************************************/
256 void init_srvsvc_NetSessInfo0(struct srvsvc_NetSessInfo0
*r
,
262 /*******************************************************************
263 inits a srvsvc_NetSessInfo1 structure
264 ********************************************************************/
266 void init_srvsvc_NetSessInfo1(struct srvsvc_NetSessInfo1
*r
,
276 r
->num_open
= num_open
;
278 r
->idle_time
= idle_time
;
279 r
->user_flags
= user_flags
;
282 /*******************************************************************
283 inits a srvsvc_NetSessInfo2 structure
284 ********************************************************************/
286 void init_srvsvc_NetSessInfo2(struct srvsvc_NetSessInfo2
*r
,
293 const char *client_type
)
297 r
->num_open
= num_open
;
299 r
->idle_time
= idle_time
;
300 r
->user_flags
= user_flags
;
301 r
->client_type
= client_type
;
304 /*******************************************************************
305 inits a srvsvc_NetSessInfo10 structure
306 ********************************************************************/
308 void init_srvsvc_NetSessInfo10(struct srvsvc_NetSessInfo10
*r
,
317 r
->idle_time
= idle_time
;
320 /*******************************************************************
321 inits a srvsvc_NetSessInfo502 structure
322 ********************************************************************/
324 void init_srvsvc_NetSessInfo502(struct srvsvc_NetSessInfo502
*r
,
331 const char *client_type
,
332 const char *transport
)
336 r
->num_open
= num_open
;
338 r
->idle_time
= idle_time
;
339 r
->user_flags
= user_flags
;
340 r
->client_type
= client_type
;
341 r
->transport
= transport
;
344 /*******************************************************************
345 inits a srvsvc_NetFileInfo2 structure
346 ********************************************************************/
348 void init_srvsvc_NetFileInfo2(struct srvsvc_NetFileInfo2
*r
,
354 /*******************************************************************
355 inits a srvsvc_NetFileInfo3 structure
356 ********************************************************************/
358 void init_srvsvc_NetFileInfo3(struct srvsvc_NetFileInfo3
*r
,
360 uint32_t permissions
,
366 r
->permissions
= permissions
;
367 r
->num_locks
= num_locks
;
372 /*******************************************************************
373 inits a srvsvc_NetConnInfo0 structure
374 ********************************************************************/
376 void init_srvsvc_NetConnInfo0(struct srvsvc_NetConnInfo0
*r
,
379 r
->conn_id
= conn_id
;
382 /*******************************************************************
383 inits a srvsvc_NetConnInfo1 structure
384 ********************************************************************/
386 void init_srvsvc_NetConnInfo1(struct srvsvc_NetConnInfo1
*r
,
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
;