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_NET_SHARE_ADD 0x0e
33 #define SRV_NETSHAREENUM_ALL 0x0f
34 #define SRV_NET_SHARE_GET_INFO 0x10
35 #define SRV_NET_SHARE_SET_INFO 0x11
36 #define SRV_NET_SHARE_DEL 0x12
37 #define SRV_NET_SRV_GET_INFO 0x15
38 #define SRV_NET_SRV_SET_INFO 0x16
39 #define SRV_NET_DISK_ENUM 0x17
40 #define SRV_NET_REMOTE_TOD 0x1c
41 #define SRV_NET_NAME_VALIDATE 0x21
42 #define SRV_NETSHAREENUM 0x24
43 #define SRV_NETFILEQUERYSECDESC 0x27
44 #define SRV_NETFILESETSECDESC 0x28
46 #define MAX_SERVER_DISK_ENTRIES 15
48 typedef struct disk_info {
53 typedef struct disk_enum_container {
58 DISK_INFO disk_info[MAX_SERVER_DISK_ENTRIES];
59 } DISK_ENUM_CONTAINER;
61 typedef struct net_srv_disk_enum {
62 uint32 ptr_srv_name; /* pointer (to server name?) */
63 UNISTR2 uni_srv_name; /* server name */
65 DISK_ENUM_CONTAINER disk_enum_ctr;
67 uint32 preferred_len; /* preferred maximum length (0xffff ffff) */
68 uint32 total_entries; /* total number of entries */
70 uint32 status; /* return status */
71 } SRV_Q_NET_DISK_ENUM, SRV_R_NET_DISK_ENUM;
73 typedef struct net_name_validate {
76 UNISTR2 uni_name; /*name to validate*/
80 } SRV_Q_NET_NAME_VALIDATE, SRV_R_NET_NAME_VALIDATE;
82 /* SESS_INFO_0 (pointers to level 0 session info strings) */
83 typedef struct ptr_sess_info0
85 uint32 ptr_name; /* pointer to name. */
89 /* SESS_INFO_0_STR (level 0 session info strings) */
90 typedef struct str_sess_info0
92 UNISTR2 uni_name; /* unicode string of name */
96 /* oops - this is going to take up a *massive* amount of stack. */
97 /* the UNISTR2s already have 1024 uint16 chars in them... */
98 #define MAX_SESS_ENTRIES 32
100 /* SRV_SESS_INFO_0 */
101 typedef struct srv_sess_info_0_info
103 uint32 num_entries_read; /* EntriesRead */
104 uint32 ptr_sess_info; /* Buffer */
105 uint32 num_entries_read2; /* EntriesRead */
107 SESS_INFO_0 info_0 [MAX_SESS_ENTRIES]; /* session entry pointers */
108 SESS_INFO_0_STR info_0_str[MAX_SESS_ENTRIES]; /* session entry strings */
112 /* SESS_INFO_1 (pointers to level 1 session info strings) */
113 typedef struct ptr_sess_info1
115 uint32 ptr_name; /* pointer to name. */
116 uint32 ptr_user; /* pointer to user name. */
125 /* SESS_INFO_1_STR (level 1 session info strings) */
126 typedef struct str_sess_info1
128 UNISTR2 uni_name; /* unicode string of name */
129 UNISTR2 uni_user; /* unicode string of user */
133 /* SRV_SESS_INFO_1 */
134 typedef struct srv_sess_info_1_info
136 uint32 num_entries_read; /* EntriesRead */
137 uint32 ptr_sess_info; /* Buffer */
138 uint32 num_entries_read2; /* EntriesRead */
140 SESS_INFO_1 info_1 [MAX_SESS_ENTRIES]; /* session entry pointers */
141 SESS_INFO_1_STR info_1_str[MAX_SESS_ENTRIES]; /* session entry strings */
145 /* SRV_SESS_INFO_CTR */
146 typedef struct srv_sess_info_ctr_info
148 uint32 switch_value; /* switch value */
149 uint32 ptr_sess_ctr; /* pointer to sess info union */
152 SRV_SESS_INFO_0 info0; /* session info level 0 */
153 SRV_SESS_INFO_1 info1; /* session info level 1 */
160 /* SRV_Q_NET_SESS_ENUM */
161 typedef struct q_net_sess_enum_info
163 uint32 ptr_srv_name; /* pointer (to server name?) */
164 UNISTR2 uni_srv_name; /* server name */
166 uint32 ptr_qual_name; /* pointer (to qualifier name) */
167 UNISTR2 uni_qual_name; /* qualifier name "\\qualifier" */
169 uint32 sess_level; /* session level */
171 SRV_SESS_INFO_CTR *ctr;
173 uint32 preferred_len; /* preferred maximum length (0xffff ffff) */
176 } SRV_Q_NET_SESS_ENUM;
178 /* SRV_R_NET_SESS_ENUM */
179 typedef struct r_net_sess_enum_info
181 uint32 sess_level; /* share level */
183 SRV_SESS_INFO_CTR *ctr;
185 uint32 total_entries; /* total number of entries */
188 uint32 status; /* return status */
190 } SRV_R_NET_SESS_ENUM;
192 /* CONN_INFO_0 (pointers to level 0 connection info strings) */
193 typedef struct ptr_conn_info0
195 uint32 id; /* connection id. */
199 /* oops - this is going to take up a *massive* amount of stack. */
200 /* the UNISTR2s already have 1024 uint16 chars in them... */
201 #define MAX_CONN_ENTRIES 32
203 /* SRV_CONN_INFO_0 */
204 typedef struct srv_conn_info_0_info
206 uint32 num_entries_read; /* EntriesRead */
207 uint32 ptr_conn_info; /* Buffer */
208 uint32 num_entries_read2; /* EntriesRead */
210 CONN_INFO_0 info_0 [MAX_CONN_ENTRIES]; /* connection entry pointers */
214 /* CONN_INFO_1 (pointers to level 1 connection info strings) */
215 typedef struct ptr_conn_info1
217 uint32 id; /* connection id */
218 uint32 type; /* 0x3 */
223 uint32 ptr_usr_name; /* pointer to user name. */
224 uint32 ptr_net_name; /* pointer to network name (e.g IPC$). */
228 /* CONN_INFO_1_STR (level 1 connection info strings) */
229 typedef struct str_conn_info1
231 UNISTR2 uni_usr_name; /* unicode string of user */
232 UNISTR2 uni_net_name; /* unicode string of name */
236 /* SRV_CONN_INFO_1 */
237 typedef struct srv_conn_info_1_info
239 uint32 num_entries_read; /* EntriesRead */
240 uint32 ptr_conn_info; /* Buffer */
241 uint32 num_entries_read2; /* EntriesRead */
243 CONN_INFO_1 info_1 [MAX_CONN_ENTRIES]; /* connection entry pointers */
244 CONN_INFO_1_STR info_1_str[MAX_CONN_ENTRIES]; /* connection entry strings */
248 /* SRV_CONN_INFO_CTR */
249 typedef struct srv_conn_info_ctr_info
251 uint32 switch_value; /* switch value */
252 uint32 ptr_conn_ctr; /* pointer to conn info union */
255 SRV_CONN_INFO_0 info0; /* connection info level 0 */
256 SRV_CONN_INFO_1 info1; /* connection info level 1 */
263 /* SRV_Q_NET_CONN_ENUM */
264 typedef struct q_net_conn_enum_info
266 uint32 ptr_srv_name; /* pointer (to server name) */
267 UNISTR2 uni_srv_name; /* server name "\\server" */
269 uint32 ptr_qual_name; /* pointer (to qualifier name) */
270 UNISTR2 uni_qual_name; /* qualifier name "\\qualifier" */
272 uint32 conn_level; /* connection level */
274 SRV_CONN_INFO_CTR *ctr;
276 uint32 preferred_len; /* preferred maximum length (0xffff ffff) */
279 } SRV_Q_NET_CONN_ENUM;
281 /* SRV_R_NET_CONN_ENUM */
282 typedef struct r_net_conn_enum_info
284 uint32 conn_level; /* share level */
286 SRV_CONN_INFO_CTR *ctr;
288 uint32 total_entries; /* total number of entries */
291 uint32 status; /* return status */
293 } SRV_R_NET_CONN_ENUM;
295 /* SH_INFO_1 (pointers to level 1 share info strings) */
296 typedef struct ptr_share_info1
298 uint32 ptr_netname; /* pointer to net name. */
299 uint32 type; /* ipc, print, disk ... */
300 uint32 ptr_remark; /* pointer to comment. */
304 /* SH_INFO_1_STR (level 1 share info strings) */
305 typedef struct str_share_info1
307 UNISTR2 uni_netname; /* unicode string of net name */
308 UNISTR2 uni_remark; /* unicode string of comment */
312 /* SRV_SHARE_INFO_1 */
313 typedef struct share_info_1_info
316 SH_INFO_1_STR info_1_str;
320 /* SH_INFO_2 (pointers to level 2 share info strings) */
321 typedef struct ptr_share_info2
323 uint32 ptr_netname; /* pointer to net name. */
324 uint32 type; /* ipc, print, disk ... */
325 uint32 ptr_remark; /* pointer to comment. */
326 uint32 perms; /* permissions */
327 uint32 max_uses; /* maximum uses */
328 uint32 num_uses; /* current uses */
329 uint32 ptr_path; /* pointer to path name */
330 uint32 ptr_passwd; /* pointer to password */
334 /* SH_INFO_2_STR (level 2 share info strings) */
335 typedef struct str_share_info2
337 UNISTR2 uni_netname; /* unicode string of net name (e.g NETLOGON) */
338 UNISTR2 uni_remark; /* unicode string of comment (e.g "Logon server share") */
339 UNISTR2 uni_path; /* unicode string of local path (e.g c:\winnt\system32\repl\import\scripts) */
340 UNISTR2 uni_passwd; /* unicode string of password - presumably for share level security (e.g NULL) */
344 /* SRV_SHARE_INFO_2 */
345 typedef struct share_info_2_info
348 SH_INFO_2_STR info_2_str;
352 /* SH_INFO_502 (pointers to level 502 share info strings) */
353 typedef struct ptr_share_info502
355 uint32 ptr_netname; /* pointer to net name. */
356 uint32 type; /* ipc, print, disk ... */
357 uint32 ptr_remark; /* pointer to comment. */
358 uint32 perms; /* permissions */
359 uint32 max_uses; /* maximum uses */
360 uint32 num_uses; /* current uses */
361 uint32 ptr_path; /* pointer to path name */
362 uint32 ptr_passwd; /* pointer to password */
363 uint32 sd_size; /* size of security descriptor */
364 uint32 ptr_sd; /* pointer to security descriptor */
368 /* SH_INFO_502_STR (level 502 share info strings) */
369 typedef struct str_share_info502
373 UNISTR2 uni_netname; /* unicode string of net name (e.g NETLOGON) */
374 UNISTR2 uni_remark; /* unicode string of comment (e.g "Logon server share") */
375 UNISTR2 uni_path; /* unicode string of local path (e.g c:\winnt\system32\repl\import\scripts) */
376 UNISTR2 uni_passwd; /* unicode string of password - presumably for share level security (e.g NULL) */
383 /* SRV_SHARE_INFO_502 */
384 typedef struct share_info_502_info
386 SH_INFO_502 info_502;
387 SH_INFO_502_STR info_502_str;
389 } SRV_SHARE_INFO_502;
391 /* SRV_SHARE_INFO_1005 */
392 typedef struct share_info_1005_info
394 uint32 dfs_root_flag;
395 } SRV_SHARE_INFO_1005;
397 /* SRV_SHARE_INFO_1501 */
398 typedef struct share_info_1501_info
401 } SRV_SHARE_INFO_1501;
403 /* SRV_SHARE_INFO_CTR */
404 typedef struct srv_share_info_ctr_info
408 uint32 ptr_share_info;
415 SRV_SHARE_INFO_1 *info1; /* share info level 1 */
416 SRV_SHARE_INFO_2 *info2; /* share info level 2 */
417 SRV_SHARE_INFO_502 *info502; /* share info level 502 */
422 } SRV_SHARE_INFO_CTR;
424 /* SRV_Q_NET_SHARE_ENUM */
425 typedef struct q_net_share_enum_info
427 uint32 ptr_srv_name; /* pointer (to server name?) */
428 UNISTR2 uni_srv_name; /* server name */
430 SRV_SHARE_INFO_CTR ctr; /* share info container */
432 uint32 preferred_len; /* preferred maximum length (0xffff ffff) */
436 } SRV_Q_NET_SHARE_ENUM;
439 /* SRV_R_NET_SHARE_ENUM */
440 typedef struct r_net_share_enum_info
442 SRV_SHARE_INFO_CTR ctr; /* share info container */
444 uint32 total_entries; /* total number of entries */
447 uint32 status; /* return status */
449 } SRV_R_NET_SHARE_ENUM;
452 /* SRV_Q_NET_SHARE_GET_INFO */
453 typedef struct q_net_share_get_info_info
456 UNISTR2 uni_srv_name;
458 UNISTR2 uni_share_name;
461 } SRV_Q_NET_SHARE_GET_INFO;
463 /* JRA. NB. We also need level 1004 and 1006 here. */
466 typedef struct srv_share_info {
468 uint32 ptr_share_ctr;
471 SRV_SHARE_INFO_1 info1;
472 SRV_SHARE_INFO_2 info2;
473 SRV_SHARE_INFO_502 info502;
474 SRV_SHARE_INFO_1005 info1005;
475 SRV_SHARE_INFO_1501 info1501;
479 /* SRV_R_NET_SHARE_GET_INFO */
480 typedef struct r_net_share_get_info_info
485 } SRV_R_NET_SHARE_GET_INFO;
487 /* SRV_Q_NET_SHARE_SET_INFO */
488 typedef struct q_net_share_set_info_info
491 UNISTR2 uni_srv_name;
493 UNISTR2 uni_share_name;
498 } SRV_Q_NET_SHARE_SET_INFO;
500 /* SRV_R_NET_SHARE_SET_INFO */
501 typedef struct r_net_share_set_info
503 uint32 switch_value; /* switch value */
505 uint32 status; /* return status */
507 } SRV_R_NET_SHARE_SET_INFO;
509 /* SRV_Q_NET_SHARE_ADD */
510 typedef struct q_net_share_add
513 UNISTR2 uni_srv_name;
519 } SRV_Q_NET_SHARE_ADD;
521 /* SRV_R_NET_SHARE_ADD */
522 typedef struct r_net_share_add
524 uint32 switch_value; /* switch value */
526 uint32 status; /* return status */
528 } SRV_R_NET_SHARE_ADD;
530 /* SRV_Q_NET_SHARE_DEL */
531 typedef struct q_net_share_del
534 UNISTR2 uni_srv_name;
535 UNISTR2 uni_share_name;
537 } SRV_Q_NET_SHARE_DEL;
539 /* SRV_R_NET_SHARE_DEL */
540 typedef struct r_net_share_del
542 uint32 status; /* return status */
544 } SRV_R_NET_SHARE_DEL;
546 /* FILE_INFO_3 (level 3 file info strings) */
547 typedef struct file_info3_info
549 uint32 id; /* file index */
550 uint32 perms; /* file permissions. don't know what format */
551 uint32 num_locks; /* file locks */
552 uint32 ptr_path_name; /* file name */
553 uint32 ptr_user_name; /* file owner */
557 /* FILE_INFO_3_STR (level 3 file info strings) */
558 typedef struct str_file_info3_info
560 UNISTR2 uni_path_name; /* unicode string of file name */
561 UNISTR2 uni_user_name; /* unicode string of file owner. */
565 /* oops - this is going to take up a *massive* amount of stack. */
566 /* the UNISTR2s already have 1024 uint16 chars in them... */
567 #define MAX_FILE_ENTRIES 32
569 /* SRV_FILE_INFO_3 */
570 typedef struct srv_file_info_3
572 uint32 num_entries_read; /* EntriesRead */
573 uint32 ptr_file_info; /* Buffer */
575 uint32 num_entries_read2; /* EntriesRead */
577 FILE_INFO_3 info_3 [MAX_FILE_ENTRIES]; /* file entry details */
578 FILE_INFO_3_STR info_3_str[MAX_FILE_ENTRIES]; /* file entry strings */
582 /* SRV_FILE_INFO_CTR */
583 typedef struct srv_file_info_3_info
585 uint32 switch_value; /* switch value */
586 uint32 ptr_file_ctr; /* pointer to file info union */
589 SRV_FILE_INFO_3 info3; /* file info with 0 entries */
596 /* SRV_Q_NET_FILE_ENUM */
597 typedef struct q_net_file_enum_info
599 uint32 ptr_srv_name; /* pointer (to server name?) */
600 UNISTR2 uni_srv_name; /* server name */
602 uint32 ptr_qual_name; /* pointer (to qualifier name) */
603 UNISTR2 uni_qual_name; /* qualifier name "\\qualifier" */
605 uint32 file_level; /* file level */
607 SRV_FILE_INFO_CTR *ctr;
609 uint32 preferred_len; /* preferred maximum length (0xffff ffff) */
612 } SRV_Q_NET_FILE_ENUM;
615 /* SRV_R_NET_FILE_ENUM */
616 typedef struct r_net_file_enum_info
618 uint32 file_level; /* file level */
620 SRV_FILE_INFO_CTR *ctr;
622 uint32 total_entries; /* total number of files */
625 uint32 status; /* return status */
627 } SRV_R_NET_FILE_ENUM;
630 typedef struct srv_info_100_info
632 uint32 platform_id; /* 0x500 */
633 uint32 ptr_name; /* pointer to server name */
635 UNISTR2 uni_name; /* server name "server" */
640 typedef struct srv_info_101_info
642 uint32 platform_id; /* 0x500 */
643 uint32 ptr_name; /* pointer to server name */
644 uint32 ver_major; /* 0x4 */
645 uint32 ver_minor; /* 0x2 */
646 uint32 srv_type; /* browse etc type */
647 uint32 ptr_comment; /* pointer to server comment */
649 UNISTR2 uni_name; /* server name "server" */
650 UNISTR2 uni_comment; /* server comment "samba x.x.x blah" */
655 typedef struct srv_info_102_info
657 uint32 platform_id; /* 0x500 */
658 uint32 ptr_name; /* pointer to server name */
659 uint32 ver_major; /* 0x4 */
660 uint32 ver_minor; /* 0x2 */
661 uint32 srv_type; /* browse etc type */
662 uint32 ptr_comment; /* pointer to server comment */
663 uint32 users; /* 0xffff ffff*/
664 uint32 disc; /* 0xf */
665 uint32 hidden; /* 0x0 */
666 uint32 announce; /* 240 */
667 uint32 ann_delta; /* 3000 */
668 uint32 licenses; /* 0 */
669 uint32 ptr_usr_path; /* pointer to user path */
671 UNISTR2 uni_name; /* server name "server" */
672 UNISTR2 uni_comment; /* server comment "samba x.x.x blah" */
673 UNISTR2 uni_usr_path; /* "c:\" (eh?) */
679 typedef struct srv_info_ctr_info
681 uint32 switch_value; /* switch value */
682 uint32 ptr_srv_ctr; /* pointer to server info */
685 SRV_INFO_102 sv102; /* server info level 102 */
686 SRV_INFO_101 sv101; /* server info level 101 */
687 SRV_INFO_100 sv100; /* server info level 100 */
693 /* SRV_Q_NET_SRV_GET_INFO */
694 typedef struct q_net_srv_get_info
697 UNISTR2 uni_srv_name; /* "\\server" */
700 } SRV_Q_NET_SRV_GET_INFO;
702 /* SRV_R_NET_SRV_GET_INFO */
703 typedef struct r_net_srv_get_info
707 uint32 status; /* return status */
709 } SRV_R_NET_SRV_GET_INFO;
711 /* SRV_Q_NET_SRV_SET_INFO */
712 typedef struct q_net_srv_set_info
715 UNISTR2 uni_srv_name; /* "\\server" */
720 } SRV_Q_NET_SRV_SET_INFO;
723 /* SRV_R_NET_SRV_SET_INFO */
724 typedef struct r_net_srv_set_info
726 uint32 switch_value; /* switch value */
728 uint32 status; /* return status */
730 } SRV_R_NET_SRV_SET_INFO;
732 /* SRV_Q_NET_REMOTE_TOD */
733 typedef struct q_net_remote_tod
736 UNISTR2 uni_srv_name; /* "\\server" */
738 } SRV_Q_NET_REMOTE_TOD;
740 /* TIME_OF_DAY_INFO */
741 typedef struct time_of_day_info
758 /* SRV_R_NET_REMOTE_TOD */
759 typedef struct r_net_remote_tod
761 uint32 ptr_srv_tod; /* pointer to TOD */
762 TIME_OF_DAY_INFO *tod;
764 uint32 status; /* return status */
766 } SRV_R_NET_REMOTE_TOD;
768 /* SRV_Q_NET_FILE_QUERY_SECDESC */
769 typedef struct q_net_file_query_secdesc
772 UNISTR2 uni_srv_name;
773 uint32 ptr_qual_name;
774 UNISTR2 uni_qual_name;
775 UNISTR2 uni_file_name;
779 } SRV_Q_NET_FILE_QUERY_SECDESC;
781 /* SRV_R_NET_FILE_QUERY_SECDESC */
782 typedef struct r_net_file_query_secdesc
785 uint32 size_response;
790 } SRV_R_NET_FILE_QUERY_SECDESC;
792 /* SRV_Q_NET_FILE_SET_SECDESC */
793 typedef struct q_net_file_set_secdesc
796 UNISTR2 uni_srv_name;
797 uint32 ptr_qual_name;
798 UNISTR2 uni_qual_name;
799 UNISTR2 uni_file_name;
805 } SRV_Q_NET_FILE_SET_SECDESC;
807 /* SRV_R_NET_FILE_SET_SECDESC */
808 typedef struct r_net_file_set_secdesc
811 } SRV_R_NET_FILE_SET_SECDESC;
812 #endif /* _RPC_SRVSVC_H */