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