c18d013f62f59734561a8050622d466f86a94b0e
[ira/wip.git] / source3 / 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);
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  lib/access.c  */
21
22 BOOL allow_access(char *deny_list,char *allow_list,
23                   char *cname,char *caddr);
24 BOOL check_access(int sock, char *allow_list, char *deny_list);
25
26 /*The following definitions come from  lib/bitmap.c  */
27
28 struct bitmap *bitmap_allocate(int n);
29 BOOL bitmap_set(struct bitmap *bm, unsigned i);
30 BOOL bitmap_clear(struct bitmap *bm, unsigned i);
31 BOOL bitmap_query(struct bitmap *bm, unsigned i);
32 int bitmap_find(struct bitmap *bm, unsigned ofs);
33
34 /*The following definitions come from  lib/charcnv.c  */
35
36 char *unix2dos_format(char *str,BOOL overwrite);
37 char *dos2unix_format(char *str, BOOL overwrite);
38 void interpret_character_set(char *str, int codepage);
39
40 /*The following definitions come from  lib/charset.c  */
41
42 void charset_initialise(void);
43 void codepage_initialise(int client_codepage);
44 void add_char_string(char *s);
45
46 /*The following definitions come from  lib/cmd_interp.c  */
47
48 void free_cmd_set_array(uint32 num_entries, struct command_set **entries);
49 struct command_set *add_cmd_set_to_array(uint32 *len,
50                                          struct command_set ***array,
51                                          const struct command_set *cmd);
52 void add_command_set(const struct command_set *cmds);
53 void cmd_set_no_autoconnect(void);
54 int command_main(int argc, char *argv[]);
55
56 /*The following definitions come from  lib/crc32.c  */
57
58 uint32 crc32_calc_buffer( char *buffer, uint32 count);
59
60 /*The following definitions come from  lib/debug.c  */
61
62 void debug_message(int msg_type, pid_t src, void *buf, size_t len);
63 void debug_message_send(pid_t pid, int level);
64 void setup_logging(char *pname, BOOL interactive);
65 void reopen_logs( void );
66 void force_check_log_size( void );
67 BOOL need_to_check_log_size( void );
68 void check_log_size( void );
69 void dbgflush( void );
70 BOOL dbghdr( int level, char *file, char *func, int line );
71
72 /*The following definitions come from  lib/doscalls.c  */
73
74 int dos_unlink(char *fname);
75 int dos_open(char *fname,int flags,mode_t mode);
76 DIR *dos_opendir(char *dname);
77 char *dos_readdirname(DIR *p);
78 int dos_chown(char *fname, uid_t uid, gid_t gid);
79 int dos_stat(char *fname,SMB_STRUCT_STAT *sbuf);
80 int dos_lstat(char *fname,SMB_STRUCT_STAT *sbuf);
81 int dos_mkdir(char *dname,mode_t mode);
82 int dos_rmdir(char *dname);
83 int dos_chdir(char *dname);
84 int dos_utime(char *fname,struct utimbuf *times);
85 int copy_reg(char *source, const char *dest);
86 int dos_rename(char *from, char *to);
87 int dos_chmod(char *fname,mode_t mode);
88 char *dos_getwd(char *unix_path);
89 BOOL dos_file_exist(char *fname,SMB_STRUCT_STAT *sbuf);
90 BOOL dos_directory_exist(char *dname,SMB_STRUCT_STAT *st);
91 time_t dos_file_modtime(char *fname);
92 SMB_OFF_T dos_file_size(char *file_name);
93
94 /*The following definitions come from  lib/error.c  */
95
96 uint32 map_nt_error_from_unix(int unix_error);
97
98 /*The following definitions come from  lib/fault.c  */
99
100 void fault_setup(void (*fn)(void *));
101
102 /*The following definitions come from  lib/fsusage.c  */
103
104 int sys_fsusage(const char *path, SMB_BIG_UINT *dfree, SMB_BIG_UINT *dsize);
105
106 /*The following definitions come from  lib/genrand.c  */
107
108 void generate_random_buffer( unsigned char *out, int len, BOOL re_seed);
109
110 /*The following definitions come from  lib/getsmbpass.c  */
111
112 char *getsmbpass(char *prompt)    ;
113
114 /*The following definitions come from  lib/hash.c  */
115
116 BOOL hash_table_init(hash_table *table, int num_buckets, compare_function compare_func);
117 int string_hash(int hash_size, const char *key);
118 hash_element *hash_lookup(hash_table *table, char *key);
119 hash_element *hash_insert(hash_table *table, char *value, char *key);
120 void hash_remove(hash_table *table, hash_element *hash_elem);
121 BOOL hash_clear(hash_table *table);
122
123 /*The following definitions come from  lib/interface.c  */
124
125 void load_interfaces(void);
126 BOOL interfaces_changed(void);
127 BOOL ismyip(struct in_addr ip);
128 BOOL is_local_net(struct in_addr from);
129 int iface_count(void);
130 BOOL we_are_multihomed(void);
131 struct interface *get_interface(int n);
132 struct in_addr *iface_n_ip(int n);
133 struct in_addr *iface_n_bcast(int n);
134 unsigned iface_hash(void);
135 struct in_addr *iface_bcast(struct in_addr ip);
136 struct in_addr *iface_ip(struct in_addr ip);
137
138 /*The following definitions come from  lib/interfaces.c  */
139
140 int get_interfaces(struct iface_struct *ifaces, int max_interfaces);
141
142 /*The following definitions come from  lib/kanji.c  */
143
144 void interpret_coding_system(char *str);
145 void initialize_multibyte_vectors( int client_codepage);
146
147 /*The following definitions come from  lib/md4.c  */
148
149 void mdfour(unsigned char *out, unsigned char *in, int n);
150
151 /*The following definitions come from  lib/messages.c  */
152
153 void ping_message(int msg_type, pid_t src, void *buf, size_t len);
154 void debuglevel_message(int msg_type, pid_t src, void *buf, size_t len);
155 BOOL message_init(void);
156 BOOL message_send_pid(pid_t pid, int msg_type, void *buf, size_t len);
157 void message_dispatch(void);
158 void message_register(int msg_type, 
159                       void (*fn)(int msg_type, pid_t pid, void *buf, size_t len));
160 void message_deregister(int msg_type);
161 BOOL message_send_all(int msg_type, void *buf, size_t len);
162
163 /*The following definitions come from  lib/ms_fnmatch.c  */
164
165 int ms_fnmatch(char *pattern, char *string);
166
167 /*The following definitions come from  lib/msrpc-client.c  */
168
169 BOOL receive_msrpc(int fd, prs_struct *data, unsigned int timeout);
170 BOOL msrpc_send(int fd, prs_struct *ps);
171 BOOL msrpc_receive(int fd, prs_struct *ps);
172 BOOL msrpc_connect(struct msrpc_state *msrpc, const char *pipe_name);
173 void msrpc_init_creds(struct msrpc_state *msrpc, const struct user_creds *usr);
174 void msrpc_close_socket(struct msrpc_state *msrpc);
175 void msrpc_sockopt(struct msrpc_state *msrpc, char *options);
176 BOOL msrpc_connect_auth(struct msrpc_state *msrpc,
177                                 uint32 pid,
178                                 const char* pipename,
179                                 const struct user_creds *usr);
180 struct msrpc_state *msrpc_initialise(struct msrpc_state *msrpc, uint32 pid);
181 void msrpc_shutdown(struct msrpc_state *msrpc);
182 BOOL msrpc_establish_connection(struct msrpc_state *msrpc,
183                 const char *pipe_name);
184
185 /*The following definitions come from  lib/msrpc_use.c  */
186
187 #if OLD_NTDOMAIN
188 void init_msrpc_use(void);
189 void free_msrpc_use(void);
190 struct msrpc_state *msrpc_use_add(const char* pipe_name,
191                                 uint32 pid,
192                                 const struct user_creds *usr_creds,
193                                 BOOL redir);
194 BOOL msrpc_use_del(const char* pipe_name,
195                                 const struct user_creds *usr_creds,
196                                 BOOL force_close,
197                                 BOOL *connection_closed);
198 void msrpc_net_use_enum(uint32 *num_cons, struct use_info ***use);
199 #endif
200
201 /*The following definitions come from  lib/pidfile.c  */
202
203 pid_t pidfile_pid(char *name);
204 void pidfile_create(char *name);
205
206 /*The following definitions come from  lib/replace.c  */
207
208 char *rep_inet_ntoa(struct in_addr ip);
209
210 /*The following definitions come from  lib/select.c  */
211
212 void sys_select_signal(void);
213 int sys_select(int maxfd, fd_set *fds,struct timeval *tval);
214 int sys_select_intr(int maxfd, fd_set *fds,struct timeval *tval);
215
216 /*The following definitions come from  lib/signal.c  */
217
218 void BlockSignals(BOOL block,int signum);
219 void CatchSignal(int signum,void (*handler)(int ));
220 void CatchChild(void);
221 void CatchChildLeaveStatus(void);
222
223 /*The following definitions come from  lib/slprintf.c  */
224
225 int vslprintf(char *str, int n, char *format, va_list ap);
226
227 /*The following definitions come from  lib/smbrun.c  */
228
229 int smbrun(char *cmd,char *outfile,BOOL shared);
230
231 /*The following definitions come from  lib/snprintf.c  */
232
233
234 /*The following definitions come from  lib/substitute.c  */
235
236 void standard_sub_basic(char *str);
237 void standard_sub_advanced(int snum, char *user, char *connectpath, gid_t gid, char *str);
238 void standard_sub_conn(connection_struct *conn, char *str);
239 void standard_sub_snum(int snum, char *str);
240 void standard_sub_vuser(char *str, user_struct *vuser);
241 void standard_sub_vsnum(char *str, user_struct *vuser, int snum);
242
243 /*The following definitions come from  lib/system.c  */
244
245 int sys_usleep(long usecs);
246 int sys_stat(const char *fname,SMB_STRUCT_STAT *sbuf);
247 int sys_fstat(int fd,SMB_STRUCT_STAT *sbuf);
248 int sys_lstat(const char *fname,SMB_STRUCT_STAT *sbuf);
249 int sys_ftruncate(int fd, SMB_OFF_T offset);
250 SMB_OFF_T sys_lseek(int fd, SMB_OFF_T offset, int whence);
251 int sys_fseek(FILE *fp, SMB_OFF_T offset, int whence);
252 SMB_OFF_T sys_ftell(FILE *fp);
253 int sys_creat(const char *path, mode_t mode);
254 int sys_open(const char *path, int oflag, mode_t mode);
255 FILE *sys_fopen(const char *path, const char *type);
256 SMB_STRUCT_DIRENT *sys_readdir(DIR *dirp);
257 int sys_waitpid(pid_t pid,int *status,int options);
258 char *sys_getwd(char *s);
259 int sys_chown(const char *fname,uid_t uid,gid_t gid);
260 int sys_chroot(const char *dname);
261 struct hostent *sys_gethostbyname(const char *name);
262 void oplock_set_capability(BOOL this_process, BOOL inherit);
263 long sys_random(void);
264 void sys_srandom(unsigned int seed);
265 int groups_max(void);
266 int sys_getgroups(int setlen, gid_t *gidset);
267 int sys_setgroups(int setlen, gid_t *gidset);
268 struct passwd *sys_getpwnam(const char *name);
269 struct passwd *sys_getpwuid(uid_t uid);
270 int wsys_stat(const smb_ucs2_t *wfname,SMB_STRUCT_STAT *sbuf);
271 int wsys_lstat(const smb_ucs2_t *wfname,SMB_STRUCT_STAT *sbuf);
272 int wsys_creat(const smb_ucs2_t *wfname, mode_t mode);
273 int wsys_open(const smb_ucs2_t *wfname, int oflag, mode_t mode);
274 FILE *wsys_fopen(const smb_ucs2_t *wfname, const char *type);
275 DIR *wsys_opendir(const smb_ucs2_t *wfname);
276 smb_ucs2_t *wsys_getwd(smb_ucs2_t *s);
277 int wsys_chown(const smb_ucs2_t *wfname, uid_t uid, gid_t gid);
278 int wsys_chroot(const smb_ucs2_t *wfname);
279 pid_t sys_fork(void);
280 pid_t sys_getpid(void);
281 int sys_popen(const char *command);
282 int sys_pclose(int fd);
283
284 /*The following definitions come from  lib/talloc.c  */
285
286 TALLOC_CTX *talloc_init(void);
287 void *talloc(TALLOC_CTX *t, size_t size);
288 void talloc_destroy_pool(TALLOC_CTX *t);
289 void talloc_destroy(TALLOC_CTX *t);
290
291 /*The following definitions come from  lib/time.c  */
292
293 void GetTimeOfDay(struct timeval *tval);
294 void TimeInit(void);
295 int TimeDiff(time_t t);
296 struct tm *LocalTime(time_t *t);
297 time_t nt_time_to_unix(NTTIME *nt);
298 time_t interpret_long_date(char *p);
299 void unix_to_nt_time(NTTIME *nt, time_t t);
300 void put_long_date(char *p,time_t t);
301 BOOL null_mtime(time_t mtime);
302 void put_dos_date(char *buf,int offset,time_t unixdate);
303 void put_dos_date2(char *buf,int offset,time_t unixdate);
304 void put_dos_date3(char *buf,int offset,time_t unixdate);
305 time_t make_unix_date(void *date_ptr);
306 time_t make_unix_date2(void *date_ptr);
307 time_t make_unix_date3(void *date_ptr);
308 char *http_timestring(time_t t);
309 char *timestring(BOOL hires);
310 time_t get_create_time(SMB_STRUCT_STAT *st,BOOL fake_dirs);
311
312 /*The following definitions come from  lib/ufc.c  */
313
314 char *ufc_crypt(char *key,char *salt);
315
316 /*The following definitions come from  lib/username.c  */
317
318 char *get_user_home_dir(char *user);
319 BOOL map_username(char *user);
320 struct passwd *Get_Pwnam(char *user,BOOL allow_change);
321 BOOL user_in_group_list(char *user,char *gname);
322 BOOL user_in_list(char *user,char *list);
323 struct passwd *smb_getpwnam(char *user, BOOL allow_change);
324
325 /*The following definitions come from  lib/util.c  */
326
327 char *tmpdir(void);
328 BOOL in_group(gid_t group, gid_t current_gid, int ngroups, gid_t *groups);
329 char *Atoic(char *p, int *n, char *c);
330 char *get_numlist(char *p, uint32 **num, int *count);
331 BOOL file_exist(char *fname,SMB_STRUCT_STAT *sbuf);
332 int file_rename(char *from, char *to);
333 time_t file_modtime(char *fname);
334 BOOL directory_exist(char *dname,SMB_STRUCT_STAT *st);
335 SMB_OFF_T get_file_size(char *file_name);
336 char *attrib_string(uint16 mode);
337 void show_msg(char *buf);
338 void smb_setlen(char *buf,int len);
339 int set_message(char *buf,int num_words,int num_bytes,BOOL zero);
340 void dos_clean_name(char *s);
341 void unix_clean_name(char *s);
342 void make_dir_struct(char *buf,char *mask,char *fname,SMB_OFF_T size,int mode,time_t date);
343 void close_low_fds(void);
344 int set_blocking(int fd, BOOL set);
345 SMB_OFF_T transfer_file(int infd,int outfd,SMB_OFF_T n,char *header,int headlen,int align);
346 void msleep(int t);
347 void become_daemon(void);
348 BOOL yesno(char *p);
349 int set_filelen(int fd, SMB_OFF_T len);
350 void *Realloc(void *p,size_t size);
351 void safe_free(void *p);
352 BOOL get_myname(char *my_name);
353 int interpret_protocol(char *str,int def);
354 BOOL is_ipaddress(const char *str);
355 uint32 interpret_addr(char *str);
356 struct in_addr *interpret_addr2(char *str);
357 BOOL zero_ip(struct in_addr ip);
358 BOOL same_net(struct in_addr ip1,struct in_addr ip2,struct in_addr mask);
359 struct hostent *Get_Hostbyname(const char *name);
360 BOOL process_exists(pid_t pid);
361 char *uidtoname(uid_t uid);
362 char *gidtoname(gid_t gid);
363 uid_t nametouid(char *name);
364 gid_t nametogid(char *name);
365 void smb_panic(char *why);
366 char *readdirname(DIR *p);
367 BOOL is_in_path(char *name, name_compare_entry *namelist);
368 void set_namearray(name_compare_entry **ppname_array, char *namelist);
369 void free_namearray(name_compare_entry *name_array);
370 BOOL fcntl_lock(int fd, int op, SMB_OFF_T offset, SMB_OFF_T count, int type);
371 BOOL is_myname(char *s);
372 void set_remote_arch(enum remote_arch_types type);
373 enum remote_arch_types get_remote_arch(void);
374 void out_ascii(FILE *f, unsigned char *buf,int len);
375 void out_data(FILE *f,char *buf1,int len, int per_line);
376 void print_asc(int level, unsigned char *buf,int len);
377 void dump_data(int level,char *buf1,int len);
378 char *tab_depth(int depth);
379 int str_checksum(const char *s);
380 void zero_free(void *p, size_t size);
381 int set_maxfiles(int requested_max);
382 BOOL reg_split_key(char *full_keyname, uint32 *reg_type, char *key_name);
383 char *smbd_mktemp(char *template);
384 void *memdup(void *p, size_t size);
385 char *myhostname(void);
386 char *lock_path(char *name);
387 char *parent_dirname(const char *path);
388 BOOL ms_has_wild(char *s);
389 BOOL mask_match(char *string, char *pattern, BOOL is_case_sensitive);
390 int _Insure_trap_error(int a1, int a2, int a3, int a4, int a5, int a6);
391
392 /*The following definitions come from  lib/util_array.c  */
393
394 void free_void_array(uint32 num_entries, void **entries,
395                 void(free_item)(void*));
396 void* add_copy_to_array(uint32 *len, void ***array, const void *item,
397         void*(item_dup)(const void*), BOOL alloc_anyway);
398 void* add_item_to_array(uint32 *len, void ***array, void *item);
399 void free_use_info_array(uint32 num_entries, struct use_info **entries);
400 struct use_info* add_use_info_to_array(uint32 *len, struct use_info ***array,
401                                 const struct use_info *name);
402 void free_char_array(uint32 num_entries, char **entries);
403 char* add_chars_to_array(uint32 *len, char ***array, const char *name);
404 void free_uint32_array(uint32 num_entries, uint32 **entries);
405 uint32* add_uint32s_to_array(uint32 *len, uint32 ***array, const uint32 *name);
406 void free_sid_array(uint32 num_entries, DOM_SID **entries);
407 DOM_SID* add_sid_to_array(uint32 *len, DOM_SID ***array, const DOM_SID *sid);
408
409 /*The following definitions come from  lib/util_file.c  */
410
411 BOOL do_file_lock(int fd, int waitsecs, int type);
412 BOOL file_lock(int fd, int type, int secs, int *plock_depth);
413 BOOL file_unlock(int fd, int *plock_depth);
414 void *startfilepwent(char *pfile, char *s_readbuf, int bufsize,
415                                 int *file_lock_depth, BOOL update);
416 void endfilepwent(void *vp, int *file_lock_depth);
417 SMB_BIG_UINT getfilepwpos(void *vp);
418 BOOL setfilepwpos(void *vp, SMB_BIG_UINT tok);
419 int getfileline(void *vp, char *linebuf, int linebuf_size);
420 char *fgets_slash(char *s2,int maxlen,FILE *f);
421 char *file_pload(char *syscmd, size_t *size);
422 char *file_load(char *fname, size_t *size);
423 char **file_lines_load(char *fname, int *numlines);
424 char **file_lines_pload(char *syscmd, int *numlines);
425 void file_lines_free(char **lines);
426 void file_lines_slashcont(char **lines);
427
428 /*The following definitions come from  lib/util_list.c  */
429
430 BOOL copy_policy_hnd (POLICY_HND *dest, const POLICY_HND *src);
431 BOOL compare_rpc_hnd_node(const RPC_HND_NODE *x, 
432                           const RPC_HND_NODE *y);
433 BOOL RpcHndList_set_connection(const POLICY_HND *hnd, 
434                                struct cli_connection *con);
435 BOOL RpcHndList_del_connection(const POLICY_HND *hnd);
436 struct cli_connection* RpcHndList_get_connection(const POLICY_HND *hnd);
437
438 /*The following definitions come from  lib/util_seaccess.c  */
439
440 BOOL se_access_check(SEC_DESC *sd, struct current_user *user,
441                      uint32 acc_desired, uint32 *acc_granted, uint32 *status);
442
443 /*The following definitions come from  lib/util_sec.c  */
444
445 void gain_root_privilege(void);
446 void gain_root_group_privilege(void);
447 void set_effective_uid(uid_t uid);
448 void set_effective_gid(gid_t gid);
449 void save_re_uid(void);
450 void restore_re_uid(void);
451 int set_re_uid(void);
452 void become_user_permanently(uid_t uid, gid_t gid);
453
454 /*The following definitions come from  lib/util_sid.c  */
455
456 void generate_wellknown_sids(void);
457 BOOL map_domain_sid_to_name(DOM_SID *sid, char *nt_domain);
458 BOOL lookup_known_rid(DOM_SID *sid, uint32 rid, char *name, enum SID_NAME_USE *psid_name_use);
459 BOOL map_domain_name_to_sid(DOM_SID *sid, char *nt_domain);
460 void split_domain_name(const char *fullname, char *domain, char *name);
461 char *sid_to_string(fstring sidstr_out, DOM_SID *sid);
462 BOOL string_to_sid(DOM_SID *sidout, char *sidstr);
463 BOOL sid_append_rid(DOM_SID *sid, uint32 rid);
464 BOOL sid_split_rid(DOM_SID *sid, uint32 *rid);
465 void sid_copy(DOM_SID *dst, const DOM_SID *src);
466 DOM_SID *sid_dup(DOM_SID *src);
467 BOOL sid_linearize(char *outbuf, size_t len, DOM_SID *sid);
468 BOOL sid_equal(const DOM_SID *sid1, const DOM_SID *sid2);
469 size_t sid_size(DOM_SID *sid);
470
471 /*The following definitions come from  lib/util_sock.c  */
472
473 BOOL is_a_socket(int fd);
474 void set_socket_options(int fd, char *options);
475 ssize_t read_udp_socket(int fd,char *buf,size_t len);
476 ssize_t read_with_timeout(int fd,char *buf,size_t mincnt,size_t maxcnt,unsigned int time_out);
477 BOOL send_keepalive(int client);
478 ssize_t read_data(int fd,char *buffer,size_t N);
479 ssize_t write_data(int fd,char *buffer,size_t N);
480 ssize_t write_socket_data(int fd,char *buffer,size_t N);
481 ssize_t write_socket(int fd,char *buf,size_t len);
482 ssize_t read_smb_length(int fd,char *inbuf,unsigned int timeout);
483 BOOL receive_smb(int fd,char *buffer, unsigned int timeout);
484 BOOL client_receive_smb(int fd,char *buffer, unsigned int timeout);
485 BOOL send_null_session_msg(int fd);
486 BOOL send_smb(int fd,char *buffer);
487 BOOL send_one_packet(char *buf,int len,struct in_addr ip,int port,int type);
488 int open_socket_in(int type, int port, int dlevel,uint32 socket_addr, BOOL rebind);
489 int open_socket_out(int type, struct in_addr *addr, int port ,int timeout);
490 void reset_globals_after_fork(void);
491 void client_setfd(int fd);
492 char *client_name(void);
493 char *client_addr(void);
494 char *get_socket_name(int fd);
495 char *get_socket_addr(int fd);
496 int open_pipe_sock(char *path);
497 int create_pipe_socket(char *dir, int dir_perms,
498                                 char *path, int path_perms);
499
500 /*The following definitions come from  lib/util_str.c  */
501
502 void set_first_token(char *ptr);
503 BOOL next_token(char **ptr,char *buff,char *sep, size_t bufsize);
504 char **toktocliplist(int *ctok, char *sep);
505 int StrCaseCmp(const char *s, const char *t);
506 int StrnCaseCmp(const char *s, const char *t, size_t n);
507 BOOL strequal(const char *s1, const char *s2);
508 BOOL strnequal(const char *s1,const char *s2,size_t n);
509 BOOL strcsequal(const char *s1,const char *s2);
510 int strwicmp(char *psz1, char *psz2);
511 void strlower(char *s);
512 void strupper(char *s);
513 void strnorm(char *s);
514 BOOL strisnormal(char *s);
515 void string_replace(char *s,char oldc,char newc);
516 char *skip_string(char *buf,size_t n);
517 size_t str_charnum(const char *s);
518 BOOL trim_string(char *s,const char *front,const char *back);
519 BOOL strhasupper(const char *s);
520 BOOL strhaslower(const char *s);
521 size_t count_chars(const char *s,char c);
522 BOOL str_is_all(const char *s,char c);
523 char *safe_strcpy(char *dest,const char *src, size_t maxlength);
524 char *safe_strcat(char *dest, const char *src, size_t maxlength);
525 char *alpha_strcpy(char *dest, const char *src, size_t maxlength);
526 char *StrnCpy(char *dest,const char *src,size_t n);
527 char *strncpyn(char *dest, const char *src,size_t n, char c);
528 size_t strhex_to_str(char *p, size_t len, const char *strhex);
529 BOOL in_list(char *s,char *list,BOOL casesensitive);
530 void string_free(char **s);
531 BOOL string_set(char **dest,const char *src);
532 void string_sub(char *s,const char *pattern,const char *insert, size_t len);
533 void fstring_sub(char *s,const char *pattern,const char *insert);
534 void pstring_sub(char *s,const char *pattern,const char *insert);
535 void all_string_sub(char *s,const char *pattern,const char *insert, size_t len);
536 void split_at_last_component(char *path, char *front, char sep, char *back);
537 char *octal_string(int i);
538 char *string_truncate(char *s, int length);
539 void parse_domain_user(char *domuser, fstring domain, fstring user);
540
541 /*The following definitions come from  lib/util_unistr.c  */
542
543 size_t dos_PutUniCode(char *dst,const char *src, ssize_t len, BOOL null_terminate);
544 void unistr_to_dos(char *dest, const char *src, size_t len);
545 char *skip_unibuf(char *src, size_t len);
546 char *dos_unistrn2(uint16 *src, int len);
547 char *dos_unistr2(uint16 *src);
548 char *dos_unistr2_to_str(UNISTR2 *str);
549 void ascii_to_unistr(uint16 *dest, const char *src, int maxlen);
550 void unistr_to_ascii(char *dest, const uint16 *src, int len);
551 void unistr2_to_ascii(char *dest, const UNISTR2 *str, size_t maxlen);
552 uint32 buffer2_to_uint32(BUFFER2 *str);
553 char *dos_buffer2_to_str(BUFFER2 *str);
554 char *dos_buffer2_to_multistr(BUFFER2 *str);
555 size_t dos_struni2(char *dst, const char *src, size_t max_len);
556 char *dos_unistr(char *buf);
557 int unistrcpy(char *dst, char *src);
558 void default_unicode_map(smb_ucs2_t **pp_cp_to_ucs2, uint16 **pp_ucs2_to_cp);
559 BOOL load_unicode_map(const char *codepage, smb_ucs2_t **pp_cp_to_ucs2, uint16 **pp_ucs2_to_cp);
560 BOOL load_dos_unicode_map(int codepage);
561 BOOL load_unix_unicode_map(const char *unix_char_set);
562 smb_ucs2_t *multibyte_to_unicode(smb_ucs2_t *dst, const char *src,
563                                  size_t dst_len, smb_ucs2_t *cp_to_ucs2);
564 char *unicode_to_unix(char *dst, const smb_ucs2_t *src, size_t dst_len);
565 smb_ucs2_t *unix_to_unicode(smb_ucs2_t *dst, const char *src, size_t dst_len);
566 char *unicode_to_dos(char *dst, const smb_ucs2_t *src, size_t dst_len);
567 size_t unicode_to_dos_char(char *dst, const smb_ucs2_t src);
568 smb_ucs2_t *dos_to_unicode(smb_ucs2_t *dst, const char *src, size_t dst_len);
569 size_t strlen_w(const smb_ucs2_t *src);
570 smb_ucs2_t *safe_strcpy_w(smb_ucs2_t *dest,const smb_ucs2_t *src, size_t maxlength);
571 smb_ucs2_t *safe_strcat_w(smb_ucs2_t *dest, const smb_ucs2_t *src, size_t maxlength);
572 int strcmp_w(const smb_ucs2_t *s1, const smb_ucs2_t *s2);
573 int strncmp_w(const smb_ucs2_t *s1, const smb_ucs2_t *s2, size_t len);
574 smb_ucs2_t *strstr_w(const smb_ucs2_t *s1, const smb_ucs2_t *s2);
575 smb_ucs2_t *strchr_w(const smb_ucs2_t *s, smb_ucs2_t c);
576 smb_ucs2_t *strrchr_w(const smb_ucs2_t *s, smb_ucs2_t c);
577 smb_ucs2_t *strtok_w(smb_ucs2_t *s1, const smb_ucs2_t *s2);
578 smb_ucs2_t *strdup_w(const smb_ucs2_t *s);
579 int isupper_w( smb_ucs2_t val);
580 int islower_w( smb_ucs2_t val);
581 int isdigit_w( smb_ucs2_t val);
582 int isxdigit_w( smb_ucs2_t val);
583 int isspace_w( smb_ucs2_t val);
584 smb_ucs2_t toupper_w( smb_ucs2_t val );
585 smb_ucs2_t tolower_w( smb_ucs2_t val );
586 void set_first_token_w(smb_ucs2_t *ptr);
587 BOOL next_token_w(smb_ucs2_t **ptr, smb_ucs2_t *buff, smb_ucs2_t *sep, size_t bufsize);
588 smb_ucs2_t **toktocliplist_w(int *ctok, smb_ucs2_t *sep);
589 int StrCaseCmp_w(const smb_ucs2_t *s, const smb_ucs2_t *t);
590 int StrnCaseCmp_w(const smb_ucs2_t *s, const smb_ucs2_t *t, size_t n);
591 BOOL strequal_w(const smb_ucs2_t *s1, const smb_ucs2_t *s2);
592 BOOL strnequal_w(const smb_ucs2_t *s1,const smb_ucs2_t *s2,size_t n);
593 BOOL strcsequal_w(const smb_ucs2_t *s1,const smb_ucs2_t *s2);
594 void strlower_w(smb_ucs2_t *s);
595 void strupper_w(smb_ucs2_t *s);
596 void strnorm_w(smb_ucs2_t *s);
597 BOOL strisnormal_w(smb_ucs2_t *s);
598 void string_replace_w(smb_ucs2_t *s, smb_ucs2_t oldc, smb_ucs2_t newc);
599 smb_ucs2_t *skip_string_w(smb_ucs2_t *buf,size_t n);
600 size_t str_charnum_w(const smb_ucs2_t *s);
601 BOOL trim_string_w(smb_ucs2_t *s,const smb_ucs2_t *front,const smb_ucs2_t *back);
602 BOOL strhasupper_w(const smb_ucs2_t *s);
603 BOOL strhaslower_w(const smb_ucs2_t *s);
604 size_t count_chars_w(const smb_ucs2_t *s,smb_ucs2_t c);
605 BOOL str_is_all_w(const smb_ucs2_t *s,smb_ucs2_t c);
606 smb_ucs2_t *alpha_strcpy_w(smb_ucs2_t *dest, const smb_ucs2_t *src, size_t maxlength);
607 smb_ucs2_t *StrnCpy_w(smb_ucs2_t *dest,const smb_ucs2_t *src,size_t n);
608 smb_ucs2_t *strncpyn_w(smb_ucs2_t *dest, const smb_ucs2_t *src,size_t n, smb_ucs2_t c);
609 size_t strhex_to_str_w(char *p, size_t len, const smb_ucs2_t *strhex);
610 BOOL in_list_w(smb_ucs2_t *s,smb_ucs2_t *list,BOOL casesensitive);
611 BOOL string_init_w(smb_ucs2_t **dest,const smb_ucs2_t *src);
612 void string_free_w(smb_ucs2_t **s);
613 BOOL string_set_w(smb_ucs2_t **dest,const smb_ucs2_t *src);
614 void string_sub_w(smb_ucs2_t *s,const smb_ucs2_t *pattern,const smb_ucs2_t *insert, size_t len);
615 void fstring_sub_w(smb_ucs2_t *s,const smb_ucs2_t *pattern,const smb_ucs2_t *insert);
616 void pstring_sub_w(smb_ucs2_t *s,const smb_ucs2_t *pattern,smb_ucs2_t *insert);
617 void all_string_sub_w(smb_ucs2_t *s,const smb_ucs2_t *pattern,const smb_ucs2_t *insert, size_t len);
618 void split_at_last_component_w(smb_ucs2_t *path, smb_ucs2_t *front, smb_ucs2_t sep, smb_ucs2_t *back);
619 smb_ucs2_t *octal_string_w(int i);
620 smb_ucs2_t *string_truncate_w(smb_ucs2_t *s, size_t length);
621 smb_ucs2_t doscp2ucs2(int w);
622 int ucs2doscp(smb_ucs2_t w);
623
624 /*The following definitions come from  lib/wins_srv.c  */
625
626 BOOL wins_srv_load_list( char *src );
627 struct in_addr wins_srv_ip( void );
628 void wins_srv_died( struct in_addr boothill_ip );
629 unsigned long wins_srv_count( void );
630
631 /*The following definitions come from  libsmb/cliconnect.c  */
632
633 BOOL cli_session_setup(struct cli_state *cli, 
634                        char *user, 
635                        char *pass, int passlen,
636                        char *ntpass, int ntpasslen,
637                        char *workgroup);
638 BOOL cli_ulogoff(struct cli_state *cli);
639 BOOL cli_send_tconX(struct cli_state *cli, 
640                     char *share, char *dev, char *pass, int passlen);
641 BOOL cli_tdis(struct cli_state *cli);
642 void cli_negprot_send(struct cli_state *cli);
643 BOOL cli_negprot(struct cli_state *cli);
644 BOOL cli_session_request(struct cli_state *cli,
645                          struct nmb_name *calling, struct nmb_name *called);
646 BOOL cli_connect(struct cli_state *cli, const char *host, struct in_addr *ip);
647 BOOL cli_reestablish_connection(struct cli_state *cli);
648 BOOL cli_establish_connection(struct cli_state *cli, 
649                                 char *dest_host, struct in_addr *dest_ip,
650                                 struct nmb_name *calling, struct nmb_name *called,
651                                 char *service, char *service_type,
652                                 BOOL do_shutdown, BOOL do_tcon);
653 BOOL attempt_netbios_session_request(struct cli_state *cli, char *srchost, char *desthost,
654                                      struct in_addr *pdest_ip);
655
656 /*The following definitions come from  libsmb/clientgen.c  */
657
658 int cli_set_port(struct cli_state *cli, int port);
659 BOOL cli_receive_smb(struct cli_state *cli);
660 BOOL cli_send_smb(struct cli_state *cli);
661 void cli_setup_packet(struct cli_state *cli);
662 void cli_init_creds(struct cli_state *cli, const struct ntuser_creds *usr);
663 struct cli_state *cli_initialise(struct cli_state *cli);
664 void cli_shutdown(struct cli_state *cli);
665 void cli_sockopt(struct cli_state *cli, char *options);
666 uint16 cli_setpid(struct cli_state *cli, uint16 pid);
667
668 /*The following definitions come from  libsmb/clierror.c  */
669
670 char *cli_errstr(struct cli_state *cli);
671 int cli_error(struct cli_state *cli, uint8 *eclass, uint32 *num, uint32 *nt_rpc_error);
672
673 /*The following definitions come from  libsmb/clifile.c  */
674
675 BOOL cli_rename(struct cli_state *cli, char *fname_src, char *fname_dst);
676 BOOL cli_unlink(struct cli_state *cli, char *fname);
677 BOOL cli_mkdir(struct cli_state *cli, char *dname);
678 BOOL cli_rmdir(struct cli_state *cli, char *dname);
679 int cli_nt_create(struct cli_state *cli, char *fname);
680 int cli_open(struct cli_state *cli, char *fname, int flags, int share_mode);
681 BOOL cli_close(struct cli_state *cli, int fnum);
682 BOOL cli_lock(struct cli_state *cli, int fnum, 
683               uint32 offset, uint32 len, int timeout, enum brl_type lock_type);
684 BOOL cli_unlock(struct cli_state *cli, int fnum, uint32 offset, uint32 len);
685 BOOL cli_lock64(struct cli_state *cli, int fnum, 
686                 SMB_BIG_UINT offset, SMB_BIG_UINT len, int timeout, enum brl_type lock_type);
687 BOOL cli_unlock64(struct cli_state *cli, int fnum, SMB_BIG_UINT offset, SMB_BIG_UINT len);
688 BOOL cli_getattrE(struct cli_state *cli, int fd, 
689                   uint16 *attr, size_t *size, 
690                   time_t *c_time, time_t *a_time, time_t *m_time);
691 BOOL cli_getatr(struct cli_state *cli, char *fname, 
692                 uint16 *attr, size_t *size, time_t *t);
693 BOOL cli_setatr(struct cli_state *cli, char *fname, uint16 attr, time_t t);
694 BOOL cli_chkpath(struct cli_state *cli, char *path);
695 BOOL cli_dskattr(struct cli_state *cli, int *bsize, int *total, int *avail);
696
697 /*The following definitions come from  libsmb/clilist.c  */
698
699 int cli_list(struct cli_state *cli,const char *Mask,uint16 attribute, 
700              void (*fn)(file_info *, const char *));
701 int cli_list_old(struct cli_state *cli,const char *Mask,uint16 attribute, 
702                  void (*fn)(file_info *, const char *));
703
704 /*The following definitions come from  libsmb/climessage.c  */
705
706 BOOL cli_message_start(struct cli_state *cli, char *host, char *username, 
707                               int *grp);
708 BOOL cli_message_text(struct cli_state *cli, char *msg, int len, int grp);
709 BOOL cli_message_end(struct cli_state *cli, int grp);
710
711 /*The following definitions come from  libsmb/cliprint.c  */
712
713 int cli_print_queue(struct cli_state *cli, 
714                     void (*fn)(struct print_job_info *));
715 int cli_printjob_del(struct cli_state *cli, int job);
716
717 /*The following definitions come from  libsmb/clirap.c  */
718
719 BOOL cli_api_pipe(struct cli_state *cli, char *pipe_name, int pipe_name_len,
720                   uint16 *setup, uint32 setup_count, uint32 max_setup_count,
721                   char *params, uint32 param_count, uint32 max_param_count,
722                   char *data, uint32 data_count, uint32 max_data_count,
723                   char **rparam, uint32 *rparam_count,
724                   char **rdata, uint32 *rdata_count);
725 BOOL cli_api(struct cli_state *cli,
726              char *param, int prcnt, int mprcnt,
727              char *data, int drcnt, int mdrcnt,
728              char **rparam, int *rprcnt,
729              char **rdata, int *rdrcnt);
730 BOOL cli_NetWkstaUserLogon(struct cli_state *cli,char *user, char *workstation);
731 int cli_RNetShareEnum(struct cli_state *cli, void (*fn)(const char *, uint32, const char *));
732 BOOL cli_NetServerEnum(struct cli_state *cli, char *workgroup, uint32 stype,
733                        void (*fn)(const char *, uint32, const char *));
734 BOOL cli_oem_change_password(struct cli_state *cli, const char *user, const char *new_password,
735                              const char *old_password);
736 BOOL cli_qpathinfo(struct cli_state *cli, const char *fname, 
737                    time_t *c_time, time_t *a_time, time_t *m_time, 
738                    size_t *size, uint16 *mode);
739 BOOL cli_qpathinfo2(struct cli_state *cli, const char *fname, 
740                     time_t *c_time, time_t *a_time, time_t *m_time, 
741                     time_t *w_time, size_t *size, uint16 *mode,
742                     SMB_INO_T *ino);
743 BOOL cli_qfileinfo(struct cli_state *cli, int fnum, 
744                    uint16 *mode, size_t *size,
745                    time_t *c_time, time_t *a_time, time_t *m_time, 
746                    time_t *w_time, SMB_INO_T *ino);
747
748 /*The following definitions come from  libsmb/clireadwrite.c  */
749
750 size_t cli_read(struct cli_state *cli, int fnum, char *buf, off_t offset, size_t size);
751 ssize_t cli_write(struct cli_state *cli,
752                   int fnum, uint16 write_mode,
753                   char *buf, off_t offset, size_t size);
754 ssize_t cli_smbwrite(struct cli_state *cli,
755                      int fnum, char *buf, off_t offset, size_t size1);
756
757 /*The following definitions come from  libsmb/clitrans.c  */
758
759 BOOL cli_send_trans(struct cli_state *cli, int trans, 
760                     char *name, int pipe_name_len, 
761                     int fid, int flags,
762                     uint16 *setup, int lsetup, int msetup,
763                     char *param, int lparam, int mparam,
764                     char *data, int ldata, int mdata);
765 BOOL cli_receive_trans(struct cli_state *cli,int trans,
766                               char **param, int *param_len,
767                               char **data, int *data_len);
768
769 /*The following definitions come from  libsmb/credentials.c  */
770
771 char *credstr(uchar *cred);
772 void cred_session_key(DOM_CHAL *clnt_chal, DOM_CHAL *srv_chal, char *pass, 
773                       uchar session_key[8]);
774 void cred_create(uchar session_key[8], DOM_CHAL *stor_cred, UTIME timestamp, 
775                  DOM_CHAL *cred);
776 int cred_assert(DOM_CHAL *cred, uchar session_key[8], DOM_CHAL *stored_cred,
777                 UTIME timestamp);
778 BOOL clnt_deal_with_creds(uchar sess_key[8],
779                           DOM_CRED *sto_clnt_cred, DOM_CRED *rcv_srv_cred);
780 BOOL deal_with_creds(uchar sess_key[8],
781                      DOM_CRED *sto_clnt_cred, 
782                      DOM_CRED *rcv_clnt_cred, DOM_CRED *rtn_srv_cred);
783
784 /*The following definitions come from  libsmb/namequery.c  */
785
786 BOOL name_status(int fd,char *name,int name_type,BOOL recurse,
787                  struct in_addr to_ip,char *master,char *rname);
788 struct in_addr *name_query(int fd,const char *name,int name_type, 
789                            BOOL bcast,BOOL recurse,
790                            struct in_addr to_ip, int *count);
791 FILE *startlmhosts(char *fname);
792 BOOL getlmhostsent( FILE *fp, pstring name, int *name_type, struct in_addr *ipaddr);
793 void endlmhosts(FILE *fp);
794 BOOL is_ip_address(const char *name);
795 BOOL resolve_name(const char *name, struct in_addr *return_ip, int name_type);
796 BOOL resolve_srv_name(const char* srv_name, fstring dest_host,
797                                 struct in_addr *ip);
798 BOOL find_master_ip(char *group, struct in_addr *master_ip);
799 BOOL lookup_pdc_name(const char *srcname, const char *domain, struct in_addr *pdc_ip, char *ret_name);
800 BOOL get_dc_list(char *group, struct in_addr **ip_list, int *count);
801
802 /*The following definitions come from  libsmb/nmblib.c  */
803
804 void debug_nmb_packet(struct packet_struct *p);
805 char *nmb_namestr(struct nmb_name *n);
806 struct packet_struct *copy_packet(struct packet_struct *packet);
807 void free_packet(struct packet_struct *packet);
808 struct packet_struct *parse_packet(char *buf,int length,
809                                    enum packet_type packet_type);
810 struct packet_struct *read_packet(int fd,enum packet_type packet_type);
811 void make_nmb_name( struct nmb_name *n, const char *name, int type);
812 BOOL nmb_name_equal(struct nmb_name *n1, struct nmb_name *n2);
813 int build_packet(char *buf, struct packet_struct *p);
814 BOOL send_packet(struct packet_struct *p);
815 struct packet_struct *receive_packet(int fd,enum packet_type type,int t);
816 struct packet_struct *receive_nmb_packet(int fd, int t, int trn_id);
817 struct packet_struct *receive_dgram_packet(int fd, int t, char *mailslot_name);
818 BOOL match_mailslot_name(struct packet_struct *p, char *mailslot_name);
819 void sort_query_replies(char *data, int n, struct in_addr ip);
820 char *dns_to_netbios_name(char *dns_name);
821 int name_mangle( char *In, char *Out, char name_type );
822 int name_extract(char *buf,int ofs,char *name);
823 int name_len(char *s1);
824
825 /*The following definitions come from  libsmb/nterr.c  */
826
827 BOOL get_safe_nt_error_msg(uint32 nt_code,char *msg, size_t len);
828 const char *get_nt_error_msg(uint32 nt_code);
829
830 /*The following definitions come from  libsmb/passchange.c  */
831
832 BOOL remote_password_change(const char *remote_machine, const char *user_name, 
833                             const char *old_passwd, const char *new_passwd,
834                             char *err_str, size_t err_str_len);
835
836 /*The following definitions come from  libsmb/pwd_cache.c  */
837
838 void pwd_init(struct pwd_info *pwd);
839 BOOL pwd_is_nullpwd(const struct pwd_info *pwd);
840 BOOL pwd_compare(struct pwd_info *pwd1, struct pwd_info *pwd2);
841 void pwd_read(struct pwd_info *pwd, char *passwd_report, BOOL do_encrypt);
842 void pwd_set_nullpwd(struct pwd_info *pwd);
843 void pwd_set_cleartext(struct pwd_info *pwd, char *clr);
844 void pwd_get_cleartext(struct pwd_info *pwd, char *clr);
845 void pwd_set_lm_nt_16(struct pwd_info *pwd, uchar lm_pwd[16], uchar nt_pwd[16]);
846 void pwd_get_lm_nt_16(struct pwd_info *pwd, uchar lm_pwd[16], uchar nt_pwd[16]);
847 void pwd_make_lm_nt_16(struct pwd_info *pwd, char *clr);
848 void pwd_make_lm_nt_owf(struct pwd_info *pwd, uchar cryptkey[8]);
849 void pwd_get_lm_nt_owf(struct pwd_info *pwd, uchar lm_owf[24], uchar nt_owf[24]);
850
851 /*The following definitions come from  libsmb/smbdes.c  */
852
853 void E_P16(unsigned char *p14,unsigned char *p16);
854 void E_P24(unsigned char *p21, unsigned char *c8, unsigned char *p24);
855 void D_P16(unsigned char *p14, unsigned char *in, unsigned char *out);
856 void E_old_pw_hash( unsigned char *p14, unsigned char *in, unsigned char *out);
857 void cred_hash1(unsigned char *out,unsigned char *in,unsigned char *key);
858 void cred_hash2(unsigned char *out,unsigned char *in,unsigned char *key);
859 void cred_hash3(unsigned char *out,unsigned char *in,unsigned char *key, int forw);
860 void SamOEMhash( unsigned char *data, unsigned char *key, int val);
861
862 /*The following definitions come from  libsmb/smbencrypt.c  */
863
864 void SMBencrypt(uchar *passwd, uchar *c8, uchar *p24);
865 void E_md4hash(uchar *passwd, uchar *p16);
866 void nt_lm_owf_gen(char *pwd, uchar nt_p16[16], uchar p16[16]);
867 void SMBOWFencrypt(uchar passwd[16], uchar *c8, uchar p24[24]);
868 void NTLMSSPOWFencrypt(uchar passwd[8], uchar *ntlmchalresp, uchar p24[24]);
869 void SMBNTencrypt(uchar *passwd, uchar *c8, uchar *p24);
870 BOOL make_oem_passwd_hash(char data[516], const char *passwd, uchar old_pw_hash[16], BOOL unicode);
871 BOOL decode_pw_buffer(char buffer[516], char *new_pwrd,
872                       int new_pwrd_size, uint32 *new_pw_len);
873
874 /*The following definitions come from  libsmb/smberr.c  */
875
876 char *smb_errstr(char *inbuf);
877
878 /*The following definitions come from  libsmb/unexpected.c  */
879
880 void unexpected_packet(struct packet_struct *p);
881 void clear_unexpected(time_t t);
882 struct packet_struct *receive_unexpected(enum packet_type packet_type, int id, 
883                                          char *mailslot_name);
884
885 /*The following definitions come from  locking/brlock.c  */
886
887 void brl_init(int read_only);
888 BOOL brl_lock(SMB_DEV_T dev, SMB_INO_T ino, int fnum,
889               uint16 smbpid, pid_t pid, uint16 tid,
890               br_off start, br_off size, 
891               enum brl_type lock_type);
892 BOOL brl_unlock(SMB_DEV_T dev, SMB_INO_T ino, int fnum,
893                 uint16 smbpid, pid_t pid, uint16 tid,
894                 br_off start, br_off size);
895 BOOL brl_locktest(SMB_DEV_T dev, SMB_INO_T ino, int fnum,
896                   uint16 smbpid, pid_t pid, uint16 tid,
897                   br_off start, br_off size, 
898                   enum brl_type lock_type);
899 void brl_close(SMB_DEV_T dev, SMB_INO_T ino, pid_t pid, int tid, int fnum);
900 int brl_forall(BRLOCK_FN(fn));
901
902 /*The following definitions come from  locking/locking.c  */
903
904 BOOL is_locked(files_struct *fsp,connection_struct *conn,
905                SMB_BIG_UINT count,SMB_BIG_UINT offset, 
906                enum brl_type lock_type);
907 BOOL do_lock(files_struct *fsp,connection_struct *conn,
908              SMB_BIG_UINT count,SMB_BIG_UINT offset,enum brl_type lock_type,
909              int *eclass,uint32 *ecode);
910 BOOL do_unlock(files_struct *fsp,connection_struct *conn,
911                SMB_BIG_UINT count,SMB_BIG_UINT offset, 
912                int *eclass,uint32 *ecode);
913 void locking_close_file(files_struct *fsp);
914 BOOL locking_init(int read_only);
915 BOOL locking_end(void);
916 BOOL lock_share_entry(connection_struct *conn,
917                       SMB_DEV_T dev, SMB_INO_T inode);
918 BOOL unlock_share_entry(connection_struct *conn,
919                         SMB_DEV_T dev, SMB_INO_T inode);
920 BOOL lock_share_entry_fsp(files_struct *fsp);
921 BOOL unlock_share_entry_fsp(files_struct *fsp);
922 int get_share_modes(connection_struct *conn, 
923                     SMB_DEV_T dev, SMB_INO_T inode, 
924                     share_mode_entry **shares);
925 void del_share_mode(files_struct *fsp);
926 BOOL set_share_mode(files_struct *fsp, uint16 port, uint16 op_type);
927 BOOL remove_share_oplock(files_struct *fsp);
928 BOOL downgrade_share_oplock(files_struct *fsp);
929 BOOL modify_share_mode(files_struct *fsp, int new_mode, uint16 new_oplock);
930 int share_mode_forall(SHAREMODE_FN(fn));
931
932 /*The following definitions come from  locking/posix.c  */
933
934 int fd_close_posix(struct connection_struct *conn, files_struct *fsp);
935 BOOL is_posix_locked(files_struct *fsp, SMB_BIG_UINT u_offset, SMB_BIG_UINT u_count, enum brl_type lock_type);
936 BOOL set_posix_lock(files_struct *fsp, SMB_BIG_UINT u_offset, SMB_BIG_UINT u_count, enum brl_type lock_type);
937 BOOL release_posix_lock(files_struct *fsp, SMB_BIG_UINT u_offset, SMB_BIG_UINT u_count);
938 void posix_locking_close_file(files_struct *fsp);
939 BOOL posix_locking_init(int read_only);
940 BOOL posix_locking_end(void);
941
942 /*The following definitions come from  msdfs/msdfs.c  */
943
944 BOOL create_junction(char* pathname, struct junction_map* jn);
945 BOOL is_msdfs_link(connection_struct* conn, char* path);
946 BOOL get_referred_path(struct junction_map* junction);
947 BOOL dfs_redirect(char* pathname, connection_struct* conn);
948 BOOL dfs_findfirst_redirect(char* pathname, connection_struct* conn);
949 int setup_dfs_referral(char* pathname, int max_referral_level, 
950                         char** ppdata);
951 int dfs_path_error(char* inbuf, char* outbuf);
952 BOOL create_msdfs_link(struct junction_map* jn, BOOL exists);
953 BOOL remove_msdfs_link(struct junction_map* jn);
954 int enum_msdfs_links(struct junction_map* jn);
955 int setup_dfs_referral(char* pathname, int max_referral_level, 
956                        char** ppdata);
957 BOOL is_msdfs_link(connection_struct* conn, char* path);
958
959 /*The following definitions come from  nmbd/asyncdns.c  */
960
961 int asyncdns_fd(void);
962 void kill_async_dns_child(void);
963 void start_async_dns(void);
964 void run_dns_queue(void);
965 BOOL queue_dns_query(struct packet_struct *p,struct nmb_name *question,
966                      struct name_record **n);
967 BOOL queue_dns_query(struct packet_struct *p,struct nmb_name *question,
968                      struct name_record **n);
969 void kill_async_dns_child(void);
970
971 /*The following definitions come from  nmbd/nmbd.c  */
972
973
974 /*The following definitions come from  nmbd/nmbd_become_dmb.c  */
975
976 void add_domain_names(time_t t);
977
978 /*The following definitions come from  nmbd/nmbd_become_lmb.c  */
979
980 void insert_permanent_name_into_unicast( struct subnet_record *subrec, 
981                                                 struct nmb_name *nmbname, uint16 nb_type );
982 void unbecome_local_master_browser(struct subnet_record *subrec, struct work_record *work,
983                                    BOOL force_new_election);
984 void become_local_master_browser(struct subnet_record *subrec, struct work_record *work);
985 void set_workgroup_local_master_browser_name( struct work_record *work, char *newname);
986
987 /*The following definitions come from  nmbd/nmbd_browserdb.c  */
988
989 void update_browser_death_time( struct browse_cache_record *browc );
990 struct browse_cache_record *create_browser_in_lmb_cache( char *work_name, 
991                                                          char *browser_name, 
992                                                          struct in_addr ip );
993 struct browse_cache_record *find_browser_in_lmb_cache( char *browser_name );
994 void expire_lmb_browsers( time_t t );
995
996 /*The following definitions come from  nmbd/nmbd_browsesync.c  */
997
998 void dmb_expire_and_sync_browser_lists(time_t t);
999 void announce_and_sync_with_domain_master_browser( struct subnet_record *subrec,
1000                                                    struct work_record *work);
1001 void collect_all_workgroup_names_from_wins_server(time_t t);
1002 void sync_all_dmbs(time_t t);
1003
1004 /*The following definitions come from  nmbd/nmbd_elections.c  */
1005
1006 void check_master_browser_exists(time_t t);
1007 void run_elections(time_t t);
1008 void process_election(struct subnet_record *subrec, struct packet_struct *p, char *buf);
1009 BOOL check_elections(void);
1010 void nmbd_message_election(int msg_type, pid_t src, void *buf, size_t len);
1011
1012 /*The following definitions come from  nmbd/nmbd_incomingdgrams.c  */
1013
1014 void tell_become_backup(void);
1015 void process_host_announce(struct subnet_record *subrec, struct packet_struct *p, char *buf);
1016 void process_workgroup_announce(struct subnet_record *subrec, struct packet_struct *p, char *buf);
1017 void process_local_master_announce(struct subnet_record *subrec, struct packet_struct *p, char *buf);
1018 void process_master_browser_announce(struct subnet_record *subrec, 
1019                                      struct packet_struct *p,char *buf);
1020 void process_lm_host_announce(struct subnet_record *subrec, struct packet_struct *p, char *buf);
1021 void process_get_backup_list_request(struct subnet_record *subrec,
1022                                      struct packet_struct *p,char *buf);
1023 void process_reset_browser(struct subnet_record *subrec,
1024                                   struct packet_struct *p,char *buf);
1025 void process_announce_request(struct subnet_record *subrec, struct packet_struct *p, char *buf);
1026 void process_lm_announce_request(struct subnet_record *subrec, struct packet_struct *p, char *buf);
1027
1028 /*The following definitions come from  nmbd/nmbd_incomingrequests.c  */
1029
1030 void process_name_release_request(struct subnet_record *subrec, 
1031                                   struct packet_struct *p);
1032 void process_name_refresh_request(struct subnet_record *subrec,
1033                                   struct packet_struct *p);
1034 void process_name_registration_request(struct subnet_record *subrec, 
1035                                        struct packet_struct *p);
1036 void process_node_status_request(struct subnet_record *subrec, struct packet_struct *p);
1037 void process_name_query_request(struct subnet_record *subrec, struct packet_struct *p);
1038
1039 /*The following definitions come from  nmbd/nmbd_lmhosts.c  */
1040
1041 void load_lmhosts_file(char *fname);
1042 BOOL find_name_in_lmhosts(struct nmb_name *nmbname, struct name_record **namerecp);
1043
1044 /*The following definitions come from  nmbd/nmbd_logonnames.c  */
1045
1046 void add_logon_names(void);
1047
1048 /*The following definitions come from  nmbd/nmbd_mynames.c  */
1049
1050 void register_my_workgroup_one_subnet(struct subnet_record *subrec);
1051 BOOL register_my_workgroup_and_names(void);
1052 void release_my_names(void);
1053 void refresh_my_names(time_t t);
1054
1055 /*The following definitions come from  nmbd/nmbd_namelistdb.c  */
1056
1057 void set_samba_nb_type(void);
1058 void remove_name_from_namelist( struct subnet_record *subrec, 
1059                                 struct name_record   *namerec );
1060 struct name_record *find_name_on_subnet( struct subnet_record *subrec,
1061                                          struct nmb_name      *nmbname,
1062                                          BOOL                  self_only );
1063 struct name_record *find_name_for_remote_broadcast_subnet(
1064                                                    struct nmb_name *nmbname,
1065                                                    BOOL             self_only );
1066 void update_name_ttl( struct name_record *namerec, int ttl );
1067 struct name_record *add_name_to_subnet( struct subnet_record *subrec,
1068                                         char                 *name,
1069                                         int                   type,
1070                                         uint16                nb_flags,
1071                                         int                   ttl,
1072                                         enum name_source      source,
1073                                         int                   num_ips,
1074                                         struct in_addr       *iplist);
1075 void standard_success_register(struct subnet_record *subrec, 
1076                              struct userdata_struct *userdata,
1077                              struct nmb_name *nmbname, uint16 nb_flags, int ttl,
1078                              struct in_addr registered_ip);
1079 void standard_fail_register( struct subnet_record   *subrec,
1080                              struct response_record *rrec,
1081                              struct nmb_name        *nmbname );
1082 BOOL find_ip_in_name_record( struct name_record *namerec, struct in_addr ip );
1083 void add_ip_to_name_record( struct name_record *namerec, struct in_addr new_ip );
1084 void remove_ip_from_name_record( struct name_record *namerec,
1085                                  struct in_addr      remove_ip );
1086 void standard_success_release( struct subnet_record   *subrec,
1087                                struct userdata_struct *userdata,
1088                                struct nmb_name        *nmbname,
1089                                struct in_addr          released_ip );
1090 void expire_names_on_subnet(struct subnet_record *subrec, time_t t);
1091 void expire_names(time_t t);
1092 void add_samba_names_to_subnet( struct subnet_record *subrec );
1093 void dump_all_namelists(void);
1094
1095 /*The following definitions come from  nmbd/nmbd_namequery.c  */
1096
1097 BOOL query_name(struct subnet_record *subrec, char *name, int type,
1098                    query_name_success_function success_fn,
1099                    query_name_fail_function fail_fn, 
1100                    struct userdata_struct *userdata);
1101 BOOL query_name_from_wins_server(struct in_addr ip_to, 
1102                    char *name, int type,
1103                    query_name_success_function success_fn,
1104                    query_name_fail_function fail_fn, 
1105                    struct userdata_struct *userdata);
1106
1107 /*The following definitions come from  nmbd/nmbd_nameregister.c  */
1108
1109 BOOL register_name(struct subnet_record *subrec,
1110                    char *name, int type, uint16 nb_flags,
1111                    register_name_success_function success_fn,
1112                    register_name_fail_function fail_fn,
1113                    struct userdata_struct *userdata);
1114 BOOL refresh_name(struct subnet_record *subrec, struct name_record *namerec,
1115                   refresh_name_success_function success_fn,
1116                   refresh_name_fail_function fail_fn,
1117                   struct userdata_struct *userdata);
1118
1119 /*The following definitions come from  nmbd/nmbd_namerelease.c  */
1120
1121 BOOL release_name(struct subnet_record *subrec, struct name_record *namerec,
1122                    release_name_success_function success_fn,
1123                    release_name_fail_function fail_fn,
1124                    struct userdata_struct *userdata);
1125
1126 /*The following definitions come from  nmbd/nmbd_nodestatus.c  */
1127
1128 BOOL node_status(struct subnet_record *subrec, struct nmb_name *nmbname,
1129                  struct in_addr send_ip, node_status_success_function success_fn, 
1130                  node_status_fail_function fail_fn, struct userdata_struct *userdata);
1131
1132 /*The following definitions come from  nmbd/nmbd_packets.c  */
1133
1134 uint16 get_nb_flags(char *buf);
1135 void set_nb_flags(char *buf, uint16 nb_flags);
1136 struct response_record *queue_register_name( struct subnet_record *subrec,
1137                           response_function resp_fn,
1138                           timeout_response_function timeout_fn,
1139                           register_name_success_function success_fn,
1140                           register_name_fail_function fail_fn,
1141                           struct userdata_struct *userdata,
1142                           struct nmb_name *nmbname,
1143                           uint16 nb_flags);
1144 struct response_record *queue_register_multihomed_name( struct subnet_record *subrec,
1145                           response_function resp_fn,
1146                           timeout_response_function timeout_fn,
1147                           register_name_success_function success_fn,
1148                           register_name_fail_function fail_fn,
1149                           struct userdata_struct *userdata,
1150                           struct nmb_name *nmbname,
1151                           uint16 nb_flags,
1152                           struct in_addr register_ip);
1153 struct response_record *queue_release_name( struct subnet_record *subrec,
1154                           response_function resp_fn,
1155                           timeout_response_function timeout_fn,
1156                           release_name_success_function success_fn,
1157                           release_name_fail_function fail_fn,
1158                           struct userdata_struct *userdata,
1159                           struct nmb_name *nmbname,
1160                           uint16 nb_flags,
1161                           struct in_addr release_ip);
1162 struct response_record *queue_refresh_name( struct subnet_record *subrec,
1163                           response_function resp_fn,
1164                           timeout_response_function timeout_fn,
1165                           refresh_name_success_function success_fn,
1166                           refresh_name_fail_function fail_fn,
1167                           struct userdata_struct *userdata,
1168                           struct name_record *namerec,
1169                           struct in_addr refresh_ip);
1170 struct response_record *queue_query_name( struct subnet_record *subrec,
1171                           response_function resp_fn,
1172                           timeout_response_function timeout_fn,
1173                           query_name_success_function success_fn,
1174                           query_name_fail_function fail_fn,
1175                           struct userdata_struct *userdata,
1176                           struct nmb_name *nmbname);
1177 struct response_record *queue_query_name_from_wins_server( struct in_addr to_ip,
1178                           response_function resp_fn,
1179                           timeout_response_function timeout_fn,
1180                           query_name_success_function success_fn,
1181                           query_name_fail_function fail_fn,
1182                           struct userdata_struct *userdata,
1183                           struct nmb_name *nmbname);
1184 struct response_record *queue_node_status( struct subnet_record *subrec,
1185                           response_function resp_fn,
1186                           timeout_response_function timeout_fn,
1187                           node_status_success_function success_fn,
1188                           node_status_fail_function fail_fn,
1189                           struct userdata_struct *userdata,
1190                           struct nmb_name *nmbname,
1191                           struct in_addr send_ip);
1192 void reply_netbios_packet(struct packet_struct *orig_packet,
1193                           int rcode, enum netbios_reply_type_code rcv_code, int opcode,
1194                           int ttl, char *data,int len);
1195 void run_packet_queue(void);
1196 void retransmit_or_expire_response_records(time_t t);
1197 BOOL listen_for_packets(BOOL run_election);
1198 BOOL send_mailslot(BOOL unique, char *mailslot,char *buf,int len,
1199                    char *srcname, int src_type,
1200                    char *dstname, int dest_type,
1201                    struct in_addr dest_ip,struct in_addr src_ip,
1202                    int dest_port);
1203
1204 /*The following definitions come from  nmbd/nmbd_processlogon.c  */
1205
1206 void process_logon_packet(struct packet_struct *p,char *buf,int len, 
1207                           char *mailslot);
1208
1209 /*The following definitions come from  nmbd/nmbd_responserecordsdb.c  */
1210
1211 void remove_response_record(struct subnet_record *subrec,
1212                                 struct response_record *rrec);
1213 struct response_record *make_response_record( struct subnet_record *subrec,
1214                     struct packet_struct *p,
1215                     response_function resp_fn,
1216                     timeout_response_function timeout_fn,
1217                     success_function success_fn,
1218                     fail_function fail_fn,
1219                     struct userdata_struct *userdata);
1220 struct response_record *find_response_record(struct subnet_record **ppsubrec,
1221                                 uint16 id);
1222 BOOL is_refresh_already_queued(struct subnet_record *subrec, struct name_record *namerec);
1223
1224 /*The following definitions come from  nmbd/nmbd_sendannounce.c  */
1225
1226 void send_browser_reset(int reset_type, char *to_name, int to_type, struct in_addr to_ip);
1227 void broadcast_announce_request(struct subnet_record *subrec, struct work_record *work);
1228 void announce_my_server_names(time_t t);
1229 void announce_my_lm_server_names(time_t t);
1230 void reset_announce_timer(void);
1231 void announce_myself_to_domain_master_browser(time_t t);
1232 void announce_my_servers_removed(void);
1233 void announce_remote(time_t t);
1234 void browse_sync_remote(time_t t);
1235
1236 /*The following definitions come from  nmbd/nmbd_serverlistdb.c  */
1237
1238 void remove_all_servers(struct work_record *work);
1239 struct server_record *find_server_in_workgroup(struct work_record *work, char *name);
1240 void remove_server_from_workgroup(struct work_record *work, struct server_record *servrec);
1241 struct server_record *create_server_on_workgroup(struct work_record *work,
1242                                                  char *name,int servertype, 
1243                                                  int ttl,char *comment);
1244 void update_server_ttl(struct server_record *servrec, int ttl);
1245 void expire_servers(struct work_record *work, time_t t);
1246 void write_browse_list(time_t t, BOOL force_write);
1247
1248 /*The following definitions come from  nmbd/nmbd_subnetdb.c  */
1249
1250 void close_subnet(struct subnet_record *subrec);
1251 struct subnet_record *make_normal_subnet(struct interface *iface);
1252 BOOL create_subnets(void);
1253 BOOL we_are_a_wins_client(void);
1254 struct subnet_record *get_next_subnet_maybe_unicast(struct subnet_record *subrec);
1255 struct subnet_record *get_next_subnet_maybe_unicast_or_wins_server(struct subnet_record *subrec);
1256
1257 /*The following definitions come from  nmbd/nmbd_synclists.c  */
1258
1259 void sync_browse_lists(struct work_record *work,
1260                        char *name, int nm_type, 
1261                        struct in_addr ip, BOOL local, BOOL servers);
1262 void sync_check_completion(void);
1263
1264 /*The following definitions come from  nmbd/nmbd_winsproxy.c  */
1265
1266 void make_wins_proxy_name_query_request( struct subnet_record *subrec, 
1267                                          struct packet_struct *incoming_packet,
1268                                          struct nmb_name *question_name);
1269
1270 /*The following definitions come from  nmbd/nmbd_winsserver.c  */
1271
1272 BOOL packet_is_for_wins_server(struct packet_struct *packet);
1273 BOOL initialise_wins(void);
1274 void wins_process_name_refresh_request(struct subnet_record *subrec,
1275                                             struct packet_struct *p);
1276 void wins_process_name_registration_request(struct subnet_record *subrec,
1277                                             struct packet_struct *p);
1278 void wins_process_multihomed_name_registration_request( struct subnet_record *subrec,
1279                                                         struct packet_struct *p);
1280 void send_wins_name_query_response(int rcode, struct packet_struct *p, 
1281                                           struct name_record *namerec);
1282 void wins_process_name_query_request(struct subnet_record *subrec, 
1283                                      struct packet_struct *p);
1284 void wins_process_name_release_request(struct subnet_record *subrec,
1285                                        struct packet_struct *p);
1286 void initiate_wins_processing(time_t t);
1287 void wins_write_database(BOOL background);
1288
1289 /*The following definitions come from  nmbd/nmbd_workgroupdb.c  */
1290
1291 struct work_record *find_workgroup_on_subnet(struct subnet_record *subrec, 
1292                                              const char *name);
1293 struct work_record *create_workgroup_on_subnet(struct subnet_record *subrec,
1294                                                fstring name, int ttl);
1295 void update_workgroup_ttl(struct work_record *work, int ttl);
1296 void initiate_myworkgroup_startup(struct subnet_record *subrec, struct work_record *work);
1297 void dump_workgroups(BOOL force_write);
1298 void expire_workgroups_and_servers(time_t t);
1299
1300 /*The following definitions come from  nsswitch/wb_client.c  */
1301
1302 BOOL winbind_lookup_name(char *name, DOM_SID *sid, enum SID_NAME_USE *name_type);
1303 BOOL winbind_lookup_sid(DOM_SID *sid, fstring dom_name, fstring name, enum SID_NAME_USE *name_type);
1304 BOOL winbind_sid_to_uid(uid_t *puid, DOM_SID *sid);
1305 BOOL winbind_uid_to_sid(DOM_SID *sid, uid_t uid);
1306 BOOL winbind_sid_to_gid(gid_t *pgid, DOM_SID *sid);
1307 BOOL winbind_gid_to_sid(DOM_SID *sid, gid_t gid);
1308 int winbind_initgroups(char *user, gid_t gid);
1309 int winbind_getgroups(char *user, int size, gid_t *list);
1310 BOOL winbind_uidtoname(fstring name, uid_t uid);
1311 BOOL winbind_gidtoname(fstring name, gid_t gid);
1312 BOOL winbind_nametouid(uid_t *puid, char *name);
1313 BOOL winbind_nametogid(gid_t *pgid, char *gname);
1314
1315 /*The following definitions come from  nsswitch/wb_common.c  */
1316
1317 void init_request(struct winbindd_request *request, int request_type);
1318 void init_response(struct winbindd_response *response);
1319 void close_sock(void);
1320 int write_sock(void *buffer, int count);
1321 int read_reply(struct winbindd_response *response);
1322 void free_response(struct winbindd_response *response);
1323 enum nss_status winbindd_request(int req_type, 
1324                                  struct winbindd_request *request,
1325                                  struct winbindd_response *response);
1326
1327 /*The following definitions come from  param/loadparm.c  */
1328
1329 void lp_talloc_free(void);
1330 char *lp_logfile(void);
1331 char *lp_smbrun(void);
1332 char *lp_configfile(void);
1333 char *lp_tdb_passwd_file(void);
1334 char *lp_smb_passwd_file(void);
1335 char *lp_passdb_module_path(void);
1336 char *lp_serverstring(void);
1337 char *lp_printcapname(void);
1338 char *lp_enumports_cmd(void);
1339 char *lp_addprinter_cmd(void);
1340 char *lp_deleteprinter_cmd(void);
1341 char *lp_lockdir(void);
1342 char *lp_utmpdir(void);
1343 char *lp_wtmpdir(void);
1344 char *lp_utmp_hostname(void);
1345 BOOL lp_utmp_consolidate(void);
1346 char *lp_rootdir(void);
1347 char *lp_source_environment(void);
1348 char *lp_defaultservice(void);
1349 char *lp_msg_command(void);
1350 char *lp_dfree_command(void);
1351 char *lp_hosts_equiv(void);
1352 char *lp_auto_services(void);
1353 char *lp_passwd_program(void);
1354 char *lp_passwd_chat(void);
1355 char *lp_passwordserver(void);
1356 char *lp_name_resolve_order(void);
1357 char *lp_workgroup(void);
1358 char *lp_username_map(void);
1359 char *lp_groupname_map(void);
1360 char *lp_logon_script(void);
1361 char *lp_logon_path(void);
1362 char *lp_logon_drive(void);
1363 char *lp_logon_home(void);
1364 char *lp_remote_announce(void);
1365 char *lp_remote_browse_sync(void);
1366 char *lp_wins_server(void);
1367 char *lp_interfaces(void);
1368 char *lp_socket_address(void);
1369 char *lp_nis_home_map_name(void);
1370 char *lp_netbios_aliases(void);
1371 char *lp_panic_action(void);
1372 char *lp_adduser_script(void);
1373 char *lp_deluser_script(void);
1374 char *lp_wins_hook(void);
1375 char *lp_domain_groups(void);
1376 char *lp_domain_admin_group(void);
1377 char *lp_domain_guest_group(void);
1378 char *lp_domain_admin_users(void);
1379 char *lp_domain_guest_users(void);
1380 char *lp_winbind_uid(void);
1381 char *lp_winbind_gid(void);
1382 char *lp_template_homedir(void);
1383 char *lp_template_shell(void);
1384 char *lp_winbind_separator(void);
1385 char *lp_codepagedir(void);
1386 char *lp_ldap_server(void);
1387 char *lp_ldap_suffix(void);
1388 char *lp_ldap_filter(void);
1389 char *lp_ldap_root(void);
1390 char *lp_ldap_rootpasswd(void);
1391 int lp_ssl_version(void);
1392 char *lp_ssl_hosts(void);
1393 char *lp_ssl_hosts_resign(void);
1394 char *lp_ssl_cacertdir(void);
1395 char *lp_ssl_cacertfile(void);
1396 char *lp_ssl_cert(void);
1397 char *lp_ssl_privkey(void);
1398 char *lp_ssl_client_cert(void);
1399 char *lp_ssl_client_privkey(void);
1400 char *lp_ssl_ciphers(void);
1401 BOOL lp_ssl_enabled(void);
1402 BOOL lp_ssl_reqClientCert(void);
1403 BOOL lp_ssl_reqServerCert(void);
1404 BOOL lp_ssl_compatibility(void);
1405 BOOL lp_ms_add_printer_wizard(void);
1406 BOOL lp_dns_proxy(void);
1407 BOOL lp_wins_support(void);
1408 BOOL lp_we_are_a_wins_server(void);
1409 BOOL lp_wins_proxy(void);
1410 BOOL lp_local_master(void);
1411 BOOL lp_domain_logons(void);
1412 BOOL lp_load_printers(void);
1413 BOOL lp_use_rhosts(void);
1414 BOOL lp_readprediction(void);
1415 BOOL lp_readbmpx(void);
1416 BOOL lp_readraw(void);
1417 BOOL lp_writeraw(void);
1418 BOOL lp_null_passwords(void);
1419 BOOL lp_strip_dot(void);
1420 BOOL lp_encrypted_passwords(void);
1421 BOOL lp_update_encrypted(void);
1422 BOOL lp_syslog_only(void);
1423 BOOL lp_timestamp_logs(void);
1424 BOOL lp_debug_hires_timestamp(void);
1425 BOOL lp_debug_pid(void);
1426 BOOL lp_debug_uid(void);
1427 BOOL lp_browse_list(void);
1428 BOOL lp_unix_realname(void);
1429 BOOL lp_nis_home_map(void);
1430 BOOL lp_bind_interfaces_only(void);
1431 BOOL lp_unix_password_sync(void);
1432 BOOL lp_passwd_chat_debug(void);
1433 BOOL lp_nt_smb_support(void);
1434 BOOL lp_nt_pipe_support(void);
1435 BOOL lp_nt_acl_support(void);
1436 BOOL lp_stat_cache(void);
1437 BOOL lp_allow_trusted_domains(void);
1438 BOOL lp_restrict_anonymous(void);
1439 BOOL lp_host_msdfs(void);
1440 BOOL lp_kernel_oplocks(void);
1441 int lp_os_level(void);
1442 int lp_max_ttl(void);
1443 int lp_max_wins_ttl(void);
1444 int lp_min_wins_ttl(void);
1445 int lp_max_log_size(void);
1446 int lp_max_open_files(void);
1447 int lp_maxxmit(void);
1448 int lp_maxmux(void);
1449 int lp_passwordlevel(void);
1450 int lp_usernamelevel(void);
1451 int lp_readsize(void);
1452 int lp_deadtime(void);
1453 int lp_maxprotocol(void);
1454 int lp_security(void);
1455 int lp_maxdisksize(void);
1456 int lp_lpqcachetime(void);
1457 int lp_syslog(void);
1458 int lp_client_code_page(void);
1459 int lp_lm_announce(void);
1460 int lp_lm_interval(void);
1461 int lp_machine_password_timeout(void);
1462 int lp_change_notify_timeout(void);
1463 int lp_stat_cache_size(void);
1464 int lp_map_to_guest(void);
1465 int lp_min_passwd_length(void);
1466 int lp_oplock_break_wait_time(void);
1467 int lp_ldap_port(void);
1468 char *lp_preexec(int );
1469 char *lp_postexec(int );
1470 char *lp_rootpreexec(int );
1471 char *lp_rootpostexec(int );
1472 char *lp_servicename(int );
1473 char *lp_pathname(int );
1474 char *lp_dontdescend(int );
1475 char *lp_username(int );
1476 char *lp_guestaccount(int );
1477 char *lp_invalid_users(int );
1478 char *lp_valid_users(int );
1479 char *lp_admin_users(int );
1480 char *lp_printcommand(int );
1481 char *lp_lpqcommand(int );
1482 char *lp_lprmcommand(int );
1483 char *lp_lppausecommand(int );
1484 char *lp_lpresumecommand(int );
1485 char *lp_queuepausecommand(int );
1486 char *lp_queueresumecommand(int );
1487 char *lp_driverfile(int );
1488 char *lp_printerdriver(int );
1489 char *lp_hostsallow(int );
1490 char *lp_hostsdeny(int );
1491 char *lp_magicscript(int );
1492 char *lp_magicoutput(int );
1493 char *lp_comment(int );
1494 char *lp_force_user(int );
1495 char *lp_force_group(int );
1496 char *lp_readlist(int );
1497 char *lp_writelist(int );
1498 char *lp_printer_admin(int );
1499 char *lp_fstype(int );
1500 char *lp_vfsobj(int );
1501 char *lp_mangled_map(int );
1502 char *lp_veto_files(int );
1503 char *lp_hide_files(int );
1504 char *lp_veto_oplocks(int );
1505 char *lp_driverlocation(int );
1506 BOOL lp_msdfs_root(int );
1507 BOOL lp_autoloaded(int );
1508 BOOL lp_preexec_close(int );
1509 BOOL lp_rootpreexec_close(int );
1510 BOOL lp_casesensitive(int );
1511 BOOL lp_preservecase(int );
1512 BOOL lp_shortpreservecase(int );
1513 BOOL lp_casemangle(int );
1514 BOOL lp_status(int );
1515 BOOL lp_hide_dot_files(int );
1516 BOOL lp_browseable(int );
1517 BOOL lp_readonly(int );
1518 BOOL lp_no_set_dir(int );
1519 BOOL lp_guest_ok(int );
1520 BOOL lp_guest_only(int );
1521 BOOL lp_print_ok(int );
1522 BOOL lp_postscript(int );
1523 BOOL lp_map_hidden(int );
1524 BOOL lp_map_archive(int );
1525 BOOL lp_locking(int );
1526 BOOL lp_strict_locking(int );
1527 BOOL lp_posix_locking(int );
1528 BOOL lp_utmp(int );
1529 BOOL lp_share_modes(int );
1530 BOOL lp_oplocks(int );
1531 BOOL lp_level2_oplocks(int );
1532 BOOL lp_onlyuser(int );
1533 BOOL lp_manglednames(int );
1534 BOOL lp_widelinks(int );
1535 BOOL lp_symlinks(int );
1536 BOOL lp_syncalways(int );
1537 BOOL lp_strict_sync(int );
1538 BOOL lp_map_system(int );
1539 BOOL lp_delete_readonly(int );
1540 BOOL lp_fake_oplocks(int );
1541 BOOL lp_recursive_veto_delete(int );
1542 BOOL lp_dos_filetimes(int );
1543 BOOL lp_dos_filetime_resolution(int );
1544 BOOL lp_fake_dir_create_times(int );
1545 BOOL lp_blocking_locks(int );
1546 BOOL lp_inherit_perms(int );
1547 int lp_create_mask(int );
1548 int lp_force_create_mode(int );
1549 int _lp_security_mask(int );
1550 int _lp_force_security_mode(int );
1551 int lp_dir_mask(int );
1552 int lp_force_dir_mode(int );
1553 int _lp_dir_security_mask(int );
1554 int _lp_force_dir_security_mode(int );
1555 int lp_max_connections(int );
1556 int lp_defaultcase(int );
1557 int lp_minprintspace(int );
1558 int lp_maxprintjobs(int );
1559 int lp_printing(int );
1560 int lp_oplock_contention_limit(int );
1561 int lp_write_cache_size(int );
1562 char lp_magicchar(int );
1563 int lp_winbind_cache_time(void);
1564 BOOL lp_add_home(char *pszHomename, int iDefaultService, char *pszHomedir);
1565 int lp_add_service(char *pszService, int iDefaultService);
1566 BOOL lp_add_printer(char *pszPrintername, int iDefaultService);
1567 BOOL lp_file_list_changed(void);
1568 void *lp_local_ptr(int snum, void *ptr);
1569 BOOL lp_do_parameter(int snum, char *pszParmName, char *pszParmValue);
1570 void init_locals(void);
1571 BOOL lp_is_default(int snum, struct parm_struct *parm);
1572 struct parm_struct *lp_next_parameter(int snum, int *i, int allparameters);
1573 BOOL lp_snum_ok(int iService);
1574 void lp_add_one_printer(char *name, char *comment);
1575 BOOL lp_loaded(void);
1576 void lp_killunused(BOOL (*snumused) (int));
1577 void lp_killservice(int iServiceIn);
1578 BOOL lp_load(char *pszFname, BOOL global_only, BOOL save_defaults,
1579              BOOL add_ipc);
1580 void lp_resetnumservices(void);
1581 int lp_numservices(void);
1582 void lp_dump(FILE * f, BOOL show_defaults, int maxtoprint);
1583 void lp_dump_one(FILE * f, BOOL show_defaults, int snum);
1584 int lp_servicenumber(char *pszServiceName);
1585 char *volume_label(int snum);
1586 int lp_server_role(void);
1587 BOOL lp_domain_master(void);
1588 BOOL lp_preferred_master(void);
1589 void lp_remove_service(int snum);
1590 void lp_copy_service(int snum, char *new_name);
1591 int lp_default_server_announce(void);
1592 int lp_major_announce_version(void);
1593 int lp_minor_announce_version(void);
1594 void lp_set_name_resolve_order(char *new_order);
1595 int lp_security_mask(int snum);
1596 int lp_force_security_mode(int snum);
1597 int lp_dir_security_mask(int snum);
1598 int lp_force_dir_security_mode(int snum);
1599 char *lp_printername(int snum);
1600
1601 /*The following definitions come from  param/params.c  */
1602
1603 BOOL pm_process( char *FileName,
1604                  BOOL (*sfunc)(char *),
1605                  BOOL (*pfunc)(char *, char *) );
1606
1607 /*The following definitions come from  passdb/machine_sid.c  */
1608
1609 BOOL pdb_generate_sam_sid(void);
1610
1611 /*The following definitions come from  passdb/pass_check.c  */
1612
1613 void dfs_unlogin(void);
1614 BOOL pass_check(char *user, char *password, int pwlen, struct passwd *pwd,
1615                 BOOL (*fn) (char *, char *));
1616
1617 /*The following definitions come from  passdb/passdb.c  */
1618
1619 BOOL initialize_password_db(BOOL reload);
1620 void pdb_init_sam(SAM_ACCOUNT *user);
1621 void pdb_clear_sam(SAM_ACCOUNT *user);
1622 struct sam_disp_info *pdb_sam_to_dispinfo(SAM_ACCOUNT *user);
1623 char *pdb_encode_acct_ctrl(uint16 acct_ctrl, size_t length);
1624 uint16 pdb_decode_acct_ctrl(const char *p);
1625 void pdb_sethexpwd(char *p, unsigned char *pwd, uint16 acct_ctrl);
1626 BOOL pdb_gethexpwd(char *p, unsigned char *pwd);
1627 BOOL pdb_name_to_rid(char *user_name, uint32 *u_rid, uint32 *g_rid);
1628 uid_t pdb_user_rid_to_uid(uint32 user_rid);
1629 gid_t pdb_user_rid_to_gid(uint32 user_rid);
1630 uint32 pdb_uid_to_user_rid(uid_t uid);
1631 uint32 pdb_gid_to_group_rid(gid_t gid);
1632 BOOL pdb_rid_is_user(uint32 rid);
1633 BOOL local_lookup_rid(uint32 rid, char *name, enum SID_NAME_USE *psid_name_use);
1634 BOOL local_lookup_name(char *domain, char *user, DOM_SID *psid, enum SID_NAME_USE *psid_name_use);
1635 DOM_SID *local_uid_to_sid(DOM_SID *psid, uid_t uid);
1636 BOOL local_sid_to_uid(uid_t *puid, DOM_SID *psid, enum SID_NAME_USE *name_type);
1637 DOM_SID *local_gid_to_sid(DOM_SID *psid, gid_t gid);
1638 BOOL local_sid_to_gid(gid_t *pgid, DOM_SID *psid, enum SID_NAME_USE *name_type);
1639 void copy_id23_to_sam_passwd(struct sam_passwd *to, SAM_USER_INFO_23 *from);
1640 void copy_id21_to_sam_passwd(struct sam_passwd *to, SAM_USER_INFO_21 *from);
1641 void copy_sam_passwd(struct sam_passwd *to, const struct sam_passwd *from);
1642 BOOL local_password_change(char *user_name, int local_flags,
1643                            char *new_passwd, 
1644                            char *err_str, size_t err_str_len,
1645                            char *msg_str, size_t msg_str_len);
1646 uint16 pdb_get_acct_ctrl (SAM_ACCOUNT *sampass);
1647 time_t pdb_get_logon_time (SAM_ACCOUNT *sampass);
1648 time_t pdb_get_logoff_time (SAM_ACCOUNT *sampass);
1649 time_t pdb_get_kickoff_time (SAM_ACCOUNT *sampass);
1650 time_t pdb_get_pass_last_set_time (SAM_ACCOUNT *sampass);
1651 time_t pdb_get_pass_can_change_time (SAM_ACCOUNT *sampass);
1652 time_t pdb_get_pass_must_change_time (SAM_ACCOUNT *sampass);
1653 uint16 pdb_get_logon_divs (SAM_ACCOUNT *sampass);
1654 uint32 pdb_get_hours_len (SAM_ACCOUNT *sampass);
1655 uint8* pdb_get_hours (SAM_ACCOUNT *sampass);
1656 BYTE* pdb_get_nt_passwd (SAM_ACCOUNT *sampass);
1657 BYTE* pdb_get_lanman_passwd (SAM_ACCOUNT *sampass);
1658 uint32 pdb_get_user_rid (SAM_ACCOUNT *sampass);
1659 uint32 pdb_get_group_rid (SAM_ACCOUNT *sampass);
1660 uid_t pdb_get_uid (SAM_ACCOUNT *sampass);
1661 gid_t pdb_get_gid (SAM_ACCOUNT *sampass);
1662 char* pdb_get_username (SAM_ACCOUNT *sampass);
1663 char* pdb_get_domain (SAM_ACCOUNT *sampass);
1664 char* pdb_get_nt_username (SAM_ACCOUNT *sampass);
1665 char* pdb_get_fullname (SAM_ACCOUNT *sampass);
1666 char* pdb_get_homedir (SAM_ACCOUNT *sampass);
1667 char* pdb_get_dirdrive (SAM_ACCOUNT *sampass);
1668 char* pdb_get_logon_script (SAM_ACCOUNT *sampass);
1669 char* pdb_get_profile_path (SAM_ACCOUNT *sampass);
1670 char* pdb_get_acct_desc (SAM_ACCOUNT *sampass);
1671 char* pdb_get_workstations (SAM_ACCOUNT *sampass);
1672 char* pdb_get_munged_dial (SAM_ACCOUNT *sampass);
1673 uint32 pdb_get_unknown3 (SAM_ACCOUNT *sampass);
1674 uint32 pdb_get_unknown5 (SAM_ACCOUNT *sampass);
1675 uint32 pdb_get_unknown6 (SAM_ACCOUNT *sampass);
1676 BOOL pdb_set_acct_ctrl (SAM_ACCOUNT *sampass, uint16 flags);
1677 BOOL pdb_set_logon_time (SAM_ACCOUNT *sampass, time_t time);
1678 BOOL pdb_set_logoff_time (SAM_ACCOUNT *sampass, time_t time);
1679 BOOL pdb_set_kickoff_time (SAM_ACCOUNT *sampass, time_t time);
1680 BOOL pdb_set_pass_can_change_time (SAM_ACCOUNT *sampass, time_t time);
1681 BOOL pdb_set_pass_must_change_time (SAM_ACCOUNT *sampass, time_t time);
1682 BOOL pdb_set_pass_last_set_time (SAM_ACCOUNT *sampass, time_t time);
1683 BOOL pdb_set_hours_len (SAM_ACCOUNT *sampass, uint32 len);
1684 BOOL pdb_set_logons_divs (SAM_ACCOUNT *sampass, uint16 hours);
1685 BOOL pdb_set_uid (SAM_ACCOUNT *sampass, uid_t uid);
1686 BOOL pdb_set_gid (SAM_ACCOUNT *sampass, gid_t gid);
1687 BOOL pdb_set_user_rid (SAM_ACCOUNT *sampass, uint32 rid);
1688 BOOL pdb_set_group_rid (SAM_ACCOUNT *sampass, uint32 grid);
1689 BOOL pdb_set_username (SAM_ACCOUNT *sampass, char *username);
1690 BOOL pdb_set_domain (SAM_ACCOUNT *sampass, char *domain);
1691 BOOL pdb_set_nt_username (SAM_ACCOUNT *sampass, char *nt_username);
1692 BOOL pdb_set_fullname (SAM_ACCOUNT *sampass, char *fullname);
1693 BOOL pdb_set_logon_script (SAM_ACCOUNT *sampass, char *logon_script);
1694 BOOL pdb_set_profile_path (SAM_ACCOUNT *sampass, char *profile_path);
1695 BOOL pdb_set_dir_drive (SAM_ACCOUNT *sampass, char *dir_drive);
1696 BOOL pdb_set_homedir (SAM_ACCOUNT *sampass, char *homedir);
1697 BOOL pdb_set_nt_passwd (SAM_ACCOUNT *sampass, BYTE *pwd);
1698 BOOL pdb_set_lanman_passwd (SAM_ACCOUNT *sampass, BYTE *pwd);
1699
1700 /*The following definitions come from  passdb/pdb_smbpasswd.c  */
1701
1702 BOOL pdb_setsampwent (BOOL update);
1703 void pdb_endsampwent (void);
1704 SAM_ACCOUNT* pdb_getsampwent (void);
1705 SAM_ACCOUNT* pdb_getsampwnam (char *username);
1706 SAM_ACCOUNT* pdb_getsampwuid (uid_t uid);
1707 SAM_ACCOUNT* pdb_getsampwrid (uint32 rid);
1708 BOOL pdb_add_sam_account (SAM_ACCOUNT *sampass);
1709 BOOL pdb_update_sam_account (SAM_ACCOUNT *sampass, BOOL override);
1710 BOOL pdb_delete_sam_account (char* username);
1711
1712 /*The following definitions come from  passdb/secrets.c  */
1713
1714 BOOL secrets_init(void);
1715 void *secrets_fetch(char *key, size_t *size);
1716 BOOL secrets_store(char *key, void *data, size_t size);
1717 BOOL secrets_delete(char *key);
1718 BOOL secrets_store_domain_sid(char *domain, DOM_SID *sid);
1719 BOOL secrets_fetch_domain_sid(char *domain, DOM_SID *sid);
1720 BOOL secrets_fetch_trust_account_password(char *domain, uint8 ret_pwd[16],
1721                                           time_t *pass_last_set_time);
1722 BOOL secrets_store_trust_account_password(char *domain, uint8 new_pwd[16]);
1723
1724 /*The following definitions come from  passdb/smbpassfile.c  */
1725
1726 BOOL trust_password_delete(char *domain);
1727
1728 /*The following definitions come from  printing/load.c  */
1729
1730 void add_all_printers(void);
1731 void load_printers(void);
1732
1733 /*The following definitions come from  printing/lpq_parse.c  */
1734
1735 BOOL parse_lpq_entry(int snum,char *line,
1736                      print_queue_struct *buf,
1737                      print_status_struct *status,BOOL first);
1738
1739 /*The following definitions come from  printing/nt_printing.c  */
1740
1741 #if OLD_NTDOMAIN
1742 BOOL nt_printing_init(void);
1743 int get_ntforms(nt_forms_struct **list);
1744 int write_ntforms(nt_forms_struct **list, int number);
1745 BOOL add_a_form(nt_forms_struct **list, const FORM *form, int *count);
1746 BOOL delete_a_form(nt_forms_struct **list, UNISTR2 *del_name, int *count, uint32 *ret);
1747 void update_a_form(nt_forms_struct **list, const FORM *form, int count);
1748 int get_ntdrivers(fstring **list, char *architecture, uint32 version);
1749 BOOL get_short_archi(char *short_archi, char *long_archi);
1750 uint32 clean_up_driver_struct(NT_PRINTER_DRIVER_INFO_LEVEL driver_abstract, uint32 level);
1751 BOOL move_driver_to_download_area(NT_PRINTER_DRIVER_INFO_LEVEL driver_abstract, 
1752                                   uint32 level, struct current_user *user, uint32 *perr);
1753 uint32 get_a_printer_driver_9x_compatible(pstring line, fstring model);
1754 uint32 del_a_printer(char *sharename);
1755 BOOL add_a_specific_param(NT_PRINTER_INFO_LEVEL_2 *info_2, NT_PRINTER_PARAM *param);
1756 BOOL unlink_specific_param_if_exist(NT_PRINTER_INFO_LEVEL_2 *info_2, NT_PRINTER_PARAM *param);
1757 NT_DEVICEMODE *construct_nt_devicemode(const fstring default_devicename);
1758 NT_DEVICEMODE *dup_nt_devicemode(NT_DEVICEMODE *nt_devicemode);
1759 void free_nt_devicemode(NT_DEVICEMODE **devmode_ptr);
1760 void get_printer_subst_params(int snum, fstring *printername, fstring *sharename, fstring *portname);
1761 uint32 mod_a_printer(NT_PRINTER_INFO_LEVEL printer, uint32 level);
1762 uint32 add_a_printer(NT_PRINTER_INFO_LEVEL printer, uint32 level);
1763 uint32 get_a_printer(NT_PRINTER_INFO_LEVEL **pp_printer, uint32 level, fstring sharename);
1764 uint32 free_a_printer(NT_PRINTER_INFO_LEVEL **pp_printer, uint32 level);
1765 uint32 add_a_printer_driver(NT_PRINTER_DRIVER_INFO_LEVEL driver, uint32 level);
1766 uint32 get_a_printer_driver(NT_PRINTER_DRIVER_INFO_LEVEL *driver, uint32 level, 
1767                             fstring printername, fstring architecture, uint32 version);
1768 uint32 free_a_printer_driver(NT_PRINTER_DRIVER_INFO_LEVEL driver, uint32 level);
1769 BOOL get_specific_param_by_index(NT_PRINTER_INFO_LEVEL printer, uint32 level, uint32 param_index,
1770                                  fstring value, uint8 **data, uint32 *type, uint32 *len);
1771 BOOL get_specific_param(NT_PRINTER_INFO_LEVEL printer, uint32 level, 
1772                         fstring value, uint8 **data, uint32 *type, uint32 *len);
1773 uint32 nt_printing_setsec(char *printername, SEC_DESC_BUF *secdesc_ctr);
1774 BOOL nt_printing_getsec(char *printername, SEC_DESC_BUF **secdesc_ctr);
1775 BOOL print_access_check(struct current_user *user, int snum, int access_type);
1776 BOOL print_time_access_check(int snum);
1777 #endif
1778
1779 /*The following definitions come from  printing/pcap.c  */
1780
1781 BOOL pcap_printername_ok(char *pszPrintername, char *pszPrintcapname);
1782 void pcap_printer_fn(void (*fn)(char *, char *));
1783
1784 /*The following definitions come from  printing/print_cups.c  */
1785
1786 void cups_printer_fn(void (*fn)(char *, char *));
1787 int cups_printername_ok(char *name);
1788
1789 /*The following definitions come from  printing/print_svid.c  */
1790
1791 void sysv_printer_fn(void (*fn)(char *, char *));
1792 int sysv_printername_ok(char *name);
1793
1794 /*The following definitions come from  printing/printfsp.c  */
1795
1796 #if OLD_NTDOMAIN
1797 files_struct *print_fsp_open(connection_struct *conn,char *jobname);
1798 void print_fsp_end(files_struct *fsp);
1799 #endif
1800
1801 /*The following definitions come from  printing/printing.c  */
1802
1803 #if OLD_NTDOMAIN
1804 BOOL print_backend_init(void);
1805 BOOL print_job_exists(int jobid);
1806 int print_job_snum(int jobid);
1807 int print_job_fd(int jobid);
1808 char *print_job_fname(int jobid);
1809 BOOL print_job_set_place(int jobid, int place);
1810 BOOL print_job_set_name(int jobid, char *name);
1811 BOOL print_job_delete(struct current_user *user, int jobid, int *errcode);
1812 BOOL print_job_pause(struct current_user *user, int jobid, int *errcode);
1813 BOOL print_job_resume(struct current_user *user, int jobid, int *errcode);
1814 int print_job_write(int jobid, const char *buf, int size);
1815 int print_job_start(struct current_user *user, int snum, char *jobname);
1816 BOOL print_job_end(int jobid);
1817 int print_queue_status(int snum, 
1818                        print_queue_struct **queue,
1819                        print_status_struct *status);
1820 int print_queue_snum(char *qname);
1821 BOOL print_queue_pause(struct current_user *user, int snum, int *errcode);
1822 BOOL print_queue_resume(struct current_user *user, int snum, int *errcode);
1823 BOOL print_queue_purge(struct current_user *user, int snum, int *errcode);
1824 #endif
1825
1826 /*The following definitions come from  profile/profile.c  */
1827
1828 void profile_message(int msg_type, pid_t src, void *buf, size_t len);
1829 void reqprofile_message(int msg_type, pid_t src, void *buf, size_t len);
1830 BOOL profile_setup(BOOL rdonly);
1831
1832 /*The following definitions come from  rpc_client/cli_connect.c  */
1833
1834 void init_connections(void);
1835 void free_connections(void);
1836 void cli_connection_free(struct cli_connection *con);
1837 void cli_connection_unlink(struct cli_connection *con);
1838 BOOL cli_connection_init(const char *srv_name, char *pipe_name,
1839                          struct cli_connection **con);
1840 BOOL cli_connection_init_auth(const char *srv_name, char *pipe_name,
1841                               struct cli_connection **con,
1842                               cli_auth_fns * auth, void *auth_creds);
1843 struct _cli_auth_fns *cli_conn_get_authfns(struct cli_connection *con);
1844 void *cli_conn_get_auth_creds(struct cli_connection *con);
1845 BOOL rpc_hnd_pipe_req(const POLICY_HND * hnd, uint8 op_num,
1846                       prs_struct * data, prs_struct * rdata);
1847 BOOL rpc_con_pipe_req(struct cli_connection *con, uint8 op_num,
1848                       prs_struct * data, prs_struct * rdata);
1849 BOOL rpc_con_ok(struct cli_connection *con);
1850
1851 /*The following definitions come from  rpc_client/cli_login.c  */
1852
1853 BOOL cli_nt_setup_creds(struct cli_state *cli, unsigned char mach_pwd[16]);
1854 BOOL cli_nt_srv_pwset(struct cli_state *cli, unsigned char *new_hashof_mach_pwd);
1855 BOOL cli_nt_login_interactive(struct cli_state *cli, char *domain, char *username, 
1856                               uint32 smb_userid_low, char *password,
1857                               NET_ID_INFO_CTR *ctr, NET_USER_INFO_3 *user_info3);
1858 BOOL cli_nt_login_network(struct cli_state *cli, char *domain, char *username, 
1859                           uint32 smb_userid_low, char lm_chal[8], 
1860                           char *lm_chal_resp, char *nt_chal_resp,
1861                           NET_ID_INFO_CTR *ctr, NET_USER_INFO_3 *user_info3);
1862 BOOL cli_nt_logoff(struct cli_state *cli, NET_ID_INFO_CTR *ctr);
1863
1864 /*The following definitions come from  rpc_client/cli_lsarpc.c  */
1865
1866 BOOL do_lsa_open_policy(struct cli_state *cli,
1867                         char *system_name, POLICY_HND *hnd,
1868                         BOOL sec_qos);
1869 BOOL do_lsa_lookup_sids(struct cli_state *cli,
1870                         POLICY_HND *hnd,
1871                         int num_sids,
1872                         DOM_SID **sids,
1873                         char ***names,
1874                         int *num_names);
1875 BOOL do_lsa_query_info_pol(struct cli_state *cli,
1876                         POLICY_HND *hnd, uint16 info_class,
1877                         fstring domain_name, DOM_SID *domain_sid);
1878 BOOL do_lsa_close(struct cli_state *cli, POLICY_HND *hnd);
1879 BOOL cli_lsa_get_domain_sid(struct cli_state *cli, char *server);
1880
1881 /*The following definitions come from  rpc_client/cli_netlogon.c  */
1882
1883 BOOL cli_net_logon_ctrl2(struct cli_state *cli, uint32 status_level);
1884 BOOL cli_net_auth2(struct cli_state *cli, uint16 sec_chan, 
1885                    uint32 neg_flags, DOM_CHAL *srv_chal);
1886 BOOL cli_net_req_chal(struct cli_state *cli, DOM_CHAL *clnt_chal, DOM_CHAL *srv_chal);
1887 BOOL cli_net_srv_pwset(struct cli_state *cli, uint8 hashed_mach_pwd[16]);
1888 BOOL cli_net_sam_logon(struct cli_state *cli, NET_ID_INFO_CTR *ctr, 
1889                        NET_USER_INFO_3 *user_info3);
1890 BOOL cli_net_sam_logoff(struct cli_state *cli, NET_ID_INFO_CTR *ctr);
1891 BOOL change_trust_account_password( char *domain, char *remote_machine_list);
1892
1893 /*The following definitions come from  rpc_client/cli_pipe.c  */
1894
1895 BOOL rpc_api_pipe_req(struct cli_state *cli, uint8 op_num,
1896                       prs_struct *data, prs_struct *rdata);
1897 BOOL rpc_pipe_bind(struct cli_state *cli, char *pipe_name, char *my_name);
1898 void cli_nt_set_ntlmssp_flgs(struct cli_state *cli, uint32 ntlmssp_flgs);
1899 BOOL cli_nt_session_open(struct cli_state *cli, char *pipe_name);
1900 void cli_nt_session_close(struct cli_state *cli);
1901
1902 /*The following definitions come from  rpc_client/cli_reg.c  */
1903
1904 BOOL do_reg_connect(struct cli_state *cli, char *full_keyname, char *key_name,
1905                                 POLICY_HND *reg_hnd);
1906 BOOL do_reg_open_hklm(struct cli_state *cli, uint16 unknown_0, uint32 level,
1907                                 POLICY_HND *hnd);
1908 BOOL do_reg_open_hku(struct cli_state *cli, uint16 unknown_0, uint32 level,
1909                                 POLICY_HND *hnd);
1910 BOOL do_reg_flush_key(struct cli_state *cli, POLICY_HND *hnd);
1911 BOOL do_reg_query_key(struct cli_state *cli, POLICY_HND *hnd,
1912                                 char *class, uint32 *class_len,
1913                                 uint32 *num_subkeys, uint32 *max_subkeylen,
1914                                 uint32 *max_subkeysize, uint32 *num_values,
1915                                 uint32 *max_valnamelen, uint32 *max_valbufsize,
1916                                 uint32 *sec_desc, NTTIME *mod_time);
1917 BOOL do_reg_unknown_1a(struct cli_state *cli, POLICY_HND *hnd, uint32 *unk);
1918 BOOL do_reg_query_info(struct cli_state *cli, POLICY_HND *hnd,
1919                                 char *key_value, uint32* key_type);
1920 BOOL do_reg_set_key_sec(struct cli_state *cli, POLICY_HND *hnd, SEC_DESC_BUF *sec_desc_buf);
1921 BOOL do_reg_get_key_sec(struct cli_state *cli, POLICY_HND *hnd, uint32 *sec_buf_size, SEC_DESC_BUF **ppsec_desc_buf);
1922 BOOL do_reg_delete_val(struct cli_state *cli, POLICY_HND *hnd, char *val_name);
1923 BOOL do_reg_delete_key(struct cli_state *cli, POLICY_HND *hnd, char *key_name);
1924 BOOL do_reg_create_key(struct cli_state *cli, POLICY_HND *hnd,
1925                                 char *key_name, char *key_class,
1926                                 SEC_ACCESS *sam_access,
1927                                 POLICY_HND *key);
1928 BOOL do_reg_enum_key(struct cli_state *cli, POLICY_HND *hnd,
1929                                 int key_index, char *key_name,
1930                                 uint32 *unk_1, uint32 *unk_2,
1931                                 time_t *mod_time);
1932 BOOL do_reg_create_val(struct cli_state *cli, POLICY_HND *hnd,
1933                                 char *val_name, uint32 type, BUFFER3 *data);
1934 BOOL do_reg_enum_val(struct cli_state *cli, POLICY_HND *hnd,
1935                                 int val_index, int max_valnamelen, int max_valbufsize,
1936                                 fstring val_name,
1937                                 uint32 *val_type, BUFFER2 *value);
1938 BOOL do_reg_open_entry(struct cli_state *cli, POLICY_HND *hnd,
1939                                 char *key_name, uint32 unk_0,
1940                                 POLICY_HND *key_hnd);
1941 BOOL do_reg_close(struct cli_state *cli, POLICY_HND *hnd);
1942
1943 /*The following definitions come from  rpc_client/cli_samr.c  */
1944
1945 #if OLD_NTDOMAIN
1946 BOOL get_samr_query_usergroups(struct cli_state *cli, 
1947                                 POLICY_HND *pol_open_domain, uint32 user_rid,
1948                                 uint32 *num_groups, DOM_GID *gid);
1949 BOOL get_samr_query_userinfo(struct cli_state *cli, 
1950                                 POLICY_HND *pol_open_domain,
1951                                 uint32 info_level,
1952                                 uint32 user_rid, SAM_USER_INFO_21 *usr);
1953 BOOL do_samr_chgpasswd_user(struct cli_state *cli,
1954                 char *srv_name, char *user_name,
1955                 char nt_newpass[516], uchar nt_oldhash[16],
1956                 char lm_newpass[516], uchar lm_oldhash[16]);
1957 BOOL do_samr_unknown_38(struct cli_state *cli, char *srv_name);
1958 BOOL do_samr_query_dom_info(struct cli_state *cli, 
1959                                 POLICY_HND *domain_pol, uint16 switch_value);
1960 BOOL do_samr_enum_dom_users(struct cli_state *cli, 
1961                                 POLICY_HND *pol, uint16 num_entries, uint16 unk_0,
1962                                 uint16 acb_mask, uint16 unk_1, uint32 size,
1963                                 struct acct_info **sam,
1964                                 int *num_sam_users);
1965 BOOL do_samr_connect(struct cli_state *cli, 
1966                                 char *srv_name, uint32 unknown_0,
1967                                 POLICY_HND *connect_pol);
1968 BOOL do_samr_open_user(struct cli_state *cli, 
1969                                 POLICY_HND *pol, uint32 unk_0, uint32 rid, 
1970                                 POLICY_HND *user_pol);
1971 BOOL do_samr_open_domain(struct cli_state *cli, 
1972                                 POLICY_HND *connect_pol, uint32 rid, DOM_SID *sid,
1973                                 POLICY_HND *domain_pol);
1974 BOOL do_samr_query_unknown_12(struct cli_state *cli, 
1975                                 POLICY_HND *pol, uint32 rid, uint32 num_gids, uint32 *gids,
1976                                 uint32 *num_aliases,
1977                                 fstring als_names    [MAX_LOOKUP_SIDS],
1978                                 uint32  num_als_users[MAX_LOOKUP_SIDS]);
1979 BOOL do_samr_query_usergroups(struct cli_state *cli, 
1980                                 POLICY_HND *pol, uint32 *num_groups, DOM_GID *gid);
1981 BOOL do_samr_query_userinfo(struct cli_state *cli, 
1982                                 POLICY_HND *pol, uint16 switch_value, void* usr);
1983 BOOL do_samr_close(struct cli_state *cli, POLICY_HND *hnd);
1984 #endif
1985
1986 /*The following definitions come from  rpc_client/cli_spoolss.c  */
1987
1988 uint32 spoolss_enum_printerdrivers(const char *srv_name, const char *environment,
1989                                    uint32 level, NEW_BUFFER *buffer, uint32 offered,
1990                                    uint32 *needed, uint32 *returned);
1991 uint32 spoolss_enum_printers(uint32 flags, fstring srv_name, uint32 level,
1992                              NEW_BUFFER *buffer, uint32 offered,
1993                              uint32 *needed, uint32 *returned);
1994 uint32 spoolss_enum_ports(fstring srv_name, uint32 level,
1995                              NEW_BUFFER *buffer, uint32 offered,
1996                              uint32 *needed, uint32 *returned);
1997 uint32 spoolss_enum_jobs(const POLICY_HND *hnd, uint32 firstjob, uint32 numofjobs,
1998                          uint32 level, NEW_BUFFER *buffer, uint32 offered,
1999                          uint32 *needed, uint32 *returned);
2000 uint32 spoolss_enum_printerdata(const POLICY_HND *hnd, uint32 idx,
2001                                 uint32 *valuelen, uint16 *value, uint32 *rvaluelen,
2002                                 uint32 *type, uint32 *datalen, uint8 *data, 
2003                                 uint32 *rdatalen);
2004 uint32 spoolss_getprinter(const POLICY_HND *hnd, uint32 level,
2005                              NEW_BUFFER *buffer, uint32 offered,
2006                              uint32 *needed);
2007 uint32 spoolss_getprinterdriver(const POLICY_HND *hnd,
2008                                 const char *environment, uint32 level,
2009                                 NEW_BUFFER *buffer, uint32 offered,
2010                                 uint32 *needed);
2011 BOOL spoolss_open_printer_ex(  const char *printername,
2012                          const char *datatype, uint32 access_required,
2013                          const char *station,  const char *username,
2014                         POLICY_HND *hnd);
2015 BOOL spoolss_addprinterex(POLICY_HND *hnd, const char* srv_name, PRINTER_INFO_2 *info2);
2016 BOOL spoolss_closeprinter(POLICY_HND *hnd);
2017 uint32 spoolss_getprinterdata(const POLICY_HND *hnd, const UNISTR2 *valuename,
2018                         uint32 in_size,
2019                         uint32 *type,
2020                         uint32 *out_size,
2021                         uint8 *data,
2022                         uint32 *needed);
2023 uint32 spoolss_getprinterdriverdir(fstring srv_name, fstring env_name, uint32 level,
2024                              NEW_BUFFER *buffer, uint32 offered,
2025                              uint32 *needed);
2026 uint32 spoolss_addprinterdriver(const char *srv_name, uint32 level, PRINTER_DRIVER_CTR *info);
2027
2028 /*The following definitions come from  rpc_client/cli_spoolss_notify.c  */
2029
2030 BOOL spoolss_disconnect_from_client( struct cli_state *cli);
2031 BOOL spoolss_connect_to_client( struct cli_state *cli, char *remote_machine);
2032 BOOL cli_spoolss_reply_open_printer(struct cli_state *cli, char *printer, uint32 localprinter, uint32 type, uint32 *status, POLICY_HND *handle);
2033 BOOL cli_spoolss_reply_rrpcn(struct cli_state *cli, POLICY_HND *handle, 
2034                              uint32 change_low, uint32 change_high, uint32 *status);
2035 BOOL cli_spoolss_reply_close_printer(struct cli_state *cli, POLICY_HND *handle, uint32 *status);
2036
2037 /*The following definitions come from  rpc_client/cli_srvsvc.c  */
2038
2039 BOOL do_srv_net_srv_conn_enum(struct cli_state *cli,
2040                         char *server_name, char *qual_name,
2041                         uint32 switch_value, SRV_CONN_INFO_CTR *ctr,
2042                         uint32 preferred_len,
2043                         ENUM_HND *hnd);
2044 BOOL do_srv_net_srv_sess_enum(struct cli_state *cli,
2045                         char *server_name, char *qual_name,
2046                         uint32 switch_value, SRV_SESS_INFO_CTR *ctr,
2047                         uint32 preferred_len,
2048                         ENUM_HND *hnd);
2049 BOOL do_srv_net_srv_share_enum(struct cli_state *cli,
2050                         char *server_name, 
2051                         uint32 switch_value, SRV_R_NET_SHARE_ENUM *r_o,
2052                         uint32 preferred_len, ENUM_HND *hnd);
2053 BOOL do_srv_net_srv_file_enum(struct cli_state *cli,
2054                         char *server_name, char *qual_name,
2055                         uint32 switch_value, SRV_FILE_INFO_CTR *ctr,
2056                         uint32 preferred_len,
2057                         ENUM_HND *hnd);
2058 BOOL do_srv_net_srv_get_info(struct cli_state *cli,
2059                         char *server_name, uint32 switch_value, SRV_INFO_CTR *ctr);
2060
2061 /*The following definitions come from  rpc_client/cli_use.c  */
2062
2063 void init_cli_use(void);
2064 void free_cli_use(void);
2065 struct cli_state *cli_net_use_add(const char *srv_name,
2066                                   const struct ntuser_creds *usr_creds,
2067                                   BOOL reuse, BOOL *is_new);
2068 BOOL cli_net_use_del(const char *srv_name,
2069                      const struct ntuser_creds *usr_creds,
2070                      BOOL force_close, BOOL *connection_closed);
2071 void cli_net_use_enum(uint32 *num_cons, struct use_info ***use);
2072 void cli_use_wait_keyboard(void);
2073
2074 /*The following definitions come from  rpc_client/cli_wkssvc.c  */
2075
2076 BOOL do_wks_query_info(struct cli_state *cli, 
2077                         char *server_name, uint32 switch_value,
2078                         WKS_INFO_100 *wks100);
2079
2080 /*The following definitions come from  rpc_client/msrpc_spoolss.c  */
2081
2082 void init_buffer(NEW_BUFFER *buffer, uint32 size, TALLOC_CTX *ctx);
2083 void decode_port_info_1(NEW_BUFFER *buffer, uint32 returned, 
2084                         PORT_INFO_1 **info);
2085 void decode_port_info_2(NEW_BUFFER *buffer, uint32 returned, 
2086                         PORT_INFO_2 **info);
2087 BOOL msrpc_spoolss_enum_printers(char* srv_name, uint32 flags, 
2088                                  uint32 level, PRINTER_INFO_CTR ctr);
2089 BOOL msrpc_spoolss_enum_ports(char* srv_name, 
2090                                  uint32 level, PORT_INFO_CTR *ctr);
2091 uint32 msrpc_spoolss_getprinterdata( const char* printer_name,
2092                                 const char* station,
2093                                 const char* user_name,
2094                                 const char* value_name,
2095                                 uint32 *type,
2096                                 NEW_BUFFER *buffer,
2097                                 void *fn);
2098 BOOL msrpc_spoolss_enum_jobs( const char* printer_name,
2099                                 const char* station, const char* user_name,
2100                                 uint32 level,
2101                                 void ***ctr, JOB_INFO_FN(fn));
2102 BOOL msrpc_spoolss_enum_printerdata( const char* printer_name, 
2103                 const char* station, const char* user_name );
2104 BOOL msrpc_spoolss_getprinter( const char* printer_name, const uint32 level,
2105                 const char* station, const char* user_name,
2106                 PRINTER_INFO_CTR ctr);
2107 BOOL msrpc_spoolss_getprinterdriver( const char* printer_name,
2108                 const char *environment, const uint32 level,
2109                 const char* station, const char* user_name,
2110                 PRINTER_DRIVER_CTR ctr);
2111 BOOL msrpc_spoolss_enumprinterdrivers( const char* srv_name,
2112                 const char *environment, const uint32 level,
2113                 PRINTER_DRIVER_CTR ctr);
2114 BOOL msrpc_spoolss_getprinterdriverdir(char* srv_name, char* env_name, uint32 level, DRIVER_DIRECTORY_CTR ctr);
2115
2116 /*The following definitions come from  rpc_client/ncacn_np_use.c  */
2117
2118 BOOL ncacn_np_use_del(const char *srv_name, const char *pipe_name,
2119                       const vuser_key * key,
2120                       BOOL force_close, BOOL *connection_closed);
2121 struct ncacn_np *ncacn_np_initialise(struct ncacn_np *msrpc,
2122                                      const vuser_key * key);
2123 struct ncacn_np *ncacn_np_use_add(const char *pipe_name,
2124                                   const vuser_key * key,
2125                                   const char *srv_name,
2126                                   const struct ntuser_creds *ntc,
2127                                   BOOL reuse, BOOL *is_new_connection);
2128
2129 /*The following definitions come from  rpc_parse/parse_creds.c  */
2130
2131 BOOL make_creds_unix(CREDS_UNIX *r_u, const char* user_name,
2132                                 const char* requested_name,
2133                                 const char* real_name,
2134                                 BOOL guest);
2135 BOOL creds_io_unix(char *desc, CREDS_UNIX *r_u, prs_struct *ps, int depth);
2136 void creds_free_unix(CREDS_UNIX *r_u);
2137 BOOL make_creds_unix_sec(CREDS_UNIX_SEC *r_u,
2138                 uint32 uid, uint32 gid, uint32 num_grps, gid_t *grps);
2139 BOOL creds_io_unix_sec(char *desc, CREDS_UNIX_SEC *r_u, prs_struct *ps, int depth);
2140 void creds_free_unix_sec(CREDS_UNIX_SEC *r_u);
2141 BOOL make_creds_nt_sec(CREDS_NT_SEC *r_u,
2142                 DOM_SID *sid, uint32 num_grps, uint32 *grps);
2143 BOOL creds_io_nt_sec(char *desc, CREDS_NT_SEC *r_u, prs_struct *ps, int depth);
2144 void creds_free_nt_sec(CREDS_NT_SEC *r_u);
2145 BOOL creds_io_pwd_info(char *desc, struct pwd_info *pwd, prs_struct *ps, int depth);
2146 BOOL creds_io_nt(char *desc, CREDS_NT *r_u, prs_struct *ps, int depth);
2147 void creds_free_nt(CREDS_NT *r_u);
2148 BOOL creds_io_hybrid(char *desc, CREDS_HYBRID *r_u, prs_struct *ps, int depth);
2149 void copy_unix_creds(CREDS_UNIX *to, const CREDS_UNIX *from);
2150 void copy_nt_sec_creds(CREDS_NT_SEC *to, const CREDS_NT_SEC *from);
2151 void copy_unix_sec_creds(CREDS_UNIX_SEC *to, const CREDS_UNIX_SEC *from);
2152 void create_ntc_from_cli_state (CREDS_NT *to, const struct cli_state *cli_from);
2153 void copy_nt_creds(struct ntuser_creds *to,
2154                                 const struct ntuser_creds *from);
2155 void copy_user_creds(struct user_creds *to,
2156                                 const struct user_creds *from);
2157 void free_user_creds(struct user_creds *creds);
2158 BOOL creds_io_cmd(char *desc, CREDS_CMD *r_u, prs_struct *ps, int depth);
2159 BOOL create_ntuser_creds( prs_struct *ps,
2160                                 const char* name, 
2161                                 uint16 version, uint16 command,
2162                                 uint32 pid,
2163                                 const struct ntuser_creds *ntu,
2164                                 BOOL reuse);
2165 BOOL create_user_creds( prs_struct *ps,
2166                                 const char* name, 
2167                                 uint16 version, uint16 command,
2168                                 uint32 pid,
2169                                 struct user_creds *usr);
2170
2171 /*The following definitions come from  rpc_parse/parse_dfs.c  */
2172
2173 BOOL dfs_io_r_dfs_exist(char *desc, DFS_R_DFS_EXIST *q_d, prs_struct *ps,
2174                         int depth);
2175 BOOL make_dfs_q_dfs_remove(DFS_Q_DFS_REMOVE *q_d, char *entrypath, 
2176                            char *servername, char *sharename);
2177 BOOL dfs_io_q_dfs_remove(char *desc, DFS_Q_DFS_REMOVE *q_d, prs_struct *ps,
2178                          int depth);
2179 BOOL dfs_io_r_dfs_remove(char *desc, DFS_R_DFS_REMOVE *r_d, prs_struct *ps,
2180                       int depth);
2181 BOOL make_dfs_q_dfs_add(DFS_Q_DFS_ADD *q_d, char *entrypath, char *servername,
2182                         char *sharename, char *comment, uint32 flags);
2183 BOOL dfs_io_q_dfs_add(char *desc, DFS_Q_DFS_ADD *q_d, prs_struct *ps,
2184                       int depth);
2185 BOOL dfs_io_r_dfs_add(char *desc, DFS_R_DFS_ADD *r_d, prs_struct *ps,
2186                       int depth);
2187 BOOL dfs_io_q_dfs_get_info(char* desc, DFS_Q_DFS_GET_INFO* q_i, 
2188                            prs_struct* ps, int depth);
2189 BOOL dfs_io_r_dfs_get_info(char* desc, DFS_R_DFS_GET_INFO* r_i,
2190                            prs_struct* ps, int depth);
2191 BOOL make_dfs_q_dfs_enum(DFS_Q_DFS_ENUM *q_d, uint32 level, DFS_INFO_CTR *ctr);
2192 BOOL dfs_io_q_dfs_enum(char *desc, DFS_Q_DFS_ENUM *q_d, prs_struct *ps,
2193                       int depth);
2194 BOOL dfs_io_dfs_info_ctr(char* desc, DFS_INFO_CTR* ctr, uint32 num_entries,
2195                          uint32 level,
2196                          prs_struct* ps, int depth);
2197 BOOL dfs_io_r_dfs_enum(char *desc, DFS_R_DFS_ENUM *q_d, prs_struct *ps, int depth);
2198 BOOL dfs_io_dfs_storage_info(char *desc, DFS_INFO_3* info3,
2199                              prs_struct *ps, int depth);
2200
2201 /*The following definitions come from  rpc_parse/parse_lsa.c  */
2202
2203 void init_lsa_trans_name(LSA_TRANS_NAME *trn, UNISTR2 *uni_name,
2204                         uint16 sid_name_use, char *name, uint32 idx);
2205 void init_lsa_sec_qos(LSA_SEC_QOS *qos, uint16 imp_lev, uint8 ctxt, uint8 eff,
2206                                 uint32 unknown);
2207 void init_lsa_obj_attr(LSA_OBJ_ATTR *attr, uint32 attributes, LSA_SEC_QOS *qos);
2208 void init_q_open_pol(LSA_Q_OPEN_POL *r_q, uint16 system_name,
2209                         uint32 attributes,
2210                         uint32 desired_access,
2211                         LSA_SEC_QOS *qos);
2212 BOOL lsa_io_q_open_pol(char *desc, LSA_Q_OPEN_POL *r_q, prs_struct *ps, int depth);
2213 BOOL lsa_io_r_open_pol(char *desc, LSA_R_OPEN_POL *r_p, prs_struct *ps, int depth);
2214 void init_q_open_pol2(LSA_Q_OPEN_POL2 *r_q, char *server_name,
2215                         uint32 attributes,
2216                         uint32 desired_access,
2217                         LSA_SEC_QOS *qos);
2218 BOOL lsa_io_q_open_pol2(char *desc, LSA_Q_OPEN_POL2 *r_q, prs_struct *ps, int depth);
2219 BOOL lsa_io_r_open_pol2(char *desc, LSA_R_OPEN_POL2 *r_p, prs_struct *ps, int depth);
2220 void init_q_query_sec_obj(LSA_Q_QUERY_SEC_OBJ *q_q, const POLICY_HND *hnd, uint32 sec_info);
2221 BOOL lsa_io_q_query_sec_obj(char *desc, LSA_Q_QUERY_SEC_OBJ *q_q, prs_struct *ps, int depth);
2222 BOOL lsa_io_r_query_sec_obj(char *desc, LSA_R_QUERY_SEC_OBJ *r_u, prs_struct *ps, int depth);
2223 void init_q_query(LSA_Q_QUERY_INFO *q_q, POLICY_HND *hnd, uint16 info_class);
2224 BOOL lsa_io_q_query(char *desc, LSA_Q_QUERY_INFO *q_q, prs_struct *ps, int depth);
2225 BOOL lsa_io_q_enum_trust_dom(char *desc, LSA_Q_ENUM_TRUST_DOM *q_e, prs_struct *ps, int depth);
2226 void init_r_enum_trust_dom(LSA_R_ENUM_TRUST_DOM *r_e,
2227                            uint32 enum_context, char *domain_name, DOM_SID *domain_sid,
2228                            uint32 status);
2229 BOOL lsa_io_r_enum_trust_dom(char *desc,  LSA_R_ENUM_TRUST_DOM *r_e, prs_struct *ps, int depth);
2230 BOOL lsa_io_r_query(char *desc, LSA_R_QUERY_INFO *r_q, prs_struct *ps, int depth);
2231 void init_lsa_sid_enum(LSA_SID_ENUM *sen, int num_entries, DOM_SID **sids);
2232 void init_q_lookup_sids(LSA_Q_LOOKUP_SIDS *q_l, POLICY_HND *hnd,
2233                                 int num_sids, DOM_SID **sids,
2234                                 uint16 level);
2235 BOOL lsa_io_q_lookup_sids(char *desc, LSA_Q_LOOKUP_SIDS *q_s, prs_struct *ps, int depth);
2236 BOOL lsa_io_r_lookup_sids(char *desc, LSA_R_LOOKUP_SIDS *r_s, prs_struct *ps, int depth);
2237 void init_q_lookup_names(LSA_Q_LOOKUP_NAMES *q_l, POLICY_HND *hnd,
2238                 int num_names, char **names);
2239 BOOL lsa_io_q_lookup_names(char *desc, LSA_Q_LOOKUP_NAMES *q_r, prs_struct *ps, int depth);
2240 BOOL lsa_io_r_lookup_names(char *desc, LSA_R_LOOKUP_NAMES *r_r, prs_struct *ps, int depth);
2241 void init_lsa_q_close(LSA_Q_CLOSE *q_c, POLICY_HND *hnd);
2242 BOOL lsa_io_q_close(char *desc, LSA_Q_CLOSE *q_c, prs_struct *ps, int depth);
2243 BOOL lsa_io_r_close(char *desc,  LSA_R_CLOSE *r_c, prs_struct *ps, int depth);
2244
2245 /*The following definitions come from  rpc_parse/parse_misc.c  */
2246
2247 void parse_talloc_free(void);
2248 BOOL smb_io_time(char *desc, NTTIME *nttime, prs_struct *ps, int depth);
2249 BOOL smb_io_lookup_level(char *desc, LOOKUP_LEVEL *level, prs_struct *ps, int depth);
2250 uint32 get_enum_hnd(ENUM_HND *enh);
2251 void init_enum_hnd(ENUM_HND *enh, uint32 hnd);
2252 BOOL smb_io_enum_hnd(char *desc, ENUM_HND *hnd, prs_struct *ps, int depth);
2253 BOOL smb_io_dom_sid(char *desc, DOM_SID *sid, prs_struct *ps, int depth);
2254 void init_dom_sid(DOM_SID *sid, char *str_sid);
2255 void init_dom_sid2(DOM_SID2 *sid2, DOM_SID *sid);
2256 BOOL smb_io_dom_sid2(char *desc, DOM_SID2 *sid, prs_struct *ps, int depth);
2257 void init_str_hdr(STRHDR *hdr, int max_len, int len, uint32 buffer);
2258 BOOL smb_io_strhdr(char *desc,  STRHDR *hdr, prs_struct *ps, int depth);
2259 void init_uni_hdr(UNIHDR *hdr, int len);
2260 BOOL smb_io_unihdr(char *desc, UNIHDR *hdr, prs_struct *ps, int depth);
2261 void init_buf_hdr(BUFHDR *hdr, int max_len, int len);
2262 BOOL smb_io_hdrbuf_pre(char *desc, BUFHDR *hdr, prs_struct *ps, int depth, uint32 *offset);
2263 BOOL smb_io_hdrbuf_post(char *desc, BUFHDR *hdr, prs_struct *ps, int depth, 
2264                                 uint32 ptr_hdrbuf, uint32 max_len, uint32 len);
2265 BOOL smb_io_hdrbuf(char *desc, BUFHDR *hdr, prs_struct *ps, int depth);
2266 void init_uni_hdr2(UNIHDR2 *hdr, int len);
2267 BOOL smb_io_unihdr2(char *desc, UNIHDR2 *hdr2, prs_struct *ps, int depth);
2268 void init_unistr(UNISTR *str, const char *buf);
2269 BOOL smb_io_unistr(char *desc, UNISTR *uni, prs_struct *ps, int depth);
2270 void init_buffer3_uint32(BUFFER3 *str, uint32 val);
2271 void init_buffer3_str(BUFFER3 *str, char *buf, int len);
2272 void init_buffer3_hex(BUFFER3 *str, char *buf);
2273 void init_buffer3_bytes(BUFFER3 *str, uint8 *buf, int len);
2274 BOOL smb_io_buffer3(char *desc, BUFFER3 *buf3, prs_struct *ps, int depth);
2275 BOOL smb_io_buffer5(char *desc, BUFFER5 *buf5, prs_struct *ps, int depth);
2276 void init_buffer2(BUFFER2 *str, uint8 *buf, int len);
2277 BOOL smb_io_buffer2(char *desc, BUFFER2 *buf2, uint32 buffer, prs_struct *ps, int depth);
2278 void init_buf_unistr2(UNISTR2 *str, uint32 *ptr, const char *buf);
2279 void copy_unistr2(UNISTR2 *str, UNISTR2 *from);
2280 void init_string2(STRING2 *str, char *buf, int len);
2281 BOOL smb_io_string2(char *desc, STRING2 *str2, uint32 buffer, prs_struct *ps, int depth);
2282 void init_unistr2(UNISTR2 *str, const char *buf, size_t len);
2283 void init_unistr2_from_unistr (UNISTR2 *to, UNISTR *from);
2284 BOOL smb_io_unistr2(char *desc, UNISTR2 *uni2, uint32 buffer, prs_struct *ps, int depth);
2285 void init_dom_rid2(DOM_RID2 *rid2, uint32 rid, uint8 type, uint32 idx);
2286 BOOL smb_io_dom_rid2(char *desc, DOM_RID2 *rid2, prs_struct *ps, int depth);
2287 void init_dom_rid3(DOM_RID3 *rid3, uint32 rid, uint8 type);
2288 BOOL smb_io_dom_rid3(char *desc, DOM_RID3 *rid3, prs_struct *ps, int depth);
2289 void init_dom_rid4(DOM_RID4 *rid4, uint16 unknown, uint16 attr, uint32 rid);
2290 void init_log_info(DOM_LOG_INFO *log, char *logon_srv, char *acct_name,
2291                 uint16 sec_chan, char *comp_name);
2292 BOOL smb_io_log_info(char *desc, DOM_LOG_INFO *log, prs_struct *ps, int depth);
2293 BOOL smb_io_chal(char *desc, DOM_CHAL *chal, prs_struct *ps, int depth);
2294 BOOL smb_io_cred(char *desc,  DOM_CRED *cred, prs_struct *ps, int depth);
2295 void init_clnt_info2(DOM_CLNT_INFO2 *clnt,
2296                                 char *logon_srv, char *comp_name,
2297                                 DOM_CRED *clnt_cred);
2298 BOOL smb_io_clnt_info2(char *desc, DOM_CLNT_INFO2 *clnt, prs_struct *ps, int depth);
2299 void init_clnt_info(DOM_CLNT_INFO *clnt,
2300                 char *logon_srv, char *acct_name,
2301                 uint16 sec_chan, char *comp_name,
2302                                 DOM_CRED *cred);
2303 BOOL smb_io_clnt_info(char *desc,  DOM_CLNT_INFO *clnt, prs_struct *ps, int depth);
2304 void init_logon_id(DOM_LOGON_ID *log, uint32 log_id_low, uint32 log_id_high);
2305 BOOL smb_io_logon_id(char *desc, DOM_LOGON_ID *log, prs_struct *ps, int depth);
2306 void init_owf_info(OWF_INFO *hash, uint8 data[16]);
2307 BOOL smb_io_owf_info(char *desc, OWF_INFO *hash, prs_struct *ps, int depth);
2308 BOOL smb_io_gid(char *desc,  DOM_GID *gid, prs_struct *ps, int depth);
2309 BOOL smb_io_pol_hnd(char *desc, POLICY_HND *pol, prs_struct *ps, int depth);
2310 BOOL smb_io_dom_query_3(char *desc, DOM_QUERY_3 *d_q, prs_struct *ps, int depth);
2311 BOOL smb_io_dom_query_5(char *desc, DOM_QUERY_3 *d_q, prs_struct *ps, int depth);
2312 BOOL smb_io_unistr3(char *desc, UNISTR3 *name, prs_struct *ps, int depth);
2313 BOOL prs_uint64(char *name, prs_struct *ps, int depth, UINT64_S *data64);
2314
2315 /*The following definitions come from  rpc_parse/parse_net.c  */
2316
2317 BOOL net_io_q_logon_ctrl2(char *desc, NET_Q_LOGON_CTRL2 *q_l, prs_struct *ps, int depth);
2318 void init_r_logon_ctrl2(NET_R_LOGON_CTRL2 *r_l, uint32 query_level,
2319                                 uint32 flags, uint32 pdc_status, uint32 logon_attempts,
2320                                 uint32 tc_status, char *trusted_domain_name);
2321 BOOL net_io_r_logon_ctrl2(char *desc, NET_R_LOGON_CTRL2 *r_l, prs_struct *ps, int depth);
2322 void init_r_trust_dom(NET_R_TRUST_DOM_LIST *r_t,
2323                         uint32 num_doms, char *dom_name);
2324 BOOL net_io_r_trust_dom(char *desc, NET_R_TRUST_DOM_LIST *r_t, prs_struct *ps, int depth);
2325 BOOL net_io_q_trust_dom(char *desc, NET_Q_TRUST_DOM_LIST *q_l, prs_struct *ps, int depth);
2326 void init_q_req_chal(NET_Q_REQ_CHAL *q_c,
2327                                 char *logon_srv, char *logon_clnt,
2328                                 DOM_CHAL *clnt_chal);
2329 BOOL net_io_q_req_chal(char *desc,  NET_Q_REQ_CHAL *q_c, prs_struct *ps, int depth);
2330 BOOL net_io_r_req_chal(char *desc, NET_R_REQ_CHAL *r_c, prs_struct *ps, int depth);
2331 void init_q_auth_2(NET_Q_AUTH_2 *q_a,
2332                 char *logon_srv, char *acct_name, uint16 sec_chan, char *comp_name,
2333                 DOM_CHAL *clnt_chal, uint32 clnt_flgs);
2334 BOOL net_io_q_auth_2(char *desc, NET_Q_AUTH_2 *q_a, prs_struct *ps, int depth);
2335 BOOL net_io_r_auth_2(char *desc, NET_R_AUTH_2 *r_a, prs_struct *ps, int depth);
2336 void init_q_srv_pwset(NET_Q_SRV_PWSET *q_s, char *logon_srv, char *acct_name, 
2337                 uint16 sec_chan, char *comp_name, DOM_CRED *cred, char nt_cypher[16]);
2338 BOOL net_io_q_srv_pwset(char *desc, NET_Q_SRV_PWSET *q_s, prs_struct *ps, int depth);
2339 BOOL net_io_r_srv_pwset(char *desc, NET_R_SRV_PWSET *r_s, prs_struct *ps, int depth);
2340 void init_id_info1(NET_ID_INFO_1 *id, char *domain_name,
2341                                 uint32 param_ctrl, uint32 log_id_low, uint32 log_id_high,
2342                                 char *user_name, char *wksta_name,
2343                                 char *sess_key,
2344                                 unsigned char lm_cypher[16], unsigned char nt_cypher[16]);
2345 void init_id_info2(NET_ID_INFO_2 *id, char *domain_name,
2346                                 uint32 param_ctrl, uint32 log_id_low, uint32 log_id_high,
2347                                 char *user_name, char *wksta_name,
2348                                 unsigned char lm_challenge[8],
2349                                 unsigned char *lm_chal_resp,
2350                                 unsigned char *nt_chal_resp);
2351 void init_sam_info(DOM_SAM_INFO *sam,
2352                                 char *logon_srv, char *comp_name, DOM_CRED *clnt_cred,
2353                                 DOM_CRED *rtn_cred, uint16 logon_level,
2354                                 NET_ID_INFO_CTR *ctr);
2355 void init_net_user_info3(NET_USER_INFO_3 *usr, SAM_ACCOUNT *sampw,
2356                          uint16 logon_count, uint16 bad_pw_count,
2357                          uint32 num_groups, DOM_GID *gids,
2358                          uint32 user_flgs, char *sess_key,
2359                          char *logon_srv, char *logon_dom,
2360                          DOM_SID *dom_sid, char *other_sids);
2361 void free_user_info3(NET_USER_INFO_3 *usr);
2362 BOOL net_io_q_sam_logon(char *desc, NET_Q_SAM_LOGON *q_l, prs_struct *ps, int depth);
2363 BOOL net_io_r_sam_logon(char *desc, NET_R_SAM_LOGON *r_l, prs_struct *ps, int depth);
2364 BOOL net_io_q_sam_logoff(char *desc,  NET_Q_SAM_LOGOFF *q_l, prs_struct *ps, int depth);
2365 BOOL net_io_r_sam_logoff(char *desc, NET_R_SAM_LOGOFF *r_l, prs_struct *ps, int depth);
2366
2367 /*The following definitions come from  rpc_parse/parse_prs.c  */
2368
2369 void prs_dump(char *name, int v, prs_struct *ps);
2370 void prs_debug(prs_struct *ps, int depth, char *desc, char *fn_name);
2371 BOOL prs_init(prs_struct *ps, uint32 size, uint8 align, TALLOC_CTX *ctx, BOOL io);
2372 BOOL prs_read(prs_struct *ps, int fd, size_t len, int timeout);
2373 void prs_mem_free(prs_struct *ps);
2374 char *prs_alloc_mem(prs_struct *ps, size_t size);
2375 TALLOC_CTX *prs_get_mem_context(prs_struct *ps);
2376 void prs_give_memory(prs_struct *ps, char *buf, uint32 size, BOOL is_dynamic);
2377 char *prs_take_memory(prs_struct *ps, uint32 *psize);
2378 BOOL prs_set_buffer_size(prs_struct *ps, uint32 newsize);
2379 BOOL prs_grow(prs_struct *ps, uint32 extra_space);
2380 BOOL prs_force_grow(prs_struct *ps, uint32 extra_space);
2381 char *prs_data_p(prs_struct *ps);
2382 uint32 prs_data_size(prs_struct *ps);
2383 uint32 prs_offset(prs_struct *ps);
2384 BOOL prs_set_offset(prs_struct *ps, uint32 offset);
2385 BOOL prs_append_prs_data(prs_struct *dst, prs_struct *src);
2386 BOOL prs_append_some_prs_data(prs_struct *dst, prs_struct *src, int32 start, uint32 len);
2387 BOOL prs_append_data(prs_struct *dst, char *src, uint32 len);
2388 void prs_set_bigendian_data(prs_struct *ps);
2389 BOOL prs_align(prs_struct *ps);
2390 BOOL prs_align_needed(prs_struct *ps, uint32 needed);
2391 char *prs_mem_get(prs_struct *ps, uint32 extra_size);
2392 void prs_switch_type(prs_struct *ps, BOOL io);
2393 void prs_force_dynamic(prs_struct *ps);
2394 BOOL prs_uint8(char *name, prs_struct *ps, int depth, uint8 *data8);
2395 BOOL prs_uint16(char *name, prs_struct *ps, int depth, uint16 *data16);
2396 BOOL prs_uint32(char *name, prs_struct *ps, int depth, uint32 *data32);
2397 BOOL prs_uint8s(BOOL charmode, char *name, prs_struct *ps, int depth, uint8 *data8s, int len);
2398 BOOL prs_uint16s(BOOL charmode, char *name, prs_struct *ps, int depth, uint16 *data16s, int len);
2399 BOOL prs_uint32s(BOOL charmode, char *name, prs_struct *ps, int depth, uint32 *data32s, int len);
2400 BOOL prs_buffer2(BOOL charmode, char *name, prs_struct *ps, int depth, BUFFER2 *str);
2401 BOOL prs_string2(BOOL charmode, char *name, prs_struct *ps, int depth, STRING2 *str);
2402 BOOL prs_unistr2(BOOL charmode, char *name, prs_struct *ps, int depth, UNISTR2 *str);
2403 BOOL prs_unistr3(BOOL charmode, char *name, UNISTR3 *str, prs_struct *ps, int depth);
2404 BOOL prs_unistr(char *name, prs_struct *ps, int depth, UNISTR *str);
2405 BOOL prs_string(char *name, prs_struct *ps, int depth, char *str, int len, int max_buf_size);
2406 BOOL prs_uint16_pre(char *name, prs_struct *ps, int depth, uint16 *data16, uint32 *offset);
2407 BOOL prs_uint16_post(char *name, prs_struct *ps, int depth, uint16 *data16,
2408                                 uint32 ptr_uint16, uint32 start_offset);
2409 BOOL prs_uint32_pre(char *name, prs_struct *ps, int depth, uint32 *data32, uint32 *offset);
2410 BOOL prs_uint32_post(char *name, prs_struct *ps, int depth, uint32 *data32,
2411                                 uint32 ptr_uint32, uint32 data_size);
2412 int tdb_prs_store(TDB_CONTEXT *tdb, char *keystr, prs_struct *ps);
2413 int tdb_prs_fetch(TDB_CONTEXT *tdb, char *keystr, prs_struct *ps, TALLOC_CTX *mem_ctx);
2414
2415 /*The following definitions come from  rpc_parse/parse_reg.c  */
2416
2417 void init_reg_q_open_hklm(REG_Q_OPEN_HKLM *q_o,
2418                                 uint16 unknown_0, uint32 level);
2419 BOOL reg_io_q_open_hklm(char *desc,  REG_Q_OPEN_HKLM *r_q, prs_struct *ps, int depth);
2420 BOOL reg_io_r_open_hklm(char *desc,  REG_R_OPEN_HKLM *r_r, prs_struct *ps, int depth);
2421 void init_reg_q_flush_key(REG_Q_FLUSH_KEY *q_u, POLICY_HND *pol);
2422 BOOL reg_io_q_flush_key(char *desc,  REG_Q_FLUSH_KEY *r_q, prs_struct *ps, int depth);
2423 BOOL reg_io_r_flush_key(char *desc,  REG_R_FLUSH_KEY *r_r, prs_struct *ps, int depth);
2424 void init_reg_q_create_key(REG_Q_CREATE_KEY *q_c, POLICY_HND *hnd,
2425                                 char *name, char *class, SEC_ACCESS *sam_access,
2426                                 SEC_DESC_BUF *sec_buf);
2427 BOOL reg_io_q_create_key(char *desc,  REG_Q_CREATE_KEY *r_q, prs_struct *ps, int depth);
2428 BOOL reg_io_r_create_key(char *desc,  REG_R_CREATE_KEY *r_r, prs_struct *ps, int depth);
2429 void init_reg_q_delete_val(REG_Q_DELETE_VALUE *q_c, POLICY_HND *hnd,
2430                                 char *name);
2431 BOOL reg_io_q_delete_val(char *desc,  REG_Q_DELETE_VALUE *r_q, prs_struct *ps, int depth);
2432 BOOL reg_io_r_delete_val(char *desc,  REG_R_DELETE_VALUE *r_r, prs_struct *ps, int depth);
2433 void init_reg_q_delete_key(REG_Q_DELETE_KEY *q_c, POLICY_HND *hnd,
2434                                 char *name);
2435 BOOL reg_io_q_delete_key(char *desc,  REG_Q_DELETE_KEY *r_q, prs_struct *ps, int depth);
2436 BOOL reg_io_r_delete_key(char *desc,  REG_R_DELETE_KEY *r_r, prs_struct *ps, int depth);
2437 void init_reg_q_query_key(REG_Q_QUERY_KEY *q_o, POLICY_HND *hnd,
2438                                 uint32 max_class_len);
2439 BOOL reg_io_q_query_key(char *desc,  REG_Q_QUERY_KEY *r_q, prs_struct *ps, int depth);
2440 BOOL reg_io_r_query_key(char *desc,  REG_R_QUERY_KEY *r_r, prs_struct *ps, int depth);
2441 void init_reg_q_unk_1a(REG_Q_UNK_1A *q_o, POLICY_HND *hnd);
2442 BOOL reg_io_q_unk_1a(char *desc,  REG_Q_UNK_1A *r_q, prs_struct *ps, int depth);
2443 BOOL reg_io_r_unk_1a(char *desc,  REG_R_UNK_1A *r_r, prs_struct *ps, int depth);
2444 void init_reg_q_open_hku(REG_Q_OPEN_HKU *q_o,
2445                                 uint16 unknown_0, uint32 level);
2446 BOOL reg_io_q_open_hku(char *desc,  REG_Q_OPEN_HKU *r_q, prs_struct *ps, int depth);
2447 BOOL reg_io_r_open_hku(char *desc,  REG_R_OPEN_HKU *r_r, prs_struct *ps, int depth);
2448 void init_reg_q_close(REG_Q_CLOSE *q_c, POLICY_HND *hnd);
2449 BOOL reg_io_q_close(char *desc,  REG_Q_CLOSE *q_u, prs_struct *ps, int depth);
2450 BOOL reg_io_r_close(char *desc,  REG_R_CLOSE *r_u, prs_struct *ps, int depth);
2451 void init_reg_q_set_key_sec(REG_Q_SET_KEY_SEC *q_i, POLICY_HND *pol, SEC_DESC_BUF *sec_desc_buf);
2452 BOOL reg_io_q_set_key_sec(char *desc,  REG_Q_SET_KEY_SEC *r_q, prs_struct *ps, int depth);
2453 BOOL reg_io_r_set_key_sec(char *desc, REG_R_SET_KEY_SEC *r_q, prs_struct *ps, int depth);
2454 void init_reg_q_get_key_sec(REG_Q_GET_KEY_SEC *q_i, POLICY_HND *pol, 
2455                                 uint32 sec_buf_size, SEC_DESC_BUF *psdb);
2456 BOOL reg_io_q_get_key_sec(char *desc,  REG_Q_GET_KEY_SEC *r_q, prs_struct *ps, int depth);
2457 BOOL reg_io_r_get_key_sec(char *desc,  REG_R_GET_KEY_SEC *r_q, prs_struct *ps, int depth);
2458 BOOL init_reg_q_info(REG_Q_INFO *q_i, POLICY_HND *pol, char* val_name);
2459 BOOL reg_io_q_info(char *desc,  REG_Q_INFO *r_q, prs_struct *ps, int depth);
2460 BOOL init_reg_r_info(uint32 include_keyval, REG_R_INFO *r_r,
2461                      BUFFER2* buf, uint32 type, uint32 status);
2462 BOOL reg_io_r_info(char *desc, REG_R_INFO *r_r, prs_struct *ps, int depth);
2463 void init_reg_q_enum_val(REG_Q_ENUM_VALUE *q_i, POLICY_HND *pol,
2464                                 uint32 val_idx, uint32 max_val_len,
2465                                 uint32 max_buf_len);
2466 BOOL reg_io_q_enum_val(char *desc,  REG_Q_ENUM_VALUE *q_q, prs_struct *ps, int depth);
2467 BOOL reg_io_r_enum_val(char *desc,  REG_R_ENUM_VALUE *r_q, prs_struct *ps, int depth);
2468 void init_reg_q_create_val(REG_Q_CREATE_VALUE *q_i, POLICY_HND *pol,
2469                                 char *val_name, uint32 type,
2470                                 BUFFER3 *val);
2471 BOOL reg_io_q_create_val(char *desc,  REG_Q_CREATE_VALUE *q_q, prs_struct *ps, int depth);
2472 BOOL reg_io_r_create_val(char *desc,  REG_R_CREATE_VALUE *r_q, prs_struct *ps, int depth);
2473 void init_reg_q_enum_key(REG_Q_ENUM_KEY *q_i, POLICY_HND *pol, uint32 key_idx);
2474 BOOL reg_io_q_enum_key(char *desc,  REG_Q_ENUM_KEY *q_q, prs_struct *ps, int depth);
2475 BOOL reg_io_r_enum_key(char *desc,  REG_R_ENUM_KEY *r_q, prs_struct *ps, int depth);
2476 void init_reg_q_open_entry(REG_Q_OPEN_ENTRY *r_q, POLICY_HND *pol,
2477                                 char *key_name, uint32 unk);
2478 BOOL reg_io_q_open_entry(char *desc,  REG_Q_OPEN_ENTRY *r_q, prs_struct *ps, int depth);
2479 void init_reg_r_open_entry(REG_R_OPEN_ENTRY *r_r,
2480                                 POLICY_HND *pol, uint32 status);
2481 BOOL reg_io_r_open_entry(char *desc,  REG_R_OPEN_ENTRY *r_r, prs_struct *ps, int depth);
2482
2483 /*The following definitions come from  rpc_parse/parse_rpc.c  */
2484
2485 void init_rpc_hdr(RPC_HDR *hdr, enum RPC_PKT_TYPE pkt_type, uint8 flags,
2486                                 uint32 call_id, int data_len, int auth_len);
2487 BOOL smb_io_rpc_hdr(char *desc,  RPC_HDR *rpc, prs_struct *ps, int depth);
2488 void init_rpc_hdr_rb(RPC_HDR_RB *rpc, 
2489                                 uint16 max_tsize, uint16 max_rsize, uint32 assoc_gid,
2490                                 uint32 num_elements, uint16 context_id, uint8 num_syntaxes,
2491                                 RPC_IFACE *abstract, RPC_IFACE *transfer);
2492 BOOL smb_io_rpc_hdr_rb(char *desc, RPC_HDR_RB *rpc, prs_struct *ps, int depth);
2493 void init_rpc_hdr_ba(RPC_HDR_BA *rpc, 
2494                                 uint16 max_tsize, uint16 max_rsize, uint32 assoc_gid,
2495                                 char *pipe_addr,
2496                                 uint8 num_results, uint16 result, uint16 reason,
2497                                 RPC_IFACE *transfer);
2498 BOOL smb_io_rpc_hdr_ba(char *desc, RPC_HDR_BA *rpc, prs_struct *ps, int depth);
2499 void init_rpc_hdr_req(RPC_HDR_REQ *hdr, uint32 alloc_hint, uint16 opnum);
2500 BOOL smb_io_rpc_hdr_req(char *desc, RPC_HDR_REQ *rpc, prs_struct *ps, int depth);
2501 BOOL smb_io_rpc_hdr_resp(char *desc, RPC_HDR_RESP *rpc, prs_struct *ps, int depth);
2502 BOOL smb_io_rpc_hdr_fault(char *desc, RPC_HDR_FAULT *rpc, prs_struct *ps, int depth);
2503 void init_rpc_hdr_autha(RPC_HDR_AUTHA *rai,
2504                                 uint16 max_tsize, uint16 max_rsize,
2505                                 uint8 auth_type, uint8 auth_level,
2506                                 uint8 stub_type_len);
2507 BOOL smb_io_rpc_hdr_autha(char *desc, RPC_HDR_AUTHA *rai, prs_struct *ps, int depth);
2508 BOOL rpc_hdr_auth_chk(RPC_HDR_AUTH *rai);
2509 void init_rpc_hdr_auth(RPC_HDR_AUTH *rai,
2510                                 uint8 auth_type, uint8 auth_level,
2511                                 uint8 stub_type_len,
2512                                 uint32 ptr);
2513 BOOL smb_io_rpc_hdr_auth(char *desc, RPC_HDR_AUTH *rai, prs_struct *ps, int depth);
2514 BOOL rpc_auth_verifier_chk(RPC_AUTH_VERIFIER *rav,
2515                                 char *signature, uint32 msg_type);
2516 void init_rpc_auth_verifier(RPC_AUTH_VERIFIER *rav,
2517                                 char *signature, uint32 msg_type);
2518 BOOL smb_io_rpc_auth_verifier(char *desc, RPC_AUTH_VERIFIER *rav, prs_struct *ps, int depth);
2519 void init_rpc_auth_ntlmssp_neg(RPC_AUTH_NTLMSSP_NEG *neg,
2520                                 uint32 neg_flgs,
2521                                 fstring myname, fstring domain);
2522 BOOL smb_io_rpc_auth_ntlmssp_neg(char *desc, RPC_AUTH_NTLMSSP_NEG *neg, prs_struct *ps, int depth);
2523 void init_rpc_auth_ntlmssp_chal(RPC_AUTH_NTLMSSP_CHAL *chl,
2524                                 uint32 neg_flags,
2525                                 uint8 challenge[8]);
2526 BOOL smb_io_rpc_auth_ntlmssp_chal(char *desc, RPC_AUTH_NTLMSSP_CHAL *chl, prs_struct *ps, int depth);
2527 void init_rpc_auth_ntlmssp_resp(RPC_AUTH_NTLMSSP_RESP *rsp,
2528                                 uchar lm_resp[24], uchar nt_resp[24],
2529                                 char *domain, char *user, char *wks,
2530                                 uint32 neg_flags);
2531 BOOL smb_io_rpc_auth_ntlmssp_resp(char *desc, RPC_AUTH_NTLMSSP_RESP *rsp, prs_struct *ps, int depth);
2532 BOOL rpc_auth_ntlmssp_chk(RPC_AUTH_NTLMSSP_CHK *chk, uint32 crc32, uint32 seq_num);
2533 void init_rpc_auth_ntlmssp_chk(RPC_AUTH_NTLMSSP_CHK *chk,
2534                                 uint32 ver, uint32 crc32, uint32 seq_num);
2535 BOOL smb_io_rpc_auth_ntlmssp_chk(char *desc, RPC_AUTH_NTLMSSP_CHK *chk, prs_struct *ps, int depth);
2536
2537 /*The following definitions come from  rpc_parse/parse_samr.c  */
2538
2539 #if OLD_NTDOMAIN
2540 void init_samr_q_close_hnd(SAMR_Q_CLOSE_HND *q_c, POLICY_HND *hnd);
2541 BOOL samr_io_q_close_hnd(char *desc,  SAMR_Q_CLOSE_HND *q_u, prs_struct *ps, int depth);
2542 BOOL samr_io_r_close_hnd(char *desc,  SAMR_R_CLOSE_HND *r_u, prs_struct *ps, int depth);
2543 void init_samr_q_open_domain(SAMR_Q_OPEN_DOMAIN *q_u,
2544                                 POLICY_HND *connect_pol, uint32 rid,
2545                                 DOM_SID *sid);
2546 BOOL samr_io_q_open_domain(char *desc, SAMR_Q_OPEN_DOMAIN *q_u, prs_struct *ps, int depth);
2547 BOOL samr_io_r_open_domain(char *desc, SAMR_R_OPEN_DOMAIN *r_u, prs_struct *ps, int depth);
2548 void init_samr_q_unknown_2c(SAMR_Q_UNKNOWN_2C *q_u, POLICY_HND *user_pol);
2549 BOOL samr_io_q_unknown_2c(char *desc,  SAMR_Q_UNKNOWN_2C *q_u, prs_struct *ps, int depth);
2550 void init_samr_r_unknown_2c(SAMR_R_UNKNOWN_2C *q_u, uint32 status);
2551 BOOL samr_io_r_unknown_2c(char *desc,  SAMR_R_UNKNOWN_2C *r_u, prs_struct *ps, int depth);
2552 void init_samr_q_unknown_3(SAMR_Q_UNKNOWN_3 *q_u,
2553                                 POLICY_HND *user_pol, uint16 switch_value);
2554 BOOL samr_io_q_unknown_3(char *desc,  SAMR_Q_UNKNOWN_3 *q_u, prs_struct *ps, int depth);
2555 void init_samr_q_query_dom_info(SAMR_Q_QUERY_DOMAIN_INFO *q_u,
2556                                 POLICY_HND *domain_pol, uint16 switch_value);
2557 BOOL samr_io_q_query_dom_info(char *desc,  SAMR_Q_QUERY_DOMAIN_INFO *q_u, prs_struct *ps, int depth);
2558 BOOL init_unk_info1(SAM_UNK_INFO_1 *u_1);
2559 void init_unk_info2(SAM_UNK_INFO_2 *u_2, char *domain, char *server);
2560 BOOL sam_io_unk_info2(char *desc, SAM_UNK_INFO_2 *u_2, prs_struct *ps, int depth);
2561 BOOL init_unk_info3(SAM_UNK_INFO_3 * u_3);
2562 BOOL init_unk_info6(SAM_UNK_INFO_6 * u_6);
2563 BOOL init_unk_info7(SAM_UNK_INFO_7 *u_7);
2564 BOOL init_unk_info12(SAM_UNK_INFO_12 * u_12);
2565 void init_samr_r_query_dom_info(SAMR_R_QUERY_DOMAIN_INFO *r_u, 
2566                                 uint16 switch_value, SAM_UNK_CTR *ctr,
2567                                 uint32 status);
2568 BOOL samr_io_r_query_dom_info(char *desc, SAMR_R_QUERY_DOMAIN_INFO *r_u, prs_struct *ps, int depth);
2569 void init_dom_sid3(DOM_SID3 *sid3, uint16 unk_0, uint16 unk_1, DOM_SID *sid);
2570 void init_samr_r_unknown_3(SAMR_R_UNKNOWN_3 *r_u,
2571                                 uint16 unknown_2, uint16 unknown_3,
2572                                 uint32 unknown_4, uint16 unknown_6, uint16 unknown_7,
2573                                 int num_sid3s, DOM_SID3 sid3[MAX_SAM_SIDS],
2574                                 uint32 status);
2575 BOOL samr_io_r_unknown_3(char *desc,  SAMR_R_UNKNOWN_3 *r_u, prs_struct *ps, int depth);
2576 void init_samr_q_enum_dom_users(SAMR_Q_ENUM_DOM_USERS *q_e, POLICY_HND *pol,
2577                                 uint16 req_num_entries, uint16 unk_0,
2578                                 uint16 acb_mask, uint16 unk_1, uint32 size);
2579 BOOL samr_io_q_enum_dom_users(char *desc,  SAMR_Q_ENUM_DOM_USERS *q_e, prs_struct *ps, int depth);
2580 void init_samr_r_enum_dom_users(SAMR_R_ENUM_DOM_USERS *r_u,
2581                 uint16 total_num_entries, uint16 unk_0,
2582                 uint32 num_sam_entries, SAM_USER_INFO_21 pass[MAX_SAM_ENTRIES], uint32 status);
2583 BOOL samr_io_r_enum_dom_users(char *desc,  SAMR_R_ENUM_DOM_USERS *r_u, prs_struct *ps, int depth);
2584 void init_samr_q_enum_dom_aliases(SAMR_Q_ENUM_DOM_ALIASES *q_e, POLICY_HND *pol, uint32 size);
2585 BOOL samr_io_q_enum_dom_aliases(char *desc,  SAMR_Q_ENUM_DOM_ALIASES *q_e, prs_struct *ps, int depth);
2586 void init_samr_r_enum_dom_aliases(SAMR_R_ENUM_DOM_ALIASES *r_u,
2587                 uint32 num_sam_entries, SAM_USER_INFO_21 grps[MAX_SAM_ENTRIES],
2588                 uint32 status);
2589 BOOL samr_io_r_enum_dom_aliases(char *desc,  SAMR_R_ENUM_DOM_ALIASES *r_u, prs_struct *ps, int depth);
2590 void init_samr_q_query_dispinfo(SAMR_Q_QUERY_DISPINFO *q_e, POLICY_HND *pol,
2591                                 uint16 switch_level, uint32 start_idx, uint32 size);
2592 BOOL samr_io_q_query_dispinfo(char *desc,  SAMR_Q_QUERY_DISPINFO *q_e, prs_struct *ps, int depth);
2593 void init_sam_info_2(SAM_INFO_2 *sam, uint32 acb_mask,
2594                 uint32 start_idx, uint32 num_sam_entries,
2595                 SAM_USER_INFO_21 pass[MAX_SAM_ENTRIES]);
2596 void init_sam_info_1(SAM_INFO_1 *sam, uint32 acb_mask,
2597                 uint32 start_idx, uint32 num_sam_entries,
2598                 SAM_USER_INFO_21 pass[MAX_SAM_ENTRIES]);
2599 void init_samr_r_query_dispinfo(SAMR_R_QUERY_DISPINFO *r_u,
2600                 uint16 switch_level, SAM_INFO_CTR *ctr, uint32 status);
2601 BOOL samr_io_r_query_dispinfo(char *desc,  SAMR_R_QUERY_DISPINFO *r_u, prs_struct *ps, int depth);
2602 void init_samr_q_enum_dom_groups(SAMR_Q_ENUM_DOM_GROUPS *q_e, POLICY_HND *pol,
2603                                 uint16 switch_level, uint32 start_idx, uint32 size);
2604 BOOL samr_io_q_enum_dom_groups(char *desc,  SAMR_Q_ENUM_DOM_GROUPS *q_e, prs_struct *ps, int depth);
2605 void init_samr_r_enum_dom_groups(SAMR_R_ENUM_DOM_GROUPS *r_u,
2606                 uint32 start_idx, uint32 num_sam_entries,
2607                 SAM_USER_INFO_21 pass[MAX_SAM_ENTRIES],
2608                 uint32 status);
2609 BOOL samr_io_r_enum_dom_groups(char *desc,  SAMR_R_ENUM_DOM_GROUPS *r_u, prs_struct *ps, int depth);
2610 void init_samr_q_query_aliasinfo(SAMR_Q_QUERY_ALIASINFO *q_e,
2611                                 POLICY_HND *pol,
2612                                 uint16 switch_level);
2613 BOOL samr_io_q_query_aliasinfo(char *desc,  SAMR_Q_QUERY_ALIASINFO *q_e, prs_struct *ps, int depth);
2614 void init_samr_r_query_aliasinfo(SAMR_R_QUERY_ALIASINFO *r_u, uint32 switch_level,
2615                                  char* alias, char* alias_desc);
2616 BOOL samr_io_r_query_aliasinfo(char *desc,  SAMR_R_QUERY_ALIASINFO *r_u, prs_struct *ps, int depth);
2617 BOOL samr_io_q_lookup_ids(char *desc,  SAMR_Q_LOOKUP_IDS *q_u, prs_struct *ps, int depth);
2618 void init_samr_r_lookup_ids(SAMR_R_LOOKUP_IDS *r_u,
2619                 uint32 num_rids, uint32 *rid, uint32 status);
2620 BOOL samr_io_r_lookup_ids(char *desc,  SAMR_R_LOOKUP_IDS *r_u, prs_struct *ps, int depth);
2621 BOOL samr_io_q_lookup_names(char *desc,  SAMR_Q_LOOKUP_NAMES *q_u, prs_struct *ps, int depth);
2622 void init_samr_r_lookup_names(SAMR_R_LOOKUP_NAMES *r_u,
2623                         uint32 num_rids, uint32 *rid, enum SID_NAME_USE *type, uint32 status);
2624 BOOL samr_io_r_lookup_names(char *desc,  SAMR_R_LOOKUP_NAMES *r_u, prs_struct *ps, int depth);
2625 BOOL samr_io_q_lookup_rids(char *desc, SAMR_Q_LOOKUP_RIDS *q_u, prs_struct *ps, int depth);
2626 void init_samr_r_lookup_rids(SAMR_R_LOOKUP_RIDS *r_u,
2627                 uint32 num_aliases, fstring *als_name, uint32 *num_als_usrs,
2628                 uint32 status);
2629 BOOL samr_io_r_lookup_rids(char *desc, SAMR_R_LOOKUP_RIDS *r_u, prs_struct *ps, int depth);
2630 void init_samr_q_open_user(SAMR_Q_OPEN_USER *q_u,
2631                                 POLICY_HND *pol,
2632                                 uint32 unk_0, uint32 rid);
2633 BOOL samr_io_q_open_user(char *desc,  SAMR_Q_OPEN_USER *q_u, prs_struct *ps, int depth);
2634 BOOL samr_io_r_open_user(char *desc,  SAMR_R_OPEN_USER *r_u, prs_struct *ps, int depth);
2635 void init_samr_q_query_usergroups(SAMR_Q_QUERY_USERGROUPS *q_u,
2636                                 POLICY_HND *hnd);
2637 BOOL samr_io_q_query_usergroups(char *desc,  SAMR_Q_QUERY_USERGROUPS *q_u, prs_struct *ps, int depth);
2638 void init_samr_r_query_usergroups(SAMR_R_QUERY_USERGROUPS *r_u,
2639                 uint32 num_gids, DOM_GID *gid, uint32 status);
2640 BOOL samr_io_r_query_usergroups(char *desc,  SAMR_R_QUERY_USERGROUPS *r_u, prs_struct *ps, int depth);
2641 void init_samr_q_query_userinfo(SAMR_Q_QUERY_USERINFO *q_u,
2642                                 POLICY_HND *hnd, uint16 switch_value);
2643 BOOL samr_io_q_query_userinfo(char *desc,  SAMR_Q_QUERY_USERINFO *q_u, prs_struct *ps, int depth);
2644 void init_sam_user_info10(SAM_USER_INFO_10 *usr,
2645                                 uint32 acb_info);
2646 BOOL sam_io_user_info10(char *desc,  SAM_USER_INFO_10 *usr, prs_struct *ps, int depth);
2647 void init_sam_user_info11(SAM_USER_INFO_11 *usr,
2648                                 NTTIME *expiry,
2649                                 char *mach_acct,
2650                                 uint32 rid_user,
2651                                 uint32 rid_group,
2652                                 uint16 acct_ctrl);
2653 BOOL sam_io_user_info11(char *desc,  SAM_USER_INFO_11 *usr, prs_struct *ps, int depth);
2654 void init_sam_user_info21(SAM_USER_INFO_21 *usr, SAM_ACCOUNT *pw);
2655 void init_samr_r_query_userinfo(SAMR_R_QUERY_USERINFO *r_u,
2656                                 uint16 switch_value, void *info, uint32 status);
2657 BOOL samr_io_r_query_userinfo(char *desc,  SAMR_R_QUERY_USERINFO *r_u, prs_struct *ps, int depth);
2658 BOOL samr_io_q_create_user(char *desc, SAMR_Q_CREATE_USER *q_u, prs_struct *ps, int depth);
2659 BOOL samr_io_r_create_user(char *desc, SAMR_R_CREATE_USER *r_u, prs_struct *ps, int depth);
2660 void init_samr_q_connect(SAMR_Q_CONNECT *q_u,
2661                                 char *srv_name, uint32 unknown_0);
2662 BOOL samr_io_q_connect(char *desc,  SAMR_Q_CONNECT *q_u, prs_struct *ps, int depth);
2663 BOOL samr_io_r_connect(char *desc,  SAMR_R_CONNECT *r_u, prs_struct *ps, int depth);
2664 void init_samr_q_connect_anon(SAMR_Q_CONNECT_ANON *q_u);
2665 BOOL samr_io_q_connect_anon(char *desc,  SAMR_Q_CONNECT_ANON *q_u, prs_struct *ps, int depth);
2666 BOOL samr_io_r_connect_anon(char *desc,  SAMR_R_CONNECT_ANON *r_u, prs_struct *ps, int depth);
2667 void init_samr_q_open_alias(SAMR_Q_OPEN_ALIAS *q_u,
2668                                 uint32 unknown_0, uint32 rid);
2669 BOOL samr_io_q_open_alias(char *desc, SAMR_Q_OPEN_ALIAS *q_u, prs_struct *ps, int depth);
2670 BOOL samr_io_r_open_alias(char *desc,  SAMR_R_OPEN_ALIAS *r_u, prs_struct *ps, int depth);
2671 void init_samr_q_lookup_rids(SAMR_Q_LOOKUP_RIDS *q_u,
2672                 POLICY_HND *pol, uint32 rid,
2673                 uint32 num_gids, uint32 *gid);
2674 void init_samr_q_unknown_21(SAMR_Q_UNKNOWN_21 *q_c,
2675                                 POLICY_HND *hnd, uint16 unk_1, uint16 unk_2);
2676 void init_samr_q_unknown_13(SAMR_Q_UNKNOWN_13 *q_c,
2677                                 POLICY_HND *hnd, uint16 unk_1, uint16 unk_2);
2678 void init_samr_q_unknown_38(SAMR_Q_UNKNOWN_38 *q_u, char *srv_name);
2679 BOOL samr_io_q_unknown_38(char *desc,  SAMR_Q_UNKNOWN_38 *q_u, prs_struct *ps, int depth);
2680 void init_samr_r_unknown_38(SAMR_R_UNKNOWN_38 *r_u);
2681 BOOL samr_io_r_unknown_38(char *desc,  SAMR_R_UNKNOWN_38 *r_u, prs_struct *ps, int depth);
2682 void init_enc_passwd(SAMR_ENC_PASSWD *pwd, char pass[512]);
2683 BOOL samr_io_enc_passwd(char *desc, SAMR_ENC_PASSWD *pwd, prs_struct *ps, int depth);
2684 void init_enc_hash(SAMR_ENC_HASH *hsh, uchar hash[16]);
2685 BOOL samr_io_enc_hash(char *desc, SAMR_ENC_HASH *hsh, prs_struct *ps, int depth);
2686 void init_samr_q_chgpasswd_user(SAMR_Q_CHGPASSWD_USER *q_u,
2687                                 char *dest_host, char *user_name,
2688                                 char nt_newpass[516], uchar nt_oldhash[16],
2689                                 char lm_newpass[516], uchar lm_oldhash[16]);
2690 BOOL samr_io_q_chgpasswd_user(char *desc, SAMR_Q_CHGPASSWD_USER *q_u, prs_struct *ps, int depth);
2691 void init_samr_r_chgpasswd_user(SAMR_R_CHGPASSWD_USER *r_u, uint32 status);
2692 BOOL samr_io_r_chgpasswd_user(char *desc, SAMR_R_CHGPASSWD_USER *r_u, prs_struct *ps, int depth);
2693 BOOL samr_io_q_lookup_domain(char* desc, SAMR_Q_LOOKUP_DOMAIN* q_u, prs_struct *ps, int depth);
2694 BOOL init_samr_r_lookup_domain(SAMR_R_LOOKUP_DOMAIN * r_u,
2695                                DOM_SID *dom_sid, uint32 status);
2696 BOOL samr_io_r_lookup_domain(char *desc, SAMR_R_LOOKUP_DOMAIN * r_u,
2697                              prs_struct *ps, int depth);
2698 BOOL samr_io_q_enum_domains(char *desc, SAMR_Q_ENUM_DOMAINS * q_e,
2699                             prs_struct *ps, int depth);
2700 BOOL init_samr_r_enum_domains(SAMR_R_ENUM_DOMAINS * r_u,
2701                               uint32 next_idx, fstring* domains, uint32 num_sam_entries);
2702 BOOL samr_io_r_enum_domains(char *desc, SAMR_R_ENUM_DOMAINS * r_u,
2703                             prs_struct *ps, int depth);
2704 void free_samr_userinfo_ctr(SAM_USERINFO_CTR * ctr);
2705 BOOL samr_io_q_set_userinfo(char *desc, SAMR_Q_SET_USERINFO *q_u, prs_struct *ps, int depth);
2706 void free_samr_q_set_userinfo(SAMR_Q_SET_USERINFO * q_u);
2707 BOOL samr_io_r_set_userinfo(char *desc, SAMR_R_SET_USERINFO *r_u, prs_struct *ps, int depth);
2708 BOOL samr_io_q_set_userinfo2(char *desc, SAMR_Q_SET_USERINFO2 *q_u, prs_struct *ps, int depth);
2709 void free_samr_q_set_userinfo2(SAMR_Q_SET_USERINFO2 *q_u);
2710 BOOL make_samr_r_set_userinfo2(SAMR_R_SET_USERINFO2 *r_u, uint32 status);
2711 BOOL samr_io_r_set_userinfo2(char *desc, SAMR_R_SET_USERINFO2 *r_u, prs_struct *ps, int depth);
2712 #endif
2713
2714 /*The following definitions come from  rpc_parse/parse_sec.c  */
2715
2716 void init_sec_access(SEC_ACCESS *t, uint32 mask);
2717 BOOL sec_io_access(char *desc, SEC_ACCESS *t, prs_struct *ps, int depth);
2718 void init_sec_ace(SEC_ACE *t, DOM_SID *sid, uint8 type, SEC_ACCESS mask, uint8 flag);
2719 BOOL sec_io_ace(char *desc, SEC_ACE *psa, prs_struct *ps, int depth);
2720 SEC_ACL *make_sec_acl(uint16 revision, int num_aces, SEC_ACE *ace_list);
2721 SEC_ACL *dup_sec_acl( SEC_ACL *src);
2722 void free_sec_acl(SEC_ACL **ppsa);
2723 BOOL sec_io_acl(char *desc, SEC_ACL **ppsa, prs_struct *ps, int depth);
2724 size_t sec_desc_size(SEC_DESC *psd);
2725 BOOL sec_ace_equal(SEC_ACE *s1, SEC_ACE *s2);
2726 BOOL sec_acl_equal(SEC_ACL *s1, SEC_ACL *s2);
2727 BOOL sec_desc_equal(SEC_DESC *s1, SEC_DESC *s2);
2728 SEC_DESC_BUF *sec_desc_merge(SEC_DESC_BUF *new_sdb, SEC_DESC_BUF *old_sdb);
2729 SEC_DESC *make_sec_desc(uint16 revision, uint16 type,
2730                         DOM_SID *owner_sid, DOM_SID *grp_sid,
2731                         SEC_ACL *sacl, SEC_ACL *dacl, size_t *sd_size);
2732 SEC_DESC *dup_sec_desc( SEC_DESC *src);
2733 void free_sec_desc(SEC_DESC **ppsd);
2734 SEC_DESC *make_standard_sec_desc(DOM_SID *owner_sid, DOM_SID *grp_sid,
2735                                  SEC_ACL *dacl, size_t *sd_size);
2736 BOOL sec_io_desc(char *desc, SEC_DESC **ppsd, prs_struct *ps, int depth);
2737 SEC_DESC_BUF *make_sec_desc_buf(size_t len, SEC_DESC *sec_desc);
2738 SEC_DESC_BUF *dup_sec_desc_buf(SEC_DESC_BUF *src);
2739 void free_sec_desc_buf(SEC_DESC_BUF **ppsdb);
2740 BOOL sec_io_desc_buf(char *desc, SEC_DESC_BUF **ppsdb, prs_struct *ps, int depth);
2741
2742 /*The following definitions come from  rpc_parse/parse_spoolss.c  */
2743
2744 BOOL make_systemtime(SYSTEMTIME *systime, struct tm *unixtime);
2745 BOOL smb_io_notify_info_data_strings(char *desc,SPOOL_NOTIFY_INFO_DATA *data,
2746                                      prs_struct *ps, int depth);
2747 void free_spoolss_devmode(DEVICEMODE *devmode);
2748 BOOL make_spoolss_q_open_printer_ex(SPOOL_Q_OPEN_PRINTER_EX *q_u,
2749                 const fstring printername, 
2750                 const fstring datatype, 
2751                 uint32 access_required,
2752                 const fstring clientname,
2753                 const fstring user_name);
2754 BOOL make_spoolss_q_addprinterex(SPOOL_Q_ADDPRINTEREX *q_u, const char *srv_name,
2755                                  const char* clientname, const char* user_name,
2756                                  uint32 level, PRINTER_INFO_2 *info);
2757 void free_spoolss_q_addprinterex(SPOOL_Q_ADDPRINTEREX *q_u);
2758 BOOL make_spool_printer_info_2(SPOOL_PRINTER_INFO_LEVEL_2 **spool_info2, 
2759                                PRINTER_INFO_2 *info);
2760 BOOL spoolss_io_q_open_printer_ex(char *desc, SPOOL_Q_OPEN_PRINTER_EX *q_u, prs_struct *ps, int depth);
2761 void free_spoolss_q_open_printer_ex(SPOOL_Q_OPEN_PRINTER_EX *q_u);
2762 BOOL spoolss_io_r_open_printer_ex(char *desc, SPOOL_R_OPEN_PRINTER_EX *r_u, prs_struct *ps, int depth);
2763 BOOL make_spoolss_q_getprinterdata(SPOOL_Q_GETPRINTERDATA *q_u,
2764                                 const POLICY_HND *handle,
2765                                 UNISTR2 *valuename, uint32 size);
2766 BOOL spoolss_io_q_getprinterdata(char *desc, SPOOL_Q_GETPRINTERDATA *q_u, prs_struct *ps, int depth);
2767 BOOL spoolss_io_q_deleteprinterdata(char *desc, SPOOL_Q_DELETEPRINTERDATA *q_u, prs_struct *ps, int depth);
2768 BOOL spoolss_io_r_deleteprinterdata(char *desc, SPOOL_R_DELETEPRINTERDATA *r_u, prs_struct *ps, int depth);
2769 BOOL spoolss_io_r_getprinterdata(char *desc, SPOOL_R_GETPRINTERDATA *r_u, prs_struct *ps, int depth);
2770 BOOL make_spoolss_q_closeprinter(SPOOL_Q_CLOSEPRINTER *q_u, POLICY_HND *hnd);
2771 BOOL spoolss_io_q_abortprinter(char *desc, SPOOL_Q_ABORTPRINTER *q_u, prs_struct *ps, int depth);
2772 BOOL spoolss_io_r_abortprinter(char *desc, SPOOL_R_ABORTPRINTER *r_u, prs_struct *ps, int depth);
2773 BOOL spoolss_io_q_deleteprinter(char *desc, SPOOL_Q_DELETEPRINTER *q_u, prs_struct *ps, int depth);
2774 BOOL spoolss_io_r_deleteprinter(char *desc, SPOOL_R_DELETEPRINTER *r_u, prs_struct *ps, int depth);
2775 BOOL spoolss_io_q_closeprinter(char *desc, SPOOL_Q_CLOSEPRINTER *q_u, prs_struct *ps, int depth);
2776 BOOL spoolss_io_r_closeprinter(char *desc, SPOOL_R_CLOSEPRINTER *r_u, prs_struct *ps, int depth);
2777 BOOL spoolss_io_q_startdocprinter(char *desc, SPOOL_Q_STARTDOCPRINTER *q_u, prs_struct *ps, int depth);
2778 BOOL spoolss_io_r_startdocprinter(char *desc, SPOOL_R_STARTDOCPRINTER *r_u, prs_struct *ps, int depth);
2779 BOOL spoolss_io_q_enddocprinter(char *desc, SPOOL_Q_ENDDOCPRINTER *q_u, prs_struct *ps, int depth);
2780 BOOL spoolss_io_r_enddocprinter(char *desc, SPOOL_R_ENDDOCPRINTER *r_u, prs_struct *ps, int depth);
2781 BOOL spoolss_io_q_startpageprinter(char *desc, SPOOL_Q_STARTPAGEPRINTER *q_u, prs_struct *ps, int depth);
2782 BOOL spoolss_io_r_startpageprinter(char *desc, SPOOL_R_STARTPAGEPRINTER *r_u, prs_struct *ps, int depth);
2783 BOOL spoolss_io_q_endpageprinter(char *desc, SPOOL_Q_ENDPAGEPRINTER *q_u, prs_struct *ps, int depth);
2784 BOOL spoolss_io_r_endpageprinter(char *desc, SPOOL_R_ENDPAGEPRINTER *r_u, prs_struct *ps, int depth);
2785 BOOL spoolss_io_q_writeprinter(char *desc, SPOOL_Q_WRITEPRINTER *q_u, prs_struct *ps, int depth);
2786 BOOL spoolss_io_r_writeprinter(char *desc, SPOOL_R_WRITEPRINTER *r_u, prs_struct *ps, int depth);
2787 BOOL spoolss_io_q_rffpcnex(char *desc, SPOOL_Q_RFFPCNEX *q_u, prs_struct *ps, int depth);
2788 BOOL spoolss_io_r_rffpcnex(char *desc, SPOOL_R_RFFPCNEX *r_u, prs_struct *ps, int depth);
2789 BOOL spoolss_io_q_rfnpcnex(char *desc, SPOOL_Q_RFNPCNEX *q_u, prs_struct *ps, int depth);
2790 BOOL spoolss_io_r_rfnpcnex(char *desc, SPOOL_R_RFNPCNEX *r_u, prs_struct *ps, int depth);
2791 BOOL new_smb_io_printer_info_0(char *desc, NEW_BUFFER *buffer, PRINTER_INFO_0 *info, int depth);
2792 BOOL new_smb_io_printer_info_1(char *desc, NEW_BUFFER *buffer, PRINTER_INFO_1 *info, int depth);
2793 BOOL new_smb_io_printer_info_2(char *desc, NEW_BUFFER *buffer, PRINTER_INFO_2 *info, int depth);
2794 BOOL new_smb_io_printer_info_3(char *desc, NEW_BUFFER *buffer, PRINTER_INFO_3 *info, int depth);
2795 BOOL new_smb_io_port_info_1(char *desc, NEW_BUFFER *buffer, PORT_INFO_1 *info, int depth);
2796 BOOL new_smb_io_port_info_2(char *desc, NEW_BUFFER *buffer, PORT_INFO_2 *info, int depth);
2797 BOOL new_smb_io_printer_driver_info_1(char *desc, NEW_BUFFER *buffer, DRIVER_INFO_1 *info, int depth) ;
2798 BOOL new_smb_io_printer_driver_info_2(char *desc, NEW_BUFFER *buffer, DRIVER_INFO_2 *info, int depth) ;
2799 BOOL new_smb_io_printer_driver_info_3(char *desc, NEW_BUFFER *buffer, DRIVER_INFO_3 *info, int depth);
2800 BOOL new_smb_io_printer_driver_info_6(char *desc, NEW_BUFFER *buffer, DRIVER_INFO_6 *info, int depth);
2801 BOOL new_smb_io_job_info_1(char *desc, NEW_BUFFER *buffer, JOB_INFO_1 *info, int depth);
2802 BOOL new_smb_io_job_info_2(char *desc, NEW_BUFFER *buffer, JOB_INFO_2 *info, int depth);
2803 BOOL new_smb_io_form_1(char *desc, NEW_BUFFER *buffer, FORM_1 *info, int depth);
2804 void new_spoolss_move_buffer(NEW_BUFFER *src, NEW_BUFFER **dest);
2805 BOOL new_spoolss_allocate_buffer(NEW_BUFFER **buffer);
2806 void new_spoolss_free_buffer(NEW_BUFFER *buffer);
2807 uint32 new_get_buffer_size(NEW_BUFFER *buffer);
2808 BOOL new_smb_io_driverdir_1(char *desc, NEW_BUFFER *buffer, DRIVER_DIRECTORY_1 *info, int depth);
2809 BOOL new_smb_io_port_1(char *desc, NEW_BUFFER *buffer, PORT_INFO_1 *info, int depth);
2810 BOOL new_smb_io_port_2(char *desc, NEW_BUFFER *buffer, PORT_INFO_2 *info, int depth);
2811 BOOL smb_io_printprocessor_info_1(char *desc, NEW_BUFFER *buffer, PRINTPROCESSOR_1 *info, int depth);
2812 BOOL smb_io_printprocdatatype_info_1(char *desc, NEW_BUFFER *buffer, PRINTPROCDATATYPE_1 *info, int depth);
2813 BOOL smb_io_printmonitor_info_1(char *desc, NEW_BUFFER *buffer, PRINTMONITOR_1 *info, int depth);
2814 BOOL smb_io_printmonitor_info_2(char *desc, NEW_BUFFER *buffer, PRINTMONITOR_2 *info, int depth);
2815 uint32 spoolss_size_printer_info_0(PRINTER_INFO_0 *info);
2816 uint32 spoolss_size_printer_info_1(PRINTER_INFO_1 *info);
2817 uint32 spoolss_size_printer_info_2(PRINTER_INFO_2 *info);
2818 uint32 spoolss_size_printer_info_3(PRINTER_INFO_3 *info);
2819 uint32 spoolss_size_printer_driver_info_1(DRIVER_INFO_1 *info);
2820 uint32 spoolss_size_printer_driver_info_2(DRIVER_INFO_2 *info);
2821 uint32 spoolss_size_string_array(uint16 *string);
2822 uint32 spoolss_size_printer_driver_info_3(DRIVER_INFO_3 *info);
2823 uint32 spoolss_size_printer_driver_info_6(DRIVER_INFO_6 *info);
2824 uint32 spoolss_size_job_info_1(JOB_INFO_1 *info);
2825 uint32 spoolss_size_job_info_2(JOB_INFO_2 *info);
2826 uint32 spoolss_size_form_1(FORM_1 *info);
2827 uint32 spoolss_size_port_info_1(PORT_INFO_1 *info);
2828 uint32 spoolss_size_driverdir_info_1(DRIVER_DIRECTORY_1 *info);
2829 uint32 spoolss_size_port_info_2(PORT_INFO_2 *info);
2830 uint32 spoolss_size_printprocessor_info_1(PRINTPROCESSOR_1 *info);
2831 uint32 spoolss_size_printprocdatatype_info_1(PRINTPROCDATATYPE_1 *info);
2832 uint32 spoolss_size_printmonitor_info_1(PRINTMONITOR_1 *info);
2833 uint32 spoolss_size_printmonitor_info_2(PRINTMONITOR_2 *info);
2834 BOOL make_spoolss_q_getprinterdriver2(SPOOL_Q_GETPRINTERDRIVER2 *q_u, 
2835                                const POLICY_HND *hnd,
2836                                const fstring architecture,
2837                                uint32 level, uint32 clientmajor, uint32 clientminor,
2838                                NEW_BUFFER *buffer, uint32 offered);
2839 BOOL spoolss_io_q_getprinterdriver2(char *desc, SPOOL_Q_GETPRINTERDRIVER2 *q_u, prs_struct *ps, int depth);
2840 BOOL spoolss_io_r_getprinterdriver2(char *desc, SPOOL_R_GETPRINTERDRIVER2 *r_u, prs_struct *ps, int depth);
2841 BOOL make_spoolss_q_enumprinters(SPOOL_Q_ENUMPRINTERS *q_u, uint32 flags, 
2842                                 fstring servername, uint32 level, 
2843                                 NEW_BUFFER *buffer, uint32 offered);
2844 BOOL make_spoolss_q_enumports(SPOOL_Q_ENUMPORTS *q_u, 
2845                                 fstring servername, uint32 level, 
2846                                 NEW_BUFFER *buffer, uint32 offered);
2847 BOOL spoolss_io_q_enumprinters(char *desc, SPOOL_Q_ENUMPRINTERS *q_u, prs_struct *ps, int depth);
2848 BOOL new_spoolss_io_r_enumprinters(char *desc, SPOOL_R_ENUMPRINTERS *r_u, prs_struct *ps, int depth);
2849 BOOL spoolss_io_r_getprinter(char *desc, SPOOL_R_GETPRINTER *r_u, prs_struct *ps, int depth);
2850 BOOL spoolss_io_q_getprinter(char *desc, SPOOL_Q_GETPRINTER *q_u, prs_struct *ps, int depth);
2851 BOOL make_spoolss_q_getprinter(SPOOL_Q_GETPRINTER *q_u, const POLICY_HND *hnd, uint32 level, 
2852                                 NEW_BUFFER *buffer, uint32 offered);
2853 BOOL spoolss_io_r_setprinter(char *desc, SPOOL_R_SETPRINTER *r_u, prs_struct *ps, int depth);
2854 void free_spoolss_q_setprinter(SPOOL_Q_SETPRINTER *q_u);
2855 BOOL spoolss_io_q_setprinter(char *desc, SPOOL_Q_SETPRINTER *q_u, prs_struct *ps, int depth);
2856 BOOL spoolss_io_r_fcpn(char *desc, SPOOL_R_FCPN *r_u, prs_struct *ps, int depth);
2857 BOOL spoolss_io_q_fcpn(char *desc, SPOOL_Q_FCPN *q_u, prs_struct *ps, int depth);
2858 BOOL spoolss_io_r_addjob(char *desc, SPOOL_R_ADDJOB *r_u, prs_struct *ps, int depth);
2859 BOOL spoolss_io_q_addjob(char *desc, SPOOL_Q_ADDJOB *q_u, prs_struct *ps, int depth);
2860 BOOL spoolss_io_r_enumjobs(char *desc, SPOOL_R_ENUMJOBS *r_u, prs_struct *ps, int depth);
2861 BOOL make_spoolss_q_enumjobs(SPOOL_Q_ENUMJOBS *q_u, const POLICY_HND *hnd,
2862                                 uint32 firstjob,
2863                                 uint32 numofjobs,
2864                                 uint32 level,
2865                                 NEW_BUFFER *buffer,
2866                                 uint32 offered);
2867 BOOL spoolss_io_q_enumjobs(char *desc, SPOOL_Q_ENUMJOBS *q_u, prs_struct *ps, int depth);
2868 BOOL spoolss_io_r_schedulejob(char *desc, SPOOL_R_SCHEDULEJOB *r_u, prs_struct *ps, int depth);
2869 BOOL spoolss_io_q_schedulejob(char *desc, SPOOL_Q_SCHEDULEJOB *q_u, prs_struct *ps, int depth);
2870 BOOL spoolss_io_r_setjob(char *desc, SPOOL_R_SETJOB *r_u, prs_struct *ps, int depth);
2871 BOOL spoolss_io_q_setjob(char *desc, SPOOL_Q_SETJOB *q_u, prs_struct *ps, int depth);
2872 BOOL new_spoolss_io_r_enumprinterdrivers(char *desc, SPOOL_R_ENUMPRINTERDRIVERS *r_u, prs_struct *ps, int depth);
2873 BOOL make_spoolss_q_enumprinterdrivers(SPOOL_Q_ENUMPRINTERDRIVERS *q_u,
2874                                 const char *name,
2875                                 const char *environment,
2876                                 uint32 level,
2877                                 NEW_BUFFER *buffer, uint32 offered);
2878 BOOL spoolss_io_q_enumprinterdrivers(char *desc, SPOOL_Q_ENUMPRINTERDRIVERS *q_u, prs_struct *ps, int depth);
2879 BOOL spoolss_io_q_enumforms(char *desc, SPOOL_Q_ENUMFORMS *q_u, prs_struct *ps, int depth);
2880 BOOL new_spoolss_io_r_enumforms(char *desc, SPOOL_R_ENUMFORMS *r_u, prs_struct *ps, int depth);
2881 BOOL spoolss_io_q_getform(char *desc, SPOOL_Q_GETFORM *q_u, prs_struct *ps, int depth);
2882 BOOL new_spoolss_io_r_getform(char *desc, SPOOL_R_GETFORM *r_u, prs_struct *ps, int depth);
2883 BOOL new_spoolss_io_r_enumports(char *desc, SPOOL_R_ENUMPORTS *r_u, prs_struct *ps, int depth);
2884 BOOL spoolss_io_q_enumports(char *desc, SPOOL_Q_ENUMPORTS *q_u, prs_struct *ps, int depth);
2885 BOOL spool_io_printer_info_level_1(char *desc, SPOOL_PRINTER_INFO_LEVEL_1 *il, prs_struct *ps, int depth);
2886 BOOL spool_io_printer_info_level_3(char *desc, SPOOL_PRINTER_INFO_LEVEL_3 *il, prs_struct *ps, int depth);
2887 BOOL spool_io_printer_info_level_2(char *desc, SPOOL_PRINTER_INFO_LEVEL_2 *il, prs_struct *ps, int depth);
2888 BOOL spool_io_printer_info_level(char *desc, SPOOL_PRINTER_INFO_LEVEL *il, prs_struct *ps, int depth);
2889 BOOL spoolss_io_q_addprinterex(char *desc, SPOOL_Q_ADDPRINTEREX *q_u, prs_struct *ps, int depth);
2890 BOOL spoolss_io_r_addprinterex(char *desc, SPOOL_R_ADDPRINTEREX *r_u, 
2891                                prs_struct *ps, int depth);
2892 BOOL spool_io_printer_driver_info_level_3(char *desc, SPOOL_PRINTER_DRIVER_INFO_LEVEL_3 **q_u, 
2893                                           prs_struct *ps, int depth);
2894 void free_spool_printer_driver_info_level_3(SPOOL_PRINTER_DRIVER_INFO_LEVEL_3 **q_u);
2895 BOOL spool_io_printer_driver_info_level_6(char *desc, SPOOL_PRINTER_DRIVER_INFO_LEVEL_6 **q_u, 
2896                                           prs_struct *ps, int depth);
2897 void free_spool_printer_driver_info_level_6(SPOOL_PRINTER_DRIVER_INFO_LEVEL_6 **q_u);
2898 BOOL smb_io_unibuffer(char *desc, UNISTR2 *buffer, prs_struct *ps, int depth);
2899 BOOL spool_io_printer_driver_info_level(char *desc, SPOOL_PRINTER_DRIVER_INFO_LEVEL *il, prs_struct *ps, int depth);
2900 void free_spool_printer_driver_info_level(SPOOL_PRINTER_DRIVER_INFO_LEVEL *il);
2901 BOOL make_spoolss_q_addprinterdriver(SPOOL_Q_ADDPRINTERDRIVER *q_u, 
2902                                      const char* srv_name, uint32 level, 
2903                                      PRINTER_DRIVER_CTR *info);
2904 BOOL make_spool_driver_info_3(SPOOL_PRINTER_DRIVER_INFO_LEVEL_3 *spool_drv_info,
2905                               DRIVER_INFO_3 *info3);
2906 void free_spool_driver_info_3 (SPOOL_PRINTER_DRIVER_INFO_LEVEL_3 *info);
2907 BOOL make_spool_buffer5(BUFFER5 *buf5, uint32 len, uint16 *src);
2908 void free_spool_buffer5(BUFFER5 *buf);
2909 BOOL spoolss_io_q_addprinterdriver(char *desc, SPOOL_Q_ADDPRINTERDRIVER *q_u, prs_struct *ps, int depth);
2910 void free_spoolss_q_addprinterdriver(SPOOL_Q_ADDPRINTERDRIVER *q_u);
2911 BOOL spoolss_io_r_addprinterdriver(char *desc, SPOOL_R_ADDPRINTERDRIVER *q_u, prs_struct *ps, int depth);
2912 BOOL uni_2_asc_printer_driver_3(SPOOL_PRINTER_DRIVER_INFO_LEVEL_3 *uni,
2913                                 NT_PRINTER_DRIVER_INFO_LEVEL_3 **asc);
2914 BOOL uni_2_asc_printer_driver_6(SPOOL_PRINTER_DRIVER_INFO_LEVEL_6 *uni,
2915                                 NT_PRINTER_DRIVER_INFO_LEVEL_6 **asc);
2916 BOOL uni_2_asc_printer_info_2(const SPOOL_PRINTER_INFO_LEVEL_2 *uni,
2917                               NT_PRINTER_INFO_LEVEL_2  **asc);
2918 BOOL make_spoolss_q_getprinterdriverdir(SPOOL_Q_GETPRINTERDRIVERDIR *q_u,
2919                                 fstring servername, fstring env_name, uint32 level,
2920                                 NEW_BUFFER *buffer, uint32 offered);
2921 BOOL spoolss_io_q_getprinterdriverdir(char *desc, SPOOL_Q_GETPRINTERDRIVERDIR *q_u, prs_struct *ps, int depth);
2922 BOOL spoolss_io_r_getprinterdriverdir(char *desc, SPOOL_R_GETPRINTERDRIVERDIR *r_u, prs_struct *ps, int depth);
2923 BOOL spoolss_io_r_enumprintprocessors(char *desc, SPOOL_R_ENUMPRINTPROCESSORS *r_u, prs_struct *ps, int depth);
2924 BOOL spoolss_io_q_enumprintprocessors(char *desc, SPOOL_Q_ENUMPRINTPROCESSORS *q_u, prs_struct *ps, int depth);
2925 BOOL spoolss_io_r_enumprintprocdatatypes(char *desc, SPOOL_R_ENUMPRINTPROCDATATYPES *r_u, prs_struct *ps, int depth);
2926 BOOL spoolss_io_q_enumprintprocdatatypes(char *desc, SPOOL_Q_ENUMPRINTPROCDATATYPES *q_u, prs_struct *ps, int depth);
2927 BOOL spoolss_io_q_enumprintmonitors(char *desc, SPOOL_Q_ENUMPRINTMONITORS *q_u, prs_struct *ps, int depth);
2928 BOOL spoolss_io_r_enumprintmonitors(char *desc, SPOOL_R_ENUMPRINTMONITORS *r_u, prs_struct *ps, int depth);
2929 BOOL spoolss_io_r_enumprinterdata(char *desc, SPOOL_R_ENUMPRINTERDATA *r_u, prs_struct *ps, int depth);
2930 BOOL spoolss_io_q_enumprinterdata(char *desc, SPOOL_Q_ENUMPRINTERDATA *q_u, prs_struct *ps, int depth);
2931 BOOL make_spoolss_q_enumprinterdata(SPOOL_Q_ENUMPRINTERDATA *q_u,
2932                 const POLICY_HND *hnd,
2933                 uint32 idx, uint32 valuelen, uint32 datalen);
2934 BOOL spoolss_io_q_setprinterdata(char *desc, SPOOL_Q_SETPRINTERDATA *q_u, prs_struct *ps, int depth);
2935 void free_spoolss_q_setprinterdata(SPOOL_Q_SETPRINTERDATA *q_u);
2936 BOOL spoolss_io_r_setprinterdata(char *desc, SPOOL_R_SETPRINTERDATA *r_u, prs_struct *ps, int depth);
2937 BOOL convert_specific_param(NT_PRINTER_PARAM **param, const UNISTR2 *value,
2938                                 uint32 type, const uint8 *data, uint32 len);
2939 BOOL spoolss_io_q_deleteform(char *desc, SPOOL_Q_DELETEFORM *q_u, prs_struct *ps, int depth);
2940 BOOL spoolss_io_r_deleteform(char *desc, SPOOL_R_DELETEFORM *r_u, prs_struct *ps, int depth);
2941 BOOL spoolss_io_q_addform(char *desc, SPOOL_Q_ADDFORM *q_u, prs_struct *ps, int depth);
2942 BOOL spoolss_io_r_addform(char *desc, SPOOL_R_ADDFORM *r_u, prs_struct *ps, int depth);
2943 BOOL spoolss_io_q_setform(char *desc, SPOOL_Q_SETFORM *q_u, prs_struct *ps, int depth);
2944 BOOL spoolss_io_r_setform(char *desc, SPOOL_R_SETFORM *r_u, prs_struct *ps, int depth);
2945 BOOL spoolss_io_r_getjob(char *desc, SPOOL_R_GETJOB *r_u, prs_struct *ps, int depth);
2946 BOOL spoolss_io_q_getjob(char *desc, SPOOL_Q_GETJOB *q_u, prs_struct *ps, int depth);
2947 void free_devmode(DEVICEMODE *devmode);
2948 void free_printer_info_1(PRINTER_INFO_1 *printer);
2949 void free_printer_info_2(PRINTER_INFO_2 *printer);
2950 void free_printer_info_3(PRINTER_INFO_3 *printer);
2951 void free_spool_printer_info_1(SPOOL_PRINTER_INFO_LEVEL_1 *printer);
2952 void free_spool_printer_info_2(SPOOL_PRINTER_INFO_LEVEL_2 *printer);
2953 void free_spool_printer_info_3(SPOOL_PRINTER_INFO_LEVEL_3 *printer);
2954 void free_spool_printer_info_level(SPOOL_PRINTER_INFO_LEVEL *pil);
2955 void free_print2_array(uint32 num_entries, PRINTER_INFO_2 **entries);
2956 void free_print1_array(uint32 num_entries, PRINTER_INFO_1 **entries);
2957 void free_job1_array(uint32 num_entries, JOB_INFO_1 **entries);
2958 void free_job_info_2(JOB_INFO_2 *job);
2959 void free_job2_array(uint32 num_entries, JOB_INFO_2 **entries);
2960 BOOL make_spoolss_q_replyopenprinter(SPOOL_Q_REPLYOPENPRINTER *q_u, 
2961                                const fstring string, uint32 printer, uint32 type);
2962 BOOL spoolss_io_q_replyopenprinter(char *desc, SPOOL_Q_REPLYOPENPRINTER *q_u, prs_struct *ps, int depth);
2963 BOOL spoolss_io_r_replyopenprinter(char *desc, SPOOL_R_REPLYOPENPRINTER *r_u, prs_struct *ps, int depth);
2964 BOOL make_spoolss_q_reply_closeprinter(SPOOL_Q_REPLYCLOSEPRINTER *q_u, POLICY_HND *hnd);
2965 BOOL spoolss_io_q_replycloseprinter(char *desc, SPOOL_Q_REPLYCLOSEPRINTER *q_u, prs_struct *ps, int depth);
2966 BOOL spoolss_io_r_replycloseprinter(char *desc, SPOOL_R_REPLYCLOSEPRINTER *r_u, prs_struct *ps, int depth);
2967 BOOL make_spoolss_q_reply_rrpcn(SPOOL_Q_REPLY_RRPCN *q_u, POLICY_HND *hnd,
2968                                 uint32 change_low, uint32 change_high);
2969 BOOL spoolss_io_q_reply_rrpcn(char *desc, SPOOL_Q_REPLY_RRPCN *q_u, prs_struct *ps, int depth);
2970 BOOL spoolss_io_r_reply_rrpcn(char *desc, SPOOL_R_REPLY_RRPCN *r_u, prs_struct *ps, int depth);
2971
2972 /*The following definitions come from  rpc_parse/parse_srv.c  */
2973
2974 void init_srv_share_info1_str(SH_INFO_1_STR *sh1, char *net_name, char *remark);
2975 void init_srv_share_info1(SH_INFO_1 *sh1, char *net_name, uint32 type, char *remark);
2976 void init_srv_share_info2_str(SH_INFO_2_STR *sh2,
2977                                 char *net_name, char *remark,
2978                                 char *path, char *passwd);
2979 void init_srv_share_info2(SH_INFO_2 *sh2,
2980                                 char *net_name, uint32 type, char *remark,
2981                                 uint32 perms, uint32 max_uses, uint32 num_uses,
2982                                 char *path, char *passwd);
2983 void free_srv_share_info_ctr(SRV_SHARE_INFO_CTR *ctr);
2984 void free_srv_q_net_share_enum(SRV_Q_NET_SHARE_ENUM *q_n);
2985 void free_srv_r_net_share_enum(SRV_R_NET_SHARE_ENUM *r_n);
2986 void init_srv_q_net_share_enum(SRV_Q_NET_SHARE_ENUM *q_n, 
2987                                 char *srv_name, uint32 info_level,
2988                                 uint32 preferred_len, ENUM_HND *hnd);
2989 BOOL srv_io_q_net_share_enum(char *desc, SRV_Q_NET_SHARE_ENUM *q_n, prs_struct *ps, int depth);
2990 BOOL srv_io_r_net_share_enum(char *desc, SRV_R_NET_SHARE_ENUM *r_n, prs_struct *ps, int depth);
2991 void free_srv_q_net_share_get_info(SRV_Q_NET_SHARE_GET_INFO *q_n);
2992 void free_srv_r_net_share_get_info(SRV_R_NET_SHARE_GET_INFO *r_n);
2993 BOOL srv_io_q_net_share_get_info(char *desc, SRV_Q_NET_SHARE_GET_INFO *q_n, prs_struct *ps, int depth);
2994 BOOL srv_io_r_net_share_get_info(char *desc, SRV_R_NET_SHARE_GET_INFO *r_n, prs_struct *ps, int depth);
2995 void init_srv_sess_info0_str(SESS_INFO_0_STR *ss0, char *name);
2996 void init_srv_sess_info0(SESS_INFO_0 *ss0, char *name);
2997 void init_srv_sess_info1_str(SESS_INFO_1_STR *ss1, char *name, char *user);
2998 void init_srv_sess_info1(SESS_INFO_1 *ss1, 
2999                                 char *name, char *user,
3000                                 uint32 num_opens, uint32 open_time, uint32 idle_time,
3001                                 uint32 user_flags);
3002 void init_srv_q_net_sess_enum(SRV_Q_NET_SESS_ENUM *q_n, 
3003                                 char *srv_name, char *qual_name,
3004                                 uint32 sess_level, SRV_SESS_INFO_CTR *ctr,
3005                                 uint32 preferred_len,
3006                                 ENUM_HND *hnd);
3007 BOOL srv_io_q_net_sess_enum(char *desc, SRV_Q_NET_SESS_ENUM *q_n, prs_struct *ps, int depth);
3008 BOOL srv_io_r_net_sess_enum(char *desc, SRV_R_NET_SESS_ENUM *r_n, prs_struct *ps, int depth);
3009 void init_srv_conn_info0(CONN_INFO_0 *ss0, uint32 id);
3010 void init_srv_conn_info1_str(CONN_INFO_1_STR *ss1, char *usr_name, char *net_name);
3011 void init_srv_conn_info1(CONN_INFO_1 *ss1, 
3012                                 uint32 id, uint32 type,
3013                                 uint32 num_opens, uint32 num_users, uint32 open_time,
3014                                 char *usr_name, char *net_name);
3015 void init_srv_q_net_conn_enum(SRV_Q_NET_CONN_ENUM *q_n, 
3016                                 char *srv_name, char *qual_name,
3017                                 uint32 conn_level, SRV_CONN_INFO_CTR *ctr,
3018                                 uint32 preferred_len,
3019                                 ENUM_HND *hnd);
3020 BOOL srv_io_q_net_conn_enum(char *desc, SRV_Q_NET_CONN_ENUM *q_n, prs_struct *ps, int depth);
3021 BOOL srv_io_r_net_conn_enum(char *desc,  SRV_R_NET_CONN_ENUM *r_n, prs_struct *ps, int depth);
3022 void init_srv_file_info3_str(FILE_INFO_3_STR *fi3, char *user_name, char *path_name);
3023 void init_srv_file_info3(FILE_INFO_3 *fl3,
3024                                 uint32 id, uint32 perms, uint32 num_locks,
3025                                 char *path_name, char *user_name);
3026 void init_srv_q_net_file_enum(SRV_Q_NET_FILE_ENUM *q_n, 
3027                                 char *srv_name, char *qual_name,
3028                                 uint32 file_level, SRV_FILE_INFO_CTR *ctr,
3029                                 uint32 preferred_len,
3030                                 ENUM_HND *hnd);
3031 BOOL srv_io_q_net_file_enum(char *desc, SRV_Q_NET_FILE_ENUM *q_n, prs_struct *ps, int depth);
3032 BOOL srv_io_r_net_file_enum(char *desc, SRV_R_NET_FILE_ENUM *r_n, prs_struct *ps, int depth);
3033 void init_srv_info_101(SRV_INFO_101 *sv101, uint32 platform_id, char *name,
3034                                 uint32 ver_major, uint32 ver_minor,
3035                                 uint32 srv_type, char *comment);
3036 void init_srv_info_102(SRV_INFO_102 *sv102, uint32 platform_id, char *name,
3037                                 char *comment, uint32 ver_major, uint32 ver_minor,
3038                                 uint32 srv_type, uint32 users, uint32 disc, uint32 hidden,
3039                                 uint32 announce, uint32 ann_delta, uint32 licenses,
3040                                 char *usr_path);
3041 void init_srv_q_net_srv_get_info(SRV_Q_NET_SRV_GET_INFO *srv,
3042                                 char *server_name, uint32 switch_value);
3043 BOOL srv_io_q_net_srv_get_info(char *desc, SRV_Q_NET_SRV_GET_INFO *q_n, prs_struct *ps, int depth);
3044 void init_srv_r_net_srv_get_info(SRV_R_NET_SRV_GET_INFO *srv,
3045                                 uint32 switch_value, SRV_INFO_CTR *ctr, uint32 status);
3046 BOOL srv_io_r_net_srv_get_info(char *desc, SRV_R_NET_SRV_GET_INFO *r_n, prs_struct *ps, int depth);
3047 BOOL srv_io_q_net_remote_tod(char *desc, SRV_Q_NET_REMOTE_TOD *q_n, prs_struct *ps, int depth);
3048 void init_time_of_day_info(TIME_OF_DAY_INFO *tod, uint32 elapsedt, uint32 msecs,
3049                            uint32 hours, uint32 mins, uint32 secs, uint32 hunds,
3050                            uint32 zone, uint32 tintervals, uint32 day,
3051                            uint32 month, uint32 year, uint32 weekday);
3052 BOOL srv_io_r_net_remote_tod(char *desc, SRV_R_NET_REMOTE_TOD *r_n, prs_struct *ps, int depth);
3053
3054 /*The following definitions come from  rpc_parse/parse_wks.c  */
3055
3056 void init_wks_q_query_info(WKS_Q_QUERY_INFO *q_u,
3057                                 char *server, uint16 switch_value)  ;
3058 BOOL wks_io_q_query_info(char *desc, WKS_Q_QUERY_INFO *q_u, prs_struct *ps, int depth);
3059 void init_wks_info_100(WKS_INFO_100 *inf,
3060                                 uint32 platform_id, uint32 ver_major, uint32 ver_minor,
3061                                 char *my_name, char *domain_name);
3062 void init_wks_r_query_info(WKS_R_QUERY_INFO *r_u,
3063                                 uint32 switch_value, WKS_INFO_100 *wks100,
3064                                 int status)  ;
3065 BOOL wks_io_r_query_info(char *desc, WKS_R_QUERY_INFO *r_u, prs_struct *ps, int depth);
3066
3067 /*The following definitions come from  rpc_server/srv_dfs.c  */
3068
3069 BOOL api_netdfs_rpc(pipes_struct *p);
3070
3071 /*The following definitions come from  rpc_server/srv_lsa.c  */
3072
3073 #if OLD_NTDOMAIN
3074 BOOL api_ntlsa_rpc(pipes_struct *p);
3075 #endif
3076
3077 /*The following definitions come from  rpc_server/srv_lsa_hnd.c  */
3078
3079 #if OLD_NTDOMAIN
3080 void init_lsa_policy_hnd(void);
3081 BOOL open_lsa_policy_hnd(POLICY_HND *hnd);
3082 int find_lsa_policy_by_hnd(POLICY_HND *hnd);
3083 BOOL set_lsa_policy_samr_pol_status(POLICY_HND *hnd, uint32 pol_status);
3084 BOOL set_lsa_policy_samr_sid(POLICY_HND *hnd, DOM_SID *sid);
3085 BOOL get_lsa_policy_samr_sid(POLICY_HND *hnd, DOM_SID *sid);
3086 uint32 get_lsa_policy_samr_rid(POLICY_HND *hnd);
3087 BOOL set_lsa_policy_reg_name(POLICY_HND *hnd, fstring name);
3088 BOOL close_lsa_policy_hnd(POLICY_HND *hnd);
3089 #endif
3090
3091 /*The following definitions come from  rpc_server/srv_netlog.c  */
3092
3093 #if OLD_NTDOMAIN
3094 BOOL api_netlog_rpc(pipes_struct *p);
3095 #endif
3096
3097 /*The following definitions come from  rpc_server/srv_pipe.c  */
3098
3099 #if OLD_NTDOMAIN
3100 BOOL create_next_pdu(pipes_struct *p);
3101 BOOL api_pipe_bind_auth_resp(pipes_struct *p, prs_struct *rpc_in_p);
3102 BOOL setup_fault_pdu(pipes_struct *p);
3103 BOOL check_bind_req(char* pipe_name, RPC_IFACE* abstract,
3104                                         RPC_IFACE* transfer);
3105 BOOL api_pipe_bind_req(pipes_struct *p, prs_struct *rpc_in_p);
3106 BOOL api_pipe_auth_process(pipes_struct *p, prs_struct *rpc_in);
3107 BOOL api_pipe_request(pipes_struct *p);
3108 BOOL api_rpcTNP(pipes_struct *p, char *rpc_name, 
3109                 struct api_struct *api_rpc_cmds);
3110 #endif
3111
3112 /*The following definitions come from  rpc_server/srv_pipe_hnd.c  */
3113
3114 #if OLD_NTDOMAIN
3115 void set_pipe_handle_offset(int max_open_files);
3116 void reset_chain_p(void);
3117 void init_rpc_pipe_hnd(void);
3118 pipes_struct *open_rpc_pipe_p(char *pipe_name, 
3119                               connection_struct *conn, uint16 vuid);
3120 ssize_t write_to_pipe(pipes_struct *p, char *data, size_t n);
3121 ssize_t read_from_pipe(pipes_struct *p, char *data, size_t n);
3122 BOOL wait_rpc_pipe_hnd_state(pipes_struct *p, uint16 priority);
3123 BOOL set_rpc_pipe_hnd_state(pipes_struct *p, uint16 device_state);
3124 BOOL close_rpc_pipe_hnd(pipes_struct *p, connection_struct *conn);
3125 pipes_struct *get_rpc_pipe_p(char *buf, int where);
3126 pipes_struct *get_rpc_pipe(int pnum);
3127 #endif
3128
3129 /*The following definitions come from  rpc_server/srv_reg.c  */
3130
3131 #if OLD_NTDOMAIN
3132 BOOL api_reg_rpc(pipes_struct *p);
3133 #endif
3134
3135 /*The following definitions come from  rpc_server/srv_samr.c  */
3136
3137 #if OLD_NTDOMAIN
3138 BOOL api_samr_rpc(pipes_struct *p);
3139 #endif
3140
3141 /*The following definitions come from  rpc_server/srv_spoolss.c  */
3142
3143 #if OLD_NTDOMAIN
3144 BOOL api_spoolss_rpc(pipes_struct *p);
3145 #endif
3146
3147 /*The following definitions come from  rpc_server/srv_spoolss_nt.c  */
3148
3149 #if OLD_NTDOMAIN
3150 void init_printer_hnd(void);
3151 void srv_spoolss_receive_message(int msg_type, pid_t src, void *buf, size_t len);
3152 uint32 _spoolss_open_printer_ex( const UNISTR2 *printername,
3153                                  const PRINTER_DEFAULT *printer_default,
3154                                  uint32  user_switch, SPOOL_USER_CTR user_ctr,
3155                                  POLICY_HND *handle);
3156 uint32 _spoolss_closeprinter(POLICY_HND *handle);
3157 uint32 _spoolss_deleteprinter(POLICY_HND *handle);
3158 uint32 _spoolss_getprinterdata(POLICY_HND *handle, UNISTR2 *valuename,
3159                                 uint32 in_size,
3160                                 uint32 *type,
3161                                 uint32 *out_size,
3162                                 uint8 **data,
3163                                 uint32 *needed);
3164 uint32 _spoolss_rffpcnex(POLICY_HND *handle, uint32 flags, uint32 options,
3165                          const UNISTR2 *localmachine, uint32 printerlocal,
3166                          SPOOL_NOTIFY_OPTION *option);
3167 uint32 _spoolss_rfnpcnex( POLICY_HND *handle, uint32 change,
3168                           SPOOL_NOTIFY_OPTION *option, SPOOL_NOTIFY_INFO *info);
3169 uint32 _spoolss_enumprinters( uint32 flags, const UNISTR2 *servername, uint32 level,
3170                               NEW_BUFFER *buffer, uint32 offered,
3171                               uint32 *needed, uint32 *returned);
3172 uint32 _spoolss_getprinter(POLICY_HND *handle, uint32 level,
3173                            NEW_BUFFER *buffer, uint32 offered, uint32 *needed);
3174 uint32 _spoolss_getprinterdriver2(POLICY_HND *handle, const UNISTR2 *uni_arch, uint32 level, 
3175                                 uint32 clientmajorversion, uint32 clientminorversion,
3176                                 NEW_BUFFER *buffer, uint32 offered,
3177                                 uint32 *needed, uint32 *servermajorversion, uint32 *serverminorversion);
3178 uint32 _spoolss_startpageprinter(POLICY_HND *handle);
3179 uint32 _spoolss_endpageprinter(POLICY_HND *handle);
3180 uint32 _spoolss_startdocprinter(POLICY_HND *handle, uint32 level,
3181                                 pipes_struct *p, DOC_INFO *docinfo, 
3182                                 uint32 *jobid);
3183 uint32 _spoolss_enddocprinter(POLICY_HND *handle);
3184 uint32 _spoolss_writeprinter( POLICY_HND *handle,
3185                                 uint32 buffer_size,
3186                                 uint8 *buffer,
3187                                 uint32 *buffer_written);
3188 uint32 _spoolss_abortprinter(POLICY_HND *handle, pipes_struct *p);
3189 uint32 _spoolss_setprinter(POLICY_HND *handle, uint32 level,
3190                            const SPOOL_PRINTER_INFO_LEVEL *info,
3191                            DEVMODE_CTR devmode_ctr,
3192                            SEC_DESC_BUF *secdesc_ctr,
3193                            uint32 command, pipes_struct *p);
3194 uint32 _spoolss_fcpn(POLICY_HND *handle);
3195 uint32 _spoolss_addjob(POLICY_HND *handle, uint32 level,
3196                        NEW_BUFFER *buffer, uint32 offered,
3197                        uint32 *needed);
3198 uint32 _spoolss_enumjobs( POLICY_HND *handle, uint32 firstjob, uint32 numofjobs, uint32 level,                    
3199                           NEW_BUFFER *buffer, uint32 offered,
3200                           uint32 *needed, uint32 *returned);
3201 uint32 _spoolss_schedulejob( POLICY_HND *handle, uint32 jobid);
3202 uint32 _spoolss_setjob(POLICY_HND *handle, uint32 jobid, uint32 level,
3203                        pipes_struct *p, JOB_INFO *ctr, uint32 command);
3204 uint32 _spoolss_enumprinterdrivers( UNISTR2 *name, UNISTR2 *environment, uint32 level,
3205                                     NEW_BUFFER *buffer, uint32 offered,
3206                                     uint32 *needed, uint32 *returned);
3207 uint32 _new_spoolss_enumforms( POLICY_HND *handle, uint32 level, 
3208                                NEW_BUFFER *buffer, uint32 offered, 
3209                                uint32 *needed, uint32 *numofforms);
3210 uint32 _spoolss_getform( POLICY_HND *handle, uint32 level, UNISTR2 *uni_formname, NEW_BUFFER *buffer, uint32 offered, uint32 *needed);
3211 uint32 _spoolss_enumports( UNISTR2 *name, uint32 level, 
3212                            NEW_BUFFER *buffer, uint32 offered, 
3213                            uint32 *needed, uint32 *returned);
3214 uint32 _spoolss_addprinterex( const UNISTR2 *uni_srv_name, uint32 level,
3215                                 const SPOOL_PRINTER_INFO_LEVEL *info,
3216                                 uint32 unk0, uint32 unk1, uint32 unk2, uint32 unk3,
3217                                 uint32 user_switch, const SPOOL_USER_CTR *user,
3218                                 POLICY_HND *handle);
3219 uint32 _spoolss_addprinterdriver(pipes_struct *p, const UNISTR2 *server_name,
3220                                  uint32 level, const SPOOL_PRINTER_DRIVER_INFO_LEVEL *info);
3221 uint32 _spoolss_getprinterdriverdirectory(UNISTR2 *name, UNISTR2 *uni_environment, uint32 level,
3222                                         NEW_BUFFER *buffer, uint32 offered, 
3223                                         uint32 *needed);
3224 uint32 _spoolss_enumprinterdata(POLICY_HND *handle, uint32 idx,
3225                                 uint32 in_value_len, uint32 in_data_len,
3226                                 uint32 *out_max_value_len, uint16 **out_value, uint32 *out_value_len,
3227                                 uint32 *out_type,
3228                                 uint32 *out_max_data_len, uint8  **data_out, uint32 *out_data_len);
3229 uint32 _spoolss_setprinterdata( POLICY_HND *handle,
3230                                 const UNISTR2 *value,
3231                                 uint32 type,
3232                                 uint32 max_len,
3233                                 const uint8 *data,
3234                                 uint32 real_len,
3235                                 uint32 numeric_data);
3236 uint32 _spoolss_deleteprinterdata( POLICY_HND *handle, const UNISTR2 *value);
3237 uint32 _spoolss_addform( POLICY_HND *handle,
3238                              &