byteorder.h :
[samba.git] / source3 / include / proto.h
1 /* This file is automatically generated with "make proto". DO NOT EDIT */
2
3
4 /*The following definitions come from  access.c  */
5
6 BOOL check_access(int snum);
7 BOOL allow_access(char *deny_list,char *allow_list,char *cname,char *caddr);
8
9 /*The following definitions come from  asyncdns.c  */
10
11 int asyncdns_fd(void);
12 void start_async_dns(void);
13 void run_dns_queue(void);
14 BOOL queue_dns_query(struct packet_struct *p,struct nmb_name *question,
15                      struct name_record **n);
16 BOOL queue_dns_query(struct packet_struct *p,struct nmb_name *question,
17                      struct name_record **n);
18
19 /*The following definitions come from  charcnv.c  */
20
21 char *unix2dos_format(char *str,BOOL overwrite);
22 char *dos2unix_format(char *str, BOOL overwrite);
23 int interpret_character_set(char *str, int def);
24
25 /*The following definitions come from  charset.c  */
26
27 void charset_initialise();
28 void codepage_initialise(int client_codepage);
29 void add_char_string(char *s);
30
31 /*The following definitions come from  chgpasswd.c  */
32
33 BOOL chat_with_program(char *passwordprogram,char *name,char *chatsequence);
34 BOOL chgpasswd(char *name,char *oldpass,char *newpass);
35 BOOL chgpasswd(char *name,char *oldpass,char *newpass);
36
37 /*The following definitions come from  client.c  */
38
39 void cli_smb_close(char *inbuf, char *outbuf, int clnt_fd, int c_num, int f_num);
40 void do_dir(char *inbuf,char *outbuf,char *Mask,int attribute,void (*fn)(),BOOL recurse_dir);
41 void cmd_help(void);
42
43 /*The following definitions come from  clientgen.c  */
44
45 BOOL cli_NetWkstaUserLogon(struct cli_state *cli,char *user, char *workstation);
46 BOOL cli_NetServerEnum(struct cli_state *cli, char *workgroup, uint32 stype,
47                        void (*fn)(char *, uint32, char *));
48 BOOL cli_session_setup(struct cli_state *cli, 
49                        char *user, 
50                        char *pass, int passlen,
51                        char *ntpass, int ntpasslen,
52                        char *workgroup);
53 BOOL cli_send_tconX(struct cli_state *cli, 
54                     char *share, char *dev, char *pass, int passlen);
55 BOOL cli_tdis(struct cli_state *cli);
56 BOOL cli_unlink(struct cli_state *cli, char *fname);
57 int cli_open(struct cli_state *cli, char *fname, int flags, int share_mode);
58 BOOL cli_close(struct cli_state *cli, int fnum);
59 BOOL cli_lock(struct cli_state *cli, int fnum, uint32 offset, uint32 len, int timeout);
60 BOOL cli_unlock(struct cli_state *cli, int fnum, uint32 offset, uint32 len, int timeout);
61 int cli_read(struct cli_state *cli, int fnum, char *buf, uint32 offset, uint16 size);
62 int cli_write(struct cli_state *cli, int fnum, char *buf, uint32 offset, uint16 size);
63 BOOL cli_negprot(struct cli_state *cli);
64 BOOL cli_session_request(struct cli_state *cli,
65                         char *called_host_name        , int called_name_type,
66                         char  calling_netbios_name[16], int calling_name_type);
67 BOOL cli_connect(struct cli_state *cli, char *host, struct in_addr *ip);
68 BOOL cli_initialise(struct cli_state *cli);
69 void cli_shutdown(struct cli_state *cli);
70 char *cli_errstr(struct cli_state *cli);
71 BOOL cli_error(struct cli_state *cli, uint8 *eclass, uint32 *num);
72 void cli_sockopt(struct cli_state *cli, char *options);
73 int cli_setpid(struct cli_state *cli, int pid);
74
75 /*The following definitions come from  clientutil.c  */
76
77 void cli_setup_pkt(char *outbuf);
78 BOOL cli_call_api(char *pipe_name, int pipe_name_len,
79                         int prcnt,int drcnt, int srcnt,
80                      int mprcnt,int mdrcnt,
81                      int *rprcnt,int *rdrcnt,
82                      char *param,char *data, uint16 *setup,
83                      char **rparam,char **rdata);
84 BOOL cli_receive_trans_response(char *inbuf,int trans,
85                                    int *data_len,int *param_len,
86                                    char **data,char **param);
87 BOOL cli_send_trans_request(char *outbuf,int trans,
88                                char *name,int namelen, int fid,int flags,
89                                char *data,char *param,uint16 *setup,
90                                int ldata,int lparam,int lsetup,
91                                int mdata,int mparam,int msetup);
92 BOOL cli_send_session_request(char *inbuf,char *outbuf);
93 BOOL cli_send_login(char *inbuf,char *outbuf,BOOL start_session,BOOL use_setup);
94 void cli_send_logout(void );
95 BOOL cli_open_sockets(int port );
96 BOOL cli_reopen_connection(char *inbuf,char *outbuf);
97
98 /*The following definitions come from  clitar.c  */
99
100 int padit(char *buf, int bufsize, int padsize);
101 void cmd_block(void);
102 void cmd_tarmode(void);
103 void cmd_setmode(void);
104 void cmd_tar(char *inbuf, char *outbuf);
105 int process_tar(char *inbuf, char *outbuf);
106 int clipfind(char **aret, int ret, char *tok);
107 int tar_parseargs(int argc, char *argv[], char *Optarg, int Optind);
108
109 /*The following definitions come from  credentials.c  */
110
111 char *credstr(uchar *cred);
112 void cred_session_key(DOM_CHAL *clnt_chal, DOM_CHAL *srv_chal, char *pass, 
113                       uchar session_key[8]);
114 void cred_create(uchar session_key[8], DOM_CHAL *stor_cred, UTIME timestamp, 
115                  DOM_CHAL *cred);
116 int cred_assert(DOM_CHAL *cred, uchar session_key[8], DOM_CHAL *stored_cred,
117                 UTIME timestamp);
118 BOOL clnt_deal_with_creds(uchar sess_key[8],
119                           DOM_CRED *sto_clnt_cred, DOM_CRED *rcv_srv_cred);
120 BOOL deal_with_creds(uchar sess_key[8],
121                      DOM_CRED *sto_clnt_cred, 
122                      DOM_CRED *rcv_clnt_cred, DOM_CRED *rtn_srv_cred);
123
124 /*The following definitions come from  dir.c  */
125
126 void init_dptrs(void);
127 char *dptr_path(int key);
128 char *dptr_wcard(int key);
129 BOOL dptr_set_wcard(int key, char *wcard);
130 BOOL dptr_set_attr(int key, uint16 attr);
131 uint16 dptr_attr(int key);
132 void dptr_close(int key);
133 void dptr_closecnum(int cnum);
134 void dptr_idlecnum(int cnum);
135 void dptr_closepath(char *path,int pid);
136 int dptr_create(int cnum,char *path, BOOL expect_close,int pid);
137 BOOL dptr_fill(char *buf1,unsigned int key);
138 BOOL dptr_zero(char *buf);
139 void *dptr_fetch(char *buf,int *num);
140 void *dptr_fetch_lanman2(char *params,int dptr_num);
141 BOOL dir_check_ftype(int cnum,int mode,struct stat *st,int dirtype);
142 BOOL get_dir_entry(int cnum,char *mask,int dirtype,char *fname,int *size,int *mode,time_t *date,BOOL check_descend);
143 void *OpenDir(int cnum, char *name, BOOL use_veto);
144 void CloseDir(void *p);
145 char *ReadDirName(void *p);
146 BOOL SeekDir(void *p,int pos);
147 int TellDir(void *p);
148 void DirCacheAdd( char *path, char *name, char *dname, int snum );
149 char *DirCacheCheck( char *path, char *name, int snum );
150 void DirCacheFlush( int snum );
151
152 /*The following definitions come from  fault.c  */
153
154 void fault_setup(void (*fn)());
155
156 /*The following definitions come from  getsmbpass.c  */
157
158 char *getsmbpass(char *prompt)    ;
159
160 /*The following definitions come from  interface.c  */
161
162 void load_interfaces(void);
163 void iface_set_default(char *ip,char *bcast,char *nmask);
164 BOOL ismyip(struct in_addr ip);
165 BOOL ismybcast(struct in_addr bcast);
166 BOOL is_local_net(struct in_addr from);
167 int iface_count(void);
168 struct in_addr *iface_n_ip(int n);
169 struct in_addr *iface_bcast(struct in_addr ip);
170 struct in_addr *iface_nmask(struct in_addr ip);
171 struct in_addr *iface_ip(struct in_addr ip);
172
173 /*The following definitions come from  ipc.c  */
174
175 int get_printerdrivernumber(int snum);
176 int reply_trans(char *inbuf,char *outbuf);
177
178 /*The following definitions come from  kanji.c  */
179
180 char *sj_strtok(char *s1, char *s2);
181 char *sj_strstr(char *s1, char *s2);
182 char *sj_strchr (char *s, int c);
183 char *sj_strrchr(char *s, int c);
184 int interpret_coding_system(char *str, int def);
185
186 /*The following definitions come from  loadparm.c  */
187
188 char *lp_string(char *s);
189 char *lp_logfile(void);
190 char *lp_smbrun(void);
191 char *lp_configfile(void);
192 char *lp_smb_passwd_file(void);
193 char *lp_serverstring(void);
194 char *lp_printcapname(void);
195 char *lp_lockdir(void);
196 char *lp_rootdir(void);
197 char *lp_defaultservice(void);
198 char *lp_msg_command(void);
199 char *lp_dfree_command(void);
200 char *lp_hosts_equiv(void);
201 char *lp_auto_services(void);
202 char *lp_passwd_program(void);
203 char *lp_passwd_chat(void);
204 char *lp_passwordserver(void);
205 char *lp_workgroup(void);
206 char *lp_username_map(void);
207 char *lp_character_set(void);
208 char *lp_logon_script(void);
209 char *lp_logon_path(void);
210 char *lp_logon_drive(void);
211 char *lp_logon_home(void);
212 char *lp_remote_announce(void);
213 char *lp_wins_server(void);
214 char *lp_interfaces(void);
215 char *lp_socket_address(void);
216 char *lp_nis_home_map_name(void);
217 char *lp_announce_version(void);
218 char *lp_netbios_aliases(void);
219 char *lp_driverfile(void);
220 char *lp_domain_sid(void);
221 char *lp_domain_other_sids(void);
222 char *lp_domain_groups(void);
223 char *lp_domain_admin_users(void);
224 char *lp_domain_guest_users(void);
225 char *lp_domain_hostsallow(void);
226 char *lp_domain_hostsdeny(void);
227 BOOL lp_dns_proxy(void);
228 BOOL lp_wins_support(void);
229 BOOL lp_wins_proxy(void);
230 BOOL lp_local_master(void);
231 BOOL lp_domain_controller(void);
232 BOOL lp_domain_master(void);
233 BOOL lp_domain_logons(void);
234 BOOL lp_preferred_master(void);
235 BOOL lp_load_printers(void);
236 BOOL lp_use_rhosts(void);
237 BOOL lp_getwdcache(void);
238 BOOL lp_readprediction(void);
239 BOOL lp_readbmpx(void);
240 BOOL lp_readraw(void);
241 BOOL lp_writeraw(void);
242 BOOL lp_null_passwords(void);
243 BOOL lp_strip_dot(void);
244 BOOL lp_encrypted_passwords(void);
245 BOOL lp_syslog_only(void);
246 BOOL lp_browse_list(void);
247 BOOL lp_unix_realname(void);
248 BOOL lp_nis_home_map(void);
249 BOOL lp_time_server(void);
250 BOOL lp_bind_interfaces_only(void);
251 int lp_os_level(void);
252 int lp_max_ttl(void);
253 int lp_max_log_size(void);
254 int lp_mangledstack(void);
255 int lp_maxxmit(void);
256 int lp_maxmux(void);
257 int lp_maxpacket(void);
258 int lp_keepalive(void);
259 int lp_passwordlevel(void);
260 int lp_usernamelevel(void);
261 int lp_readsize(void);
262 int lp_shmem_size(void);
263 int lp_deadtime(void);
264 int lp_maxprotocol(void);
265 int lp_security(void);
266 int lp_printing(void);
267 int lp_maxdisksize(void);
268 int lp_lpqcachetime(void);
269 int lp_syslog(void);
270 int lp_client_code_page(void);
271 int lp_announce_as(void);
272 char *lp_preexec(int );
273 char *lp_postexec(int );
274 char *lp_rootpreexec(int );
275 char *lp_rootpostexec(int );
276 char *lp_servicename(int );
277 char *lp_pathname(int );
278 char *lp_dontdescend(int );
279 char *lp_username(int );
280 char *lp_guestaccount(int );
281 char *lp_invalid_users(int );
282 char *lp_valid_users(int );
283 char *lp_admin_users(int );
284 char *lp_printcommand(int );
285 char *lp_lpqcommand(int );
286 char *lp_lprmcommand(int );
287 char *lp_lppausecommand(int );
288 char *lp_lpresumecommand(int );
289 char *lp_printername(int );
290 char *lp_printerdriver(int );
291 char *lp_hostsallow(int );
292 char *lp_hostsdeny(int );
293 char *lp_magicscript(int );
294 char *lp_magicoutput(int );
295 char *lp_comment(int );
296 char *lp_force_user(int );
297 char *lp_force_group(int );
298 char *lp_readlist(int );
299 char *lp_writelist(int );
300 char *lp_volume(int );
301 char *lp_mangled_map(int );
302 char *lp_veto_files(int );
303 char *lp_hide_files(int );
304 char *lp_driverlocation(int );
305 BOOL lp_alternate_permissions(int );
306 BOOL lp_revalidate(int );
307 BOOL lp_casesensitive(int );
308 BOOL lp_preservecase(int );
309 BOOL lp_shortpreservecase(int );
310 BOOL lp_casemangle(int );
311 BOOL lp_status(int );
312 BOOL lp_hide_dot_files(int );
313 BOOL lp_browseable(int );
314 BOOL lp_readonly(int );
315 BOOL lp_no_set_dir(int );
316 BOOL lp_guest_ok(int );
317 BOOL lp_guest_only(int );
318 BOOL lp_print_ok(int );
319 BOOL lp_postscript(int );
320 BOOL lp_map_hidden(int );
321 BOOL lp_map_archive(int );
322 BOOL lp_locking(int );
323 BOOL lp_strict_locking(int );
324 BOOL lp_share_modes(int );
325 BOOL lp_oplocks(int );
326 BOOL lp_onlyuser(int );
327 BOOL lp_manglednames(int );
328 BOOL lp_widelinks(int );
329 BOOL lp_symlinks(int );
330 BOOL lp_syncalways(int );
331 BOOL lp_map_system(int );
332 BOOL lp_delete_readonly(int );
333 BOOL lp_fake_oplocks(int );
334 BOOL lp_recursive_veto_delete(int );
335 BOOL lp_dos_filetimes(int );
336 int lp_create_mode(int );
337 int lp_force_create_mode(int );
338 int lp_dir_mode(int );
339 int lp_force_dir_mode(int );
340 int lp_max_connections(int );
341 int lp_defaultcase(int );
342 int lp_minprintspace(int );
343 char lp_magicchar(int );
344 BOOL lp_add_home(char *pszHomename, int iDefaultService, char *pszHomedir);
345 int lp_add_service(char *pszService, int iDefaultService);
346 BOOL lp_add_printer(char *pszPrintername, int iDefaultService);
347 BOOL lp_file_list_changed(void);
348 BOOL lp_do_parameter(int snum, char *pszParmName, char *pszParmValue);
349 int lp_next_parameter(int snum, int *i, char *label, 
350                            char *value, int allparameters);
351 BOOL lp_snum_ok(int iService);
352 BOOL lp_loaded(void);
353 void lp_killunused(BOOL (*snumused)(int ));
354 BOOL lp_load(char *pszFname,BOOL global_only);
355 int lp_numservices(void);
356 void lp_dump(FILE *f);
357 int lp_servicenumber(char *pszServiceName);
358 char *volume_label(int snum);
359 void lp_rename_service(int snum, char *new_name);
360 void lp_remove_service(int snum);
361 void lp_copy_service(int snum, char *new_name);
362 int lp_default_server_announce(void);
363 int lp_major_announce_version(void);
364 int lp_minor_announce_version(void);
365
366 /*The following definitions come from  locking.c  */
367
368 BOOL is_locked(int fnum,int cnum,uint32 count,uint32 offset);
369 BOOL do_lock(int fnum,int cnum,uint32 count,uint32 offset,int *eclass,uint32 *ecode);
370 BOOL do_unlock(int fnum,int cnum,uint32 count,uint32 offset,int *eclass,uint32 *ecode);
371 BOOL locking_init(int read_only);
372 BOOL locking_end(void);
373 BOOL lock_share_entry(int cnum, uint32 dev, uint32 inode, int *ptok);
374 BOOL unlock_share_entry(int cnum, uint32 dev, uint32 inode, int token);
375 int get_share_modes(int cnum, int token, uint32 dev, uint32 inode, 
376                     share_mode_entry **shares);
377 void del_share_mode(int token, int fnum);
378 BOOL set_share_mode(int token, int fnum, uint16 port, uint16 op_type);
379 BOOL remove_share_oplock(int fnum, int token);
380 int share_mode_forall(void (*fn)(share_mode_entry *, char *));
381 void share_status(FILE *f);
382
383 /*The following definitions come from  locking_shm.c  */
384
385 struct share_ops *locking_shm_init(int ronly);
386
387 /*The following definitions come from  locking_slow.c  */
388
389 struct share_ops *locking_slow_init(int ronly);
390
391 /*The following definitions come from  mangle.c  */
392
393 int str_checksum(char *s);
394 BOOL is_8_3(char *fname, BOOL check_case);
395 void reset_mangled_stack( int size );
396 BOOL check_mangled_stack(char *s);
397 BOOL is_mangled( char *s );
398 void mangle_name_83(char *s);
399 BOOL name_map_mangle(char *OutName,BOOL need83,int snum);
400
401 /*The following definitions come from  md4.c  */
402
403 void mdfour(unsigned char *out, unsigned char *in, int n);
404
405 /*The following definitions come from  message.c  */
406
407 int reply_sends(char *inbuf,char *outbuf);
408 int reply_sendstrt(char *inbuf,char *outbuf);
409 int reply_sendtxt(char *inbuf,char *outbuf);
410 int reply_sendend(char *inbuf,char *outbuf);
411
412 /*The following definitions come from  nameannounce.c  */
413
414 void announce_request(struct work_record *work, struct in_addr ip);
415 void do_announce_request(char *info, char *to_name, int announce_type, 
416                          int from,
417                          int to, struct in_addr dest_ip);
418 void sync_server(enum state_type state, char *serv_name, char *work_name, 
419                  int name_type,
420                  struct subnet_record *d,
421                  struct in_addr ip);
422 void announce_my_servers_removed(void);
423 void announce_server(struct subnet_record *d, struct work_record *work,
424                      char *name, char *comment, time_t ttl, int server_type);
425 void announce_host(time_t t);
426 void reset_announce_timer();
427 void announce_master(time_t t);
428 void announce_remote(time_t t);
429
430 /*The following definitions come from  namebrowse.c  */
431
432 void expire_browse_cache(time_t t);
433 struct browse_cache_record *add_browser_entry(char *name, int type, char *wg,
434                                               time_t ttl, struct subnet_record *d,
435                                               struct in_addr ip, BOOL local);
436 void do_browser_lists(time_t t);
437
438 /*The following definitions come from  namedbname.c  */
439
440 void set_samba_nb_type(void);
441 BOOL name_equal(struct nmb_name *n1,struct nmb_name *n2);
442 BOOL ms_browser_name(char *name, int type);
443 void remove_name(struct subnet_record *d, struct name_record *n);
444 struct name_record *find_name_on_subnet(struct subnet_record *d,
445                         struct nmb_name *name, BOOL self_only);
446 void dump_names(void);
447 void load_netbios_names(void);
448 void remove_netbios_name(struct subnet_record *d,
449                         char *name,int type, enum name_source source);
450 struct name_record *add_netbios_entry(struct subnet_record *d,
451                 char *name, int type, int nb_flags, int ttl, 
452                 enum name_source source, struct in_addr ip, BOOL new_only);
453 void expire_names(time_t t);
454
455 /*The following definitions come from  namedbresp.c  */
456
457 void add_response_record(struct subnet_record *d,
458                                 struct response_record *n);
459 void remove_response_record(struct subnet_record *d,
460                                 struct response_record *n);
461 struct response_record *make_response_queue_record(enum state_type state,
462                                 int id,uint16 fd,
463                                 int quest_type, char *name,int type, int nb_flags, time_t ttl,
464                                 int server_type, char *my_name, char *my_comment,
465                                 BOOL bcast,BOOL recurse,
466                                 struct in_addr send_ip, struct in_addr reply_to_ip,
467                                 int reply_id);
468 struct response_record *find_response_record(struct subnet_record **d,
469                                 uint16 id);
470
471 /*The following definitions come from  namedbserver.c  */
472
473 void remove_old_servers(struct work_record *work, time_t t,
474                                         BOOL remove_all);
475 struct server_record *find_server(struct work_record *work, char *name);
476 struct server_record *add_server_entry(struct subnet_record *d, 
477                                        struct work_record *work,
478                                        char *name,int servertype, 
479                                        int ttl,char *comment,
480                                        BOOL replace);
481 void expire_servers(time_t t);
482
483 /*The following definitions come from  namedbsubnet.c  */
484
485 struct subnet_record *find_subnet(struct in_addr ip);
486 struct subnet_record *find_subnet_all(struct in_addr ip);
487 void add_workgroup_to_subnet( struct subnet_record *d, char *group);
488 void add_my_subnets(char *group);
489 void write_browse_list(time_t t);
490
491 /*The following definitions come from  namedbwork.c  */
492
493 struct work_record *remove_workgroup(struct subnet_record *d, 
494                                      struct work_record *work,
495                                          BOOL remove_all_servers);
496 struct work_record *find_workgroupstruct(struct subnet_record *d, 
497                                          fstring name, BOOL add);
498 void dump_workgroups(void);
499
500 /*The following definitions come from  nameelect.c  */
501
502 void check_master_browser(time_t t);
503 void browser_gone(char *work_name, struct in_addr ip);
504 void send_election(struct subnet_record *d, char *group,uint32 criterion,
505                    int timeup,char *name);
506 void name_unregister_work(struct subnet_record *d, char *name, int name_type);
507 void name_register_work(struct subnet_record *d, char *name, int name_type,
508                                 int nb_flags, time_t ttl, struct in_addr ip, BOOL bcast);
509 void become_local_master(struct subnet_record *d, struct work_record *work);
510 void become_domain_master(struct subnet_record *d, struct work_record *work);
511 void become_logon_server(struct subnet_record *d, struct work_record *work);
512 void unbecome_local_master(struct subnet_record *d, struct work_record *work,
513                                 int remove_type);
514 void unbecome_domain_master(struct subnet_record *d, struct work_record *work,
515                                 int remove_type);
516 void unbecome_logon_server(struct subnet_record *d, struct work_record *work,
517                                 int remove_type);
518 void run_elections(time_t t);
519 void process_election(struct packet_struct *p,char *buf);
520 BOOL check_elections(void);
521
522 /*The following definitions come from  namelogon.c  */
523
524 void process_logon_packet(struct packet_struct *p,char *buf,int len);
525
526 /*The following definitions come from  namepacket.c  */
527
528 void debug_browse_data(char *outbuf, int len);
529 void initiate_netbios_packet(uint16 *id,
530                              int fd,int quest_type,char *name,int name_type,
531                              int nb_flags,BOOL bcast,BOOL recurse,
532                              struct in_addr to_ip);
533 void reply_netbios_packet(struct packet_struct *p1,int trn_id,
534                                 int rcode, int rcv_code, int opcode,
535                 BOOL recursion_available,
536                 BOOL recursion_desired,
537                                 struct nmb_name *rr_name,int rr_type,int rr_class,int ttl,
538                                 char *data,int len);
539 void queue_packet(struct packet_struct *packet);
540 void run_packet_queue();
541 BOOL listen_for_packets(BOOL run_election);
542 BOOL send_mailslot_reply(BOOL unique, char *mailslot,int fd,char *buf,int len,char *srcname,
543                          char *dstname,int src_type,int dest_type,
544                          struct in_addr dest_ip,struct in_addr src_ip);
545
546 /*The following definitions come from  namequery.c  */
547
548 BOOL name_status(int fd,char *name,int name_type,BOOL recurse,
549                  struct in_addr to_ip,char *master,char *rname,
550                  void (*fn)());
551 BOOL name_query(int fd,char *name,int name_type, 
552                 BOOL bcast,BOOL recurse,
553                 struct in_addr to_ip, struct in_addr *ip,void (*fn)());
554
555 /*The following definitions come from  nameresp.c  */
556
557 void expire_netbios_response_entries(time_t t);
558 struct response_record *queue_netbios_pkt_wins(
559                                 int fd,int quest_type,enum state_type state,
560                             char *name,int name_type,int nb_flags, time_t ttl,
561                                 int server_type, char *my_name, char *my_comment,
562                                 struct in_addr send_ip, struct in_addr reply_to_ip);
563 struct response_record *queue_netbios_packet(struct subnet_record *d,
564                         int fd,int quest_type,enum state_type state,char *name,
565                         int name_type,int nb_flags, time_t ttl,
566                         int server_type, char *my_name, char *my_comment,
567                         BOOL bcast,BOOL recurse,
568                         struct in_addr send_ip, struct in_addr reply_to_ip,
569                         int reply_id);
570
571 /*The following definitions come from  nameserv.c  */
572
573 void remove_name_entry(struct subnet_record *d, char *name,int type);
574 void add_my_name_entry(struct subnet_record *d,char *name,int type,int nb_flags);
575 void add_domain_logon_names(void);
576 void add_domain_master_bcast(void);
577 void add_domain_master_wins(void);
578 void add_domain_names(time_t t);
579 void add_my_names(void);
580 void remove_my_names();
581 void refresh_my_names(time_t t);
582 void query_refresh_names(time_t t);
583
584 /*The following definitions come from  nameservreply.c  */
585
586 void add_name_respond(struct subnet_record *d, int fd, struct in_addr from_ip,
587                                 uint16 response_id,
588                                 struct nmb_name *name,
589                                 int nb_flags, int ttl, struct in_addr register_ip,
590                                 BOOL new_owner, struct in_addr reply_to_ip);
591 void reply_name_release(struct packet_struct *p);
592 void reply_name_reg(struct packet_struct *p);
593 void reply_name_status(struct packet_struct *p);
594 void reply_name_query(struct packet_struct *p);
595
596 /*The following definitions come from  nameservresp.c  */
597
598 void debug_state_type(int state);
599 void response_netbios_packet(struct packet_struct *p);
600
601 /*The following definitions come from  namework.c  */
602
603 void reset_server(char *name, int state, struct in_addr ip);
604 void tell_become_backup(void);
605 BOOL same_context(struct dgram_packet *dgram);
606 void process_browse_packet(struct packet_struct *p,char *buf,int len);
607
608 /*The following definitions come from  nmbd.c  */
609
610 BOOL reload_services(BOOL test);
611
612 /*The following definitions come from  nmblib.c  */
613
614 char *lookup_opcode_name( int opcode );
615 void debug_nmb_packet(struct packet_struct *p);
616 char *namestr(struct nmb_name *n);
617 void free_nmb_packet(struct nmb_packet *nmb);
618 void free_packet(struct packet_struct *packet);
619 struct packet_struct *read_packet(int fd,enum packet_type packet_type);
620 void make_nmb_name(struct nmb_name *n,char *name,int type,char *this_scope);
621 BOOL send_packet(struct packet_struct *p);
622 struct packet_struct *receive_packet(int fd,enum packet_type type,int t);
623
624 /*The following definitions come from  nmbsync.c  */
625
626 void sync_browse_lists(struct subnet_record *d, struct work_record *work,
627                        char *name, int nm_type, struct in_addr ip, BOOL local);
628
629 /*The following definitions come from  ntclient.c  */
630
631 BOOL wksta_trust_account_check(struct in_addr dest_ip, char *dest_host,
632                                 char *myhostname, char *domain,
633                                 fstring mach_pwd, fstring new_mach_pwd);
634 BOOL do_nt_login(struct in_addr dest_ip, char *dest_host,
635                                 char *myhostname,
636                                 int Client, int cnum);
637
638 /*The following definitions come from  nterr.c  */
639
640 char *get_nt_error_msg(uint16 nt_code);
641
642 /*The following definitions come from  params.c  */
643
644 BOOL pm_process( char *FileName,
645                  BOOL (*sfunc)(char *),
646                  BOOL (*pfunc)(char *, char *) );
647
648 /*The following definitions come from  password.c  */
649
650 void generate_next_challenge(char *challenge);
651 BOOL set_challenge(char *challenge);
652 BOOL last_challenge(char *challenge);
653 user_struct *get_valid_user_struct(uint16 vuid);
654 void invalidate_vuid(uint16 vuid);
655 char *validated_username(uint16 vuid);
656 uint16 register_vuid(int uid,int gid, char *name,BOOL guest);
657 void add_session_user(char *user);
658 void dfs_unlogin(void);
659 BOOL password_check(char *password);
660 BOOL smb_password_check(char *password, unsigned char *part_passwd, unsigned char *c8);
661 BOOL password_ok(char *user,char *password, int pwlen, struct passwd *pwd);
662 BOOL user_ok(char *user,int snum);
663 BOOL authorise_login(int snum,char *user,char *password, int pwlen, 
664                      BOOL *guest,BOOL *force,uint16 vuid);
665 BOOL check_hosts_equiv(char *user);
666
667 /*The following definitions come from  pcap.c  */
668
669 BOOL pcap_printername_ok(char *pszPrintername, char *pszPrintcapname);
670 void pcap_printer_fn(void (*fn)());
671
672 /*The following definitions come from  pipes.c  */
673
674 int reply_open_pipe_and_X(char *inbuf,char *outbuf,int length,int bufsize);
675 int reply_pipe_close(char *inbuf,char *outbuf);
676 BOOL api_LsarpcSNPHS(int pnum, int cnum, char *param);
677 BOOL api_LsarpcTNP(int cnum,int uid, char *param,char *data,
678                      int mdrcnt,int mprcnt,
679                      char **rdata,char **rparam,
680                      int *rdata_len,int *rparam_len);
681
682 /*The following definitions come from  predict.c  */
683
684 int read_predict(int fd,int offset,char *buf,char **ptr,int num);
685 void do_read_prediction();
686 void invalidate_read_prediction(int fd);
687
688 /*The following definitions come from  printing.c  */
689
690 void lpq_reset(int snum);
691 void print_file(int fnum);
692 int get_printqueue(int snum,int cnum,print_queue_struct **queue,
693                    print_status_struct *status);
694 void del_printqueue(int cnum,int snum,int jobid);
695 void status_printjob(int cnum,int snum,int jobid,int status);
696 int printjob_encode(int snum, int job);
697 void printjob_decode(int jobid, int *snum, int *job);
698
699 /*The following definitions come from  pwd_validate.c  */
700
701 BOOL server_connect_init(struct cli_state *clnt, char my_netbios_name[16],
702                                 struct in_addr dest_ip, char *desthost);
703 BOOL server_cryptkey(struct cli_state *clnt, char my_netbios_name[16]);
704 BOOL server_validate2(struct cli_state *clnt, char *user, char *domain, 
705                      char *pass, int passlen,
706                      char *ntpass, int ntpasslen);
707 BOOL server_validate(struct cli_state *clnt, char *user, char *domain, 
708                      char *pass, int passlen,
709                      char *ntpass, int ntpasslen);
710
711 /*The following definitions come from  quotas.c  */
712
713 BOOL disk_quotas(char *path, int *bsize, int *dfree, int *dsize);
714 BOOL disk_quotas(char *path, int *bsize, int *dfree, int *dsize);
715 BOOL disk_quotas(char *path, int *bsize, int *dfree, int *dsize);
716 BOOL disk_quotas(char *path, int *bsize, int *dfree, int *dsize);
717 BOOL disk_quotas(char *path, int *bsize, int *dfree, int *dsize);
718 BOOL disk_quotas(char *path, int *bsize, int *dfree, int *dsize);
719
720 /*The following definitions come from  replace.c  */
721
722 char *Strstr(char *s, char *p);
723 time_t Mktime(struct tm      *t);
724 int InNetGr(char *group,char *host,char *user,char *dom);
725 void *malloc_wrapped(int size,char *file,int line);
726 void *realloc_wrapped(void *ptr,int size,char *file,int line);
727 void free_wrapped(void *ptr,char *file,int line);
728 void *memcpy_wrapped(void *d,void *s,int l,char *fname,int line);
729
730 /*The following definitions come from  reply.c  */
731
732 int reply_special(char *inbuf,char *outbuf);
733 int reply_tcon(char *inbuf,char *outbuf);
734 int reply_tcon_and_X(char *inbuf,char *outbuf,int length,int bufsize);
735 int reply_unknown(char *inbuf,char *outbuf);
736 int reply_ioctl(char *inbuf,char *outbuf);
737 int reply_sesssetup_and_X(char *inbuf,char *outbuf,int length,int bufsize);
738 int reply_chkpth(char *inbuf,char *outbuf);
739 int reply_getatr(char *inbuf,char *outbuf);
740 int reply_setatr(char *inbuf,char *outbuf);
741 int reply_dskattr(char *inbuf,char *outbuf);
742 int reply_search(char *inbuf,char *outbuf);
743 int reply_fclose(char *inbuf,char *outbuf);
744 int reply_open(char *inbuf,char *outbuf);
745 int reply_open_and_X(char *inbuf,char *outbuf,int length,int bufsize);
746 int reply_ulogoffX(char *inbuf,char *outbuf,int length,int bufsize);
747 int reply_mknew(char *inbuf,char *outbuf);
748 int reply_ctemp(char *inbuf,char *outbuf);
749 int reply_unlink(char *inbuf,char *outbuf);
750 int reply_readbraw(char *inbuf, char *outbuf);
751 int reply_lockread(char *inbuf,char *outbuf);
752 int reply_read(char *inbuf,char *outbuf);
753 int reply_read_and_X(char *inbuf,char *outbuf,int length,int bufsize);
754 int reply_writebraw(char *inbuf,char *outbuf);
755 int reply_writeunlock(char *inbuf,char *outbuf);
756 int reply_write(char *inbuf,char *outbuf,int dum1,int dum2);
757 int reply_write_and_X(char *inbuf,char *outbuf,int length,int bufsize);
758 int reply_lseek(char *inbuf,char *outbuf);
759 int reply_flush(char *inbuf,char *outbuf);
760 int reply_exit(char *inbuf,char *outbuf);
761 int reply_close(char *inbuf,char *outbuf);
762 int reply_writeclose(char *inbuf,char *outbuf);
763 int reply_lock(char *inbuf,char *outbuf);
764 int reply_unlock(char *inbuf,char *outbuf);
765 int reply_tdis(char *inbuf,char *outbuf);
766 int reply_echo(char *inbuf,char *outbuf);
767 int reply_printopen(char *inbuf,char *outbuf);
768 int reply_printclose(char *inbuf,char *outbuf);
769 int reply_printqueue(char *inbuf,char *outbuf);
770 int reply_printwrite(char *inbuf,char *outbuf);
771 int reply_mkdir(char *inbuf,char *outbuf);
772 int reply_rmdir(char *inbuf,char *outbuf);
773 int reply_mv(char *inbuf,char *outbuf);
774 int reply_copy(char *inbuf,char *outbuf);
775 int reply_setdir(char *inbuf,char *outbuf);
776 int reply_lockingX(char *inbuf,char *outbuf,int length,int bufsize);
777 int reply_readbmpx(char *inbuf,char *outbuf,int length,int bufsize);
778 int reply_writebmpx(char *inbuf,char *outbuf);
779 int reply_writebs(char *inbuf,char *outbuf);
780 int reply_setattrE(char *inbuf,char *outbuf);
781 int reply_getattrE(char *inbuf,char *outbuf);
782
783 /*The following definitions come from  rpc_pipes/lsa_hnd.c  */
784
785 void init_lsa_policy_hnd(void);
786 BOOL open_lsa_policy_hnd(LSA_POL_HND *hnd);
787 BOOL set_lsa_policy_samr_rid(LSA_POL_HND *hnd, uint32 rid);
788 BOOL set_lsa_policy_samr_pol_status(LSA_POL_HND *hnd, uint32 pol_status);
789 BOOL set_lsa_policy_samr_sid(LSA_POL_HND *hnd, DOM_SID *sid);
790 uint32 get_lsa_policy_samr_rid(LSA_POL_HND *hnd);
791 BOOL close_lsa_policy_hnd(LSA_POL_HND *hnd);
792
793 /*The following definitions come from  rpc_pipes/lsaparse.c  */
794
795 void make_q_open_pol(LSA_Q_OPEN_POL *r_q, char *server_name,
796                         uint32 attributes, uint32 sec_qos,
797                         uint16 desired_access);
798 char* lsa_io_q_open_pol(BOOL io, LSA_Q_OPEN_POL *r_q, char *q, char *base, int align, int depth);
799 char* lsa_io_r_open_pol(BOOL io, LSA_R_OPEN_POL *r_p, char *q, char *base, int align, int depth);
800 void make_q_query(LSA_Q_QUERY_INFO *q_q, LSA_POL_HND *hnd, uint16 info_class);
801 char* lsa_io_q_query(BOOL io, LSA_Q_QUERY_INFO *q_q, char *q, char *base, int align, int depth);
802 char* lsa_io_q_enum_trust_dom(BOOL io, LSA_Q_ENUM_TRUST_DOM *q_e, char *q, char *base, int align, int depth);
803 void make_r_enum_trust_dom(LSA_R_ENUM_TRUST_DOM *r_e, LSA_POL_HND *hnd, uint32 status);
804 char* lsa_io_r_enum_trust_dom(BOOL io, LSA_R_ENUM_TRUST_DOM *r_e, char *q, char *base, int align, int depth);
805 void make_q_close(LSA_Q_CLOSE *q_c, LSA_POL_HND *hnd);
806 char* lsa_io_q_close(BOOL io, LSA_Q_CLOSE *q_c, char *q, char *base, int align, int depth);
807 void make_r_close(LSA_R_CLOSE *q_r, LSA_POL_HND *hnd);
808 char* lsa_io_r_close(BOOL io, LSA_R_CLOSE *r_c, char *q, char *base, int align, int depth);
809 char* lsa_io_r_query(BOOL io, LSA_R_QUERY_INFO *r_q, char *q, char *base, int align, int depth);
810 char* lsa_io_q_lookup_sids(BOOL io, LSA_Q_LOOKUP_SIDS *q_s, char *q, char *base, int align, int depth);
811 char* lsa_io_r_lookup_sids(BOOL io, LSA_R_LOOKUP_SIDS *r_s, char *q, char *base, int align, int depth);
812 char* lsa_io_q_lookup_rids(BOOL io, LSA_Q_LOOKUP_RIDS *q_r, char *q, char *base, int align, int depth);
813 char* lsa_io_r_lookup_rids(BOOL io, LSA_R_LOOKUP_RIDS *r_r, char *q, char *base, int align, int depth);
814 void make_q_req_chal(LSA_Q_REQ_CHAL *q_c,
815                                 char *logon_srv, char *logon_clnt,
816                                 DOM_CHAL *clnt_chal);
817 char* lsa_io_q_req_chal(BOOL io, LSA_Q_REQ_CHAL *q_c, char *q, char *base, int align, int depth);
818 char* lsa_io_r_req_chal(BOOL io, LSA_R_REQ_CHAL *r_c, char *q, char *base, int align, int depth);
819 void make_q_auth_2(LSA_Q_AUTH_2 *q_a,
820                 char *logon_srv, char *acct_name, uint16 sec_chan, char *comp_name,
821                 DOM_CHAL *clnt_chal, uint32 clnt_flgs);
822 char* lsa_io_q_auth_2(BOOL io, LSA_Q_AUTH_2 *q_a, char *q, char *base, int align, int depth);
823 char* lsa_io_r_auth_2(BOOL io, LSA_R_AUTH_2 *r_a, char *q, char *base, int align, int depth);
824 void make_q_srv_pwset(LSA_Q_SRV_PWSET *q_s, char sess_key[8],
825                 char *logon_srv, char *acct_name, uint16 sec_chan, char *comp_name,
826                 DOM_CRED *cred, char nt_cypher[16]);
827 char* lsa_io_q_srv_pwset(BOOL io, LSA_Q_SRV_PWSET *q_s, char *q, char *base, int align, int depth);
828 char* lsa_io_r_srv_pwset(BOOL io, LSA_R_SRV_PWSET *r_s, char *q, char *base, int align, int depth);
829 char* lsa_io_user_info(BOOL io, LSA_USER_INFO *usr, char *q, char *base, int align, int depth);
830 char* lsa_io_q_sam_logon(BOOL io, LSA_Q_SAM_LOGON *q_l, char *q, char *base, int align, int depth);
831 char* lsa_io_r_sam_logon(BOOL io, LSA_R_SAM_LOGON *r_l, char *q, char *base, int align, int depth);
832 char* lsa_io_q_sam_logoff(BOOL io, LSA_Q_SAM_LOGOFF *q_l, char *q, char *base, int align, int depth);
833 char* lsa_io_r_sam_logoff(BOOL io, LSA_R_SAM_LOGOFF *r_l, char *q, char *base, int align, int depth);
834
835 /*The following definitions come from  rpc_pipes/ntclientlsa.c  */
836
837 BOOL do_lsa_open_policy(uint16 fnum, uint32 call_id,
838                         char *server_name, LSA_POL_HND *hnd);
839 BOOL do_lsa_query_info_pol(uint16 fnum, uint32 call_id,
840                         LSA_POL_HND *hnd, uint16 info_class,
841                         fstring domain_name, pstring domain_sid);
842 BOOL do_lsa_close(uint16 fnum, uint32 call_id,
843                         LSA_POL_HND *hnd);
844
845 /*The following definitions come from  rpc_pipes/ntclientnet.c  */
846
847 BOOL do_lsa_req_chal(uint16 fnum, uint32 call_id,
848                 char *desthost, char *myhostname,
849         DOM_CHAL *clnt_chal, DOM_CHAL *srv_chal);
850 BOOL do_lsa_auth2(uint16 fnum, uint32 call_id,
851                 char *logon_srv, char *acct_name, uint16 sec_chan, char *comp_name,
852         DOM_CHAL *clnt_chal, uint32 neg_flags, DOM_CHAL *srv_chal);
853 BOOL do_lsa_srv_pwset(uint16 fnum, uint32 call_id,
854                 uchar sess_key[8], 
855                 char *logon_srv, char *mach_acct, uint16 sec_chan_type, char *comp_name,
856         DOM_CRED *clnt_cred, DOM_CRED *srv_cred,
857                 char nt_owf_new_mach_pwd[16]);
858 BOOL do_lsa_sam_logon(uint16 fnum, uint32 call_id,
859                 uchar sess_key[8], DOM_CRED *sto_clnt_cred,
860                 char *logon_srv, char *comp_name,
861         DOM_CRED *clnt_cred, DOM_CRED *rtn_cred,
862                 uint16 logon_level, uint16 switch_value, DOM_ID_INFO_1 *id1,
863                 LSA_USER_INFO *user_info,
864                 DOM_CRED *srv_cred);
865 BOOL do_lsa_sam_logoff(uint16 fnum, uint32 call_id,
866                 uchar sess_key[8], DOM_CRED *sto_clnt_cred,
867                 char *logon_srv, char *comp_name,
868         DOM_CRED *clnt_cred, DOM_CRED *rtn_cred,
869                 uint16 logon_level, uint16 switch_value, DOM_ID_INFO_1 *id1,
870                 DOM_CRED *srv_cred);
871
872 /*The following definitions come from  rpc_pipes/ntclientpipe.c  */
873
874 uint16 rpc_pipe_open(char *inbuf, char *outbuf, char *rname, int Client, int cnum);
875 BOOL rpc_pipe_set_hnd_state(char *pipe_name, uint16 fnum, uint16 device_state);
876 BOOL rpc_pipe_bind(char *pipe_name, uint16 fnum, uint32 call_id,
877                                 RPC_IFACE *abstract, RPC_IFACE *transfer);
878
879 /*The following definitions come from  rpc_pipes/pipe_hnd.c  */
880
881 void reset_chain_pnum(void);
882 void init_rpc_pipe_hnd(void);
883 int open_rpc_pipe_hnd(char *pipe_name, int cnum);
884 char *get_rpc_pipe_hnd_name(int pnum);
885 BOOL set_rpc_pipe_hnd_state(int pnum, int cnum, uint16 device_state);
886 BOOL close_rpc_pipe_hnd(int pnum, int cnum);
887 int get_rpc_pipe_num(char *buf, int where);
888
889 /*The following definitions come from  rpc_pipes/pipenetlog.c  */
890
891 BOOL api_netlogrpcTNP(int cnum,int uid, char *param,char *data,
892                      int mdrcnt,int mprcnt,
893                      char **rdata,char **rparam,
894                      int *rdata_len,int *rparam_len);
895
896 /*The following definitions come from  rpc_pipes/pipentlsa.c  */
897
898 BOOL api_ntLsarpcTNP(int cnum,int uid, char *param,char *data,
899                      int mdrcnt,int mprcnt,
900                      char **rdata,char **rparam,
901                      int *rdata_len,int *rparam_len);
902
903 /*The following definitions come from  rpc_pipes/pipesamr.c  */
904
905 BOOL api_samrTNP(int cnum,int uid, char *param,char *data,
906                      int mdrcnt,int mprcnt,
907                      char **rdata,char **rparam,
908                      int *rdata_len,int *rparam_len);
909
910 /*The following definitions come from  rpc_pipes/pipesrvsvc.c  */
911
912 BOOL api_srvsvcTNP(int cnum,int uid, char *param,char *data,
913                      int mdrcnt,int mprcnt,
914                      char **rdata,char **rparam,
915                      int *rdata_len,int *rparam_len);
916
917 /*The following definitions come from  rpc_pipes/pipeutil.c  */
918
919 void initrpcreply(char *inbuf, char *q);
920 void endrpcreply(char *inbuf, char *q, int datalen, int rtnval, int *rlen);
921 BOOL name_to_rid(char *user_name, uint32 *u_rid, uint32 *g_rid);
922 char *dom_sid_to_string(DOM_SID *sid);
923 int make_dom_sids(char *sids_str, DOM_SID *sids, int max_sids);
924 int make_dom_gids(char *gids_str, DOM_GID *gids);
925 int create_rpc_request(uint32 call_id, uint8 op_num, char *q, int data_len);
926 int create_rpc_reply(uint32 call_id, char *q, int data_len);
927
928 /*The following definitions come from  rpc_pipes/pipewkssvc.c  */
929
930 BOOL api_wkssvcTNP(int cnum,int uid, char *param,char *data,
931                      int mdrcnt,int mprcnt,
932                      char **rdata,char **rparam,
933                      int *rdata_len,int *rparam_len);
934
935 /*The following definitions come from  rpc_pipes/samrparse.c  */
936
937 char* samr_io_q_close(BOOL io, SAMR_Q_CLOSE *q_u, char *q, char *base, int align, int depth);
938 char* samr_io_r_close(BOOL io, SAMR_R_CLOSE *r_u, char *q, char *base, int align, int depth);
939 char* samr_io_q_open_secret(BOOL io, SAMR_Q_OPEN_SECRET *q_u, char *q, char *base, int align, int depth);
940 char* samr_io_r_open_secret(BOOL io, SAMR_R_OPEN_SECRET *r_u, char *q, char *base, int align, int depth);
941 char* samr_io_q_lookup_rids(BOOL io, SAMR_Q_LOOKUP_RIDS *q_u, char *q, char *base, int align, int depth);
942 void make_samr_r_lookup_rids(SAMR_R_LOOKUP_RIDS *r_u,
943                 uint32 num_rids, uint32 rid, uint32 status);
944 char* samr_io_r_lookup_rids(BOOL io, SAMR_R_LOOKUP_RIDS *r_u, char *q, char *base, int align, int depth);
945 char* samr_io_q_unknown_22(BOOL io, SAMR_Q_UNKNOWN_22 *q_u, char *q, char *base, int align, int depth);
946 char* samr_io_r_unknown_22(BOOL io, SAMR_R_UNKNOWN_22 *r_u, char *q, char *base, int align, int depth);
947 char* samr_io_q_unknown_24(BOOL io, SAMR_Q_UNKNOWN_24 *q_u, char *q, char *base, int align, int depth);
948 void make_samr_r_unknown_24(SAMR_R_UNKNOWN_24 *r_u,
949                                 uint16 unknown_0, NTTIME *expiry, char *mach_acct,
950                                 uint32 unknown_id_0, uint32 status);
951 char* samr_io_r_unknown_24(BOOL io, SAMR_R_UNKNOWN_24 *r_u, char *q, char *base, int align, int depth);
952 char* samr_io_q_unknown_32(BOOL io, SAMR_Q_UNKNOWN_32 *q_u, char *q, char *base, int align, int depth);
953 char* samr_io_r_unknown_32(BOOL io, SAMR_R_UNKNOWN_32 *r_u, char *q, char *base, int align, int depth);
954 char* samr_io_q_open_policy(BOOL io, SAMR_Q_OPEN_POLICY *q_u, char *q, char *base, int align, int depth);
955 char* samr_io_r_open_policy(BOOL io, SAMR_R_OPEN_POLICY *r_u, char *q, char *base, int align, int depth);
956
957 /*The following definitions come from  rpc_pipes/smbparse.c  */
958
959 char* smb_io_utime(BOOL io, UTIME *t, char *q, char *base, int align, int depth);
960 char* smb_io_time(BOOL io, NTTIME *nttime, char *q, char *base, int align, int depth);
961 void make_dom_sid(DOM_SID *sid, char *domsid);
962 char* smb_io_dom_sid(BOOL io, DOM_SID *sid, char *q, char *base, int align, int depth);
963 void make_uni_hdr(UNIHDR *hdr, int max_len, int len, uint16 terminate);
964 char* smb_io_unihdr(BOOL io, UNIHDR *hdr, char *q, char *base, int align, int depth);
965 void make_uni_hdr2(UNIHDR2 *hdr, int max_len, int len, uint16 terminate);
966 char* smb_io_unihdr2(BOOL io, UNIHDR2 *hdr2, char *q, char *base, int align, int depth);
967 void make_unistr(UNISTR *str, char *buf);
968 char* smb_io_unistr(BOOL io, UNISTR *uni, char *q, char *base, int align, int depth);
969 void make_unistr2(UNISTR2 *str, char *buf, int len);
970 char* smb_io_unistr2(BOOL io, UNISTR2 *uni2, char *q, char *base, int align, int depth);
971 void make_dom_sid2(DOM_SID2 *sid2, char *sid_str);
972 char* smb_io_dom_sid2(BOOL io, DOM_SID2 *sid2, char *q, char *base, int align, int depth);
973 void make_dom_rid2(DOM_RID2 *rid2, uint32 rid);
974 char* smb_io_dom_rid2(BOOL io, DOM_RID2 *rid2, char *q, char *base, int align, int depth);
975 void make_dom_rid3(DOM_RID3 *rid3, uint32 rid);
976 char* smb_io_dom_rid3(BOOL io, DOM_RID3 *rid3, char *q, char *base, int align, int depth);
977 void make_clnt_srv(DOM_CLNT_SRV *log, char *logon_srv, char *comp_name);
978 char* smb_io_clnt_srv(BOOL io, DOM_CLNT_SRV *log, char *q, char *base, int align, int depth);
979 void make_log_info(DOM_LOG_INFO *log, char *logon_srv, char *acct_name,
980                 uint16 sec_chan, char *comp_name);
981 char* smb_io_log_info(BOOL io, DOM_LOG_INFO *log, char *q, char *base, int align, int depth);
982 char* smb_io_chal(BOOL io, DOM_CHAL *chal, char *q, char *base, int align, int depth);
983 char* smb_io_cred(BOOL io, DOM_CRED *cred, char *q, char *base, int align, int depth);
984 void make_clnt_info2(DOM_CLNT_INFO2 *clnt,
985                                 char *logon_srv, char *comp_name,
986                                 DOM_CRED *clnt_cred);
987 char* smb_io_clnt_info2(BOOL io, DOM_CLNT_INFO2 *clnt, char *q, char *base, int align, int depth);
988 char* make_clnt_info(DOM_CLNT_INFO *clnt,
989                 char *logon_srv, char *acct_name,
990                 uint16 sec_chan, char *comp_name,
991                                 DOM_CRED *cred);
992 char* smb_io_clnt_info(BOOL io, DOM_CLNT_INFO *clnt, char *q, char *base, int align, int depth);
993 void make_logon_id(DOM_LOGON_ID *log, uint32 log_id_low, uint32 log_id_high);
994 char* smb_io_logon_id(BOOL io, DOM_LOGON_ID *log, char *q, char *base, int align, int depth);
995 void make_arc4_owf(ARC4_OWF *hash, char data[16]);
996 char* smb_io_arc4_owf(BOOL io, ARC4_OWF *hash, char *q, char *base, int align, int depth);
997 void make_id_info1(DOM_ID_INFO_1 *id, char *domain_name,
998                                 uint32 param_ctrl, uint32 log_id_low, uint32 log_id_high,
999                                 char *user_name, char *wksta_name,
1000                                 char *sess_key,
1001                                 unsigned char lm_cypher[16], unsigned char nt_cypher[16]);
1002 char* smb_io_id_info1(BOOL io, DOM_ID_INFO_1 *id, char *q, char *base, int align, int depth);
1003 void make_sam_info(DOM_SAM_INFO *sam,
1004                                 char *logon_srv, char *comp_name, DOM_CRED *clnt_cred,
1005                                 DOM_CRED *rtn_cred, uint16 logon_level, uint16 switch_value,
1006                                 DOM_ID_INFO_1 *id1);
1007 char* smb_io_sam_info(BOOL io, DOM_SAM_INFO *sam, char *q, char *base, int align, int depth);
1008 char* smb_io_gid(BOOL io, DOM_GID *gid, char *q, char *base, int align, int depth);
1009 void make_rpc_hdr(RPC_HDR *hdr, enum RPC_PKT_TYPE pkt_type, uint8 frag,
1010                                 uint32 call_id, int data_len);
1011 char* smb_io_rpc_hdr(BOOL io, RPC_HDR *rpc, char *q, char *base, int align, int depth);
1012 void make_rpc_iface(RPC_IFACE *ifc, char data[16], uint32 version);
1013 char* smb_io_rpc_iface(BOOL io, RPC_IFACE *ifc, char *q, char *base, int align, int depth);
1014 void make_rpc_addr_str(RPC_ADDR_STR *str, char *name);
1015 char* smb_io_rpc_addr_str(BOOL io, RPC_ADDR_STR *str, char *q, char *base, int align, int depth);
1016 void make_rpc_hdr_bba(RPC_HDR_BBA *bba, uint16 max_tsize, uint16 max_rsize, uint32 assoc_gid);
1017 char* smb_io_rpc_hdr_bba(BOOL io, RPC_HDR_BBA *rpc, char *q, char *base, int align, int depth);
1018 void make_rpc_hdr_rb(RPC_HDR_RB *rpc, 
1019                                 uint16 max_tsize, uint16 max_rsize, uint32 assoc_gid,
1020                                 uint32 num_elements, uint16 context_id, uint8 num_syntaxes,
1021                                 RPC_IFACE *abstract, RPC_IFACE *transfer);
1022 char* smb_io_rpc_hdr_rb(BOOL io, RPC_HDR_RB *rpc, char *q, char *base, int align, int depth);
1023 void make_rpc_results(RPC_RESULTS *res, 
1024                                 uint8 num_results, uint16 result, uint16 reason);
1025 char* smb_io_rpc_results(BOOL io, RPC_RESULTS *res, char *q, char *base, int align, int depth);
1026 void make_rpc_hdr_ba(RPC_HDR_BA *rpc, 
1027                                 uint16 max_tsize, uint16 max_rsize, uint32 assoc_gid,
1028                                 char *pipe_addr,
1029                                 uint8 num_results, uint16 result, uint16 reason,
1030                                 RPC_IFACE *transfer);
1031 char* smb_io_rpc_hdr_ba(BOOL io, RPC_HDR_BA *rpc, char *q, char *base, int align, int depth);
1032 void make_obj_attr(LSA_OBJ_ATTR *attr, uint32 attributes, uint32 sec_qos);
1033 char* smb_io_obj_attr(BOOL io, LSA_OBJ_ATTR *attr, char *q, char *base, int align, int depth);
1034 void make_rpc_hdr_rr(RPC_HDR_RR *hdr, enum RPC_PKT_TYPE pkt_type,
1035                                 uint32 call_id, int data_len, uint8 opnum);
1036 char* smb_io_rpc_hdr_rr(BOOL io, RPC_HDR_RR *rpc, char *q, char *base, int align, int depth);
1037 char* smb_io_pol_hnd(BOOL io, LSA_POL_HND *pol, char *q, char *base, int align, int depth);
1038 char* smb_io_dom_query_3(BOOL io, DOM_QUERY_3 *d_q, char *q, char *base, int align, int depth);
1039 char* smb_io_dom_query_5(BOOL io, DOM_QUERY_3 *d_q, char *q, char *base, int align, int depth);
1040 char* smb_io_dom_query(BOOL io, DOM_QUERY *d_q, char *q, char *base, int align, int depth);
1041 char* smb_io_dom_r_ref(BOOL io, DOM_R_REF *r_r, char *q, char *base, int align, int depth);
1042 char* smb_io_dom_name(BOOL io, DOM_NAME *name, char *q, char *base, int align, int depth);
1043 char* smb_io_neg_flags(BOOL io, NEG_FLAGS *neg, char *q, char *base, int align, int depth);
1044
1045 /*The following definitions come from  rpc_pipes/srvparse.c  */
1046
1047 char* srv_io_share_info1_str(BOOL io, SH_INFO_1_STR *sh1, char *q, char *base, int align, int depth);
1048 char* srv_io_share_info1(BOOL io, SH_INFO_1 *sh1, char *q, char *base, int align, int depth);
1049 char* srv_io_share_1_ctr(BOOL io, SHARE_INFO_1_CTR *ctr, char *q, char *base, int align, int depth);
1050 char* srv_io_q_net_share_enum(BOOL io, SRV_Q_NET_SHARE_ENUM *q_n, char *q, char *base, int align, int depth);
1051 char* srv_io_r_net_share_enum(BOOL io, SRV_R_NET_SHARE_ENUM *r_n, char *q, char *base, int align, int depth);
1052
1053 /*The following definitions come from  rpc_pipes/wksparse.c  */
1054
1055 char* wks_io_q_unknown_0(BOOL io, WKS_Q_UNKNOWN_0 *q_u, char *q, char *base, int align, int depth);
1056 char* wks_io_r_unknown_0(BOOL io, WKS_R_UNKNOWN_0 *r_u, char *q, char *base, int align, int depth);
1057
1058 /*The following definitions come from  server.c  */
1059
1060 struct cli_state *pwd_server_connection(void);
1061 void  *dflt_sig(void);
1062 void  killkids(void);
1063 mode_t unix_mode(int cnum,int dosmode);
1064 int dos_mode(int cnum,char *path,struct stat *sbuf);
1065 int dos_chmod(int cnum,char *fname,int dosmode,struct stat *st);
1066 int file_utime(int cnum, char *fname, struct utimbuf *times);
1067 BOOL set_filetime(int cnum, char *fname, time_t mtime);
1068 BOOL unix_convert(char *name,int cnum,pstring saved_last_component, BOOL *bad_path);
1069 int disk_free(char *path,int *bsize,int *dfree,int *dsize);
1070 int sys_disk_free(char *path,int *bsize,int *dfree,int *dsize);
1071 BOOL check_name(char *name,int cnum);
1072 void sync_file(int fnum);
1073 void close_file(int fnum, BOOL normal_close);
1074 BOOL check_file_sharing(int cnum,char *fname);
1075 int check_share_mode( share_mode_entry *share, int deny_mode, char *fname,
1076                       BOOL fcbopen, int *flags);
1077 void open_file_shared(int fnum,int cnum,char *fname,int share_mode,int ofun,
1078                       int mode,int oplock_request, int *Access,int *action);
1079 int seek_file(int fnum,uint32 pos);
1080 int read_file(int fnum,char *data,uint32 pos,int n);
1081 int write_file(int fnum,char *data,int n);
1082 BOOL become_service(int cnum,BOOL do_chdir);
1083 int find_service(char *service);
1084 int cached_error_packet(char *inbuf,char *outbuf,int fnum,int line);
1085 int unix_error_packet(char *inbuf,char *outbuf,int def_class,uint32 def_code,int line);
1086 int error_packet(char *inbuf,char *outbuf,int error_class,uint32 error_code,int line);
1087 BOOL oplock_break(uint32 dev, uint32 inode, struct timeval *tval);
1088 BOOL request_oplock_break(share_mode_entry *share_entry, 
1089                           uint32 dev, uint32 inode);
1090 BOOL snum_used(int snum);
1091 BOOL reload_services(BOOL test);
1092 int setup_groups(char *user, int uid, int gid, int *p_ngroups, 
1093                  int **p_igroups, gid_t **p_groups,
1094          int **p_attrs);
1095 int make_connection(char *service,char *user,char *password, int pwlen, char *dev,uint16 vuid);
1096 int find_free_file(void );
1097 int reply_corep(char *outbuf);
1098 int reply_coreplus(char *outbuf);
1099 int reply_lanman1(char *outbuf);
1100 int reply_lanman2(char *outbuf);
1101 int reply_nt1(char *outbuf);
1102 void close_cnum(int cnum, uint16 vuid);
1103 BOOL yield_connection(int cnum,char *name,int max_connections);
1104 BOOL claim_connection(int cnum,char *name,int max_connections,BOOL Clear);
1105 void exit_server(char *reason);
1106 void standard_sub(int cnum,char *str);
1107 char *smb_fn_name(int type);
1108 int chain_reply(char *inbuf,char *outbuf,int size,int bufsize);
1109 int construct_reply(char *inbuf,char *outbuf,int size,int bufsize);
1110
1111 /*The following definitions come from  shmem.c  */
1112
1113 struct shmem_ops *smb_shm_open(int ronly);
1114
1115 /*The following definitions come from  shmem_sysv.c  */
1116
1117 struct shmem_ops *sysv_shm_open(int ronly);
1118
1119 /*The following definitions come from  smbdes.c  */
1120
1121 void E_P16(unsigned char *p14,unsigned char *p16);
1122 void E_P24(unsigned char *p21, unsigned char *c8, unsigned char *p24);
1123 void cred_hash1(unsigned char *out,unsigned char *in,unsigned char *key);
1124 void cred_hash2(unsigned char *out,unsigned char *in,unsigned char *key);
1125
1126 /*The following definitions come from  smbencrypt.c  */
1127
1128 void SMBencrypt(uchar *passwd, uchar *c8, uchar p24[24]);
1129 void E_md4hash(uchar *passwd, uchar *p16);
1130 void SMBOWFencrypt(char passwd[16], uchar *c8, uchar p24[24]);
1131 void SMBNTencrypt(uchar *passwd, uchar *c8, uchar p24[24]);
1132 void nt_lm_owf_gen(char *pwd, char nt_p16[16], char p16[16]);
1133
1134 /*The following definitions come from  smberr.c  */
1135
1136 char *smb_errstr(char *inbuf);
1137
1138 /*The following definitions come from  smbpass.c  */
1139
1140 int pw_file_lock(char *name, int type, int secs);
1141 int pw_file_unlock(int fd);
1142 struct smb_passwd *get_smbpwd_entry(char *name, int smb_userid);
1143 BOOL add_smbpwd_entry(struct smb_passwd* pwd);
1144 BOOL mod_smbpwd_entry(struct smb_passwd* pwd);
1145
1146 /*The following definitions come from  status.c  */
1147
1148 void Ucrit_addUsername(pstring username);
1149 unsigned int Ucrit_checkUsername(pstring username);
1150 void Ucrit_addPid(int pid);
1151 unsigned int   Ucrit_checkPid(int pid);
1152
1153 /*The following definitions come from  system.c  */
1154
1155 int sys_select(fd_set *fds,struct timeval *tval);
1156 int sys_select(fd_set *fds,struct timeval *tval);
1157 int sys_unlink(char *fname);
1158 int sys_open(char *fname,int flags,int mode);
1159 DIR *sys_opendir(char *dname);
1160 int sys_stat(char *fname,struct stat *sbuf);
1161 int sys_waitpid(pid_t pid,int *status,int options);
1162 int sys_lstat(char *fname,struct stat *sbuf);
1163 int sys_mkdir(char *dname,int mode);
1164 int sys_rmdir(char *dname);
1165 int sys_chdir(char *dname);
1166 int sys_utime(char *fname,struct utimbuf *times);
1167 int sys_rename(char *from, char *to);
1168 int sys_chmod(char *fname,int mode);
1169 char *sys_getwd(char *s);
1170 int sys_chown(char *fname,int uid,int gid);
1171 int sys_chroot(char *dname);
1172 struct hostent *sys_gethostbyname(char *name);
1173
1174 /*The following definitions come from  time.c  */
1175
1176 void GetTimeOfDay(struct timeval *tval);
1177 void TimeInit(void);
1178 int TimeDiff(time_t t);
1179 struct tm *LocalTime(time_t *t);
1180 time_t interpret_long_date(char *p);
1181 void put_long_date(char *p,time_t t);
1182 BOOL null_mtime(time_t mtime);
1183 void put_dos_date(char *buf,int offset,time_t unixdate);
1184 void put_dos_date2(char *buf,int offset,time_t unixdate);
1185 void put_dos_date3(char *buf,int offset,time_t unixdate);
1186 time_t make_unix_date(void *date_ptr);
1187 time_t make_unix_date2(void *date_ptr);
1188 time_t make_unix_date3(void *date_ptr);
1189 char *timestring(void );
1190
1191 /*The following definitions come from  trans2.c  */
1192
1193 int reply_findclose(char *inbuf,char *outbuf,int length,int bufsize);
1194 int reply_findnclose(char *inbuf,char *outbuf,int length,int bufsize);
1195 int reply_transs2(char *inbuf,char *outbuf,int length,int bufsize);
1196 int reply_trans2(char *inbuf,char *outbuf,int length,int bufsize);
1197
1198 /*The following definitions come from  ubiqx/ubi_dLinkList.c  */
1199
1200
1201 /*The following definitions come from  ufc.c  */
1202
1203 char *ufc_crypt(char *key,char *salt);
1204
1205 /*The following definitions come from  uid.c  */
1206
1207 void init_uid(void);
1208 BOOL become_guest(void);
1209 BOOL become_user(connection_struct *conn, int cnum, uint16 vuid);
1210 BOOL unbecome_user(void );
1211 int smbrun(char *cmd,char *outfile,BOOL shared);
1212 void become_root(BOOL save_dir) ;
1213 void unbecome_root(BOOL restore_dir);
1214
1215 /*The following definitions come from  username.c  */
1216
1217 char *get_home_dir(char *user);
1218 void map_username(char *user);
1219 struct passwd *Get_Pwnam(char *user,BOOL allow_change);
1220 BOOL user_in_list(char *user,char *list);
1221
1222 /*The following definitions come from  util.c  */
1223
1224 void setup_logging(char *pname,BOOL interactive);
1225 void reopen_logs(void);
1226 char *tmpdir(void);
1227 BOOL is_a_socket(int fd);
1228 BOOL next_token(char **ptr,char *buff,char *sep);
1229 char **toktocliplist(int *ctok, char *sep);
1230 void *MemMove(void *dest,void *src,int size);
1231 void array_promote(char *array,int elsize,int element);
1232 void set_socket_options(int fd, char *options);
1233 void close_sockets(void );
1234 BOOL in_group(gid_t group, int current_gid, int ngroups, int *groups);
1235 char *StrCpy(char *dest,char *src);
1236 char *StrnCpy(char *dest,char *src,int n);
1237 void putip(void *dest,void *src);
1238 int name_mangle( char *In, char *Out, char name_type );
1239 BOOL file_exist(char *fname,struct stat *sbuf);
1240 time_t file_modtime(char *fname);
1241 BOOL directory_exist(char *dname,struct stat *st);
1242 uint32 file_size(char *file_name);
1243 char *attrib_string(int mode);
1244 int StrCaseCmp(char *s, char *t);
1245 int StrnCaseCmp(char *s, char *t, int n);
1246 BOOL strequal(char *s1, char *s2);
1247 BOOL strnequal(char *s1,char *s2,int n);
1248 BOOL strcsequal(char *s1,char *s2);
1249 void strlower(char *s);
1250 void strupper(char *s);
1251 void strnorm(char *s);
1252 BOOL strisnormal(char *s);
1253 void string_replace(char *s,char oldc,char newc);
1254 void unix_format(char *fname);
1255 void dos_format(char *fname);
1256 void show_msg(char *buf);
1257 int smb_len(char *buf);
1258 void _smb_setlen(char *buf,int len);
1259 void smb_setlen(char *buf,int len);
1260 int set_message(char *buf,int num_words,int num_bytes,BOOL zero);
1261 int smb_numwords(char *buf);
1262 int smb_buflen(char *buf);
1263 int smb_buf_ofs(char *buf);
1264 char *smb_buf(char *buf);
1265 int smb_offset(char *p,char *buf);
1266 char *skip_string(char *buf,int n);
1267 BOOL trim_string(char *s,char *front,char *back);
1268 void dos_clean_name(char *s);
1269 void unix_clean_name(char *s);
1270 int ChDir(char *path);
1271 char *GetWd(char *str);
1272 BOOL reduce_name(char *s,char *dir,BOOL widelinks);
1273 void expand_mask(char *Mask,BOOL doext);
1274 BOOL strhasupper(char *s);
1275 BOOL strhaslower(char *s);
1276 int count_chars(char *s,char c);
1277 void make_dir_struct(char *buf,char *mask,char *fname,unsigned int size,int mode,time_t date);
1278 void close_low_fds(void);
1279 int set_blocking(int fd, BOOL set);
1280 int write_socket(int fd,char *buf,int len);
1281 int read_udp_socket(int fd,char *buf,int len);
1282 int read_with_timeout(int fd,char *buf,int mincnt,int maxcnt,long time_out);
1283 int read_max_udp(int fd,char *buffer,int bufsize,int maxtime);
1284 int TvalDiff(struct timeval *tvalold,struct timeval *tvalnew);
1285 BOOL send_keepalive(int client);
1286 int read_data(int fd,char *buffer,int N);
1287 int write_data(int fd,char *buffer,int N);
1288 int transfer_file(int infd,int outfd,int n,char *header,int headlen,int align);
1289 int read_smb_length(int fd,char *inbuf,int timeout);
1290 BOOL receive_smb(int fd,char *buffer, int timeout);
1291 BOOL receive_local_message(int fd, char *buffer, int buffer_len, int timeout);
1292 BOOL push_local_message(char *buf, int msg_len);
1293 BOOL receive_message_or_smb(int smbfd, int oplock_fd, 
1294                            char *buffer, int buffer_len, 
1295                            int timeout, BOOL *got_smb);
1296 BOOL send_smb(int fd,char *buffer);
1297 char *name_ptr(char *buf,int ofs);
1298 int name_extract(char *buf,int ofs,char *name);
1299 int name_len( char *s );
1300 BOOL send_one_packet(char *buf,int len,struct in_addr ip,int port,int type);
1301 void msleep(int t);
1302 BOOL in_list(char *s,char *list,BOOL casesensitive);
1303 BOOL string_init(char **dest,char *src);
1304 void string_free(char **s);
1305 BOOL string_set(char **dest,char *src);
1306 BOOL string_sub(char *s,char *pattern,char *insert);
1307 BOOL do_match(char *str, char *regexp, int case_sig);
1308 BOOL mask_match(char *str, char *regexp, int case_sig,BOOL trans2);
1309 void become_daemon(void);
1310 BOOL yesno(char *p);
1311 char *fgets_slash(char *s2,int maxlen,FILE *f);
1312 int set_filelen(int fd, long len);
1313 int byte_checksum(char *buf,int len);
1314 char *dirname_dos(char *path,char *buf);
1315 void *Realloc(void *p,int size);
1316 void Abort(void );
1317 BOOL get_myname(char *my_name,struct in_addr *ip);
1318 BOOL ip_equal(struct in_addr ip1,struct in_addr ip2);
1319 int open_socket_in(int type, int port, int dlevel,uint32 socket_addr);
1320 int open_socket_out(int type, struct in_addr *addr, int port ,int timeout);
1321 int interpret_protocol(char *str,int def);
1322 int interpret_security(char *str,int def);
1323 uint32 interpret_addr(char *str);
1324 struct in_addr *interpret_addr2(char *str);
1325 BOOL zero_ip(struct in_addr ip);
1326 void reset_globals_after_fork();
1327 char *client_name(void);
1328 char *client_addr(void);
1329 char *automount_server(char *user_name);
1330 void standard_sub_basic(char *str);
1331 BOOL same_net(struct in_addr ip1,struct in_addr ip2,struct in_addr mask);
1332 int PutUniCode(char *dst,char *src);
1333 struct hostent *Get_Hostbyname(char *name);
1334 BOOL process_exists(int pid);
1335 char *uidtoname(int uid);
1336 char *gidtoname(int gid);
1337 void BlockSignals(BOOL block,int signum);
1338 void ajt_panic(void);
1339 char *readdirname(void *p);
1340 BOOL is_in_path(char *name, name_compare_entry *namelist);
1341 void set_namearray(name_compare_entry **ppname_array, char *namelist);
1342 void free_namearray(name_compare_entry *name_array);
1343 BOOL fcntl_lock(int fd,int op,uint32 offset,uint32 count,int type);
1344 int file_lock(char *name,int timeout);
1345 void file_unlock(int fd);
1346 BOOL is_myname(char *s);
1347 void set_remote_arch(enum remote_arch_types type);
1348 enum remote_arch_types get_remote_arch();
1349 char *skip_unicode_string(char *buf,int n);
1350 char *unistrn2(uint16 *buf, int len);
1351 char *unistr2(uint16 *buf);
1352 int struni2(uint16 *p, char *buf);
1353 char *unistr(char *buf);
1354 int unistrncpy(char *dst, char *src, int len);
1355 int unistrcpy(char *dst, char *src);
1356 void fstrcpy(char *dest, char *src);
1357 void pstrcpy(char *dest, char *src);
1358 char *align4(char *q, char *base);
1359 char *align2(char *q, char *base);
1360 char *align_offset(char *q, char *base, int align_offset_len);
1361 void print_asc(int level, unsigned char *buf,int len);
1362 void dump_data(int level,char *buf1,int len);
1363 char *tab_depth(int depth);