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