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