3 * Unix SMB/Netbios implementation.
5 * RPC Pipe client / server routines
6 * Copyright (C) Andrew Tridgell 1992-1997,
7 * Copyright (C) Luke Kenneth Casson Leighton 1996-1997,
8 * Copyright (C) Paul Ashton 1997.
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.
28 extern int DEBUGLEVEL
;
31 /*******************************************************************
32 makes a SH_INFO_1_STR structure
33 ********************************************************************/
34 void make_srv_share_info1_str(SH_INFO_1_STR
*sh1
, char *net_name
, char *remark
)
36 if (sh1
== NULL
) return;
38 DEBUG(5,("make_srv_share_info1_str\n"));
40 make_unistr2(&(sh1
->uni_netname
), net_name
, strlen(net_name
));
41 make_unistr2(&(sh1
->uni_remark
), remark
, strlen(remark
));
44 /*******************************************************************
45 reads or writes a structure.
46 ********************************************************************/
47 static void srv_io_share_info1_str(char *desc
, SH_INFO_1_STR
*sh1
, prs_struct
*ps
, int depth
)
49 if (sh1
== NULL
) return;
51 prs_debug(ps
, depth
, desc
, "srv_io_share_info1_str");
56 smb_io_unistr2("", &(sh1
->uni_netname
), True
, ps
, depth
);
57 smb_io_unistr2("", &(sh1
->uni_remark
), True
, ps
, depth
);
60 /*******************************************************************
61 makes a SH_INFO_1 structure
62 ********************************************************************/
63 void make_srv_share_info1(SH_INFO_1
*sh1
, char *net_name
, uint32 type
, char *remark
)
65 if (sh1
== NULL
) return;
67 DEBUG(5,("make_srv_share_info1: %s %8x %s\n", net_name
, type
, remark
));
69 sh1
->ptr_netname
= net_name
!= NULL
? 1 : 0;
71 sh1
->ptr_remark
= remark
!= NULL
? 1 : 0;
74 /*******************************************************************
75 reads or writes a structure.
76 ********************************************************************/
77 static void srv_io_share_info1(char *desc
, SH_INFO_1
*sh1
, prs_struct
*ps
, int depth
)
79 if (sh1
== NULL
) return;
81 prs_debug(ps
, depth
, desc
, "srv_io_share_info1");
86 prs_uint32("ptr_netname", ps
, depth
, &(sh1
->ptr_netname
));
87 prs_uint32("type ", ps
, depth
, &(sh1
->type
));
88 prs_uint32("ptr_remark ", ps
, depth
, &(sh1
->ptr_remark
));
91 /*******************************************************************
92 reads or writes a structure.
93 ********************************************************************/
94 static void srv_io_srv_share_info_1(char *desc
, SRV_SHARE_INFO_1
*ctr
, prs_struct
*ps
, int depth
)
96 if (ctr
== NULL
) return;
98 prs_debug(ps
, depth
, desc
, "srv_io_share_1_ctr");
103 prs_uint32("num_entries_read", ps
, depth
, &(ctr
->num_entries_read
));
104 prs_uint32("ptr_share_info", ps
, depth
, &(ctr
->ptr_share_info
));
106 if (ctr
->ptr_share_info
!= 0)
109 int num_entries
= ctr
->num_entries_read
;
110 if (num_entries
> MAX_SHARE_ENTRIES
)
112 num_entries
= MAX_SHARE_ENTRIES
; /* report this! */
115 prs_uint32("num_entries_read2", ps
, depth
, &(ctr
->num_entries_read2
));
117 SMB_ASSERT_ARRAY(ctr
->info_1
, num_entries
);
119 for (i
= 0; i
< num_entries
; i
++)
122 srv_io_share_info1("", &(ctr
->info_1
[i
]), ps
, depth
);
125 for (i
= 0; i
< num_entries
; i
++)
128 srv_io_share_info1_str("", &(ctr
->info_1_str
[i
]), ps
, depth
);
135 /*******************************************************************
136 makes a SH_INFO_2_STR structure
137 ********************************************************************/
138 void make_srv_share_info2_str(SH_INFO_2_STR
*sh2
,
139 char *net_name
, char *remark
,
140 char *path
, char *passwd
)
142 if (sh2
== NULL
) return;
144 DEBUG(5,("make_srv_share_info2_str\n"));
146 make_unistr2(&(sh2
->uni_netname
), net_name
, strlen(net_name
)+1);
147 make_unistr2(&(sh2
->uni_remark
), remark
, strlen(remark
)+1);
148 make_unistr2(&(sh2
->uni_path
), path
, strlen(path
)+1);
149 make_unistr2(&(sh2
->uni_passwd
), passwd
, strlen(passwd
)+1);
152 /*******************************************************************
153 reads or writes a structure.
154 ********************************************************************/
155 static void srv_io_share_info2_str(char *desc
, SH_INFO_2_STR
*sh2
, prs_struct
*ps
, int depth
)
157 if (sh2
== NULL
) return;
159 prs_debug(ps
, depth
, desc
, "srv_io_share_info2_str");
164 smb_io_unistr2("", &(sh2
->uni_netname
), True
, ps
, depth
);
165 smb_io_unistr2("", &(sh2
->uni_remark
), True
, ps
, depth
);
166 smb_io_unistr2("", &(sh2
->uni_path
), True
, ps
, depth
);
167 smb_io_unistr2("", &(sh2
->uni_passwd
), True
, ps
, depth
);
170 /*******************************************************************
171 makes a SH_INFO_2 structure
172 ********************************************************************/
173 void make_srv_share_info2(SH_INFO_2
*sh2
,
174 char *net_name
, uint32 type
, char *remark
,
175 uint32 perms
, uint32 max_uses
, uint32 num_uses
,
176 char *path
, char *passwd
)
178 if (sh2
== NULL
) return;
180 DEBUG(5,("make_srv_share_info2: %s %8x %s\n", net_name
, type
, remark
));
182 sh2
->ptr_netname
= net_name
!= NULL
? 1 : 0;
184 sh2
->ptr_remark
= remark
!= NULL
? 1 : 0;
186 sh2
->max_uses
= max_uses
;
187 sh2
->num_uses
= num_uses
;
189 sh2
->ptr_path
= path
!= NULL
? 1 : 0;
190 sh2
->ptr_passwd
= passwd
!= NULL
? 1 : 0;
193 /*******************************************************************
194 reads or writes a structure.
195 ********************************************************************/
196 static void srv_io_share_info2(char *desc
, SH_INFO_2
*sh2
, prs_struct
*ps
, int depth
)
198 if (sh2
== NULL
) return;
200 prs_debug(ps
, depth
, desc
, "srv_io_share_info2");
205 prs_uint32("ptr_netname", ps
, depth
, &(sh2
->ptr_netname
));
206 prs_uint32("type ", ps
, depth
, &(sh2
->type
));
207 prs_uint32("ptr_remark ", ps
, depth
, &(sh2
->ptr_remark
));
208 prs_uint32("perms ", ps
, depth
, &(sh2
->perms
));
209 prs_uint32("max_uses ", ps
, depth
, &(sh2
->max_uses
));
210 prs_uint32("num_uses ", ps
, depth
, &(sh2
->num_uses
));
211 prs_uint32("ptr_path ", ps
, depth
, &(sh2
->ptr_path
));
212 prs_uint32("ptr_passwd ", ps
, depth
, &(sh2
->ptr_passwd
));
215 /*******************************************************************
216 reads or writes a structure.
217 ********************************************************************/
218 static void srv_io_srv_share_info_2(char *desc
, SRV_SHARE_INFO_2
*ctr
, prs_struct
*ps
, int depth
)
220 if (ctr
== NULL
) return;
222 prs_debug(ps
, depth
, desc
, "srv_io_share_2_ctr");
227 prs_uint32("num_entries_read", ps
, depth
, &(ctr
->num_entries_read
));
228 prs_uint32("ptr_share_info", ps
, depth
, &(ctr
->ptr_share_info
));
230 if (ctr
->ptr_share_info
!= 0)
233 int num_entries
= ctr
->num_entries_read
;
234 if (num_entries
> MAX_SHARE_ENTRIES
)
236 num_entries
= MAX_SHARE_ENTRIES
; /* report this! */
239 prs_uint32("num_entries_read2", ps
, depth
, &(ctr
->num_entries_read2
));
241 SMB_ASSERT_ARRAY(ctr
->info_2
, num_entries
);
243 for (i
= 0; i
< num_entries
; i
++)
246 srv_io_share_info2("", &(ctr
->info_2
[i
]), ps
, depth
);
249 for (i
= 0; i
< num_entries
; i
++)
252 srv_io_share_info2_str("", &(ctr
->info_2_str
[i
]), ps
, depth
);
259 /*******************************************************************
260 reads or writes a structure.
261 ********************************************************************/
262 static void srv_io_srv_share_ctr(char *desc
, SRV_SHARE_INFO_CTR
*ctr
, prs_struct
*ps
, int depth
)
264 if (ctr
== NULL
) return;
266 prs_debug(ps
, depth
, desc
, "srv_io_srv_share_ctr");
271 prs_uint32("switch_value", ps
, depth
, &(ctr
->switch_value
));
272 prs_uint32("ptr_share_ctr", ps
, depth
, &(ctr
->ptr_share_ctr
));
274 if (ctr
->ptr_share_ctr
!= 0)
276 switch (ctr
->switch_value
)
280 srv_io_srv_share_info_2("", &(ctr
->share
.info2
), ps
, depth
);
285 srv_io_srv_share_info_1("", &(ctr
->share
.info1
), ps
, depth
);
290 DEBUG(5,("%s no share info at switch_value %d\n",
291 tab_depth(depth
), ctr
->switch_value
));
298 /*******************************************************************
299 reads or writes a structure.
300 ********************************************************************/
301 void make_srv_q_net_share_enum(SRV_Q_NET_SHARE_ENUM
*q_n
,
303 uint32 share_level
, SRV_SHARE_INFO_CTR
*ctr
,
304 uint32 preferred_len
,
307 if (q_n
== NULL
|| ctr
== NULL
|| hnd
== NULL
) return;
311 DEBUG(5,("make_q_net_share_enum\n"));
313 make_buf_unistr2(&(q_n
->uni_srv_name
), &(q_n
->ptr_srv_name
), srv_name
);
315 q_n
->share_level
= share_level
;
316 q_n
->preferred_len
= preferred_len
;
318 memcpy(&(q_n
->enum_hnd
), hnd
, sizeof(*hnd
));
321 /*******************************************************************
322 reads or writes a structure.
323 ********************************************************************/
324 void srv_io_q_net_share_enum(char *desc
, SRV_Q_NET_SHARE_ENUM
*q_n
, prs_struct
*ps
, int depth
)
326 if (q_n
== NULL
) return;
328 prs_debug(ps
, depth
, desc
, "srv_io_q_net_share_enum");
333 prs_uint32("ptr_srv_name", ps
, depth
, &(q_n
->ptr_srv_name
));
334 smb_io_unistr2("", &(q_n
->uni_srv_name
), True
, ps
, depth
);
338 prs_uint32("share_level", ps
, depth
, &(q_n
->share_level
));
340 if (q_n
->share_level
!= -1)
342 srv_io_srv_share_ctr("share_ctr", q_n
->ctr
, ps
, depth
);
345 prs_uint32("preferred_len", ps
, depth
, &(q_n
->preferred_len
));
347 smb_io_enum_hnd("enum_hnd", &(q_n
->enum_hnd
), ps
, depth
);
350 /*******************************************************************
351 reads or writes a structure.
352 ********************************************************************/
353 void srv_io_r_net_share_enum(char *desc
, SRV_R_NET_SHARE_ENUM
*r_n
, prs_struct
*ps
, int depth
)
355 if (r_n
== NULL
) return;
357 prs_debug(ps
, depth
, desc
, "srv_io_r_net_share_enum");
362 prs_uint32("share_level", ps
, depth
, &(r_n
->share_level
));
364 if (r_n
->share_level
!= 0)
366 srv_io_srv_share_ctr("share_ctr", r_n
->ctr
, ps
, depth
);
369 prs_uint32("total_entries", ps
, depth
, &(r_n
->total_entries
));
370 smb_io_enum_hnd("enum_hnd", &(r_n
->enum_hnd
), ps
, depth
);
371 prs_uint32("status ", ps
, depth
, &(r_n
->status
));
374 /*******************************************************************
375 makes a SESS_INFO_0_STR structure
376 ********************************************************************/
377 void make_srv_sess_info0_str(SESS_INFO_0_STR
*ss0
, char *name
)
379 if (ss0
== NULL
) return;
381 DEBUG(5,("make_srv_sess_info0_str\n"));
383 make_unistr2(&(ss0
->uni_name
), name
, strlen(name
));
386 /*******************************************************************
387 reads or writes a structure.
388 ********************************************************************/
389 static void srv_io_sess_info0_str(char *desc
, SESS_INFO_0_STR
*ss0
, prs_struct
*ps
, int depth
)
391 if (ss0
== NULL
) return;
393 prs_debug(ps
, depth
, desc
, "srv_io_sess_info0_str");
398 smb_io_unistr2("", &(ss0
->uni_name
), True
, ps
, depth
);
401 /*******************************************************************
402 makes a SESS_INFO_0 structure
403 ********************************************************************/
404 void make_srv_sess_info0(SESS_INFO_0
*ss0
, char *name
)
406 if (ss0
== NULL
) return;
408 DEBUG(5,("make_srv_sess_info0: %s\n", name
));
410 ss0
->ptr_name
= name
!= NULL
? 1 : 0;
413 /*******************************************************************
414 reads or writes a structure.
415 ********************************************************************/
416 static void srv_io_sess_info0(char *desc
, SESS_INFO_0
*ss0
, prs_struct
*ps
, int depth
)
418 if (ss0
== NULL
) return;
420 prs_debug(ps
, depth
, desc
, "srv_io_sess_info0");
425 prs_uint32("ptr_name", ps
, depth
, &(ss0
->ptr_name
));
428 /*******************************************************************
429 reads or writes a structure.
430 ********************************************************************/
431 static void srv_io_srv_sess_info_0(char *desc
, SRV_SESS_INFO_0
*ss0
, prs_struct
*ps
, int depth
)
433 if (ss0
== NULL
) return;
435 prs_debug(ps
, depth
, desc
, "srv_io_srv_sess_info_0");
440 prs_uint32("num_entries_read", ps
, depth
, &(ss0
->num_entries_read
));
441 prs_uint32("ptr_sess_info", ps
, depth
, &(ss0
->ptr_sess_info
));
443 if (ss0
->ptr_sess_info
!= 0)
446 int num_entries
= ss0
->num_entries_read
;
447 if (num_entries
> MAX_SESS_ENTRIES
)
449 num_entries
= MAX_SESS_ENTRIES
; /* report this! */
452 prs_uint32("num_entries_read2", ps
, depth
, &(ss0
->num_entries_read2
));
454 SMB_ASSERT_ARRAY(ss0
->info_0
, num_entries
);
456 for (i
= 0; i
< num_entries
; i
++)
459 srv_io_sess_info0("", &(ss0
->info_0
[i
]), ps
, depth
);
462 for (i
= 0; i
< num_entries
; i
++)
465 srv_io_sess_info0_str("", &(ss0
->info_0_str
[i
]), ps
, depth
);
472 /*******************************************************************
473 makes a SESS_INFO_1_STR structure
474 ********************************************************************/
475 void make_srv_sess_info1_str(SESS_INFO_1_STR
*ss1
, char *name
, char *user
)
477 if (ss1
== NULL
) return;
479 DEBUG(5,("make_srv_sess_info1_str\n"));
481 make_unistr2(&(ss1
->uni_name
), name
, strlen(name
));
482 make_unistr2(&(ss1
->uni_user
), name
, strlen(user
));
485 /*******************************************************************
486 reads or writes a structure.
487 ********************************************************************/
488 static void srv_io_sess_info1_str(char *desc
, SESS_INFO_1_STR
*ss1
, prs_struct
*ps
, int depth
)
490 if (ss1
== NULL
) return;
492 prs_debug(ps
, depth
, desc
, "srv_io_sess_info1_str");
497 smb_io_unistr2("", &(ss1
->uni_name
), True
, ps
, depth
);
498 smb_io_unistr2("", &(ss1
->uni_user
), True
, ps
, depth
);
501 /*******************************************************************
502 makes a SESS_INFO_1 structure
503 ********************************************************************/
504 void make_srv_sess_info1(SESS_INFO_1
*ss1
,
505 char *name
, char *user
,
506 uint32 num_opens
, uint32 open_time
, uint32 idle_time
,
509 if (ss1
== NULL
) return;
511 DEBUG(5,("make_srv_sess_info1: %s\n", name
));
513 ss1
->ptr_name
= name
!= NULL
? 1 : 0;
514 ss1
->ptr_user
= user
!= NULL
? 1 : 0;
516 ss1
->num_opens
= num_opens
;
517 ss1
->open_time
= open_time
;
518 ss1
->idle_time
= idle_time
;
519 ss1
->user_flags
= user_flags
;
522 /*******************************************************************
523 reads or writes a structure.
524 ********************************************************************/
525 static void srv_io_sess_info1(char *desc
, SESS_INFO_1
*ss1
, prs_struct
*ps
, int depth
)
527 if (ss1
== NULL
) return;
529 prs_debug(ps
, depth
, desc
, "srv_io_sess_info1");
534 prs_uint32("ptr_name ", ps
, depth
, &(ss1
->ptr_name
));
535 prs_uint32("ptr_user ", ps
, depth
, &(ss1
->ptr_user
));
537 prs_uint32("num_opens ", ps
, depth
, &(ss1
->num_opens
));
538 prs_uint32("open_time ", ps
, depth
, &(ss1
->open_time
));
539 prs_uint32("idle_time ", ps
, depth
, &(ss1
->idle_time
));
540 prs_uint32("user_flags", ps
, depth
, &(ss1
->user_flags
));
543 /*******************************************************************
544 reads or writes a structure.
545 ********************************************************************/
546 static void srv_io_srv_sess_info_1(char *desc
, SRV_SESS_INFO_1
*ss1
, prs_struct
*ps
, int depth
)
548 if (ss1
== NULL
) return;
550 prs_debug(ps
, depth
, desc
, "srv_io_srv_sess_info_1");
555 prs_uint32("num_entries_read", ps
, depth
, &(ss1
->num_entries_read
));
556 prs_uint32("ptr_sess_info", ps
, depth
, &(ss1
->ptr_sess_info
));
558 if (ss1
->ptr_sess_info
!= 0)
561 int num_entries
= ss1
->num_entries_read
;
562 if (num_entries
> MAX_SESS_ENTRIES
)
564 num_entries
= MAX_SESS_ENTRIES
; /* report this! */
567 prs_uint32("num_entries_read2", ps
, depth
, &(ss1
->num_entries_read2
));
569 SMB_ASSERT_ARRAY(ss1
->info_1
, num_entries
);
571 for (i
= 0; i
< num_entries
; i
++)
574 srv_io_sess_info1("", &(ss1
->info_1
[i
]), ps
, depth
);
577 for (i
= 0; i
< num_entries
; i
++)
580 srv_io_sess_info1_str("", &(ss1
->info_1_str
[i
]), ps
, depth
);
587 /*******************************************************************
588 reads or writes a structure.
589 ********************************************************************/
590 static void srv_io_srv_sess_ctr(char *desc
, SRV_SESS_INFO_CTR
*ctr
, prs_struct
*ps
, int depth
)
592 if (ctr
== NULL
) return;
594 prs_debug(ps
, depth
, desc
, "srv_io_srv_sess_ctr");
599 prs_uint32("switch_value", ps
, depth
, &(ctr
->switch_value
));
600 prs_uint32("ptr_sess_ctr", ps
, depth
, &(ctr
->ptr_sess_ctr
));
602 if (ctr
->ptr_sess_ctr
!= 0)
604 switch (ctr
->switch_value
)
608 srv_io_srv_sess_info_0("", &(ctr
->sess
.info0
), ps
, depth
);
613 srv_io_srv_sess_info_1("", &(ctr
->sess
.info1
), ps
, depth
);
618 DEBUG(5,("%s no session info at switch_value %d\n",
619 tab_depth(depth
), ctr
->switch_value
));
626 /*******************************************************************
627 reads or writes a structure.
628 ********************************************************************/
629 void make_srv_q_net_sess_enum(SRV_Q_NET_SESS_ENUM
*q_n
,
630 char *srv_name
, char *qual_name
,
631 uint32 sess_level
, SRV_SESS_INFO_CTR
*ctr
,
632 uint32 preferred_len
,
635 if (q_n
== NULL
|| ctr
== NULL
|| hnd
== NULL
) return;
639 DEBUG(5,("make_q_net_sess_enum\n"));
641 make_buf_unistr2(&(q_n
->uni_srv_name
), &(q_n
->ptr_srv_name
), srv_name
);
642 make_buf_unistr2(&(q_n
->uni_qual_name
), &(q_n
->ptr_qual_name
), qual_name
);
644 q_n
->sess_level
= sess_level
;
645 q_n
->preferred_len
= preferred_len
;
647 memcpy(&(q_n
->enum_hnd
), hnd
, sizeof(*hnd
));
650 /*******************************************************************
651 reads or writes a structure.
652 ********************************************************************/
653 void srv_io_q_net_sess_enum(char *desc
, SRV_Q_NET_SESS_ENUM
*q_n
, prs_struct
*ps
, int depth
)
655 if (q_n
== NULL
) return;
657 prs_debug(ps
, depth
, desc
, "srv_io_q_net_sess_enum");
662 prs_uint32("ptr_srv_name", ps
, depth
, &(q_n
->ptr_srv_name
));
663 smb_io_unistr2("", &(q_n
->uni_srv_name
), True
, ps
, depth
);
667 prs_uint32("ptr_qual_name", ps
, depth
, &(q_n
->ptr_qual_name
));
668 smb_io_unistr2("", &(q_n
->uni_qual_name
), q_n
->ptr_qual_name
, ps
, depth
);
672 prs_uint32("sess_level", ps
, depth
, &(q_n
->sess_level
));
674 if (q_n
->sess_level
!= -1)
676 srv_io_srv_sess_ctr("sess_ctr", q_n
->ctr
, ps
, depth
);
679 prs_uint32("preferred_len", ps
, depth
, &(q_n
->preferred_len
));
681 smb_io_enum_hnd("enum_hnd", &(q_n
->enum_hnd
), ps
, depth
);
684 /*******************************************************************
685 reads or writes a structure.
686 ********************************************************************/
687 void srv_io_r_net_sess_enum(char *desc
, SRV_R_NET_SESS_ENUM
*r_n
, prs_struct
*ps
, int depth
)
689 if (r_n
== NULL
) return;
691 prs_debug(ps
, depth
, desc
, "srv_io_r_net_sess_enum");
696 prs_uint32("sess_level", ps
, depth
, &(r_n
->sess_level
));
698 if (r_n
->sess_level
!= -1)
700 srv_io_srv_sess_ctr("sess_ctr", r_n
->ctr
, ps
, depth
);
703 prs_uint32("total_entries", ps
, depth
, &(r_n
->total_entries
));
704 smb_io_enum_hnd("enum_hnd", &(r_n
->enum_hnd
), ps
, depth
);
705 prs_uint32("status ", ps
, depth
, &(r_n
->status
));
708 /*******************************************************************
709 makes a CONN_INFO_0 structure
710 ********************************************************************/
711 void make_srv_conn_info0(CONN_INFO_0
*ss0
, uint32 id
)
713 if (ss0
== NULL
) return;
715 DEBUG(5,("make_srv_conn_info0\n"));
720 /*******************************************************************
721 reads or writes a structure.
722 ********************************************************************/
723 static void srv_io_conn_info0(char *desc
, CONN_INFO_0
*ss0
, prs_struct
*ps
, int depth
)
725 if (ss0
== NULL
) return;
727 prs_debug(ps
, depth
, desc
, "srv_io_conn_info0");
732 prs_uint32("id", ps
, depth
, &(ss0
->id
));
735 /*******************************************************************
736 reads or writes a structure.
737 ********************************************************************/
738 static void srv_io_srv_conn_info_0(char *desc
, SRV_CONN_INFO_0
*ss0
, prs_struct
*ps
, int depth
)
740 if (ss0
== NULL
) return;
742 prs_debug(ps
, depth
, desc
, "srv_io_srv_conn_info_0");
747 prs_uint32("num_entries_read", ps
, depth
, &(ss0
->num_entries_read
));
748 prs_uint32("ptr_conn_info", ps
, depth
, &(ss0
->ptr_conn_info
));
750 if (ss0
->ptr_conn_info
!= 0)
753 int num_entries
= ss0
->num_entries_read
;
754 if (num_entries
> MAX_CONN_ENTRIES
)
756 num_entries
= MAX_CONN_ENTRIES
; /* report this! */
759 prs_uint32("num_entries_read2", ps
, depth
, &(ss0
->num_entries_read2
));
761 for (i
= 0; i
< num_entries
; i
++)
764 srv_io_conn_info0("", &(ss0
->info_0
[i
]), ps
, depth
);
771 /*******************************************************************
772 makes a CONN_INFO_1_STR structure
773 ********************************************************************/
774 void make_srv_conn_info1_str(CONN_INFO_1_STR
*ss1
, char *usr_name
, char *net_name
)
776 if (ss1
== NULL
) return;
778 DEBUG(5,("make_srv_conn_info1_str\n"));
780 make_unistr2(&(ss1
->uni_usr_name
), usr_name
, strlen(usr_name
));
781 make_unistr2(&(ss1
->uni_net_name
), net_name
, strlen(net_name
));
784 /*******************************************************************
785 reads or writes a structure.
786 ********************************************************************/
787 static void srv_io_conn_info1_str(char *desc
, CONN_INFO_1_STR
*ss1
, prs_struct
*ps
, int depth
)
789 if (ss1
== NULL
) return;
791 prs_debug(ps
, depth
, desc
, "srv_io_conn_info1_str");
796 smb_io_unistr2("", &(ss1
->uni_usr_name
), True
, ps
, depth
);
797 smb_io_unistr2("", &(ss1
->uni_net_name
), True
, ps
, depth
);
800 /*******************************************************************
801 makes a CONN_INFO_1 structure
802 ********************************************************************/
803 void make_srv_conn_info1(CONN_INFO_1
*ss1
,
804 uint32 id
, uint32 type
,
805 uint32 num_opens
, uint32 num_users
, uint32 open_time
,
806 char *usr_name
, char *net_name
)
808 if (ss1
== NULL
) return;
810 DEBUG(5,("make_srv_conn_info1: %s %s\n", usr_name
, net_name
));
814 ss1
->num_opens
= num_opens
;
815 ss1
->num_users
= num_users
;
816 ss1
->open_time
= open_time
;
818 ss1
->ptr_usr_name
= usr_name
!= NULL
? 1 : 0;
819 ss1
->ptr_net_name
= net_name
!= NULL
? 1 : 0;
822 /*******************************************************************
823 reads or writes a structure.
824 ********************************************************************/
825 static void srv_io_conn_info1(char *desc
, CONN_INFO_1
*ss1
, prs_struct
*ps
, int depth
)
827 if (ss1
== NULL
) return;
829 prs_debug(ps
, depth
, desc
, "srv_io_conn_info1");
834 prs_uint32("id ", ps
, depth
, &(ss1
->id
));
835 prs_uint32("type ", ps
, depth
, &(ss1
->type
));
836 prs_uint32("num_opens ", ps
, depth
, &(ss1
->num_opens
));
837 prs_uint32("num_users ", ps
, depth
, &(ss1
->num_users
));
838 prs_uint32("open_time ", ps
, depth
, &(ss1
->open_time
));
840 prs_uint32("ptr_usr_name", ps
, depth
, &(ss1
->ptr_usr_name
));
841 prs_uint32("ptr_net_name", ps
, depth
, &(ss1
->ptr_net_name
));
844 /*******************************************************************
845 reads or writes a structure.
846 ********************************************************************/
847 static void srv_io_srv_conn_info_1(char *desc
, SRV_CONN_INFO_1
*ss1
, prs_struct
*ps
, int depth
)
849 if (ss1
== NULL
) return;
851 prs_debug(ps
, depth
, desc
, "srv_io_srv_conn_info_1");
856 prs_uint32("num_entries_read", ps
, depth
, &(ss1
->num_entries_read
));
857 prs_uint32("ptr_conn_info", ps
, depth
, &(ss1
->ptr_conn_info
));
859 if (ss1
->ptr_conn_info
!= 0)
862 int num_entries
= ss1
->num_entries_read
;
863 if (num_entries
> MAX_CONN_ENTRIES
)
865 num_entries
= MAX_CONN_ENTRIES
; /* report this! */
868 prs_uint32("num_entries_read2", ps
, depth
, &(ss1
->num_entries_read2
));
870 for (i
= 0; i
< num_entries
; i
++)
873 srv_io_conn_info1("", &(ss1
->info_1
[i
]), ps
, depth
);
876 for (i
= 0; i
< num_entries
; i
++)
879 srv_io_conn_info1_str("", &(ss1
->info_1_str
[i
]), ps
, depth
);
886 /*******************************************************************
887 reads or writes a structure.
888 ********************************************************************/
889 static void srv_io_srv_conn_ctr(char *desc
, SRV_CONN_INFO_CTR
*ctr
, prs_struct
*ps
, int depth
)
891 if (ctr
== NULL
) return;
893 prs_debug(ps
, depth
, desc
, "srv_io_srv_conn_ctr");
898 prs_uint32("switch_value", ps
, depth
, &(ctr
->switch_value
));
899 prs_uint32("ptr_conn_ctr", ps
, depth
, &(ctr
->ptr_conn_ctr
));
901 if (ctr
->ptr_conn_ctr
!= 0)
903 switch (ctr
->switch_value
)
907 srv_io_srv_conn_info_0("", &(ctr
->conn
.info0
), ps
, depth
);
912 srv_io_srv_conn_info_1("", &(ctr
->conn
.info1
), ps
, depth
);
917 DEBUG(5,("%s no connection info at switch_value %d\n",
918 tab_depth(depth
), ctr
->switch_value
));
925 /*******************************************************************
926 reads or writes a structure.
927 ********************************************************************/
928 void make_srv_q_net_conn_enum(SRV_Q_NET_CONN_ENUM
*q_n
,
929 char *srv_name
, char *qual_name
,
930 uint32 conn_level
, SRV_CONN_INFO_CTR
*ctr
,
931 uint32 preferred_len
,
934 if (q_n
== NULL
|| ctr
== NULL
|| hnd
== NULL
) return;
938 DEBUG(5,("make_q_net_conn_enum\n"));
940 make_buf_unistr2(&(q_n
->uni_srv_name
), &(q_n
->ptr_srv_name
), srv_name
);
941 make_buf_unistr2(&(q_n
->uni_qual_name
), &(q_n
->ptr_qual_name
), qual_name
);
943 q_n
->conn_level
= conn_level
;
944 q_n
->preferred_len
= preferred_len
;
946 memcpy(&(q_n
->enum_hnd
), hnd
, sizeof(*hnd
));
949 /*******************************************************************
950 reads or writes a structure.
951 ********************************************************************/
952 void srv_io_q_net_conn_enum(char *desc
, SRV_Q_NET_CONN_ENUM
*q_n
, prs_struct
*ps
, int depth
)
954 if (q_n
== NULL
) return;
956 prs_debug(ps
, depth
, desc
, "srv_io_q_net_conn_enum");
961 prs_uint32("ptr_srv_name ", ps
, depth
, &(q_n
->ptr_srv_name
));
962 smb_io_unistr2("", &(q_n
->uni_srv_name
), q_n
->ptr_srv_name
, ps
, depth
);
966 prs_uint32("ptr_qual_name", ps
, depth
, &(q_n
->ptr_qual_name
));
967 smb_io_unistr2("", &(q_n
->uni_qual_name
), q_n
->ptr_qual_name
, ps
, depth
);
971 prs_uint32("conn_level", ps
, depth
, &(q_n
->conn_level
));
973 if (q_n
->conn_level
!= -1)
975 srv_io_srv_conn_ctr("conn_ctr", q_n
->ctr
, ps
, depth
);
978 prs_uint32("preferred_len", ps
, depth
, &(q_n
->preferred_len
));
980 smb_io_enum_hnd("enum_hnd", &(q_n
->enum_hnd
), ps
, depth
);
983 /*******************************************************************
984 reads or writes a structure.
985 ********************************************************************/
986 void srv_io_r_net_conn_enum(char *desc
, SRV_R_NET_CONN_ENUM
*r_n
, prs_struct
*ps
, int depth
)
988 if (r_n
== NULL
) return;
990 prs_debug(ps
, depth
, desc
, "srv_io_r_net_conn_enum");
995 prs_uint32("conn_level", ps
, depth
, &(r_n
->conn_level
));
997 if (r_n
->conn_level
!= -1)
999 srv_io_srv_conn_ctr("conn_ctr", r_n
->ctr
, ps
, depth
);
1002 prs_uint32("total_entries", ps
, depth
, &(r_n
->total_entries
));
1003 smb_io_enum_hnd("enum_hnd", &(r_n
->enum_hnd
), ps
, depth
);
1004 prs_uint32("status ", ps
, depth
, &(r_n
->status
));
1007 /*******************************************************************
1008 makes a FILE_INFO_3_STR structure
1009 ********************************************************************/
1010 void make_srv_file_info3_str(FILE_INFO_3_STR
*fi3
, char *user_name
, char *path_name
)
1012 if (fi3
== NULL
) return;
1014 DEBUG(5,("make_srv_file_info3_str\n"));
1016 make_unistr2(&(fi3
->uni_path_name
), path_name
, strlen(path_name
)+1);
1017 make_unistr2(&(fi3
->uni_user_name
), user_name
, strlen(user_name
)+1);
1020 /*******************************************************************
1021 reads or writes a structure.
1022 ********************************************************************/
1023 static void srv_io_file_info3_str(char *desc
, FILE_INFO_3_STR
*sh1
, prs_struct
*ps
, int depth
)
1025 if (sh1
== NULL
) return;
1027 prs_debug(ps
, depth
, desc
, "srv_io_file_info3_str");
1032 smb_io_unistr2("", &(sh1
->uni_path_name
), True
, ps
, depth
);
1033 smb_io_unistr2("", &(sh1
->uni_user_name
), True
, ps
, depth
);
1036 /*******************************************************************
1037 makes a FILE_INFO_3 structure
1038 ********************************************************************/
1039 void make_srv_file_info3(FILE_INFO_3
*fl3
,
1040 uint32 id
, uint32 perms
, uint32 num_locks
,
1041 char *path_name
, char *user_name
)
1043 if (fl3
== NULL
) return;
1045 DEBUG(5,("make_srv_file_info3: %s %s\n", path_name
, user_name
));
1049 fl3
->num_locks
= num_locks
;
1051 fl3
->ptr_path_name
= path_name
!= NULL
? 1 : 0;
1052 fl3
->ptr_user_name
= user_name
!= NULL
? 1 : 0;
1055 /*******************************************************************
1056 reads or writes a structure.
1057 ********************************************************************/
1058 static void srv_io_file_info3(char *desc
, FILE_INFO_3
*fl3
, prs_struct
*ps
, int depth
)
1060 if (fl3
== NULL
) return;
1062 prs_debug(ps
, depth
, desc
, "srv_io_file_info3");
1067 prs_uint32("id ", ps
, depth
, &(fl3
->id
));
1068 prs_uint32("perms ", ps
, depth
, &(fl3
->perms
));
1069 prs_uint32("num_locks ", ps
, depth
, &(fl3
->num_locks
));
1070 prs_uint32("ptr_path_name", ps
, depth
, &(fl3
->ptr_path_name
));
1071 prs_uint32("ptr_user_name", ps
, depth
, &(fl3
->ptr_user_name
));
1074 /*******************************************************************
1075 reads or writes a structure.
1076 ********************************************************************/
1077 static void srv_io_srv_file_info_3(char *desc
, SRV_FILE_INFO_3
*fl3
, prs_struct
*ps
, int depth
)
1079 if (fl3
== NULL
) return;
1081 prs_debug(ps
, depth
, desc
, "srv_io_file_3_fl3");
1086 prs_uint32("num_entries_read", ps
, depth
, &(fl3
->num_entries_read
));
1087 prs_uint32("ptr_file_fl3", ps
, depth
, &(fl3
->ptr_file_info
));
1088 if (fl3
->ptr_file_info
!= 0)
1091 int num_entries
= fl3
->num_entries_read
;
1092 if (num_entries
> MAX_FILE_ENTRIES
)
1094 num_entries
= MAX_FILE_ENTRIES
; /* report this! */
1097 prs_uint32("num_entries_read2", ps
, depth
, &(fl3
->num_entries_read2
));
1099 for (i
= 0; i
< num_entries
; i
++)
1102 srv_io_file_info3("", &(fl3
->info_3
[i
]), ps
, depth
);
1105 for (i
= 0; i
< num_entries
; i
++)
1108 srv_io_file_info3_str("", &(fl3
->info_3_str
[i
]), ps
, depth
);
1115 /*******************************************************************
1116 reads or writes a structure.
1117 ********************************************************************/
1118 static void srv_io_srv_file_ctr(char *desc
, SRV_FILE_INFO_CTR
*ctr
, prs_struct
*ps
, int depth
)
1120 if (ctr
== NULL
) return;
1122 prs_debug(ps
, depth
, desc
, "srv_io_srv_file_ctr");
1127 prs_uint32("switch_value", ps
, depth
, &(ctr
->switch_value
));
1128 prs_uint32("ptr_file_ctr", ps
, depth
, &(ctr
->ptr_file_ctr
));
1130 if (ctr
->ptr_file_ctr
!= 0)
1132 switch (ctr
->switch_value
)
1136 srv_io_srv_file_info_3("", &(ctr
->file
.info3
), ps
, depth
);
1141 DEBUG(5,("%s no file info at switch_value %d\n",
1142 tab_depth(depth
), ctr
->switch_value
));
1149 /*******************************************************************
1150 reads or writes a structure.
1151 ********************************************************************/
1152 void make_srv_q_net_file_enum(SRV_Q_NET_FILE_ENUM
*q_n
,
1153 char *srv_name
, char *qual_name
,
1154 uint32 file_level
, SRV_FILE_INFO_CTR
*ctr
,
1155 uint32 preferred_len
,
1158 if (q_n
== NULL
|| ctr
== NULL
|| hnd
== NULL
) return;
1162 DEBUG(5,("make_q_net_file_enum\n"));
1164 make_buf_unistr2(&(q_n
->uni_srv_name
), &(q_n
->ptr_srv_name
), srv_name
);
1165 make_buf_unistr2(&(q_n
->uni_qual_name
), &(q_n
->ptr_qual_name
), qual_name
);
1167 q_n
->file_level
= file_level
;
1168 q_n
->preferred_len
= preferred_len
;
1170 memcpy(&(q_n
->enum_hnd
), hnd
, sizeof(*hnd
));
1173 /*******************************************************************
1174 reads or writes a structure.
1175 ********************************************************************/
1176 void srv_io_q_net_file_enum(char *desc
, SRV_Q_NET_FILE_ENUM
*q_n
, prs_struct
*ps
, int depth
)
1178 if (q_n
== NULL
) return;
1180 prs_debug(ps
, depth
, desc
, "srv_io_q_net_file_enum");
1185 prs_uint32("ptr_srv_name", ps
, depth
, &(q_n
->ptr_srv_name
));
1186 smb_io_unistr2("", &(q_n
->uni_srv_name
), True
, ps
, depth
);
1190 prs_uint32("ptr_qual_name", ps
, depth
, &(q_n
->ptr_qual_name
));
1191 smb_io_unistr2("", &(q_n
->uni_qual_name
), q_n
->ptr_qual_name
, ps
, depth
);
1195 prs_uint32("file_level", ps
, depth
, &(q_n
->file_level
));
1197 if (q_n
->file_level
!= -1)
1199 srv_io_srv_file_ctr("file_ctr", q_n
->ctr
, ps
, depth
);
1202 prs_uint32("preferred_len", ps
, depth
, &(q_n
->preferred_len
));
1204 smb_io_enum_hnd("enum_hnd", &(q_n
->enum_hnd
), ps
, depth
);
1207 /*******************************************************************
1208 reads or writes a structure.
1209 ********************************************************************/
1210 void srv_io_r_net_file_enum(char *desc
, SRV_R_NET_FILE_ENUM
*r_n
, prs_struct
*ps
, int depth
)
1212 if (r_n
== NULL
) return;
1214 prs_debug(ps
, depth
, desc
, "srv_io_r_net_file_enum");
1219 prs_uint32("file_level", ps
, depth
, &(r_n
->file_level
));
1221 if (r_n
->file_level
!= 0)
1223 srv_io_srv_file_ctr("file_ctr", r_n
->ctr
, ps
, depth
);
1226 prs_uint32("total_entries", ps
, depth
, &(r_n
->total_entries
));
1227 smb_io_enum_hnd("enum_hnd", &(r_n
->enum_hnd
), ps
, depth
);
1228 prs_uint32("status ", ps
, depth
, &(r_n
->status
));
1231 /*******************************************************************
1232 makes a SRV_INFO_101 structure.
1233 ********************************************************************/
1234 void make_srv_info_101(SRV_INFO_101
*sv101
, uint32 platform_id
, char *name
,
1235 uint32 ver_major
, uint32 ver_minor
,
1236 uint32 srv_type
, char *comment
)
1238 if (sv101
== NULL
) return;
1240 DEBUG(5,("make_srv_info_101\n"));
1242 sv101
->platform_id
= platform_id
;
1243 make_buf_unistr2(&(sv101
->uni_name
), &(sv101
->ptr_name
) , name
);
1244 sv101
->ver_major
= ver_major
;
1245 sv101
->ver_minor
= ver_minor
;
1246 sv101
->srv_type
= srv_type
;
1247 make_buf_unistr2(&(sv101
->uni_comment
), &(sv101
->ptr_comment
) , comment
);
1251 /*******************************************************************
1252 reads or writes a SRV_INFO_101 structure.
1253 ********************************************************************/
1254 static void srv_io_info_101(char *desc
, SRV_INFO_101
*sv101
, prs_struct
*ps
, int depth
)
1256 if (sv101
== NULL
) return;
1258 prs_debug(ps
, depth
, desc
, "srv_io_info_101");
1263 prs_uint32("platform_id ", ps
, depth
, &(sv101
->platform_id
));
1264 prs_uint32("ptr_name ", ps
, depth
, &(sv101
->ptr_name
));
1265 prs_uint32("ver_major ", ps
, depth
, &(sv101
->ver_major
));
1266 prs_uint32("ver_minor ", ps
, depth
, &(sv101
->ver_minor
));
1267 prs_uint32("srv_type ", ps
, depth
, &(sv101
->srv_type
));
1268 prs_uint32("ptr_comment ", ps
, depth
, &(sv101
->ptr_comment
));
1272 smb_io_unistr2("uni_name ", &(sv101
->uni_name
), True
, ps
, depth
);
1273 smb_io_unistr2("uni_comment ", &(sv101
->uni_comment
), True
, ps
, depth
);
1276 /*******************************************************************
1277 makes a SRV_INFO_102 structure.
1278 ********************************************************************/
1279 void make_srv_info_102(SRV_INFO_102
*sv102
, uint32 platform_id
, char *name
,
1280 char *comment
, uint32 ver_major
, uint32 ver_minor
,
1281 uint32 srv_type
, uint32 users
, uint32 disc
, uint32 hidden
,
1282 uint32 announce
, uint32 ann_delta
, uint32 licenses
,
1285 if (sv102
== NULL
) return;
1287 DEBUG(5,("make_srv_info_102\n"));
1289 sv102
->platform_id
= platform_id
;
1290 make_buf_unistr2(&(sv102
->uni_name
), &(sv102
->ptr_name
), name
);
1291 sv102
->ver_major
= ver_major
;
1292 sv102
->ver_minor
= ver_minor
;
1293 sv102
->srv_type
= srv_type
;
1294 make_buf_unistr2(&(sv102
->uni_comment
), &(sv102
->ptr_comment
), comment
);
1296 /* same as 101 up to here */
1298 sv102
->users
= users
;
1300 sv102
->hidden
= hidden
;
1301 sv102
->announce
= announce
;
1302 sv102
->ann_delta
=ann_delta
;
1303 sv102
->licenses
= licenses
;
1304 make_buf_unistr2(&(sv102
->uni_usr_path
), &(sv102
->ptr_usr_path
), usr_path
);
1308 /*******************************************************************
1309 reads or writes a SRV_INFO_102 structure.
1310 ********************************************************************/
1311 static void srv_io_info_102(char *desc
, SRV_INFO_102
*sv102
, prs_struct
*ps
, int depth
)
1313 if (sv102
== NULL
) return;
1315 prs_debug(ps
, depth
, desc
, "srv_io_info102");
1320 prs_uint32("platform_id ", ps
, depth
, &(sv102
->platform_id
));
1321 prs_uint32("ptr_name ", ps
, depth
, &(sv102
->ptr_name
));
1322 prs_uint32("ver_major ", ps
, depth
, &(sv102
->ver_major
));
1323 prs_uint32("ver_minor ", ps
, depth
, &(sv102
->ver_minor
));
1324 prs_uint32("srv_type ", ps
, depth
, &(sv102
->srv_type
));
1325 prs_uint32("ptr_comment ", ps
, depth
, &(sv102
->ptr_comment
));
1327 /* same as 101 up to here */
1329 prs_uint32("users ", ps
, depth
, &(sv102
->users
));
1330 prs_uint32("disc ", ps
, depth
, &(sv102
->disc
));
1331 prs_uint32("hidden ", ps
, depth
, &(sv102
->hidden
));
1332 prs_uint32("announce ", ps
, depth
, &(sv102
->announce
));
1333 prs_uint32("ann_delta ", ps
, depth
, &(sv102
->ann_delta
));
1334 prs_uint32("licenses ", ps
, depth
, &(sv102
->licenses
));
1335 prs_uint32("ptr_usr_path", ps
, depth
, &(sv102
->ptr_usr_path
));
1337 smb_io_unistr2("uni_name ", &(sv102
->uni_name
), True
, ps
, depth
);
1339 smb_io_unistr2("uni_comment ", &(sv102
->uni_comment
), True
, ps
, depth
);
1341 smb_io_unistr2("uni_usr_path", &(sv102
->uni_usr_path
), True
, ps
, depth
);
1344 /*******************************************************************
1345 reads or writes a SRV_INFO_102 structure.
1346 ********************************************************************/
1347 static void srv_io_info_ctr(char *desc
, SRV_INFO_CTR
*ctr
, prs_struct
*ps
, int depth
)
1349 if (ctr
== NULL
) return;
1351 prs_debug(ps
, depth
, desc
, "srv_io_info_ctr");
1356 prs_uint32("switch_value", ps
, depth
, &(ctr
->switch_value
));
1357 prs_uint32("ptr_srv_ctr ", ps
, depth
, &(ctr
->ptr_srv_ctr
));
1359 if (ctr
->ptr_srv_ctr
!= 0 && ctr
->switch_value
!= 0 && ctr
!= NULL
)
1361 switch (ctr
->switch_value
)
1365 srv_io_info_101("sv101", &(ctr
->srv
.sv101
), ps
, depth
);
1370 srv_io_info_102("sv102", &(ctr
->srv
.sv102
), ps
, depth
);
1375 DEBUG(5,("%s no server info at switch_value %d\n",
1376 tab_depth(depth
), ctr
->switch_value
));
1383 /*******************************************************************
1384 makes a SRV_Q_NET_SRV_GET_INFO structure.
1385 ********************************************************************/
1386 void make_srv_q_net_srv_get_info(SRV_Q_NET_SRV_GET_INFO
*srv
,
1387 char *server_name
, uint32 switch_value
)
1389 if (srv
== NULL
) return;
1391 DEBUG(5,("make_srv_q_net_srv_get_info\n"));
1393 make_buf_unistr2(&(srv
->uni_srv_name
), &(srv
->ptr_srv_name
), server_name
);
1395 srv
->switch_value
= switch_value
;
1398 /*******************************************************************
1399 reads or writes a structure.
1400 ********************************************************************/
1401 void srv_io_q_net_srv_get_info(char *desc
, SRV_Q_NET_SRV_GET_INFO
*q_n
, prs_struct
*ps
, int depth
)
1403 if (q_n
== NULL
) return;
1405 prs_debug(ps
, depth
, desc
, "srv_io_q_net_srv_get_info");
1410 prs_uint32("ptr_srv_name ", ps
, depth
, &(q_n
->ptr_srv_name
));
1411 smb_io_unistr2("", &(q_n
->uni_srv_name
), True
, ps
, depth
);
1415 prs_uint32("switch_value ", ps
, depth
, &(q_n
->switch_value
));
1418 /*******************************************************************
1419 makes a SRV_R_NET_SRV_GET_INFO structure.
1420 ********************************************************************/
1421 void make_srv_r_net_srv_get_info(SRV_R_NET_SRV_GET_INFO
*srv
,
1422 uint32 switch_value
, SRV_INFO_CTR
*ctr
, uint32 status
)
1424 if (srv
== NULL
) return;
1426 DEBUG(5,("make_srv_r_net_srv_get_info\n"));
1432 srv
->ctr
->switch_value
= switch_value
;
1433 srv
->ctr
->ptr_srv_ctr
= 1;
1437 srv
->ctr
->switch_value
= 0;
1438 srv
->ctr
->ptr_srv_ctr
= 0;
1441 srv
->status
= status
;
1444 /*******************************************************************
1445 reads or writes a structure.
1446 ********************************************************************/
1447 void srv_io_r_net_srv_get_info(char *desc
, SRV_R_NET_SRV_GET_INFO
*r_n
, prs_struct
*ps
, int depth
)
1449 if (r_n
== NULL
) return;
1451 prs_debug(ps
, depth
, desc
, "srv_io_r_net_srv_get_info");
1456 srv_io_info_ctr("ctr", r_n
->ctr
, ps
, depth
);
1458 prs_uint32("status ", ps
, depth
, &(r_n
->status
));
1462 /*******************************************************************
1463 reads or writes a structure.
1464 ********************************************************************/
1465 void srv_io_q_net_remote_tod(char *desc
, SRV_Q_NET_REMOTE_TOD
*q_n
, prs_struct
*ps
, int depth
)
1467 if (q_n
== NULL
) return;
1469 prs_debug(ps
, depth
, desc
, "srv_io_q_net_remote_tod");
1474 prs_uint32("ptr_srv_name ", ps
, depth
, &(q_n
->ptr_srv_name
));
1475 smb_io_unistr2("", &(q_n
->uni_srv_name
), True
, ps
, depth
);
1478 /*******************************************************************
1479 reads or writes a TIME_OF_DAY_INFO structure.
1480 ********************************************************************/
1481 static void srv_io_time_of_day_info(char *desc
, TIME_OF_DAY_INFO
*tod
, prs_struct
*ps
, int depth
)
1483 if (tod
== NULL
) return;
1485 prs_debug(ps
, depth
, desc
, "srv_io_time_of_day_info");
1490 prs_uint32("elapsedt ", ps
, depth
, &(tod
->elapsedt
));
1491 prs_uint32("msecs ", ps
, depth
, &(tod
->msecs
));
1492 prs_uint32("hours ", ps
, depth
, &(tod
->hours
));
1493 prs_uint32("mins ", ps
, depth
, &(tod
->mins
));
1494 prs_uint32("secs ", ps
, depth
, &(tod
->secs
));
1495 prs_uint32("hunds ", ps
, depth
, &(tod
->hunds
));
1496 prs_uint32("timezone ", ps
, depth
, &(tod
->zone
));
1497 prs_uint32("tintervals ", ps
, depth
, &(tod
->tintervals
));
1498 prs_uint32("day ", ps
, depth
, &(tod
->day
));
1499 prs_uint32("month ", ps
, depth
, &(tod
->month
));
1500 prs_uint32("year ", ps
, depth
, &(tod
->year
));
1501 prs_uint32("weekday ", ps
, depth
, &(tod
->weekday
));
1505 /*******************************************************************
1506 makes a TIME_OF_DAY_INFO structure.
1507 ********************************************************************/
1508 void make_time_of_day_info(TIME_OF_DAY_INFO
*tod
, uint32 elapsedt
, uint32 msecs
,
1509 uint32 hours
, uint32 mins
, uint32 secs
, uint32 hunds
,
1510 uint32 zone
, uint32 tintervals
, uint32 day
,
1511 uint32 month
, uint32 year
, uint32 weekday
)
1513 if (tod
== NULL
) return;
1515 DEBUG(5,("make_time_of_day_info\n"));
1517 tod
->elapsedt
= elapsedt
;
1524 tod
->tintervals
= tintervals
;
1528 tod
->weekday
= weekday
;
1532 /*******************************************************************
1533 reads or writes a structure.
1534 ********************************************************************/
1535 void srv_io_r_net_remote_tod(char *desc
, SRV_R_NET_REMOTE_TOD
*r_n
, prs_struct
*ps
, int depth
)
1537 if (r_n
== NULL
) return;
1539 prs_debug(ps
, depth
, desc
, "srv_io_r_net_remote_tod");
1544 prs_uint32("ptr_srv_tod ", ps
, depth
, &(r_n
->ptr_srv_tod
));
1546 srv_io_time_of_day_info("tod", r_n
->tod
, ps
, depth
);
1548 prs_uint32("status ", ps
, depth
, &(r_n
->status
));