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