2 Unix SMB/Netbios implementation.
4 SMB parameters and setup
5 Copyright (C) Andrew Tridgell 1992-1997
6 Copyright (C) Luke Kenneth Casson Leighton 1996-1997
7 Copyright (C) Paul Ashton 1997
9 This program is free software; you can redistribute it and/or modify
10 it under the terms of the GNU General Public License as published by
11 the Free Software Foundation; either version 2 of the License, or
12 (at your option) any later version.
14 This program is distributed in the hope that it will be useful,
15 but WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 GNU General Public License for more details.
19 You should have received a copy of the GNU General Public License
20 along with this program; if not, write to the Free Software
21 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
24 #ifndef _RPC_SRVSVC_H /* _RPC_SRVSVC_H */
29 #define SRV_NETCONNENUM 0x08
30 #define SRV_NETFILEENUM 0x09
31 #define SRV_NETSESSENUM 0x0c
32 #define SRV_NETSHAREENUM 0x0f
33 #define SRV_NET_SHARE_GET_INFO 0x10
34 #define SRV_NET_SHARE_SET_INFO 0x11
35 #define SRV_NET_SRV_GET_INFO 0x15
36 #define SRV_NET_SRV_SET_INFO 0x16
37 #define SRV_NET_REMOTE_TOD 0x1c
39 /* SESS_INFO_0 (pointers to level 0 session info strings) */
40 typedef struct ptr_sess_info0
42 uint32 ptr_name; /* pointer to name. */
46 /* SESS_INFO_0_STR (level 0 session info strings) */
47 typedef struct str_sess_info0
49 UNISTR2 uni_name; /* unicode string of name */
53 /* oops - this is going to take up a *massive* amount of stack. */
54 /* the UNISTR2s already have 1024 uint16 chars in them... */
55 #define MAX_SESS_ENTRIES 32
58 typedef struct srv_sess_info_0_info
60 uint32 num_entries_read; /* EntriesRead */
61 uint32 ptr_sess_info; /* Buffer */
62 uint32 num_entries_read2; /* EntriesRead */
64 SESS_INFO_0 info_0 [MAX_SESS_ENTRIES]; /* session entry pointers */
65 SESS_INFO_0_STR info_0_str[MAX_SESS_ENTRIES]; /* session entry strings */
69 /* SESS_INFO_1 (pointers to level 1 session info strings) */
70 typedef struct ptr_sess_info1
72 uint32 ptr_name; /* pointer to name. */
73 uint32 ptr_user; /* pointer to user name. */
82 /* SESS_INFO_1_STR (level 1 session info strings) */
83 typedef struct str_sess_info1
85 UNISTR2 uni_name; /* unicode string of name */
86 UNISTR2 uni_user; /* unicode string of user */
91 typedef struct srv_sess_info_1_info
93 uint32 num_entries_read; /* EntriesRead */
94 uint32 ptr_sess_info; /* Buffer */
95 uint32 num_entries_read2; /* EntriesRead */
97 SESS_INFO_1 info_1 [MAX_SESS_ENTRIES]; /* session entry pointers */
98 SESS_INFO_1_STR info_1_str[MAX_SESS_ENTRIES]; /* session entry strings */
102 /* SRV_SESS_INFO_CTR */
103 typedef struct srv_sess_info_ctr_info
105 uint32 switch_value; /* switch value */
106 uint32 ptr_sess_ctr; /* pointer to sess info union */
109 SRV_SESS_INFO_0 info0; /* session info level 0 */
110 SRV_SESS_INFO_1 info1; /* session info level 1 */
117 /* SRV_Q_NET_SESS_ENUM */
118 typedef struct q_net_sess_enum_info
120 uint32 ptr_srv_name; /* pointer (to server name?) */
121 UNISTR2 uni_srv_name; /* server name */
123 uint32 ptr_qual_name; /* pointer (to qualifier name) */
124 UNISTR2 uni_qual_name; /* qualifier name "\\qualifier" */
126 uint32 sess_level; /* session level */
128 SRV_SESS_INFO_CTR *ctr;
130 uint32 preferred_len; /* preferred maximum length (0xffff ffff) */
133 } SRV_Q_NET_SESS_ENUM;
135 /* SRV_R_NET_SESS_ENUM */
136 typedef struct r_net_sess_enum_info
138 uint32 sess_level; /* share level */
140 SRV_SESS_INFO_CTR *ctr;
142 uint32 total_entries; /* total number of entries */
145 uint32 status; /* return status */
147 } SRV_R_NET_SESS_ENUM;
149 /* CONN_INFO_0 (pointers to level 0 connection info strings) */
150 typedef struct ptr_conn_info0
152 uint32 id; /* connection id. */
156 /* oops - this is going to take up a *massive* amount of stack. */
157 /* the UNISTR2s already have 1024 uint16 chars in them... */
158 #define MAX_CONN_ENTRIES 32
160 /* SRV_CONN_INFO_0 */
161 typedef struct srv_conn_info_0_info
163 uint32 num_entries_read; /* EntriesRead */
164 uint32 ptr_conn_info; /* Buffer */
165 uint32 num_entries_read2; /* EntriesRead */
167 CONN_INFO_0 info_0 [MAX_CONN_ENTRIES]; /* connection entry pointers */
171 /* CONN_INFO_1 (pointers to level 1 connection info strings) */
172 typedef struct ptr_conn_info1
174 uint32 id; /* connection id */
175 uint32 type; /* 0x3 */
180 uint32 ptr_usr_name; /* pointer to user name. */
181 uint32 ptr_net_name; /* pointer to network name (e.g IPC$). */
185 /* CONN_INFO_1_STR (level 1 connection info strings) */
186 typedef struct str_conn_info1
188 UNISTR2 uni_usr_name; /* unicode string of user */
189 UNISTR2 uni_net_name; /* unicode string of name */
193 /* SRV_CONN_INFO_1 */
194 typedef struct srv_conn_info_1_info
196 uint32 num_entries_read; /* EntriesRead */
197 uint32 ptr_conn_info; /* Buffer */
198 uint32 num_entries_read2; /* EntriesRead */
200 CONN_INFO_1 info_1 [MAX_CONN_ENTRIES]; /* connection entry pointers */
201 CONN_INFO_1_STR info_1_str[MAX_CONN_ENTRIES]; /* connection entry strings */
205 /* SRV_CONN_INFO_CTR */
206 typedef struct srv_conn_info_ctr_info
208 uint32 switch_value; /* switch value */
209 uint32 ptr_conn_ctr; /* pointer to conn info union */
212 SRV_CONN_INFO_0 info0; /* connection info level 0 */
213 SRV_CONN_INFO_1 info1; /* connection info level 1 */
220 /* SRV_Q_NET_CONN_ENUM */
221 typedef struct q_net_conn_enum_info
223 uint32 ptr_srv_name; /* pointer (to server name) */
224 UNISTR2 uni_srv_name; /* server name "\\server" */
226 uint32 ptr_qual_name; /* pointer (to qualifier name) */
227 UNISTR2 uni_qual_name; /* qualifier name "\\qualifier" */
229 uint32 conn_level; /* connection level */
231 SRV_CONN_INFO_CTR *ctr;
233 uint32 preferred_len; /* preferred maximum length (0xffff ffff) */
236 } SRV_Q_NET_CONN_ENUM;
238 /* SRV_R_NET_CONN_ENUM */
239 typedef struct r_net_conn_enum_info
241 uint32 conn_level; /* share level */
243 SRV_CONN_INFO_CTR *ctr;
245 uint32 total_entries; /* total number of entries */
248 uint32 status; /* return status */
250 } SRV_R_NET_CONN_ENUM;
252 /* SH_INFO_1 (pointers to level 1 share info strings) */
253 typedef struct ptr_share_info1
255 uint32 ptr_netname; /* pointer to net name. */
256 uint32 type; /* ipc, print, disk ... */
257 uint32 ptr_remark; /* pointer to comment. */
261 /* SH_INFO_1_STR (level 1 share info strings) */
262 typedef struct str_share_info1
264 UNISTR2 uni_netname; /* unicode string of net name */
265 UNISTR2 uni_remark; /* unicode string of comment */
269 /* SRV_SHARE_INFO_1 */
270 typedef struct share_info_1_info
273 SH_INFO_1_STR info_1_str;
277 /* SH_INFO_2 (pointers to level 2 share info strings) */
278 typedef struct ptr_share_info2
280 uint32 ptr_netname; /* pointer to net name. */
281 uint32 type; /* ipc, print, disk ... */
282 uint32 ptr_remark; /* pointer to comment. */
283 uint32 perms; /* permissions */
284 uint32 max_uses; /* maximum uses */
285 uint32 num_uses; /* current uses */
286 uint32 ptr_path; /* pointer to path name */
287 uint32 ptr_passwd; /* pointer to password */
291 /* SH_INFO_2_STR (level 2 share info strings) */
292 typedef struct str_share_info2
294 UNISTR2 uni_netname; /* unicode string of net name (e.g NETLOGON) */
295 UNISTR2 uni_remark; /* unicode string of comment (e.g "Logon server share") */
296 UNISTR2 uni_path; /* unicode string of local path (e.g c:\winnt\system32\repl\import\scripts) */
297 UNISTR2 uni_passwd; /* unicode string of password - presumably for share level security (e.g NULL) */
301 /* SRV_SHARE_INFO_2 */
302 typedef struct share_info_2_info
305 SH_INFO_2_STR info_2_str;
309 /* SH_INFO_502 (pointers to level 502 share info strings) */
310 typedef struct ptr_share_info502
312 uint32 ptr_netname; /* pointer to net name. */
313 uint32 type; /* ipc, print, disk ... */
314 uint32 ptr_remark; /* pointer to comment. */
315 uint32 perms; /* permissions */
316 uint32 max_uses; /* maximum uses */
317 uint32 num_uses; /* current uses */
318 uint32 ptr_path; /* pointer to path name */
319 uint32 ptr_passwd; /* pointer to password */
320 uint32 sd_size; /* size of security descriptor */
321 uint32 ptr_sd; /* pointer to security descriptor */
325 /* SH_INFO_502_STR (level 502 share info strings) */
326 typedef struct str_share_info502
328 UNISTR2 uni_netname; /* unicode string of net name (e.g NETLOGON) */
329 UNISTR2 uni_remark; /* unicode string of comment (e.g "Logon server share") */
330 UNISTR2 uni_path; /* unicode string of local path (e.g c:\winnt\system32\repl\import\scripts) */
331 UNISTR2 uni_passwd; /* unicode string of password - presumably for share level security (e.g NULL) */
338 /* SRV_SHARE_INFO_502 */
339 /* SRV_SHARE_INFO_2 */
340 typedef struct share_info_502_info
342 SH_INFO_502 info_502;
343 SH_INFO_502_STR info_502_str;
345 } SRV_SHARE_INFO_502;
347 /* SRV_SHARE_INFO_1005 */
348 typedef struct share_info_1005_info
350 uint32 dfs_root_flag;
351 } SRV_SHARE_INFO_1005;
353 /* SRV_SHARE_INFO_CTR */
354 typedef struct srv_share_info_ctr_info
358 uint32 ptr_share_info;
365 SRV_SHARE_INFO_1 *info1; /* share info level 1 */
366 SRV_SHARE_INFO_2 *info2; /* share info level 2 */
367 SRV_SHARE_INFO_502 *info502; /* share info level 502 */
372 } SRV_SHARE_INFO_CTR;
374 /* SRV_Q_NET_SHARE_ENUM */
375 typedef struct q_net_share_enum_info
377 uint32 ptr_srv_name; /* pointer (to server name?) */
378 UNISTR2 uni_srv_name; /* server name */
380 SRV_SHARE_INFO_CTR ctr; /* share info container */
382 uint32 preferred_len; /* preferred maximum length (0xffff ffff) */
386 } SRV_Q_NET_SHARE_ENUM;
389 /* SRV_R_NET_SHARE_ENUM */
390 typedef struct r_net_share_enum_info
392 SRV_SHARE_INFO_CTR ctr; /* share info container */
394 uint32 total_entries; /* total number of entries */
397 uint32 status; /* return status */
399 } SRV_R_NET_SHARE_ENUM;
402 /* SRV_Q_NET_SHARE_GET_INFO */
403 typedef struct q_net_share_get_info_info
406 UNISTR2 uni_srv_name;
408 UNISTR2 uni_share_name;
411 } SRV_Q_NET_SHARE_GET_INFO;
414 typedef struct srv_share_info {
416 uint32 ptr_share_ctr;
419 SRV_SHARE_INFO_1 info1;
420 SRV_SHARE_INFO_2 info2;
421 SRV_SHARE_INFO_502 info502;
422 SRV_SHARE_INFO_1005 info1005;
426 /* SRV_R_NET_SHARE_GET_INFO */
427 typedef struct r_net_share_get_info_info
432 } SRV_R_NET_SHARE_GET_INFO;
434 /* JRA. NB. We also need level 1004, 1006 and 1501 here. */
436 /* SRV_Q_NET_SHARE_SET_INFO */
437 typedef struct q_net_share_set_info_info
440 UNISTR2 uni_srv_name;
442 UNISTR2 uni_share_name;
447 } SRV_Q_NET_SHARE_SET_INFO;
449 /* SRV_R_NET_SHARE_SET_INFO */
450 typedef struct r_net_share_set_info
452 uint32 switch_value; /* switch value */
454 uint32 status; /* return status */
456 } SRV_R_NET_SHARE_SET_INFO;
458 /* FILE_INFO_3 (level 3 file info strings) */
459 typedef struct file_info3_info
461 uint32 id; /* file index */
462 uint32 perms; /* file permissions. don't know what format */
463 uint32 num_locks; /* file locks */
464 uint32 ptr_path_name; /* file name */
465 uint32 ptr_user_name; /* file owner */
469 /* FILE_INFO_3_STR (level 3 file info strings) */
470 typedef struct str_file_info3_info
472 UNISTR2 uni_path_name; /* unicode string of file name */
473 UNISTR2 uni_user_name; /* unicode string of file owner. */
477 /* oops - this is going to take up a *massive* amount of stack. */
478 /* the UNISTR2s already have 1024 uint16 chars in them... */
479 #define MAX_FILE_ENTRIES 32
481 /* SRV_FILE_INFO_3 */
482 typedef struct srv_file_info_3
484 uint32 num_entries_read; /* EntriesRead */
485 uint32 ptr_file_info; /* Buffer */
487 uint32 num_entries_read2; /* EntriesRead */
489 FILE_INFO_3 info_3 [MAX_FILE_ENTRIES]; /* file entry details */
490 FILE_INFO_3_STR info_3_str[MAX_FILE_ENTRIES]; /* file entry strings */
494 /* SRV_FILE_INFO_CTR */
495 typedef struct srv_file_info_3_info
497 uint32 switch_value; /* switch value */
498 uint32 ptr_file_ctr; /* pointer to file info union */
501 SRV_FILE_INFO_3 info3; /* file info with 0 entries */
508 /* SRV_Q_NET_FILE_ENUM */
509 typedef struct q_net_file_enum_info
511 uint32 ptr_srv_name; /* pointer (to server name?) */
512 UNISTR2 uni_srv_name; /* server name */
514 uint32 ptr_qual_name; /* pointer (to qualifier name) */
515 UNISTR2 uni_qual_name; /* qualifier name "\\qualifier" */
517 uint32 file_level; /* file level */
519 SRV_FILE_INFO_CTR *ctr;
521 uint32 preferred_len; /* preferred maximum length (0xffff ffff) */
524 } SRV_Q_NET_FILE_ENUM;
527 /* SRV_R_NET_FILE_ENUM */
528 typedef struct r_net_file_enum_info
530 uint32 file_level; /* file level */
532 SRV_FILE_INFO_CTR *ctr;
534 uint32 total_entries; /* total number of files */
537 uint32 status; /* return status */
539 } SRV_R_NET_FILE_ENUM;
542 typedef struct srv_info_100_info
544 uint32 platform_id; /* 0x500 */
545 uint32 ptr_name; /* pointer to server name */
547 UNISTR2 uni_name; /* server name "server" */
552 typedef struct srv_info_101_info
554 uint32 platform_id; /* 0x500 */
555 uint32 ptr_name; /* pointer to server name */
556 uint32 ver_major; /* 0x4 */
557 uint32 ver_minor; /* 0x2 */
558 uint32 srv_type; /* browse etc type */
559 uint32 ptr_comment; /* pointer to server comment */
561 UNISTR2 uni_name; /* server name "server" */
562 UNISTR2 uni_comment; /* server comment "samba x.x.x blah" */
567 typedef struct srv_info_102_info
569 uint32 platform_id; /* 0x500 */
570 uint32 ptr_name; /* pointer to server name */
571 uint32 ver_major; /* 0x4 */
572 uint32 ver_minor; /* 0x2 */
573 uint32 srv_type; /* browse etc type */
574 uint32 ptr_comment; /* pointer to server comment */
575 uint32 users; /* 0xffff ffff*/
576 uint32 disc; /* 0xf */
577 uint32 hidden; /* 0x0 */
578 uint32 announce; /* 240 */
579 uint32 ann_delta; /* 3000 */
580 uint32 licenses; /* 0 */
581 uint32 ptr_usr_path; /* pointer to user path */
583 UNISTR2 uni_name; /* server name "server" */
584 UNISTR2 uni_comment; /* server comment "samba x.x.x blah" */
585 UNISTR2 uni_usr_path; /* "c:\" (eh?) */
591 typedef struct srv_info_ctr_info
593 uint32 switch_value; /* switch value */
594 uint32 ptr_srv_ctr; /* pointer to server info */
597 SRV_INFO_102 sv102; /* server info level 102 */
598 SRV_INFO_101 sv101; /* server info level 101 */
599 SRV_INFO_100 sv100; /* server info level 100 */
605 /* SRV_Q_NET_SRV_GET_INFO */
606 typedef struct q_net_srv_get_info
609 UNISTR2 uni_srv_name; /* "\\server" */
612 } SRV_Q_NET_SRV_GET_INFO;
614 /* SRV_R_NET_SRV_GET_INFO */
615 typedef struct r_net_srv_get_info
619 uint32 status; /* return status */
621 } SRV_R_NET_SRV_GET_INFO;
623 /* SRV_Q_NET_SRV_SET_INFO */
624 typedef struct q_net_srv_set_info
627 UNISTR2 uni_srv_name; /* "\\server" */
632 } SRV_Q_NET_SRV_SET_INFO;
635 /* SRV_R_NET_SRV_SET_INFO */
636 typedef struct r_net_srv_set_info
638 uint32 switch_value; /* switch value */
640 uint32 status; /* return status */
642 } SRV_R_NET_SRV_SET_INFO;
644 /* SRV_Q_NET_REMOTE_TOD */
645 typedef struct q_net_remote_tod
648 UNISTR2 uni_srv_name; /* "\\server" */
650 } SRV_Q_NET_REMOTE_TOD;
652 /* TIME_OF_DAY_INFO */
653 typedef struct time_of_day_info
670 /* SRV_R_NET_REMOTE_TOD */
671 typedef struct r_net_remote_tod
673 uint32 ptr_srv_tod; /* pointer to TOD */
674 TIME_OF_DAY_INFO *tod;
676 uint32 status; /* return status */
678 } SRV_R_NET_REMOTE_TOD;
681 #endif /* _RPC_SRVSVC_H */