2 Unix SMB/CIFS implementation.
3 SMB parameters and setup
4 Copyright (C) Andrew Tridgell 1992-1997
5 Copyright (C) Luke Kenneth Casson Leighton 1996-1997
6 Copyright (C) Paul Ashton 1997
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_SRVSVC_H /* _RPC_SRVSVC_H */
28 #define SRV_NETCONNENUM 0x08
29 #define SRV_NETFILEENUM 0x09
30 #define SRV_NETSESSENUM 0x0c
31 #define SRV_NET_SHARE_ADD 0x0e
32 #define SRV_NETSHAREENUM_ALL 0x0f
33 #define SRV_NET_SHARE_GET_INFO 0x10
34 #define SRV_NET_SHARE_SET_INFO 0x11
35 #define SRV_NET_SHARE_DEL 0x12
36 #define SRV_NET_SRV_GET_INFO 0x15
37 #define SRV_NET_SRV_SET_INFO 0x16
38 #define SRV_NET_DISK_ENUM 0x17
39 #define SRV_NET_REMOTE_TOD 0x1c
40 #define SRV_NET_NAME_VALIDATE 0x21
41 #define SRV_NETSHAREENUM 0x24
42 #define SRV_NETFILEQUERYSECDESC 0x27
43 #define SRV_NETFILESETSECDESC 0x28
45 #define MAX_SERVER_DISK_ENTRIES 15
47 typedef struct disk_info {
52 typedef struct disk_enum_container {
57 DISK_INFO disk_info[MAX_SERVER_DISK_ENTRIES];
58 } DISK_ENUM_CONTAINER;
60 typedef struct net_srv_disk_enum {
61 uint32 ptr_srv_name; /* pointer (to server name?) */
62 UNISTR2 uni_srv_name; /* server name */
64 DISK_ENUM_CONTAINER disk_enum_ctr;
66 uint32 preferred_len; /* preferred maximum length (0xffff ffff) */
67 uint32 total_entries; /* total number of entries */
69 NTSTATUS status; /* return status */
70 } SRV_Q_NET_DISK_ENUM, SRV_R_NET_DISK_ENUM;
72 typedef struct net_name_validate {
75 UNISTR2 uni_name; /*name to validate*/
79 } SRV_Q_NET_NAME_VALIDATE, SRV_R_NET_NAME_VALIDATE;
81 /* SESS_INFO_0 (pointers to level 0 session info strings) */
82 typedef struct ptr_sess_info0
84 uint32 ptr_name; /* pointer to name. */
88 /* SESS_INFO_0_STR (level 0 session info strings) */
89 typedef struct str_sess_info0
91 UNISTR2 uni_name; /* unicode string of name */
95 /* oops - this is going to take up a *massive* amount of stack. */
96 /* the UNISTR2s already have 1024 uint16 chars in them... */
97 #define MAX_SESS_ENTRIES 32
100 typedef struct srv_sess_info_0_info
102 uint32 num_entries_read; /* EntriesRead */
103 uint32 ptr_sess_info; /* Buffer */
104 uint32 num_entries_read2; /* EntriesRead */
106 SESS_INFO_0 info_0 [MAX_SESS_ENTRIES]; /* session entry pointers */
107 SESS_INFO_0_STR info_0_str[MAX_SESS_ENTRIES]; /* session entry strings */
111 /* SESS_INFO_1 (pointers to level 1 session info strings) */
112 typedef struct ptr_sess_info1
114 uint32 ptr_name; /* pointer to name. */
115 uint32 ptr_user; /* pointer to user name. */
124 /* SESS_INFO_1_STR (level 1 session info strings) */
125 typedef struct str_sess_info1
127 UNISTR2 uni_name; /* unicode string of name */
128 UNISTR2 uni_user; /* unicode string of user */
132 /* SRV_SESS_INFO_1 */
133 typedef struct srv_sess_info_1_info
135 uint32 num_entries_read; /* EntriesRead */
136 uint32 ptr_sess_info; /* Buffer */
137 uint32 num_entries_read2; /* EntriesRead */
139 SESS_INFO_1 info_1 [MAX_SESS_ENTRIES]; /* session entry pointers */
140 SESS_INFO_1_STR info_1_str[MAX_SESS_ENTRIES]; /* session entry strings */
144 /* SRV_SESS_INFO_CTR */
145 typedef struct srv_sess_info_ctr_info
147 uint32 switch_value; /* switch value */
148 uint32 ptr_sess_ctr; /* pointer to sess info union */
151 SRV_SESS_INFO_0 info0; /* session info level 0 */
152 SRV_SESS_INFO_1 info1; /* session info level 1 */
159 /* SRV_Q_NET_SESS_ENUM */
160 typedef struct q_net_sess_enum_info
162 uint32 ptr_srv_name; /* pointer (to server name?) */
163 UNISTR2 uni_srv_name; /* server name */
165 uint32 ptr_qual_name; /* pointer (to qualifier name) */
166 UNISTR2 uni_qual_name; /* qualifier name "\\qualifier" */
168 uint32 sess_level; /* session level */
170 SRV_SESS_INFO_CTR *ctr;
172 uint32 preferred_len; /* preferred maximum length (0xffff ffff) */
175 } SRV_Q_NET_SESS_ENUM;
177 /* SRV_R_NET_SESS_ENUM */
178 typedef struct r_net_sess_enum_info
180 uint32 sess_level; /* share level */
182 SRV_SESS_INFO_CTR *ctr;
184 uint32 total_entries; /* total number of entries */
187 NTSTATUS status; /* return status */
189 } SRV_R_NET_SESS_ENUM;
191 /* CONN_INFO_0 (pointers to level 0 connection info strings) */
192 typedef struct ptr_conn_info0
194 uint32 id; /* connection id. */
198 /* oops - this is going to take up a *massive* amount of stack. */
199 /* the UNISTR2s already have 1024 uint16 chars in them... */
200 #define MAX_CONN_ENTRIES 32
202 /* SRV_CONN_INFO_0 */
203 typedef struct srv_conn_info_0_info
205 uint32 num_entries_read; /* EntriesRead */
206 uint32 ptr_conn_info; /* Buffer */
207 uint32 num_entries_read2; /* EntriesRead */
209 CONN_INFO_0 info_0 [MAX_CONN_ENTRIES]; /* connection entry pointers */
213 /* CONN_INFO_1 (pointers to level 1 connection info strings) */
214 typedef struct ptr_conn_info1
216 uint32 id; /* connection id */
217 uint32 type; /* 0x3 */
222 uint32 ptr_usr_name; /* pointer to user name. */
223 uint32 ptr_net_name; /* pointer to network name (e.g IPC$). */
227 /* CONN_INFO_1_STR (level 1 connection info strings) */
228 typedef struct str_conn_info1
230 UNISTR2 uni_usr_name; /* unicode string of user */
231 UNISTR2 uni_net_name; /* unicode string of name */
235 /* SRV_CONN_INFO_1 */
236 typedef struct srv_conn_info_1_info
238 uint32 num_entries_read; /* EntriesRead */
239 uint32 ptr_conn_info; /* Buffer */
240 uint32 num_entries_read2; /* EntriesRead */
242 CONN_INFO_1 info_1 [MAX_CONN_ENTRIES]; /* connection entry pointers */
243 CONN_INFO_1_STR info_1_str[MAX_CONN_ENTRIES]; /* connection entry strings */
247 /* SRV_CONN_INFO_CTR */
248 typedef struct srv_conn_info_ctr_info
250 uint32 switch_value; /* switch value */
251 uint32 ptr_conn_ctr; /* pointer to conn info union */
254 SRV_CONN_INFO_0 info0; /* connection info level 0 */
255 SRV_CONN_INFO_1 info1; /* connection info level 1 */
262 /* SRV_Q_NET_CONN_ENUM */
263 typedef struct q_net_conn_enum_info
265 uint32 ptr_srv_name; /* pointer (to server name) */
266 UNISTR2 uni_srv_name; /* server name "\\server" */
268 uint32 ptr_qual_name; /* pointer (to qualifier name) */
269 UNISTR2 uni_qual_name; /* qualifier name "\\qualifier" */
271 uint32 conn_level; /* connection level */
273 SRV_CONN_INFO_CTR *ctr;
275 uint32 preferred_len; /* preferred maximum length (0xffff ffff) */
278 } SRV_Q_NET_CONN_ENUM;
280 /* SRV_R_NET_CONN_ENUM */
281 typedef struct r_net_conn_enum_info
283 uint32 conn_level; /* share level */
285 SRV_CONN_INFO_CTR *ctr;
287 uint32 total_entries; /* total number of entries */
290 NTSTATUS status; /* return status */
292 } SRV_R_NET_CONN_ENUM;
294 /* SH_INFO_1 (pointers to level 1 share info strings) */
295 typedef struct ptr_share_info1
297 uint32 ptr_netname; /* pointer to net name. */
298 uint32 type; /* ipc, print, disk ... */
299 uint32 ptr_remark; /* pointer to comment. */
303 /* SH_INFO_1_STR (level 1 share info strings) */
304 typedef struct str_share_info1
306 UNISTR2 uni_netname; /* unicode string of net name */
307 UNISTR2 uni_remark; /* unicode string of comment */
311 /* SRV_SHARE_INFO_1 */
312 typedef struct share_info_1_info
315 SH_INFO_1_STR info_1_str;
319 /* SH_INFO_2 (pointers to level 2 share info strings) */
320 typedef struct ptr_share_info2
322 uint32 ptr_netname; /* pointer to net name. */
323 uint32 type; /* ipc, print, disk ... */
324 uint32 ptr_remark; /* pointer to comment. */
325 uint32 perms; /* permissions */
326 uint32 max_uses; /* maximum uses */
327 uint32 num_uses; /* current uses */
328 uint32 ptr_path; /* pointer to path name */
329 uint32 ptr_passwd; /* pointer to password */
333 /* SH_INFO_2_STR (level 2 share info strings) */
334 typedef struct str_share_info2
336 UNISTR2 uni_netname; /* unicode string of net name (e.g NETLOGON) */
337 UNISTR2 uni_remark; /* unicode string of comment (e.g "Logon server share") */
338 UNISTR2 uni_path; /* unicode string of local path (e.g c:\winnt\system32\repl\import\scripts) */
339 UNISTR2 uni_passwd; /* unicode string of password - presumably for share level security (e.g NULL) */
343 /* SRV_SHARE_INFO_2 */
344 typedef struct share_info_2_info
347 SH_INFO_2_STR info_2_str;
351 /* SH_INFO_502 (pointers to level 502 share info strings) */
352 typedef struct ptr_share_info502
354 uint32 ptr_netname; /* pointer to net name. */
355 uint32 type; /* ipc, print, disk ... */
356 uint32 ptr_remark; /* pointer to comment. */
357 uint32 perms; /* permissions */
358 uint32 max_uses; /* maximum uses */
359 uint32 num_uses; /* current uses */
360 uint32 ptr_path; /* pointer to path name */
361 uint32 ptr_passwd; /* pointer to password */
362 uint32 sd_size; /* size of security descriptor */
363 uint32 ptr_sd; /* pointer to security descriptor */
367 /* SH_INFO_502_STR (level 502 share info strings) */
368 typedef struct str_share_info502
372 UNISTR2 uni_netname; /* unicode string of net name (e.g NETLOGON) */
373 UNISTR2 uni_remark; /* unicode string of comment (e.g "Logon server share") */
374 UNISTR2 uni_path; /* unicode string of local path (e.g c:\winnt\system32\repl\import\scripts) */
375 UNISTR2 uni_passwd; /* unicode string of password - presumably for share level security (e.g NULL) */
382 /* SRV_SHARE_INFO_502 */
383 typedef struct share_info_502_info
385 SH_INFO_502 info_502;
386 SH_INFO_502_STR info_502_str;
388 } SRV_SHARE_INFO_502;
390 /* SRV_SHARE_INFO_1005 */
391 typedef struct share_info_1005_info
393 uint32 dfs_root_flag;
394 } SRV_SHARE_INFO_1005;
396 /* SRV_SHARE_INFO_1501 */
397 typedef struct share_info_1501_info
400 } SRV_SHARE_INFO_1501;
402 /* SRV_SHARE_INFO_CTR */
403 typedef struct srv_share_info_ctr_info
407 uint32 ptr_share_info;
414 SRV_SHARE_INFO_1 *info1; /* share info level 1 */
415 SRV_SHARE_INFO_2 *info2; /* share info level 2 */
416 SRV_SHARE_INFO_502 *info502; /* share info level 502 */
421 } SRV_SHARE_INFO_CTR;
423 /* SRV_Q_NET_SHARE_ENUM */
424 typedef struct q_net_share_enum_info
426 uint32 ptr_srv_name; /* pointer (to server name?) */
427 UNISTR2 uni_srv_name; /* server name */
429 SRV_SHARE_INFO_CTR ctr; /* share info container */
431 uint32 preferred_len; /* preferred maximum length (0xffff ffff) */
435 } SRV_Q_NET_SHARE_ENUM;
438 /* SRV_R_NET_SHARE_ENUM */
439 typedef struct r_net_share_enum_info
441 SRV_SHARE_INFO_CTR ctr; /* share info container */
443 uint32 total_entries; /* total number of entries */
446 NTSTATUS status; /* return status */
448 } SRV_R_NET_SHARE_ENUM;
451 /* SRV_Q_NET_SHARE_GET_INFO */
452 typedef struct q_net_share_get_info_info
455 UNISTR2 uni_srv_name;
457 UNISTR2 uni_share_name;
460 } SRV_Q_NET_SHARE_GET_INFO;
462 /* JRA. NB. We also need level 1004 and 1006 here. */
465 typedef struct srv_share_info {
467 uint32 ptr_share_ctr;
470 SRV_SHARE_INFO_1 info1;
471 SRV_SHARE_INFO_2 info2;
472 SRV_SHARE_INFO_502 info502;
473 SRV_SHARE_INFO_1005 info1005;
474 SRV_SHARE_INFO_1501 info1501;
478 /* SRV_R_NET_SHARE_GET_INFO */
479 typedef struct r_net_share_get_info_info
484 } SRV_R_NET_SHARE_GET_INFO;
486 /* SRV_Q_NET_SHARE_SET_INFO */
487 typedef struct q_net_share_set_info_info
490 UNISTR2 uni_srv_name;
492 UNISTR2 uni_share_name;
497 } SRV_Q_NET_SHARE_SET_INFO;
499 /* SRV_R_NET_SHARE_SET_INFO */
500 typedef struct r_net_share_set_info
502 uint32 switch_value; /* switch value */
504 NTSTATUS status; /* return status */
506 } SRV_R_NET_SHARE_SET_INFO;
508 /* SRV_Q_NET_SHARE_ADD */
509 typedef struct q_net_share_add
512 UNISTR2 uni_srv_name;
518 } SRV_Q_NET_SHARE_ADD;
520 /* SRV_R_NET_SHARE_ADD */
521 typedef struct r_net_share_add
523 uint32 switch_value; /* switch value */
525 NTSTATUS status; /* return status */
527 } SRV_R_NET_SHARE_ADD;
529 /* SRV_Q_NET_SHARE_DEL */
530 typedef struct q_net_share_del
533 UNISTR2 uni_srv_name;
534 UNISTR2 uni_share_name;
536 } SRV_Q_NET_SHARE_DEL;
538 /* SRV_R_NET_SHARE_DEL */
539 typedef struct r_net_share_del
541 NTSTATUS status; /* return status */
543 } SRV_R_NET_SHARE_DEL;
545 /* FILE_INFO_3 (level 3 file info strings) */
546 typedef struct file_info3_info
548 uint32 id; /* file index */
549 uint32 perms; /* file permissions. don't know what format */
550 uint32 num_locks; /* file locks */
551 uint32 ptr_path_name; /* file name */
552 uint32 ptr_user_name; /* file owner */
556 /* FILE_INFO_3_STR (level 3 file info strings) */
557 typedef struct str_file_info3_info
559 UNISTR2 uni_path_name; /* unicode string of file name */
560 UNISTR2 uni_user_name; /* unicode string of file owner. */
564 /* oops - this is going to take up a *massive* amount of stack. */
565 /* the UNISTR2s already have 1024 uint16 chars in them... */
566 #define MAX_FILE_ENTRIES 32
568 /* SRV_FILE_INFO_3 */
569 typedef struct srv_file_info_3
571 uint32 num_entries_read; /* EntriesRead */
572 uint32 ptr_file_info; /* Buffer */
574 uint32 num_entries_read2; /* EntriesRead */
576 FILE_INFO_3 info_3 [MAX_FILE_ENTRIES]; /* file entry details */
577 FILE_INFO_3_STR info_3_str[MAX_FILE_ENTRIES]; /* file entry strings */
581 /* SRV_FILE_INFO_CTR */
582 typedef struct srv_file_info_3_info
584 uint32 switch_value; /* switch value */
585 uint32 ptr_file_ctr; /* pointer to file info union */
588 SRV_FILE_INFO_3 info3; /* file info with 0 entries */
595 /* SRV_Q_NET_FILE_ENUM */
596 typedef struct q_net_file_enum_info
598 uint32 ptr_srv_name; /* pointer (to server name?) */
599 UNISTR2 uni_srv_name; /* server name */
601 uint32 ptr_qual_name; /* pointer (to qualifier name) */
602 UNISTR2 uni_qual_name; /* qualifier name "\\qualifier" */
604 uint32 file_level; /* file level */
606 SRV_FILE_INFO_CTR *ctr;
608 uint32 preferred_len; /* preferred maximum length (0xffff ffff) */
611 } SRV_Q_NET_FILE_ENUM;
614 /* SRV_R_NET_FILE_ENUM */
615 typedef struct r_net_file_enum_info
617 uint32 file_level; /* file level */
619 SRV_FILE_INFO_CTR *ctr;
621 uint32 total_entries; /* total number of files */
624 NTSTATUS status; /* return status */
626 } SRV_R_NET_FILE_ENUM;
629 typedef struct srv_info_100_info
631 uint32 platform_id; /* 0x500 */
632 uint32 ptr_name; /* pointer to server name */
634 UNISTR2 uni_name; /* server name "server" */
639 typedef struct srv_info_101_info
641 uint32 platform_id; /* 0x500 */
642 uint32 ptr_name; /* pointer to server name */
643 uint32 ver_major; /* 0x4 */
644 uint32 ver_minor; /* 0x2 */
645 uint32 srv_type; /* browse etc type */
646 uint32 ptr_comment; /* pointer to server comment */
648 UNISTR2 uni_name; /* server name "server" */
649 UNISTR2 uni_comment; /* server comment "samba x.x.x blah" */
654 typedef struct srv_info_102_info
656 uint32 platform_id; /* 0x500 */
657 uint32 ptr_name; /* pointer to server name */
658 uint32 ver_major; /* 0x4 */
659 uint32 ver_minor; /* 0x2 */
660 uint32 srv_type; /* browse etc type */
661 uint32 ptr_comment; /* pointer to server comment */
662 uint32 users; /* 0xffff ffff*/
663 uint32 disc; /* 0xf */
664 uint32 hidden; /* 0x0 */
665 uint32 announce; /* 240 */
666 uint32 ann_delta; /* 3000 */
667 uint32 licenses; /* 0 */
668 uint32 ptr_usr_path; /* pointer to user path */
670 UNISTR2 uni_name; /* server name "server" */
671 UNISTR2 uni_comment; /* server comment "samba x.x.x blah" */
672 UNISTR2 uni_usr_path; /* "c:\" (eh?) */
678 typedef struct srv_info_ctr_info
680 uint32 switch_value; /* switch value */
681 uint32 ptr_srv_ctr; /* pointer to server info */
684 SRV_INFO_102 sv102; /* server info level 102 */
685 SRV_INFO_101 sv101; /* server info level 101 */
686 SRV_INFO_100 sv100; /* server info level 100 */
692 /* SRV_Q_NET_SRV_GET_INFO */
693 typedef struct q_net_srv_get_info
696 UNISTR2 uni_srv_name; /* "\\server" */
699 } SRV_Q_NET_SRV_GET_INFO;
701 /* SRV_R_NET_SRV_GET_INFO */
702 typedef struct r_net_srv_get_info
706 NTSTATUS status; /* return status */
708 } SRV_R_NET_SRV_GET_INFO;
710 /* SRV_Q_NET_SRV_SET_INFO */
711 typedef struct q_net_srv_set_info
714 UNISTR2 uni_srv_name; /* "\\server" */
719 } SRV_Q_NET_SRV_SET_INFO;
722 /* SRV_R_NET_SRV_SET_INFO */
723 typedef struct r_net_srv_set_info
725 uint32 switch_value; /* switch value */
727 NTSTATUS status; /* return status */
729 } SRV_R_NET_SRV_SET_INFO;
731 /* SRV_Q_NET_REMOTE_TOD */
732 typedef struct q_net_remote_tod
735 UNISTR2 uni_srv_name; /* "\\server" */
737 } SRV_Q_NET_REMOTE_TOD;
739 /* TIME_OF_DAY_INFO */
740 typedef struct time_of_day_info
757 /* SRV_R_NET_REMOTE_TOD */
758 typedef struct r_net_remote_tod
760 uint32 ptr_srv_tod; /* pointer to TOD */
761 TIME_OF_DAY_INFO *tod;
763 NTSTATUS status; /* return status */
765 } SRV_R_NET_REMOTE_TOD;
767 /* SRV_Q_NET_FILE_QUERY_SECDESC */
768 typedef struct q_net_file_query_secdesc
771 UNISTR2 uni_srv_name;
772 uint32 ptr_qual_name;
773 UNISTR2 uni_qual_name;
774 UNISTR2 uni_file_name;
778 } SRV_Q_NET_FILE_QUERY_SECDESC;
780 /* SRV_R_NET_FILE_QUERY_SECDESC */
781 typedef struct r_net_file_query_secdesc
784 uint32 size_response;
789 } SRV_R_NET_FILE_QUERY_SECDESC;
791 /* SRV_Q_NET_FILE_SET_SECDESC */
792 typedef struct q_net_file_set_secdesc
795 UNISTR2 uni_srv_name;
796 uint32 ptr_qual_name;
797 UNISTR2 uni_qual_name;
798 UNISTR2 uni_file_name;
804 } SRV_Q_NET_FILE_SET_SECDESC;
806 /* SRV_R_NET_FILE_SET_SECDESC */
807 typedef struct r_net_file_set_secdesc
810 } SRV_R_NET_FILE_SET_SECDESC;
811 #endif /* _RPC_SRVSVC_H */