2 * Unix SMB/Netbios implementation.
4 * RPC Pipe client / server routines
5 * Copyright (C) Andrew Tridgell 1992-1997,
6 * Copyright (C) Luke Kenneth Casson Leighton 1996-1997,
7 * Copyright (C) Paul Ashton 1997.
8 * Copyright (C) Jeremy Allison 1999.
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License as published by
12 * the Free Software Foundation; either version 2 of the License, or
13 * (at your option) any later version.
15 * This program is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU General Public License for more details.
20 * You should have received a copy of the GNU General Public License
21 * along with this program; if not, write to the Free Software
22 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
27 /*******************************************************************
28 Inits a SH_INFO_1_STR structure
29 ********************************************************************/
31 void init_srv_share_info1_str(SH_INFO_1_STR
*sh1
, char *net_name
, char *remark
)
33 DEBUG(5,("init_srv_share_info1_str\n"));
35 init_unistr2(&sh1
->uni_netname
, net_name
, strlen(net_name
)+1);
36 init_unistr2(&sh1
->uni_remark
, remark
, strlen(remark
)+1);
39 /*******************************************************************
40 Reads or writes a structure.
41 ********************************************************************/
43 static BOOL
srv_io_share_info1_str(char *desc
, SH_INFO_1_STR
*sh1
, prs_struct
*ps
, int depth
)
48 prs_debug(ps
, depth
, desc
, "srv_io_share_info1_str");
53 if(!smb_io_unistr2("", &sh1
->uni_netname
, True
, ps
, depth
))
58 if(!smb_io_unistr2("", &sh1
->uni_remark
, True
, ps
, depth
))
64 /*******************************************************************
65 makes a SH_INFO_1 structure
66 ********************************************************************/
68 void init_srv_share_info1(SH_INFO_1
*sh1
, char *net_name
, uint32 type
, char *remark
)
70 DEBUG(5,("init_srv_share_info1: %s %8x %s\n", net_name
, type
, remark
));
72 sh1
->ptr_netname
= (net_name
!= NULL
) ? 1 : 0;
74 sh1
->ptr_remark
= (remark
!= NULL
) ? 1 : 0;
77 /*******************************************************************
78 Reads or writes a structure.
79 ********************************************************************/
81 static BOOL
srv_io_share_info1(char *desc
, SH_INFO_1
*sh1
, prs_struct
*ps
, int depth
)
86 prs_debug(ps
, depth
, desc
, "srv_io_share_info1");
92 if(!prs_uint32("ptr_netname", ps
, depth
, &sh1
->ptr_netname
))
94 if(!prs_uint32("type ", ps
, depth
, &sh1
->type
))
96 if(!prs_uint32("ptr_remark ", ps
, depth
, &sh1
->ptr_remark
))
102 /*******************************************************************
103 Inits a SH_INFO_2_STR structure
104 ********************************************************************/
106 void init_srv_share_info2_str(SH_INFO_2_STR
*sh2
,
107 char *net_name
, char *remark
,
108 char *path
, char *passwd
)
110 DEBUG(5,("init_srv_share_info2_str\n"));
112 init_unistr2(&sh2
->uni_netname
, net_name
, strlen(net_name
)+1);
113 init_unistr2(&sh2
->uni_remark
, remark
, strlen(remark
)+1);
114 init_unistr2(&sh2
->uni_path
, path
, strlen(path
)+1);
115 init_unistr2(&sh2
->uni_passwd
, passwd
, strlen(passwd
)+1);
118 /*******************************************************************
119 Reads or writes a structure.
120 ********************************************************************/
122 static BOOL
srv_io_share_info2_str(char *desc
, SH_INFO_2
*sh
, SH_INFO_2_STR
*sh2
, prs_struct
*ps
, int depth
)
127 if (UNMARSHALLING(ps
))
130 prs_debug(ps
, depth
, desc
, "srv_io_share_info2_str");
136 if(!smb_io_unistr2("", &sh2
->uni_netname
, True
, ps
, depth
))
140 if(!smb_io_unistr2("", &sh2
->uni_remark
, True
, ps
, depth
))
144 if(!smb_io_unistr2("", &sh2
->uni_path
, True
, ps
, depth
))
148 if(!smb_io_unistr2("", &sh2
->uni_passwd
, True
, ps
, depth
))
154 /*******************************************************************
155 Inits a SH_INFO_2 structure
156 ********************************************************************/
158 void init_srv_share_info2(SH_INFO_2
*sh2
,
159 char *net_name
, uint32 type
, char *remark
,
160 uint32 perms
, uint32 max_uses
, uint32 num_uses
,
161 char *path
, char *passwd
)
163 DEBUG(5,("init_srv_share_info2: %s %8x %s\n", net_name
, type
, remark
));
165 sh2
->ptr_netname
= (net_name
!= NULL
) ? 1 : 0;
167 sh2
->ptr_remark
= (remark
!= NULL
) ? 1 : 0;
169 sh2
->max_uses
= max_uses
;
170 sh2
->num_uses
= num_uses
;
172 sh2
->ptr_path
= (path
!= NULL
) ? 1 : 0;
173 sh2
->ptr_passwd
= (passwd
!= NULL
) ? 1 : 0;
176 /*******************************************************************
177 Reads or writes a structure.
178 ********************************************************************/
180 static BOOL
srv_io_share_info2(char *desc
, SH_INFO_2
*sh2
, prs_struct
*ps
, int depth
)
185 prs_debug(ps
, depth
, desc
, "srv_io_share_info2");
191 if(!prs_uint32("ptr_netname", ps
, depth
, &sh2
->ptr_netname
))
193 if(!prs_uint32("type ", ps
, depth
, &sh2
->type
))
195 if(!prs_uint32("ptr_remark ", ps
, depth
, &sh2
->ptr_remark
))
197 if(!prs_uint32("perms ", ps
, depth
, &sh2
->perms
))
199 if(!prs_uint32("max_uses ", ps
, depth
, &sh2
->max_uses
))
201 if(!prs_uint32("num_uses ", ps
, depth
, &sh2
->num_uses
))
203 if(!prs_uint32("ptr_path ", ps
, depth
, &sh2
->ptr_path
))
205 if(!prs_uint32("ptr_passwd ", ps
, depth
, &sh2
->ptr_passwd
))
211 /*******************************************************************
212 Inits a SH_INFO_2 structure
213 *******************************************************************/
215 void init_srv_share_info501(SH_INFO_501
*sh501
, char *net_name
, uint32 type
, char *remark
, uint32 csc_policy
)
217 DEBUG(5,("init_srv_share_info501: %s %8x %s %08x\n", net_name
, type
,
218 remark
, csc_policy
));
222 sh501
->ptr_netname
= (net_name
!= NULL
) ? 1 : 0;
224 sh501
->ptr_remark
= (remark
!= NULL
) ? 1 : 0;
225 sh501
->csc_policy
= csc_policy
;
228 /*******************************************************************
229 Reads of writes a structure.
230 *******************************************************************/
232 static BOOL
srv_io_share_info501(char *desc
, SH_INFO_501
*sh501
, prs_struct
*ps
, int depth
)
237 prs_debug(ps
, depth
, desc
, "srv_io_share_info501");
243 if (!prs_uint32("ptr_netname", ps
, depth
, &sh501
->ptr_netname
))
245 if (!prs_uint32("type ", ps
, depth
, &sh501
->type
))
247 if (!prs_uint32("ptr_remark ", ps
, depth
, &sh501
->ptr_remark
))
249 if (!prs_uint32("csc_policy ", ps
, depth
, &sh501
->csc_policy
))
255 /********************************************************************
256 Inits a SH_INFO_501_STR structure
257 ********************************************************************/
259 void init_srv_share_info501_str(SH_INFO_501_STR
*sh501
, char *net_name
, char *remark
)
261 DEBUG(5,("init_srv_share_info501_str\n"));
263 init_unistr2(&sh501
->uni_netname
, net_name
, strlen(net_name
)+1);
264 init_unistr2(&sh501
->uni_remark
, remark
, strlen(remark
)+1);
267 /*******************************************************************
268 Reads or writes a structure.
269 ********************************************************************/
271 static BOOL
srv_io_share_info501_str(char *desc
, SH_INFO_501_STR
*sh501
, prs_struct
*ps
, int depth
)
276 prs_debug(ps
, depth
, desc
, "srv_io_share_info501_str");
281 if(!smb_io_unistr2("", &sh501
->uni_netname
, True
, ps
, depth
))
286 if(!smb_io_unistr2("", &sh501
->uni_remark
, True
, ps
, depth
))
292 /*******************************************************************
293 Inits a SH_INFO_502 structure
294 ********************************************************************/
296 void init_srv_share_info502(SH_INFO_502
*sh502
,
297 char *net_name
, uint32 type
, char *remark
,
298 uint32 perms
, uint32 max_uses
, uint32 num_uses
,
299 char *path
, char *passwd
, SEC_DESC
*psd
, size_t sd_size
)
301 DEBUG(5,("init_srv_share_info502: %s %8x %s\n", net_name
, type
, remark
));
305 sh502
->ptr_netname
= (net_name
!= NULL
) ? 1 : 0;
307 sh502
->ptr_remark
= (remark
!= NULL
) ? 1 : 0;
308 sh502
->perms
= perms
;
309 sh502
->max_uses
= max_uses
;
310 sh502
->num_uses
= num_uses
;
312 sh502
->ptr_path
= (path
!= NULL
) ? 1 : 0;
313 sh502
->ptr_passwd
= (passwd
!= NULL
) ? 1 : 0;
314 sh502
->sd_size
= (uint32
)sd_size
;
315 sh502
->ptr_sd
= (psd
!= NULL
) ? 1 : 0;
318 /*******************************************************************
319 Reads or writes a structure.
320 ********************************************************************/
322 static BOOL
srv_io_share_info502(char *desc
, SH_INFO_502
*sh502
, prs_struct
*ps
, int depth
)
327 prs_debug(ps
, depth
, desc
, "srv_io_share_info502");
333 if(!prs_uint32("ptr_netname", ps
, depth
, &sh502
->ptr_netname
))
335 if(!prs_uint32("type ", ps
, depth
, &sh502
->type
))
337 if(!prs_uint32("ptr_remark ", ps
, depth
, &sh502
->ptr_remark
))
339 if(!prs_uint32("perms ", ps
, depth
, &sh502
->perms
))
341 if(!prs_uint32("max_uses ", ps
, depth
, &sh502
->max_uses
))
343 if(!prs_uint32("num_uses ", ps
, depth
, &sh502
->num_uses
))
345 if(!prs_uint32("ptr_path ", ps
, depth
, &sh502
->ptr_path
))
347 if(!prs_uint32("ptr_passwd ", ps
, depth
, &sh502
->ptr_passwd
))
349 if(!prs_uint32("sd_size ", ps
, depth
, &sh502
->sd_size
))
351 if(!prs_uint32("ptr_sd ", ps
, depth
, &sh502
->ptr_sd
))
357 /*******************************************************************
358 Inits a SH_INFO_502_STR structure
359 ********************************************************************/
361 void init_srv_share_info502_str(SH_INFO_502_STR
*sh502str
,
363 char *net_name
, char *remark
,
364 char *path
, char *passwd
, SEC_DESC
*psd
, size_t sd_size
)
366 DEBUG(5,("init_srv_share_info502_str\n"));
368 sh502str
->ptrs
= ptrs
;
370 if(sh502str
->ptrs
->ptr_netname
)
371 init_unistr2(&sh502str
->uni_netname
, net_name
, strlen(net_name
)+1);
372 if(sh502str
->ptrs
->ptr_remark
)
373 init_unistr2(&sh502str
->uni_remark
, remark
, strlen(remark
)+1);
374 if(sh502str
->ptrs
->ptr_path
)
375 init_unistr2(&sh502str
->uni_path
, path
, strlen(path
)+1);
376 if(sh502str
->ptrs
->ptr_passwd
)
377 init_unistr2(&sh502str
->uni_passwd
, passwd
, strlen(passwd
)+1);
378 if(sh502str
->ptrs
->ptr_sd
) {
380 sh502str
->sd_size
= sd_size
;
384 /*******************************************************************
385 Reads or writes a structure.
386 ********************************************************************/
388 static BOOL
srv_io_share_info502_str(char *desc
, SH_INFO_502_STR
*sh502
, prs_struct
*ps
, int depth
)
393 prs_debug(ps
, depth
, desc
, "srv_io_share_info502_str");
399 if(sh502
->ptrs
->ptr_netname
) {
400 if(!smb_io_unistr2("", &sh502
->uni_netname
, True
, ps
, depth
))
407 if(sh502
->ptrs
->ptr_remark
) {
408 if(!smb_io_unistr2("", &sh502
->uni_remark
, True
, ps
, depth
))
415 if(sh502
->ptrs
->ptr_path
) {
416 if(!smb_io_unistr2("", &sh502
->uni_path
, True
, ps
, depth
))
423 if(sh502
->ptrs
->ptr_passwd
) {
424 if(!smb_io_unistr2("", &sh502
->uni_passwd
, True
, ps
, depth
))
431 if(sh502
->ptrs
->ptr_sd
) {
432 if(!prs_uint32("sd_size ", ps
, depth
, &sh502
->sd_size
))
434 if (!sec_io_desc(desc
, &sh502
->sd
, ps
, depth
))
441 /*******************************************************************
442 Reads or writes a structure.
443 ********************************************************************/
445 static BOOL
srv_io_share_info1005(char* desc
, SRV_SHARE_INFO_1005
* sh1005
,
446 prs_struct
* ps
, int depth
)
451 prs_debug(ps
, depth
, desc
, "srv_io_share_info1005");
457 if(!prs_uint32("misc_flags", ps
, depth
, &sh1005
->misc_flags
))
463 /*******************************************************************
464 Reads or writes a structure.
465 ********************************************************************/
467 static BOOL
srv_io_share_info1501(char* desc
, SRV_SHARE_INFO_1501
* sh1501
,
468 prs_struct
* ps
, int depth
)
473 prs_debug(ps
, depth
, desc
, "srv_io_share_info1501");
479 if (!sec_io_desc_buf(desc
, &sh1501
->sdb
, ps
, depth
))
485 /*******************************************************************
486 Reads or writes a structure.
487 ********************************************************************/
489 static BOOL
srv_io_srv_share_ctr(char *desc
, SRV_SHARE_INFO_CTR
*ctr
, prs_struct
*ps
, int depth
)
494 prs_debug(ps
, depth
, desc
, "srv_io_srv_share_ctr");
497 if (UNMARSHALLING(ps
)) {
498 memset(ctr
, '\0', sizeof(SRV_SHARE_INFO_CTR
));
504 if(!prs_uint32("info_level", ps
, depth
, &ctr
->info_level
))
507 if (ctr
->info_level
== 0)
510 if(!prs_uint32("switch_value", ps
, depth
, &ctr
->switch_value
))
512 if(!prs_uint32("ptr_share_info", ps
, depth
, &ctr
->ptr_share_info
))
515 if (ctr
->ptr_share_info
== 0)
518 if(!prs_uint32("num_entries", ps
, depth
, &ctr
->num_entries
))
520 if(!prs_uint32("ptr_entries", ps
, depth
, &ctr
->ptr_entries
))
523 if (ctr
->ptr_entries
== 0) {
524 if (ctr
->num_entries
== 0)
530 if(!prs_uint32("num_entries2", ps
, depth
, &ctr
->num_entries2
))
533 if (ctr
->num_entries2
!= ctr
->num_entries
)
536 switch (ctr
->switch_value
) {
539 SRV_SHARE_INFO_1
*info1
= ctr
->share
.info1
;
540 int num_entries
= ctr
->num_entries
;
543 if (UNMARSHALLING(ps
)) {
544 if (!(info1
= (SRV_SHARE_INFO_1
*)prs_alloc_mem(ps
, num_entries
* sizeof(SRV_SHARE_INFO_1
))))
546 ctr
->share
.info1
= info1
;
549 for (i
= 0; i
< num_entries
; i
++) {
550 if(!srv_io_share_info1("", &info1
[i
].info_1
, ps
, depth
))
554 for (i
= 0; i
< num_entries
; i
++) {
555 if(!srv_io_share_info1_str("", &info1
[i
].info_1_str
, ps
, depth
))
564 SRV_SHARE_INFO_2
*info2
= ctr
->share
.info2
;
565 int num_entries
= ctr
->num_entries
;
568 if (UNMARSHALLING(ps
)) {
569 if (!(info2
= (SRV_SHARE_INFO_2
*)prs_alloc_mem(ps
,num_entries
* sizeof(SRV_SHARE_INFO_2
))))
571 ctr
->share
.info2
= info2
;
574 for (i
= 0; i
< num_entries
; i
++) {
575 if(!srv_io_share_info2("", &info2
[i
].info_2
, ps
, depth
))
579 for (i
= 0; i
< num_entries
; i
++) {
580 if(!srv_io_share_info2_str("", &info2
[i
].info_2
, &info2
[i
].info_2_str
, ps
, depth
))
589 SRV_SHARE_INFO_501
*info501
= ctr
->share
.info501
;
590 int num_entries
= ctr
->num_entries
;
593 if (UNMARSHALLING(ps
)) {
594 if (!(info501
= (SRV_SHARE_INFO_501
*) prs_alloc_mem(ps
, num_entries
*
595 sizeof (SRV_SHARE_INFO_501
))))
597 ctr
->share
.info501
= info501
;
600 for (i
= 0; i
< num_entries
; i
++) {
601 if (!srv_io_share_info501("", &info501
[i
].info_501
, ps
, depth
))
605 for (i
= 0; i
< num_entries
; i
++) {
606 if (!srv_io_share_info501_str("", &info501
[i
].info_501_str
, ps
, depth
))
615 SRV_SHARE_INFO_502
*info502
= ctr
->share
.info502
;
616 int num_entries
= ctr
->num_entries
;
619 if (UNMARSHALLING(ps
)) {
620 if (!(info502
= (SRV_SHARE_INFO_502
*)prs_alloc_mem(ps
,num_entries
* sizeof(SRV_SHARE_INFO_502
))))
622 ctr
->share
.info502
= info502
;
625 for (i
= 0; i
< num_entries
; i
++) {
626 if(!srv_io_share_info502("", &info502
[i
].info_502
, ps
, depth
))
630 for (i
= 0; i
< num_entries
; i
++) {
631 info502
[i
].info_502_str
.ptrs
= &info502
[i
].info_502
;
632 if(!srv_io_share_info502_str("", &info502
[i
].info_502_str
, ps
, depth
))
640 DEBUG(5,("%s no share info at switch_value %d\n",
641 tab_depth(depth
), ctr
->switch_value
));
648 /*******************************************************************
649 Inits a SRV_Q_NET_SHARE_ENUM structure.
650 ********************************************************************/
652 void init_srv_q_net_share_enum(SRV_Q_NET_SHARE_ENUM
*q_n
,
653 char *srv_name
, uint32 info_level
,
654 uint32 preferred_len
, ENUM_HND
*hnd
)
657 DEBUG(5,("init_q_net_share_enum\n"));
659 init_buf_unistr2(&q_n
->uni_srv_name
, &q_n
->ptr_srv_name
, srv_name
);
661 q_n
->ctr
.info_level
= q_n
->ctr
.switch_value
= info_level
;
662 q_n
->ctr
.ptr_share_info
= 0;
663 q_n
->preferred_len
= preferred_len
;
665 memcpy(&q_n
->enum_hnd
, hnd
, sizeof(*hnd
));
668 /*******************************************************************
669 Reads or writes a structure.
670 ********************************************************************/
672 BOOL
srv_io_q_net_share_enum(char *desc
, SRV_Q_NET_SHARE_ENUM
*q_n
, prs_struct
*ps
, int depth
)
677 prs_debug(ps
, depth
, desc
, "srv_io_q_net_share_enum");
683 if(!prs_uint32("ptr_srv_name", ps
, depth
, &q_n
->ptr_srv_name
))
685 if(!smb_io_unistr2("", &q_n
->uni_srv_name
, True
, ps
, depth
))
688 if(!srv_io_srv_share_ctr("share_ctr", &q_n
->ctr
, ps
, depth
))
694 if(!prs_uint32("preferred_len", ps
, depth
, &q_n
->preferred_len
))
697 if(!smb_io_enum_hnd("enum_hnd", &q_n
->enum_hnd
, ps
, depth
))
703 /*******************************************************************
704 Reads or writes a structure.
705 ********************************************************************/
707 BOOL
srv_io_r_net_share_enum(char *desc
, SRV_R_NET_SHARE_ENUM
*r_n
, prs_struct
*ps
, int depth
)
712 prs_debug(ps
, depth
, desc
, "srv_io_r_net_share_enum");
715 if(!srv_io_srv_share_ctr("share_ctr", &r_n
->ctr
, ps
, depth
))
721 if(!prs_uint32("total_entries", ps
, depth
, &r_n
->total_entries
))
723 if(!smb_io_enum_hnd("enum_hnd", &r_n
->enum_hnd
, ps
, depth
))
725 if(!prs_werror("status ", ps
, depth
, &r_n
->status
))
731 /*******************************************************************
732 Reads or writes a structure.
733 ********************************************************************/
735 BOOL
srv_io_q_net_share_get_info(char *desc
, SRV_Q_NET_SHARE_GET_INFO
*q_n
, prs_struct
*ps
, int depth
)
740 prs_debug(ps
, depth
, desc
, "srv_io_q_net_share_get_info");
746 if(!prs_uint32("ptr_srv_name", ps
, depth
, &q_n
->ptr_srv_name
))
748 if(!smb_io_unistr2("", &q_n
->uni_srv_name
, True
, ps
, depth
))
751 if(!smb_io_unistr2("", &q_n
->uni_share_name
, True
, ps
, depth
))
757 if(!prs_uint32("info_level", ps
, depth
, &q_n
->info_level
))
763 /*******************************************************************
764 Reads or writes a structure.
765 ********************************************************************/
767 static BOOL
srv_io_srv_share_info(char *desc
, prs_struct
*ps
, int depth
, SRV_SHARE_INFO
*r_n
)
772 prs_debug(ps
, depth
, desc
, "srv_io_srv_share_info");
778 if(!prs_uint32("switch_value ", ps
, depth
, &r_n
->switch_value
))
781 if(!prs_uint32("ptr_share_ctr", ps
, depth
, &r_n
->ptr_share_ctr
))
784 if (r_n
->ptr_share_ctr
!= 0) {
785 switch (r_n
->switch_value
) {
787 if(!srv_io_share_info1("", &r_n
->share
.info1
.info_1
, ps
, depth
))
790 if(!srv_io_share_info1_str("", &r_n
->share
.info1
.info_1_str
, ps
, depth
))
795 if(!srv_io_share_info2("", &r_n
->share
.info2
.info_2
, ps
, depth
))
798 if(!srv_io_share_info2_str("", &r_n
->share
.info2
.info_2
, &r_n
->share
.info2
.info_2_str
, ps
, depth
))
803 if (!srv_io_share_info501("", &r_n
->share
.info501
.info_501
, ps
, depth
))
805 if (!srv_io_share_info501_str("", &r_n
->share
.info501
.info_501_str
, ps
, depth
))
810 if(!srv_io_share_info502("", &r_n
->share
.info502
.info_502
, ps
, depth
))
813 /*allow access to pointers in the str part. */
814 r_n
->share
.info502
.info_502_str
.ptrs
= &r_n
->share
.info502
.info_502
;
816 if(!srv_io_share_info502_str("", &r_n
->share
.info502
.info_502_str
, ps
, depth
))
820 if(!srv_io_share_info1005("", &r_n
->share
.info1005
, ps
, depth
))
824 if (!srv_io_share_info1501("", &r_n
->share
.info1501
, ps
, depth
))
827 DEBUG(5,("%s no share info at switch_value %d\n",
828 tab_depth(depth
), r_n
->switch_value
));
836 /*******************************************************************
837 Reads or writes a structure.
838 ********************************************************************/
840 BOOL
srv_io_r_net_share_get_info(char *desc
, SRV_R_NET_SHARE_GET_INFO
*r_n
, prs_struct
*ps
, int depth
)
845 prs_debug(ps
, depth
, desc
, "srv_io_r_net_share_get_info");
851 if(!srv_io_srv_share_info("info ", ps
, depth
, &r_n
->info
))
857 if(!prs_werror("status", ps
, depth
, &r_n
->status
))
863 /*******************************************************************
864 Reads or writes a structure.
865 ********************************************************************/
867 BOOL
srv_io_q_net_share_set_info(char *desc
, SRV_Q_NET_SHARE_SET_INFO
*q_n
, prs_struct
*ps
, int depth
)
872 prs_debug(ps
, depth
, desc
, "srv_io_q_net_share_set_info");
878 if(!prs_uint32("ptr_srv_name", ps
, depth
, &q_n
->ptr_srv_name
))
880 if(!smb_io_unistr2("", &q_n
->uni_srv_name
, True
, ps
, depth
))
883 if(!smb_io_unistr2("", &q_n
->uni_share_name
, True
, ps
, depth
))
889 if(!prs_uint32("info_level", ps
, depth
, &q_n
->info_level
))
895 if(!srv_io_srv_share_info("info ", ps
, depth
, &q_n
->info
))
901 /*******************************************************************
902 Reads or writes a structure.
903 ********************************************************************/
905 BOOL
srv_io_r_net_share_set_info(char *desc
, SRV_R_NET_SHARE_SET_INFO
*q_n
, prs_struct
*ps
, int depth
)
910 prs_debug(ps
, depth
, desc
, "srv_io_r_net_share_set_info");
916 if(!prs_uint32("switch_value ", ps
, depth
, &q_n
->switch_value
))
918 if(!prs_werror("status ", ps
, depth
, &q_n
->status
))
924 /*******************************************************************
925 Reads or writes a structure.
926 ********************************************************************/
928 BOOL
srv_io_q_net_share_add(char *desc
, SRV_Q_NET_SHARE_ADD
*q_n
, prs_struct
*ps
, int depth
)
933 prs_debug(ps
, depth
, desc
, "srv_io_q_net_share_add");
939 if(!prs_uint32("ptr_srv_name", ps
, depth
, &q_n
->ptr_srv_name
))
941 if(!smb_io_unistr2("", &q_n
->uni_srv_name
, True
, ps
, depth
))
947 if(!prs_uint32("info_level", ps
, depth
, &q_n
->info_level
))
953 if(!srv_io_srv_share_info("info ", ps
, depth
, &q_n
->info
))
959 /*******************************************************************
960 Reads or writes a structure.
961 ********************************************************************/
963 BOOL
srv_io_r_net_share_add(char *desc
, SRV_R_NET_SHARE_ADD
*q_n
, prs_struct
*ps
, int depth
)
968 prs_debug(ps
, depth
, desc
, "srv_io_r_net_share_add");
974 if(!prs_uint32("switch_value ", ps
, depth
, &q_n
->switch_value
))
976 if(!prs_werror("status ", ps
, depth
, &q_n
->status
))
982 /*******************************************************************
983 Reads or writes a structure.
984 ********************************************************************/
986 BOOL
srv_io_q_net_share_del(char *desc
, SRV_Q_NET_SHARE_DEL
*q_n
, prs_struct
*ps
, int depth
)
991 prs_debug(ps
, depth
, desc
, "srv_io_q_net_share_del");
997 if(!prs_uint32("ptr_srv_name", ps
, depth
, &q_n
->ptr_srv_name
))
999 if(!smb_io_unistr2("", &q_n
->uni_srv_name
, True
, ps
, depth
))
1002 if(!smb_io_unistr2("", &q_n
->uni_share_name
, True
, ps
, depth
))
1008 /*******************************************************************
1009 Reads or writes a structure.
1010 ********************************************************************/
1012 BOOL
srv_io_r_net_share_del(char *desc
, SRV_R_NET_SHARE_DEL
*q_n
, prs_struct
*ps
, int depth
)
1017 prs_debug(ps
, depth
, desc
, "srv_io_r_net_share_del");
1023 if(!prs_werror("status ", ps
, depth
, &q_n
->status
))
1029 /*******************************************************************
1030 Inits a SESS_INFO_0_STR structure
1031 ********************************************************************/
1033 void init_srv_sess_info0_str(SESS_INFO_0_STR
*ss0
, char *name
)
1035 DEBUG(5,("init_srv_sess_info0_str\n"));
1037 init_unistr2(&ss0
->uni_name
, name
, strlen(name
)+1);
1040 /*******************************************************************
1041 Reads or writes a structure.
1042 ********************************************************************/
1044 static BOOL
srv_io_sess_info0_str(char *desc
, SESS_INFO_0_STR
*ss0
, prs_struct
*ps
, int depth
)
1049 prs_debug(ps
, depth
, desc
, "srv_io_sess_info0_str");
1055 if(!smb_io_unistr2("", &ss0
->uni_name
, True
, ps
, depth
))
1061 /*******************************************************************
1062 Inits a SESS_INFO_0 structure
1063 ********************************************************************/
1065 void init_srv_sess_info0(SESS_INFO_0
*ss0
, char *name
)
1067 DEBUG(5,("init_srv_sess_info0: %s\n", name
));
1069 ss0
->ptr_name
= (name
!= NULL
) ? 1 : 0;
1072 /*******************************************************************
1073 Reads or writes a structure.
1074 ********************************************************************/
1076 static BOOL
srv_io_sess_info0(char *desc
, SESS_INFO_0
*ss0
, prs_struct
*ps
, int depth
)
1081 prs_debug(ps
, depth
, desc
, "srv_io_sess_info0");
1087 if(!prs_uint32("ptr_name", ps
, depth
, &ss0
->ptr_name
))
1093 /*******************************************************************
1094 Reads or writes a structure.
1095 ********************************************************************/
1097 static BOOL
srv_io_srv_sess_info_0(char *desc
, SRV_SESS_INFO_0
*ss0
, prs_struct
*ps
, int depth
)
1102 prs_debug(ps
, depth
, desc
, "srv_io_srv_sess_info_0");
1108 if(!prs_uint32("num_entries_read", ps
, depth
, &ss0
->num_entries_read
))
1110 if(!prs_uint32("ptr_sess_info", ps
, depth
, &ss0
->ptr_sess_info
))
1113 if (ss0
->ptr_sess_info
!= 0) {
1115 int num_entries
= ss0
->num_entries_read
;
1117 if (num_entries
> MAX_SESS_ENTRIES
) {
1118 num_entries
= MAX_SESS_ENTRIES
; /* report this! */
1121 if(!prs_uint32("num_entries_read2", ps
, depth
, &ss0
->num_entries_read2
))
1124 SMB_ASSERT_ARRAY(ss0
->info_0
, num_entries
);
1126 for (i
= 0; i
< num_entries
; i
++) {
1127 if(!srv_io_sess_info0("", &ss0
->info_0
[i
], ps
, depth
))
1131 for (i
= 0; i
< num_entries
; i
++) {
1132 if(!srv_io_sess_info0_str("", &ss0
->info_0_str
[i
], ps
, depth
))
1143 /*******************************************************************
1144 Inits a SESS_INFO_1_STR structure
1145 ********************************************************************/
1147 void init_srv_sess_info1_str(SESS_INFO_1_STR
*ss1
, char *name
, char *user
)
1149 DEBUG(5,("init_srv_sess_info1_str\n"));
1151 init_unistr2(&ss1
->uni_name
, name
, strlen(name
)+1);
1152 init_unistr2(&ss1
->uni_user
, name
, strlen(user
)+1);
1155 /*******************************************************************
1156 Reads or writes a structure.
1157 ********************************************************************/
1159 static BOOL
srv_io_sess_info1_str(char *desc
, SESS_INFO_1_STR
*ss1
, prs_struct
*ps
, int depth
)
1164 prs_debug(ps
, depth
, desc
, "srv_io_sess_info1_str");
1170 if(!smb_io_unistr2("", &ss1
->uni_name
, True
, ps
, depth
))
1172 if(!smb_io_unistr2("", &(ss1
->uni_user
), True
, ps
, depth
))
1178 /*******************************************************************
1179 Inits a SESS_INFO_1 structure
1180 ********************************************************************/
1182 void init_srv_sess_info1(SESS_INFO_1
*ss1
,
1183 char *name
, char *user
,
1184 uint32 num_opens
, uint32 open_time
, uint32 idle_time
,
1187 DEBUG(5,("init_srv_sess_info1: %s\n", name
));
1189 ss1
->ptr_name
= (name
!= NULL
) ? 1 : 0;
1190 ss1
->ptr_user
= (user
!= NULL
) ? 1 : 0;
1192 ss1
->num_opens
= num_opens
;
1193 ss1
->open_time
= open_time
;
1194 ss1
->idle_time
= idle_time
;
1195 ss1
->user_flags
= user_flags
;
1198 /*******************************************************************
1199 reads or writes a structure.
1200 ********************************************************************/
1202 static BOOL
srv_io_sess_info1(char *desc
, SESS_INFO_1
*ss1
, prs_struct
*ps
, int depth
)
1207 prs_debug(ps
, depth
, desc
, "srv_io_sess_info1");
1213 if(!prs_uint32("ptr_name ", ps
, depth
, &ss1
->ptr_name
))
1215 if(!prs_uint32("ptr_user ", ps
, depth
, &ss1
->ptr_user
))
1218 if(!prs_uint32("num_opens ", ps
, depth
, &ss1
->num_opens
))
1220 if(!prs_uint32("open_time ", ps
, depth
, &ss1
->open_time
))
1222 if(!prs_uint32("idle_time ", ps
, depth
, &ss1
->idle_time
))
1224 if(!prs_uint32("user_flags", ps
, depth
, &ss1
->user_flags
))
1230 /*******************************************************************
1231 Reads or writes a structure.
1232 ********************************************************************/
1234 static BOOL
srv_io_srv_sess_info_1(char *desc
, SRV_SESS_INFO_1
*ss1
, prs_struct
*ps
, int depth
)
1239 prs_debug(ps
, depth
, desc
, "srv_io_srv_sess_info_1");
1245 if(!prs_uint32("num_entries_read", ps
, depth
, &ss1
->num_entries_read
))
1247 if(!prs_uint32("ptr_sess_info", ps
, depth
, &ss1
->ptr_sess_info
))
1250 if (ss1
->ptr_sess_info
!= 0) {
1252 int num_entries
= ss1
->num_entries_read
;
1254 if (num_entries
> MAX_SESS_ENTRIES
) {
1255 num_entries
= MAX_SESS_ENTRIES
; /* report this! */
1258 if(!prs_uint32("num_entries_read2", ps
, depth
, &ss1
->num_entries_read2
))
1261 SMB_ASSERT_ARRAY(ss1
->info_1
, num_entries
);
1263 for (i
= 0; i
< num_entries
; i
++) {
1264 if(!srv_io_sess_info1("", &ss1
->info_1
[i
], ps
, depth
))
1268 for (i
= 0; i
< num_entries
; i
++) {
1269 if(!srv_io_sess_info1_str("", &ss1
->info_1_str
[i
], ps
, depth
))
1280 /*******************************************************************
1281 Reads or writes a structure.
1282 ********************************************************************/
1284 static BOOL
srv_io_srv_sess_ctr(char *desc
, SRV_SESS_INFO_CTR
**pp_ctr
, prs_struct
*ps
, int depth
)
1286 SRV_SESS_INFO_CTR
*ctr
= *pp_ctr
;
1288 prs_debug(ps
, depth
, desc
, "srv_io_srv_sess_ctr");
1291 if(UNMARSHALLING(ps
)) {
1292 ctr
= *pp_ctr
= (SRV_SESS_INFO_CTR
*)prs_alloc_mem(ps
, sizeof(SRV_SESS_INFO_CTR
));
1303 if(!prs_uint32("switch_value", ps
, depth
, &ctr
->switch_value
))
1305 if(!prs_uint32("ptr_sess_ctr", ps
, depth
, &ctr
->ptr_sess_ctr
))
1308 if (ctr
->ptr_sess_ctr
!= 0) {
1309 switch (ctr
->switch_value
) {
1311 if(!srv_io_srv_sess_info_0("", &ctr
->sess
.info0
, ps
, depth
))
1315 if(!srv_io_srv_sess_info_1("", &ctr
->sess
.info1
, ps
, depth
))
1319 DEBUG(5,("%s no session info at switch_value %d\n",
1320 tab_depth(depth
), ctr
->switch_value
));
1328 /*******************************************************************
1329 Inits a SRV_Q_NET_SESS_ENUM structure.
1330 ********************************************************************/
1332 void init_srv_q_net_sess_enum(SRV_Q_NET_SESS_ENUM
*q_n
,
1333 char *srv_name
, char *qual_name
,
1334 uint32 sess_level
, SRV_SESS_INFO_CTR
*ctr
,
1335 uint32 preferred_len
,
1340 DEBUG(5,("init_q_net_sess_enum\n"));
1342 init_buf_unistr2(&q_n
->uni_srv_name
, &q_n
->ptr_srv_name
, srv_name
);
1343 init_buf_unistr2(&q_n
->uni_qual_name
, &q_n
->ptr_qual_name
, qual_name
);
1345 q_n
->sess_level
= sess_level
;
1346 q_n
->preferred_len
= preferred_len
;
1348 memcpy(&q_n
->enum_hnd
, hnd
, sizeof(*hnd
));
1351 /*******************************************************************
1352 Reads or writes a structure.
1353 ********************************************************************/
1355 BOOL
srv_io_q_net_sess_enum(char *desc
, SRV_Q_NET_SESS_ENUM
*q_n
, prs_struct
*ps
, int depth
)
1360 prs_debug(ps
, depth
, desc
, "srv_io_q_net_sess_enum");
1366 if(!prs_uint32("ptr_srv_name", ps
, depth
, &q_n
->ptr_srv_name
))
1368 if(!smb_io_unistr2("", &q_n
->uni_srv_name
, True
, ps
, depth
))
1374 if(!prs_uint32("ptr_qual_name", ps
, depth
, &q_n
->ptr_qual_name
))
1376 if(!smb_io_unistr2("", &q_n
->uni_qual_name
, q_n
->ptr_qual_name
, ps
, depth
))
1382 if(!prs_uint32("sess_level", ps
, depth
, &q_n
->sess_level
))
1385 if (q_n
->sess_level
!= -1) {
1386 if(!srv_io_srv_sess_ctr("sess_ctr", &q_n
->ctr
, ps
, depth
))
1390 if(!prs_uint32("preferred_len", ps
, depth
, &q_n
->preferred_len
))
1393 if(!smb_io_enum_hnd("enum_hnd", &q_n
->enum_hnd
, ps
, depth
))
1399 /*******************************************************************
1400 Reads or writes a structure.
1401 ********************************************************************/
1403 BOOL
srv_io_r_net_sess_enum(char *desc
, SRV_R_NET_SESS_ENUM
*r_n
, prs_struct
*ps
, int depth
)
1408 prs_debug(ps
, depth
, desc
, "srv_io_r_net_sess_enum");
1414 if(!prs_uint32("sess_level", ps
, depth
, &r_n
->sess_level
))
1417 if (r_n
->sess_level
!= -1) {
1418 if(!srv_io_srv_sess_ctr("sess_ctr", &r_n
->ctr
, ps
, depth
))
1422 if(!prs_uint32("total_entries", ps
, depth
, &r_n
->total_entries
))
1424 if(!smb_io_enum_hnd("enum_hnd", &r_n
->enum_hnd
, ps
, depth
))
1426 if(!prs_werror("status ", ps
, depth
, &r_n
->status
))
1432 /*******************************************************************
1433 Inits a CONN_INFO_0 structure
1434 ********************************************************************/
1436 void init_srv_conn_info0(CONN_INFO_0
*ss0
, uint32 id
)
1438 DEBUG(5,("init_srv_conn_info0\n"));
1443 /*******************************************************************
1444 Reads or writes a structure.
1445 ********************************************************************/
1447 static BOOL
srv_io_conn_info0(char *desc
, CONN_INFO_0
*ss0
, prs_struct
*ps
, int depth
)
1452 prs_debug(ps
, depth
, desc
, "srv_io_conn_info0");
1458 if(!prs_uint32("id", ps
, depth
, &ss0
->id
))
1464 /*******************************************************************
1465 Reads or writes a structure.
1466 ********************************************************************/
1468 static BOOL
srv_io_srv_conn_info_0(char *desc
, SRV_CONN_INFO_0
*ss0
, prs_struct
*ps
, int depth
)
1473 prs_debug(ps
, depth
, desc
, "srv_io_srv_conn_info_0");
1479 if(!prs_uint32("num_entries_read", ps
, depth
, &ss0
->num_entries_read
))
1481 if(!prs_uint32("ptr_conn_info", ps
, depth
, &ss0
->ptr_conn_info
))
1484 if (ss0
->ptr_conn_info
!= 0) {
1486 int num_entries
= ss0
->num_entries_read
;
1488 if (num_entries
> MAX_CONN_ENTRIES
) {
1489 num_entries
= MAX_CONN_ENTRIES
; /* report this! */
1492 if(!prs_uint32("num_entries_read2", ps
, depth
, &ss0
->num_entries_read2
))
1495 for (i
= 0; i
< num_entries
; i
++) {
1496 if(!srv_io_conn_info0("", &ss0
->info_0
[i
], ps
, depth
))
1507 /*******************************************************************
1508 Inits a CONN_INFO_1_STR structure
1509 ********************************************************************/
1511 void init_srv_conn_info1_str(CONN_INFO_1_STR
*ss1
, char *usr_name
, char *net_name
)
1513 DEBUG(5,("init_srv_conn_info1_str\n"));
1515 init_unistr2(&ss1
->uni_usr_name
, usr_name
, strlen(usr_name
)+1);
1516 init_unistr2(&ss1
->uni_net_name
, net_name
, strlen(net_name
)+1);
1519 /*******************************************************************
1520 Reads or writes a structure.
1521 ********************************************************************/
1523 static BOOL
srv_io_conn_info1_str(char *desc
, CONN_INFO_1_STR
*ss1
, prs_struct
*ps
, int depth
)
1528 prs_debug(ps
, depth
, desc
, "srv_io_conn_info1_str");
1534 if(!smb_io_unistr2("", &ss1
->uni_usr_name
, True
, ps
, depth
))
1536 if(!smb_io_unistr2("", &ss1
->uni_net_name
, True
, ps
, depth
))
1542 /*******************************************************************
1543 Inits a CONN_INFO_1 structure
1544 ********************************************************************/
1546 void init_srv_conn_info1(CONN_INFO_1
*ss1
,
1547 uint32 id
, uint32 type
,
1548 uint32 num_opens
, uint32 num_users
, uint32 open_time
,
1549 char *usr_name
, char *net_name
)
1551 DEBUG(5,("init_srv_conn_info1: %s %s\n", usr_name
, net_name
));
1555 ss1
->num_opens
= num_opens
;
1556 ss1
->num_users
= num_users
;
1557 ss1
->open_time
= open_time
;
1559 ss1
->ptr_usr_name
= (usr_name
!= NULL
) ? 1 : 0;
1560 ss1
->ptr_net_name
= (net_name
!= NULL
) ? 1 : 0;
1563 /*******************************************************************
1564 Reads or writes a structure.
1565 ********************************************************************/
1567 static BOOL
srv_io_conn_info1(char *desc
, CONN_INFO_1
*ss1
, prs_struct
*ps
, int depth
)
1572 prs_debug(ps
, depth
, desc
, "srv_io_conn_info1");
1578 if(!prs_uint32("id ", ps
, depth
, &ss1
->id
))
1580 if(!prs_uint32("type ", ps
, depth
, &ss1
->type
))
1582 if(!prs_uint32("num_opens ", ps
, depth
, &ss1
->num_opens
))
1584 if(!prs_uint32("num_users ", ps
, depth
, &ss1
->num_users
))
1586 if(!prs_uint32("open_time ", ps
, depth
, &ss1
->open_time
))
1589 if(!prs_uint32("ptr_usr_name", ps
, depth
, &ss1
->ptr_usr_name
))
1591 if(!prs_uint32("ptr_net_name", ps
, depth
, &ss1
->ptr_net_name
))
1597 /*******************************************************************
1598 Reads or writes a structure.
1599 ********************************************************************/
1601 static BOOL
srv_io_srv_conn_info_1(char *desc
, SRV_CONN_INFO_1
*ss1
, prs_struct
*ps
, int depth
)
1606 prs_debug(ps
, depth
, desc
, "srv_io_srv_conn_info_1");
1612 if(!prs_uint32("num_entries_read", ps
, depth
, &ss1
->num_entries_read
))
1614 if(!prs_uint32("ptr_conn_info", ps
, depth
, &ss1
->ptr_conn_info
))
1617 if (ss1
->ptr_conn_info
!= 0) {
1619 int num_entries
= ss1
->num_entries_read
;
1621 if (num_entries
> MAX_CONN_ENTRIES
) {
1622 num_entries
= MAX_CONN_ENTRIES
; /* report this! */
1625 if(!prs_uint32("num_entries_read2", ps
, depth
, &ss1
->num_entries_read2
))
1628 for (i
= 0; i
< num_entries
; i
++) {
1629 if(!srv_io_conn_info1("", &ss1
->info_1
[i
], ps
, depth
))
1633 for (i
= 0; i
< num_entries
; i
++) {
1634 if(!srv_io_conn_info1_str("", &ss1
->info_1_str
[i
], ps
, depth
))
1645 /*******************************************************************
1646 Reads or writes a structure.
1647 ********************************************************************/
1649 static BOOL
srv_io_srv_conn_ctr(char *desc
, SRV_CONN_INFO_CTR
**pp_ctr
, prs_struct
*ps
, int depth
)
1651 SRV_CONN_INFO_CTR
*ctr
= *pp_ctr
;
1653 prs_debug(ps
, depth
, desc
, "srv_io_srv_conn_ctr");
1656 if (UNMARSHALLING(ps
)) {
1657 ctr
= *pp_ctr
= (SRV_CONN_INFO_CTR
*)prs_alloc_mem(ps
, sizeof(SRV_CONN_INFO_CTR
));
1668 if(!prs_uint32("switch_value", ps
, depth
, &ctr
->switch_value
))
1670 if(!prs_uint32("ptr_conn_ctr", ps
, depth
, &ctr
->ptr_conn_ctr
))
1673 if (ctr
->ptr_conn_ctr
!= 0) {
1674 switch (ctr
->switch_value
) {
1676 if(!srv_io_srv_conn_info_0("", &ctr
->conn
.info0
, ps
, depth
))
1680 if(!srv_io_srv_conn_info_1("", &ctr
->conn
.info1
, ps
, depth
))
1684 DEBUG(5,("%s no connection info at switch_value %d\n",
1685 tab_depth(depth
), ctr
->switch_value
));
1693 /*******************************************************************
1694 Reads or writes a structure.
1695 ********************************************************************/
1697 void init_srv_q_net_conn_enum(SRV_Q_NET_CONN_ENUM
*q_n
,
1698 char *srv_name
, char *qual_name
,
1699 uint32 conn_level
, SRV_CONN_INFO_CTR
*ctr
,
1700 uint32 preferred_len
,
1703 DEBUG(5,("init_q_net_conn_enum\n"));
1707 init_buf_unistr2(&q_n
->uni_srv_name
, &q_n
->ptr_srv_name
, srv_name
);
1708 init_buf_unistr2(&q_n
->uni_qual_name
, &q_n
->ptr_qual_name
, qual_name
);
1710 q_n
->conn_level
= conn_level
;
1711 q_n
->preferred_len
= preferred_len
;
1713 memcpy(&q_n
->enum_hnd
, hnd
, sizeof(*hnd
));
1716 /*******************************************************************
1717 Reads or writes a structure.
1718 ********************************************************************/
1720 BOOL
srv_io_q_net_conn_enum(char *desc
, SRV_Q_NET_CONN_ENUM
*q_n
, prs_struct
*ps
, int depth
)
1725 prs_debug(ps
, depth
, desc
, "srv_io_q_net_conn_enum");
1731 if(!prs_uint32("ptr_srv_name ", ps
, depth
, &q_n
->ptr_srv_name
))
1733 if(!smb_io_unistr2("", &q_n
->uni_srv_name
, q_n
->ptr_srv_name
, ps
, depth
))
1739 if(!prs_uint32("ptr_qual_name", ps
, depth
, &q_n
->ptr_qual_name
))
1741 if(!smb_io_unistr2("", &q_n
->uni_qual_name
, q_n
->ptr_qual_name
, ps
, depth
))
1747 if(!prs_uint32("conn_level", ps
, depth
, &q_n
->conn_level
))
1750 if (q_n
->conn_level
!= -1) {
1751 if(!srv_io_srv_conn_ctr("conn_ctr", &q_n
->ctr
, ps
, depth
))
1755 if(!prs_uint32("preferred_len", ps
, depth
, &q_n
->preferred_len
))
1758 if(!smb_io_enum_hnd("enum_hnd", &q_n
->enum_hnd
, ps
, depth
))
1764 /*******************************************************************
1765 Reads or writes a structure.
1766 ********************************************************************/
1768 BOOL
srv_io_r_net_conn_enum(char *desc
, SRV_R_NET_CONN_ENUM
*r_n
, prs_struct
*ps
, int depth
)
1773 prs_debug(ps
, depth
, desc
, "srv_io_r_net_conn_enum");
1779 if(!prs_uint32("conn_level", ps
, depth
, &r_n
->conn_level
))
1782 if (r_n
->conn_level
!= -1) {
1783 if(!srv_io_srv_conn_ctr("conn_ctr", &r_n
->ctr
, ps
, depth
))
1787 if(!prs_uint32("total_entries", ps
, depth
, &r_n
->total_entries
))
1789 if(!smb_io_enum_hnd("enum_hnd", &r_n
->enum_hnd
, ps
, depth
))
1791 if(!prs_werror("status ", ps
, depth
, &r_n
->status
))
1797 /*******************************************************************
1798 Inits a FILE_INFO_3_STR structure
1799 ********************************************************************/
1801 void init_srv_file_info3_str(FILE_INFO_3_STR
*fi3
, char *user_name
, char *path_name
)
1803 DEBUG(5,("init_srv_file_info3_str\n"));
1805 init_unistr2(&fi3
->uni_path_name
, path_name
, strlen(path_name
)+1);
1806 init_unistr2(&fi3
->uni_user_name
, user_name
, strlen(user_name
)+1);
1809 /*******************************************************************
1810 Reads or writes a structure.
1811 ********************************************************************/
1813 static BOOL
srv_io_file_info3_str(char *desc
, FILE_INFO_3_STR
*sh1
, prs_struct
*ps
, int depth
)
1818 prs_debug(ps
, depth
, desc
, "srv_io_file_info3_str");
1824 if(!smb_io_unistr2("", &sh1
->uni_path_name
, True
, ps
, depth
))
1826 if(!smb_io_unistr2("", &sh1
->uni_user_name
, True
, ps
, depth
))
1832 /*******************************************************************
1833 Inits a FILE_INFO_3 structure
1834 ********************************************************************/
1836 void init_srv_file_info3(FILE_INFO_3
*fl3
,
1837 uint32 id
, uint32 perms
, uint32 num_locks
,
1838 char *path_name
, char *user_name
)
1840 DEBUG(5,("init_srv_file_info3: %s %s\n", path_name
, user_name
));
1844 fl3
->num_locks
= num_locks
;
1846 fl3
->ptr_path_name
= (path_name
!= NULL
) ? 1 : 0;
1847 fl3
->ptr_user_name
= (user_name
!= NULL
) ? 1 : 0;
1850 /*******************************************************************
1851 Reads or writes a structure.
1852 ********************************************************************/
1854 static BOOL
srv_io_file_info3(char *desc
, FILE_INFO_3
*fl3
, prs_struct
*ps
, int depth
)
1859 prs_debug(ps
, depth
, desc
, "srv_io_file_info3");
1865 if(!prs_uint32("id ", ps
, depth
, &fl3
->id
))
1867 if(!prs_uint32("perms ", ps
, depth
, &fl3
->perms
))
1869 if(!prs_uint32("num_locks ", ps
, depth
, &fl3
->num_locks
))
1871 if(!prs_uint32("ptr_path_name", ps
, depth
, &fl3
->ptr_path_name
))
1873 if(!prs_uint32("ptr_user_name", ps
, depth
, &fl3
->ptr_user_name
))
1879 /*******************************************************************
1880 Reads or writes a structure.
1881 ********************************************************************/
1883 static BOOL
srv_io_srv_file_info_3(char *desc
, SRV_FILE_INFO_3
*fl3
, prs_struct
*ps
, int depth
)
1888 prs_debug(ps
, depth
, desc
, "srv_io_file_3_fl3");
1894 if(!prs_uint32("num_entries_read", ps
, depth
, &fl3
->num_entries_read
))
1896 if(!prs_uint32("ptr_file_fl3", ps
, depth
, &fl3
->ptr_file_info
))
1899 if (fl3
->ptr_file_info
!= 0) {
1901 int num_entries
= fl3
->num_entries_read
;
1903 if (num_entries
> MAX_FILE_ENTRIES
) {
1904 num_entries
= MAX_FILE_ENTRIES
; /* report this! */
1907 if(!prs_uint32("num_entries_read2", ps
, depth
, &fl3
->num_entries_read2
))
1910 for (i
= 0; i
< num_entries
; i
++) {
1911 if(!srv_io_file_info3("", &fl3
->info_3
[i
], ps
, depth
))
1915 for (i
= 0; i
< num_entries
; i
++) {
1916 if(!srv_io_file_info3_str("", &fl3
->info_3_str
[i
], ps
, depth
))
1927 /*******************************************************************
1928 Reads or writes a structure.
1929 ********************************************************************/
1931 static BOOL
srv_io_srv_file_ctr(char *desc
, SRV_FILE_INFO_CTR
**pp_ctr
, prs_struct
*ps
, int depth
)
1933 SRV_FILE_INFO_CTR
*ctr
= *pp_ctr
;
1935 if (UNMARSHALLING(ps
)) {
1936 ctr
= *pp_ctr
= (SRV_FILE_INFO_CTR
*)prs_alloc_mem(ps
, sizeof(SRV_FILE_INFO_CTR
));
1944 prs_debug(ps
, depth
, desc
, "srv_io_srv_file_ctr");
1950 if(!prs_uint32("switch_value", ps
, depth
, &ctr
->switch_value
))
1952 if(!prs_uint32("ptr_file_ctr", ps
, depth
, &ctr
->ptr_file_ctr
))
1955 if (ctr
->ptr_file_ctr
!= 0) {
1956 switch (ctr
->switch_value
) {
1958 if(!srv_io_srv_file_info_3("", &ctr
->file
.info3
, ps
, depth
))
1962 DEBUG(5,("%s no file info at switch_value %d\n",
1963 tab_depth(depth
), ctr
->switch_value
));
1971 /*******************************************************************
1972 Inits a SRV_Q_NET_FILE_ENUM structure.
1973 ********************************************************************/
1975 void init_srv_q_net_file_enum(SRV_Q_NET_FILE_ENUM
*q_n
,
1976 char *srv_name
, char *qual_name
,
1977 uint32 file_level
, SRV_FILE_INFO_CTR
*ctr
,
1978 uint32 preferred_len
,
1981 DEBUG(5,("init_q_net_file_enum\n"));
1985 init_buf_unistr2(&q_n
->uni_srv_name
, &q_n
->ptr_srv_name
, srv_name
);
1986 init_buf_unistr2(&q_n
->uni_qual_name
, &q_n
->ptr_qual_name
, qual_name
);
1988 q_n
->file_level
= file_level
;
1989 q_n
->preferred_len
= preferred_len
;
1991 memcpy(&q_n
->enum_hnd
, hnd
, sizeof(*hnd
));
1994 /*******************************************************************
1995 Reads or writes a structure.
1996 ********************************************************************/
1998 BOOL
srv_io_q_net_file_enum(char *desc
, SRV_Q_NET_FILE_ENUM
*q_n
, prs_struct
*ps
, int depth
)
2003 prs_debug(ps
, depth
, desc
, "srv_io_q_net_file_enum");
2009 if(!prs_uint32("ptr_srv_name", ps
, depth
, &q_n
->ptr_srv_name
))
2011 if(!smb_io_unistr2("", &q_n
->uni_srv_name
, True
, ps
, depth
))
2017 if(!prs_uint32("ptr_qual_name", ps
, depth
, &q_n
->ptr_qual_name
))
2019 if(!smb_io_unistr2("", &q_n
->uni_qual_name
, q_n
->ptr_qual_name
, ps
, depth
))
2025 if(!prs_uint32("file_level", ps
, depth
, &q_n
->file_level
))
2028 if (q_n
->file_level
!= -1) {
2029 if(!srv_io_srv_file_ctr("file_ctr", &q_n
->ctr
, ps
, depth
))
2033 if(!prs_uint32("preferred_len", ps
, depth
, &q_n
->preferred_len
))
2036 if(!smb_io_enum_hnd("enum_hnd", &q_n
->enum_hnd
, ps
, depth
))
2042 /*******************************************************************
2043 Reads or writes a structure.
2044 ********************************************************************/
2046 BOOL
srv_io_r_net_file_enum(char *desc
, SRV_R_NET_FILE_ENUM
*r_n
, prs_struct
*ps
, int depth
)
2051 prs_debug(ps
, depth
, desc
, "srv_io_r_net_file_enum");
2057 if(!prs_uint32("file_level", ps
, depth
, &r_n
->file_level
))
2060 if (r_n
->file_level
!= 0) {
2061 if(!srv_io_srv_file_ctr("file_ctr", &r_n
->ctr
, ps
, depth
))
2065 if(!prs_uint32("total_entries", ps
, depth
, &r_n
->total_entries
))
2067 if(!smb_io_enum_hnd("enum_hnd", &r_n
->enum_hnd
, ps
, depth
))
2069 if(!prs_werror("status ", ps
, depth
, &r_n
->status
))
2075 /*******************************************************************
2076 Inits a SRV_INFO_100 structure.
2077 ********************************************************************/
2079 void init_srv_info_100(SRV_INFO_100
*sv100
, uint32 platform_id
, char *name
)
2081 DEBUG(5,("init_srv_info_100\n"));
2083 sv100
->platform_id
= platform_id
;
2084 init_buf_unistr2(&sv100
->uni_name
, &sv100
->ptr_name
, name
);
2087 /*******************************************************************
2088 Reads or writes a SRV_INFO_101 structure.
2089 ********************************************************************/
2091 static BOOL
srv_io_info_100(char *desc
, SRV_INFO_100
*sv100
, prs_struct
*ps
, int depth
)
2096 prs_debug(ps
, depth
, desc
, "srv_io_info_100");
2102 if(!prs_uint32("platform_id ", ps
, depth
, &sv100
->platform_id
))
2104 if(!prs_uint32("ptr_name ", ps
, depth
, &sv100
->ptr_name
))
2107 if(!smb_io_unistr2("uni_name ", &sv100
->uni_name
, True
, ps
, depth
))
2114 /*******************************************************************
2115 Inits a SRV_INFO_101 structure.
2116 ********************************************************************/
2118 void init_srv_info_101(SRV_INFO_101
*sv101
, uint32 platform_id
, char *name
,
2119 uint32 ver_major
, uint32 ver_minor
,
2120 uint32 srv_type
, char *comment
)
2122 DEBUG(5,("init_srv_info_101\n"));
2124 sv101
->platform_id
= platform_id
;
2125 init_buf_unistr2(&sv101
->uni_name
, &sv101
->ptr_name
, name
);
2126 sv101
->ver_major
= ver_major
;
2127 sv101
->ver_minor
= ver_minor
;
2128 sv101
->srv_type
= srv_type
;
2129 init_buf_unistr2(&sv101
->uni_comment
, &sv101
->ptr_comment
, comment
);
2132 /*******************************************************************
2133 Reads or writes a SRV_INFO_101 structure.
2134 ********************************************************************/
2136 static BOOL
srv_io_info_101(char *desc
, SRV_INFO_101
*sv101
, prs_struct
*ps
, int depth
)
2141 prs_debug(ps
, depth
, desc
, "srv_io_info_101");
2147 if(!prs_uint32("platform_id ", ps
, depth
, &sv101
->platform_id
))
2149 if(!prs_uint32("ptr_name ", ps
, depth
, &sv101
->ptr_name
))
2151 if(!prs_uint32("ver_major ", ps
, depth
, &sv101
->ver_major
))
2153 if(!prs_uint32("ver_minor ", ps
, depth
, &sv101
->ver_minor
))
2155 if(!prs_uint32("srv_type ", ps
, depth
, &sv101
->srv_type
))
2157 if(!prs_uint32("ptr_comment ", ps
, depth
, &sv101
->ptr_comment
))
2163 if(!smb_io_unistr2("uni_name ", &sv101
->uni_name
, True
, ps
, depth
))
2165 if(!smb_io_unistr2("uni_comment ", &sv101
->uni_comment
, True
, ps
, depth
))
2171 /*******************************************************************
2172 Inits a SRV_INFO_102 structure.
2173 ********************************************************************/
2175 void init_srv_info_102(SRV_INFO_102
*sv102
, uint32 platform_id
, char *name
,
2176 char *comment
, uint32 ver_major
, uint32 ver_minor
,
2177 uint32 srv_type
, uint32 users
, uint32 disc
, uint32 hidden
,
2178 uint32 announce
, uint32 ann_delta
, uint32 licenses
,
2181 DEBUG(5,("init_srv_info_102\n"));
2183 sv102
->platform_id
= platform_id
;
2184 init_buf_unistr2(&sv102
->uni_name
, &sv102
->ptr_name
, name
);
2185 sv102
->ver_major
= ver_major
;
2186 sv102
->ver_minor
= ver_minor
;
2187 sv102
->srv_type
= srv_type
;
2188 init_buf_unistr2(&sv102
->uni_comment
, &sv102
->ptr_comment
, comment
);
2190 /* same as 101 up to here */
2192 sv102
->users
= users
;
2194 sv102
->hidden
= hidden
;
2195 sv102
->announce
= announce
;
2196 sv102
->ann_delta
=ann_delta
;
2197 sv102
->licenses
= licenses
;
2198 init_buf_unistr2(&sv102
->uni_usr_path
, &sv102
->ptr_usr_path
, usr_path
);
2202 /*******************************************************************
2203 Reads or writes a SRV_INFO_102 structure.
2204 ********************************************************************/
2206 static BOOL
srv_io_info_102(char *desc
, SRV_INFO_102
*sv102
, prs_struct
*ps
, int depth
)
2211 prs_debug(ps
, depth
, desc
, "srv_io_info102");
2217 if(!prs_uint32("platform_id ", ps
, depth
, &sv102
->platform_id
))
2219 if(!prs_uint32("ptr_name ", ps
, depth
, &sv102
->ptr_name
))
2221 if(!prs_uint32("ver_major ", ps
, depth
, &sv102
->ver_major
))
2223 if(!prs_uint32("ver_minor ", ps
, depth
, &sv102
->ver_minor
))
2225 if(!prs_uint32("srv_type ", ps
, depth
, &sv102
->srv_type
))
2227 if(!prs_uint32("ptr_comment ", ps
, depth
, &sv102
->ptr_comment
))
2230 /* same as 101 up to here */
2232 if(!prs_uint32("users ", ps
, depth
, &sv102
->users
))
2234 if(!prs_uint32("disc ", ps
, depth
, &sv102
->disc
))
2236 if(!prs_uint32("hidden ", ps
, depth
, &sv102
->hidden
))
2238 if(!prs_uint32("announce ", ps
, depth
, &sv102
->announce
))
2240 if(!prs_uint32("ann_delta ", ps
, depth
, &sv102
->ann_delta
))
2242 if(!prs_uint32("licenses ", ps
, depth
, &sv102
->licenses
))
2244 if(!prs_uint32("ptr_usr_path", ps
, depth
, &sv102
->ptr_usr_path
))
2247 if(!smb_io_unistr2("uni_name ", &sv102
->uni_name
, True
, ps
, depth
))
2251 if(!smb_io_unistr2("uni_comment ", &sv102
->uni_comment
, True
, ps
, depth
))
2255 if(!smb_io_unistr2("uni_usr_path", &sv102
->uni_usr_path
, True
, ps
, depth
))
2261 /*******************************************************************
2262 Reads or writes a SRV_INFO_102 structure.
2263 ********************************************************************/
2265 static BOOL
srv_io_info_ctr(char *desc
, SRV_INFO_CTR
*ctr
, prs_struct
*ps
, int depth
)
2270 prs_debug(ps
, depth
, desc
, "srv_io_info_ctr");
2276 if(!prs_uint32("switch_value", ps
, depth
, &ctr
->switch_value
))
2278 if(!prs_uint32("ptr_srv_ctr ", ps
, depth
, &ctr
->ptr_srv_ctr
))
2281 if (ctr
->ptr_srv_ctr
!= 0 && ctr
->switch_value
!= 0 && ctr
!= NULL
) {
2282 switch (ctr
->switch_value
) {
2284 if(!srv_io_info_100("sv100", &ctr
->srv
.sv100
, ps
, depth
))
2288 if(!srv_io_info_101("sv101", &ctr
->srv
.sv101
, ps
, depth
))
2292 if(!srv_io_info_102("sv102", &ctr
->srv
.sv102
, ps
, depth
))
2296 DEBUG(5,("%s no server info at switch_value %d\n",
2297 tab_depth(depth
), ctr
->switch_value
));
2307 /*******************************************************************
2308 Inits a SRV_Q_NET_SRV_GET_INFO structure.
2309 ********************************************************************/
2311 void init_srv_q_net_srv_get_info(SRV_Q_NET_SRV_GET_INFO
*srv
,
2312 char *server_name
, uint32 switch_value
)
2314 DEBUG(5,("init_srv_q_net_srv_get_info\n"));
2316 init_buf_unistr2(&srv
->uni_srv_name
, &srv
->ptr_srv_name
, server_name
);
2318 srv
->switch_value
= switch_value
;
2321 /*******************************************************************
2322 Reads or writes a structure.
2323 ********************************************************************/
2325 BOOL
srv_io_q_net_srv_get_info(char *desc
, SRV_Q_NET_SRV_GET_INFO
*q_n
, prs_struct
*ps
, int depth
)
2330 prs_debug(ps
, depth
, desc
, "srv_io_q_net_srv_get_info");
2336 if(!prs_uint32("ptr_srv_name ", ps
, depth
, &q_n
->ptr_srv_name
))
2338 if(!smb_io_unistr2("", &q_n
->uni_srv_name
, True
, ps
, depth
))
2344 if(!prs_uint32("switch_value ", ps
, depth
, &q_n
->switch_value
))
2350 /*******************************************************************
2351 Inits a SRV_R_NET_SRV_GET_INFO structure.
2352 ********************************************************************/
2354 void init_srv_r_net_srv_get_info(SRV_R_NET_SRV_GET_INFO
*srv
,
2355 uint32 switch_value
, SRV_INFO_CTR
*ctr
, WERROR status
)
2357 DEBUG(5,("init_srv_r_net_srv_get_info\n"));
2361 if (W_ERROR_IS_OK(status
)) {
2362 srv
->ctr
->switch_value
= switch_value
;
2363 srv
->ctr
->ptr_srv_ctr
= 1;
2365 srv
->ctr
->switch_value
= 0;
2366 srv
->ctr
->ptr_srv_ctr
= 0;
2369 srv
->status
= status
;
2372 /*******************************************************************
2373 Inits a SRV_R_NET_SRV_SET_INFO structure.
2374 ********************************************************************/
2376 void init_srv_r_net_srv_set_info(SRV_R_NET_SRV_SET_INFO
*srv
,
2377 uint32 switch_value
, WERROR status
)
2379 DEBUG(5,("init_srv_r_net_srv_set_info\n"));
2381 srv
->switch_value
= switch_value
;
2382 srv
->status
= status
;
2385 /*******************************************************************
2386 Reads or writes a structure.
2387 ********************************************************************/
2389 BOOL
srv_io_q_net_srv_set_info(char *desc
, SRV_Q_NET_SRV_SET_INFO
*q_n
,
2390 prs_struct
*ps
, int depth
)
2392 prs_debug(ps
, depth
, desc
, "srv_io_q_net_srv_set_info");
2398 if(!prs_uint32("ptr_srv_name ", ps
, depth
, &q_n
->ptr_srv_name
))
2400 if(!smb_io_unistr2("", &q_n
->uni_srv_name
, True
, ps
, depth
))
2406 if(!prs_uint32("switch_value ", ps
, depth
, &q_n
->switch_value
))
2409 if (UNMARSHALLING(ps
)) {
2410 q_n
->ctr
= (SRV_INFO_CTR
*)
2411 prs_alloc_mem(ps
, sizeof(SRV_INFO_CTR
));
2417 if(!srv_io_info_ctr("ctr", q_n
->ctr
, ps
, depth
))
2423 /*******************************************************************
2424 Reads or writes a structure.
2425 ********************************************************************/
2427 BOOL
srv_io_r_net_srv_get_info(char *desc
, SRV_R_NET_SRV_GET_INFO
*r_n
, prs_struct
*ps
, int depth
)
2432 prs_debug(ps
, depth
, desc
, "srv_io_r_net_srv_get_info");
2438 if(!srv_io_info_ctr("ctr", r_n
->ctr
, ps
, depth
))
2441 if(!prs_werror("status ", ps
, depth
, &r_n
->status
))
2447 /*******************************************************************
2448 Reads or writes a structure.
2449 ********************************************************************/
2451 BOOL
srv_io_r_net_srv_set_info(char *desc
, SRV_R_NET_SRV_SET_INFO
*r_n
,
2452 prs_struct
*ps
, int depth
)
2454 prs_debug(ps
, depth
, desc
, "srv_io_r_net_srv_set_info");
2460 if(!prs_uint32("switch_value ", ps
, depth
, &r_n
->switch_value
))
2463 if(!prs_werror("status ", ps
, depth
, &r_n
->status
))
2469 /*******************************************************************
2470 Reads or writes a structure.
2471 ********************************************************************/
2473 BOOL
srv_io_q_net_remote_tod(char *desc
, SRV_Q_NET_REMOTE_TOD
*q_n
, prs_struct
*ps
, int depth
)
2478 prs_debug(ps
, depth
, desc
, "srv_io_q_net_remote_tod");
2484 if(!prs_uint32("ptr_srv_name ", ps
, depth
, &q_n
->ptr_srv_name
))
2486 if(!smb_io_unistr2("", &q_n
->uni_srv_name
, True
, ps
, depth
))
2492 /*******************************************************************
2493 Reads or writes a TIME_OF_DAY_INFO structure.
2494 ********************************************************************/
2496 static BOOL
srv_io_time_of_day_info(char *desc
, TIME_OF_DAY_INFO
*tod
, prs_struct
*ps
, int depth
)
2501 prs_debug(ps
, depth
, desc
, "srv_io_time_of_day_info");
2507 if(!prs_uint32("elapsedt ", ps
, depth
, &tod
->elapsedt
))
2509 if(!prs_uint32("msecs ", ps
, depth
, &tod
->msecs
))
2511 if(!prs_uint32("hours ", ps
, depth
, &tod
->hours
))
2513 if(!prs_uint32("mins ", ps
, depth
, &tod
->mins
))
2515 if(!prs_uint32("secs ", ps
, depth
, &tod
->secs
))
2517 if(!prs_uint32("hunds ", ps
, depth
, &tod
->hunds
))
2519 if(!prs_uint32("timezone ", ps
, depth
, &tod
->zone
))
2521 if(!prs_uint32("tintervals ", ps
, depth
, &tod
->tintervals
))
2523 if(!prs_uint32("day ", ps
, depth
, &tod
->day
))
2525 if(!prs_uint32("month ", ps
, depth
, &tod
->month
))
2527 if(!prs_uint32("year ", ps
, depth
, &tod
->year
))
2529 if(!prs_uint32("weekday ", ps
, depth
, &tod
->weekday
))
2535 /*******************************************************************
2536 Inits a TIME_OF_DAY_INFO structure.
2537 ********************************************************************/
2539 void init_time_of_day_info(TIME_OF_DAY_INFO
*tod
, uint32 elapsedt
, uint32 msecs
,
2540 uint32 hours
, uint32 mins
, uint32 secs
, uint32 hunds
,
2541 uint32 zone
, uint32 tintervals
, uint32 day
,
2542 uint32 month
, uint32 year
, uint32 weekday
)
2544 DEBUG(5,("init_time_of_day_info\n"));
2546 tod
->elapsedt
= elapsedt
;
2553 tod
->tintervals
= tintervals
;
2557 tod
->weekday
= weekday
;
2561 /*******************************************************************
2562 Reads or writes a structure.
2563 ********************************************************************/
2565 BOOL
srv_io_r_net_remote_tod(char *desc
, SRV_R_NET_REMOTE_TOD
*r_n
, prs_struct
*ps
, int depth
)
2570 prs_debug(ps
, depth
, desc
, "srv_io_r_net_remote_tod");
2576 if(!prs_uint32("ptr_srv_tod ", ps
, depth
, &r_n
->ptr_srv_tod
))
2579 if(!srv_io_time_of_day_info("tod", r_n
->tod
, ps
, depth
))
2582 if(!prs_werror("status ", ps
, depth
, &r_n
->status
))
2588 /*******************************************************************
2589 Reads or writes a structure.
2590 ********************************************************************/
2592 BOOL
srv_io_q_net_disk_enum(char *desc
, SRV_Q_NET_DISK_ENUM
*q_n
, prs_struct
*ps
, int depth
)
2597 prs_debug(ps
, depth
, desc
, "srv_io_q_net_disk_enum");
2603 if(!prs_uint32("ptr_srv_name", ps
, depth
, &q_n
->ptr_srv_name
))
2606 if(!smb_io_unistr2("", &q_n
->uni_srv_name
, True
, ps
, depth
))
2612 if(!prs_uint32("level", ps
, depth
, &q_n
->disk_enum_ctr
.level
))
2615 if(!prs_uint32("entries_read", ps
, depth
, &q_n
->disk_enum_ctr
.entries_read
))
2618 if(!prs_uint32("buffer", ps
, depth
, &q_n
->disk_enum_ctr
.disk_info_ptr
))
2624 if(!prs_uint32("preferred_len", ps
, depth
, &q_n
->preferred_len
))
2626 if(!smb_io_enum_hnd("enum_hnd", &q_n
->enum_hnd
, ps
, depth
))
2632 /*******************************************************************
2633 Reads or writes a structure.
2634 ********************************************************************/
2636 BOOL
srv_io_r_net_disk_enum(char *desc
, SRV_R_NET_DISK_ENUM
*r_n
, prs_struct
*ps
, int depth
)
2643 prs_debug(ps
, depth
, desc
, "srv_io_r_net_disk_enum");
2649 if(!prs_uint32("entries_read", ps
, depth
, &r_n
->disk_enum_ctr
.entries_read
))
2651 if(!prs_uint32("ptr_disk_info", ps
, depth
, &r_n
->disk_enum_ctr
.disk_info_ptr
))
2654 /*this may be max, unknown, actual?*/
2656 if(!prs_uint32("max_elements", ps
, depth
, &r_n
->disk_enum_ctr
.entries_read
))
2658 if(!prs_uint32("unknown", ps
, depth
, &r_n
->disk_enum_ctr
.unknown
))
2660 if(!prs_uint32("actual_elements", ps
, depth
, &r_n
->disk_enum_ctr
.entries_read
))
2663 for(i
=0; i
< r_n
->disk_enum_ctr
.entries_read
; i
++) {
2665 if(!prs_uint32("unknown", ps
, depth
, &r_n
->disk_enum_ctr
.disk_info
[i
].unknown
))
2668 if(!smb_io_unistr3("disk_name", &r_n
->disk_enum_ctr
.disk_info
[i
].disk_name
, ps
, depth
))
2675 if(!prs_uint32("total_entries", ps
, depth
, &r_n
->total_entries
))
2678 if(!smb_io_enum_hnd("enum_hnd", &r_n
->enum_hnd
, ps
, depth
))
2681 if(!prs_werror("status", ps
, depth
, &r_n
->status
))
2687 /*******************************************************************
2688 Reads or writes a structure.
2689 ********************************************************************/
2691 BOOL
srv_io_q_net_name_validate(char *desc
, SRV_Q_NET_NAME_VALIDATE
*q_n
, prs_struct
*ps
, int depth
)
2696 prs_debug(ps
, depth
, desc
, "srv_io_q_net_name_validate");
2702 if(!prs_uint32("ptr_srv_name", ps
, depth
, &q_n
->ptr_srv_name
))
2705 if(!smb_io_unistr2("", &q_n
->uni_srv_name
, True
, ps
, depth
))
2711 if(!smb_io_unistr2("", &q_n
->uni_name
, True
, ps
, depth
))
2717 if(!prs_uint32("type", ps
, depth
, &q_n
->type
))
2720 if(!prs_uint32("flags", ps
, depth
, &q_n
->flags
))
2726 /*******************************************************************
2727 Reads or writes a structure.
2728 ********************************************************************/
2730 BOOL
srv_io_r_net_name_validate(char *desc
, SRV_R_NET_NAME_VALIDATE
*r_n
, prs_struct
*ps
, int depth
)
2735 prs_debug(ps
, depth
, desc
, "srv_io_r_net_name_validate");
2741 if(!prs_werror("status", ps
, depth
, &r_n
->status
))
2747 /*******************************************************************
2748 Reads or writes a structure.
2749 ********************************************************************/
2751 BOOL
srv_io_q_net_file_query_secdesc(char *desc
, SRV_Q_NET_FILE_QUERY_SECDESC
*q_n
, prs_struct
*ps
, int depth
)
2756 prs_debug(ps
, depth
, desc
, "srv_io_q_net_file_query_secdesc");
2762 if(!prs_uint32("ptr_srv_name", ps
, depth
, &q_n
->ptr_srv_name
))
2765 if(!smb_io_unistr2("", &q_n
->uni_srv_name
, True
, ps
, depth
))
2771 if(!prs_uint32("ptr_qual_name", ps
, depth
, &q_n
->ptr_qual_name
))
2774 if(!smb_io_unistr2("", &q_n
->uni_qual_name
, True
, ps
, depth
))
2780 if(!smb_io_unistr2("", &q_n
->uni_file_name
, True
, ps
, depth
))
2783 if(!prs_uint32("unknown1", ps
, depth
, &q_n
->unknown1
))
2786 if(!prs_uint32("unknown2", ps
, depth
, &q_n
->unknown2
))
2789 if(!prs_uint32("unknown3", ps
, depth
, &q_n
->unknown3
))
2795 /*******************************************************************
2796 Reads or writes a structure.
2797 ********************************************************************/
2799 BOOL
srv_io_r_net_file_query_secdesc(char *desc
, SRV_R_NET_FILE_QUERY_SECDESC
*r_n
, prs_struct
*ps
, int depth
)
2804 prs_debug(ps
, depth
, desc
, "srv_io_r_net_file_query_secdesc");
2810 if(!prs_uint32("ptr_response", ps
, depth
, &r_n
->ptr_response
))
2813 if(!prs_uint32("size_response", ps
, depth
, &r_n
->size_response
))
2816 if(!prs_uint32("ptr_secdesc", ps
, depth
, &r_n
->ptr_secdesc
))
2819 if(!prs_uint32("size_secdesc", ps
, depth
, &r_n
->size_secdesc
))
2822 if(!sec_io_desc("sec_desc", &r_n
->sec_desc
, ps
, depth
))
2828 if(!prs_werror("status", ps
, depth
, &r_n
->status
))
2834 /*******************************************************************
2835 Reads or writes a structure.
2836 ********************************************************************/
2838 BOOL
srv_io_q_net_file_set_secdesc(char *desc
, SRV_Q_NET_FILE_SET_SECDESC
*q_n
, prs_struct
*ps
, int depth
)
2843 prs_debug(ps
, depth
, desc
, "srv_io_q_net_file_set_secdesc");
2849 if(!prs_uint32("ptr_srv_name", ps
, depth
, &q_n
->ptr_srv_name
))
2852 if(!smb_io_unistr2("", &q_n
->uni_srv_name
, True
, ps
, depth
))
2858 if(!prs_uint32("ptr_qual_name", ps
, depth
, &q_n
->ptr_qual_name
))
2861 if(!smb_io_unistr2("", &q_n
->uni_qual_name
, True
, ps
, depth
))
2867 if(!smb_io_unistr2("", &q_n
->uni_file_name
, True
, ps
, depth
))
2873 if(!prs_uint32("sec_info", ps
, depth
, &q_n
->sec_info
))
2876 if(!prs_uint32("size_set", ps
, depth
, &q_n
->size_set
))
2879 if(!prs_uint32("ptr_secdesc", ps
, depth
, &q_n
->ptr_secdesc
))
2882 if(!prs_uint32("size_secdesc", ps
, depth
, &q_n
->size_secdesc
))
2885 if(!sec_io_desc("sec_desc", &q_n
->sec_desc
, ps
, depth
))
2891 /*******************************************************************
2892 Reads or writes a structure.
2893 ********************************************************************/
2895 BOOL
srv_io_r_net_file_set_secdesc(char *desc
, SRV_R_NET_FILE_SET_SECDESC
*r_n
, prs_struct
*ps
, int depth
)
2900 prs_debug(ps
, depth
, desc
, "srv_io_r_net_file_set_secdesc");
2906 if(!prs_werror("status", ps
, depth
, &r_n
->status
))