f0c855c689a7957335c1a8589b71718c4ee320e6
[kai/samba.git] / source3 / include / proto.h
1 /* This file is automatically generated with "make proto". DO NOT EDIT */
2
3
4 /*The following definitions come from  access.c  */
5
6 BOOL check_access(int snum);
7 BOOL allow_access(char *deny_list,char *allow_list,char *cname,char *caddr);
8
9 /*The following definitions come from  asyncdns.c  */
10
11 int asyncdns_fd(void);
12 void start_async_dns(void);
13 void run_dns_queue(void);
14 BOOL queue_dns_query(struct packet_struct *p,struct nmb_name *question,
15                      struct name_record **n);
16 BOOL queue_dns_query(struct packet_struct *p,struct nmb_name *question,
17                      struct name_record **n);
18
19 /*The following definitions come from  charcnv.c  */
20
21 char *unix2dos_format(char *str,BOOL overwrite);
22 char *dos2unix_format(char *str, BOOL overwrite);
23 int interpret_character_set(char *str, int def);
24
25 /*The following definitions come from  charset.c  */
26
27 void charset_initialise();
28 void codepage_initialise(int client_codepage);
29 void add_char_string(char *s);
30
31 /*The following definitions come from  chgpasswd.c  */
32
33 BOOL chat_with_program(char *passwordprogram,char *name,char *chatsequence);
34 BOOL chgpasswd(char *name,char *oldpass,char *newpass);
35 BOOL chgpasswd(char *name,char *oldpass,char *newpass);
36
37 /*The following definitions come from  client.c  */
38
39 void cli_smb_close(char *inbuf, char *outbuf, int clnt_fd, int c_num, int f_num);
40 void do_dir(char *inbuf,char *outbuf,char *Mask,int attribute,void (*fn)(),BOOL recurse_dir);
41 void cmd_help(void);
42
43 /*The following definitions come from  clientgen.c  */
44
45 BOOL cli_NetWkstaUserLogon(struct cli_state *cli,char *user, char *workstation);
46 BOOL cli_NetServerEnum(struct cli_state *cli, char *workgroup, uint32 stype,
47                        void (*fn)(char *, uint32, char *));
48 BOOL cli_session_setup(struct cli_state *cli, 
49                        char *user, 
50                        char *pass, int passlen,
51                        char *ntpass, int ntpasslen,
52                        char *workgroup);
53 BOOL cli_send_tconX(struct cli_state *cli, 
54                     char *share, char *dev, char *pword, int passlen);
55 BOOL cli_tdis(struct cli_state *cli);
56 BOOL cli_negprot(struct cli_state *cli);
57 BOOL cli_session_request(struct cli_state *cli, char *host, int name_type,
58                          char *myname);
59 BOOL cli_connect(struct cli_state *cli, char *host, struct in_addr *ip);
60 BOOL cli_initialise(struct cli_state *cli);
61 void cli_shutdown(struct cli_state *cli);
62
63 /*The following definitions come from  clientutil.c  */
64
65 void cli_setup_pkt(char *outbuf);
66 BOOL cli_call_api(char *pipe_name, int prcnt,int drcnt, int srcnt,
67                      int mprcnt,int mdrcnt,
68                      int *rprcnt,int *rdrcnt,
69                      char *param,char *data, uint16 *setup,
70                      char **rparam,char **rdata);
71 BOOL cli_receive_trans_response(char *inbuf,int trans,
72                                    int *data_len,int *param_len,
73                                    char **data,char **param);
74 BOOL cli_send_trans_request(char *outbuf,int trans,
75                                char *name,int fid,int flags,
76                                char *data,char *param,uint16 *setup,
77                                int ldata,int lparam,int lsetup,
78                                int mdata,int mparam,int msetup);
79 BOOL cli_send_session_request(char *inbuf,char *outbuf);
80 BOOL cli_send_login(char *inbuf,char *outbuf,BOOL start_session,BOOL use_setup);
81 void cli_send_logout(void );
82 BOOL cli_open_sockets(int port );
83 BOOL cli_reopen_connection(char *inbuf,char *outbuf);
84 char *smb_errstr(char *inbuf);
85
86 /*The following definitions come from  clitar.c  */
87
88 int padit(char *buf, int bufsize, int padsize);
89 void cmd_block(void);
90 void cmd_tarmode(void);
91 void cmd_setmode(void);
92 void cmd_tar(char *inbuf, char *outbuf);
93 int process_tar(char *inbuf, char *outbuf);
94 int clipfind(char **aret, int ret, char *tok);
95 int tar_parseargs(int argc, char *argv[], char *Optarg, int Optind);
96
97 /*The following definitions come from  credentials.c  */
98
99 void cred_session_key(DOM_CHAL *clnt_chal, DOM_CHAL *srv_chal, char *pass, 
100                        uint32 session_key[2]);
101 void cred_create(uint32 session_key[2], DOM_CHAL *stor_cred, UTIME timestamp, 
102                  DOM_CHAL *cred);
103 int cred_assert(DOM_CHAL *cred, uint32 session_key[2], DOM_CHAL *stored_cred,
104                 UTIME timestamp);
105 BOOL clnt_deal_with_creds(uint32 sess_key[2],
106                 DOM_CRED *sto_clnt_cred, DOM_CRED *rcv_srv_cred);
107 BOOL deal_with_creds(uint32 sess_key[2],
108                 DOM_CRED *sto_clnt_cred, 
109                 DOM_CRED *rcv_clnt_cred, DOM_CRED *rtn_srv_cred);
110
111 /*The following definitions come from  dir.c  */
112
113 void init_dptrs(void);
114 char *dptr_path(int key);
115 char *dptr_wcard(int key);
116 BOOL dptr_set_wcard(int key, char *wcard);
117 BOOL dptr_set_attr(int key, uint16 attr);
118 uint16 dptr_attr(int key);
119 void dptr_close(int key);
120 void dptr_closecnum(int cnum);
121 void dptr_idlecnum(int cnum);
122 void dptr_closepath(char *path,int pid);
123 int dptr_create(int cnum,char *path, BOOL expect_close,int pid);
124 BOOL dptr_fill(char *buf1,unsigned int key);
125 BOOL dptr_zero(char *buf);
126 void *dptr_fetch(char *buf,int *num);
127 void *dptr_fetch_lanman2(char *params,int dptr_num);
128 BOOL dir_check_ftype(int cnum,int mode,struct stat *st,int dirtype);
129 BOOL get_dir_entry(int cnum,char *mask,int dirtype,char *fname,int *size,int *mode,time_t *date,BOOL check_descend);
130 void *OpenDir(int cnum, char *name, BOOL use_veto);
131 void CloseDir(void *p);
132 char *ReadDirName(void *p);
133 BOOL SeekDir(void *p,int pos);
134 int TellDir(void *p);
135 void DirCacheAdd( char *path, char *name, char *dname, int snum );
136 char *DirCacheCheck( char *path, char *name, int snum );
137 void DirCacheFlush( int snum );
138
139 /*The following definitions come from  fault.c  */
140
141 void fault_setup(void (*fn)());
142
143 /*The following definitions come from  getsmbpass.c  */
144
145 char *getsmbpass(char *prompt)    ;
146
147 /*The following definitions come from  interface.c  */
148
149 void load_interfaces(void);
150 void iface_set_default(char *ip,char *bcast,char *nmask);
151 BOOL ismyip(struct in_addr ip);
152 BOOL ismybcast(struct in_addr bcast);
153 BOOL is_local_net(struct in_addr from);
154 int iface_count(void);
155 struct in_addr *iface_n_ip(int n);
156 struct in_addr *iface_bcast(struct in_addr ip);
157 struct in_addr *iface_nmask(struct in_addr ip);
158 struct in_addr *iface_ip(struct in_addr ip);
159
160 /*The following definitions come from  ipc.c  */
161
162 int reply_trans(char *inbuf,char *outbuf);
163
164 /*The following definitions come from  kanji.c  */
165
166 char *sj_strtok(char *s1, char *s2);
167 char *sj_strstr(char *s1, char *s2);
168 char *sj_strchr (char *s, int c);
169 char *sj_strrchr(char *s, int c);
170 int interpret_coding_system(char *str, int def);
171
172 /*The following definitions come from  loadparm.c  */
173
174 char *lp_string(char *s);
175 char *lp_logfile(void);
176 char *lp_smbrun(void);
177 char *lp_configfile(void);
178 char *lp_smb_passwd_file(void);
179 char *lp_serverstring(void);
180 char *lp_printcapname(void);
181 char *lp_lockdir(void);
182 char *lp_rootdir(void);
183 char *lp_defaultservice(void);
184 char *lp_msg_command(void);
185 char *lp_dfree_command(void);
186 char *lp_hosts_equiv(void);
187 char *lp_auto_services(void);
188 char *lp_passwd_program(void);
189 char *lp_passwd_chat(void);
190 char *lp_passwordserver(void);
191 char *lp_workgroup(void);
192 char *lp_domain_controller(void);
193 char *lp_username_map(void);
194 char *lp_character_set(void);
195 char *lp_logon_script(void);
196 char *lp_logon_path(void);
197 char *lp_logon_drive(void);
198 char *lp_logon_home(void);
199 char *lp_remote_announce(void);
200 char *lp_wins_server(void);
201 char *lp_interfaces(void);
202 char *lp_socket_address(void);
203 char *lp_nis_home_map_name(void);
204 char *lp_announce_version(void);
205 char *lp_netbios_aliases(void);
206 char *lp_domain_sid(void);
207 char *lp_domain_other_sids(void);
208 char *lp_domain_groups(void);
209 char *lp_domain_admin_users(void);
210 char *lp_domain_guest_users(void);
211 BOOL lp_dns_proxy(void);
212 BOOL lp_wins_support(void);
213 BOOL lp_wins_proxy(void);
214 BOOL lp_local_master(void);
215 BOOL lp_domain_master(void);
216 BOOL lp_domain_logons(void);
217 BOOL lp_preferred_master(void);
218 BOOL lp_load_printers(void);
219 BOOL lp_use_rhosts(void);
220 BOOL lp_getwdcache(void);
221 BOOL lp_readprediction(void);
222 BOOL lp_readbmpx(void);
223 BOOL lp_readraw(void);
224 BOOL lp_writeraw(void);
225 BOOL lp_null_passwords(void);
226 BOOL lp_strip_dot(void);
227 BOOL lp_encrypted_passwords(void);
228 BOOL lp_syslog_only(void);
229 BOOL lp_browse_list(void);
230 BOOL lp_unix_realname(void);
231 BOOL lp_nis_home_map(void);
232 BOOL lp_time_server(void);
233 BOOL lp_bind_interfaces_only(void);
234 int lp_os_level(void);
235 int lp_max_ttl(void);
236 int lp_max_log_size(void);
237 int lp_mangledstack(void);
238 int lp_maxxmit(void);
239 int lp_maxmux(void);
240 int lp_maxpacket(void);
241 int lp_keepalive(void);
242 int lp_passwordlevel(void);
243 int lp_usernamelevel(void);
244 int lp_readsize(void);
245 int lp_shmem_size(void);
246 int lp_shmem_hash_size(void);
247 int lp_deadtime(void);
248 int lp_maxprotocol(void);
249 int lp_security(void);
250 int lp_printing(void);
251 int lp_maxdisksize(void);
252 int lp_lpqcachetime(void);
253 int lp_syslog(void);
254 int lp_client_code_page(void);
255 int lp_announce_as(void);
256 char *lp_preexec(int );
257 char *lp_postexec(int );
258 char *lp_rootpreexec(int );
259 char *lp_rootpostexec(int );
260 char *lp_servicename(int );
261 char *lp_pathname(int );
262 char *lp_dontdescend(int );
263 char *lp_username(int );
264 char *lp_guestaccount(int );
265 char *lp_invalid_users(int );
266 char *lp_valid_users(int );
267 char *lp_admin_users(int );
268 char *lp_printcommand(int );
269 char *lp_lpqcommand(int );
270 char *lp_lprmcommand(int );
271 char *lp_lppausecommand(int );
272 char *lp_lpresumecommand(int );
273 char *lp_printername(int );
274 char *lp_printerdriver(int );
275 char *lp_hostsallow(int );
276 char *lp_hostsdeny(int );
277 char *lp_magicscript(int );
278 char *lp_magicoutput(int );
279 char *lp_comment(int );
280 char *lp_force_user(int );
281 char *lp_force_group(int );
282 char *lp_readlist(int );
283 char *lp_writelist(int );
284 char *lp_volume(int );
285 char *lp_mangled_map(int );
286 char *lp_veto_files(int );
287 char *lp_hide_files(int );
288 BOOL lp_alternate_permissions(int );
289 BOOL lp_revalidate(int );
290 BOOL lp_casesensitive(int );
291 BOOL lp_preservecase(int );
292 BOOL lp_shortpreservecase(int );
293 BOOL lp_casemangle(int );
294 BOOL lp_status(int );
295 BOOL lp_hide_dot_files(int );
296 BOOL lp_browseable(int );
297 BOOL lp_readonly(int );
298 BOOL lp_no_set_dir(int );
299 BOOL lp_guest_ok(int );
300 BOOL lp_guest_only(int );
301 BOOL lp_print_ok(int );
302 BOOL lp_postscript(int );
303 BOOL lp_map_hidden(int );
304 BOOL lp_map_archive(int );
305 BOOL lp_locking(int );
306 BOOL lp_strict_locking(int );
307 BOOL lp_share_modes(int );
308 BOOL lp_oplocks(int );
309 BOOL lp_onlyuser(int );
310 BOOL lp_manglednames(int );
311 BOOL lp_widelinks(int );
312 BOOL lp_symlinks(int );
313 BOOL lp_syncalways(int );
314 BOOL lp_map_system(int );
315 BOOL lp_delete_readonly(int );
316 BOOL lp_fake_oplocks(int );
317 BOOL lp_recursive_veto_delete(int );
318 BOOL lp_dos_filetimes(int );
319 int lp_create_mode(int );
320 int lp_force_create_mode(int );
321 int lp_dir_mode(int );
322 int lp_force_dir_mode(int );
323 int lp_max_connections(int );
324 int lp_defaultcase(int );
325 int lp_minprintspace(int );
326 char lp_magicchar(int );
327 BOOL lp_add_home(char *pszHomename, int iDefaultService, char *pszHomedir);
328 int lp_add_service(char *pszService, int iDefaultService);
329 BOOL lp_add_printer(char *pszPrintername, int iDefaultService);
330 BOOL lp_file_list_changed(void);
331 BOOL lp_do_parameter(int snum, char *pszParmName, char *pszParmValue);
332 int lp_next_parameter(int snum, int *i, char *label, 
333                            char *value, int allparameters);
334 BOOL lp_snum_ok(int iService);
335 BOOL lp_loaded(void);
336 void lp_killunused(BOOL (*snumused)(int ));
337 BOOL lp_load(char *pszFname,BOOL global_only);
338 int lp_numservices(void);
339 void lp_dump(FILE *f);
340 int lp_servicenumber(char *pszServiceName);
341 char *volume_label(int snum);
342 void lp_rename_service(int snum, char *new_name);
343 void lp_remove_service(int snum);
344 void lp_copy_service(int snum, char *new_name);
345 int lp_default_server_announce(void);
346 int lp_major_announce_version(void);
347 int lp_minor_announce_version(void);
348
349 /*The following definitions come from  locking.c  */
350
351 BOOL is_locked(int fnum,int cnum,uint32 count,uint32 offset);
352 BOOL do_lock(int fnum,int cnum,uint32 count,uint32 offset,int *eclass,uint32 *ecode);
353 BOOL do_unlock(int fnum,int cnum,uint32 count,uint32 offset,int *eclass,uint32 *ecode);
354 BOOL locking_init(void);
355 BOOL locking_end(void);
356 BOOL lock_share_entry(int cnum, uint32 dev, uint32 inode, int *ptok);
357 BOOL unlock_share_entry(int cnum, uint32 dev, uint32 inode, int token);
358 int get_share_modes(int cnum, int token, uint32 dev, uint32 inode, 
359                     share_mode_entry **shares);
360 void del_share_mode(int token, int fnum);
361 BOOL set_share_mode(int token, int fnum, uint16 port, uint16 op_type);
362 BOOL remove_share_oplock(int fnum, int token);
363 int share_mode_forall(void (*fn)(share_mode_entry *, char *));
364 void share_status(FILE *f);
365
366 /*The following definitions come from  locking_shm.c  */
367
368 struct share_ops *locking_shm_init(void);
369
370 /*The following definitions come from  locking_slow.c  */
371
372 struct share_ops *locking_slow_init(void);
373
374 /*The following definitions come from  lsaparse.c  */
375
376 char* lsa_io_r_open_pol(BOOL io, LSA_R_OPEN_POL *r_p, char *q, char *base, int align, int depth);
377 char* lsa_io_q_query(BOOL io, LSA_Q_QUERY_INFO *q_q, char *q, char *base, int align, int depth);
378 char* lsa_io_r_query(BOOL io, LSA_R_QUERY_INFO *r_q, char *q, char *base, int align, int depth);
379 char* lsa_io_q_lookup_sids(BOOL io, LSA_Q_LOOKUP_SIDS *q_s, char *q, char *base, int align, int depth);
380 char* lsa_io_r_lookup_sids(BOOL io, LSA_R_LOOKUP_SIDS *r_s, char *q, char *base, int align, int depth);
381 char* lsa_io_q_lookup_rids(BOOL io, LSA_Q_LOOKUP_RIDS *q_r, char *q, char *base, int align, int depth);
382 char* lsa_io_r_lookup_rids(BOOL io, LSA_R_LOOKUP_RIDS *r_r, char *q, char *base, int align, int depth);
383 void make_q_req_chal(LSA_Q_REQ_CHAL *q_c,
384                                 char *logon_srv, char *logon_clnt,
385                                 DOM_CHAL *clnt_chal);
386 char* lsa_io_q_req_chal(BOOL io, LSA_Q_REQ_CHAL *q_c, char *q, char *base, int align, int depth);
387 char* lsa_io_r_req_chal(BOOL io, LSA_R_REQ_CHAL *r_c, char *q, char *base, int align, int depth);
388 void make_q_auth_2(LSA_Q_AUTH_2 *q_a,
389                 char *logon_srv, char *acct_name, uint16 sec_chan, char *comp_name,
390                 DOM_CHAL *clnt_chal, uint32 clnt_flgs);
391 char* lsa_io_q_auth_2(BOOL io, LSA_Q_AUTH_2 *q_a, char *q, char *base, int align, int depth);
392 char* lsa_io_r_auth_2(BOOL io, LSA_R_AUTH_2 *r_a, char *q, char *base, int align, int depth);
393 char* lsa_io_q_srv_pwset(BOOL io, LSA_Q_SRV_PWSET *q_s, char *q, char *base, int align, int depth);
394 char* lsa_io_r_srv_pwset(BOOL io, LSA_R_SRV_PWSET *r_s, char *q, char *base, int align, int depth);
395 char* lsa_io_user_info(BOOL io, LSA_USER_INFO *usr, char *q, char *base, int align, int depth);
396 char* lsa_io_q_sam_logon(BOOL io, LSA_Q_SAM_LOGON *q_l, char *q, char *base, int align, int depth);
397 char* lsa_io_r_sam_logon(BOOL io, LSA_R_SAM_LOGON *r_l, char *q, char *base, int align, int depth);
398 char* lsa_io_q_sam_logoff(BOOL io, LSA_Q_SAM_LOGOFF *q_l, char *q, char *base, int align, int depth);
399 char* lsa_io_r_sam_logoff(BOOL io, LSA_R_SAM_LOGOFF *r_l, char *q, char *base, int align, int depth);
400
401 /*The following definitions come from  mangle.c  */
402
403 int str_checksum(char *s);
404 BOOL is_8_3(char *fname, BOOL check_case);
405 void create_mangled_stack(int size);
406 BOOL check_mangled_stack(char *s);
407 BOOL is_mangled(char *s);
408 void mangle_name_83(char *s);
409 BOOL name_map_mangle(char *OutName,BOOL need83,int snum);
410
411 /*The following definitions come from  md4.c  */
412
413 void mdfour(unsigned char *out, unsigned char *in, int n);
414
415 /*The following definitions come from  message.c  */
416
417 int reply_sends(char *inbuf,char *outbuf);
418 int reply_sendstrt(char *inbuf,char *outbuf);
419 int reply_sendtxt(char *inbuf,char *outbuf);
420 int reply_sendend(char *inbuf,char *outbuf);
421
422 /*The following definitions come from  nameannounce.c  */
423
424 void announce_request(struct work_record *work, struct in_addr ip);
425 void do_announce_request(char *info, char *to_name, int announce_type, 
426                          int from,
427                          int to, struct in_addr dest_ip);
428 void sync_server(enum state_type state, char *serv_name, char *work_name, 
429                  int name_type,
430                  struct subnet_record *d,
431                  struct in_addr ip);
432 void announce_my_servers_removed(void);
433 void announce_server(struct subnet_record *d, struct work_record *work,
434                      char *name, char *comment, time_t ttl, int server_type);
435 void announce_host(time_t t);
436 void reset_announce_timer();
437 void announce_master(time_t t);
438 void announce_remote(time_t t);
439
440 /*The following definitions come from  namebrowse.c  */
441
442 void expire_browse_cache(time_t t);
443 struct browse_cache_record *add_browser_entry(char *name, int type, char *wg,
444                                               time_t ttl, struct subnet_record *d,
445                                               struct in_addr ip, BOOL local);
446 void do_browser_lists(time_t t);
447
448 /*The following definitions come from  namedbname.c  */
449
450 void set_samba_nb_type(void);
451 BOOL name_equal(struct nmb_name *n1,struct nmb_name *n2);
452 BOOL ms_browser_name(char *name, int type);
453 void remove_name(struct subnet_record *d, struct name_record *n);
454 struct name_record *find_name_on_subnet(struct subnet_record *d,
455                         struct nmb_name *name, BOOL self_only);
456 void dump_names(void);
457 void load_netbios_names(void);
458 void remove_netbios_name(struct subnet_record *d,
459                         char *name,int type, enum name_source source);
460 struct name_record *add_netbios_entry(struct subnet_record *d,
461                 char *name, int type, int nb_flags, int ttl, 
462                 enum name_source source, struct in_addr ip, BOOL new_only);
463 void expire_names(time_t t);
464
465 /*The following definitions come from  namedbresp.c  */
466
467 void add_response_record(struct subnet_record *d,
468                                 struct response_record *n);
469 void remove_response_record(struct subnet_record *d,
470                                 struct response_record *n);
471 struct response_record *make_response_queue_record(enum state_type state,
472                                 int id,uint16 fd,
473                                 int quest_type, char *name,int type, int nb_flags, time_t ttl,
474                                 int server_type, char *my_name, char *my_comment,
475                                 BOOL bcast,BOOL recurse,
476                                 struct in_addr send_ip, struct in_addr reply_to_ip,
477                                 int reply_id);
478 struct response_record *find_response_record(struct subnet_record **d,
479                                 uint16 id);
480
481 /*The following definitions come from  namedbserver.c  */
482
483 void remove_old_servers(struct work_record *work, time_t t,
484                                         BOOL remove_all);
485 struct server_record *find_server(struct work_record *work, char *name);
486 struct server_record *add_server_entry(struct subnet_record *d, 
487                                        struct work_record *work,
488                                        char *name,int servertype, 
489                                        int ttl,char *comment,
490                                        BOOL replace);
491 void expire_servers(time_t t);
492
493 /*The following definitions come from  namedbsubnet.c  */
494
495 struct subnet_record *find_subnet(struct in_addr ip);
496 struct subnet_record *find_subnet_all(struct in_addr ip);
497 void add_workgroup_to_subnet( struct subnet_record *d, char *group);
498 void add_my_subnets(char *group);
499 void write_browse_list(time_t t);
500
501 /*The following definitions come from  namedbwork.c  */
502
503 struct work_record *remove_workgroup(struct subnet_record *d, 
504                                      struct work_record *work,
505                                          BOOL remove_all_servers);
506 struct work_record *find_workgroupstruct(struct subnet_record *d, 
507                                          fstring name, BOOL add);
508 void dump_workgroups(void);
509
510 /*The following definitions come from  nameelect.c  */
511
512 void check_master_browser(time_t t);
513 void browser_gone(char *work_name, struct in_addr ip);
514 void send_election(struct subnet_record *d, char *group,uint32 criterion,
515                    int timeup,char *name);
516 void name_unregister_work(struct subnet_record *d, char *name, int name_type);
517 void name_register_work(struct subnet_record *d, char *name, int name_type,
518                                 int nb_flags, time_t ttl, struct in_addr ip, BOOL bcast);
519 void become_local_master(struct subnet_record *d, struct work_record *work);
520 void become_domain_master(struct subnet_record *d, struct work_record *work);
521 void become_logon_server(struct subnet_record *d, struct work_record *work);
522 void unbecome_local_master(struct subnet_record *d, struct work_record *work,
523                                 int remove_type);
524 void unbecome_domain_master(struct subnet_record *d, struct work_record *work,
525                                 int remove_type);
526 void unbecome_logon_server(struct subnet_record *d, struct work_record *work,
527                                 int remove_type);
528 void run_elections(time_t t);
529 void process_election(struct packet_struct *p,char *buf);
530 BOOL check_elections(void);
531
532 /*The following definitions come from  namelogon.c  */
533
534 void process_logon_packet(struct packet_struct *p,char *buf,int len);
535
536 /*The following definitions come from  namepacket.c  */
537
538 void debug_browse_data(char *outbuf, int len);
539 void initiate_netbios_packet(uint16 *id,
540                              int fd,int quest_type,char *name,int name_type,
541                              int nb_flags,BOOL bcast,BOOL recurse,
542                              struct in_addr to_ip);
543 void reply_netbios_packet(struct packet_struct *p1,int trn_id,
544                                 int rcode, int rcv_code, int opcode,
545                 BOOL recursion_available,
546                 BOOL recursion_desired,
547                                 struct nmb_name *rr_name,int rr_type,int rr_class,int ttl,
548                                 char *data,int len);
549 void queue_packet(struct packet_struct *packet);
550 void run_packet_queue();
551 BOOL listen_for_packets(BOOL run_election);
552 BOOL send_mailslot_reply(BOOL unique, char *mailslot,int fd,char *buf,int len,char *srcname,
553                          char *dstname,int src_type,int dest_type,
554                          struct in_addr dest_ip,struct in_addr src_ip);
555
556 /*The following definitions come from  namequery.c  */
557
558 BOOL name_status(int fd,char *name,int name_type,BOOL recurse,
559                  struct in_addr to_ip,char *master,char *rname,
560                  void (*fn)());
561 BOOL name_query(int fd,char *name,int name_type, 
562                 BOOL bcast,BOOL recurse,
563                 struct in_addr to_ip, struct in_addr *ip,void (*fn)());
564
565 /*The following definitions come from  nameresp.c  */
566
567 void expire_netbios_response_entries(time_t t);
568 struct response_record *queue_netbios_pkt_wins(
569                                 int fd,int quest_type,enum state_type state,
570                             char *name,int name_type,int nb_flags, time_t ttl,
571                                 int server_type, char *my_name, char *my_comment,
572                                 struct in_addr send_ip, struct in_addr reply_to_ip);
573 struct response_record *queue_netbios_packet(struct subnet_record *d,
574                         int fd,int quest_type,enum state_type state,char *name,
575                         int name_type,int nb_flags, time_t ttl,
576                         int server_type, char *my_name, char *my_comment,
577                         BOOL bcast,BOOL recurse,
578                         struct in_addr send_ip, struct in_addr reply_to_ip,
579                         int reply_id);
580
581 /*The following definitions come from  nameserv.c  */
582
583 void remove_name_entry(struct subnet_record *d, char *name,int type);
584 void add_my_name_entry(struct subnet_record *d,char *name,int type,int nb_flags);
585 void add_domain_logon_names(void);
586 void add_domain_master_bcast(void);
587 void add_domain_master_wins(void);
588 void add_domain_names(time_t t);
589 void add_my_names(void);
590 void remove_my_names();
591 void refresh_my_names(time_t t);
592 void query_refresh_names(time_t t);
593
594 /*The following definitions come from  nameservreply.c  */
595
596 void add_name_respond(struct subnet_record *d, int fd, struct in_addr from_ip,
597                                 uint16 response_id,
598                                 struct nmb_name *name,
599                                 int nb_flags, int ttl, struct in_addr register_ip,
600                                 BOOL new_owner, struct in_addr reply_to_ip);
601 void reply_name_release(struct packet_struct *p);
602 void reply_name_reg(struct packet_struct *p);
603 void reply_name_status(struct packet_struct *p);
604 void reply_name_query(struct packet_struct *p);
605
606 /*The following definitions come from  nameservresp.c  */
607
608 void debug_state_type(int state);
609 void response_netbios_packet(struct packet_struct *p);
610
611 /*The following definitions come from  namework.c  */
612
613 void reset_server(char *name, int state, struct in_addr ip);
614 void tell_become_backup(void);
615 BOOL same_context(struct dgram_packet *dgram);
616 void process_browse_packet(struct packet_struct *p,char *buf,int len);
617
618 /*The following definitions come from  nmbd.c  */
619
620 BOOL reload_services(BOOL test);
621
622 /*The following definitions come from  nmblib.c  */
623
624 char *lookup_opcode_name( int opcode );
625 void debug_nmb_packet(struct packet_struct *p);
626 char *namestr(struct nmb_name *n);
627 void free_nmb_packet(struct nmb_packet *nmb);
628 void free_packet(struct packet_struct *packet);
629 struct packet_struct *read_packet(int fd,enum packet_type packet_type);
630 void make_nmb_name(struct nmb_name *n,char *name,int type,char *this_scope);
631 BOOL send_packet(struct packet_struct *p);
632 struct packet_struct *receive_packet(int fd,enum packet_type type,int t);
633
634 /*The following definitions come from  nmblookup.c  */
635
636 int main(int argc,char *argv[]);
637
638 /*The following definitions come from  nmbsync.c  */
639
640 void sync_browse_lists(struct subnet_record *d, struct work_record *work,
641                        char *name, int nm_type, struct in_addr ip, BOOL local);
642
643 /*The following definitions come from  ntclient.c  */
644
645 BOOL do_nt_login(char *desthost, char *myhostname,
646                                 int Client, int cnum);
647
648 /*The following definitions come from  params.c  */
649
650 BOOL pm_process( char *FileName,
651                  BOOL (*sfunc)(char *),
652                  BOOL (*pfunc)(char *, char *) );
653
654 /*The following definitions come from  password.c  */
655
656 void generate_next_challenge(char *challenge);
657 BOOL set_challenge(char *challenge);
658 BOOL last_challenge(char *challenge);
659 user_struct *get_valid_user_struct(uint16 vuid);
660 void invalidate_vuid(uint16 vuid);
661 char *validated_username(uint16 vuid);
662 uint16 register_vuid(int uid,int gid, char *name,BOOL guest);
663 void add_session_user(char *user);
664 void dfs_unlogin(void);
665 BOOL password_check(char *password);
666 BOOL smb_password_check(char *password, unsigned char *part_passwd, unsigned char *c8);
667 BOOL password_ok(char *user,char *password, int pwlen, struct passwd *pwd);
668 BOOL user_ok(char *user,int snum);
669 BOOL authorise_login(int snum,char *user,char *password, int pwlen, 
670                      BOOL *guest,BOOL *force,uint16 vuid);
671 BOOL check_hosts_equiv(char *user);
672 struct cli_state *server_client(void);
673 struct cli_state *server_cryptkey(void);
674 BOOL server_validate(char *user, char *domain, 
675                      char *pass, int passlen,
676                      char *ntpass, int ntpasslen);
677
678 /*The following definitions come from  pcap.c  */
679
680 BOOL pcap_printername_ok(char *pszPrintername, char *pszPrintcapname);
681 void pcap_printer_fn(void (*fn)());
682
683 /*The following definitions come from  pipenetlog.c  */
684
685 BOOL get_md4pw(char *md4pw, char *mach_acct);
686 BOOL api_netlogrpcTNP(int cnum,int uid, char *param,char *data,
687                      int mdrcnt,int mprcnt,
688                      char **rdata,char **rparam,
689                      int *rdata_len,int *rparam_len);
690
691 /*The following definitions come from  pipentlsa.c  */
692
693 BOOL api_ntLsarpcTNP(int cnum,int uid, char *param,char *data,
694                      int mdrcnt,int mprcnt,
695                      char **rdata,char **rparam,
696                      int *rdata_len,int *rparam_len);
697
698 /*The following definitions come from  pipes.c  */
699
700 int reply_open_pipe_and_X(char *inbuf,char *outbuf,int length,int bufsize);
701 BOOL api_LsarpcSNPHS(int cnum,int uid, char *param,char *data,
702                      int mdrcnt,int mprcnt,
703                      char **rdata,char **rparam,
704                      int *rdata_len,int *rparam_len);
705 void LsarpcTNP1(char *data,char **rdata, int *rdata_len);
706 BOOL api_LsarpcTNP(int cnum,int uid, char *param,char *data,
707                      int mdrcnt,int mprcnt,
708                      char **rdata,char **rparam,
709                      int *rdata_len,int *rparam_len);
710
711 /*The following definitions come from  pipesrvsvc.c  */
712
713 BOOL api_srvsvcTNP(int cnum,int uid, char *param,char *data,
714                      int mdrcnt,int mprcnt,
715                      char **rdata,char **rparam,
716                      int *rdata_len,int *rparam_len);
717
718 /*The following definitions come from  pipeutil.c  */
719
720 void initrpcreply(char *inbuf, char *q);
721 void endrpcreply(char *inbuf, char *q, int datalen, int rtnval, int *rlen);
722 BOOL name_to_rid(char *user_name, uint32 *u_rid, uint32 *g_rid);
723 char *dom_sid_to_string(DOM_SID *sid);
724 int make_dom_sids(char *sids_str, DOM_SID *sids, int max_sids);
725 int make_dom_gids(char *gids_str, DOM_GID *gids);
726 int create_rpc_request(uint32 call_id, uint8 op_num, char *q, int data_len);
727 int create_rpc_reply(uint32 call_id, char *q, int data_len);
728
729 /*The following definitions come from  predict.c  */
730
731 int read_predict(int fd,int offset,char *buf,char **ptr,int num);
732 void do_read_prediction();
733 void invalidate_read_prediction(int fd);
734
735 /*The following definitions come from  printing.c  */
736
737 void lpq_reset(int snum);
738 void print_file(int fnum);
739 int get_printqueue(int snum,int cnum,print_queue_struct **queue,
740                    print_status_struct *status);
741 void del_printqueue(int cnum,int snum,int jobid);
742 void status_printjob(int cnum,int snum,int jobid,int status);
743 int printjob_encode(int snum, int job);
744 void printjob_decode(int jobid, int *snum, int *job);
745
746 /*The following definitions come from  quotas.c  */
747
748 BOOL disk_quotas(char *path, int *bsize, int *dfree, int *dsize);
749 BOOL disk_quotas(char *path, int *bsize, int *dfree, int *dsize);
750 BOOL disk_quotas(char *path, int *bsize, int *dfree, int *dsize);
751 BOOL disk_quotas(char *path, int *bsize, int *dfree, int *dsize);
752 BOOL disk_quotas(char *path, int *bsize, int *dfree, int *dsize);
753 BOOL disk_quotas(char *path, int *bsize, int *dfree, int *dsize);
754
755 /*The following definitions come from  replace.c  */
756
757 char *Strstr(char *s, char *p);
758 time_t Mktime(struct tm      *t);
759 int InNetGr(char *group,char *host,char *user,char *dom);
760 void *malloc_wrapped(int size,char *file,int line);
761 void *realloc_wrapped(void *ptr,int size,char *file,int line);
762 void free_wrapped(void *ptr,char *file,int line);
763 void *memcpy_wrapped(void *d,void *s,int l,char *fname,int line);
764
765 /*The following definitions come from  reply.c  */
766
767 int reply_special(char *inbuf,char *outbuf);
768 int reply_tcon(char *inbuf,char *outbuf);
769 int reply_tcon_and_X(char *inbuf,char *outbuf,int length,int bufsize);
770 int reply_unknown(char *inbuf,char *outbuf);
771 int reply_ioctl(char *inbuf,char *outbuf);
772 int reply_sesssetup_and_X(char *inbuf,char *outbuf,int length,int bufsize);
773 int reply_chkpth(char *inbuf,char *outbuf);
774 int reply_getatr(char *inbuf,char *outbuf);
775 int reply_setatr(char *inbuf,char *outbuf);
776 int reply_dskattr(char *inbuf,char *outbuf);
777 int reply_search(char *inbuf,char *outbuf);
778 int reply_fclose(char *inbuf,char *outbuf);
779 int reply_open(char *inbuf,char *outbuf);
780 int reply_open_and_X(char *inbuf,char *outbuf,int length,int bufsize);
781 int reply_ulogoffX(char *inbuf,char *outbuf,int length,int bufsize);
782 int reply_mknew(char *inbuf,char *outbuf);
783 int reply_ctemp(char *inbuf,char *outbuf);
784 int reply_unlink(char *inbuf,char *outbuf);
785 int reply_readbraw(char *inbuf, char *outbuf);
786 int reply_lockread(char *inbuf,char *outbuf);
787 int reply_read(char *inbuf,char *outbuf);
788 int reply_read_and_X(char *inbuf,char *outbuf,int length,int bufsize);
789 int reply_writebraw(char *inbuf,char *outbuf);
790 int reply_writeunlock(char *inbuf,char *outbuf);
791 int reply_write(char *inbuf,char *outbuf,int dum1,int dum2);
792 int reply_write_and_X(char *inbuf,char *outbuf,int length,int bufsize);
793 int reply_lseek(char *inbuf,char *outbuf);
794 int reply_flush(char *inbuf,char *outbuf);
795 int reply_exit(char *inbuf,char *outbuf);
796 int reply_close(char *inbuf,char *outbuf);
797 int reply_writeclose(char *inbuf,char *outbuf);
798 int reply_lock(char *inbuf,char *outbuf);
799 int reply_unlock(char *inbuf,char *outbuf);
800 int reply_tdis(char *inbuf,char *outbuf);
801 int reply_echo(char *inbuf,char *outbuf);
802 int reply_printopen(char *inbuf,char *outbuf);
803 int reply_printclose(char *inbuf,char *outbuf);
804 int reply_printqueue(char *inbuf,char *outbuf);
805 int reply_printwrite(char *inbuf,char *outbuf);
806 int reply_mkdir(char *inbuf,char *outbuf);
807 int reply_rmdir(char *inbuf,char *outbuf);
808 int reply_mv(char *inbuf,char *outbuf);
809 int reply_copy(char *inbuf,char *outbuf);
810 int reply_setdir(char *inbuf,char *outbuf);
811 int reply_lockingX(char *inbuf,char *outbuf,int length,int bufsize);
812 int reply_readbmpx(char *inbuf,char *outbuf,int length,int bufsize);
813 int reply_writebmpx(char *inbuf,char *outbuf);
814 int reply_writebs(char *inbuf,char *outbuf);
815 int reply_setattrE(char *inbuf,char *outbuf);
816 int reply_getattrE(char *inbuf,char *outbuf);
817
818 /*The following definitions come from  server.c  */
819
820 void  *dflt_sig(void);
821 void  killkids(void);
822 mode_t unix_mode(int cnum,int dosmode);
823 int dos_mode(int cnum,char *path,struct stat *sbuf);
824 int dos_chmod(int cnum,char *fname,int dosmode,struct stat *st);
825 int file_utime(int cnum, char *fname, struct utimbuf *times);
826 BOOL set_filetime(int cnum, char *fname, time_t mtime);
827 BOOL unix_convert(char *name,int cnum,pstring saved_last_component, BOOL *bad_path);
828 int disk_free(char *path,int *bsize,int *dfree,int *dsize);
829 int sys_disk_free(char *path,int *bsize,int *dfree,int *dsize);
830 BOOL check_name(char *name,int cnum);
831 void sync_file(int fnum);
832 void close_file(int fnum, BOOL normal_close);
833 BOOL check_file_sharing(int cnum,char *fname);
834 int check_share_mode( share_mode_entry *share, int deny_mode, char *fname,
835                       BOOL fcbopen, int *flags);
836 void open_file_shared(int fnum,int cnum,char *fname,int share_mode,int ofun,
837                       int mode,int oplock_request, int *Access,int *action);
838 int seek_file(int fnum,uint32 pos);
839 int read_file(int fnum,char *data,uint32 pos,int n);
840 int write_file(int fnum,char *data,int n);
841 BOOL become_service(int cnum,BOOL do_chdir);
842 int find_service(char *service);
843 int cached_error_packet(char *inbuf,char *outbuf,int fnum,int line);
844 int unix_error_packet(char *inbuf,char *outbuf,int def_class,uint32 def_code,int line);
845 int error_packet(char *inbuf,char *outbuf,int error_class,uint32 error_code,int line);
846 BOOL oplock_break(uint32 dev, uint32 inode, struct timeval *tval);
847 BOOL request_oplock_break(share_mode_entry *share_entry, 
848                           uint32 dev, uint32 inode);
849 BOOL snum_used(int snum);
850 BOOL reload_services(BOOL test);
851 int setup_groups(char *user, int uid, int gid, int *p_ngroups, 
852                  int **p_igroups, gid_t **p_groups,
853          int **p_attrs);
854 int make_connection(char *service,char *user,char *password, int pwlen, char *dev,uint16 vuid);
855 int find_free_file(void );
856 int reply_corep(char *outbuf);
857 int reply_coreplus(char *outbuf);
858 int reply_lanman1(char *outbuf);
859 int reply_lanman2(char *outbuf);
860 int reply_nt1(char *outbuf);
861 void close_cnum(int cnum, uint16 vuid);
862 BOOL yield_connection(int cnum,char *name,int max_connections);
863 BOOL claim_connection(int cnum,char *name,int max_connections,BOOL Clear);
864 void exit_server(char *reason);
865 void standard_sub(int cnum,char *str);
866 char *smb_fn_name(int type);
867 int chain_reply(char *inbuf,char *outbuf,int size,int bufsize);
868 int construct_reply(char *inbuf,char *outbuf,int size,int bufsize);
869
870 /*The following definitions come from  shmem.c  */
871
872 BOOL smb_shm_open(char *file_name, int size);
873 BOOL smb_shm_close( void );
874 int smb_shm_alloc(int size);
875 BOOL smb_shm_free(int offset);
876 int smb_shm_get_userdef_off(void);
877 void *smb_shm_offset2addr(int offset);
878 int smb_shm_addr2offset(void *addr);
879 BOOL smb_shm_lock_hash_entry( unsigned int entry);
880 BOOL smb_shm_unlock_hash_entry( unsigned int entry );
881 BOOL smb_shm_get_usage(int *bytes_free,
882                    int *bytes_used,
883                    int *bytes_overhead);
884
885 /*The following definitions come from  smbdes.c  */
886
887 void E_P16(unsigned char *p14,unsigned char *p16);
888 void E_P24(unsigned char *p21, unsigned char *c8, unsigned char *p24);
889 void cred_hash1(unsigned char *out,unsigned char *in,unsigned char *key);
890 void cred_hash2(unsigned char *out,unsigned char *in,unsigned char *key);
891
892 /*The following definitions come from  smbencrypt.c  */
893
894 void SMBencrypt(uchar *passwd, uchar *c8, uchar *p24);
895 void E_md4hash(uchar *passwd, uchar *p16);
896 void SMBNTencrypt(uchar *passwd, uchar *c8, uchar *p24);
897 void nt_lm_owf_gen(char *pwd, char *nt_p16, char *p16);
898
899 /*The following definitions come from  smbparse.c  */
900
901 char* smb_io_utime(BOOL io, UTIME *t, char *q, char *base, int align, int depth);
902 char* smb_io_time(BOOL io, NTTIME *nttime, char *q, char *base, int align, int depth);
903 void make_dom_sid(DOM_SID *sid, char *domsid);
904 char* smb_io_dom_sid(BOOL io, DOM_SID *sid, char *q, char *base, int align, int depth);
905 void make_uni_hdr(UNIHDR *hdr, int max_len, int len, uint16 terminate);
906 char* smb_io_unihdr(BOOL io, UNIHDR *hdr, char *q, char *base, int align, int depth);
907 void make_uni_hdr2(UNIHDR2 *hdr, int max_len, int len, uint16 terminate);
908 char* smb_io_unihdr2(BOOL io, UNIHDR2 *hdr2, char *q, char *base, int align, int depth);
909 void make_unistr(UNISTR *str, char *buf);
910 char* smb_io_unistr(BOOL io, UNISTR *uni, char *q, char *base, int align, int depth);
911 void make_unistr2(UNISTR2 *str, char *buf, int len);
912 char* smb_io_unistr2(BOOL io, UNISTR2 *uni2, char *q, char *base, int align, int depth);
913 void make_dom_sid2(DOM_SID2 *sid2, char *sid_str);
914 char* smb_io_dom_sid2(BOOL io, DOM_SID2 *sid2, char *q, char *base, int align, int depth);
915 void make_dom_rid2(DOM_RID2 *rid2, uint32 rid);
916 char* smb_io_dom_rid2(BOOL io, DOM_RID2 *rid2, char *q, char *base, int align, int depth);
917 void make_clnt_srv(DOM_CLNT_SRV *log, char *logon_srv, char *comp_name);
918 char* smb_io_clnt_srv(BOOL io, DOM_CLNT_SRV *log, char *q, char *base, int align, int depth);
919 void make_log_info(DOM_LOG_INFO *log, char *logon_srv, char *acct_name,
920                 uint16 sec_chan, char *comp_name);
921 char* smb_io_log_info(BOOL io, DOM_LOG_INFO *log, char *q, char *base, int align, int depth);
922 char* smb_io_chal(BOOL io, DOM_CHAL *chal, char *q, char *base, int align, int depth);
923 char* smb_io_cred(BOOL io, DOM_CRED *cred, char *q, char *base, int align, int depth);
924 void make_clnt_info2(DOM_CLNT_INFO2 *clnt,
925                                 char *logon_srv, char *comp_name,
926                                 DOM_CRED *clnt_cred);
927 char* smb_io_clnt_info2(BOOL io, DOM_CLNT_INFO2 *clnt, char *q, char *base, int align, int depth);
928 char* smb_io_clnt_info(BOOL io, DOM_CLNT_INFO *clnt, char *q, char *base, int align, int depth);
929 void make_logon_id(DOM_LOGON_ID *log, uint32 log_id_low, uint32 log_id_high);
930 char* smb_io_logon_id(BOOL io, DOM_LOGON_ID *log, char *q, char *base, int align, int depth);
931 void make_arc4_owf(ARC4_OWF *hash, char data[16]);
932 char* smb_io_arc4_owf(BOOL io, ARC4_OWF *hash, char *q, char *base, int align, int depth);
933 void make_id_info1(DOM_ID_INFO_1 *id, char *domain_name,
934                                 uint32 param_ctrl, uint32 log_id_low, uint32 log_id_high,
935                                 char *user_name, char *wksta_name,
936                                 char arc4_lm_owf[16], char arc4_nt_owf[16]);
937 char* smb_io_id_info1(BOOL io, DOM_ID_INFO_1 *id, char *q, char *base, int align, int depth);
938 void make_sam_info(DOM_SAM_INFO *sam,
939                                 char *logon_srv, char *comp_name, DOM_CRED *clnt_cred,
940                                 DOM_CRED *rtn_cred, uint16 logon_level, uint16 switch_value,
941                                 DOM_ID_INFO_1 *id1);
942 char* smb_io_sam_info(BOOL io, DOM_SAM_INFO *sam, char *q, char *base, int align, int depth);
943 char* smb_io_gid(BOOL io, DOM_GID *gid, char *q, char *base, int align, int depth);
944 void make_rpc_header(RPC_HDR *hdr, enum RPC_PKT_TYPE pkt_type,
945                                 uint32 call_id, int data_len, uint8 opnum);
946 char* smb_io_rpc_hdr(BOOL io, RPC_HDR *rpc, char *q, char *base, int align, int depth);
947 char* smb_io_pol_hnd(BOOL io, LSA_POL_HND *pol, char *q, char *base, int align, int depth);
948 char* smb_io_dom_query_3(BOOL io, DOM_QUERY_3 *d_q, char *q, char *base, int align, int depth);
949 char* smb_io_dom_query_5(BOOL io, DOM_QUERY_3 *d_q, char *q, char *base, int align, int depth);
950 char* smb_io_dom_query(BOOL io, DOM_QUERY *d_q, char *q, char *base, int align, int depth);
951 char* smb_io_dom_r_ref(BOOL io, DOM_R_REF *r_r, char *q, char *base, int align, int depth);
952 char* smb_io_dom_name(BOOL io, DOM_NAME *name, char *q, char *base, int align, int depth);
953 char* smb_io_neg_flags(BOOL io, NEG_FLAGS *neg, char *q, char *base, int align, int depth);
954
955 /*The following definitions come from  smbpass.c  */
956
957 int pw_file_lock(char *name, int type, int secs);
958 int pw_file_unlock(int fd);
959 struct smb_passwd *get_smbpwnam(char *name);
960
961 /*The following definitions come from  smbpasswd.c  */
962
963
964 /*The following definitions come from  smbrun.c  */
965
966
967 /*The following definitions come from  srvparse.c  */
968
969 char* srv_io_share_info1_str(BOOL io, SH_INFO_1_STR *sh1, char *q, char *base, int align, int depth);
970 char* srv_io_share_info1(BOOL io, SH_INFO_1 *sh1, char *q, char *base, int align, int depth);
971 char* srv_io_share_1_ctr(BOOL io, SHARE_INFO_1_CTR *ctr, char *q, char *base, int align, int depth);
972 char* srv_io_q_net_share_enum(BOOL io, SRV_Q_NET_SHARE_ENUM *q_n, char *q, char *base, int align, int depth);
973 char* srv_io_r_net_share_enum(BOOL io, SRV_R_NET_SHARE_ENUM *r_n, char *q, char *base, int align, int depth);
974
975 /*The following definitions come from  status.c  */
976
977 void Ucrit_addUsername(pstring username);
978 unsigned int Ucrit_checkUsername(pstring username);
979 void Ucrit_addPid(int pid);
980 unsigned int   Ucrit_checkPid(int pid);
981
982 /*The following definitions come from  system.c  */
983
984 int sys_select(fd_set *fds,struct timeval *tval);
985 int sys_select(fd_set *fds,struct timeval *tval);
986 int sys_unlink(char *fname);
987 int sys_open(char *fname,int flags,int mode);
988 DIR *sys_opendir(char *dname);
989 int sys_stat(char *fname,struct stat *sbuf);
990 int sys_waitpid(pid_t pid,int *status,int options);
991 int sys_lstat(char *fname,struct stat *sbuf);
992 int sys_mkdir(char *dname,int mode);
993 int sys_rmdir(char *dname);
994 int sys_chdir(char *dname);
995 int sys_utime(char *fname,struct utimbuf *times);
996 int sys_rename(char *from, char *to);
997 int sys_chmod(char *fname,int mode);
998 char *sys_getwd(char *s);
999 int sys_chown(char *fname,int uid,int gid);
1000 int sys_chroot(char *dname);
1001 struct hostent *sys_gethostbyname(char *name);
1002
1003 /*The following definitions come from  testparm.c  */
1004
1005
1006 /*The following definitions come from  testprns.c  */
1007
1008 int main(int argc, char *argv[]);
1009
1010 /*The following definitions come from  time.c  */
1011
1012 void GetTimeOfDay(struct timeval *tval);
1013 void TimeInit(void);
1014 int TimeDiff(time_t t);
1015 struct tm *LocalTime(time_t *t);
1016 time_t interpret_long_date(char *p);
1017 void put_long_date(char *p,time_t t);
1018 BOOL null_mtime(time_t mtime);
1019 void put_dos_date(char *buf,int offset,time_t unixdate);
1020 void put_dos_date2(char *buf,int offset,time_t unixdate);
1021 void put_dos_date3(char *buf,int offset,time_t unixdate);
1022 time_t make_unix_date(void *date_ptr);
1023 time_t make_unix_date2(void *date_ptr);
1024 time_t make_unix_date3(void *date_ptr);
1025 char *timestring(void );
1026
1027 /*The following definitions come from  trans2.c  */
1028
1029 int reply_findclose(char *inbuf,char *outbuf,int length,int bufsize);
1030 int reply_findnclose(char *inbuf,char *outbuf,int length,int bufsize);
1031 int reply_transs2(char *inbuf,char *outbuf,int length,int bufsize);
1032 int reply_trans2(char *inbuf,char *outbuf,int length,int bufsize);
1033
1034 /*The following definitions come from  ubi_dLinkList.c  */
1035
1036
1037 /*The following definitions come from  ufc.c  */
1038
1039 char *ufc_crypt(char *key,char *salt);
1040
1041 /*The following definitions come from  uid.c  */
1042
1043 void init_uid(void);
1044 BOOL become_guest(void);
1045 BOOL become_user(connection_struct *conn, int cnum, uint16 vuid);
1046 BOOL unbecome_user(void );
1047 int smbrun(char *cmd,char *outfile,BOOL shared);
1048 void become_root(BOOL save_dir) ;
1049 void unbecome_root(BOOL restore_dir);
1050
1051 /*The following definitions come from  username.c  */
1052
1053 char *get_home_dir(char *user);
1054 void map_username(char *user);
1055 struct passwd *Get_Pwnam(char *user,BOOL allow_change);
1056 BOOL user_in_list(char *user,char *list);
1057
1058 /*The following definitions come from  util.c  */
1059
1060 void setup_logging(char *pname,BOOL interactive);
1061 void reopen_logs(void);
1062 char *tmpdir(void);
1063 BOOL is_a_socket(int fd);
1064 BOOL next_token(char **ptr,char *buff,char *sep);
1065 char **toktocliplist(int *ctok, char *sep);
1066 void *MemMove(void *dest,void *src,int size);
1067 void array_promote(char *array,int elsize,int element);
1068 void set_socket_options(int fd, char *options);
1069 void close_sockets(void );
1070 BOOL in_group(gid_t group, int current_gid, int ngroups, int *groups);
1071 char *StrCpy(char *dest,char *src);
1072 char *StrnCpy(char *dest,char *src,int n);
1073 void putip(void *dest,void *src);
1074 int name_mangle( char *In, char *Out, char name_type );
1075 BOOL file_exist(char *fname,struct stat *sbuf);
1076 time_t file_modtime(char *fname);
1077 BOOL directory_exist(char *dname,struct stat *st);
1078 uint32 file_size(char *file_name);
1079 char *attrib_string(int mode);
1080 int StrCaseCmp(char *s, char *t);
1081 int StrnCaseCmp(char *s, char *t, int n);
1082 BOOL strequal(char *s1, char *s2);
1083 BOOL strnequal(char *s1,char *s2,int n);
1084 BOOL strcsequal(char *s1,char *s2);
1085 void strlower(char *s);
1086 void strupper(char *s);
1087 void strnorm(char *s);
1088 BOOL strisnormal(char *s);
1089 void string_replace(char *s,char oldc,char newc);
1090 void unix_format(char *fname);
1091 void dos_format(char *fname);
1092 void show_msg(char *buf);
1093 int smb_len(char *buf);
1094 void _smb_setlen(char *buf,int len);
1095 void smb_setlen(char *buf,int len);
1096 int set_message(char *buf,int num_words,int num_bytes,BOOL zero);
1097 int smb_numwords(char *buf);
1098 int smb_buflen(char *buf);
1099 int smb_buf_ofs(char *buf);
1100 char *smb_buf(char *buf);
1101 int smb_offset(char *p,char *buf);
1102 char *skip_string(char *buf,int n);
1103 BOOL trim_string(char *s,char *front,char *back);
1104 void dos_clean_name(char *s);
1105 void unix_clean_name(char *s);
1106 int ChDir(char *path);
1107 char *GetWd(char *str);
1108 BOOL reduce_name(char *s,char *dir,BOOL widelinks);
1109 void expand_mask(char *Mask,BOOL doext);
1110 BOOL strhasupper(char *s);
1111 BOOL strhaslower(char *s);
1112 int count_chars(char *s,char c);
1113 void make_dir_struct(char *buf,char *mask,char *fname,unsigned int size,int mode,time_t date);
1114 void close_low_fds(void);
1115 int set_blocking(int fd, BOOL set);
1116 int write_socket(int fd,char *buf,int len);
1117 int read_udp_socket(int fd,char *buf,int len);
1118 int read_with_timeout(int fd,char *buf,int mincnt,int maxcnt,long time_out);
1119 int read_max_udp(int fd,char *buffer,int bufsize,int maxtime);
1120 int TvalDiff(struct timeval *tvalold,struct timeval *tvalnew);
1121 BOOL send_keepalive(int client);
1122 int read_data(int fd,char *buffer,int N);
1123 int write_data(int fd,char *buffer,int N);
1124 int transfer_file(int infd,int outfd,int n,char *header,int headlen,int align);
1125 int read_smb_length(int fd,char *inbuf,int timeout);
1126 BOOL receive_smb(int fd,char *buffer, int timeout);
1127 BOOL receive_local_message(int fd, char *buffer, int buffer_len, int timeout);
1128 BOOL push_local_message(char *buf, int msg_len);
1129 BOOL receive_message_or_smb(int smbfd, int oplock_fd, 
1130                            char *buffer, int buffer_len, 
1131                            int timeout, BOOL *got_smb);
1132 BOOL send_smb(int fd,char *buffer);
1133 char *name_ptr(char *buf,int ofs);
1134 int name_extract(char *buf,int ofs,char *name);
1135 int name_len( char *s );
1136 BOOL send_one_packet(char *buf,int len,struct in_addr ip,int port,int type);
1137 void msleep(int t);
1138 BOOL in_list(char *s,char *list,BOOL casesensitive);
1139 BOOL string_init(char **dest,char *src);
1140 void string_free(char **s);
1141 BOOL string_set(char **dest,char *src);
1142 BOOL string_sub(char *s,char *pattern,char *insert);
1143 BOOL do_match(char *str, char *regexp, int case_sig);
1144 BOOL mask_match(char *str, char *regexp, int case_sig,BOOL trans2);
1145 void become_daemon(void);
1146 BOOL yesno(char *p);
1147 char *fgets_slash(char *s2,int maxlen,FILE *f);
1148 int set_filelen(int fd, long len);
1149 int byte_checksum(char *buf,int len);
1150 char *dirname_dos(char *path,char *buf);
1151 void *Realloc(void *p,int size);
1152 void Abort(void );
1153 BOOL get_myname(char *my_name,struct in_addr *ip);
1154 BOOL ip_equal(struct in_addr ip1,struct in_addr ip2);
1155 int open_socket_in(int type, int port, int dlevel,uint32 socket_addr);
1156 int open_socket_out(int type, struct in_addr *addr, int port ,int timeout);
1157 int interpret_protocol(char *str,int def);
1158 int interpret_security(char *str,int def);
1159 uint32 interpret_addr(char *str);
1160 struct in_addr *interpret_addr2(char *str);
1161 BOOL zero_ip(struct in_addr ip);
1162 void reset_globals_after_fork();
1163 char *client_name(void);
1164 char *client_addr(void);
1165 char *automount_server(char *user_name);
1166 void standard_sub_basic(char *str);
1167 BOOL same_net(struct in_addr ip1,struct in_addr ip2,struct in_addr mask);
1168 int PutUniCode(char *dst,char *src);
1169 struct hostent *Get_Hostbyname(char *name);
1170 BOOL process_exists(int pid);
1171 char *uidtoname(int uid);
1172 char *gidtoname(int gid);
1173 void BlockSignals(BOOL block,int signum);
1174 void ajt_panic(void);
1175 char *readdirname(void *p);
1176 BOOL is_in_path(char *name, name_compare_entry *namelist);
1177 void set_namearray(name_compare_entry **ppname_array, char *namelist);
1178 void free_namearray(name_compare_entry *name_array);
1179 BOOL fcntl_lock(int fd,int op,uint32 offset,uint32 count,int type);
1180 int file_lock(char *name,int timeout);
1181 void file_unlock(int fd);
1182 BOOL is_myname(char *s);
1183 void set_remote_arch(enum remote_arch_types type);
1184 enum remote_arch_types get_remote_arch();
1185 char *skip_unicode_string(char *buf,int n);
1186 char *unistrn2(uint16 *buf, int len);
1187 char *unistr2(uint16 *buf);
1188 char *unistr(char *buf);
1189 int unistrncpy(char *dst, char *src, int len);
1190 int unistrcpy(char *dst, char *src);
1191 void fstrcpy(char *dest, char *src);
1192 void pstrcpy(char *dest, char *src);
1193 char *align4(char *q, char *base);
1194 char *align2(char *q, char *base);
1195 char *align_offset(char *q, char *base, int align_offset_len);
1196 void dump_data(int level,char *buf1,int len);
1197 char *tab_depth(int depth);