string_hash() should be static. hash_clear() should be void.
[Samba/gbeck.git] / source / include / proto.h
blob6f12e4e2759195b723cd25e04442cb60e8f17d96
1 #ifndef _PROTO_H_
2 #define _PROTO_H_
3 /* This file is automatically generated with "make proto". DO NOT EDIT */
6 /*The following definitions come from client/client.c */
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);
11 /*The following definitions come from client/clitar.c */
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);
20 /*The following definitions come from groupdb/mapping.c */
22 char *decode_sid_name_use(fstring group, enum SID_NAME_USE name_use);
23 BOOL init_group_mapping(void);
24 BOOL add_mapping_entry(GROUP_MAP *map, int flag);
25 BOOL add_initial_entry(gid_t gid, fstring sid, enum SID_NAME_USE sid_name_use,
26 fstring nt_name, fstring comment, uint32 privilege);
27 BOOL default_group_mapping(void);
28 BOOL get_group_map_from_sid(DOM_SID sid, GROUP_MAP *map);
29 BOOL get_group_map_from_gid(gid_t gid, GROUP_MAP *map);
30 BOOL get_group_map_from_ntname(char *name, GROUP_MAP *map);
31 BOOL group_map_remove(DOM_SID sid);
32 BOOL enum_group_mapping(enum SID_NAME_USE sid_name_use, GROUP_MAP **rmap,
33 int *num_entries, BOOL unix_only);
34 void convert_priv_from_text(uint32 *se_priv, char *privilege);
35 void convert_priv_to_text(uint32 se_priv, char *privilege);
36 BOOL get_domain_group_from_sid(DOM_SID sid, GROUP_MAP *map);
37 BOOL get_local_group_from_sid(DOM_SID sid, GROUP_MAP *map);
38 BOOL get_builtin_group_from_sid(DOM_SID sid, GROUP_MAP *map);
39 BOOL get_group_from_gid(gid_t gid, GROUP_MAP *map);
40 BOOL get_uid_list_of_group(gid_t gid, uid_t **uid, int *num_uids);
41 int smb_create_group(char *unix_group);
42 int smb_delete_group(char *unix_group);
43 int smb_add_user_group(char *unix_group, char *unix_user);
44 int smb_delete_user_group(char *unix_group, char *unix_user);
46 /*The following definitions come from lib/access.c */
48 BOOL allow_access(char *deny_list,char *allow_list,
49 char *cname,char *caddr);
50 BOOL check_access(int sock, char *allow_list, char *deny_list);
52 /*The following definitions come from lib/bitmap.c */
54 struct bitmap *bitmap_allocate(int n);
55 void bitmap_free(struct bitmap *bm);
56 BOOL bitmap_set(struct bitmap *bm, unsigned i);
57 BOOL bitmap_clear(struct bitmap *bm, unsigned i);
58 BOOL bitmap_query(struct bitmap *bm, unsigned i);
59 int bitmap_find(struct bitmap *bm, unsigned ofs);
61 /*The following definitions come from lib/charcnv.c */
63 char *unix2dos_format(char *str,BOOL overwrite);
64 char *dos2unix_format(char *str, BOOL overwrite);
65 void interpret_character_set(char *str, int codepage);
67 /*The following definitions come from lib/charset.c */
69 void charset_initialise(void);
70 void codepage_initialise(int client_codepage);
71 void add_char_string(char *s);
73 /*The following definitions come from lib/crc32.c */
75 uint32 crc32_calc_buffer( char *buffer, uint32 count);
77 /*The following definitions come from lib/debug.c */
79 char* debug_classname_from_index(int ndx);
80 int debug_lookup_classname(char* classname);
81 BOOL debug_parse_params(char **params, int *debuglevel_class);
82 BOOL debug_parse_levels(char *params_str);
83 void debug_message(int msg_type, pid_t src, void *buf, size_t len);
84 void debug_message_send(pid_t pid, int level);
85 void setup_logging(char *pname, BOOL interactive);
86 BOOL reopen_logs( void );
87 void force_check_log_size( void );
88 BOOL need_to_check_log_size( void );
89 void check_log_size( void );
90 void dbgflush( void );
91 BOOL dbghdr( int level, char *file, char *func, int line );
93 /*The following definitions come from lib/doscalls.c */
95 int dos_unlink(char *fname);
96 int dos_open(char *fname,int flags,mode_t mode);
97 DIR *dos_opendir(char *dname);
98 char *dos_readdirname(DIR *p);
99 int dos_chown(char *fname, uid_t uid, gid_t gid);
100 int dos_stat(char *fname,SMB_STRUCT_STAT *sbuf);
101 int dos_lstat(char *fname,SMB_STRUCT_STAT *sbuf);
102 int dos_mkdir(char *dname,mode_t mode);
103 int dos_rmdir(char *dname);
104 int dos_chdir(char *dname);
105 int dos_utime(char *fname,struct utimbuf *times);
106 int copy_reg(char *source, const char *dest);
107 int dos_rename(char *from, char *to);
108 int dos_chmod(char *fname,mode_t mode);
109 char *dos_getwd(char *unix_path);
110 BOOL dos_file_exist(char *fname,SMB_STRUCT_STAT *sbuf);
111 BOOL dos_directory_exist(char *dname,SMB_STRUCT_STAT *st);
112 time_t dos_file_modtime(char *fname);
113 SMB_OFF_T dos_file_size(char *file_name);
115 /*The following definitions come from lib/error.c */
117 uint32 map_nt_error_from_unix(int unix_error);
119 /*The following definitions come from lib/fault.c */
121 void fault_setup(void (*fn)(void *));
123 /*The following definitions come from lib/fsusage.c */
125 int sys_fsusage(const char *path, SMB_BIG_UINT *dfree, SMB_BIG_UINT *dsize);
127 /*The following definitions come from lib/genrand.c */
129 void generate_random_buffer( unsigned char *out, int len, BOOL re_seed);
130 char *generate_random_str(size_t len);
132 /*The following definitions come from lib/getsmbpass.c */
134 char *getsmbpass(char *prompt) ;
136 /*The following definitions come from lib/hash.c */
138 BOOL hash_table_init(hash_table *table, int num_buckets, compare_function compare_func);
139 hash_element *hash_lookup(hash_table *table, char *key);
140 hash_element *hash_insert(hash_table *table, char *value, char *key);
141 void hash_remove(hash_table *table, hash_element *hash_elem);
142 void hash_clear(hash_table *table);
144 /*The following definitions come from lib/interface.c */
146 void load_interfaces(void);
147 BOOL interfaces_changed(void);
148 BOOL ismyip(struct in_addr ip);
149 BOOL is_local_net(struct in_addr from);
150 int iface_count(void);
151 BOOL we_are_multihomed(void);
152 struct interface *get_interface(int n);
153 struct in_addr *iface_n_ip(int n);
154 struct in_addr *iface_n_bcast(int n);
155 unsigned iface_hash(void);
156 struct in_addr *iface_bcast(struct in_addr ip);
157 struct in_addr *iface_ip(struct in_addr ip);
159 /*The following definitions come from lib/interfaces.c */
161 int get_interfaces(struct iface_struct *ifaces, int max_interfaces);
163 /*The following definitions come from lib/kanji.c */
165 void interpret_coding_system(char *str);
166 void initialize_multibyte_vectors( int client_codepage);
168 /*The following definitions come from lib/md4.c */
170 void mdfour(unsigned char *out, unsigned char *in, int n);
172 /*The following definitions come from lib/messages.c */
174 void ping_message(int msg_type, pid_t src, void *buf, size_t len);
175 void debuglevel_message(int msg_type, pid_t src, void *buf, size_t len);
176 BOOL message_init(void);
177 BOOL message_send_pid(pid_t pid, int msg_type, void *buf, size_t len, BOOL duplicates_allowed);
178 void message_dispatch(void);
179 void message_register(int msg_type,
180 void (*fn)(int msg_type, pid_t pid, void *buf, size_t len));
181 void message_deregister(int msg_type);
182 BOOL message_send_all(TDB_CONTEXT *conn_tdb, int msg_type, void *buf, size_t len, BOOL duplicates_allowed);
184 /*The following definitions come from lib/ms_fnmatch.c */
186 int ms_fnmatch(const char *pattern, const char *string);
188 /*The following definitions come from lib/pidfile.c */
190 pid_t pidfile_pid(char *name);
191 void pidfile_create(char *name);
193 /*The following definitions come from lib/readline.c */
195 char *smb_readline(char *prompt, void (*callback)(void),
196 char **(completion_fn)(char *text, int start, int end));
197 void cmd_history(void);
199 /*The following definitions come from lib/replace.c */
201 char *rep_inet_ntoa(struct in_addr ip);
203 /*The following definitions come from lib/select.c */
205 void sys_select_signal(void);
206 int sys_select(int maxfd, fd_set *fds,struct timeval *tval);
207 int sys_select_intr(int maxfd, fd_set *fds,struct timeval *tval);
209 /*The following definitions come from lib/signal.c */
211 void BlockSignals(BOOL block,int signum);
212 void CatchSignal(int signum,void (*handler)(int ));
213 void CatchChild(void);
214 void CatchChildLeaveStatus(void);
216 /*The following definitions come from lib/smbrun.c */
218 int smbrun(char *cmd, int *outfd);
220 /*The following definitions come from lib/snprintf.c */
223 /*The following definitions come from lib/substitute.c */
225 void standard_sub_basic(char *str);
226 void standard_sub_advanced(int snum, char *user, char *connectpath, gid_t gid, char *str);
227 void standard_sub_conn(connection_struct *conn, char *str);
228 void standard_sub_snum(int snum, char *str);
229 void standard_sub_vuser(char *str, user_struct *vuser);
230 void standard_sub_vsnum(char *str, user_struct *vuser, int snum);
232 /*The following definitions come from lib/sysacls.c */
234 int sys_acl_get_entry( SMB_ACL_T the_acl, int entry_id, SMB_ACL_ENTRY_T *entry_p);
235 int sys_acl_get_tag_type( SMB_ACL_ENTRY_T entry_d, SMB_ACL_TAG_T *tag_type_p);
236 int sys_acl_get_permset( SMB_ACL_ENTRY_T entry_d, SMB_ACL_PERMSET_T *permset_p);
237 void *sys_acl_get_qualifier( SMB_ACL_ENTRY_T entry_d);
238 SMB_ACL_T sys_acl_get_file( const char *path_p, SMB_ACL_TYPE_T type);
239 SMB_ACL_T sys_acl_get_fd(int fd);
240 int sys_acl_clear_perms(SMB_ACL_PERMSET_T permset);
241 int sys_acl_add_perm( SMB_ACL_PERMSET_T permset, SMB_ACL_PERM_T perm);
242 int sys_acl_get_perm( SMB_ACL_PERMSET_T permset, SMB_ACL_PERM_T perm);
243 char *sys_acl_to_text( SMB_ACL_T the_acl, ssize_t *plen);
244 SMB_ACL_T sys_acl_init( int count);
245 int sys_acl_create_entry( SMB_ACL_T *pacl, SMB_ACL_ENTRY_T *pentry);
246 int sys_acl_set_tag_type( SMB_ACL_ENTRY_T entry, SMB_ACL_TAG_T tagtype);
247 int sys_acl_set_qualifier( SMB_ACL_ENTRY_T entry, void *qual);
248 int sys_acl_set_permset( SMB_ACL_ENTRY_T entry, SMB_ACL_PERMSET_T permset);
249 int sys_acl_valid( SMB_ACL_T theacl );
250 int sys_acl_set_file( char *name, SMB_ACL_TYPE_T acltype, SMB_ACL_T theacl);
251 int sys_acl_set_fd( int fd, SMB_ACL_T theacl);
252 int sys_acl_free_text(char *text);
253 int sys_acl_free_acl(SMB_ACL_T the_acl) ;
254 int sys_acl_free_qualifier(void *qual) ;
255 int sys_acl_get_entry(SMB_ACL_T acl_d, int entry_id, SMB_ACL_ENTRY_T *entry_p);
256 int sys_acl_get_tag_type(SMB_ACL_ENTRY_T entry_d, SMB_ACL_TAG_T *type_p);
257 int sys_acl_get_permset(SMB_ACL_ENTRY_T entry_d, SMB_ACL_PERMSET_T *permset_p);
258 void *sys_acl_get_qualifier(SMB_ACL_ENTRY_T entry_d);
259 SMB_ACL_T sys_acl_get_file(const char *path_p, SMB_ACL_TYPE_T type);
260 SMB_ACL_T sys_acl_get_fd(int fd);
261 int sys_acl_clear_perms(SMB_ACL_PERMSET_T permset_d);
262 int sys_acl_add_perm(SMB_ACL_PERMSET_T permset_d, SMB_ACL_PERM_T perm);
263 int sys_acl_get_perm(SMB_ACL_PERMSET_T permset_d, SMB_ACL_PERM_T perm);
264 char *sys_acl_to_text(SMB_ACL_T acl_d, ssize_t *len_p);
265 SMB_ACL_T sys_acl_init(int count);
266 int sys_acl_create_entry(SMB_ACL_T *acl_p, SMB_ACL_ENTRY_T *entry_p);
267 int sys_acl_set_tag_type(SMB_ACL_ENTRY_T entry_d, SMB_ACL_TAG_T tag_type);
268 int sys_acl_set_qualifier(SMB_ACL_ENTRY_T entry_d, void *qual_p);
269 int sys_acl_set_permset(SMB_ACL_ENTRY_T entry_d, SMB_ACL_PERMSET_T permset_d);
270 int sys_acl_valid(SMB_ACL_T acl_d);
271 int sys_acl_set_file(char *name, SMB_ACL_TYPE_T type, SMB_ACL_T acl_d);
272 int sys_acl_set_fd(int fd, SMB_ACL_T acl_d);
273 int sys_acl_free_text(char *text);
274 int sys_acl_free_acl(SMB_ACL_T acl_d) ;
275 int sys_acl_free_qualifier(void *qual) ;
276 int sys_acl_get_entry(SMB_ACL_T acl_d, int entry_id, SMB_ACL_ENTRY_T *entry_p);
277 int sys_acl_get_tag_type(SMB_ACL_ENTRY_T entry_d, SMB_ACL_TAG_T *type_p);
278 int sys_acl_get_permset(SMB_ACL_ENTRY_T entry_d, SMB_ACL_PERMSET_T *permset_p);
279 void *sys_acl_get_qualifier(SMB_ACL_ENTRY_T entry_d);
280 SMB_ACL_T sys_acl_get_file(const char *path_p, SMB_ACL_TYPE_T type);
281 SMB_ACL_T sys_acl_get_fd(int fd);
282 int sys_acl_clear_perms(SMB_ACL_PERMSET_T permset_d);
283 int sys_acl_add_perm(SMB_ACL_PERMSET_T permset_d, SMB_ACL_PERM_T perm);
284 int sys_acl_get_perm(SMB_ACL_PERMSET_T permset_d, SMB_ACL_PERM_T perm);
285 char *sys_acl_to_text(SMB_ACL_T acl_d, ssize_t *len_p);
286 SMB_ACL_T sys_acl_init(int count);
287 int sys_acl_create_entry(SMB_ACL_T *acl_p, SMB_ACL_ENTRY_T *entry_p);
288 int sys_acl_set_tag_type(SMB_ACL_ENTRY_T entry_d, SMB_ACL_TAG_T tag_type);
289 int sys_acl_set_qualifier(SMB_ACL_ENTRY_T entry_d, void *qual_p);
290 int sys_acl_set_permset(SMB_ACL_ENTRY_T entry_d, SMB_ACL_PERMSET_T permset_d);
291 int sys_acl_valid(SMB_ACL_T acl_d);
292 int sys_acl_set_file(char *name, SMB_ACL_TYPE_T type, SMB_ACL_T acl_d);
293 int sys_acl_set_fd(int fd, SMB_ACL_T acl_d);
294 int sys_acl_free_text(char *text);
295 int sys_acl_free_acl(SMB_ACL_T acl_d) ;
296 int sys_acl_free_qualifier(void *qual) ;
297 int sys_acl_get_entry( SMB_ACL_T the_acl, int entry_id, SMB_ACL_ENTRY_T *entry_p);
298 SMB_ACL_T sys_acl_get_file( const char *path_p, SMB_ACL_TYPE_T type);
299 SMB_ACL_T sys_acl_get_fd(int fd);
300 char *sys_acl_to_text( SMB_ACL_T the_acl, ssize_t *plen);
301 int sys_acl_valid( SMB_ACL_T theacl );
302 int sys_acl_set_file( char *name, SMB_ACL_TYPE_T acltype, SMB_ACL_T theacl);
303 int sys_acl_set_fd( int fd, SMB_ACL_T theacl);
304 int sys_acl_create_entry( SMB_ACL_T *acl_p, SMB_ACL_ENTRY_T *entry_p);
305 int sys_acl_get_tag_type( SMB_ACL_ENTRY_T entry_d, SMB_ACL_TAG_T *tag_type_p);
306 int sys_acl_get_permset( SMB_ACL_ENTRY_T entry_d, SMB_ACL_PERMSET_T *permset_p);
307 void *sys_acl_get_qualifier( SMB_ACL_ENTRY_T entry_d);
308 int sys_acl_clear_perms(SMB_ACL_PERMSET_T permset);
309 int sys_acl_get_perm( SMB_ACL_PERMSET_T permset, SMB_ACL_PERM_T perm);
310 int sys_acl_add_perm( SMB_ACL_PERMSET_T permset, SMB_ACL_PERM_T perm);
311 SMB_ACL_T sys_acl_init( int count);
312 int sys_acl_set_tag_type( SMB_ACL_ENTRY_T entry_d, SMB_ACL_TAG_T tag_type);
313 int sys_acl_set_qualifier( SMB_ACL_ENTRY_T entry_d, void *qual_p);
314 int sys_acl_set_permset( SMB_ACL_ENTRY_T entry_d, SMB_ACL_PERMSET_T permset_d);
315 int sys_acl_free_text(char *text);
316 int sys_acl_free_acl(SMB_ACL_T the_acl) ;
317 int sys_acl_free_qualifier(void *qual) ;
318 int sys_acl_get_entry( SMB_ACL_T theacl, int entry_id, SMB_ACL_ENTRY_T *entry_p);
319 int sys_acl_get_tag_type( SMB_ACL_ENTRY_T entry_d, SMB_ACL_TAG_T *tag_type_p);
320 int sys_acl_get_permset( SMB_ACL_ENTRY_T entry_d, SMB_ACL_PERMSET_T *permset_p);
321 void *sys_acl_get_qualifier( SMB_ACL_ENTRY_T entry_d);
322 SMB_ACL_T sys_acl_get_file( const char *path_p, SMB_ACL_TYPE_T type);
323 SMB_ACL_T sys_acl_get_fd(int fd);
324 int sys_acl_clear_perms(SMB_ACL_PERMSET_T permset);
325 int sys_acl_add_perm( SMB_ACL_PERMSET_T permset, SMB_ACL_PERM_T perm);
326 char *sys_acl_to_text( SMB_ACL_T theacl, ssize_t *plen);
327 SMB_ACL_T sys_acl_init( int count);
328 int sys_acl_create_entry( SMB_ACL_T *pacl, SMB_ACL_ENTRY_T *pentry);
329 int sys_acl_set_tag_type( SMB_ACL_ENTRY_T entry, SMB_ACL_TAG_T tagtype);
330 int sys_acl_set_qualifier( SMB_ACL_ENTRY_T entry, void *qual);
331 int sys_acl_set_permset( SMB_ACL_ENTRY_T entry, SMB_ACL_PERMSET_T permset);
332 int sys_acl_valid( SMB_ACL_T theacl );
333 int sys_acl_set_file( char *name, SMB_ACL_TYPE_T acltype, SMB_ACL_T theacl);
334 int sys_acl_set_fd( int fd, SMB_ACL_T theacl);
335 int sys_acl_get_perm( SMB_ACL_PERMSET_T permset, SMB_ACL_PERM_T perm);
336 int sys_acl_free_text(char *text);
337 int sys_acl_free_acl(SMB_ACL_T posix_acl);
338 int sys_acl_free_qualifier(void *qual);
339 int sys_acl_get_entry( SMB_ACL_T the_acl, int entry_id, SMB_ACL_ENTRY_T *entry_p);
340 int sys_acl_get_tag_type( SMB_ACL_ENTRY_T entry_d, SMB_ACL_TAG_T *tag_type_p);
341 int sys_acl_get_permset( SMB_ACL_ENTRY_T entry_d, SMB_ACL_PERMSET_T *permset_p);
342 void *sys_acl_get_qualifier( SMB_ACL_ENTRY_T entry_d);
343 SMB_ACL_T sys_acl_get_file( const char *path_p, SMB_ACL_TYPE_T type);
344 SMB_ACL_T sys_acl_get_fd(int fd);
345 int sys_acl_clear_perms(SMB_ACL_PERMSET_T permset);
346 int sys_acl_add_perm( SMB_ACL_PERMSET_T permset, SMB_ACL_PERM_T perm);
347 int sys_acl_get_perm( SMB_ACL_PERMSET_T permset, SMB_ACL_PERM_T perm);
348 char *sys_acl_to_text( SMB_ACL_T the_acl, ssize_t *plen);
349 int sys_acl_free_text(char *text);
350 SMB_ACL_T sys_acl_init( int count);
351 int sys_acl_create_entry( SMB_ACL_T *pacl, SMB_ACL_ENTRY_T *pentry);
352 int sys_acl_set_tag_type( SMB_ACL_ENTRY_T entry, SMB_ACL_TAG_T tagtype);
353 int sys_acl_set_qualifier( SMB_ACL_ENTRY_T entry, void *qual);
354 int sys_acl_set_permset( SMB_ACL_ENTRY_T entry, SMB_ACL_PERMSET_T permset);
355 int sys_acl_valid( SMB_ACL_T theacl );
356 int sys_acl_set_file( char *name, SMB_ACL_TYPE_T acltype, SMB_ACL_T theacl);
357 int sys_acl_set_fd( int fd, SMB_ACL_T theacl);
358 int sys_acl_free_acl(SMB_ACL_T the_acl) ;
359 int sys_acl_free_qualifier(void *qual) ;
361 /*The following definitions come from lib/system.c */
363 int sys_usleep(long usecs);
364 int sys_stat(const char *fname,SMB_STRUCT_STAT *sbuf);
365 int sys_fstat(int fd,SMB_STRUCT_STAT *sbuf);
366 int sys_lstat(const char *fname,SMB_STRUCT_STAT *sbuf);
367 int sys_ftruncate(int fd, SMB_OFF_T offset);
368 SMB_OFF_T sys_lseek(int fd, SMB_OFF_T offset, int whence);
369 int sys_fseek(FILE *fp, SMB_OFF_T offset, int whence);
370 SMB_OFF_T sys_ftell(FILE *fp);
371 int sys_creat(const char *path, mode_t mode);
372 int sys_open(const char *path, int oflag, mode_t mode);
373 FILE *sys_fopen(const char *path, const char *type);
374 SMB_STRUCT_DIRENT *sys_readdir(DIR *dirp);
375 int sys_waitpid(pid_t pid,int *status,int options);
376 char *sys_getwd(char *s);
377 int sys_chown(const char *fname,uid_t uid,gid_t gid);
378 int sys_chroot(const char *dname);
379 struct hostent *sys_gethostbyname(const char *name);
380 void oplock_set_capability(BOOL this_process, BOOL inherit);
381 long sys_random(void);
382 void sys_srandom(unsigned int seed);
383 int groups_max(void);
384 int sys_getgroups(int setlen, gid_t *gidset);
385 int sys_setgroups(int setlen, gid_t *gidset);
386 void sys_setpwent(void);
387 struct passwd *sys_getpwent(void);
388 void sys_endpwent(void);
389 struct passwd *sys_getpwnam(const char *name);
390 struct passwd *sys_getpwuid(uid_t uid);
391 int wsys_stat(const smb_ucs2_t *wfname,SMB_STRUCT_STAT *sbuf);
392 int wsys_lstat(const smb_ucs2_t *wfname,SMB_STRUCT_STAT *sbuf);
393 int wsys_creat(const smb_ucs2_t *wfname, mode_t mode);
394 int wsys_open(const smb_ucs2_t *wfname, int oflag, mode_t mode);
395 FILE *wsys_fopen(const smb_ucs2_t *wfname, const char *type);
396 DIR *wsys_opendir(const smb_ucs2_t *wfname);
397 smb_ucs2_t *wsys_getwd(smb_ucs2_t *s);
398 int wsys_chown(const smb_ucs2_t *wfname, uid_t uid, gid_t gid);
399 int wsys_chroot(const smb_ucs2_t *wfname);
400 pid_t sys_fork(void);
401 pid_t sys_getpid(void);
402 int sys_popen(const char *command);
403 int sys_pclose(int fd);
404 void *sys_dlopen(const char *name, int flags);
405 void *sys_dlsym(void *handle, char *symbol);
406 int sys_dlclose (void *handle);
408 /*The following definitions come from lib/talloc.c */
410 TALLOC_CTX *talloc_init(void);
411 void *talloc(TALLOC_CTX *t, size_t size);
412 void *talloc_realloc(TALLOC_CTX *t, void *ptr, size_t size);
413 void talloc_destroy_pool(TALLOC_CTX *t);
414 void talloc_destroy(TALLOC_CTX *t);
415 size_t talloc_pool_size(TALLOC_CTX *t);
416 void *talloc_zero(TALLOC_CTX *t, size_t size);
417 void *talloc_memdup(TALLOC_CTX *t, void *p, size_t size);
418 char *talloc_strdup(TALLOC_CTX *t, char *p);
420 /*The following definitions come from lib/time.c */
422 void GetTimeOfDay(struct timeval *tval);
423 void TimeInit(void);
424 int TimeDiff(time_t t);
425 struct tm *LocalTime(time_t *t);
426 time_t nt_time_to_unix(NTTIME *nt);
427 time_t interpret_long_date(char *p);
428 void unix_to_nt_time(NTTIME *nt, time_t t);
429 void put_long_date(char *p,time_t t);
430 BOOL null_mtime(time_t mtime);
431 void put_dos_date(char *buf,int offset,time_t unixdate);
432 void put_dos_date2(char *buf,int offset,time_t unixdate);
433 void put_dos_date3(char *buf,int offset,time_t unixdate);
434 time_t make_unix_date(void *date_ptr);
435 time_t make_unix_date2(void *date_ptr);
436 time_t make_unix_date3(void *date_ptr);
437 char *http_timestring(time_t t);
438 char *timestring(BOOL hires);
439 time_t get_create_time(SMB_STRUCT_STAT *st,BOOL fake_dirs);
441 /*The following definitions come from lib/ufc.c */
443 char *ufc_crypt(char *key,char *salt);
445 /*The following definitions come from lib/username.c */
447 char *get_user_home_dir(char *user);
448 BOOL map_username(char *user);
449 struct passwd *Get_Pwnam(char *user,BOOL allow_change);
450 BOOL user_in_group_list(char *user,char *gname);
451 BOOL user_in_list(char *user,char *list);
452 struct passwd *smb_getpwnam(char *user, BOOL allow_change);
454 /*The following definitions come from lib/util.c */
456 char *tmpdir(void);
457 BOOL in_group(gid_t group, gid_t current_gid, int ngroups, gid_t *groups);
458 char *Atoic(char *p, int *n, char *c);
459 char *get_numlist(char *p, uint32 **num, int *count);
460 BOOL file_exist(char *fname,SMB_STRUCT_STAT *sbuf);
461 int file_rename(char *from, char *to);
462 time_t file_modtime(char *fname);
463 BOOL directory_exist(char *dname,SMB_STRUCT_STAT *st);
464 SMB_OFF_T get_file_size(char *file_name);
465 char *attrib_string(uint16 mode);
466 void show_msg(char *buf);
467 void smb_setlen(char *buf,int len);
468 int set_message(char *buf,int num_words,int num_bytes,BOOL zero);
469 void set_message_bcc(char *buf,int num_bytes);
470 void set_message_end(void *outbuf,void *end_ptr);
471 void dos_clean_name(char *s);
472 void unix_clean_name(char *s);
473 void make_dir_struct(char *buf,char *mask,char *fname,SMB_OFF_T size,int mode,time_t date);
474 void close_low_fds(void);
475 int set_blocking(int fd, BOOL set);
476 SMB_OFF_T transfer_file(int infd,int outfd,SMB_OFF_T n,char *header,int headlen,int align);
477 void msleep(int t);
478 void become_daemon(void);
479 BOOL yesno(char *p);
480 void *Realloc(void *p,size_t size);
481 void safe_free(void *p);
482 BOOL get_myname(char *my_name);
483 int interpret_protocol(char *str,int def);
484 BOOL is_ipaddress(const char *str);
485 uint32 interpret_addr(char *str);
486 struct in_addr *interpret_addr2(char *str);
487 BOOL zero_ip(struct in_addr ip);
488 char *automount_lookup(char *user_name);
489 char *automount_lookup(char *user_name);
490 BOOL same_net(struct in_addr ip1,struct in_addr ip2,struct in_addr mask);
491 struct hostent *Get_Hostbyname(const char *name);
492 BOOL process_exists(pid_t pid);
493 char *uidtoname(uid_t uid);
494 char *gidtoname(gid_t gid);
495 uid_t nametouid(char *name);
496 gid_t nametogid(char *name);
497 void smb_panic(char *why);
498 char *readdirname(DIR *p);
499 BOOL is_in_path(char *name, name_compare_entry *namelist);
500 void set_namearray(name_compare_entry **ppname_array, char *namelist);
501 void free_namearray(name_compare_entry *name_array);
502 BOOL fcntl_lock(int fd, int op, SMB_OFF_T offset, SMB_OFF_T count, int type);
503 BOOL is_myname(char *s);
504 void set_remote_arch(enum remote_arch_types type);
505 enum remote_arch_types get_remote_arch(void);
506 void out_ascii(FILE *f, unsigned char *buf,int len);
507 void out_data(FILE *f,char *buf1,int len, int per_line);
508 void print_asc(int level, unsigned char *buf,int len);
509 void dump_data(int level,char *buf1,int len);
510 char *tab_depth(int depth);
511 int str_checksum(const char *s);
512 void zero_free(void *p, size_t size);
513 int set_maxfiles(int requested_max);
514 BOOL reg_split_key(char *full_keyname, uint32 *reg_type, char *key_name);
515 int smb_mkstemp(char *template);
516 void *memdup(void *p, size_t size);
517 char *myhostname(void);
518 char *lock_path(char *name);
519 char *parent_dirname(const char *path);
520 BOOL ms_has_wild(char *s);
521 BOOL mask_match(char *string, char *pattern, BOOL is_case_sensitive);
522 int _Insure_trap_error(int a1, int a2, int a3, int a4, int a5, int a6);
524 /*The following definitions come from lib/util_array.c */
526 void free_void_array(uint32 num_entries, void **entries,
527 void(free_item)(void*));
528 void* add_copy_to_array(uint32 *len, void ***array, const void *item,
529 void*(item_dup)(const void*), BOOL alloc_anyway);
530 void* add_item_to_array(uint32 *len, void ***array, void *item);
531 void free_use_info_array(uint32 num_entries, struct use_info **entries);
532 struct use_info* add_use_info_to_array(uint32 *len, struct use_info ***array,
533 const struct use_info *name);
534 void free_char_array(uint32 num_entries, char **entries);
535 char* add_chars_to_array(uint32 *len, char ***array, const char *name);
536 void free_uint32_array(uint32 num_entries, uint32 **entries);
537 uint32* add_uint32s_to_array(uint32 *len, uint32 ***array, const uint32 *name);
538 void free_sid_array(uint32 num_entries, DOM_SID **entries);
539 DOM_SID* add_sid_to_array(uint32 *len, DOM_SID ***array, const DOM_SID *sid);
541 /*The following definitions come from lib/util_file.c */
543 BOOL do_file_lock(int fd, int waitsecs, int type);
544 BOOL file_lock(int fd, int type, int secs, int *plock_depth);
545 BOOL file_unlock(int fd, int *plock_depth);
546 void *startfilepwent(char *pfile, char *s_readbuf, int bufsize,
547 int *file_lock_depth, BOOL update);
548 void endfilepwent(void *vp, int *file_lock_depth);
549 SMB_BIG_UINT getfilepwpos(void *vp);
550 BOOL setfilepwpos(void *vp, SMB_BIG_UINT tok);
551 int getfileline(void *vp, char *linebuf, int linebuf_size);
552 char *fgets_slash(char *s2,int maxlen,FILE *f);
553 char *file_pload(char *syscmd, size_t *size);
554 char *fd_load(int fd, size_t *size);
555 char *file_load(char *fname, size_t *size);
556 char **file_lines_load(char *fname, int *numlines, BOOL convert);
557 char **fd_lines_load(int fd, int *numlines, BOOL convert);
558 char **file_lines_pload(char *syscmd, int *numlines, BOOL convert);
559 void file_lines_free(char **lines);
560 void file_lines_slashcont(char **lines);
562 /*The following definitions come from lib/util_list.c */
564 BOOL copy_policy_hnd (POLICY_HND *dest, const POLICY_HND *src);
565 BOOL compare_rpc_hnd_node(const RPC_HND_NODE *x,
566 const RPC_HND_NODE *y);
567 BOOL RpcHndList_set_connection(const POLICY_HND *hnd,
568 struct cli_connection *con);
569 BOOL RpcHndList_del_connection(const POLICY_HND *hnd);
570 struct cli_connection* RpcHndList_get_connection(const POLICY_HND *hnd);
572 /*The following definitions come from lib/util_seaccess.c */
574 void se_map_generic(uint32 *access_mask, struct generic_mapping *mapping);
575 BOOL se_access_check(SEC_DESC *sd, struct current_user *user,
576 uint32 acc_desired, uint32 *acc_granted, uint32 *status);
577 SEC_DESC_BUF *se_create_child_secdesc(TALLOC_CTX *ctx, SEC_DESC *parent_ctr,
578 BOOL child_container);
580 /*The following definitions come from lib/util_sec.c */
582 void gain_root_privilege(void);
583 void gain_root_group_privilege(void);
584 void set_effective_uid(uid_t uid);
585 void set_effective_gid(gid_t gid);
586 void save_re_uid(void);
587 void restore_re_uid(void);
588 int set_re_uid(void);
589 void become_user_permanently(uid_t uid, gid_t gid);
591 /*The following definitions come from lib/util_sid.c */
593 void generate_wellknown_sids(void);
594 BOOL map_domain_sid_to_name(DOM_SID *sid, char *nt_domain);
595 BOOL lookup_known_rid(DOM_SID *sid, uint32 rid, char *name, enum SID_NAME_USE *psid_name_use);
596 BOOL map_domain_name_to_sid(DOM_SID *sid, char *nt_domain);
597 void split_domain_name(const char *fullname, char *domain, char *name);
598 char *sid_to_string(fstring sidstr_out, DOM_SID *sid);
599 BOOL string_to_sid(DOM_SID *sidout, char *sidstr);
600 BOOL sid_append_rid(DOM_SID *sid, uint32 rid);
601 BOOL sid_split_rid(DOM_SID *sid, uint32 *rid);
602 BOOL sid_peek_rid(DOM_SID *sid, uint32 *rid);
603 void sid_copy(DOM_SID *dst, const DOM_SID *src);
604 DOM_SID *sid_dup(DOM_SID *src);
605 BOOL sid_linearize(char *outbuf, size_t len, DOM_SID *sid);
606 int sid_compare(const DOM_SID *sid1, const DOM_SID *sid2);
607 BOOL sid_equal(const DOM_SID *sid1, const DOM_SID *sid2);
608 size_t sid_size(DOM_SID *sid);
610 /*The following definitions come from lib/util_sock.c */
612 BOOL is_a_socket(int fd);
613 void set_socket_options(int fd, char *options);
614 ssize_t read_udp_socket(int fd,char *buf,size_t len);
615 ssize_t read_with_timeout(int fd,char *buf,size_t mincnt,size_t maxcnt,unsigned int time_out);
616 BOOL send_keepalive(int client);
617 ssize_t read_data(int fd,char *buffer,size_t N);
618 ssize_t write_data(int fd,char *buffer,size_t N);
619 ssize_t write_socket_data(int fd,char *buffer,size_t N);
620 ssize_t write_socket(int fd,char *buf,size_t len);
621 ssize_t read_smb_length(int fd,char *inbuf,unsigned int timeout);
622 BOOL receive_smb(int fd,char *buffer, unsigned int timeout);
623 BOOL client_receive_smb(int fd,char *buffer, unsigned int timeout);
624 BOOL send_null_session_msg(int fd);
625 BOOL send_smb(int fd,char *buffer);
626 BOOL send_one_packet(char *buf,int len,struct in_addr ip,int port,int type);
627 int open_socket_in(int type, int port, int dlevel,uint32 socket_addr, BOOL rebind);
628 int open_socket_out(int type, struct in_addr *addr, int port ,int timeout);
629 void reset_globals_after_fork(void);
630 void client_setfd(int fd);
631 char *client_name(void);
632 char *client_addr(void);
633 char *get_socket_name(int fd);
634 char *get_socket_addr(int fd);
635 int open_pipe_sock(char *path);
636 int create_pipe_socket(char *dir, int dir_perms,
637 char *path, int path_perms);
639 /*The following definitions come from lib/util_str.c */
641 void set_first_token(char *ptr);
642 BOOL next_token(char **ptr,char *buff,char *sep, size_t bufsize);
643 char **toktocliplist(int *ctok, char *sep);
644 int StrCaseCmp(const char *s, const char *t);
645 int StrnCaseCmp(const char *s, const char *t, size_t n);
646 BOOL strequal(const char *s1, const char *s2);
647 BOOL strnequal(const char *s1,const char *s2,size_t n);
648 BOOL strcsequal(const char *s1,const char *s2);
649 int strwicmp(char *psz1, char *psz2);
650 void strlower(char *s);
651 void strupper(char *s);
652 void strnorm(char *s);
653 BOOL strisnormal(char *s);
654 void string_replace(char *s,char oldc,char newc);
655 char *skip_string(char *buf,size_t n);
656 size_t str_charnum(const char *s);
657 BOOL trim_string(char *s,const char *front,const char *back);
658 BOOL strhasupper(const char *s);
659 BOOL strhaslower(const char *s);
660 size_t count_chars(const char *s,char c);
661 BOOL str_is_all(const char *s,char c);
662 char *safe_strcpy(char *dest,const char *src, size_t maxlength);
663 char *safe_strcat(char *dest, const char *src, size_t maxlength);
664 char *alpha_strcpy(char *dest, const char *src, size_t maxlength);
665 char *StrnCpy(char *dest,const char *src,size_t n);
666 char *strncpyn(char *dest, const char *src,size_t n, char c);
667 size_t strhex_to_str(char *p, size_t len, const char *strhex);
668 BOOL in_list(char *s,char *list,BOOL casesensitive);
669 void string_free(char **s);
670 BOOL string_set(char **dest,const char *src);
671 void string_sub(char *s,const char *pattern,const char *insert, size_t len);
672 void fstring_sub(char *s,const char *pattern,const char *insert);
673 void pstring_sub(char *s,const char *pattern,const char *insert);
674 void all_string_sub(char *s,const char *pattern,const char *insert, size_t len);
675 void split_at_last_component(char *path, char *front, char sep, char *back);
676 char *octal_string(int i);
677 char *string_truncate(char *s, int length);
679 /*The following definitions come from lib/util_unistr.c */
681 size_t dos_PutUniCode(char *dst,const char *src, ssize_t len, BOOL null_terminate);
682 void unistr_to_dos(char *dest, const char *src, size_t len);
683 char *skip_unibuf(char *src, size_t len);
684 char *dos_unistrn2(uint16 *src, int len);
685 char *dos_unistr2(uint16 *src);
686 char *dos_unistr2_to_str(UNISTR2 *str);
687 void ascii_to_unistr(uint16 *dest, const char *src, int maxlen);
688 void unistr_to_ascii(char *dest, const uint16 *src, int len);
689 void unistr2_to_ascii(char *dest, const UNISTR2 *str, size_t maxlen);
690 uint32 buffer2_to_uint32(BUFFER2 *str);
691 char *dos_buffer2_to_str(BUFFER2 *str);
692 char *dos_buffer2_to_multistr(BUFFER2 *str);
693 size_t dos_struni2(char *dst, const char *src, size_t max_len);
694 char *dos_unistr(char *buf);
695 int unistrcpy(char *dst, char *src);
696 void default_unicode_map(smb_ucs2_t **pp_cp_to_ucs2, uint16 **pp_ucs2_to_cp);
697 BOOL load_unicode_map(const char *codepage, smb_ucs2_t **pp_cp_to_ucs2, uint16 **pp_ucs2_to_cp);
698 BOOL load_dos_unicode_map(int codepage);
699 BOOL load_unix_unicode_map(const char *unix_char_set);
700 smb_ucs2_t *multibyte_to_unicode(smb_ucs2_t *dst, const char *src,
701 size_t dst_len, smb_ucs2_t *cp_to_ucs2);
702 char *unicode_to_unix(char *dst, const smb_ucs2_t *src, size_t dst_len);
703 smb_ucs2_t *unix_to_unicode(smb_ucs2_t *dst, const char *src, size_t dst_len);
704 char *unicode_to_dos(char *dst, const smb_ucs2_t *src, size_t dst_len);
705 size_t unicode_to_dos_char(char *dst, const smb_ucs2_t src);
706 smb_ucs2_t *dos_to_unicode(smb_ucs2_t *dst, const char *src, size_t dst_len);
707 size_t strlen_w(const smb_ucs2_t *src);
708 smb_ucs2_t *safe_strcpy_w(smb_ucs2_t *dest,const smb_ucs2_t *src, size_t maxlength);
709 smb_ucs2_t *safe_strcat_w(smb_ucs2_t *dest, const smb_ucs2_t *src, size_t maxlength);
710 int strcmp_w(const smb_ucs2_t *s1, const smb_ucs2_t *s2);
711 int strncmp_w(const smb_ucs2_t *s1, const smb_ucs2_t *s2, size_t len);
712 smb_ucs2_t *strstr_w(const smb_ucs2_t *s1, const smb_ucs2_t *s2);
713 smb_ucs2_t *strchr_w(const smb_ucs2_t *s, smb_ucs2_t c);
714 smb_ucs2_t *strrchr_w(const smb_ucs2_t *s, smb_ucs2_t c);
715 smb_ucs2_t *strtok_w(smb_ucs2_t *s1, const smb_ucs2_t *s2);
716 smb_ucs2_t *strdup_w(const smb_ucs2_t *s);
717 int isupper_w( smb_ucs2_t val);
718 int islower_w( smb_ucs2_t val);
719 int isdigit_w( smb_ucs2_t val);
720 int isxdigit_w( smb_ucs2_t val);
721 int isspace_w( smb_ucs2_t val);
722 smb_ucs2_t toupper_w( smb_ucs2_t val );
723 smb_ucs2_t tolower_w( smb_ucs2_t val );
724 void set_first_token_w(smb_ucs2_t *ptr);
725 BOOL next_token_w(smb_ucs2_t **ptr, smb_ucs2_t *buff, smb_ucs2_t *sep, size_t bufsize);
726 smb_ucs2_t **toktocliplist_w(int *ctok, smb_ucs2_t *sep);
727 int StrCaseCmp_w(const smb_ucs2_t *s, const smb_ucs2_t *t);
728 int StrnCaseCmp_w(const smb_ucs2_t *s, const smb_ucs2_t *t, size_t n);
729 BOOL strequal_w(const smb_ucs2_t *s1, const smb_ucs2_t *s2);
730 BOOL strnequal_w(const smb_ucs2_t *s1,const smb_ucs2_t *s2,size_t n);
731 BOOL strcsequal_w(const smb_ucs2_t *s1,const smb_ucs2_t *s2);
732 void strlower_w(smb_ucs2_t *s);
733 void strupper_w(smb_ucs2_t *s);
734 void strnorm_w(smb_ucs2_t *s);
735 BOOL strisnormal_w(smb_ucs2_t *s);
736 void string_replace_w(smb_ucs2_t *s, smb_ucs2_t oldc, smb_ucs2_t newc);
737 smb_ucs2_t *skip_string_w(smb_ucs2_t *buf,size_t n);
738 size_t str_charnum_w(const smb_ucs2_t *s);
739 BOOL trim_string_w(smb_ucs2_t *s,const smb_ucs2_t *front,const smb_ucs2_t *back);
740 BOOL strhasupper_w(const smb_ucs2_t *s);
741 BOOL strhaslower_w(const smb_ucs2_t *s);
742 size_t count_chars_w(const smb_ucs2_t *s,smb_ucs2_t c);
743 BOOL str_is_all_w(const smb_ucs2_t *s,smb_ucs2_t c);
744 smb_ucs2_t *alpha_strcpy_w(smb_ucs2_t *dest, const smb_ucs2_t *src, size_t maxlength);
745 smb_ucs2_t *StrnCpy_w(smb_ucs2_t *dest,const smb_ucs2_t *src,size_t n);
746 smb_ucs2_t *strncpyn_w(smb_ucs2_t *dest, const smb_ucs2_t *src,size_t n, smb_ucs2_t c);
747 size_t strhex_to_str_w(char *p, size_t len, const smb_ucs2_t *strhex);
748 BOOL in_list_w(smb_ucs2_t *s,smb_ucs2_t *list,BOOL casesensitive);
749 BOOL string_init_w(smb_ucs2_t **dest,const smb_ucs2_t *src);
750 void string_free_w(smb_ucs2_t **s);
751 BOOL string_set_w(smb_ucs2_t **dest,const smb_ucs2_t *src);
752 void string_sub_w(smb_ucs2_t *s,const smb_ucs2_t *pattern,const smb_ucs2_t *insert, size_t len);
753 void fstring_sub_w(smb_ucs2_t *s,const smb_ucs2_t *pattern,const smb_ucs2_t *insert);
754 void pstring_sub_w(smb_ucs2_t *s,const smb_ucs2_t *pattern,smb_ucs2_t *insert);
755 void all_string_sub_w(smb_ucs2_t *s,const smb_ucs2_t *pattern,const smb_ucs2_t *insert, size_t len);
756 void split_at_last_component_w(smb_ucs2_t *path, smb_ucs2_t *front, smb_ucs2_t sep, smb_ucs2_t *back);
757 smb_ucs2_t *octal_string_w(int i);
758 smb_ucs2_t *string_truncate_w(smb_ucs2_t *s, size_t length);
759 smb_ucs2_t doscp2ucs2(int w);
760 int ucs2doscp(smb_ucs2_t w);
762 /*The following definitions come from lib/wins_srv.c */
764 BOOL wins_srv_load_list( char *src );
765 struct in_addr wins_srv_ip( void );
766 void wins_srv_died( struct in_addr boothill_ip );
767 unsigned long wins_srv_count( void );
769 /*The following definitions come from libsmb/cli_lsarpc.c */
771 struct cli_state *cli_lsa_initialise(struct cli_state *cli, char *system_name,
772 struct ntuser_creds *creds);
773 void cli_lsa_shutdown(struct cli_state *cli);
774 uint32 cli_lsa_open_policy(struct cli_state *cli, TALLOC_CTX *mem_ctx,
775 BOOL sec_qos, uint32 des_access, POLICY_HND *pol);
776 uint32 cli_lsa_close(struct cli_state *cli, TALLOC_CTX *mem_ctx,
777 POLICY_HND *pol);
778 uint32 cli_lsa_lookup_sids(struct cli_state *cli, TALLOC_CTX *mem_ctx,
779 POLICY_HND *pol, int num_sids, DOM_SID *sids,
780 char ***names, uint32 **types, int *num_names);
781 uint32 cli_lsa_lookup_names(struct cli_state *cli, TALLOC_CTX *mem_ctx,
782 POLICY_HND *pol, int num_names, char **names,
783 DOM_SID **sids, uint32 **types, int *num_sids);
784 uint32 cli_lsa_query_info_policy(struct cli_state *cli, TALLOC_CTX *mem_ctx,
785 POLICY_HND *pol, uint16 info_class,
786 fstring domain_name, DOM_SID *domain_sid);
787 uint32 cli_lsa_enum_trust_dom(struct cli_state *cli, TALLOC_CTX *mem_ctx,
788 POLICY_HND *pol, uint32 *enum_ctx,
789 uint32 *num_domains, char ***domain_names,
790 DOM_SID **domain_sids);
792 /*The following definitions come from libsmb/cli_samr.c */
794 struct cli_state *cli_samr_initialise(struct cli_state *cli, char *system_name,
795 struct ntuser_creds *creds);
796 void cli_samr_shutdown(struct cli_state *cli);
797 uint32 cli_samr_connect(struct cli_state *cli, TALLOC_CTX *mem_ctx,
798 char *srv_name, uint32 access_mask,
799 POLICY_HND *connect_pol);
800 uint32 cli_samr_close(struct cli_state *cli, TALLOC_CTX *mem_ctx,
801 POLICY_HND *connect_pol);
802 uint32 cli_samr_open_domain(struct cli_state *cli, TALLOC_CTX *mem_ctx,
803 POLICY_HND *connect_pol, uint32 access_mask,
804 DOM_SID *domain_sid, POLICY_HND *domain_pol);
805 uint32 cli_samr_open_user(struct cli_state *cli, TALLOC_CTX *mem_ctx,
806 POLICY_HND *domain_pol, uint32 access_mask,
807 uint32 user_rid, POLICY_HND *user_pol);
808 uint32 cli_samr_open_group(struct cli_state *cli, TALLOC_CTX *mem_ctx,
809 POLICY_HND *domain_pol, uint32 access_mask,
810 uint32 group_rid, POLICY_HND *group_pol);
811 uint32 cli_samr_query_userinfo(struct cli_state *cli, TALLOC_CTX *mem_ctx,
812 POLICY_HND *user_pol, uint16 switch_value,
813 SAM_USERINFO_CTR *ctr);
814 uint32 cli_samr_query_groupinfo(struct cli_state *cli, TALLOC_CTX *mem_ctx,
815 POLICY_HND *group_pol, uint32 info_level,
816 GROUP_INFO_CTR *ctr);
817 uint32 cli_samr_query_usergroups(struct cli_state *cli, TALLOC_CTX *mem_ctx,
818 POLICY_HND *user_pol, uint32 *num_groups,
819 DOM_GID **gid);
820 uint32 cli_samr_query_groupmem(struct cli_state *cli, TALLOC_CTX *mem_ctx,
821 POLICY_HND *group_pol, uint32 *num_mem,
822 uint32 **rid, uint32 **attr);
823 uint32 cli_samr_enum_dom_groups(struct cli_state *cli, TALLOC_CTX *mem_ctx,
824 POLICY_HND *pol, uint32 *start_idx,
825 uint32 size, struct acct_info **dom_groups,
826 uint32 *num_dom_groups);
827 uint32 cli_samr_query_aliasmem(struct cli_state *cli, TALLOC_CTX *mem_ctx,
828 POLICY_HND *alias_pol, uint32 *num_mem,
829 DOM_SID **sids);
830 uint32 cli_samr_open_alias(struct cli_state *cli, TALLOC_CTX *mem_ctx,
831 POLICY_HND *domain_pol, uint32 access_mask,
832 uint32 alias_rid, POLICY_HND *alias_pol);
833 uint32 cli_samr_query_dom_info(struct cli_state *cli, TALLOC_CTX *mem_ctx,
834 POLICY_HND *domain_pol, uint16 switch_value,
835 SAM_UNK_CTR *ctr);
836 uint32 cli_samr_query_dispinfo(struct cli_state *cli, TALLOC_CTX *mem_ctx,
837 POLICY_HND *domain_pol, uint32 *start_idx,
838 uint16 switch_value, uint32 *num_entries,
839 uint32 max_entries, SAM_DISPINFO_CTR *ctr);
840 uint32 cli_samr_lookup_rids(struct cli_state *cli, TALLOC_CTX *mem_ctx,
841 POLICY_HND *domain_pol, uint32 flags,
842 uint32 num_rids, uint32 *rids,
843 uint32 *num_names, char ***names,
844 uint32 **name_types);
846 /*The following definitions come from libsmb/cli_spoolss.c */
848 struct cli_state *cli_spoolss_initialise(struct cli_state *cli,
849 char *system_name,
850 struct ntuser_creds *creds);
851 void cli_spoolss_shutdown(struct cli_state *cli);
852 uint32 cli_spoolss_open_printer_ex(
853 struct cli_state *cli,
854 TALLOC_CTX *mem_ctx,
855 char *printername,
856 char *datatype,
857 uint32 access_required,
858 char *station,
859 char *username,
860 POLICY_HND *pol
862 uint32 cli_spoolss_close_printer(
863 struct cli_state *cli,
864 TALLOC_CTX *mem_ctx,
865 POLICY_HND *pol
867 uint32 cli_spoolss_enum_printers(
868 struct cli_state *cli,
869 TALLOC_CTX *mem_ctx,
870 uint32 flags,
871 uint32 level,
872 int *returned,
873 PRINTER_INFO_CTR *ctr
875 uint32 cli_spoolss_enum_ports(
876 struct cli_state *cli,
877 TALLOC_CTX *mem_ctx,
878 uint32 level,
879 int *returned,
880 PORT_INFO_CTR *ctr
882 uint32 cli_spoolss_getprinter(
883 struct cli_state *cli,
884 TALLOC_CTX *mem_ctx,
885 POLICY_HND *pol,
886 uint32 level,
887 PRINTER_INFO_CTR *ctr
889 uint32 cli_spoolss_setprinter(
890 struct cli_state *cli,
891 TALLOC_CTX *mem_ctx,
892 POLICY_HND *pol,
893 uint32 level,
894 PRINTER_INFO_CTR *ctr,
895 uint32 command
897 uint32 cli_spoolss_getprinterdriver (
898 struct cli_state *cli,
899 TALLOC_CTX *mem_ctx,
900 POLICY_HND *pol,
901 uint32 level,
902 char* env,
903 PRINTER_DRIVER_CTR *ctr
905 uint32 cli_spoolss_enumprinterdrivers (
906 struct cli_state *cli,
907 TALLOC_CTX *mem_ctx,
908 uint32 level,
909 char* env,
910 uint32 *returned,
911 PRINTER_DRIVER_CTR *ctr
913 uint32 cli_spoolss_getprinterdriverdir (
914 struct cli_state *cli,
915 TALLOC_CTX *mem_ctx,
916 uint32 level,
917 char* env,
918 DRIVER_DIRECTORY_CTR *ctr
920 uint32 cli_spoolss_addprinterdriver (
921 struct cli_state *cli,
922 TALLOC_CTX *mem_ctx,
923 uint32 level,
924 PRINTER_DRIVER_CTR *ctr
926 uint32 cli_spoolss_addprinterex (
927 struct cli_state *cli,
928 TALLOC_CTX *mem_ctx,
929 uint32 level,
930 PRINTER_INFO_CTR *ctr
933 /*The following definitions come from libsmb/cliconnect.c */
935 BOOL cli_session_setup(struct cli_state *cli,
936 char *user,
937 char *pass, int passlen,
938 char *ntpass, int ntpasslen,
939 char *workgroup);
940 BOOL cli_ulogoff(struct cli_state *cli);
941 BOOL cli_send_tconX(struct cli_state *cli,
942 char *share, char *dev, char *pass, int passlen);
943 BOOL cli_tdis(struct cli_state *cli);
944 void cli_negprot_send(struct cli_state *cli);
945 BOOL cli_negprot(struct cli_state *cli);
946 BOOL cli_session_request(struct cli_state *cli,
947 struct nmb_name *calling, struct nmb_name *called);
948 BOOL cli_connect(struct cli_state *cli, const char *host, struct in_addr *ip);
949 BOOL cli_reestablish_connection(struct cli_state *cli);
950 BOOL cli_establish_connection(struct cli_state *cli,
951 char *dest_host, struct in_addr *dest_ip,
952 struct nmb_name *calling, struct nmb_name *called,
953 char *service, char *service_type,
954 BOOL do_shutdown, BOOL do_tcon);
955 BOOL attempt_netbios_session_request(struct cli_state *cli, char *srchost, char *desthost,
956 struct in_addr *pdest_ip);
958 /*The following definitions come from libsmb/clidgram.c */
960 int cli_send_mailslot(int dgram_sock, BOOL unique, char *mailslot,
961 char *buf, int len,
962 const char *srcname, int src_type,
963 const char *dstname, int dest_type,
964 struct in_addr dest_ip, struct in_addr src_ip,
965 int dest_port, int src_port);
966 int cli_get_response(int dgram_sock, BOOL unique, char *mailslot, char *buf, int bufsiz);
967 int cli_get_backup_list(const char *myname, const char *send_to_name);
968 int cli_get_backup_server(char *my_name, char *target, char *servername, int namesize);
970 /*The following definitions come from libsmb/clientgen.c */
972 int cli_set_port(struct cli_state *cli, int port);
973 BOOL cli_receive_smb(struct cli_state *cli);
974 BOOL cli_send_smb(struct cli_state *cli);
975 void cli_setup_packet(struct cli_state *cli);
976 void cli_setup_bcc(struct cli_state *cli, void *p);
977 void cli_init_creds(struct cli_state *cli, const struct ntuser_creds *usr);
978 struct cli_state *cli_initialise(struct cli_state *cli);
979 void cli_shutdown(struct cli_state *cli);
980 void cli_sockopt(struct cli_state *cli, char *options);
981 uint16 cli_setpid(struct cli_state *cli, uint16 pid);
983 /*The following definitions come from libsmb/clierror.c */
985 char *cli_errstr(struct cli_state *cli);
986 int cli_error(struct cli_state *cli, uint8 *eclass, uint32 *num, uint32 *nt_rpc_error);
988 /*The following definitions come from libsmb/clifile.c */
990 BOOL cli_rename(struct cli_state *cli, char *fname_src, char *fname_dst);
991 BOOL cli_unlink(struct cli_state *cli, char *fname);
992 BOOL cli_mkdir(struct cli_state *cli, char *dname);
993 BOOL cli_rmdir(struct cli_state *cli, char *dname);
994 int cli_nt_delete_on_close(struct cli_state *cli, int fnum, BOOL flag);
995 int cli_nt_create_full(struct cli_state *cli, char *fname, uint32 DesiredAccess,
996 uint32 FileAttributes, uint32 ShareAccess,
997 uint32 CreateDisposition, uint32 CreateOptions);
998 int cli_nt_create(struct cli_state *cli, char *fname, uint32 DesiredAccess);
999 int cli_open(struct cli_state *cli, char *fname, int flags, int share_mode);
1000 BOOL cli_close(struct cli_state *cli, int fnum);
1001 BOOL cli_lock(struct cli_state *cli, int fnum,
1002 uint32 offset, uint32 len, int timeout, enum brl_type lock_type);
1003 BOOL cli_unlock(struct cli_state *cli, int fnum, uint32 offset, uint32 len);
1004 BOOL cli_lock64(struct cli_state *cli, int fnum,
1005 SMB_BIG_UINT offset, SMB_BIG_UINT len, int timeout, enum brl_type lock_type);
1006 BOOL cli_unlock64(struct cli_state *cli, int fnum, SMB_BIG_UINT offset, SMB_BIG_UINT len);
1007 BOOL cli_getattrE(struct cli_state *cli, int fd,
1008 uint16 *attr, size_t *size,
1009 time_t *c_time, time_t *a_time, time_t *m_time);
1010 BOOL cli_getatr(struct cli_state *cli, char *fname,
1011 uint16 *attr, size_t *size, time_t *t);
1012 BOOL cli_setatr(struct cli_state *cli, char *fname, uint16 attr, time_t t);
1013 BOOL cli_chkpath(struct cli_state *cli, char *path);
1014 BOOL cli_dskattr(struct cli_state *cli, int *bsize, int *total, int *avail);
1015 int cli_ctemp(struct cli_state *cli, char *path, char **tmp_path);
1017 /*The following definitions come from libsmb/clilist.c */
1019 int cli_list_new(struct cli_state *cli,const char *Mask,uint16 attribute,
1020 void (*fn)(file_info *, const char *, void *), void *state);
1021 int cli_list_old(struct cli_state *cli,const char *Mask,uint16 attribute,
1022 void (*fn)(file_info *, const char *, void *), void *state);
1023 int cli_list(struct cli_state *cli,const char *Mask,uint16 attribute,
1024 void (*fn)(file_info *, const char *, void *), void *state);
1026 /*The following definitions come from libsmb/climessage.c */
1028 BOOL cli_message_start(struct cli_state *cli, char *host, char *username,
1029 int *grp);
1030 BOOL cli_message_text(struct cli_state *cli, char *msg, int len, int grp);
1031 BOOL cli_message_end(struct cli_state *cli, int grp);
1033 /*The following definitions come from libsmb/cliprint.c */
1035 int cli_print_queue(struct cli_state *cli,
1036 void (*fn)(struct print_job_info *));
1037 int cli_printjob_del(struct cli_state *cli, int job);
1039 /*The following definitions come from libsmb/clirap.c */
1041 BOOL cli_api_pipe(struct cli_state *cli, char *pipe_name,
1042 uint16 *setup, uint32 setup_count, uint32 max_setup_count,
1043 char *params, uint32 param_count, uint32 max_param_count,
1044 char *data, uint32 data_count, uint32 max_data_count,
1045 char **rparam, uint32 *rparam_count,
1046 char **rdata, uint32 *rdata_count);
1047 BOOL cli_api(struct cli_state *cli,
1048 char *param, int prcnt, int mprcnt,
1049 char *data, int drcnt, int mdrcnt,
1050 char **rparam, int *rprcnt,
1051 char **rdata, int *rdrcnt);
1052 BOOL cli_NetWkstaUserLogon(struct cli_state *cli,char *user, char *workstation);
1053 int cli_RNetShareEnum(struct cli_state *cli, void (*fn)(const char *, uint32, const char *, void *), void *state);
1054 BOOL cli_NetServerEnum(struct cli_state *cli, char *workgroup, uint32 stype,
1055 void (*fn)(const char *, uint32, const char *, void *),
1056 void *state);
1057 BOOL cli_oem_change_password(struct cli_state *cli, const char *user, const char *new_password,
1058 const char *old_password);
1059 BOOL cli_qpathinfo(struct cli_state *cli, const char *fname,
1060 time_t *c_time, time_t *a_time, time_t *m_time,
1061 size_t *size, uint16 *mode);
1062 BOOL cli_qpathinfo2(struct cli_state *cli, const char *fname,
1063 time_t *c_time, time_t *a_time, time_t *m_time,
1064 time_t *w_time, size_t *size, uint16 *mode,
1065 SMB_INO_T *ino);
1066 BOOL cli_qfileinfo(struct cli_state *cli, int fnum,
1067 uint16 *mode, size_t *size,
1068 time_t *c_time, time_t *a_time, time_t *m_time,
1069 time_t *w_time, SMB_INO_T *ino);
1071 /*The following definitions come from libsmb/clireadwrite.c */
1073 size_t cli_read(struct cli_state *cli, int fnum, char *buf, off_t offset, size_t size);
1074 ssize_t cli_write(struct cli_state *cli,
1075 int fnum, uint16 write_mode,
1076 char *buf, off_t offset, size_t size);
1077 ssize_t cli_smbwrite(struct cli_state *cli,
1078 int fnum, char *buf, off_t offset, size_t size1);
1080 /*The following definitions come from libsmb/clisecdesc.c */
1082 SEC_DESC *cli_query_secdesc(struct cli_state *cli,int fd, TALLOC_CTX *mem_ctx);
1083 BOOL cli_set_secdesc(struct cli_state *cli,int fd, SEC_DESC *sd);
1085 /*The following definitions come from libsmb/clistr.c */
1087 int clistr_push(struct cli_state *cli, void *dest, const char *src, int dest_len, int flags);
1088 int clistr_pull(struct cli_state *cli, char *dest, const void *src, int dest_len, int src_len, int flags);
1089 int clistr_align(const void *buf, const void *p);
1091 /*The following definitions come from libsmb/clitrans.c */
1093 BOOL cli_send_trans(struct cli_state *cli, int trans,
1094 char *pipe_name,
1095 int fid, int flags,
1096 uint16 *setup, int lsetup, int msetup,
1097 char *param, int lparam, int mparam,
1098 char *data, int ldata, int mdata);
1099 BOOL cli_receive_trans(struct cli_state *cli,int trans,
1100 char **param, int *param_len,
1101 char **data, int *data_len);
1102 BOOL cli_send_nt_trans(struct cli_state *cli,
1103 int function,
1104 int flags,
1105 uint16 *setup, int lsetup, int msetup,
1106 char *param, int lparam, int mparam,
1107 char *data, int ldata, int mdata);
1108 BOOL cli_receive_nt_trans(struct cli_state *cli,
1109 char **param, int *param_len,
1110 char **data, int *data_len);
1112 /*The following definitions come from libsmb/credentials.c */
1114 char *credstr(uchar *cred);
1115 void cred_session_key(DOM_CHAL *clnt_chal, DOM_CHAL *srv_chal, char *pass,
1116 uchar session_key[8]);
1117 void cred_create(uchar session_key[8], DOM_CHAL *stor_cred, UTIME timestamp,
1118 DOM_CHAL *cred);
1119 int cred_assert(DOM_CHAL *cred, uchar session_key[8], DOM_CHAL *stored_cred,
1120 UTIME timestamp);
1121 BOOL clnt_deal_with_creds(uchar sess_key[8],
1122 DOM_CRED *sto_clnt_cred, DOM_CRED *rcv_srv_cred);
1123 BOOL deal_with_creds(uchar sess_key[8],
1124 DOM_CRED *sto_clnt_cred,
1125 DOM_CRED *rcv_clnt_cred, DOM_CRED *rtn_srv_cred);
1127 /*The following definitions come from libsmb/namequery.c */
1129 struct node_status *name_status_query(int fd,struct nmb_name *name,
1130 struct in_addr to_ip, int *num_names);
1131 BOOL name_status_find(int type, struct in_addr to_ip, char *name);
1132 BOOL name_register(int fd, const char *name, int name_type,
1133 struct in_addr name_ip, int opcode,
1134 BOOL bcast,
1135 struct in_addr to_ip, int *count);
1136 struct in_addr *name_query(int fd,const char *name,int name_type,
1137 BOOL bcast,BOOL recurse,
1138 struct in_addr to_ip, int *count);
1139 FILE *startlmhosts(char *fname);
1140 BOOL getlmhostsent( FILE *fp, pstring name, int *name_type, struct in_addr *ipaddr);
1141 void endlmhosts(FILE *fp);
1142 BOOL name_register_wins(const char *name, int name_type);
1143 BOOL name_resolve_bcast(const char *name, int name_type,
1144 struct in_addr **return_ip_list, int *return_count);
1145 BOOL resolve_name(const char *name, struct in_addr *return_ip, int name_type);
1146 BOOL resolve_srv_name(const char* srv_name, fstring dest_host,
1147 struct in_addr *ip);
1148 BOOL find_master_ip(char *group, struct in_addr *master_ip);
1149 BOOL lookup_pdc_name(const char *srcname, const char *domain, struct in_addr *pdc_ip, char *ret_name);
1150 BOOL get_dc_list(BOOL pdc_only, char *group, struct in_addr **ip_list, int *count);
1152 /*The following definitions come from libsmb/nmblib.c */
1154 void debug_nmb_packet(struct packet_struct *p);
1155 char *nmb_namestr(struct nmb_name *n);
1156 struct packet_struct *copy_packet(struct packet_struct *packet);
1157 void free_packet(struct packet_struct *packet);
1158 struct packet_struct *parse_packet(char *buf,int length,
1159 enum packet_type packet_type);
1160 struct packet_struct *read_packet(int fd,enum packet_type packet_type);
1161 void make_nmb_name( struct nmb_name *n, const char *name, int type);
1162 BOOL nmb_name_equal(struct nmb_name *n1, struct nmb_name *n2);
1163 int build_packet(char *buf, struct packet_struct *p);
1164 BOOL send_packet(struct packet_struct *p);
1165 struct packet_struct *receive_packet(int fd,enum packet_type type,int t);
1166 struct packet_struct *receive_nmb_packet(int fd, int t, int trn_id);
1167 struct packet_struct *receive_dgram_packet(int fd, int t, char *mailslot_name);
1168 BOOL match_mailslot_name(struct packet_struct *p, char *mailslot_name);
1169 void sort_query_replies(char *data, int n, struct in_addr ip);
1170 char *dns_to_netbios_name(char *dns_name);
1171 int name_mangle( char *In, char *Out, char name_type );
1172 int name_extract(char *buf,int ofs,char *name);
1173 int name_len(char *s1);
1175 /*The following definitions come from libsmb/nterr.c */
1177 BOOL get_safe_nt_error_msg(uint32 nt_code,char *msg, size_t len);
1178 char *get_nt_error_msg(uint32 nt_code);
1180 /*The following definitions come from libsmb/passchange.c */
1182 BOOL remote_password_change(const char *remote_machine, const char *user_name,
1183 const char *old_passwd, const char *new_passwd,
1184 char *err_str, size_t err_str_len);
1186 /*The following definitions come from libsmb/pwd_cache.c */
1188 void pwd_init(struct pwd_info *pwd);
1189 BOOL pwd_is_nullpwd(const struct pwd_info *pwd);
1190 BOOL pwd_compare(struct pwd_info *pwd1, struct pwd_info *pwd2);
1191 void pwd_read(struct pwd_info *pwd, char *passwd_report, BOOL do_encrypt);
1192 void pwd_set_nullpwd(struct pwd_info *pwd);
1193 void pwd_set_cleartext(struct pwd_info *pwd, char *clr);
1194 void pwd_get_cleartext(struct pwd_info *pwd, char *clr);
1195 void pwd_set_lm_nt_16(struct pwd_info *pwd, uchar lm_pwd[16], uchar nt_pwd[16]);
1196 void pwd_get_lm_nt_16(struct pwd_info *pwd, uchar lm_pwd[16], uchar nt_pwd[16]);
1197 void pwd_make_lm_nt_16(struct pwd_info *pwd, char *clr);
1198 void pwd_make_lm_nt_owf(struct pwd_info *pwd, uchar cryptkey[8]);
1199 void pwd_get_lm_nt_owf(struct pwd_info *pwd, uchar lm_owf[24], uchar nt_owf[24]);
1201 /*The following definitions come from libsmb/smbdes.c */
1203 void E_P16(unsigned char *p14,unsigned char *p16);
1204 void E_P24(unsigned char *p21, unsigned char *c8, unsigned char *p24);
1205 void D_P16(unsigned char *p14, unsigned char *in, unsigned char *out);
1206 void E_old_pw_hash( unsigned char *p14, unsigned char *in, unsigned char *out);
1207 void cred_hash1(unsigned char *out,unsigned char *in,unsigned char *key);
1208 void cred_hash2(unsigned char *out,unsigned char *in,unsigned char *key);
1209 void cred_hash3(unsigned char *out,unsigned char *in,unsigned char *key, int forw);
1210 void SamOEMhash( unsigned char *data, unsigned char *key, int val);
1212 /*The following definitions come from libsmb/smbencrypt.c */
1214 void SMBencrypt(uchar *passwd, uchar *c8, uchar *p24);
1215 void E_md4hash(uchar *passwd, uchar *p16);
1216 void nt_lm_owf_gen(char *pwd, uchar nt_p16[16], uchar p16[16]);
1217 void SMBOWFencrypt(uchar passwd[16], uchar *c8, uchar p24[24]);
1218 void NTLMSSPOWFencrypt(uchar passwd[8], uchar *ntlmchalresp, uchar p24[24]);
1219 void SMBNTencrypt(uchar *passwd, uchar *c8, uchar *p24);
1220 BOOL make_oem_passwd_hash(char data[516], const char *passwd, uchar old_pw_hash[16], BOOL unicode);
1221 BOOL decode_pw_buffer(char in_buffer[516], char *new_pwrd,
1222 int new_pwrd_size, uint32 *new_pw_len,
1223 uchar nt_p16[16], uchar p16[16]);
1225 /*The following definitions come from libsmb/smberr.c */
1227 char *smb_errstr(char *inbuf);
1229 /*The following definitions come from libsmb/unexpected.c */
1231 void unexpected_packet(struct packet_struct *p);
1232 void clear_unexpected(time_t t);
1233 struct packet_struct *receive_unexpected(enum packet_type packet_type, int id,
1234 char *mailslot_name);
1236 /*The following definitions come from locking/brlock.c */
1238 void brl_init(int read_only);
1239 BOOL brl_lock(SMB_DEV_T dev, SMB_INO_T ino, int fnum,
1240 uint16 smbpid, pid_t pid, uint16 tid,
1241 br_off start, br_off size,
1242 enum brl_type lock_type);
1243 BOOL brl_unlock(SMB_DEV_T dev, SMB_INO_T ino, int fnum,
1244 uint16 smbpid, pid_t pid, uint16 tid,
1245 br_off start, br_off size);
1246 BOOL brl_locktest(SMB_DEV_T dev, SMB_INO_T ino, int fnum,
1247 uint16 smbpid, pid_t pid, uint16 tid,
1248 br_off start, br_off size,
1249 enum brl_type lock_type);
1250 void brl_close(SMB_DEV_T dev, SMB_INO_T ino, pid_t pid, int tid, int fnum);
1251 int brl_forall(BRLOCK_FN(fn));
1253 /*The following definitions come from locking/locking.c */
1255 BOOL is_locked(files_struct *fsp,connection_struct *conn,
1256 SMB_BIG_UINT count,SMB_BIG_UINT offset,
1257 enum brl_type lock_type);
1258 BOOL do_lock(files_struct *fsp,connection_struct *conn,
1259 SMB_BIG_UINT count,SMB_BIG_UINT offset,enum brl_type lock_type,
1260 int *eclass,uint32 *ecode);
1261 BOOL do_unlock(files_struct *fsp,connection_struct *conn,
1262 SMB_BIG_UINT count,SMB_BIG_UINT offset,
1263 int *eclass,uint32 *ecode);
1264 void locking_close_file(files_struct *fsp);
1265 BOOL locking_init(int read_only);
1266 BOOL locking_end(void);
1267 BOOL lock_share_entry(connection_struct *conn,
1268 SMB_DEV_T dev, SMB_INO_T inode);
1269 void unlock_share_entry(connection_struct *conn,
1270 SMB_DEV_T dev, SMB_INO_T inode);
1271 BOOL lock_share_entry_fsp(files_struct *fsp);
1272 void unlock_share_entry_fsp(files_struct *fsp);
1273 int get_share_modes(connection_struct *conn,
1274 SMB_DEV_T dev, SMB_INO_T inode,
1275 share_mode_entry **shares);
1276 size_t del_share_mode(files_struct *fsp, share_mode_entry **ppse);
1277 BOOL set_share_mode(files_struct *fsp, uint16 port, uint16 op_type);
1278 BOOL remove_share_oplock(files_struct *fsp);
1279 BOOL downgrade_share_oplock(files_struct *fsp);
1280 BOOL modify_delete_flag( SMB_DEV_T dev, SMB_INO_T inode, BOOL delete_on_close);
1281 int share_mode_forall(SHAREMODE_FN(fn));
1283 /*The following definitions come from locking/posix.c */
1285 int fd_close_posix(struct connection_struct *conn, files_struct *fsp);
1286 uint32 map_lock_offset(uint32 high, uint32 low);
1287 BOOL is_posix_locked(files_struct *fsp, SMB_BIG_UINT u_offset, SMB_BIG_UINT u_count, enum brl_type lock_type);
1288 BOOL set_posix_lock(files_struct *fsp, SMB_BIG_UINT u_offset, SMB_BIG_UINT u_count, enum brl_type lock_type);
1289 BOOL release_posix_lock(files_struct *fsp, SMB_BIG_UINT u_offset, SMB_BIG_UINT u_count);
1290 void posix_locking_close_file(files_struct *fsp);
1291 BOOL posix_locking_init(int read_only);
1292 BOOL posix_locking_end(void);
1294 /*The following definitions come from msdfs/msdfs.c */
1296 BOOL create_junction(char* pathname, struct junction_map* jn);
1297 BOOL is_msdfs_link(connection_struct* conn, char* path);
1298 BOOL get_referred_path(struct junction_map* junction);
1299 BOOL dfs_redirect(char* pathname, connection_struct* conn);
1300 BOOL dfs_findfirst_redirect(char* pathname, connection_struct* conn);
1301 int setup_dfs_referral(char* pathname, int max_referral_level,
1302 char** ppdata);
1303 int dfs_path_error(char* inbuf, char* outbuf);
1304 BOOL create_msdfs_link(struct junction_map* jn, BOOL exists);
1305 BOOL remove_msdfs_link(struct junction_map* jn);
1306 int enum_msdfs_links(struct junction_map* jn);
1307 int setup_dfs_referral(char* pathname, int max_referral_level,
1308 char** ppdata);
1309 BOOL is_msdfs_link(connection_struct* conn, char* path);
1311 /*The following definitions come from nmbd/asyncdns.c */
1313 int asyncdns_fd(void);
1314 void kill_async_dns_child(void);
1315 void start_async_dns(void);
1316 void run_dns_queue(void);
1317 BOOL queue_dns_query(struct packet_struct *p,struct nmb_name *question,
1318 struct name_record **n);
1319 BOOL queue_dns_query(struct packet_struct *p,struct nmb_name *question,
1320 struct name_record **n);
1321 void kill_async_dns_child(void);
1323 /*The following definitions come from nmbd/nmbd.c */
1326 /*The following definitions come from nmbd/nmbd_become_dmb.c */
1328 void add_domain_names(time_t t);
1330 /*The following definitions come from nmbd/nmbd_become_lmb.c */
1332 void insert_permanent_name_into_unicast( struct subnet_record *subrec,
1333 struct nmb_name *nmbname, uint16 nb_type );
1334 void unbecome_local_master_browser(struct subnet_record *subrec, struct work_record *work,
1335 BOOL force_new_election);
1336 void become_local_master_browser(struct subnet_record *subrec, struct work_record *work);
1337 void set_workgroup_local_master_browser_name( struct work_record *work, char *newname);
1339 /*The following definitions come from nmbd/nmbd_browserdb.c */
1341 void update_browser_death_time( struct browse_cache_record *browc );
1342 struct browse_cache_record *create_browser_in_lmb_cache( char *work_name,
1343 char *browser_name,
1344 struct in_addr ip );
1345 struct browse_cache_record *find_browser_in_lmb_cache( char *browser_name );
1346 void expire_lmb_browsers( time_t t );
1348 /*The following definitions come from nmbd/nmbd_browsesync.c */
1350 void dmb_expire_and_sync_browser_lists(time_t t);
1351 void announce_and_sync_with_domain_master_browser( struct subnet_record *subrec,
1352 struct work_record *work);
1353 void collect_all_workgroup_names_from_wins_server(time_t t);
1354 void sync_all_dmbs(time_t t);
1356 /*The following definitions come from nmbd/nmbd_elections.c */
1358 void check_master_browser_exists(time_t t);
1359 void run_elections(time_t t);
1360 void process_election(struct subnet_record *subrec, struct packet_struct *p, char *buf);
1361 BOOL check_elections(void);
1362 void nmbd_message_election(int msg_type, pid_t src, void *buf, size_t len);
1364 /*The following definitions come from nmbd/nmbd_incomingdgrams.c */
1366 void tell_become_backup(void);
1367 void process_host_announce(struct subnet_record *subrec, struct packet_struct *p, char *buf);
1368 void process_workgroup_announce(struct subnet_record *subrec, struct packet_struct *p, char *buf);
1369 void process_local_master_announce(struct subnet_record *subrec, struct packet_struct *p, char *buf);
1370 void process_master_browser_announce(struct subnet_record *subrec,
1371 struct packet_struct *p,char *buf);
1372 void process_lm_host_announce(struct subnet_record *subrec, struct packet_struct *p, char *buf);
1373 void process_get_backup_list_request(struct subnet_record *subrec,
1374 struct packet_struct *p,char *buf);
1375 void process_reset_browser(struct subnet_record *subrec,
1376 struct packet_struct *p,char *buf);
1377 void process_announce_request(struct subnet_record *subrec, struct packet_struct *p, char *buf);
1378 void process_lm_announce_request(struct subnet_record *subrec, struct packet_struct *p, char *buf);
1380 /*The following definitions come from nmbd/nmbd_incomingrequests.c */
1382 void process_name_release_request(struct subnet_record *subrec,
1383 struct packet_struct *p);
1384 void process_name_refresh_request(struct subnet_record *subrec,
1385 struct packet_struct *p);
1386 void process_name_registration_request(struct subnet_record *subrec,
1387 struct packet_struct *p);
1388 void process_node_status_request(struct subnet_record *subrec, struct packet_struct *p);
1389 void process_name_query_request(struct subnet_record *subrec, struct packet_struct *p);
1391 /*The following definitions come from nmbd/nmbd_lmhosts.c */
1393 void load_lmhosts_file(char *fname);
1394 BOOL find_name_in_lmhosts(struct nmb_name *nmbname, struct name_record **namerecp);
1396 /*The following definitions come from nmbd/nmbd_logonnames.c */
1398 void add_logon_names(void);
1400 /*The following definitions come from nmbd/nmbd_mynames.c */
1402 void register_my_workgroup_one_subnet(struct subnet_record *subrec);
1403 BOOL register_my_workgroup_and_names(void);
1404 void release_my_names(void);
1405 void refresh_my_names(time_t t);
1407 /*The following definitions come from nmbd/nmbd_namelistdb.c */
1409 void set_samba_nb_type(void);
1410 void remove_name_from_namelist( struct subnet_record *subrec,
1411 struct name_record *namerec );
1412 struct name_record *find_name_on_subnet( struct subnet_record *subrec,
1413 struct nmb_name *nmbname,
1414 BOOL self_only );
1415 struct name_record *find_name_for_remote_broadcast_subnet(
1416 struct nmb_name *nmbname,
1417 BOOL self_only );
1418 void update_name_ttl( struct name_record *namerec, int ttl );
1419 struct name_record *add_name_to_subnet( struct subnet_record *subrec,
1420 char *name,
1421 int type,
1422 uint16 nb_flags,
1423 int ttl,
1424 enum name_source source,
1425 int num_ips,
1426 struct in_addr *iplist);
1427 void standard_success_register(struct subnet_record *subrec,
1428 struct userdata_struct *userdata,
1429 struct nmb_name *nmbname, uint16 nb_flags, int ttl,
1430 struct in_addr registered_ip);
1431 void standard_fail_register( struct subnet_record *subrec,
1432 struct response_record *rrec,
1433 struct nmb_name *nmbname );
1434 BOOL find_ip_in_name_record( struct name_record *namerec, struct in_addr ip );
1435 void add_ip_to_name_record( struct name_record *namerec, struct in_addr new_ip );
1436 void remove_ip_from_name_record( struct name_record *namerec,
1437 struct in_addr remove_ip );
1438 void standard_success_release( struct subnet_record *subrec,
1439 struct userdata_struct *userdata,
1440 struct nmb_name *nmbname,
1441 struct in_addr released_ip );
1442 void expire_names_on_subnet(struct subnet_record *subrec, time_t t);
1443 void expire_names(time_t t);
1444 void add_samba_names_to_subnet( struct subnet_record *subrec );
1445 void dump_all_namelists(void);
1447 /*The following definitions come from nmbd/nmbd_namequery.c */
1449 BOOL query_name(struct subnet_record *subrec, char *name, int type,
1450 query_name_success_function success_fn,
1451 query_name_fail_function fail_fn,
1452 struct userdata_struct *userdata);
1453 BOOL query_name_from_wins_server(struct in_addr ip_to,
1454 char *name, int type,
1455 query_name_success_function success_fn,
1456 query_name_fail_function fail_fn,
1457 struct userdata_struct *userdata);
1459 /*The following definitions come from nmbd/nmbd_nameregister.c */
1461 BOOL register_name(struct subnet_record *subrec,
1462 char *name, int type, uint16 nb_flags,
1463 register_name_success_function success_fn,
1464 register_name_fail_function fail_fn,
1465 struct userdata_struct *userdata);
1466 BOOL refresh_name(struct subnet_record *subrec, struct name_record *namerec,
1467 refresh_name_success_function success_fn,
1468 refresh_name_fail_function fail_fn,
1469 struct userdata_struct *userdata);
1471 /*The following definitions come from nmbd/nmbd_namerelease.c */
1473 BOOL release_name(struct subnet_record *subrec, struct name_record *namerec,
1474 release_name_success_function success_fn,
1475 release_name_fail_function fail_fn,
1476 struct userdata_struct *userdata);
1478 /*The following definitions come from nmbd/nmbd_nodestatus.c */
1480 BOOL node_status(struct subnet_record *subrec, struct nmb_name *nmbname,
1481 struct in_addr send_ip, node_status_success_function success_fn,
1482 node_status_fail_function fail_fn, struct userdata_struct *userdata);
1484 /*The following definitions come from nmbd/nmbd_packets.c */
1486 uint16 get_nb_flags(char *buf);
1487 void set_nb_flags(char *buf, uint16 nb_flags);
1488 struct response_record *queue_register_name( struct subnet_record *subrec,
1489 response_function resp_fn,
1490 timeout_response_function timeout_fn,
1491 register_name_success_function success_fn,
1492 register_name_fail_function fail_fn,
1493 struct userdata_struct *userdata,
1494 struct nmb_name *nmbname,
1495 uint16 nb_flags);
1496 struct response_record *queue_register_multihomed_name( struct subnet_record *subrec,
1497 response_function resp_fn,
1498 timeout_response_function timeout_fn,
1499 register_name_success_function success_fn,
1500 register_name_fail_function fail_fn,
1501 struct userdata_struct *userdata,
1502 struct nmb_name *nmbname,
1503 uint16 nb_flags,
1504 struct in_addr register_ip);
1505 struct response_record *queue_release_name( struct subnet_record *subrec,
1506 response_function resp_fn,
1507 timeout_response_function timeout_fn,
1508 release_name_success_function success_fn,
1509 release_name_fail_function fail_fn,
1510 struct userdata_struct *userdata,
1511 struct nmb_name *nmbname,
1512 uint16 nb_flags,
1513 struct in_addr release_ip);
1514 struct response_record *queue_refresh_name( struct subnet_record *subrec,
1515 response_function resp_fn,
1516 timeout_response_function timeout_fn,
1517 refresh_name_success_function success_fn,
1518 refresh_name_fail_function fail_fn,
1519 struct userdata_struct *userdata,
1520 struct name_record *namerec,
1521 struct in_addr refresh_ip);
1522 struct response_record *queue_query_name( struct subnet_record *subrec,
1523 response_function resp_fn,
1524 timeout_response_function timeout_fn,
1525 query_name_success_function success_fn,
1526 query_name_fail_function fail_fn,
1527 struct userdata_struct *userdata,
1528 struct nmb_name *nmbname);
1529 struct response_record *queue_query_name_from_wins_server( struct in_addr to_ip,
1530 response_function resp_fn,
1531 timeout_response_function timeout_fn,
1532 query_name_success_function success_fn,
1533 query_name_fail_function fail_fn,
1534 struct userdata_struct *userdata,
1535 struct nmb_name *nmbname);
1536 struct response_record *queue_node_status( struct subnet_record *subrec,
1537 response_function resp_fn,
1538 timeout_response_function timeout_fn,
1539 node_status_success_function success_fn,
1540 node_status_fail_function fail_fn,
1541 struct userdata_struct *userdata,
1542 struct nmb_name *nmbname,
1543 struct in_addr send_ip);
1544 void reply_netbios_packet(struct packet_struct *orig_packet,
1545 int rcode, enum netbios_reply_type_code rcv_code, int opcode,
1546 int ttl, char *data,int len);
1547 void run_packet_queue(void);
1548 void retransmit_or_expire_response_records(time_t t);
1549 BOOL listen_for_packets(BOOL run_election);
1550 BOOL send_mailslot(BOOL unique, char *mailslot,char *buf,int len,
1551 char *srcname, int src_type,
1552 char *dstname, int dest_type,
1553 struct in_addr dest_ip,struct in_addr src_ip,
1554 int dest_port);
1556 /*The following definitions come from nmbd/nmbd_processlogon.c */
1558 void process_logon_packet(struct packet_struct *p,char *buf,int len,
1559 char *mailslot);
1561 /*The following definitions come from nmbd/nmbd_responserecordsdb.c */
1563 void remove_response_record(struct subnet_record *subrec,
1564 struct response_record *rrec);
1565 struct response_record *make_response_record( struct subnet_record *subrec,
1566 struct packet_struct *p,
1567 response_function resp_fn,
1568 timeout_response_function timeout_fn,
1569 success_function success_fn,
1570 fail_function fail_fn,
1571 struct userdata_struct *userdata);
1572 struct response_record *find_response_record(struct subnet_record **ppsubrec,
1573 uint16 id);
1574 BOOL is_refresh_already_queued(struct subnet_record *subrec, struct name_record *namerec);
1576 /*The following definitions come from nmbd/nmbd_sendannounce.c */
1578 void send_browser_reset(int reset_type, char *to_name, int to_type, struct in_addr to_ip);
1579 void broadcast_announce_request(struct subnet_record *subrec, struct work_record *work);
1580 void announce_my_server_names(time_t t);
1581 void announce_my_lm_server_names(time_t t);
1582 void reset_announce_timer(void);
1583 void announce_myself_to_domain_master_browser(time_t t);
1584 void announce_my_servers_removed(void);
1585 void announce_remote(time_t t);
1586 void browse_sync_remote(time_t t);
1588 /*The following definitions come from nmbd/nmbd_serverlistdb.c */
1590 void remove_all_servers(struct work_record *work);
1591 struct server_record *find_server_in_workgroup(struct work_record *work, char *name);
1592 void remove_server_from_workgroup(struct work_record *work, struct server_record *servrec);
1593 struct server_record *create_server_on_workgroup(struct work_record *work,
1594 char *name,int servertype,
1595 int ttl,char *comment);
1596 void update_server_ttl(struct server_record *servrec, int ttl);
1597 void expire_servers(struct work_record *work, time_t t);
1598 void write_browse_list(time_t t, BOOL force_write);
1600 /*The following definitions come from nmbd/nmbd_subnetdb.c */
1602 void close_subnet(struct subnet_record *subrec);
1603 struct subnet_record *make_normal_subnet(struct interface *iface);
1604 BOOL create_subnets(void);
1605 BOOL we_are_a_wins_client(void);
1606 struct subnet_record *get_next_subnet_maybe_unicast(struct subnet_record *subrec);
1607 struct subnet_record *get_next_subnet_maybe_unicast_or_wins_server(struct subnet_record *subrec);
1609 /*The following definitions come from nmbd/nmbd_synclists.c */
1611 void sync_browse_lists(struct work_record *work,
1612 char *name, int nm_type,
1613 struct in_addr ip, BOOL local, BOOL servers);
1614 void sync_check_completion(void);
1616 /*The following definitions come from nmbd/nmbd_winsproxy.c */
1618 void make_wins_proxy_name_query_request( struct subnet_record *subrec,
1619 struct packet_struct *incoming_packet,
1620 struct nmb_name *question_name);
1622 /*The following definitions come from nmbd/nmbd_winsserver.c */
1624 BOOL packet_is_for_wins_server(struct packet_struct *packet);
1625 BOOL initialise_wins(void);
1626 void wins_process_name_refresh_request(struct subnet_record *subrec,
1627 struct packet_struct *p);
1628 void wins_process_name_registration_request(struct subnet_record *subrec,
1629 struct packet_struct *p);
1630 void wins_process_multihomed_name_registration_request( struct subnet_record *subrec,
1631 struct packet_struct *p);
1632 void send_wins_name_query_response(int rcode, struct packet_struct *p,
1633 struct name_record *namerec);
1634 void wins_process_name_query_request(struct subnet_record *subrec,
1635 struct packet_struct *p);
1636 void wins_process_name_release_request(struct subnet_record *subrec,
1637 struct packet_struct *p);
1638 void initiate_wins_processing(time_t t);
1639 void wins_write_database(BOOL background);
1641 /*The following definitions come from nmbd/nmbd_workgroupdb.c */
1643 struct work_record *find_workgroup_on_subnet(struct subnet_record *subrec,
1644 const char *name);
1645 struct work_record *create_workgroup_on_subnet(struct subnet_record *subrec,
1646 const char *name, int ttl);
1647 void update_workgroup_ttl(struct work_record *work, int ttl);
1648 void initiate_myworkgroup_startup(struct subnet_record *subrec, struct work_record *work);
1649 void dump_workgroups(BOOL force_write);
1650 void expire_workgroups_and_servers(time_t t);
1652 /*The following definitions come from nsswitch/wb_client.c */
1654 BOOL winbind_lookup_name(const char *name, DOM_SID *sid, enum SID_NAME_USE *name_type);
1655 BOOL winbind_lookup_sid(DOM_SID *sid, fstring dom_name, fstring name, enum SID_NAME_USE *name_type);
1656 BOOL winbind_sid_to_uid(uid_t *puid, DOM_SID *sid);
1657 BOOL winbind_uid_to_sid(DOM_SID *sid, uid_t uid);
1658 BOOL winbind_sid_to_gid(gid_t *pgid, DOM_SID *sid);
1659 BOOL winbind_gid_to_sid(DOM_SID *sid, gid_t gid);
1660 int winbind_initgroups(char *user, gid_t gid);
1661 int winbind_getgroups(char *user, int size, gid_t *list);
1662 BOOL winbind_uidtoname(fstring name, uid_t uid);
1663 BOOL winbind_gidtoname(fstring name, gid_t gid);
1664 BOOL winbind_nametouid(uid_t *puid, char *name);
1665 BOOL winbind_nametogid(gid_t *pgid, char *gname);
1667 /*The following definitions come from nsswitch/wb_common.c */
1669 void init_request(struct winbindd_request *request, int request_type);
1670 void init_response(struct winbindd_response *response);
1671 void close_sock(void);
1672 int write_sock(void *buffer, int count);
1673 int read_reply(struct winbindd_response *response);
1674 void free_response(struct winbindd_response *response);
1676 /*The following definitions come from nsswitch/winbindd_glue.c */
1678 BOOL wb_lsa_open_policy(char *server, BOOL sec_qos, uint32 des_access,
1679 CLI_POLICY_HND *pol);
1680 BOOL wb_lsa_enum_trust_dom(CLI_POLICY_HND *hnd, uint32 *enum_ctx,
1681 uint32 * num_doms, char ***names, DOM_SID **sids);
1682 BOOL wb_lsa_query_info_pol(CLI_POLICY_HND *hnd, uint16 info_class,
1683 fstring domain_name, DOM_SID *domain_sid);
1684 BOOL wb_lsa_lookup_names(CLI_POLICY_HND *hnd, int num_names, char **names,
1685 DOM_SID **sids, uint32 **types, int *num_sids);
1686 BOOL wb_lsa_lookup_sids(CLI_POLICY_HND *hnd, int num_sids, DOM_SID *sids,
1687 char ***names, uint32 **types, int *num_names);
1688 BOOL wb_lsa_close(CLI_POLICY_HND *hnd);
1689 BOOL wb_samr_close(CLI_POLICY_HND *hnd);
1690 BOOL wb_samr_connect(char *server, uint32 access_mask, CLI_POLICY_HND *pol);
1691 BOOL wb_samr_open_domain(CLI_POLICY_HND *connect_pol, uint32 ace_perms,
1692 DOM_SID *sid, CLI_POLICY_HND *domain_pol);
1693 void wb_free_samr_userinfo_ctr(SAM_USERINFO_CTR * ctr);
1694 uint32 wb_samr_enum_dom_groups(CLI_POLICY_HND *pol, uint32 *start_idx,
1695 uint32 size, struct acct_info **sam,
1696 uint32 *num_sam_groups);
1697 BOOL wb_get_samr_query_userinfo(CLI_POLICY_HND *pol, uint32 info_level,
1698 uint32 user_rid, SAM_USERINFO_CTR *ctr);
1699 BOOL wb_samr_open_user(CLI_POLICY_HND *pol, uint32 access_mask, uint32 rid,
1700 POLICY_HND *user_pol);
1701 BOOL wb_samr_query_usergroups(CLI_POLICY_HND *pol, uint32 *num_groups,
1702 DOM_GID **gid);
1703 BOOL wb_get_samr_query_groupinfo(CLI_POLICY_HND *pol, uint32 info_level,
1704 uint32 group_rid, GROUP_INFO_CTR *ctr);
1705 BOOL wb_sam_query_groupmem(CLI_POLICY_HND *pol, uint32 group_rid,
1706 uint32 *num_names, uint32 **rid_mem,
1707 char ***names, uint32 **name_types);
1708 BOOL wb_samr_query_dom_info(CLI_POLICY_HND *pol, uint16 switch_value,
1709 SAM_UNK_CTR *ctr);
1710 BOOL wb_samr_query_dispinfo(CLI_POLICY_HND *pol, uint32 *start_ndx,
1711 uint16 info_level, uint32 *num_entries,
1712 SAM_DISPINFO_CTR *ctr);
1714 /*The following definitions come from param/loadparm.c */
1716 void lp_talloc_free(void);
1717 char *lp_logfile(void);
1718 char *lp_configfile(void);
1719 char *lp_smb_passwd_file(void);
1720 char *lp_private_dir(void);
1721 char *lp_passdb_module_path(void);
1722 char *lp_serverstring(void);
1723 char *lp_printcapname(void);
1724 char *lp_enumports_cmd(void);
1725 char *lp_addprinter_cmd(void);
1726 char *lp_deleteprinter_cmd(void);
1727 char *lp_os2_driver_map(void);
1728 char *lp_lockdir(void);
1729 char *lp_utmpdir(void);
1730 char *lp_wtmpdir(void);
1731 char *lp_utmp_hostname(void);
1732 BOOL lp_utmp(void);
1733 char *lp_rootdir(void);
1734 char *lp_source_environment(void);
1735 char *lp_defaultservice(void);
1736 char *lp_msg_command(void);
1737 char *lp_dfree_command(void);
1738 char *lp_hosts_equiv(void);
1739 char *lp_auto_services(void);
1740 char *lp_passwd_program(void);
1741 char *lp_passwd_chat(void);
1742 char *lp_passwordserver(void);
1743 char *lp_name_resolve_order(void);
1744 char *lp_workgroup(void);
1745 char *lp_username_map(void);
1746 char *lp_groupname_map(void);
1747 char *lp_logon_script(void);
1748 char *lp_logon_path(void);
1749 char *lp_logon_drive(void);
1750 char *lp_logon_home(void);
1751 char *lp_remote_announce(void);
1752 char *lp_remote_browse_sync(void);
1753 char *lp_wins_server(void);
1754 char *lp_interfaces(void);
1755 char *lp_socket_address(void);
1756 char *lp_nis_home_map_name(void);
1757 char *lp_netbios_aliases(void);
1758 char *lp_panic_action(void);
1759 char *lp_adduser_script(void);
1760 char *lp_deluser_script(void);
1761 char *lp_addgroup_script(void);
1762 char *lp_delgroup_script(void);
1763 char *lp_addusertogroup_script(void);
1764 char *lp_deluserfromgroup_script(void);
1765 char *lp_wins_hook(void);
1766 char *lp_domain_admin_group(void);
1767 char *lp_domain_guest_group(void);
1768 char *lp_winbind_uid(void);
1769 char *lp_winbind_gid(void);
1770 char *lp_template_homedir(void);
1771 char *lp_template_shell(void);
1772 char *lp_winbind_separator(void);
1773 BOOL lp_winbind_enum_users(void);
1774 BOOL lp_winbind_enum_groups(void);
1775 char *lp_codepagedir(void);
1776 char *lp_ldap_server(void);
1777 char *lp_ldap_suffix(void);
1778 char *lp_ldap_filter(void);
1779 char *lp_ldap_root(void);
1780 char *lp_ldap_rootpasswd(void);
1781 char *lp_add_share_cmd(void);
1782 char *lp_change_share_cmd(void);
1783 char *lp_delete_share_cmd(void);
1784 int lp_ssl_version(void);
1785 char *lp_ssl_hosts(void);
1786 char *lp_ssl_hosts_resign(void);
1787 char *lp_ssl_cacertdir(void);
1788 char *lp_ssl_cacertfile(void);
1789 char *lp_ssl_cert(void);
1790 char *lp_ssl_privkey(void);
1791 char *lp_ssl_client_cert(void);
1792 char *lp_ssl_client_privkey(void);
1793 char *lp_ssl_ciphers(void);
1794 BOOL lp_ssl_enabled(void);
1795 BOOL lp_ssl_reqClientCert(void);
1796 BOOL lp_ssl_reqServerCert(void);
1797 BOOL lp_ssl_compatibility(void);
1798 BOOL lp_ms_add_printer_wizard(void);
1799 BOOL lp_dns_proxy(void);
1800 BOOL lp_wins_support(void);
1801 BOOL lp_we_are_a_wins_server(void);
1802 BOOL lp_wins_proxy(void);
1803 BOOL lp_local_master(void);
1804 BOOL lp_domain_logons(void);
1805 BOOL lp_load_printers(void);
1806 BOOL lp_use_rhosts(void);
1807 BOOL lp_readprediction(void);
1808 BOOL lp_readbmpx(void);
1809 BOOL lp_readraw(void);
1810 BOOL lp_writeraw(void);
1811 BOOL lp_null_passwords(void);
1812 BOOL lp_obey_pam_restrictions(void);
1813 BOOL lp_strip_dot(void);
1814 BOOL lp_encrypted_passwords(void);
1815 BOOL lp_update_encrypted(void);
1816 BOOL lp_syslog_only(void);
1817 BOOL lp_timestamp_logs(void);
1818 BOOL lp_debug_hires_timestamp(void);
1819 BOOL lp_debug_pid(void);
1820 BOOL lp_debug_uid(void);
1821 BOOL lp_browse_list(void);
1822 BOOL lp_nis_home_map(void);
1823 BOOL lp_bind_interfaces_only(void);
1824 BOOL lp_pam_password_change(void);
1825 BOOL lp_unix_password_sync(void);
1826 BOOL lp_passwd_chat_debug(void);
1827 BOOL lp_nt_smb_support(void);
1828 BOOL lp_unicode(void);
1829 BOOL lp_nt_pipe_support(void);
1830 BOOL lp_nt_acl_support(void);
1831 BOOL lp_stat_cache(void);
1832 BOOL lp_allow_trusted_domains(void);
1833 BOOL lp_restrict_anonymous(void);
1834 BOOL lp_lanman_auth(void);
1835 BOOL lp_host_msdfs(void);
1836 BOOL lp_kernel_oplocks(void);
1837 BOOL lp_enhanced_browsing(void);
1838 int lp_os_level(void);
1839 int lp_max_ttl(void);
1840 int lp_max_wins_ttl(void);
1841 int lp_min_wins_ttl(void);
1842 int lp_max_log_size(void);
1843 int lp_max_open_files(void);
1844 int lp_maxxmit(void);
1845 int lp_maxmux(void);
1846 int lp_passwordlevel(void);
1847 int lp_usernamelevel(void);
1848 int lp_readsize(void);
1849 int lp_deadtime(void);
1850 int lp_maxprotocol(void);
1851 int lp_minprotocol(void);
1852 int lp_security(void);
1853 int lp_maxdisksize(void);
1854 int lp_lpqcachetime(void);
1855 int lp_max_smbd_processes(void);
1856 int lp_totalprintjobs(void);
1857 int lp_syslog(void);
1858 int lp_client_code_page(void);
1859 int lp_lm_announce(void);
1860 int lp_lm_interval(void);
1861 int lp_machine_password_timeout(void);
1862 int lp_change_notify_timeout(void);
1863 int lp_stat_cache_size(void);
1864 int lp_map_to_guest(void);
1865 int lp_min_passwd_length(void);
1866 int lp_oplock_break_wait_time(void);
1867 int lp_ldap_port(void);
1868 char *lp_preexec(int );
1869 char *lp_postexec(int );
1870 char *lp_rootpreexec(int );
1871 char *lp_rootpostexec(int );
1872 char *lp_servicename(int );
1873 char *lp_pathname(int );
1874 char *lp_dontdescend(int );
1875 char *lp_username(int );
1876 char *lp_guestaccount(int );
1877 char *lp_invalid_users(int );
1878 char *lp_valid_users(int );
1879 char *lp_admin_users(int );
1880 char *lp_printcommand(int );
1881 char *lp_lpqcommand(int );
1882 char *lp_lprmcommand(int );
1883 char *lp_lppausecommand(int );
1884 char *lp_lpresumecommand(int );
1885 char *lp_queuepausecommand(int );
1886 char *lp_queueresumecommand(int );
1887 char *lp_driverfile(int );
1888 char *lp_printerdriver(int );
1889 char *lp_hostsallow(int );
1890 char *lp_hostsdeny(int );
1891 char *lp_magicscript(int );
1892 char *lp_magicoutput(int );
1893 char *lp_comment(int );
1894 char *lp_force_user(int );
1895 char *lp_force_group(int );
1896 char *lp_readlist(int );
1897 char *lp_writelist(int );
1898 char *lp_printer_admin(int );
1899 char *lp_fstype(int );
1900 char *lp_vfsobj(int );
1901 char *lp_mangled_map(int );
1902 char *lp_veto_files(int );
1903 char *lp_hide_files(int );
1904 char *lp_veto_oplocks(int );
1905 char *lp_driverlocation(int );
1906 BOOL lp_msdfs_root(int );
1907 BOOL lp_autoloaded(int );
1908 BOOL lp_preexec_close(int );
1909 BOOL lp_rootpreexec_close(int );
1910 BOOL lp_casesensitive(int );
1911 BOOL lp_preservecase(int );
1912 BOOL lp_shortpreservecase(int );
1913 BOOL lp_casemangle(int );
1914 BOOL lp_status(int );
1915 BOOL lp_hide_dot_files(int );
1916 BOOL lp_hideunreadable(int );
1917 BOOL lp_browseable(int );
1918 BOOL lp_readonly(int );
1919 BOOL lp_no_set_dir(int );
1920 BOOL lp_guest_ok(int );
1921 BOOL lp_guest_only(int );
1922 BOOL lp_print_ok(int );
1923 BOOL lp_postscript(int );
1924 BOOL lp_map_hidden(int );
1925 BOOL lp_map_archive(int );
1926 BOOL lp_locking(int );
1927 BOOL lp_strict_locking(int );
1928 BOOL lp_posix_locking(int );
1929 BOOL lp_share_modes(int );
1930 BOOL lp_oplocks(int );
1931 BOOL lp_level2_oplocks(int );
1932 BOOL lp_onlyuser(int );
1933 BOOL lp_manglednames(int );
1934 BOOL lp_widelinks(int );
1935 BOOL lp_symlinks(int );
1936 BOOL lp_syncalways(int );
1937 BOOL lp_strict_sync(int );
1938 BOOL lp_map_system(int );
1939 BOOL lp_delete_readonly(int );
1940 BOOL lp_fake_oplocks(int );
1941 BOOL lp_recursive_veto_delete(int );
1942 BOOL lp_dos_filemode(int );
1943 BOOL lp_dos_filetimes(int );
1944 BOOL lp_dos_filetime_resolution(int );
1945 BOOL lp_fake_dir_create_times(int );
1946 BOOL lp_blocking_locks(int );
1947 BOOL lp_inherit_perms(int );
1948 int lp_create_mask(int );
1949 int lp_force_create_mode(int );
1950 int lp_security_mask(int );
1951 int lp_force_security_mode(int );
1952 int lp_dir_mask(int );
1953 int lp_force_dir_mode(int );
1954 int lp_dir_security_mask(int );
1955 int lp_force_dir_security_mode(int );
1956 int lp_max_connections(int );
1957 int lp_defaultcase(int );
1958 int lp_minprintspace(int );
1959 int lp_maxprintjobs(int );
1960 int lp_printing(int );
1961 int lp_oplock_contention_limit(int );
1962 int lp_write_cache_size(int );
1963 char lp_magicchar(int );
1964 int lp_winbind_cache_time(void);
1965 BOOL lp_hide_local_users(void);
1966 BOOL lp_add_home(char *pszHomename, int iDefaultService, char *pszHomedir);
1967 int lp_add_service(char *pszService, int iDefaultService);
1968 BOOL lp_add_printer(char *pszPrintername, int iDefaultService);
1969 BOOL lp_file_list_changed(void);
1970 void *lp_local_ptr(int snum, void *ptr);
1971 BOOL lp_do_parameter(int snum, char *pszParmName, char *pszParmValue);
1972 void init_locals(void);
1973 BOOL lp_is_default(int snum, struct parm_struct *parm);
1974 struct parm_struct *lp_next_parameter(int snum, int *i, int allparameters);
1975 BOOL lp_snum_ok(int iService);
1976 void lp_add_one_printer(char *name, char *comment);
1977 BOOL lp_loaded(void);
1978 void lp_killunused(BOOL (*snumused) (int));
1979 void lp_killservice(int iServiceIn);
1980 BOOL lp_load(char *pszFname, BOOL global_only, BOOL save_defaults,
1981 BOOL add_ipc);
1982 void lp_resetnumservices(void);
1983 int lp_numservices(void);
1984 void lp_dump(FILE *f, BOOL show_defaults, int maxtoprint, char *(*dos_to_ext)(char *, BOOL));
1985 void lp_dump_one(FILE * f, BOOL show_defaults, int snum, char *(*dos_to_ext)(char *, BOOL));
1986 int lp_servicenumber(char *pszServiceName);
1987 char *volume_label(int snum);
1988 int lp_server_role(void);
1989 BOOL lp_domain_master(void);
1990 BOOL lp_preferred_master(void);
1991 void lp_remove_service(int snum);
1992 void lp_copy_service(int snum, char *new_name);
1993 int lp_default_server_announce(void);
1994 int lp_major_announce_version(void);
1995 int lp_minor_announce_version(void);
1996 void lp_set_name_resolve_order(char *new_order);
1997 char *lp_printername(int snum);
1999 /*The following definitions come from param/params.c */
2001 BOOL pm_process( char *FileName,
2002 BOOL (*sfunc)(char *),
2003 BOOL (*pfunc)(char *, char *) );
2005 /*The following definitions come from passdb/machine_sid.c */
2007 BOOL pdb_generate_sam_sid(void);
2009 /*The following definitions come from passdb/pampass.c */
2011 BOOL smb_pam_claim_session(char *user, char *tty, char *rhost);
2012 BOOL smb_pam_close_session(char *user, char *tty, char *rhost);
2013 uint32 smb_pam_accountcheck(char * user);
2014 uint32 smb_pam_passcheck(char * user, char * password);
2015 BOOL smb_pam_passchange(char * user, char * oldpassword, char * newpassword);
2017 /*The following definitions come from passdb/pass_check.c */
2019 void dfs_unlogin(void);
2020 BOOL pass_check(char *user, char *password, int pwlen, struct passwd *pwd,
2021 BOOL (*fn) (char *, char *));
2023 /*The following definitions come from passdb/passdb.c */
2025 BOOL initialize_password_db(BOOL reload);
2026 BOOL pdb_init_sam(SAM_ACCOUNT **user);
2027 BOOL pdb_free_sam(SAM_ACCOUNT *user);
2028 BOOL pdb_reset_sam(SAM_ACCOUNT *user);
2029 struct sam_disp_info *pdb_sam_to_dispinfo(SAM_ACCOUNT *user);
2030 char *pdb_encode_acct_ctrl(uint16 acct_ctrl, size_t length);
2031 uint16 pdb_decode_acct_ctrl(const char *p);
2032 void pdb_sethexpwd(char *p, unsigned char *pwd, uint16 acct_ctrl);
2033 BOOL pdb_gethexpwd(char *p, unsigned char *pwd);
2034 BOOL pdb_name_to_rid(char *user_name, uint32 *u_rid, uint32 *g_rid);
2035 uid_t pdb_user_rid_to_uid(uint32 user_rid);
2036 gid_t pdb_user_rid_to_gid(uint32 user_rid);
2037 uint32 pdb_uid_to_user_rid(uid_t uid);
2038 uint32 pdb_gid_to_group_rid(gid_t gid);
2039 BOOL pdb_rid_is_user(uint32 rid);
2040 BOOL local_lookup_rid(uint32 rid, char *name, enum SID_NAME_USE *psid_name_use);
2041 BOOL local_lookup_name(const char *c_domain, const char *c_user, DOM_SID *psid, enum SID_NAME_USE *psid_name_use);
2042 DOM_SID *local_uid_to_sid(DOM_SID *psid, uid_t uid);
2043 BOOL local_sid_to_uid(uid_t *puid, DOM_SID *psid, enum SID_NAME_USE *name_type);
2044 DOM_SID *local_gid_to_sid(DOM_SID *psid, gid_t gid);
2045 BOOL local_sid_to_gid(gid_t *pgid, DOM_SID *psid, enum SID_NAME_USE *name_type);
2046 void copy_id23_to_sam_passwd(SAM_ACCOUNT *to, SAM_USER_INFO_23 *from);
2047 void copy_id21_to_sam_passwd(SAM_ACCOUNT *to, SAM_USER_INFO_21 *from);
2048 void copy_sam_passwd(SAM_ACCOUNT *to, const SAM_ACCOUNT *from);
2049 BOOL local_password_change(char *user_name, int local_flags,
2050 char *new_passwd,
2051 char *err_str, size_t err_str_len,
2052 char *msg_str, size_t msg_str_len);
2053 uint16 pdb_get_acct_ctrl (SAM_ACCOUNT *sampass);
2054 time_t pdb_get_logon_time (SAM_ACCOUNT *sampass);
2055 time_t pdb_get_logoff_time (SAM_ACCOUNT *sampass);
2056 time_t pdb_get_kickoff_time (SAM_ACCOUNT *sampass);
2057 time_t pdb_get_pass_last_set_time (SAM_ACCOUNT *sampass);
2058 time_t pdb_get_pass_can_change_time (SAM_ACCOUNT *sampass);
2059 time_t pdb_get_pass_must_change_time (SAM_ACCOUNT *sampass);
2060 uint16 pdb_get_logon_divs (SAM_ACCOUNT *sampass);
2061 uint32 pdb_get_hours_len (SAM_ACCOUNT *sampass);
2062 uint8* pdb_get_hours (SAM_ACCOUNT *sampass);
2063 uint8* pdb_get_nt_passwd (SAM_ACCOUNT *sampass);
2064 uint8* pdb_get_lanman_passwd (SAM_ACCOUNT *sampass);
2065 uint32 pdb_get_user_rid (SAM_ACCOUNT *sampass);
2066 uint32 pdb_get_group_rid (SAM_ACCOUNT *sampass);
2067 uid_t pdb_get_uid (SAM_ACCOUNT *sampass);
2068 gid_t pdb_get_gid (SAM_ACCOUNT *sampass);
2069 char* pdb_get_username (SAM_ACCOUNT *sampass);
2070 char* pdb_get_domain (SAM_ACCOUNT *sampass);
2071 char* pdb_get_nt_username (SAM_ACCOUNT *sampass);
2072 char* pdb_get_fullname (SAM_ACCOUNT *sampass);
2073 char* pdb_get_homedir (SAM_ACCOUNT *sampass);
2074 char* pdb_get_dirdrive (SAM_ACCOUNT *sampass);
2075 char* pdb_get_logon_script (SAM_ACCOUNT *sampass);
2076 char* pdb_get_profile_path (SAM_ACCOUNT *sampass);
2077 char* pdb_get_acct_desc (SAM_ACCOUNT *sampass);
2078 char* pdb_get_workstations (SAM_ACCOUNT *sampass);
2079 char* pdb_get_munged_dial (SAM_ACCOUNT *sampass);
2080 uint32 pdb_get_unknown3 (SAM_ACCOUNT *sampass);
2081 uint32 pdb_get_unknown5 (SAM_ACCOUNT *sampass);
2082 uint32 pdb_get_unknown6 (SAM_ACCOUNT *sampass);
2083 BOOL pdb_set_acct_ctrl (SAM_ACCOUNT *sampass, uint16 flags);
2084 BOOL pdb_set_logon_time (SAM_ACCOUNT *sampass, time_t mytime);
2085 BOOL pdb_set_logoff_time (SAM_ACCOUNT *sampass, time_t mytime);
2086 BOOL pdb_set_kickoff_time (SAM_ACCOUNT *sampass, time_t mytime);
2087 BOOL pdb_set_pass_can_change_time (SAM_ACCOUNT *sampass, time_t mytime);
2088 BOOL pdb_set_pass_must_change_time (SAM_ACCOUNT *sampass, time_t mytime);
2089 BOOL pdb_set_pass_last_set_time (SAM_ACCOUNT *sampass, time_t mytime);
2090 BOOL pdb_set_hours_len (SAM_ACCOUNT *sampass, uint32 len);
2091 BOOL pdb_set_logons_divs (SAM_ACCOUNT *sampass, uint16 hours);
2092 BOOL pdb_set_uid (SAM_ACCOUNT *sampass, uid_t uid);
2093 BOOL pdb_set_gid (SAM_ACCOUNT *sampass, gid_t gid);
2094 BOOL pdb_set_user_rid (SAM_ACCOUNT *sampass, uint32 rid);
2095 BOOL pdb_set_group_rid (SAM_ACCOUNT *sampass, uint32 grid);
2096 BOOL pdb_set_username(SAM_ACCOUNT *sampass, char *username);
2097 BOOL pdb_set_domain(SAM_ACCOUNT *sampass, char *domain);
2098 BOOL pdb_set_nt_username(SAM_ACCOUNT *sampass, char *nt_username);
2099 BOOL pdb_set_fullname(SAM_ACCOUNT *sampass, char *fullname);
2100 BOOL pdb_set_logon_script(SAM_ACCOUNT *sampass, char *logon_script);
2101 BOOL pdb_set_profile_path (SAM_ACCOUNT *sampass, char *profile_path);
2102 BOOL pdb_set_dir_drive (SAM_ACCOUNT *sampass, char *dir_drive);
2103 BOOL pdb_set_homedir (SAM_ACCOUNT *sampass, char *homedir);
2104 BOOL pdb_set_acct_desc (SAM_ACCOUNT *sampass, char *acct_desc);
2105 BOOL pdb_set_workstations (SAM_ACCOUNT *sampass, char *workstations);
2106 BOOL pdb_set_munged_dial (SAM_ACCOUNT *sampass, char *munged_dial);
2107 BOOL pdb_set_nt_passwd (SAM_ACCOUNT *sampass, uint8 *pwd);
2108 BOOL pdb_set_lanman_passwd (SAM_ACCOUNT *sampass, uint8 *pwd);
2109 BOOL pdb_set_unknown_3 (SAM_ACCOUNT *sampass, uint32 unkn);
2110 BOOL pdb_set_unknown_5 (SAM_ACCOUNT *sampass, uint32 unkn);
2111 BOOL pdb_set_unknown_6 (SAM_ACCOUNT *sampass, uint32 unkn);
2112 BOOL pdb_set_hours (SAM_ACCOUNT *sampass, uint8 *hours);
2114 /*The following definitions come from passdb/pdb_smbpasswd.c */
2116 BOOL pdb_setsampwent (BOOL update);
2117 void pdb_endsampwent (void);
2118 BOOL pdb_getsampwent(SAM_ACCOUNT *user);
2119 BOOL pdb_getsampwnam(SAM_ACCOUNT *sam_acct, char *username);
2120 BOOL pdb_getsampwuid (SAM_ACCOUNT *sam_acct, uid_t uid);
2121 BOOL pdb_getsampwrid(SAM_ACCOUNT *sam_acct,uint32 rid);
2122 BOOL pdb_add_sam_account(SAM_ACCOUNT *sampass);
2123 BOOL pdb_update_sam_account(SAM_ACCOUNT *sampass, BOOL override);
2124 BOOL pdb_delete_sam_account (char* username);
2126 /*The following definitions come from passdb/pdb_tdb.c */
2128 BOOL pdb_setsampwent(BOOL update);
2129 void pdb_endsampwent(void);
2130 BOOL pdb_getsampwent(SAM_ACCOUNT *user);
2131 BOOL pdb_getsampwnam (SAM_ACCOUNT *user, char *sname);
2132 BOOL pdb_getsampwuid (SAM_ACCOUNT* user, uid_t uid);
2133 BOOL pdb_getsampwrid (SAM_ACCOUNT *user, uint32 rid);
2134 BOOL pdb_delete_sam_account(char *sname);
2135 BOOL pdb_update_sam_account (SAM_ACCOUNT *newpwd, BOOL override);
2136 BOOL pdb_add_sam_account (SAM_ACCOUNT *newpwd);
2138 /*The following definitions come from passdb/secrets.c */
2140 BOOL secrets_init(void);
2141 void *secrets_fetch(char *key, size_t *size);
2142 BOOL secrets_store(char *key, void *data, size_t size);
2143 BOOL secrets_delete(char *key);
2144 BOOL secrets_store_domain_sid(char *domain, DOM_SID *sid);
2145 BOOL secrets_fetch_domain_sid(char *domain, DOM_SID *sid);
2146 char *trust_keystr(char *domain);
2147 BOOL secrets_fetch_trust_account_password(char *domain, uint8 ret_pwd[16],
2148 time_t *pass_last_set_time);
2149 BOOL secrets_store_trust_account_password(char *domain, uint8 new_pwd[16]);
2150 BOOL trust_password_delete(char *domain);
2152 /*The following definitions come from passdb/smbpassfile.c */
2154 BOOL migrate_from_old_password_file(char *domain);
2156 /*The following definitions come from printing/load.c */
2158 void add_all_printers(void);
2159 void load_printers(void);
2161 /*The following definitions come from printing/lpq_parse.c */
2163 BOOL parse_lpq_entry(int snum,char *line,
2164 print_queue_struct *buf,
2165 print_status_struct *status,BOOL first);
2167 /*The following definitions come from printing/nt_printing.c */
2169 BOOL nt_printing_init(void);
2170 int get_builtin_ntforms(nt_forms_struct **list);
2171 BOOL get_a_builtin_ntform(UNISTR2 *uni_formname,nt_forms_struct *form);
2172 int get_ntforms(nt_forms_struct **list);
2173 int write_ntforms(nt_forms_struct **list, int number);
2174 BOOL add_a_form(nt_forms_struct **list, const FORM *form, int *count);
2175 BOOL delete_a_form(nt_forms_struct **list, UNISTR2 *del_name, int *count, uint32 *ret);
2176 void update_a_form(nt_forms_struct **list, const FORM *form, int count);
2177 int get_ntdrivers(fstring **list, char *architecture, uint32 version);
2178 BOOL get_short_archi(char *short_archi, char *long_archi);
2179 uint32 clean_up_driver_struct(NT_PRINTER_DRIVER_INFO_LEVEL driver_abstract,
2180 uint32 level, struct current_user *user);
2181 BOOL move_driver_to_download_area(NT_PRINTER_DRIVER_INFO_LEVEL driver_abstract, uint32 level, struct current_user *user, uint32 *perr);
2182 uint32 get_a_printer_driver_9x_compatible(pstring line, fstring model);
2183 uint32 del_a_printer(char *sharename);
2184 void add_a_specific_param(NT_PRINTER_INFO_LEVEL_2 *info_2, NT_PRINTER_PARAM **param);
2185 BOOL unlink_specific_param_if_exist(NT_PRINTER_INFO_LEVEL_2 *info_2, NT_PRINTER_PARAM *param);
2186 void free_nt_printer_param(NT_PRINTER_PARAM **param_ptr);
2187 NT_DEVICEMODE *construct_nt_devicemode(const fstring default_devicename);
2188 NT_DEVICEMODE *dup_nt_devicemode(NT_DEVICEMODE *nt_devicemode);
2189 void free_nt_devicemode(NT_DEVICEMODE **devmode_ptr);
2190 void get_printer_subst_params(int snum, fstring *printername, fstring *sharename, fstring *portname);
2191 uint32 mod_a_printer(NT_PRINTER_INFO_LEVEL printer, uint32 level);
2192 uint32 add_a_printer(NT_PRINTER_INFO_LEVEL printer, uint32 level);
2193 uint32 get_a_printer(NT_PRINTER_INFO_LEVEL **pp_printer, uint32 level, fstring sharename);
2194 uint32 free_a_printer(NT_PRINTER_INFO_LEVEL **pp_printer, uint32 level);
2195 uint32 add_a_printer_driver(NT_PRINTER_DRIVER_INFO_LEVEL driver, uint32 level);
2196 uint32 get_a_printer_driver(NT_PRINTER_DRIVER_INFO_LEVEL *driver, uint32 level,
2197 fstring printername, fstring architecture, uint32 version);
2198 uint32 free_a_printer_driver(NT_PRINTER_DRIVER_INFO_LEVEL driver, uint32 level);
2199 BOOL get_specific_param_by_index(NT_PRINTER_INFO_LEVEL printer, uint32 level, uint32 param_index,
2200 fstring value, uint8 **data, uint32 *type, uint32 *len);
2201 BOOL get_specific_param(NT_PRINTER_INFO_LEVEL printer, uint32 level,
2202 fstring value, uint8 **data, uint32 *type, uint32 *len);
2203 uint32 nt_printing_setsec(char *printername, SEC_DESC_BUF *secdesc_ctr);
2204 BOOL nt_printing_getsec(TALLOC_CTX *ctx, char *printername, SEC_DESC_BUF **secdesc_ctr);
2205 void map_printer_permissions(SEC_DESC *sd);
2206 BOOL print_access_check(struct current_user *user, int snum, int access_type);
2207 BOOL print_time_access_check(int snum);
2208 uint32 printer_write_default_dev(int snum, const PRINTER_DEFAULT *printer_default);
2210 /*The following definitions come from printing/pcap.c */
2212 BOOL pcap_printername_ok(char *pszPrintername, char *pszPrintcapname);
2213 void pcap_printer_fn(void (*fn)(char *, char *));
2215 /*The following definitions come from printing/print_cups.c */
2218 /*The following definitions come from printing/print_generic.c */
2221 /*The following definitions come from printing/print_svid.c */
2223 void sysv_printer_fn(void (*fn)(char *, char *));
2224 int sysv_printername_ok(char *name);
2226 /*The following definitions come from printing/printfsp.c */
2228 files_struct *print_fsp_open(connection_struct *conn);
2229 void print_fsp_end(files_struct *fsp, BOOL normal_close);
2231 /*The following definitions come from printing/printing.c */
2233 BOOL print_backend_init(void);
2234 BOOL print_job_exists(int jobid);
2235 int print_job_snum(int jobid);
2236 int print_job_fd(int jobid);
2237 char *print_job_fname(int jobid);
2238 BOOL print_job_set_place(int jobid, int place);
2239 BOOL print_job_set_name(int jobid, char *name);
2240 BOOL print_job_delete(struct current_user *user, int jobid, int *errcode);
2241 BOOL print_job_pause(struct current_user *user, int jobid, int *errcode);
2242 BOOL print_job_resume(struct current_user *user, int jobid, int *errcode);
2243 int print_job_write(int jobid, const char *buf, int size);
2244 int print_job_start(struct current_user *user, int snum, char *jobname);
2245 BOOL print_job_end(int jobid, BOOL normal_close);
2246 int print_queue_status(int snum,
2247 print_queue_struct **queue,
2248 print_status_struct *status);
2249 int print_queue_snum(char *qname);
2250 BOOL print_queue_pause(struct current_user *user, int snum, int *errcode);
2251 BOOL print_queue_resume(struct current_user *user, int snum, int *errcode);
2252 BOOL print_queue_purge(struct current_user *user, int snum, int *errcode);
2254 /*The following definitions come from profile/profile.c */
2256 void profile_message(int msg_type, pid_t src, void *buf, size_t len);
2257 void reqprofile_message(int msg_type, pid_t src, void *buf, size_t len);
2258 BOOL profile_setup(BOOL rdonly);
2260 /*The following definitions come from rpc_client/cli_connect.c */
2262 void init_connections(void);
2263 void free_connections(void);
2264 void cli_connection_free(struct cli_connection *con);
2265 void cli_connection_unlink(struct cli_connection *con);
2266 BOOL cli_connection_init(const char *srv_name, char *pipe_name,
2267 struct cli_connection **con);
2268 BOOL cli_connection_init_auth(const char *srv_name, char *pipe_name,
2269 struct cli_connection **con,
2270 cli_auth_fns * auth, void *auth_creds);
2271 struct _cli_auth_fns *cli_conn_get_authfns(struct cli_connection *con);
2272 void *cli_conn_get_auth_creds(struct cli_connection *con);
2273 BOOL rpc_hnd_pipe_req(const POLICY_HND * hnd, uint8 op_num,
2274 prs_struct * data, prs_struct * rdata);
2275 BOOL rpc_con_pipe_req(struct cli_connection *con, uint8 op_num,
2276 prs_struct * data, prs_struct * rdata);
2277 BOOL rpc_con_ok(struct cli_connection *con);
2279 /*The following definitions come from rpc_client/cli_login.c */
2281 BOOL cli_nt_setup_creds(struct cli_state *cli, unsigned char mach_pwd[16]);
2282 BOOL cli_nt_srv_pwset(struct cli_state *cli, unsigned char *new_hashof_mach_pwd);
2283 BOOL cli_nt_login_interactive(struct cli_state *cli, char *domain, char *username,
2284 uint32 smb_userid_low, char *password,
2285 NET_ID_INFO_CTR *ctr, NET_USER_INFO_3 *user_info3);
2286 BOOL cli_nt_login_network(struct cli_state *cli, char *domain, char *username,
2287 uint32 smb_userid_low, char lm_chal[8],
2288 char *lm_chal_resp, char *nt_chal_resp,
2289 NET_ID_INFO_CTR *ctr, NET_USER_INFO_3 *user_info3);
2290 BOOL cli_nt_logoff(struct cli_state *cli, NET_ID_INFO_CTR *ctr);
2292 /*The following definitions come from rpc_client/cli_lsarpc.c */
2294 BOOL do_lsa_open_policy(struct cli_state *cli,
2295 char *system_name, POLICY_HND *hnd,
2296 BOOL sec_qos);
2297 BOOL do_lsa_query_info_pol(struct cli_state *cli,
2298 POLICY_HND *hnd, uint16 info_class,
2299 fstring domain_name, DOM_SID *domain_sid);
2300 BOOL do_lsa_close(struct cli_state *cli, POLICY_HND *hnd);
2301 BOOL cli_lsa_get_domain_sid(struct cli_state *cli, char *server);
2302 uint32 lsa_open_policy(const char *system_name, POLICY_HND *hnd,
2303 BOOL sec_qos, uint32 des_access);
2304 uint32 lsa_close(POLICY_HND *hnd);
2305 uint32 lsa_lookup_sids(POLICY_HND *hnd, int num_sids, DOM_SID *sids,
2306 char ***names, uint32 **types, int *num_names);
2307 uint32 lsa_lookup_names(POLICY_HND *hnd, int num_names, char **names,
2308 DOM_SID **sids, uint32 **types, int *num_sids);
2310 /*The following definitions come from rpc_client/cli_netlogon.c */
2312 BOOL cli_net_logon_ctrl2(struct cli_state *cli, uint32 status_level);
2313 BOOL cli_net_auth2(struct cli_state *cli, uint16 sec_chan,
2314 uint32 neg_flags, DOM_CHAL *srv_chal);
2315 BOOL cli_net_req_chal(struct cli_state *cli, DOM_CHAL *clnt_chal, DOM_CHAL *srv_chal);
2316 BOOL cli_net_srv_pwset(struct cli_state *cli, uint8 hashed_mach_pwd[16]);
2317 BOOL cli_net_sam_logon(struct cli_state *cli, NET_ID_INFO_CTR *ctr, NET_USER_INFO_3 *user_info3);
2318 BOOL cli_net_sam_logoff(struct cli_state *cli, NET_ID_INFO_CTR *ctr);
2319 BOOL change_trust_account_password( char *domain, char *remote_machine_list);
2321 /*The following definitions come from rpc_client/cli_pipe.c */
2323 BOOL rpc_api_pipe_req(struct cli_state *cli, uint8 op_num,
2324 prs_struct *data, prs_struct *rdata);
2325 BOOL rpc_pipe_bind(struct cli_state *cli, char *pipe_name, char *my_name);
2326 void cli_nt_set_ntlmssp_flgs(struct cli_state *cli, uint32 ntlmssp_flgs);
2327 BOOL cli_nt_session_open(struct cli_state *cli, char *pipe_name);
2328 void cli_nt_session_close(struct cli_state *cli);
2330 /*The following definitions come from rpc_client/cli_spoolss_notify.c */
2332 BOOL spoolss_disconnect_from_client( struct cli_state *cli);
2333 BOOL spoolss_connect_to_client( struct cli_state *cli, char *remote_machine);
2334 BOOL cli_spoolss_reply_open_printer(struct cli_state *cli, char *printer, uint32 localprinter, uint32 type, uint32 *status, POLICY_HND *handle);
2335 BOOL cli_spoolss_reply_rrpcn(struct cli_state *cli, POLICY_HND *handle,
2336 uint32 change_low, uint32 change_high, uint32 *status);
2337 BOOL cli_spoolss_reply_close_printer(struct cli_state *cli, POLICY_HND *handle, uint32 *status);
2339 /*The following definitions come from rpc_client/cli_use.c */
2341 void init_cli_use(void);
2342 void free_cli_use(void);
2343 struct cli_state *cli_net_use_add(const char *srv_name,
2344 const struct ntuser_creds *usr_creds,
2345 BOOL reuse, BOOL *is_new);
2346 BOOL cli_net_use_del(const char *srv_name,
2347 const struct ntuser_creds *usr_creds,
2348 BOOL force_close, BOOL *connection_closed);
2349 void cli_net_use_enum(uint32 *num_cons, struct use_info ***use);
2350 void cli_use_wait_keyboard(void);
2352 /*The following definitions come from rpc_client/ncacn_np_use.c */
2354 BOOL ncacn_np_use_del(const char *srv_name, const char *pipe_name,
2355 const vuser_key * key,
2356 BOOL force_close, BOOL *connection_closed);
2357 struct ncacn_np *ncacn_np_initialise(struct ncacn_np *msrpc,
2358 const vuser_key * key);
2359 struct ncacn_np *ncacn_np_use_add(const char *pipe_name,
2360 const vuser_key * key,
2361 const char *srv_name,
2362 const struct ntuser_creds *ntc,
2363 BOOL reuse, BOOL *is_new_connection);
2365 /*The following definitions come from rpc_parse/parse_creds.c */
2367 BOOL make_creds_unix(CREDS_UNIX *r_u, const char* user_name,
2368 const char* requested_name,
2369 const char* real_name,
2370 BOOL guest);
2371 BOOL creds_io_unix(char *desc, CREDS_UNIX *r_u, prs_struct *ps, int depth);
2372 void creds_free_unix(CREDS_UNIX *r_u);
2373 BOOL make_creds_unix_sec(CREDS_UNIX_SEC *r_u,
2374 uint32 uid, uint32 gid, uint32 num_grps, gid_t *grps);
2375 BOOL creds_io_unix_sec(char *desc, CREDS_UNIX_SEC *r_u, prs_struct *ps, int depth);
2376 void creds_free_unix_sec(CREDS_UNIX_SEC *r_u);
2377 BOOL make_creds_nt_sec(CREDS_NT_SEC *r_u,
2378 DOM_SID *sid, uint32 num_grps, uint32 *grps);
2379 BOOL creds_io_nt_sec(char *desc, CREDS_NT_SEC *r_u, prs_struct *ps, int depth);
2380 void creds_free_nt_sec(CREDS_NT_SEC *r_u);
2381 BOOL creds_io_pwd_info(char *desc, struct pwd_info *pwd, prs_struct *ps, int depth);
2382 BOOL creds_io_nt(char *desc, CREDS_NT *r_u, prs_struct *ps, int depth);
2383 void creds_free_nt(CREDS_NT *r_u);
2384 BOOL creds_io_hybrid(char *desc, CREDS_HYBRID *r_u, prs_struct *ps, int depth);
2385 void copy_unix_creds(CREDS_UNIX *to, const CREDS_UNIX *from);
2386 void copy_nt_sec_creds(CREDS_NT_SEC *to, const CREDS_NT_SEC *from);
2387 void copy_unix_sec_creds(CREDS_UNIX_SEC *to, const CREDS_UNIX_SEC *from);
2388 void create_ntc_from_cli_state (CREDS_NT *to, const struct cli_state *cli_from);
2389 void copy_nt_creds(struct ntuser_creds *to,
2390 const struct ntuser_creds *from);
2391 void copy_user_creds(struct user_creds *to,
2392 const struct user_creds *from);
2393 void free_user_creds(struct user_creds *creds);
2394 BOOL creds_io_cmd(char *desc, CREDS_CMD *r_u, prs_struct *ps, int depth);
2395 BOOL create_ntuser_creds( prs_struct *ps,
2396 const char* name,
2397 uint16 version, uint16 command,
2398 uint32 pid,
2399 const struct ntuser_creds *ntu,
2400 BOOL reuse);
2401 BOOL create_user_creds( prs_struct *ps,
2402 const char* name,
2403 uint16 version, uint16 command,
2404 uint32 pid,
2405 struct user_creds *usr);
2407 /*The following definitions come from rpc_parse/parse_dfs.c */
2409 BOOL dfs_io_q_dfs_exist(char *desc, DFS_Q_DFS_EXIST *q_d, prs_struct *ps, int depth);
2410 BOOL dfs_io_r_dfs_exist(char *desc, DFS_R_DFS_EXIST *q_d, prs_struct *ps, int depth);
2411 BOOL make_dfs_q_dfs_remove(DFS_Q_DFS_REMOVE *q_d, char *entrypath,
2412 char *servername, char *sharename);
2413 BOOL dfs_io_q_dfs_remove(char *desc, DFS_Q_DFS_REMOVE *q_d, prs_struct *ps, int depth);
2414 BOOL dfs_io_r_dfs_remove(char *desc, DFS_R_DFS_REMOVE *r_d, prs_struct *ps, int depth);
2415 BOOL make_dfs_q_dfs_add(DFS_Q_DFS_ADD *q_d, char *entrypath, char *servername,
2416 char *sharename, char *comment, uint32 flags);
2417 BOOL dfs_io_q_dfs_add(char *desc, DFS_Q_DFS_ADD *q_d, prs_struct *ps, int depth);
2418 BOOL dfs_io_r_dfs_add(char *desc, DFS_R_DFS_ADD *r_d, prs_struct *ps, int depth);
2419 BOOL dfs_io_q_dfs_get_info(char* desc, DFS_Q_DFS_GET_INFO* q_i, prs_struct* ps, int depth);
2420 BOOL dfs_io_r_dfs_get_info(char* desc, DFS_R_DFS_GET_INFO* r_i, prs_struct* ps, int depth);
2421 BOOL make_dfs_q_dfs_enum(DFS_Q_DFS_ENUM *q_d, uint32 level, DFS_INFO_CTR *ctr);
2422 BOOL dfs_io_q_dfs_enum(char *desc, DFS_Q_DFS_ENUM *q_d, prs_struct *ps, int depth);
2423 BOOL dfs_io_dfs_info_ctr(char* desc, DFS_INFO_CTR* ctr, uint32 num_entries, uint32 level, prs_struct* ps, int depth);
2424 BOOL dfs_io_r_dfs_enum(char *desc, DFS_R_DFS_ENUM *q_d, prs_struct *ps, int depth);
2425 BOOL dfs_io_dfs_storage_info(char *desc, DFS_INFO_3* info3, prs_struct *ps, int depth);
2427 /*The following definitions come from rpc_parse/parse_lsa.c */
2429 void init_lsa_trans_name(LSA_TRANS_NAME *trn, UNISTR2 *uni_name,
2430 uint16 sid_name_use, char *name, uint32 idx);
2431 void init_lsa_sec_qos(LSA_SEC_QOS *qos, uint16 imp_lev, uint8 ctxt, uint8 eff,
2432 uint32 unknown);
2433 void init_lsa_obj_attr(LSA_OBJ_ATTR *attr, uint32 attributes, LSA_SEC_QOS *qos);
2434 void init_q_open_pol(LSA_Q_OPEN_POL *r_q, uint16 system_name,
2435 uint32 attributes, uint32 desired_access,
2436 LSA_SEC_QOS *qos);
2437 BOOL lsa_io_q_open_pol(char *desc, LSA_Q_OPEN_POL *r_q, prs_struct *ps,
2438 int depth);
2439 BOOL lsa_io_r_open_pol(char *desc, LSA_R_OPEN_POL *r_p, prs_struct *ps,
2440 int depth);
2441 void init_q_open_pol2(LSA_Q_OPEN_POL2 *r_q, char *server_name,
2442 uint32 attributes, uint32 desired_access,
2443 LSA_SEC_QOS *qos);
2444 BOOL lsa_io_q_open_pol2(char *desc, LSA_Q_OPEN_POL2 *r_q, prs_struct *ps,
2445 int depth);
2446 BOOL lsa_io_r_open_pol2(char *desc, LSA_R_OPEN_POL2 *r_p, prs_struct *ps,
2447 int depth);
2448 void init_q_query_sec_obj(LSA_Q_QUERY_SEC_OBJ *q_q, const POLICY_HND *hnd,
2449 uint32 sec_info);
2450 BOOL lsa_io_q_query_sec_obj(char *desc, LSA_Q_QUERY_SEC_OBJ *q_q,
2451 prs_struct *ps, int depth);
2452 BOOL lsa_io_r_query_sec_obj(char *desc, LSA_R_QUERY_SEC_OBJ *r_u,
2453 prs_struct *ps, int depth);
2454 void init_q_query(LSA_Q_QUERY_INFO *q_q, POLICY_HND *hnd, uint16 info_class);
2455 BOOL lsa_io_q_query(char *desc, LSA_Q_QUERY_INFO *q_q, prs_struct *ps,
2456 int depth);
2457 BOOL init_q_enum_trust_dom(LSA_Q_ENUM_TRUST_DOM * q_e, POLICY_HND *pol,
2458 uint32 enum_context, uint32 preferred_len);
2459 BOOL lsa_io_q_enum_trust_dom(char *desc, LSA_Q_ENUM_TRUST_DOM *q_e,
2460 prs_struct *ps, int depth);
2461 void init_r_enum_trust_dom(LSA_R_ENUM_TRUST_DOM *r_e, uint32 enum_context,
2462 char *domain_name, DOM_SID *domain_sid,
2463 uint32 status);
2464 BOOL lsa_io_r_enum_trust_dom(char *desc, LSA_R_ENUM_TRUST_DOM *r_e,
2465 prs_struct *ps, int depth);
2466 void lsa_free_r_enum_trust_dom(LSA_R_ENUM_TRUST_DOM * r_e);
2467 BOOL lsa_io_dom_query_5(char *desc, DOM_QUERY_5 *d_q, prs_struct *ps, int depth);
2468 BOOL lsa_io_r_query(char *desc, LSA_R_QUERY_INFO *r_q, prs_struct *ps,
2469 int depth);
2470 void init_lsa_sid_enum(TALLOC_CTX *mem_ctx, LSA_SID_ENUM *sen,
2471 int num_entries, DOM_SID *sids);
2472 void init_q_lookup_sids(TALLOC_CTX *mem_ctx, LSA_Q_LOOKUP_SIDS *q_l,
2473 POLICY_HND *hnd, int num_sids, DOM_SID *sids,
2474 uint16 level);
2475 BOOL lsa_io_q_lookup_sids(char *desc, LSA_Q_LOOKUP_SIDS *q_s, prs_struct *ps,
2476 int depth);
2477 BOOL lsa_io_r_lookup_sids(char *desc, LSA_R_LOOKUP_SIDS *r_s,
2478 prs_struct *ps, int depth);
2479 void init_q_lookup_names(TALLOC_CTX *mem_ctx, LSA_Q_LOOKUP_NAMES *q_l,
2480 POLICY_HND *hnd, int num_names, char **names);
2481 BOOL lsa_io_q_lookup_names(char *desc, LSA_Q_LOOKUP_NAMES *q_r,
2482 prs_struct *ps, int depth);
2483 BOOL lsa_io_r_lookup_names(char *desc, LSA_R_LOOKUP_NAMES *r_r,
2484 prs_struct *ps, int depth);
2485 void init_lsa_q_close(LSA_Q_CLOSE *q_c, POLICY_HND *hnd);
2486 BOOL lsa_io_q_close(char *desc, LSA_Q_CLOSE *q_c, prs_struct *ps, int depth);
2487 BOOL lsa_io_r_close(char *desc, LSA_R_CLOSE *r_c, prs_struct *ps, int depth);
2488 BOOL lsa_io_q_open_secret(char *desc, LSA_Q_OPEN_SECRET *q_c, prs_struct *ps, int depth);
2489 BOOL lsa_io_r_open_secret(char *desc, LSA_R_OPEN_SECRET *r_c, prs_struct *ps, int depth);
2491 /*The following definitions come from rpc_parse/parse_misc.c */
2493 TALLOC_CTX *get_current_rpc_talloc(void);
2494 void set_current_rpc_talloc( TALLOC_CTX *ctx);
2495 void main_loop_talloc_free(void);
2496 TALLOC_CTX *main_loop_talloc_get(void);
2497 TALLOC_CTX *get_talloc_ctx(void);
2498 BOOL smb_io_time(char *desc, NTTIME *nttime, prs_struct *ps, int depth);
2499 BOOL smb_io_lookup_level(char *desc, LOOKUP_LEVEL *level, prs_struct *ps, int depth);
2500 uint32 get_enum_hnd(ENUM_HND *enh);
2501 void init_enum_hnd(ENUM_HND *enh, uint32 hnd);
2502 BOOL smb_io_enum_hnd(char *desc, ENUM_HND *hnd, prs_struct *ps, int depth);
2503 BOOL smb_io_dom_sid(char *desc, DOM_SID *sid, prs_struct *ps, int depth);
2504 void init_dom_sid(DOM_SID *sid, char *str_sid);
2505 void init_dom_sid2(DOM_SID2 *sid2, DOM_SID *sid);
2506 BOOL smb_io_dom_sid2(char *desc, DOM_SID2 *sid, prs_struct *ps, int depth);
2507 void init_str_hdr(STRHDR *hdr, int max_len, int len, uint32 buffer);
2508 BOOL smb_io_strhdr(char *desc, STRHDR *hdr, prs_struct *ps, int depth);
2509 void init_uni_hdr(UNIHDR *hdr, int len);
2510 BOOL smb_io_unihdr(char *desc, UNIHDR *hdr, prs_struct *ps, int depth);
2511 void init_buf_hdr(BUFHDR *hdr, int max_len, int len);
2512 BOOL smb_io_hdrbuf_pre(char *desc, BUFHDR *hdr, prs_struct *ps, int depth, uint32 *offset);
2513 BOOL smb_io_hdrbuf_post(char *desc, BUFHDR *hdr, prs_struct *ps, int depth,
2514 uint32 ptr_hdrbuf, uint32 max_len, uint32 len);
2515 BOOL smb_io_hdrbuf(char *desc, BUFHDR *hdr, prs_struct *ps, int depth);
2516 void init_uni_hdr2(UNIHDR2 *hdr, int len);
2517 BOOL smb_io_unihdr2(char *desc, UNIHDR2 *hdr2, prs_struct *ps, int depth);
2518 void init_unistr(UNISTR *str, const char *buf);
2519 BOOL smb_io_unistr(char *desc, UNISTR *uni, prs_struct *ps, int depth);
2520 void init_buffer3_uint32(BUFFER3 *str, uint32 val);
2521 void init_buffer3_str(BUFFER3 *str, char *buf, int len);
2522 void init_buffer3_hex(BUFFER3 *str, char *buf);
2523 void init_buffer3_bytes(BUFFER3 *str, uint8 *buf, int len);
2524 BOOL smb_io_buffer3(char *desc, BUFFER3 *buf3, prs_struct *ps, int depth);
2525 BOOL smb_io_buffer5(char *desc, BUFFER5 *buf5, prs_struct *ps, int depth);
2526 void init_buffer2(BUFFER2 *str, uint8 *buf, int len);
2527 BOOL smb_io_buffer2(char *desc, BUFFER2 *buf2, uint32 buffer, prs_struct *ps, int depth);
2528 void init_buf_unistr2(UNISTR2 *str, uint32 *ptr, const char *buf);
2529 void copy_unistr2(UNISTR2 *str, UNISTR2 *from);
2530 void init_string2(STRING2 *str, char *buf, int len);
2531 BOOL smb_io_string2(char *desc, STRING2 *str2, uint32 buffer, prs_struct *ps, int depth);
2532 void init_unistr2(UNISTR2 *str, const char *buf, size_t len);
2533 void init_unistr2_from_unistr (UNISTR2 *to, UNISTR *from);
2534 BOOL smb_io_unistr2(char *desc, UNISTR2 *uni2, uint32 buffer, prs_struct *ps, int depth);
2535 void init_dom_rid2(DOM_RID2 *rid2, uint32 rid, uint8 type, uint32 idx);
2536 BOOL smb_io_dom_rid2(char *desc, DOM_RID2 *rid2, prs_struct *ps, int depth);
2537 void init_dom_rid3(DOM_RID3 *rid3, uint32 rid, uint8 type);
2538 BOOL smb_io_dom_rid3(char *desc, DOM_RID3 *rid3, prs_struct *ps, int depth);
2539 void init_dom_rid4(DOM_RID4 *rid4, uint16 unknown, uint16 attr, uint32 rid);
2540 void init_log_info(DOM_LOG_INFO *log, char *logon_srv, char *acct_name,
2541 uint16 sec_chan, char *comp_name);
2542 BOOL smb_io_log_info(char *desc, DOM_LOG_INFO *log, prs_struct *ps, int depth);
2543 BOOL smb_io_chal(char *desc, DOM_CHAL *chal, prs_struct *ps, int depth);
2544 BOOL smb_io_cred(char *desc, DOM_CRED *cred, prs_struct *ps, int depth);
2545 void init_clnt_info2(DOM_CLNT_INFO2 *clnt,
2546 char *logon_srv, char *comp_name,
2547 DOM_CRED *clnt_cred);
2548 BOOL smb_io_clnt_info2(char *desc, DOM_CLNT_INFO2 *clnt, prs_struct *ps, int depth);
2549 void init_clnt_info(DOM_CLNT_INFO *clnt,
2550 char *logon_srv, char *acct_name,
2551 uint16 sec_chan, char *comp_name,
2552 DOM_CRED *cred);
2553 BOOL smb_io_clnt_info(char *desc, DOM_CLNT_INFO *clnt, prs_struct *ps, int depth);
2554 void init_logon_id(DOM_LOGON_ID *log, uint32 log_id_low, uint32 log_id_high);
2555 BOOL smb_io_logon_id(char *desc, DOM_LOGON_ID *log, prs_struct *ps, int depth);
2556 void init_owf_info(OWF_INFO *hash, uint8 data[16]);
2557 BOOL smb_io_owf_info(char *desc, OWF_INFO *hash, prs_struct *ps, int depth);
2558 BOOL smb_io_gid(char *desc, DOM_GID *gid, prs_struct *ps, int depth);
2559 BOOL smb_io_pol_hnd(char *desc, POLICY_HND *pol, prs_struct *ps, int depth);
2560 void init_unistr3(UNISTR3 *str, const char *buf);
2561 BOOL smb_io_unistr3(char *desc, UNISTR3 *name, prs_struct *ps, int depth);
2562 BOOL prs_uint64(char *name, prs_struct *ps, int depth, UINT64_S *data64);
2564 /*The following definitions come from rpc_parse/parse_net.c */
2566 BOOL net_io_q_logon_ctrl2(char *desc, NET_Q_LOGON_CTRL2 *q_l, prs_struct *ps, int depth);
2567 void init_r_logon_ctrl2(NET_R_LOGON_CTRL2 *r_l, uint32 query_level,
2568 uint32 flags, uint32 pdc_status, uint32 logon_attempts,
2569 uint32 tc_status, char *trusted_domain_name);
2570 BOOL net_io_r_logon_ctrl2(char *desc, NET_R_LOGON_CTRL2 *r_l, prs_struct *ps, int depth);
2571 void init_r_trust_dom(NET_R_TRUST_DOM_LIST *r_t,
2572 uint32 num_doms, char *dom_name);
2573 BOOL net_io_r_trust_dom(char *desc, NET_R_TRUST_DOM_LIST *r_t, prs_struct *ps, int depth);
2574 BOOL net_io_q_trust_dom(char *desc, NET_Q_TRUST_DOM_LIST *q_l, prs_struct *ps, int depth);
2575 void init_q_req_chal(NET_Q_REQ_CHAL *q_c,
2576 char *logon_srv, char *logon_clnt,
2577 DOM_CHAL *clnt_chal);
2578 BOOL net_io_q_req_chal(char *desc, NET_Q_REQ_CHAL *q_c, prs_struct *ps, int depth);
2579 BOOL net_io_r_req_chal(char *desc, NET_R_REQ_CHAL *r_c, prs_struct *ps, int depth);
2580 BOOL net_io_q_auth(char *desc, NET_Q_AUTH *q_a, prs_struct *ps, int depth);
2581 BOOL net_io_r_auth(char *desc, NET_R_AUTH *r_a, prs_struct *ps, int depth);
2582 void init_q_auth_2(NET_Q_AUTH_2 *q_a,
2583 char *logon_srv, char *acct_name, uint16 sec_chan, char *comp_name,
2584 DOM_CHAL *clnt_chal, uint32 clnt_flgs);
2585 BOOL net_io_q_auth_2(char *desc, NET_Q_AUTH_2 *q_a, prs_struct *ps, int depth);
2586 BOOL net_io_r_auth_2(char *desc, NET_R_AUTH_2 *r_a, prs_struct *ps, int depth);
2587 void init_q_srv_pwset(NET_Q_SRV_PWSET *q_s, char *logon_srv, char *acct_name,
2588 uint16 sec_chan, char *comp_name, DOM_CRED *cred, char nt_cypher[16]);
2589 BOOL net_io_q_srv_pwset(char *desc, NET_Q_SRV_PWSET *q_s, prs_struct *ps, int depth);
2590 BOOL net_io_r_srv_pwset(char *desc, NET_R_SRV_PWSET *r_s, prs_struct *ps, int depth);
2591 void init_id_info1(NET_ID_INFO_1 *id, char *domain_name,
2592 uint32 param_ctrl, uint32 log_id_low, uint32 log_id_high,
2593 char *user_name, char *wksta_name,
2594 char *sess_key,
2595 unsigned char lm_cypher[16], unsigned char nt_cypher[16]);
2596 void init_id_info2(NET_ID_INFO_2 *id, char *domain_name,
2597 uint32 param_ctrl, uint32 log_id_low, uint32 log_id_high,
2598 char *user_name, char *wksta_name,
2599 unsigned char lm_challenge[8],
2600 unsigned char *lm_chal_resp,
2601 unsigned char *nt_chal_resp);
2602 void init_sam_info(DOM_SAM_INFO *sam,
2603 char *logon_srv, char *comp_name, DOM_CRED *clnt_cred,
2604 DOM_CRED *rtn_cred, uint16 logon_level,
2605 NET_ID_INFO_CTR *ctr);
2606 void init_net_user_info3(TALLOC_CTX *ctx, NET_USER_INFO_3 *usr, SAM_ACCOUNT *sampw,
2607 uint16 logon_count, uint16 bad_pw_count,
2608 uint32 num_groups, DOM_GID *gids,
2609 uint32 user_flgs, char *sess_key,
2610 char *logon_srv, char *logon_dom,
2611 DOM_SID *dom_sid, char *other_sids);
2612 BOOL net_io_q_sam_logon(char *desc, NET_Q_SAM_LOGON *q_l, prs_struct *ps, int depth);
2613 BOOL net_io_r_sam_logon(char *desc, NET_R_SAM_LOGON *r_l, prs_struct *ps, int depth);
2614 BOOL net_io_q_sam_logoff(char *desc, NET_Q_SAM_LOGOFF *q_l, prs_struct *ps, int depth);
2615 BOOL net_io_r_sam_logoff(char *desc, NET_R_SAM_LOGOFF *r_l, prs_struct *ps, int depth);
2617 /*The following definitions come from rpc_parse/parse_prs.c */
2619 void prs_dump(char *name, int v, prs_struct *ps);
2620 void prs_debug(prs_struct *ps, int depth, char *desc, char *fn_name);
2621 BOOL prs_init(prs_struct *ps, uint32 size, TALLOC_CTX *ctx, BOOL io);
2622 BOOL prs_read(prs_struct *ps, int fd, size_t len, int timeout);
2623 void prs_mem_free(prs_struct *ps);
2624 char *prs_alloc_mem(prs_struct *ps, size_t size);
2625 TALLOC_CTX *prs_get_mem_context(prs_struct *ps);
2626 void prs_give_memory(prs_struct *ps, char *buf, uint32 size, BOOL is_dynamic);
2627 char *prs_take_memory(prs_struct *ps, uint32 *psize);
2628 BOOL prs_set_buffer_size(prs_struct *ps, uint32 newsize);
2629 BOOL prs_grow(prs_struct *ps, uint32 extra_space);
2630 BOOL prs_force_grow(prs_struct *ps, uint32 extra_space);
2631 char *prs_data_p(prs_struct *ps);
2632 uint32 prs_data_size(prs_struct *ps);
2633 uint32 prs_offset(prs_struct *ps);
2634 BOOL prs_set_offset(prs_struct *ps, uint32 offset);
2635 BOOL prs_append_prs_data(prs_struct *dst, prs_struct *src);
2636 BOOL prs_append_some_prs_data(prs_struct *dst, prs_struct *src, int32 start, uint32 len);
2637 BOOL prs_append_data(prs_struct *dst, char *src, uint32 len);
2638 void prs_set_endian_data(prs_struct *ps, BOOL endian);
2639 BOOL prs_align(prs_struct *ps);
2640 BOOL prs_align_needed(prs_struct *ps, uint32 needed);
2641 char *prs_mem_get(prs_struct *ps, uint32 extra_size);
2642 void prs_switch_type(prs_struct *ps, BOOL io);
2643 void prs_force_dynamic(prs_struct *ps);
2644 BOOL prs_uint8(char *name, prs_struct *ps, int depth, uint8 *data8);
2645 BOOL prs_uint16(char *name, prs_struct *ps, int depth, uint16 *data16);
2646 BOOL prs_uint32(char *name, prs_struct *ps, int depth, uint32 *data32);
2647 BOOL prs_uint8s(BOOL charmode, char *name, prs_struct *ps, int depth, uint8 *data8s, int len);
2648 BOOL prs_uint16s(BOOL charmode, char *name, prs_struct *ps, int depth, uint16 *data16s, int len);
2649 BOOL prs_uint16uni(BOOL charmode, char *name, prs_struct *ps, int depth, uint16 *data16s, int len);
2650 BOOL prs_uint32s(BOOL charmode, char *name, prs_struct *ps, int depth, uint32 *data32s, int len);
2651 BOOL prs_buffer5(BOOL charmode, char *name, prs_struct *ps, int depth, BUFFER5 *str);
2652 BOOL prs_buffer2(BOOL charmode, char *name, prs_struct *ps, int depth, BUFFER2 *str);
2653 BOOL prs_string2(BOOL charmode, char *name, prs_struct *ps, int depth, STRING2 *str);
2654 BOOL prs_unistr2(BOOL charmode, char *name, prs_struct *ps, int depth, UNISTR2 *str);
2655 BOOL prs_unistr3(BOOL charmode, char *name, UNISTR3 *str, prs_struct *ps, int depth);
2656 BOOL prs_unistr(char *name, prs_struct *ps, int depth, UNISTR *str);
2657 BOOL prs_string(char *name, prs_struct *ps, int depth, char *str, int len, int max_buf_size);
2658 BOOL prs_uint16_pre(char *name, prs_struct *ps, int depth, uint16 *data16, uint32 *offset);
2659 BOOL prs_uint16_post(char *name, prs_struct *ps, int depth, uint16 *data16,
2660 uint32 ptr_uint16, uint32 start_offset);
2661 BOOL prs_uint32_pre(char *name, prs_struct *ps, int depth, uint32 *data32, uint32 *offset);
2662 BOOL prs_uint32_post(char *name, prs_struct *ps, int depth, uint32 *data32,
2663 uint32 ptr_uint32, uint32 data_size);
2664 int tdb_prs_store(TDB_CONTEXT *tdb, char *keystr, prs_struct *ps);
2665 int tdb_prs_fetch(TDB_CONTEXT *tdb, char *keystr, prs_struct *ps, TALLOC_CTX *mem_ctx);
2667 /*The following definitions come from rpc_parse/parse_reg.c */
2669 void init_reg_q_open_hklm(REG_Q_OPEN_HKLM *q_o,
2670 uint16 unknown_0, uint32 level);
2671 BOOL reg_io_q_open_hklm(char *desc, REG_Q_OPEN_HKLM *r_q, prs_struct *ps, int depth);
2672 BOOL reg_io_r_open_hklm(char *desc, REG_R_OPEN_HKLM *r_r, prs_struct *ps, int depth);
2673 void init_reg_q_flush_key(REG_Q_FLUSH_KEY *q_u, POLICY_HND *pol);
2674 BOOL reg_io_q_flush_key(char *desc, REG_Q_FLUSH_KEY *r_q, prs_struct *ps, int depth);
2675 BOOL reg_io_r_flush_key(char *desc, REG_R_FLUSH_KEY *r_r, prs_struct *ps, int depth);
2676 void init_reg_q_create_key(REG_Q_CREATE_KEY *q_c, POLICY_HND *hnd,
2677 char *name, char *class, SEC_ACCESS *sam_access,
2678 SEC_DESC_BUF *sec_buf);
2679 BOOL reg_io_q_create_key(char *desc, REG_Q_CREATE_KEY *r_q, prs_struct *ps, int depth);
2680 BOOL reg_io_r_create_key(char *desc, REG_R_CREATE_KEY *r_r, prs_struct *ps, int depth);
2681 void init_reg_q_delete_val(REG_Q_DELETE_VALUE *q_c, POLICY_HND *hnd,
2682 char *name);
2683 BOOL reg_io_q_delete_val(char *desc, REG_Q_DELETE_VALUE *r_q, prs_struct *ps, int depth);
2684 BOOL reg_io_r_delete_val(char *desc, REG_R_DELETE_VALUE *r_r, prs_struct *ps, int depth);
2685 void init_reg_q_delete_key(REG_Q_DELETE_KEY *q_c, POLICY_HND *hnd,
2686 char *name);
2687 BOOL reg_io_q_delete_key(char *desc, REG_Q_DELETE_KEY *r_q, prs_struct *ps, int depth);
2688 BOOL reg_io_r_delete_key(char *desc, REG_R_DELETE_KEY *r_r, prs_struct *ps, int depth);
2689 void init_reg_q_query_key(REG_Q_QUERY_KEY *q_o, POLICY_HND *hnd,
2690 uint32 max_class_len);
2691 BOOL reg_io_q_query_key(char *desc, REG_Q_QUERY_KEY *r_q, prs_struct *ps, int depth);
2692 BOOL reg_io_r_query_key(char *desc, REG_R_QUERY_KEY *r_r, prs_struct *ps, int depth);
2693 void init_reg_q_unk_1a(REG_Q_UNK_1A *q_o, POLICY_HND *hnd);
2694 BOOL reg_io_q_unk_1a(char *desc, REG_Q_UNK_1A *r_q, prs_struct *ps, int depth);
2695 BOOL reg_io_r_unk_1a(char *desc, REG_R_UNK_1A *r_r, prs_struct *ps, int depth);
2696 void init_reg_q_open_hku(REG_Q_OPEN_HKU *q_o,
2697 uint16 unknown_0, uint32 level);
2698 BOOL reg_io_q_open_hku(char *desc, REG_Q_OPEN_HKU *r_q, prs_struct *ps, int depth);
2699 BOOL reg_io_r_open_hku(char *desc, REG_R_OPEN_HKU *r_r, prs_struct *ps, int depth);
2700 void init_reg_q_close(REG_Q_CLOSE *q_c, POLICY_HND *hnd);
2701 BOOL reg_io_q_close(char *desc, REG_Q_CLOSE *q_u, prs_struct *ps, int depth);
2702 BOOL reg_io_r_close(char *desc, REG_R_CLOSE *r_u, prs_struct *ps, int depth);
2703 void init_reg_q_set_key_sec(REG_Q_SET_KEY_SEC *q_i, POLICY_HND *pol, SEC_DESC_BUF *sec_desc_buf);
2704 BOOL reg_io_q_set_key_sec(char *desc, REG_Q_SET_KEY_SEC *r_q, prs_struct *ps, int depth);
2705 BOOL reg_io_r_set_key_sec(char *desc, REG_R_SET_KEY_SEC *r_q, prs_struct *ps, int depth);
2706 void init_reg_q_get_key_sec(REG_Q_GET_KEY_SEC *q_i, POLICY_HND *pol,
2707 uint32 sec_buf_size, SEC_DESC_BUF *psdb);
2708 BOOL reg_io_q_get_key_sec(char *desc, REG_Q_GET_KEY_SEC *r_q, prs_struct *ps, int depth);
2709 BOOL reg_io_r_get_key_sec(char *desc, REG_R_GET_KEY_SEC *r_q, prs_struct *ps, int depth);
2710 BOOL init_reg_q_info(REG_Q_INFO *q_i, POLICY_HND *pol, char* val_name);
2711 BOOL reg_io_q_info(char *desc, REG_Q_INFO *r_q, prs_struct *ps, int depth);
2712 BOOL init_reg_r_info(uint32 include_keyval, REG_R_INFO *r_r,
2713 BUFFER2* buf, uint32 type, uint32 status);
2714 BOOL reg_io_r_info(char *desc, REG_R_INFO *r_r, prs_struct *ps, int depth);
2715 void init_reg_q_enum_val(REG_Q_ENUM_VALUE *q_i, POLICY_HND *pol,
2716 uint32 val_idx, uint32 max_val_len,
2717 uint32 max_buf_len);
2718 BOOL reg_io_q_enum_val(char *desc, REG_Q_ENUM_VALUE *q_q, prs_struct *ps, int depth);
2719 BOOL reg_io_r_enum_val(char *desc, REG_R_ENUM_VALUE *r_q, prs_struct *ps, int depth);
2720 void init_reg_q_create_val(REG_Q_CREATE_VALUE *q_i, POLICY_HND *pol,
2721 char *val_name, uint32 type,
2722 BUFFER3 *val);
2723 BOOL reg_io_q_create_val(char *desc, REG_Q_CREATE_VALUE *q_q, prs_struct *ps, int depth);
2724 BOOL reg_io_r_create_val(char *desc, REG_R_CREATE_VALUE *r_q, prs_struct *ps, int depth);
2725 void init_reg_q_enum_key(REG_Q_ENUM_KEY *q_i, POLICY_HND *pol, uint32 key_idx);
2726 BOOL reg_io_q_enum_key(char *desc, REG_Q_ENUM_KEY *q_q, prs_struct *ps, int depth);
2727 BOOL reg_io_r_enum_key(char *desc, REG_R_ENUM_KEY *r_q, prs_struct *ps, int depth);
2728 void init_reg_q_open_entry(REG_Q_OPEN_ENTRY *r_q, POLICY_HND *pol,
2729 char *key_name, uint32 unk);
2730 BOOL reg_io_q_open_entry(char *desc, REG_Q_OPEN_ENTRY *r_q, prs_struct *ps, int depth);
2731 void init_reg_r_open_entry(REG_R_OPEN_ENTRY *r_r,
2732 POLICY_HND *pol, uint32 status);
2733 BOOL reg_io_r_open_entry(char *desc, REG_R_OPEN_ENTRY *r_r, prs_struct *ps, int depth);
2735 /*The following definitions come from rpc_parse/parse_rpc.c */
2737 void init_rpc_hdr(RPC_HDR *hdr, enum RPC_PKT_TYPE pkt_type, uint8 flags,
2738 uint32 call_id, int data_len, int auth_len);
2739 BOOL smb_io_rpc_hdr(char *desc, RPC_HDR *rpc, prs_struct *ps, int depth);
2740 void init_rpc_hdr_rb(RPC_HDR_RB *rpc,
2741 uint16 max_tsize, uint16 max_rsize, uint32 assoc_gid,
2742 uint32 num_elements, uint16 context_id, uint8 num_syntaxes,
2743 RPC_IFACE *abstract, RPC_IFACE *transfer);
2744 BOOL smb_io_rpc_hdr_rb(char *desc, RPC_HDR_RB *rpc, prs_struct *ps, int depth);
2745 void init_rpc_hdr_ba(RPC_HDR_BA *rpc,
2746 uint16 max_tsize, uint16 max_rsize, uint32 assoc_gid,
2747 char *pipe_addr,
2748 uint8 num_results, uint16 result, uint16 reason,
2749 RPC_IFACE *transfer);
2750 BOOL smb_io_rpc_hdr_ba(char *desc, RPC_HDR_BA *rpc, prs_struct *ps, int depth);
2751 void init_rpc_hdr_req(RPC_HDR_REQ *hdr, uint32 alloc_hint, uint16 opnum);
2752 BOOL smb_io_rpc_hdr_req(char *desc, RPC_HDR_REQ *rpc, prs_struct *ps, int depth);
2753 BOOL smb_io_rpc_hdr_resp(char *desc, RPC_HDR_RESP *rpc, prs_struct *ps, int depth);
2754 BOOL smb_io_rpc_hdr_fault(char *desc, RPC_HDR_FAULT *rpc, prs_struct *ps, int depth);
2755 void init_rpc_hdr_autha(RPC_HDR_AUTHA *rai,
2756 uint16 max_tsize, uint16 max_rsize,
2757 uint8 auth_type, uint8 auth_level,
2758 uint8 stub_type_len);
2759 BOOL smb_io_rpc_hdr_autha(char *desc, RPC_HDR_AUTHA *rai, prs_struct *ps, int depth);
2760 BOOL rpc_hdr_auth_chk(RPC_HDR_AUTH *rai);
2761 void init_rpc_hdr_auth(RPC_HDR_AUTH *rai,
2762 uint8 auth_type, uint8 auth_level,
2763 uint8 stub_type_len,
2764 uint32 ptr);
2765 BOOL smb_io_rpc_hdr_auth(char *desc, RPC_HDR_AUTH *rai, prs_struct *ps, int depth);
2766 BOOL rpc_auth_verifier_chk(RPC_AUTH_VERIFIER *rav,
2767 char *signature, uint32 msg_type);
2768 void init_rpc_auth_verifier(RPC_AUTH_VERIFIER *rav,
2769 char *signature, uint32 msg_type);
2770 BOOL smb_io_rpc_auth_verifier(char *desc, RPC_AUTH_VERIFIER *rav, prs_struct *ps, int depth);
2771 void init_rpc_auth_ntlmssp_neg(RPC_AUTH_NTLMSSP_NEG *neg,
2772 uint32 neg_flgs,
2773 fstring myname, fstring domain);
2774 BOOL smb_io_rpc_auth_ntlmssp_neg(char *desc, RPC_AUTH_NTLMSSP_NEG *neg, prs_struct *ps, int depth);
2775 void init_rpc_auth_ntlmssp_chal(RPC_AUTH_NTLMSSP_CHAL *chl,
2776 uint32 neg_flags,
2777 uint8 challenge[8]);
2778 BOOL smb_io_rpc_auth_ntlmssp_chal(char *desc, RPC_AUTH_NTLMSSP_CHAL *chl, prs_struct *ps, int depth);
2779 void init_rpc_auth_ntlmssp_resp(RPC_AUTH_NTLMSSP_RESP *rsp,
2780 uchar lm_resp[24], uchar nt_resp[24],
2781 char *domain, char *user, char *wks,
2782 uint32 neg_flags);
2783 BOOL smb_io_rpc_auth_ntlmssp_resp(char *desc, RPC_AUTH_NTLMSSP_RESP *rsp, prs_struct *ps, int depth);
2784 BOOL rpc_auth_ntlmssp_chk(RPC_AUTH_NTLMSSP_CHK *chk, uint32 crc32, uint32 seq_num);
2785 void init_rpc_auth_ntlmssp_chk(RPC_AUTH_NTLMSSP_CHK *chk,
2786 uint32 ver, uint32 crc32, uint32 seq_num);
2787 BOOL smb_io_rpc_auth_ntlmssp_chk(char *desc, RPC_AUTH_NTLMSSP_CHK *chk, prs_struct *ps, int depth);
2789 /*The following definitions come from rpc_parse/parse_samr.c */
2791 void init_samr_q_close_hnd(SAMR_Q_CLOSE_HND * q_c, POLICY_HND *hnd);
2792 BOOL samr_io_q_close_hnd(char *desc, SAMR_Q_CLOSE_HND * q_u,
2793 prs_struct *ps, int depth);
2794 BOOL samr_io_r_close_hnd(char *desc, SAMR_R_CLOSE_HND * r_u,
2795 prs_struct *ps, int depth);
2796 void init_samr_q_lookup_domain(SAMR_Q_LOOKUP_DOMAIN * q_u,
2797 POLICY_HND *pol, char *dom_name);
2798 BOOL samr_io_q_lookup_domain(char *desc, SAMR_Q_LOOKUP_DOMAIN * q_u,
2799 prs_struct *ps, int depth);
2800 void init_samr_r_lookup_domain(SAMR_R_LOOKUP_DOMAIN * r_u,
2801 DOM_SID *dom_sid, uint32 status);
2802 BOOL samr_io_r_lookup_domain(char *desc, SAMR_R_LOOKUP_DOMAIN * r_u,
2803 prs_struct *ps, int depth);
2804 void init_samr_q_unknown_2d(SAMR_Q_UNKNOWN_2D * q_u, POLICY_HND *dom_pol, DOM_SID *sid);
2805 BOOL samr_io_q_unknown_2d(char *desc, SAMR_Q_UNKNOWN_2D * q_u,
2806 prs_struct *ps, int depth);
2807 BOOL samr_io_r_unknown_2d(char *desc, SAMR_R_UNKNOWN_2D * r_u,
2808 prs_struct *ps, int depth);
2809 void init_samr_q_open_domain(SAMR_Q_OPEN_DOMAIN * q_u,
2810 POLICY_HND *pol, uint32 flags,
2811 DOM_SID *sid);
2812 BOOL samr_io_q_open_domain(char *desc, SAMR_Q_OPEN_DOMAIN * q_u,
2813 prs_struct *ps, int depth);
2814 BOOL samr_io_r_open_domain(char *desc, SAMR_R_OPEN_DOMAIN * r_u,
2815 prs_struct *ps, int depth);
2816 void init_samr_q_get_usrdom_pwinfo(SAMR_Q_GET_USRDOM_PWINFO * q_u,
2817 POLICY_HND *user_pol);
2818 BOOL samr_io_q_get_usrdom_pwinfo(char *desc, SAMR_Q_GET_USRDOM_PWINFO * q_u,
2819 prs_struct *ps, int depth);
2820 void init_samr_r_get_usrdom_pwinfo(SAMR_R_GET_USRDOM_PWINFO *r_u, uint32 status);
2821 BOOL samr_io_r_get_usrdom_pwinfo(char *desc, SAMR_R_GET_USRDOM_PWINFO * r_u,
2822 prs_struct *ps, int depth);
2823 void init_samr_q_query_sec_obj(SAMR_Q_QUERY_SEC_OBJ * q_u,
2824 POLICY_HND *user_pol, uint32 sec_info);
2825 BOOL samr_io_q_query_sec_obj(char *desc, SAMR_Q_QUERY_SEC_OBJ * q_u,
2826 prs_struct *ps, int depth);
2827 void init_samr_q_query_dom_info(SAMR_Q_QUERY_DOMAIN_INFO * q_u,
2828 POLICY_HND *domain_pol, uint16 switch_value);
2829 BOOL samr_io_q_query_dom_info(char *desc, SAMR_Q_QUERY_DOMAIN_INFO * q_u,
2830 prs_struct *ps, int depth);
2831 void init_unk_info3(SAM_UNK_INFO_3 * u_3);
2832 void init_unk_info6(SAM_UNK_INFO_6 * u_6);
2833 void init_unk_info7(SAM_UNK_INFO_7 * u_7);
2834 void init_unk_info12(SAM_UNK_INFO_12 * u_12);
2835 void init_unk_info2(SAM_UNK_INFO_2 * u_2,
2836 char *domain, char *server,
2837 uint32 seq_num);
2838 void init_unk_info1(SAM_UNK_INFO_1 * u_1);
2839 void init_samr_r_query_dom_info(SAMR_R_QUERY_DOMAIN_INFO * r_u,
2840 uint16 switch_value, SAM_UNK_CTR * ctr,
2841 uint32 status);
2842 BOOL samr_io_r_query_dom_info(char *desc, SAMR_R_QUERY_DOMAIN_INFO * r_u,
2843 prs_struct *ps, int depth);
2844 BOOL samr_io_r_query_sec_obj(char *desc, SAMR_R_QUERY_SEC_OBJ * r_u,
2845 prs_struct *ps, int depth);
2846 void init_sam_entry(SAM_ENTRY * sam, uint32 len_sam_name, uint32 rid);
2847 void init_samr_q_enum_dom_users(SAMR_Q_ENUM_DOM_USERS * q_e, POLICY_HND *pol,
2848 uint32 start_idx,
2849 uint16 acb_mask, uint16 unk_1, uint32 size);
2850 BOOL samr_io_q_enum_dom_users(char *desc, SAMR_Q_ENUM_DOM_USERS * q_e,
2851 prs_struct *ps, int depth);
2852 void init_samr_r_enum_dom_users(SAMR_R_ENUM_DOM_USERS * r_u,
2853 uint32 next_idx, uint32 num_sam_entries);
2854 BOOL samr_io_r_enum_dom_users(char *desc, SAMR_R_ENUM_DOM_USERS * r_u,
2855 prs_struct *ps, int depth);
2856 void init_samr_q_query_dispinfo(SAMR_Q_QUERY_DISPINFO * q_e, POLICY_HND *pol,
2857 uint16 switch_level, uint32 start_idx,
2858 uint32 max_entries);
2859 BOOL samr_io_q_query_dispinfo(char *desc, SAMR_Q_QUERY_DISPINFO * q_e,
2860 prs_struct *ps, int depth);
2861 void init_sam_dispinfo_1(SAM_DISPINFO_1 * sam, uint32 *num_entries,
2862 uint32 *data_size, uint32 start_idx,
2863 SAM_USER_INFO_21 pass[MAX_SAM_ENTRIES]);
2864 void init_sam_dispinfo_2(SAM_DISPINFO_2 * sam, uint32 *num_entries,
2865 uint32 *data_size, uint32 start_idx,
2866 SAM_USER_INFO_21 pass[MAX_SAM_ENTRIES]);
2867 void init_sam_dispinfo_3(SAM_DISPINFO_3 * sam, uint32 *num_entries,
2868 uint32 *data_size, uint32 start_idx,
2869 DOMAIN_GRP * grp);
2870 void init_sam_dispinfo_4(SAM_DISPINFO_4 * sam, uint32 *num_entries,
2871 uint32 *data_size, uint32 start_idx,
2872 SAM_USER_INFO_21 pass[MAX_SAM_ENTRIES]);
2873 void init_sam_dispinfo_5(SAM_DISPINFO_5 * sam, uint32 *num_entries,
2874 uint32 *data_size, uint32 start_idx,
2875 DOMAIN_GRP * grp);
2876 void init_samr_r_query_dispinfo(SAMR_R_QUERY_DISPINFO * r_u,
2877 uint32 num_entries, uint32 data_size,
2878 uint16 switch_level, SAM_DISPINFO_CTR * ctr,
2879 uint32 status);
2880 BOOL samr_io_r_query_dispinfo(char *desc, SAMR_R_QUERY_DISPINFO * r_u,
2881 prs_struct *ps, int depth);
2882 void init_samr_q_open_group(SAMR_Q_OPEN_GROUP * q_c,
2883 POLICY_HND *hnd,
2884 uint32 access_mask, uint32 rid);
2885 BOOL samr_io_q_open_group(char *desc, SAMR_Q_OPEN_GROUP * q_u,
2886 prs_struct *ps, int depth);
2887 BOOL samr_io_r_open_group(char *desc, SAMR_R_OPEN_GROUP * r_u,
2888 prs_struct *ps, int depth);
2889 void init_samr_group_info1(GROUP_INFO1 * gr1,
2890 char *acct_name, char *acct_desc,
2891 uint32 num_members);
2892 BOOL samr_io_group_info1(char *desc, GROUP_INFO1 * gr1,
2893 prs_struct *ps, int depth);
2894 void init_samr_group_info4(GROUP_INFO4 * gr4, char *acct_desc);
2895 BOOL samr_io_group_info4(char *desc, GROUP_INFO4 * gr4,
2896 prs_struct *ps, int depth);
2897 void init_samr_q_create_dom_group(SAMR_Q_CREATE_DOM_GROUP * q_e,
2898 POLICY_HND *pol, char *acct_desc,
2899 uint32 access_mask);
2900 BOOL samr_io_q_create_dom_group(char *desc, SAMR_Q_CREATE_DOM_GROUP * q_e,
2901 prs_struct *ps, int depth);
2902 BOOL samr_io_r_create_dom_group(char *desc, SAMR_R_CREATE_DOM_GROUP * r_u,
2903 prs_struct *ps, int depth);
2904 void init_samr_q_delete_dom_group(SAMR_Q_DELETE_DOM_GROUP * q_c,
2905 POLICY_HND *hnd);
2906 BOOL samr_io_q_delete_dom_group(char *desc, SAMR_Q_DELETE_DOM_GROUP * q_u,
2907 prs_struct *ps, int depth);
2908 BOOL samr_io_r_delete_dom_group(char *desc, SAMR_R_DELETE_DOM_GROUP * r_u,
2909 prs_struct *ps, int depth);
2910 void init_samr_q_del_groupmem(SAMR_Q_DEL_GROUPMEM * q_e,
2911 POLICY_HND *pol, uint32 rid);
2912 BOOL samr_io_q_del_groupmem(char *desc, SAMR_Q_DEL_GROUPMEM * q_e,
2913 prs_struct *ps, int depth);
2914 void init_samr_r_del_groupmem(SAMR_R_DEL_GROUPMEM * r_u, POLICY_HND *pol,
2915 uint32 status);
2916 BOOL samr_io_r_del_groupmem(char *desc, SAMR_R_DEL_GROUPMEM * r_u,
2917 prs_struct *ps, int depth);
2918 void init_samr_q_add_groupmem(SAMR_Q_ADD_GROUPMEM * q_e,
2919 POLICY_HND *pol, uint32 rid);
2920 BOOL samr_io_q_add_groupmem(char *desc, SAMR_Q_ADD_GROUPMEM * q_e,
2921 prs_struct *ps, int depth);
2922 void init_samr_r_add_groupmem(SAMR_R_ADD_GROUPMEM * r_u, POLICY_HND *pol,
2923 uint32 status);
2924 BOOL samr_io_r_add_groupmem(char *desc, SAMR_R_ADD_GROUPMEM * r_u,
2925 prs_struct *ps, int depth);
2926 void init_samr_q_set_groupinfo(SAMR_Q_SET_GROUPINFO * q_e,
2927 POLICY_HND *pol, GROUP_INFO_CTR * ctr);
2928 BOOL samr_io_q_set_groupinfo(char *desc, SAMR_Q_SET_GROUPINFO * q_e,
2929 prs_struct *ps, int depth);
2930 void init_samr_r_set_groupinfo(SAMR_R_SET_GROUPINFO * r_u, uint32 status);
2931 BOOL samr_io_r_set_groupinfo(char *desc, SAMR_R_SET_GROUPINFO * r_u,
2932 prs_struct *ps, int depth);
2933 void init_samr_q_query_groupinfo(SAMR_Q_QUERY_GROUPINFO * q_e,
2934 POLICY_HND *pol, uint16 switch_level);
2935 BOOL samr_io_q_query_groupinfo(char *desc, SAMR_Q_QUERY_GROUPINFO * q_e,
2936 prs_struct *ps, int depth);
2937 void init_samr_r_query_groupinfo(SAMR_R_QUERY_GROUPINFO * r_u,
2938 GROUP_INFO_CTR * ctr, uint32 status);
2939 BOOL samr_io_r_query_groupinfo(char *desc, SAMR_R_QUERY_GROUPINFO * r_u,
2940 prs_struct *ps, int depth);
2941 void init_samr_q_query_groupmem(SAMR_Q_QUERY_GROUPMEM * q_c, POLICY_HND *hnd);
2942 BOOL samr_io_q_query_groupmem(char *desc, SAMR_Q_QUERY_GROUPMEM * q_u,
2943 prs_struct *ps, int depth);
2944 void init_samr_r_query_groupmem(SAMR_R_QUERY_GROUPMEM * r_u,
2945 uint32 num_entries, uint32 *rid,
2946 uint32 *attr, uint32 status);
2947 BOOL samr_io_r_query_groupmem(char *desc, SAMR_R_QUERY_GROUPMEM * r_u,
2948 prs_struct *ps, int depth);
2949 void init_samr_q_query_usergroups(SAMR_Q_QUERY_USERGROUPS * q_u,
2950 POLICY_HND *hnd);
2951 BOOL samr_io_q_query_usergroups(char *desc, SAMR_Q_QUERY_USERGROUPS * q_u,
2952 prs_struct *ps, int depth);
2953 void init_samr_r_query_usergroups(SAMR_R_QUERY_USERGROUPS * r_u,
2954 uint32 num_gids, DOM_GID * gid,
2955 uint32 status);
2956 BOOL samr_io_gids(char *desc, uint32 *num_gids, DOM_GID ** gid,
2957 prs_struct *ps, int depth);
2958 BOOL samr_io_r_query_usergroups(char *desc, SAMR_R_QUERY_USERGROUPS * r_u,
2959 prs_struct *ps, int depth);
2960 void init_samr_q_enum_domains(SAMR_Q_ENUM_DOMAINS * q_e,
2961 POLICY_HND *pol,
2962 uint32 start_idx, uint32 size);
2963 BOOL samr_io_q_enum_domains(char *desc, SAMR_Q_ENUM_DOMAINS * q_e,
2964 prs_struct *ps, int depth);
2965 void init_samr_r_enum_domains(SAMR_R_ENUM_DOMAINS * r_u,
2966 uint32 next_idx, uint32 num_sam_entries);
2967 BOOL samr_io_r_enum_domains(char *desc, SAMR_R_ENUM_DOMAINS * r_u,
2968 prs_struct *ps, int depth);
2969 void init_samr_q_enum_dom_groups(SAMR_Q_ENUM_DOM_GROUPS * q_e,
2970 POLICY_HND *pol,
2971 uint32 start_idx, uint32 size);
2972 BOOL samr_io_q_enum_dom_groups(char *desc, SAMR_Q_ENUM_DOM_GROUPS * q_e,
2973 prs_struct *ps, int depth);
2974 void init_samr_r_enum_dom_groups(SAMR_R_ENUM_DOM_GROUPS * r_u,
2975 uint32 next_idx, uint32 num_sam_entries);
2976 BOOL samr_io_r_enum_dom_groups(char *desc, SAMR_R_ENUM_DOM_GROUPS * r_u,
2977 prs_struct *ps, int depth);
2978 void init_samr_q_enum_dom_aliases(SAMR_Q_ENUM_DOM_ALIASES * q_e,
2979 POLICY_HND *pol, uint32 start_idx,
2980 uint32 size);
2981 BOOL samr_io_q_enum_dom_aliases(char *desc, SAMR_Q_ENUM_DOM_ALIASES * q_e,
2982 prs_struct *ps, int depth);
2983 void init_samr_r_enum_dom_aliases(SAMR_R_ENUM_DOM_ALIASES *r_u, uint32 next_idx, uint32 num_sam_entries);
2984 BOOL samr_io_r_enum_dom_aliases(char *desc, SAMR_R_ENUM_DOM_ALIASES * r_u,
2985 prs_struct *ps, int depth);
2986 void init_samr_alias_info3(ALIAS_INFO3 * al3, char *acct_desc);
2987 BOOL samr_io_alias_info3(char *desc, ALIAS_INFO3 * al3,
2988 prs_struct *ps, int depth);
2989 BOOL samr_alias_info_ctr(char *desc, ALIAS_INFO_CTR * ctr,
2990 prs_struct *ps, int depth);
2991 void init_samr_q_query_aliasinfo(SAMR_Q_QUERY_ALIASINFO * q_e,
2992 POLICY_HND *pol, uint16 switch_level);
2993 BOOL samr_io_q_query_aliasinfo(char *desc, SAMR_Q_QUERY_ALIASINFO * q_e,
2994 prs_struct *ps, int depth);
2995 void init_samr_r_query_aliasinfo(SAMR_R_QUERY_ALIASINFO * r_u,
2996 ALIAS_INFO_CTR * ctr, uint32 status);
2997 BOOL samr_io_r_query_aliasinfo(char *desc, SAMR_R_QUERY_ALIASINFO * r_u,
2998 prs_struct *ps, int depth);
2999 void init_samr_q_set_aliasinfo(SAMR_Q_SET_ALIASINFO * q_u,
3000 POLICY_HND *hnd, ALIAS_INFO_CTR * ctr);
3001 BOOL samr_io_q_set_aliasinfo(char *desc, SAMR_Q_SET_ALIASINFO * q_u,
3002 prs_struct *ps, int depth);
3003 BOOL samr_io_r_set_aliasinfo(char *desc, SAMR_R_SET_ALIASINFO * r_u,
3004 prs_struct *ps, int depth);
3005 void init_samr_q_query_useraliases(SAMR_Q_QUERY_USERALIASES * q_u,
3006 POLICY_HND *hnd,
3007 uint32 num_sids,
3008 uint32 *ptr_sid, DOM_SID2 * sid);
3009 BOOL samr_io_q_query_useraliases(char *desc, SAMR_Q_QUERY_USERALIASES * q_u,
3010 prs_struct *ps, int depth);
3011 void init_samr_r_query_useraliases(SAMR_R_QUERY_USERALIASES * r_u,
3012 uint32 num_rids, uint32 *rid,
3013 uint32 status);
3014 BOOL samr_io_rids(char *desc, uint32 *num_rids, uint32 **rid,
3015 prs_struct *ps, int depth);
3016 BOOL samr_io_r_query_useraliases(char *desc, SAMR_R_QUERY_USERALIASES * r_u,
3017 prs_struct *ps, int depth);
3018 void init_samr_q_open_alias(SAMR_Q_OPEN_ALIAS * q_u, POLICY_HND *pol,
3019 uint32 access_mask, uint32 rid);
3020 BOOL samr_io_q_open_alias(char *desc, SAMR_Q_OPEN_ALIAS * q_u,
3021 prs_struct *ps, int depth);
3022 BOOL samr_io_r_open_alias(char *desc, SAMR_R_OPEN_ALIAS * r_u,
3023 prs_struct *ps, int depth);
3024 void init_samr_q_lookup_rids(TALLOC_CTX *ctx, SAMR_Q_LOOKUP_RIDS * q_u,
3025 POLICY_HND *pol, uint32 flags,
3026 uint32 num_rids, uint32 *rid);
3027 BOOL samr_io_q_lookup_rids(char *desc, SAMR_Q_LOOKUP_RIDS * q_u,
3028 prs_struct *ps, int depth);
3029 void init_samr_r_lookup_rids(SAMR_R_LOOKUP_RIDS * r_u,
3030 uint32 num_names, UNIHDR * hdr_name,
3031 UNISTR2 *uni_name, uint32 *type);
3032 BOOL samr_io_r_lookup_rids(char *desc, SAMR_R_LOOKUP_RIDS * r_u,
3033 prs_struct *ps, int depth);
3034 void init_samr_q_delete_alias(SAMR_Q_DELETE_DOM_ALIAS * q_u, POLICY_HND *hnd);
3035 BOOL samr_io_q_delete_alias(char *desc, SAMR_Q_DELETE_DOM_ALIAS * q_u,
3036 prs_struct *ps, int depth);
3037 BOOL samr_io_r_delete_alias(char *desc, SAMR_R_DELETE_DOM_ALIAS * r_u,
3038 prs_struct *ps, int depth);
3039 void init_samr_q_create_dom_alias(SAMR_Q_CREATE_DOM_ALIAS * q_u,
3040 POLICY_HND *hnd, char *acct_desc);
3041 BOOL samr_io_q_create_dom_alias(char *desc, SAMR_Q_CREATE_DOM_ALIAS * q_u,
3042 prs_struct *ps, int depth);
3043 BOOL samr_io_r_create_dom_alias(char *desc, SAMR_R_CREATE_DOM_ALIAS * r_u,
3044 prs_struct *ps, int depth);
3045 void init_samr_q_add_aliasmem(SAMR_Q_ADD_ALIASMEM * q_u, POLICY_HND *hnd,
3046 DOM_SID *sid);
3047 BOOL samr_io_q_add_aliasmem(char *desc, SAMR_Q_ADD_ALIASMEM * q_u,
3048 prs_struct *ps, int depth);
3049 BOOL samr_io_r_add_aliasmem(char *desc, SAMR_R_ADD_ALIASMEM * r_u,
3050 prs_struct *ps, int depth);
3051 void init_samr_q_del_aliasmem(SAMR_Q_DEL_ALIASMEM * q_u, POLICY_HND *hnd,
3052 DOM_SID *sid);
3053 BOOL samr_io_q_del_aliasmem(char *desc, SAMR_Q_DEL_ALIASMEM * q_u,
3054 prs_struct *ps, int depth);
3055 BOOL samr_io_r_del_aliasmem(char *desc, SAMR_R_DEL_ALIASMEM * r_u,
3056 prs_struct *ps, int depth);
3057 void init_samr_q_delete_dom_alias(SAMR_Q_DELETE_DOM_ALIAS * q_c,
3058 POLICY_HND *hnd);
3059 BOOL samr_io_q_delete_dom_alias(char *desc, SAMR_Q_DELETE_DOM_ALIAS * q_u,
3060 prs_struct *ps, int depth);
3061 void init_samr_r_delete_dom_alias(SAMR_R_DELETE_DOM_ALIAS * r_u,
3062 uint32 status);
3063 BOOL samr_io_r_delete_dom_alias(char *desc, SAMR_R_DELETE_DOM_ALIAS * r_u,
3064 prs_struct *ps, int depth);
3065 void init_samr_q_query_aliasmem(SAMR_Q_QUERY_ALIASMEM * q_c,
3066 POLICY_HND *hnd);
3067 BOOL samr_io_q_query_aliasmem(char *desc, SAMR_Q_QUERY_ALIASMEM * q_u,
3068 prs_struct *ps, int depth);
3069 void init_samr_r_query_aliasmem(SAMR_R_QUERY_ALIASMEM * r_u,
3070 uint32 num_sids, DOM_SID2 * sid,
3071 uint32 status);
3072 BOOL samr_io_r_query_aliasmem(char *desc, SAMR_R_QUERY_ALIASMEM * r_u,
3073 prs_struct *ps, int depth);
3074 void init_samr_q_lookup_names(SAMR_Q_LOOKUP_NAMES * q_u,
3075 POLICY_HND *pol, uint32 flags,
3076 uint32 num_names, char **name);
3077 BOOL samr_io_q_lookup_names(char *desc, SAMR_Q_LOOKUP_NAMES * q_u,
3078 prs_struct *ps, int depth);
3079 void init_samr_r_lookup_names(TALLOC_CTX *ctx, SAMR_R_LOOKUP_NAMES * r_u,
3080 uint32 num_rids,
3081 uint32 *rid, uint32 *type,
3082 uint32 status);
3083 BOOL samr_io_r_lookup_names(char *desc, SAMR_R_LOOKUP_NAMES * r_u,
3084 prs_struct *ps, int depth);
3085 void init_samr_q_delete_dom_user(SAMR_Q_DELETE_DOM_USER * q_c,
3086 POLICY_HND *hnd);
3087 BOOL samr_io_q_delete_dom_user(char *desc, SAMR_Q_DELETE_DOM_USER * q_u,
3088 prs_struct *ps, int depth);
3089 BOOL samr_io_r_delete_dom_user(char *desc, SAMR_R_DELETE_DOM_USER * r_u,
3090 prs_struct *ps, int depth);
3091 void init_samr_q_open_user(SAMR_Q_OPEN_USER * q_u,
3092 POLICY_HND *pol,
3093 uint32 access_mask, uint32 rid);
3094 BOOL samr_io_q_open_user(char *desc, SAMR_Q_OPEN_USER * q_u,
3095 prs_struct *ps, int depth);
3096 BOOL samr_io_r_open_user(char *desc, SAMR_R_OPEN_USER * r_u,
3097 prs_struct *ps, int depth);
3098 void init_samr_q_create_user(SAMR_Q_CREATE_USER * q_u,
3099 POLICY_HND *pol,
3100 char *name,
3101 uint32 acb_info, uint32 access_mask);
3102 BOOL samr_io_q_create_user(char *desc, SAMR_Q_CREATE_USER * q_u,
3103 prs_struct *ps, int depth);
3104 BOOL samr_io_r_create_user(char *desc, SAMR_R_CREATE_USER * r_u,
3105 prs_struct *ps, int depth);
3106 void init_samr_q_query_userinfo(SAMR_Q_QUERY_USERINFO * q_u,
3107 POLICY_HND *hnd, uint16 switch_value);
3108 BOOL samr_io_q_query_userinfo(char *desc, SAMR_Q_QUERY_USERINFO * q_u,
3109 prs_struct *ps, int depth);
3110 void init_sam_user_info12(SAM_USER_INFO_12 * usr,
3111 uint8 lm_pwd[16], uint8 nt_pwd[16]);
3112 void init_sam_user_info10(SAM_USER_INFO_10 * usr, uint32 acb_info);
3113 void init_sam_user_info11(SAM_USER_INFO_11 * usr,
3114 NTTIME * expiry,
3115 char *mach_acct,
3116 uint32 rid_user, uint32 rid_group, uint16 acct_ctrl);
3117 void init_sam_user_info24(SAM_USER_INFO_24 * usr,
3118 char newpass[516], uint16 passlen);
3119 void init_sam_user_info23W(SAM_USER_INFO_23 * usr, NTTIME * logon_time, /* all zeros */
3120 NTTIME * logoff_time, /* all zeros */
3121 NTTIME * kickoff_time, /* all zeros */
3122 NTTIME * pass_last_set_time, /* all zeros */
3123 NTTIME * pass_can_change_time, /* all zeros */
3124 NTTIME * pass_must_change_time, /* all zeros */
3125 UNISTR2 *user_name,
3126 UNISTR2 *full_name,
3127 UNISTR2 *home_dir,
3128 UNISTR2 *dir_drive,
3129 UNISTR2 *log_scr,
3130 UNISTR2 *prof_path,
3131 UNISTR2 *desc,
3132 UNISTR2 *wkstas,
3133 UNISTR2 *unk_str,
3134 UNISTR2 *mung_dial,
3135 uint32 user_rid, /* 0x0000 0000 */
3136 uint32 group_rid,
3137 uint32 acb_info,
3138 uint32 unknown_3,
3139 uint16 logon_divs,
3140 LOGON_HRS * hrs,
3141 uint32 unknown_5,
3142 char newpass[516], uint32 unknown_6);
3143 void init_sam_user_info23A(SAM_USER_INFO_23 * usr, NTTIME * logon_time, /* all zeros */
3144 NTTIME * logoff_time, /* all zeros */
3145 NTTIME * kickoff_time, /* all zeros */
3146 NTTIME * pass_last_set_time, /* all zeros */
3147 NTTIME * pass_can_change_time, /* all zeros */
3148 NTTIME * pass_must_change_time, /* all zeros */
3149 char *user_name, /* NULL */
3150 char *full_name,
3151 char *home_dir, char *dir_drive, char *log_scr,
3152 char *prof_path, char *desc, char *wkstas,
3153 char *unk_str, char *mung_dial, uint32 user_rid, /* 0x0000 0000 */
3154 uint32 group_rid, uint32 acb_info,
3155 uint32 unknown_3, uint16 logon_divs,
3156 LOGON_HRS * hrs, uint32 unknown_5,
3157 char newpass[516], uint32 unknown_6);
3158 void init_sam_user_info21W(SAM_USER_INFO_21 * usr,
3159 NTTIME * logon_time,
3160 NTTIME * logoff_time,
3161 NTTIME * kickoff_time,
3162 NTTIME * pass_last_set_time,
3163 NTTIME * pass_can_change_time,
3164 NTTIME * pass_must_change_time,
3165 UNISTR2 *user_name,
3166 UNISTR2 *full_name,
3167 UNISTR2 *home_dir,
3168 UNISTR2 *dir_drive,
3169 UNISTR2 *log_scr,
3170 UNISTR2 *prof_path,
3171 UNISTR2 *desc,
3172 UNISTR2 *wkstas,
3173 UNISTR2 *unk_str,
3174 UNISTR2 *mung_dial,
3175 uchar lm_pwd[16],
3176 uchar nt_pwd[16],
3177 uint32 user_rid,
3178 uint32 group_rid,
3179 uint32 acb_info,
3180 uint32 unknown_3,
3181 uint16 logon_divs,
3182 LOGON_HRS * hrs,
3183 uint32 unknown_5, uint32 unknown_6);
3184 void init_sam_user_info21A(SAM_USER_INFO_21 *usr, SAM_ACCOUNT *pw);
3185 uint32 make_samr_userinfo_ctr_usr21(TALLOC_CTX *ctx, SAM_USERINFO_CTR * ctr,
3186 uint16 switch_value,
3187 SAM_USER_INFO_21 * usr);
3188 void init_samr_userinfo_ctr(SAM_USERINFO_CTR * ctr, uchar * sess_key,
3189 uint16 switch_value, void *info);
3190 void init_samr_r_query_userinfo(SAMR_R_QUERY_USERINFO * r_u,
3191 SAM_USERINFO_CTR * ctr, uint32 status);
3192 BOOL samr_io_r_query_userinfo(char *desc, SAMR_R_QUERY_USERINFO * r_u,
3193 prs_struct *ps, int depth);
3194 void init_samr_q_set_userinfo(SAMR_Q_SET_USERINFO * q_u,
3195 POLICY_HND *hnd, unsigned char sess_key[16],
3196 uint16 switch_value, void *info);
3197 BOOL samr_io_q_set_userinfo(char *desc, SAMR_Q_SET_USERINFO * q_u,
3198 prs_struct *ps, int depth);
3199 void init_samr_r_set_userinfo(SAMR_R_SET_USERINFO * r_u, uint32 status);
3200 BOOL samr_io_r_set_userinfo(char *desc, SAMR_R_SET_USERINFO * r_u,
3201 prs_struct *ps, int depth);
3202 void init_samr_q_set_userinfo2(SAMR_Q_SET_USERINFO2 * q_u,
3203 POLICY_HND *hnd, unsigned char sess_key[16],
3204 uint16 switch_value, SAM_USERINFO_CTR * ctr);
3205 BOOL samr_io_q_set_userinfo2(char *desc, SAMR_Q_SET_USERINFO2 * q_u,
3206 prs_struct *ps, int depth);
3207 void init_samr_r_set_userinfo2(SAMR_R_SET_USERINFO2 * r_u, uint32 status);
3208 BOOL samr_io_r_set_userinfo2(char *desc, SAMR_R_SET_USERINFO2 * r_u,
3209 prs_struct *ps, int depth);
3210 void init_samr_q_connect(SAMR_Q_CONNECT * q_u,
3211 char *srv_name, uint32 access_mask);
3212 BOOL samr_io_q_connect(char *desc, SAMR_Q_CONNECT * q_u,
3213 prs_struct *ps, int depth);
3214 BOOL samr_io_r_connect(char *desc, SAMR_R_CONNECT * r_u,
3215 prs_struct *ps, int depth);
3216 void init_samr_q_connect_anon(SAMR_Q_CONNECT_ANON * q_u);
3217 BOOL samr_io_q_connect_anon(char *desc, SAMR_Q_CONNECT_ANON * q_u,
3218 prs_struct *ps, int depth);
3219 BOOL samr_io_r_connect_anon(char *desc, SAMR_R_CONNECT_ANON * r_u,
3220 prs_struct *ps, int depth);
3221 void init_samr_q_get_dom_pwinfo(SAMR_Q_GET_DOM_PWINFO * q_u,
3222 char *srv_name);
3223 BOOL samr_io_q_get_dom_pwinfo(char *desc, SAMR_Q_GET_DOM_PWINFO * q_u,
3224 prs_struct *ps, int depth);
3225 BOOL samr_io_r_get_dom_pwinfo(char *desc, SAMR_R_GET_DOM_PWINFO * r_u,
3226 prs_struct *ps, int depth);
3227 void init_enc_passwd(SAMR_ENC_PASSWD * pwd, char pass[512]);
3228 BOOL samr_io_enc_passwd(char *desc, SAMR_ENC_PASSWD * pwd,
3229 prs_struct *ps, int depth);
3230 void init_enc_hash(SAMR_ENC_HASH * hsh, uchar hash[16]);
3231 BOOL samr_io_enc_hash(char *desc, SAMR_ENC_HASH * hsh,
3232 prs_struct *ps, int depth);
3233 void init_samr_q_chgpasswd_user(SAMR_Q_CHGPASSWD_USER * q_u,
3234 char *dest_host, char *user_name,
3235 char nt_newpass[516],
3236 uchar nt_oldhash[16],
3237 char lm_newpass[516],
3238 uchar lm_oldhash[16]);
3239 BOOL samr_io_q_chgpasswd_user(char *desc, SAMR_Q_CHGPASSWD_USER * q_u,
3240 prs_struct *ps, int depth);
3241 void init_samr_r_chgpasswd_user(SAMR_R_CHGPASSWD_USER * r_u, uint32 status);
3242 BOOL samr_io_r_chgpasswd_user(char *desc, SAMR_R_CHGPASSWD_USER * r_u,
3243 prs_struct *ps, int depth);
3245 /*The following definitions come from rpc_parse/parse_sec.c */
3247 void init_sec_access(SEC_ACCESS *t, uint32 mask);
3248 BOOL sec_io_access(char *desc, SEC_ACCESS *t, prs_struct *ps, int depth);
3249 void init_sec_ace(SEC_ACE *t, DOM_SID *sid, uint8 type, SEC_ACCESS mask, uint8 flag);
3250 BOOL sec_io_ace(char *desc, SEC_ACE *psa, prs_struct *ps, int depth);
3251 SEC_ACL *make_sec_acl(TALLOC_CTX *ctx, uint16 revision, int num_aces, SEC_ACE *ace_list);
3252 SEC_ACL *dup_sec_acl(TALLOC_CTX *ctx, SEC_ACL *src);
3253 BOOL sec_io_acl(char *desc, SEC_ACL **ppsa, prs_struct *ps, int depth);
3254 size_t sec_desc_size(SEC_DESC *psd);
3255 BOOL sec_ace_equal(SEC_ACE *s1, SEC_ACE *s2);
3256 BOOL sec_acl_equal(SEC_ACL *s1, SEC_ACL *s2);
3257 BOOL sec_desc_equal(SEC_DESC *s1, SEC_DESC *s2);
3258 SEC_DESC_BUF *sec_desc_merge(TALLOC_CTX *ctx, SEC_DESC_BUF *new_sdb, SEC_DESC_BUF *old_sdb);
3259 SEC_DESC *make_sec_desc(TALLOC_CTX *ctx, uint16 revision,
3260 DOM_SID *owner_sid, DOM_SID *grp_sid,
3261 SEC_ACL *sacl, SEC_ACL *dacl, size_t *sd_size);
3262 SEC_DESC *dup_sec_desc( TALLOC_CTX *ctx, SEC_DESC *src);
3263 SEC_DESC *make_standard_sec_desc(TALLOC_CTX *ctx, DOM_SID *owner_sid, DOM_SID *grp_sid,
3264 SEC_ACL *dacl, size_t *sd_size);
3265 BOOL sec_io_desc(char *desc, SEC_DESC **ppsd, prs_struct *ps, int depth);
3266 SEC_DESC_BUF *make_sec_desc_buf(TALLOC_CTX *ctx, size_t len, SEC_DESC *sec_desc);
3267 SEC_DESC_BUF *dup_sec_desc_buf(TALLOC_CTX *ctx, SEC_DESC_BUF *src);
3268 BOOL sec_io_desc_buf(char *desc, SEC_DESC_BUF **ppsdb, prs_struct *ps, int depth);
3270 /*The following definitions come from rpc_parse/parse_spoolss.c */
3272 BOOL make_systemtime(SYSTEMTIME *systime, struct tm *unixtime);
3273 BOOL smb_io_notify_info_data_strings(char *desc,SPOOL_NOTIFY_INFO_DATA *data,
3274 prs_struct *ps, int depth);
3275 BOOL make_spoolss_q_open_printer_ex(SPOOL_Q_OPEN_PRINTER_EX *q_u,
3276 const fstring printername,
3277 const fstring datatype,
3278 uint32 access_required,
3279 const fstring clientname,
3280 const fstring user_name);
3281 BOOL make_spoolss_q_addprinterex(
3282 TALLOC_CTX *mem_ctx,
3283 SPOOL_Q_ADDPRINTEREX *q_u,
3284 const char *srv_name,
3285 const char* clientname,
3286 const char* user_name,
3287 uint32 level,
3288 PRINTER_INFO_CTR *ctr);
3289 BOOL make_spoolss_printer_info_2(
3290 TALLOC_CTX *mem_ctx,
3291 SPOOL_PRINTER_INFO_LEVEL_2 **spool_info2,
3292 PRINTER_INFO_2 *info
3294 BOOL spoolss_io_q_open_printer_ex(char *desc, SPOOL_Q_OPEN_PRINTER_EX *q_u, prs_struct *ps, int depth);
3295 BOOL spoolss_io_r_open_printer_ex(char *desc, SPOOL_R_OPEN_PRINTER_EX *r_u, prs_struct *ps, int depth);
3296 BOOL make_spoolss_q_getprinterdata(SPOOL_Q_GETPRINTERDATA *q_u,
3297 const POLICY_HND *handle,
3298 UNISTR2 *valuename, uint32 size);
3299 BOOL spoolss_io_q_getprinterdata(char *desc, SPOOL_Q_GETPRINTERDATA *q_u, prs_struct *ps, int depth);
3300 BOOL spoolss_io_q_deleteprinterdata(char *desc, SPOOL_Q_DELETEPRINTERDATA *q_u, prs_struct *ps, int depth);
3301 BOOL spoolss_io_r_deleteprinterdata(char *desc, SPOOL_R_DELETEPRINTERDATA *r_u, prs_struct *ps, int depth);
3302 BOOL spoolss_io_r_getprinterdata(char *desc, SPOOL_R_GETPRINTERDATA *r_u, prs_struct *ps, int depth);
3303 BOOL make_spoolss_q_closeprinter(SPOOL_Q_CLOSEPRINTER *q_u, POLICY_HND *hnd);
3304 BOOL spoolss_io_q_abortprinter(char *desc, SPOOL_Q_ABORTPRINTER *q_u, prs_struct *ps, int depth);
3305 BOOL spoolss_io_r_abortprinter(char *desc, SPOOL_R_ABORTPRINTER *r_u, prs_struct *ps, int depth);
3306 BOOL spoolss_io_q_deleteprinter(char *desc, SPOOL_Q_DELETEPRINTER *q_u, prs_struct *ps, int depth);
3307 BOOL spoolss_io_r_deleteprinter(char *desc, SPOOL_R_DELETEPRINTER *r_u, prs_struct *ps, int depth);
3308 BOOL spoolss_io_q_closeprinter(char *desc, SPOOL_Q_CLOSEPRINTER *q_u, prs_struct *ps, int depth);
3309 BOOL spoolss_io_r_closeprinter(char *desc, SPOOL_R_CLOSEPRINTER *r_u, prs_struct *ps, int depth);
3310 BOOL spoolss_io_q_startdocprinter(char *desc, SPOOL_Q_STARTDOCPRINTER *q_u, prs_struct *ps, int depth);
3311 BOOL spoolss_io_r_startdocprinter(char *desc, SPOOL_R_STARTDOCPRINTER *r_u, prs_struct *ps, int depth);
3312 BOOL spoolss_io_q_enddocprinter(char *desc, SPOOL_Q_ENDDOCPRINTER *q_u, prs_struct *ps, int depth);
3313 BOOL spoolss_io_r_enddocprinter(char *desc, SPOOL_R_ENDDOCPRINTER *r_u, prs_struct *ps, int depth);
3314 BOOL spoolss_io_q_startpageprinter(char *desc, SPOOL_Q_STARTPAGEPRINTER *q_u, prs_struct *ps, int depth);
3315 BOOL spoolss_io_r_startpageprinter(char *desc, SPOOL_R_STARTPAGEPRINTER *r_u, prs_struct *ps, int depth);
3316 BOOL spoolss_io_q_endpageprinter(char *desc, SPOOL_Q_ENDPAGEPRINTER *q_u, prs_struct *ps, int depth);
3317 BOOL spoolss_io_r_endpageprinter(char *desc, SPOOL_R_ENDPAGEPRINTER *r_u, prs_struct *ps, int depth);
3318 BOOL spoolss_io_q_writeprinter(char *desc, SPOOL_Q_WRITEPRINTER *q_u, prs_struct *ps, int depth);
3319 BOOL spoolss_io_r_writeprinter(char *desc, SPOOL_R_WRITEPRINTER *r_u, prs_struct *ps, int depth);
3320 BOOL spoolss_io_q_rffpcnex(char *desc, SPOOL_Q_RFFPCNEX *q_u, prs_struct *ps, int depth);
3321 BOOL spoolss_io_r_rffpcnex(char *desc, SPOOL_R_RFFPCNEX *r_u, prs_struct *ps, int depth);
3322 BOOL spoolss_io_q_rfnpcnex(char *desc, SPOOL_Q_RFNPCNEX *q_u, prs_struct *ps, int depth);
3323 BOOL spoolss_io_r_rfnpcnex(char *desc, SPOOL_R_RFNPCNEX *r_u, prs_struct *ps, int depth);
3324 BOOL smb_io_printer_info_0(char *desc, NEW_BUFFER *buffer, PRINTER_INFO_0 *info, int depth);
3325 BOOL smb_io_printer_info_1(char *desc, NEW_BUFFER *buffer, PRINTER_INFO_1 *info, int depth);
3326 BOOL smb_io_printer_info_2(char *desc, NEW_BUFFER *buffer, PRINTER_INFO_2 *info, int depth);
3327 BOOL smb_io_printer_info_3(char *desc, NEW_BUFFER *buffer, PRINTER_INFO_3 *info, int depth);
3328 BOOL smb_io_port_info_1(char *desc, NEW_BUFFER *buffer, PORT_INFO_1 *info, int depth);
3329 BOOL smb_io_port_info_2(char *desc, NEW_BUFFER *buffer, PORT_INFO_2 *info, int depth);
3330 BOOL smb_io_printer_driver_info_1(char *desc, NEW_BUFFER *buffer, DRIVER_INFO_1 *info, int depth) ;
3331 BOOL smb_io_printer_driver_info_2(char *desc, NEW_BUFFER *buffer, DRIVER_INFO_2 *info, int depth) ;
3332 BOOL smb_io_printer_driver_info_3(char *desc, NEW_BUFFER *buffer, DRIVER_INFO_3 *info, int depth);
3333 BOOL smb_io_printer_driver_info_6(char *desc, NEW_BUFFER *buffer, DRIVER_INFO_6 *info, int depth);
3334 BOOL smb_io_job_info_1(char *desc, NEW_BUFFER *buffer, JOB_INFO_1 *info, int depth);
3335 BOOL smb_io_job_info_2(char *desc, NEW_BUFFER *buffer, JOB_INFO_2 *info, int depth);
3336 BOOL smb_io_form_1(char *desc, NEW_BUFFER *buffer, FORM_1 *info, int depth);
3337 void spoolss_move_buffer(NEW_BUFFER *src, NEW_BUFFER **dest);
3338 uint32 new_get_buffer_size(NEW_BUFFER *buffer);
3339 BOOL smb_io_driverdir_1(char *desc, NEW_BUFFER *buffer, DRIVER_DIRECTORY_1 *info, int depth);
3340 BOOL smb_io_port_1(char *desc, NEW_BUFFER *buffer, PORT_INFO_1 *info, int depth);
3341 BOOL smb_io_port_2(char *desc, NEW_BUFFER *buffer, PORT_INFO_2 *info, int depth);
3342 BOOL smb_io_printprocessor_info_1(char *desc, NEW_BUFFER *buffer, PRINTPROCESSOR_1 *info, int depth);
3343 BOOL smb_io_printprocdatatype_info_1(char *desc, NEW_BUFFER *buffer, PRINTPROCDATATYPE_1 *info, int depth);
3344 BOOL smb_io_printmonitor_info_1(char *desc, NEW_BUFFER *buffer, PRINTMONITOR_1 *info, int depth);
3345 BOOL smb_io_printmonitor_info_2(char *desc, NEW_BUFFER *buffer, PRINTMONITOR_2 *info, int depth);
3346 uint32 spoolss_size_printer_info_0(PRINTER_INFO_0 *info);
3347 uint32 spoolss_size_printer_info_1(PRINTER_INFO_1 *info);
3348 uint32 spoolss_size_printer_info_2(PRINTER_INFO_2 *info);
3349 uint32 spoolss_size_printer_info_3(PRINTER_INFO_3 *info);
3350 uint32 spoolss_size_printer_driver_info_1(DRIVER_INFO_1 *info);
3351 uint32 spoolss_size_printer_driver_info_2(DRIVER_INFO_2 *info);
3352 uint32 spoolss_size_string_array(uint16 *string);
3353 uint32 spoolss_size_printer_driver_info_3(DRIVER_INFO_3 *info);
3354 uint32 spoolss_size_printer_driver_info_6(DRIVER_INFO_6 *info);
3355 uint32 spoolss_size_job_info_1(JOB_INFO_1 *info);
3356 uint32 spoolss_size_job_info_2(JOB_INFO_2 *info);
3357 uint32 spoolss_size_form_1(FORM_1 *info);
3358 uint32 spoolss_size_port_info_1(PORT_INFO_1 *info);
3359 uint32 spoolss_size_driverdir_info_1(DRIVER_DIRECTORY_1 *info);
3360 uint32 spoolss_size_port_info_2(PORT_INFO_2 *info);
3361 uint32 spoolss_size_printprocessor_info_1(PRINTPROCESSOR_1 *info);
3362 uint32 spoolss_size_printprocdatatype_info_1(PRINTPROCDATATYPE_1 *info);
3363 uint32 spoolss_size_printmonitor_info_1(PRINTMONITOR_1 *info);
3364 uint32 spoolss_size_printmonitor_info_2(PRINTMONITOR_2 *info);
3365 BOOL make_spoolss_q_getprinterdriver2(SPOOL_Q_GETPRINTERDRIVER2 *q_u,
3366 const POLICY_HND *hnd,
3367 const fstring architecture,
3368 uint32 level, uint32 clientmajor, uint32 clientminor,
3369 NEW_BUFFER *buffer, uint32 offered);
3370 BOOL spoolss_io_q_getprinterdriver2(char *desc, SPOOL_Q_GETPRINTERDRIVER2 *q_u, prs_struct *ps, int depth);
3371 BOOL spoolss_io_r_getprinterdriver2(char *desc, SPOOL_R_GETPRINTERDRIVER2 *r_u, prs_struct *ps, int depth);
3372 BOOL make_spoolss_q_enumprinters(
3373 SPOOL_Q_ENUMPRINTERS *q_u,
3374 uint32 flags,
3375 fstring servername,
3376 uint32 level,
3377 NEW_BUFFER *buffer,
3378 uint32 offered
3380 BOOL make_spoolss_q_enumports(SPOOL_Q_ENUMPORTS *q_u,
3381 fstring servername, uint32 level,
3382 NEW_BUFFER *buffer, uint32 offered);
3383 BOOL spoolss_io_q_enumprinters(char *desc, SPOOL_Q_ENUMPRINTERS *q_u, prs_struct *ps, int depth);
3384 BOOL spoolss_io_r_enumprinters(char *desc, SPOOL_R_ENUMPRINTERS *r_u, prs_struct *ps, int depth);
3385 BOOL spoolss_io_r_getprinter(char *desc, SPOOL_R_GETPRINTER *r_u, prs_struct *ps, int depth);
3386 BOOL spoolss_io_q_getprinter(char *desc, SPOOL_Q_GETPRINTER *q_u, prs_struct *ps, int depth);
3387 BOOL make_spoolss_q_getprinter(
3388 TALLOC_CTX *mem_ctx,
3389 SPOOL_Q_GETPRINTER *q_u,
3390 const POLICY_HND *hnd,
3391 uint32 level,
3392 NEW_BUFFER *buffer,
3393 uint32 offered
3395 BOOL make_spoolss_q_setprinter(
3396 TALLOC_CTX *mem_ctx,
3397 SPOOL_Q_SETPRINTER *q_u,
3398 const POLICY_HND *hnd,
3399 uint32 level,
3400 PRINTER_INFO_CTR *info,
3401 uint32 command
3403 BOOL spoolss_io_r_setprinter(char *desc, SPOOL_R_SETPRINTER *r_u, prs_struct *ps, int depth);
3404 BOOL spoolss_io_q_setprinter(char *desc, SPOOL_Q_SETPRINTER *q_u, prs_struct *ps, int depth);
3405 BOOL spoolss_io_r_fcpn(char *desc, SPOOL_R_FCPN *r_u, prs_struct *ps, int depth);
3406 BOOL spoolss_io_q_fcpn(char *desc, SPOOL_Q_FCPN *q_u, prs_struct *ps, int depth);
3407 BOOL spoolss_io_r_addjob(char *desc, SPOOL_R_ADDJOB *r_u, prs_struct *ps, int depth);
3408 BOOL spoolss_io_q_addjob(char *desc, SPOOL_Q_ADDJOB *q_u, prs_struct *ps, int depth);
3409 BOOL spoolss_io_r_enumjobs(char *desc, SPOOL_R_ENUMJOBS *r_u, prs_struct *ps, int depth);
3410 BOOL make_spoolss_q_enumjobs(SPOOL_Q_ENUMJOBS *q_u, const POLICY_HND *hnd,
3411 uint32 firstjob,
3412 uint32 numofjobs,
3413 uint32 level,
3414 NEW_BUFFER *buffer,
3415 uint32 offered);
3416 BOOL spoolss_io_q_enumjobs(char *desc, SPOOL_Q_ENUMJOBS *q_u, prs_struct *ps, int depth);
3417 BOOL spoolss_io_r_schedulejob(char *desc, SPOOL_R_SCHEDULEJOB *r_u, prs_struct *ps, int depth);
3418 BOOL spoolss_io_q_schedulejob(char *desc, SPOOL_Q_SCHEDULEJOB *q_u, prs_struct *ps, int depth);
3419 BOOL spoolss_io_r_setjob(char *desc, SPOOL_R_SETJOB *r_u, prs_struct *ps, int depth);
3420 BOOL spoolss_io_q_setjob(char *desc, SPOOL_Q_SETJOB *q_u, prs_struct *ps, int depth);
3421 BOOL spoolss_io_r_enumprinterdrivers(char *desc, SPOOL_R_ENUMPRINTERDRIVERS *r_u, prs_struct *ps, int depth);
3422 BOOL make_spoolss_q_enumprinterdrivers(SPOOL_Q_ENUMPRINTERDRIVERS *q_u,
3423 const char *name,
3424 const char *environment,
3425 uint32 level,
3426 NEW_BUFFER *buffer, uint32 offered);
3427 BOOL spoolss_io_q_enumprinterdrivers(char *desc, SPOOL_Q_ENUMPRINTERDRIVERS *q_u, prs_struct *ps, int depth);
3428 BOOL spoolss_io_q_enumforms(char *desc, SPOOL_Q_ENUMFORMS *q_u, prs_struct *ps, int depth);
3429 BOOL spoolss_io_r_enumforms(char *desc, SPOOL_R_ENUMFORMS *r_u, prs_struct *ps, int depth);
3430 BOOL spoolss_io_q_getform(char *desc, SPOOL_Q_GETFORM *q_u, prs_struct *ps, int depth);
3431 BOOL spoolss_io_r_getform(char *desc, SPOOL_R_GETFORM *r_u, prs_struct *ps, int depth);
3432 BOOL spoolss_io_r_enumports(char *desc, SPOOL_R_ENUMPORTS *r_u, prs_struct *ps, int depth);
3433 BOOL spoolss_io_q_enumports(char *desc, SPOOL_Q_ENUMPORTS *q_u, prs_struct *ps, int depth);
3434 BOOL spool_io_printer_info_level_1(char *desc, SPOOL_PRINTER_INFO_LEVEL_1 *il, prs_struct *ps, int depth);
3435 BOOL spool_io_printer_info_level_3(char *desc, SPOOL_PRINTER_INFO_LEVEL_3 *il, prs_struct *ps, int depth);
3436 BOOL spool_io_printer_info_level_2(char *desc, SPOOL_PRINTER_INFO_LEVEL_2 *il, prs_struct *ps, int depth);
3437 BOOL spool_io_printer_info_level(char *desc, SPOOL_PRINTER_INFO_LEVEL *il, prs_struct *ps, int depth);
3438 BOOL spoolss_io_q_addprinterex(char *desc, SPOOL_Q_ADDPRINTEREX *q_u, prs_struct *ps, int depth);
3439 BOOL spoolss_io_r_addprinterex(char *desc, SPOOL_R_ADDPRINTEREX *r_u,
3440 prs_struct *ps, int depth);
3441 BOOL spool_io_printer_driver_info_level_3(char *desc, SPOOL_PRINTER_DRIVER_INFO_LEVEL_3 **q_u,
3442 prs_struct *ps, int depth);
3443 BOOL spool_io_printer_driver_info_level_6(char *desc, SPOOL_PRINTER_DRIVER_INFO_LEVEL_6 **q_u,
3444 prs_struct *ps, int depth);
3445 BOOL smb_io_unibuffer(char *desc, UNISTR2 *buffer, prs_struct *ps, int depth);
3446 BOOL spool_io_printer_driver_info_level(char *desc, SPOOL_PRINTER_DRIVER_INFO_LEVEL *il, prs_struct *ps, int depth);
3447 BOOL make_spoolss_q_addprinterdriver(
3448 TALLOC_CTX *mem_ctx,
3449 SPOOL_Q_ADDPRINTERDRIVER *q_u,
3450 const char* srv_name,
3451 uint32 level,
3452 PRINTER_DRIVER_CTR *info);
3453 BOOL make_spoolss_driver_info_3(
3454 TALLOC_CTX *mem_ctx,
3455 SPOOL_PRINTER_DRIVER_INFO_LEVEL_3 **spool_drv_info,
3456 DRIVER_INFO_3 *info3
3458 BOOL make_spoolss_buffer5(
3459 TALLOC_CTX *mem_ctx,
3460 BUFFER5 *buf5,
3461 uint32 len,
3462 uint16 *src
3464 BOOL spoolss_io_q_addprinterdriver(char *desc, SPOOL_Q_ADDPRINTERDRIVER *q_u, prs_struct *ps, int depth);
3465 BOOL spoolss_io_r_addprinterdriver(char *desc, SPOOL_R_ADDPRINTERDRIVER *q_u, prs_struct *ps, int depth);
3466 BOOL uni_2_asc_printer_driver_3(SPOOL_PRINTER_DRIVER_INFO_LEVEL_3 *uni,
3467 NT_PRINTER_DRIVER_INFO_LEVEL_3 **asc);
3468 BOOL uni_2_asc_printer_driver_6(SPOOL_PRINTER_DRIVER_INFO_LEVEL_6 *uni,
3469 NT_PRINTER_DRIVER_INFO_LEVEL_6 **asc);
3470 BOOL uni_2_asc_printer_info_2(const SPOOL_PRINTER_INFO_LEVEL_2 *uni,
3471 NT_PRINTER_INFO_LEVEL_2 **asc);
3472 BOOL make_spoolss_q_getprinterdriverdir(SPOOL_Q_GETPRINTERDRIVERDIR *q_u,
3473 fstring servername, fstring env_name, uint32 level,
3474 NEW_BUFFER *buffer, uint32 offered);
3475 BOOL spoolss_io_q_getprinterdriverdir(char *desc, SPOOL_Q_GETPRINTERDRIVERDIR *q_u, prs_struct *ps, int depth);
3476 BOOL spoolss_io_r_getprinterdriverdir(char *desc, SPOOL_R_GETPRINTERDRIVERDIR *r_u, prs_struct *ps, int depth);
3477 BOOL spoolss_io_r_enumprintprocessors(char *desc, SPOOL_R_ENUMPRINTPROCESSORS *r_u, prs_struct *ps, int depth);
3478 BOOL spoolss_io_q_enumprintprocessors(char *desc, SPOOL_Q_ENUMPRINTPROCESSORS *q_u, prs_struct *ps, int depth);
3479 BOOL spoolss_io_r_enumprintprocdatatypes(char *desc, SPOOL_R_ENUMPRINTPROCDATATYPES *r_u, prs_struct *ps, int depth);
3480 BOOL spoolss_io_q_enumprintprocdatatypes(char *desc, SPOOL_Q_ENUMPRINTPROCDATATYPES *q_u, prs_struct *ps, int depth);
3481 BOOL spoolss_io_q_enumprintmonitors(char *desc, SPOOL_Q_ENUMPRINTMONITORS *q_u, prs_struct *ps, int depth);
3482 BOOL spoolss_io_r_enumprintmonitors(char *desc, SPOOL_R_ENUMPRINTMONITORS *r_u, prs_struct *ps, int depth);
3483 BOOL spoolss_io_r_enumprinterdata(char *desc, SPOOL_R_ENUMPRINTERDATA *r_u, prs_struct *ps, int depth);
3484 BOOL spoolss_io_q_enumprinterdata(char *desc, SPOOL_Q_ENUMPRINTERDATA *q_u, prs_struct *ps, int depth);
3485 BOOL make_spoolss_q_enumprinterdata(SPOOL_Q_ENUMPRINTERDATA *q_u,
3486 const POLICY_HND *hnd,
3487 uint32 idx, uint32 valuelen, uint32 datalen);
3488 BOOL spoolss_io_q_setprinterdata(char *desc, SPOOL_Q_SETPRINTERDATA *q_u, prs_struct *ps, int depth);
3489 BOOL spoolss_io_r_setprinterdata(char *desc, SPOOL_R_SETPRINTERDATA *r_u, prs_struct *ps, int depth);
3490 BOOL convert_specific_param(NT_PRINTER_PARAM **param, const UNISTR2 *value,
3491 uint32 type, const uint8 *data, uint32 len);
3492 BOOL spoolss_io_q_deleteform(char *desc, SPOOL_Q_DELETEFORM *q_u, prs_struct *ps, int depth);
3493 BOOL spoolss_io_r_deleteform(char *desc, SPOOL_R_DELETEFORM *r_u, prs_struct *ps, int depth);
3494 BOOL spoolss_io_q_addform(char *desc, SPOOL_Q_ADDFORM *q_u, prs_struct *ps, int depth);
3495 BOOL spoolss_io_r_addform(char *desc, SPOOL_R_ADDFORM *r_u, prs_struct *ps, int depth);
3496 BOOL spoolss_io_q_setform(char *desc, SPOOL_Q_SETFORM *q_u, prs_struct *ps, int depth);
3497 BOOL spoolss_io_r_setform(char *desc, SPOOL_R_SETFORM *r_u, prs_struct *ps, int depth);
3498 BOOL spoolss_io_r_getjob(char *desc, SPOOL_R_GETJOB *r_u, prs_struct *ps, int depth);
3499 BOOL spoolss_io_q_getjob(char *desc, SPOOL_Q_GETJOB *q_u, prs_struct *ps, int depth);
3500 void free_devmode(DEVICEMODE *devmode);
3501 void free_printer_info_1(PRINTER_INFO_1 *printer);
3502 void free_printer_info_2(PRINTER_INFO_2 *printer);
3503 void free_printer_info_3(PRINTER_INFO_3 *printer);
3504 void free_job_info_2(JOB_INFO_2 *job);
3505 BOOL make_spoolss_q_replyopenprinter(SPOOL_Q_REPLYOPENPRINTER *q_u,
3506 const fstring string, uint32 printer, uint32 type);
3507 BOOL spoolss_io_q_replyopenprinter(char *desc, SPOOL_Q_REPLYOPENPRINTER *q_u, prs_struct *ps, int depth);
3508 BOOL spoolss_io_r_replyopenprinter(char *desc, SPOOL_R_REPLYOPENPRINTER *r_u, prs_struct *ps, int depth);
3509 BOOL make_spoolss_q_reply_closeprinter(SPOOL_Q_REPLYCLOSEPRINTER *q_u, POLICY_HND *hnd);
3510 BOOL spoolss_io_q_replycloseprinter(char *desc, SPOOL_Q_REPLYCLOSEPRINTER *q_u, prs_struct *ps, int depth);
3511 BOOL spoolss_io_r_replycloseprinter(char *desc, SPOOL_R_REPLYCLOSEPRINTER *r_u, prs_struct *ps, int depth);
3512 BOOL make_spoolss_q_reply_rrpcn(SPOOL_Q_REPLY_RRPCN *q_u, POLICY_HND *hnd,
3513 uint32 change_low, uint32 change_high);
3514 BOOL spoolss_io_q_reply_rrpcn(char *desc, SPOOL_Q_REPLY_RRPCN *q_u, prs_struct *ps, int depth);
3515 BOOL spoolss_io_r_reply_rrpcn(char *desc, SPOOL_R_REPLY_RRPCN *r_u, prs_struct *ps, int depth);
3517 /*The following definitions come from rpc_parse/parse_srv.c */
3519 void init_srv_share_info1_str(SH_INFO_1_STR *sh1, char *net_name, char *remark);
3520 void init_srv_share_info1(SH_INFO_1 *sh1, char *net_name, uint32 type, char *remark);
3521 void init_srv_share_info2_str(SH_INFO_2_STR *sh2,
3522 char *net_name, char *remark,
3523 char *path, char *passwd);
3524 void init_srv_share_info2(SH_INFO_2 *sh2,
3525 char *net_name, uint32 type, char *remark,
3526 uint32 perms, uint32 max_uses, uint32 num_uses,
3527 char *path, char *passwd);
3528 void init_srv_share_info502(SH_INFO_502 *sh502,
3529 char *net_name, uint32 type, char *remark,
3530 uint32 perms, uint32 max_uses, uint32 num_uses,
3531 char *path, char *passwd, SEC_DESC *psd, size_t sd_size);
3532 void init_srv_share_info502_str(SH_INFO_502_STR *sh502str,
3533 SH_INFO_502 *ptrs,
3534 char *net_name, char *remark,
3535 char *path, char *passwd, SEC_DESC *psd, size_t sd_size);
3536 void init_srv_q_net_share_enum(SRV_Q_NET_SHARE_ENUM *q_n,
3537 char *srv_name, uint32 info_level,
3538 uint32 preferred_len, ENUM_HND *hnd);
3539 BOOL srv_io_q_net_share_enum(char *desc, SRV_Q_NET_SHARE_ENUM *q_n, prs_struct *ps, int depth);
3540 BOOL srv_io_r_net_share_enum(char *desc, SRV_R_NET_SHARE_ENUM *r_n, prs_struct *ps, int depth);
3541 BOOL srv_io_q_net_share_get_info(char *desc, SRV_Q_NET_SHARE_GET_INFO *q_n, prs_struct *ps, int depth);
3542 BOOL srv_io_r_net_share_get_info(char *desc, SRV_R_NET_SHARE_GET_INFO *r_n, prs_struct *ps, int depth);
3543 BOOL srv_io_q_net_share_set_info(char *desc, SRV_Q_NET_SHARE_SET_INFO *q_n, prs_struct *ps, int depth);
3544 BOOL srv_io_r_net_share_set_info(char *desc, SRV_R_NET_SHARE_SET_INFO *q_n, prs_struct *ps, int depth);
3545 BOOL srv_io_q_net_share_add(char *desc, SRV_Q_NET_SHARE_ADD *q_n, prs_struct *ps, int depth);
3546 BOOL srv_io_r_net_share_add(char *desc, SRV_R_NET_SHARE_ADD *q_n, prs_struct *ps, int depth);
3547 BOOL srv_io_q_net_share_del(char *desc, SRV_Q_NET_SHARE_DEL *q_n, prs_struct *ps, int depth);
3548 BOOL srv_io_r_net_share_del(char *desc, SRV_R_NET_SHARE_DEL *q_n, prs_struct *ps, int depth);
3549 void init_srv_sess_info0_str(SESS_INFO_0_STR *ss0, char *name);
3550 void init_srv_sess_info0(SESS_INFO_0 *ss0, char *name);
3551 void init_srv_sess_info1_str(SESS_INFO_1_STR *ss1, char *name, char *user);
3552 void init_srv_sess_info1(SESS_INFO_1 *ss1,
3553 char *name, char *user,
3554 uint32 num_opens, uint32 open_time, uint32 idle_time,
3555 uint32 user_flags);
3556 void init_srv_q_net_sess_enum(SRV_Q_NET_SESS_ENUM *q_n,
3557 char *srv_name, char *qual_name,
3558 uint32 sess_level, SRV_SESS_INFO_CTR *ctr,
3559 uint32 preferred_len,
3560 ENUM_HND *hnd);
3561 BOOL srv_io_q_net_sess_enum(char *desc, SRV_Q_NET_SESS_ENUM *q_n, prs_struct *ps, int depth);
3562 BOOL srv_io_r_net_sess_enum(char *desc, SRV_R_NET_SESS_ENUM *r_n, prs_struct *ps, int depth);
3563 void init_srv_conn_info0(CONN_INFO_0 *ss0, uint32 id);
3564 void init_srv_conn_info1_str(CONN_INFO_1_STR *ss1, char *usr_name, char *net_name);
3565 void init_srv_conn_info1(CONN_INFO_1 *ss1,
3566 uint32 id, uint32 type,
3567 uint32 num_opens, uint32 num_users, uint32 open_time,
3568 char *usr_name, char *net_name);
3569 void init_srv_q_net_conn_enum(SRV_Q_NET_CONN_ENUM *q_n,
3570 char *srv_name, char *qual_name,
3571 uint32 conn_level, SRV_CONN_INFO_CTR *ctr,
3572 uint32 preferred_len,
3573 ENUM_HND *hnd);
3574 BOOL srv_io_q_net_conn_enum(char *desc, SRV_Q_NET_CONN_ENUM *q_n, prs_struct *ps, int depth);
3575 BOOL srv_io_r_net_conn_enum(char *desc, SRV_R_NET_CONN_ENUM *r_n, prs_struct *ps, int depth);
3576 void init_srv_file_info3_str(FILE_INFO_3_STR *fi3, char *user_name, char *path_name);
3577 void init_srv_file_info3(FILE_INFO_3 *fl3,
3578 uint32 id, uint32 perms, uint32 num_locks,
3579 char *path_name, char *user_name);
3580 void init_srv_q_net_file_enum(SRV_Q_NET_FILE_ENUM *q_n,
3581 char *srv_name, char *qual_name,
3582 uint32 file_level, SRV_FILE_INFO_CTR *ctr,
3583 uint32 preferred_len,
3584 ENUM_HND *hnd);
3585 BOOL srv_io_q_net_file_enum(char *desc, SRV_Q_NET_FILE_ENUM *q_n, prs_struct *ps, int depth);
3586 BOOL srv_io_r_net_file_enum(char *desc, SRV_R_NET_FILE_ENUM *r_n, prs_struct *ps, int depth);
3587 void init_srv_info_100(SRV_INFO_100 *sv100, uint32 platform_id, char *name);
3588 void init_srv_info_101(SRV_INFO_101 *sv101, uint32 platform_id, char *name,
3589 uint32 ver_major, uint32 ver_minor,
3590 uint32 srv_type, char *comment);
3591 void init_srv_info_102(SRV_INFO_102 *sv102, uint32 platform_id, char *name,
3592 char *comment, uint32 ver_major, uint32 ver_minor,
3593 uint32 srv_type, uint32 users, uint32 disc, uint32 hidden,
3594 uint32 announce, uint32 ann_delta, uint32 licenses,
3595 char *usr_path);
3596 void init_srv_q_net_srv_get_info(SRV_Q_NET_SRV_GET_INFO *srv,
3597 char *server_name, uint32 switch_value);
3598 BOOL srv_io_q_net_srv_get_info(char *desc, SRV_Q_NET_SRV_GET_INFO *q_n, prs_struct *ps, int depth);
3599 void init_srv_r_net_srv_get_info(SRV_R_NET_SRV_GET_INFO *srv,
3600 uint32 switch_value, SRV_INFO_CTR *ctr, uint32 status);
3601 BOOL srv_io_r_net_srv_get_info(char *desc, SRV_R_NET_SRV_GET_INFO *r_n, prs_struct *ps, int depth);
3602 BOOL srv_io_q_net_remote_tod(char *desc, SRV_Q_NET_REMOTE_TOD *q_n, prs_struct *ps, int depth);
3603 void init_time_of_day_info(TIME_OF_DAY_INFO *tod, uint32 elapsedt, uint32 msecs,
3604 uint32 hours, uint32 mins, uint32 secs, uint32 hunds,
3605 uint32 zone, uint32 tintervals, uint32 day,
3606 uint32 month, uint32 year, uint32 weekday);
3607 BOOL srv_io_r_net_remote_tod(char *desc, SRV_R_NET_REMOTE_TOD *r_n, prs_struct *ps, int depth);
3608 BOOL srv_io_q_net_disk_enum(char *desc, SRV_Q_NET_DISK_ENUM *q_n, prs_struct *ps, int depth);
3609 BOOL srv_io_r_net_disk_enum(char *desc, SRV_R_NET_DISK_ENUM *r_n, prs_struct *ps, int depth);
3610 BOOL srv_io_q_net_name_validate(char *desc, SRV_Q_NET_NAME_VALIDATE *q_n, prs_struct *ps, int depth);
3611 BOOL srv_io_r_net_name_validate(char *desc, SRV_R_NET_NAME_VALIDATE *r_n, prs_struct *ps, int depth);
3613 /*The following definitions come from rpc_parse/parse_wks.c */
3615 void init_wks_q_query_info(WKS_Q_QUERY_INFO *q_u,
3616 char *server, uint16 switch_value) ;
3617 BOOL wks_io_q_query_info(char *desc, WKS_Q_QUERY_INFO *q_u, prs_struct *ps, int depth);
3618 void init_wks_info_100(WKS_INFO_100 *inf,
3619 uint32 platform_id, uint32 ver_major, uint32 ver_minor,
3620 char *my_name, char *domain_name);
3621 void init_wks_r_query_info(WKS_R_QUERY_INFO *r_u,
3622 uint32 switch_value, WKS_INFO_100 *wks100,
3623 int status) ;
3624 BOOL wks_io_r_query_info(char *desc, WKS_R_QUERY_INFO *r_u, prs_struct *ps, int depth);
3626 /*The following definitions come from rpc_server/srv_dfs.c */
3628 BOOL api_netdfs_rpc(pipes_struct *p);
3630 /*The following definitions come from rpc_server/srv_dfs_nt.c */
3632 uint32 _dfs_exist(pipes_struct *p, DFS_Q_DFS_EXIST *q_u, DFS_R_DFS_EXIST *r_u);
3633 uint32 _dfs_add(pipes_struct *p, DFS_Q_DFS_ADD* q_u, DFS_R_DFS_ADD *r_u);
3634 uint32 _dfs_remove(pipes_struct *p, DFS_Q_DFS_REMOVE *q_u, DFS_R_DFS_REMOVE *r_u);
3635 uint32 _dfs_enum(pipes_struct *p, DFS_Q_DFS_ENUM *q_u, DFS_R_DFS_ENUM *r_u);
3636 uint32 _dfs_get_info(pipes_struct *p, DFS_Q_DFS_GET_INFO *q_u, DFS_R_DFS_GET_INFO *r_u);
3638 /*The following definitions come from rpc_server/srv_lsa.c */
3640 BOOL api_ntlsa_rpc(pipes_struct *p);
3642 /*The following definitions come from rpc_server/srv_lsa_hnd.c */
3644 BOOL init_pipe_handle_list(pipes_struct *p, char *pipe_name);
3645 BOOL create_policy_hnd(pipes_struct *p, POLICY_HND *hnd, void (*free_fn)(void *), void *data_ptr);
3646 BOOL find_policy_by_hnd(pipes_struct *p, POLICY_HND *hnd, void **data_p);
3647 BOOL close_policy_hnd(pipes_struct *p, POLICY_HND *hnd);
3648 void close_policy_by_pipe(pipes_struct *p);
3650 /*The following definitions come from rpc_server/srv_lsa_nt.c */
3652 uint32 _lsa_open_policy2(pipes_struct *p, LSA_Q_OPEN_POL2 *q_u, LSA_R_OPEN_POL2 *r_u);
3653 uint32 _lsa_open_policy(pipes_struct *p, LSA_Q_OPEN_POL *q_u, LSA_R_OPEN_POL *r_u);
3654 uint32 _lsa_enum_trust_dom(pipes_struct *p, LSA_Q_ENUM_TRUST_DOM *q_u, LSA_R_ENUM_TRUST_DOM *r_u);
3655 uint32 _lsa_query_info(pipes_struct *p, LSA_Q_QUERY_INFO *q_u, LSA_R_QUERY_INFO *r_u);
3656 uint32 _lsa_lookup_sids(pipes_struct *p, LSA_Q_LOOKUP_SIDS *q_u, LSA_R_LOOKUP_SIDS *r_u);
3657 uint32 _lsa_lookup_names(pipes_struct *p,LSA_Q_LOOKUP_NAMES *q_u, LSA_R_LOOKUP_NAMES *r_u);
3658 uint32 _lsa_close(pipes_struct *p, LSA_Q_CLOSE *q_u, LSA_R_CLOSE *r_u);
3659 uint32 _lsa_open_secret(pipes_struct *p, LSA_Q_OPEN_SECRET *q_u, LSA_R_OPEN_SECRET *r_u);
3661 /*The following definitions come from rpc_server/srv_netlog.c */
3663 BOOL api_netlog_rpc(pipes_struct *p);
3665 /*The following definitions come from rpc_server/srv_netlog_nt.c */
3667 uint32 _net_logon_ctrl2(pipes_struct *p, NET_Q_LOGON_CTRL2 *q_u, NET_R_LOGON_CTRL2 *r_u);
3668 uint32 _net_trust_dom_list(pipes_struct *p, NET_Q_TRUST_DOM_LIST *q_u, NET_R_TRUST_DOM_LIST *r_u);
3669 uint32 _net_req_chal(pipes_struct *p, NET_Q_REQ_CHAL *q_u, NET_R_REQ_CHAL *r_u);
3670 uint32 _net_auth(pipes_struct *p, NET_Q_AUTH *q_u, NET_R_AUTH *r_u);
3671 uint32 _net_auth_2(pipes_struct *p, NET_Q_AUTH_2 *q_u, NET_R_AUTH_2 *r_u);
3672 uint32 _net_srv_pwset(pipes_struct *p, NET_Q_SRV_PWSET *q_u, NET_R_SRV_PWSET *r_u);
3673 uint32 _net_sam_logoff(pipes_struct *p, NET_Q_SAM_LOGOFF *q_u, NET_R_SAM_LOGOFF *r_u);
3674 uint32 _net_sam_logon(pipes_struct *p, NET_Q_SAM_LOGON *q_u, NET_R_SAM_LOGON *r_u);
3676 /*The following definitions come from rpc_server/srv_pipe.c */
3678 BOOL create_next_pdu(pipes_struct *p);
3679 BOOL api_pipe_bind_auth_resp(pipes_struct *p, prs_struct *rpc_in_p);
3680 BOOL setup_fault_pdu(pipes_struct *p);
3681 BOOL check_bind_req(char* pipe_name, RPC_IFACE* abstract,
3682 RPC_IFACE* transfer);
3683 BOOL api_pipe_bind_req(pipes_struct *p, prs_struct *rpc_in_p);
3684 BOOL api_pipe_auth_process(pipes_struct *p, prs_struct *rpc_in);
3685 struct current_user *get_current_user(struct current_user *user, pipes_struct *p);
3686 BOOL api_pipe_request(pipes_struct *p);
3687 BOOL api_rpcTNP(pipes_struct *p, char *rpc_name,
3688 struct api_struct *api_rpc_cmds);
3690 /*The following definitions come from rpc_server/srv_pipe_hnd.c */
3692 pipes_struct *get_first_pipe(void);
3693 pipes_struct *get_next_pipe(pipes_struct *p);
3694 void set_pipe_handle_offset(int max_open_files);
3695 void reset_chain_p(void);
3696 void init_rpc_pipe_hnd(void);
3697 pipes_struct *open_rpc_pipe_p(char *pipe_name,
3698 connection_struct *conn, uint16 vuid);
3699 void free_pipe_context(pipes_struct *p);
3700 ssize_t write_to_pipe(pipes_struct *p, char *data, size_t n);
3701 ssize_t read_from_pipe(pipes_struct *p, char *data, size_t n);
3702 BOOL wait_rpc_pipe_hnd_state(pipes_struct *p, uint16 priority);
3703 BOOL set_rpc_pipe_hnd_state(pipes_struct *p, uint16 device_state);
3704 BOOL close_rpc_pipe_hnd(pipes_struct *p, connection_struct *conn);
3705 pipes_struct *get_rpc_pipe_p(char *buf, int where);
3706 pipes_struct *get_rpc_pipe(int pnum);
3708 /*The following definitions come from rpc_server/srv_reg.c */
3710 BOOL api_reg_rpc(pipes_struct *p);
3712 /*The following definitions come from rpc_server/srv_reg_nt.c */
3714 uint32 _reg_close(pipes_struct *p, REG_Q_CLOSE *q_u, REG_R_CLOSE *r_u);
3715 uint32 _reg_open(pipes_struct *p, REG_Q_OPEN_HKLM *q_u, REG_R_OPEN_HKLM *r_u);
3716 uint32 _reg_open_entry(pipes_struct *p, REG_Q_OPEN_ENTRY *q_u, REG_R_OPEN_ENTRY *r_u);
3717 uint32 _reg_info(pipes_struct *p, REG_Q_INFO *q_u, REG_R_INFO *r_u);
3719 /*The following definitions come from rpc_server/srv_samr.c */
3721 BOOL api_samr_rpc(pipes_struct *p);
3723 /*The following definitions come from rpc_server/srv_samr_nt.c */
3725 uint32 _samr_close_hnd(pipes_struct *p, SAMR_Q_CLOSE_HND *q_u, SAMR_R_CLOSE_HND *r_u);
3726 uint32 _samr_open_domain(pipes_struct *p, SAMR_Q_OPEN_DOMAIN *q_u, SAMR_R_OPEN_DOMAIN *r_u);
3727 uint32 _samr_get_usrdom_pwinfo(pipes_struct *p, SAMR_Q_GET_USRDOM_PWINFO *q_u, SAMR_R_GET_USRDOM_PWINFO *r_u);
3728 uint32 _samr_query_sec_obj(pipes_struct *p, SAMR_Q_QUERY_SEC_OBJ *q_u, SAMR_R_QUERY_SEC_OBJ *r_u);
3729 uint32 _samr_enum_dom_users(pipes_struct *p, SAMR_Q_ENUM_DOM_USERS *q_u, SAMR_R_ENUM_DOM_USERS *r_u);
3730 uint32 _samr_enum_dom_groups(pipes_struct *p, SAMR_Q_ENUM_DOM_GROUPS *q_u, SAMR_R_ENUM_DOM_GROUPS *r_u);
3731 uint32 _samr_enum_dom_aliases(pipes_struct *p, SAMR_Q_ENUM_DOM_ALIASES *q_u, SAMR_R_ENUM_DOM_ALIASES *r_u);
3732 uint32 _samr_query_dispinfo(pipes_struct *p, SAMR_Q_QUERY_DISPINFO *q_u, SAMR_R_QUERY_DISPINFO *r_u);
3733 uint32 _samr_query_aliasinfo(pipes_struct *p, SAMR_Q_QUERY_ALIASINFO *q_u, SAMR_R_QUERY_ALIASINFO *r_u);
3734 uint32 _samr_lookup_names(pipes_struct *p, SAMR_Q_LOOKUP_NAMES *q_u, SAMR_R_LOOKUP_NAMES *r_u);
3735 uint32 _samr_chgpasswd_user(pipes_struct *p, SAMR_Q_CHGPASSWD_USER *q_u, SAMR_R_CHGPASSWD_USER *r_u);
3736 uint32 _samr_lookup_rids(pipes_struct *p, SAMR_Q_LOOKUP_RIDS *q_u, SAMR_R_LOOKUP_RIDS *r_u);
3737 uint32 _api_samr_open_user(pipes_struct *p, SAMR_Q_OPEN_USER *q_u, SAMR_R_OPEN_USER *r_u);
3738 uint32 _samr_query_userinfo(pipes_struct *p, SAMR_Q_QUERY_USERINFO *q_u, SAMR_R_QUERY_USERINFO *r_u);
3739 uint32 _samr_query_usergroups(pipes_struct *p, SAMR_Q_QUERY_USERGROUPS *q_u, SAMR_R_QUERY_USERGROUPS *r_u);
3740 uint32 _samr_query_dom_info(pipes_struct *p, SAMR_Q_QUERY_DOMAIN_INFO *q_u, SAMR_R_QUERY_DOMAIN_INFO *r_u);
3741 uint32 _api_samr_create_user(pipes_struct *p, SAMR_Q_CREATE_USER *q_u, SAMR_R_CREATE_USER *r_u);
3742 uint32 _samr_connect_anon(pipes_struct *p, SAMR_Q_CONNECT_ANON *q_u, SAMR_R_CONNECT_ANON *r_u);
3743 uint32 _samr_connect(pipes_struct *p, SAMR_Q_CONNECT *q_u, SAMR_R_CONNECT *r_u);
3744 uint32 _samr_lookup_domain(pipes_struct *p, SAMR_Q_LOOKUP_DOMAIN *q_u, SAMR_R_LOOKUP_DOMAIN *r_u);
3745 uint32 _samr_enum_domains(pipes_struct *p, SAMR_Q_ENUM_DOMAINS *q_u, SAMR_R_ENUM_DOMAINS *r_u);
3746 uint32 _api_samr_open_alias(pipes_struct *p, SAMR_Q_OPEN_ALIAS *q_u, SAMR_R_OPEN_ALIAS *r_u);
3747 uint32 _samr_set_userinfo(pipes_struct *p, SAMR_Q_SET_USERINFO *q_u, SAMR_R_SET_USERINFO *r_u);
3748 uint32 _samr_set_userinfo2(pipes_struct *p, SAMR_Q_SET_USERINFO2 *q_u, SAMR_R_SET_USERINFO2 *r_u);
3749 uint32 _samr_query_useraliases(pipes_struct *p, SAMR_Q_QUERY_USERALIASES *q_u, SAMR_R_QUERY_USERALIASES *r_u);
3750 uint32 _samr_query_aliasmem(pipes_struct *p, SAMR_Q_QUERY_ALIASMEM *q_u, SAMR_R_QUERY_ALIASMEM *r_u);
3751 uint32 _samr_query_groupmem(pipes_struct *p, SAMR_Q_QUERY_GROUPMEM *q_u, SAMR_R_QUERY_GROUPMEM *r_u);
3752 uint32 _samr_add_aliasmem(pipes_struct *p, SAMR_Q_ADD_ALIASMEM *q_u, SAMR_R_ADD_ALIASMEM *r_u);
3753 uint32 _samr_del_aliasmem(pipes_struct *p, SAMR_Q_DEL_ALIASMEM *q_u, SAMR_R_DEL_ALIASMEM *r_u);
3754 uint32 _samr_add_groupmem(pipes_struct *p, SAMR_Q_ADD_GROUPMEM *q_u, SAMR_R_ADD_GROUPMEM *r_u);
3755 uint32 _samr_del_groupmem(pipes_struct *p, SAMR_Q_DEL_GROUPMEM *q_u, SAMR_R_DEL_GROUPMEM *r_u);
3756 uint32 _samr_delete_dom_user(pipes_struct *p, SAMR_Q_DELETE_DOM_USER *q_u, SAMR_R_DELETE_DOM_USER *r_u );
3757 uint32 _samr_delete_dom_group(pipes_struct *p, SAMR_Q_DELETE_DOM_GROUP *q_u, SAMR_R_DELETE_DOM_GROUP *r_u);
3758 uint32 _samr_delete_dom_alias(pipes_struct *p, SAMR_Q_DELETE_DOM_ALIAS *q_u, SAMR_R_DELETE_DOM_ALIAS *r_u);
3759 uint32 _samr_create_dom_group(pipes_struct *p, SAMR_Q_CREATE_DOM_GROUP *q_u, SAMR_R_CREATE_DOM_GROUP *r_u);
3760 uint32 _samr_create_dom_alias(pipes_struct *p, SAMR_Q_CREATE_DOM_ALIAS *q_u, SAMR_R_CREATE_DOM_ALIAS *r_u);
3761 uint32 _samr_query_groupinfo(pipes_struct *p, SAMR_Q_QUERY_GROUPINFO *q_u, SAMR_R_QUERY_GROUPINFO *r_u);
3762 uint32 _samr_set_groupinfo(pipes_struct *p, SAMR_Q_SET_GROUPINFO *q_u, SAMR_R_SET_GROUPINFO *r_u);
3763 uint32 _samr_set_aliasinfo(pipes_struct *p, SAMR_Q_SET_ALIASINFO *q_u, SAMR_R_SET_ALIASINFO *r_u);
3764 uint32 _samr_get_dom_pwinfo(pipes_struct *p, SAMR_Q_GET_DOM_PWINFO *q_u, SAMR_R_GET_DOM_PWINFO *r_u);
3765 uint32 _samr_open_group(pipes_struct *p, SAMR_Q_OPEN_GROUP *q_u, SAMR_R_OPEN_GROUP *r_u);
3766 uint32 _samr_unknown_2d(pipes_struct *p, SAMR_Q_UNKNOWN_2D *q_u, SAMR_R_UNKNOWN_2D *r_u);
3768 /*The following definitions come from rpc_server/srv_spoolss.c */
3770 BOOL api_spoolss_rpc(pipes_struct *p);
3772 /*The following definitions come from rpc_server/srv_spoolss_nt.c */
3774 void srv_spoolss_receive_message(int msg_type, pid_t src, void *buf, size_t len);
3775 uint32 _spoolss_open_printer_ex( pipes_struct *p, SPOOL_Q_OPEN_PRINTER_EX *q_u, SPOOL_R_OPEN_PRINTER_EX *r_u);
3776 BOOL convert_devicemode(char *printername, const DEVICEMODE *devmode,
3777 NT_DEVICEMODE **pp_nt_devmode);
3778 uint32 _spoolss_closeprinter(pipes_struct *p, SPOOL_Q_CLOSEPRINTER *q_u, SPOOL_R_CLOSEPRINTER *r_u);
3779 uint32 _spoolss_deleteprinter(pipes_struct *p, SPOOL_Q_DELETEPRINTER *q_u, SPOOL_R_DELETEPRINTER *r_u);
3780 uint32 _spoolss_getprinterdata(pipes_struct *p, SPOOL_Q_GETPRINTERDATA *q_u, SPOOL_R_GETPRINTERDATA *r_u);
3781 uint32 _spoolss_rffpcnex(pipes_struct *p, SPOOL_Q_RFFPCNEX *q_u, SPOOL_R_RFFPCNEX *r_u);
3782 uint32 _spoolss_rfnpcnex( pipes_struct *p, SPOOL_Q_RFNPCNEX *q_u, SPOOL_R_RFNPCNEX *r_u);
3783 uint32 _spoolss_enumprinters( pipes_struct *p, SPOOL_Q_ENUMPRINTERS *q_u, SPOOL_R_ENUMPRINTERS *r_u);
3784 uint32 _spoolss_getprinter(pipes_struct *p, SPOOL_Q_GETPRINTER *q_u, SPOOL_R_GETPRINTER *r_u);
3785 uint32 _spoolss_getprinterdriver2(pipes_struct *p, SPOOL_Q_GETPRINTERDRIVER2 *q_u, SPOOL_R_GETPRINTERDRIVER2 *r_u);
3786 uint32 _spoolss_startpageprinter(pipes_struct *p, SPOOL_Q_STARTPAGEPRINTER *q_u, SPOOL_R_STARTPAGEPRINTER *r_u);
3787 uint32 _spoolss_endpageprinter(pipes_struct *p, SPOOL_Q_ENDPAGEPRINTER *q_u, SPOOL_R_ENDPAGEPRINTER *r_u);
3788 uint32 _spoolss_startdocprinter(pipes_struct *p, SPOOL_Q_STARTDOCPRINTER *q_u, SPOOL_R_STARTDOCPRINTER *r_u);
3789 uint32 _spoolss_enddocprinter(pipes_struct *p, SPOOL_Q_ENDDOCPRINTER *q_u, SPOOL_R_ENDDOCPRINTER *r_u);
3790 uint32 _spoolss_writeprinter(pipes_struct *p, SPOOL_Q_WRITEPRINTER *q_u, SPOOL_R_WRITEPRINTER *r_u);
3791 uint32 _spoolss_abortprinter(pipes_struct *p, SPOOL_Q_ABORTPRINTER *q_u, SPOOL_R_ABORTPRINTER *r_u);
3792 uint32 _spoolss_setprinter(pipes_struct *p, SPOOL_Q_SETPRINTER *q_u, SPOOL_R_SETPRINTER *r_u);
3793 uint32 _spoolss_fcpn(pipes_struct *p, SPOOL_Q_FCPN *q_u, SPOOL_R_FCPN *r_u);
3794 uint32 _spoolss_addjob(pipes_struct *p, SPOOL_Q_ADDJOB *q_u, SPOOL_R_ADDJOB *r_u);
3795 uint32 _spoolss_enumjobs( pipes_struct *p, SPOOL_Q_ENUMJOBS *q_u, SPOOL_R_ENUMJOBS *r_u);
3796 uint32 _spoolss_schedulejob( pipes_struct *p, SPOOL_Q_SCHEDULEJOB *q_u, SPOOL_R_SCHEDULEJOB *r_u);
3797 uint32 _spoolss_setjob(pipes_struct *p, SPOOL_Q_SETJOB *q_u, SPOOL_R_SETJOB *r_u);
3798 uint32 _spoolss_enumprinterdrivers( pipes_struct *p, SPOOL_Q_ENUMPRINTERDRIVERS *q_u, SPOOL_R_ENUMPRINTERDRIVERS *r_u);
3799 uint32 _spoolss_enumforms(pipes_struct *p, SPOOL_Q_ENUMFORMS *q_u, SPOOL_R_ENUMFORMS *r_u);
3800 uint32 _spoolss_getform(pipes_struct *p, SPOOL_Q_GETFORM *q_u, SPOOL_R_GETFORM *r_u);
3801 uint32 _spoolss_enumports( pipes_struct *p, SPOOL_Q_ENUMPORTS *q_u, SPOOL_R_ENUMPORTS *r_u);
3802 uint32 _spoolss_addprinterex( pipes_struct *p, SPOOL_Q_ADDPRINTEREX *q_u, SPOOL_R_ADDPRINTEREX *r_u);
3803 uint32 _spoolss_addprinterdriver(pipes_struct *p, SPOOL_Q_ADDPRINTERDRIVER *q_u, SPOOL_R_ADDPRINTERDRIVER *r_u);
3804 uint32 _spoolss_getprinterdriverdirectory(pipes_struct *p, SPOOL_Q_GETPRINTERDRIVERDIR *q_u, SPOOL_R_GETPRINTERDRIVERDIR *r_u);
3805 uint32 _spoolss_enumprinterdata(pipes_struct *p, SPOOL_Q_ENUMPRINTERDATA *q_u, SPOOL_R_ENUMPRINTERDATA *r_u);
3806 uint32 _spoolss_setprinterdata( pipes_struct *p, SPOOL_Q_SETPRINTERDATA *q_u, SPOOL_R_SETPRINTERDATA *r_u);
3807 uint32 _spoolss_deleteprinterdata(pipes_struct *p, SPOOL_Q_DELETEPRINTERDATA *q_u, SPOOL_R_DELETEPRINTERDATA *r_u);
3808 uint32 _spoolss_addform( pipes_struct *p, SPOOL_Q_ADDFORM *q_u, SPOOL_R_ADDFORM *r_u);
3809 uint32 _spoolss_deleteform( pipes_struct *p, SPOOL_Q_DELETEFORM *q_u, SPOOL_R_DELETEFORM *r_u);
3810 uint32 _spoolss_setform(pipes_struct *p, SPOOL_Q_SETFORM *q_u, SPOOL_R_SETFORM *r_u);
3811 uint32 _spoolss_enumprintprocessors(pipes_struct *p, SPOOL_Q_ENUMPRINTPROCESSORS *q_u, SPOOL_R_ENUMPRINTPROCESSORS *r_u);
3812 uint32 _spoolss_enumprintprocdatatypes(pipes_struct *p, SPOOL_Q_ENUMPRINTPROCDATATYPES *q_u, SPOOL_R_ENUMPRINTPROCDATATYPES *r_u);
3813 uint32 _spoolss_enumprintmonitors(pipes_struct *p, SPOOL_Q_ENUMPRINTMONITORS *q_u, SPOOL_R_ENUMPRINTMONITORS *r_u);
3814 uint32 _spoolss_getjob( pipes_struct *p, SPOOL_Q_GETJOB *q_u, SPOOL_R_GETJOB *r_u);
3816 /*The following definitions come from rpc_server/srv_srvsvc.c */
3818 BOOL api_srvsvc_rpc(pipes_struct *p);
3820 /*The following definitions come from rpc_server/srv_srvsvc_nt.c */
3822 BOOL share_info_db_init(void);
3823 void map_generic_share_sd_bits(SEC_DESC *psd);
3824 BOOL share_access_check(connection_struct *conn, int snum, uint16 vuid, uint32 desired_access);
3825 uint32 _srv_net_srv_get_info(pipes_struct *p, SRV_Q_NET_SRV_GET_INFO *q_u, SRV_R_NET_SRV_GET_INFO *r_u);
3826 uint32 _srv_net_file_enum(pipes_struct *p, SRV_Q_NET_FILE_ENUM *q_u, SRV_R_NET_FILE_ENUM *r_u);
3827 uint32 _srv_net_conn_enum(pipes_struct *p, SRV_Q_NET_CONN_ENUM *q_u, SRV_R_NET_CONN_ENUM *r_u);
3828 uint32 _srv_net_sess_enum(pipes_struct *p, SRV_Q_NET_SESS_ENUM *q_u, SRV_R_NET_SESS_ENUM *r_u);
3829 uint32 _srv_net_share_enum_all(pipes_struct *p, SRV_Q_NET_SHARE_ENUM *q_u, SRV_R_NET_SHARE_ENUM *r_u);
3830 uint32 _srv_net_share_enum(pipes_struct *p, SRV_Q_NET_SHARE_ENUM *q_u, SRV_R_NET_SHARE_ENUM *r_u);
3831 uint32 _srv_net_share_get_info(pipes_struct *p, SRV_Q_NET_SHARE_GET_INFO *q_u, SRV_R_NET_SHARE_GET_INFO *r_u);
3832 uint32 _srv_net_share_set_info(pipes_struct *p, SRV_Q_NET_SHARE_SET_INFO *q_u, SRV_R_NET_SHARE_SET_INFO *r_u);
3833 uint32 _srv_net_share_add(pipes_struct *p, SRV_Q_NET_SHARE_ADD *q_u, SRV_R_NET_SHARE_ADD *r_u);
3834 uint32 _srv_net_share_del(pipes_struct *p, SRV_Q_NET_SHARE_DEL *q_u, SRV_R_NET_SHARE_DEL *r_u);
3835 uint32 _srv_net_remote_tod(pipes_struct *p, SRV_Q_NET_REMOTE_TOD *q_u, SRV_R_NET_REMOTE_TOD *r_u);
3836 uint32 _srv_net_disk_enum(pipes_struct *p, SRV_Q_NET_DISK_ENUM *q_u, SRV_R_NET_DISK_ENUM *r_u);
3837 uint32 _srv_net_name_validate(pipes_struct *p, SRV_Q_NET_NAME_VALIDATE *q_u, SRV_R_NET_NAME_VALIDATE *r_u);
3839 /*The following definitions come from rpc_server/srv_util.c */
3841 int make_dom_gids(TALLOC_CTX *ctx, char *gids_str, DOM_GID **ppgids);
3842 void get_domain_user_groups(char *domain_groups, char *user);
3843 uint32 local_lookup_group_name(uint32 rid, char *group_name, uint32 *type);
3844 uint32 local_lookup_alias_name(uint32 rid, char *alias_name, uint32 *type);
3845 uint32 local_lookup_user_name(uint32 rid, char *user_name, uint32 *type);
3846 uint32 local_lookup_group_rid(char *group_name, uint32 *rid);
3847 uint32 local_lookup_alias_rid(char *alias_name, uint32 *rid);
3848 uint32 local_lookup_user_rid(char *user_name, uint32 *rid);
3850 /*The following definitions come from rpc_server/srv_wkssvc.c */
3852 BOOL api_wkssvc_rpc(pipes_struct *p);
3854 /*The following definitions come from rpc_server/srv_wkssvc_nt.c */
3856 uint32 _wks_query_info(pipes_struct *p, WKS_Q_QUERY_INFO *q_u, WKS_R_QUERY_INFO *r_u);
3858 /*The following definitions come from rpcclient/cmd_lsarpc.c */
3861 /*The following definitions come from rpcclient/cmd_samr.c */
3863 void display_sam_info_1(SAM_ENTRY1 *e1, SAM_STR1 *s1);
3865 /*The following definitions come from rpcclient/cmd_spoolss.c */
3867 BOOL get_short_archi(char *short_archi, char *long_archi);
3868 void set_drv_info_3_env (DRIVER_INFO_3 *info, const char *arch);
3870 /*The following definitions come from rpcclient/rpcclient.c */
3872 void fetch_domain_sid(struct cli_state *cli);
3873 void init_rpcclient_creds(struct ntuser_creds *creds, char* username,
3874 char* domain, char* password);
3875 void add_command_set(struct cmd_set *cmd_set);
3876 struct cli_state *setup_connection(struct cli_state *cli, char *system_name,
3877 struct ntuser_creds *creds);
3879 /*The following definitions come from smbd/blocking.c */
3881 BOOL push_blocking_lock_request( char *inbuf, int length, int lock_timeout, int lock_num);
3882 void remove_pending_lock_requests_by_fid(files_struct *fsp);
3883 void remove_pending_lock_requests_by_mid(int mid);
3884 BOOL blocking_locks_pending(void);
3885 void process_blocking_lock_queue(time_t t);
3887 /*The following definitions come from smbd/chgpasswd.c */
3889 BOOL chgpasswd(char *name, char *oldpass, char *newpass, BOOL as_root);
3890 BOOL chgpasswd(char *name, char *oldpass, char *newpass, BOOL as_root);
3891 BOOL check_lanman_password(char *user, uchar * pass1,
3892 uchar * pass2, SAM_ACCOUNT **hnd);
3893 BOOL change_lanman_password(SAM_ACCOUNT *sampass, uchar * pass1,
3894 uchar * pass2);
3895 BOOL pass_oem_change(char *user,
3896 uchar * lmdata, uchar * lmhash,
3897 uchar * ntdata, uchar * nthash);
3898 BOOL check_oem_password(char *user,
3899 uchar * lmdata, uchar * lmhash,
3900 uchar * ntdata, uchar * nthash,
3901 SAM_ACCOUNT **hnd, char *new_passwd,
3902 int new_passwd_size);
3903 BOOL change_oem_password(SAM_ACCOUNT *hnd, char *new_passwd,
3904 BOOL override);
3905 BOOL check_plaintext_password(char *user, char *old_passwd,
3906 int old_passwd_size, SAM_ACCOUNT **hnd);
3908 /*The following definitions come from smbd/close.c */
3910 int close_file(files_struct *fsp, BOOL normal_close);
3912 /*The following definitions come from smbd/conn.c */
3914 void conn_init(void);
3915 int conn_num_open(void);
3916 BOOL conn_snum_used(int snum);
3917 connection_struct *conn_find(int cnum);
3918 connection_struct *conn_new(void);
3919 void conn_close_all(void);
3920 BOOL conn_idle_all(time_t t, int deadtime);
3921 void conn_free(connection_struct *conn);
3923 /*The following definitions come from smbd/connection.c */
3925 TDB_CONTEXT *conn_tdb_ctx(void);
3926 BOOL yield_connection(connection_struct *conn,char *name,int max_connections);
3927 BOOL claim_connection(connection_struct *conn,char *name,int max_connections,BOOL Clear);
3929 /*The following definitions come from smbd/dfree.c */
3931 SMB_BIG_UINT sys_disk_free(char *path, BOOL small_query,
3932 SMB_BIG_UINT *bsize,SMB_BIG_UINT *dfree,SMB_BIG_UINT *dsize);
3934 /*The following definitions come from smbd/dir.c */
3936 void init_dptrs(void);
3937 char *dptr_path(int key);
3938 char *dptr_wcard(int key);
3939 BOOL dptr_set_wcard(int key, char *wcard);
3940 BOOL dptr_set_attr(int key, uint16 attr);
3941 uint16 dptr_attr(int key);
3942 void dptr_close(int *key);
3943 void dptr_closecnum(connection_struct *conn);
3944 void dptr_idlecnum(connection_struct *conn);
3945 void dptr_closepath(char *path,uint16 spid);
3946 int dptr_create(connection_struct *conn,char *path, BOOL old_handle, BOOL expect_close,uint16 spid);
3947 BOOL dptr_fill(char *buf1,unsigned int key);
3948 void *dptr_fetch(char *buf,int *num);
3949 void *dptr_fetch_lanman2(int dptr_num);
3950 BOOL dir_check_ftype(connection_struct *conn,int mode,SMB_STRUCT_STAT *st,int dirtype);
3951 BOOL get_dir_entry(connection_struct *conn,char *mask,int dirtype,char *fname,
3952 SMB_OFF_T *size,int *mode,time_t *date,BOOL check_descend);
3953 void *OpenDir(connection_struct *conn, char *name, BOOL use_veto);
3954 void CloseDir(void *p);
3955 char *ReadDirName(void *p);
3956 BOOL SeekDir(void *p,int pos);
3957 int TellDir(void *p);
3958 void DirCacheAdd( char *path, char *name, char *dname, int snum );
3959 char *DirCacheCheck( char *path, char *name, int snum );
3960 void DirCacheFlush(int snum);
3962 /*The following definitions come from smbd/dosmode.c */
3964 mode_t unix_mode(connection_struct *conn,int dosmode,const char *fname);
3965 int dos_mode(connection_struct *conn,char *path,SMB_STRUCT_STAT *sbuf);
3966 int file_chmod(connection_struct *conn,char *fname,int dosmode,SMB_STRUCT_STAT *st);
3967 int file_utime(connection_struct *conn, char *fname, struct utimbuf *times);
3968 BOOL set_filetime(connection_struct *conn, char *fname, time_t mtime);
3970 /*The following definitions come from smbd/error.c */
3972 int cached_error_packet(char *inbuf,char *outbuf,files_struct *fsp,int line);
3973 int unix_error_packet(char *inbuf,char *outbuf,int def_class,uint32 def_code,int line);
3974 int error_packet(char *inbuf,char *outbuf,int error_class,uint32 error_code,int line);
3976 /*The following definitions come from smbd/fileio.c */
3978 SMB_OFF_T seek_file(files_struct *fsp,SMB_OFF_T pos);
3979 BOOL read_from_write_cache(files_struct *fsp,char *data,SMB_OFF_T pos,size_t n);
3980 ssize_t read_file(files_struct *fsp,char *data,SMB_OFF_T pos,size_t n);
3981 ssize_t write_file(files_struct *fsp, char *data, SMB_OFF_T pos, size_t n);
3982 void delete_write_cache(files_struct *fsp);
3983 void set_filelen_write_cache(files_struct *fsp, SMB_OFF_T file_size);
3984 ssize_t flush_write_cache(files_struct *fsp, enum flush_reason_enum reason);
3985 void sync_file(connection_struct *conn, files_struct *fsp);
3987 /*The following definitions come from smbd/filename.c */
3989 BOOL unix_convert(char *name,connection_struct *conn,char *saved_last_component,
3990 BOOL *bad_path, SMB_STRUCT_STAT *pst);
3991 BOOL check_name(char *name,connection_struct *conn);
3993 /*The following definitions come from smbd/files.c */
3995 files_struct *file_new(connection_struct *conn);
3996 void file_close_conn(connection_struct *conn);
3997 void file_init(void);
3998 void file_close_user(int vuid);
3999 files_struct *file_find_dit(SMB_DEV_T dev, SMB_INO_T inode, struct timeval *tval);
4000 files_struct *file_find_fsp(files_struct *orig_fsp);
4001 files_struct *file_find_di_first(SMB_DEV_T dev, SMB_INO_T inode);
4002 files_struct *file_find_di_next(files_struct *start_fsp);
4003 files_struct *file_find_print(void);
4004 void file_sync_all(connection_struct *conn);
4005 void file_free(files_struct *fsp);
4006 files_struct *file_fsp(char *buf, int where);
4007 void file_chain_reset(void);
4008 void file_chain_save(void);
4009 void file_chain_restore(void);
4011 /*The following definitions come from smbd/ipc.c */
4013 void send_trans_reply(char *outbuf,
4014 char *rparam, int rparam_len,
4015 char *rdata, int rdata_len,
4016 BOOL buffer_too_large);
4017 int reply_trans(connection_struct *conn, char *inbuf,char *outbuf, int size, int bufsize);
4019 /*The following definitions come from smbd/lanman.c */
4021 int api_reply(connection_struct *conn,uint16 vuid,char *outbuf,char *data,char *params,
4022 int tdscnt,int tpscnt,int mdrcnt,int mprcnt);
4024 /*The following definitions come from smbd/mangle.c */
4026 BOOL is_mangled( char *s );
4027 BOOL is_8_3( char *fname, BOOL check_case );
4028 void reset_mangled_cache( void );
4029 BOOL check_mangled_cache( char *s );
4030 void mangle_name_83( char *s);
4031 BOOL name_map_mangle(char *OutName, BOOL need83, BOOL cache83, int snum);
4033 /*The following definitions come from smbd/message.c */
4035 int reply_sends(connection_struct *conn,
4036 char *inbuf,char *outbuf, int dum_size, int dum_buffsize);
4037 int reply_sendstrt(connection_struct *conn,
4038 char *inbuf,char *outbuf, int dum_size, int dum_buffsize);
4039 int reply_sendtxt(connection_struct *conn,
4040 char *inbuf,char *outbuf, int dum_size, int dum_buffsize);
4041 int reply_sendend(connection_struct *conn,
4042 char *inbuf,char *outbuf, int dum_size, int dum_buffsize);
4044 /*The following definitions come from smbd/negprot.c */
4046 int reply_negprot(connection_struct *conn,
4047 char *inbuf,char *outbuf, int dum_size,
4048 int dum_buffsize);
4050 /*The following definitions come from smbd/noquotas.c */
4052 BOOL disk_quotas(char *path,SMB_BIG_UINT *bsize,SMB_BIG_UINT *dfree,SMB_BIG_UINT *dsize);
4054 /*The following definitions come from smbd/notify.c */
4056 void remove_pending_change_notify_requests_by_fid(files_struct *fsp);
4057 void remove_pending_change_notify_requests_by_mid(int mid);
4058 void remove_pending_change_notify_requests_by_filename(files_struct *fsp);
4059 int change_notify_timeout(void);
4060 BOOL process_pending_change_notify_queue(time_t t);
4061 BOOL change_notify_set(char *inbuf, files_struct *fsp, connection_struct *conn, uint32 flags);
4062 BOOL init_change_notify(void);
4064 /*The following definitions come from smbd/notify_hash.c */
4066 struct cnotify_fns *hash_notify_init(void) ;
4068 /*The following definitions come from smbd/notify_kernel.c */
4070 struct cnotify_fns *kernel_notify_init(void) ;
4072 /*The following definitions come from smbd/nttrans.c */
4074 void fail_next_srvsvc_open(void);
4075 BOOL should_fail_next_srvsvc_open(const char *pipename);
4076 int reply_ntcreate_and_X(connection_struct *conn,
4077 char *inbuf,char *outbuf,int length,int bufsize);
4078 int reply_ntcancel(connection_struct *conn,
4079 char *inbuf,char *outbuf,int length,int bufsize);
4080 int reply_nttranss(connection_struct *conn,
4081 char *inbuf,char *outbuf,int length,int bufsize);
4082 int reply_nttrans(connection_struct *conn,
4083 char *inbuf,char *outbuf,int length,int bufsize);
4085 /*The following definitions come from smbd/open.c */
4087 int fd_close(struct connection_struct *conn, files_struct *fsp);
4088 files_struct *open_file_shared(connection_struct *conn,char *fname, SMB_STRUCT_STAT *psbuf,
4089 int share_mode,int ofun, mode_t mode,int oplock_request, int *Access,int *action);
4090 files_struct *open_file_stat(connection_struct *conn, char *fname,
4091 SMB_STRUCT_STAT *psbuf, int smb_ofun, int *action);
4092 files_struct *open_file_fchmod(connection_struct *conn, char *fname, SMB_STRUCT_STAT *psbuf);
4093 int close_file_fchmod(files_struct *fsp);
4094 files_struct *open_directory(connection_struct *conn, char *fname,
4095 SMB_STRUCT_STAT *psbuf, int smb_ofun, mode_t unixmode, int *action);
4096 BOOL check_file_sharing(connection_struct *conn,char *fname, BOOL rename_op);
4098 /*The following definitions come from smbd/oplock.c */
4100 int32 get_number_of_exclusive_open_oplocks(void);
4101 BOOL receive_local_message(fd_set *fds, char *buffer, int buffer_len, int timeout);
4102 BOOL set_file_oplock(files_struct *fsp, int oplock_type);
4103 void release_file_oplock(files_struct *fsp);
4104 BOOL remove_oplock(files_struct *fsp, BOOL break_to_none);
4105 int setup_oplock_select_set( fd_set *fds);
4106 BOOL process_local_message(char *buffer, int buf_size);
4107 BOOL oplock_break_level2(files_struct *fsp, BOOL local_request, int token);
4108 BOOL request_oplock_break(share_mode_entry *share_entry,
4109 SMB_DEV_T dev, SMB_INO_T inode);
4110 BOOL attempt_close_oplocked_file(files_struct *fsp);
4111 void release_level_2_oplocks_on_change(files_struct *fsp);
4112 BOOL init_oplocks(void);
4114 /*The following definitions come from smbd/oplock_irix.c */
4116 struct kernel_oplocks *irix_init_kernel_oplocks(void) ;
4118 /*The following definitions come from smbd/oplock_linux.c */
4120 struct kernel_oplocks *linux_init_kernel_oplocks(void) ;
4122 /*The following definitions come from smbd/password.c */
4124 void generate_next_challenge(char *challenge);
4125 BOOL set_challenge(unsigned char *challenge);
4126 user_struct *get_valid_user_struct(uint16 vuid);
4127 void invalidate_vuid(uint16 vuid);
4128 void invalidate_all_vuids(void);
4129 char *validated_username(uint16 vuid);
4130 char *validated_domain(uint16 vuid);
4131 NT_USER_TOKEN *create_nt_token(uid_t uid, gid_t gid, int ngroups, gid_t *groups, BOOL is_guest);
4132 int register_vuid(uid_t uid,gid_t gid, char *unix_name, char *requested_name,
4133 char *domain,BOOL guest);
4134 void add_session_user(char *user);
4135 BOOL smb_password_check(char *password, unsigned char *part_passwd, unsigned char *c8);
4136 BOOL smb_password_ok(SAM_ACCOUNT *sampass, uchar chal[8],
4137 uchar lm_pass[24], uchar nt_pass[24]);
4138 BOOL pass_check_smb(char *user, char *domain, uchar *chal,
4139 uchar *lm_pwd, uchar *nt_pwd, struct passwd *pwd);
4140 BOOL password_ok(char *user, char *password, int pwlen, struct passwd *pwd);
4141 BOOL user_ok(char *user,int snum);
4142 BOOL authorise_login(int snum,char *user,char *password, int pwlen,
4143 BOOL *guest,BOOL *force,uint16 vuid);
4144 BOOL check_hosts_equiv(char *user);
4145 struct cli_state *server_client(void);
4146 struct cli_state *server_cryptkey(void);
4147 BOOL server_validate(char *user, char *domain,
4148 char *pass, int passlen,
4149 char *ntpass, int ntpasslen);
4150 BOOL domain_client_validate( char *user, char *domain,
4151 char *smb_apasswd, int smb_apasslen,
4152 char *smb_ntpasswd, int smb_ntpasslen,
4153 BOOL *user_exists);
4155 /*The following definitions come from smbd/pipes.c */
4157 int reply_open_pipe_and_X(connection_struct *conn,
4158 char *inbuf,char *outbuf,int length,int bufsize);
4159 int reply_pipe_write(char *inbuf,char *outbuf,int length,int dum_bufsize);
4160 int reply_pipe_write_and_X(char *inbuf,char *outbuf,int length,int bufsize);
4161 int reply_pipe_read_and_X(char *inbuf,char *outbuf,int length,int bufsize);
4162 int reply_pipe_close(connection_struct *conn, char *inbuf,char *outbuf);
4164 /*The following definitions come from smbd/posix_acls.c */
4166 size_t get_nt_acl(files_struct *fsp, SEC_DESC **ppdesc);
4167 BOOL set_nt_acl(files_struct *fsp, uint32 security_info_sent, SEC_DESC *psd);
4168 int chmod_acl(char *name, mode_t mode);
4169 int fchmod_acl(int fd, mode_t mode);
4171 /*The following definitions come from smbd/process.c */
4173 BOOL push_oplock_pending_smb_message(char *buf, int msg_len);
4174 BOOL receive_next_smb(char *inbuf, int bufsize, int timeout);
4175 void respond_to_all_remaining_local_messages(void);
4176 void process_smb(char *inbuf, char *outbuf);
4177 char *smb_fn_name(int type);
4178 void construct_reply_common(char *inbuf,char *outbuf);
4179 int chain_reply(char *inbuf,char *outbuf,int size,int bufsize);
4180 void check_reload(int t);
4181 void smbd_process(void);
4183 /*The following definitions come from smbd/reply.c */
4185 int reply_special(char *inbuf,char *outbuf);
4186 int reply_tcon(connection_struct *conn,
4187 char *inbuf,char *outbuf, int dum_size, int dum_buffsize);
4188 int reply_tcon_and_X(connection_struct *conn, char *inbuf,char *outbuf,int length,int bufsize);
4189 int reply_unknown(char *inbuf,char *outbuf);
4190 int reply_ioctl(connection_struct *conn,
4191 char *inbuf,char *outbuf, int dum_size, int dum_buffsize);
4192 int smb_create_user(char *unix_user, char *homedir);
4193 int reply_sesssetup_and_X(connection_struct *conn, char *inbuf,char *outbuf,int length,int bufsize);
4194 int reply_chkpth(connection_struct *conn, char *inbuf,char *outbuf, int dum_size, int dum_buffsize);
4195 int reply_getatr(connection_struct *conn, char *inbuf,char *outbuf, int dum_size, int dum_buffsize);
4196 int reply_setatr(connection_struct *conn, char *inbuf,char *outbuf, int dum_size, int dum_buffsize);
4197 int reply_dskattr(connection_struct *conn, char *inbuf,char *outbuf, int dum_size, int dum_buffsize);
4198 int reply_search(connection_struct *conn, char *inbuf,char *outbuf, int dum_size, int dum_buffsize);
4199 int reply_fclose(connection_struct *conn, char *inbuf,char *outbuf, int dum_size, int dum_buffsize);
4200 int reply_open(connection_struct *conn, char *inbuf,char *outbuf, int dum_size, int dum_buffsize);
4201 int reply_open_and_X(connection_struct *conn, char *inbuf,char *outbuf,int length,int bufsize);
4202 int reply_ulogoffX(connection_struct *conn, char *inbuf,char *outbuf,int length,int bufsize);
4203 int reply_mknew(connection_struct *conn, char *inbuf,char *outbuf, int dum_size, int dum_buffsize);
4204 int reply_ctemp(connection_struct *conn, char *inbuf,char *outbuf, int dum_size, int dum_buffsize);
4205 int unlink_internals(connection_struct *conn, char *inbuf,char *outbuf,
4206 int dirtype, char *name);
4207 int reply_unlink(connection_struct *conn, char *inbuf,char *outbuf, int dum_size, int dum_buffsize);
4208 int reply_readbraw(connection_struct *conn, char *inbuf, char *outbuf, int dum_size, int dum_buffsize);
4209 int reply_lockread(connection_struct *conn, char *inbuf,char *outbuf, int length, int dum_buffsiz);
4210 int reply_read(connection_struct *conn, char *inbuf,char *outbuf, int size, int dum_buffsize);
4211 int reply_read_and_X(connection_struct *conn, char *inbuf,char *outbuf,int length,int bufsize);
4212 int reply_writebraw(connection_struct *conn, char *inbuf,char *outbuf, int size, int dum_buffsize);
4213 int reply_writeunlock(connection_struct *conn, char *inbuf,char *outbuf, int size, int dum_buffsize);
4214 int reply_write(connection_struct *conn, char *inbuf,char *outbuf,int size,int dum_buffsize);
4215 int reply_write_and_X(connection_struct *conn, char *inbuf,char *outbuf,int length,int bufsize);
4216 int reply_lseek(connection_struct *conn, char *inbuf,char *outbuf, int size, int dum_buffsize);
4217 int reply_flush(connection_struct *conn, char *inbuf,char *outbuf, int size, int dum_buffsize);
4218 int reply_exit(connection_struct *conn,
4219 char *inbuf,char *outbuf, int dum_size, int dum_buffsize);
4220 int reply_close(connection_struct *conn, char *inbuf,char *outbuf, int size,
4221 int dum_buffsize);
4222 int reply_writeclose(connection_struct *conn,
4223 char *inbuf,char *outbuf, int size, int dum_buffsize);
4224 int reply_lock(connection_struct *conn,
4225 char *inbuf,char *outbuf, int length, int dum_buffsize);
4226 int reply_unlock(connection_struct *conn, char *inbuf,char *outbuf, int size, int dum_buffsize);
4227 int reply_tdis(connection_struct *conn,
4228 char *inbuf,char *outbuf, int dum_size, int dum_buffsize);
4229 int reply_echo(connection_struct *conn,
4230 char *inbuf,char *outbuf, int dum_size, int dum_buffsize);
4231 int reply_printopen(connection_struct *conn,
4232 char *inbuf,char *outbuf, int dum_size, int dum_buffsize);
4233 int reply_printclose(connection_struct *conn,
4234 char *inbuf,char *outbuf, int dum_size, int dum_buffsize);
4235 int reply_printqueue(connection_struct *conn,
4236 char *inbuf,char *outbuf, int dum_size, int dum_buffsize);
4237 int reply_printwrite(connection_struct *conn, char *inbuf,char *outbuf, int dum_size, int dum_buffsize);
4238 int mkdir_internal(connection_struct *conn, char *inbuf, char *outbuf, pstring directory);
4239 int reply_mkdir(connection_struct *conn, char *inbuf,char *outbuf, int dum_size, int dum_buffsize);
4240 BOOL rmdir_internals(connection_struct *conn, char *directory);
4241 int reply_rmdir(connection_struct *conn, char *inbuf,char *outbuf, int dum_size, int dum_buffsize);
4242 int rename_internals(connection_struct *conn,
4243 char *inbuf, char *outbuf, char *name,
4244 char *newname, BOOL replace_if_exists);
4245 int reply_mv(connection_struct *conn, char *inbuf,char *outbuf, int dum_size, int dum_buffsize);
4246 int reply_copy(connection_struct *conn, char *inbuf,char *outbuf, int dum_size, int dum_buffsize);
4247 int reply_setdir(connection_struct *conn, char *inbuf,char *outbuf, int dum_size, int dum_buffsize);
4248 SMB_BIG_UINT get_lock_count( char *data, int data_offset, BOOL large_file_format);
4249 SMB_BIG_UINT get_lock_offset( char *data, int data_offset, BOOL large_file_format, BOOL *err);
4250 int reply_lockingX(connection_struct *conn, char *inbuf,char *outbuf,int length,int bufsize);
4251 int reply_readbmpx(connection_struct *conn, char *inbuf,char *outbuf,int length,int bufsize);
4252 int reply_writebmpx(connection_struct *conn, char *inbuf,char *outbuf, int size, int dum_buffsize);
4253 int reply_writebs(connection_struct *conn, char *inbuf,char *outbuf, int dum_size, int dum_buffsize);
4254 int reply_setattrE(connection_struct *conn, char *inbuf,char *outbuf, int size, int dum_buffsize);
4255 int reply_getattrE(connection_struct *conn, char *inbuf,char *outbuf, int size, int dum_buffsize);
4257 /*The following definitions come from smbd/sec_ctx.c */
4259 int get_current_groups(int *p_ngroups, gid_t **p_groups);
4260 void delete_nt_token(NT_USER_TOKEN **pptoken);
4261 NT_USER_TOKEN *dup_nt_token(NT_USER_TOKEN *ptoken);
4262 BOOL initialise_groups(char *user, uid_t uid, gid_t gid);
4263 BOOL push_sec_ctx(void);
4264 void set_sec_ctx(uid_t uid, gid_t gid, int ngroups, gid_t *groups, NT_USER_TOKEN *token);
4265 void set_root_sec_ctx(void);
4266 BOOL pop_sec_ctx(void);
4267 void init_sec_ctx(void);
4269 /*The following definitions come from smbd/server.c */
4271 int smbd_server_fd(void);
4272 void smbd_set_server_fd(int fd);
4273 BOOL reload_services(BOOL test);
4274 void exit_server(char *reason);
4276 /*The following definitions come from smbd/service.c */
4278 BOOL become_service(connection_struct *conn,BOOL do_chdir);
4279 int add_home_service(char *service, char *homedir);
4280 int find_service(char *service);
4281 connection_struct *make_connection(char *service,char *user,char *password, int pwlen, char *dev,uint16 vuid, int *ecode);
4282 void close_cnum(connection_struct *conn, uint16 vuid);
4284 /*The following definitions come from smbd/session.c */
4286 BOOL session_claim(uint16 vuid);
4287 void session_yield(uint16 vuid);
4289 /*The following definitions come from smbd/srvstr.c */
4291 int srvstr_push(void *outbuf, void *dest, const char *src, int dest_len, int flags);
4292 int srvstr_pull(void *inbuf, char *dest, const void *src, int dest_len, int src_len, int flags);
4293 int srvstr_align(void *inbuf, int offset);
4294 int srvstr_push_ascii(void *dest, const char *src, int dest_len);
4295 int srvstr_pull_ascii(char *dest, const void *src, int dest_len);
4297 /*The following definitions come from smbd/ssl.c */
4299 int sslutil_init(int isServer);
4300 int sslutil_accept(int fd);
4301 int sslutil_fd_is_ssl(int fd);
4302 int sslutil_connect(int fd);
4303 int sslutil_disconnect(int fd);
4304 int sslutil_negotiate_ssl(int fd, int msg_type);
4306 /*The following definitions come from smbd/statcache.c */
4308 void stat_cache_add( char *full_orig_name, char *orig_translated_path);
4309 BOOL stat_cache_lookup(connection_struct *conn, char *name, char *dirpath,
4310 char **start, SMB_STRUCT_STAT *pst);
4311 BOOL reset_stat_cache( void );
4313 /*The following definitions come from smbd/trans2.c */
4315 int reply_findclose(connection_struct *conn,
4316 char *inbuf,char *outbuf,int length,int bufsize);
4317 int reply_findnclose(connection_struct *conn,
4318 char *inbuf,char *outbuf,int length,int bufsize);
4319 int reply_transs2(connection_struct *conn,
4320 char *inbuf,char *outbuf,int length,int bufsize);
4321 int reply_trans2(connection_struct *conn,
4322 char *inbuf,char *outbuf,int length,int bufsize);
4324 /*The following definitions come from smbd/uid.c */
4326 BOOL become_guest(void);
4327 BOOL become_user(connection_struct *conn, uint16 vuid);
4328 BOOL unbecome_user(void );
4329 BOOL become_authenticated_pipe_user(pipes_struct *p);
4330 BOOL unbecome_authenticated_pipe_user(pipes_struct *p);
4331 void become_root(void);
4332 void unbecome_root(void);
4333 BOOL lookup_name(const char *name, DOM_SID *psid, enum SID_NAME_USE *name_type);
4334 BOOL lookup_sid(DOM_SID *sid, fstring dom_name, fstring name, enum SID_NAME_USE *name_type);
4335 DOM_SID *uid_to_sid(DOM_SID *psid, uid_t uid);
4336 DOM_SID *gid_to_sid(DOM_SID *psid, gid_t gid);
4337 BOOL sid_to_uid(DOM_SID *psid, uid_t *puid, enum SID_NAME_USE *sidtype);
4338 BOOL sid_to_gid(DOM_SID *psid, gid_t *pgid, enum SID_NAME_USE *sidtype);
4340 /*The following definitions come from smbd/utmp.c */
4342 void sys_utmp_yield(const char *username, const char *hostname,
4343 const char *id_str, int id_num);
4344 void sys_utmp_claim(const char *username, const char *hostname,
4345 const char *id_str, int id_num);
4347 /*The following definitions come from smbd/vfs-wrap.c */
4349 int vfswrap_dummy_connect(connection_struct *conn, char *service, char *user);
4350 void vfswrap_dummy_disconnect(connection_struct *conn);
4351 SMB_BIG_UINT vfswrap_disk_free(connection_struct *conn, char *path, BOOL small_query, SMB_BIG_UINT *bsize,
4352 SMB_BIG_UINT *dfree, SMB_BIG_UINT *dsize);
4353 DIR *vfswrap_opendir(connection_struct *conn, char *fname);
4354 struct dirent *vfswrap_readdir(connection_struct *conn, DIR *dirp);
4355 int vfswrap_mkdir(connection_struct *conn, char *path, mode_t mode);
4356 int vfswrap_rmdir(connection_struct *conn, char *path);
4357 int vfswrap_closedir(connection_struct *conn, DIR *dirp);
4358 int vfswrap_open(connection_struct *conn, char *fname, int flags, mode_t mode);
4359 int vfswrap_close(files_struct *fsp, int fd);
4360 ssize_t vfswrap_read(files_struct *fsp, int fd, char *data, size_t n);
4361 ssize_t vfswrap_write(files_struct *fsp, int fd, char *data, size_t n);
4362 SMB_OFF_T vfswrap_lseek(files_struct *fsp, int filedes, SMB_OFF_T offset, int whence);
4363 int vfswrap_rename(connection_struct *conn, char *old, char *new);
4364 int vfswrap_fsync(files_struct *fsp, int fd);
4365 int vfswrap_stat(connection_struct *conn, char *fname, SMB_STRUCT_STAT *sbuf);
4366 int vfswrap_fstat(files_struct *fsp, int fd, SMB_STRUCT_STAT *sbuf);
4367 int vfswrap_lstat(connection_struct *conn, char *path, SMB_STRUCT_STAT *sbuf);
4368 int vfswrap_unlink(connection_struct *conn, char *path);
4369 int vfswrap_chmod(connection_struct *conn, char *path, mode_t mode);
4370 int vfswrap_fchmod(files_struct *fsp, int fd, mode_t mode);
4371 int vfswrap_chown(connection_struct *conn, char *path, uid_t uid, gid_t gid);
4372 int vfswrap_fchown(files_struct *fsp, int fd, uid_t uid, gid_t gid);
4373 int vfswrap_chdir(connection_struct *conn, char *path);
4374 char *vfswrap_getwd(connection_struct *conn, char *path);
4375 int vfswrap_utime(connection_struct *conn, char *path, struct utimbuf *times);
4376 int vfswrap_ftruncate(files_struct *fsp, int fd, SMB_OFF_T len);
4377 BOOL vfswrap_lock(files_struct *fsp, int fd, int op, SMB_OFF_T offset, SMB_OFF_T count, int type);
4378 size_t vfswrap_fget_nt_acl(files_struct *fsp, int fd, SEC_DESC **ppdesc);
4379 size_t vfswrap_get_nt_acl(files_struct *fsp, char *name, SEC_DESC **ppdesc);
4380 BOOL vfswrap_fset_nt_acl(files_struct *fsp, int fd, uint32 security_info_sent, SEC_DESC *psd);
4381 BOOL vfswrap_set_nt_acl(files_struct *fsp, char *name, uint32 security_info_sent, SEC_DESC *psd);
4382 int vfswrap_chmod_acl(connection_struct *conn, char *name, mode_t mode);
4383 int vfswrap_fchmod_acl(files_struct *fsp, int fd, mode_t mode);
4385 /*The following definitions come from smbd/vfs.c */
4387 int vfs_init_default(connection_struct *conn);
4388 BOOL vfs_init_custom(connection_struct *conn);
4389 BOOL vfs_directory_exist(connection_struct *conn, char *dname, SMB_STRUCT_STAT *st);
4390 int vfs_mkdir(connection_struct *conn, char *fname, mode_t mode);
4391 char *vfs_getwd(connection_struct *conn, char *unix_path);
4392 BOOL vfs_file_exist(connection_struct *conn,char *fname,SMB_STRUCT_STAT *sbuf);
4393 ssize_t vfs_read_data(files_struct *fsp, char *buf, size_t byte_count);
4394 ssize_t vfs_write_data(files_struct *fsp,char *buffer,size_t N);
4395 int vfs_set_filelen(files_struct *fsp, SMB_OFF_T len);
4396 SMB_OFF_T vfs_transfer_file(int in_fd, files_struct *in_fsp,
4397 int out_fd, files_struct *out_fsp,
4398 SMB_OFF_T n, char *header, int headlen, int align);
4399 char *vfs_readdirname(connection_struct *conn, void *p);
4400 int vfs_ChDir(connection_struct *conn, char *path);
4401 char *vfs_GetWd(connection_struct *conn, char *path);
4402 BOOL reduce_name(connection_struct *conn, char *s,char *dir,BOOL widelinks);
4404 /*The following definitions come from smbwrapper/realcalls.c */
4406 int real_utime(const char *name, struct utimbuf *buf);
4407 int real_utimes(const char *name, struct timeval tv[2]);
4409 /*The following definitions come from smbwrapper/shared.c */
4411 void smbw_setup_shared(void);
4412 char *smbw_getshared(const char *name);
4413 void smbw_setshared(const char *name, const char *val);
4414 int smbw_setenv(const char *name, const char *value);
4415 int smbw_shared_fd(int fd);
4417 /*The following definitions come from smbwrapper/smbw.c */
4419 void smbw_init(void);
4420 int smbw_fd(int fd);
4421 int smbw_local_fd(int fd);
4422 ino_t smbw_inode(const char *name);
4423 void clean_fname(char *name);
4424 char *smbw_parse_path(const char *fname, char *server, char *share, char *path);
4425 int smbw_path(const char *path);
4426 int smbw_errno(struct cli_state *c);
4427 void get_envvar_auth_data(char *server, char *share, char **workgroup,
4428 char **username, char **password);
4429 void smbw_set_auth_data_fn(smbw_get_auth_data_fn fn);
4430 struct smbw_server *smbw_server(char *server, char *share);
4431 struct smbw_file *smbw_file(int fd);
4432 int smbw_open(const char *fname, int flags, mode_t mode);
4433 ssize_t smbw_pread(int fd, void *buf, size_t count, off_t ofs);
4434 ssize_t smbw_read(int fd, void *buf, size_t count);
4435 ssize_t smbw_write(int fd, void *buf, size_t count);
4436 ssize_t smbw_pwrite(int fd, void *buf, size_t count, off_t ofs);
4437 int smbw_close(int fd);
4438 int smbw_fcntl(int fd, int cmd, long arg);
4439 int smbw_access(const char *name, int mode);
4440 int smbw_readlink(const char *path, char *buf, size_t bufsize);
4441 int smbw_unlink(const char *fname);
4442 int smbw_rename(const char *oldname, const char *newname);
4443 int smbw_utime(const char *fname, void *buf);
4444 int smbw_utimes(const char *fname, void *buf);
4445 int smbw_chown(const char *fname, uid_t owner, gid_t group);
4446 int smbw_chmod(const char *fname, mode_t newmode);
4447 off_t smbw_lseek(int fd, off_t offset, int whence);
4448 int smbw_dup(int fd);
4449 int smbw_dup2(int fd, int fd2);
4450 int smbw_fork(void);
4452 /*The following definitions come from smbwrapper/smbw_cache.c */
4454 BOOL smbw_NetServerEnum(struct cli_state *cli, char *workgroup, uint32 stype,
4455 void (*fn)(const char *, uint32, const char *, void *),
4456 void *state);
4457 int smbw_RNetShareEnum(struct cli_state *cli,
4458 void (*fn)(const char *, uint32, const char *, void *),
4459 void *state);
4461 /*The following definitions come from smbwrapper/smbw_dir.c */
4463 struct smbw_dir *smbw_dir(int fd);
4464 int smbw_dirp(DIR *dirp);
4465 int smbw_dir_open(const char *fname);
4466 int smbw_dir_fstat(int fd, struct stat *st);
4467 int smbw_dir_close(int fd);
4468 int smbw_getdents(unsigned int fd, struct dirent *dirp, int count);
4469 int smbw_chdir(const char *name);
4470 off_t smbw_dir_lseek(int fd, off_t offset, int whence);
4471 int smbw_mkdir(const char *fname, mode_t mode);
4472 int smbw_rmdir(const char *fname);
4473 char *smbw_getcwd(char *buf, size_t size);
4474 int smbw_fchdir(unsigned int fd);
4475 DIR *smbw_opendir(const char *fname);
4476 struct dirent *smbw_readdir(DIR *dirp);
4477 int smbw_closedir(DIR *dirp);
4478 void smbw_seekdir(DIR *dirp, off_t offset);
4479 off_t smbw_telldir(DIR *dirp);
4481 /*The following definitions come from smbwrapper/smbw_stat.c */
4483 void smbw_setup_stat(struct stat *st, char *fname, size_t size, int mode);
4484 BOOL smbw_getatr(struct smbw_server *srv, char *path,
4485 uint16 *mode, size_t *size,
4486 time_t *c_time, time_t *a_time, time_t *m_time,
4487 SMB_INO_T *ino);
4488 int smbw_stat_printjob(struct smbw_server *srv,char *path,
4489 size_t *size, time_t *m_time);
4490 int smbw_fstat(int fd, struct stat *st);
4491 int smbw_stat(const char *fname, struct stat *st);
4493 /*The following definitions come from tdb/spinlock.c */
4495 int tdb_spinlock(TDB_CONTEXT *tdb, int list, int rw_type);
4496 int tdb_spinunlock(TDB_CONTEXT *tdb, int list, int rw_type);
4497 int tdb_create_rwlocks(int fd, unsigned int hash_size);
4498 int tdb_clear_spinlocks(TDB_CONTEXT *tdb);
4499 int tdb_clear_spinlocks(TDB_CONTEXT *tdb);
4501 /*The following definitions come from tdb/tdb.c */
4503 void tdb_printfreelist(TDB_CONTEXT *tdb);
4504 enum TDB_ERROR tdb_error(TDB_CONTEXT *tdb);
4505 const char *tdb_errorstr(TDB_CONTEXT *tdb);
4506 TDB_DATA tdb_fetch(TDB_CONTEXT *tdb, TDB_DATA key);
4507 int tdb_exists(TDB_CONTEXT *tdb, TDB_DATA key);
4508 int tdb_traverse(TDB_CONTEXT *tdb, tdb_traverse_func fn, void *state);
4509 TDB_DATA tdb_firstkey(TDB_CONTEXT *tdb);
4510 TDB_DATA tdb_nextkey(TDB_CONTEXT *tdb, TDB_DATA oldkey);
4511 int tdb_delete(TDB_CONTEXT *tdb, TDB_DATA key);
4512 int tdb_store(TDB_CONTEXT *tdb, TDB_DATA key, TDB_DATA dbuf, int flag);
4513 TDB_CONTEXT *tdb_open(char *name, int hash_size, int tdb_flags,
4514 int open_flags, mode_t mode);
4515 int tdb_close(TDB_CONTEXT *tdb);
4516 int tdb_lockall(TDB_CONTEXT *tdb);
4517 void tdb_unlockall(TDB_CONTEXT *tdb);
4518 int tdb_lockkeys(TDB_CONTEXT *tdb, u32 number, TDB_DATA keys[]);
4519 void tdb_unlockkeys(TDB_CONTEXT *tdb);
4520 int tdb_chainlock(TDB_CONTEXT *tdb, TDB_DATA key);
4521 void tdb_chainunlock(TDB_CONTEXT *tdb, TDB_DATA key);
4523 /*The following definitions come from tdb/tdbutil.c */
4525 int tdb_lock_bystring(TDB_CONTEXT *tdb, char *keyval);
4526 void tdb_unlock_bystring(TDB_CONTEXT *tdb, char *keyval);
4527 int tdb_fetch_int_byblob(TDB_CONTEXT *tdb, char *keyval, size_t len);
4528 int tdb_fetch_int(TDB_CONTEXT *tdb, char *keystr);
4529 int tdb_store_int_byblob(TDB_CONTEXT *tdb, char *keystr, size_t len, int v);
4530 int tdb_store_int(TDB_CONTEXT *tdb, char *keystr, int v);
4531 int tdb_store_by_string(TDB_CONTEXT *tdb, char *keystr, void *buffer, int len);
4532 TDB_DATA tdb_fetch_by_string(TDB_CONTEXT *tdb, char *keystr);
4533 size_t tdb_pack(char *buf, int bufsize, char *fmt, ...);
4534 int tdb_unpack(char *buf, int bufsize, char *fmt, ...);
4536 /*The following definitions come from utils/nbio.c */
4538 void nb_setup(struct cli_state *cli);
4539 void nb_unlink(char *fname);
4540 void nb_open(char *fname, int handle, int size);
4541 void nb_write(int handle, int size, int offset);
4542 void nb_read(int handle, int size, int offset);
4543 void nb_close(int handle);
4544 void nb_mkdir(char *fname);
4545 void nb_rmdir(char *fname);
4546 void nb_rename(char *old, char *new);
4547 void nb_stat(char *fname, int size);
4548 void nb_create(char *fname, int size);
4550 /*The following definitions come from utils/torture.c */
4553 /*The following definitions come from web/cgi.c */
4555 void cgi_load_variables(FILE *f1);
4556 char *cgi_variable(char *name);
4557 BOOL am_root(void);
4558 char *cgi_user_name(void);
4559 void cgi_setup(char *rootdir, int auth_required);
4560 char *cgi_baseurl(void);
4561 char *cgi_pathinfo(void);
4562 char *cgi_remote_host(void);
4563 char *cgi_remote_addr(void);
4564 BOOL cgi_waspost(void);
4566 /*The following definitions come from web/diagnose.c */
4568 BOOL nmbd_running(void);
4569 BOOL smbd_running(void);
4571 /*The following definitions come from web/startstop.c */
4573 void start_smbd(void);
4574 void start_nmbd(void);
4575 void stop_smbd(void);
4576 void stop_nmbd(void);
4577 void kill_pid(pid_t pid);
4579 /*The following definitions come from web/statuspage.c */
4581 void status_page(void);
4583 /*The following definitions come from web/swat.c */
4585 #endif /* _PROTO_H_ */