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