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
,char *cname
,char *caddr
);
9 /*The following definitions come from charcnv.c */
11 char *unix2dos_format(char *str
,BOOL overwrite
);
12 char *dos2unix_format(char *str
, BOOL overwrite
);
13 int interpret_character_set(char *str
, int def
);
15 /*The following definitions come from charset.c */
17 void charset_initialise();
18 void codepage_initialise(int client_codepage
);
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 padit(char *buf
, int bufsize
, int padsize
);
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(int cnum
, char *name
, BOOL use_veto
);
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_printcapname(void);
128 char *lp_lockdir(void);
129 char *lp_rootdir(void);
130 char *lp_defaultservice(void);
131 char *lp_msg_command(void);
132 char *lp_dfree_command(void);
133 char *lp_hosts_equiv(void);
134 char *lp_auto_services(void);
135 char *lp_passwd_program(void);
136 char *lp_passwd_chat(void);
137 char *lp_passwordserver(void);
138 char *lp_workgroup(void);
139 char *lp_domain_controller(void);
140 char *lp_username_map(void);
141 char *lp_character_set(void);
142 char *lp_logon_script(void);
143 char *lp_logon_path(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 char *lp_nis_home_map_name(void);
149 char *lp_netbios_aliases(void);
150 BOOL
lp_dns_proxy(void);
151 BOOL
lp_wins_support(void);
152 BOOL
lp_wins_proxy(void);
153 BOOL
lp_local_master(void);
154 BOOL
lp_domain_master(void);
155 BOOL
lp_domain_logons(void);
156 BOOL
lp_preferred_master(void);
157 BOOL
lp_load_printers(void);
158 BOOL
lp_use_rhosts(void);
159 BOOL
lp_getwdcache(void);
160 BOOL
lp_readprediction(void);
161 BOOL
lp_readbmpx(void);
162 BOOL
lp_readraw(void);
163 BOOL
lp_writeraw(void);
164 BOOL
lp_null_passwords(void);
165 BOOL
lp_strip_dot(void);
166 BOOL
lp_encrypted_passwords(void);
167 BOOL
lp_syslog_only(void);
168 BOOL
lp_browse_list(void);
169 BOOL
lp_unix_realname(void);
170 BOOL
lp_nis_home_map(void);
171 BOOL
lp_time_server(void);
172 int lp_os_level(void);
173 int lp_max_ttl(void);
174 int lp_max_log_size(void);
175 int lp_mangledstack(void);
176 int lp_maxxmit(void);
178 int lp_maxpacket(void);
179 int lp_keepalive(void);
180 int lp_passwordlevel(void);
181 int lp_readsize(void);
182 int lp_shmem_size(void);
183 int lp_shmem_hash_size(void);
184 int lp_deadtime(void);
185 int lp_maxprotocol(void);
186 int lp_security(void);
187 int lp_printing(void);
188 int lp_maxdisksize(void);
189 int lp_lpqcachetime(void);
191 int lp_client_code_page(void);
192 char *lp_preexec(int );
193 char *lp_postexec(int );
194 char *lp_rootpreexec(int );
195 char *lp_rootpostexec(int );
196 char *lp_servicename(int );
197 char *lp_pathname(int );
198 char *lp_dontdescend(int );
199 char *lp_username(int );
200 char *lp_guestaccount(int );
201 char *lp_invalid_users(int );
202 char *lp_valid_users(int );
203 char *lp_admin_users(int );
204 char *lp_printcommand(int );
205 char *lp_lpqcommand(int );
206 char *lp_lprmcommand(int );
207 char *lp_lppausecommand(int );
208 char *lp_lpresumecommand(int );
209 char *lp_printername(int );
210 char *lp_printerdriver(int );
211 char *lp_hostsallow(int );
212 char *lp_hostsdeny(int );
213 char *lp_magicscript(int );
214 char *lp_magicoutput(int );
215 char *lp_comment(int );
216 char *lp_force_user(int );
217 char *lp_force_group(int );
218 char *lp_readlist(int );
219 char *lp_writelist(int );
220 char *lp_volume(int );
221 char *lp_mangled_map(int );
222 char *lp_veto_files(int );
223 char *lp_hide_files(int );
224 BOOL
lp_alternate_permissions(int );
225 BOOL
lp_revalidate(int );
226 BOOL
lp_casesensitive(int );
227 BOOL
lp_preservecase(int );
228 BOOL
lp_shortpreservecase(int );
229 BOOL
lp_casemangle(int );
230 BOOL
lp_status(int );
231 BOOL
lp_hide_dot_files(int );
232 BOOL
lp_browseable(int );
233 BOOL
lp_readonly(int );
234 BOOL
lp_no_set_dir(int );
235 BOOL
lp_guest_ok(int );
236 BOOL
lp_guest_only(int );
237 BOOL
lp_print_ok(int );
238 BOOL
lp_postscript(int );
239 BOOL
lp_map_hidden(int );
240 BOOL
lp_map_archive(int );
241 BOOL
lp_locking(int );
242 BOOL
lp_strict_locking(int );
243 BOOL
lp_share_modes(int );
244 BOOL
lp_onlyuser(int );
245 BOOL
lp_manglednames(int );
246 BOOL
lp_widelinks(int );
247 BOOL
lp_symlinks(int );
248 BOOL
lp_syncalways(int );
249 BOOL
lp_map_system(int );
250 BOOL
lp_delete_readonly(int );
251 BOOL
lp_fake_oplocks(int );
252 int lp_create_mode(int );
253 int lp_force_create_mode(int );
254 int lp_dir_mode(int );
255 int lp_force_dir_mode(int );
256 int lp_max_connections(int );
257 int lp_defaultcase(int );
258 int lp_minprintspace(int );
259 char lp_magicchar(int );
260 BOOL
lp_add_home(char *pszHomename
, int iDefaultService
, char *pszHomedir
);
261 int lp_add_service(char *pszService
, int iDefaultService
);
262 BOOL
lp_add_printer(char *pszPrintername
, int iDefaultService
);
263 BOOL
lp_file_list_changed(void);
264 BOOL
lp_snum_ok(int iService
);
265 BOOL
lp_loaded(void);
266 void lp_killunused(BOOL (*snumused
)(int ));
267 BOOL
lp_load(char *pszFname
,BOOL global_only
);
268 int lp_numservices(void);
270 int lp_servicenumber(char *pszServiceName
);
271 int lp_default_server_announce(void);
272 int lp_major_announce_version(void);
273 int lp_minor_announce_version(void);
274 char *volume_label(int snum
);
276 /*The following definitions come from locking.c */
278 BOOL
is_locked(int fnum
,int cnum
,uint32 count
,uint32 offset
);
279 BOOL
do_lock(int fnum
,int cnum
,uint32 count
,uint32 offset
,int *eclass
,uint32
*ecode
);
280 BOOL
do_unlock(int fnum
,int cnum
,uint32 count
,uint32 offset
,int *eclass
,uint32
*ecode
);
281 BOOL
start_share_mode_mgmt(void);
282 BOOL
stop_share_mode_mgmt(void);
283 BOOL
lock_share_entry(int cnum
, uint32 dev
, uint32 inode
, share_lock_token
*ptok
);
284 BOOL
unlock_share_entry(int cnum
, uint32 dev
, uint32 inode
, share_lock_token token
);
285 int get_share_modes(int cnum
, share_lock_token token
, uint32 dev
, uint32 inode
,
286 min_share_mode_entry
**old_shares
);
287 void del_share_mode(share_lock_token token
, int fnum
);
288 BOOL
set_share_mode(share_lock_token token
, int fnum
);
289 BOOL
lock_share_entry(int cnum
, uint32 dev
, uint32 inode
, share_lock_token
*ptok
);
290 BOOL
unlock_share_entry(int cnum
, uint32 dev
, uint32 inode
, share_lock_token token
);
291 int get_share_modes(int cnum
, share_lock_token token
, uint32 dev
, uint32 inode
,
292 min_share_mode_entry
**old_shares
);
293 void del_share_mode(share_lock_token token
, int fnum
);
294 BOOL
set_share_mode(share_lock_token token
,int fnum
);
296 /*The following definitions come from mangle.c */
298 int str_checksum(char *s
);
299 BOOL
is_8_3(char *fname
, BOOL check_case
);
300 void create_mangled_stack(int size
);
301 BOOL
check_mangled_stack(char *s
);
302 BOOL
is_mangled(char *s
);
303 void mangle_name_83(char *s
);
304 BOOL
name_map_mangle(char *OutName
,BOOL need83
,int snum
);
306 /*The following definitions come from md4.c */
309 /*The following definitions come from message.c */
311 int reply_sends(char *inbuf
,char *outbuf
);
312 int reply_sendstrt(char *inbuf
,char *outbuf
);
313 int reply_sendtxt(char *inbuf
,char *outbuf
);
314 int reply_sendend(char *inbuf
,char *outbuf
);
316 /*The following definitions come from nameannounce.c */
318 void announce_request(struct work_record
*work
, struct in_addr ip
);
319 void do_announce_request(char *info
, char *to_name
, int announce_type
,
321 int to
, struct in_addr dest_ip
);
322 void sync_server(enum state_type state
, char *serv_name
, char *work_name
,
324 struct subnet_record
*d
,
326 void do_announce_host(int command
,
327 char *from_name
, int from_type
, struct in_addr from_ip
,
328 char *to_name
, int to_type
, struct in_addr to_ip
,
329 time_t announce_interval
,
330 char *server_name
, int server_type
, char *server_comment
);
331 void announce_my_servers_removed(void);
332 void announce_server(struct subnet_record
*d
, struct work_record
*work
,
333 char *name
, char *comment
, time_t ttl
, int server_type
);
334 void announce_host(time_t t
);
335 void reset_announce_timer();
336 void announce_master(time_t t
);
337 void announce_remote(time_t t
);
339 /*The following definitions come from namebrowse.c */
341 void expire_browse_cache(time_t t
);
342 struct browse_cache_record
*add_browser_entry(char *name
, int type
, char *wg
,
343 time_t ttl
, struct subnet_record
*d
,
344 struct in_addr ip
, BOOL local
);
345 void do_browser_lists(time_t t
);
347 /*The following definitions come from nameconf.c */
349 int get_num_workgroups(void);
350 int conf_workgroup_name_to_token(char *workgroup_name
,char *default_name
);
351 char *conf_workgroup_name(int token
);
352 int conf_should_workgroup_member(int token
);
353 int conf_should_local_master(int token
);
354 int conf_should_domain_master(int token
);
355 char *conf_browsing_alias(int token
);
356 char *conf_browsing_alias_comment(int token
);
357 char *conf_alias_to_workgroup(char *alias
);
358 int conf_alias_to_token(char *alias
);
359 void read_smbbrowse_conf(char *default_name
);
361 /*The following definitions come from namedbname.c */
363 void set_samba_nb_type(void);
364 BOOL
name_equal(struct nmb_name
*n1
,struct nmb_name
*n2
);
365 BOOL
ms_browser_name(char *name
, int type
);
366 void remove_name(struct subnet_record
*d
, struct name_record
*n
);
367 struct name_record
*find_name(struct name_record
*n
,
368 struct nmb_name
*name
, int search
);
369 struct name_record
*find_name_search(struct subnet_record
**d
,
370 struct nmb_name
*name
,
371 int search
, struct in_addr ip
);
372 void dump_names(void);
373 void load_netbios_names(void);
374 void remove_netbios_name(struct subnet_record
*d
,
375 char *name
,int type
, enum name_source source
,
377 struct name_record
*add_netbios_entry(struct subnet_record
*d
,
378 char *name
, int type
, int nb_flags
,
379 int ttl
, enum name_source source
, struct in_addr ip
,
380 BOOL new_only
,BOOL wins
);
381 void expire_names(time_t t
);
382 struct name_record
*dns_name_search(struct nmb_name
*question
, int Time
);
384 /*The following definitions come from namedbresp.c */
386 void add_response_record(struct subnet_record
*d
,
387 struct response_record
*n
);
388 void remove_response_record(struct subnet_record
*d
,
389 struct response_record
*n
);
390 struct response_record
*make_response_queue_record(enum state_type state
,
392 int quest_type
, char *name
,int type
, int nb_flags
, time_t ttl
,
393 int server_type
, char *my_name
, char *my_comment
,
394 BOOL bcast
,BOOL recurse
,
395 struct in_addr send_ip
, struct in_addr reply_to_ip
);
396 struct response_record
*find_response_record(struct subnet_record
**d
,
399 /*The following definitions come from namedbserver.c */
401 void remove_old_servers(struct work_record
*work
, time_t t
,
403 struct server_record
*find_server(struct work_record
*work
, char *name
);
404 struct server_record
*add_server_entry(struct subnet_record
*d
,
405 struct work_record
*work
,
406 char *name
,int servertype
,
407 int ttl
,char *comment
,
409 void expire_servers(time_t t
);
411 /*The following definitions come from namedbsubnet.c */
413 struct subnet_record
*find_subnet(struct in_addr bcast_ip
);
414 struct subnet_record
*find_req_subnet(struct in_addr ip
, BOOL bcast
);
415 struct subnet_record
*find_subnet_all(struct in_addr bcast_ip
);
416 void add_workgroup_to_subnet( struct subnet_record
*d
, char *group
);
417 void add_my_subnets(char *group
);
418 void write_browse_list(time_t t
);
420 /*The following definitions come from namedbwork.c */
422 struct work_record
*remove_workgroup(struct subnet_record
*d
,
423 struct work_record
*work
,
424 BOOL remove_all_servers
);
425 struct work_record
*find_workgroupstruct(struct subnet_record
*d
,
426 fstring name
, BOOL add
);
427 void dump_workgroups(void);
429 /*The following definitions come from nameelect.c */
431 void check_master_browser(time_t t
);
432 void browser_gone(char *work_name
, struct in_addr ip
);
433 void send_election(struct subnet_record
*d
, char *group
,uint32 criterion
,
434 int timeup
,char *name
);
435 void name_unregister_work(struct subnet_record
*d
, char *name
, int name_type
);
436 void name_register_work(struct subnet_record
*d
, char *name
, int name_type
,
437 int nb_flags
, time_t ttl
, struct in_addr ip
, BOOL bcast
);
438 void become_local_master(struct subnet_record
*d
, struct work_record
*work
);
439 void become_domain_master(struct subnet_record
*d
, struct work_record
*work
);
440 void become_logon_server(struct subnet_record
*d
, struct work_record
*work
);
441 void unbecome_local_master(struct subnet_record
*d
, struct work_record
*work
,
443 void unbecome_domain_master(struct subnet_record
*d
, struct work_record
*work
,
445 void unbecome_logon_server(struct subnet_record
*d
, struct work_record
*work
,
447 void run_elections(time_t t
);
448 void process_election(struct packet_struct
*p
,char *buf
);
449 BOOL
check_elections(void);
451 /*The following definitions come from namelogon.c */
453 void process_logon_packet(struct packet_struct
*p
,char *buf
,int len
);
455 /*The following definitions come from namepacket.c */
457 void debug_browse_data(char *outbuf
, int len
);
458 void initiate_netbios_packet(uint16
*id
,
459 int fd
,int quest_type
,char *name
,int name_type
,
460 int nb_flags
,BOOL bcast
,BOOL recurse
,
461 struct in_addr to_ip
);
462 void reply_netbios_packet(struct packet_struct
*p1
,int trn_id
,
463 int rcode
, int rcv_code
, int opcode
, BOOL recurse
,
464 struct nmb_name
*rr_name
,int rr_type
,int rr_class
,int ttl
,
466 void queue_packet(struct packet_struct
*packet
);
467 void run_packet_queue();
468 void listen_for_packets(BOOL run_election
);
469 BOOL
send_mailslot_reply(BOOL unique
, char *mailslot
,int fd
,char *buf
,int len
,char *srcname
,
470 char *dstname
,int src_type
,int dest_type
,
471 struct in_addr dest_ip
,struct in_addr src_ip
);
473 /*The following definitions come from namequery.c */
475 BOOL
name_status(int fd
,char *name
,int name_type
,BOOL recurse
,
476 struct in_addr to_ip
,char *master
,char *rname
,
478 BOOL
name_query(int fd
,char *name
,int name_type
,
479 BOOL bcast
,BOOL recurse
,
480 struct in_addr to_ip
, struct in_addr
*ip
,void (*fn
)());
482 /*The following definitions come from nameresp.c */
484 void expire_netbios_response_entries(time_t t
);
485 struct response_record
*queue_netbios_pkt_wins(
486 int fd
,int quest_type
,enum state_type state
,
487 char *name
,int name_type
,int nb_flags
, time_t ttl
,
488 int server_type
, char *my_name
, char *my_comment
,
489 BOOL bcast
,BOOL recurse
,
490 struct in_addr send_ip
, struct in_addr reply_to_ip
);
491 struct response_record
*queue_netbios_packet(struct subnet_record
*d
,
492 int fd
,int quest_type
,enum state_type state
,char *name
,
493 int name_type
,int nb_flags
, time_t ttl
,
494 int server_type
, char *my_name
, char *my_comment
,
495 BOOL bcast
,BOOL recurse
,
496 struct in_addr send_ip
, struct in_addr reply_to_ip
);
498 /*The following definitions come from nameserv.c */
500 void remove_name_entry(struct subnet_record
*d
, char *name
,int type
);
501 void add_my_name_entry(struct subnet_record
*d
,char *name
,int type
,int nb_flags
);
502 void add_domain_logon_names(void);
503 void add_domain_master_bcast(void);
504 void add_domain_master_wins(void);
505 void add_domain_names(time_t t
);
506 void add_my_names(void);
507 void remove_my_names();
508 void refresh_my_names(time_t t
);
509 void query_refresh_names(time_t t
);
511 /*The following definitions come from nameservreply.c */
513 void add_name_respond(struct subnet_record
*d
, int fd
, struct in_addr from_ip
,
515 struct nmb_name
*name
,
516 int nb_flags
, int ttl
, struct in_addr register_ip
,
517 BOOL new_owner
, struct in_addr reply_to_ip
);
518 void reply_name_release(struct packet_struct
*p
);
519 void reply_name_reg(struct packet_struct
*p
);
520 void reply_name_status(struct packet_struct
*p
);
521 void reply_name_query(struct packet_struct
*p
);
523 /*The following definitions come from nameservresp.c */
525 void debug_state_type(int state
);
526 void response_netbios_packet(struct packet_struct
*p
);
528 /*The following definitions come from namework.c */
530 void reset_server(char *name
, int state
, struct in_addr ip
);
531 void tell_become_backup(void);
532 BOOL
same_context(struct dgram_packet
*dgram
);
533 void process_browse_packet(struct packet_struct
*p
,char *buf
,int len
);
535 /*The following definitions come from nmbd.c */
537 BOOL
reload_services(BOOL test
);
539 /*The following definitions come from nmblib.c */
541 void debug_nmb_packet(struct packet_struct
*p
);
542 char *namestr(struct nmb_name
*n
);
543 void free_nmb_packet(struct nmb_packet
*nmb
);
544 void free_packet(struct packet_struct
*packet
);
545 struct packet_struct
*read_packet(int fd
,enum packet_type packet_type
);
546 void make_nmb_name(struct nmb_name
*n
,char *name
,int type
,char *this_scope
);
547 BOOL
send_packet(struct packet_struct
*p
);
548 struct packet_struct
*receive_packet(int fd
,enum packet_type type
,int t
);
550 /*The following definitions come from nmblookup.c */
552 int main(int argc
,char *argv
[]);
554 /*The following definitions come from nmbsync.c */
556 char *getsmbpass(char *pass
);
557 void sync_browse_lists(struct subnet_record
*d
, struct work_record
*work
,
558 char *name
, int nm_type
, struct in_addr ip
, BOOL local
);
560 /*The following definitions come from params.c */
562 BOOL
pm_process(char *pszFileName
,BOOL (*sfunc
)(char *),BOOL (*pfunc
)(char *,char *));
564 /*The following definitions come from password.c */
566 void generate_next_challenge(char *challenge
);
567 BOOL
set_challenge(char *challenge
);
568 BOOL
last_challenge(char *challenge
);
569 user_struct
*get_valid_user_struct(uint16 vuid
);
570 void invalidate_vuid(uint16 vuid
);
571 char *validated_username(uint16 vuid
);
572 uint16
register_vuid(int uid
,int gid
, char *name
,BOOL guest
);
573 void add_session_user(char *user
);
574 void dfs_unlogin(void);
575 BOOL
password_check(char *password
);
576 BOOL
smb_password_check(char *password
, unsigned char *part_passwd
, unsigned char *c8
);
577 BOOL
password_ok(char *user
,char *password
, int pwlen
, struct passwd
*pwd
);
578 BOOL
user_ok(char *user
,int snum
);
579 BOOL
authorise_login(int snum
,char *user
,char *password
, int pwlen
,
580 BOOL
*guest
,BOOL
*force
,uint16 vuid
);
581 BOOL
check_hosts_equiv(char *user
);
582 BOOL
server_cryptkey(char *buf
);
583 BOOL
server_validate(char *buf
);
585 /*The following definitions come from pcap.c */
587 BOOL
pcap_printername_ok(char *pszPrintername
, char *pszPrintcapname
);
588 void pcap_printer_fn(void (*fn
)());
590 /*The following definitions come from pipes.c */
592 int reply_open_pipe_and_X(char *inbuf
,char *outbuf
,int length
,int bufsize
);
593 BOOL
api_LsarpcSNPHS(int cnum
,int uid
, char *param
,char *data
,
594 int mdrcnt
,int mprcnt
,
595 char **rdata
,char **rparam
,
596 int *rdata_len
,int *rparam_len
);
597 BOOL
api_LsarpcTNP(int cnum
,int uid
, char *param
,char *data
,
598 int mdrcnt
,int mprcnt
,
599 char **rdata
,char **rparam
,
600 int *rdata_len
,int *rparam_len
);
602 /*The following definitions come from predict.c */
604 int read_predict(int fd
,int offset
,char *buf
,char **ptr
,int num
);
605 void do_read_prediction();
606 void invalidate_read_prediction(int fd
);
608 /*The following definitions come from printing.c */
610 void lpq_reset(int snum
);
611 void print_file(int fnum
);
612 int get_printqueue(int snum
,int cnum
,print_queue_struct
**queue
,
613 print_status_struct
*status
);
614 void del_printqueue(int cnum
,int snum
,int jobid
);
615 void status_printjob(int cnum
,int snum
,int jobid
,int status
);
617 /*The following definitions come from quotas.c */
619 BOOL
disk_quotas(char *path
, int *bsize
, int *dfree
, int *dsize
);
620 BOOL
disk_quotas(char *path
, int *bsize
, int *dfree
, int *dsize
);
621 BOOL
disk_quotas(char *path
, int *bsize
, int *dfree
, int *dsize
);
622 BOOL
disk_quotas(char *path
, int *bsize
, int *dfree
, int *dsize
);
624 /*The following definitions come from replace.c */
626 char *Strstr(char *s
, char *p
);
627 time_t Mktime(struct tm
*t
);
628 int InNetGr(char *group
,char *host
,char *user
,char *dom
);
629 void *malloc_wrapped(int size
,char *file
,int line
);
630 void *realloc_wrapped(void *ptr
,int size
,char *file
,int line
);
631 void free_wrapped(void *ptr
,char *file
,int line
);
632 void *memcpy_wrapped(void *d
,void *s
,int l
,char *fname
,int line
);
634 /*The following definitions come from reply.c */
636 int reply_special(char *inbuf
,char *outbuf
);
637 int reply_tcon(char *inbuf
,char *outbuf
);
638 int reply_tcon_and_X(char *inbuf
,char *outbuf
,int length
,int bufsize
);
639 int reply_unknown(char *inbuf
,char *outbuf
);
640 int reply_ioctl(char *inbuf
,char *outbuf
);
641 int reply_sesssetup_and_X(char *inbuf
,char *outbuf
,int length
,int bufsize
);
642 int reply_chkpth(char *inbuf
,char *outbuf
);
643 int reply_getatr(char *inbuf
,char *outbuf
);
644 int reply_setatr(char *inbuf
,char *outbuf
);
645 int reply_dskattr(char *inbuf
,char *outbuf
);
646 int reply_search(char *inbuf
,char *outbuf
);
647 int reply_fclose(char *inbuf
,char *outbuf
);
648 int reply_open(char *inbuf
,char *outbuf
);
649 int reply_open_and_X(char *inbuf
,char *outbuf
,int length
,int bufsize
);
650 int reply_ulogoffX(char *inbuf
,char *outbuf
,int length
,int bufsize
);
651 int reply_mknew(char *inbuf
,char *outbuf
);
652 int reply_ctemp(char *inbuf
,char *outbuf
);
653 int reply_unlink(char *inbuf
,char *outbuf
);
654 int reply_readbraw(char *inbuf
, char *outbuf
);
655 int reply_lockread(char *inbuf
,char *outbuf
);
656 int reply_read(char *inbuf
,char *outbuf
);
657 int reply_read_and_X(char *inbuf
,char *outbuf
,int length
,int bufsize
);
658 int reply_writebraw(char *inbuf
,char *outbuf
);
659 int reply_writeunlock(char *inbuf
,char *outbuf
);
660 int reply_write(char *inbuf
,char *outbuf
,int dum1
,int dum2
);
661 int reply_write_and_X(char *inbuf
,char *outbuf
,int length
,int bufsize
);
662 int reply_lseek(char *inbuf
,char *outbuf
);
663 int reply_flush(char *inbuf
,char *outbuf
);
664 int reply_exit(char *inbuf
,char *outbuf
);
665 int reply_close(char *inbuf
,char *outbuf
);
666 int reply_writeclose(char *inbuf
,char *outbuf
);
667 int reply_lock(char *inbuf
,char *outbuf
);
668 int reply_unlock(char *inbuf
,char *outbuf
);
669 int reply_tdis(char *inbuf
,char *outbuf
);
670 int reply_echo(char *inbuf
,char *outbuf
);
671 int reply_printopen(char *inbuf
,char *outbuf
);
672 int reply_printclose(char *inbuf
,char *outbuf
);
673 int reply_printqueue(char *inbuf
,char *outbuf
);
674 int reply_printwrite(char *inbuf
,char *outbuf
);
675 int reply_mkdir(char *inbuf
,char *outbuf
);
676 int reply_rmdir(char *inbuf
,char *outbuf
);
677 int reply_mv(char *inbuf
,char *outbuf
);
678 int reply_copy(char *inbuf
,char *outbuf
);
679 int reply_setdir(char *inbuf
,char *outbuf
);
680 int reply_lockingX(char *inbuf
,char *outbuf
,int length
,int bufsize
);
681 int reply_readbmpx(char *inbuf
,char *outbuf
,int length
,int bufsize
);
682 int reply_writebmpx(char *inbuf
,char *outbuf
);
683 int reply_writebs(char *inbuf
,char *outbuf
);
684 int reply_setattrE(char *inbuf
,char *outbuf
);
685 int reply_getattrE(char *inbuf
,char *outbuf
);
687 /*The following definitions come from server.c */
689 void *dflt_sig(void);
691 mode_t
unix_mode(int cnum
,int dosmode
);
692 int dos_mode(int cnum
,char *path
,struct stat
*sbuf
);
693 int dos_chmod(int cnum
,char *fname
,int dosmode
,struct stat
*st
);
694 BOOL
unix_convert(char *name
,int cnum
,pstring saved_last_component
, BOOL
*bad_path
);
695 int disk_free(char *path
,int *bsize
,int *dfree
,int *dsize
);
696 int sys_disk_free(char *path
,int *bsize
,int *dfree
,int *dsize
);
697 BOOL
check_name(char *name
,int cnum
);
698 int fd_attempt_open(char *fname
, int flags
, int mode
);
699 void fd_attempt_reopen(char *fname
, int mode
, file_fd_struct
*fd_ptr
);
700 int fd_attempt_close(file_fd_struct
*fd_ptr
);
701 void sync_file(int fnum
);
702 void close_file(int fnum
);
703 BOOL
check_file_sharing(int cnum
,char *fname
);
704 void open_file_shared(int fnum
,int cnum
,char *fname
,int share_mode
,int ofun
,
705 int mode
,int *Access
,int *action
);
706 int seek_file(int fnum
,uint32 pos
);
707 int read_file(int fnum
,char *data
,uint32 pos
,int n
);
708 int write_file(int fnum
,char *data
,int n
);
709 BOOL
become_service(int cnum
,BOOL do_chdir
);
710 int find_service(char *service
);
711 int cached_error_packet(char *inbuf
,char *outbuf
,int fnum
,int line
);
712 int unix_error_packet(char *inbuf
,char *outbuf
,int def_class
,uint32 def_code
,int line
);
713 int error_packet(char *inbuf
,char *outbuf
,int error_class
,uint32 error_code
,int line
);
714 BOOL
snum_used(int snum
);
715 BOOL
reload_services(BOOL test
);
716 int setup_groups(char *user
, int uid
, int gid
, int *p_ngroups
,
717 int **p_igroups
, gid_t
**p_groups
);
718 int make_connection(char *service
,char *user
,char *password
, int pwlen
, char *dev
,uint16 vuid
);
719 int find_free_file(void );
720 int reply_corep(char *outbuf
);
721 int reply_coreplus(char *outbuf
);
722 int reply_lanman1(char *outbuf
);
723 int reply_lanman2(char *outbuf
);
724 int reply_nt1(char *outbuf
);
725 void close_cnum(int cnum
, uint16 vuid
);
726 BOOL
yield_connection(int cnum
,char *name
,int max_connections
);
727 BOOL
claim_connection(int cnum
,char *name
,int max_connections
,BOOL Clear
);
728 void exit_server(char *reason
);
729 void standard_sub(int cnum
,char *string
);
730 char *smb_fn_name(int type
);
731 int chain_reply(char *inbuf
,char *outbuf
,int size
,int bufsize
);
732 int construct_reply(char *inbuf
,char *outbuf
,int size
,int bufsize
);
734 /*The following definitions come from shmem.c */
736 smb_shm_offset_t
smb_shm_alloc(int size
);
737 smb_shm_offset_t
smb_shm_addr2offset(void *addr
);
738 smb_shm_offset_t
smb_shm_get_userdef_off(void);
739 BOOL
smb_shm_create_hash_table( unsigned int size
);
740 BOOL
smb_shm_open( char *file_name
, int size
);
741 BOOL
smb_shm_close( void );
742 BOOL
smb_shm_free(smb_shm_offset_t offset
);
743 BOOL
smb_shm_set_userdef_off(smb_shm_offset_t userdef_off
);
744 void * smb_shm_offset2addr(smb_shm_offset_t offset
);
745 BOOL
smb_shm_lock_hash_entry( unsigned int entry
);
746 BOOL
smb_shm_unlock_hash_entry( unsigned int entry
);
747 BOOL
smb_shm_get_usage(int *bytes_free
,
749 int *bytes_overhead
);
751 /*The following definitions come from smbencrypt.c */
753 void str_to_key(uchar
*str
,uchar
*key
);
754 void D1(uchar
*k
, uchar
*d
, uchar
*out
);
755 void E1(uchar
*k
, uchar
*d
, uchar
*out
);
756 void E_P16(uchar
*p14
,uchar
*p16
);
757 void E_P24(uchar
*p21
, uchar
*c8
, uchar
*p24
);
758 void SMBencrypt(uchar
*passwd
, uchar
*c8
, uchar
*p24
);
759 void E_md4hash(uchar
*passwd
, uchar
*p16
);
760 void SMBNTencrypt(uchar
*passwd
, uchar
*c8
, uchar
*p24
);
762 /*The following definitions come from smbpass.c */
764 int pw_file_lock(char *name
, int type
, int secs
);
765 int pw_file_unlock(int fd
);
766 struct smb_passwd
*get_smbpwnam(char *name
);
768 /*The following definitions come from smbpasswd.c */
771 /*The following definitions come from smbrun.c */
774 /*The following definitions come from status.c */
776 void Ucrit_addUsername(pstring username
);
777 unsigned int Ucrit_checkUsername(pstring username
);
778 void Ucrit_addPid(int pid
);
779 unsigned int Ucrit_checkPid(int pid
);
781 /*The following definitions come from system.c */
783 int sys_select(fd_set
*fds
,struct timeval
*tval
);
784 int sys_select(fd_set
*fds
,struct timeval
*tval
);
785 int sys_unlink(char *fname
);
786 int sys_open(char *fname
,int flags
,int mode
);
787 DIR *sys_opendir(char *dname
);
788 int sys_stat(char *fname
,struct stat
*sbuf
);
789 int sys_waitpid(pid_t pid
,int *status
,int options
);
790 int sys_lstat(char *fname
,struct stat
*sbuf
);
791 int sys_mkdir(char *dname
,int mode
);
792 int sys_rmdir(char *dname
);
793 int sys_chdir(char *dname
);
794 int sys_utime(char *fname
,struct utimbuf
*times
);
795 int sys_rename(char *from
, char *to
);
796 int sys_chmod(char *fname
,int mode
);
797 int sys_chown(char *fname
,int uid
,int gid
);
798 int sys_chroot(char *dname
);
799 struct hostent
*sys_gethostbyname(char *name
);
801 /*The following definitions come from testparm.c */
804 /*The following definitions come from testprns.c */
806 int main(int argc
, char *argv
[]);
808 /*The following definitions come from time.c */
810 void GetTimeOfDay(struct timeval
*tval
);
812 int TimeDiff(time_t t
);
813 struct tm
*LocalTime(time_t *t
);
814 time_t interpret_long_date(char *p
);
815 void put_long_date(char *p
,time_t t
);
816 void put_dos_date(char *buf
,int offset
,time_t unixdate
);
817 void put_dos_date2(char *buf
,int offset
,time_t unixdate
);
818 void put_dos_date3(char *buf
,int offset
,time_t unixdate
);
819 time_t make_unix_date(void *date_ptr
);
820 time_t make_unix_date2(void *date_ptr
);
821 time_t make_unix_date3(void *date_ptr
);
822 BOOL
set_filetime(char *fname
,time_t mtime
);
823 char *timestring(void );
825 /*The following definitions come from trans2.c */
827 int reply_findclose(char *inbuf
,char *outbuf
,int length
,int bufsize
);
828 int reply_findnclose(char *inbuf
,char *outbuf
,int length
,int bufsize
);
829 int reply_transs2(char *inbuf
,char *outbuf
,int length
,int bufsize
);
830 int reply_trans2(char *inbuf
,char *outbuf
,int length
,int bufsize
);
832 /*The following definitions come from ufc.c */
834 char *ufc_crypt(char *key
,char *salt
);
836 /*The following definitions come from uid.c */
839 BOOL
become_guest(void);
840 BOOL
become_user(int cnum
, uint16 vuid
);
841 BOOL
unbecome_user(void );
842 int smbrun(char *cmd
,char *outfile
,BOOL shared
);
844 /*The following definitions come from username.c */
846 char *get_home_dir(char *user
);
847 void map_username(char *user
);
848 struct passwd
*Get_Pwnam(char *user
,BOOL allow_change
);
849 BOOL
user_in_list(char *user
,char *list
);
851 /*The following definitions come from util.c */
853 void setup_logging(char *pname
,BOOL interactive
);
854 void reopen_logs(void);
856 BOOL
is_a_socket(int fd
);
857 BOOL
next_token(char **ptr
,char *buff
,char *sep
);
858 char **toktocliplist(int *ctok
, char *sep
);
859 void *MemMove(void *dest
,void *src
,int size
);
860 void array_promote(char *array
,int elsize
,int element
);
861 void set_socket_options(int fd
, char *options
);
862 void close_sockets(void );
863 BOOL
in_group(gid_t group
, int current_gid
, int ngroups
, int *groups
);
864 char *StrCpy(char *dest
,char *src
);
865 char *StrnCpy(char *dest
,char *src
,int n
);
866 void putip(void *dest
,void *src
);
867 int name_mangle(char *In
,char *Out
,char name_type
);
868 BOOL
file_exist(char *fname
,struct stat
*sbuf
);
869 time_t file_modtime(char *fname
);
870 BOOL
directory_exist(char *dname
,struct stat
*st
);
871 uint32
file_size(char *file_name
);
872 char *attrib_string(int mode
);
873 int StrCaseCmp(const char *s
, const char *t
);
874 int StrnCaseCmp(const char *s
, const char *t
, int n
);
875 BOOL
strequal(const char *s1
,const char *s2
);
876 BOOL
strnequal(const char *s1
,const char *s2
,int n
);
877 BOOL
strcsequal(char *s1
,char *s2
);
878 void strlower(char *s
);
879 void strupper(char *s
);
880 void strnorm(char *s
);
881 BOOL
strisnormal(char *s
);
882 void string_replace(char *s
,char oldc
,char newc
);
883 void unix_format(char *fname
);
884 void dos_format(char *fname
);
885 void show_msg(char *buf
);
886 int smb_len(char *buf
);
887 void _smb_setlen(char *buf
,int len
);
888 void smb_setlen(char *buf
,int len
);
889 int set_message(char *buf
,int num_words
,int num_bytes
,BOOL zero
);
890 int smb_numwords(char *buf
);
891 int smb_buflen(char *buf
);
892 int smb_buf_ofs(char *buf
);
893 char *smb_buf(char *buf
);
894 int smb_offset(char *p
,char *buf
);
895 char *skip_string(char *buf
,int n
);
896 BOOL
trim_string(char *s
,char *front
,char *back
);
897 void dos_clean_name(char *s
);
898 void unix_clean_name(char *s
);
899 int ChDir(char *path
);
900 char *GetWd(char *str
);
901 BOOL
reduce_name(char *s
,char *dir
,BOOL widelinks
);
902 void expand_mask(char *Mask
,BOOL doext
);
903 BOOL
strhasupper(char *s
);
904 BOOL
strhaslower(char *s
);
905 int count_chars(char *s
,char c
);
906 void make_dir_struct(char *buf
,char *mask
,char *fname
,unsigned int size
,int mode
,time_t date
);
907 void close_low_fds(void);
908 int set_blocking(int fd
, BOOL set
);
909 int write_socket(int fd
,char *buf
,int len
);
910 int read_udp_socket(int fd
,char *buf
,int len
);
911 int read_with_timeout(int fd
,char *buf
,int mincnt
,int maxcnt
,long time_out
);
912 int read_max_udp(int fd
,char *buffer
,int bufsize
,int maxtime
);
913 int TvalDiff(struct timeval
*tvalold
,struct timeval
*tvalnew
);
914 BOOL
send_keepalive(int client
);
915 int read_data(int fd
,char *buffer
,int N
);
916 int write_data(int fd
,char *buffer
,int N
);
917 int transfer_file(int infd
,int outfd
,int n
,char *header
,int headlen
,int align
);
918 int read_smb_length(int fd
,char *inbuf
,int timeout
);
919 BOOL
receive_smb(int fd
,char *buffer
,int timeout
);
920 BOOL
send_smb(int fd
,char *buffer
);
921 char *name_ptr(char *buf
,int ofs
);
922 int name_extract(char *buf
,int ofs
,char *name
);
923 int name_len(char *s
);
924 BOOL
send_one_packet(char *buf
,int len
,struct in_addr ip
,int port
,int type
);
926 BOOL
in_list(char *s
,char *list
,BOOL casesensitive
);
927 BOOL
string_init(char **dest
,char *src
);
928 void string_free(char **s
);
929 BOOL
string_set(char **dest
,char *src
);
930 BOOL
string_sub(char *s
,char *pattern
,char *insert
);
931 BOOL
do_match(char *str
, char *regexp
, int case_sig
);
932 BOOL
mask_match(char *str
, char *regexp
, int case_sig
,BOOL trans2
);
933 void become_daemon(void);
935 char *fgets_slash(char *s2
,int maxlen
,FILE *f
);
936 int set_filelen(int fd
, long len
);
937 int byte_checksum(char *buf
,int len
);
938 char *dirname_dos(char *path
,char *buf
);
939 void *Realloc(void *p
,int size
);
941 BOOL
get_myname(char *my_name
,struct in_addr
*ip
);
942 BOOL
ip_equal(struct in_addr ip1
,struct in_addr ip2
);
943 int open_socket_in(int type
, int port
, int dlevel
,uint32 socket_addr
);
944 int open_socket_out(int type
, struct in_addr
*addr
, int port
,int timeout
);
945 int interpret_protocol(char *str
,int def
);
946 int interpret_security(char *str
,int def
);
947 uint32
interpret_addr(char *str
);
948 struct in_addr
*interpret_addr2(char *str
);
949 BOOL
zero_ip(struct in_addr ip
);
950 void reset_globals_after_fork();
951 char *client_name(void);
952 char *client_addr(void);
953 void standard_sub_basic(char *string
);
954 BOOL
same_net(struct in_addr ip1
,struct in_addr ip2
,struct in_addr mask
);
955 int PutUniCode(char *dst
,char *src
);
956 struct hostent
*Get_Hostbyname(char *name
);
957 BOOL
process_exists(int pid
);
958 char *uidtoname(int uid
);
959 char *gidtoname(int gid
);
960 void BlockSignals(BOOL block
,int signum
);
961 void ajt_panic(void);
962 char *readdirname(void *p
);
963 BOOL
is_in_path(char *name
, name_compare_entry
*namelist
);
964 void set_namearray(name_compare_entry
**ppname_array
, char *namelist
);
965 void free_namearray(name_compare_entry
*name_array
);
966 BOOL
fcntl_lock(int fd
,int op
,uint32 offset
,uint32 count
,int type
);
967 int file_lock(char *name
,int timeout
);
968 void file_unlock(int fd
);
969 BOOL
is_myname(const char *s
);
971 /*The following definitions come from vt_mode.c */
973 int VT_Check(char *buffer
);
974 int VT_Start_utmp(void);
975 int VT_Stop_utmp(void);
976 void VT_AtExit(void);
977 void VT_SigCLD(int sig
);
978 void VT_SigEXIT(int sig
);
980 int VT_Output(char *Buffer
);
981 int VT_Input(char *Buffer
,int Size
);
982 void VT_Process(void);