lots of changes to nmbd
[samba.git] / source / include / proto.h
1 /* This file is automatically generated with "make proto". DO NOT EDIT */
2
3
4 /*The following definitions come from  -  */
5
6 BOOL check_access(int snum);
7 BOOL allow_access(char *deny_list,char *allow_list,struct from_host *client);
8 BOOL fromhost(int sock,struct from_host *f);
9 char *unix2dos_format(char *str,BOOL overwrite);
10 char *dos2unix_format(char *str, BOOL overwrite);
11 int interpret_character_set(char *str, int def);
12 void charset_initialise(void);
13 void add_char_string(char *s);
14 BOOL chat_with_program(char *passwordprogram,char *name,char *chatsequence);
15 BOOL chgpasswd(char *name,char *oldpass,char *newpass);
16 BOOL chgpasswd(char *name,char *oldpass,char *newpass);
17 void setup_pkt(char *outbuf);
18 void do_dir(char *inbuf,char *outbuf,char *Mask,int attribute,void (*fn)(),BOOL recurse_dir);
19 void cmd_help(void);
20 BOOL reopen_connection(char *inbuf,char *outbuf);
21 char *smb_errstr(char *inbuf);
22 void cli_setup_pkt(char *outbuf);
23 BOOL cli_receive_trans_response(char *inbuf,int trans,int *data_len,
24                                 int *param_len, char **data,char **param);
25 BOOL cli_send_session_request(char *inbuf, char *outbuf);
26 BOOL cli_send_login(char *inbuf, char *outbuf, BOOL start_session, BOOL use_setup);
27 void cli_send_logout(void);
28 BOOL cli_call_api(int prcnt,int drcnt,int mprcnt,int mdrcnt,int *rprcnt,
29               int *rdrcnt, char *param,char *data, char **rparam,char **rdata);
30 BOOL cli_send_trans_request(char *outbuf, int trans, char *name, int fid, int flags,
31                         char *data,char *param,uint16 *setup, int ldata,int lparam,
32                         int lsetup,int mdata,int mparam,int msetup);
33 BOOL cli_open_sockets(int port);
34 BOOL cli_reopen_connection(char *inbuf,char *outbuf);
35 char *smb_errstr(char *inbuf);
36 int strslashcmp(const char *s1, const char *s2);
37 void cmd_block(void);
38 void cmd_tarmode(void);
39 void cmd_setmode(void);
40 void cmd_tar(char *inbuf, char *outbuf);
41 int process_tar(char *inbuf, char *outbuf);
42 int clipfind(char **aret, int ret, char *tok);
43 int tar_parseargs(int argc, char *argv[], char *Optarg, int Optind);
44 void init_dptrs(void);
45 char *dptr_path(int key);
46 char *dptr_wcard(int key);
47 BOOL dptr_set_wcard(int key, char *wcard);
48 BOOL dptr_set_attr(int key, uint16 attr);
49 uint16 dptr_attr(int key);
50 void dptr_close(int key);
51 void dptr_closecnum(int cnum);
52 void dptr_idlecnum(int cnum);
53 void dptr_closepath(char *path,int pid);
54 int dptr_create(int cnum,char *path, BOOL expect_close,int pid);
55 BOOL dptr_fill(char *buf1,unsigned int key);
56 BOOL dptr_zero(char *buf);
57 void *dptr_fetch(char *buf,int *num);
58 void *dptr_fetch_lanman2(char *params,int dptr_num);
59 BOOL dir_check_ftype(int cnum,int mode,struct stat *st,int dirtype);
60 BOOL get_dir_entry(int cnum,char *mask,int dirtype,char *fname,int *size,int *mode,time_t *date,BOOL check_descend);
61 void *OpenDir(char *name);
62 void CloseDir(void *p);
63 char *ReadDirName(void *p);
64 BOOL SeekDir(void *p,int pos);
65 int TellDir(void *p);
66 void DirCacheAdd(char *path,char *name,char *dname,int snum);
67 char *DirCacheCheck(char *path,char *name,int snum);
68 void DirCacheFlush(int snum);
69 void fault_setup(void (*fn)());
70 char *getsmbpass(char *prompt)    ;
71 void load_interfaces(void);
72 void iface_set_default(char *ip,char *bcast,char *nmask);
73 BOOL ismyip(struct in_addr ip);
74 BOOL ismybcast(struct in_addr bcast);
75 int iface_count(void);
76 struct in_addr *iface_n_ip(int n);
77 struct in_addr *iface_bcast(struct in_addr ip);
78 struct in_addr *iface_nmask(struct in_addr ip);
79 struct in_addr *iface_ip(struct in_addr ip);
80 int reply_trans(char *inbuf,char *outbuf);
81 int interpret_coding_system(char *str, int def);
82 char *lp_string(char *s);
83 char *lp_logfile(void);
84 char *lp_smbrun(void);
85 char *lp_configfile(void);
86 char *lp_smb_passwd_file(void);
87 char *lp_serverstring(void);
88 char *lp_printcapname(void);
89 char *lp_lockdir(void);
90 char *lp_rootdir(void);
91 char *lp_defaultservice(void);
92 char *lp_msg_command(void);
93 char *lp_dfree_command(void);
94 char *lp_hosts_equiv(void);
95 char *lp_auto_services(void);
96 char *lp_passwd_program(void);
97 char *lp_passwd_chat(void);
98 char *lp_passwordserver(void);
99 char *lp_workgroup(void);
100 char *lp_domain_controller(void);
101 char *lp_username_map(void);
102 char *lp_character_set(void);
103 char *lp_logon_script(void);
104 char *lp_wins_server(void);
105 char *lp_interfaces(void);
106 char *lp_remote_interfaces(void);
107 BOOL lp_wins_support(void);
108 BOOL lp_wins_proxy(void);
109 BOOL lp_domain_master(void);
110 BOOL lp_domain_logons(void);
111 BOOL lp_preferred_master(void);
112 BOOL lp_load_printers(void);
113 BOOL lp_use_rhosts(void);
114 BOOL lp_getwdcache(void);
115 BOOL lp_readprediction(void);
116 BOOL lp_readbmpx(void);
117 BOOL lp_readraw(void);
118 BOOL lp_writeraw(void);
119 BOOL lp_null_passwords(void);
120 BOOL lp_strip_dot(void);
121 BOOL lp_encrypted_passwords(void);
122 BOOL lp_syslog_only(void);
123 BOOL lp_browse_list(void);
124 int lp_os_level(void);
125 int lp_max_ttl(void);
126 int lp_max_log_size(void);
127 int lp_mangledstack(void);
128 int lp_maxxmit(void);
129 int lp_maxmux(void);
130 int lp_maxpacket(void);
131 int lp_keepalive(void);
132 int lp_passwordlevel(void);
133 int lp_readsize(void);
134 int lp_deadtime(void);
135 int lp_maxprotocol(void);
136 int lp_security(void);
137 int lp_printing(void);
138 int lp_maxdisksize(void);
139 int lp_lpqcachetime(void);
140 int lp_syslog(void);
141 char *lp_preexec(int );
142 char *lp_postexec(int );
143 char *lp_rootpreexec(int );
144 char *lp_rootpostexec(int );
145 char *lp_servicename(int );
146 char *lp_pathname(int );
147 char *lp_dontdescend(int );
148 char *lp_username(int );
149 char *lp_guestaccount(int );
150 char *lp_invalid_users(int );
151 char *lp_valid_users(int );
152 char *lp_admin_users(int );
153 char *lp_printcommand(int );
154 char *lp_lpqcommand(int );
155 char *lp_lprmcommand(int );
156 char *lp_lppausecommand(int );
157 char *lp_lpresumecommand(int );
158 char *lp_printername(int );
159 char *lp_hostsallow(int );
160 char *lp_hostsdeny(int );
161 char *lp_magicscript(int );
162 char *lp_magicoutput(int );
163 char *lp_comment(int );
164 char *lp_force_user(int );
165 char *lp_force_group(int );
166 char *lp_readlist(int );
167 char *lp_writelist(int );
168 char *lp_volume(int );
169 char *lp_mangled_map(int );
170 BOOL lp_alternate_permissions(int );
171 BOOL lp_revalidate(int );
172 BOOL lp_casesensitive(int );
173 BOOL lp_preservecase(int );
174 BOOL lp_shortpreservecase(int );
175 BOOL lp_casemangle(int );
176 BOOL lp_status(int );
177 BOOL lp_hide_dot_files(int );
178 BOOL lp_browseable(int );
179 BOOL lp_readonly(int );
180 BOOL lp_no_set_dir(int );
181 BOOL lp_guest_ok(int );
182 BOOL lp_guest_only(int );
183 BOOL lp_print_ok(int );
184 BOOL lp_postscript(int );
185 BOOL lp_map_hidden(int );
186 BOOL lp_map_archive(int );
187 BOOL lp_locking(int );
188 BOOL lp_strict_locking(int );
189 BOOL lp_share_modes(int );
190 BOOL lp_onlyuser(int );
191 BOOL lp_manglednames(int );
192 BOOL lp_widelinks(int );
193 BOOL lp_syncalways(int );
194 BOOL lp_map_system(int );
195 BOOL lp_delete_readonly(int );
196 int lp_create_mode(int );
197 int lp_max_connections(int );
198 int lp_defaultcase(int );
199 int lp_minprintspace(int );
200 char lp_magicchar(int );
201 BOOL lp_add_home(char *pszHomename, int iDefaultService, char *pszHomedir);
202 int lp_add_service(char *pszService, int iDefaultService);
203 BOOL lp_add_printer(char *pszPrintername, int iDefaultService);
204 BOOL lp_file_list_changed(void);
205 BOOL lp_snum_ok(int iService);
206 BOOL lp_loaded(void);
207 void lp_killunused(BOOL (*snumused)(int ));
208 BOOL lp_load(char *pszFname,BOOL global_only);
209 int lp_numservices(void);
210 void lp_dump(void);
211 int lp_servicenumber(char *pszServiceName);
212 char *my_workgroup(void);
213 char *volume_label(int snum);
214 BOOL fcntl_lock(int fd,int op,uint32 offset,uint32 count,int type);
215 int file_lock(char *name,int timeout);
216 void file_unlock(int fd);
217 BOOL is_locked(int fnum,int cnum,uint32 count,uint32 offset);
218 BOOL do_lock(int fnum,int cnum,uint32 count,uint32 offset,int *eclass,uint32 *ecode);
219 BOOL do_unlock(int fnum,int cnum,uint32 count,uint32 offset,int *eclass,uint32 *ecode);
220 int get_share_mode_by_fnum(int cnum,int fnum,int *pid);
221 int get_share_mode_byname(int cnum,char *fname,int *pid);
222 int get_share_mode(int cnum,struct stat *sbuf,int *pid);
223 void del_share_mode(int fnum);
224 BOOL set_share_mode(int fnum,int mode);
225 void clean_share_files(void);
226 int str_checksum(char *s);
227 BOOL is_8_3(char *fname);
228 void create_mangled_stack(int size);
229 BOOL check_mangled_stack(char *s);
230 BOOL is_mangled(char *s);
231 void mangle_name_83(char *s);
232 BOOL name_map_mangle(char *OutName,BOOL need83,int snum);
233 int reply_sends(char *inbuf,char *outbuf);
234 int reply_sendstrt(char *inbuf,char *outbuf);
235 int reply_sendtxt(char *inbuf,char *outbuf);
236 int reply_sendend(char *inbuf,char *outbuf);
237 void announce_request(struct work_record *work, struct in_addr ip);
238 void do_announce_request(char *info, char *to_name, int announce_type, 
239                          int from,
240                          int to, struct in_addr dest_ip);
241 void sync_server(enum state_type state, char *serv_name, char *work_name, 
242                  int name_type,
243                  struct in_addr ip);
244 void announce_backup(void);
245 void remove_my_servers(void);
246 void announce_server(struct subnet_record *d, struct work_record *work,
247                                         char *name, char *comment, time_t ttl, int server_type);
248 void announce_host(void);
249 void announce_master(void);
250 void expire_browse_cache(time_t t);
251 struct browse_cache_record *add_browser_entry(char *name, int type, char *wg,
252                                               time_t ttl, struct in_addr ip);
253 void do_browser_lists(void);
254 BOOL name_equal(struct nmb_name *n1,struct nmb_name *n2);
255 BOOL ms_browser_name(char *name, int type);
256 void remove_name(struct subnet_record *d, struct name_record *n);
257 struct name_record *find_name(struct name_record *n,
258                         struct nmb_name *name,
259                         int search);
260 struct name_record *find_name_search(struct subnet_record **d,
261                         struct nmb_name *name,
262                         int search, struct in_addr ip);
263 void dump_names(void);
264 void load_netbios_names(void);
265 void remove_netbios_name(struct subnet_record *d,
266                         char *name,int type, enum name_source source,
267                          struct in_addr ip);
268 struct name_record *add_netbios_entry(struct subnet_record *d,
269                 char *name, int type, int nb_flags, 
270                 int ttl, enum name_source source, struct in_addr ip,
271                 BOOL new_only,BOOL wins);
272 void expire_names(time_t t);
273 struct name_record *search_for_name(struct subnet_record **d,
274                                         struct nmb_name *question,
275                                     struct in_addr ip, int Time, int search);
276 void add_response_record(struct subnet_record *d,
277                                 struct response_record *n);
278 void remove_response_record(struct subnet_record *d,
279                                 struct response_record *n);
280 struct response_record *make_response_queue_record(enum state_type state,
281                                 int id,uint16 fd,
282                                 int quest_type, char *name,int type, int nb_flags, time_t ttl,
283                                 BOOL bcast,BOOL recurse,
284                                 struct in_addr send_ip, struct in_addr reply_to_ip);
285 struct response_record *find_response_record(struct subnet_record **d,
286                                 uint16 id);
287 void remove_old_servers(struct work_record *work, time_t t,
288                                         BOOL remove_all);
289 struct server_record *find_server(struct work_record *work, char *name);
290 struct server_record *add_server_entry(struct subnet_record *d, 
291                                        struct work_record *work,
292                                        char *name,int servertype, 
293                                        int ttl,char *comment,
294                                        BOOL replace);
295 void expire_servers(time_t t);
296 struct subnet_record *find_subnet(struct in_addr bcast_ip);
297 struct subnet_record *find_req_subnet(struct in_addr ip, BOOL bcast);
298 void add_subnet_interfaces(void);
299 void add_my_subnets(char *group);
300 struct subnet_record *add_subnet_entry(struct in_addr bcast_ip, 
301                                        struct in_addr mask_ip,
302                                        char *name, BOOL add, BOOL lmhosts);
303 void write_browse_list(void);
304 struct work_record *remove_workgroup(struct subnet_record *d, 
305                                      struct work_record *work,
306                                          BOOL remove_all_servers);
307 struct work_record *find_workgroupstruct(struct subnet_record *d, 
308                                          fstring name, BOOL add);
309 void dump_workgroups(void);
310 void check_master_browser(void);
311 void browser_gone(char *work_name, struct in_addr ip);
312 void send_election(struct subnet_record *d, char *group,uint32 criterion,
313                    int timeup,char *name);
314 void name_unregister_work(struct subnet_record *d, char *name, int name_type);
315 void name_register_work(struct subnet_record *d, char *name, int name_type,
316                                 int nb_flags, time_t ttl, struct in_addr ip, BOOL bcast);
317 void become_master(struct subnet_record *d, struct work_record *work);
318 void become_nonmaster(struct subnet_record *d, struct work_record *work,
319                                 int remove_type);
320 void run_elections(void);
321 void process_election(struct packet_struct *p,char *buf);
322 BOOL check_elections(void);
323 void process_logon_packet(struct packet_struct *p,char *buf,int len);
324 void debug_browse_data(char *outbuf, int len);
325 void initiate_netbios_packet(uint16 *id,
326                                 int fd,int quest_type,char *name,int name_type,
327                             int nb_flags,BOOL bcast,BOOL recurse,
328                             struct in_addr to_ip);
329 void reply_netbios_packet(struct packet_struct *p1,int trn_id,
330                                 int rcode, int rcv_code, int opcode, BOOL recurse,
331                                 struct nmb_name *rr_name,int rr_type,int rr_class,int ttl,
332                                 char *data,int len);
333 void queue_packet(struct packet_struct *packet);
334 void run_packet_queue();
335 void listen_for_packets(BOOL run_election);
336 BOOL send_mailslot_reply(char *mailslot,int fd,char *buf,int len,char *srcname,
337                          char *dstname,int src_type,int dest_type,
338                          struct in_addr dest_ip,struct in_addr src_ip);
339 BOOL name_status(int fd,char *name,int name_type,BOOL recurse,
340                  struct in_addr to_ip,char *master,char *rname,
341                  void (*fn)());
342 BOOL name_query(int fd,char *name,int name_type, 
343                 BOOL bcast,BOOL recurse,
344                 struct in_addr to_ip, struct in_addr *ip,void (*fn)());
345 void expire_netbios_response_entries();
346 struct response_record *queue_netbios_pkt_wins(struct subnet_record *d,
347                                 int fd,int quest_type,enum state_type state,
348                             char *name,int name_type,int nb_flags, time_t ttl,
349                             BOOL bcast,BOOL recurse,
350                                 struct in_addr send_ip, struct in_addr reply_to_ip);
351 struct response_record *queue_netbios_packet(struct subnet_record *d,
352                         int fd,int quest_type,enum state_type state,char *name,
353                         int name_type,int nb_flags, time_t ttl,
354                             BOOL bcast,BOOL recurse,
355                                 struct in_addr send_ip, struct in_addr reply_to_ip);
356 void remove_name_entry(struct subnet_record *d, char *name,int type);
357 void add_my_name_entry(struct subnet_record *d,char *name,int type,int nb_flags);
358 void add_my_names(void);
359 void remove_my_names();
360 void refresh_my_names(time_t t);
361 void query_refresh_names(void);
362 void add_name_respond(struct subnet_record *d, int fd, struct in_addr from_ip,
363                                 uint16 response_id,
364                                 struct nmb_name *name,
365                                 int nb_flags, int ttl, struct in_addr register_ip,
366                                 BOOL new_owner, struct in_addr reply_to_ip);
367 void send_name_response(int fd, struct in_addr from_ip,
368                                 int name_trn_id, int opcode, BOOL success, BOOL recurse,
369                                 struct nmb_name *reply_name, int nb_flags, int ttl,
370                                 struct in_addr ip);
371 void reply_name_release(struct packet_struct *p);
372 void reply_name_reg(struct packet_struct *p);
373 void reply_name_status(struct packet_struct *p);
374 void reply_name_query(struct packet_struct *p);
375 void debug_state_type(int state);
376 void response_netbios_packet(struct packet_struct *p);
377 void reset_server(char *name, int state, struct in_addr ip);
378 void tell_become_backup(void);
379 BOOL same_context(struct dgram_packet *dgram);
380 BOOL listening_name(struct work_record *work, struct nmb_name *n);
381 BOOL listening_type(struct packet_struct *p, int command);
382 void process_browse_packet(struct packet_struct *p,char *buf,int len);
383 BOOL reload_services(BOOL test);
384 void debug_nmb_packet(struct packet_struct *p);
385 char *namestr(struct nmb_name *n);
386 void free_nmb_packet(struct nmb_packet *nmb);
387 void free_packet(struct packet_struct *packet);
388 struct packet_struct *read_packet(int fd,enum packet_type packet_type);
389 void make_nmb_name(struct nmb_name *n,char *name,int type,char *this_scope);
390 BOOL send_packet(struct packet_struct *p);
391 struct packet_struct *receive_packet(int fd,enum packet_type type,int t);
392 int main(int argc,char *argv[]);
393 char *getsmbpass(char *pass);
394 void sync_browse_lists(struct subnet_record *d, struct work_record *work,
395                 char *name, int nm_type, struct in_addr ip);
396 BOOL pm_process(char *pszFileName,BOOL (*sfunc)(char *),BOOL (*pfunc)(char *,char *));
397 void generate_next_challenge(char *challenge);
398 BOOL set_challenge(char *challenge);
399 BOOL last_challenge(char *challenge);
400 int valid_uid(int uid);
401 user_struct *get_valid_user_struct(int uid);
402 void invalidate_uid(int uid);
403 char *validated_username(int vuid);
404 void register_uid(int uid,int gid, char *name,BOOL guest);
405 void add_session_user(char *user);
406 void dfs_unlogin(void);
407 BOOL password_check(char *password);
408 BOOL smb_password_check(char *password, unsigned char *part_passwd, unsigned char *c8);
409 BOOL password_ok(char *user,char *password, int pwlen, struct passwd *pwd, BOOL is_nt_password);
410 BOOL user_ok(char *user,int snum);
411 BOOL authorise_login(int snum,char *user,char *password, int pwlen, 
412                      BOOL *guest,BOOL *force,int vuid);
413 BOOL check_hosts_equiv(char *user);
414 BOOL server_cryptkey(char *buf);
415 BOOL server_validate(char *buf);
416 BOOL pcap_printername_ok(char *pszPrintername, char *pszPrintcapname);
417 void pcap_printer_fn(void (*fn)());
418 int read_predict(int fd,int offset,char *buf,char **ptr,int num);
419 void do_read_prediction();
420 void invalidate_read_prediction(int fd);
421 void lpq_reset(int snum);
422 void print_file(int fnum);
423 int get_printqueue(int snum,int cnum,print_queue_struct **queue,
424                    print_status_struct *status);
425 void del_printqueue(int cnum,int snum,int jobid);
426 void status_printjob(int cnum,int snum,int jobid,int status);
427 BOOL disk_quotas(char *path, int *bsize, int *dfree, int *dsize);
428 BOOL disk_quotas(char *path, int *bsize, int *dfree, int *dsize);
429 BOOL disk_quotas(char *path, int *bsize, int *dfree, int *dsize);
430 BOOL disk_quotas(char *path, int *bsize, int *dfree, int *dsize);
431 char *Strstr(char *s, char *p);
432 time_t Mktime(struct tm      *t);
433 int InNetGr(char *group,char *host,char *user,char *dom);
434 void *malloc_wrapped(int size,char *file,int line);
435 void *realloc_wrapped(void *ptr,int size,char *file,int line);
436 void free_wrapped(void *ptr,char *file,int line);
437 void *memcpy_wrapped(void *d,void *s,int l,char *fname,int line);
438 int reply_special(char *inbuf,char *outbuf);
439 int reply_tcon(char *inbuf,char *outbuf);
440 int reply_tcon_and_X(char *inbuf,char *outbuf,int length,int bufsize);
441 int reply_unknown(char *inbuf,char *outbuf);
442 int reply_ioctl(char *inbuf,char *outbuf);
443 int reply_sesssetup_and_X(char *inbuf,char *outbuf,int length,int bufsize);
444 int reply_chkpth(char *inbuf,char *outbuf);
445 int reply_getatr(char *inbuf,char *outbuf);
446 int reply_setatr(char *inbuf,char *outbuf);
447 int reply_dskattr(char *inbuf,char *outbuf);
448 int reply_search(char *inbuf,char *outbuf);
449 int reply_fclose(char *inbuf,char *outbuf);
450 int reply_open(char *inbuf,char *outbuf);
451 int reply_open_and_X(char *inbuf,char *outbuf,int length,int bufsize);
452 int reply_ulogoffX(char *inbuf,char *outbuf,int length,int bufsize);
453 int reply_mknew(char *inbuf,char *outbuf);
454 int reply_ctemp(char *inbuf,char *outbuf);
455 int reply_unlink(char *inbuf,char *outbuf);
456 int reply_readbraw(char *inbuf, char *outbuf);
457 int reply_lockread(char *inbuf,char *outbuf);
458 int reply_read(char *inbuf,char *outbuf);
459 int reply_read_and_X(char *inbuf,char *outbuf,int length,int bufsize);
460 int reply_writebraw(char *inbuf,char *outbuf);
461 int reply_writeunlock(char *inbuf,char *outbuf);
462 int reply_write(char *inbuf,char *outbuf,int dum1,int dum2);
463 int reply_write_and_X(char *inbuf,char *outbuf,int length,int bufsize);
464 int reply_lseek(char *inbuf,char *outbuf);
465 int reply_flush(char *inbuf,char *outbuf);
466 int reply_exit(char *inbuf,char *outbuf);
467 int reply_close(char *inbuf,char *outbuf);
468 int reply_writeclose(char *inbuf,char *outbuf);
469 int reply_lock(char *inbuf,char *outbuf);
470 int reply_unlock(char *inbuf,char *outbuf);
471 int reply_tdis(char *inbuf,char *outbuf);
472 int reply_echo(char *inbuf,char *outbuf);
473 int reply_printopen(char *inbuf,char *outbuf);
474 int reply_printclose(char *inbuf,char *outbuf);
475 int reply_printqueue(char *inbuf,char *outbuf);
476 int reply_printwrite(char *inbuf,char *outbuf);
477 int reply_mkdir(char *inbuf,char *outbuf);
478 int reply_rmdir(char *inbuf,char *outbuf);
479 int reply_mv(char *inbuf,char *outbuf);
480 int reply_copy(char *inbuf,char *outbuf);
481 int reply_setdir(char *inbuf,char *outbuf);
482 int reply_lockingX(char *inbuf,char *outbuf,int length,int bufsize);
483 int reply_readbmpx(char *inbuf,char *outbuf,int length,int bufsize);
484 int reply_writebmpx(char *inbuf,char *outbuf);
485 int reply_writebs(char *inbuf,char *outbuf);
486 int reply_setattrE(char *inbuf,char *outbuf);
487 int reply_getattrE(char *inbuf,char *outbuf);
488 mode_t unix_mode(int cnum,int dosmode);
489 int dos_mode(int cnum,char *path,struct stat *sbuf);
490 int dos_chmod(int cnum,char *fname,int dosmode,struct stat *st);
491 BOOL unix_convert(char *name,int cnum);
492 int disk_free(char *path,int *bsize,int *dfree,int *dsize);
493 int sys_disk_free(char *path,int *bsize,int *dfree,int *dsize);
494 BOOL check_name(char *name,int cnum);
495 void open_file(int fnum,int cnum,char *fname1,int flags,int mode);
496 void sync_file(int fnum);
497 void close_file(int fnum);
498 BOOL check_file_sharing(int cnum,char *fname);
499 void open_file_shared(int fnum,int cnum,char *fname,int share_mode,int ofun,
500                       int mode,int *Access,int *action);
501 int seek_file(int fnum,int pos);
502 int read_file(int fnum,char *data,int pos,int mincnt,int maxcnt,int timeout,BOOL exact);
503 int write_file(int fnum,char *data,int n);
504 BOOL become_service(int cnum,BOOL do_chdir);
505 int find_service(char *service);
506 int cached_error_packet(char *inbuf,char *outbuf,int fnum,int line);
507 int unix_error_packet(char *inbuf,char *outbuf,int def_class,uint32 def_code,int line);
508 int error_packet(char *inbuf,char *outbuf,int error_class,uint32 error_code,int line);
509 BOOL snum_used(int snum);
510 BOOL reload_services(BOOL test);
511 int setup_groups(char *user, int uid, int gid, int *p_ngroups, 
512                  int **p_igroups, gid_t **p_groups);
513 int make_connection(char *service,char *user,char *password, int pwlen, char *dev,int vuid);
514 int find_free_file(void );
515 int reply_corep(char *outbuf);
516 int reply_coreplus(char *outbuf);
517 int reply_lanman1(char *outbuf);
518 int reply_lanman2(char *outbuf);
519 int reply_nt1(char *outbuf);
520 void parse_connect(char *buf,char *service,char *user,char *password,int *pwlen,char *dev);
521 void close_cnum(int cnum, int uid);
522 BOOL yield_connection(int cnum,char *name,int max_connections);
523 BOOL claim_connection(int cnum,char *name,int max_connections,BOOL Clear);
524 void exit_server(char *reason);
525 void standard_sub(int cnum,char *s);
526 char *smb_fn_name(int type);
527 int chain_reply(int type,char *inbuf,char *inbuf2,char *outbuf,char *outbuf2,int size,int bufsize);
528 int construct_reply(char *inbuf,char *outbuf,int size,int bufsize);
529 void str_to_key(uchar *str,uchar *key);
530 void D1(uchar *k, uchar *d, uchar *out);
531 void E1(uchar *k, uchar *d, uchar *out);
532 void E_P16(uchar *p14,uchar *p16);
533 void E_P24(uchar *p21, uchar *c8, uchar *p24);
534 void SMBencrypt(uchar *passwd, uchar *c8, uchar *p24);
535 void E_md4hash(uchar *passwd, uchar *p16);
536 void SMBNTencrypt(uchar *passwd, uchar *c8, uchar *p24);
537 void Ucrit_addUsername(pstring username);
538 unsigned int Ucrit_checkUsername(pstring username);
539 void Ucrit_addPid(int pid);
540 unsigned int   Ucrit_checkPid(int pid);
541 int sys_select(fd_set *fds,struct timeval *tval);
542 int sys_select(fd_set *fds,struct timeval *tval);
543 int sys_unlink(char *fname);
544 int sys_open(char *fname,int flags,int mode);
545 DIR *sys_opendir(char *dname);
546 int sys_stat(char *fname,struct stat *sbuf);
547 int sys_lstat(char *fname,struct stat *sbuf);
548 int sys_mkdir(char *dname,int mode);
549 int sys_rmdir(char *dname);
550 int sys_chdir(char *dname);
551 int sys_utime(char *fname,struct utimbuf *times);
552 int sys_rename(char *from, char *to);
553 int sys_chown(char *fname,int uid,int gid);
554 int sys_chroot(char *dname);
555 int main(int argc, char *argv[]);
556 void GetTimeOfDay(struct timeval *tval);
557 void TimeInit(void);
558 int TimeDiff(time_t t);
559 struct tm *LocalTime(time_t *t);
560 time_t interpret_long_date(char *p);
561 void put_long_date(char *p,time_t t);
562 void put_dos_date(char *buf,int offset,time_t unixdate);
563 void put_dos_date2(char *buf,int offset,time_t unixdate);
564 void put_dos_date3(char *buf,int offset,time_t unixdate);
565 time_t make_unix_date(void *date_ptr);
566 time_t make_unix_date2(void *date_ptr);
567 time_t make_unix_date3(void *date_ptr);
568 BOOL set_filetime(char *fname,time_t mtime);
569 char *timestring(void );
570 int reply_findclose(char *inbuf,char *outbuf,int length,int bufsize);
571 int reply_findnclose(char *inbuf,char *outbuf,int length,int bufsize);
572 int reply_transs2(char *inbuf,char *outbuf,int length,int bufsize);
573 int reply_trans2(char *inbuf,char *outbuf,int length,int bufsize);
574 char *ufc_crypt(char *key,char *salt);
575 void init_uid(void);
576 BOOL become_guest(void);
577 BOOL become_user(int cnum, int uid);
578 BOOL unbecome_user(void );
579 int smbrun(char *cmd,char *outfile);
580 char *get_home_dir(char *user);
581 void map_username(char *user);
582 struct passwd *Get_Pwnam(char *user,BOOL allow_change);
583 BOOL user_in_list(char *user,char *list);
584 void setup_logging(char *pname,BOOL interactive);
585 void reopen_logs(void);
586 BOOL is_a_socket(int fd);
587 BOOL next_token(char **ptr,char *buff,char *sep);
588 char **toktocliplist(int *ctok, char *sep);
589 void *MemMove(void *dest,void *src,int size);
590 void array_promote(char *array,int elsize,int element);
591 void set_socket_options(int fd, char *options);
592 void close_sockets(void );
593 BOOL in_group(gid_t group, int current_gid, int ngroups, int *groups);
594 char *StrCpy(char *dest,char *src);
595 char *StrnCpy(char *dest,const char *src,int n);
596 void putip(void *dest,void *src);
597 int name_mangle(char *In,char *Out,char name_type);
598 BOOL file_exist(char *fname,struct stat *sbuf);
599 time_t file_modtime(char *fname);
600 BOOL directory_exist(char *dname,struct stat *st);
601 uint32 file_size(char *file_name);
602 char *attrib_string(int mode);
603 int StrCaseCmp(char *s, char *t);
604 int StrnCaseCmp(char *s, char *t, int n);
605 BOOL strequal(char *s1,char *s2);
606 BOOL strnequal(char *s1,char *s2,int n);
607 BOOL strcsequal(char *s1,char *s2);
608 void strlower(char *s);
609 void strupper(char *s);
610 void strnorm(char *s);
611 BOOL strisnormal(char *s);
612 void string_replace(char *s,char oldc,char newc);
613 void unix_format(char *fname);
614 void dos_format(char *fname);
615 void show_msg(char *buf);
616 int smb_len(char *buf);
617 void _smb_setlen(char *buf,int len);
618 void smb_setlen(char *buf,int len);
619 int set_message(char *buf,int num_words,int num_bytes,BOOL zero);
620 int smb_numwords(char *buf);
621 int smb_buflen(char *buf);
622 int smb_buf_ofs(char *buf);
623 char *smb_buf(char *buf);
624 int smb_offset(char *p,char *buf);
625 char *skip_string(char *buf,int n);
626 BOOL trim_string(char *s,char *front,char *back);
627 void dos_clean_name(char *s);
628 void unix_clean_name(char *s);
629 int ChDir(char *path);
630 char *GetWd(char *str);
631 BOOL reduce_name(char *s,char *dir,BOOL widelinks);
632 void expand_mask(char *Mask,BOOL doext);
633 BOOL strhasupper(char *s);
634 BOOL strhaslower(char *s);
635 int count_chars(char *s,char c);
636 void make_dir_struct(char *buf,char *mask,char *fname,unsigned int size,int mode,time_t date);
637 void close_low_fds(void);
638 int write_socket(int fd,char *buf,int len);
639 int read_udp_socket(int fd,char *buf,int len);
640 int set_blocking(int fd, BOOL set);
641 int read_with_timeout(int fd,char *buf,int mincnt,int maxcnt,long time_out,BOOL exact);
642 int read_max_udp(int fd,char *buffer,int bufsize,int maxtime);
643 int TvalDiff(struct timeval *tvalold,struct timeval *tvalnew);
644 BOOL send_keepalive(int client);
645 int read_data(int fd,char *buffer,int N);
646 int write_data(int fd,char *buffer,int N);
647 int transfer_file(int infd,int outfd,int n,char *header,int headlen,int align);
648 int read_smb_length(int fd,char *inbuf,int timeout);
649 BOOL receive_smb(int fd,char *buffer,int timeout);
650 BOOL send_smb(int fd,char *buffer);
651 char *name_ptr(char *buf,int ofs);
652 int name_extract(char *buf,int ofs,char *name);
653 int name_len(char *s);
654 BOOL send_one_packet(char *buf,int len,struct in_addr ip,int port,int type);
655 void msleep(int t);
656 BOOL in_list(char *s,char *list,BOOL casesensitive);
657 BOOL string_init(char **dest,char *src);
658 void string_free(char **s);
659 BOOL string_set(char **dest,char *src);
660 BOOL string_sub(char *s,char *pattern,char *insert);
661 BOOL do_match(char *str, char *regexp, int case_sig);
662 BOOL mask_match(char *str, char *regexp, int case_sig,BOOL trans2);
663 void become_daemon(void);
664 BOOL yesno(char *p);
665 char *fgets_slash(char *s2,int maxlen,FILE *f);
666 int set_filelen(int fd, long len);
667 int byte_checksum(char *buf,int len);
668 char *dirname_dos(char *path,char *buf);
669 void *Realloc(void *p,int size);
670 void Abort(void );
671 BOOL get_myname(char *myname,struct in_addr *ip);
672 BOOL ip_equal(struct in_addr ip1,struct in_addr ip2);
673 int open_socket_in(int type, int port, int dlevel);
674 int open_socket_out(int type, struct in_addr *addr, int port );
675 int interpret_protocol(char *str,int def);
676 int interpret_security(char *str,int def);
677 unsigned long interpret_addr(char *str);
678 struct in_addr *interpret_addr2(char *str);
679 BOOL zero_ip(struct in_addr ip);
680 void standard_sub_basic(char *s);
681 BOOL same_net(struct in_addr ip1,struct in_addr ip2,struct in_addr mask);
682 int PutUniCode(char *dst,char *src);
683 struct hostent *Get_Hostbyname(char *name);
684 BOOL process_exists(int pid);
685 char *uidtoname(int uid);
686 char *gidtoname(int gid);
687 void BlockSignals(BOOL block);
688 void ajt_panic(void);
689 char *readdirname(void *p);
690 int     VT_Check(char   *buffer);
691 int VT_Start_utmp(void);
692 int VT_Stop_utmp(void);
693 void    VT_AtExit(void);
694 void    VT_SigCLD(int   sig);
695 void    VT_SigEXIT(int  sig);
696 int     VT_Start(void);
697 int     VT_Output(char  *Buffer);
698 int     VT_Input(char   *Buffer,int             Size);
699 void VT_Process(void);