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