1 /* This file is automatically generated with "make proto". DO NOT EDIT */
4 /*The following definitions come from access.c */
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);
10 /*The following definitions come from charcnv.c */
12 char *unix2dos_format(char *str,BOOL overwrite);
13 char *dos2unix_format(char *str, BOOL overwrite);
14 int interpret_character_set(char *str, int def);
16 /*The following definitions come from charset.c */
18 void charset_initialise(void);
19 void add_char_string(char *s);
21 /*The following definitions come from chgpasswd.c */
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);
27 /*The following definitions come from client.c */
29 void setup_pkt(char *outbuf);
30 void do_dir(char *inbuf,char *outbuf,char *Mask,int attribute,void (*fn)(),BOOL recurse_dir);
32 BOOL reopen_connection(char *inbuf,char *outbuf);
33 char *smb_errstr(char *inbuf);
35 /*The following definitions come from clientutil.c */
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);
52 /*The following definitions come from clitar.c */
54 int strslashcmp(char *s1,char *s2);
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);
63 /*The following definitions come from dir.c */
65 void init_dptrs(void);
66 char *dptr_path(int key);
67 char *dptr_wcard(int key);
68 BOOL dptr_set_wcard(int key, char *wcard);
69 BOOL dptr_set_attr(int key, uint16 attr);
70 uint16 dptr_attr(int key);
71 void dptr_close(int key);
72 void dptr_closecnum(int cnum);
73 void dptr_idlecnum(int cnum);
74 void dptr_closepath(char *path,int pid);
75 int dptr_create(int cnum,char *path, BOOL expect_close,int pid);
76 BOOL dptr_fill(char *buf1,unsigned int key);
77 BOOL dptr_zero(char *buf);
78 void *dptr_fetch(char *buf,int *num);
79 void *dptr_fetch_lanman2(char *params,int dptr_num);
80 BOOL dir_check_ftype(int cnum,int mode,struct stat *st,int dirtype);
81 BOOL get_dir_entry(int cnum,char *mask,int dirtype,char *fname,int *size,int *mode,time_t *date,BOOL check_descend);
82 void *OpenDir(char *name);
83 void CloseDir(void *p);
84 char *ReadDirName(void *p);
85 BOOL SeekDir(void *p,int pos);
87 void DirCacheAdd(char *path,char *name,char *dname,int snum);
88 char *DirCacheCheck(char *path,char *name,int snum);
89 void DirCacheFlush(int snum);
91 /*The following definitions come from fault.c */
93 void fault_setup(void (*fn)());
95 /*The following definitions come from getsmbpass.c */
97 char *getsmbpass(char *prompt) ;
99 /*The following definitions come from interface.c */
101 void load_interfaces(void);
102 void iface_set_default(char *ip,char *bcast,char *nmask);
103 BOOL ismyip(struct in_addr ip);
104 BOOL ismybcast(struct in_addr bcast);
105 int iface_count(void);
106 struct in_addr *iface_n_ip(int n);
107 struct in_addr *iface_bcast(struct in_addr ip);
108 struct in_addr *iface_nmask(struct in_addr ip);
109 struct in_addr *iface_ip(struct in_addr ip);
111 /*The following definitions come from ipc.c */
113 int reply_trans(char *inbuf,char *outbuf);
115 /*The following definitions come from kanji.c */
117 int interpret_coding_system(char *str, int def);
119 /*The following definitions come from loadparm.c */
121 char *lp_string(char *s);
122 char *lp_logfile(void);
123 char *lp_smbrun(void);
124 char *lp_configfile(void);
125 char *lp_smb_passwd_file(void);
126 char *lp_serverstring(void);
127 char *lp_server_comment(void);
128 char *lp_printcapname(void);
129 char *lp_lockdir(void);
130 char *lp_rootdir(void);
131 char *lp_defaultservice(void);
132 char *lp_msg_command(void);
133 char *lp_dfree_command(void);
134 char *lp_hosts_equiv(void);
135 char *lp_auto_services(void);
136 char *lp_passwd_program(void);
137 char *lp_passwd_chat(void);
138 char *lp_passwordserver(void);
139 char *lp_workgroup(void);
140 char *lp_domain_controller(void);
141 char *lp_username_map(void);
142 char *lp_character_set(void);
143 char *lp_logon_script(void);
144 char *lp_remote_announce(void);
145 char *lp_wins_server(void);
146 char *lp_interfaces(void);
147 char *lp_socket_address(void);
148 BOOL lp_wins_support(void);
149 BOOL lp_wins_proxy(void);
150 BOOL lp_local_master(void);
151 BOOL lp_domain_master(void);
152 BOOL lp_domain_logons(void);
153 BOOL lp_preferred_master(void);
154 BOOL lp_load_printers(void);
155 BOOL lp_use_rhosts(void);
156 BOOL lp_getwdcache(void);
157 BOOL lp_readprediction(void);
158 BOOL lp_readbmpx(void);
159 BOOL lp_readraw(void);
160 BOOL lp_writeraw(void);
161 BOOL lp_null_passwords(void);
162 BOOL lp_strip_dot(void);
163 BOOL lp_encrypted_passwords(void);
164 BOOL lp_syslog_only(void);
165 BOOL lp_browse_list(void);
166 int lp_os_level(void);
167 int lp_max_ttl(void);
168 int lp_max_log_size(void);
169 int lp_mangledstack(void);
170 int lp_maxxmit(void);
172 int lp_maxpacket(void);
173 int lp_keepalive(void);
174 int lp_passwordlevel(void);
175 int lp_readsize(void);
176 int lp_deadtime(void);
177 int lp_maxprotocol(void);
178 int lp_security(void);
179 int lp_printing(void);
180 int lp_maxdisksize(void);
181 int lp_lpqcachetime(void);
183 char *lp_preexec(int );
184 char *lp_postexec(int );
185 char *lp_rootpreexec(int );
186 char *lp_rootpostexec(int );
187 char *lp_servicename(int );
188 char *lp_pathname(int );
189 char *lp_dontdescend(int );
190 char *lp_username(int );
191 char *lp_guestaccount(int );
192 char *lp_invalid_users(int );
193 char *lp_valid_users(int );
194 char *lp_admin_users(int );
195 char *lp_printcommand(int );
196 char *lp_lpqcommand(int );
197 char *lp_lprmcommand(int );
198 char *lp_lppausecommand(int );
199 char *lp_lpresumecommand(int );
200 char *lp_printername(int );
201 char *lp_printerdriver(int );
202 char *lp_hostsallow(int );
203 char *lp_hostsdeny(int );
204 char *lp_magicscript(int );
205 char *lp_magicoutput(int );
206 char *lp_comment(int );
207 char *lp_force_user(int );
208 char *lp_force_group(int );
209 char *lp_readlist(int );
210 char *lp_writelist(int );
211 char *lp_volume(int );
212 char *lp_mangled_map(int );
213 BOOL lp_alternate_permissions(int );
214 BOOL lp_revalidate(int );
215 BOOL lp_casesensitive(int );
216 BOOL lp_preservecase(int );
217 BOOL lp_shortpreservecase(int );
218 BOOL lp_casemangle(int );
219 BOOL lp_status(int );
220 BOOL lp_hide_dot_files(int );
221 BOOL lp_browseable(int );
222 BOOL lp_readonly(int );
223 BOOL lp_no_set_dir(int );
224 BOOL lp_guest_ok(int );
225 BOOL lp_guest_only(int );
226 BOOL lp_print_ok(int );
227 BOOL lp_postscript(int );
228 BOOL lp_map_hidden(int );
229 BOOL lp_map_archive(int );
230 BOOL lp_locking(int );
231 BOOL lp_strict_locking(int );
232 BOOL lp_share_modes(int );
233 BOOL lp_onlyuser(int );
234 BOOL lp_manglednames(int );
235 BOOL lp_widelinks(int );
236 BOOL lp_syncalways(int );
237 BOOL lp_map_system(int );
238 BOOL lp_delete_readonly(int );
239 int lp_create_mode(int );
240 int lp_max_connections(int );
241 int lp_defaultcase(int );
242 int lp_minprintspace(int );
243 char lp_magicchar(int );
244 BOOL lp_add_home(char *pszHomename, int iDefaultService, char *pszHomedir);
245 int lp_add_service(char *pszService, int iDefaultService);
246 BOOL lp_add_printer(char *pszPrintername, int iDefaultService);
247 BOOL lp_file_list_changed(void);
248 BOOL lp_snum_ok(int iService);
249 BOOL lp_loaded(void);
250 void lp_killunused(BOOL (*snumused)(int ));
251 BOOL lp_load(char *pszFname,BOOL global_only);
252 int lp_numservices(void);
254 int lp_servicenumber(char *pszServiceName);
255 char *volume_label(int snum);
257 /*The following definitions come from locking.c */
259 BOOL fcntl_lock(int fd,int op,uint32 offset,uint32 count,int type);
260 int file_lock(char *name,int timeout);
261 void file_unlock(int fd);
262 BOOL is_locked(int fnum,int cnum,uint32 count,uint32 offset);
263 BOOL do_lock(int fnum,int cnum,uint32 count,uint32 offset,int *eclass,uint32 *ecode);
264 BOOL do_unlock(int fnum,int cnum,uint32 count,uint32 offset,int *eclass,uint32 *ecode);
265 BOOL start_share_mode_mgmt(void);
266 BOOL stop_share_mode_mgmt(void);
267 int get_share_mode_by_fnum(int cnum,int fnum,int *pid);
268 int get_share_mode_byname(int cnum,char *fname,int *pid);
269 int get_share_mode(int cnum,struct stat *sbuf,int *pid);
270 void del_share_mode(int fnum);
271 BOOL set_share_mode(int fnum,int mode);
272 void clean_share_modes(void);
274 /*The following definitions come from mangle.c */
276 int str_checksum(char *s);
277 BOOL is_8_3(char *fname);
278 void create_mangled_stack(int size);
279 BOOL check_mangled_stack(char *s);
280 BOOL is_mangled(char *s);
281 void mangle_name_83(char *s);
282 BOOL name_map_mangle(char *OutName,BOOL need83,int snum);
284 /*The following definitions come from md4.c */
287 /*The following definitions come from message.c */
289 int reply_sends(char *inbuf,char *outbuf);
290 int reply_sendstrt(char *inbuf,char *outbuf);
291 int reply_sendtxt(char *inbuf,char *outbuf);
292 int reply_sendend(char *inbuf,char *outbuf);
294 /*The following definitions come from nameannounce.c */
296 void announce_request(struct work_record *work, struct in_addr ip);
297 void do_announce_request(char *info, char *from_name, char *to_name,
298 int announce_type, int from, int to, struct in_addr dest_ip);
299 void sync_server(enum state_type state, char *serv_name, char *work_name,
302 void do_announce_host(int command,
303 char *from_name, int from_type, struct in_addr from_ip,
304 char *to_name , int to_type , struct in_addr to_ip,
305 time_t announce_interval,
306 char *server_name, int server_type,
307 char major_version, char minor_version,
308 uint16 browse_version, uint16 browse_sig,
309 char *server_comment);
310 void remove_my_servers(void);
311 void announce_server(struct subnet_record *d, struct work_record *work,
312 char *name, char *comment, time_t ttl, int server_type);
313 void announce_host(void);
314 void announce_master(void);
315 void announce_remote(void);
317 /*The following definitions come from namebrowse.c */
319 void expire_browse_cache(time_t t);
320 struct browse_cache_record *add_browser_entry(char *name, int type, char *wg,
321 time_t ttl, struct in_addr ip, BOOL local);
322 void do_browser_lists(void);
324 /*The following definitions come from nameconf.c */
326 int get_num_workgroups(void);
327 int conf_workgroup_name_to_token(char *workgroup_name,char *default_name);
328 char *conf_workgroup_name(int token);
329 int conf_should_preferred_master(int token);
330 int conf_should_workgroup_member(int token);
331 int conf_should_local_master(int token);
332 int conf_should_domain_logon(int token);
333 int conf_should_domain_master(int token);
334 char *conf_browsing_alias(int token);
335 char *conf_browsing_alias_comment(int token);
336 char *conf_alias_to_workgroup(char *alias);
337 int conf_alias_to_token(char *alias);
338 void read_smbbrowse_conf(char *default_name);
340 /*The following definitions come from namedbname.c */
342 void set_samba_nb_type(void);
343 BOOL name_equal(struct nmb_name *n1,struct nmb_name *n2);
344 BOOL ms_browser_name(char *name, int type);
345 void remove_name(struct subnet_record *d, struct name_record *n);
346 struct name_record *find_name(struct name_record *n,
347 struct nmb_name *name,
349 struct name_record *find_name_search(struct subnet_record **d,
350 struct nmb_name *name,
351 int search, struct in_addr ip);
352 void dump_names(void);
353 void load_netbios_names(void);
354 void remove_netbios_name(struct subnet_record *d,
355 char *name,int type, enum name_source source,
357 struct name_record *add_netbios_entry(struct subnet_record *d,
358 char *name, int type, int nb_flags,
359 int ttl, enum name_source source, struct in_addr ip,
360 BOOL new_only,BOOL wins);
361 void check_expire_names(time_t t);
362 struct name_record *search_for_name(struct subnet_record **d,
363 struct nmb_name *question,
364 struct in_addr ip, int Time, int search);
366 /*The following definitions come from namedbresp.c */
368 void add_response_record(struct subnet_record *d,
369 struct response_record *n);
370 void remove_response_record(struct subnet_record *d,
371 struct response_record *n);
372 struct response_record *make_response_queue_record(enum state_type state,
373 int id,uint16 fd, int quest_type,
374 int token, char *name,int type,
375 enum name_source source, int nb_flags, time_t ttl,
376 int server_type, char *my_name, char *my_comment,
377 BOOL bcast,BOOL recurse,
378 struct in_addr send_ip, struct in_addr reply_to_ip);
379 struct response_record *find_response_record(struct subnet_record **d,
382 /*The following definitions come from namedbserver.c */
384 void remove_old_servers(struct work_record *work, time_t t,
386 struct server_record *find_server(struct work_record *work, char *name);
387 struct server_record *add_server_entry(struct subnet_record *d,
388 struct work_record *work,
389 char *name,int servertype,
390 int ttl,char *comment,
392 void expire_servers(time_t t);
394 /*The following definitions come from namedbsubnet.c */
396 struct subnet_record *find_subnet(struct in_addr bcast_ip);
397 struct subnet_record *find_req_subnet(struct in_addr ip, BOOL bcast);
398 void add_subnet_interfaces(void);
399 void add_workgroup_to_subnet(char *group, struct in_addr bcast_ip,
400 struct in_addr mask_ip);
401 void add_workgroups_to_subnets();
402 struct subnet_record *add_subnet_entry(struct in_addr bcast_ip,
403 struct in_addr mask_ip,
404 char *name, BOOL add, BOOL lmhosts);
405 void write_browse_list(void);
407 /*The following definitions come from namedbwork.c */
409 struct work_record *remove_workgroup(struct subnet_record *d,
410 struct work_record *work,
411 BOOL remove_all_servers);
412 struct work_record *find_workgroupstruct(struct subnet_record *d,
413 fstring name, BOOL add);
414 void dump_workgroups(void);
416 /*The following definitions come from nameelect.c */
418 void check_master_browser(void);
419 void browser_gone(char *work_name, struct in_addr ip);
420 void send_election(struct subnet_record *d, char *group,uint32 criterion,
421 int timeup,char *name);
422 void name_unregister_work(struct subnet_record *d, char *name, int name_type);
423 void name_register_work(struct subnet_record *d, int token,
424 char *name, int name_type, enum name_source source,
425 struct nmb_ip *data, time_t ttl, struct in_addr ip, BOOL bcast);
426 void become_master(struct subnet_record *d, struct work_record *work);
427 void become_nonmaster(struct subnet_record *d, struct work_record *work,
429 void run_elections(void);
430 void process_election(struct packet_struct *p,char *buf);
431 BOOL check_elections(void);
433 /*The following definitions come from namelogon.c */
435 void process_logon_packet(struct packet_struct *p,char *buf,int len);
437 /*The following definitions come from namepacket.c */
439 void debug_browse_data(char *outbuf, int len);
440 BOOL initiate_netbios_packet(uint16 id,
441 int fd,int quest_type,char *name,int name_type,
442 int nb_flags,BOOL bcast,BOOL recurse,
443 struct in_addr to_ip);
444 void reply_netbios_packet(struct packet_struct *p1,int trn_id,
445 int rcode, int rcv_code, int opcode, BOOL recurse,
446 struct nmb_name *rr_name,int rr_type,int rr_class,int ttl,
448 void queue_packet(struct packet_struct *packet);
449 void run_packet_queue();
450 void listen_for_packets(BOOL run_election);
451 BOOL send_mailslot_reply(char *mailslot,int fd,char *buf,int len,char *srcname,
452 char *dstname,int src_type,int dest_type,
453 struct in_addr dest_ip,struct in_addr src_ip);
455 /*The following definitions come from namequery.c */
457 BOOL name_status(int fd,char *name,int name_type,BOOL recurse,
458 struct in_addr to_ip,char *master,char *rname,
460 BOOL name_query(int fd,char *name,int name_type,
461 BOOL bcast,BOOL recurse,
462 struct in_addr to_ip, struct in_addr *ip,void (*fn)());
464 /*The following definitions come from nameresp.c */
466 void update_name_trn_id(void);
467 void expire_netbios_response_entries();
468 void queue_netbios_pkt_wins(struct subnet_record *d,
469 int fd,int quest_type,enum state_type state,
470 int token, char *name,int name_type,
471 enum name_source source, int nb_flags, time_t ttl,
472 int server_type, char *my_name, char *my_comment,
473 BOOL bcast,BOOL recurse,
474 struct in_addr send_ip, struct in_addr reply_to_ip);
475 void queue_netbios_packet(struct subnet_record *d,
476 int fd,int quest_type,enum state_type state,
477 int token, char *name, int name_type,
478 enum name_source source, int nb_flags, time_t ttl,
479 int server_type, char *my_name, char *my_comment,
480 BOOL bcast,BOOL recurse,
481 struct in_addr send_ip, struct in_addr reply_to_ip);
483 /*The following definitions come from nameserv.c */
485 void remove_name_entry(struct subnet_record *d, int token, char *name,int type);
486 void add_my_name_entry(struct subnet_record *d, int token,
487 char *name,int type,int nb_flags);
488 void add_my_names(void);
489 void remove_my_names();
490 void query_refresh_names(void);
492 /*The following definitions come from nameservreply.c */
494 void add_name_respond(struct subnet_record *d, int fd, struct in_addr from_ip,
496 struct nmb_name *name,
497 int nb_flags, int ttl, struct in_addr register_ip,
498 BOOL new_owner, struct in_addr reply_to_ip);
499 void send_name_response(int fd, struct in_addr from_ip,
500 int name_trn_id, int opcode, BOOL success, BOOL recurse,
501 struct nmb_name *reply_name, int nb_flags, int ttl,
503 void reply_name_release(struct packet_struct *p);
504 void reply_name_reg(struct packet_struct *p);
505 void reply_name_status(struct packet_struct *p);
506 void reply_name_query(struct packet_struct *p);
508 /*The following definitions come from nameservresp.c */
510 void debug_state_type(int state);
511 void response_process(struct in_addr ip, struct subnet_record *d,
512 struct response_record *n,
513 int rcode, char *nmb_data, struct nmb_name *q_name,
514 time_t ttl, BOOL bcast, struct nmb_name *ans_name);
515 void response_netbios_packet(struct packet_struct *p);
517 /*The following definitions come from namework.c */
519 void reset_server(struct work_record *work, char *name, int state, struct in_addr ip);
520 void tell_become_backup(void);
521 BOOL same_context(struct dgram_packet *dgram);
522 BOOL listening_name(struct work_record *work, struct nmb_name *n);
523 void process_browse_packet(struct packet_struct *p,char *buf,int len);
525 /*The following definitions come from nmbd.c */
527 BOOL reload_services(BOOL test);
529 /*The following definitions come from nmblib.c */
531 void debug_nmb_packet(struct packet_struct *p);
532 char *namestr(struct nmb_name *n);
533 void free_nmb_packet(struct nmb_packet *nmb);
534 void free_packet(struct packet_struct *packet);
535 struct packet_struct *read_packet(int fd,enum packet_type packet_type);
536 void make_nmb_name(struct nmb_name *n,char *name,int type,char *this_scope);
537 BOOL send_packet(struct packet_struct *p);
538 struct packet_struct *receive_packet(int fd,enum packet_type type,int t);
540 /*The following definitions come from nmblookup.c */
542 int main(int argc,char *argv[]);
544 /*The following definitions come from nmbsync.c */
546 char *getsmbpass(char *pass);
547 void sync_browse_lists(struct subnet_record *d, struct work_record *work,
548 char *name, int nm_type, struct in_addr ip, BOOL local);
550 /*The following definitions come from params.c */
552 BOOL pm_process(char *pszFileName,BOOL (*sfunc)(char *),BOOL (*pfunc)(char *,char *));
554 /*The following definitions come from password.c */
556 void generate_next_challenge(char *challenge);
557 BOOL set_challenge(char *challenge);
558 BOOL last_challenge(char *challenge);
559 int valid_uid(int uid);
560 user_struct *get_valid_user_struct(int uid);
561 void invalidate_uid(int uid);
562 char *validated_username(int vuid);
563 void register_uid(int uid,int gid, char *name,BOOL guest);
564 void add_session_user(char *user);
565 void dfs_unlogin(void);
566 BOOL password_check(char *password);
567 BOOL smb_password_check(char *password, unsigned char *part_passwd, unsigned char *c8);
568 BOOL password_ok(char *user,char *password, int pwlen, struct passwd *pwd);
569 BOOL user_ok(char *user,int snum);
570 BOOL authorise_login(int snum,char *user,char *password, int pwlen,
571 BOOL *guest,BOOL *force,int vuid);
572 BOOL check_hosts_equiv(char *user);
573 BOOL server_cryptkey(char *buf);
574 BOOL server_validate(char *buf);
576 /*The following definitions come from pcap.c */
578 BOOL pcap_printername_ok(char *pszPrintername, char *pszPrintcapname);
579 void pcap_printer_fn(void (*fn)());
581 /*The following definitions come from pipes.c */
583 int reply_open_pipe_and_X(char *inbuf,char *outbuf,int length,int bufsize);
584 BOOL api_LsarpcSNPHS(int cnum,int uid, char *param,char *data,
585 int mdrcnt,int mprcnt,
586 char **rdata,char **rparam,
587 int *rdata_len,int *rparam_len);
588 BOOL api_LsarpcTNP(int cnum,int uid, char *param,char *data,
589 int mdrcnt,int mprcnt,
590 char **rdata,char **rparam,
591 int *rdata_len,int *rparam_len);
593 /*The following definitions come from predict.c */
595 int read_predict(int fd,int offset,char *buf,char **ptr,int num);
596 void do_read_prediction();
597 void invalidate_read_prediction(int fd);
599 /*The following definitions come from printing.c */
601 void lpq_reset(int snum);
602 void print_file(int fnum);
603 int get_printqueue(int snum,int cnum,print_queue_struct **queue,
604 print_status_struct *status);
605 void del_printqueue(int cnum,int snum,int jobid);
606 void status_printjob(int cnum,int snum,int jobid,int status);
608 /*The following definitions come from quotas.c */
610 BOOL disk_quotas(char *path, int *bsize, int *dfree, int *dsize);
611 BOOL disk_quotas(char *path, int *bsize, int *dfree, int *dsize);
612 BOOL disk_quotas(char *path, int *bsize, int *dfree, int *dsize);
613 BOOL disk_quotas(char *path, int *bsize, int *dfree, int *dsize);
615 /*The following definitions come from replace.c */
617 char *Strstr(char *s, char *p);
618 time_t Mktime(struct tm *t);
619 int InNetGr(char *group,char *host,char *user,char *dom);
620 void *malloc_wrapped(int size,char *file,int line);
621 void *realloc_wrapped(void *ptr,int size,char *file,int line);
622 void free_wrapped(void *ptr,char *file,int line);
623 void *memcpy_wrapped(void *d,void *s,int l,char *fname,int line);
625 /*The following definitions come from reply.c */
627 int reply_special(char *inbuf,char *outbuf);
628 int reply_tcon(char *inbuf,char *outbuf);
629 int reply_tcon_and_X(char *inbuf,char *outbuf,int length,int bufsize);
630 int reply_unknown(char *inbuf,char *outbuf);
631 int reply_ioctl(char *inbuf,char *outbuf);
632 int reply_sesssetup_and_X(char *inbuf,char *outbuf,int length,int bufsize);
633 int reply_chkpth(char *inbuf,char *outbuf);
634 int reply_getatr(char *inbuf,char *outbuf);
635 int reply_setatr(char *inbuf,char *outbuf);
636 int reply_dskattr(char *inbuf,char *outbuf);
637 int reply_search(char *inbuf,char *outbuf);
638 int reply_fclose(char *inbuf,char *outbuf);
639 int reply_open(char *inbuf,char *outbuf);
640 int reply_open_and_X(char *inbuf,char *outbuf,int length,int bufsize);
641 int reply_ulogoffX(char *inbuf,char *outbuf,int length,int bufsize);
642 int reply_mknew(char *inbuf,char *outbuf);
643 int reply_ctemp(char *inbuf,char *outbuf);
644 int reply_unlink(char *inbuf,char *outbuf);
645 int reply_readbraw(char *inbuf, char *outbuf);
646 int reply_lockread(char *inbuf,char *outbuf);
647 int reply_read(char *inbuf,char *outbuf);
648 int reply_read_and_X(char *inbuf,char *outbuf,int length,int bufsize);
649 int reply_writebraw(char *inbuf,char *outbuf);
650 int reply_writeunlock(char *inbuf,char *outbuf);
651 int reply_write(char *inbuf,char *outbuf,int dum1,int dum2);
652 int reply_write_and_X(char *inbuf,char *outbuf,int length,int bufsize);
653 int reply_lseek(char *inbuf,char *outbuf);
654 int reply_flush(char *inbuf,char *outbuf);
655 int reply_exit(char *inbuf,char *outbuf);
656 int reply_close(char *inbuf,char *outbuf);
657 int reply_writeclose(char *inbuf,char *outbuf);
658 int reply_lock(char *inbuf,char *outbuf);
659 int reply_unlock(char *inbuf,char *outbuf);
660 int reply_tdis(char *inbuf,char *outbuf);
661 int reply_echo(char *inbuf,char *outbuf);
662 int reply_printopen(char *inbuf,char *outbuf);
663 int reply_printclose(char *inbuf,char *outbuf);
664 int reply_printqueue(char *inbuf,char *outbuf);
665 int reply_printwrite(char *inbuf,char *outbuf);
666 int reply_mkdir(char *inbuf,char *outbuf);
667 int reply_rmdir(char *inbuf,char *outbuf);
668 int reply_mv(char *inbuf,char *outbuf);
669 int reply_copy(char *inbuf,char *outbuf);
670 int reply_setdir(char *inbuf,char *outbuf);
671 int reply_lockingX(char *inbuf,char *outbuf,int length,int bufsize);
672 int reply_readbmpx(char *inbuf,char *outbuf,int length,int bufsize);
673 int reply_writebmpx(char *inbuf,char *outbuf);
674 int reply_writebs(char *inbuf,char *outbuf);
675 int reply_setattrE(char *inbuf,char *outbuf);
676 int reply_getattrE(char *inbuf,char *outbuf);
678 /*The following definitions come from server.c */
680 mode_t unix_mode(int cnum,int dosmode);
681 int dos_mode(int cnum,char *path,struct stat *sbuf);
682 int dos_chmod(int cnum,char *fname,int dosmode,struct stat *st);
683 BOOL unix_convert(char *name,int cnum);
684 int disk_free(char *path,int *bsize,int *dfree,int *dsize);
685 int sys_disk_free(char *path,int *bsize,int *dfree,int *dsize);
686 BOOL check_name(char *name,int cnum);
687 void open_file(int fnum,int cnum,char *fname1,int flags,int mode);
688 void sync_file(int fnum);
689 void close_file(int fnum);
690 BOOL check_file_sharing(int cnum,char *fname);
691 void open_file_shared(int fnum,int cnum,char *fname,int share_mode,int ofun,
692 int mode,int *Access,int *action);
693 int seek_file(int fnum,int pos);
694 int read_file(int fnum,char *data,int pos,int n);
695 int write_file(int fnum,char *data,int n);
696 BOOL become_service(int cnum,BOOL do_chdir);
697 int find_service(char *service);
698 int cached_error_packet(char *inbuf,char *outbuf,int fnum,int line);
699 int unix_error_packet(char *inbuf,char *outbuf,int def_class,uint32 def_code,int line);
700 int error_packet(char *inbuf,char *outbuf,int error_class,uint32 error_code,int line);
701 BOOL snum_used(int snum);
702 BOOL reload_services(BOOL test);
703 int setup_groups(char *user, int uid, int gid, int *p_ngroups,
704 int **p_igroups, gid_t **p_groups);
705 int make_connection(char *service,char *user,char *password, int pwlen, char *dev,int vuid);
706 int find_free_file(void );
707 int reply_corep(char *outbuf);
708 int reply_coreplus(char *outbuf);
709 int reply_lanman1(char *outbuf);
710 int reply_lanman2(char *outbuf);
711 int reply_nt1(char *outbuf);
712 void close_cnum(int cnum, int uid);
713 BOOL yield_connection(int cnum,char *name,int max_connections);
714 BOOL claim_connection(int cnum,char *name,int max_connections,BOOL Clear);
715 void exit_server(char *reason);
716 void standard_sub(int cnum,char *s);
717 char *smb_fn_name(int type);
718 int chain_reply(char *inbuf,char *outbuf,int size,int bufsize);
719 int construct_reply(char *inbuf,char *outbuf,int size,int bufsize);
721 /*The following definitions come from shmem.c */
723 BOOL shm_open( char *file_name, int size);
724 BOOL shm_close( void );
725 shm_offset_t shm_alloc(int size);
726 BOOL shm_free(shm_offset_t offset);
727 shm_offset_t shm_get_userdef_off(void);
728 BOOL shm_set_userdef_off(shm_offset_t userdef_off);
729 void * shm_offset2addr(shm_offset_t offset);
730 shm_offset_t shm_addr2offset(void *addr);
732 BOOL shm_unlock(void);
733 BOOL shm_get_usage(int *bytes_free,
735 int *bytes_overhead);
737 /*The following definitions come from smbencrypt.c */
739 void str_to_key(uchar *str,uchar *key);
740 void D1(uchar *k, uchar *d, uchar *out);
741 void E1(uchar *k, uchar *d, uchar *out);
742 void E_P16(uchar *p14,uchar *p16);
743 void E_P24(uchar *p21, uchar *c8, uchar *p24);
744 void SMBencrypt(uchar *passwd, uchar *c8, uchar *p24);
745 void E_md4hash(uchar *passwd, uchar *p16);
746 void SMBNTencrypt(uchar *passwd, uchar *c8, uchar *p24);
748 /*The following definitions come from smbpass.c */
750 int pw_file_lock(char *name, int type, int secs);
751 int pw_file_unlock(int fd);
752 struct smb_passwd *get_smbpwnam(char *name);
754 /*The following definitions come from smbpasswd.c */
757 /*The following definitions come from smbrun.c */
760 /*The following definitions come from status.c */
762 void Ucrit_addUsername(pstring username);
763 unsigned int Ucrit_checkUsername(pstring username);
764 void Ucrit_addPid(int pid);
765 unsigned int Ucrit_checkPid(int pid);
767 /*The following definitions come from system.c */
769 int sys_select(fd_set *fds,struct timeval *tval);
770 int sys_select(fd_set *fds,struct timeval *tval);
771 int sys_unlink(char *fname);
772 unsigned int sys_random(int max_range);
773 int sys_open(char *fname,int flags,int mode);
774 DIR *sys_opendir(char *dname);
775 int sys_stat(char *fname,struct stat *sbuf);
776 int sys_lstat(char *fname,struct stat *sbuf);
777 int sys_mkdir(char *dname,int mode);
778 int sys_rmdir(char *dname);
779 int sys_chdir(char *dname);
780 int sys_utime(char *fname,struct utimbuf *times);
781 int sys_rename(char *from, char *to);
782 int sys_chmod(char *fname,int mode);
783 int sys_chown(char *fname,int uid,int gid);
784 int sys_chroot(char *dname);
786 /*The following definitions come from testparm.c */
789 /*The following definitions come from testprns.c */
791 int main(int argc, char *argv[]);
793 /*The following definitions come from time.c */
795 void GetTimeOfDay(struct timeval *tval);
797 int TimeDiff(time_t t);
798 struct tm *LocalTime(time_t *t);
799 time_t interpret_long_date(char *p);
800 void put_long_date(char *p,time_t t);
801 void put_dos_date(char *buf,int offset,time_t unixdate);
802 void put_dos_date2(char *buf,int offset,time_t unixdate);
803 void put_dos_date3(char *buf,int offset,time_t unixdate);
804 time_t make_unix_date(void *date_ptr);
805 time_t make_unix_date2(void *date_ptr);
806 time_t make_unix_date3(void *date_ptr);
807 BOOL set_filetime(char *fname,time_t mtime);
808 char *timestring(void );
810 /*The following definitions come from trans2.c */
812 int reply_findclose(char *inbuf,char *outbuf,int length,int bufsize);
813 int reply_findnclose(char *inbuf,char *outbuf,int length,int bufsize);
814 int reply_transs2(char *inbuf,char *outbuf,int length,int bufsize);
815 int reply_trans2(char *inbuf,char *outbuf,int length,int bufsize);
817 /*The following definitions come from ufc.c */
819 char *ufc_crypt(char *key,char *salt);
821 /*The following definitions come from uid.c */
824 BOOL become_guest(void);
825 BOOL become_user(int cnum, int uid);
826 BOOL unbecome_user(void );
827 int smbrun(char *cmd,char *outfile);
829 /*The following definitions come from username.c */
831 char *get_home_dir(char *user);
832 void map_username(char *user);
833 struct passwd *Get_Pwnam(char *user,BOOL allow_change);
834 BOOL user_in_list(char *user,char *list);
836 /*The following definitions come from util.c */
838 void setup_logging(char *pname,BOOL interactive);
839 void reopen_logs(void);
840 BOOL is_a_socket(int fd);
841 BOOL next_token(char **ptr,char *buff,char *sep);
842 char **toktocliplist(int *ctok, char *sep);
843 void *MemMove(void *dest,void *src,int size);
844 void array_promote(char *array,int elsize,int element);
845 void set_socket_options(int fd, char *options);
846 void close_sockets(void );
847 BOOL in_group(gid_t group, int current_gid, int ngroups, int *groups);
848 char *StrCpy(char *dest,char *src);
849 char *StrnCpy(char *dest,char *src,int n);
850 void putip(void *dest,void *src);
851 int name_mangle(char *In,char *Out,char name_type);
852 BOOL file_exist(char *fname,struct stat *sbuf);
853 time_t file_modtime(char *fname);
854 BOOL directory_exist(char *dname,struct stat *st);
855 uint32 file_size(char *file_name);
856 char *attrib_string(int mode);
857 int StrCaseCmp(char *s, char *t);
858 int StrnCaseCmp(char *s, char *t, int n);
859 BOOL strequal(char *s1,char *s2);
860 BOOL strnequal(char *s1,char *s2,int n);
861 BOOL strcsequal(char *s1,char *s2);
862 void strlower(char *s);
863 void strupper(char *s);
864 void strnorm(char *s);
865 BOOL strisnormal(char *s);
866 void string_replace(char *s,char oldc,char newc);
867 void unix_format(char *fname);
868 void dos_format(char *fname);
869 void show_msg(char *buf);
870 int smb_len(char *buf);
871 void _smb_setlen(char *buf,int len);
872 void smb_setlen(char *buf,int len);
873 int set_message(char *buf,int num_words,int num_bytes,BOOL zero);
874 int smb_numwords(char *buf);
875 int smb_buflen(char *buf);
876 int smb_buf_ofs(char *buf);
877 char *smb_buf(char *buf);
878 int smb_offset(char *p,char *buf);
879 char *skip_string(char *buf,int n);
880 BOOL trim_string(char *s,char *front,char *back);
881 void dos_clean_name(char *s);
882 void unix_clean_name(char *s);
883 int ChDir(char *path);
884 char *GetWd(char *str);
885 BOOL reduce_name(char *s,char *dir,BOOL widelinks);
886 void expand_mask(char *Mask,BOOL doext);
887 BOOL strhasupper(char *s);
888 BOOL strhaslower(char *s);
889 int count_chars(char *s,char c);
890 void make_dir_struct(char *buf,char *mask,char *fname,unsigned int size,int mode,time_t date);
891 void close_low_fds(void);
892 int set_blocking(int fd, int set);
893 int write_socket(int fd,char *buf,int len);
894 int read_udp_socket(int fd,char *buf,int len);
895 int read_with_timeout(int fd,char *buf,int mincnt,int maxcnt,long time_out);
896 int read_max_udp(int fd,char *buffer,int bufsize,int maxtime);
897 int TvalDiff(struct timeval *tvalold,struct timeval *tvalnew);
898 BOOL send_keepalive(int client);
899 int read_data(int fd,char *buffer,int N);
900 int write_data(int fd,char *buffer,int N);
901 int transfer_file(int infd,int outfd,int n,char *header,int headlen,int align);
902 int read_smb_length(int fd,char *inbuf,int timeout);
903 BOOL receive_smb(int fd,char *buffer,int timeout);
904 BOOL send_smb(int fd,char *buffer);
905 char *name_ptr(char *buf,int ofs);
906 int name_extract(char *buf,int ofs,char *name);
907 int name_len(char *s);
908 BOOL send_one_packet(char *buf,int len,struct in_addr ip,int port,int type);
910 BOOL in_list(char *s,char *list,BOOL casesensitive);
911 BOOL string_init(char **dest,char *src);
912 void string_free(char **s);
913 BOOL string_set(char **dest,char *src);
914 BOOL string_sub(char *s,char *pattern,char *insert);
915 BOOL do_match(char *str, char *regexp, int case_sig);
916 BOOL mask_match(char *str, char *regexp, int case_sig,BOOL trans2);
917 void become_daemon(void);
919 char *fgets_slash(char *s2,int maxlen,FILE *f);
920 int set_filelen(int fd, long len);
921 int byte_checksum(char *buf,int len);
922 char *dirname_dos(char *path,char *buf);
923 void *Realloc(void *p,int size);
925 BOOL get_myname(char *my_name,struct in_addr *ip);
926 BOOL ip_equal(struct in_addr ip1,struct in_addr ip2);
927 int open_socket_in(int type, int port, int dlevel,uint32 socket_addr);
928 int open_socket_out(int type, struct in_addr *addr, int port ,int timeout);
929 int interpret_protocol(char *str,int def);
930 int interpret_security(char *str,int def);
931 uint32 interpret_addr(char *str);
932 struct in_addr *interpret_addr2(char *str);
933 BOOL zero_ip(struct in_addr ip);
934 void standard_sub_basic(char *s);
935 BOOL same_net(struct in_addr ip1,struct in_addr ip2,struct in_addr mask);
936 int PutUniCode(char *dst,char *src);
937 struct hostent *Get_Hostbyname(char *name);
938 BOOL process_exists(int pid);
939 char *uidtoname(int uid);
940 char *gidtoname(int gid);
941 void BlockSignals(BOOL block,int signum);
942 void ajt_panic(void);
943 char *readdirname(void *p);
945 /*The following definitions come from vt_mode.c */
947 int VT_Check(char *buffer);
948 int VT_Start_utmp(void);
949 int VT_Stop_utmp(void);
950 void VT_AtExit(void);
951 void VT_SigCLD(int sig);
952 void VT_SigEXIT(int sig);
954 int VT_Output(char *Buffer);
955 int VT_Input(char *Buffer,int Size);
956 void VT_Process(void);