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