a18b498ba5068098e990625d2b02b66575001f78
[tprouty/samba.git] / source / include / proto.h
1 #ifndef _PROTO_H_
2 #define _PROTO_H_
3 /* This file is automatically generated with "make proto". DO NOT EDIT */
4
5
6 /*The following definitions come from  client/client.c  */
7
8 void do_list(const char *mask,uint16 attribute,void (*fn)(file_info *),BOOL rec, BOOL dirs);
9 struct cli_state *do_connect(char *server, char *share, int smb_port);
10
11 /*The following definitions come from  client/clitar.c  */
12
13 void cmd_block(void);
14 void cmd_tarmode(void);
15 void cmd_setmode(void);
16 void cmd_tar(void);
17 int process_tar(void);
18 int tar_parseargs(int argc, char *argv[], char *Optarg, int Optind);
19
20 /*The following definitions come from  groupdb/aliasdb.c  */
21
22 BOOL initialise_alias_db(void);
23 LOCAL_GRP *iterate_getaliasgid(gid_t gid, LOCAL_GRP_MEMBER **mem, int *num_mem);
24 LOCAL_GRP *iterate_getaliasrid(uint32 rid, LOCAL_GRP_MEMBER **mem, int *num_mem);
25 LOCAL_GRP *iterate_getaliasntnam(const char *name, LOCAL_GRP_MEMBER **mem, int *num_mem);
26 BOOL add_domain_alias(LOCAL_GRP **alss, int *num_alss, LOCAL_GRP *als);
27 BOOL iterate_getuseraliasntnam(const char *user_name, LOCAL_GRP **alss, int *num_alss);
28 BOOL enumdomaliases(LOCAL_GRP **alss, int *num_alss);
29 void *startaliasent(BOOL update);
30 void endaliasent(void *vp);
31 LOCAL_GRP *getaliasent(void *vp, LOCAL_GRP_MEMBER **mem, int *num_mem);
32 BOOL add_alias_entry(LOCAL_GRP *newgrp);
33 BOOL mod_alias_entry(LOCAL_GRP* als);
34 BOOL del_alias_entry(uint32 rid);
35 BOOL add_alias_member(uint32 rid, DOM_SID *member_sid);
36 BOOL del_alias_member(uint32 rid, DOM_SID *member_sid);
37 LOCAL_GRP *getaliasntnam(const char *name, LOCAL_GRP_MEMBER **mem, int *num_mem);
38 LOCAL_GRP *getaliasrid(uint32 alias_rid, LOCAL_GRP_MEMBER **mem, int *num_mem);
39 LOCAL_GRP *getaliasgid(gid_t gid, LOCAL_GRP_MEMBER **mem, int *num_mem);
40 BOOL getuseraliasntnam(const char *user_name, LOCAL_GRP **als, int *num_alss);
41 void aldb_init_als(LOCAL_GRP *als);
42 BOOL make_alias_line(char *p, int max_len,
43                                 LOCAL_GRP *als,
44                                 LOCAL_GRP_MEMBER **mem, int *num_mem);
45
46 /*The following definitions come from  groupdb/aliasfile.c  */
47
48 struct aliasdb_ops *file_initialise_alias_db(void);
49
50 /*The following definitions come from  groupdb/aliasldap.c  */
51
52 struct aliasdb_ops *ldap_initialise_alias_db(void);
53
54 /*The following definitions come from  groupdb/aliasunix.c  */
55
56 BOOL get_unixalias_members(struct group *grp,
57                                 int *num_mem, LOCAL_GRP_MEMBER **members);
58 struct aliasdb_ops *unix_initialise_alias_db(void);
59
60 /*The following definitions come from  groupdb/builtindb.c  */
61
62 BOOL initialise_builtin_db(void);
63 LOCAL_GRP *iterate_getbuiltingid(gid_t gid, LOCAL_GRP_MEMBER **mem, int *num_mem);
64 LOCAL_GRP *iterate_getbuiltinrid(uint32 rid, LOCAL_GRP_MEMBER **mem, int *num_mem);
65 LOCAL_GRP *iterate_getbuiltinntnam(const char *name, LOCAL_GRP_MEMBER **mem, int *num_mem);
66 BOOL add_domain_builtin(LOCAL_GRP **blts, int *num_blts, LOCAL_GRP *blt);
67 BOOL iterate_getuserbuiltinntnam(const char *user_name, LOCAL_GRP **blts, int *num_blts);
68 BOOL enumdombuiltins(LOCAL_GRP **blts, int *num_blts);
69 void *startbuiltinent(BOOL update);
70 void endbuiltinent(void *vp);
71 LOCAL_GRP *getbuiltinent(void *vp, LOCAL_GRP_MEMBER **mem, int *num_mem);
72 BOOL add_builtin_entry(LOCAL_GRP *newblt);
73 BOOL mod_builtin_entry(LOCAL_GRP* blt);
74 BOOL add_builtin_member(uint32 rid, DOM_SID *member_sid);
75 BOOL del_builtin_member(uint32 rid, DOM_SID *member_sid);
76 LOCAL_GRP *getbuiltinntnam(const char *name, LOCAL_GRP_MEMBER **mem, int *num_mem);
77 LOCAL_GRP *getbuiltinrid(uint32 builtin_rid, LOCAL_GRP_MEMBER **mem, int *num_mem);
78 LOCAL_GRP *getbuiltingid(gid_t gid, LOCAL_GRP_MEMBER **mem, int *num_mem);
79 BOOL getuserbuiltinntnam(const char *user_name, LOCAL_GRP **blt, int *num_blts);
80 void bidb_init_blt(LOCAL_GRP *blt);
81 BOOL make_builtin_line(char *p, int max_len,
82                                 LOCAL_GRP *blt,
83                                 LOCAL_GRP_MEMBER **mem, int *num_mem);
84
85 /*The following definitions come from  groupdb/builtinldap.c  */
86
87 struct aliasdb_ops *ldap_initialise_builtin_db(void);
88
89 /*The following definitions come from  groupdb/builtinunix.c  */
90
91 BOOL get_unixbuiltin_members(struct group *grp,
92                                 int *num_mem, LOCAL_GRP_MEMBER **members);
93 struct aliasdb_ops *unix_initialise_builtin_db(void);
94
95 /*The following definitions come from  groupdb/groupdb.c  */
96
97 BOOL initialise_group_db(void);
98 DOMAIN_GRP *iterate_getgroupgid(gid_t gid, DOMAIN_GRP_MEMBER **mem, int *num_mem);
99 DOMAIN_GRP *iterate_getgrouprid(uint32 rid, DOMAIN_GRP_MEMBER **mem, int *num_mem);
100 DOMAIN_GRP *iterate_getgroupntnam(const char *name, DOMAIN_GRP_MEMBER **mem, int *num_mem);
101 BOOL add_domain_group(DOMAIN_GRP **grps, int *num_grps, DOMAIN_GRP *grp);
102 BOOL iterate_getusergroupsnam(const char *user_name, DOMAIN_GRP **grps, int *num_grps);
103 BOOL enumdomgroups(DOMAIN_GRP **grps, int *num_grps);
104 void *startgroupent(BOOL update);
105 void endgroupent(void *vp);
106 DOMAIN_GRP *getgroupent(void *vp, DOMAIN_GRP_MEMBER **mem, int *num_mem);
107 BOOL add_group_entry(DOMAIN_GRP *newgrp);
108 BOOL del_group_entry(uint32 rid);
109 BOOL mod_group_entry(DOMAIN_GRP* grp);
110 BOOL add_group_member(uint32 rid, uint32 member_rid);
111 BOOL del_group_member(uint32 rid, uint32 member_rid);
112 DOMAIN_GRP *getgroupntnam(const char *name, DOMAIN_GRP_MEMBER **mem, int *num_mem);
113 DOMAIN_GRP *getgrouprid(uint32 group_rid, DOMAIN_GRP_MEMBER **mem, int *num_mem);
114 DOMAIN_GRP *getgroupgid(gid_t gid, DOMAIN_GRP_MEMBER **mem, int *num_mem);
115 BOOL getusergroupsntnam(const char *user_name, DOMAIN_GRP **grp, int *num_grps);
116 void gpdb_init_grp(DOMAIN_GRP *grp);
117 BOOL make_group_line(char *p, int max_len,
118                                 DOMAIN_GRP *grp,
119                                 DOMAIN_GRP_MEMBER **mem, int *num_mem);
120
121 /*The following definitions come from  groupdb/groupfile.c  */
122
123 struct groupdb_ops *file_initialise_group_db(void);
124
125 /*The following definitions come from  groupdb/groupldap.c  */
126
127 struct groupdb_ops *ldap_initialise_group_db(void);
128
129 /*The following definitions come from  groupdb/groupunix.c  */
130
131 BOOL get_unixgroup_members(struct group *grp,
132                                 int *num_mem, DOMAIN_GRP_MEMBER **members);
133 struct groupdb_ops *unix_initialise_group_db(void);
134
135 /*The following definitions come from  lib/access.c  */
136
137 BOOL allow_access(char *deny_list,char *allow_list,
138                   char *cname,char *caddr);
139 BOOL check_access(int sock, char *allow_list, char *deny_list);
140
141 /*The following definitions come from  lib/bitmap.c  */
142
143 struct bitmap *bitmap_allocate(int n);
144 BOOL bitmap_set(struct bitmap *bm, unsigned i);
145 BOOL bitmap_clear(struct bitmap *bm, unsigned i);
146 BOOL bitmap_query(struct bitmap *bm, unsigned i);
147 int bitmap_find(struct bitmap *bm, unsigned ofs);
148
149 /*The following definitions come from  lib/charcnv.c  */
150
151 char *unix2dos_format(char *str,BOOL overwrite);
152 char *dos2unix_format(char *str, BOOL overwrite);
153 void interpret_character_set(char *str);
154
155 /*The following definitions come from  lib/charset.c  */
156
157 void charset_initialise(void);
158 void codepage_initialise(int client_codepage);
159 void add_char_string(char *s);
160
161 /*The following definitions come from  lib/crc32.c  */
162
163 uint32 crc32_calc_buffer( uint32 count, char *buffer);
164
165 /*The following definitions come from  lib/debug.c  */
166
167 BOOL dbg_interactive(void);
168 void sig_usr2( int sig );
169 void sig_usr1( int sig );
170 void setup_logging( char *pname, BOOL interactive );
171 void reopen_logs( void );
172 void force_check_log_size( void );
173 void dbgflush( void );
174 BOOL dbghdr( int level, char *file, char *func, int line );
175 dbg_Token dbg_char2token( dbg_Token *state, int c );
176
177 /*The following definitions come from  lib/domain_namemap.c  */
178
179 BOOL pwdb_rid_is_user(uint32 rid);
180 BOOL map_unix_group_name(char *group_name, DOM_NAME_MAP *grp_info);
181 BOOL map_unix_alias_name(char *alias_name, DOM_NAME_MAP *grp_info);
182 BOOL map_nt_alias_name(char *ntalias_name, char *nt_domain, DOM_NAME_MAP *grp_info);
183 BOOL map_nt_group_name(char *ntgroup_name, char *nt_domain, DOM_NAME_MAP *grp_info);
184 BOOL map_alias_sid(DOM_SID *psid, DOM_NAME_MAP *grp_info);
185 BOOL map_group_sid(DOM_SID *psid, DOM_NAME_MAP *grp_info);
186 BOOL lookupsmbpwnam(const char *unix_usr_name, DOM_NAME_MAP *grp);
187 BOOL lookupsmbpwuid(uid_t uid, DOM_NAME_MAP *gmep);
188 BOOL lookupsmbpwntnam(const char *fullntname, DOM_NAME_MAP *gmep);
189 BOOL lookupsmbpwsid(DOM_SID *sid, DOM_NAME_MAP *gmep);
190 BOOL lookupsmbgrpnam(const char *unix_grp_name, DOM_NAME_MAP *grp);
191 BOOL lookupsmbgrpsid(DOM_SID *sid, DOM_NAME_MAP *gmep);
192 BOOL lookupsmbgrpgid(gid_t gid, DOM_NAME_MAP *gmep);
193
194 /*The following definitions come from  lib/doscalls.c  */
195
196 int dos_unlink(char *fname);
197 int dos_open(char *fname,int flags,mode_t mode);
198 DIR *dos_opendir(char *dname);
199 char *dos_readdirname(DIR *p);
200 int dos_stat(char *fname,SMB_STRUCT_STAT *sbuf);
201 int dos_lstat(char *fname,SMB_STRUCT_STAT *sbuf);
202 int dos_mkdir(char *dname,mode_t mode);
203 int dos_rmdir(char *dname);
204 int dos_chdir(char *dname);
205 int dos_utime(char *fname,struct utimbuf *times);
206 int copy_reg(char *source, const char *dest);
207 int dos_rename(char *from, char *to);
208 int dos_chmod(char *fname,mode_t mode);
209 char *dos_getwd(char *unix_path);
210 BOOL dos_file_exist(char *fname,SMB_STRUCT_STAT *sbuf);
211 BOOL dos_directory_exist(char *dname,SMB_STRUCT_STAT *st);
212 time_t dos_file_modtime(char *fname);
213 SMB_OFF_T dos_file_size(char *file_name);
214 int dos_ChDir(char *path);
215 char *dos_GetWd(char *path);
216
217 /*The following definitions come from  lib/fault.c  */
218
219 void fault_setup(void (*fn)(void *));
220
221 /*The following definitions come from  lib/genrand.c  */
222
223 void generate_random_buffer( unsigned char *out, int len, BOOL re_seed);
224
225 /*The following definitions come from  lib/getsmbpass.c  */
226
227 char *getsmbpass(char *prompt)    ;
228
229 /*The following definitions come from  lib/hmacmd5.c  */
230
231 void hmac_md5_init_rfc2104(uchar*  key, int key_len, HMACMD5Context *ctx);
232 void hmac_md5_init_limK_to_64(const uchar* key, int key_len,
233                         HMACMD5Context *ctx);
234 void hmac_md5_update(const uchar* text, int text_len, HMACMD5Context *ctx);
235 void hmac_md5_final(uchar *digest, HMACMD5Context *ctx);
236
237 /*The following definitions come from  lib/interface.c  */
238
239 void load_interfaces(void);
240 void iface_set_default(char *ip,char *bcast,char *nmask);
241 BOOL ismyip(struct in_addr ip);
242 BOOL is_local_net(struct in_addr from);
243 int iface_count(void);
244 BOOL we_are_multihomed(void);
245 struct interface *get_interface(int n);
246 struct in_addr *iface_n_ip(int n);
247 unsigned iface_hash(void);
248 struct in_addr *iface_bcast(struct in_addr ip);
249 struct in_addr *iface_ip(struct in_addr ip);
250
251 /*The following definitions come from  lib/kanji.c  */
252
253 void interpret_coding_system(char *str);
254 BOOL is_multibyte_codepage(void);
255 void initialize_multibyte_vectors( int client_codepage);
256
257 /*The following definitions come from  lib/md4.c  */
258
259 void mdfour(unsigned char *out, const unsigned char *in, int n);
260
261 /*The following definitions come from  lib/md5.c  */
262
263 void MD5Init(struct MD5Context *ctx);
264 void MD5Update(struct MD5Context *ctx, uchar const *buf, unsigned len);
265 void MD5Final(uchar digest[16], struct MD5Context *ctx);
266 void MD5Transform(uint32 buf[4], const uchar inext[64]);
267
268 /*The following definitions come from  lib/membuffer.c  */
269
270 void mem_init(struct mem_buf *buf, int margin);
271 void mem_create(struct mem_buf *buf, char *data, int offset, int size, int margin, BOOL dynamic);
272 BOOL mem_alloc_data(struct mem_buf *buf, int size);
273 BOOL mem_buf_copy(char *copy_into, struct mem_buf *buf,
274                                 uint32 offset, uint32 len);
275 BOOL mem_buf_init(struct mem_buf **buf, uint32 margin);
276 void mem_buf_free(struct mem_buf **buf);
277 void mem_free_data(struct mem_buf *buf);
278 BOOL mem_realloc_data(struct mem_buf *buf, size_t new_size);
279 BOOL mem_grow_data(struct mem_buf **buf, BOOL io, int new_size, BOOL force_grow);
280 uint32 mem_buf_len(struct mem_buf *buf);
281 char *mem_data(struct mem_buf **buf, uint32 offset);
282
283 /*The following definitions come from  lib/msrpc-agent.c  */
284
285 void start_msrpc_agent(char *pipe_name);
286
287 /*The following definitions come from  lib/msrpc-client.c  */
288
289 BOOL msrpc_receive(struct msrpc_state *msrpc);
290 BOOL msrpc_send_prs(struct msrpc_state *msrpc, prs_struct *ps);
291 BOOL msrpc_receive_prs(struct msrpc_state *msrpc, prs_struct *ps);
292 BOOL msrpc_send(struct msrpc_state *msrpc, BOOL show);
293 BOOL msrpc_connect(struct msrpc_state *msrpc, const char *pipe_name);
294 void msrpc_init_creds(struct msrpc_state *msrpc, const struct user_creds *usr);
295 void msrpc_close_socket(struct msrpc_state *msrpc);
296 void msrpc_sockopt(struct msrpc_state *msrpc, char *options);
297 BOOL msrpc_connect_auth(struct msrpc_state *msrpc,
298                                 const char* pipename,
299                                 const struct user_creds *usr);
300 struct msrpc_state *msrpc_initialise(struct msrpc_state *msrpc);
301 void msrpc_shutdown(struct msrpc_state *msrpc);
302 BOOL msrpc_establish_connection(struct msrpc_state *msrpc,
303                 const char *pipe_name);
304
305 /*The following definitions come from  lib/msrpc_use.c  */
306
307 void init_msrpc_use(void);
308 void free_msrpc_use(void);
309 struct msrpc_state *msrpc_use_add(const char* pipe_name,
310                                 const struct user_creds *usr_creds,
311                                 BOOL redir);
312 BOOL msrpc_use_del(const char* pipe_name,
313                                 const struct user_creds *usr_creds,
314                                 BOOL force_close,
315                                 BOOL *connection_closed);
316 void msrpc_net_use_enum(uint32 *num_cons, struct use_info ***use);
317
318 /*The following definitions come from  lib/netmask.c  */
319
320 int get_netmask(struct in_addr *ipaddr, struct in_addr *nmask);
321
322 /*The following definitions come from  lib/passcheck.c  */
323
324 BOOL smb_password_ok(struct smb_passwd *smb_pass, uchar challenge[8],
325                                 const char *user, const char *domain,
326                                 uchar *lm_pass, size_t lm_pwd_len,
327                                 uchar *nt_pass, size_t nt_pwd_len,
328                                 uchar sess_key[16]);
329 BOOL pass_check_smb(struct smb_passwd *smb_pass, char *domain, uchar *chal,
330                 uchar *lm_pwd, size_t lm_pwd_len,
331                 uchar *nt_pwd, size_t nt_pwd_len,
332                 struct passwd *pwd, uchar user_sess_key[16]);
333
334 /*The following definitions come from  lib/pidfile.c  */
335
336 pid_t pidfile_pid(char *name);
337 void pidfile_create(char *name);
338
339 /*The following definitions come from  lib/replace.c  */
340
341 char *rep_inet_ntoa(struct in_addr ip);
342
343 /*The following definitions come from  lib/sids.c  */
344
345 struct sid_map* add_sidmap_to_array(uint32 *len, struct sid_map ***array,
346                                 const struct sid_map *name);
347 void get_sam_domain_name(void);
348 BOOL get_member_domain_sid(void);
349 void generate_wellknown_sids(void);
350 BOOL create_sidmap_table(void);
351 BOOL generate_sam_sid(char *domain_name, DOM_SID *sid);
352 BOOL map_domain_name_to_sid(DOM_SID *sid, char **nt_domain);
353 BOOL map_domain_sid_to_name(DOM_SID *sid, char *nt_domain);
354 BOOL map_domain_sid_to_any_dc(DOM_SID *sid, char *dc_name);
355 BOOL split_domain_name(const char *fullname, char *domain, char *name);
356 BOOL enumtrustdoms(char ***doms, uint32 *num_entries);
357 BOOL enumdomains(char ***doms, uint32 *num_entries);
358
359 /*The following definitions come from  lib/signal.c  */
360
361 void BlockSignals(BOOL block,int signum);
362 void CatchSignal(int signum,void (*handler)(int ));
363 void CatchChild(void);
364
365 /*The following definitions come from  lib/slprintf.c  */
366
367 int vslprintf(char *str, int n, char *format, va_list ap);
368
369 /*The following definitions come from  lib/smbrun.c  */
370
371 int smbrun(char *cmd,char *outfile,BOOL shared);
372
373 /*The following definitions come from  lib/snprintf.c  */
374
375
376 /*The following definitions come from  lib/system.c  */
377
378 int sys_select(int maxfd, fd_set *fds, fd_set *w_fds, struct timeval *tval);
379 int sys_select(int maxfd, fd_set *r_fds, fd_set *w_fds, struct timeval *tval);
380 int sys_stat(const char *fname,SMB_STRUCT_STAT *sbuf);
381 int sys_fstat(int fd,SMB_STRUCT_STAT *sbuf);
382 int sys_lstat(const char *fname,SMB_STRUCT_STAT *sbuf);
383 int sys_ftruncate(int fd, SMB_OFF_T offset);
384 SMB_OFF_T sys_lseek(int fd, SMB_OFF_T offset, int whence);
385 int sys_fseek(FILE *fp, SMB_OFF_T offset, int whence);
386 SMB_OFF_T sys_ftell(FILE *fp);
387 int sys_creat(const char *path, mode_t mode);
388 int sys_open(const char *path, int oflag, mode_t mode);
389 FILE *sys_fopen(const char *path, const char *type);
390 void *sys_mmap(void *addr, size_t len, int prot, int flags, int fd, SMB_OFF_T offset);
391 int sys_waitpid(pid_t pid,int *status,int options);
392 char *sys_getwd(char *s);
393 int sys_chown(const char *fname,uid_t uid,gid_t gid);
394 int sys_chroot(const char *dname);
395 struct hostent *sys_gethostbyname(const char *name);
396 BOOL set_process_capability( uint32 cap_flag, BOOL enable );
397 BOOL set_inherited_process_capability( uint32 cap_flag, BOOL enable );
398 long sys_random(void);
399 void sys_srandom(unsigned int seed);
400 int sys_getgroups(int setlen, gid_t *gidset);
401 struct passwd *copy_passwd_struct(struct passwd *pass);
402 struct passwd *sys_getpwnam(const char *name);
403 struct passwd *sys_getpwuid(uid_t uid);
404
405 /*The following definitions come from  lib/time.c  */
406
407 void GetTimeOfDay(struct timeval *tval);
408 void TimeInit(void);
409 int TimeDiff(time_t t);
410 struct tm *LocalTime(time_t *t);
411 time_t nt_time_to_unix(const NTTIME *nt);
412 time_t interpret_long_date(char *p);
413 void unix_to_nt_time(NTTIME *nt, time_t t);
414 void init_nt_time(NTTIME *nt);
415 void put_long_date(char *p,time_t t);
416 BOOL null_mtime(time_t mtime);
417 void put_dos_date(char *buf,int offset,time_t unixdate);
418 void put_dos_date2(char *buf,int offset,time_t unixdate);
419 void put_dos_date3(char *buf,int offset,time_t unixdate);
420 time_t make_unix_date(void *date_ptr);
421 time_t make_unix_date2(void *date_ptr);
422 time_t make_unix_date3(void *date_ptr);
423 char *http_timestring(time_t t);
424 char *timestring(void );
425 time_t get_create_time(SMB_STRUCT_STAT *st,BOOL fake_dirs);
426
427 /*The following definitions come from  lib/ufc.c  */
428
429 char *ufc_crypt(char *key,char *salt);
430
431 /*The following definitions come from  lib/username.c  */
432
433 struct passwd *hashed_getpwnam(const char *name);
434 char *uidtoname(uid_t uid);
435 char *get_home_dir(char *user);
436 BOOL map_username(char *user);
437 const struct passwd *Get_Pwnam(char *user,BOOL allow_change);
438 BOOL user_ok(char *user,int snum);
439 BOOL user_in_list(char *user,char *list);
440
441 /*The following definitions come from  lib/util.c  */
442
443 BOOL init_myworkgroup(void);
444 char *tmpdir(void);
445 BOOL in_group(gid_t group, gid_t current_gid, int ngroups, gid_t *groups);
446 uint32 get_number(const char *tmp);
447 char *Atoic(char *p, int *n, char *c);
448 uint32 *add_num_to_list(uint32 **num, int *count, int val);
449 char *get_numlist(char *p, uint32 **num, int *count);
450 void putip(void *dest,void *src);
451 char *dns_to_netbios_name(char *dns_name);
452 int name_mangle( char *In, char *Out, char name_type );
453 BOOL file_exist(char *fname,SMB_STRUCT_STAT *sbuf);
454 int file_rename(char *from, char *to);
455 time_t file_modtime(char *fname);
456 BOOL directory_exist(char *dname,SMB_STRUCT_STAT *st);
457 SMB_OFF_T file_size(char *file_name);
458 char *attrib_string(uint16 mode);
459 void unix_format(char *fname);
460 void dos_format(char *fname);
461 void show_msg(char *buf);
462 int smb_len(char *buf);
463 void _smb_setlen(char *buf,int len);
464 void smb_setlen(char *buf,int len);
465 int set_message(char *buf,int num_words,int num_bytes,BOOL zero);
466 int smb_buflen(char *buf);
467 char *smb_buf(char *buf);
468 int smb_offset(char *p,char *buf);
469 void dos_clean_name(char *s);
470 void unix_clean_name(char *s);
471 BOOL reduce_name(char *s,char *dir,BOOL widelinks);
472 void expand_mask(char *Mask,BOOL doext);
473 void make_dir_struct(char *buf,char *mask,char *fname,SMB_OFF_T size,int mode,time_t date);
474 void close_low_fds(void);
475 int set_blocking(int fd, BOOL set);
476 int TvalDiff(struct timeval *tvalold,struct timeval *tvalnew);
477 SMB_OFF_T transfer_file(int infd,int outfd,SMB_OFF_T n,char *header,int headlen,int align);
478 int name_extract(char *buf,int ofs,char *name);
479 int name_len(char *s1);
480 void msleep(int t);
481 BOOL do_match(char *str, char *regexp, int case_sig);
482 BOOL mask_match(char *str, char *regexp, int case_sig,BOOL trans2);
483 void become_daemon(void);
484 BOOL yesno(char *p);
485 int set_filelen(int fd, SMB_OFF_T len);
486 void *Realloc(void *p,size_t size);
487 BOOL get_myname(char *my_name,struct in_addr *ip);
488 BOOL ip_equal(struct in_addr ip1,struct in_addr ip2);
489 int interpret_protocol(char *str,int def);
490 uint32 interpret_addr(char *str);
491 struct in_addr *interpret_addr2(char *str);
492 BOOL zero_ip(struct in_addr ip);
493 BOOL matchname(char *remotehost,struct in_addr  addr);
494 void standard_sub_basic(char *str);
495 void standard_sub(connection_struct *conn,char *str);
496 BOOL same_net(struct in_addr ip1,struct in_addr ip2,struct in_addr mask);
497 struct hostent *Get_Hostbyname(const char *name);
498 BOOL process_exists(int pid);
499 int get_unixgroups(char *user, uid_t uid, gid_t gid, int *p_ngroups, gid_t **p_groups);
500 BOOL get_unix_grps(int *p_ngroups, struct group **p_groups);
501 void free_unix_grps(int ngroups, struct group *p_groups);
502 char *gidtoname(gid_t gid);
503 BOOL nametogid(const char *name, gid_t *gid);
504 BOOL nametouid(const char *name, uid_t *uid);
505 void smb_panic(char *why);
506 char *readdirname(DIR *p);
507 BOOL is_in_path(char *name, name_compare_entry *namelist);
508 void set_namearray(name_compare_entry **ppname_array, char *namelist);
509 void free_namearray(name_compare_entry *name_array);
510 BOOL fcntl_lock(int fd, int op, SMB_OFF_T offset, SMB_OFF_T count, int type);
511 BOOL is_myname(char *s);
512 void set_remote_arch(enum remote_arch_types type);
513 enum remote_arch_types get_remote_arch(void);
514 char *align4(char *q, char *base);
515 char *align2(char *q, char *base);
516 void out_ascii(FILE *f, const unsigned char *buf,int len);
517 void out_struct(FILE *f, const char *buf1,int len, int per_line);
518 void out_data(FILE *f, const char *buf1,int len, int per_line);
519 void print_asc(int level, unsigned char const *buf,int len);
520 void dump_data(int level, const char *buf1, int len);
521 char *tab_depth(int depth);
522 int str_checksum(const char *s);
523 void zero_free(void *p, size_t size);
524 int set_maxfiles(int requested_max);
525 void reg_get_subkey(char *full_keyname, char *key_name, char *subkey_name);
526 BOOL reg_split_key(const char *full_keyname, uint32 *reg_type, char *key_name);
527 BOOL become_user_permanently(uid_t uid, gid_t gid);
528 char *get_trusted_serverlist(const char* domain);
529
530 /*The following definitions come from  lib/util_array.c  */
531
532 void free_void_array(uint32 num_entries, void **entries,
533                 void(free_item)(void*));
534 void* add_copy_to_array(uint32 *len, void ***array, const void *item,
535         void*(item_dup)(const void*), BOOL alloc_anyway);
536 void* add_item_to_array(uint32 *len, void ***array, void *item);
537 void free_use_info_array(uint32 num_entries, struct use_info **entries);
538 struct use_info* add_use_info_to_array(uint32 *len, struct use_info ***array,
539                                 const struct use_info *name);
540 void free_char_array(uint32 num_entries, char **entries);
541 char* add_chars_to_array(uint32 *len, char ***array, const char *name);
542 void free_uint32_array(uint32 num_entries, uint32 **entries);
543 uint32* add_uint32s_to_array(uint32 *len, uint32 ***array, const uint32 *name);
544 void free_unistr_array(uint32 num_entries, UNISTR2 **entries);
545 UNISTR2* add_unistr_to_array(uint32 *len, UNISTR2 ***array, UNISTR2 *name);
546 void free_sid_array(uint32 num_entries, DOM_SID **entries);
547 DOM_SID* add_sid_to_array(uint32 *len, DOM_SID ***array, const DOM_SID *sid);
548 void free_devmode(DEVICEMODE *devmode);
549 void free_printer_info_2(PRINTER_INFO_2 *printer);
550 void free_print2_array(uint32 num_entries, PRINTER_INFO_2 **entries);
551 PRINTER_INFO_2 *add_print2_to_array(uint32 *len, PRINTER_INFO_2 ***array,
552                                 const PRINTER_INFO_2 *prt);
553 void free_print1_array(uint32 num_entries, PRINTER_INFO_1 **entries);
554 PRINTER_INFO_1 *add_print1_to_array(uint32 *len, PRINTER_INFO_1 ***array,
555                                 const PRINTER_INFO_1 *prt);
556 void free_job1_array(uint32 num_entries, JOB_INFO_1 **entries);
557 JOB_INFO_1 *add_job1_to_array(uint32 *len, JOB_INFO_1 ***array,
558                                 const JOB_INFO_1 *job);
559 void free_job2_array(uint32 num_entries, JOB_INFO_2 **entries);
560 JOB_INFO_2 *add_job2_to_array(uint32 *len, JOB_INFO_2 ***array,
561                                 const JOB_INFO_2 *job);
562
563 /*The following definitions come from  lib/util_file.c  */
564
565 BOOL do_file_lock(int fd, int waitsecs, int type);
566 BOOL file_lock(int fd, int type, int secs, int *plock_depth);
567 BOOL file_unlock(int fd, int *plock_depth);
568 void *startfileent(char *pfile, char *s_readbuf, int bufsize,
569                                 int *file_lock_depth, BOOL update);
570 void endfileent(void *vp, int *file_lock_depth);
571 SMB_BIG_UINT getfilepwpos(void *vp);
572 BOOL setfilepwpos(void *vp, SMB_BIG_UINT tok);
573 int getfileline(void *vp, char *linebuf, int linebuf_size);
574 char *fgets_slash(char *s2,int maxlen,FILE *f);
575 BOOL file_modified(const char *filename, time_t *lastmodified);
576 void *open_file_if_modified(const char *filename, char *mode, time_t *lastmodified);
577
578 /*The following definitions come from  lib/util_hnd.c  */
579
580 BOOL init_policy_hnd(int num_pol_hnds);
581 BOOL register_policy_hnd(POLICY_HND *hnd);
582 BOOL open_policy_hnd(POLICY_HND *hnd);
583 int find_policy_by_hnd(const POLICY_HND *hnd);
584 BOOL set_policy_samr_rid(POLICY_HND *hnd, uint32 rid);
585 BOOL set_policy_samr_pol_status(POLICY_HND *hnd, uint32 pol_status);
586 BOOL set_policy_samr_sid(POLICY_HND *hnd, DOM_SID *sid);
587 BOOL get_policy_samr_sid(POLICY_HND *hnd, DOM_SID *sid);
588 uint32 get_policy_samr_rid(POLICY_HND *hnd);
589 BOOL set_policy_reg_name(POLICY_HND *hnd, fstring name);
590 BOOL get_policy_reg_name(POLICY_HND *hnd, fstring name);
591 BOOL set_policy_con(POLICY_HND *hnd, struct cli_connection *con,
592                                 void (*free_fn)(struct cli_connection *));
593 BOOL get_policy_con(const POLICY_HND *hnd, struct cli_connection **con);
594 BOOL close_policy_hnd(POLICY_HND *hnd);
595
596 /*The following definitions come from  lib/util_pwdb.c  */
597
598 uint32 lookup_wk_group_name(const char *group_name, const char *domain,
599                                 DOM_SID *sid, uint8 *type);
600 uint32 lookup_wk_user_name(const char *user_name, const char *domain,
601                                 DOM_SID *sid, uint8 *type);
602 uint32 lookup_builtin_alias_name(const char *alias_name, const char *domain,
603                                 DOM_SID *sid, uint8 *type);
604 char *pwdb_encode_acct_ctrl(uint16 acct_ctrl, size_t length);
605 uint16 pwdb_decode_acct_ctrl(const char *p);
606 time_t pwdb_get_last_set_time(const char *p);
607 void pwdb_set_logon_time(char *p, int max_len, time_t t);
608 void pwdb_set_logoff_time(char *p, int max_len, time_t t);
609 void pwdb_set_kickoff_time(char *p, int max_len, time_t t);
610 void pwdb_set_can_change_time(char *p, int max_len, time_t t);
611 void pwdb_set_must_change_time(char *p, int max_len, time_t t);
612 void pwdb_set_last_set_time(char *p, int max_len, time_t t);
613 void pwdb_sethexpwd(char *p, const char *pwd, uint16 acct_ctrl);
614 BOOL pwdb_gethexpwd(const char *p, char *pwd, uint32 *acct_ctrl);
615 BOOL pwdb_initialise(BOOL is_server);
616 char *lookup_wk_alias_rid(uint32 rid);
617 char *lookup_wk_user_rid(uint32 rid);
618 char *lookup_wk_group_rid(uint32 rid);
619
620 /*The following definitions come from  lib/util_sid.c  */
621
622 char *sid_to_string(pstring sidstr_out, const DOM_SID *sid);
623 BOOL string_to_sid(DOM_SID *sidout, const char *sidstr);
624 BOOL sid_append_rid(DOM_SID *sid, uint32 rid);
625 BOOL sid_split_rid(DOM_SID *sid, uint32 *rid);
626 void sid_copy(DOM_SID *sid1, const DOM_SID *sid2);
627 BOOL sid_front_equal(const DOM_SID *sid1, const DOM_SID *sid2);
628 BOOL sid_equal(const DOM_SID *sid1, const DOM_SID *sid2);
629 int sid_size(const DOM_SID *sid);
630 DOM_SID *sid_dup(const DOM_SID *src);
631 BOOL read_sid(char *domain_name, DOM_SID *sid);
632 BOOL write_sid(char *domain_name, DOM_SID *sid);
633 BOOL create_new_sid(DOM_SID *sid);
634
635 /*The following definitions come from  lib/util_sock.c  */
636
637 BOOL is_a_socket(int fd);
638 void set_socket_options(int fd, char *options);
639 void close_sockets(void );
640 ssize_t write_socket(int fd,char *buf,size_t len);
641 ssize_t read_udp_socket(int fd,char *buf,size_t len);
642 ssize_t read_with_timeout(int fd,char *buf,size_t mincnt,size_t maxcnt,unsigned int time_out);
643 BOOL send_keepalive(int client);
644 ssize_t read_data(int fd,char *buffer,size_t N);
645 ssize_t write_data(int fd,char *buffer,size_t N);
646 ssize_t read_smb_length(int fd,char *inbuf,unsigned int timeout);
647 BOOL receive_smb(int fd,char *buffer, unsigned int timeout);
648 BOOL client_receive_smb(int fd,char *buffer, unsigned int timeout);
649 BOOL send_smb(int fd,char *buffer);
650 BOOL send_one_packet(char *buf,int len,struct in_addr ip,int port,int type);
651 int open_socket_in(int type, int port, int dlevel,uint32 socket_addr);
652 int open_socket_out(int type, struct in_addr *addr, int port ,int timeout);
653 void reset_globals_after_fork(void);
654 char *client_name(int fd);
655 char *client_addr(int fd);
656 int open_pipe_sock(char *path);
657 int create_pipe_socket(char *dir, int dir_perms,
658                                 char *path, int path_perms);
659
660 /*The following definitions come from  lib/util_status.c  */
661
662 BOOL get_connection_status(struct connect_record **crec,
663                                 uint32 *connection_count);
664 BOOL get_session_count(struct connect_record **srec,uint32 *session_count);
665
666 /*The following definitions come from  lib/util_str.c  */
667
668 void set_first_token(char *ptr);
669 BOOL next_token(char **ptr,char *buff,char *sep, size_t bufsize);
670 char **toktocliplist(int *ctok, char *sep);
671 int StrCaseCmp(const char *s, const char *t);
672 int StrnCaseCmp(const char *s, const char *t, size_t n);
673 BOOL strequal(const char *s1, const char *s2);
674 BOOL strnequal(const char *s1,const char *s2,size_t n);
675 BOOL strcsequal(const char *s1,const char *s2);
676 void strlower(char *s);
677 void strupper(char *s);
678 void strnorm(char *s);
679 BOOL strisnormal(char *s);
680 void string_replace(char *s,char oldc,char newc);
681 char *skip_string(char *buf,size_t n);
682 size_t str_charnum(const char *s);
683 BOOL trim_string(char *s,const char *front,const char *back);
684 BOOL strhasupper(const char *s);
685 BOOL strhaslower(const char *s);
686 size_t count_chars(const char *s,char c);
687 char *safe_strcpy(char *dest,const char *src, size_t maxlength);
688 char *safe_strcat(char *dest, const char *src, size_t maxlength);
689 char *StrCpy(char *dest,const char *src);
690 char *StrnCpy(char *dest,const char *src,size_t n);
691 char *strncpyn(char *dest, char *src,size_t n, char c);
692 size_t strhex_to_str(char *p, size_t len, const char *strhex);
693 BOOL in_list(char *s,char *list,BOOL casesensitive);
694 BOOL string_init(char **dest,const char *src);
695 void string_free(char **s);
696 BOOL string_set(char **dest,const char *src);
697 void string_sub(char *s,const char *pattern,const char *insert);
698 void all_string_sub(char *s,const char *pattern,const char *insert);
699 void split_at_first_component(char *path, char *front, char sep, char *back);
700 void split_at_last_component(char *path, char *front, char sep, char *back);
701 char *bit_field_to_str(uint32 type, struct field_info *bs);
702 char *enum_field_to_str(uint32 type, struct field_info *bs, BOOL first_default);
703
704 /*The following definitions come from  lib/util_unistr.c  */
705
706 char *ascii_to_unibuf(char *dest, const char *src, int maxlen);
707 const char* unibuf_to_ascii(char *dest, const char *src, int maxlen);
708 void ascii_to_unistr(uint16 *dest, const char *src, int maxlen);
709 void unistr_to_ascii(char *dest, const uint16 *src, int len);
710 void unistr2_to_ascii(char *dest, const UNISTR2 *str, size_t maxlen);
711 char *skip_unibuf(char *srcbuf, int len);
712 char *uni_strncpy(char *destbuf, const char *srcbuf, int len);
713 uint32 buffer2_to_uint32(const BUFFER2 *str);
714 void buffer2_to_multistr(char *dest, const BUFFER2 *str, size_t maxlen);
715 void buffer4_to_str(char *dest, const BUFFER4 *str, size_t maxlen);
716 BOOL copy_unistr2(UNISTR2 *str, const UNISTR2 *from);
717 UNISTR2 *unistr2_dup(const UNISTR2 *name);
718 void unistr2_free(UNISTR2 *name);
719
720 /*The following definitions come from  lib/vagent.c  */
721
722 void init_sock_redir(struct vagent_ops*va);
723 void free_sock_redir(struct vagent_ops*va);
724 void start_agent(struct vagent_ops *va);
725
726 /*The following definitions come from  lib/vuser.c  */
727
728 user_struct *get_valid_user_struct(uint16 vuid);
729 void invalidate_vuid(uint16 vuid);
730 char *validated_username(uint16 vuid);
731 uint16 register_vuid(uid_t uid,gid_t gid, char *unix_name, char *requested_name, BOOL guest, uchar user_sess_key[16]);
732
733 /*The following definitions come from  libsmb/clientgen.c  */
734
735 int cli_set_port(struct cli_state *cli, int port);
736 char *cli_errstr(struct cli_state *cli);
737 void cli_safe_smb_errstr(struct cli_state *cli, char *msg, size_t len);
738 BOOL get_safe_rap_errstr(int rap_error, char *err_msg, size_t msglen);
739 void cli_safe_errstr(struct cli_state *cli, char *err_msg, size_t msglen);
740 BOOL cli_send_trans(struct cli_state *cli, int trans, 
741                            char *name, int pipe_name_len, 
742                            int fid, int flags,
743                            uint16 *setup, int lsetup, int msetup,
744                            char *param, int lparam, int mparam,
745                            char *data, int ldata, int mdata);
746 BOOL cli_api_pipe(struct cli_state *cli, char *pipe_name, int pipe_name_len,
747                   uint16 *setup, uint32 setup_count, uint32 max_setup_count,
748                   char *params, uint32 param_count, uint32 max_param_count,
749                   char *data, uint32 data_count, uint32 max_data_count,
750                   char **rparam, uint32 *rparam_count,
751                   char **rdata, uint32 *rdata_count);
752 BOOL cli_api(struct cli_state *cli,
753              char *param, int prcnt, int mprcnt,
754              char *data, int drcnt, int mdrcnt,
755              char **rparam, int *rprcnt,
756              char **rdata, int *rdrcnt);
757 BOOL cli_NetWkstaUserLogon(struct cli_state *cli,char *user, char *workstation);
758 BOOL cli_RNetShareEnum(struct cli_state *cli, void (*fn)(const char *, uint32, const char *));
759 BOOL cli_NetServerEnum(struct cli_state *cli, char *workgroup, uint32 stype,
760                        void (*fn)(const char *, uint32, const char *));
761 BOOL cli_session_setup_x(struct cli_state *cli, 
762                                 char *user, 
763                                 char *pass, int passlen,
764                                 char *ntpass, int ntpasslen,
765                                 char *user_domain);
766 BOOL cli_session_setup(struct cli_state *cli, 
767                                 char *myhostname, char *user,
768                                 char *pass, int passlen,
769                                 char *ntpass, int ntpasslen,
770                                 char *user_domain);
771 BOOL cli_ulogoff(struct cli_state *cli);
772 BOOL cli_send_tconX(struct cli_state *cli, 
773                     char *share, char *dev, char *pass, int passlen);
774 BOOL cli_tdis(struct cli_state *cli);
775 BOOL cli_rename(struct cli_state *cli, char *fname_src, char *fname_dst);
776 BOOL cli_unlink(struct cli_state *cli, char *fname);
777 BOOL cli_mkdir(struct cli_state *cli, char *dname);
778 BOOL cli_rmdir(struct cli_state *cli, char *dname);
779 int cli_nt_create(struct cli_state *cli, const char *fname);
780 int cli_open(struct cli_state *cli, const char *fname,
781                                 int flags, int share_mode);
782 BOOL cli_close(struct cli_state *cli, int fnum);
783 BOOL cli_lock(struct cli_state *cli, int fnum, uint32 offset, uint32 len, int timeout);
784 BOOL cli_unlock(struct cli_state *cli, int fnum, uint32 offset, uint32 len, int timeout);
785 size_t cli_read(struct cli_state *cli, int fnum, char *buf, off_t offset, size_t size);
786 ssize_t cli_write(struct cli_state *cli,
787                   int fnum, uint16 write_mode,
788                   char *buf, off_t offset, size_t size);
789 BOOL cli_getattrE(struct cli_state *cli, int fd, 
790                   uint16 *attr, size_t *size, 
791                   time_t *c_time, time_t *a_time, time_t *m_time);
792 BOOL cli_getatr(struct cli_state *cli, char *fname, 
793                 uint16 *attr, size_t *size, time_t *t);
794 BOOL cli_setatr(struct cli_state *cli, char *fname, uint16 attr, time_t t);
795 BOOL cli_qpathinfo(struct cli_state *cli, const char *fname, 
796                    time_t *c_time, time_t *a_time, time_t *m_time, 
797                    size_t *size, uint16 *mode);
798 BOOL cli_qpathinfo2(struct cli_state *cli, const char *fname, 
799                     time_t *c_time, time_t *a_time, time_t *m_time, 
800                     time_t *w_time, size_t *size, uint16 *mode,
801                     SMB_INO_T *ino);
802 BOOL cli_qfileinfo(struct cli_state *cli, int fnum, 
803                    uint16 *mode, size_t *size,
804                    time_t *c_time, time_t *a_time, time_t *m_time, 
805                    time_t *w_time, SMB_INO_T *ino);
806 int cli_list(struct cli_state *cli,const char *Mask,uint16 attribute, 
807              void (*fn)(file_info *, const char *));
808 BOOL cli_oem_change_password(struct cli_state *cli, const char *user, const char *new_password,
809                              const char *old_password);
810 BOOL cli_negprot(struct cli_state *cli);
811 BOOL cli_session_request(struct cli_state *cli,
812                          struct nmb_name *calling, struct nmb_name *called);
813 BOOL cli_connect(struct cli_state *cli, const char *host, struct in_addr *ip);
814 void cli_init_creds(struct cli_state *cli, const struct ntuser_creds *usr);
815 struct cli_state *cli_initialise(struct cli_state *cli);
816 void cli_close_socket(struct cli_state *cli);
817 void cli_shutdown(struct cli_state *cli);
818 int cli_error(struct cli_state *cli, uint8 *eclass, uint32 *num);
819 void cli_sockopt(struct cli_state *cli, char *options);
820 uint16 cli_setpid(struct cli_state *cli, uint16 pid);
821 BOOL cli_reestablish_connection(struct cli_state *cli);
822 BOOL cli_establish_connection(struct cli_state *cli, 
823                                 const char *dest_host, struct in_addr *dest_ip,
824                                 struct nmb_name *calling, struct nmb_name *called,
825                                 char *service, char *service_type,
826                                 BOOL do_shutdown, BOOL do_tcon);
827 BOOL cli_connect_auth(struct cli_state *cli,
828                                 const char* desthost,
829                                 struct in_addr *dest_ip,
830                                 const struct ntuser_creds *usr);
831 BOOL cli_connect_servers_auth(struct cli_state *cli,
832                                 char *p,
833                                 const struct ntuser_creds *usr);
834 BOOL cli_connect_serverlist(struct cli_state *cli, char *p);
835 int cli_printjob_del(struct cli_state *cli, int job);
836 int cli_print_queue(struct cli_state *cli, 
837                     void (*fn)(struct print_job_info *));
838 BOOL cli_chkpath(struct cli_state *cli, char *path);
839 BOOL cli_message_start(struct cli_state *cli, char *host, char *username, 
840                               int *grp);
841 BOOL cli_message_text(struct cli_state *cli, char *msg, int len, int grp);
842 BOOL cli_message_end(struct cli_state *cli, int grp);
843 BOOL cli_dskattr(struct cli_state *cli, int *bsize, int *total, int *avail);
844 BOOL get_any_dc_name(const char *domain, char *srv_name);
845
846 /*The following definitions come from  libsmb/clienttrust.c  */
847
848 BOOL change_trust_account_password(char *domain, char *remote_machine_list,
849                                         uint16 sec_chan);
850
851 /*The following definitions come from  libsmb/credentials.c  */
852
853 char *credstr(uchar *cred);
854 void cred_session_key(DOM_CHAL *clnt_chal, DOM_CHAL *srv_chal, char *pass, 
855                       uchar session_key[8]);
856 void cred_create(uchar session_key[8], DOM_CHAL *stor_cred, UTIME timestamp, 
857                  DOM_CHAL *cred);
858 int cred_assert(DOM_CHAL *cred, uchar session_key[8], DOM_CHAL *stored_cred,
859                 UTIME timestamp);
860 BOOL clnt_deal_with_creds(uchar sess_key[8],
861                           DOM_CRED *sto_clnt_cred, DOM_CRED *rcv_srv_cred);
862 BOOL deal_with_creds(uchar sess_key[8],
863                      DOM_CRED *sto_clnt_cred, 
864                      DOM_CRED *rcv_clnt_cred, DOM_CRED *rtn_srv_cred);
865
866 /*The following definitions come from  libsmb/namequery.c  */
867
868 BOOL name_status(int fd,char *name,int name_type,BOOL recurse,
869                  struct in_addr to_ip,char *master,char *rname,
870                  void (*fn)(struct packet_struct *));
871 struct in_addr *name_query(int fd,const char *name,int name_type, BOOL bcast,BOOL recurse,
872          struct in_addr to_ip, int *count, void (*fn)(struct packet_struct *));
873 FILE *startlmhosts(char *fname);
874 BOOL getlmhostsent( FILE *fp, pstring name, int *name_type, struct in_addr *ipaddr);
875 void endlmhosts(FILE *fp);
876 BOOL is_ip_address(const char *name);
877 BOOL resolve_name(const char *name, struct in_addr *return_ip, int name_type);
878 BOOL resolve_srv_name(const char* srv_name, fstring dest_host,
879                                 struct in_addr *ip);
880 BOOL find_master_ip(char *group, struct in_addr *master_ip);
881
882 /*The following definitions come from  libsmb/nmblib.c  */
883
884 void debug_nmb_packet(struct packet_struct *p);
885 char *nmb_namestr(struct nmb_name *n);
886 void nmb_safe_namestr(struct nmb_name *n, char *str, size_t len);
887 struct packet_struct *copy_packet(struct packet_struct *packet);
888 void free_packet(struct packet_struct *packet);
889 struct packet_struct *read_packet(int fd,enum packet_type packet_type);
890 void make_nmb_name( struct nmb_name *n, const char *name, int type, const char *this_scope );
891 BOOL nmb_name_equal(struct nmb_name *n1, struct nmb_name *n2);
892 BOOL send_packet(struct packet_struct *p);
893 struct packet_struct *receive_packet(int fd,enum packet_type type,int t);
894 void sort_query_replies(char *data, int n, struct in_addr ip);
895 BOOL read_nmb_sock(int c, struct nmb_state *con);
896 int get_nmb_sock(void);
897
898 /*The following definitions come from  libsmb/nterr.c  */
899
900 void get_safe_nt_error_msg(uint32 nt_code, char *msg, size_t len);
901 char *get_nt_error_msg(uint32 nt_code);
902
903 /*The following definitions come from  libsmb/passchange.c  */
904
905 BOOL remote_password_change(const char *remote_machine, const char *user_name, 
906                             const char *old_passwd, const char *new_passwd,
907                             char *err_str, size_t err_str_len);
908
909 /*The following definitions come from  libsmb/pwd_cache.c  */
910
911 void pwd_init(struct pwd_info *pwd);
912 BOOL pwd_is_nullpwd(const struct pwd_info *pwd);
913 void pwd_obfuscate_key(struct pwd_info *pwd, uint32 int_key, char *str_key);
914 BOOL pwd_compare(struct pwd_info *pwd1, struct pwd_info *pwd2);
915 void pwd_read(struct pwd_info *pwd, char *passwd_report, BOOL do_encrypt);
916 void pwd_set_nullpwd(struct pwd_info *pwd);
917 void pwd_set_cleartext(struct pwd_info *pwd, char *clr);
918 void pwd_get_cleartext(struct pwd_info *pwd, char *clr);
919 void pwd_set_lm_nt_16(struct pwd_info *pwd, uchar lm_pwd[16], uchar nt_pwd[16]);
920 void pwd_get_lm_nt_16(const struct pwd_info *pwd, uchar lm_pwd[16], uchar nt_pwd[16]);
921 void pwd_make_lm_nt_16(struct pwd_info *pwd, char *clr);
922 void pwd_make_lm_nt_owf2(struct pwd_info *pwd, const uchar srv_key[8],
923                 const char *user, const char *server, const char *domain);
924 void pwd_make_lm_nt_owf(struct pwd_info *pwd, uchar cryptkey[8]);
925 void pwd_get_lm_nt_owf(struct pwd_info *pwd, uchar lm_owf[24],
926                                 uchar *nt_owf, size_t *nt_owf_len,
927                                 uchar *sess_key);
928
929 /*The following definitions come from  libsmb/smbdes.c  */
930
931 void smbhash(unsigned char *out, const uchar *in, const uchar *key, int forw);
932 void E_P16(unsigned char *p14,unsigned char *p16);
933 void E_P24(unsigned char *p21, unsigned char *c8, unsigned char *p24);
934 void D_P16(unsigned char *p14, unsigned char *in, unsigned char *out);
935 void E_old_pw_hash( unsigned char *p14, unsigned char *in, unsigned char *out);
936 void cred_hash1(unsigned char *out,unsigned char *in,unsigned char *key);
937 void cred_hash2(unsigned char *out,unsigned char *in,unsigned char *key);
938 void cred_hash3(unsigned char *out,unsigned char *in,unsigned char *key, int forw);
939 void SamOEMhash( unsigned char *data, unsigned char *key, int val);
940 void sam_pwd_hash(uint32 rid, const uchar *in, uchar *out, int forw);
941
942 /*The following definitions come from  libsmb/smbencrypt.c  */
943
944 void SMBencrypt(uchar *pwrd, uchar *c8, uchar *p24);
945 void SMBNTencrypt(uchar *pwrd, uchar *c8, uchar *p24);
946 void E_md4hash(uchar *pwrd, uchar *p16);
947 void lm_owf_genW(const UNISTR2 *pwd, uchar p16[16]);
948 void lm_owf_gen(const char *pwd, uchar p16[16]);
949 void nt_owf_genW(const UNISTR2 *pwd, uchar nt_p16[16]);
950 void nt_owf_gen(const char *pwd, uchar nt_p16[16]);
951 void nt_lm_owf_genW(const UNISTR2 *pwd, uchar nt_p16[16], uchar lm_p16[16]);
952 void nt_lm_owf_gen(const char *pwd, uchar nt_p16[16], uchar lm_p16[16]);
953 void SMBOWFencrypt(uchar pwrd[16], uchar *c8, uchar p24[24]);
954 void SMBOWFencrypt_ntv2(const uchar kr[16], 
955                                 const uchar *srv_chal, int srv_chal_len,
956                                 const uchar *cli_chal, int cli_chal_len,
957                                 char resp_buf[16]);
958 void SMBsesskeygen_ntv2(const uchar kr[16], 
959                                 const uchar *nt_resp, 
960                                 char sess_key[16]);
961 void SMBsesskeygen_ntv1(const uchar kr[16], 
962                                 const uchar *nt_resp, 
963                                 char sess_key[16]);
964 void SMBgenclientchals(char *lm_cli_chal,
965                                 char *nt_cli_chal, int *nt_cli_chal_len,
966                                 const char *srv, const char *dom);
967 void ntv2_owf_gen(const uchar owf[16], 
968                                 const char *user_n,
969                                 const char *domain_n,
970                                 uchar kr_buf[16]);
971 void NTLMSSPOWFencrypt(uchar pwrd[8], uchar *ntlmchalresp, uchar p24[24]);
972 BOOL make_oem_passwd_hash(char data[516], const char *pwrd, uchar old_pw_hash[16], BOOL unicode);
973 BOOL nt_decrypt_string2(STRING2 *out, const STRING2 *in, const uchar *key);
974 void create_ntlmssp_resp(struct pwd_info *pwd,
975                                 char *domain, char *user_name, char *my_name,
976                                 uint32 ntlmssp_cli_flgs,
977                                 prs_struct *auth_resp);
978 BOOL decode_pw_buffer(const char buffer[516], char *new_pwrd,
979                         int new_pwrd_size, uint32 *new_pw_len);
980 BOOL encode_pw_buffer(char buffer[516], const char *new_pass,
981                         int new_pw_len, BOOL nt_pass_set);
982
983 /*The following definitions come from  libsmb/smberr.c  */
984
985 char *smb_err_msg(uint8 class, uint32 num);
986 BOOL smb_safe_err_msg(uint8 class, uint32 num, char *ret, size_t len);
987 BOOL smb_safe_errstr(char *inbuf, char *msg, size_t len);
988 char *smb_errstr(char *inbuf);
989
990 /*The following definitions come from  locking/locking.c  */
991
992 BOOL is_locked(files_struct *fsp,connection_struct *conn,
993                SMB_OFF_T count,SMB_OFF_T offset, int lock_type);
994 BOOL do_lock(files_struct *fsp,connection_struct *conn,
995              SMB_OFF_T count,SMB_OFF_T offset,int lock_type,
996              int *eclass,uint32 *ecode);
997 BOOL do_unlock(files_struct *fsp,connection_struct *conn,
998                SMB_OFF_T count,SMB_OFF_T offset,int *eclass,uint32 *ecode);
999 BOOL locking_init(int read_only);
1000 BOOL locking_end(void);
1001 BOOL lock_share_entry(connection_struct *conn,
1002                       SMB_DEV_T dev, SMB_INO_T inode, int *ptok);
1003 BOOL unlock_share_entry(connection_struct *conn,
1004                         SMB_DEV_T dev, SMB_INO_T inode, int token);
1005 int get_share_modes(connection_struct *conn, 
1006                     int token, SMB_DEV_T dev, SMB_INO_T inode, 
1007                     share_mode_entry **shares);
1008 void del_share_mode(int token, files_struct *fsp);
1009 BOOL set_share_mode(int token, files_struct *fsp, uint16 port, uint16 op_type);
1010 BOOL remove_share_oplock(int token, files_struct *fsp);
1011 BOOL modify_share_mode(int token, files_struct *fsp, int new_mode);
1012 int share_mode_forall(void (*fn)(share_mode_entry *, char *));
1013 void share_status(FILE *f);
1014
1015 /*The following definitions come from  locking/locking_shm.c  */
1016
1017 struct share_ops *locking_shm_init(int ronly);
1018
1019 /*The following definitions come from  locking/locking_slow.c  */
1020
1021 struct share_ops *locking_slow_init(int ronly);
1022
1023 /*The following definitions come from  locking/shmem.c  */
1024
1025 struct shmem_ops *smb_shm_open(int ronly);
1026
1027 /*The following definitions come from  locking/shmem_sysv.c  */
1028
1029 struct shmem_ops *sysv_shm_open(int ronly);
1030
1031 /*The following definitions come from  lsarpcd/lsarpcd.c  */
1032
1033 BOOL reload_services(BOOL test);
1034 void exit_server(char *reason);
1035
1036 /*The following definitions come from  lsarpcd/lsarpcd_process.c  */
1037
1038 BOOL receive_next_smb(char *inbuf, int bufsize, int timeout);
1039 void process_smb(char *inbuf, char *outbuf);
1040 BOOL get_user_creds(struct user_creds *usr);
1041 void lsarpcd_process(void);
1042
1043 /*The following definitions come from  mem_man/mem_man.c  */
1044
1045 void *smb_mem_malloc(size_t size,char *file,int line);
1046 char *smb_mem_strdup(char *s, char *file, int line);
1047 int smb_mem_free(void *ptr,char *file,int line);
1048 void smb_mem_write_info(void *ptr,FILE *outfile);
1049 size_t smb_mem_query_size(void *ptr);
1050 size_t smb_mem_query_real_size(void *ptr);
1051 char *smb_mem_query_file(void *ptr);
1052 int smb_mem_query_line(void *ptr);
1053 int smb_mem_test(void *ptr);
1054 void smb_mem_write_status(FILE *outfile);
1055 void smb_mem_write_verbose(FILE *outfile);
1056 void smb_mem_write_errors(FILE *outfile);
1057 void smb_mem_set_multiplier(int multiplier);
1058 void *smb_mem_resize(void *ptr,size_t newsize);
1059
1060 /*The following definitions come from  nmbd/asyncdns.c  */
1061
1062 int asyncdns_fd(void);
1063 void kill_async_dns_child(void);
1064 void start_async_dns(void);
1065 void run_dns_queue(void);
1066 BOOL queue_dns_query(struct packet_struct *p,struct nmb_name *question,
1067                      struct name_record **n);
1068 BOOL queue_dns_query(struct packet_struct *p,struct nmb_name *question,
1069                      struct name_record **n);
1070 void kill_async_dns_child(void);
1071
1072 /*The following definitions come from  nmbd/nmbd.c  */
1073
1074 BOOL reload_services(BOOL test);
1075
1076 /*The following definitions come from  nmbd/nmbd_become_dmb.c  */
1077
1078 void add_domain_names(time_t t);
1079
1080 /*The following definitions come from  nmbd/nmbd_become_lmb.c  */
1081
1082 void insert_permanent_name_into_unicast( struct subnet_record *subrec, 
1083                                                 struct nmb_name *nmbname, uint16 nb_type );
1084 void unbecome_local_master_browser(struct subnet_record *subrec, struct work_record *work,
1085                                    BOOL force_new_election);
1086 void become_local_master_browser(struct subnet_record *subrec, struct work_record *work);
1087 void set_workgroup_local_master_browser_name( struct work_record *work, char *newname);
1088
1089 /*The following definitions come from  nmbd/nmbd_browserdb.c  */
1090
1091 void update_browser_death_time( struct browse_cache_record *browc );
1092 struct browse_cache_record *create_browser_in_lmb_cache( char *work_name, 
1093                                                          char *browser_name, 
1094                                                          struct in_addr ip );
1095 struct browse_cache_record *find_browser_in_lmb_cache( char *browser_name );
1096 void expire_lmb_browsers( time_t t );
1097
1098 /*The following definitions come from  nmbd/nmbd_browsesync.c  */
1099
1100 void dmb_expire_and_sync_browser_lists(time_t t);
1101 void announce_and_sync_with_domain_master_browser( struct subnet_record *subrec,
1102                                                    struct work_record *work);
1103 void collect_all_workgroup_names_from_wins_server(time_t t);
1104 void sync_all_dmbs(time_t t);
1105
1106 /*The following definitions come from  nmbd/nmbd_elections.c  */
1107
1108 void check_master_browser_exists(time_t t);
1109 void run_elections(time_t t);
1110 void process_election(struct subnet_record *subrec, struct packet_struct *p, char *buf);
1111 BOOL check_elections(void);
1112
1113 /*The following definitions come from  nmbd/nmbd_incomingdgrams.c  */
1114
1115 void tell_become_backup(void);
1116 void process_host_announce(struct subnet_record *subrec, struct packet_struct *p, char *buf);
1117 void process_workgroup_announce(struct subnet_record *subrec, struct packet_struct *p, char *buf);
1118 void process_local_master_announce(struct subnet_record *subrec, struct packet_struct *p, char *buf);
1119 void process_master_browser_announce(struct subnet_record *subrec, 
1120                                      struct packet_struct *p,char *buf);
1121 void process_lm_host_announce(struct subnet_record *subrec, struct packet_struct *p, char *buf);
1122 void process_get_backup_list_request(struct subnet_record *subrec,
1123                                      struct packet_struct *p,char *buf);
1124 void process_reset_browser(struct subnet_record *subrec,
1125                                   struct packet_struct *p,char *buf);
1126 void process_announce_request(struct subnet_record *subrec, struct packet_struct *p, char *buf);
1127 void process_lm_announce_request(struct subnet_record *subrec, struct packet_struct *p, char *buf);
1128
1129 /*The following definitions come from  nmbd/nmbd_incomingrequests.c  */
1130
1131 void process_name_release_request(struct subnet_record *subrec, 
1132                                   struct packet_struct *p);
1133 void process_name_refresh_request(struct subnet_record *subrec,
1134                                   struct packet_struct *p);
1135 void process_name_registration_request(struct subnet_record *subrec, 
1136                                        struct packet_struct *p);
1137 void process_node_status_request(struct subnet_record *subrec, struct packet_struct *p);
1138 void process_name_query_request(struct subnet_record *subrec, struct packet_struct *p);
1139
1140 /*The following definitions come from  nmbd/nmbd_lmhosts.c  */
1141
1142 void load_lmhosts_file(char *fname);
1143 BOOL find_name_in_lmhosts(struct nmb_name *nmbname, struct name_record **namerecp);
1144
1145 /*The following definitions come from  nmbd/nmbd_logonnames.c  */
1146
1147 void add_logon_names(void);
1148
1149 /*The following definitions come from  nmbd/nmbd_mynames.c  */
1150
1151 BOOL register_my_workgroup_and_names(void);
1152 void release_my_names(void);
1153 void refresh_my_names(time_t t);
1154
1155 /*The following definitions come from  nmbd/nmbd_namelistdb.c  */
1156
1157 void set_samba_nb_type(void);
1158 void remove_name_from_namelist( struct subnet_record *subrec, 
1159                                 struct name_record   *namerec );
1160 struct name_record *find_name_on_subnet( struct subnet_record *subrec,
1161                                          struct nmb_name      *nmbname,
1162                                          BOOL                  self_only );
1163 struct name_record *find_name_for_remote_broadcast_subnet(
1164                                                    struct nmb_name *nmbname,
1165                                                    BOOL             self_only );
1166 void update_name_ttl( struct name_record *namerec, int ttl );
1167 struct name_record *add_name_to_subnet( struct subnet_record *subrec,
1168                                         char                 *name,
1169                                         int                   type,
1170                                         uint16                nb_flags,
1171                                         int                   ttl,
1172                                         enum name_source      source,
1173                                         int                   num_ips,
1174                                         struct in_addr       *iplist);
1175 void standard_success_register(struct subnet_record *subrec, 
1176                              struct userdata_struct *userdata,
1177                              struct nmb_name *nmbname, uint16 nb_flags, int ttl,
1178                              struct in_addr registered_ip);
1179 void standard_fail_register( struct subnet_record   *subrec,
1180                              struct response_record *rrec,
1181                              struct nmb_name        *nmbname );
1182 BOOL find_ip_in_name_record( struct name_record *namerec, struct in_addr ip );
1183 void add_ip_to_name_record( struct name_record *namerec, struct in_addr new_ip );
1184 void remove_ip_from_name_record( struct name_record *namerec,
1185                                  struct in_addr      remove_ip );
1186 void standard_success_release( struct subnet_record   *subrec,
1187                                struct userdata_struct *userdata,
1188                                struct nmb_name        *nmbname,
1189                                struct in_addr          released_ip );
1190 void expire_names_on_subnet(struct subnet_record *subrec, time_t t);
1191 void expire_names(time_t t);
1192 void add_samba_names_to_subnet( struct subnet_record *subrec );
1193 void dump_all_namelists(void);
1194
1195 /*The following definitions come from  nmbd/nmbd_namequery.c  */
1196
1197 BOOL query_name(struct subnet_record *subrec, char *name, int type,
1198                    query_name_success_function success_fn,
1199                    query_name_fail_function fail_fn, 
1200                    struct userdata_struct *userdata);
1201 BOOL query_name_from_wins_server(struct in_addr ip_to, 
1202                    char *name, int type,
1203                    query_name_success_function success_fn,
1204                    query_name_fail_function fail_fn, 
1205                    struct userdata_struct *userdata);
1206
1207 /*The following definitions come from  nmbd/nmbd_nameregister.c  */
1208
1209 BOOL register_name(struct subnet_record *subrec,
1210                    char *name, int type, uint16 nb_flags,
1211                    register_name_success_function success_fn,
1212                    register_name_fail_function fail_fn,
1213                    struct userdata_struct *userdata);
1214 BOOL refresh_name(struct subnet_record *subrec, struct name_record *namerec,
1215                   refresh_name_success_function success_fn,
1216                   refresh_name_fail_function fail_fn,
1217                   struct userdata_struct *userdata);
1218
1219 /*The following definitions come from  nmbd/nmbd_namerelease.c  */
1220
1221 BOOL release_name(struct subnet_record *subrec, struct name_record *namerec,
1222                    release_name_success_function success_fn,
1223                    release_name_fail_function fail_fn,
1224                    struct userdata_struct *userdata);
1225
1226 /*The following definitions come from  nmbd/nmbd_nodestatus.c  */
1227
1228 BOOL node_status(struct subnet_record *subrec, struct nmb_name *nmbname,
1229                  struct in_addr send_ip, node_status_success_function success_fn, 
1230                  node_status_fail_function fail_fn, struct userdata_struct *userdata);
1231
1232 /*The following definitions come from  nmbd/nmbd_packets.c  */
1233
1234 uint16 get_nb_flags(char *buf);
1235 void set_nb_flags(char *buf, uint16 nb_flags);
1236 struct response_record *queue_register_name( struct subnet_record *subrec,
1237                           response_function resp_fn,
1238                           timeout_response_function timeout_fn,
1239                           register_name_success_function success_fn,
1240                           register_name_fail_function fail_fn,
1241                           struct userdata_struct *userdata,
1242                           struct nmb_name *nmbname,
1243                           uint16 nb_flags);
1244 struct response_record *queue_register_multihomed_name( struct subnet_record *subrec,
1245                           response_function resp_fn,
1246                           timeout_response_function timeout_fn,
1247                           register_name_success_function success_fn,
1248                           register_name_fail_function fail_fn,
1249                           struct userdata_struct *userdata,
1250                           struct nmb_name *nmbname,
1251                           uint16 nb_flags,
1252                           struct in_addr register_ip);
1253 struct response_record *queue_release_name( struct subnet_record *subrec,
1254                           response_function resp_fn,
1255                           timeout_response_function timeout_fn,
1256                           release_name_success_function success_fn,
1257                           release_name_fail_function fail_fn,
1258                           struct userdata_struct *userdata,
1259                           struct nmb_name *nmbname,
1260                           uint16 nb_flags,
1261                           struct in_addr release_ip);
1262 struct response_record *queue_refresh_name( struct subnet_record *subrec,
1263                           response_function resp_fn,
1264                           timeout_response_function timeout_fn,
1265                           refresh_name_success_function success_fn,
1266                           refresh_name_fail_function fail_fn,
1267                           struct userdata_struct *userdata,
1268                           struct name_record *namerec,
1269                           struct in_addr refresh_ip);
1270 struct response_record *queue_query_name( struct subnet_record *subrec,
1271                           response_function resp_fn,
1272                           timeout_response_function timeout_fn,
1273                           query_name_success_function success_fn,
1274                           query_name_fail_function fail_fn,
1275                           struct userdata_struct *userdata,
1276                           struct nmb_name *nmbname);
1277 struct response_record *queue_query_name_from_wins_server( struct in_addr to_ip,
1278                           response_function resp_fn,
1279                           timeout_response_function timeout_fn,
1280                           query_name_success_function success_fn,
1281                           query_name_fail_function fail_fn,
1282                           struct userdata_struct *userdata,
1283                           struct nmb_name *nmbname);
1284 struct response_record *queue_node_status( struct subnet_record *subrec,
1285                           response_function resp_fn,
1286                           timeout_response_function timeout_fn,
1287                           node_status_success_function success_fn,
1288                           node_status_fail_function fail_fn,
1289                           struct userdata_struct *userdata,
1290                           struct nmb_name *nmbname,
1291                           struct in_addr send_ip);
1292 void reply_netbios_packet(struct packet_struct *orig_packet,
1293                           int rcode, enum netbios_reply_type_code rcv_code, int opcode,
1294                           int ttl, char *data,int len);
1295 void run_packet_queue(void);
1296 void retransmit_or_expire_response_records(time_t t);
1297 BOOL listen_for_packets(BOOL run_election);
1298 BOOL send_mailslot(BOOL unique, char *mailslot,char *buf,int len,
1299                    char *srcname, int src_type,
1300                    char *dstname, int dest_type,
1301                    struct in_addr dest_ip,struct in_addr src_ip,
1302                    int dest_port);
1303
1304 /*The following definitions come from  nmbd/nmbd_processlogon.c  */
1305
1306 void process_logon_packet(struct packet_struct *p,char *buf,int len, 
1307                           char *mailslot);
1308
1309 /*The following definitions come from  nmbd/nmbd_responserecordsdb.c  */
1310
1311 void remove_response_record(struct subnet_record *subrec,
1312                                 struct response_record *rrec);
1313 struct response_record *make_response_record( struct subnet_record *subrec,
1314                     struct packet_struct *p,
1315                     response_function resp_fn,
1316                     timeout_response_function timeout_fn,
1317                     success_function success_fn,
1318                     fail_function fail_fn,
1319                     struct userdata_struct *userdata);
1320 struct response_record *find_response_record(struct subnet_record **ppsubrec,
1321                                 uint16 id);
1322 BOOL is_refresh_already_queued(struct subnet_record *subrec, struct name_record *namerec);
1323
1324 /*The following definitions come from  nmbd/nmbd_sendannounce.c  */
1325
1326 void send_browser_reset(int reset_type, char *to_name, int to_type, struct in_addr to_ip);
1327 void broadcast_announce_request(struct subnet_record *subrec, struct work_record *work);
1328 void announce_my_server_names(time_t t);
1329 void announce_my_lm_server_names(time_t t);
1330 void reset_announce_timer(void);
1331 void announce_myself_to_domain_master_browser(time_t t);
1332 void announce_my_servers_removed(void);
1333 void announce_remote(time_t t);
1334 void browse_sync_remote(time_t t);
1335
1336 /*The following definitions come from  nmbd/nmbd_serverlistdb.c  */
1337
1338 void remove_all_servers(struct work_record *work);
1339 struct server_record *find_server_in_workgroup(struct work_record *work, char *name);
1340 void remove_server_from_workgroup(struct work_record *work, struct server_record *servrec);
1341 struct server_record *create_server_on_workgroup(struct work_record *work,
1342                                                  char *name,int servertype, 
1343                                                  int ttl,char *comment);
1344 void update_server_ttl(struct server_record *servrec, int ttl);
1345 void expire_servers(struct work_record *work, time_t t);
1346 void write_browse_list(time_t t, BOOL force_write);
1347
1348 /*The following definitions come from  nmbd/nmbd_subnetdb.c  */
1349
1350 BOOL create_subnets(void);
1351 BOOL we_are_a_wins_client(void);
1352 struct subnet_record *get_next_subnet_maybe_unicast(struct subnet_record *subrec);
1353 struct subnet_record *get_next_subnet_maybe_unicast_or_wins_server(struct subnet_record *subrec);
1354
1355 /*The following definitions come from  nmbd/nmbd_synclists.c  */
1356
1357 void sync_browse_lists(struct work_record *work,
1358                        char *name, int nm_type, 
1359                        struct in_addr ip, BOOL local, BOOL servers);
1360 void sync_check_completion(void);
1361
1362 /*The following definitions come from  nmbd/nmbd_winsproxy.c  */
1363
1364 void make_wins_proxy_name_query_request( struct subnet_record *subrec, 
1365                                          struct packet_struct *incoming_packet,
1366                                          struct nmb_name *question_name);
1367
1368 /*The following definitions come from  nmbd/nmbd_winsserver.c  */
1369
1370 BOOL packet_is_for_wins_server(struct packet_struct *packet);
1371 BOOL initialise_wins(void);
1372 void wins_process_name_refresh_request(struct subnet_record *subrec,
1373                                             struct packet_struct *p);
1374 void wins_process_name_registration_request(struct subnet_record *subrec,
1375                                             struct packet_struct *p);
1376 void wins_process_multihomed_name_registration_request( struct subnet_record *subrec,
1377                                                         struct packet_struct *p);
1378 void send_wins_name_query_response(int rcode, struct packet_struct *p, 
1379                                           struct name_record *namerec);
1380 void wins_process_name_query_request(struct subnet_record *subrec, 
1381                                      struct packet_struct *p);
1382 void wins_process_name_release_request(struct subnet_record *subrec,
1383                                        struct packet_struct *p);
1384 void initiate_wins_processing(time_t t);
1385 void wins_write_database(BOOL background);
1386
1387 /*The following definitions come from  nmbd/nmbd_workgroupdb.c  */
1388
1389 struct work_record *find_workgroup_on_subnet(struct subnet_record *subrec, 
1390                                              fstring name);
1391 struct work_record *create_workgroup_on_subnet(struct subnet_record *subrec,
1392                                                fstring name, int ttl);
1393 void update_workgroup_ttl(struct work_record *work, int ttl);
1394 void initiate_myworkgroup_startup(struct subnet_record *subrec, struct work_record *work);
1395 void dump_workgroups(BOOL force_write);
1396 void expire_workgroups_and_servers(time_t t);
1397
1398 /*The following definitions come from  param/loadparm.c  */
1399
1400 struct vfs_options *lp_vfsoptions(int i) ;
1401 char *lp_logfile(void);
1402 char *lp_smbrun(void);
1403 char *lp_configfile(void);
1404 char *lp_smb_passwd_file(void);
1405 char *lp_smb_passgrp_file(void);
1406 char *lp_smb_group_file(void);
1407 char *lp_smb_alias_file(void);
1408 char *lp_serverstring(void);
1409 char *lp_printcapname(void);
1410 char *lp_lockdir(void);
1411 char *lp_rootdir(void);
1412 char *lp_defaultservice(void);
1413 char *lp_msg_command(void);
1414 char *lp_hosts_equiv(void);
1415 char *lp_auto_services(void);
1416 char *lp_passwd_program(void);
1417 char *lp_passwd_chat(void);
1418 char *lp_passwordserver(void);
1419 char *lp_name_resolve_order(void);
1420 char *lp_workgroup(void);
1421 char *lp_trusted_domains(void);
1422 char *lp_trusting_domains(void);
1423 char *lp_username_map(void);
1424 char *lp_aliasname_map(void);
1425 char *lp_groupname_map(void);
1426 char *lp_builtinname_map(void);
1427 char *lp_builtinrid_file(void);
1428 char *lp_ntusrname_map(void);
1429 char *lp_logon_script(void);
1430 char *lp_logon_path(void);
1431 char *lp_logon_drive(void);
1432 char *lp_logon_home(void);
1433 char *lp_remote_announce(void);
1434 char *lp_remote_browse_sync(void);
1435 char *lp_wins_server(void);
1436 char *lp_interfaces(void);
1437 char *lp_socket_address(void);
1438 char *lp_nis_home_map_name(void);
1439 char *lp_netbios_aliases(void);
1440 char *lp_driverfile(void);
1441 char *lp_panic_action(void);
1442 char *lp_nt_forms(void);
1443 char *lp_nt_drivers_file(void);
1444 char *lp_dfs_map(void);
1445 char *lp_ldap_server(void);
1446 char *lp_ldap_suffix(void);
1447 char *lp_ldap_bind_as(void);
1448 char *lp_ldap_passwd_file(void);
1449 int lp_ssl_version(void);
1450 char *lp_ssl_hosts(void);
1451 char *lp_ssl_hosts_resign(void);
1452 char *lp_ssl_cacertdir(void);
1453 char *lp_ssl_cacertfile(void);
1454 char *lp_ssl_cert(void);
1455 char *lp_ssl_privkey(void);
1456 char *lp_ssl_client_cert(void);
1457 char *lp_ssl_client_privkey(void);
1458 char *lp_ssl_ciphers(void);
1459 BOOL lp_ssl_enabled(void);
1460 BOOL lp_ssl_reqClientCert(void);
1461 BOOL lp_ssl_reqServerCert(void);
1462 BOOL lp_ssl_compatibility(void);
1463 BOOL lp_dns_proxy(void);
1464 BOOL lp_wins_support(void);
1465 BOOL lp_we_are_a_wins_server(void);
1466 BOOL lp_wins_proxy(void);
1467 BOOL lp_local_master(void);
1468 BOOL lp_domain_logons(void);
1469 BOOL lp_load_printers(void);
1470 BOOL lp_use_rhosts(void);
1471 BOOL lp_readprediction(void);
1472 BOOL lp_readbmpx(void);
1473 BOOL lp_readraw(void);
1474 BOOL lp_writeraw(void);
1475 BOOL lp_null_passwords(void);
1476 BOOL lp_strip_dot(void);
1477 BOOL lp_encrypted_passwords(void);
1478 BOOL lp_update_encrypted(void);
1479 BOOL lp_client_ntlmv2(void);
1480 BOOL lp_server_ntlmv2(void);
1481 BOOL lp_syslog_only(void);
1482 BOOL lp_timestamp_logs(void);
1483 BOOL lp_browse_list(void);
1484 BOOL lp_unix_realname(void);
1485 BOOL lp_nis_home_map(void);
1486 BOOL lp_bind_interfaces_only(void);
1487 BOOL lp_unix_password_sync(void);
1488 BOOL lp_passwd_chat_debug(void);
1489 BOOL lp_ole_locking_compat(void);
1490 BOOL lp_nt_smb_support(void);
1491 BOOL lp_nt_pipe_support(void);
1492 BOOL lp_stat_cache(void);
1493 int lp_os_level(void);
1494 int lp_max_ttl(void);
1495 int lp_max_wins_ttl(void);
1496 int lp_min_wins_ttl(void);
1497 int lp_max_log_size(void);
1498 int lp_max_open_files(void);
1499 int lp_maxxmit(void);
1500 int lp_maxmux(void);
1501 int lp_passwordlevel(void);
1502 int lp_usernamelevel(void);
1503 int lp_readsize(void);
1504 int lp_shmem_size(void);
1505 int lp_deadtime(void);
1506 int lp_maxprotocol(void);
1507 int lp_security(void);
1508 int lp_maxdisksize(void);
1509 int lp_lpqcachetime(void);
1510 int lp_syslog(void);
1511 int lp_client_code_page(void);
1512 int lp_lm_announce(void);
1513 int lp_lm_interval(void);
1514 int lp_machine_password_timeout(void);
1515 int lp_change_notify_timeout(void);
1516 int lp_stat_cache_size(void);
1517 int lp_map_to_guest(void);
1518 int lp_ldap_port(void);
1519 char *lp_preexec(int );
1520 char *lp_postexec(int );
1521 char *lp_rootpreexec(int );
1522 char *lp_rootpostexec(int );
1523 char *lp_servicename(int );
1524 char *lp_pathname(int );
1525 char *lp_dontdescend(int );
1526 char *lp_username(int );
1527 char *lp_guestaccount(int );
1528 char *lp_invalid_users(int );
1529 char *lp_valid_users(int );
1530 char *lp_admin_users(int );
1531 char *lp_printcommand(int );
1532 char *lp_lpqcommand(int );
1533 char *lp_lprmcommand(int );
1534 char *lp_lppausecommand(int );
1535 char *lp_lpresumecommand(int );
1536 char *lp_queuepausecommand(int );
1537 char *lp_queueresumecommand(int );
1538 char *lp_printername(int );
1539 char *lp_printerdriver(int );
1540 char *lp_hostsallow(int );
1541 char *lp_hostsdeny(int );
1542 char *lp_magicscript(int );
1543 char *lp_magicoutput(int );
1544 char *lp_comment(int );
1545 char *lp_force_user(int );
1546 char *lp_force_group(int );
1547 char *lp_readlist(int );
1548 char *lp_writelist(int );
1549 char *lp_fstype(int );
1550 char *lp_vfsobj(int );
1551 char *lp_mangled_map(int );
1552 char *lp_veto_files(int );
1553 char *lp_hide_files(int );
1554 char *lp_veto_oplocks(int );
1555 char *lp_driverlocation(int );
1556 BOOL lp_revalidate(int );
1557 BOOL lp_casesensitive(int );
1558 BOOL lp_preservecase(int );
1559 BOOL lp_shortpreservecase(int );
1560 BOOL lp_casemangle(int );
1561 BOOL lp_status(int );
1562 BOOL lp_hide_dot_files(int );
1563 BOOL lp_browseable(int );
1564 BOOL lp_readonly(int );
1565 BOOL lp_no_set_dir(int );
1566 BOOL lp_guest_ok(int );
1567 BOOL lp_guest_only(int );
1568 BOOL lp_print_ok(int );
1569 BOOL lp_postscript(int );
1570 BOOL lp_map_hidden(int );
1571 BOOL lp_map_archive(int );
1572 BOOL lp_locking(int );
1573 BOOL lp_strict_locking(int );
1574 BOOL lp_share_modes(int );
1575 BOOL lp_oplocks(int );
1576 BOOL lp_onlyuser(int );
1577 BOOL lp_manglednames(int );
1578 BOOL lp_widelinks(int );
1579 BOOL lp_symlinks(int );
1580 BOOL lp_syncalways(int );
1581 BOOL lp_strict_sync(int );
1582 BOOL lp_map_system(int );
1583 BOOL lp_delete_readonly(int );
1584 BOOL lp_fake_oplocks(int );
1585 BOOL lp_recursive_veto_delete(int );
1586 BOOL lp_dos_filetimes(int );
1587 BOOL lp_dos_filetime_resolution(int );
1588 BOOL lp_fake_dir_create_times(int );
1589 BOOL lp_blocking_locks(int );
1590 int lp_create_mode(int );
1591 int lp_force_create_mode(int );
1592 int lp_dir_mode(int );
1593 int lp_force_dir_mode(int );
1594 int lp_max_connections(int );
1595 int lp_defaultcase(int );
1596 int lp_minprintspace(int );
1597 int lp_printing(int );
1598 char lp_magicchar(int );
1599 char *lp_mysql_host(void);
1600 char *lp_mysql_user(void);
1601 char *lp_mysql_passfile(void);
1602 char *lp_mysql_db(void);
1603 char *lp_mysql_table(void);
1604 BOOL lp_add_home(char *pszHomename, int iDefaultService, char *pszHomedir);
1605 int lp_add_service(char *pszService, int iDefaultService);
1606 BOOL lp_add_printer(char *pszPrintername, int iDefaultService);
1607 BOOL lp_file_list_changed(void);
1608 void *lp_local_ptr(int snum, void *ptr);
1609 BOOL lp_do_parameter(int snum, char *pszParmName, char *pszParmValue);
1610 BOOL lp_is_default(int snum, struct parm_struct *parm);
1611 struct parm_struct *lp_next_parameter(int snum, int *i, int allparameters);
1612 BOOL lp_snum_ok(int iService);
1613 void lp_add_one_printer(char *name,char *comment);
1614 BOOL lp_loaded(void);
1615 void lp_killunused(BOOL (*snumused)(int ));
1616 BOOL lp_load(char *pszFname,BOOL global_only, BOOL save_defaults, BOOL add_ipc);
1617 int lp_numservices(void);
1618 void lp_dump(FILE *f, BOOL show_defaults);
1619 int lp_servicenumber(char *pszServiceName);
1620 char *volume_label(int snum);
1621 void lp_remove_service(int snum);
1622 void lp_copy_service(int snum, char *new_name);
1623 int lp_default_server_announce(void);
1624 int lp_major_announce_version(void);
1625 int lp_minor_announce_version(void);
1626 void lp_set_name_resolve_order(char *new_order);
1627 void lp_set_kernel_oplocks(BOOL val);
1628 BOOL lp_kernel_oplocks(void);
1629 int lp_server_role(void);
1630 BOOL lp_domain_master(void);
1631 BOOL lp_preferred_master(void);
1632
1633 /*The following definitions come from  param/params.c  */
1634
1635 BOOL pm_process( char *FileName,
1636                  BOOL (*sfunc)(char *),
1637                  BOOL (*pfunc)(char *, char *) );
1638
1639 /*The following definitions come from  passdb/ldap.c  */
1640
1641 BOOL ldap_connect(void);
1642 void ldap_disconnect(void);
1643 BOOL ldap_search_for(char *filter);
1644 BOOL ldap_search_by_name(const char *user);
1645 BOOL ldap_search_by_uid(int uid);
1646 BOOL ldap_get_attribute(char *attribute, char *value);
1647 struct smb_passwd *ldap_getpw(void);
1648 BOOL ldap_allocaterid(uint32 *rid);
1649 struct smb_passdb_ops *ldap_initialise_password_db(void);
1650
1651 /*The following definitions come from  passdb/mysqlpass.c  */
1652
1653 int mysql_db_lock_connect( MYSQL *handle );
1654 void *mysql_startpwent( BOOL update );
1655 void mysql_endpwent( void *ptr );
1656 SMB_BIG_UINT mysql_getpwpos(void *vp);
1657 BOOL mysql_setpwpos(void *vp, SMB_BIG_UINT pos);
1658 void *mysql_fill_smb_passwd( MYSQL_ROW *row );
1659 struct smb_passwd *mysql_getsmbpwent(void *vp);
1660 void *mysql_fetch_passwd( void *(*filler)(MYSQL_ROW*), char *where );
1661 void *mysql_getpwuid(void *(*filler)(MYSQL_ROW *), uid_t uid);
1662 struct smb_passwd *mysql_getsmbpwuid(uid_t uid);
1663 void *mysql_getpwnam(void *(*filler)(MYSQL_ROW *), char *field, const char *name);
1664 struct smb_passwd *mysql_getsmbpwnam(const char *unix_name);
1665 BOOL mysql_del_smb( MYSQL *handle, char *unix_name );
1666 BOOL mysql_add_smb( MYSQL *handle, struct smb_passwd *smb );
1667 BOOL mysql_mod_smb( MYSQL *handle, struct smb_passwd *smb, BOOL override );
1668 BOOL mysql_add_smbpwd_entry(struct smb_passwd *smb);
1669 BOOL mysql_mod_smbpwd_entry(struct smb_passwd *smb, BOOL override);
1670 struct smb_passdb_ops *mysql_initialise_password_db(void);
1671
1672 /*The following definitions come from  passdb/mysqlsampass.c  */
1673
1674 void *mysql_fill_sam_passwd( MYSQL_ROW *row );
1675 struct sam_passwd *mysql_getsampwent(void *vp);
1676 struct sam_passwd *mysql_getsampwrid(uint32 rid);
1677 struct sam_passwd *mysql_getsampwuid(uid_t uid);
1678 struct sam_passwd *mysql_getsampwntnam(const char *nt_name);
1679 struct sam_disp_info *mysql_getsamdispntnam(const char *nt_name);
1680 struct sam_disp_info *mysql_getsamdisprid(uint32 rid);
1681 struct sam_disp_info *mysql_getsamdispent(void *vp);
1682 BOOL mysql_add_sampwd_entry(struct sam_passwd *sam);
1683 BOOL mysql_mod_sampwd_entry(struct sam_passwd *sam, BOOL override);
1684 struct sam_passdb_ops *mysql_initialise_sam_password_db(void);
1685
1686 /*The following definitions come from  passdb/nispass.c  */
1687
1688 struct passdb_ops *nisplus_initialise_password_db(void);
1689
1690 /*The following definitions come from  passdb/pass_check.c  */
1691
1692 void dfs_unlogin(void);
1693 BOOL pass_check(char *user,char *password, int pwlen, struct passwd *pwd,
1694                 BOOL (*fn)(char *, char *));
1695
1696 /*The following definitions come from  passdb/passdb.c  */
1697
1698 BOOL initialise_password_db(void);
1699 struct smb_passwd *iterate_getsmbpwuid(uid_t unix_uid);
1700 struct smb_passwd *iterate_getsmbpwnam(const char *name);
1701 void *startsmbpwent(BOOL update);
1702 void endsmbpwent(void *vp);
1703 SMB_BIG_UINT getsmbpwpos(void *vp);
1704 BOOL setsmbpwpos(void *vp, SMB_BIG_UINT tok);
1705 struct smb_passwd *getsmbpwent(void *vp);
1706 BOOL add_smbpwd_entry(struct smb_passwd *newpwd);
1707 BOOL mod_smbpwd_entry(struct smb_passwd* pwd, BOOL override);
1708 struct smb_passwd *getsmbpwnam(const char *name);
1709 struct smb_passwd *getsmbpwuid(uid_t unix_uid);
1710 void pwdb_init_smb(struct smb_passwd *user);
1711 struct smb_passwd *pwdb_smb_map_names(struct smb_passwd *smb);
1712
1713 /*The following definitions come from  passdb/passgrp.c  */
1714
1715 BOOL initialise_passgrp_db(void);
1716 struct smb_passwd *iterate_getsmbgrprid(uint32 user_rid,
1717                 uint32 **grps, int *num_grps,
1718                 uint32 **alss, int *num_alss);
1719 struct smb_passwd *iterate_getsmbgrpuid(uid_t unix_uid,
1720                 uint32 **grps, int *num_grps,
1721                 uint32 **alss, int *num_alss);
1722 struct smb_passwd *iterate_getsmbgrpntnam(const char *nt_name,
1723                 uint32 **grps, int *num_grps,
1724                 uint32 **alss, int *num_alss);
1725 void *startsmbgrpent(BOOL update);
1726 void endsmbgrpent(void *vp);
1727 struct smb_passwd *getsmbgrpent(void *vp,
1728                 uint32 **grps, int *num_grps,
1729                 uint32 **alss, int *num_alss);
1730 struct smb_passwd *getsmbgrpntnam(char *name,
1731                 uint32 **grps, int *num_grps,
1732                 uint32 **alss, int *num_alss);
1733 struct smb_passwd *getsmbgrprid(uint32 user_rid,
1734                 uint32 **grps, int *num_grps,
1735                 uint32 **alss, int *num_alss);
1736 struct smb_passwd *getsmbgrpuid(uid_t unix_uid,
1737                 uint32 **grps, int *num_grps,
1738                 uint32 **alss, int *num_alss);
1739
1740 /*The following definitions come from  passdb/passgrpldap.c  */
1741
1742 struct passgrp_ops *ldap_initialise_password_grp(void);
1743
1744 /*The following definitions come from  passdb/sampass.c  */
1745
1746 struct sam_passdb_ops *file_initialise_sam_password_db(void);
1747
1748 /*The following definitions come from  passdb/sampassdb.c  */
1749
1750 BOOL initialise_sam_password_db(void);
1751 void *startsam21pwent(BOOL update);
1752 void endsam21pwent(void *vp);
1753 struct sam_passwd *getsam21pwent(void *vp);
1754 BOOL mod_sam21pwd_entry(struct sam_passwd* pwd, BOOL override);
1755 struct sam_passwd *iterate_getsam21pwntnam(const char *ntname);
1756 struct sam_passwd *iterate_getsam21pwrid(uint32 rid);
1757 struct sam_passwd *iterate_getsam21pwuid(uid_t uid);
1758 struct sam_disp_info *getsamdisprid(uint32 rid);
1759 struct sam_passwd *getsam21pwntnam(const char *name);
1760 struct sam_passwd *getsam21pwrid(uint32 rid);
1761 void pwdb_init_sam(struct sam_passwd *user);
1762 struct sam_disp_info *pwdb_sam_to_dispinfo(struct sam_passwd *user);
1763 void copy_id23_to_sam_passwd(struct sam_passwd *to, const SAM_USER_INFO_23 *from);
1764 void copy_sam_passwd(struct sam_passwd *to, const struct sam_passwd *from);
1765 struct smb_passwd *pwdb_sam_to_smb(struct sam_passwd *user);
1766 struct sam_passwd *pwdb_smb_to_sam(struct smb_passwd *user);
1767 struct sam_passwd *pwdb_sam_map_names(struct sam_passwd *sam);
1768
1769 /*The following definitions come from  passdb/sampassldap.c  */
1770
1771 BOOL ldap_search_by_rid(uint32 rid);
1772 BOOL ldap_search_by_ntname(const char *ntname);
1773 struct sam_passdb_ops *ldap_initialise_sam_password_db(void);
1774
1775 /*The following definitions come from  passdb/smbpass.c  */
1776
1777 struct smb_passwd *getsmbfilepwent(void *vp);
1778 struct smb_passdb_ops *file_initialise_password_db(void);
1779
1780 /*The following definitions come from  passdb/smbpasschange.c  */
1781
1782 BOOL local_password_change(char *user_name,
1783                                 BOOL add_user,
1784                                 uint16 acb_info, uint16 acb_mask,
1785                                 char *new_passwd, 
1786                                 char *err_str, size_t err_str_len,
1787                                 char *msg_str, size_t msg_str_len);
1788
1789 /*The following definitions come from  passdb/smbpassfile.c  */
1790
1791 BOOL trust_password_lock( char *domain, char *name, BOOL update);
1792 BOOL trust_password_unlock(void);
1793 BOOL trust_password_delete( char *domain, char *name );
1794 BOOL get_trust_account_password( unsigned char *ret_pwd, time_t *pass_last_set_time);
1795 BOOL set_trust_account_password( unsigned char *md4_new_pwd);
1796 BOOL trust_get_passwd( unsigned char trust_passwd[16], char *domain, char *myname);
1797 BOOL create_trust_account_file(char *domain, char *name, uchar pass[16]);
1798
1799 /*The following definitions come from  passdb/smbpassgroup.c  */
1800
1801 struct passgrp_ops *file_initialise_password_grp(void);
1802
1803 /*The following definitions come from  passdb/smbpassgroupunix.c  */
1804
1805 struct passgrp_ops *unix_initialise_password_grp(void);
1806
1807 /*The following definitions come from  printing/nt_printing.c  */
1808
1809 int get_ntforms(nt_forms_struct **list);
1810 int write_ntforms(nt_forms_struct **list, int number);
1811 void add_a_form(nt_forms_struct **list, FORM form, int *count);
1812 void update_a_form(nt_forms_struct **list, FORM form, int count);
1813 int get_ntdrivers(connection_struct *conn, fstring **list, char *architecture);
1814 void get_short_archi(char *short_archi, char *long_archi);
1815 void dump_a_param(NT_PRINTER_PARAM *param);
1816 BOOL add_a_specific_param(NT_PRINTER_INFO_LEVEL_2 *info_2, NT_PRINTER_PARAM *param);
1817 BOOL unlink_specific_param_if_exist(NT_PRINTER_INFO_LEVEL_2 *info_2, NT_PRINTER_PARAM *param);
1818 uint32 add_a_printer(NT_PRINTER_INFO_LEVEL printer, uint32 level);
1819 uint32 get_a_printer(NT_PRINTER_INFO_LEVEL *printer, uint32 level, fstring sharename);
1820 uint32 free_a_printer(NT_PRINTER_INFO_LEVEL printer, uint32 level);
1821 uint32 add_a_printer_driver(NT_PRINTER_DRIVER_INFO_LEVEL driver, uint32 level);
1822 uint32 get_a_printer_driver(NT_PRINTER_DRIVER_INFO_LEVEL *driver, uint32 level, 
1823                             fstring printername, fstring architecture);
1824 uint32 free_a_printer_driver(NT_PRINTER_DRIVER_INFO_LEVEL driver, uint32 level);
1825 BOOL get_specific_param_by_index(NT_PRINTER_INFO_LEVEL printer, uint32 level, uint32 param_index,
1826                                  fstring value, uint8 **data, uint32 *type, uint32 *len);
1827 BOOL get_specific_param(NT_PRINTER_INFO_LEVEL printer, uint32 level, 
1828                         fstring value, uint8 **data, uint32 *type, uint32 *len);
1829 void init_devicemode(NT_DEVICEMODE *nt_devmode);
1830
1831 /*The following definitions come from  printing/pcap.c  */
1832
1833 BOOL pcap_printername_ok(char *pszPrintername, char *pszPrintcapname);
1834 void pcap_printer_fn(void (*fn)(char *, char *));
1835
1836 /*The following definitions come from  printing/print_svid.c  */
1837
1838 void sysv_printer_fn(void (*fn)(char *, char *));
1839 int sysv_printername_ok(char *name);
1840
1841 /*The following definitions come from  printing/printing.c  */
1842
1843 void lpq_reset(int snum);
1844 void print_file(connection_struct *conn, files_struct *file);
1845 int get_printqueue(int snum, 
1846                    connection_struct *conn,print_queue_struct **queue,
1847                    print_status_struct *status);
1848 void del_printqueue(connection_struct *conn,int snum,int jobid);
1849 void status_printjob(connection_struct *conn,int snum,int jobid,int status);
1850 int printjob_encode(int snum, int job);
1851 void printjob_decode(int jobid, int *snum, int *job);
1852 void status_printqueue(connection_struct *conn,int snum,int status);
1853 void load_printers(void);
1854
1855 /*The following definitions come from  profile/profile.c  */
1856
1857 BOOL profile_setup(BOOL rdonly);
1858
1859 /*The following definitions come from  rpc_client/cli_atsvc.c  */
1860
1861 BOOL at_add_job(
1862                 char *srv_name, AT_JOB_INFO *info, char *command,
1863                 uint32 *jobid);
1864 BOOL at_del_job( char *srv_name, uint32 min_jobid, uint32 max_jobid);
1865 BOOL at_enum_jobs( char *srv_name, uint32 *num_jobs,
1866                   AT_ENUM_INFO *jobs, char ***commands);
1867 BOOL at_query_job(char *srv_name,
1868                   uint32 jobid, AT_JOB_INFO *job, fstring command);
1869
1870 /*The following definitions come from  rpc_client/cli_brs.c  */
1871
1872 BOOL brs_query_info( const char *srv_name, uint32 switch_value,
1873                         void *id);
1874
1875 /*The following definitions come from  rpc_client/cli_connect.c  */
1876
1877 void init_connections(void);
1878 void free_connections(void);
1879 void cli_connection_free(struct cli_connection *con);
1880 void cli_connection_unlink(struct cli_connection *con);
1881 BOOL cli_connection_init(const char* srv_name, const char* pipe_name,
1882                                 struct cli_connection **con);
1883 BOOL cli_connection_getsrv(const char* srv_name, const char* pipe_name,
1884                                 struct cli_connection **con);
1885 BOOL cli_connection_get(const POLICY_HND *pol, struct cli_connection **con);
1886 BOOL cli_pol_link(POLICY_HND *to, const POLICY_HND *from);
1887 BOOL cli_get_con_usr_sesskey(struct cli_connection *con, uchar usr_sess_key[16]);
1888 BOOL cli_get_con_sesskey(struct cli_connection *con, uchar sess_key[16]);
1889 BOOL cli_con_get_srvname(struct cli_connection *con, char *srv_name);
1890 BOOL cli_get_usr_sesskey(const POLICY_HND *pol, uchar usr_sess_key[16]);
1891 BOOL cli_get_sesskey(const POLICY_HND *pol, uchar sess_key[16]);
1892 BOOL cli_get_sesskey_srv(const char* srv_name, uchar sess_key[16]);
1893 void cli_con_gen_next_creds(struct cli_connection *con,
1894                                 DOM_CRED *new_clnt_cred);
1895 void cli_con_get_cli_cred(struct cli_connection *con,
1896                                 DOM_CRED *clnt_cred);
1897 BOOL cli_con_deal_with_creds(struct cli_connection *con,
1898                                 DOM_CRED *rcv_srv_cred);
1899 BOOL cli_con_set_creds(const char* srv_name, const uchar sess_key[16],
1900                                 DOM_CRED *cred);
1901 BOOL rpc_hnd_pipe_req(const POLICY_HND *hnd, uint8 op_num,
1902                       prs_struct *data, prs_struct *rdata);
1903 BOOL rpc_con_pipe_req(struct cli_connection *con, uint8 op_num,
1904                       prs_struct *data, prs_struct *rdata);
1905
1906 /*The following definitions come from  rpc_client/cli_eventlog.c  */
1907
1908 BOOL event_open(const char* srv_name, const char *log, POLICY_HND *hnd);
1909 BOOL event_close( POLICY_HND *hnd);
1910 BOOL event_numofeventlogrec( POLICY_HND *hnd, uint32 *number);
1911 BOOL event_readeventlog(POLICY_HND *hnd, 
1912                            uint32 number, uint32 flags, uint32 offset, 
1913                            uint32 *number_of_bytes, EVENTLOGRECORD *ev);
1914
1915 /*The following definitions come from  rpc_client/cli_login.c  */
1916
1917 uint32 cli_nt_setup_creds( const char* srv_name, const char* myhostname,
1918                                 const char* trust_acct,
1919                                 unsigned char trust_pwd[16],
1920                                 uint16 sec_chan);
1921 BOOL cli_nt_srv_pwset(const char* srv_name, const char* myhostname,
1922                                 const char* trust_acct,
1923                                 unsigned char *new_hashof_trust_pwd,
1924                                 uint16 sec_chan);
1925 BOOL cli_nt_login_interactive(const char* srv_name, const char* myhostname,
1926                                 const char *domain, const char *username, 
1927                                 uint32 luid_low, char *password,
1928                                 NET_ID_INFO_CTR *ctr,
1929                                 NET_USER_INFO_3 *user_info3);
1930 BOOL cli_nt_login_network(const char* srv_name, const char* myhostname,
1931                                 const char *domain, const char *username, 
1932                                 uint32 luid_low, char lm_chal[8],
1933                                 char lm_chal_resp[24],
1934                                 char nt_chal_resp[24],
1935                                 NET_ID_INFO_CTR *ctr,
1936                                 NET_USER_INFO_3 *user_info3);
1937 BOOL cli_nt_logoff(const char* srv_name, const char* myhostname,
1938                                 NET_ID_INFO_CTR *ctr);
1939 BOOL net_sam_sync(const char* srv_name, const char* myhostname,
1940                                 const char* trust_acct,
1941                                 uchar trust_passwd[16],
1942                                 SAM_DELTA_HDR hdr_deltas[MAX_SAM_DELTAS],
1943                                 SAM_DELTA_CTR deltas    [MAX_SAM_DELTAS],
1944                                 uint32 *num_deltas);
1945
1946 /*The following definitions come from  rpc_client/cli_lsarpc.c  */
1947
1948 BOOL get_domain_sids(const char *domain, DOM_SID *sid3, DOM_SID *sid5);
1949 BOOL get_trust_sid_and_domain(const char* myname, char *server,
1950                                 DOM_SID *sid,
1951                                 char *domain, size_t len);
1952 BOOL lsa_open_policy(const char *server_name, POLICY_HND *hnd,
1953                         BOOL sec_qos);
1954 BOOL lsa_open_policy2( const char *server_name, POLICY_HND *hnd,
1955                         BOOL sec_qos);
1956 BOOL lsa_open_secret( const POLICY_HND *hnd,
1957                                 const char *secret_name,
1958                                 uint32 des_access,
1959                                 POLICY_HND *hnd_secret);
1960 BOOL lsa_query_secret(POLICY_HND *hnd, STRING2 *secret,
1961                       NTTIME *last_update);
1962 BOOL lsa_lookup_names( POLICY_HND *hnd,
1963                         int num_names,
1964                         char **names,
1965                         DOM_SID **sids,
1966                         uint8 **types,
1967                         int *num_sids);
1968 BOOL lsa_lookup_sids(POLICY_HND *hnd,
1969                         int num_sids,
1970                         DOM_SID **sids,
1971                         char ***names,
1972                         uint8 **types,
1973                         int *num_names);
1974 BOOL lsa_query_info_pol(POLICY_HND *hnd, uint16 info_class,
1975                         fstring domain_name, DOM_SID *domain_sid);
1976 BOOL lsa_enum_trust_dom(POLICY_HND *hnd, uint32 *enum_ctx,
1977                         uint32 *num_doms, char ***names,
1978                         DOM_SID ***sids);
1979 BOOL lsa_close(POLICY_HND *hnd);
1980
1981 /*The following definitions come from  rpc_client/cli_netlogon.c  */
1982
1983 void gen_next_creds( struct cli_state *cli, DOM_CRED *new_clnt_cred);
1984 BOOL cli_net_logon_ctrl2(const char* srv_name, uint32 status_level);
1985 uint32 cli_net_auth2(const char *srv_name,
1986                                 const char *trust_acct, 
1987                                 const char *acct_name, 
1988                                 uint16 sec_chan, 
1989                                 uint32 neg_flags, DOM_CHAL *srv_chal);
1990 uint32 cli_net_req_chal( const char *srv_name, const char* myhostname,
1991                                 DOM_CHAL *clnt_chal, DOM_CHAL *srv_chal);
1992 BOOL cli_net_srv_pwset(const char* srv_name,
1993                                 const char* myhostname,
1994                                 const char* trust_acct,
1995                                 uint8 hashed_trust_pwd[16],
1996                                 uint16 sec_chan_type);
1997 BOOL cli_net_sam_logon(const char* srv_name, const char* myhostname,
1998                                 NET_ID_INFO_CTR *ctr, 
1999                                 NET_USER_INFO_3 *user_info3);
2000 BOOL cli_net_sam_logoff(const char* srv_name, const char* myhostname,
2001                                 NET_ID_INFO_CTR *ctr);
2002 BOOL cli_net_sam_sync( const char* srv_name, const char* myhostname,
2003                                 uint32 database_id,
2004                                 uint32 *num_deltas,
2005                                 SAM_DELTA_HDR *hdr_deltas,
2006                                 SAM_DELTA_CTR *deltas);
2007
2008 /*The following definitions come from  rpc_client/cli_netlogon_sync.c  */
2009
2010 BOOL synchronise_passdb(void);
2011
2012 /*The following definitions come from  rpc_client/cli_pipe.c  */
2013
2014 BOOL create_rpc_bind_resp(struct pwd_info *pwd,
2015                                 char *domain, char *user_name, char *my_name,
2016                                 uint32 ntlmssp_cli_flgs,
2017                                 uint32 rpc_call_id,
2018                                 prs_struct *rhdr,
2019                                 prs_struct *rhdr_autha,
2020                                 prs_struct *auth_resp);
2021 BOOL rpc_api_pipe_req(struct cli_state *cli, uint16 fnum, uint8 op_num,
2022                       prs_struct *data, prs_struct *rdata);
2023 void cli_nt_set_ntlmssp_flgs(struct cli_state *cli, uint32 ntlmssp_flgs);
2024 BOOL cli_nt_session_open(struct cli_state *cli, const char *pipe_name,
2025                 uint16* fnum);
2026 void cli_nt_session_close(struct cli_state *cli, uint16 fnum);
2027
2028 /*The following definitions come from  rpc_client/cli_reg.c  */
2029
2030 BOOL reg_connect( const char* srv_name,
2031                                 const char *full_keyname,
2032                                 char *key_name,
2033                                 POLICY_HND *reg_hnd);
2034 BOOL reg_open_hkcr( struct cli_connection *con,
2035                                 uint16 unknown_0, uint32 level,
2036                                 POLICY_HND *hnd);
2037 BOOL reg_open_hklm( struct cli_connection *con,
2038                                 uint16 unknown_0, uint32 level,
2039                                 POLICY_HND *hnd);
2040 BOOL reg_open_hku( struct cli_connection *con, 
2041                                 uint16 unknown_0, uint32 level,
2042                                 POLICY_HND *hnd);
2043 BOOL reg_flush_key( POLICY_HND *hnd);
2044 BOOL reg_query_key( POLICY_HND *hnd,
2045                                 char *key_class, uint32 *class_len,
2046                                 uint32 *num_subkeys, uint32 *max_subkeylen,
2047                                 uint32 *max_subkeysize, uint32 *num_values,
2048                                 uint32 *max_valnamelen, uint32 *max_valbufsize,
2049                                 uint32 *sec_desc, NTTIME *mod_time);
2050 BOOL reg_unknown_1a( POLICY_HND *hnd, uint32 *unk);
2051 BOOL reg_query_info( POLICY_HND *hnd,
2052                                 const char* val_name,
2053                                 uint32 *type, BUFFER2 *buffer);
2054 BOOL reg_set_key_sec( POLICY_HND *hnd,
2055                                 uint32 sec_info,
2056                                 uint32 sec_buf_size, SEC_DESC *sec_buf);
2057 BOOL reg_get_key_sec( POLICY_HND *hnd,
2058                                 uint32 sec_info,
2059                                 uint32 *sec_buf_size, SEC_DESC_BUF *sec_buf);
2060 BOOL reg_delete_val( POLICY_HND *hnd, char *val_name);
2061 BOOL reg_delete_key( POLICY_HND *hnd, char *key_name);
2062 BOOL reg_create_key( POLICY_HND *hnd,
2063                                 char *key_name, char *key_class,
2064                                 SEC_ACCESS *sam_access,
2065                                 POLICY_HND *key);
2066 BOOL reg_enum_key( POLICY_HND *hnd,
2067                                 int key_index, char *key_name,
2068                                 uint32 *unk_1, uint32 *unk_2,
2069                                 time_t *mod_time);
2070 BOOL reg_create_val( POLICY_HND *hnd,
2071                                 char *val_name, uint32 type, BUFFER3 *data);
2072 BOOL reg_enum_val( POLICY_HND *hnd,
2073                                 int val_index, int max_valnamelen, int max_valbufsize,
2074                                 fstring val_name,
2075                                 uint32 *val_type, BUFFER2 *value);
2076 BOOL reg_open_entry( POLICY_HND *hnd,
2077                                 char *key_name, uint32 unk_0,
2078                                 POLICY_HND *key_hnd);
2079 BOOL reg_close( POLICY_HND *hnd);
2080 BOOL reg_shutdown(const char *srv_name,
2081                         const char *msg, uint32 timeout, uint16 flags);
2082
2083 /*The following definitions come from  rpc_client/cli_samr.c  */
2084
2085 BOOL samr_chgpasswd_user( struct cli_connection *con, 
2086                 char *srv_name, char *user_name,
2087                 char nt_newpass[516], uchar nt_oldhash[16],
2088                 char lm_newpass[516], uchar lm_oldhash[16]);
2089 BOOL samr_unknown_38(struct cli_connection *con, char *srv_name);
2090 BOOL samr_query_dom_info(  POLICY_HND *domain_pol, uint16 switch_value,
2091                                 SAM_UNK_CTR *ctr);
2092 uint32 samr_enum_domains(  POLICY_HND *pol,
2093                                 uint32 *start_idx, uint32 size,
2094                                 struct acct_info **sam,
2095                                 uint32 *num_sam_domains);
2096 uint32 samr_enum_dom_groups(  POLICY_HND *pol,
2097                                 uint32 *start_idx, uint32 size,
2098                                 struct acct_info **sam,
2099                                 uint32 *num_sam_groups);
2100 uint32 samr_enum_dom_aliases(  POLICY_HND *pol,
2101                                 uint32 *start_idx, uint32 size,
2102                                 struct acct_info **sam,
2103                                 uint32 *num_sam_aliases);
2104 uint32 samr_enum_dom_users(  POLICY_HND *pol, uint32 *start_idx, 
2105                                 uint16 acb_mask, uint16 unk_1, uint32 size,
2106                                 struct acct_info **sam,
2107                                 uint32 *num_sam_users);
2108 BOOL samr_connect(  const char *srv_name, uint32 unknown_0,
2109                                 POLICY_HND *connect_pol);
2110 BOOL samr_open_user(  const POLICY_HND *pol,
2111                                 uint32 unk_0, uint32 rid, 
2112                                 POLICY_HND *user_pol);
2113 BOOL samr_open_alias(  const POLICY_HND *domain_pol,
2114                                 uint32 flags, uint32 rid,
2115                                 POLICY_HND *alias_pol);
2116 BOOL samr_del_aliasmem(  POLICY_HND *alias_pol, DOM_SID *sid);
2117 BOOL samr_add_aliasmem(  POLICY_HND *alias_pol, DOM_SID *sid);
2118 BOOL samr_delete_dom_alias(  POLICY_HND *alias_pol);
2119 uint32 samr_create_dom_user(  POLICY_HND *domain_pol, const char *acct_name,
2120                                 uint32 unk_0, uint32 unk_1,
2121                                 POLICY_HND *user_pol, uint32 *rid);
2122 BOOL samr_create_dom_alias(  POLICY_HND *domain_pol, const char *acct_name,
2123                                 POLICY_HND *alias_pol, uint32 *rid);
2124 BOOL samr_query_aliasinfo(  POLICY_HND *alias_pol, uint16 switch_value,
2125                                 ALIAS_INFO_CTR *ctr);
2126 BOOL samr_set_aliasinfo(  POLICY_HND *alias_pol, ALIAS_INFO_CTR *ctr);
2127 BOOL samr_open_group(  const POLICY_HND *domain_pol,
2128                                 uint32 flags, uint32 rid,
2129                                 POLICY_HND *group_pol);
2130 BOOL samr_del_groupmem(  POLICY_HND *group_pol, uint32 rid);
2131 BOOL samr_add_groupmem(  POLICY_HND *group_pol, uint32 rid);
2132 BOOL samr_delete_dom_group(  POLICY_HND *group_pol);
2133 BOOL samr_create_dom_group(  POLICY_HND *domain_pol, const char *acct_name,
2134                                 POLICY_HND *group_pol, uint32 *rid);
2135 BOOL samr_set_groupinfo(  POLICY_HND *group_pol, GROUP_INFO_CTR *ctr);
2136 BOOL samr_open_domain(  const POLICY_HND *connect_pol,
2137                                 uint32 ace_perms,
2138                                 const DOM_SID *sid,
2139                                 POLICY_HND *domain_pol);
2140 BOOL samr_query_lookup_domain(  POLICY_HND *pol, const char *dom_name,
2141                               DOM_SID *dom_sid);
2142 BOOL samr_query_lookup_names(  POLICY_HND *pol, uint32 flags,
2143                                 uint32 num_names, char **names,
2144                                 uint32 *num_rids,
2145                                 uint32 rid[MAX_LOOKUP_SIDS],
2146                                 uint32 type[MAX_LOOKUP_SIDS]);
2147 BOOL samr_query_lookup_rids(  const POLICY_HND *pol, uint32 flags,
2148                                 uint32 num_rids, uint32 *rids,
2149                                 uint32 *num_names,
2150                                 char   ***names,
2151                                 uint32 **type);
2152 BOOL samr_query_aliasmem(  const POLICY_HND *alias_pol, 
2153                                 uint32 *num_mem, DOM_SID2 *sid);
2154 BOOL samr_query_useraliases(  const POLICY_HND *pol,
2155                                 uint32 *ptr_sid, DOM_SID2 *sid,
2156                                 uint32 *num_aliases, uint32 **rid);
2157 BOOL samr_query_groupmem(  POLICY_HND *group_pol, 
2158                                 uint32 *num_mem, uint32 **rid, uint32 **attr);
2159 BOOL samr_query_usergroups(  POLICY_HND *pol, uint32 *num_groups,
2160                                 DOM_GID **gid);
2161 BOOL samr_query_groupinfo(  POLICY_HND *pol,
2162                                 uint16 switch_value, GROUP_INFO_CTR* ctr);
2163 BOOL samr_set_userinfo2(  POLICY_HND *pol, uint16 switch_value,
2164                                 void* usr);
2165 BOOL samr_set_userinfo(  POLICY_HND *pol, uint16 switch_value, void* usr);
2166 BOOL samr_query_userinfo(  POLICY_HND *pol, uint16 switch_value, void* usr);
2167 BOOL samr_close(  POLICY_HND *hnd);
2168 BOOL samr_query_dispinfo(  POLICY_HND *pol_domain, uint16 level,
2169                                 uint32 *num_entries,
2170                                 SAM_DISPINFO_CTR *ctr);
2171
2172 /*The following definitions come from  rpc_client/cli_spoolss.c  */
2173
2174 BOOL spoolss_enum_printers(uint32 flags, const char *srv_name,
2175                         uint32 level,
2176                         uint32 *count,
2177                         void ***printers);
2178 uint32 spoolss_enum_jobs( const POLICY_HND *hnd,
2179                         uint32 firstjob,
2180                         uint32 numofjobs,
2181                         uint32 level,
2182                         uint32 *buf_size,
2183                         uint32 *count,
2184                         void ***jobs);
2185 BOOL spoolss_open_printer_ex( const char *printername,
2186                         uint32 cbbuf, uint32 devmod, uint32 des_access,
2187                         const char *station, const char *username,
2188                         POLICY_HND *hnd);
2189 BOOL spoolss_closeprinter(POLICY_HND *hnd);
2190
2191 /*The following definitions come from  rpc_client/cli_srvsvc.c  */
2192
2193 BOOL srv_net_srv_tprt_enum(
2194                         const char *srv_name, 
2195                         uint32 switch_value, SRV_TPRT_INFO_CTR *ctr,
2196                         uint32 preferred_len,
2197                         ENUM_HND *hnd);
2198 BOOL srv_net_srv_conn_enum( char *srv_name, char *qual_name,
2199                         uint32 switch_value, SRV_CONN_INFO_CTR *ctr,
2200                         uint32 preferred_len,
2201                         ENUM_HND *hnd);
2202 BOOL srv_net_srv_sess_enum( char *srv_name, char *qual_name, char *user_name,
2203                         uint32 switch_value, SRV_SESS_INFO_CTR *ctr,
2204                         uint32 preferred_len,
2205                         ENUM_HND *hnd);
2206 BOOL srv_net_srv_share_enum( char *srv_name, 
2207                         uint32 switch_value, SRV_SHARE_INFO_CTR *ctr,
2208                         uint32 preferred_len,
2209                         ENUM_HND *hnd);
2210 BOOL srv_net_srv_file_enum( char *srv_name, char *qual_name, uint32 file_id,
2211                         uint32 switch_value, SRV_FILE_INFO_CTR *ctr,
2212                         uint32 preferred_len,
2213                         ENUM_HND *hnd);
2214 BOOL srv_net_srv_get_info( char *srv_name, uint32 switch_value,
2215                                 SRV_INFO_CTR *ctr);
2216 BOOL srv_net_remote_tod( char *srv_name, TIME_OF_DAY_INFO *tod);
2217
2218 /*The following definitions come from  rpc_client/cli_svcctl.c  */
2219
2220 BOOL svc_open_sc_man( const char *srv_name, char *db_name,
2221                                 uint32 des_access,
2222                                 POLICY_HND *hnd);
2223 BOOL svc_open_service( POLICY_HND *scm_hnd,
2224                                 const char *srv_name,
2225                                 uint32 des_access,
2226                                 POLICY_HND *hnd);
2227 BOOL svc_enum_svcs( POLICY_HND *hnd,
2228                                 uint32 services_type, uint32 services_state,
2229                                 uint32 *buf_size, uint32 *resume_hnd,
2230                                 uint32 *dos_error,
2231                                 ENUM_SRVC_STATUS **svcs, uint32 *num_svcs);
2232 BOOL svc_stop_service( POLICY_HND *hnd,
2233                                 uint32 unknown);
2234 BOOL svc_start_service( POLICY_HND *hnd,
2235                                 uint32 argc,
2236                                 char **argv);
2237 BOOL svc_query_svc_cfg( POLICY_HND *hnd,
2238                                 QUERY_SERVICE_CONFIG *cfg,
2239                                 uint32 *buf_size);
2240 BOOL svc_close(POLICY_HND *hnd);
2241 BOOL svc_change_svc_cfg( POLICY_HND *hnd,
2242                                 uint32 service_type, uint32 start_type,
2243                                 uint32 unknown_0,
2244                                 uint32 error_control,
2245                                 char* bin_path_name, char* load_order_grp, 
2246                                 uint32 tag_id,
2247                                 char* dependencies, char* service_start_name,
2248                                 char* password,
2249                                 char* disp_name);
2250
2251 /*The following definitions come from  rpc_client/cli_use.c  */
2252
2253 void init_cli_use(void);
2254 void free_cli_use(void);
2255 struct cli_state *cli_net_use_add(const char* srv_name,
2256                                 const struct ntuser_creds *usr_creds,
2257                                 BOOL redir,
2258                                 BOOL reuse);
2259 BOOL cli_net_use_del(const char* srv_name,
2260                                 const struct ntuser_creds *usr_creds,
2261                                 BOOL force_close,
2262                                 BOOL *connection_closed);
2263 void cli_net_use_enum(uint32 *num_cons, struct use_info ***use);
2264 void cli_use_wait_keyboard(void);
2265
2266 /*The following definitions come from  rpc_client/cli_wkssvc.c  */
2267
2268 BOOL wks_query_info( char *srv_name, uint32 switch_value,
2269                         WKS_INFO_100 *wks100);
2270
2271 /*The following definitions come from  rpc_client/msrpc_lsarpc.c  */
2272
2273 BOOL msrpc_lsa_query_secret(const char* srv_name,
2274                                 const char* secret_name,
2275                                 STRING2 *secret,
2276                                 NTTIME *last_update);
2277
2278 /*The following definitions come from  rpc_client/msrpc_samr.c  */
2279
2280 BOOL req_user_info( const POLICY_HND *pol_dom,
2281                                 const char *domain,
2282                                 const DOM_SID *sid,
2283                                 uint32 user_rid,
2284                                 USER_INFO_FN(usr_inf));
2285 uint32 sam_query_usergroups(
2286                                 const POLICY_HND *pol_dom,
2287                                 const char *domain,
2288                                 const DOM_SID *sid,
2289                                 uint32 user_rid,
2290                                 const char *user_name,
2291                                 uint32 *num_groups,
2292                                 DOM_GID **gid,
2293                                 char    ***name,
2294                                 uint32  **type,
2295                                 USER_MEM_FN(usr_mem));
2296 void msrpc_sam_user( const POLICY_HND *pol_dom, const POLICY_HND *pol_blt,
2297                         const char* domain,
2298                         const DOM_SID *sid1,
2299                         const DOM_SID *blt_sid1,
2300                         uint32 user_rid,
2301                         char  *user_name,
2302                         USER_FN(usr_fn),
2303                         USER_INFO_FN(usr_inf_fn),
2304                         USER_MEM_FN(usr_grp_fn),
2305                         USER_MEM_FN(usr_als_fn));
2306 BOOL msrpc_sam_query_user( const char* srv_name,
2307                         const char* domain,
2308                         const DOM_SID *sid,
2309                         char  *user_name,
2310                         USER_FN(usr_fn),
2311                         USER_INFO_FN(usr_inf_fn),
2312                         USER_MEM_FN(usr_grp_fn),
2313                         USER_MEM_FN(usr_als_fn));
2314 int msrpc_sam_enum_users( const char* srv_name,
2315                         const char* domain,
2316                         const DOM_SID *sid1,
2317                         struct acct_info **sam,
2318                         uint32 *num_sam_entries,
2319                         USER_FN(usr_fn),
2320                         USER_INFO_FN(usr_inf_fn),
2321                         USER_MEM_FN(usr_grp_fn),
2322                         USER_MEM_FN(usr_als_fn));
2323 BOOL sam_query_dominfo(const char* srv_name,
2324                                 const DOM_SID *sid1,
2325                                 uint32 switch_value, SAM_UNK_CTR *ctr);
2326 BOOL query_aliasinfo(
2327                                 const POLICY_HND *pol_dom,
2328                                 const char *domain,
2329                                 const DOM_SID *sid,
2330                                 uint32 alias_rid,
2331                                 ALIAS_INFO_FN(grp_inf));
2332 BOOL sam_query_aliasmem(const char *srv_name,
2333                                 const POLICY_HND *pol_dom,
2334                                 uint32 alias_rid,
2335                                 uint32 *num_names,
2336                                 DOM_SID ***sids,
2337                                 char ***name,
2338                                 uint8 **type);
2339 BOOL req_aliasmem_info(const char* srv_name,
2340                                 const POLICY_HND *pol_dom,
2341                                 const char *domain,
2342                                 const DOM_SID *sid,
2343                                 uint32 alias_rid,
2344                                 const char *alias_name,
2345                                 ALIAS_MEM_FN(als_mem));
2346 BOOL sam_query_groupmem(
2347                                 const POLICY_HND *pol_dom,
2348                                 uint32 group_rid,
2349                                 uint32 *num_names,
2350                                 uint32 **rid_mem,
2351                                 char ***name,
2352                                 uint32 **type);
2353 BOOL query_groupinfo( const POLICY_HND *pol_dom,
2354                                 const char *domain,
2355                                 const DOM_SID *sid,
2356                                 uint32 group_rid,
2357                                 GROUP_INFO_FN(grp_inf));
2358 BOOL req_groupmem_info( const POLICY_HND *pol_dom,
2359                                 const char *domain,
2360                                 const DOM_SID *sid,
2361                                 uint32 group_rid,
2362                                 const char *group_name,
2363                                 GROUP_MEM_FN(grp_mem));
2364 uint32 msrpc_sam_enum_domains( const char* srv_name,
2365                                 struct acct_info **sam,
2366                                 uint32 *num_sam_entries,
2367                                 DOMAIN_FN(dom_fn),
2368                                 DOMAIN_INFO_FN(dom_inf_fn));
2369 uint32 msrpc_sam_enum_groups( const char* srv_name,
2370                                 const char* domain,
2371                                 const DOM_SID *sid1,
2372                                 struct acct_info **sam,
2373                                 uint32 *num_sam_entries,
2374                                 GROUP_FN(grp_fn),
2375                                 GROUP_INFO_FN(grp_inf_fn),
2376                                 GROUP_MEM_FN(grp_mem_fn));
2377 uint32 msrpc_sam_enum_aliases( const char* srv_name,
2378                                 const char* domain,
2379                                 const DOM_SID *sid1,
2380                                 struct acct_info **sam,
2381                                 uint32 *num_sam_entries,
2382                                 ALIAS_FN(als_fn),
2383                                 ALIAS_INFO_FN(als_inf_fn),
2384                                 ALIAS_MEM_FN(als_mem_fn));
2385 BOOL create_samr_domain_user( POLICY_HND *pol_dom,
2386                                 char *acct_name, uint16 acb_info,
2387                                 const char* password, int plen,
2388                                 uint32 *rid);
2389 BOOL create_samr_domain_alias( POLICY_HND *pol_open_domain,
2390                                 const char *acct_name, const char *acct_desc,
2391                                 uint32 *rid);
2392 BOOL create_samr_domain_group(
2393                                 POLICY_HND *pol_open_domain,
2394                                 const char *acct_name, const char *acct_desc,
2395                                 uint32 *rid);
2396 BOOL get_samr_query_usergroups( const POLICY_HND *pol_open_domain,
2397                                 uint32 user_rid,
2398                                 uint32 *num_groups, DOM_GID **gid);
2399 BOOL delete_samr_dom_group(
2400                                 POLICY_HND *pol_open_domain,
2401                                 uint32 group_rid);
2402 BOOL get_samr_query_groupmem( 
2403                                 const POLICY_HND *pol_open_domain,
2404                                 uint32 group_rid, uint32 *num_mem,
2405                                 uint32 **rid, uint32 **attr);
2406 BOOL delete_samr_dom_alias( 
2407                                 POLICY_HND *pol_open_domain,
2408                                 uint32 alias_rid);
2409 BOOL get_samr_query_aliasmem( 
2410                                 const POLICY_HND *pol_open_domain,
2411                                 uint32 alias_rid, uint32 *num_mem, DOM_SID2 *sid);
2412 BOOL set_samr_set_userinfo2( 
2413                                 POLICY_HND *pol_open_domain,
2414                                 uint32 info_level,
2415                                 uint32 user_rid, void *usr);
2416 BOOL set_samr_set_userinfo( 
2417                                 POLICY_HND *pol_open_domain,
2418                                 uint32 info_level,
2419                                 uint32 user_rid, void *usr);
2420 BOOL get_samr_query_userinfo( 
2421                                 const POLICY_HND *pol_open_domain,
2422                                 uint32 info_level,
2423                                 uint32 user_rid, void *usr);
2424 BOOL get_samr_query_groupinfo( 
2425                                 const POLICY_HND *pol_open_domain,
2426                                 uint32 info_level,
2427                                 uint32 group_rid, GROUP_INFO_CTR *ctr);
2428 BOOL get_samr_query_aliasinfo( 
2429                                 const POLICY_HND *pol_open_domain,
2430                                 uint32 info_level,
2431                                 uint32 alias_rid, ALIAS_INFO_CTR *ctr);
2432 BOOL msrpc_sam_create_dom_user(const char* srv_name, DOM_SID *sid1,
2433                                 char *acct_name, uint16 acb_info,
2434                                 const char *password, int plen,
2435                                 uint32 *rid);
2436 BOOL msrpc_sam_query_dispinfo(const char* srv_name, const char* domain,
2437                                 DOM_SID *sid1,
2438                                 uint16 switch_value,
2439                                 uint32 *num_entries, SAM_DISPINFO_CTR *ctr,
2440                                 DISP_FN(disp_fn));
2441
2442 /*The following definitions come from  rpc_parse/parse_at.c  */
2443
2444 BOOL make_at_q_add_job(AT_Q_ADD_JOB *q_a, char *server,
2445                         AT_JOB_INFO *info, char *command);
2446 BOOL at_io_job_info(char *desc, AT_JOB_INFO *info, prs_struct *ps, int depth);
2447 BOOL at_io_q_add_job(char *desc, AT_Q_ADD_JOB *q_a, prs_struct *ps, int depth);
2448 BOOL at_io_r_add_job(char *desc, AT_R_ADD_JOB *r_a, prs_struct *ps, int depth);
2449 BOOL make_at_q_del_job(AT_Q_DEL_JOB *q_a, char *server, uint32 min_jobid,
2450                        uint32 max_jobid);
2451 BOOL at_io_q_del_job(char *desc, AT_Q_DEL_JOB *q_d, prs_struct *ps, int depth);
2452 BOOL at_io_r_del_job(char *desc, AT_R_DEL_JOB *r_d, prs_struct *ps, int depth);
2453 BOOL make_at_q_enum_jobs(AT_Q_ENUM_JOBS *q_e, char *server);
2454 BOOL at_io_q_enum_jobs(char *desc, AT_Q_ENUM_JOBS *q_e, prs_struct *ps, int depth);
2455 BOOL at_io_r_enum_jobs(char *desc, AT_R_ENUM_JOBS *r_e, prs_struct *ps, int depth);
2456 BOOL make_at_q_query_job(AT_Q_QUERY_JOB *q_q, char *server, uint32 jobid);
2457 BOOL at_io_q_query_job(char *desc, AT_Q_QUERY_JOB *q_q, prs_struct *ps, int depth);
2458 BOOL at_io_r_query_job(char *desc, AT_R_QUERY_JOB *r_q, prs_struct *ps, int depth);
2459
2460 /*The following definitions come from  rpc_parse/parse_brs.c  */
2461
2462 BOOL make_brs_q_query_info(BRS_Q_QUERY_INFO *q_u,
2463                                 const char *server, uint16 switch_value)  ;
2464 BOOL brs_io_q_query_info(char *desc, BRS_Q_QUERY_INFO *q_u, prs_struct *ps, int depth);
2465 BOOL make_brs_info_100(BRS_INFO_100 *inf);
2466 BOOL make_brs_r_query_info(BRS_R_QUERY_INFO *r_u,
2467                                 uint32 switch_value, void *inf,
2468                                 int status)  ;
2469 BOOL brs_io_r_query_info(char *desc,  BRS_R_QUERY_INFO *r_u, prs_struct *ps, int depth);
2470
2471 /*The following definitions come from  rpc_parse/parse_creds.c  */
2472
2473 BOOL make_creds_unix(CREDS_UNIX *r_u, const char* user_name);
2474 BOOL creds_io_unix(char *desc, CREDS_UNIX *r_u, prs_struct *ps, int depth);
2475 void creds_free_unix(CREDS_UNIX *r_u);
2476 BOOL make_creds_unix_sec(CREDS_UNIX_SEC *r_u,
2477                 uint32 uid, uint32 gid, uint32 num_grps, uint32 *grps);
2478 BOOL creds_io_unix_sec(char *desc, CREDS_UNIX_SEC *r_u, prs_struct *ps, int depth);
2479 void creds_free_unix_sec(CREDS_UNIX_SEC *r_u);
2480 BOOL creds_io_nt_sec(char *desc, CREDS_NT_SEC *r_u, prs_struct *ps, int depth);
2481 void creds_free_nt_sec(CREDS_NT_SEC *r_u);
2482 BOOL creds_io_pwd_info(char *desc, struct pwd_info *pwd, prs_struct *ps, int depth);
2483 BOOL creds_io_nt(char *desc, CREDS_NT *r_u, prs_struct *ps, int depth);
2484 void creds_free_nt(CREDS_NT *r_u);
2485 BOOL creds_io_hybrid(char *desc, CREDS_HYBRID *r_u, prs_struct *ps, int depth);
2486 void copy_unix_creds(CREDS_UNIX *to, const CREDS_UNIX *from);
2487 void copy_nt_sec_creds(CREDS_NT_SEC *to, const CREDS_NT_SEC *from);
2488 void copy_unix_sec_creds(CREDS_UNIX_SEC *to, const CREDS_UNIX_SEC *from);
2489 void copy_nt_creds(struct ntuser_creds *to,
2490                                 const struct ntuser_creds *from);
2491 void copy_user_creds(struct user_creds *to,
2492                                 const struct user_creds *from);
2493 void free_user_creds(struct user_creds *creds);
2494 BOOL creds_io_cmd(char *desc, CREDS_CMD *r_u, prs_struct *ps, int depth);
2495 BOOL create_ntuser_creds( prs_struct *ps,
2496                                 const char* name, 
2497                                 uint16 version, uint16 command,
2498                                 const struct ntuser_creds *ntu,
2499                                 BOOL reuse);
2500 BOOL create_user_creds( prs_struct *ps,
2501                                 const char* name, 
2502                                 uint16 version, uint16 command,
2503                                 const struct user_creds *usr);
2504
2505 /*The following definitions come from  rpc_parse/parse_eventlog.c  */
2506
2507 BOOL make_eventlog_q_open(EVENTLOG_Q_OPEN *q_u, const char *journal, char *unk);
2508 BOOL eventlog_io_q_open(char *desc, EVENTLOG_Q_OPEN *q_u, prs_struct *ps, int depth);
2509 BOOL eventlog_io_r_open(char *desc, EVENTLOG_R_OPEN *r_u, prs_struct *ps, int depth);
2510 BOOL make_eventlog_q_close(EVENTLOG_Q_CLOSE *q_u, POLICY_HND *pol);
2511 BOOL eventlog_io_q_close(char *desc, EVENTLOG_Q_CLOSE *q_u, prs_struct *ps, int depth);
2512 BOOL eventlog_io_r_close(char *desc, EVENTLOG_R_CLOSE *r_u, prs_struct *ps, int depth);
2513 BOOL make_eventlog_q_numofeventlogrec(EVENTLOG_Q_NUMOFEVENTLOGREC *q_u, POLICY_HND *pol);
2514 BOOL eventlog_io_q_numofeventlogrec(char *desc,EVENTLOG_Q_NUMOFEVENTLOGREC  *q_u, prs_struct *ps, int depth);
2515 BOOL eventlog_io_r_numofeventlogrec(char *desc, EVENTLOG_R_NUMOFEVENTLOGREC *r_u, prs_struct *ps, int depth);
2516 BOOL make_eventlog_q_readeventlog(EVENTLOG_Q_READEVENTLOG *q_u, POLICY_HND *pol,
2517                                   uint32 flags, uint32 offset, uint32 number_of_bytes);
2518 BOOL eventlog_io_q_readeventlog(char *desc, EVENTLOG_Q_READEVENTLOG *q_u, prs_struct *ps, int depth);
2519 BOOL eventlog_io_r_readeventlog(char *desc, EVENTLOG_R_READEVENTLOG *r_u, prs_struct *ps, int depth);
2520
2521 /*The following definitions come from  rpc_parse/parse_lsa.c  */
2522
2523 BOOL make_lsa_trans_name(LSA_TRANS_NAME *trn, UNISTR2 *uni_name,
2524                         uint32 sid_name_use, char *name, uint32 idx);
2525 BOOL make_lsa_sec_qos(LSA_SEC_QOS *qos, uint16 imp_lev, uint8 ctxt, uint8 eff,
2526                                 uint32 unknown);
2527 BOOL make_lsa_obj_attr(LSA_OBJ_ATTR *attr, uint32 attributes, LSA_SEC_QOS *qos);
2528 BOOL make_q_open_pol(LSA_Q_OPEN_POL *r_q, uint16 system_name,
2529                         uint32 attributes,
2530                         uint32 desired_access,
2531                         LSA_SEC_QOS *qos);
2532 BOOL lsa_io_q_open_pol(char *desc,  LSA_Q_OPEN_POL *r_q, prs_struct *ps, int depth);
2533 BOOL lsa_io_r_open_pol(char *desc,  LSA_R_OPEN_POL *r_p, prs_struct *ps, int depth);
2534 BOOL make_q_open_pol2(LSA_Q_OPEN_POL2 *r_q, const char *server_name,
2535                         uint32 attributes,
2536                         uint32 desired_access,
2537                         LSA_SEC_QOS *qos);
2538 BOOL lsa_io_q_open_pol2(char *desc,  LSA_Q_OPEN_POL2 *r_q, prs_struct *ps, int depth);
2539 BOOL lsa_io_r_open_pol2(char *desc,  LSA_R_OPEN_POL2 *r_p, prs_struct *ps, int depth);
2540 BOOL make_q_query(LSA_Q_QUERY_INFO *q_q, POLICY_HND *hnd, uint16 info_class);
2541 BOOL lsa_io_q_query(char *desc,  LSA_Q_QUERY_INFO *q_q, prs_struct *ps, int depth);
2542 BOOL make_q_open_secret(LSA_Q_OPEN_SECRET *q_o, const POLICY_HND *pol_hnd,
2543                         const char *secret_name, uint32 desired_access);
2544 BOOL lsa_io_q_open_secret(char *desc, LSA_Q_OPEN_SECRET *q_o, prs_struct *ps, int depth);
2545 BOOL lsa_io_r_open_secret(char *desc, LSA_R_OPEN_SECRET *r_o, prs_struct *ps, int depth);
2546 BOOL lsa_io_secret_value(char *desc, LSA_SECRET_VALUE *value, prs_struct *ps, int depth);
2547 BOOL lsa_io_secret_info(char *desc, LSA_SECRET_INFO *info, prs_struct *ps, int depth);
2548 BOOL make_q_query_secret(LSA_Q_QUERY_SECRET *q_q, POLICY_HND *pol);
2549 BOOL lsa_io_q_query_secret(char *desc, LSA_Q_QUERY_SECRET *q_q, prs_struct *ps, int depth);
2550 BOOL lsa_io_r_query_secret(char *desc, LSA_R_QUERY_SECRET *r_q, prs_struct *ps, int depth);
2551 BOOL make_q_enum_trust_dom(LSA_Q_ENUM_TRUST_DOM *q_e,
2552                                 POLICY_HND *pol,
2553                                 uint32 enum_context, uint32 preferred_len);
2554 BOOL lsa_io_q_enum_trust_dom(char *desc,  LSA_Q_ENUM_TRUST_DOM *q_e, prs_struct *ps, int depth);
2555 BOOL make_r_enum_trust_dom(LSA_R_ENUM_TRUST_DOM *r_e,
2556                                 int32 enum_context,
2557                                 char *domain_name, DOM_SID *domain_sid,
2558                                 uint32 status);
2559 BOOL lsa_io_r_enum_trust_dom(char *desc, LSA_R_ENUM_TRUST_DOM *r_e, prs_struct *ps, int depth);
2560 BOOL lsa_io_r_query(char *desc,  LSA_R_QUERY_INFO *r_q, prs_struct *ps, int depth);
2561 BOOL make_lsa_sid_enum(LSA_SID_ENUM *sen, uint32 num_entries, DOM_SID **sids);
2562 BOOL make_q_lookup_sids(LSA_Q_LOOKUP_SIDS *q_l, POLICY_HND *hnd,
2563                                 int num_sids, DOM_SID **sids,
2564                                 uint16 level);
2565 BOOL lsa_io_q_lookup_sids(char *desc, LSA_Q_LOOKUP_SIDS *q_s, prs_struct *ps, int depth);
2566 BOOL lsa_io_r_lookup_sids(char *desc,  LSA_R_LOOKUP_SIDS *r_s, prs_struct *ps, int depth);
2567 BOOL make_q_lookup_names(LSA_Q_LOOKUP_NAMES *q_l, POLICY_HND *hnd,
2568                                 uint32 num_names, char **names);
2569 BOOL lsa_io_q_lookup_names(char *desc,  LSA_Q_LOOKUP_NAMES *q_r, prs_struct *ps, int depth);
2570 BOOL lsa_io_r_lookup_names(char *desc,  LSA_R_LOOKUP_NAMES *r_r, prs_struct *ps, int depth);
2571 BOOL make_lsa_q_close(LSA_Q_CLOSE *q_c, POLICY_HND *hnd);
2572 BOOL lsa_io_q_close(char *desc,  LSA_Q_CLOSE *q_c, prs_struct *ps, int depth);
2573 BOOL lsa_io_r_close(char *desc,  LSA_R_CLOSE *r_c, prs_struct *ps, int depth);
2574
2575 /*The following definitions come from  rpc_parse/parse_misc.c  */
2576
2577 BOOL smb_io_bigint(char *desc, BIGINT *bigint, prs_struct *ps, int depth);
2578 BOOL smb_io_time(char *desc,  NTTIME *nttime, prs_struct *ps, int depth);
2579 BOOL smb_io_lookup_level(char *desc, LOOKUP_LEVEL *level, prs_struct *ps, int depth);
2580 uint32 get_enum_hnd(ENUM_HND *enh);
2581 BOOL make_enum_hnd(ENUM_HND *enh, uint32 hnd);
2582 BOOL smb_io_enum_hnd(char *desc,  ENUM_HND *hnd, prs_struct *ps, int depth);
2583 BOOL smb_io_dom_sid(char *desc,  DOM_SID *sid, prs_struct *ps, int depth);
2584 BOOL make_dom_sid2(DOM_SID2 *sid2, const DOM_SID *sid);
2585 BOOL smb_io_dom_sid2(char *desc,  DOM_SID2 *sid, prs_struct *ps, int depth);
2586 BOOL make_str_hdr(STRHDR *hdr, int max_len, int len, uint32 buffer);
2587 BOOL smb_io_strhdr(char *desc,  STRHDR *hdr, prs_struct *ps, int depth);
2588 BOOL make_strhdr2(STRHDR2 *hdr, uint32 max_len, uint32 len, uint32 buffer);
2589 BOOL smb_io_strhdr2(char *desc, STRHDR2 *hdr, prs_struct *ps, int depth);
2590 BOOL make_uni_hdr(UNIHDR *hdr, int len);
2591 BOOL smb_io_unihdr(char *desc,  UNIHDR *hdr, prs_struct *ps, int depth);
2592 BOOL make_buf_hdr(BUFHDR *hdr, int max_len, int len);
2593 BOOL smb_io_hdrbuf_pre(char *desc,  BUFHDR *hdr, prs_struct *ps, int depth, uint32 *offset);
2594 BOOL smb_io_hdrbuf_post(char *desc,  BUFHDR *hdr, prs_struct *ps, int depth, 
2595                                 uint32 ptr_hdrbuf, uint32 max_len, uint32 len);
2596 BOOL smb_io_hdrbuf(char *desc,  BUFHDR *hdr, prs_struct *ps, int depth);
2597 BOOL make_bufhdr2(BUFHDR2 *hdr, uint32 info_level, uint32 length, uint32 buffer);
2598 BOOL smb_io_bufhdr2(char *desc, BUFHDR2 *hdr, prs_struct *ps, int depth);
2599 BOOL make_uni_hdr2(UNIHDR2 *hdr, int len);
2600 BOOL smb_io_unihdr2(char *desc,  UNIHDR2 *hdr2, prs_struct *ps, int depth);
2601 BOOL make_unistr(UNISTR *str, char *buf);
2602 BOOL smb_io_unistr(char *desc,  UNISTR *uni, prs_struct *ps, int depth);
2603 BOOL make_buffer3_uint32(BUFFER3 *str, uint32 val);
2604 BOOL make_buffer3_str(BUFFER3 *str, const char *buf, int len);
2605 BOOL make_buffer3_hex(BUFFER3 *str, char *buf);
2606 BOOL make_buffer3_bytes(BUFFER3 *str, uint8 *buf, int len);
2607 BOOL smb_io_buffer3(char *desc,  BUFFER3 *buf3, prs_struct *ps, int depth);
2608 BOOL make_buffer4_str(BUFFER4 *str, const char *buf, int len);
2609 BOOL smb_io_buffer4(char *desc, BUFFER4 *buf4, uint32 buffer, prs_struct *ps, int depth);
2610 BOOL init_buffer5(BUFFER5 **str);
2611 BOOL clear_buffer5(BUFFER5 **str);
2612 BOOL make_buffer5(BUFFER5 *str, char *buf, int len);
2613 BOOL smb_io_buffer5(char *desc, BUFFER5 *buf5, prs_struct *ps, int depth);
2614 BOOL make_buffer2_multi(BUFFER2 *str, char *const* const buf, uint32 num);
2615 BOOL make_buffer2(BUFFER2 *str, const char *buf, int len);
2616 BOOL smb_io_buffer2(char *desc,  BUFFER2 *buf2, uint32 buffer, prs_struct *ps, int depth);
2617 BOOL make_buf_unistr2(UNISTR2 *str, uint32 *ptr, const char *buf);
2618 BOOL make_string2(STRING2 *str, const char *buf, int len);
2619 BOOL make_buf_string2(STRING2 *str, uint32 *ptr, const char *buf);
2620 BOOL smb_io_string2(char *desc,  STRING2 *str2, uint32 buffer, prs_struct *ps, int depth);
2621 BOOL make_unistr2(UNISTR2 *str, const char *buf, int len);
2622 BOOL smb_io_unistr2(char *desc,  UNISTR2 *uni2, uint32 buffer, prs_struct *ps, int depth);
2623 BOOL make_dom_rid2(DOM_RID2 *rid2, uint32 rid, uint8 type, uint32 idx);
2624 BOOL smb_io_dom_rid2(char *desc,  DOM_RID2 *rid2, prs_struct *ps, int depth);
2625 BOOL make_dom_rid3(DOM_RID3 *rid3, uint32 rid, uint8 type);
2626 BOOL smb_io_dom_rid3(char *desc,  DOM_RID3 *rid3, prs_struct *ps, int depth);
2627 BOOL make_log_info(DOM_LOG_INFO *log,
2628                 const char *logon_srv, const char *acct_name,
2629                 uint16 sec_chan, const char *comp_name);
2630 BOOL smb_io_log_info(char *desc,  DOM_LOG_INFO *log, prs_struct *ps, int depth);
2631 BOOL smb_io_chal(char *desc,  DOM_CHAL *chal, prs_struct *ps, int depth);
2632 BOOL smb_io_cred(char *desc,  DOM_CRED *cred, prs_struct *ps, int depth);
2633 BOOL make_clnt_info2(DOM_CLNT_INFO2 *clnt,
2634                                 const char *logon_srv, const char *comp_name,
2635                                 DOM_CRED *clnt_cred);
2636 BOOL smb_io_clnt_info2(char *desc,  DOM_CLNT_INFO2 *clnt, prs_struct *ps, int depth);
2637 BOOL make_clnt_info(DOM_CLNT_INFO *clnt,
2638                 const char *logon_srv, const char *acct_name,
2639                 uint16 sec_chan, const char *comp_name,
2640                                 DOM_CRED *cred);
2641 BOOL smb_io_clnt_info(char *desc,  DOM_CLNT_INFO *clnt, prs_struct *ps, int depth);
2642 BOOL make_owf_info(OWF_INFO *hash, uint8 data[16]);
2643 BOOL smb_io_owf_info(char *desc, OWF_INFO *hash, prs_struct *ps, int depth);
2644 BOOL smb_io_gid(char *desc,  DOM_GID *gid, prs_struct *ps, int depth);
2645 BOOL smb_io_pol_hnd(char *desc,  POLICY_HND *pol, prs_struct *ps, int depth);
2646 BOOL smb_io_dom_query_3(char *desc,  DOM_QUERY_3 *d_q, prs_struct *ps, int depth);
2647 BOOL smb_io_dom_query_5(char *desc,  DOM_QUERY_3 *d_q, prs_struct *ps, int depth);
2648 BOOL smb_io_unistr3(char *desc,  UNISTR3 *name, prs_struct *ps, int depth);
2649
2650 /*The following definitions come from  rpc_parse/parse_net.c  */
2651
2652 BOOL make_q_logon_ctrl2(NET_Q_LOGON_CTRL2 *q_l, 
2653                                 const char* srv_name,
2654                                 uint32 function_code,
2655                                 uint32 query_level,
2656                                 uint32 switch_value);
2657 BOOL net_io_q_logon_ctrl2(char *desc,  NET_Q_LOGON_CTRL2 *q_l, prs_struct *ps, int depth);
2658 BOOL make_r_logon_ctrl2(NET_R_LOGON_CTRL2 *r_l, uint32 query_level,
2659                                 uint32 flags, uint32 pdc_status, uint32 logon_attempts,
2660                                 uint32 tc_status, char *trusted_domain_name);
2661 BOOL net_io_r_logon_ctrl2(char *desc,  NET_R_LOGON_CTRL2 *r_l, prs_struct *ps, int depth);
2662 BOOL make_r_trust_dom(NET_R_TRUST_DOM_LIST *r_t,
2663                         uint32 num_doms, char **dom_name);
2664 BOOL net_io_r_trust_dom(char *desc,  NET_R_TRUST_DOM_LIST *r_t, prs_struct *ps, int depth);
2665 BOOL net_io_q_trust_dom(char *desc,  NET_Q_TRUST_DOM_LIST *q_l, prs_struct *ps, int depth);
2666 BOOL make_q_req_chal(NET_Q_REQ_CHAL *q_c,
2667                                 const char *logon_srv, const char *logon_clnt,
2668                                 DOM_CHAL *clnt_chal);
2669 BOOL net_io_q_req_chal(char *desc,  NET_Q_REQ_CHAL *q_c, prs_struct *ps, int depth);
2670 BOOL net_io_r_req_chal(char *desc,  NET_R_REQ_CHAL *r_c, prs_struct *ps, int depth);
2671 BOOL make_q_auth(NET_Q_AUTH *q_a,
2672                 const char *logon_srv, const char *acct_name,
2673                 uint16 sec_chan, const char *comp_name,
2674                 DOM_CHAL *clnt_chal);
2675 BOOL net_io_q_auth(char *desc,  NET_Q_AUTH *q_a, prs_struct *ps, int depth);
2676 BOOL net_io_r_auth(char *desc,  NET_R_AUTH *r_a, prs_struct *ps, int depth);
2677 BOOL make_q_auth_2(NET_Q_AUTH_2 *q_a,
2678                 const char *logon_srv, const char *acct_name,
2679                 uint16 sec_chan, const char *comp_name,
2680                 DOM_CHAL *clnt_chal, uint32 clnt_flgs);
2681 BOOL net_io_q_auth_2(char *desc,  NET_Q_AUTH_2 *q_a, prs_struct *ps, int depth);
2682 BOOL net_io_r_auth_2(char *desc,  NET_R_AUTH_2 *r_a, prs_struct *ps, int depth);
2683 BOOL make_q_srv_pwset(NET_Q_SRV_PWSET *q_s,
2684                                 const char *logon_srv, const char *acct_name, 
2685                                 uint16 sec_chan, const char *comp_name,
2686                                 DOM_CRED *cred, char nt_cypher[16]);
2687 BOOL net_io_q_srv_pwset(char *desc,  NET_Q_SRV_PWSET *q_s, prs_struct *ps, int depth);
2688 BOOL net_io_r_srv_pwset(char *desc,  NET_R_SRV_PWSET *r_s, prs_struct *ps, int depth);
2689 BOOL make_id_info1(NET_ID_INFO_1 *id, const char *domain_name,
2690                                 uint32 param_ctrl, uint32 log_id_low, uint32 log_id_high,
2691                                 const char *user_name, const char *wksta_name,
2692                                 char sess_key[16],
2693                                 unsigned char lm_cypher[16], unsigned char nt_cypher[16]);
2694 BOOL make_id_info2(NET_ID_INFO_2 *id, const char *domain_name,
2695                                 uint32 param_ctrl,
2696                                 uint32 log_id_low, uint32 log_id_high,
2697                                 const char *user_name, const char *wksta_name,
2698                                 unsigned char lm_challenge[8],
2699                                 unsigned char lm_chal_resp[24],
2700                                 unsigned char nt_chal_resp[24]);
2701 BOOL make_sam_info(DOM_SAM_INFO *sam,
2702                                 const char *logon_srv, const char *comp_name,
2703                                 DOM_CRED *clnt_cred,
2704                                 DOM_CRED *rtn_cred, uint16 logon_level,
2705                                 NET_ID_INFO_CTR *ctr);
2706 BOOL make_net_user_info3(NET_USER_INFO_3 *usr,
2707
2708         NTTIME *logon_time,
2709         NTTIME *logoff_time,
2710         NTTIME *kickoff_time,
2711         NTTIME *pass_last_set_time,
2712         NTTIME *pass_can_change_time,
2713         NTTIME *pass_must_change_time,
2714
2715         char *user_name,
2716         char *full_name,
2717         char *logon_script,
2718         char *profile_path,
2719         char *home_dir,
2720         char *dir_drive,
2721
2722         uint16 logon_count,
2723         uint16 bad_pw_count,
2724
2725         uint32 user_id,
2726         uint32 group_id,
2727         uint32 num_groups,
2728         DOM_GID *gids,
2729         uint32 user_flgs,
2730
2731         char sess_key[16],
2732
2733         char *logon_srv,
2734         char *logon_dom,
2735
2736         DOM_SID *dom_sid,
2737         char *other_sids);
2738 BOOL net_io_q_sam_logon(char *desc,  NET_Q_SAM_LOGON *q_l, prs_struct *ps, int depth);
2739 BOOL net_io_r_sam_logon(char *desc,  NET_R_SAM_LOGON *r_l, prs_struct *ps, int depth);
2740 BOOL net_io_q_sam_logoff(char *desc,  NET_Q_SAM_LOGOFF *q_l, prs_struct *ps, int depth);
2741 BOOL net_io_r_sam_logoff(char *desc,  NET_R_SAM_LOGOFF *r_l, prs_struct *ps, int depth);
2742 BOOL make_q_sam_sync(NET_Q_SAM_SYNC *q_s,
2743                                 const char *srv_name,
2744                                 const char *cli_name,
2745                                 DOM_CRED *cli_creds, uint32 database_id);
2746 BOOL net_io_q_sam_sync(char *desc, NET_Q_SAM_SYNC *q_s, prs_struct *ps, int depth);
2747 BOOL make_sam_delta_hdr(SAM_DELTA_HDR *delta, uint16 type, uint32 rid);
2748 BOOL make_sam_account_info(SAM_ACCOUNT_INFO *info, char *user_name,
2749                            char *full_name, uint32 user_rid, uint32 group_rid,
2750                            char *home_dir, char *dir_drive, char *logon_script,
2751                            char *acct_desc, uint32 acb_info, char *profile);
2752 BOOL net_io_r_sam_sync(char *desc, uint8 sess_key[16],
2753                                 NET_R_SAM_SYNC *r_s, prs_struct *ps, int depth);
2754
2755 /*The following definitions come from  rpc_parse/parse_prs.c  */
2756
2757 void prs_debug(prs_struct *ps, int depth, char *desc, char *fn_name);
2758 void prs_debug_out(prs_struct *ps, int level);
2759 void prs_init(prs_struct *ps, uint32 size,
2760                                 uint8 align, uint32 margin,
2761                                 BOOL io);
2762 void prs_mem_free(prs_struct *ps);
2763 void prs_link(prs_struct *prev, prs_struct *ps, prs_struct *next);
2764 void prs_align(prs_struct *ps);
2765 BOOL prs_grow(prs_struct *ps);
2766 BOOL _prs_uint8(char *name, prs_struct *ps, int depth, uint8 *data8);
2767 BOOL _prs_uint16(char *name, prs_struct *ps, int depth, uint16 *data16);
2768 BOOL _prs_hash1(prs_struct *ps, uint32 offset, uint8 sess_key[16]);
2769 BOOL _prs_uint32(char *name, prs_struct *ps, int depth, uint32 *data32);
2770 BOOL _prs_uint8s(BOOL charmode, char *name, prs_struct *ps, int depth, uint8 *data8s, int len);
2771 BOOL _prs_uint16s(BOOL charmode, char *name, prs_struct *ps, int depth, uint16 *data16s, int len);
2772 BOOL _prs_uint32s(BOOL charmode, char *name, prs_struct *ps, int depth, uint32 *data32s, int len);
2773 BOOL _prs_buffer2(BOOL charmode, char *name, prs_struct *ps, int depth, BUFFER2 *str);
2774 BOOL _prs_string2(BOOL charmode, char *name, prs_struct *ps, int depth, STRING2 *str);
2775 BOOL _prs_unistr2(BOOL charmode, char *name, prs_struct *ps, int depth, UNISTR2 *str);
2776 BOOL _prs_unistr3(BOOL charmode, char *name, UNISTR3 *str, prs_struct *ps, int depth);
2777 BOOL _prs_unistr(char *name, prs_struct *ps, int depth, UNISTR *str);
2778 BOOL _prs_string(char *name, prs_struct *ps, int depth, char *str, uint16 len, uint16 max_buf_size);
2779 BOOL _prs_uint16_pre(char *name, prs_struct *ps, int depth, uint16 *data16, uint32 *offset);
2780 BOOL _prs_uint16_post(char *name, prs_struct *ps, int depth, uint16 *data16,
2781                                 uint32 ptr_uint16, uint32 start_offset);
2782 BOOL _prs_uint32_pre(char *name, prs_struct *ps, int depth, uint32 *data32, uint32 *offset);
2783 BOOL _prs_uint32_post(char *name, prs_struct *ps, int depth, uint32 *data32,
2784                                 uint32 ptr_uint32, uint32 data_size);
2785
2786 /*The following definitions come from  rpc_parse/parse_reg.c  */
2787
2788 BOOL make_reg_q_open_hkcr(REG_Q_OPEN_HKCR *q_o,
2789                                 uint16 unknown_0, uint32 level);
2790 BOOL reg_io_q_open_hkcr(char *desc,  REG_Q_OPEN_HKCR *r_q, prs_struct *ps, int depth);
2791 BOOL reg_io_r_open_hkcr(char *desc,  REG_R_OPEN_HKCR *r_r, prs_struct *ps, int depth);
2792 BOOL make_reg_q_open_hklm(REG_Q_OPEN_HKLM *q_o,
2793                                 uint16 unknown_0, uint32 level);
2794 BOOL reg_io_q_open_hklm(char *desc,  REG_Q_OPEN_HKLM *r_q, prs_struct *ps, int depth);
2795 BOOL reg_io_r_open_hklm(char *desc,  REG_R_OPEN_HKLM *r_r, prs_struct *ps, int depth);
2796 BOOL make_reg_q_flush_key(REG_Q_FLUSH_KEY *q_u, POLICY_HND *pol);
2797 BOOL reg_io_q_flush_key(char *desc,  REG_Q_FLUSH_KEY *r_q, prs_struct *ps, int depth);
2798 BOOL reg_io_r_flush_key(char *desc,  REG_R_FLUSH_KEY *r_r, prs_struct *ps, int depth);
2799 BOOL make_reg_q_create_key(REG_Q_CREATE_KEY *q_c, POLICY_HND *hnd,
2800                                 char *key_name, char *key_class,
2801                                 SEC_ACCESS *sam_access,
2802                                 SEC_DESC_BUF *sec_buf,
2803                                 int sec_len, SEC_DESC *sec);
2804 BOOL reg_io_q_create_key(char *desc,  REG_Q_CREATE_KEY *r_q, prs_struct *ps, int depth);
2805 BOOL reg_io_r_create_key(char *desc,  REG_R_CREATE_KEY *r_r, prs_struct *ps, int depth);
2806 BOOL make_reg_q_delete_val(REG_Q_DELETE_VALUE *q_c, POLICY_HND *hnd,
2807                                 char *name);
2808 BOOL reg_io_q_delete_val(char *desc,  REG_Q_DELETE_VALUE *r_q, prs_struct *ps, int depth);
2809 BOOL reg_io_r_delete_val(char *desc,  REG_R_DELETE_VALUE *r_r, prs_struct *ps, int depth);
2810 BOOL make_reg_q_delete_key(REG_Q_DELETE_KEY *q_c, POLICY_HND *hnd,
2811                                 char *name);
2812 BOOL reg_io_q_delete_key(char *desc,  REG_Q_DELETE_KEY *r_q, prs_struct *ps, int depth);
2813 BOOL reg_io_r_delete_key(char *desc,  REG_R_DELETE_KEY *r_r, prs_struct *ps, int depth);
2814 BOOL make_reg_q_query_key(REG_Q_QUERY_KEY *q_o, POLICY_HND *hnd,
2815                                 uint32 max_class_len);
2816 BOOL reg_io_q_query_key(char *desc,  REG_Q_QUERY_KEY *r_q, prs_struct *ps, int depth);
2817 BOOL reg_io_r_query_key(char *desc,  REG_R_QUERY_KEY *r_r, prs_struct *ps, int depth);
2818 BOOL make_reg_q_unk_1a(REG_Q_UNK_1A *q_o, POLICY_HND *hnd);
2819 BOOL reg_io_q_unk_1a(char *desc,  REG_Q_UNK_1A *r_q, prs_struct *ps, int depth);
2820 BOOL reg_io_r_unk_1a(char *desc,  REG_R_UNK_1A *r_r, prs_struct *ps, int depth);
2821 BOOL make_reg_q_open_hku(REG_Q_OPEN_HKU *q_o,
2822                                 uint16 unknown_0, uint32 level);
2823 BOOL reg_io_q_open_hku(char *desc,  REG_Q_OPEN_HKU *r_q, prs_struct *ps, int depth);
2824 BOOL reg_io_r_open_hku(char *desc,  REG_R_OPEN_HKU *r_r, prs_struct *ps, int depth);
2825 BOOL make_reg_q_close(REG_Q_CLOSE *q_c, POLICY_HND *hnd);
2826 BOOL reg_io_q_close(char *desc,  REG_Q_CLOSE *q_u, prs_struct *ps, int depth);
2827 BOOL reg_io_r_close(char *desc,  REG_R_CLOSE *r_u, prs_struct *ps, int depth);
2828 BOOL make_reg_q_set_key_sec(REG_Q_SET_KEY_SEC *q_i, POLICY_HND *pol,
2829                                 uint32 sec_info,
2830                                 uint32 buf_len, SEC_DESC *sec_desc);
2831 BOOL reg_io_q_set_key_sec(char *desc,  REG_Q_SET_KEY_SEC *r_q, prs_struct *ps, int depth);
2832 BOOL reg_io_r_set_key_sec(char *desc, REG_R_SET_KEY_SEC *r_q, prs_struct *ps, int depth);
2833 BOOL make_reg_q_get_key_sec(REG_Q_GET_KEY_SEC *q_i, POLICY_HND *pol, 
2834                                 uint32 sec_info,
2835                                 uint32 buf_len, SEC_DESC_BUF *sec_buf);
2836 BOOL reg_io_q_get_key_sec(char *desc,  REG_Q_GET_KEY_SEC *r_q, prs_struct *ps, int depth);
2837 BOOL reg_io_r_get_key_sec(char *desc,  REG_R_GET_KEY_SEC *r_q, prs_struct *ps, int depth);
2838 BOOL make_reg_q_info(REG_Q_INFO *q_i, POLICY_HND *pol, const char *val_name,
2839                                 uint8 major, uint8 minor);
2840 BOOL reg_io_q_info(char *desc,  REG_Q_INFO *r_q, prs_struct *ps, int depth);
2841 BOOL make_reg_r_info(REG_R_INFO *r_r,
2842                                 uint32 *type, BUFFER2 *buf,
2843                                 uint32 status);
2844 BOOL reg_io_r_info(char *desc, REG_R_INFO *r_r, prs_struct *ps, int depth);
2845 BOOL make_reg_q_enum_val(REG_Q_ENUM_VALUE *q_i, POLICY_HND *pol,
2846                                 uint32 val_idx, uint32 max_val_len,
2847                                 uint32 max_buf_len);
2848 BOOL reg_io_q_enum_val(char *desc,  REG_Q_ENUM_VALUE *q_q, prs_struct *ps, int depth);
2849 BOOL reg_io_r_enum_val(char *desc,  REG_R_ENUM_VALUE *r_q, prs_struct *ps, int depth);
2850 BOOL make_reg_q_create_val(REG_Q_CREATE_VALUE *q_i, POLICY_HND *pol,
2851                                 char *val_name, uint32 type,
2852                                 BUFFER3 *val);
2853 BOOL reg_io_q_create_val(char *desc,  REG_Q_CREATE_VALUE *q_q, prs_struct *ps, int depth);
2854 BOOL reg_io_r_create_val(char *desc,  REG_R_CREATE_VALUE *r_q, prs_struct *ps, int depth);
2855 BOOL make_reg_q_enum_key(REG_Q_ENUM_KEY *q_i, POLICY_HND *pol, uint32 key_idx);
2856 BOOL reg_io_q_enum_key(char *desc,  REG_Q_ENUM_KEY *q_q, prs_struct *ps, int depth);
2857 BOOL reg_io_r_enum_key(char *desc,  REG_R_ENUM_KEY *r_q, prs_struct *ps, int depth);
2858 BOOL make_reg_q_open_entry(REG_Q_OPEN_ENTRY *r_q, POLICY_HND *pol,
2859                                 char *key_name, uint32 unk);
2860 BOOL reg_io_q_open_entry(char *desc,  REG_Q_OPEN_ENTRY *r_q, prs_struct *ps, int depth);
2861 BOOL make_reg_r_open_entry(REG_R_OPEN_ENTRY *r_r,
2862                                 POLICY_HND *pol, uint32 status);
2863 BOOL reg_io_r_open_entry(char *desc,  REG_R_OPEN_ENTRY *r_r, prs_struct *ps, int depth);
2864 BOOL make_reg_q_shutdown(REG_Q_SHUTDOWN *q_i,
2865                                 const char *msg, uint32 timeout, uint16 flags);
2866 BOOL reg_io_q_shutdown(char *desc,  REG_Q_SHUTDOWN *q_q, prs_struct *ps, int depth);
2867 BOOL reg_io_r_shutdown(char *desc,  REG_R_SHUTDOWN *r_q, prs_struct *ps, int depth);
2868
2869 /*The following definitions come from  rpc_parse/parse_rpc.c  */
2870
2871 BOOL make_rpc_hdr(RPC_HDR *hdr, enum RPC_PKT_TYPE pkt_type, uint8 flags,
2872                                 uint32 call_id, int data_len, int auth_len);
2873 BOOL smb_io_rpc_hdr(char *desc,  RPC_HDR *rpc, prs_struct *ps, int depth);
2874 BOOL smb_io_rpc_hdr_fault(char *desc,  RPC_HDR_FAULT *rpc, prs_struct *ps, int depth);
2875 BOOL make_rpc_hdr_rb(RPC_HDR_RB *rpc, 
2876                                 uint16 max_tsize, uint16 max_rsize, uint32 assoc_gid,
2877                                 uint32 num_elements, uint16 context_id, uint8 num_syntaxes,
2878                                 RPC_IFACE *abstract, RPC_IFACE *transfer);
2879 BOOL smb_io_rpc_hdr_rb(char *desc,  RPC_HDR_RB *rpc, prs_struct *ps, int depth);
2880 BOOL make_rpc_hdr_ba(RPC_HDR_BA *rpc, 
2881                                 uint16 max_tsize, uint16 max_rsize, uint32 assoc_gid,
2882                                 char *pipe_addr,
2883                                 uint8 num_results, uint16 result, uint16 reason,
2884                                 RPC_IFACE *transfer);
2885 BOOL smb_io_rpc_hdr_ba(char *desc,  RPC_HDR_BA *rpc, prs_struct *ps, int depth);
2886 BOOL make_rpc_hdr_req(RPC_HDR_REQ *hdr, uint32 alloc_hint, uint16 opnum);
2887 BOOL smb_io_rpc_hdr_req(char *desc,  RPC_HDR_REQ *rpc, prs_struct *ps, int depth);
2888 BOOL smb_io_rpc_hdr_resp(char *desc,  RPC_HDR_RESP *rpc, prs_struct *ps, int depth);
2889 BOOL make_rpc_hdr_autha(RPC_HDR_AUTHA *rai,
2890                                 uint16 max_tsize, uint16 max_rsize,
2891                                 uint8 auth_type, uint8 auth_level,
2892                                 uint8 stub_type_len);
2893 BOOL smb_io_rpc_hdr_autha(char *desc, RPC_HDR_AUTHA *rai, prs_struct *ps, int depth);
2894 BOOL rpc_hdr_auth_chk(RPC_HDR_AUTH *rai);
2895 BOOL make_rpc_hdr_auth(RPC_HDR_AUTH *rai,
2896                                 uint8 auth_type, uint8 auth_level,
2897                                 uint8 stub_type_len,
2898                                 uint32 ptr);
2899 BOOL smb_io_rpc_hdr_auth(char *desc, RPC_HDR_AUTH *rai, prs_struct *ps, int depth);
2900 BOOL rpc_auth_ntlmssp_verifier_chk(RPC_AUTH_NTLMSSP_VERIFIER *rav,
2901                                 char *signature, uint32 msg_type);
2902 BOOL make_rpc_auth_ntlmssp_verifier(RPC_AUTH_NTLMSSP_VERIFIER *rav,
2903                                 char *signature, uint32 msg_type);
2904 BOOL smb_io_rpc_auth_ntlmssp_verifier(char *desc, RPC_AUTH_NTLMSSP_VERIFIER *rav, prs_struct *ps, int depth);
2905 BOOL make_rpc_auth_ntlmssp_neg(RPC_AUTH_NTLMSSP_NEG *neg,
2906                                 uint32 neg_flgs,
2907                                 fstring myname, fstring domain);
2908 BOOL smb_io_rpc_auth_ntlmssp_neg(char *desc, RPC_AUTH_NTLMSSP_NEG *neg, prs_struct *ps, int depth);
2909 BOOL make_rpc_auth_ntlmssp_chal(RPC_AUTH_NTLMSSP_CHAL *chl,
2910                                 uint32 neg_flags,
2911                                 uint8 challenge[8]);
2912 BOOL smb_io_rpc_auth_ntlmssp_chal(char *desc, RPC_AUTH_NTLMSSP_CHAL *chl, prs_struct *ps, int depth);
2913 BOOL make_rpc_auth_ntlmssp_resp(RPC_AUTH_NTLMSSP_RESP *rsp,
2914                                 uchar lm_resp[24],
2915                                 uchar *nt_resp, size_t nt_len,
2916                                 char *domain, char *user, char *wks,
2917                                 uint32 neg_flags);
2918 BOOL smb_io_rpc_auth_ntlmssp_resp(char *desc, RPC_AUTH_NTLMSSP_RESP *rsp, prs_struct *ps, int depth);
2919 BOOL rpc_auth_ntlmssp_chk(RPC_AUTH_NTLMSSP_CHK *chk, uint32 crc32, uint32 seq_num);
2920 BOOL make_rpc_auth_ntlmssp_chk(RPC_AUTH_NTLMSSP_CHK *chk,
2921                                 uint32 ver, uint32 crc32, uint32 seq_num);
2922 BOOL smb_io_rpc_auth_ntlmssp_chk(char *desc, RPC_AUTH_NTLMSSP_CHK *chk, prs_struct *ps, int depth);
2923
2924 /*The following definitions come from  rpc_parse/parse_samr.c  */
2925
2926 BOOL make_samr_q_close_hnd(SAMR_Q_CLOSE_HND *q_c, POLICY_HND *hnd);
2927 BOOL samr_io_q_close_hnd(char *desc,  SAMR_Q_CLOSE_HND *q_u, prs_struct *ps, int depth);
2928 BOOL samr_io_r_close_hnd(char *desc,  SAMR_R_CLOSE_HND *r_u, prs_struct *ps, int depth);
2929 BOOL make_samr_q_lookup_domain(SAMR_Q_LOOKUP_DOMAIN *q_u,
2930                 POLICY_HND *pol, const char *dom_name);
2931 BOOL samr_io_q_lookup_domain(char *desc, SAMR_Q_LOOKUP_DOMAIN *q_u, prs_struct *ps, int depth);
2932 BOOL samr_io_r_lookup_domain(char *desc, SAMR_R_LOOKUP_DOMAIN *r_u, prs_struct *ps, int depth);
2933 BOOL make_samr_q_open_domain(SAMR_Q_OPEN_DOMAIN *q_u,
2934                                 const POLICY_HND *connect_pol, uint32 flags,
2935                                 const DOM_SID *sid);
2936 BOOL samr_io_q_open_domain(char *desc,  SAMR_Q_OPEN_DOMAIN *q_u, prs_struct *ps, int depth);
2937 BOOL samr_io_r_open_domain(char *desc,  SAMR_R_OPEN_DOMAIN *r_u, prs_struct *ps, int depth);
2938 BOOL make_samr_q_unknown_2c(SAMR_Q_UNKNOWN_2C *q_u, POLICY_HND *user_pol);
2939 BOOL samr_io_q_unknown_2c(char *desc,  SAMR_Q_UNKNOWN_2C *q_u, prs_struct *ps, int depth);
2940 BOOL make_samr_r_unknown_2c(SAMR_R_UNKNOWN_2C *q_u, uint32 status);
2941 BOOL samr_io_r_unknown_2c(char *desc,  SAMR_R_UNKNOWN_2C *r_u, prs_struct *ps, int depth);
2942 BOOL make_samr_q_unknown_3(SAMR_Q_UNKNOWN_3 *q_u,
2943                                 POLICY_HND *user_pol, uint16 switch_value);
2944 BOOL samr_io_q_unknown_3(char *desc,  SAMR_Q_UNKNOWN_3 *q_u, prs_struct *ps, int depth);
2945 BOOL make_samr_q_query_dom_info(SAMR_Q_QUERY_DOMAIN_INFO *q_u,
2946                                 POLICY_HND *domain_pol, uint16 switch_value);
2947 BOOL samr_io_q_query_dom_info(char *desc,  SAMR_Q_QUERY_DOMAIN_INFO *q_u, prs_struct *ps, int depth);
2948 BOOL make_unk_info3(SAM_UNK_INFO_3 *u_3);
2949 BOOL sam_io_unk_info3(char *desc, SAM_UNK_INFO_3 *u_3, prs_struct *ps, int depth);
2950 BOOL make_unk_info6(SAM_UNK_INFO_6 *u_6);
2951 BOOL sam_io_unk_info6(char *desc, SAM_UNK_INFO_6 *u_6, prs_struct *ps, int depth);
2952 BOOL make_unk_info7(SAM_UNK_INFO_7 *u_7);
2953 BOOL sam_io_unk_info7(char *desc, SAM_UNK_INFO_7 *u_7, prs_struct *ps, int depth);
2954 BOOL make_unk_info2(SAM_UNK_INFO_2 *u_2, char *domain, char *server);
2955 BOOL sam_io_unk_info2(char *desc, SAM_UNK_INFO_2 *u_2, prs_struct *ps, int depth);
2956 BOOL make_unk_info1(SAM_UNK_INFO_1 *u_1);
2957 BOOL sam_io_unk_info1(char *desc, SAM_UNK_INFO_1 *u_1, prs_struct *ps, int depth);
2958 BOOL make_samr_r_query_dom_info(SAMR_R_QUERY_DOMAIN_INFO *r_u, 
2959                                 uint16 switch_value, SAM_UNK_CTR *ctr,
2960                                 uint32 status);
2961 BOOL samr_io_r_query_dom_info(char *desc, SAMR_R_QUERY_DOMAIN_INFO *r_u, prs_struct *ps, int depth);
2962 BOOL make_dom_sid3(DOM_SID3 *sid3, uint16 unk_0, uint16 unk_1, DOM_SID *sid);
2963 BOOL make_samr_r_unknown_3(SAMR_R_UNKNOWN_3 *r_u,
2964                                 uint16 unknown_2, uint16 unknown_3,
2965                                 uint32 unknown_4, uint16 unknown_6, uint16 unknown_7,
2966                                 int num_sid3s, DOM_SID3 sid3[MAX_SAM_SIDS],
2967                                 uint32 status);
2968 BOOL samr_io_r_unknown_3(char *desc,  SAMR_R_UNKNOWN_3 *r_u, prs_struct *ps, int depth);
2969 BOOL make_samr_q_enum_dom_users(SAMR_Q_ENUM_DOM_USERS *q_e, POLICY_HND *pol,
2970                                 uint32 start_idx, 
2971                                 uint16 acb_mask, uint16 unk_1, uint32 size);
2972 BOOL samr_io_q_enum_dom_users(char *desc,  SAMR_Q_ENUM_DOM_USERS *q_e, prs_struct *ps, int depth);
2973 BOOL make_samr_r_enum_dom_users(SAMR_R_ENUM_DOM_USERS *r_u,
2974                 uint32 next_idx,
2975                 uint32 num_sam_entries, SAM_USER_INFO_21 pass[MAX_SAM_ENTRIES], uint32 status);
2976 BOOL samr_io_r_enum_dom_users(char *desc, SAMR_R_ENUM_DOM_USERS *r_u, prs_struct *ps, int depth);
2977 BOOL make_samr_q_query_dispinfo(SAMR_Q_QUERY_DISPINFO *q_e, POLICY_HND *pol,
2978                                 uint16 switch_level, uint32 start_idx,
2979                                 uint32 max_entries);
2980 BOOL samr_io_q_query_dispinfo(char *desc,  SAMR_Q_QUERY_DISPINFO *q_e, prs_struct *ps, int depth);
2981 BOOL make_sam_dispinfo_1(SAM_DISPINFO_1 *sam, uint32 *num_entries,
2982                          uint32 *data_size, uint32 start_idx,
2983                          SAM_USER_INFO_21 pass[MAX_SAM_ENTRIES]);
2984 BOOL make_sam_dispinfo_2(SAM_DISPINFO_2 *sam, uint32 *num_entries,
2985                          uint32 *data_size, uint32 start_idx,
2986                          SAM_USER_INFO_21 pass[MAX_SAM_ENTRIES]);
2987 BOOL make_sam_dispinfo_3(SAM_DISPINFO_3 *sam, uint32 *num_entries,
2988                          uint32 *data_size, uint32 start_idx,
2989                          DOMAIN_GRP *grp);
2990 BOOL make_sam_dispinfo_4(SAM_DISPINFO_4 *sam, uint32 *num_entries,
2991                          uint32 *data_size, uint32 start_idx,
2992                          SAM_USER_INFO_21 pass[MAX_SAM_ENTRIES]);
2993 BOOL make_sam_dispinfo_5(SAM_DISPINFO_5 *sam, uint32 *num_entries,
2994                          uint32 *data_size, uint32 start_idx,
2995                          DOMAIN_GRP *grp);
2996 BOOL make_samr_r_query_dispinfo(SAMR_R_QUERY_DISPINFO *r_u,
2997                                 uint32 num_entries, uint32 data_size,
2998                                 uint16 switch_level, SAM_DISPINFO_CTR *ctr,
2999                                 uint32 status);
3000 BOOL samr_io_r_query_dispinfo(char *desc, SAMR_R_QUERY_DISPINFO *r_u, prs_struct *ps, int depth);
3001 BOOL make_samr_q_open_group(SAMR_Q_OPEN_GROUP *q_c,
3002                                 const POLICY_HND *hnd, uint32 unk, uint32 rid);
3003 BOOL samr_io_q_open_group(char *desc,  SAMR_Q_OPEN_GROUP *q_u, prs_struct *ps, int depth);
3004 BOOL samr_io_r_open_group(char *desc,  SAMR_R_OPEN_GROUP *r_u, prs_struct *ps, int depth);
3005 BOOL make_samr_group_info1(GROUP_INFO1 *gr1,
3006                                 char *acct_name, char *acct_desc,
3007                                 uint32 num_members);
3008 BOOL samr_io_group_info1(char *desc,  GROUP_INFO1 *gr1, prs_struct *ps, int depth);
3009 BOOL make_samr_group_info4(GROUP_INFO4 *gr4, const char *acct_desc);
3010 BOOL samr_io_group_info4(char *desc,  GROUP_INFO4 *gr4, prs_struct *ps, int depth);
3011 BOOL samr_group_info_ctr(char *desc,  GROUP_INFO_CTR *ctr, prs_struct *ps, int depth);
3012 BOOL make_samr_q_create_dom_group(SAMR_Q_CREATE_DOM_GROUP *q_e,
3013                                 POLICY_HND *pol,
3014                                 const char *acct_desc);
3015 BOOL samr_io_q_create_dom_group(char *desc,  SAMR_Q_CREATE_DOM_GROUP *q_e, prs_struct *ps, int depth);
3016 BOOL make_samr_r_create_dom_group(SAMR_R_CREATE_DOM_GROUP *r_u, POLICY_HND *pol,
3017                 uint32 rid, uint32 status);
3018 BOOL samr_io_r_create_dom_group(char *desc,  SAMR_R_CREATE_DOM_GROUP *r_u, prs_struct *ps, int depth);
3019 BOOL make_samr_q_delete_dom_group(SAMR_Q_DELETE_DOM_GROUP *q_c, POLICY_HND *hnd);
3020 BOOL samr_io_q_delete_dom_group(char *desc,  SAMR_Q_DELETE_DOM_GROUP *q_u, prs_struct *ps, int depth);
3021 BOOL make_samr_r_delete_dom_group(SAMR_R_DELETE_DOM_GROUP *r_u,
3022                 uint32 status);
3023 BOOL samr_io_r_delete_dom_group(char *desc,  SAMR_R_DELETE_DOM_GROUP *r_u, prs_struct *ps, int depth);
3024 BOOL make_samr_q_del_groupmem(SAMR_Q_DEL_GROUPMEM *q_e,
3025                                 POLICY_HND *pol,
3026                                 uint32 rid);
3027 BOOL samr_io_q_del_groupmem(char *desc,  SAMR_Q_DEL_GROUPMEM *q_e, prs_struct *ps, int depth);
3028 BOOL make_samr_r_del_groupmem(SAMR_R_DEL_GROUPMEM *r_u, POLICY_HND *pol,
3029                 uint32 status);
3030 BOOL samr_io_r_del_groupmem(char *desc,  SAMR_R_DEL_GROUPMEM *r_u, prs_struct *ps, int depth);
3031 BOOL make_samr_q_add_groupmem(SAMR_Q_ADD_GROUPMEM *q_e,
3032                                 POLICY_HND *pol,
3033                                 uint32 rid);
3034 BOOL samr_io_q_add_groupmem(char *desc,  SAMR_Q_ADD_GROUPMEM *q_e, prs_struct *ps, int depth);
3035 BOOL make_samr_r_add_groupmem(SAMR_R_ADD_GROUPMEM *r_u, POLICY_HND *pol,
3036                 uint32 status);
3037 BOOL samr_io_r_add_groupmem(char *desc,  SAMR_R_ADD_GROUPMEM *r_u, prs_struct *ps, int depth);
3038 BOOL make_samr_q_set_groupinfo(SAMR_Q_SET_GROUPINFO *q_e,
3039                                 POLICY_HND *pol, GROUP_INFO_CTR *ctr);
3040 BOOL samr_io_q_set_groupinfo(char *desc,  SAMR_Q_SET_GROUPINFO *q_e, prs_struct *ps, int depth);
3041 BOOL make_samr_r_set_groupinfo(SAMR_R_SET_GROUPINFO *r_u, 
3042                 uint32 status);
3043 BOOL samr_io_r_set_groupinfo(char *desc,  SAMR_R_SET_GROUPINFO *r_u, prs_struct *ps, int depth);
3044 BOOL make_samr_q_query_groupinfo(SAMR_Q_QUERY_GROUPINFO *q_e,
3045                                 POLICY_HND *pol,
3046                                 uint16 switch_level);
3047 BOOL samr_io_q_query_groupinfo(char *desc,  SAMR_Q_QUERY_GROUPINFO *q_e, prs_struct *ps, int depth);
3048 BOOL make_samr_r_query_groupinfo(SAMR_R_QUERY_GROUPINFO *r_u, GROUP_INFO_CTR *ctr,
3049                 uint32 status);
3050 BOOL samr_io_r_query_groupinfo(char *desc,  SAMR_R_QUERY_GROUPINFO *r_u, prs_struct *ps, int depth);
3051 BOOL make_samr_q_query_groupmem(SAMR_Q_QUERY_GROUPMEM *q_c, POLICY_HND *hnd);
3052 BOOL samr_io_q_query_groupmem(char *desc,  SAMR_Q_QUERY_GROUPMEM *q_u, prs_struct *ps, int depth);
3053 BOOL make_samr_r_query_groupmem(SAMR_R_QUERY_GROUPMEM *r_u,
3054                 uint32 num_entries, uint32 *rid, uint32 *attr, uint32 status);
3055 BOOL samr_io_r_query_groupmem(char *desc,  SAMR_R_QUERY_GROUPMEM *r_u, prs_struct *ps, int depth);
3056 void samr_free_r_query_groupmem(SAMR_R_QUERY_GROUPMEM *r_u);
3057 BOOL make_samr_q_query_usergroups(SAMR_Q_QUERY_USERGROUPS *q_u,
3058                                 POLICY_HND *hnd);
3059 BOOL samr_io_q_query_usergroups(char *desc,  SAMR_Q_QUERY_USERGROUPS *q_u, prs_struct *ps, int depth);
3060 BOOL make_samr_r_query_usergroups(SAMR_R_QUERY_USERGROUPS *r_u,
3061                 uint32 num_gids, DOM_GID *gid, uint32 status);
3062 BOOL samr_io_r_query_usergroups(char *desc,  SAMR_R_QUERY_USERGROUPS *r_u, prs_struct *ps, int depth);
3063 BOOL make_samr_q_enum_domains(SAMR_Q_ENUM_DOMAINS *q_e, POLICY_HND *pol,
3064                                 uint32 start_idx, uint32 size);
3065 BOOL samr_io_q_enum_domains(char *desc, SAMR_Q_ENUM_DOMAINS *q_e, prs_struct *ps, int depth);
3066 BOOL make_samr_r_enum_domains(SAMR_R_ENUM_DOMAINS *r_u,
3067                 uint32 next_idx,
3068                 uint32 num_sam_entries, char **doms, uint32 status);
3069 BOOL samr_io_r_enum_domains(char *desc, SAMR_R_ENUM_DOMAINS *r_u, prs_struct *ps, int depth);
3070 BOOL make_samr_q_enum_dom_groups(SAMR_Q_ENUM_DOM_GROUPS *q_e, POLICY_HND *pol,
3071                                 uint32 start_idx, uint32 size);
3072 BOOL samr_io_q_enum_dom_groups(char *desc, SAMR_Q_ENUM_DOM_GROUPS *q_e, prs_struct *ps, int depth);
3073 BOOL make_samr_r_enum_dom_groups(SAMR_R_ENUM_DOM_GROUPS *r_u,
3074                 uint32 next_idx,
3075                 uint32 num_sam_entries, DOMAIN_GRP *grps, uint32 status);
3076 BOOL samr_io_r_enum_dom_groups(char *desc, SAMR_R_ENUM_DOM_GROUPS *r_u, prs_struct *ps, int depth);
3077 BOOL make_samr_q_enum_dom_aliases(SAMR_Q_ENUM_DOM_ALIASES *q_e, POLICY_HND *pol,
3078                                 uint32 start_idx, uint32 size);
3079 BOOL samr_io_q_enum_dom_aliases(char *desc,  SAMR_Q_ENUM_DOM_ALIASES *q_e, prs_struct *ps, int depth);
3080 BOOL make_samr_r_enum_dom_aliases(SAMR_R_ENUM_DOM_ALIASES *r_u,
3081                 uint32 next_idx,
3082                 uint32 num_sam_entries, LOCAL_GRP *alss, uint32 status);
3083 BOOL samr_io_r_enum_dom_aliases(char *desc, SAMR_R_ENUM_DOM_ALIASES *r_u, prs_struct *ps, int depth);
3084 BOOL make_samr_alias_info3(ALIAS_INFO3 *al3, const char *acct_desc);
3085 BOOL samr_io_alias_info3(char *desc,  ALIAS_INFO3 *al3, prs_struct *ps, int depth);
3086 BOOL samr_alias_info_ctr(char *desc,  ALIAS_INFO_CTR *ctr, prs_struct *ps, int depth);
3087 BOOL make_samr_q_query_aliasinfo(SAMR_Q_QUERY_ALIASINFO *q_e,
3088                                 POLICY_HND *pol,
3089                                 uint16 switch_level);
3090 BOOL samr_io_q_query_aliasinfo(char *desc,  SAMR_Q_QUERY_ALIASINFO *q_e, prs_struct *ps, int depth);
3091 BOOL make_samr_r_query_aliasinfo(SAMR_R_QUERY_ALIASINFO *r_u, ALIAS_INFO_CTR *ctr,
3092                 uint32 status);
3093 BOOL samr_io_r_query_aliasinfo(char *desc,  SAMR_R_QUERY_ALIASINFO *r_u, prs_struct *ps, int depth);
3094 BOOL make_samr_q_set_aliasinfo(SAMR_Q_SET_ALIASINFO *q_u, POLICY_HND *hnd,
3095                                 ALIAS_INFO_CTR *ctr);
3096 BOOL samr_io_q_set_aliasinfo(char *desc,  SAMR_Q_SET_ALIASINFO *q_u, prs_struct *ps, int depth);
3097 BOOL samr_io_r_set_aliasinfo(char *desc,  SAMR_R_SET_ALIASINFO *r_u, prs_struct *ps, int depth);
3098 BOOL make_samr_q_query_useraliases(SAMR_Q_QUERY_USERALIASES *q_u,
3099                                 const POLICY_HND *hnd,
3100                                 uint32 *ptr_sid, DOM_SID2 *sid);
3101 BOOL samr_io_q_query_useraliases(char *desc,  SAMR_Q_QUERY_USERALIASES *q_u, prs_struct *ps, int depth);
3102 void samr_free_q_query_useraliases(SAMR_Q_QUERY_USERALIASES *q_u);
3103 BOOL make_samr_r_query_useraliases(SAMR_R_QUERY_USERALIASES *r_u,
3104                 uint32 num_rids, uint32 *rid, uint32 status);
3105 BOOL samr_io_r_query_useraliases(char *desc,  SAMR_R_QUERY_USERALIASES *r_u, prs_struct *ps, int depth);
3106 void samr_free_r_query_useraliases(SAMR_R_QUERY_USERALIASES *r_u);
3107 BOOL make_samr_q_open_alias(SAMR_Q_OPEN_ALIAS *q_u, const POLICY_HND *pol,
3108                                 uint32 unknown_0, uint32 rid);
3109 BOOL samr_io_q_open_alias(char *desc,  SAMR_Q_OPEN_ALIAS *q_u, prs_struct *ps, int depth);
3110 BOOL samr_io_r_open_alias(char *desc,  SAMR_R_OPEN_ALIAS *r_u, prs_struct *ps, int depth);
3111 BOOL make_samr_q_lookup_rids(SAMR_Q_LOOKUP_RIDS *q_u,
3112                 const POLICY_HND *pol, uint32 flags,
3113                 uint32 num_rids, uint32 *rid);
3114 BOOL samr_io_q_lookup_rids(char *desc,  SAMR_Q_LOOKUP_RIDS *q_u, prs_struct *ps, int depth);
3115 void samr_free_q_lookup_rids(SAMR_Q_LOOKUP_RIDS *q_u);
3116 BOOL make_samr_r_lookup_rids(SAMR_R_LOOKUP_RIDS *r_u,
3117                 uint32 num_names, fstring *name, uint8 *type,
3118                 uint32 status);
3119 BOOL samr_io_r_lookup_rids(char *desc, SAMR_R_LOOKUP_RIDS *r_u, prs_struct *ps, int depth);
3120 void samr_free_r_lookup_rids(SAMR_R_LOOKUP_RIDS *r_u);
3121 BOOL make_samr_q_delete_alias(SAMR_Q_DELETE_DOM_ALIAS *q_u, POLICY_HND *hnd);
3122 BOOL samr_io_q_delete_alias(char *desc,  SAMR_Q_DELETE_DOM_ALIAS *q_u, prs_struct *ps, int depth);
3123 BOOL samr_io_r_delete_alias(char *desc,  SAMR_R_DELETE_DOM_ALIAS *r_u, prs_struct *ps, int depth);
3124 BOOL make_samr_q_create_dom_alias(SAMR_Q_CREATE_DOM_ALIAS *q_u, POLICY_HND *hnd,
3125                                 const char *acct_desc);
3126 BOOL samr_io_q_create_dom_alias(char *desc,  SAMR_Q_CREATE_DOM_ALIAS *q_u, prs_struct *ps, int depth);
3127 BOOL make_samr_r_create_dom_alias(SAMR_R_CREATE_DOM_ALIAS *r_u, POLICY_HND *pol,
3128                 uint32 rid, uint32 status);
3129 BOOL samr_io_r_create_dom_alias(char *desc,  SAMR_R_CREATE_DOM_ALIAS *r_u, prs_struct *ps, int depth);
3130 BOOL make_samr_q_add_aliasmem(SAMR_Q_ADD_ALIASMEM *q_u, POLICY_HND *hnd,
3131                                 DOM_SID *sid);
3132 BOOL samr_io_q_add_aliasmem(char *desc,  SAMR_Q_ADD_ALIASMEM *q_u, prs_struct *ps, int depth);
3133 BOOL samr_io_r_add_aliasmem(char *desc,  SAMR_R_ADD_ALIASMEM *r_u, prs_struct *ps, int depth);
3134 BOOL make_samr_q_del_aliasmem(SAMR_Q_DEL_ALIASMEM *q_u, POLICY_HND *hnd,
3135                                 DOM_SID *sid);
3136 BOOL samr_io_q_del_aliasmem(char *desc,  SAMR_Q_DEL_ALIASMEM *q_u, prs_struct *ps, int depth);
3137 BOOL samr_io_r_del_aliasmem(char *desc,  SAMR_R_DEL_ALIASMEM *r_u, prs_struct *ps, int depth);
3138 BOOL make_samr_q_delete_dom_alias(SAMR_Q_DELETE_DOM_ALIAS *q_c, POLICY_HND *hnd);
3139 BOOL samr_io_q_delete_dom_alias(char *desc,  SAMR_Q_DELETE_DOM_ALIAS *q_u, prs_struct *ps, int depth);
3140 BOOL make_samr_r_delete_dom_alias(SAMR_R_DELETE_DOM_ALIAS *r_u,
3141                 uint32 status);
3142 BOOL samr_io_r_delete_dom_alias(char *desc,  SAMR_R_DELETE_DOM_ALIAS *r_u, prs_struct *ps, int depth);
3143 BOOL make_samr_q_query_aliasmem(SAMR_Q_QUERY_ALIASMEM *q_c,
3144                                 const POLICY_HND *hnd);
3145 BOOL samr_io_q_query_aliasmem(char *desc,  SAMR_Q_QUERY_ALIASMEM *q_u, prs_struct *ps, int depth);
3146 BOOL make_samr_r_query_aliasmem(SAMR_R_QUERY_ALIASMEM *r_u,
3147                 uint32 num_sids, DOM_SID2 *sid, uint32 status);
3148 BOOL samr_io_r_query_aliasmem(char *desc,  SAMR_R_QUERY_ALIASMEM *r_u, prs_struct *ps, int depth);
3149 BOOL make_samr_q_lookup_names(SAMR_Q_LOOKUP_NAMES *q_u,
3150                 POLICY_HND *pol, uint32 flags,
3151                 uint32 num_names, char **name);
3152 BOOL samr_io_q_lookup_names(char *desc,  SAMR_Q_LOOKUP_NAMES *q_u, prs_struct *ps, int depth);
3153 BOOL make_samr_r_lookup_names(SAMR_R_LOOKUP_NAMES *r_u,
3154                 uint32 num_rids, uint32 *rid, uint8 *type, uint32 status);
3155 BOOL samr_io_r_lookup_names(char *desc,  SAMR_R_LOOKUP_NAMES *r_u, prs_struct *ps, int depth);
3156 BOOL make_samr_q_open_user(SAMR_Q_OPEN_USER *q_u,
3157                                 const POLICY_HND *pol,
3158                                 uint32 unk_0, uint32 rid);
3159 BOOL samr_io_q_open_user(char *desc,  SAMR_Q_OPEN_USER *q_u, prs_struct *ps, int depth);
3160 BOOL samr_io_r_open_user(char *desc,  SAMR_R_OPEN_USER *r_u, prs_struct *ps, int depth);
3161 BOOL make_samr_q_create_user(SAMR_Q_CREATE_USER *q_u,
3162                                 POLICY_HND *pol,
3163                                 const char *name,
3164                                 uint16 acb_info, uint32 unk_1);
3165 BOOL samr_io_q_create_user(char *desc,  SAMR_Q_CREATE_USER *q_u, prs_struct *ps, int depth);
3166 BOOL make_samr_r_create_user(SAMR_R_CREATE_USER *r_u,
3167                                 POLICY_HND *user_pol,
3168                                 uint32 unk_0, uint32 user_rid,
3169                                 uint32 status);
3170 BOOL samr_io_r_create_user(char *desc,  SAMR_R_CREATE_USER *r_u, prs_struct *ps, int depth);
3171 BOOL make_samr_q_query_userinfo(SAMR_Q_QUERY_USERINFO *q_u,
3172                                 POLICY_HND *hnd, uint16 switch_value);
3173 BOOL samr_io_q_query_userinfo(char *desc,  SAMR_Q_QUERY_USERINFO *q_u, prs_struct *ps, int depth);
3174 BOOL make_sam_user_info10(SAM_USER_INFO_10 *usr,
3175                                 uint32 acb_info);
3176 BOOL sam_io_user_info10(char *desc,  SAM_USER_INFO_10 *usr, prs_struct *ps, int depth);
3177 BOOL make_sam_user_info11(SAM_USER_INFO_11 *usr,
3178                                 NTTIME *expiry,
3179                                 char *mach_acct,
3180                                 uint32 rid_user,
3181                                 uint32 rid_group,
3182                                 uint16 acct_ctrl);
3183 BOOL sam_io_user_info11(char *desc,  SAM_USER_INFO_11 *usr, prs_struct *ps, int depth);
3184 BOOL make_sam_user_info24(SAM_USER_INFO_24 *usr,
3185         char newpass[516], uint16 passlen);
3186 BOOL make_sam_user_info23W(SAM_USER_INFO_23 *usr,
3187
3188         NTTIME *logon_time, /* all zeros */
3189         NTTIME *logoff_time, /* all zeros */
3190         NTTIME *kickoff_time, /* all zeros */
3191         NTTIME *pass_last_set_time, /* all zeros */
3192         NTTIME *pass_can_change_time, /* all zeros */
3193         NTTIME *pass_must_change_time, /* all zeros */
3194
3195         UNISTR2 *user_name, /* NULL */
3196         UNISTR2 *full_name,
3197         UNISTR2 *home_dir,
3198         UNISTR2 *dir_drive,
3199         UNISTR2 *log_scr,
3200         UNISTR2 *prof_path,
3201         UNISTR2 *desc,
3202         UNISTR2 *wkstas,
3203         UNISTR2 *unk_str,
3204         UNISTR2 *mung_dial,
3205
3206         uint32 user_rid, /* 0x0000 0000 */
3207         uint32 group_rid,
3208         uint16 acb_info, 
3209
3210         uint32 unknown_3,
3211         uint16 logon_divs,
3212         LOGON_HRS *hrs,
3213         uint32 unknown_5,
3214         char newpass[516],
3215         uint32 unknown_6);
3216 BOOL make_sam_user_info23A(SAM_USER_INFO_23 *usr,
3217
3218         NTTIME *logon_time, /* all zeros */
3219         NTTIME *logoff_time, /* all zeros */
3220         NTTIME *kickoff_time, /* all zeros */
3221         NTTIME *pass_last_set_time, /* all zeros */
3222         NTTIME *pass_can_change_time, /* all zeros */
3223         NTTIME *pass_must_change_time, /* all zeros */
3224
3225         char *user_name, /* NULL */
3226         char *full_name,
3227         char *home_dir,
3228         char *dir_drive,
3229         char *log_scr,
3230         char *prof_path,
3231         char *desc,
3232         char *wkstas,
3233         char *unk_str,
3234         char *mung_dial,
3235
3236         uint32 user_rid, /* 0x0000 0000 */
3237         uint32 group_rid,
3238         uint16 acb_info, 
3239
3240         uint32 unknown_3,
3241         uint16 logon_divs,
3242         LOGON_HRS *hrs,
3243         uint32 unknown_5,
3244         char newpass[516],
3245         uint32 unknown_6);
3246 BOOL make_sam_user_info21(SAM_USER_INFO_21 *usr,
3247
3248         NTTIME *logon_time,
3249         NTTIME *logoff_time,
3250         NTTIME *kickoff_time,
3251         NTTIME *pass_last_set_time,
3252         NTTIME *pass_can_change_time,
3253         NTTIME *pass_must_change_time,
3254
3255         char *user_name,
3256         char *full_name,
3257         char *home_dir,
3258         char *dir_drive,
3259         char *log_scr,
3260         char *prof_path,
3261         char *desc,
3262         char *wkstas,
3263         char *unk_str,
3264         char *mung_dial,
3265
3266         uint32 user_rid,
3267         uint32 group_rid,
3268         uint16 acb_info, 
3269
3270         uint32 unknown_3,
3271         uint16 logon_divs,
3272         LOGON_HRS *hrs,
3273         uint32 unknown_5,
3274         uint32 unknown_6);
3275 BOOL make_samr_r_query_userinfo(SAMR_R_QUERY_USERINFO *r_u,
3276                                 uint16 switch_value, void *info, uint32 status);
3277 BOOL samr_io_r_query_userinfo(char *desc,  SAMR_R_QUERY_USERINFO *r_u, prs_struct *ps, int depth);
3278 BOOL make_samr_q_set_userinfo(SAMR_Q_SET_USERINFO *q_u,
3279                                 POLICY_HND *hnd,
3280                                 uint16 switch_value, void *info);
3281 BOOL samr_io_q_set_userinfo(char *desc, SAMR_Q_SET_USERINFO *q_u, prs_struct *ps, int depth);
3282 void free_samr_q_set_userinfo(SAMR_Q_SET_USERINFO *q_u);
3283 BOOL make_samr_r_set_userinfo(SAMR_R_SET_USERINFO *r_u, uint32 status);
3284 BOOL samr_io_r_set_userinfo(char *desc,  SAMR_R_SET_USERINFO *r_u, prs_struct *ps, int depth);
3285 BOOL make_samr_q_set_userinfo2(SAMR_Q_SET_USERINFO2 *q_u,
3286                                 POLICY_HND *hnd,
3287                                 uint16 switch_value, void *info);
3288 BOOL samr_io_q_set_userinfo2(char *desc, SAMR_Q_SET_USERINFO2 *q_u, prs_struct *ps, int depth);
3289 void free_samr_q_set_userinfo2(SAMR_Q_SET_USERINFO2 *q_u);
3290 BOOL make_samr_r_set_userinfo2(SAMR_R_SET_USERINFO2 *r_u,
3291                                 uint32 status);
3292 BOOL samr_io_r_set_userinfo2(char *desc,  SAMR_R_SET_USERINFO2 *r_u, prs_struct *ps, int depth);
3293 BOOL make_samr_q_connect(SAMR_Q_CONNECT *q_u,
3294                                 const char *srv_name, uint32 unknown_0);
3295 BOOL samr_io_q_connect(char *desc,  SAMR_Q_CONNECT *q_u, prs_struct *ps, int depth);
3296 BOOL samr_io_r_connect(char *desc,  SAMR_R_CONNECT *r_u, prs_struct *ps, int depth);
3297 BOOL make_samr_q_connect_anon(SAMR_Q_CONNECT_ANON *q_u);
3298 BOOL samr_io_q_connect_anon(char *desc,  SAMR_Q_CONNECT_ANON *q_u, prs_struct *ps, int depth);
3299 BOOL samr_io_r_connect_anon(char *desc,  SAMR_R_CONNECT_ANON *r_u, prs_struct *ps, int depth);
3300 BOOL make_samr_q_unknown_38(SAMR_Q_UNKNOWN_38 *q_u, char *srv_name);
3301 BOOL samr_io_q_unknown_38(char *desc,  SAMR_Q_UNKNOWN_38 *q_u, prs_struct *ps, int depth);
3302 BOOL make_samr_r_unknown_38(SAMR_R_UNKNOWN_38 *r_u);
3303 BOOL samr_io_r_unknown_38(char *desc,  SAMR_R_UNKNOWN_38 *r_u, prs_struct *ps, int depth);
3304 BOOL make_enc_passwd(SAMR_ENC_PASSWD *pwd, char pass[512]);
3305 BOOL samr_io_enc_passwd(char *desc, SAMR_ENC_PASSWD *pwd, prs_struct *ps, int depth);
3306 BOOL make_enc_hash(SAMR_ENC_HASH *hsh, uchar hash[16]);
3307 BOOL samr_io_enc_hash(char *desc, SAMR_ENC_HASH *hsh, prs_struct *ps, int depth);
3308 BOOL make_samr_q_chgpasswd_user(SAMR_Q_CHGPASSWD_USER *q_u,
3309                                 char *dest_host, char *user_name,
3310                                 char nt_newpass[516], uchar nt_oldhash[16],
3311                                 char lm_newpass[516], uchar lm_oldhash[16]);
3312 BOOL samr_io_q_chgpasswd_user(char *desc, SAMR_Q_CHGPASSWD_USER *q_u, prs_struct *ps, int depth);
3313 BOOL make_samr_r_chgpasswd_user(SAMR_R_CHGPASSWD_USER *r_u, uint32 status);
3314 BOOL samr_io_r_chgpasswd_user(char *desc, SAMR_R_CHGPASSWD_USER *r_u, prs_struct *ps, int depth);
3315
3316 /*The following definitions come from  rpc_parse/parse_sec.c  */
3317
3318 BOOL make_sec_access(SEC_ACCESS *t, uint32 mask);
3319 BOOL sec_io_access(char *desc, SEC_ACCESS *t, prs_struct *ps, int depth);
3320 BOOL make_sec_ace(SEC_ACE *t, DOM_SID *sid, uint8 type, SEC_ACCESS mask, uint8 flag);
3321 BOOL sec_io_ace(char *desc, SEC_ACE *t, prs_struct *ps, int depth);
3322 BOOL make_sec_acl(SEC_ACL *t, uint16 revision, int num_aces, SEC_ACE *ace);
3323 void free_sec_acl(SEC_ACL *t);
3324 BOOL sec_io_acl(char *desc, SEC_ACL *t, prs_struct *ps, int depth);
3325 int make_sec_desc(SEC_DESC *t, uint16 revision, uint16 type,
3326                         DOM_SID *owner_sid, DOM_SID *grp_sid,
3327                                 SEC_ACL *sacl, SEC_ACL *dacl);
3328 void free_sec_desc(SEC_DESC *t);
3329 BOOL make_sec_desc_buf(SEC_DESC_BUF *buf, int len, SEC_DESC *data);
3330 void free_sec_desc_buf(SEC_DESC_BUF *buf);
3331 BOOL sec_io_desc_buf(char *desc, SEC_DESC_BUF *sec, prs_struct *ps, int depth);
3332
3333 /*The following definitions come from  rpc_parse/parse_spoolss.c  */
3334
3335 BOOL make_systemtime(SYSTEMTIME *systime, struct tm *unixtime);
3336 BOOL smb_io_notify_info_data_strings(char *desc,SPOOL_NOTIFY_INFO_DATA *data,
3337                                      prs_struct *ps, int depth);
3338 BOOL spoolss_io_r_open_printer_ex(char *desc, SPOOL_R_OPEN_PRINTER_EX *r_u, prs_struct *ps, int depth);
3339 BOOL make_spoolss_q_open_printer_ex(SPOOL_Q_OPEN_PRINTER_EX *q_u, 
3340                 const char *printername,
3341                 uint32 cbbuf, uint32 devmod, uint32 des_access,
3342                 const char *station,
3343                 const char *username);
3344 BOOL spoolss_io_q_open_printer_ex(char *desc, SPOOL_Q_OPEN_PRINTER_EX *q_u, prs_struct *ps, int depth);
3345 BOOL make_spoolss_q_getprinterdata(SPOOL_Q_GETPRINTERDATA *q_u,
3346                                 POLICY_HND *handle,
3347                                 char *valuename,
3348                                 uint32 size);
3349 BOOL spoolss_io_q_getprinterdata(char *desc, SPOOL_Q_GETPRINTERDATA *q_u, prs_struct *ps, int depth);
3350 BOOL spoolss_io_r_getprinterdata(char *desc, SPOOL_R_GETPRINTERDATA *r_u, prs_struct *ps, int depth);
3351 BOOL make_spoolss_q_closeprinter(SPOOL_Q_CLOSEPRINTER *q_u, POLICY_HND *hnd);
3352 BOOL spoolss_io_q_closeprinter(char *desc, SPOOL_Q_CLOSEPRINTER *q_u, prs_struct *ps, int depth);
3353 BOOL spoolss_io_r_closeprinter(char *desc, SPOOL_R_CLOSEPRINTER *r_u, prs_struct *ps, int depth);
3354 BOOL spoolss_io_q_startdocprinter(char *desc, SPOOL_Q_STARTDOCPRINTER *q_u, prs_struct *ps, int depth);
3355 BOOL spoolss_io_r_startdocprinter(char *desc, SPOOL_R_STARTDOCPRINTER *r_u, prs_struct *ps, int depth);
3356 BOOL spoolss_io_q_enddocprinter(char *desc, SPOOL_Q_ENDDOCPRINTER *q_u, prs_struct *ps, int depth);
3357 BOOL spoolss_io_r_enddocprinter(char *desc, SPOOL_R_ENDDOCPRINTER *r_u, prs_struct *ps, int depth);
3358 BOOL spoolss_io_q_startpageprinter(char *desc, SPOOL_Q_STARTPAGEPRINTER *q_u, prs_struct *ps, int depth);
3359 BOOL spoolss_io_r_startpageprinter(char *desc, SPOOL_R_STARTPAGEPRINTER *r_u, prs_struct *ps, int depth);
3360 BOOL spoolss_io_q_endpageprinter(char *desc, SPOOL_Q_ENDPAGEPRINTER *q_u, prs_struct *ps, int depth);
3361 BOOL spoolss_io_r_endpageprinter(char *desc, SPOOL_R_ENDPAGEPRINTER *r_u, prs_struct *ps, int depth);
3362 BOOL spoolss_io_q_writeprinter(char *desc, SPOOL_Q_WRITEPRINTER *q_u, prs_struct *ps, int depth);
3363 BOOL spoolss_io_r_writeprinter(char *desc, SPOOL_R_WRITEPRINTER *r_u, prs_struct *ps, int depth);
3364 BOOL spoolss_io_q_rffpcnex(char *desc, SPOOL_Q_RFFPCNEX *q_u,
3365                            prs_struct *ps, int depth);
3366 BOOL spoolss_io_r_rffpcnex(char *desc, SPOOL_R_RFFPCNEX *r_u, 
3367                            prs_struct *ps, int depth);
3368 BOOL spoolss_io_q_rfnpcnex(char *desc, SPOOL_Q_RFNPCNEX *q_u,
3369                            prs_struct *ps, int depth);
3370 BOOL spoolss_io_r_rfnpcnex(char *desc, 
3371                            SPOOL_R_RFNPCNEX *r_u, 
3372                            prs_struct *ps, int depth);
3373 BOOL spoolss_io_free_buffer(BUFFER *buffer);
3374 BOOL spoolss_io_q_getprinterdriver2(char *desc, 
3375                                     SPOOL_Q_GETPRINTERDRIVER2 *q_u,
3376                                     prs_struct *ps, int depth);
3377 BOOL spoolss_io_r_getprinterdriver2(char *desc, SPOOL_R_GETPRINTERDRIVER2 *r_u,
3378                                prs_struct *ps, int depth);
3379 BOOL make_spoolss_q_enumprinters(SPOOL_Q_ENUMPRINTERS *q_u,
3380                                 uint32 flags,
3381                                 const char* servername,
3382                                 uint32 level,
3383                                 uint32 size);
3384 BOOL spoolss_io_q_enumprinters(char *desc, SPOOL_Q_ENUMPRINTERS *q_u,
3385                                prs_struct *ps, int depth);
3386 void free_r_enumprinters(SPOOL_R_ENUMPRINTERS *r_u);
3387 BOOL spoolss_io_r_enumprinters(char *desc,
3388                                SPOOL_R_ENUMPRINTERS *r_u, 
3389                                prs_struct *ps, int depth);
3390 BOOL spoolss_io_r_getprinter(char *desc,
3391                                SPOOL_R_GETPRINTER *r_u, 
3392                                prs_struct *ps, int depth);
3393 BOOL make_spoolss_q_getprinter(SPOOL_Q_GETPRINTER *q_u,
3394                                 POLICY_HND *hnd,
3395                                 uint32 level,
3396                                 uint32 buf_size);
3397 BOOL spoolss_io_q_getprinter(char *desc, SPOOL_Q_GETPRINTER *q_u,
3398                                prs_struct *ps, int depth);
3399 BOOL spoolss_io_r_setprinter(char *desc, SPOOL_R_SETPRINTER *r_u, prs_struct *ps, int depth);
3400 BOOL spoolss_io_q_setprinter(char *desc, SPOOL_Q_SETPRINTER *q_u, prs_struct *ps, int depth);
3401 BOOL spoolss_io_r_fcpn(char *desc, SPOOL_R_FCPN *r_u, prs_struct *ps, int depth);
3402 BOOL spoolss_io_q_fcpn(char *desc, SPOOL_Q_FCPN *q_u, prs_struct *ps, int depth);
3403 BOOL spoolss_io_r_addjob(char *desc, SPOOL_R_ADDJOB *r_u, prs_struct *ps, int depth);
3404 BOOL spoolss_io_q_addjob(char *desc, SPOOL_Q_ADDJOB *q_u, prs_struct *ps, int depth);
3405 void free_r_enumjobs(SPOOL_R_ENUMJOBS *r_u);
3406 BOOL spoolss_io_r_enumjobs(char *desc, SPOOL_R_ENUMJOBS *r_u, prs_struct *ps, int depth);
3407 BOOL make_spoolss_q_enumjobs(SPOOL_Q_ENUMJOBS *q_u, const POLICY_HND *hnd,
3408                                 uint32 firstjob,
3409                                 uint32 numofjobs,
3410                                 uint32 level,
3411                                 uint32 buf_size);
3412 BOOL spoolss_io_q_enumjobs(char *desc, SPOOL_Q_ENUMJOBS *q_u, prs_struct *ps, int depth);
3413 BOOL spoolss_io_r_schedulejob(char *desc, SPOOL_R_SCHEDULEJOB *r_u, prs_struct *ps, int depth);
3414 BOOL spoolss_io_q_schedulejob(char *desc, SPOOL_Q_SCHEDULEJOB *q_u, prs_struct *ps, int depth);
3415 BOOL spoolss_io_r_setjob(char *desc, SPOOL_R_SETJOB *r_u, prs_struct *ps, int depth);
3416 BOOL spoolss_io_q_setjob(char *desc, SPOOL_Q_SETJOB *q_u, prs_struct *ps, int depth);
3417 BOOL spoolss_io_r_enumdrivers(char *desc, SPOOL_R_ENUMPRINTERDRIVERS *r_u, prs_struct *ps, int depth);
3418 BOOL spoolss_io_q_enumprinterdrivers(char *desc, SPOOL_Q_ENUMPRINTERDRIVERS *q_u, prs_struct *ps, int depth);
3419 BOOL spoolss_io_r_enumforms(char *desc, SPOOL_R_ENUMFORMS *r_u, prs_struct *ps, int depth);
3420 BOOL spoolss_io_q_enumforms(char *desc, SPOOL_Q_ENUMFORMS *q_u, prs_struct *ps, int depth);
3421 BOOL spoolss_io_r_enumports(char *desc, SPOOL_R_ENUMPORTS *r_u, prs_struct *ps, int depth);
3422 BOOL spoolss_io_q_enumports(char *desc, SPOOL_Q_ENUMPORTS *q_u, prs_struct *ps, int depth);
3423 BOOL spool_io_printer_info_level_2(char *desc, SPOOL_PRINTER_INFO_LEVEL_2 **q_u, prs_struct *ps, int depth);
3424 BOOL spool_io_printer_info_level(char *desc, SPOOL_PRINTER_INFO_LEVEL *il, prs_struct *ps, int depth);
3425 BOOL spool_io_user_level_1(char *desc, SPOOL_USER_LEVEL_1 **q_u, prs_struct *ps, int depth);
3426 BOOL spool_io_user_level(char *desc, SPOOL_USER_LEVEL *q_u, prs_struct *ps, int depth);
3427 BOOL spoolss_io_q_addprinterex(char *desc, SPOOL_Q_ADDPRINTEREX *q_u, prs_struct *ps, int depth);
3428 BOOL spoolss_io_r_addprinterex(char *desc, SPOOL_R_ADDPRINTEREX *r_u, prs_struct *ps, int depth);
3429 BOOL spool_io_printer_driver_info_level_3(char *desc, SPOOL_PRINTER_DRIVER_INFO_LEVEL_3 **q_u, 
3430                                           prs_struct *ps, int depth);
3431 BOOL uniarray_2_ascarray(BUFFER5 *buf5, char ***ar);
3432 BOOL smb_io_unibuffer(char *desc, UNISTR2 *buffer, prs_struct *ps, int depth);
3433 BOOL spool_io_printer_driver_info_level(char *desc, SPOOL_PRINTER_DRIVER_INFO_LEVEL *il, prs_struct *ps, int depth);
3434 BOOL spoolss_io_q_addprinterdriver(char *desc, SPOOL_Q_ADDPRINTERDRIVER *q_u, prs_struct *ps, int depth);
3435 BOOL spoolss_io_r_addprinterdriver(char *desc, SPOOL_R_ADDPRINTERDRIVER *q_u, prs_struct *ps, int depth);
3436 BOOL uni_2_asc_printer_driver_3(SPOOL_PRINTER_DRIVER_INFO_LEVEL_3 *uni,
3437                                 NT_PRINTER_DRIVER_INFO_LEVEL_3 **asc);
3438 BOOL uni_2_asc_printer_info_2(SPOOL_PRINTER_INFO_LEVEL_2 *uni,
3439                               NT_PRINTER_INFO_LEVEL_2  **asc);
3440 BOOL convert_printer_info(SPOOL_PRINTER_INFO_LEVEL uni,
3441                           NT_PRINTER_INFO_LEVEL *printer,
3442                           uint32 level);
3443 BOOL convert_printer_driver_info(SPOOL_PRINTER_DRIVER_INFO_LEVEL uni,
3444                                  NT_PRINTER_DRIVER_INFO_LEVEL *printer,
3445                                  uint32 level);
3446 BOOL convert_devicemode(DEVICEMODE devmode, NT_DEVICEMODE *nt_devmode);
3447 BOOL spoolss_io_r_getprinterdriverdir(char *desc, SPOOL_R_GETPRINTERDRIVERDIR *r_u, prs_struct *ps, int depth);
3448 BOOL spoolss_io_q_getprinterdriverdir(char *desc, SPOOL_Q_GETPRINTERDRIVERDIR *q_u, prs_struct *ps, int depth);
3449 BOOL spoolss_io_r_enumprintprocessors(char *desc, SPOOL_R_ENUMPRINTPROCESSORS *r_u, prs_struct *ps, int depth);
3450 BOOL spoolss_io_q_enumprintprocessors(char *desc, SPOOL_Q_ENUMPRINTPROCESSORS *q_u, prs_struct *ps, int depth);
3451 BOOL spoolss_io_r_enumprintmonitors(char *desc, SPOOL_R_ENUMPRINTMONITORS *r_u, prs_struct *ps, int depth);
3452 BOOL spoolss_io_q_enumprintmonitors(char *desc, SPOOL_Q_ENUMPRINTMONITORS *q_u, prs_struct *ps, int depth);
3453 BOOL spoolss_io_r_enumprinterdata(char *desc, SPOOL_R_ENUMPRINTERDATA *r_u, prs_struct *ps, int depth);
3454 BOOL spoolss_io_q_enumprinterdata(char *desc, SPOOL_Q_ENUMPRINTERDATA *q_u, prs_struct *ps, int depth);
3455 BOOL spoolss_io_q_setprinterdata(char *desc, SPOOL_Q_SETPRINTERDATA *q_u, prs_struct *ps, int depth);
3456 BOOL spoolss_io_r_setprinterdata(char *desc, SPOOL_R_SETPRINTERDATA *r_u, prs_struct *ps, int depth);
3457 BOOL convert_specific_param(NT_PRINTER_PARAM **param, UNISTR2 value , uint32 type, uint8 *data, uint32 len);
3458 BOOL spoolss_io_q_addform(char *desc, SPOOL_Q_ADDFORM *q_u, prs_struct *ps, int depth);
3459 BOOL spoolss_io_r_addform(char *desc, SPOOL_R_ADDFORM *r_u, prs_struct *ps, int depth);
3460 BOOL spoolss_io_q_setform(char *desc, SPOOL_Q_SETFORM *q_u, prs_struct *ps, int depth);
3461 BOOL spoolss_io_r_setform(char *desc, SPOOL_R_SETFORM *r_u, prs_struct *ps, int depth);
3462 BOOL spoolss_io_r_getjob(char *desc, SPOOL_R_GETJOB *r_u, prs_struct *ps, int depth);
3463 BOOL spoolss_io_q_getjob(char *desc, SPOOL_Q_GETJOB *q_u, prs_struct *ps, int depth);
3464
3465 /*The following definitions come from  rpc_parse/parse_srv.c  */
3466
3467 BOOL make_srv_share_info1_str(SH_INFO_1_STR *sh1, char *net_name, char *remark);
3468 BOOL make_srv_share_info1(SH_INFO_1 *sh1, char *net_name, uint32 type, char *remark);
3469 BOOL make_srv_share_info2_str(SH_INFO_2_STR *sh2,
3470                                 char *net_name, char *remark,
3471                                 char *path, char *pass);
3472 BOOL make_srv_share_info2(SH_INFO_2 *sh2,
3473                                 char *net_name, uint32 type, char *remark,
3474                                 uint32 perms, uint32 max_uses, uint32 num_uses,
3475                                 char *path, char *pass);
3476 BOOL make_srv_q_net_share_enum(SRV_Q_NET_SHARE_ENUM *q_n, 
3477                                 const char *srv_name, 
3478                                 uint32 share_level, SRV_SHARE_INFO_CTR *ctr,
3479                                 uint32 preferred_len,
3480                                 ENUM_HND *hnd);
3481 BOOL srv_io_q_net_share_enum(char *desc,  SRV_Q_NET_SHARE_ENUM *q_n, prs_struct *ps, int depth);
3482 BOOL srv_io_r_net_share_enum(char *desc,  SRV_R_NET_SHARE_ENUM *r_n, prs_struct *ps, int depth);
3483 BOOL make_srv_sess_info0_str(SESS_INFO_0_STR *ss0, char *name);
3484 BOOL make_srv_sess_info0(SESS_INFO_0 *ss0, char *name);
3485 BOOL make_srv_sess_info1_str(SESS_INFO_1_STR *ss1, char *name, char *user);
3486 BOOL make_srv_sess_info1(SESS_INFO_1 *ss1, 
3487                                 char *name, char *user,
3488                                 uint32 num_opens, uint32 open_time, uint32 idle_time,
3489                                 uint32 user_flags);
3490 BOOL make_srv_q_net_sess_enum(SRV_Q_NET_SESS_ENUM *q_n, 
3491                                 const char *srv_name, const char *qual_name,
3492                                 char *user_name,
3493                                 uint32 sess_level, SRV_SESS_INFO_CTR *ctr,
3494                                 uint32 preferred_len,
3495                                 ENUM_HND *hnd);
3496 BOOL srv_io_q_net_sess_enum(char *desc,  SRV_Q_NET_SESS_ENUM *q_n, prs_struct *ps, int depth);
3497 BOOL srv_io_r_net_sess_enum(char *desc,  SRV_R_NET_SESS_ENUM *r_n, prs_struct *ps, int depth);
3498 BOOL make_srv_conn_info0(CONN_INFO_0 *ss0, uint32 id);
3499 BOOL make_srv_conn_info1_str(CONN_INFO_1_STR *ss1, char *usr_name, char *net_name);
3500 BOOL make_srv_conn_info1(CONN_INFO_1 *ss1, 
3501                                 uint32 id, uint32 type,
3502                                 uint32 num_opens, uint32 num_users, uint32 open_time,
3503                                 char *usr_name, char *net_name);
3504 BOOL make_srv_q_net_conn_enum(SRV_Q_NET_CONN_ENUM *q_n, 
3505                                 const char *srv_name, const char *qual_name,
3506                                 uint32 conn_level, SRV_CONN_INFO_CTR *ctr,
3507                                 uint32 preferred_len,
3508                                 ENUM_HND *hnd);
3509 BOOL srv_io_q_net_conn_enum(char *desc,  SRV_Q_NET_CONN_ENUM *q_n, prs_struct *ps, int depth);
3510 BOOL srv_io_r_net_conn_enum(char *desc,  SRV_R_NET_CONN_ENUM *r_n, prs_struct *ps, int depth);
3511 BOOL make_srv_tprt_info0_str(TPRT_INFO_0_STR *tp0,
3512                                 char *trans_name,
3513                                 char *trans_addr, uint32 trans_addr_len,
3514                                 char *addr_name);
3515 BOOL make_srv_tprt_info0(TPRT_INFO_0 *tp0, 
3516                                 uint32 num_vcs, uint32 trans_addr_len,
3517                                 char *trans_name, char *trans_addr,
3518                                 char *addr_name);
3519 void free_srv_tprt_info_0(SRV_TPRT_INFO_0 *tp0);
3520 void free_srv_tprt_ctr(SRV_TPRT_INFO_CTR *ctr);
3521 BOOL make_srv_q_net_tprt_enum(SRV_Q_NET_TPRT_ENUM *q_n, 
3522                                 const char *srv_name, 
3523                                 uint32 tprt_level, SRV_TPRT_INFO_CTR *ctr,
3524                                 uint32 preferred_len,
3525                                 ENUM_HND *hnd);
3526 BOOL srv_io_q_net_tprt_enum(char *desc,  SRV_Q_NET_TPRT_ENUM *q_n, prs_struct *ps, int depth);
3527 BOOL srv_io_r_net_tprt_enum(char *desc,  SRV_R_NET_TPRT_ENUM *r_n, prs_struct *ps, int depth);
3528 BOOL make_srv_file_info3_str(FILE_INFO_3_STR *fi3, char *user_name, char *path_name);
3529 BOOL make_srv_file_info3(FILE_INFO_3 *fl3,
3530                                 uint32 id, uint32 perms, uint32 num_locks,
3531                                 char *path_name, char *user_name);
3532 BOOL make_srv_q_net_file_enum(SRV_Q_NET_FILE_ENUM *q_n, 
3533                                 const char *srv_name, const char *qual_name,
3534                                 uint32 file_id,
3535                                 uint32 file_level, SRV_FILE_INFO_CTR *ctr,
3536                                 uint32 preferred_len,
3537                                 ENUM_HND *hnd);
3538 BOOL srv_io_q_net_file_enum(char *desc,  SRV_Q_NET_FILE_ENUM *q_n, prs_struct *ps, int depth);
3539 BOOL srv_io_r_net_file_enum(char *desc,  SRV_R_NET_FILE_ENUM *r_n, prs_struct *ps, int depth);
3540 BOOL make_srv_info_101(SRV_INFO_101 *sv101, uint32 platform_id, char *name,
3541                                 uint32 ver_major, uint32 ver_minor,
3542                                 uint32 srv_type, char *comment);
3543 BOOL make_srv_info_102(SRV_INFO_102 *sv102, uint32 platform_id, char *name,
3544                                 char *comment, uint32 ver_major, uint32 ver_minor,
3545                                 uint32 srv_type, uint32 users, uint32 disc, uint32 hidden,
3546                                 uint32 announce, uint32 ann_delta, uint32 licenses,
3547                                 char *usr_path);
3548 BOOL make_srv_q_net_srv_get_info(SRV_Q_NET_SRV_GET_INFO *srv,
3549                                 char *server_name, uint32 switch_value);
3550 BOOL srv_io_q_net_srv_get_info(char *desc,  SRV_Q_NET_SRV_GET_INFO *q_n, prs_struct *ps, int depth);
3551 BOOL make_srv_r_net_srv_get_info(SRV_R_NET_SRV_GET_INFO *srv,
3552                                 uint32 switch_value, SRV_INFO_CTR *ctr, uint32 status);
3553 BOOL srv_io_r_net_srv_get_info(char *desc,  SRV_R_NET_SRV_GET_INFO *r_n, prs_struct *ps, int depth);
3554 BOOL make_srv_q_net_remote_tod(SRV_Q_NET_REMOTE_TOD *q_t, char *server_name);
3555 BOOL srv_io_q_net_remote_tod(char *desc,  SRV_Q_NET_REMOTE_TOD *q_n, prs_struct *ps, int depth);
3556 BOOL make_time_of_day_info(TIME_OF_DAY_INFO *tod, uint32 elapsedt, uint32 msecs,
3557                            uint32 hours, uint32 mins, uint32 secs, uint32 hunds,
3558                            uint32 zone, uint32 tintervals, uint32 day,
3559                            uint32 month, uint32 year, uint32 weekday);
3560 BOOL srv_io_r_net_remote_tod(char *desc, SRV_R_NET_REMOTE_TOD *r_n, prs_struct *ps, int depth);
3561
3562 /*The following definitions come from  rpc_parse/parse_svc.c  */
3563
3564 BOOL make_svc_q_open_sc_man(SVC_Q_OPEN_SC_MAN *q_u,
3565                                 const char *server, const char *database,
3566                                 uint32 des_access)  ;
3567 BOOL svc_io_q_open_sc_man(char *desc, SVC_Q_OPEN_SC_MAN *q_u, prs_struct *ps, int depth);
3568 BOOL make_svc_r_open_sc_man(SVC_R_OPEN_SC_MAN *r_u, POLICY_HND *hnd,
3569                                 uint32 status)  ;
3570 BOOL svc_io_r_open_sc_man(char *desc,  SVC_R_OPEN_SC_MAN *r_u, prs_struct *ps, int depth);
3571 BOOL make_svc_q_open_service(SVC_Q_OPEN_SERVICE *q_u,
3572                                 POLICY_HND *hnd,
3573                                 const char *server,
3574                                 uint32 des_access)  ;
3575 BOOL svc_io_q_open_service(char *desc, SVC_Q_OPEN_SERVICE *q_u, prs_struct *ps, int depth);
3576 BOOL make_svc_r_open_service(SVC_R_OPEN_SERVICE *r_u, POLICY_HND *hnd,
3577                                 uint32 status)  ;
3578 BOOL svc_io_r_open_service(char *desc,  SVC_R_OPEN_SERVICE *r_u, prs_struct *ps, int depth);
3579 BOOL make_svc_q_stop_service(SVC_Q_STOP_SERVICE *q_c, POLICY_HND *hnd,
3580                                 uint32 unk);
3581 BOOL svc_io_q_stop_service(char *desc, SVC_Q_STOP_SERVICE *q_s, prs_struct *ps, int depth);