3 /* This file is automatically generated with "make proto". DO NOT EDIT */
6 /*The following definitions come from browserd/browserd.c */
8 msrpc_service_fns
*get_service_fns(void);
9 uint32
_brs_query_info( const UNISTR2
*srv_name
, uint16 switch_value
,
12 /*The following definitions come from client/client.c */
14 void do_list(const char *mask
,uint16 attribute
,void (*fn
)(file_info
*),BOOL rec
, BOOL dirs
);
15 struct cli_state
*do_connect(char *server
, char *share
, int smb_port
);
17 /*The following definitions come from client/clitar.c */
20 void cmd_tarmode(void);
21 void cmd_setmode(void);
23 int process_tar(void);
24 int tar_parseargs(int argc
, char *argv
[], char *Optarg
, int Optind
);
26 /*The following definitions come from groupdb/aliasdb.c */
28 BOOL
initialise_alias_db(void);
29 LOCAL_GRP
*iterate_getaliasgid(gid_t gid
, LOCAL_GRP_MEMBER
**mem
, int *num_mem
);
30 LOCAL_GRP
*iterate_getaliasrid(uint32 rid
, LOCAL_GRP_MEMBER
**mem
, int *num_mem
);
31 LOCAL_GRP
*iterate_getaliasntnam(const char *name
, LOCAL_GRP_MEMBER
**mem
, int *num_mem
);
32 BOOL
add_domain_alias(LOCAL_GRP
**alss
, int *num_alss
, LOCAL_GRP
*als
);
33 BOOL
iterate_getuseraliasntnam(const char *user_name
, LOCAL_GRP
**alss
, int *num_alss
);
34 BOOL
enumdomaliases(LOCAL_GRP
**alss
, int *num_alss
);
35 void *startaliasent(BOOL update
);
36 void endaliasent(void *vp
);
37 LOCAL_GRP
*getaliasent(void *vp
, LOCAL_GRP_MEMBER
**mem
, int *num_mem
);
38 BOOL
add_alias_entry(LOCAL_GRP
*newgrp
);
39 BOOL
mod_alias_entry(LOCAL_GRP
* als
);
40 BOOL
del_alias_entry(uint32 rid
);
41 BOOL
add_alias_member(uint32 rid
, const DOM_SID
*member_sid
);
42 BOOL
del_alias_member(uint32 rid
, const DOM_SID
*member_sid
);
43 LOCAL_GRP
*getaliasntnam(const char *name
, LOCAL_GRP_MEMBER
**mem
, int *num_mem
);
44 LOCAL_GRP
*getaliasrid(uint32 alias_rid
, LOCAL_GRP_MEMBER
**mem
, int *num_mem
);
45 LOCAL_GRP
*getaliasgid(gid_t gid
, LOCAL_GRP_MEMBER
**mem
, int *num_mem
);
46 BOOL
getuseraliasntnam(const char *user_name
, LOCAL_GRP
**als
, int *num_alss
);
47 void aldb_init_als(LOCAL_GRP
*als
);
48 BOOL
make_alias_line(char *p
, int max_len
,
50 LOCAL_GRP_MEMBER
**mem
, int *num_mem
);
52 /*The following definitions come from groupdb/aliasfile.c */
54 struct aliasdb_ops
*file_initialise_alias_db(void);
56 /*The following definitions come from groupdb/aliasldap.c */
58 struct aliasdb_ops
*ldap_initialise_alias_db(void);
60 /*The following definitions come from groupdb/aliasnt5ldap.c */
63 /*The following definitions come from groupdb/aliasunix.c */
65 BOOL
get_unixalias_members(struct group
*grp
,
66 int *num_mem
, LOCAL_GRP_MEMBER
**members
);
67 struct aliasdb_ops
*unix_initialise_alias_db(void);
69 /*The following definitions come from groupdb/builtindb.c */
71 BOOL
initialise_builtin_db(void);
72 LOCAL_GRP
*iterate_getbuiltingid(gid_t gid
, LOCAL_GRP_MEMBER
**mem
, int *num_mem
);
73 LOCAL_GRP
*iterate_getbuiltinrid(uint32 rid
, LOCAL_GRP_MEMBER
**mem
, int *num_mem
);
74 LOCAL_GRP
*iterate_getbuiltinntnam(const char *name
, LOCAL_GRP_MEMBER
**mem
, int *num_mem
);
75 BOOL
add_domain_builtin(LOCAL_GRP
**blts
, int *num_blts
, LOCAL_GRP
*blt
);
76 BOOL
iterate_getuserbuiltinntnam(const char *user_name
, LOCAL_GRP
**blts
, int *num_blts
);
77 BOOL
enumdombuiltins(LOCAL_GRP
**blts
, int *num_blts
);
78 void *startbuiltinent(BOOL update
);
79 void endbuiltinent(void *vp
);
80 LOCAL_GRP
*getbuiltinent(void *vp
, LOCAL_GRP_MEMBER
**mem
, int *num_mem
);
81 BOOL
add_builtin_entry(LOCAL_GRP
*newblt
);
82 BOOL
mod_builtin_entry(LOCAL_GRP
* blt
);
83 BOOL
add_builtin_member(uint32 rid
, const DOM_SID
*member_sid
);
84 BOOL
del_builtin_member(uint32 rid
, const DOM_SID
*member_sid
);
85 LOCAL_GRP
*getbuiltinntnam(const char *name
, LOCAL_GRP_MEMBER
**mem
, int *num_mem
);
86 LOCAL_GRP
*getbuiltinrid(uint32 builtin_rid
, LOCAL_GRP_MEMBER
**mem
, int *num_mem
);
87 LOCAL_GRP
*getbuiltingid(gid_t gid
, LOCAL_GRP_MEMBER
**mem
, int *num_mem
);
88 BOOL
getuserbuiltinntnam(const char *user_name
, LOCAL_GRP
**blt
, int *num_blts
);
89 void bidb_init_blt(LOCAL_GRP
*blt
);
90 BOOL
make_builtin_line(char *p
, int max_len
,
92 LOCAL_GRP_MEMBER
**mem
, int *num_mem
);
94 /*The following definitions come from groupdb/builtinldap.c */
96 struct aliasdb_ops
*ldap_initialise_builtin_db(void);
98 /*The following definitions come from groupdb/builtinnt5ldap.c */
101 /*The following definitions come from groupdb/builtinunix.c */
103 BOOL
get_unixbuiltin_members(struct group
*grp
,
104 int *num_mem
, LOCAL_GRP_MEMBER
**members
);
105 struct aliasdb_ops
*unix_initialise_builtin_db(void);
107 /*The following definitions come from groupdb/groupdb.c */
109 BOOL
initialise_group_db(void);
110 DOMAIN_GRP
*iterate_getgroupgid(gid_t gid
, DOMAIN_GRP_MEMBER
**mem
, int *num_mem
);
111 DOMAIN_GRP
*iterate_getgrouprid(uint32 rid
, DOMAIN_GRP_MEMBER
**mem
, int *num_mem
);
112 DOMAIN_GRP
*iterate_getgroupntnam(const char *name
, DOMAIN_GRP_MEMBER
**mem
, int *num_mem
);
113 BOOL
add_domain_group(DOMAIN_GRP
**grps
, int *num_grps
, DOMAIN_GRP
*grp
);
114 BOOL
iterate_getusergroupsnam(const char *user_name
, DOMAIN_GRP
**grps
, int *num_grps
);
115 BOOL
enumdomgroups(DOMAIN_GRP
**grps
, int *num_grps
);
116 void *startgroupent(BOOL update
);
117 void endgroupent(void *vp
);
118 DOMAIN_GRP
*getgroupent(void *vp
, DOMAIN_GRP_MEMBER
**mem
, int *num_mem
);
119 BOOL
add_group_entry(DOMAIN_GRP
*newgrp
);
120 BOOL
del_group_entry(uint32 rid
);
121 BOOL
mod_group_entry(DOMAIN_GRP
* grp
);
122 BOOL
add_group_member(uint32 rid
, uint32 member_rid
);
123 BOOL
del_group_member(uint32 rid
, uint32 member_rid
);
124 DOMAIN_GRP
*getgroupntnam(const char *name
, DOMAIN_GRP_MEMBER
**mem
, int *num_mem
);
125 DOMAIN_GRP
*getgrouprid(uint32 group_rid
, DOMAIN_GRP_MEMBER
**mem
, int *num_mem
);
126 DOMAIN_GRP
*getgroupgid(gid_t gid
, DOMAIN_GRP_MEMBER
**mem
, int *num_mem
);
127 BOOL
getusergroupsntnam(const char *user_name
, DOMAIN_GRP
**grp
, int *num_grps
);
128 void gpdb_init_grp(DOMAIN_GRP
*grp
);
129 BOOL
make_group_line(char *p
, int max_len
,
131 DOMAIN_GRP_MEMBER
**mem
, int *num_mem
);
133 /*The following definitions come from groupdb/groupfile.c */
135 struct groupdb_ops
*file_initialise_group_db(void);
137 /*The following definitions come from groupdb/groupldap.c */
139 struct groupdb_ops
*ldap_initialise_group_db(void);
141 /*The following definitions come from groupdb/groupnt5ldap.c */
144 /*The following definitions come from groupdb/groupunix.c */
146 BOOL
get_unixgroup_members(struct group
*grp
,
147 int *num_mem
, DOMAIN_GRP_MEMBER
**members
);
148 struct groupdb_ops
*unix_initialise_group_db(void);
150 /*The following definitions come from lib/access.c */
152 BOOL
allow_access(char *deny_list
,char *allow_list
,
153 char *cname
,char *caddr
);
154 BOOL
check_access(int sock
, char *allow_list
, char *deny_list
);
156 /*The following definitions come from lib/bitmap.c */
158 struct bitmap
*bitmap_allocate(int n
);
159 BOOL
bitmap_set(struct bitmap
*bm
, unsigned i
);
160 BOOL
bitmap_clear(struct bitmap
*bm
, unsigned i
);
161 BOOL
bitmap_query(struct bitmap
*bm
, unsigned i
);
162 int bitmap_find(struct bitmap
*bm
, unsigned ofs
);
164 /*The following definitions come from lib/charcnv.c */
166 char *unix2dos_format(char *str
,BOOL overwrite
);
167 char *dos2unix_format(char *str
, BOOL overwrite
);
168 void interpret_character_set(char *str
);
170 /*The following definitions come from lib/charset.c */
172 void charset_initialise(void);
173 void codepage_initialise(int client_codepage
);
174 void add_char_string(char *s
);
176 /*The following definitions come from lib/crc32.c */
178 uint32
crc32_calc_buffer( uint32 count
, char *buffer
);
180 /*The following definitions come from lib/debug.c */
182 BOOL
dbg_interactive(void);
183 void sig_usr2( int sig
);
184 void sig_usr1( int sig
);
185 void setup_logging( char *pname
, BOOL interactive
);
186 void reopen_logs( void );
187 void force_check_log_size( void );
188 void dbgflush( void );
189 BOOL
dbghdr( int level
, char *file
, char *func
, int line
);
190 dbg_Token
dbg_char2token( dbg_Token
*state
, int c
);
192 /*The following definitions come from lib/domain_namemap.c */
194 BOOL
pwdb_rid_is_user(uint32 rid
);
195 BOOL
map_unix_group_name(char *group_name
, DOM_NAME_MAP
*grp_info
);
196 BOOL
map_unix_alias_name(char *alias_name
, DOM_NAME_MAP
*grp_info
);
197 BOOL
map_nt_alias_name(char *ntalias_name
, char *nt_domain
, DOM_NAME_MAP
*grp_info
);
198 BOOL
map_nt_group_name(char *ntgroup_name
, char *nt_domain
, DOM_NAME_MAP
*grp_info
);
199 BOOL
map_alias_sid(DOM_SID
*psid
, DOM_NAME_MAP
*grp_info
);
200 BOOL
map_group_sid(DOM_SID
*psid
, DOM_NAME_MAP
*grp_info
);
201 BOOL
lookupsmbpwnam(const char *unix_usr_name
, DOM_NAME_MAP
*grp
);
202 BOOL
lookupsmbpwuid(uid_t uid
, DOM_NAME_MAP
*gmep
);
203 BOOL
lookupsmbpwntnam(const char *fullntname
, DOM_NAME_MAP
*gmep
);
204 BOOL
lookupsmbpwsid(DOM_SID
*sid
, DOM_NAME_MAP
*gmep
);
205 BOOL
lookupsmbgrpnam(const char *unix_grp_name
, DOM_NAME_MAP
*grp
);
206 BOOL
lookupsmbgrpsid(DOM_SID
*sid
, DOM_NAME_MAP
*gmep
);
207 BOOL
lookupsmbgrpgid(gid_t gid
, DOM_NAME_MAP
*gmep
);
208 const struct passwd
*map_nt_and_unix_username(const char *domain
,
210 char *unix_user
, char *nt_user
);
212 /*The following definitions come from lib/doscalls.c */
214 int dos_unlink(char *fname
);
215 int dos_open(char *fname
,int flags
,mode_t mode
);
216 DIR *dos_opendir(char *dname
);
217 char *dos_readdirname(DIR *p
);
218 int dos_stat(char *fname
,SMB_STRUCT_STAT
*sbuf
);
219 int dos_lstat(char *fname
,SMB_STRUCT_STAT
*sbuf
);
220 int dos_mkdir(char *dname
,mode_t mode
);
221 int dos_rmdir(char *dname
);
222 int dos_chdir(char *dname
);
223 int dos_utime(char *fname
,struct utimbuf
*times
);
224 int copy_reg(char *source
, const char *dest
);
225 int dos_rename(char *from
, char *to
);
226 int dos_chmod(char *fname
,mode_t mode
);
227 char *dos_getwd(char *unix_path
);
228 BOOL
dos_file_exist(char *fname
,SMB_STRUCT_STAT
*sbuf
);
229 BOOL
dos_directory_exist(char *dname
,SMB_STRUCT_STAT
*st
);
230 time_t dos_file_modtime(char *fname
);
231 SMB_OFF_T
dos_file_size(char *file_name
);
232 int dos_ChDir(char *path
);
233 char *dos_GetWd(char *path
);
235 /*The following definitions come from lib/fault.c */
237 void fault_setup(void (*fn
)(void *));
239 /*The following definitions come from lib/genrand.c */
241 void generate_random_buffer( unsigned char *out
, int len
, BOOL re_seed
);
243 /*The following definitions come from lib/getsmbpass.c */
245 char *getsmbpass(char *prompt
) ;
247 /*The following definitions come from lib/hmacmd5.c */
249 void hmac_md5_init_rfc2104(uchar
* key
, int key_len
, HMACMD5Context
*ctx
);
250 void hmac_md5_init_limK_to_64(const uchar
* key
, int key_len
,
251 HMACMD5Context
*ctx
);
252 void hmac_md5_update(const uchar
* text
, int text_len
, HMACMD5Context
*ctx
);
253 void hmac_md5_final(uchar
*digest
, HMACMD5Context
*ctx
);
254 void hmac_md5( uchar key
[16], uchar
* data
, int data_len
, uchar
* digest
);
256 /*The following definitions come from lib/interface.c */
258 void load_interfaces(void);
259 void iface_set_default(char *ip
,char *bcast
,char *nmask
);
260 BOOL
ismyip(struct in_addr ip
);
261 BOOL
is_local_net(struct in_addr from
);
262 int iface_count(void);
263 BOOL
we_are_multihomed(void);
264 struct interface
*get_interface(int n
);
265 struct in_addr
*iface_n_ip(int n
);
266 unsigned iface_hash(void);
267 struct in_addr
*iface_bcast(struct in_addr ip
);
268 struct in_addr
*iface_ip(struct in_addr ip
);
270 /*The following definitions come from lib/kanji.c */
272 void interpret_coding_system(char *str
);
273 BOOL
is_multibyte_codepage(void);
274 void initialize_multibyte_vectors( int client_codepage
);
276 /*The following definitions come from lib/md4.c */
278 void mdfour(unsigned char *out
, const unsigned char *in
, int n
);
280 /*The following definitions come from lib/md5.c */
282 void MD5Init(struct MD5Context
*ctx
);
283 void MD5Update(struct MD5Context
*ctx
, uchar
const *buf
, unsigned len
);
284 void MD5Final(uchar digest
[16], struct MD5Context
*ctx
);
285 void MD5Transform(uint32 buf
[4], const uchar inext
[64]);
287 /*The following definitions come from lib/msrpc-agent.c */
289 void start_msrpc_agent(char *pipe_name
);
291 /*The following definitions come from lib/msrpc-client.c */
293 BOOL
receive_msrpc(int fd
, prs_struct
*data
, unsigned int timeout
);
294 BOOL
msrpc_send(int fd
, prs_struct
*ps
);
295 BOOL
msrpc_receive(int fd
, prs_struct
*ps
);
296 BOOL
msrpc_connect(struct msrpc_state
*msrpc
, const char *pipe_name
);
297 void msrpc_close_socket(struct msrpc_state
*msrpc
);
298 void msrpc_sockopt(struct msrpc_state
*msrpc
, char *options
);
299 BOOL
msrpc_connect_auth(struct msrpc_state
*msrpc
,
300 const vuser_key
*key
,
301 const char* pipename
);
302 struct msrpc_state
*msrpc_initialise(struct msrpc_state
*msrpc
,
303 const vuser_key
*key
);
304 void msrpc_shutdown(struct msrpc_state
*msrpc
);
305 BOOL
msrpc_establish_connection(struct msrpc_state
*msrpc
,
306 const vuser_key
*key
,
307 const char *pipe_name
);
309 /*The following definitions come from lib/msrpc_use.c */
311 void init_msrpc_use(void);
312 void free_msrpc_use(void);
313 struct msrpc_state
*msrpc_use_add(const char* pipe_name
,
314 const vuser_key
*key
,
316 BOOL
msrpc_use_del(const char* pipe_name
,
318 BOOL
*connection_closed
);
319 void msrpc_net_use_enum(uint32
*num_cons
, struct use_info
***use
);
321 /*The following definitions come from lib/netmask.c */
323 int get_netmask(struct in_addr
*ipaddr
, struct in_addr
*nmask
);
325 /*The following definitions come from lib/passcheck.c */
327 BOOL
smb_password_ok(uint16 acct_ctrl
,
328 uchar smb_passwd
[16],
329 uchar smb_nt_passwd
[16],
330 const uchar challenge
[8],
331 const char *user
, const char *domain
,
332 const uchar
*lm_pass
, size_t lm_pwd_len
,
333 const uchar
*nt_pass
, size_t nt_pwd_len
,
334 uchar user_sess_key
[16]);
336 /*The following definitions come from lib/pidfile.c */
338 pid_t
pidfile_pid(char *name
);
339 void pidfile_create(char *name
);
341 /*The following definitions come from lib/replace.c */
343 char *rep_inet_ntoa(struct in_addr ip
);
345 /*The following definitions come from lib/set_uid.c */
347 const vuser_key
*get_sec_ctx(void);
349 BOOL
become_uid(uid_t uid
);
350 BOOL
become_gid(gid_t gid
);
351 BOOL
unbecome_to_initial_uid(void);
352 BOOL
become_id(uid_t uid
,gid_t gid
);
353 BOOL
become_unix_sec_ctx(const vuser_key
*k
, connection_struct
*conn
,
354 uid_t new_uid
, gid_t new_gid
,
355 int n_groups
, gid_t
* groups
);
356 BOOL
become_guest(void);
357 void become_root(BOOL save_dir
) ;
358 void unbecome_root(BOOL restore_dir
);
360 /*The following definitions come from lib/set_vuid.c */
362 void init_vuid(void);
363 BOOL
become_vuser(const vuser_key
*k
);
364 BOOL
unbecome_vuser(void);
366 /*The following definitions come from lib/sids.c */
368 struct sid_map
* add_sidmap_to_array(uint32
*len
, struct sid_map
***array
,
369 const struct sid_map
*name
);
370 void get_sam_domain_name(void);
371 BOOL
get_member_domain_sid(void);
372 void generate_wellknown_sids(void);
373 BOOL
create_sidmap_table(void);
374 BOOL
generate_sam_sid(char *domain_name
, DOM_SID
*sid
);
375 BOOL
pwdb_initialise(BOOL is_server
);
376 BOOL
map_domain_name_to_sid(DOM_SID
*sid
, char **nt_domain
);
377 BOOL
map_domain_sid_to_name(DOM_SID
*sid
, char *nt_domain
);
378 BOOL
map_domain_sid_to_any_dc(DOM_SID
*sid
, char *dc_name
);
379 BOOL
split_domain_name(const char *fullname
, char *domain
, char *name
);
380 BOOL
enumtrustdoms(char ***doms
, uint32
*num_entries
);
381 BOOL
enumdomains(char ***doms
, uint32
*num_entries
);
383 /*The following definitions come from lib/signal.c */
385 void BlockSignals(BOOL block
,int signum
);
386 void CatchSignal(int signum
,void (*handler
)(int ));
387 void CatchChild(void);
388 void CatchChildLeaveStatus(void);
390 /*The following definitions come from lib/slprintf.c */
392 int vslprintf(char *str
, int n
, char *format
, va_list ap
);
394 /*The following definitions come from lib/smbrun.c */
396 int smbrun(char *cmd
,char *outfile
,BOOL shared
);
398 /*The following definitions come from lib/snprintf.c */
401 /*The following definitions come from lib/stub_uid.c */
403 void become_root(BOOL save_dir
);
404 void unbecome_root(BOOL restore_dir
);
406 /*The following definitions come from lib/sursalgdomonly.c */
408 BOOL
sursalg_sam_sid_to_unixid(DOM_SID
*sid
, uint32 type
, uint32
*id
);
409 BOOL
sursalg_unixid_to_sam_sid(uint32 id
, uint32 type
, DOM_SID
*sid
,
412 /*The following definitions come from lib/sursalgnt5ldap.c */
414 BOOL
nt5ldap_sursalg_sam_sid_to_unixid(LDAPDB
*hds
, DOM_SID
*sid
, uint32 type
, uint32
*id
);
415 BOOL
nt5ldap_sursalg_unixid_to_sam_sid(LDAPDB
*hds
, uint32 id
, uint32 type
, DOM_SID
*sid
,
418 /*The following definitions come from lib/system.c */
420 int sys_select(int maxfd
, fd_set
*fds
, fd_set
*w_fds
, struct timeval
*tval
);
421 int sys_select(int maxfd
, fd_set
*r_fds
, fd_set
*w_fds
, struct timeval
*tval
);
422 int sys_stat(const char *fname
,SMB_STRUCT_STAT
*sbuf
);
423 int sys_fstat(int fd
,SMB_STRUCT_STAT
*sbuf
);
424 int sys_lstat(const char *fname
,SMB_STRUCT_STAT
*sbuf
);
425 int sys_ftruncate(int fd
, SMB_OFF_T offset
);
426 SMB_OFF_T
sys_lseek(int fd
, SMB_OFF_T offset
, int whence
);
427 int sys_fseek(FILE *fp
, SMB_OFF_T offset
, int whence
);
428 SMB_OFF_T
sys_ftell(FILE *fp
);
429 int sys_creat(const char *path
, mode_t mode
);
430 int sys_open(const char *path
, int oflag
, mode_t mode
);
431 FILE *sys_fopen(const char *path
, const char *type
);
432 void *sys_mmap(void *addr
, size_t len
, int prot
, int flags
, int fd
, SMB_OFF_T offset
);
433 int sys_waitpid(pid_t pid
,int *status
,int options
);
434 char *sys_getwd(char *s
);
435 int sys_chown(const char *fname
,uid_t uid
,gid_t gid
);
436 int sys_chroot(const char *dname
);
437 struct hostent
*sys_gethostbyname(const char *name
);
438 BOOL
set_process_capability( uint32 cap_flag
, BOOL enable
);
439 BOOL
set_inherited_process_capability( uint32 cap_flag
, BOOL enable
);
440 long sys_random(void);
441 void sys_srandom(unsigned int seed
);
442 int sys_getgroups(int setlen
, gid_t
*gidset
);
443 struct passwd
*copy_passwd_struct(struct passwd
*pass
);
444 struct passwd
*sys_getpwnam(const char *name
);
445 struct passwd
*sys_getpwuid(uid_t uid
);
447 /*The following definitions come from lib/time.c */
449 void GetTimeOfDay(struct timeval
*tval
);
451 int TimeDiff(time_t t
);
452 struct tm
*LocalTime(time_t *t
);
453 time_t nt_time_to_unix(const NTTIME
*nt
);
454 time_t interpret_long_date(char *p
);
455 void unix_to_nt_time(NTTIME
*nt
, time_t t
);
456 void init_nt_time(NTTIME
*nt
);
457 void put_long_date(char *p
,time_t t
);
458 BOOL
null_mtime(time_t mtime
);
459 void put_dos_date(char *buf
,int offset
,time_t unixdate
);
460 void put_dos_date2(char *buf
,int offset
,time_t unixdate
);
461 void put_dos_date3(char *buf
,int offset
,time_t unixdate
);
462 time_t make_unix_date(void *date_ptr
);
463 time_t make_unix_date2(void *date_ptr
);
464 time_t make_unix_date3(void *date_ptr
);
465 char *http_timestring(time_t t
);
466 char *timestring(void );
467 time_t get_create_time(SMB_STRUCT_STAT
*st
,BOOL fake_dirs
);
469 /*The following definitions come from lib/ufc.c */
471 char *ufc_crypt(char *key
,char *salt
);
473 /*The following definitions come from lib/username.c */
475 struct passwd
*hashed_getpwnam(const char *name
);
476 char *uidtoname(uid_t uid
);
477 char *get_unixhome_dir(char *user
);
478 BOOL
map_username(char *user
);
479 const struct passwd
*Get_Pwnam(char *user
,BOOL allow_change
);
480 BOOL
user_ok(char *user
,int snum
);
481 BOOL
user_in_list(char *user
,char *list
);
483 /*The following definitions come from lib/util.c */
485 BOOL
init_myworkgroup(void);
487 BOOL
in_group(gid_t group
, gid_t current_gid
, int ngroups
, gid_t
*groups
);
488 uint32
get_number(const char *tmp
);
489 char *Atoic(char *p
, int *n
, char *c
);
490 uint32
*add_num_to_list(uint32
**num
, int *count
, int val
);
491 char *get_numlist(char *p
, uint32
**num
, int *count
);
492 void putip(void *dest
,void *src
);
493 BOOL
file_exist(char *fname
,SMB_STRUCT_STAT
*sbuf
);
494 int file_rename(char *from
, char *to
);
495 time_t file_modtime(char *fname
);
496 BOOL
directory_exist(char *dname
,SMB_STRUCT_STAT
*st
);
497 SMB_OFF_T
file_size(char *file_name
);
498 char *attrib_string(uint16 mode
);
499 void unix_format(char *fname
);
500 void dos_format(char *fname
);
501 void show_msg(char *buf
);
502 int smb_len(char *buf
);
503 void _smb_setlen(char *buf
,int len
);
504 void smb_setlen(char *buf
,int len
);
505 int set_message(char *buf
,int num_words
,int num_bytes
,BOOL zero
);
506 int smb_buflen(char *buf
);
507 char *smb_buf(char *buf
);
508 int smb_offset(char *p
,char *buf
);
509 void dos_clean_name(char *s
);
510 void make_dir_struct(char *buf
,char *mask
,char *fname
,SMB_OFF_T size
,int mode
,time_t date
);
511 void close_low_fds(void);
512 int set_blocking(int fd
, BOOL set
);
513 int TvalDiff(struct timeval
*tvalold
,struct timeval
*tvalnew
);
514 SMB_OFF_T
transfer_file(int infd
,int outfd
,SMB_OFF_T n
,char *header
,int headlen
,int align
);
516 BOOL
get_file_match(const char* dirname
, const char* regexp
,
517 uint32
*total
, char ***list
);
518 BOOL
do_match(char *str
, const char *regexp
, int case_sig
);
519 BOOL
mask_match(char *str
, char *regexp
, int case_sig
,BOOL trans2
);
520 void become_daemon(void);
522 int set_filelen(int fd
, SMB_OFF_T len
);
523 void *Realloc(void *p
,size_t size
);
524 void safe_free(void *p
);
525 BOOL
get_myname(char *my_name
,struct in_addr
*ip
);
526 BOOL
ip_equal(struct in_addr ip1
,struct in_addr ip2
);
527 int interpret_protocol(char *str
,int def
);
528 uint32
interpret_addr(char *str
);
529 struct in_addr
*interpret_addr2(char *str
);
530 BOOL
zero_ip(struct in_addr ip
);
531 BOOL
matchname(char *remotehost
,struct in_addr addr
);
532 void standard_sub_basic(char *str
);
533 void standard_sub_vuser(const user_struct
*vuser
, char *str
);
534 void standard_sub(connection_struct
*conn
, user_struct
*vuser
, char *str
);
535 BOOL
same_net(struct in_addr ip1
,struct in_addr ip2
,struct in_addr mask
);
536 struct hostent
*Get_Hostbyname(const char *name
);
537 BOOL
process_exists(int pid
);
538 int get_unixgroups(const char *user
, uid_t uid
, gid_t gid
, int *p_ngroups
, gid_t
**p_groups
);
539 BOOL
get_unix_grps(int *p_ngroups
, struct group
**p_groups
);
540 void free_unix_grps(int ngroups
, struct group
*p_groups
);
541 char *gidtoname(gid_t gid
);
542 BOOL
nametogid(const char *name
, gid_t
*gid
);
543 BOOL
nametouid(const char *name
, uid_t
*uid
);
544 void smb_panic(char *why
);
545 char *readdirname(DIR *p
);
546 BOOL
is_in_path(char *name
, name_compare_entry
*namelist
);
547 void set_namearray(name_compare_entry
**ppname_array
, char *namelist
);
548 void free_namearray(name_compare_entry
*name_array
);
549 BOOL
is_myname(char *s
);
550 void set_remote_arch(enum remote_arch_types type
);
551 enum remote_arch_types
get_remote_arch(void);
552 char *align4(char *q
, char *base
);
553 char *align2(char *q
, char *base
);
554 void out_ascii(FILE *f
, const uchar
*buf
,int len
);
555 void out_struct(FILE *f
, const char *buf1
,int len
, int per_line
);
556 void out_data(FILE *f
, const char *buf1
,int len
, int per_line
);
557 void print_asc(int level
, uchar
const *buf
,int len
);
558 void dump_data(int level
, const char *buf1
, int len
);
559 void dump_data_pw(const char *msg
, const uchar
* data
, size_t len
);
560 char *tab_depth(int depth
);
561 int str_checksum(const char *s
);
562 void zero_free(void *p
, size_t size
);
563 int set_maxfiles(int requested_max
);
564 void reg_get_subkey(char *full_keyname
, char *key_name
, char *subkey_name
);
565 BOOL
reg_split_key(const char *full_keyname
, uint32
*reg_type
, char *key_name
);
566 char *get_trusted_serverlist(const char* domain
);
567 uint16
pwdb_acct_ctrl_from_ad(NTDS_USER_FLAG_ENUM adac
);
568 char *pwdb_encode_acct_ctrl(uint16 acct_ctrl
, size_t length
);
569 uint16
pwdb_decode_acct_ctrl(const char *p
);
570 time_t pwdb_get_time_last_changed(const char *p
);
571 time_t pwdb_get_last_set_time(const char *p
);
572 void pwdb_set_logon_time(char *p
, int max_len
, time_t t
);
573 void pwdb_set_logoff_time(char *p
, int max_len
, time_t t
);
574 void pwdb_set_kickoff_time(char *p
, int max_len
, time_t t
);
575 void pwdb_set_can_change_time(char *p
, int max_len
, time_t t
);
576 void pwdb_set_time_last_changed(char *p
, int max_len
, time_t t
);
577 void pwdb_set_must_change_time(char *p
, int max_len
, time_t t
);
578 void pwdb_set_last_set_time(char *p
, int max_len
, time_t t
);
579 void pwdb_sethexpwd(char *p
, const uchar
*pwd
, uint16 acct_ctrl
);
580 BOOL
pwdb_gethexpwd(const char *p
, char *pwd
, uint32
*acct_ctrl
);
581 void *memdup(const void *p
, size_t size
);
582 char *passdb_path(char *name
);
583 char *lock_path(char *name
);
585 /*The following definitions come from lib/util_array.c */
587 void free_void_array(uint32 num_entries
, void **entries
,
588 void(free_item
)(void*));
589 void* add_copy_to_array(uint32
*len
, void ***array
, const void *item
,
590 void*(item_dup
)(const void*), BOOL alloc_anyway
);
591 void* add_item_to_array(uint32
*len
, void ***array
, void *item
);
592 void free_use_info_array(uint32 num_entries
, struct use_info
**entries
);
593 struct use_info
* add_use_info_to_array(uint32
*len
, struct use_info
***array
,
594 const struct use_info
*name
);
595 void free_char_array(uint32 num_entries
, char **entries
);
596 char* add_chars_to_array(uint32
*len
, char ***array
, const char *name
);
597 void free_uint32_array(uint32 num_entries
, uint32
**entries
);
598 uint32
* add_uint32s_to_array(uint32
*len
, uint32
***array
, const uint32
*name
);
599 void free_unistr_array(uint32 num_entries
, UNISTR2
**entries
);
600 UNISTR2
* add_unistr_to_array(uint32
*len
, UNISTR2
***array
, UNISTR2
*name
);
601 void free_sid_array(uint32 num_entries
, DOM_SID
**entries
);
602 DOM_SID
* add_sid_to_array(uint32
*len
, DOM_SID
***array
, const DOM_SID
*sid
);
604 /*The following definitions come from lib/util_file.c */
606 BOOL
do_file_lock(int fd
, int waitsecs
, int type
);
607 BOOL
file_lock(int fd
, int type
, int secs
, int *plock_depth
);
608 BOOL
file_unlock(int fd
, int *plock_depth
);
609 BOOL
fcntl_lock(int fd
, int op
, SMB_OFF_T offset
, SMB_OFF_T count
, int type
);
610 void *startfileent(char *pfile
, char *s_readbuf
, int bufsize
,
611 int *file_lock_depth
, BOOL update
);
612 void endfileent(void *vp
, int *file_lock_depth
);
613 SMB_BIG_UINT
getfilepwpos(void *vp
);
614 BOOL
setfilepwpos(void *vp
, SMB_BIG_UINT tok
);
615 int getfileline(void *vp
, char *linebuf
, int linebuf_size
);
616 char *fgets_slash(char *s2
,int maxlen
,FILE *f
);
617 BOOL
file_modified(const char *filename
, time_t *lastmodified
);
618 void *open_file_if_modified(const char *filename
, char *mode
, time_t *lastmodified
);
620 /*The following definitions come from lib/util_hnd.c */
622 struct policy_cache
*get_global_hnd_cache(void);
623 struct policy_cache
*init_policy_cache(int num_pol_hnds
);
624 void free_policy_cache(struct policy_cache
*cache
);
625 BOOL
dup_policy_hnd(struct policy_cache
*cache
,
627 const POLICY_HND
*from
);
628 BOOL
register_policy_hnd(struct policy_cache
*cache
,
629 const vuser_key
*key
,
632 BOOL
open_policy_hnd(struct policy_cache
*cache
,
633 const vuser_key
*key
,
636 BOOL
open_policy_hnd_link(struct policy_cache
*cache
,
637 const POLICY_HND
*parent_hnd
,
640 int find_policy_by_hnd(struct policy_cache
*cache
, const POLICY_HND
*hnd
);
641 BOOL
set_policy_state(struct policy_cache
*cache
, POLICY_HND
*hnd
,
642 void(*fn
)(void*), void *dev
);
643 void *get_policy_state_info(struct policy_cache
*cache
, const POLICY_HND
*hnd
);
644 BOOL
close_policy_hnd(struct policy_cache
*cache
, POLICY_HND
*hnd
);
645 BOOL
policy_link_key(struct policy_cache
*cache
, const POLICY_HND
*hnd
,
647 const vuser_key
*get_policy_vuser_key(struct policy_cache
*cache
,
648 const POLICY_HND
*hnd
);
649 BOOL
pol_get_usr_sesskey(struct policy_cache
*cache
, const POLICY_HND
*hnd
,
650 uchar usr_sess_key
[16]);
652 /*The following definitions come from lib/util_pwdb.c */
654 uint32
lookup_wk_group_name(const char *group_name
, const char *domain
,
655 DOM_SID
*sid
, uint32
*type
);
656 uint32
lookup_wk_user_name(const char *user_name
, const char *domain
,
657 DOM_SID
*sid
, uint32
*type
);
658 uint32
lookup_builtin_alias_name(const char *alias_name
, const char *domain
,
659 DOM_SID
*sid
, uint32
*type
);
660 char *lookup_wk_alias_rid(uint32 rid
);
661 char *lookup_wk_user_rid(uint32 rid
);
662 char *lookup_wk_group_rid(uint32 rid
);
664 /*The following definitions come from lib/util_sec.c */
666 void gain_root_privilege(void);
667 void gain_root_group_privilege(void);
668 void set_effective_uid(uid_t uid
);
669 void set_effective_gid(gid_t gid
);
670 void save_re_uid(void);
671 void restore_re_uid(void);
672 int set_re_uid(void);
673 void become_user_permanently(uid_t uid
, gid_t gid
);
675 /*The following definitions come from lib/util_sid.c */
677 char *sid_to_string(pstring sidstr_out
, const DOM_SID
*sid
);
678 BOOL
string_to_sid(DOM_SID
*sidout
, const char *sidstr
);
679 BOOL
sid_append_rid(DOM_SID
*sid
, uint32 rid
);
680 BOOL
sid_split_rid(DOM_SID
*sid
, uint32
*rid
);
681 void sid_copy(DOM_SID
*sid1
, const DOM_SID
*sid2
);
682 BOOL
sid_front_equal(const DOM_SID
*sid1
, const DOM_SID
*sid2
);
683 BOOL
sid_equal(const DOM_SID
*sid1
, const DOM_SID
*sid2
);
684 int sid_size(const DOM_SID
*sid
);
685 DOM_SID
*sid_dup(const DOM_SID
*src
);
686 BOOL
read_sid(char *domain_name
, DOM_SID
*sid
);
687 BOOL
write_sid(char *domain_name
, DOM_SID
*sid
);
688 BOOL
create_new_sid(DOM_SID
*sid
);
690 /*The following definitions come from lib/util_sock.c */
692 BOOL
is_a_socket(int fd
);
693 void set_socket_options(int fd
, char *options
);
694 void close_sockets(void );
695 ssize_t
write_socket(int fd
,char *buf
,size_t len
);
696 ssize_t
read_udp_socket(int fd
,char *buf
,size_t len
);
697 ssize_t
read_with_timeout(int fd
,char *buf
,size_t mincnt
,size_t maxcnt
,unsigned int time_out
);
698 BOOL
send_keepalive(int client
);
699 ssize_t
read_data(int fd
,char *buffer
,size_t N
);
700 ssize_t
write_data(int fd
,char *buffer
,size_t N
);
701 ssize_t
read_smb_length(int fd
,char *inbuf
,unsigned int timeout
);
702 BOOL
receive_smb(int fd
,char *buffer
, unsigned int timeout
);
703 BOOL
client_receive_smb(int fd
,char *buffer
, unsigned int timeout
);
704 BOOL
send_smb(int fd
,char *buffer
);
705 BOOL
send_one_packet(char *buf
,int len
,struct in_addr ip
,int port
,int type
);
706 int open_socket_in(int type
, int port
, int dlevel
,uint32 socket_addr
,
708 int open_socket_out(int type
, struct in_addr
*addr
, int port
,int timeout
);
709 void set_client_connection_name(const char* name
, int fd
);
710 void set_client_connection_addr(const char* addr
, int fd
);
711 char *client_connection_name(void);
712 char *client_connection_addr(void);
713 void reset_globals_after_fork(void);
714 char *client_name(int fd
);
715 char *client_addr(int fd
);
716 int open_pipe_sock(char *path
);
717 int create_pipe_socket(char *dir
, int dir_perms
,
718 char *path
, int path_perms
);
720 /*The following definitions come from lib/util_status.c */
722 BOOL
get_connection_status(struct connect_record
**crec
,
723 uint32
*connection_count
);
724 BOOL
get_session_count(struct connect_record
**srec
,uint32
*session_count
);
726 /*The following definitions come from lib/util_str.c */
728 void set_first_token(char *ptr
);
729 BOOL
next_token(char **ptr
,char *buff
,char *sep
, size_t bufsize
);
730 char **toktocliplist(int *ctok
, char *sep
);
731 int StrCaseCmp(const char *s
, const char *t
);
732 int StrnCaseCmp(const char *s
, const char *t
, size_t n
);
733 BOOL
strequal(const char *s1
, const char *s2
);
734 BOOL
strnequal(const char *s1
,const char *s2
,size_t n
);
735 BOOL
strcsequal(const char *s1
,const char *s2
);
736 void strlower(char *s
);
737 void strupper(char *s
);
738 void strnorm(char *s
);
739 BOOL
strisnormal(char *s
);
740 void string_replace(char *s
,char oldc
,char newc
);
741 char *skip_string(char *buf
,size_t n
);
742 size_t str_charnum(const char *s
);
743 BOOL
trim_string(char *s
,const char *front
,const char *back
);
744 BOOL
strhasupper(const char *s
);
745 BOOL
strhaslower(const char *s
);
746 size_t count_chars(const char *s
,char c
);
747 char *safe_strcpy(char *dest
,const char *src
, size_t maxlength
);
748 char *safe_strcat(char *dest
, const char *src
, size_t maxlength
);
749 char *StrCpy(char *dest
,const char *src
);
750 char *StrnCpy(char *dest
,const char *src
,size_t n
);
751 char *strncpyn(char *dest
, char *src
,size_t n
, char c
);
752 size_t strhex_to_str(char *p
, size_t len
, const char *strhex
);
753 BOOL
in_list(char *s
,char *list
,BOOL casesensitive
);
754 BOOL
string_init(char **dest
,const char *src
);
755 void string_free(char **s
);
756 BOOL
string_set(char **dest
,const char *src
);
757 void string_sub(char *s
,const char *pattern
,const char *insert
);
758 void all_string_sub(char *s
,const char *pattern
,const char *insert
, size_t len
);
759 void split_at_first_component(char *path
, char *front
, char sep
, char *back
);
760 void split_at_last_component(char *path
, char *front
, char sep
, char *back
);
761 char *bit_field_to_str(uint32 type
, struct field_info
*bs
);
762 char *enum_field_to_str(uint32 type
, struct field_info
*bs
, BOOL first_default
);
764 /*The following definitions come from lib/util_unistr.c */
766 char *ascii_to_unibuf(char *dest
, const char *src
, int maxlen
);
767 const char* unibuf_to_ascii(char *dest
, const char *src
, int maxlen
);
768 void ascii_to_unistr(uint16
*dest
, const char *src
, int maxlen
);
769 void unistr_to_ascii(char *dest
, const uint16
*src
, int len
);
770 char *unistr2_to_ascii(char *dest
, const UNISTR2
*str
, size_t maxlen
);
771 char *skip_unibuf(char *srcbuf
, int len
);
772 char *uni_strncpy(char *destbuf
, const char *srcbuf
, int len
);
773 uint32
buffer2_to_uint32(const BUFFER2
*str
);
774 void buffer2_to_multistr(char *dest
, const BUFFER2
*str
, size_t maxlen
);
775 void buffer4_to_str(char *dest
, const BUFFER4
*str
, size_t maxlen
);
776 UNISTR2
*unistr2_new(const char *init
);
777 UNISTR2
*unistr2_assign_ascii(UNISTR2
*str
, const char *buf
, int len
);
778 UNISTR2
*unistr2_assign_ascii_str(UNISTR2
*str
, const char *buf
);
779 UNISTR2
*unistr2_grow(UNISTR2
*str
, size_t new_size
);
780 BOOL
unistr2upper(UNISTR2
*str
, const UNISTR2
*from
);
781 BOOL
copy_unistr2(UNISTR2
*str
, const UNISTR2
*from
);
782 UNISTR2
*unistr2_dup(const UNISTR2
*name
);
783 void unistr2_free(UNISTR2
*name
);
784 int StrCaseCmpW(const UNISTR2
*ws
, const UNISTR2
*wt
);
785 BOOL
unistr2equal(const UNISTR2
*s1
, const UNISTR2
*s2
);
787 /*The following definitions come from lib/vagent.c */
789 void init_sock_redir(struct vagent_ops
*va
);
790 void free_sock_redir(struct vagent_ops
*va
);
791 void start_agent(struct vagent_ops
*va
);
793 /*The following definitions come from lib/vuser.c */
795 BOOL
is_valid_user_struct(const vuser_key
*key
);
796 user_struct
*get_valid_user_struct(const vuser_key
*key
);
797 void invalidate_vuid(vuser_key
*key
);
798 BOOL
validated_username(vuser_key
*key
, char *name
, size_t len
);
799 uint16
create_vuid(pid_t pid
,
800 uid_t uid
, gid_t gid
,
801 int n_groups
, gid_t
*groups
,
802 const char *unix_name
,
803 const char *requested_name
,
804 const char *real_name
,
805 BOOL guest
, const NET_USER_INFO_3
*info3
);
806 uint16
register_vuid(pid_t pid
,
808 const char *unix_name
,
809 const char *requested_name
,
811 const NET_USER_INFO_3
*info3
);
812 BOOL
check_vuser_ok(struct uid_cache
*cache
, user_struct
*vuser
,int snum
);
814 /*The following definitions come from lib/vuser_db.c */
816 BOOL
tdb_delete_vuid( const vuser_key
*uk
);
817 BOOL
tdb_lookup_vuid( const vuser_key
*uk
, user_struct
**usr
);
818 BOOL
tdb_store_vuid( const vuser_key
*uk
, user_struct
*usr
);
819 BOOL
vuid_init_db(void);
821 /*The following definitions come from libsmb/clientgen.c */
823 int cli_set_port(struct cli_state
*cli
, int port
);
824 char *cli_errstr(struct cli_state
*cli
);
825 void cli_safe_smb_errstr(struct cli_state
*cli
, char *msg
, size_t len
);
826 BOOL
get_safe_rap_errstr(int rap_error
, char *err_msg
, size_t msglen
);
827 void cli_safe_errstr(struct cli_state
*cli
, char *err_msg
, size_t msglen
);
828 BOOL
cli_send_trans(struct cli_state
*cli
, int trans
,
829 char *name
, int pipe_name_len
,
831 uint16
*setup
, int lsetup
, int msetup
,
832 char *param
, int lparam
, int mparam
,
833 char *data
, int ldata
, int mdata
);
834 BOOL
cli_api_pipe(struct cli_state
*cli
, char *pipe_name
, int pipe_name_len
,
835 uint16
*setup
, uint32 setup_count
, uint32 max_setup_count
,
836 char *params
, uint32 param_count
, uint32 max_param_count
,
837 char *data
, uint32 data_count
, uint32 max_data_count
,
838 char **rparam
, uint32
*rparam_count
,
839 char **rdata
, uint32
*rdata_count
);
840 BOOL
cli_api(struct cli_state
*cli
,
841 char *param
, int prcnt
, int mprcnt
,
842 char *data
, int drcnt
, int mdrcnt
,
843 char **rparam
, int *rprcnt
,
844 char **rdata
, int *rdrcnt
);
845 BOOL
cli_NetWkstaUserLogon(struct cli_state
*cli
,char *user
, char *workstation
);
846 BOOL
cli_RNetShareEnum(struct cli_state
*cli
, void (*fn
)(const char *, uint32
, const char *));
847 BOOL
cli_NetServerEnum(struct cli_state
*cli
, char *workgroup
, uint32 stype
,
848 void (*fn
)(const char *, uint32
, const char *));
849 BOOL
cli_session_setup_x(struct cli_state
*cli
,
851 char *pass
, int passlen
,
852 char *ntpass
, int ntpasslen
,
854 BOOL
cli_session_setup(struct cli_state
*cli
,
855 char *myhostname
, char *user
,
856 char *pass
, int passlen
,
857 char *ntpass
, int ntpasslen
,
859 BOOL
cli_ulogoff(struct cli_state
*cli
);
860 BOOL
cli_send_tconX(struct cli_state
*cli
,
861 char *share
, char *dev
, char *pass
, int passlen
);
862 BOOL
cli_tdis(struct cli_state
*cli
);
863 BOOL
cli_rename(struct cli_state
*cli
, char *fname_src
, char *fname_dst
);
864 BOOL
cli_unlink(struct cli_state
*cli
, char *fname
);
865 BOOL
cli_mkdir(struct cli_state
*cli
, char *dname
);
866 BOOL
cli_rmdir(struct cli_state
*cli
, char *dname
);
867 int cli_nt_create(struct cli_state
*cli
, const char *fname
);
868 int cli_open(struct cli_state
*cli
, const char *fname
,
869 int flags
, int share_mode
);
870 BOOL
cli_close(struct cli_state
*cli
, int fnum
);
871 BOOL
cli_lock(struct cli_state
*cli
, int fnum
, uint32 offset
, uint32 len
, int timeout
);
872 BOOL
cli_unlock(struct cli_state
*cli
, int fnum
, uint32 offset
, uint32 len
, int timeout
);
873 size_t cli_read_one(struct cli_state
*cli
, int fnum
, char *buf
, off_t offset
, size_t size
);
874 size_t cli_read(struct cli_state
*cli
, int fnum
, char *buf
, off_t offset
, size_t size
, BOOL overlap
);
875 ssize_t
cli_write(struct cli_state
*cli
,
876 int fnum
, uint16 write_mode
,
877 char *buf
, off_t offset
, size_t size
, size_t bytes_left
);
878 BOOL
cli_getattrE(struct cli_state
*cli
, int fd
,
879 uint16
*attr
, size_t *size
,
880 time_t *c_time
, time_t *a_time
, time_t *m_time
);
881 BOOL
cli_getatr(struct cli_state
*cli
, char *fname
,
882 uint16
*attr
, size_t *size
, time_t *t
);
883 BOOL
cli_setatr(struct cli_state
*cli
, char *fname
, uint16 attr
, time_t t
);
884 BOOL
cli_qpathinfo(struct cli_state
*cli
, const char *fname
,
885 time_t *c_time
, time_t *a_time
, time_t *m_time
,
886 size_t *size
, uint16
*mode
);
887 BOOL
cli_qpathinfo2(struct cli_state
*cli
, const char *fname
,
888 time_t *c_time
, time_t *a_time
, time_t *m_time
,
889 time_t *w_time
, size_t *size
, uint16
*mode
,
891 BOOL
cli_qfileinfo(struct cli_state
*cli
, int fnum
,
892 uint16
*mode
, size_t *size
,
893 time_t *c_time
, time_t *a_time
, time_t *m_time
,
894 time_t *w_time
, SMB_INO_T
*ino
);
895 int cli_list(struct cli_state
*cli
,const char *Mask
,uint16 attribute
,
896 void (*fn
)(file_info
*, const char *));
897 BOOL
cli_oem_change_password(struct cli_state
*cli
, const char *user
, const char *new_password
,
898 const char *old_password
);
899 BOOL
cli_negprot(struct cli_state
*cli
);
900 BOOL
cli_session_request(struct cli_state
*cli
,
901 struct nmb_name
*calling
, struct nmb_name
*called
);
902 BOOL
cli_connect(struct cli_state
*cli
, const char *host
, struct in_addr
*ip
);
903 void cli_init_creds(struct cli_state
*cli
, const struct ntuser_creds
*usr
);
904 struct cli_state
*cli_initialise(struct cli_state
*cli
);
905 void cli_close_socket(struct cli_state
*cli
);
906 void cli_shutdown(struct cli_state
*cli
);
907 int cli_error(struct cli_state
*cli
, uint8
*eclass
, uint32
*num
);
908 void cli_sockopt(struct cli_state
*cli
, char *options
);
909 uint16
cli_setpid(struct cli_state
*cli
, uint16 pid
);
910 BOOL
cli_reestablish_connection(struct cli_state
*cli
);
911 BOOL
cli_establish_connection(struct cli_state
*cli
,
912 const char *dest_host
, struct in_addr
*dest_ip
,
913 struct nmb_name
*calling
, struct nmb_name
*called
,
914 char *service
, char *service_type
,
915 BOOL do_shutdown
, BOOL do_tcon
);
916 BOOL
cli_connect_auth(struct cli_state
*cli
,
917 const char* desthost
,
918 struct in_addr
*dest_ip
,
919 const struct ntuser_creds
*usr
);
920 BOOL
cli_connect_servers_auth(struct cli_state
*cli
,
922 const struct ntuser_creds
*usr
);
923 BOOL
cli_connect_serverlist(struct cli_state
*cli
, char *p
);
924 int cli_printjob_del(struct cli_state
*cli
, int job
);
925 int cli_print_queue(struct cli_state
*cli
,
926 void (*fn
)(struct print_job_info
*));
927 BOOL
cli_chkpath(struct cli_state
*cli
, char *path
);
928 BOOL
cli_message_start(struct cli_state
*cli
, char *host
, char *username
,
930 BOOL
cli_message_text(struct cli_state
*cli
, char *msg
, int len
, int grp
);
931 BOOL
cli_message_end(struct cli_state
*cli
, int grp
);
932 BOOL
cli_dskattr(struct cli_state
*cli
, int *bsize
, int *total
, int *avail
);
933 BOOL
get_any_dc_name(const char *domain
, char *srv_name
);
935 /*The following definitions come from libsmb/clienttrust.c */
937 BOOL
change_trust_account_password(char *domain
, char *remote_machine_list
,
940 /*The following definitions come from libsmb/credentials.c */
942 char *credstr(const uchar
*cred
);
943 void cred_session_key(DOM_CHAL
*clnt_chal
, DOM_CHAL
*srv_chal
, char *pass
,
944 uchar session_key
[8]);
945 void cred_create(uchar session_key
[8], DOM_CHAL
*stor_cred
, UTIME timestamp
,
947 int cred_assert(const DOM_CHAL
*cred
, uchar session_key
[8],
948 DOM_CHAL
*stored_cred
, UTIME timestamp
);
949 BOOL
clnt_deal_with_creds(uchar sess_key
[8],
950 DOM_CRED
*sto_clnt_cred
, DOM_CRED
*rcv_srv_cred
);
951 BOOL
deal_with_creds(uchar sess_key
[8],
952 DOM_CRED
*sto_clnt_cred
,
953 const DOM_CRED
*rcv_clnt_cred
, DOM_CRED
*rtn_srv_cred
);
955 /*The following definitions come from libsmb/namequery.c */
957 BOOL
name_status(int fd
,char *name
,int name_type
,BOOL recurse
,
958 struct in_addr to_ip
,char *master
,char *rname
,
959 void (*fn
)(struct packet_struct
*));
960 struct in_addr
*name_query(int fd
,const char *name
,int name_type
, BOOL bcast
,BOOL recurse
,
961 struct in_addr to_ip
, int *count
, void (*fn
)(struct packet_struct
*));
962 FILE *startlmhosts(char *fname
);
963 BOOL
getlmhostsent( FILE *fp
, pstring name
, int *name_type
, struct in_addr
*ipaddr
);
964 void endlmhosts(FILE *fp
);
965 BOOL
is_ip_address(const char *name
);
966 BOOL
resolve_name(const char *name
, struct in_addr
*return_ip
, int name_type
);
967 BOOL
resolve_srv_name(const char* srv_name
, fstring dest_host
,
969 BOOL
find_master_ip(char *group
, struct in_addr
*master_ip
);
971 /*The following definitions come from libsmb/nmblib.c */
973 void debug_nmb_packet(struct packet_struct
*p
);
974 char *nmb_namestr(struct nmb_name
*n
);
975 void nmb_safe_namestr(struct nmb_name
*n
, char *str
, size_t len
);
976 struct packet_struct
*copy_packet(struct packet_struct
*packet
);
977 void free_packet(struct packet_struct
*packet
);
978 struct packet_struct
*read_packet(int fd
,enum packet_type packet_type
);
979 void make_nmb_name( struct nmb_name
*n
, const char *name
, int type
, const char *this_scope
);
980 BOOL
nmb_name_equal(struct nmb_name
*n1
, struct nmb_name
*n2
);
981 BOOL
send_packet(struct packet_struct
*p
);
982 struct packet_struct
*receive_packet(int fd
,enum packet_type type
,int t
);
983 void sort_query_replies(char *data
, int n
, struct in_addr ip
);
984 BOOL
read_nmb_sock(int c
, struct nmb_state
*con
);
985 int get_nmb_sock(void);
986 char *dns_to_netbios_name(char *dns_name
);
987 int name_mangle( char *In
, char *Out
, char name_type
);
988 int name_extract(char *buf
,int ofs
,char *name
);
989 int name_len(char *s1
);
991 /*The following definitions come from libsmb/nterr.c */
993 BOOL
get_safe_nt_error_msg(uint32 nt_code
, char *msg
, size_t len
);
994 const char *get_nt_error_msg(uint32 nt_code
);
996 /*The following definitions come from libsmb/passchange.c */
998 BOOL
remote_password_change(const char *remote_machine
, const char *user_name
,
999 const char *old_passwd
, const char *new_passwd
,
1000 char *err_str
, size_t err_str_len
);
1002 /*The following definitions come from libsmb/pwd_cache.c */
1004 void pwd_init(struct pwd_info
*pwd
);
1005 BOOL
pwd_is_nullpwd(const struct pwd_info
*pwd
);
1006 void pwd_obfuscate_key(struct pwd_info
*pwd
, uint32 int_key
, char *str_key
);
1007 BOOL
pwd_compare(const struct pwd_info
*_pwd1
, const struct pwd_info
*_pwd2
);
1008 void pwd_read(struct pwd_info
*pwd
, char *passwd_report
, BOOL do_encrypt
);
1009 void pwd_set_nullpwd(struct pwd_info
*pwd
);
1010 void pwd_set_cleartext(struct pwd_info
*pwd
, char *clr
);
1011 void pwd_get_cleartext(struct pwd_info
*pwd
, char *clr
);
1012 void pwd_set_lm_nt_16(struct pwd_info
*pwd
,
1013 const uchar lm_pwd
[16],
1014 const uchar nt_pwd
[16]);
1015 void pwd_get_lm_nt_16(const struct pwd_info
*pwd
, uchar lm_pwd
[16], uchar nt_pwd
[16]);
1016 void pwd_make_lm_nt_16(struct pwd_info
*pwd
, char *clr
);
1017 void pwd_make_lm_nt_owf2(struct pwd_info
*pwd
, const uchar srv_key
[8],
1018 const char *user
, const char *server
, const char *domain
,
1019 uchar sess_key
[16]);
1020 void pwd_make_lm_nt_owf(struct pwd_info
*pwd
, uchar cryptkey
[8],
1021 uchar sess_key
[16]);
1022 void pwd_get_lm_nt_owf(struct pwd_info
*pwd
, uchar lm_owf
[24],
1023 uchar
*nt_owf
, size_t *nt_owf_len
);
1025 /*The following definitions come from libsmb/smbdes.c */
1027 void smbhash(uchar
*out
, const uchar
*in
, const uchar
*key
, int forw
);
1028 void E_P16(uchar
*p14
,uchar
*p16
);
1029 void E_P24(const uchar
*p21
, const uchar
*c8
, uchar
*p24
);
1030 void D_P16(const uchar
*p14
, const uchar
*in
, uchar
*out
);
1031 void E_old_pw_hash( const uchar
*p14
, const uchar
*in
, uchar
*out
);
1032 void cred_hash1(uchar
*out
,uchar
*in
,uchar
*key
);
1033 void cred_hash2(uchar
*out
,uchar
*in
,uchar
*key
);
1034 void cred_hash3(uchar
*out
, const uchar
*in
,uchar
*key
, int forw
);
1035 void SamOEMhash( uchar
*data
, const uchar
*key
, int val
);
1036 void sam_pwd_hash(uint32 rid
, const uchar
*in
, uchar
*out
, int forw
);
1038 /*The following definitions come from libsmb/smbencrypt.c */
1040 void SMBencrypt(uchar
*pwrd
, uchar
*c8
, uchar
*p24
);
1041 void SMBNTencrypt(uchar
*pwrd
, uchar
*c8
, uchar
*p24
);
1042 void E_md4hash(uchar
*pwrd
, uchar
*p16
);
1043 void lm_owf_genW(const UNISTR2
*pwd
, uchar p16
[16]);
1044 void lm_owf_gen(const char *pwd
, uchar p16
[16]);
1045 void nt_owf_genW(const UNISTR2
*pwd
, uchar nt_p16
[16]);
1046 void nt_owf_gen(const char *pwd
, uchar nt_p16
[16]);
1047 void nt_lm_owf_genW(const UNISTR2
*pwd
, uchar nt_p16
[16], uchar lm_p16
[16]);
1048 void nt_lm_owf_gen(const char *pwd
, uchar nt_p16
[16], uchar lm_p16
[16]);
1049 void SMBOWFencrypt(const uchar pwrd
[16], const uchar
*c8
, uchar p24
[24]);
1050 void SMBOWFencrypt_ntv2(const uchar kr
[16],
1051 const uchar
*srv_chal
, int srv_chal_len
,
1052 const uchar
*cli_chal
, int cli_chal_len
,
1054 void SMBsesskeygen_ntv2(const uchar kr
[16],
1055 const uchar
*nt_resp
,
1057 void SMBsesskeygen_ntv1(const uchar kr
[16],
1058 const uchar
*nt_resp
,
1060 void SMBgenclientchals(char *lm_cli_chal
,
1061 char *nt_cli_chal
, int *nt_cli_chal_len
,
1062 const char *srv
, const char *dom
);
1063 void ntv2_owf_gen(const uchar owf
[16],
1065 const char *domain_n
,
1067 void NTLMSSPOWFencrypt(uchar pwrd
[8], uchar
*ntlmchalresp
, uchar p24
[24]);
1068 BOOL
make_oem_passwd_hash(uchar data
[516],
1069 const char *pwrd
, int new_pw_len
,
1070 const uchar old_pw_hash
[16], BOOL unicode
);
1071 BOOL
nt_decrypt_string2(STRING2
*out
, const STRING2
*in
, const uchar
*key
);
1072 void create_ntlmssp_resp(struct pwd_info
*pwd
,
1073 char *domain
, char *user_name
, char *my_name
,
1074 uint32 ntlmssp_cli_flgs
,
1075 prs_struct
*auth_resp
);
1076 BOOL
decode_pw_buffer(const char buffer
[516], char *new_pwrd
,
1077 int new_pwrd_size
, uint32
*new_pw_len
);
1078 BOOL
encode_pw_buffer(char buffer
[516], const char *new_pass
,
1079 int new_pw_len
, BOOL nt_pass_set
);
1081 /*The following definitions come from libsmb/smberr.c */
1083 char *smb_err_msg(uint8
class, uint32 num
);
1084 BOOL
smb_safe_err_msg(uint8
class, uint32 num
, char *ret
, size_t len
);
1085 BOOL
smb_safe_errstr(char *inbuf
, char *msg
, size_t len
);
1086 char *smb_errstr(char *inbuf
);
1088 /*The following definitions come from locking/locking.c */
1090 BOOL
is_locked(files_struct
*fsp
,connection_struct
*conn
,
1091 SMB_OFF_T count
,SMB_OFF_T offset
, int lock_type
);
1092 BOOL
do_lock(files_struct
*fsp
,connection_struct
*conn
,
1093 SMB_OFF_T count
,SMB_OFF_T offset
,int lock_type
,
1094 int *eclass
,uint32
*ecode
);
1095 BOOL
do_unlock(files_struct
*fsp
,connection_struct
*conn
,
1096 SMB_OFF_T count
,SMB_OFF_T offset
,int *eclass
,uint32
*ecode
);
1097 BOOL
locking_init(int read_only
);
1098 BOOL
locking_end(void);
1099 BOOL
lock_share_entry(connection_struct
*conn
,
1100 SMB_DEV_T dev
, SMB_INO_T inode
);
1101 BOOL
unlock_share_entry(connection_struct
*conn
,
1102 SMB_DEV_T dev
, SMB_INO_T inode
);
1103 int get_share_modes(connection_struct
*conn
,
1104 SMB_DEV_T dev
, SMB_INO_T inode
,
1105 share_mode_entry
**shares
);
1106 void del_share_mode(files_struct
*fsp
);
1107 BOOL
set_share_mode(files_struct
*fsp
, uint16 port
, uint16 op_type
);
1108 BOOL
remove_share_oplock(files_struct
*fsp
);
1109 BOOL
downgrade_share_oplock(files_struct
*fsp
);
1110 BOOL
modify_share_mode(files_struct
*fsp
, int new_mode
, uint16 new_oplock
);
1111 int share_mode_forall(void (*fn
)(share_mode_entry
*, char *));
1113 /*The following definitions come from lsarpcd/lsarpcd.c */
1115 msrpc_service_fns
*get_service_fns(void);
1117 /*The following definitions come from lsarpcd/srv_lsa.c */
1119 BOOL
api_ntlsa_rpc(rpcsrv_struct
*p
);
1121 /*The following definitions come from lsarpcd/srv_lsa_samdb.c */
1123 uint32
_lsa_open_policy2(const UNISTR2
*server_name
, POLICY_HND
*hnd
,
1124 const LSA_OBJ_ATTR
*attr
,
1126 uint32
_lsa_open_policy(const UNISTR2
*server_name
, POLICY_HND
*hnd
,
1127 const LSA_OBJ_ATTR
*attr
,
1129 uint32
_lsa_enum_trust_dom(POLICY_HND
*hnd
, uint32
*enum_ctx
,
1130 uint32
*num_doms
, UNISTR2
**uni_names
,
1132 uint32
_lsa_lookup_sids(const POLICY_HND
*hnd
,
1133 uint32 num_entries
, DOM_SID2
*sid
, uint16 level
,
1135 LSA_TRANS_NAME_ENUM
*trn
,
1136 uint32
*mapped_count
);
1137 uint32
_lsa_query_info_pol(POLICY_HND
*hnd
, uint16 info_class
,
1138 fstring domain_name
, DOM_SID
*domain_sid
);
1139 uint32
_lsa_close(POLICY_HND
*hnd
);
1140 uint32
_lsa_open_secret(const POLICY_HND
*hnd
,
1141 const UNISTR2
*secret_name
, uint32 des_access
,
1142 POLICY_HND
*hnd_secret
);
1144 /*The following definitions come from msrpc/msrpcd.c */
1146 void exit_server(char *reason
);
1148 /*The following definitions come from msrpc/msrpcd_process.c */
1150 BOOL
get_user_creds(int c
, vuser_key
*uk
);
1151 void close_srv_auth_array(rpcsrv_struct
*l
);
1152 void add_srv_auth_fn(rpcsrv_struct
*l
, srv_auth_fns
*fn
);
1153 BOOL
msrpcd_init(int c
, rpcsrv_struct
**l
);
1154 void msrpcd_process(msrpc_service_fns
*fn
, rpcsrv_struct
*l
, const char* name
);
1156 /*The following definitions come from netlogond/creds_db.c */
1158 BOOL
cred_get(uint32 pid
, const char *domain
, const char* wks
, struct dcinfo
*dc
);
1159 BOOL
cred_store(uint32 pid
, const char *domain
, const char* wks
, struct dcinfo
*dc
);
1160 BOOL
cred_init_db(void);
1162 /*The following definitions come from netlogond/netlogond.c */
1164 msrpc_service_fns
*get_service_fns(void);
1166 /*The following definitions come from netlogond/srv_netlogon_nt.c */
1168 uint32
_net_req_chal( const UNISTR2
*uni_logon_server
,
1169 const UNISTR2
*uni_logon_client
,
1170 const DOM_CHAL
*clnt_chal
,
1172 uint16 remote_pid
) ;
1173 uint32
_net_logon_ctrl2(const UNISTR2
*uni_server_name
,
1174 uint32 function_code
,
1176 uint32 switch_value
,
1177 uint32
*reply_switch_value
,
1178 NETLOGON_INFO
*logon_info
);
1179 uint32
_net_trust_dom_list(const UNISTR2
*uni_server_name
,
1180 uint32 function_code
,
1181 BUFFER2
*uni_trust_dom_name
);
1182 uint32
_net_auth(const DOM_LOG_INFO
*clnt_id
,
1183 const DOM_CHAL
*clnt_chal
,
1186 uint32
_net_auth_2(const DOM_LOG_INFO
*clnt_id
,
1187 const DOM_CHAL
*clnt_chal
,
1188 const NEG_FLAGS
*clnt_flgs
,
1190 NEG_FLAGS
*srv_flgs
,
1192 uint32
_net_srv_pwset(const DOM_CLNT_INFO
*clnt_id
,
1193 const uint8 pwd
[16],
1196 uint32
_net_sam_logon(const DOM_SAM_INFO
*sam_id
,
1197 uint16 validation_level
,
1198 DOM_CRED
*srv_creds
,
1199 uint16
*switch_value
,
1200 NET_USER_INFO_3
*user
,
1202 uint32
_net_sam_logoff(const DOM_SAM_INFO
*sam_id
,
1203 DOM_CRED
*srv_creds
,
1205 uint32
_net_sam_sync(const UNISTR2
*uni_srv_name
,
1206 const UNISTR2
*uni_cli_name
,
1208 uint32 restart_state
,
1209 uint32
*sync_context
,
1212 uint32
*num_deltas2
,
1213 SAM_DELTA_HDR
*hdr_deltas
,
1214 SAM_DELTA_CTR
*deltas
);
1216 /*The following definitions come from nmbd/asyncdns.c */
1218 int asyncdns_fd(void);
1219 void kill_async_dns_child(void);
1220 void start_async_dns(void);
1221 void run_dns_queue(void);
1222 BOOL
queue_dns_query(struct packet_struct
*p
,struct nmb_name
*question
,
1223 struct name_record
**n
);
1224 BOOL
queue_dns_query(struct packet_struct
*p
,struct nmb_name
*question
,
1225 struct name_record
**n
);
1226 void kill_async_dns_child(void);
1228 /*The following definitions come from nmbd/nmbd.c */
1231 /*The following definitions come from nmbd/nmbd_become_dmb.c */
1233 void add_domain_names(time_t t
);
1235 /*The following definitions come from nmbd/nmbd_become_lmb.c */
1237 void insert_permanent_name_into_unicast( struct subnet_record
*subrec
,
1238 struct nmb_name
*nmbname
, uint16 nb_type
);
1239 void unbecome_local_master_browser(struct subnet_record
*subrec
, struct work_record
*work
,
1240 BOOL force_new_election
);
1241 void become_local_master_browser(struct subnet_record
*subrec
, struct work_record
*work
);
1242 void set_workgroup_local_master_browser_name( struct work_record
*work
, char *newname
);
1244 /*The following definitions come from nmbd/nmbd_browserdb.c */
1246 void update_browser_death_time( struct browse_cache_record
*browc
);
1247 struct browse_cache_record
*create_browser_in_lmb_cache( char *work_name
,
1249 struct in_addr ip
);
1250 struct browse_cache_record
*find_browser_in_lmb_cache( char *browser_name
);
1251 void expire_lmb_browsers( time_t t
);
1253 /*The following definitions come from nmbd/nmbd_browsesync.c */
1255 void dmb_expire_and_sync_browser_lists(time_t t
);
1256 void announce_and_sync_with_domain_master_browser( struct subnet_record
*subrec
,
1257 struct work_record
*work
);
1258 void collect_all_workgroup_names_from_wins_server(time_t t
);
1259 void sync_all_dmbs(time_t t
);
1261 /*The following definitions come from nmbd/nmbd_elections.c */
1263 void check_master_browser_exists(time_t t
);
1264 void run_elections(time_t t
);
1265 void process_election(struct subnet_record
*subrec
, struct packet_struct
*p
, char *buf
);
1266 BOOL
check_elections(void);
1268 /*The following definitions come from nmbd/nmbd_incomingdgrams.c */
1270 void tell_become_backup(void);
1271 void process_host_announce(struct subnet_record
*subrec
, struct packet_struct
*p
, char *buf
);
1272 void process_workgroup_announce(struct subnet_record
*subrec
, struct packet_struct
*p
, char *buf
);
1273 void process_local_master_announce(struct subnet_record
*subrec
, struct packet_struct
*p
, char *buf
);
1274 void process_master_browser_announce(struct subnet_record
*subrec
,
1275 struct packet_struct
*p
,char *buf
);
1276 void process_lm_host_announce(struct subnet_record
*subrec
, struct packet_struct
*p
, char *buf
);
1277 void process_get_backup_list_request(struct subnet_record
*subrec
,
1278 struct packet_struct
*p
,char *buf
);
1279 void process_reset_browser(struct subnet_record
*subrec
,
1280 struct packet_struct
*p
,char *buf
);
1281 void process_announce_request(struct subnet_record
*subrec
, struct packet_struct
*p
, char *buf
);
1282 void process_lm_announce_request(struct subnet_record
*subrec
, struct packet_struct
*p
, char *buf
);
1284 /*The following definitions come from nmbd/nmbd_incomingrequests.c */
1286 void process_name_release_request(struct subnet_record
*subrec
,
1287 struct packet_struct
*p
);
1288 void process_name_refresh_request(struct subnet_record
*subrec
,
1289 struct packet_struct
*p
);
1290 void process_name_registration_request(struct subnet_record
*subrec
,
1291 struct packet_struct
*p
);
1292 void process_node_status_request(struct subnet_record
*subrec
, struct packet_struct
*p
);
1293 void process_name_query_request(struct subnet_record
*subrec
, struct packet_struct
*p
);
1295 /*The following definitions come from nmbd/nmbd_lmhosts.c */
1297 void load_lmhosts_file(char *fname
);
1298 BOOL
find_name_in_lmhosts(struct nmb_name
*nmbname
, struct name_record
**namerecp
);
1300 /*The following definitions come from nmbd/nmbd_logonnames.c */
1302 void add_logon_names(void);
1304 /*The following definitions come from nmbd/nmbd_mynames.c */
1306 BOOL
register_my_workgroup_and_names(void);
1307 void release_my_names(void);
1308 void refresh_my_names(time_t t
);
1310 /*The following definitions come from nmbd/nmbd_namelistdb.c */
1312 void set_samba_nb_type(void);
1313 void remove_name_from_namelist( struct subnet_record
*subrec
,
1314 struct name_record
*namerec
);
1315 struct name_record
*find_name_on_subnet( struct subnet_record
*subrec
,
1316 struct nmb_name
*nmbname
,
1318 struct name_record
*find_name_for_remote_broadcast_subnet(
1319 struct nmb_name
*nmbname
,
1321 void update_name_ttl( struct name_record
*namerec
, int ttl
);
1322 struct name_record
*add_name_to_subnet( struct subnet_record
*subrec
,
1327 enum name_source source
,
1329 struct in_addr
*iplist
);
1330 void standard_success_register(struct subnet_record
*subrec
,
1331 struct userdata_struct
*userdata
,
1332 struct nmb_name
*nmbname
, uint16 nb_flags
, int ttl
,
1333 struct in_addr registered_ip
);
1334 void standard_fail_register( struct subnet_record
*subrec
,
1335 struct response_record
*rrec
,
1336 struct nmb_name
*nmbname
);
1337 BOOL
find_ip_in_name_record( struct name_record
*namerec
, struct in_addr ip
);
1338 void add_ip_to_name_record( struct name_record
*namerec
, struct in_addr new_ip
);
1339 void remove_ip_from_name_record( struct name_record
*namerec
,
1340 struct in_addr remove_ip
);
1341 void standard_success_release( struct subnet_record
*subrec
,
1342 struct userdata_struct
*userdata
,
1343 struct nmb_name
*nmbname
,
1344 struct in_addr released_ip
);
1345 void expire_names_on_subnet(struct subnet_record
*subrec
, time_t t
);
1346 void expire_names(time_t t
);
1347 void add_samba_names_to_subnet( struct subnet_record
*subrec
);
1348 void dump_all_namelists(void);
1350 /*The following definitions come from nmbd/nmbd_namequery.c */
1352 BOOL
query_name(struct subnet_record
*subrec
, char *name
, int type
,
1353 query_name_success_function success_fn
,
1354 query_name_fail_function fail_fn
,
1355 struct userdata_struct
*userdata
);
1356 BOOL
query_name_from_wins_server(struct in_addr ip_to
,
1357 char *name
, int type
,
1358 query_name_success_function success_fn
,
1359 query_name_fail_function fail_fn
,
1360 struct userdata_struct
*userdata
);
1362 /*The following definitions come from nmbd/nmbd_nameregister.c */
1364 BOOL
register_name(struct subnet_record
*subrec
,
1365 char *name
, int type
, uint16 nb_flags
,
1366 register_name_success_function success_fn
,
1367 register_name_fail_function fail_fn
,
1368 struct userdata_struct
*userdata
);
1369 BOOL
refresh_name(struct subnet_record
*subrec
, struct name_record
*namerec
,
1370 refresh_name_success_function success_fn
,
1371 refresh_name_fail_function fail_fn
,
1372 struct userdata_struct
*userdata
);
1374 /*The following definitions come from nmbd/nmbd_namerelease.c */
1376 BOOL
release_name(struct subnet_record
*subrec
, struct name_record
*namerec
,
1377 release_name_success_function success_fn
,
1378 release_name_fail_function fail_fn
,
1379 struct userdata_struct
*userdata
);
1381 /*The following definitions come from nmbd/nmbd_nodestatus.c */
1383 BOOL
node_status(struct subnet_record
*subrec
, struct nmb_name
*nmbname
,
1384 struct in_addr send_ip
, node_status_success_function success_fn
,
1385 node_status_fail_function fail_fn
, struct userdata_struct
*userdata
);
1387 /*The following definitions come from nmbd/nmbd_packets.c */
1389 uint16
get_nb_flags(char *buf
);
1390 void set_nb_flags(char *buf
, uint16 nb_flags
);
1391 struct response_record
*queue_register_name( struct subnet_record
*subrec
,
1392 response_function resp_fn
,
1393 timeout_response_function timeout_fn
,
1394 register_name_success_function success_fn
,
1395 register_name_fail_function fail_fn
,
1396 struct userdata_struct
*userdata
,
1397 struct nmb_name
*nmbname
,
1399 struct response_record
*queue_register_multihomed_name( struct subnet_record
*subrec
,
1400 response_function resp_fn
,
1401 timeout_response_function timeout_fn
,
1402 register_name_success_function success_fn
,
1403 register_name_fail_function fail_fn
,
1404 struct userdata_struct
*userdata
,
1405 struct nmb_name
*nmbname
,
1407 struct in_addr register_ip
);
1408 struct response_record
*queue_release_name( struct subnet_record
*subrec
,
1409 response_function resp_fn
,
1410 timeout_response_function timeout_fn
,
1411 release_name_success_function success_fn
,
1412 release_name_fail_function fail_fn
,
1413 struct userdata_struct
*userdata
,
1414 struct nmb_name
*nmbname
,
1416 struct in_addr release_ip
);
1417 struct response_record
*queue_refresh_name( struct subnet_record
*subrec
,
1418 response_function resp_fn
,
1419 timeout_response_function timeout_fn
,
1420 refresh_name_success_function success_fn
,
1421 refresh_name_fail_function fail_fn
,
1422 struct userdata_struct
*userdata
,
1423 struct name_record
*namerec
,
1424 struct in_addr refresh_ip
);
1425 struct response_record
*queue_query_name( struct subnet_record
*subrec
,
1426 response_function resp_fn
,
1427 timeout_response_function timeout_fn
,
1428 query_name_success_function success_fn
,
1429 query_name_fail_function fail_fn
,
1430 struct userdata_struct
*userdata
,
1431 struct nmb_name
*nmbname
);
1432 struct response_record
*queue_query_name_from_wins_server( struct in_addr to_ip
,
1433 response_function resp_fn
,
1434 timeout_response_function timeout_fn
,
1435 query_name_success_function success_fn
,
1436 query_name_fail_function fail_fn
,
1437 struct userdata_struct
*userdata
,
1438 struct nmb_name
*nmbname
);
1439 struct response_record
*queue_node_status( struct subnet_record
*subrec
,
1440 response_function resp_fn
,
1441 timeout_response_function timeout_fn
,
1442 node_status_success_function success_fn
,
1443 node_status_fail_function fail_fn
,
1444 struct userdata_struct
*userdata
,
1445 struct nmb_name
*nmbname
,
1446 struct in_addr send_ip
);
1447 void reply_netbios_packet(struct packet_struct
*orig_packet
,
1448 int rcode
, enum netbios_reply_type_code rcv_code
, int opcode
,
1449 int ttl
, char *data
,int len
);
1450 void run_packet_queue(void);
1451 void retransmit_or_expire_response_records(time_t t
);
1452 BOOL
listen_for_packets(BOOL run_election
);
1453 BOOL
send_mailslot(BOOL unique
, char *mailslot
,char *buf
,int len
,
1454 char *srcname
, int src_type
,
1455 char *dstname
, int dest_type
,
1456 struct in_addr dest_ip
,struct in_addr src_ip
,
1459 /*The following definitions come from nmbd/nmbd_processlogon.c */
1461 void process_logon_packet(struct packet_struct
*p
,char *buf
,int len
,
1464 /*The following definitions come from nmbd/nmbd_responserecordsdb.c */
1466 void remove_response_record(struct subnet_record
*subrec
,
1467 struct response_record
*rrec
);
1468 struct response_record
*make_response_record( struct subnet_record
*subrec
,
1469 struct packet_struct
*p
,
1470 response_function resp_fn
,
1471 timeout_response_function timeout_fn
,
1472 success_function success_fn
,
1473 fail_function fail_fn
,
1474 struct userdata_struct
*userdata
);
1475 struct response_record
*find_response_record(struct subnet_record
**ppsubrec
,
1477 BOOL
is_refresh_already_queued(struct subnet_record
*subrec
, struct name_record
*namerec
);
1479 /*The following definitions come from nmbd/nmbd_sendannounce.c */
1481 void send_browser_reset(int reset_type
, char *to_name
, int to_type
, struct in_addr to_ip
);
1482 void broadcast_announce_request(struct subnet_record
*subrec
, struct work_record
*work
);
1483 void announce_my_server_names(time_t t
);
1484 void announce_my_lm_server_names(time_t t
);
1485 void reset_announce_timer(void);
1486 void announce_myself_to_domain_master_browser(time_t t
);
1487 void announce_my_servers_removed(void);
1488 void announce_remote(time_t t
);
1489 void browse_sync_remote(time_t t
);
1491 /*The following definitions come from nmbd/nmbd_serverlistdb.c */
1493 void remove_all_servers(struct work_record
*work
);
1494 struct server_record
*find_server_in_workgroup(struct work_record
*work
, char *name
);
1495 void remove_server_from_workgroup(struct work_record
*work
, struct server_record
*servrec
);
1496 struct server_record
*create_server_on_workgroup(struct work_record
*work
,
1497 char *name
,int servertype
,
1498 int ttl
,char *comment
);
1499 void update_server_ttl(struct server_record
*servrec
, int ttl
);
1500 void expire_servers(struct work_record
*work
, time_t t
);
1501 void write_browse_list(time_t t
, BOOL force_write
);
1503 /*The following definitions come from nmbd/nmbd_subnetdb.c */
1505 BOOL
create_subnets(void);
1506 BOOL
we_are_a_wins_client(void);
1507 struct subnet_record
*get_next_subnet_maybe_unicast(struct subnet_record
*subrec
);
1508 struct subnet_record
*get_next_subnet_maybe_unicast_or_wins_server(struct subnet_record
*subrec
);
1510 /*The following definitions come from nmbd/nmbd_synclists.c */
1512 void sync_browse_lists(struct work_record
*work
,
1513 char *name
, int nm_type
,
1514 struct in_addr ip
, BOOL local
, BOOL servers
);
1515 void sync_check_completion(void);
1517 /*The following definitions come from nmbd/nmbd_winsproxy.c */
1519 void make_wins_proxy_name_query_request( struct subnet_record
*subrec
,
1520 struct packet_struct
*incoming_packet
,
1521 struct nmb_name
*question_name
);
1523 /*The following definitions come from nmbd/nmbd_winsserver.c */
1525 BOOL
packet_is_for_wins_server(struct packet_struct
*packet
);
1526 BOOL
initialise_wins(void);
1527 void wins_process_name_refresh_request(struct subnet_record
*subrec
,
1528 struct packet_struct
*p
);
1529 void wins_process_name_registration_request(struct subnet_record
*subrec
,
1530 struct packet_struct
*p
);
1531 void wins_process_multihomed_name_registration_request( struct subnet_record
*subrec
,
1532 struct packet_struct
*p
);
1533 void send_wins_name_query_response(int rcode
, struct packet_struct
*p
,
1534 struct name_record
*namerec
);
1535 void wins_process_name_query_request(struct subnet_record
*subrec
,
1536 struct packet_struct
*p
);
1537 void wins_process_name_release_request(struct subnet_record
*subrec
,
1538 struct packet_struct
*p
);
1539 void initiate_wins_processing(time_t t
);
1540 void wins_write_database(BOOL background
);
1542 /*The following definitions come from nmbd/nmbd_workgroupdb.c */
1544 struct work_record
*find_workgroup_on_subnet(struct subnet_record
*subrec
,
1546 struct work_record
*create_workgroup_on_subnet(struct subnet_record
*subrec
,
1547 fstring name
, int ttl
);
1548 void update_workgroup_ttl(struct work_record
*work
, int ttl
);
1549 void initiate_myworkgroup_startup(struct subnet_record
*subrec
, struct work_record
*work
);
1550 void dump_workgroups(BOOL force_write
);
1551 void expire_workgroups_and_servers(time_t t
);
1553 /*The following definitions come from param/loadparm.c */
1555 struct vfs_options
*lp_vfsoptions(int i
) ;
1556 char *lp_logfile(void);
1557 char *lp_smbrun(void);
1558 char *lp_configfile(void);
1559 char *lp_smb_passwd_file(void);
1560 char *lp_sam_directory(void);
1561 char *lp_smb_passgrp_file(void);
1562 char *lp_smb_group_file(void);
1563 char *lp_smb_alias_file(void);
1564 char *lp_serverstring(void);
1565 char *lp_printcapname(void);
1566 char *lp_lockdir(void);
1567 char *lp_rootdir(void);
1568 char *lp_defaultservice(void);
1569 char *lp_msg_command(void);
1570 char *lp_hosts_equiv(void);
1571 char *lp_auto_services(void);
1572 char *lp_passwd_program(void);
1573 char *lp_passwd_chat(void);
1574 char *lp_passwordserver(void);
1575 char *lp_name_resolve_order(void);
1576 char *lp_workgroup(void);
1577 char *lp_trusted_domains(void);
1578 char *lp_trusting_domains(void);
1579 char *lp_username_map(void);
1580 char *lp_aliasname_map(void);
1581 char *lp_groupname_map(void);
1582 char *lp_builtinname_map(void);
1583 char *lp_builtinrid_file(void);
1584 char *lp_ntusrname_map(void);
1585 char *lp_remote_announce(void);
1586 char *lp_remote_browse_sync(void);
1587 char *lp_wins_server(void);
1588 char *lp_interfaces(void);
1589 char *lp_socket_address(void);
1590 char *lp_nis_home_map_name(void);
1591 char *lp_netbios_aliases(void);
1592 char *lp_driverfile(void);
1593 char *lp_panic_action(void);
1594 char *lp_nt_forms(void);
1595 char *lp_nt_drivers_file(void);
1596 char *lp_dfs_map(void);
1597 char *lp_ldap_server(void);
1598 char *lp_ldap_suffix(void);
1599 char *lp_ldap_bind_as(void);
1600 char *lp_ldap_passwd_file(void);
1601 char *lp_ldap_url(void);
1602 char *lp_ldap_realm(void);
1603 char *lp_ldap_computers_subcontext(void);
1604 char *lp_ldap_users_subcontext(void);
1605 char *lp_ldap_builtin_subcontext(void);
1606 int lp_ssl_version(void);
1607 char *lp_ssl_hosts(void);
1608 char *lp_ssl_hosts_resign(void);
1609 char *lp_ssl_cacertdir(void);
1610 char *lp_ssl_cacertfile(void);
1611 char *lp_ssl_cert(void);
1612 char *lp_ssl_privkey(void);
1613 char *lp_ssl_client_cert(void);
1614 char *lp_ssl_client_privkey(void);
1615 char *lp_ssl_ciphers(void);
1616 BOOL
lp_ssl_enabled(void);
1617 BOOL
lp_ssl_reqClientCert(void);
1618 BOOL
lp_ssl_reqServerCert(void);
1619 BOOL
lp_ssl_compatibility(void);
1620 BOOL
lp_dns_proxy(void);
1621 BOOL
lp_wins_support(void);
1622 BOOL
lp_we_are_a_wins_server(void);
1623 BOOL
lp_wins_proxy(void);
1624 BOOL
lp_local_master(void);
1625 BOOL
lp_domain_logons(void);
1626 BOOL
lp_load_printers(void);
1627 BOOL
lp_use_rhosts(void);
1628 BOOL
lp_readprediction(void);
1629 BOOL
lp_readbmpx(void);
1630 BOOL
lp_readraw(void);
1631 BOOL
lp_writeraw(void);
1632 BOOL
lp_null_passwords(void);
1633 BOOL
lp_strip_dot(void);
1634 BOOL
lp_encrypted_passwords(void);
1635 BOOL
lp_update_encrypted(void);
1636 BOOL
lp_client_ntlmv2(void);
1637 BOOL
lp_server_ntlmv2(void);
1638 BOOL
lp_client_schannel(void);
1639 BOOL
lp_server_schannel(void);
1640 BOOL
lp_syslog_only(void);
1641 BOOL
lp_timestamp_logs(void);
1642 BOOL
lp_browse_list(void);
1643 BOOL
lp_unix_realname(void);
1644 BOOL
lp_nis_home_map(void);
1645 BOOL
lp_bind_interfaces_only(void);
1646 BOOL
lp_unix_password_sync(void);
1647 BOOL
lp_passwd_chat_debug(void);
1648 BOOL
lp_ole_locking_compat(void);
1649 BOOL
lp_nt_smb_support(void);
1650 BOOL
lp_nt_pipe_support(void);
1651 BOOL
lp_stat_cache(void);
1652 int lp_os_level(void);
1653 int lp_max_ttl(void);
1654 int lp_max_wins_ttl(void);
1655 int lp_min_wins_ttl(void);
1656 int lp_max_log_size(void);
1657 int lp_max_open_files(void);
1658 int lp_maxxmit(void);
1659 int lp_maxmux(void);
1660 int lp_passwordlevel(void);
1661 int lp_usernamelevel(void);
1662 int lp_readsize(void);
1663 int lp_shmem_size(void);
1664 int lp_deadtime(void);
1665 int lp_maxprotocol(void);
1666 int lp_security(void);
1667 int lp_maxdisksize(void);
1668 int lp_lpqcachetime(void);
1669 int lp_syslog(void);
1670 int lp_client_code_page(void);
1671 int lp_lm_announce(void);
1672 int lp_lm_interval(void);
1673 int lp_machine_password_timeout(void);
1674 int lp_change_notify_timeout(void);
1675 int lp_stat_cache_size(void);
1676 int lp_map_to_guest(void);
1677 int lp_ldap_port(void);
1678 int lp_ldap_protocol_version(void);
1679 char *lp_logon_script(const user_struct
* );
1680 char *lp_logon_path(const user_struct
* );
1681 char *lp_logon_drive(const user_struct
* );
1682 char *lp_logon_home(const user_struct
* );
1683 char *lp_preexec(int );
1684 char *lp_postexec(int );
1685 char *lp_rootpreexec(int );
1686 char *lp_rootpostexec(int );
1687 char *lp_servicename(int );
1688 char *lp_pathname(int );
1689 char *lp_dontdescend(int );
1690 char *lp_username(int );
1691 char *lp_guestaccount(int );
1692 char *lp_invalid_users(int );
1693 char *lp_valid_users(int );
1694 char *lp_admin_users(int );
1695 char *lp_printcommand(int );
1696 char *lp_lpqcommand(int );
1697 char *lp_lprmcommand(int );
1698 char *lp_lppausecommand(int );
1699 char *lp_lpresumecommand(int );
1700 char *lp_queuepausecommand(int );
1701 char *lp_queueresumecommand(int );
1702 char *lp_printername(int );
1703 char *lp_printerdriver(int );
1704 char *lp_hostsallow(int );
1705 char *lp_hostsdeny(int );
1706 char *lp_magicscript(int );
1707 char *lp_magicoutput(int );
1708 char *lp_comment(int );
1709 char *lp_force_user(int );
1710 char *lp_force_group(int );
1711 char *lp_readlist(int );
1712 char *lp_writelist(int );
1713 char *lp_fstype(int );
1714 char *lp_vfsobj(int );
1715 char *lp_mangled_map(int );
1716 char *lp_veto_files(int );
1717 char *lp_hide_files(int );
1718 char *lp_veto_oplocks(int );
1719 char *lp_driverlocation(int );
1720 BOOL
lp_revalidate(int );
1721 BOOL
lp_casesensitive(int );
1722 BOOL
lp_preservecase(int );
1723 BOOL
lp_shortpreservecase(int );
1724 BOOL
lp_casemangle(int );
1725 BOOL
lp_status(int );
1726 BOOL
lp_hide_dot_files(int );
1727 BOOL
lp_browseable(int );
1728 BOOL
lp_readonly(int );
1729 BOOL
lp_no_set_dir(int );
1730 BOOL
lp_guest_ok(int );
1731 BOOL
lp_guest_only(int );
1732 BOOL
lp_print_ok(int );
1733 BOOL
lp_postscript(int );
1734 BOOL
lp_map_hidden(int );
1735 BOOL
lp_map_archive(int );
1736 BOOL
lp_locking(int );
1737 BOOL
lp_strict_locking(int );
1738 BOOL
lp_share_modes(int );
1739 BOOL
lp_oplocks(int );
1740 BOOL
lp_onlyuser(int );
1741 BOOL
lp_manglednames(int );
1742 BOOL
lp_widelinks(int );
1743 BOOL
lp_symlinks(int );
1744 BOOL
lp_syncalways(int );
1745 BOOL
lp_strict_sync(int );
1746 BOOL
lp_map_system(int );
1747 BOOL
lp_delete_readonly(int );
1748 BOOL
lp_fake_oplocks(int );
1749 BOOL
lp_recursive_veto_delete(int );
1750 BOOL
lp_dos_filetimes(int );
1751 BOOL
lp_dos_filetime_resolution(int );
1752 BOOL
lp_fake_dir_create_times(int );
1753 BOOL
lp_blocking_locks(int );
1754 int lp_create_mode(int );
1755 int lp_force_create_mode(int );
1756 int lp_dir_mode(int );
1757 int lp_force_dir_mode(int );
1758 int lp_max_connections(int );
1759 int lp_defaultcase(int );
1760 int lp_minprintspace(int );
1761 int lp_printing(int );
1762 char lp_magicchar(int );
1763 char *lp_mysql_host(void);
1764 char *lp_mysql_user(void);
1765 char *lp_mysql_passfile(void);
1766 char *lp_mysql_db(void);
1767 char *lp_mysql_table(void);
1768 BOOL
lp_add_home(char *pszHomename
, int iDefaultService
, char *pszHomedir
);
1769 int lp_add_service(char *pszService
, int iDefaultService
);
1770 BOOL
lp_add_printer(char *pszPrintername
, int iDefaultService
);
1771 BOOL
lp_file_list_changed(void);
1772 void *lp_local_ptr(int snum
, void *ptr
);
1773 BOOL
lp_do_parameter(int snum
, char *pszParmName
, char *pszParmValue
);
1774 BOOL
lp_is_default(int snum
, struct parm_struct
*parm
);
1775 struct parm_struct
*lp_next_parameter(int snum
, int *i
, int allparameters
);
1776 BOOL
lp_snum_ok(int iService
);
1777 void lp_add_one_printer(char *name
,char *comment
);
1778 BOOL
lp_loaded(void);
1779 void lp_killunused(BOOL (*snumused
)(int ));
1780 BOOL
lp_load(char *pszFname
,BOOL global_only
, BOOL save_defaults
, BOOL add_ipc
);
1781 int lp_numservices(void);
1782 void lp_dump(FILE *f
, BOOL show_defaults
);
1783 int lp_servicenumber(char *pszServiceName
);
1784 char *volume_label(int snum
);
1785 void lp_remove_service(int snum
);
1786 void lp_copy_service(int snum
, char *new_name
);
1787 int lp_default_server_announce(void);
1788 int lp_major_announce_version(void);
1789 int lp_minor_announce_version(void);
1790 void lp_set_name_resolve_order(char *new_order
);
1791 void lp_set_kernel_oplocks(BOOL val
);
1792 BOOL
lp_kernel_oplocks(void);
1793 int lp_server_role(void);
1794 BOOL
lp_domain_master(void);
1795 BOOL
lp_preferred_master(void);
1797 /*The following definitions come from param/params.c */
1799 BOOL
pm_process( char *FileName
,
1800 BOOL (*sfunc
)(char *),
1801 BOOL (*pfunc
)(char *, char *) );
1803 /*The following definitions come from passdb/ldap.c */
1805 BOOL
ldap_connect(void);
1806 void ldap_disconnect(void);
1807 BOOL
ldap_search_for(char *filter
);
1808 BOOL
ldap_search_by_name(const char *user
);
1809 BOOL
ldap_search_by_uid(int uid
);
1810 BOOL
ldap_get_attribute(char *attribute
, char *value
);
1811 struct smb_passwd
*ldap_getpw(void);
1812 BOOL
ldap_allocaterid(uint32
*rid
);
1813 struct smb_passdb_ops
*ldap_initialise_password_db(void);
1815 /*The following definitions come from passdb/ldapdb.c */
1817 BOOL
ldapdb_init(void);
1818 BOOL
ldapdb_get_uint32(LDAPDB
*hds
, const char *attribute
, uint32
*val
);
1819 BOOL
ldapdb_get_unistr_value(LDAPDB
*hds
, const char *attribute
, UNISTR2
*buf
);
1820 BOOL
ldapdb_oc_check(LDAPDB
*hds
, const char *ocname
);
1821 BOOL
ldapdb_queue_unistr_mod(LDAPMod
***modlist
,int modop
, const char *attribute
, const UNISTR2
*value
);
1822 BOOL
ldapdb_queue_uint32_mod(LDAPMod
***modlist
, int modop
, const char *attribute
, uint32 value
);
1823 BOOL
ldapdb_get_domain_info(PLDAPDB _hds
, const char *realm
, DOM_SID
*sid
, fstring nbname
);
1824 void unistr2_to_utf8(char *dest
, const UNISTR2
*str
, size_t maxlen
);
1825 void utf8_to_unistr2(UNISTR2
*unistr
, const char *str
);
1827 /*The following definitions come from passdb/mysqlpass.c */
1829 int mysql_db_lock_connect( MYSQL
*handle
);
1830 void *mysql_startpwent( BOOL update
);
1831 void mysql_endpwent( void *ptr
);
1832 SMB_BIG_UINT
mysql_getpwpos(void *vp
);
1833 BOOL
mysql_setpwpos(void *vp
, SMB_BIG_UINT pos
);
1834 void *mysql_fill_smb_passwd( MYSQL_ROW
*row
);
1835 struct smb_passwd
*mysql_getsmbpwent(void *vp
);
1836 void *mysql_fetch_passwd( void *(*filler
)(MYSQL_ROW
*), char *where
);
1837 void *mysql_getpwuid(void *(*filler
)(MYSQL_ROW
*), uid_t uid
);
1838 struct smb_passwd
*mysql_getsmbpwuid(uid_t uid
);
1839 void *mysql_getpwnam(void *(*filler
)(MYSQL_ROW
*), char *field
, const char *name
);
1840 struct smb_passwd
*mysql_getsmbpwnam(const char *unix_name
);
1841 BOOL
mysql_del_smb( MYSQL
*handle
, char *unix_name
);
1842 BOOL
mysql_add_smb( MYSQL
*handle
, struct smb_passwd
*smb
);
1843 BOOL
mysql_mod_smb( MYSQL
*handle
, struct smb_passwd
*smb
, BOOL override
);
1844 BOOL
mysql_add_smbpwd_entry(struct smb_passwd
*smb
);
1845 BOOL
mysql_mod_smbpwd_entry(struct smb_passwd
*smb
, BOOL override
);
1846 struct smb_passdb_ops
*mysql_initialise_password_db(void);
1848 /*The following definitions come from passdb/mysqlsampass.c */
1850 void *mysql_fill_sam_passwd( MYSQL_ROW
*row
);
1851 struct sam_passwd
*mysql_getsampwent(void *vp
);
1852 struct sam_passwd
*mysql_getsampwrid(uint32 rid
);
1853 struct sam_passwd
*mysql_getsampwuid(uid_t uid
);
1854 struct sam_passwd
*mysql_getsampwntnam(const char *nt_name
);
1855 struct sam_disp_info
*mysql_getsamdispntnam(const char *nt_name
);
1856 struct sam_disp_info
*mysql_getsamdisprid(uint32 rid
);
1857 struct sam_disp_info
*mysql_getsamdispent(void *vp
);
1858 BOOL
mysql_add_sampwd_entry(struct sam_passwd
*sam
);
1859 BOOL
mysql_mod_sampwd_entry(struct sam_passwd
*sam
, BOOL override
);
1860 struct sam_passdb_ops
*mysql_initialise_sam_password_db(void);
1862 /*The following definitions come from passdb/nispass.c */
1864 struct passdb_ops
*nisplus_initialise_password_db(void);
1866 /*The following definitions come from passdb/nt5ldap.c */
1868 BOOL
nt5ldap_make_local_grp(LDAPDB
* hds
, LOCAL_GRP
* group
,
1869 LOCAL_GRP_MEMBER
** members
, int *num_membs
, uint32 req_type
);
1870 BOOL
nt5ldap_make_sam_user_info21(LDAPDB
*hds
, SAM_USER_INFO_21
*usr
);
1871 BOOL
nt5ldap_sam_user_info21_mods(const SAM_USER_INFO_21
*usr
, LDAPMod
***mods
, int op
,
1872 char *rdn
, size_t rdnmaxlen
, BOOL
*iscomputer_p
);
1874 /*The following definitions come from passdb/pass_check.c */
1876 void dfs_unlogin(void);
1877 BOOL
pass_check(const char *_user
, const char *_password
,
1878 int pwlen
, const struct passwd
*pwd
,
1879 BOOL (*fn
)(const char *, const char *));
1881 /*The following definitions come from passdb/passdb.c */
1883 BOOL
initialise_password_db(void);
1884 struct smb_passwd
*iterate_getsmbpwuid(uid_t unix_uid
);
1885 struct smb_passwd
*iterate_getsmbpwnam(const char *name
);
1886 void *startsmbpwent(BOOL update
);
1887 void endsmbpwent(void *vp
);
1888 SMB_BIG_UINT
getsmbpwpos(void *vp
);
1889 BOOL
setsmbpwpos(void *vp
, SMB_BIG_UINT tok
);
1890 struct smb_passwd
*getsmbpwent(void *vp
);
1891 BOOL
add_smbpwd_entry(struct smb_passwd
*newpwd
);
1892 BOOL
mod_smbpwd_entry(struct smb_passwd
* pwd
, BOOL override
);
1893 struct smb_passwd
*getsmbpwnam(const char *name
);
1894 struct smb_passwd
*getsmbpwuid(uid_t unix_uid
);
1895 void pwdb_init_smb(struct smb_passwd
*user
);
1896 struct smb_passwd
*pwdb_smb_map_names(struct smb_passwd
*smb
);
1898 /*The following definitions come from passdb/passgrp.c */
1900 BOOL
initialise_passgrp_db(void);
1901 struct smb_passwd
*iterate_getsmbgrprid(uint32 user_rid
,
1902 uint32
**grps
, int *num_grps
,
1903 uint32
**alss
, int *num_alss
);
1904 struct smb_passwd
*iterate_getsmbgrpuid(uid_t unix_uid
,
1905 uint32
**grps
, int *num_grps
,
1906 uint32
**alss
, int *num_alss
);
1907 struct smb_passwd
*iterate_getsmbgrpntnam(const char *nt_name
,
1908 uint32
**grps
, int *num_grps
,
1909 uint32
**alss
, int *num_alss
);
1910 void *startsmbgrpent(BOOL update
);
1911 void endsmbgrpent(void *vp
);
1912 struct smb_passwd
*getsmbgrpent(void *vp
,
1913 uint32
**grps
, int *num_grps
,
1914 uint32
**alss
, int *num_alss
);
1915 struct smb_passwd
*getsmbgrpntnam(char *name
,
1916 uint32
**grps
, int *num_grps
,
1917 uint32
**alss
, int *num_alss
);
1918 struct smb_passwd
*getsmbgrprid(uint32 user_rid
,
1919 uint32
**grps
, int *num_grps
,
1920 uint32
**alss
, int *num_alss
);
1921 struct smb_passwd
*getsmbgrpuid(uid_t unix_uid
,
1922 uint32
**grps
, int *num_grps
,
1923 uint32
**alss
, int *num_alss
);
1925 /*The following definitions come from passdb/passgrpldap.c */
1927 struct passgrp_ops
*ldap_initialise_password_grp(void);
1929 /*The following definitions come from passdb/passgrpnt5ldap.c */
1932 /*The following definitions come from passdb/sampass.c */
1934 struct sam_passdb_ops
*file_initialise_sam_password_db(void);
1936 /*The following definitions come from passdb/sampassdb.c */
1938 BOOL
initialise_sam_password_db(void);
1939 void *startsam21pwent(BOOL update
);
1940 void endsam21pwent(void *vp
);
1941 struct sam_passwd
*getsam21pwent(void *vp
);
1942 BOOL
mod_sam21pwd_entry(struct sam_passwd
* pwd
, BOOL override
);
1943 struct sam_passwd
*iterate_getsam21pwntnam(const char *ntname
);
1944 struct sam_passwd
*iterate_getsam21pwrid(uint32 rid
);
1945 struct sam_passwd
*iterate_getsam21pwuid(uid_t uid
);
1946 struct sam_disp_info
*getsamdisprid(uint32 rid
);
1947 struct sam_passwd
*getsam21pwntnam(const char *name
);
1948 struct sam_passwd
*getsam21pwrid(uint32 rid
);
1949 void pwdb_init_sam(struct sam_passwd
*user
);
1950 struct sam_disp_info
*pwdb_sam_to_dispinfo(struct sam_passwd
*user
);
1951 void copy_id23_to_sam_passwd(struct sam_passwd
*to
, const SAM_USER_INFO_23
*from
);
1952 void copy_sam_passwd(struct sam_passwd
*to
, const struct sam_passwd
*from
);
1953 struct smb_passwd
*pwdb_sam_to_smb(struct sam_passwd
*user
);
1954 struct sam_passwd
*pwdb_smb_to_sam(struct smb_passwd
*user
);
1955 struct sam_passwd
*pwdb_sam_map_names(struct sam_passwd
*sam
);
1957 /*The following definitions come from passdb/sampassldap.c */
1959 BOOL
ldap_search_by_rid(uint32 rid
);
1960 BOOL
ldap_search_by_ntname(const char *ntname
);
1961 struct sam_passdb_ops
*ldap_initialise_sam_password_db(void);
1963 /*The following definitions come from passdb/sampassnt5ldap.c */
1966 /*The following definitions come from passdb/smbpass.c */
1968 struct smb_passwd
*getsmbfilepwent(void *vp
);
1969 struct smb_passdb_ops
*file_initialise_password_db(void);
1971 /*The following definitions come from passdb/smbpasschange.c */
1973 BOOL
local_password_change(char *user_name
,
1975 uint16 acb_info
, uint16 acb_mask
,
1977 char *err_str
, size_t err_str_len
,
1978 char *msg_str
, size_t msg_str_len
);
1980 /*The following definitions come from passdb/smbpassfile.c */
1982 BOOL
trust_password_lock( const char *domain
, const char *name
, BOOL update
);
1983 BOOL
trust_password_unlock(void);
1984 BOOL
trust_password_delete( char *domain
, char *name
);
1985 BOOL
get_trust_account_password( uchar
*ret_pwd
, time_t *pass_last_set_time
);
1986 BOOL
set_trust_account_password( uchar
*md4_new_pwd
);
1987 BOOL
trust_get_passwd( uchar trust_passwd
[16],
1988 const char *domain
, const char *myname
);
1989 BOOL
create_trust_account_file(char *domain
, char *name
, uchar pass
[16]);
1991 /*The following definitions come from passdb/smbpassgroup.c */
1993 struct passgrp_ops
*file_initialise_password_grp(void);
1995 /*The following definitions come from passdb/smbpassgroupunix.c */
1997 struct passgrp_ops
*unix_initialise_password_grp(void);
1999 /*The following definitions come from passdb/smbpassnt5ldap.c */
2002 /*The following definitions come from printing/nt_printing.c */
2004 int get_ntforms(nt_forms_struct
**list
);
2005 int write_ntforms(nt_forms_struct
**list
, int number
);
2006 void add_a_form(nt_forms_struct
**list
, const FORM
*form
, int *count
);
2007 void update_a_form(nt_forms_struct
**list
, const FORM
*form
, int count
);
2008 int get_ntdrivers(fstring
**list
, char *architecture
);
2009 void get_short_archi(char *short_archi
, char *long_archi
);
2010 void dump_a_param(NT_PRINTER_PARAM
*param
);
2011 BOOL
add_a_specific_param(NT_PRINTER_INFO_LEVEL_2
*info_2
, NT_PRINTER_PARAM
*param
);
2012 BOOL
unlink_specific_param_if_exist(NT_PRINTER_INFO_LEVEL_2
*info_2
, NT_PRINTER_PARAM
*param
);
2013 uint32
add_a_printer(NT_PRINTER_INFO_LEVEL printer
, uint32 level
);
2014 uint32
get_a_printer(NT_PRINTER_INFO_LEVEL
*printer
, uint32 level
, fstring sharename
);
2015 uint32
free_a_printer(NT_PRINTER_INFO_LEVEL printer
, uint32 level
);
2016 uint32
add_a_printer_driver(NT_PRINTER_DRIVER_INFO_LEVEL driver
, uint32 level
);
2017 uint32
get_a_printer_driver(NT_PRINTER_DRIVER_INFO_LEVEL
*driver
, uint32 level
,
2018 fstring printername
, fstring architecture
);
2019 uint32
free_a_printer_driver(NT_PRINTER_DRIVER_INFO_LEVEL driver
, uint32 level
);
2020 BOOL
get_specific_param_by_index(NT_PRINTER_INFO_LEVEL printer
, uint32 level
, uint32 param_index
,
2021 fstring value
, uint8
**data
, uint32
*type
, uint32
*len
);
2022 BOOL
get_specific_param(NT_PRINTER_INFO_LEVEL printer
, uint32 level
,
2023 fstring value
, uint8
**data
, uint32
*type
, uint32
*len
);
2024 void init_devicemode(NT_DEVICEMODE
*nt_devmode
);
2026 /*The following definitions come from printing/pcap.c */
2028 BOOL
pcap_printername_ok(char *pszPrintername
, char *pszPrintcapname
);
2029 void pcap_printer_fn(void (*fn
)(char *, char *));
2031 /*The following definitions come from printing/print_svid.c */
2033 void sysv_printer_fn(void (*fn
)(char *, char *));
2034 int sysv_printername_ok(char *name
);
2036 /*The following definitions come from printing/printing.c */
2038 void lpq_reset(int snum
);
2039 void print_file(connection_struct
*conn
, const vuser_key
*key
,
2040 int snum
, files_struct
*file
);
2041 int get_printqueue(int snum
, connection_struct
*conn
, const vuser_key
*key
,
2042 print_queue_struct
**queue
,
2043 print_status_struct
*status
);
2044 void del_printqueue(connection_struct
*conn
,const vuser_key
*key
,
2045 int snum
,int jobid
);
2046 void status_printjob(connection_struct
*conn
,const vuser_key
*key
,
2047 int snum
,int jobid
,int status
);
2048 int printjob_encode(int snum
, int job
);
2049 void printjob_decode(int jobid
, int *snum
, int *job
);
2050 uint32
status_printqueue(connection_struct
*conn
,const vuser_key
*key
,
2051 int snum
,int status
);
2052 void load_printers(void);
2054 /*The following definitions come from profile/profile.c */
2056 BOOL
profile_setup(BOOL rdonly
);
2058 /*The following definitions come from rpc_client/cli_atsvc.c */
2061 char *srv_name
, AT_JOB_INFO
*info
, char *command
,
2063 BOOL
at_del_job( char *srv_name
, uint32 min_jobid
, uint32 max_jobid
);
2064 BOOL
at_enum_jobs( char *srv_name
, uint32
*num_jobs
,
2065 AT_ENUM_INFO
*jobs
, char ***commands
);
2066 BOOL
at_query_job(char *srv_name
,
2067 uint32 jobid
, AT_JOB_INFO
*job
, fstring command
);
2069 /*The following definitions come from rpc_client/cli_brs.c */
2071 BOOL
brs_query_info( const char *srv_name
, uint32 switch_value
,
2074 /*The following definitions come from rpc_client/cli_connect.c */
2076 void init_connections(void);
2077 void free_connections(void);
2078 void cli_connection_free(struct cli_connection
*con
);
2079 void cli_connection_unlink(struct cli_connection
*con
);
2080 BOOL
cli_connection_init(const char* srv_name
, const char* pipe_name
,
2081 struct cli_connection
**con
);
2082 BOOL
cli_connection_init_auth(const char* srv_name
, const char* pipe_name
,
2083 struct cli_connection
**con
,
2086 BOOL
cli_connection_getsrv(const char* srv_name
, const char* pipe_name
,
2087 struct cli_connection
**con
);
2088 BOOL
cli_connection_get(const POLICY_HND
*pol
, struct cli_connection
**con
);
2089 BOOL
cli_pol_link(POLICY_HND
*to
, const POLICY_HND
*from
);
2090 BOOL
cli_get_usr_sesskey(const POLICY_HND
*pol
, uchar usr_sess_key
[16]);
2091 BOOL
cli_set_con_usr_sesskey(struct cli_connection
*con
,
2092 const uchar usr_sess_key
[16]);
2093 const vuser_key
*cli_con_sec_ctx(struct cli_connection
*con
);
2094 struct cli_auth_fns
*cli_conn_get_authfns(struct cli_connection
*con
);
2095 void *cli_conn_get_auth_creds(struct cli_connection
*con
);
2096 void *cli_conn_get_auth_info(struct cli_connection
*con
);
2097 BOOL
cli_conn_set_auth_info(struct cli_connection
*con
, void *auth_info
);
2098 struct ntdom_info
*cli_conn_get_ntinfo(struct cli_connection
*con
);
2099 BOOL
cli_get_con_sesskey(struct cli_connection
*con
, uchar sess_key
[16]);
2100 BOOL
cli_con_get_srvname(struct cli_connection
*con
, char *srv_name
);
2101 BOOL
cli_get_sesskey(const POLICY_HND
*pol
, uchar sess_key
[16]);
2102 BOOL
cli_get_sesskey_srv(const char* srv_name
, uchar sess_key
[16]);
2103 void cli_con_gen_next_creds(struct cli_connection
*con
,
2104 DOM_CRED
*new_clnt_cred
);
2105 void cli_con_get_cli_cred(struct cli_connection
*con
,
2106 DOM_CRED
*clnt_cred
);
2107 BOOL
cli_con_deal_with_creds(struct cli_connection
*con
,
2108 DOM_CRED
*rcv_srv_cred
);
2109 BOOL
cli_con_set_creds(const char* srv_name
, const uchar sess_key
[16],
2111 BOOL
rpc_hnd_pipe_req(const POLICY_HND
*hnd
, uint8 op_num
,
2112 prs_struct
*data
, prs_struct
*rdata
);
2113 BOOL
rpc_con_pipe_req(struct cli_connection
*con
, uint8 op_num
,
2114 prs_struct
*data
, prs_struct
*rdata
);
2115 BOOL
rpc_api_write(struct cli_connection
*con
, prs_struct
*data
);
2116 BOOL
rpc_api_rcv_pdu(struct cli_connection
*con
, prs_struct
*rdata
);
2117 BOOL
rpc_api_send_rcv_pdu(struct cli_connection
*con
, prs_struct
*data
,
2119 BOOL
set_policy_con(struct policy_cache
*cache
, POLICY_HND
*hnd
,
2120 struct cli_connection
*con
,
2121 void (*free_fn
)(struct cli_connection
*));
2122 BOOL
get_policy_con(struct policy_cache
*cache
, const POLICY_HND
*hnd
,
2123 struct cli_connection
**con
);
2125 /*The following definitions come from rpc_client/cli_eventlog.c */
2127 BOOL
event_open(const char* srv_name
, const char *log
, POLICY_HND
*hnd
);
2128 BOOL
event_close( POLICY_HND
*hnd
);
2129 BOOL
event_numofeventlogrec( POLICY_HND
*hnd
, uint32
*number
);
2130 BOOL
event_readeventlog(POLICY_HND
*hnd
,
2131 uint32 number
, uint32 flags
, uint32 offset
,
2132 uint32
*number_of_bytes
, EVENTLOGRECORD
*ev
);
2134 /*The following definitions come from rpc_client/cli_login.c */
2136 uint32
cli_nt_setup_creds( const char* srv_name
,
2138 const char* myhostname
,
2139 const char* trust_acct
,
2140 unsigned char trust_pwd
[16],
2142 BOOL
cli_nt_srv_pwset(const char* srv_name
, const char* myhostname
,
2143 const char* trust_acct
,
2144 unsigned char *new_hashof_trust_pwd
,
2146 BOOL
cli_nt_login_general(const char* srv_name
, const char* myhostname
,
2147 const char *domain
, const char *username
,
2149 const char* general
,
2150 NET_ID_INFO_CTR
*ctr
,
2151 NET_USER_INFO_3
*user_info3
);
2152 BOOL
cli_nt_login_interactive(const char* srv_name
, const char* myhostname
,
2153 const char *domain
, const char *username
,
2155 const uchar
*lm_owf_user_pwd
,
2156 const uchar
*nt_owf_user_pwd
,
2157 NET_ID_INFO_CTR
*ctr
,
2158 NET_USER_INFO_3
*user_info3
);
2159 BOOL
cli_nt_login_network(const char* srv_name
, const char* myhostname
,
2160 const char *domain
, const char *username
,
2161 uint32 luid_low
, const char lm_chal
[8],
2162 const char *lm_chal_resp
,
2164 const char *nt_chal_resp
,
2166 NET_ID_INFO_CTR
*ctr
,
2167 NET_USER_INFO_3
*user_info3
);
2168 BOOL
cli_nt_logoff(const char* srv_name
, const char* myhostname
,
2169 NET_ID_INFO_CTR
*ctr
);
2170 BOOL
net_sam_sync(const char* srv_name
,
2172 const char* myhostname
,
2173 const char* trust_acct
,
2174 uchar trust_passwd
[16],
2175 SAM_DELTA_HDR hdr_deltas
[MAX_SAM_DELTAS
],
2176 SAM_DELTA_CTR deltas
[MAX_SAM_DELTAS
],
2177 uint32
*num_deltas
);
2179 /*The following definitions come from rpc_client/cli_lsarpc.c */
2181 BOOL
get_domain_sids(const char *domain
, DOM_SID
*sid3
, DOM_SID
*sid5
);
2182 BOOL
get_trust_sid_and_domain(const char* myname
, char *server
,
2184 char *domain
, size_t len
);
2185 BOOL
lsa_open_policy(const char *system_name
, POLICY_HND
*hnd
,
2186 BOOL sec_qos
, uint32 des_access
);
2187 BOOL
lsa_open_policy2( const char *system_name
, POLICY_HND
*hnd
,
2188 BOOL sec_qos
, uint32 des_access
);
2189 BOOL
lsa_open_secret( const POLICY_HND
*hnd
,
2190 const char *secret_name
,
2192 POLICY_HND
*hnd_secret
);
2193 BOOL
lsa_query_secret(POLICY_HND
*hnd
, STRING2
*secret
,
2194 NTTIME
*last_update
);
2195 BOOL
lsa_lookup_names( POLICY_HND
*hnd
,
2201 BOOL
lsa_lookup_sids(POLICY_HND
*hnd
,
2207 BOOL
lsa_query_info_pol(POLICY_HND
*hnd
, uint16 info_class
,
2208 fstring domain_name
, DOM_SID
*domain_sid
);
2209 BOOL
lsa_enum_trust_dom(POLICY_HND
*hnd
, uint32
*enum_ctx
,
2210 uint32
*num_doms
, char ***names
,
2212 BOOL
lsa_close(POLICY_HND
*hnd
);
2214 /*The following definitions come from rpc_client/cli_netlogon.c */
2216 void gen_next_creds( struct ntdom_info
*nt
, DOM_CRED
*new_clnt_cred
);
2217 BOOL
cli_net_logon_ctrl2(const char* srv_name
, uint32 status_level
);
2218 uint32
cli_net_auth2(const char *srv_name
,
2219 const char *trust_acct
,
2220 const char *acct_name
,
2222 uint32
*neg_flags
, DOM_CHAL
*srv_chal
);
2223 uint32
cli_net_req_chal( const char *srv_name
, const char* myhostname
,
2224 DOM_CHAL
*clnt_chal
, DOM_CHAL
*srv_chal
);
2225 BOOL
cli_net_srv_pwset(const char* srv_name
,
2226 const char* myhostname
,
2227 const char* trust_acct
,
2228 uint8 hashed_trust_pwd
[16],
2229 uint16 sec_chan_type
);
2230 uint32
cli_net_sam_logon(const char* srv_name
, const char* myhostname
,
2231 NET_ID_INFO_CTR
*ctr
,
2232 NET_USER_INFO_3
*user_info3
);
2233 BOOL
cli_net_sam_logoff(const char* srv_name
, const char* myhostname
,
2234 NET_ID_INFO_CTR
*ctr
);
2235 BOOL
cli_net_sam_sync( const char* srv_name
, const char* myhostname
,
2238 SAM_DELTA_HDR
*hdr_deltas
,
2239 SAM_DELTA_CTR
*deltas
);
2241 /*The following definitions come from rpc_client/cli_netlogon_sync.c */
2243 BOOL
synchronise_passdb(void);
2245 /*The following definitions come from rpc_client/cli_pipe.c */
2247 BOOL
create_rpc_request(prs_struct
*rhdr
, uint16 vuid
,
2248 uint8 op_num
, uint8 flags
,
2251 BOOL
rpc_api_pipe_req(struct cli_connection
*con
, uint8 opnum
,
2254 BOOL
cli_send_and_rcv_pdu_trans(struct cli_connection
*con
,
2255 struct cli_state
*cli
, uint16 fnum
,
2256 prs_struct
*data
, prs_struct
*rdata
,
2258 BOOL
cli_send_and_rcv_pdu_rw(struct cli_connection
*con
,
2259 struct cli_state
*cli
, uint16 fnum
,
2260 prs_struct
*data
, prs_struct
*rdata
,
2262 BOOL
cli_send_and_rcv_pdu(struct cli_connection
*con
,
2263 struct cli_state
*cli
, uint16 fnum
,
2264 prs_struct
*data
, prs_struct
*rdata
,
2266 BOOL
cli_rcv_pdu(struct cli_connection
*con
,
2267 struct cli_state
*cli
, uint16 fnum
,
2269 BOOL
rpc_pipe_bind(struct cli_connection
*con
,
2270 const char *pipe_name
,
2271 RPC_IFACE
*abstract
, RPC_IFACE
*transfer
,
2273 void cli_nt_set_ntlmssp_flgs(struct cli_state
*cli
, uint32 ntlmssp_flgs
);
2274 BOOL
cli_nt_session_open(struct cli_state
*cli
, const char *pipe_name
,
2276 void cli_nt_session_close(struct cli_state
*cli
, uint16 fnum
);
2278 /*The following definitions come from rpc_client/cli_pipe_netsec.c */
2281 /*The following definitions come from rpc_client/cli_pipe_noauth.c */
2284 /*The following definitions come from rpc_client/cli_pipe_ntlmssp.c */
2287 /*The following definitions come from rpc_client/cli_reg.c */
2289 BOOL
reg_connect( const char* srv_name
,
2290 const char *full_keyname
,
2293 POLICY_HND
*reg_hnd
);
2294 BOOL
reg_open_hkcr( struct cli_connection
*con
,
2295 uint16 unknown_0
, uint32 level
,
2297 BOOL
reg_open_hklm( struct cli_connection
*con
,
2298 uint16 unknown_0
, uint32 level
,
2300 BOOL
reg_open_hku( struct cli_connection
*con
,
2301 uint16 unknown_0
, uint32 level
,
2303 BOOL
reg_flush_key( POLICY_HND
*hnd
);
2304 BOOL
reg_query_key( POLICY_HND
*hnd
,
2305 char *key_class
, uint32
*class_len
,
2306 uint32
*num_subkeys
, uint32
*max_subkeylen
,
2307 uint32
*max_subkeysize
, uint32
*num_values
,
2308 uint32
*max_valnamelen
, uint32
*max_valbufsize
,
2309 uint32
*sec_desc
, NTTIME
*mod_time
);
2310 BOOL
reg_unknown_1a( POLICY_HND
*hnd
, uint32
*unk
);
2311 BOOL
reg_query_info( POLICY_HND
*hnd
,
2312 const char* val_name
,
2313 uint32
*type
, BUFFER2
*buffer
);
2314 BOOL
reg_set_key_sec( POLICY_HND
*hnd
,
2316 uint32 sec_buf_size
, SEC_DESC
*sec_buf
);
2317 BOOL
reg_get_key_sec( POLICY_HND
*hnd
,
2319 uint32
*sec_buf_size
, SEC_DESC_BUF
*sec_buf
);
2320 BOOL
reg_delete_val( POLICY_HND
*hnd
, char *val_name
);
2321 BOOL
reg_delete_key( POLICY_HND
*hnd
, char *key_name
);
2322 BOOL
reg_create_key( POLICY_HND
*hnd
,
2323 char *key_name
, char *key_class
,
2324 SEC_ACCESS
*sam_access
,
2326 BOOL
reg_enum_key( POLICY_HND
*hnd
,
2327 int key_index
, char *key_name
,
2328 uint32
*unk_1
, uint32
*unk_2
,
2330 BOOL
reg_create_val( POLICY_HND
*hnd
,
2331 char *val_name
, uint32 type
, BUFFER3
*data
);
2332 BOOL
reg_enum_val( POLICY_HND
*hnd
,
2333 int val_index
, int max_valnamelen
, int max_valbufsize
,
2335 uint32
*val_type
, BUFFER2
*value
);
2336 BOOL
reg_open_entry( POLICY_HND
*hnd
,
2337 char *key_name
, uint32 unk_0
,
2338 POLICY_HND
*key_hnd
);
2339 BOOL
reg_close( POLICY_HND
*hnd
);
2340 BOOL
reg_shutdown(const char *srv_name
,
2341 const char *msg
, uint32 timeout
, uint16 flags
);
2343 /*The following definitions come from rpc_client/cli_samr.c */
2345 BOOL
samr_chgpasswd_user( struct cli_connection
*con
,
2346 const char *srv_name
, const char *user_name
,
2347 const char nt_newpass
[516], const uchar nt_oldhash
[16],
2348 const char lm_newpass
[516], const uchar lm_oldhash
[16]);
2349 BOOL
samr_get_dom_pwinfo(struct cli_connection
*con
, const char *srv_name
);
2350 BOOL
samr_query_dom_info( POLICY_HND
*domain_pol
, uint16 switch_value
,
2352 uint32
samr_enum_domains( POLICY_HND
*pol
,
2353 uint32
*start_idx
, uint32 size
,
2354 struct acct_info
**sam
,
2355 uint32
*num_sam_domains
);
2356 uint32
samr_enum_dom_groups( POLICY_HND
*pol
,
2357 uint32
*start_idx
, uint32 size
,
2358 struct acct_info
**sam
,
2359 uint32
*num_sam_groups
);
2360 uint32
samr_enum_dom_aliases( POLICY_HND
*pol
,
2361 uint32
*start_idx
, uint32 size
,
2362 struct acct_info
**sam
,
2363 uint32
*num_sam_aliases
);
2364 uint32
samr_enum_dom_users( POLICY_HND
*pol
, uint32
*start_idx
,
2365 uint16 acb_mask
, uint16 unk_1
, uint32 size
,
2366 struct acct_info
**sam
,
2367 uint32
*num_sam_users
);
2368 BOOL
samr_connect( const char *srv_name
, uint32 access_mask
,
2369 POLICY_HND
*connect_pol
);
2370 BOOL
samr_query_sec_obj( const POLICY_HND
*pol
,
2373 BOOL
samr_open_user( const POLICY_HND
*pol
,
2374 uint32 unk_0
, uint32 rid
,
2375 POLICY_HND
*user_pol
);
2376 BOOL
samr_open_alias( const POLICY_HND
*domain_pol
,
2377 uint32 flags
, uint32 rid
,
2378 POLICY_HND
*alias_pol
);
2379 BOOL
samr_del_aliasmem( POLICY_HND
*alias_pol
, DOM_SID
*sid
);
2380 BOOL
samr_add_aliasmem( POLICY_HND
*alias_pol
, DOM_SID
*sid
);
2381 BOOL
samr_delete_dom_alias( POLICY_HND
*alias_pol
);
2382 uint32
samr_create_dom_user( POLICY_HND
*domain_pol
, const char *acct_name
,
2383 uint32 unk_0
, uint32 unk_1
,
2384 POLICY_HND
*user_pol
, uint32
*rid
);
2385 BOOL
samr_create_dom_alias( POLICY_HND
*domain_pol
, const char *acct_name
,
2386 POLICY_HND
*alias_pol
, uint32
*rid
);
2387 BOOL
samr_query_aliasinfo( POLICY_HND
*alias_pol
, uint16 switch_value
,
2388 ALIAS_INFO_CTR
*ctr
);
2389 BOOL
samr_set_aliasinfo( POLICY_HND
*alias_pol
, ALIAS_INFO_CTR
*ctr
);
2390 BOOL
samr_open_group( const POLICY_HND
*domain_pol
,
2391 uint32 flags
, uint32 rid
,
2392 POLICY_HND
*group_pol
);
2393 BOOL
samr_del_groupmem( POLICY_HND
*group_pol
, uint32 rid
);
2394 BOOL
samr_add_groupmem( POLICY_HND
*group_pol
, uint32 rid
);
2395 BOOL
samr_delete_dom_group( POLICY_HND
*group_pol
);
2396 BOOL
samr_create_dom_group( POLICY_HND
*domain_pol
, const char *acct_name
,
2397 POLICY_HND
*group_pol
, uint32
*rid
);
2398 BOOL
samr_set_groupinfo( POLICY_HND
*group_pol
, GROUP_INFO_CTR
*ctr
);
2399 BOOL
samr_open_domain( const POLICY_HND
*connect_pol
,
2402 POLICY_HND
*domain_pol
);
2403 BOOL
samr_query_lookup_domain( POLICY_HND
*pol
, const char *dom_name
,
2405 BOOL
samr_query_lookup_names(const POLICY_HND
*pol
, uint32 flags
,
2406 uint32 num_names
, const char **names
,
2407 uint32
*num_rids
, uint32
**rids
, uint32
**types
);
2408 BOOL
samr_query_lookup_rids( const POLICY_HND
*pol
, uint32 flags
,
2409 uint32 num_rids
, const uint32
*rids
,
2413 BOOL
samr_query_aliasmem( const POLICY_HND
*alias_pol
,
2414 uint32
*num_mem
, DOM_SID2
*sid
);
2415 BOOL
samr_query_useraliases( const POLICY_HND
*pol
,
2416 uint32
*ptr_sid
, DOM_SID2
*sid
,
2417 uint32
*num_aliases
, uint32
**rid
);
2418 BOOL
samr_query_groupmem( POLICY_HND
*group_pol
,
2419 uint32
*num_mem
, uint32
**rid
, uint32
**attr
);
2420 BOOL
samr_query_usergroups( POLICY_HND
*pol
, uint32
*num_groups
,
2422 BOOL
samr_query_groupinfo( POLICY_HND
*pol
,
2423 uint16 switch_value
, GROUP_INFO_CTR
* ctr
);
2424 BOOL
samr_set_userinfo2( POLICY_HND
*pol
, uint16 switch_value
,
2426 BOOL
samr_set_userinfo( POLICY_HND
*pol
, uint16 switch_value
, void* usr
);
2427 BOOL
samr_query_userinfo( POLICY_HND
*pol
, uint16 switch_value
,
2428 SAM_USERINFO_CTR
*ctr
);
2429 BOOL
samr_close( POLICY_HND
*hnd
);
2430 BOOL
samr_query_dispinfo( POLICY_HND
*pol_domain
, uint16 level
,
2431 uint32
*num_entries
,
2432 SAM_DISPINFO_CTR
*ctr
);
2434 /*The following definitions come from rpc_client/cli_spoolss.c */
2436 BOOL
spoolss_enum_printers(uint32 flags
, const char *srv_name
,
2440 uint32
spoolss_enum_jobs( const POLICY_HND
*hnd
,
2447 BOOL
spoolss_open_printer_ex( const char *printername
,
2448 uint32 cbbuf
, uint32 devmod
, uint32 des_access
,
2449 const char *station
, const char *username
,
2451 BOOL
spoolss_closeprinter(POLICY_HND
*hnd
);
2453 /*The following definitions come from rpc_client/cli_srvsvc.c */
2455 BOOL
srv_net_srv_tprt_enum(
2456 const char *srv_name
,
2457 uint32 switch_value
, SRV_TPRT_INFO_CTR
*ctr
,
2458 uint32 preferred_len
,
2460 BOOL
srv_net_srv_conn_enum( char *srv_name
, char *qual_name
,
2461 uint32 switch_value
, SRV_CONN_INFO_CTR
*ctr
,
2462 uint32 preferred_len
,
2464 BOOL
srv_net_srv_sess_enum( char *srv_name
, char *qual_name
, char *user_name
,
2465 uint32 switch_value
, SRV_SESS_INFO_CTR
*ctr
,
2466 uint32 preferred_len
,
2468 BOOL
srv_net_srv_share_enum( char *srv_name
,
2469 uint32 switch_value
, SRV_SHARE_INFO_CTR
*ctr
,
2470 uint32 preferred_len
,
2472 BOOL
srv_net_srv_file_enum( char *srv_name
, char *qual_name
, uint32 file_id
,
2473 uint32 switch_value
, SRV_FILE_INFO_CTR
*ctr
,
2474 uint32 preferred_len
,
2476 BOOL
srv_net_srv_get_info( char *srv_name
, uint32 switch_value
,
2478 BOOL
srv_net_remote_tod( char *srv_name
, TIME_OF_DAY_INFO
*tod
);
2480 /*The following definitions come from rpc_client/cli_svcctl.c */
2482 BOOL
svc_open_sc_man( const char *srv_name
, char *db_name
,
2485 BOOL
svc_open_service( POLICY_HND
*scm_hnd
,
2486 const char *srv_name
,
2489 BOOL
svc_enum_svcs( POLICY_HND
*hnd
,
2490 uint32 services_type
, uint32 services_state
,
2491 uint32
*buf_size
, uint32
*resume_hnd
,
2493 ENUM_SRVC_STATUS
**svcs
, uint32
*num_svcs
);
2494 BOOL
svc_stop_service( POLICY_HND
*hnd
,
2496 BOOL
svc_start_service( POLICY_HND
*hnd
,
2499 BOOL
svc_query_svc_cfg( POLICY_HND
*hnd
,
2500 QUERY_SERVICE_CONFIG
*cfg
,
2502 BOOL
svc_close(POLICY_HND
*hnd
);
2503 BOOL
svc_change_svc_cfg( POLICY_HND
*hnd
,
2504 uint32 service_type
, uint32 start_type
,
2506 uint32 error_control
,
2507 char* bin_path_name
, char* load_order_grp
,
2509 char* dependencies
, char* service_start_name
,
2513 /*The following definitions come from rpc_client/cli_use.c */
2515 void init_cli_use(void);
2516 void free_cli_use(void);
2517 struct cli_state
*cli_net_use_add(const char* srv_name
,
2518 const struct ntuser_creds
*usr_creds
,
2521 BOOL
cli_net_use_del(const char* srv_name
,
2522 const struct ntuser_creds
*usr_creds
,
2524 BOOL
*connection_closed
);
2525 void cli_net_use_enum(uint32
*num_cons
, struct use_info
***use
);
2526 void cli_use_wait_keyboard(void);
2528 /*The following definitions come from rpc_client/cli_wkssvc.c */
2530 BOOL
wks_query_info( char *srv_name
, uint32 switch_value
,
2531 WKS_INFO_100
*wks100
);
2533 /*The following definitions come from rpc_client/msrpc_lsarpc.c */
2535 uint32
lookup_lsa_names(const char *srv_name
,
2536 uint32 num_names
, char **names
,
2537 uint32
*num_sids
, DOM_SID
**sids
, uint32
**types
);
2538 uint32
lookup_lsa_name(const char *domain
,
2539 char *name
, DOM_SID
*sid
, uint32
*type
);
2540 uint32
lookup_lsa_sid(const char *domain
,
2541 DOM_SID
*sid
, char *name
, uint32
*type
);
2542 BOOL
msrpc_lsa_query_secret(const char* srv_name
,
2543 const char* secret_name
,
2545 NTTIME
*last_update
);
2547 /*The following definitions come from rpc_client/msrpc_netlogon.c */
2549 uint32
check_domain_security(const char *orig_user
, const char *domain
,
2550 const uchar
*challenge
,
2551 const char *smb_apasswd
, int smb_apasslen
,
2552 const char *smb_ntpasswd
, int smb_ntpasslen
,
2553 NET_USER_INFO_3
*info3
);
2555 /*The following definitions come from rpc_client/msrpc_samr.c */
2557 uint32
lookup_sam_domainname(const char *srv_name
,
2558 const char *domain
, DOM_SID
*sid
);
2559 uint32
lookup_sam_names(const char *domain
, const DOM_SID
*sid
,
2560 uint32 num_names
, char **names
,
2561 uint32
*num_rids
, uint32
**rids
, uint32
**types
);
2562 uint32
lookup_sam_name(const char *domain
, DOM_SID
*sid
,
2563 char *name
, uint32
*rid
, uint32
*type
);
2564 uint32
lookup_sam_rid(const char *domain
, DOM_SID
*sid
,
2565 uint32 rid
, char *name
, uint32
*type
);
2566 BOOL
req_user_info( const POLICY_HND
*pol_dom
,
2569 uint32 user_rid
, uint16 info_level
,
2570 USER_INFO_FN(usr_inf
));
2571 uint32
sam_query_usergroups( const POLICY_HND
*pol_dom
,
2575 const char *user_name
,
2580 USER_MEM_FN(usr_mem
));
2581 void msrpc_sam_user( const POLICY_HND
*pol_dom
, const POLICY_HND
*pol_blt
,
2583 const DOM_SID
*sid1
,
2584 const DOM_SID
*blt_sid1
,
2585 uint32 user_rid
, uint16 info_level
,
2588 USER_INFO_FN(usr_inf_fn
),
2589 USER_MEM_FN(usr_grp_fn
),
2590 USER_MEM_FN(usr_als_fn
));
2591 BOOL
msrpc_sam_query_user( const char* srv_name
,
2596 USER_INFO_FN(usr_inf_fn
),
2597 USER_MEM_FN(usr_grp_fn
),
2598 USER_MEM_FN(usr_als_fn
));
2599 int msrpc_sam_enum_users( const char* srv_name
,
2601 const DOM_SID
*sid1
,
2602 struct acct_info
**sam
,
2603 uint32
*num_sam_entries
,
2605 USER_INFO_FN(usr_inf_fn
),
2606 USER_MEM_FN(usr_grp_fn
),
2607 USER_MEM_FN(usr_als_fn
));
2608 BOOL
sam_query_dominfo(const char* srv_name
,
2609 const DOM_SID
*sid1
,
2610 uint32 switch_value
, SAM_UNK_CTR
*ctr
);
2611 BOOL
query_aliasinfo( const POLICY_HND
*pol_dom
,
2615 ALIAS_INFO_FN(grp_inf
));
2616 BOOL
sam_query_aliasmem(const char *srv_name
,
2617 const POLICY_HND
*pol_dom
,
2623 BOOL
req_aliasmem_info(const char* srv_name
,
2624 const POLICY_HND
*pol_dom
,
2628 const char *alias_name
,
2629 ALIAS_MEM_FN(als_mem
));
2630 BOOL
sam_query_groupmem( const POLICY_HND
*pol_dom
,
2636 BOOL
query_groupinfo( const POLICY_HND
*pol_dom
,
2640 GROUP_INFO_FN(grp_inf
));
2641 BOOL
req_groupmem_info( const POLICY_HND
*pol_dom
,
2645 const char *group_name
,
2646 GROUP_MEM_FN(grp_mem
));
2647 uint32
msrpc_sam_enum_domains( const char* srv_name
,
2648 struct acct_info
**sam
,
2649 uint32
*num_sam_entries
,
2651 DOMAIN_INFO_FN(dom_inf_fn
));
2652 uint32
msrpc_sam_enum_groups( const char* srv_name
,
2654 const DOM_SID
*sid1
,
2655 struct acct_info
**sam
,
2656 uint32
*num_sam_entries
,
2658 GROUP_INFO_FN(grp_inf_fn
),
2659 GROUP_MEM_FN(grp_mem_fn
));
2660 uint32
msrpc_sam_enum_aliases( const char* srv_name
,
2662 const DOM_SID
*sid1
,
2663 struct acct_info
**sam
,
2664 uint32
*num_sam_entries
,
2666 ALIAS_INFO_FN(als_inf_fn
),
2667 ALIAS_MEM_FN(als_mem_fn
));
2668 BOOL
create_samr_domain_user( POLICY_HND
*pol_dom
,
2669 char *acct_name
, uint16 acb_info
,
2670 const char* password
, int plen
,
2672 BOOL
create_samr_domain_alias( POLICY_HND
*pol_open_domain
,
2673 const char *acct_name
, const char *acct_desc
,
2675 BOOL
create_samr_domain_group( POLICY_HND
*pol_open_domain
,
2676 const char *acct_name
, const char *acct_desc
,
2678 BOOL
get_samr_query_usergroups( const POLICY_HND
*pol_open_domain
,
2680 uint32
*num_groups
, DOM_GID
**gid
);
2681 BOOL
delete_samr_dom_group( POLICY_HND
*pol_open_domain
,
2683 BOOL
get_samr_query_groupmem(
2684 const POLICY_HND
*pol_open_domain
,
2685 uint32 group_rid
, uint32
*num_mem
,
2686 uint32
**rid
, uint32
**attr
);
2687 BOOL
delete_samr_dom_alias(
2688 POLICY_HND
*pol_open_domain
,
2690 BOOL
get_samr_query_aliasmem(
2691 const POLICY_HND
*pol_open_domain
,
2692 uint32 alias_rid
, uint32
*num_mem
, DOM_SID2
*sid
);
2693 BOOL
set_samr_set_userinfo2(
2694 POLICY_HND
*pol_open_domain
,
2696 uint32 user_rid
, void *usr
);
2697 BOOL
set_samr_set_userinfo( const POLICY_HND
*pol_open_domain
,
2699 uint32 user_rid
, void *usr
);
2700 BOOL
get_samr_query_userinfo( const POLICY_HND
*pol_open_domain
,
2702 uint32 user_rid
, SAM_USERINFO_CTR
*ctr
);
2703 BOOL
get_samr_query_groupinfo(
2704 const POLICY_HND
*pol_open_domain
,
2706 uint32 group_rid
, GROUP_INFO_CTR
*ctr
);
2707 BOOL
get_samr_query_aliasinfo(
2708 const POLICY_HND
*pol_open_domain
,
2710 uint32 alias_rid
, ALIAS_INFO_CTR
*ctr
);
2711 BOOL
msrpc_sam_create_dom_user(const char* srv_name
, DOM_SID
*sid1
,
2712 char *acct_name
, uint16 acb_info
,
2713 const char *password
, int plen
,
2715 BOOL
msrpc_sam_query_dispinfo(const char* srv_name
, const char* domain
,
2717 uint16 switch_value
,
2718 uint32
*num_entries
, SAM_DISPINFO_CTR
*ctr
,
2720 BOOL
msrpc_sam_ntchange_pwd(const char* srv_name
,
2723 const uchar lm_oldhash
[16],
2724 const uchar nt_oldhash
[16],
2725 const char* new_passwd
);
2726 BOOL
msrpc_sam_ntpasswd_set(const char* srv_name
, const char *user
,
2727 struct ntuser_creds
*samr_creds
,
2728 const uchar lm_newpass
[516],
2729 const uchar lm_hshhash
[16],
2730 const uchar nt_newpass
[516],
2731 const uchar nt_hshhash
[16]);
2732 BOOL
msrpc_sam_query_userinfo(const char* srv_name
, const DOM_SID
*sid
,
2733 const char *user_name
, uint16 info_level
,
2734 SAM_USERINFO_CTR
*ctr
);
2736 /*The following definitions come from rpc_parse/parse_creds.c */
2738 BOOL
make_creds_unix(CREDS_UNIX
*r_u
, const char* user_name
,
2739 const char* requested_name
,
2740 const char* real_name
,
2742 BOOL
creds_io_unix(char *desc
, CREDS_UNIX
*r_u
, prs_struct
*ps
, int depth
);
2743 void creds_free_unix(CREDS_UNIX
*r_u
);
2744 BOOL
make_creds_unix_sec(CREDS_UNIX_SEC
*r_u
,
2745 uint32 uid
, uint32 gid
, uint32 num_grps
, gid_t
*grps
);
2746 BOOL
creds_io_unix_sec(char *desc
, CREDS_UNIX_SEC
*r_u
, prs_struct
*ps
, int depth
);
2747 void creds_free_unix_sec(CREDS_UNIX_SEC
*r_u
);
2748 BOOL
creds_io_pwd_info(char *desc
, struct pwd_info
*pwd
, prs_struct
*ps
, int depth
);
2749 BOOL
creds_io_nt(char *desc
, CREDS_NT
*r_u
, prs_struct
*ps
, int depth
);
2750 void creds_free_nt(CREDS_NT
*r_u
);
2751 BOOL
creds_io_hybrid(char *desc
, CREDS_HYBRID
*r_u
, prs_struct
*ps
, int depth
);
2752 void copy_unix_creds(CREDS_UNIX
*to
, const CREDS_UNIX
*from
);
2753 void copy_unix_sec_creds(CREDS_UNIX_SEC
*to
, const CREDS_UNIX_SEC
*from
);
2754 void copy_nt_creds(struct ntuser_creds
*to
,
2755 const struct ntuser_creds
*from
);
2756 void copy_user_creds(struct user_creds
*to
,
2757 const struct user_creds
*from
);
2758 void free_user_creds(struct user_creds
*creds
);
2759 BOOL
creds_io_cmd(char *desc
, CREDS_CMD
*r_u
, prs_struct
*ps
, int depth
);
2760 BOOL
create_ntuser_creds( prs_struct
*ps
,
2762 uint16 version
, uint16 command
,
2763 const vuser_key
*key
,
2764 const struct ntuser_creds
*ntu
,
2766 BOOL
create_user_creds( prs_struct
*ps
,
2768 uint16 version
, uint16 command
,
2769 const vuser_key
*key
,
2770 const struct user_creds
*usr
);
2772 /*The following definitions come from rpc_parse/parse_misc.c */
2774 BOOL
smb_io_bigint(char *desc
, BIGINT
*bigint
, prs_struct
*ps
, int depth
);
2775 BOOL
smb_io_time(char *desc
, NTTIME
*nttime
, prs_struct
*ps
, int depth
);
2776 BOOL
smb_io_lookup_level(char *desc
, LOOKUP_LEVEL
*level
, prs_struct
*ps
, int depth
);
2777 uint32
get_enum_hnd(ENUM_HND
*enh
);
2778 BOOL
make_enum_hnd(ENUM_HND
*enh
, uint32 hnd
);
2779 BOOL
smb_io_enum_hnd(char *desc
, ENUM_HND
*hnd
, prs_struct
*ps
, int depth
);
2780 BOOL
smb_io_dom_sid(char *desc
, DOM_SID
*sid
, prs_struct
*ps
, int depth
);
2781 BOOL
make_dom_sid2(DOM_SID2
*sid2
, const DOM_SID
*sid
);
2782 BOOL
smb_io_dom_sid2(char *desc
, DOM_SID2
*sid
, prs_struct
*ps
, int depth
);
2783 BOOL
make_str_hdr(STRHDR
*hdr
, int max_len
, int len
, uint32 buffer
);
2784 BOOL
smb_io_strhdr(char *desc
, STRHDR
*hdr
, prs_struct
*ps
, int depth
);
2785 BOOL
make_strhdr2(STRHDR2
*hdr
, uint32 max_len
, uint32 len
, uint32 buffer
);
2786 BOOL
smb_io_strhdr2(char *desc
, STRHDR2
*hdr
, prs_struct
*ps
, int depth
);
2787 BOOL
make_uni_hdr(UNIHDR
*hdr
, int len
);
2788 BOOL
make_unihdr_from_unistr2(UNIHDR
*hdr
, const UNISTR2
*str
);
2789 BOOL
smb_io_unihdr(char *desc
, UNIHDR
*hdr
, prs_struct
*ps
, int depth
);
2790 BOOL
make_buf_hdr(BUFHDR
*hdr
, int max_len
, int len
);
2791 BOOL
smb_io_hdrbuf_pre(char *desc
, BUFHDR
*hdr
, prs_struct
*ps
, int depth
, uint32
*offset
);
2792 BOOL
smb_io_hdrbuf_post(char *desc
, BUFHDR
*hdr
, prs_struct
*ps
, int depth
,
2793 uint32 ptr_hdrbuf
, uint32 max_len
, uint32 len
);
2794 BOOL
smb_io_hdrbuf(char *desc
, BUFHDR
*hdr
, prs_struct
*ps
, int depth
);
2795 BOOL
make_bufhdr2(BUFHDR2
*hdr
, uint32 info_level
, uint32 length
, uint32 buffer
);
2796 BOOL
smb_io_bufhdr2(char *desc
, BUFHDR2
*hdr
, prs_struct
*ps
, int depth
);
2797 BOOL
make_uni_hdr2(UNIHDR2
*hdr
, int len
);
2798 BOOL
make_unihdr2_from_unistr2(UNIHDR2
*hdr
, const UNISTR2
*str
);
2799 BOOL
smb_io_unihdr2(char *desc
, UNIHDR2
*hdr2
, prs_struct
*ps
, int depth
);
2800 BOOL
make_unistr(UNISTR
*str
, char *buf
);
2801 BOOL
smb_io_unistr(char *desc
, UNISTR
*uni
, prs_struct
*ps
, int depth
);
2802 BOOL
make_buffer3_uint32(BUFFER3
*str
, uint32 val
);
2803 BOOL
make_buffer3_str(BUFFER3
*str
, const char *buf
, int len
);
2804 BOOL
make_buffer3_hex(BUFFER3
*str
, char *buf
);
2805 BOOL
make_buffer3_bytes(BUFFER3
*str
, uint8
*buf
, int len
);
2806 BOOL
smb_io_buffer3(char *desc
, BUFFER3
*buf3
, prs_struct
*ps
, int depth
);
2807 BOOL
make_buffer4_str(BUFFER4
*str
, const char *buf
, int len
);
2808 BOOL
smb_io_buffer4(char *desc
, BUFFER4
*buf4
, uint32 buffer
, prs_struct
*ps
, int depth
);
2809 BOOL
init_buffer5(BUFFER5
**str
);
2810 BOOL
clear_buffer5(BUFFER5
**str
);
2811 BOOL
make_buffer5(BUFFER5
*str
, char *buf
, int len
);
2812 BOOL
smb_io_buffer5(char *desc
, BUFFER5
*buf5
, prs_struct
*ps
, int depth
);
2813 BOOL
make_buffer2_multi(BUFFER2
*str
, char *const* const buf
, uint32 num
);
2814 BOOL
make_buffer2(BUFFER2
*str
, const char *buf
, int len
);
2815 BOOL
smb_io_buffer2(char *desc
, BUFFER2
*buf2
, uint32 buffer
, prs_struct
*ps
, int depth
);
2816 BOOL
make_buf_unistr2(UNISTR2
*str
, uint32
*ptr
, const char *buf
);
2817 BOOL
make_string2(STRING2
*str
, const char *buf
, int len
);
2818 BOOL
make_buf_string2(STRING2
*str
, uint32
*ptr
, const char *buf
);
2819 BOOL
smb_io_string2(char *desc
, STRING2
*str2
, uint32 buffer
, prs_struct
*ps
, int depth
);
2820 BOOL
make_unistr2(UNISTR2
*str
, const char *buf
, int len
);
2821 BOOL
smb_io_unistr2(char *desc
, UNISTR2
*uni2
, uint32 buffer
, prs_struct
*ps
, int depth
);
2822 BOOL
make_dom_rid2(DOM_RID2
*rid2
, uint32 rid
, uint8 type
, uint32 idx
);
2823 BOOL
smb_io_dom_rid2(char *desc
, DOM_RID2
*rid2
, prs_struct
*ps
, int depth
);
2824 BOOL
make_dom_rid3(DOM_RID3
*rid3
, uint32 rid
, uint8 type
);
2825 BOOL
smb_io_dom_rid3(char *desc
, DOM_RID3
*rid3
, prs_struct
*ps
, int depth
);
2826 BOOL
make_log_info(DOM_LOG_INFO
*log
,
2827 const char *logon_srv
, const char *acct_name
,
2828 uint16 sec_chan
, const char *comp_name
);
2829 BOOL
smb_io_log_info(char *desc
, DOM_LOG_INFO
*log
, prs_struct
*ps
, int depth
);
2830 BOOL
smb_io_chal(char *desc
, DOM_CHAL
*chal
, prs_struct
*ps
, int depth
);
2831 BOOL
smb_io_cred(char *desc
, DOM_CRED
*cred
, prs_struct
*ps
, int depth
);
2832 BOOL
make_clnt_info2(DOM_CLNT_INFO2
*clnt
,
2833 const char *logon_srv
, const char *comp_name
,
2834 DOM_CRED
*clnt_cred
);
2835 BOOL
smb_io_clnt_info2(char *desc
, DOM_CLNT_INFO2
*clnt
, prs_struct
*ps
, int depth
);
2836 BOOL
make_clnt_info(DOM_CLNT_INFO
*clnt
,
2837 const char *logon_srv
, const char *acct_name
,
2838 uint16 sec_chan
, const char *comp_name
,
2840 BOOL
smb_io_clnt_info(char *desc
, DOM_CLNT_INFO
*clnt
, prs_struct
*ps
, int depth
);
2841 BOOL
make_owf_info(OWF_INFO
*hash
, const uint8 data
[16]);
2842 BOOL
smb_io_owf_info(char *desc
, OWF_INFO
*hash
, prs_struct
*ps
, int depth
);
2843 BOOL
smb_io_gid(char *desc
, DOM_GID
*gid
, prs_struct
*ps
, int depth
);
2844 BOOL
smb_io_pol_hnd(char *desc
, POLICY_HND
*pol
, prs_struct
*ps
, int depth
);
2845 BOOL
smb_io_dom_query_3(char *desc
, DOM_QUERY_3
*d_q
, prs_struct
*ps
, int depth
);
2846 BOOL
smb_io_dom_query_5(char *desc
, DOM_QUERY_3
*d_q
, prs_struct
*ps
, int depth
);
2847 BOOL
smb_io_unistr3(char *desc
, UNISTR3
*name
, prs_struct
*ps
, int depth
);
2849 /*The following definitions come from rpc_parse/parse_net.c */
2851 BOOL
make_q_logon_ctrl2(NET_Q_LOGON_CTRL2
*q_l
,
2852 const char* srv_name
,
2853 uint32 function_code
,
2855 uint32 switch_value
);
2856 BOOL
net_io_q_logon_ctrl2(char *desc
, NET_Q_LOGON_CTRL2
*q_l
, prs_struct
*ps
, int depth
);
2857 BOOL
make_r_logon_ctrl2(NET_R_LOGON_CTRL2
*r_l
,
2858 uint32 switch_value
,
2859 NETLOGON_INFO
*logon_info
,
2861 BOOL
net_io_r_logon_ctrl2(char *desc
, NET_R_LOGON_CTRL2
*r_l
, prs_struct
*ps
, int depth
);
2862 BOOL
net_io_r_trust_dom(char *desc
, NET_R_TRUST_DOM_LIST
*r_t
, prs_struct
*ps
, int depth
);
2863 BOOL
net_io_q_trust_dom(char *desc
, NET_Q_TRUST_DOM_LIST
*q_l
, prs_struct
*ps
, int depth
);
2864 BOOL
make_q_req_chal(NET_Q_REQ_CHAL
*q_c
,
2865 const char *logon_srv
, const char *logon_clnt
,
2866 DOM_CHAL
*clnt_chal
);
2867 BOOL
net_io_q_req_chal(char *desc
, NET_Q_REQ_CHAL
*q_c
, prs_struct
*ps
, int depth
);
2868 BOOL
net_io_r_req_chal(char *desc
, NET_R_REQ_CHAL
*r_c
, prs_struct
*ps
, int depth
);
2869 BOOL
make_q_auth(NET_Q_AUTH
*q_a
,
2870 const char *logon_srv
, const char *acct_name
,
2871 uint16 sec_chan
, const char *comp_name
,
2872 DOM_CHAL
*clnt_chal
);
2873 BOOL
net_io_q_auth(char *desc
, NET_Q_AUTH
*q_a
, prs_struct
*ps
, int depth
);
2874 BOOL
net_io_r_auth(char *desc
, NET_R_AUTH
*r_a
, prs_struct
*ps
, int depth
);
2875 BOOL
make_q_auth_2(NET_Q_AUTH_2
*q_a
,
2876 const char *logon_srv
, const char *acct_name
,
2877 uint16 sec_chan
, const char *comp_name
,
2878 DOM_CHAL
*clnt_chal
, uint32 clnt_flgs
);
2879 BOOL
net_io_q_auth_2(char *desc
, NET_Q_AUTH_2
*q_a
, prs_struct
*ps
, int depth
);
2880 BOOL
net_io_r_auth_2(char *desc
, NET_R_AUTH_2
*r_a
, prs_struct
*ps
, int depth
);
2881 BOOL
make_q_srv_pwset(NET_Q_SRV_PWSET
*q_s
,
2882 const char *logon_srv
, const char *acct_name
,
2883 uint16 sec_chan
, const char *comp_name
,
2884 DOM_CRED
*cred
, char nt_cypher
[16]);
2885 BOOL
net_io_q_srv_pwset(char *desc
, NET_Q_SRV_PWSET
*q_s
, prs_struct
*ps
, int depth
);
2886 BOOL
net_io_r_srv_pwset(char *desc
, NET_R_SRV_PWSET
*r_s
, prs_struct
*ps
, int depth
);
2887 BOOL
make_id_info1(NET_ID_INFO_1
*id
, const char *domain_name
,
2891 const char *user_name
,
2892 const char *wksta_name
,
2893 const char sess_key
[16],
2894 const uchar lm_cypher
[16],
2895 const uchar nt_cypher
[16]);
2896 BOOL
make_id_info4(NET_ID_INFO_4
*id
, const char *domain_name
,
2898 uint32 log_id_low
, uint32 log_id_high
,
2899 const char *user_name
, const char *wksta_name
,
2900 const char *general
);
2901 BOOL
make_id_info2(NET_ID_INFO_2
*id
, const char *domain_name
,
2903 uint32 log_id_low
, uint32 log_id_high
,
2904 const char *user_name
, const char *wksta_name
,
2905 const uchar lm_challenge
[8],
2906 const uchar
*lm_chal_resp
,
2908 const uchar
*nt_chal_resp
,
2910 BOOL
make_sam_info(DOM_SAM_INFO
*sam
,
2911 const char *logon_srv
, const char *comp_name
,
2912 DOM_CRED
*clnt_cred
,
2913 DOM_CRED
*rtn_cred
, uint16 logon_level
,
2914 NET_ID_INFO_CTR
*ctr
);
2915 BOOL
make_net_user_info3W(NET_USER_INFO_3
*usr
,
2917 const NTTIME
*logon_time
,
2918 const NTTIME
*logoff_time
,
2919 const NTTIME
*kickoff_time
,
2920 const NTTIME
*pass_last_set_time
,
2921 const NTTIME
*pass_can_change_time
,
2922 const NTTIME
*pass_must_change_time
,
2924 const UNISTR2
*user_name
,
2925 const UNISTR2
*full_name
,
2926 const UNISTR2
*log_scr
,
2927 const UNISTR2
*prof_path
,
2928 const UNISTR2
*home_dir
,
2929 const UNISTR2
*dir_drive
,
2932 uint16 bad_pw_count
,
2937 const DOM_GID
*gids
,
2940 const char sess_key
[16],
2942 const UNISTR2
*logon_srv
,
2943 const UNISTR2
*logon_dom
,
2945 const char *padding
,
2947 const DOM_SID
*dom_sid
,
2948 const char *other_sids
);
2949 BOOL
make_net_user_info3(NET_USER_INFO_3
*usr
,
2952 NTTIME
*logoff_time
,
2953 NTTIME
*kickoff_time
,
2954 NTTIME
*pass_last_set_time
,
2955 NTTIME
*pass_can_change_time
,
2956 NTTIME
*pass_must_change_time
,
2966 uint16 bad_pw_count
,
2983 BOOL
net_io_user_info3(char *desc
, NET_USER_INFO_3
*usr
, prs_struct
*ps
, int depth
);
2984 BOOL
net_io_q_sam_logon(char *desc
, NET_Q_SAM_LOGON
*q_l
, prs_struct
*ps
, int depth
);
2985 BOOL
make_r_sam_logon(NET_R_SAM_LOGON
*r_s
,
2986 const DOM_CRED
*srv_creds
,
2987 uint16 switch_value
,
2988 NET_USER_INFO_3
*user_info
,
2990 BOOL
net_io_r_sam_logon(char *desc
, NET_R_SAM_LOGON
*r_l
, prs_struct
*ps
, int depth
);
2991 BOOL
net_io_q_sam_logoff(char *desc
, NET_Q_SAM_LOGOFF
*q_l
, prs_struct
*ps
, int depth
);
2992 BOOL
make_r_sam_logoff(NET_R_SAM_LOGOFF
*r_s
,
2993 const DOM_CRED
*srv_cred
,
2995 BOOL
net_io_r_sam_logoff(char *desc
, NET_R_SAM_LOGOFF
*r_l
, prs_struct
*ps
, int depth
);
2996 BOOL
make_q_sam_sync(NET_Q_SAM_SYNC
*q_s
,
2997 const char *srv_name
,
2998 const char *cli_name
,
2999 DOM_CRED
*cli_creds
, uint32 database_id
);
3000 BOOL
net_io_q_sam_sync(char *desc
, NET_Q_SAM_SYNC
*q_s
, prs_struct
*ps
, int depth
);
3001 BOOL
make_sam_delta_hdr(SAM_DELTA_HDR
*delta
, uint16 type
, uint32 rid
);
3002 BOOL
make_sam_account_info(SAM_ACCOUNT_INFO
*info
,
3003 const UNISTR2
*user_name
,
3004 const UNISTR2
*full_name
,
3005 uint32 user_rid
, uint32 group_rid
,
3006 const UNISTR2
*home_dir
,
3007 const UNISTR2
*dir_drive
,
3008 const UNISTR2
*log_scr
,
3009 const UNISTR2
*desc
,
3011 const UNISTR2
*prof_path
,
3012 const UNISTR2
*wkstas
,
3013 const UNISTR2
*unk_str
,
3014 const UNISTR2
*mung_dial
);
3015 BOOL
make_r_sam_sync(NET_R_SAM_SYNC
*r_s
,
3016 const DOM_CRED
*srv_cred
,
3017 uint32 sync_context
,
3020 SAM_DELTA_HDR
*hdr_deltas
,
3021 SAM_DELTA_CTR
*deltas
,
3023 BOOL
net_io_r_sam_sync(char *desc
, uint8 sess_key
[16],
3024 NET_R_SAM_SYNC
*r_s
, prs_struct
*ps
, int depth
);
3026 /*The following definitions come from rpc_parse/parse_netsec.c */
3028 BOOL
rpc_hdr_netsec_auth_chk(RPC_HDR_AUTH
*rai
);
3029 BOOL
make_rpc_auth_netsec_neg(RPC_AUTH_NETSEC_NEG
*neg
,
3032 BOOL
smb_io_rpc_auth_netsec_neg(char *desc
, RPC_AUTH_NETSEC_NEG
*neg
, prs_struct
*ps
, int depth
);
3033 BOOL
make_rpc_auth_netsec_resp(RPC_AUTH_NETSEC_RESP
*rsp
, uint32 flags
);
3034 BOOL
smb_io_rpc_auth_netsec_resp(char *desc
, RPC_AUTH_NETSEC_RESP
*rsp
, prs_struct
*ps
, int depth
);
3035 BOOL
rpc_auth_netsec_chk(RPC_AUTH_NETSEC_CHK
*chk
);
3036 BOOL
make_rpc_auth_netsec_chk(RPC_AUTH_NETSEC_CHK
*chk
,
3038 const uchar data1
[8],
3039 const uchar data3
[8],
3040 const uchar data8
[8]);
3041 BOOL
smb_io_rpc_auth_netsec_chk(char *desc
, RPC_AUTH_NETSEC_CHK
*chk
, prs_struct
*ps
, int depth
);
3042 BOOL
netsec_encode(struct netsec_auth_struct
*a
,
3043 RPC_AUTH_NETSEC_CHK
*verf
,
3044 char *data
, size_t data_len
);
3045 BOOL
netsec_decode(struct netsec_auth_struct
*a
,
3046 RPC_AUTH_NETSEC_CHK
*verf
,
3047 char *data
, size_t data_len
);
3049 /*The following definitions come from rpc_parse/parse_ntlmssp.c */
3051 BOOL
rpc_hdr_ntlmssp_auth_chk(RPC_HDR_AUTH
*rai
);
3052 BOOL
make_rpc_auth_ntlmssp_neg(RPC_AUTH_NTLMSSP_NEG
*neg
,
3054 fstring myname
, fstring domain
);
3055 BOOL
smb_io_rpc_auth_ntlmssp_neg(char *desc
, RPC_AUTH_NTLMSSP_NEG
*neg
, prs_struct
*ps
, int depth
);
3056 BOOL
make_rpc_auth_ntlmssp_chal(RPC_AUTH_NTLMSSP_CHAL
*chl
,
3058 uint8 challenge
[8]);
3059 BOOL
smb_io_rpc_auth_ntlmssp_chal(char *desc
, RPC_AUTH_NTLMSSP_CHAL
*chl
, prs_struct
*ps
, int depth
);
3060 BOOL
make_rpc_auth_ntlmssp_resp(RPC_AUTH_NTLMSSP_RESP
*rsp
,
3062 uchar
*nt_resp
, size_t nt_len
,
3063 char *domain
, char *user
, char *wks
,
3065 BOOL
smb_io_rpc_auth_ntlmssp_resp(char *desc
, RPC_AUTH_NTLMSSP_RESP
*rsp
, prs_struct
*ps
, int depth
);
3066 BOOL
rpc_auth_ntlmssp_chk(RPC_AUTH_NTLMSSP_CHK
*chk
, uint32 crc32
, uint32 seq_num
);
3067 BOOL
make_rpc_auth_ntlmssp_chk(RPC_AUTH_NTLMSSP_CHK
*chk
,
3068 uint32 ver
, uint32 crc32
, uint32 seq_num
);
3069 BOOL
smb_io_rpc_auth_ntlmssp_chk(char *desc
, RPC_AUTH_NTLMSSP_CHK
*chk
, prs_struct
*ps
, int depth
);
3071 /*The following definitions come from rpc_parse/parse_prs.c */
3073 void prs_debug(prs_struct
*ps
, int depth
, const char *desc
, const char *fn_name
);
3074 void prs_debug_out(const prs_struct
*ps
, char *msg
, int level
);
3075 void prs_init(prs_struct
*ps
, uint32 size
, uint8 align
, BOOL io
);
3076 void prs_create(prs_struct
*ps
, char *data
, uint32 size
, uint8 align
, BOOL io
);
3077 BOOL
prs_copy(prs_struct
*ps
, const prs_struct
*from
);
3078 BOOL
prs_alloc_data(prs_struct
*buf
, int size
);
3079 BOOL
prs_buf_copy(char *copy_into
, const prs_struct
*buf
,
3080 uint32 offset
, uint32 len
);
3081 void prs_struct_free(prs_struct
**buf
);
3082 void prs_free_data(prs_struct
*buf
);
3083 BOOL
prs_realloc_data(prs_struct
*buf
, size_t new_size
);
3084 BOOL
prs_grow_data(prs_struct
*buf
, BOOL io
, int new_size
, BOOL force_grow
);
3085 uint32
prs_buf_len(const prs_struct
*buf
);
3086 char *prs_data(const prs_struct
*buf
, uint32 offset
);
3087 void prs_link(prs_struct
*prev
, prs_struct
*ps
, prs_struct
*next
);
3088 void prs_align(prs_struct
*ps
);
3089 BOOL
prs_grow(prs_struct
*ps
, uint32 new_size
);
3090 BOOL
prs_append_data(prs_struct
*ps
, const char *data
, int len
);
3091 BOOL
prs_add_data(prs_struct
*ps
, const char *data
, int len
);
3092 BOOL
_prs_uint8(char *name
, prs_struct
*ps
, int depth
, uint8
*data8
);
3093 BOOL
_prs_uint16(char *name
, prs_struct
*ps
, int depth
, uint16
*data16
);
3094 BOOL
_prs_hash1(prs_struct
*ps
, uint32 offset
, uint8 sess_key
[16]);
3095 BOOL
_prs_uint32(char *name
, prs_struct
*ps
, int depth
, uint32
*data32
);
3096 BOOL
_prs_uint8s(BOOL charmode
, char *name
, prs_struct
*ps
, int depth
, uint8
*data8s
, int len
);
3097 BOOL
_prs_uint16s(BOOL charmode
, char *name
, prs_struct
*ps
, int depth
, uint16
*data16s
, int len
);
3098 BOOL
_prs_uint32s(BOOL charmode
, char *name
, prs_struct
*ps
, int depth
, uint32
*data32s
, int len
);
3099 BOOL
_prs_buffer2(BOOL charmode
, char *name
, prs_struct
*ps
, int depth
, BUFFER2
*str
);
3100 BOOL
_prs_string2(BOOL charmode
, char *name
, prs_struct
*ps
, int depth
, STRING2
*str
);
3101 BOOL
_prs_unistr2(BOOL charmode
, char *name
, prs_struct
*ps
, int depth
, UNISTR2
*str
);
3102 BOOL
_prs_unistr3(BOOL charmode
, char *name
, UNISTR3
*str
, prs_struct
*ps
, int depth
);
3103 BOOL
_prs_unistr(char *name
, prs_struct
*ps
, int depth
, UNISTR
*str
);
3104 BOOL
_prs_string(char *name
, prs_struct
*ps
, int depth
, char *str
, uint16 len
, uint16 max_buf_size
);
3105 BOOL
_prs_uint16_pre(char *name
, prs_struct
*ps
, int depth
, uint16
*data16
, uint32
*offset
);
3106 BOOL
_prs_uint16_post(char *name
, prs_struct
*ps
, int depth
, uint16
*data16
,
3107 uint32 ptr_uint16
, uint32 start_offset
);
3108 BOOL
_prs_uint32_pre(char *name
, prs_struct
*ps
, int depth
, uint32
*data32
, uint32
*offset
);
3109 BOOL
_prs_uint32_post(char *name
, prs_struct
*ps
, int depth
, uint32
*data32
,
3110 uint32 ptr_uint32
, uint32 data_size
);
3111 int prs_tdb_delete(TDB_CONTEXT
*tdb
, prs_struct
*pk
);
3112 int prs_tdb_store(TDB_CONTEXT
*tdb
, int flgs
, prs_struct
*pk
, prs_struct
*pd
);
3113 void prs_tdb_fetch(TDB_CONTEXT
*tdb
, prs_struct
*pk
, prs_struct
*pd
);
3115 /*The following definitions come from rpc_parse/parse_rpc.c */
3117 BOOL
make_rpc_hdr(RPC_HDR
*hdr
, enum RPC_PKT_TYPE pkt_type
, uint8 flags
,
3118 uint32 call_id
, int data_len
, int auth_len
);
3119 BOOL
smb_io_rpc_hdr(char *desc
, RPC_HDR
*rpc
, prs_struct
*ps
, int depth
);
3120 BOOL
is_complete_pdu(prs_struct
*ps
);
3121 BOOL
smb_io_rpc_hdr_fault(char *desc
, RPC_HDR_FAULT
*rpc
, prs_struct
*ps
, int depth
);
3122 BOOL
make_rpc_hdr_rb(RPC_HDR_RB
*rpc
,
3123 uint16 max_tsize
, uint16 max_rsize
, uint32 assoc_gid
,
3124 uint32 num_elements
, uint16 context_id
, uint8 num_syntaxes
,
3125 RPC_IFACE
*abstract
, RPC_IFACE
*transfer
);
3126 BOOL
smb_io_rpc_hdr_rb(char *desc
, RPC_HDR_RB
*rpc
, prs_struct
*ps
, int depth
);
3127 BOOL
make_rpc_hdr_ba(RPC_HDR_BA
*rpc
,
3128 uint16 max_tsize
, uint16 max_rsize
, uint32 assoc_gid
,
3129 const char *pipe_addr
,
3130 uint8 num_results
, uint16 result
, uint16 reason
,
3131 RPC_IFACE
*transfer
);
3132 BOOL
smb_io_rpc_hdr_ba(char *desc
, RPC_HDR_BA
*rpc
, prs_struct
*ps
, int depth
);
3133 BOOL
make_rpc_hdr_req(RPC_HDR_REQ
*hdr
, uint32 alloc_hint
, uint16 vuid
,
3135 BOOL
smb_io_rpc_hdr_req(char *desc
, RPC_HDR_REQ
*rpc
, prs_struct
*ps
, int depth
);
3136 BOOL
smb_io_rpc_hdr_resp(char *desc
, RPC_HDR_RESP
*rpc
, prs_struct
*ps
, int depth
);
3137 BOOL
make_rpc_hdr_autha(RPC_HDR_AUTHA
*rai
,
3138 uint16 max_tsize
, uint16 max_rsize
,
3139 uint8 auth_type
, uint8 auth_level
,
3140 uint8 stub_type_len
);
3141 BOOL
smb_io_rpc_hdr_autha(char *desc
, RPC_HDR_AUTHA
*rai
, prs_struct
*ps
, int depth
);
3142 BOOL
make_rpc_hdr_auth(RPC_HDR_AUTH
*rai
,
3143 uint8 auth_type
, uint8 auth_level
,
3144 uint8 stub_type_len
,
3146 BOOL
smb_io_rpc_hdr_auth(char *desc
, RPC_HDR_AUTH
*rai
, prs_struct
*ps
, int depth
);
3147 BOOL
make_rpc_auth_verifier(RPC_AUTH_VERIFIER
*rav
,
3148 char *signature
, uint32 msg_type
);
3149 BOOL
smb_io_rpc_auth_verifier(char *desc
, RPC_AUTH_VERIFIER
*rav
, prs_struct
*ps
, int depth
);
3150 BOOL
rpc_auth_verifier_chk(RPC_AUTH_VERIFIER
*rav
,
3151 char *signature
, uint32 msg_type
);
3153 /*The following definitions come from rpc_parse/parse_sec.c */
3155 BOOL
make_sec_access(SEC_ACCESS
*t
, uint32 mask
);
3156 BOOL
sec_io_access(char *desc
, SEC_ACCESS
*t
, prs_struct
*ps
, int depth
);
3157 BOOL
make_sec_ace(SEC_ACE
*t
, DOM_SID
*sid
, uint8 type
, SEC_ACCESS mask
, uint8 flag
);
3158 BOOL
sec_io_ace(char *desc
, SEC_ACE
*t
, prs_struct
*ps
, int depth
);
3159 BOOL
make_sec_acl(SEC_ACL
*t
, uint16 revision
, int num_aces
, SEC_ACE
*ace
);
3160 void free_sec_acl(SEC_ACL
*t
);
3161 BOOL
sec_io_acl(char *desc
, SEC_ACL
*t
, prs_struct
*ps
, int depth
);
3162 int make_sec_desc(SEC_DESC
*t
, uint16 revision
, uint16 type
,
3163 DOM_SID
*owner_sid
, DOM_SID
*grp_sid
,
3164 SEC_ACL
*sacl
, SEC_ACL
*dacl
);
3165 void free_sec_desc(SEC_DESC
*t
);
3166 BOOL
make_sec_desc_buf(SEC_DESC_BUF
*buf
, int len
, SEC_DESC
*data
);
3167 void free_sec_desc_buf(SEC_DESC_BUF
*buf
);
3168 BOOL
sec_io_desc_buf(char *desc
, SEC_DESC_BUF
*sec
, prs_struct
*ps
, int depth
);
3170 /*The following definitions come from rpc_parse/parse_vuid.c */
3172 BOOL
vuid_io_key(char *desc
, vuser_key
*r_u
, prs_struct
*ps
, int depth
);
3173 BOOL
make_vuid_user_struct(user_struct
*r_u
,
3174 uid_t uid
, gid_t gid
,
3176 const char* requested_name
,
3177 const char* real_name
,
3179 uint32 n_groups
, const gid_t
*groups
,
3180 const NET_USER_INFO_3
*usr
);
3181 BOOL
vuid_io_user_struct(char *desc
, user_struct
*r_u
, prs_struct
*ps
, int depth
);
3182 void vuid_free_user_struct(user_struct
*r_u
);
3184 /*The following definitions come from rpc_server/srv_brs.c */
3186 BOOL
api_brs_rpc(rpcsrv_struct
*p
);
3188 /*The following definitions come from rpc_server/srv_lookup.c */
3190 uint32
make_dom_gids(DOMAIN_GRP
*mem
, int num_members
, DOM_GID
**ppgids
);
3191 int get_domain_user_groups(DOMAIN_GRP_MEMBER
**grp_members
, uint32 group_rid
);
3192 uint32
lookup_sid(DOM_SID
*sid
, char *name
, uint32
*type
);
3193 uint32
lookup_added_user_rids(char *nt_name
,
3194 uint32
*usr_rid
, uint32
*grp_rid
);
3195 uint32
lookup_name(const char *name
, DOM_SID
*sid
, uint32
*type
);
3197 /*The following definitions come from rpc_server/srv_netlog.c */
3199 BOOL
api_netlog_rpc(rpcsrv_struct
*p
);
3201 /*The following definitions come from rpc_server/srv_pipe.c */
3203 BOOL
readwrite_pipe(pipes_struct
*p
, char *data
, int len
,
3204 char **rdata
, int *rlen
,
3205 BOOL
*pipe_outstanding
);
3206 ssize_t
write_pipe(pipes_struct
*p
, char *data
, size_t n
);
3207 int read_pipe(pipes_struct
*p
, char *data
, int n
);
3209 /*The following definitions come from rpc_server/srv_pipe_hnd.c */
3211 void set_pipe_handle_offset(int max_open_files
);
3212 void reset_chain_p(void);
3213 void init_rpc_pipe_hnd(void);
3214 pipes_struct
*open_rpc_pipe_p(char *pipe_name
, const vuser_key
*key
,
3216 BOOL
wait_rpc_pipe_hnd_state(pipes_struct
*p
, uint16 priority
);
3217 BOOL
set_rpc_pipe_hnd_state(pipes_struct
*p
, uint16 device_state
);
3218 BOOL
close_rpc_pipe_hnd(pipes_struct
*p
);
3219 pipes_struct
*get_rpc_pipe_p(char *buf
, int where
);
3220 pipes_struct
*get_rpc_vuser(const vuser_key
*key
);
3221 pipes_struct
*get_rpc_pipe(int pnum
);
3223 /*The following definitions come from rpc_server/srv_pipe_netsec.c */
3226 /*The following definitions come from rpc_server/srv_pipe_noauth.c */
3229 /*The following definitions come from rpc_server/srv_pipe_ntlmssp.c */
3232 /*The following definitions come from rpc_server/srv_pipe_srv.c */
3234 void close_msrpc_command_processor(void);
3235 void add_msrpc_command_processor(char* pipe_name
,
3237 BOOL (*fn
) (rpcsrv_struct
*));
3238 BOOL
api_rpcTNP(rpcsrv_struct
*l
, const char *rpc_name
,
3239 const struct api_struct
*api_rpc_cmds
);
3240 BOOL
rpc_local(rpcsrv_struct
*l
, char *data
, int len
, const char *name
);
3242 /*The following definitions come from rpc_server/srv_reg.c */
3244 BOOL
api_reg_rpc(rpcsrv_struct
*p
);
3246 /*The following definitions come from rpc_server/srv_samr.c */
3248 BOOL
api_samr_rpc(rpcsrv_struct
*p
);
3250 /*The following definitions come from rpc_server/srv_spoolss.c */
3252 BOOL
api_spoolss_rpc(rpcsrv_struct
*p
);
3254 /*The following definitions come from rpc_server/srv_srvsvc.c */
3256 BOOL
api_srvsvc_rpc(rpcsrv_struct
*p
);
3258 /*The following definitions come from rpc_server/srv_svcctl.c */
3260 BOOL
api_svcctl_rpc(rpcsrv_struct
*p
);
3262 /*The following definitions come from rpc_server/srv_wkssvc.c */
3264 BOOL
api_wkssvc_rpc(rpcsrv_struct
*p
);
3266 /*The following definitions come from rpcclient/cmd_atsvc.c */
3268 void cmd_at(struct client_info
*info
, int argc
, char *argv
[]);
3270 /*The following definitions come from rpcclient/cmd_brs.c */
3272 void cmd_brs_query_info(struct client_info
*info
, int argc
, char *argv
[]);
3274 /*The following definitions come from rpcclient/cmd_eventlog.c */
3276 void cmd_eventlog(struct client_info
*info
, int argc
, char *argv
[]);
3278 /*The following definitions come from rpcclient/cmd_lsarpc.c */
3280 void cmd_lsa_enum_trust_dom(struct client_info
*info
, int argc
, char *argv
[]);
3281 void cmd_lsa_query_info(struct client_info
*info
, int argc
, char *argv
[]);
3282 void cmd_lsa_lookup_names(struct client_info
*info
, int argc
, char *argv
[]);
3283 void cmd_lsa_lookup_sids(struct client_info
*info
, int argc
, char *argv
[]);
3284 void cmd_lsa_query_secret(struct client_info
*info
, int argc
, char *argv
[]);
3286 /*The following definitions come from rpcclient/cmd_netlogon.c */
3288 void cmd_netlogon_login_test(struct client_info
*info
, int argc
, char *argv
[]);
3289 void cmd_netlogon_domain_test(struct client_info
*info
, int argc
, char *argv
[]);
3290 void cmd_sam_sync(struct client_info
*info
, int argc
, char *argv
[]);
3292 /*The following definitions come from rpcclient/cmd_reg.c */
3294 void split_server_keyname(char *srv_name
, char *key
, const char* arg
);
3295 BOOL
msrpc_reg_enum_key(const char* srv_name
, const char* full_keyname
,
3297 REG_KEY_FN(reg_key_fn
),
3298 REG_VAL_FN(reg_val_fn
));
3299 void cmd_reg_enum(struct client_info
*info
, int argc
, char *argv
[]);
3300 void cmd_reg_query_info(struct client_info
*info
, int argc
, char *argv
[]);
3301 void cmd_reg_query_key(struct client_info
*info
, int argc
, char *argv
[]);
3302 void cmd_reg_create_val(struct client_info
*info
, int argc
, char *argv
[]);
3303 void cmd_reg_delete_val(struct client_info
*info
, int argc
, char *argv
[]);
3304 void cmd_reg_delete_key(struct client_info
*info
, int argc
, char *argv
[]);
3305 void cmd_reg_create_key(struct client_info
*info
, int argc
, char *argv
[]);
3306 void cmd_reg_test_key_sec(struct client_info
*info
, int argc
, char *argv
[]);
3307 void cmd_reg_get_key_sec(struct client_info
*info
, int argc
, char *argv
[]);
3308 void cmd_reg_shutdown(struct client_info
*info
, int argc
, char *argv
[]);
3310 /*The following definitions come from rpcclient/cmd_samr.c */
3312 void cmd_sam_ntchange_pwd(struct client_info
*info
, int argc
, char *argv
[]);
3313 void cmd_sam_test(struct client_info
*info
, int argc
, char *argv
[]);
3314 void cmd_sam_lookup_domain(struct client_info
*info
, int argc
, char *argv
[]);
3315 void cmd_sam_lookup_names(struct client_info
*info
, int argc
, char *argv
[]);
3316 void cmd_sam_lookup_rids(struct client_info
*info
, int argc
, char *argv
[]);
3317 void cmd_sam_del_aliasmem(struct client_info
*info
, int argc
, char *argv
[]);
3318 void cmd_sam_delete_dom_alias(struct client_info
*info
, int argc
, char *argv
[]);
3319 void cmd_sam_add_aliasmem(struct client_info
*info
, int argc
, char *argv
[]);
3320 void cmd_sam_create_dom_trusting(struct client_info
*info
, int argc
, char *argv
[]);
3321 void cmd_sam_create_dom_user(struct client_info
*info
, int argc
, char *argv
[]);
3322 void cmd_sam_create_dom_alias(struct client_info
*info
, int argc
, char *argv
[]);
3323 void cmd_sam_del_groupmem(struct client_info
*info
, int argc
, char *argv
[]);
3324 void cmd_sam_delete_dom_group(struct client_info
*info
, int argc
, char *argv
[]);
3325 void cmd_sam_add_groupmem(struct client_info
*info
, int argc
, char *argv
[]);
3326 void cmd_sam_create_dom_group(struct client_info
*info
, int argc
, char *argv
[]);
3327 void cmd_sam_enum_users(struct client_info
*info
, int argc
, char *argv
[]);
3328 void cmd_sam_query_groupmem(struct client_info
*info
, int argc
, char *argv
[]);
3329 void cmd_sam_query_group(struct client_info
*info
, int argc
, char *argv
[]);
3330 void cmd_sam_query_sec_obj(struct client_info
*info
, int argc
, char *argv
[]);
3331 void cmd_sam_query_user(struct client_info
*info
, int argc
, char *argv
[]);
3332 void cmd_sam_set_userinfo2(struct client_info
*info
, int argc
, char *argv
[]);
3333 void cmd_sam_set_userinfo(struct client_info
*info
, int argc
, char *argv
[]);
3334 void cmd_sam_query_dispinfo(struct client_info
*info
, int argc
, char *argv
[]);
3335 void cmd_sam_query_dominfo(struct client_info
*info
, int argc
, char *argv
[]);
3336 void cmd_sam_query_aliasmem(struct client_info
*info
, int argc
, char *argv
[]);
3337 void cmd_sam_query_alias(struct client_info
*info
, int argc
, char *argv
[]);
3338 void cmd_sam_enum_aliases(struct client_info
*info
, int argc
, char *argv
[]);
3339 void cmd_sam_enum_groups(struct client_info
*info
, int argc
, char *argv
[]);
3340 void cmd_sam_enum_domains(struct client_info
*info
, int argc
, char *argv
[]);
3342 /*The following definitions come from rpcclient/cmd_spoolss.c */
3344 BOOL
msrpc_spoolss_enum_printers( const char* srv_name
,
3349 void cmd_spoolss_enum_printers(struct client_info
*info
, int argc
, char *argv
[]);
3350 void cmd_spoolss_open_printer_ex(struct client_info
*info
, int argc
, char *argv
[]);
3351 BOOL
msrpc_spoolss_enum_jobs( const char* printer_name
,
3352 const char* station
, const char* user_name
,
3357 void cmd_spoolss_enum_jobs(struct client_info
*info
, int argc
, char *argv
[]);
3359 /*The following definitions come from rpcclient/cmd_srvsvc.c */
3361 BOOL
net_srv_get_info(struct client_info
*info
,
3364 void cmd_srv_query_info(struct client_info
*info
, int argc
, char *argv
[]);
3365 BOOL
msrpc_srv_enum_tprt( const char* dest_srv
,
3367 SRV_TPRT_INFO_CTR
*ctr
,
3368 TPRT_INFO_FN(tprt_fn
));
3369 void cmd_srv_enum_tprt(struct client_info
*info
, int argc
, char *argv
[]);
3370 void cmd_srv_enum_conn(struct client_info
*info
, int argc
, char *argv
[]);
3371 void cmd_srv_enum_shares(struct client_info
*info
, int argc
, char *argv
[]);
3372 void cmd_srv_enum_sess(struct client_info
*info
, int argc
, char *argv
[]);
3373 void cmd_srv_enum_files(struct client_info
*info
, int argc
, char *argv
[]);
3374 void cmd_time(struct client_info
*info
, int argc
, char *argv
[]);
3376 /*The following definitions come from rpcclient/cmd_svcctl.c */
3378 void svc_display_query_svc_cfg(const QUERY_SERVICE_CONFIG
*cfg
);
3379 BOOL
svc_query_service( POLICY_HND
*pol_scm
,
3380 const char *svc_name
,
3381 SVC_QUERY_FN(svc_query_fn
));
3382 void cmd_svc_info(struct client_info
*info
, int argc
, char *argv
[]);
3383 BOOL
msrpc_svc_enum(const char* srv_name
,
3384 ENUM_SRVC_STATUS
**svcs
,
3386 SVC_INFO_FN(info_fn
),
3387 SVC_QUERY_FN(query_fn
));
3388 void cmd_svc_enum(struct client_info
*info
, int argc
, char *argv
[]);
3389 void cmd_svc_stop(struct client_info
*info
, int argc
, char *argv
[]);
3390 void cmd_svc_start(struct client_info
*info
, int argc
, char *argv
[]);
3391 void cmd_svc_set(struct client_info
*info
, int argc
, char *argv
[]);
3393 /*The following definitions come from rpcclient/cmd_wkssvc.c */
3395 void cmd_wks_query_info(struct client_info
*info
, int argc
, char *argv
[]);
3397 /*The following definitions come from rpcclient/display_at.c */
3399 void display_at_enum_info(FILE *out_hnd
, enum action_type action
,
3400 uint32 num_jobs
, const AT_ENUM_INFO
*const jobs
,
3401 char *const *const commands
);
3402 void display_at_job_info(FILE *out_hnd
, enum action_type action
,
3403 AT_JOB_INFO
*const job
, fstring command
);
3405 /*The following definitions come from rpcclient/display_event.c */
3407 void display_eventlog_eventrecord(FILE *out_hnd
, enum action_type action
, EVENTLOGRECORD
*const ev
);
3409 /*The following definitions come from rpcclient/display_reg.c */
3411 char *get_reg_val_type_str(uint32 type
);
3412 void display_reg_value_info(FILE *out_hnd
, enum action_type action
,
3413 const char *val_name
,
3414 uint32 val_type
, const BUFFER2
*value
);
3415 void display_reg_key_info(FILE *out_hnd
, enum action_type action
,
3416 const char *key_name
, time_t key_mod_time
);
3418 /*The following definitions come from rpcclient/display_sam.c */
3420 void display_alias_members(FILE *out_hnd
, enum action_type action
,
3421 uint32 num_mem
, char *const *const sid_mem
,
3422 uint32
*const type
);
3423 void display_alias_rid_info(FILE *out_hnd
, enum action_type action
,
3425 uint32 num_rids
, uint32
*const rid
);
3426 void display_group_members(FILE *out_hnd
, enum action_type action
,
3427 uint32 num_mem
, char *const *const name
, uint32
*const type
);
3428 void display_group_info1(FILE *out_hnd
, enum action_type action
, GROUP_INFO1
*const info1
);
3429 void display_group_info4(FILE *out_hnd
, enum action_type action
, GROUP_INFO4
*const info4
);
3430 void display_group_info_ctr(FILE *out_hnd
, enum action_type action
,
3431 GROUP_INFO_CTR
*const ctr
);
3432 void display_group_rid_info(FILE *out_hnd
, enum action_type action
,
3433 uint32 num_gids
, DOM_GID
*const gid
);
3434 void display_alias_name_info(FILE *out_hnd
, enum action_type action
,
3435 uint32 num_aliases
, fstring
*const alias_name
, const uint32
*const num_als_usrs
);
3436 void display_alias_info3(FILE *out_hnd
, enum action_type action
, ALIAS_INFO3
*const info3
);
3437 void display_alias_info_ctr(FILE *out_hnd
, enum action_type action
,
3438 ALIAS_INFO_CTR
*const ctr
);
3439 void display_sam_user_info_21(FILE *out_hnd
, enum action_type action
, SAM_USER_INFO_21
*const usr
);
3440 void display_sam_unk_info_2(FILE *out_hnd
, enum action_type action
,
3441 SAM_UNK_INFO_2
*const info2
);
3442 void display_sam_unk_ctr(FILE *out_hnd
, enum action_type action
,
3443 uint32 switch_value
, SAM_UNK_CTR
*const ctr
);
3444 void display_sam_info_1(FILE *out_hnd
, enum action_type action
,
3445 SAM_ENTRY1
*const e1
, SAM_STR1
*const s1
);
3446 void display_sam_info_1_ctr(FILE *out_hnd
, enum action_type action
,
3447 uint32 count
, SAM_DISPINFO_1
*const ctr
);
3448 void display_sam_disp_info_ctr(FILE *out_hnd
, enum action_type action
,
3449 uint16 level
, uint32 count
,
3450 SAM_DISPINFO_CTR
*const ctr
);
3452 /*The following definitions come from rpcclient/display_sec.c */
3454 char *get_sec_mask_str(uint32 type
);
3455 void display_sec_access(FILE *out_hnd
, enum action_type action
, SEC_ACCESS
*const info
);
3456 void display_sec_ace(FILE *out_hnd
, enum action_type action
, SEC_ACE
*const ace
);
3457 void display_sec_acl(FILE *out_hnd
, enum action_type action
, SEC_ACL
*const sec_acl
);
3458 void display_sec_desc(FILE *out_hnd
, enum action_type action
, SEC_DESC
*const sec
);
3460 /*The following definitions come from rpcclient/display_spool.c */
3462 void display_print_info_0(FILE *out_hnd
, enum action_type action
,
3463 PRINTER_INFO_0
*const i0
);
3464 void display_print_info_1(FILE *out_hnd
, enum action_type action
,
3465 PRINTER_INFO_1
*const i1
);
3466 void display_printer_info_0_ctr(FILE *out_hnd
, enum action_type action
,
3467 uint32 count
, PRINTER_INFO_0
*const *const ctr
);
3468 void display_printer_info_1_ctr(FILE *out_hnd
, enum action_type action
,
3469 uint32 count
, PRINTER_INFO_1
*const *const ctr
);
3470 void display_printer_info_ctr(FILE *out_hnd
, enum action_type action
,
3471 uint32 level
, uint32 count
,
3472 void *const *const ctr
);
3473 void display_job_info_2(FILE *out_hnd
, enum action_type action
,
3474 JOB_INFO_2
*const i2
);
3475 void display_job_info_1(FILE *out_hnd
, enum action_type action
,
3476 JOB_INFO_1
*const i1
);
3477 void display_job_info_2_ctr(FILE *out_hnd
, enum action_type action
,
3478 uint32 count
, JOB_INFO_2
*const *const ctr
);
3479 void display_job_info_1_ctr(FILE *out_hnd
, enum action_type action
,
3480 uint32 count
, JOB_INFO_1
*const *const ctr
);
3481 void display_job_info_ctr(FILE *out_hnd
, enum action_type action
,
3482 uint32 level
, uint32 count
,
3483 void *const *const ctr
);
3485 /*The following definitions come from rpcclient/display_srv.c */
3487 char *get_sid_name_use_str(uint32 sid_name_use
);
3488 char *get_file_mode_str(uint32 share_mode
);
3489 char *get_file_oplock_str(uint32 op_type
);
3490 char *get_share_type_str(uint32 type
);
3491 char *get_server_type_str(uint32 type
);
3492 void display_srv_info_101(FILE *out_hnd
, enum action_type action
,
3493 SRV_INFO_101
*const sv101
);
3494 void display_srv_info_102(FILE *out_hnd
, enum action_type action
, SRV_INFO_102
*const sv102
);
3495 void display_srv_info_ctr(FILE *out_hnd
, enum action_type action
, SRV_INFO_CTR
*const ctr
);
3496 void display_conn_info_0(FILE *out_hnd
, enum action_type action
,
3497 CONN_INFO_0
*const info0
);
3498 void display_conn_info_1(FILE *out_hnd
, enum action_type action
,
3499 CONN_INFO_1
*const info1
, CONN_INFO_1_STR
*const str1
);
3500 void display_srv_conn_info_0_ctr(FILE *out_hnd
, enum action_type action
,
3501 SRV_CONN_INFO_0
*const ctr
);
3502 void display_srv_conn_info_1_ctr(FILE *out_hnd
, enum action_type action
,
3503 SRV_CONN_INFO_1
*const ctr
);
3504 void display_srv_conn_info_ctr(FILE *out_hnd
, enum action_type action
,
3505 SRV_CONN_INFO_CTR
*const ctr
);
3506 void display_tprt_info_0(FILE *out_hnd
, enum action_type action
,
3507 TPRT_INFO_0
*const info0
, TPRT_INFO_0_STR
*const str0
);
3508 void display_srv_tprt_info_0_ctr(FILE *out_hnd
, enum action_type action
,
3509 const SRV_TPRT_INFO_0
*const ctr
);
3510 void display_srv_tprt_info_ctr(FILE *out_hnd
, enum action_type action
,
3511 const SRV_TPRT_INFO_CTR
*const ctr
);
3512 void display_share_info_1(FILE *out_hnd
, enum action_type action
,
3513 SH_INFO_1
*const info1
, SH_INFO_1_STR
*const str1
);
3514 void display_share_info_2(FILE *out_hnd
, enum action_type action
,
3515 SH_INFO_2
*const info2
, SH_INFO_2_STR
*const str2
);
3516 void display_srv_share_info_1_ctr(FILE *out_hnd
, enum action_type action
,
3517 SRV_SHARE_INFO_1
*const ctr
);
3518 void display_srv_share_info_2_ctr(FILE *out_hnd
, enum action_type action
,
3519 SRV_SHARE_INFO_2
*const ctr
);
3520 void display_srv_share_info_ctr(FILE *out_hnd
, enum action_type action
,
3521 SRV_SHARE_INFO_CTR
*const ctr
);
3522 void display_file_info_3(FILE *out_hnd
, enum action_type action
,
3523 FILE_INFO_3
*const info3
, FILE_INFO_3_STR
*const str3
);
3524 void display_srv_file_info_3_ctr(FILE *out_hnd
, enum action_type action
,
3525 SRV_FILE_INFO_3
*const ctr
);
3526 void display_srv_file_info_ctr(FILE *out_hnd
, enum action_type action
,
3527 SRV_FILE_INFO_CTR
*const ctr
);
3528 void display_sess_info_0(FILE *out_hnd
, enum action_type action
,
3529 SESS_INFO_0
*const info0
, SESS_INFO_0_STR
*const str0
);
3530 void display_sess_info_1(FILE *out_hnd
, enum action_type action
,
3531 SESS_INFO_1
*const info1
, SESS_INFO_1_STR
*const str1
);
3532 void display_srv_sess_info_0_ctr(FILE *out_hnd
, enum action_type action
,
3533 SRV_SESS_INFO_0
*const ctr
);
3534 void display_srv_sess_info_1_ctr(FILE *out_hnd
, enum action_type action
,
3535 SRV_SESS_INFO_1
*const ctr
);
3536 void display_srv_sess_info_ctr(FILE *out_hnd
, enum action_type action
,
3537 SRV_SESS_INFO_CTR
*const ctr
);
3538 void display_server(FILE *out_hnd
, enum action_type action
,
3539 char *const sname
, uint32 type
, char *const comment
);
3540 void display_share(FILE *out_hnd
, enum action_type action
,
3541 char *const sname
, uint32 type
, char *const comment
);
3542 void display_share2(FILE *out_hnd
, enum action_type action
,
3543 char *const sname
, uint32 type
, char *const comment
,
3544 uint32 perms
, uint32 max_uses
, uint32 num_uses
,
3545 char *const path
, char *const password
);
3546 void display_name(FILE *out_hnd
, enum action_type action
,
3549 /*The following definitions come from rpcclient/display_svc.c */
3551 char *get_svc_start_type_str(uint32 type
);
3552 void display_query_svc_cfg(FILE *out_hnd
, enum action_type action
,
3553 const QUERY_SERVICE_CONFIG
*const cfg
);
3554 void display_svc_info(FILE *out_hnd
, enum action_type action
,
3555 const ENUM_SRVC_STATUS
*const svc
);
3557 /*The following definitions come from rpcclient/display_sync.c */
3559 void display_sam_sync_ctr(FILE *out_hnd
, enum action_type action
,
3560 SAM_DELTA_HDR
*const delta
,
3561 SAM_DELTA_CTR
*const ctr
);
3562 void display_sam_sync(FILE *out_hnd
, enum action_type action
,
3563 SAM_DELTA_HDR
*const deltas
,
3564 SAM_DELTA_CTR
*const ctr
,
3567 /*The following definitions come from rpcclient/rpcclient.c */
3569 void readline_init(void);
3571 /*The following definitions come from samrd/samrd.c */
3573 msrpc_service_fns
*get_service_fns(void);
3575 /*The following definitions come from samrd/srv_samr_als_tdb.c */
3577 uint32
_samr_add_aliasmem(const POLICY_HND
*alias_pol
, const DOM_SID
*sid
);
3578 uint32
_samr_del_aliasmem(const POLICY_HND
*alias_pol
, const DOM_SID
*sid
);
3579 uint32
_samr_query_aliasinfo(const POLICY_HND
*alias_pol
,
3580 uint16 switch_level
,
3581 ALIAS_INFO_CTR
*ctr
);
3582 uint32
_samr_delete_dom_alias(POLICY_HND
*alias_pol
);
3583 uint32
_samr_query_aliasmem(const POLICY_HND
*alias_pol
,
3584 uint32
*num_mem
, DOM_SID2
**sid
);
3585 uint32
_samr_create_dom_alias(const POLICY_HND
*domain_pol
,
3586 const UNISTR2
*uni_acct_name
,
3588 POLICY_HND
*alias_pol
, uint32
*rid
);
3589 uint32
_samr_open_alias(const POLICY_HND
*domain_pol
,
3590 uint32 access_mask
, uint32 alias_rid
,
3591 POLICY_HND
*alias_pol
);
3593 /*The following definitions come from samrd/srv_samr_dom_nt5ldap.c */
3595 uint32
_samr_open_domain(const POLICY_HND
*connect_pol
,
3598 POLICY_HND
*domain_pol
);
3599 uint32
_samr_enum_dom_users( const POLICY_HND
*pol
, uint32
*start_idx
,
3600 uint16 acb_mask
, uint16 unk_1
, uint32 size
,
3602 UNISTR2
**uni_acct_name
,
3603 uint32
*num_sam_users
);
3604 uint32
_samr_enum_dom_groups(const POLICY_HND
*pol
,
3605 uint32
*start_idx
, uint32 size
,
3607 UNISTR2
**uni_acct_name
,
3608 uint32
*num_sam_groups
);
3609 uint32
_samr_enum_dom_aliases(const POLICY_HND
*pol
,
3610 uint32
*start_idx
, uint32 size
,
3612 UNISTR2
**uni_acct_name
,
3613 uint32
*num_sam_aliases
);
3614 uint32
_samr_query_dispinfo( const POLICY_HND
*domain_pol
, uint16 level
,
3619 uint32
*num_entries
,
3620 SAM_DISPINFO_CTR
*ctr
);
3621 uint32
_samr_lookup_names(const POLICY_HND
*dom_pol
,
3626 const UNISTR2
*uni_name
,
3629 uint32 rid
[MAX_SAM_ENTRIES
],
3631 uint32 type
[MAX_SAM_ENTRIES
]);
3632 uint32
_samr_lookup_rids(const POLICY_HND
*dom_pol
,
3633 uint32 num_rids
, uint32 flags
,
3636 UNIHDR
**hdr_name
, UNISTR2
** uni_name
,
3638 uint32
_samr_query_dom_info(const POLICY_HND
*domain_pol
,
3639 uint16 switch_value
,
3642 /*The following definitions come from samrd/srv_samr_dom_tdb.c */
3644 uint32
_samr_open_domain(const POLICY_HND
*connect_pol
,
3647 POLICY_HND
*domain_pol
);
3648 uint32
_samr_enum_dom_users( const POLICY_HND
*pol
, uint32
*start_idx
,
3649 uint16 acb_mask
, uint16 unk_1
, uint32 size
,
3651 UNISTR2
**uni_acct_name
,
3652 uint32
*num_sam_users
);
3653 uint32
_samr_enum_dom_groups(const POLICY_HND
*pol
,
3654 uint32
*start_idx
, uint32 size
,
3656 UNISTR2
**uni_acct_name
,
3657 uint32
*num_sam_groups
);
3658 uint32
_samr_enum_dom_aliases(const POLICY_HND
*pol
,
3659 uint32
*start_idx
, uint32 size
,
3661 UNISTR2
**uni_acct_name
,
3662 uint32
*num_sam_aliases
);
3663 uint32
_samr_query_dispinfo( const POLICY_HND
*domain_pol
, uint16 level
,
3668 uint32
*num_entries
,
3669 SAM_DISPINFO_CTR
*ctr
);
3670 uint32
_samr_lookup_names(const POLICY_HND
*dom_pol
,
3675 const UNISTR2
*uni_name
,
3678 uint32 rid
[MAX_SAM_ENTRIES
],
3680 uint32 type
[MAX_SAM_ENTRIES
]);
3681 uint32
_samr_lookup_rids(const POLICY_HND
*dom_pol
,
3682 uint32 num_rids
, uint32 flags
,
3685 UNIHDR
**hdr_name
, UNISTR2
** uni_name
,
3687 uint32
_samr_query_dom_info(const POLICY_HND
*domain_pol
,
3688 uint16 switch_value
,
3691 /*The following definitions come from samrd/srv_samr_grp_tdb.c */
3693 uint32
_samr_add_groupmem(const POLICY_HND
*pol
, uint32 rid
, uint32 unknown
);
3694 uint32
_samr_del_groupmem(const POLICY_HND
*pol
, uint32 rid
);
3695 uint32
_samr_delete_dom_group(POLICY_HND
*group_pol
);
3696 uint32
_samr_query_groupmem(const POLICY_HND
*group_pol
,
3700 uint32
_samr_query_groupinfo(const POLICY_HND
*pol
,
3701 uint16 switch_level
,
3702 GROUP_INFO_CTR
* ctr
);
3703 uint32
_samr_create_dom_group(const POLICY_HND
*domain_pol
,
3704 const UNISTR2
*uni_acct_name
,
3706 POLICY_HND
*group_pol
, uint32
*rid
);
3707 uint32
_samr_open_group(const POLICY_HND
*domain_pol
, uint32 access_mask
,
3709 POLICY_HND
*group_pol
);
3711 /*The following definitions come from samrd/srv_samr_nt5ldap.c */
3713 BOOL
set_nt5ldaprid(struct policy_cache
*cache
, POLICY_HND
*hnd
,
3714 LDAPDB
*hds
, uint32 rid
);
3715 BOOL
get_nt5ldaprid(struct policy_cache
*cache
, const POLICY_HND
*hnd
,
3716 LDAPDB
**hds
, uint32
*rid
);
3717 BOOL
set_nt5ldapsam(struct policy_cache
*cache
, POLICY_HND
*hnd
,
3719 BOOL
get_nt5ldapsam(struct policy_cache
*cache
, const POLICY_HND
*hnd
,
3721 BOOL
set_nt5ldapdomsid(struct policy_cache
*cache
, POLICY_HND
*hnd
,
3723 const DOM_SID
*sid
);
3724 BOOL
get_nt5ldapdomsid(struct policy_cache
*cache
, const POLICY_HND
*hnd
,
3727 BOOL
set_nt5ldapsid(struct policy_cache
*cache
, POLICY_HND
*hnd
,
3728 LDAPDB
*hds
, const DOM_SID
*sid
);
3729 BOOL
get_nt5ldapsid(struct policy_cache
*cache
, const POLICY_HND
*hnd
,
3730 LDAPDB
**hds
, DOM_SID
*sid
);
3731 uint32
samr_open_by_nt5ldaprid( LDAPDB
*hds
,
3732 const POLICY_HND
*parent_pol
,
3733 POLICY_HND
*pol
, uint32 access_mask
, uint32 rid
);
3734 BOOL
pwdbsam_initialise(void);
3736 /*The following definitions come from samrd/srv_samr_passdb.c */
3738 uint32
_samr_close(POLICY_HND
*hnd
);
3739 uint32
_samr_open_domain(const POLICY_HND
*connect_pol
,
3742 POLICY_HND
*domain_pol
);
3743 uint32
_samr_get_usrdom_pwinfo(const POLICY_HND
*user_pol
,
3746 uint32
_samr_query_sec_obj(const POLICY_HND
*user_pol
, SEC_DESC_BUF
*buf
);
3747 uint32
_samr_enum_dom_users( const POLICY_HND
*pol
, uint32
*start_idx
,
3748 uint16 acb_mask
, uint16 unk_1
, uint32 size
,
3750 UNISTR2
**uni_acct_name
,
3751 uint32
*num_sam_users
);
3752 uint32
_samr_add_groupmem(const POLICY_HND
*pol
, uint32 rid
, uint32 unknown
);
3753 uint32
_samr_del_groupmem(const POLICY_HND
*pol
, uint32 rid
);
3754 uint32
_samr_add_aliasmem(const POLICY_HND
*alias_pol
, const DOM_SID
*sid
);
3755 uint32
_samr_del_aliasmem(const POLICY_HND
*alias_pol
, const DOM_SID
*sid
);
3756 uint32
_samr_enum_domains(const POLICY_HND
*pol
, uint32
*start_idx
,
3759 UNISTR2
**uni_acct_name
,
3760 uint32
*num_sam_users
);
3761 uint32
_samr_enum_dom_groups(const POLICY_HND
*pol
,
3762 uint32
*start_idx
, uint32 size
,
3764 UNISTR2
**uni_acct_name
,
3765 uint32
*num_sam_groups
);
3766 uint32
_samr_enum_dom_aliases(const POLICY_HND
*pol
,
3767 uint32
*start_idx
, uint32 size
,
3769 UNISTR2
**uni_acct_name
,
3770 uint32
*num_sam_aliases
);
3771 uint32
_samr_query_dispinfo( const POLICY_HND
*domain_pol
, uint16 level
,
3776 uint32
*num_entries
,
3777 SAM_DISPINFO_CTR
*ctr
);
3778 uint32
_samr_delete_dom_group(POLICY_HND
*group_pol
);
3779 uint32
_samr_query_groupmem(const POLICY_HND
*group_pol
,
3783 uint32
_samr_query_groupinfo(const POLICY_HND
*pol
,
3784 uint16 switch_level
,
3785 GROUP_INFO_CTR
* ctr
);
3786 uint32
_samr_query_aliasinfo(const POLICY_HND
*alias_pol
,
3787 uint16 switch_level
,
3788 ALIAS_INFO_CTR
*ctr
);
3789 uint32
_samr_query_useraliases(const POLICY_HND
*pol
,
3790 const uint32
*ptr_sid
, const DOM_SID2
*sid
,
3791 uint32
*num_aliases
, uint32
**rid
);
3792 uint32
_samr_delete_dom_alias(POLICY_HND
*alias_pol
);
3793 uint32
_samr_query_aliasmem(const POLICY_HND
*alias_pol
,
3794 uint32
*num_mem
, DOM_SID2
**sid
);
3795 uint32
_samr_lookup_names(const POLICY_HND
*pol
,
3800 const UNISTR2
*uni_name
,
3803 uint32 rid
[MAX_SAM_ENTRIES
],
3805 uint32 type
[MAX_SAM_ENTRIES
]);
3806 uint32
_samr_chgpasswd_user( const UNISTR2
*uni_dest_host
,
3807 const UNISTR2
*uni_user_name
,
3808 const char nt_newpass
[516],
3809 const uchar nt_oldhash
[16],
3810 const char lm_newpass
[516],
3811 const uchar lm_oldhash
[16]);
3812 uint32
_samr_get_dom_pwinfo(const UNISTR2
*uni_srv_name
,
3813 uint16
*unk_0
, uint16
*unk_1
, uint16
*unk_2
);
3814 uint32
_samr_lookup_rids(const POLICY_HND
*pol
,
3815 uint32 num_rids
, uint32 flags
,
3818 UNIHDR
**hdr_name
, UNISTR2
** uni_name
,
3820 uint32
_samr_open_user(const POLICY_HND
*domain_pol
,
3821 uint32 access_mask
, uint32 user_rid
,
3822 POLICY_HND
*user_pol
);
3823 uint32
_samr_query_userinfo(const POLICY_HND
*pol
, uint16 switch_value
,
3824 SAM_USERINFO_CTR
*ctr
);
3825 uint32
_samr_set_userinfo(const POLICY_HND
*pol
, uint16 switch_value
,
3826 SAM_USERINFO_CTR
*ctr
);
3827 uint32
_samr_set_userinfo2(const POLICY_HND
*pol
, uint16 switch_value
,
3828 SAM_USERINFO_CTR
*ctr
);
3829 uint32
_samr_query_usergroups(const POLICY_HND
*pol
,
3832 uint32
_samr_create_dom_alias(const POLICY_HND
*domain_pol
,
3833 const UNISTR2
*uni_acct_name
,
3835 POLICY_HND
*alias_pol
, uint32
*rid
);
3836 uint32
_samr_create_dom_group(const POLICY_HND
*domain_pol
,
3837 const UNISTR2
*uni_acct_name
,
3839 POLICY_HND
*group_pol
, uint32
*rid
);
3840 uint32
_samr_query_dom_info(const POLICY_HND
*domain_pol
,
3841 uint16 switch_value
,
3843 uint32
_samr_create_user(const POLICY_HND
*domain_pol
,
3844 const UNISTR2
*uni_username
,
3845 uint16 acb_info
, uint32 access_mask
,
3846 POLICY_HND
*user_pol
,
3847 uint32
*unknown_0
, uint32
*user_rid
);
3848 uint32
_samr_connect_anon(const UNISTR2
*srv_name
, uint32 access_mask
,
3849 POLICY_HND
*connect_pol
);
3850 uint32
_samr_connect(const UNISTR2
*srv_name
, uint32 access_mask
,
3851 POLICY_HND
*connect_pol
);
3852 uint32
_samr_open_alias(const POLICY_HND
*domain_pol
,
3853 uint32 access_mask
, uint32 alias_rid
,
3854 POLICY_HND
*alias_pol
);
3855 uint32
_samr_open_group(const POLICY_HND
*domain_pol
, uint32 access_mask
,
3857 POLICY_HND
*group_pol
);
3858 uint32
_samr_lookup_domain(const POLICY_HND
*connect_pol
,
3859 const UNISTR2
*uni_domain
,
3861 BOOL
pwdbsam_initialise(void);
3863 /*The following definitions come from samrd/srv_samr_sam_tdb.c */
3865 uint32
_samr_enum_domains(const POLICY_HND
*pol
, uint32
*start_idx
,
3868 UNISTR2
**uni_acct_name
,
3869 uint32
*num_sam_users
);
3870 uint32
_samr_connect_anon(const UNISTR2
*srv_name
, uint32 access_mask
,
3871 POLICY_HND
*connect_pol
);
3872 uint32
_samr_connect(const UNISTR2
*srv_name
, uint32 access_mask
,
3873 POLICY_HND
*connect_pol
);
3874 uint32
_samr_lookup_domain(const POLICY_HND
*connect_pol
,
3875 const UNISTR2
*uni_domain
,
3877 uint32
_samr_close(POLICY_HND
*hnd
);
3878 uint32
_samr_chgpasswd_user( const UNISTR2
*uni_dest_host
,
3879 const UNISTR2
*uni_user_name
,
3880 const char nt_newpass
[516],
3881 const uchar nt_oldhash
[16],
3882 const char lm_newpass
[516],
3883 const uchar lm_oldhash
[16]);
3884 uint32
_samr_get_dom_pwinfo(const UNISTR2
*uni_srv_name
,
3885 uint16
*unk_0
, uint16
*unk_1
, uint16
*unk_2
);
3886 uint32
_samr_query_sec_obj(const POLICY_HND
*pol
, SEC_DESC_BUF
*buf
);
3888 /*The following definitions come from samrd/srv_samr_tdb.c */
3890 BOOL
set_tdbrid(struct policy_cache
*cache
, POLICY_HND
*hnd
,
3891 TDB_CONTEXT
*usr_tdb
,
3892 TDB_CONTEXT
*grp_tdb
,
3893 TDB_CONTEXT
*als_tdb
,
3895 BOOL
get_tdbrid(struct policy_cache
*cache
, const POLICY_HND
*hnd
,
3896 TDB_CONTEXT
**usr_tdb
,
3897 TDB_CONTEXT
**grp_tdb
,
3898 TDB_CONTEXT
**als_tdb
,
3900 BOOL
set_tdbsam(struct policy_cache
*cache
, POLICY_HND
*hnd
,
3902 BOOL
get_tdbsam(struct policy_cache
*cache
, const POLICY_HND
*hnd
,
3904 BOOL
set_tdbdomsid(struct policy_cache
*cache
, POLICY_HND
*hnd
,
3905 TDB_CONTEXT
*usr_tdb
,
3906 TDB_CONTEXT
*usg_tdb
,
3907 TDB_CONTEXT
*usa_tdb
,
3908 TDB_CONTEXT
*grp_tdb
,
3909 TDB_CONTEXT
*als_tdb
,
3910 const DOM_SID
*sid
);
3911 BOOL
get_tdbdomsid(struct policy_cache
*cache
, const POLICY_HND
*hnd
,
3912 TDB_CONTEXT
**usr_tdb
,
3913 TDB_CONTEXT
**usg_tdb
,
3914 TDB_CONTEXT
**usa_tdb
,
3915 TDB_CONTEXT
**grp_tdb
,
3916 TDB_CONTEXT
**als_tdb
,
3918 BOOL
set_tdbsid(struct policy_cache
*cache
, POLICY_HND
*hnd
,
3919 TDB_CONTEXT
*tdb
, const DOM_SID
*sid
);
3920 BOOL
get_tdbsid(struct policy_cache
*cache
, const POLICY_HND
*hnd
,
3921 TDB_CONTEXT
**tdb
, DOM_SID
*sid
);
3922 uint32
samr_open_by_tdbrid( const POLICY_HND
*parent_pol
,
3923 TDB_CONTEXT
*usr_tdb
,
3924 TDB_CONTEXT
*grp_tdb
,
3925 TDB_CONTEXT
*als_tdb
,
3927 uint32 access_mask
, uint32 rid
);
3929 /*The following definitions come from samrd/srv_samr_tdb_init.c */
3931 uint32
initialise_dom_tdb(const DOM_SID
*sid
);
3932 uint32
initialise_sam_tdb( const char* sam_name
, const DOM_SID
*sam_sid
);
3933 BOOL
pwdbsam_initialise(void);
3935 /*The following definitions come from samrd/srv_samr_usr_nt5ldap.c */
3937 uint32
_samr_get_usrdom_pwinfo(const POLICY_HND
*user_pol
,
3940 uint32
_samr_query_sec_obj(const POLICY_HND
*pol
, SEC_DESC_BUF
*buf
);
3941 uint32
_samr_query_usergroups(const POLICY_HND
*pol
,
3944 uint32
_samr_query_useraliases(const POLICY_HND
*pol
,
3945 const uint32
*ptr_sid
, const DOM_SID2
*sid
,
3946 uint32
*num_aliases
, uint32
**rid
);
3947 uint32
_samr_open_user(const POLICY_HND
*domain_pol
,
3948 uint32 access_mask
, uint32 user_rid
,
3949 POLICY_HND
*user_pol
);
3950 uint32
_samr_query_userinfo(const POLICY_HND
*pol
, uint16 switch_value
,
3951 SAM_USERINFO_CTR
*ctr
);
3952 uint32
_samr_set_userinfo(const POLICY_HND
*pol
, uint16 switch_value
,
3953 SAM_USERINFO_CTR
*ctr
);
3954 uint32
_samr_set_userinfo2(const POLICY_HND
*pol
, uint16 switch_value
,
3955 SAM_USERINFO_CTR
*ctr
);
3956 uint32
_samr_create_user(const POLICY_HND
*domain_pol
,
3957 const UNISTR2
*uni_username
,
3958 uint16 acb_info
, uint32 access_mask
,
3959 POLICY_HND
*user_pol
,
3960 uint32
*unknown_0
, uint32
*user_rid
);
3962 /*The following definitions come from samrd/srv_samr_usr_tdb.c */
3964 uint32
_samr_get_usrdom_pwinfo(const POLICY_HND
*user_pol
,
3967 uint32
_samr_query_usergroups(const POLICY_HND
*pol
,
3970 uint32
_samr_query_useraliases(const POLICY_HND
*domain_pol
,
3971 const uint32
*ptr_sid
, const DOM_SID2
*sid
,
3972 uint32
*num_aliases
, uint32
**rid
);
3973 uint32
_samr_open_user(const POLICY_HND
*domain_pol
,
3974 uint32 access_mask
, uint32 user_rid
,
3975 POLICY_HND
*user_pol
);
3976 uint32
_samr_query_userinfo(const POLICY_HND
*pol
, uint16 switch_value
,
3977 SAM_USERINFO_CTR
*ctr
);
3978 uint32
_samr_set_userinfo(const POLICY_HND
*pol
, uint16 switch_value
,
3979 SAM_USERINFO_CTR
*ctr
);
3980 uint32
_samr_set_userinfo2(const POLICY_HND
*pol
, uint16 switch_value
,
3981 SAM_USERINFO_CTR
*ctr
);
3982 uint32
_samr_create_user(const POLICY_HND
*domain_pol
,
3983 const UNISTR2
*uni_username
,
3984 uint16 acb_info
, uint32 access_mask
,
3985 POLICY_HND
*user_pol
,
3986 uint32
*unknown_0
, uint32
*user_rid
);
3988 /*The following definitions come from smbd/blocking.c */
3990 BOOL
push_blocking_lock_request( char *inbuf
, int length
, int lock_timeout
, int lock_num
);
3991 void remove_pending_lock_requests_by_fid(files_struct
*fsp
);
3992 void remove_pending_lock_requests_by_mid(int mid
);
3993 void process_blocking_lock_queue(time_t t
);
3995 /*The following definitions come from smbd/challenge.c */
3997 void generate_next_challenge(char *challenge
);
3998 BOOL
set_challenge(unsigned char *challenge
);
3999 BOOL
last_challenge(unsigned char *challenge
);
4001 /*The following definitions come from smbd/chgpasswd.c */
4003 BOOL
chgpasswd(const char *_name
,char *oldpass
,char *newpass
, BOOL as_root
);
4004 BOOL
chgpasswd(const char *name
,char *oldpass
,char *newpass
, BOOL as_root
);
4005 BOOL
pass_oem_change(const char *user
,
4006 const uchar
*lmdata
, const uchar
*lmhash
,
4007 const uchar
*ntdata
, const uchar
*nthash
);
4008 BOOL
change_oem_password(struct smb_passwd
*smbpw
, UNISTR2
*new_passwd
,
4009 BOOL unicode
, BOOL override
);
4010 BOOL
update_smbpassword_file(const char *user
, const char *password
);
4012 /*The following definitions come from smbd/close.c */
4014 void close_file(files_struct
*fsp
, BOOL normal_close
);
4015 void close_directory(files_struct
*fsp
);
4017 /*The following definitions come from smbd/conn.c */
4019 void conn_init(void);
4020 int conn_num_open(void);
4021 BOOL
conn_snum_used(int snum
);
4022 connection_struct
*conn_find(int cnum
);
4023 connection_struct
*conn_new(void);
4024 void conn_close_all(void);
4025 BOOL
conn_idle_all(time_t t
, int deadtime
);
4026 void conn_free(connection_struct
*conn
);
4028 /*The following definitions come from smbd/connection.c */
4030 BOOL
yield_connection(connection_struct
*conn
,char *name
,int max_connections
);
4031 BOOL
claim_connection(connection_struct
*conn
,char *name
,int max_connections
,BOOL Clear
);
4033 /*The following definitions come from smbd/dfree.c */
4035 SMB_BIG_UINT
sys_disk_free(char *path
,SMB_BIG_UINT
*bsize
,SMB_BIG_UINT
*dfree
,SMB_BIG_UINT
*dsize
);
4037 /*The following definitions come from smbd/dfs.c */
4039 BOOL
init_dfs_table(void);
4040 int under_dfs(connection_struct
*conn
, const char *path
,
4041 char *local_path
, size_t local_plen
);
4043 /*The following definitions come from smbd/dir.c */
4045 void init_dptrs(void);
4046 char *dptr_path(int key
);
4047 char *dptr_wcard(int key
);
4048 BOOL
dptr_set_wcard(int key
, char *wcard
);
4049 BOOL
dptr_set_attr(int key
, uint16 attr
);
4050 uint16
dptr_attr(int key
);
4051 void dptr_close(int key
);
4052 void dptr_closecnum(connection_struct
*conn
);
4053 void dptr_idlecnum(connection_struct
*conn
);
4054 void dptr_closepath(char *path
,int pid
);
4055 int dptr_create(connection_struct
*conn
,char *path
, BOOL expect_close
,int pid
);
4056 BOOL
dptr_fill(char *buf1
,unsigned int key
);
4057 BOOL
dptr_zero(char *buf
);
4058 void *dptr_fetch(char *buf
,int *num
);
4059 void *dptr_fetch_lanman2(int dptr_num
);
4060 BOOL
dir_check_ftype(connection_struct
*conn
,int mode
,SMB_STRUCT_STAT
*st
,int dirtype
);
4061 BOOL
get_dir_entry(connection_struct
*conn
,char *mask
,int dirtype
,char *fname
,
4062 SMB_OFF_T
*size
,int *mode
,time_t *date
,BOOL check_descend
);
4063 void *OpenDir(connection_struct
*conn
, char *name
, BOOL use_veto
);
4064 void CloseDir(void *p
);
4065 char *ReadDirName(void *p
);
4066 BOOL
SeekDir(void *p
,int pos
);
4067 int TellDir(void *p
);
4068 void DirCacheAdd( char *path
, char *name
, char *dname
, int snum
);
4069 char *DirCacheCheck( char *path
, char *name
, int snum
);
4070 void DirCacheFlush(int snum
);
4072 /*The following definitions come from smbd/dosmode.c */
4074 mode_t
unix_mode(connection_struct
*conn
,int dosmode
);
4075 int dos_mode(connection_struct
*conn
,char *path
,SMB_STRUCT_STAT
*sbuf
);
4076 int file_chmod(connection_struct
*conn
,char *fname
,int dosmode
,SMB_STRUCT_STAT
*st
);
4077 int file_utime(connection_struct
*conn
, char *fname
, struct utimbuf
*times
);
4078 BOOL
set_filetime(connection_struct
*conn
, char *fname
, time_t mtime
);
4080 /*The following definitions come from smbd/error.c */
4082 int cached_error_packet(char *inbuf
,char *outbuf
,files_struct
*fsp
,int line
);
4083 int unix_error_packet(char *inbuf
,char *outbuf
,int def_class
,uint32 def_code
,int line
);
4084 int error_packet(char *inbuf
,char *outbuf
,int error_class
,uint32 error_code
,int line
);
4086 /*The following definitions come from smbd/fileio.c */
4088 SMB_OFF_T
seek_file(files_struct
*fsp
,SMB_OFF_T pos
);
4089 ssize_t
read_file(files_struct
*fsp
,char *data
,SMB_OFF_T pos
,size_t n
);
4090 ssize_t
write_file(files_struct
*fsp
,char *data
,size_t n
);
4091 void sys_sync_file(int fd
);
4093 /*The following definitions come from smbd/filename.c */
4095 void print_stat_cache_statistics(void);
4096 BOOL
unix_dfs_convert(char *name
,connection_struct
*conn
,
4097 char *saved_last_component
,
4098 BOOL
*bad_path
, SMB_STRUCT_STAT
*pst
);
4099 BOOL
unix_convert(char *name
,connection_struct
*conn
,
4100 char *saved_last_component
,
4101 BOOL
*bad_path
, SMB_STRUCT_STAT
*pst
);
4102 BOOL
check_name(char *name
,connection_struct
*conn
);
4104 /*The following definitions come from smbd/files.c */
4106 files_struct
*file_new(void );
4107 file_fd_struct
*fd_get_already_open(SMB_STRUCT_STAT
*sbuf
);
4108 file_fd_struct
*fd_get_new(void);
4109 void file_close_conn(connection_struct
*conn
);
4110 void file_init(void);
4111 void file_close_user(int vuid
);
4112 files_struct
*file_find_dit(SMB_DEV_T dev
, SMB_INO_T inode
, struct timeval
*tval
);
4113 files_struct
*file_find_di_first(SMB_DEV_T dev
, SMB_INO_T inode
);
4114 files_struct
*file_find_di_next(files_struct
*start_fsp
);
4115 files_struct
*file_find_print(void);
4116 void file_sync_all(connection_struct
*conn
);
4117 void fd_ptr_free(file_fd_struct
*fd_ptr
);
4118 void file_free(files_struct
*fsp
);
4119 files_struct
*file_fsp(char *buf
, int where
);
4120 void file_chain_reset(void);
4121 void file_chain_save(void);
4122 void file_chain_restore(void);
4124 /*The following definitions come from smbd/ipc.c */
4126 void send_trans_reply(char *outbuf
,
4129 uint16
*setup
, int lsetup
, int max_data_ret
,
4130 BOOL pipe_data_outstanding
);
4131 int reply_trans(connection_struct
*conn
, char *inbuf
,char *outbuf
, int size
, int bufsize
);
4133 /*The following definitions come from smbd/lanman.c */
4135 int api_reply(connection_struct
*conn
,uint16 vuid
,char *outbuf
,char *data
,char *params
,
4136 int tdscnt
,int tpscnt
,int mdrcnt
,int mprcnt
);
4138 /*The following definitions come from smbd/mangle.c */
4140 BOOL
is_mangled( char *s
);
4141 BOOL
is_8_3( char *fname
, BOOL check_case
);
4142 void reset_mangled_cache( void );
4143 BOOL
check_mangled_cache( char *s
);
4144 void mangle_name_83( char *s
);
4145 BOOL
name_map_mangle(char *OutName
, BOOL need83
, int snum
);
4147 /*The following definitions come from smbd/message.c */
4149 int reply_sends(connection_struct
*conn
,
4150 char *inbuf
,char *outbuf
, int dum_size
, int dum_buffsize
);
4151 int reply_sendstrt(connection_struct
*conn
,
4152 char *inbuf
,char *outbuf
, int dum_size
, int dum_buffsize
);
4153 int reply_sendtxt(connection_struct
*conn
,
4154 char *inbuf
,char *outbuf
, int dum_size
, int dum_buffsize
);
4155 int reply_sendend(connection_struct
*conn
,
4156 char *inbuf
,char *outbuf
, int dum_size
, int dum_buffsize
);
4158 /*The following definitions come from smbd/negprot.c */
4160 int reply_negprot(connection_struct
*conn
,
4161 char *inbuf
,char *outbuf
, int dum_size
,
4164 /*The following definitions come from smbd/noquotas.c */
4166 BOOL
disk_quotas(char *path
,SMB_BIG_UINT
*bsize
,SMB_BIG_UINT
*dfree
,SMB_BIG_UINT
*dsize
);
4168 /*The following definitions come from smbd/nttrans.c */
4170 void fail_next_srvsvc_open(void);
4171 int reply_ntcreate_and_X(connection_struct
*conn
,
4172 char *inbuf
,char *outbuf
,int length
,int bufsize
);
4173 int reply_ntcancel(connection_struct
*conn
,
4174 char *inbuf
,char *outbuf
,int length
,int bufsize
);
4175 int reply_nttranss(connection_struct
*conn
,
4176 char *inbuf
,char *outbuf
,int length
,int bufsize
);
4177 void remove_pending_change_notify_requests_by_fid(files_struct
*fsp
);
4178 void process_pending_change_notify_queue(time_t t
);
4179 int reply_nttrans(connection_struct
*conn
,
4180 char *inbuf
,char *outbuf
,int length
,int bufsize
);
4182 /*The following definitions come from smbd/open.c */
4184 void fd_add_to_uid_cache(file_fd_struct
*fd_ptr
, uid_t u
);
4185 uint16
fd_attempt_close(files_struct
*fsp
);
4186 void open_file_shared(files_struct
*fsp
, connection_struct
*conn
,
4187 char *fname
, int share_mode
, int ofun
,
4188 mode_t mode
, int oplock_request
, int *Access
,
4190 int open_directory(files_struct
*fsp
,connection_struct
*conn
,
4191 char *fname
, int smb_ofun
, mode_t unixmode
, int *action
);
4192 BOOL
check_file_sharing(connection_struct
*conn
,char *fname
, BOOL rename_op
);
4194 /*The following definitions come from smbd/oplock.c */
4196 BOOL
setup_kernel_oplock_pipe(void);
4197 BOOL
open_oplock_ipc(void);
4198 BOOL
receive_local_message(fd_set
*fds
, char *buffer
, int buffer_len
, int timeout
);
4199 BOOL
set_file_oplock(files_struct
*fsp
);
4200 int setup_oplock_select_set( fd_set
*fds
);
4201 BOOL
process_local_message(char *buffer
, int buf_size
);
4202 BOOL
request_oplock_break(share_mode_entry
*share_entry
,
4203 SMB_DEV_T dev
, SMB_INO_T inode
);
4204 BOOL
attempt_close_oplocked_file(files_struct
*fsp
);
4205 void check_kernel_oplocks(void);
4207 /*The following definitions come from smbd/password.c */
4209 void add_session_user(char *user
);
4210 BOOL
password_ok(const char *orig_user
, const char *domain
,
4211 const char *smb_apasswd
, int smb_apasslen
,
4212 const char *smb_ntpasswd
, int smb_ntpasslen
,
4214 NET_USER_INFO_3
*info3
);
4215 BOOL
authorise_login(int snum
, char *user
, char *domain
,
4216 char *password
, int pwlen
,
4217 BOOL
*guest
,BOOL
*force
,
4218 const vuser_key
*key
);
4219 BOOL
check_hosts_equiv(char *user
);
4221 /*The following definitions come from smbd/pipes.c */
4223 int reply_open_pipe_and_X(connection_struct
*conn
,
4224 char *inbuf
,char *outbuf
,int length
,int bufsize
);
4225 int reply_pipe_write(char *inbuf
,char *outbuf
,int length
,int bufsize
);
4226 int reply_pipe_write_and_X(char *inbuf
,char *outbuf
,int length
,int bufsize
);
4227 int reply_pipe_read_and_X(char *inbuf
,char *outbuf
,int length
,int bufsize
);
4228 int reply_pipe_close(connection_struct
*conn
, char *inbuf
,char *outbuf
);
4230 /*The following definitions come from smbd/predict.c */
4232 ssize_t
read_predict(files_struct
*fsp
, int fd
,SMB_OFF_T offset
,char *buf
,char **ptr
,size_t num
);
4233 void do_read_prediction(connection_struct
*conn
);
4234 void invalidate_read_prediction(int fd
);
4236 /*The following definitions come from smbd/process.c */
4238 BOOL
push_oplock_pending_smb_message(char *buf
, int msg_len
);
4239 BOOL
receive_next_smb(char *inbuf
, int bufsize
, int timeout
);
4240 void process_smb(char *inbuf
, char *outbuf
);
4241 char *smb_fn_name(int type
);
4242 void construct_reply_common(char *inbuf
,char *outbuf
);
4243 int chain_reply(char *inbuf
,char *outbuf
,int size
,int bufsize
);
4244 void smbd_process(void);
4246 /*The following definitions come from smbd/reply.c */
4248 int reply_special(char *inbuf
,char *outbuf
);
4249 int reply_tcon(connection_struct
*conn
,
4250 char *inbuf
,char *outbuf
, int dum_size
, int dum_buffsize
);
4251 int reply_tcon_and_X(connection_struct
*conn
, char *inbuf
,char *outbuf
,int length
,int bufsize
);
4252 int reply_unknown(char *inbuf
,char *outbuf
);
4253 int reply_ioctl(connection_struct
*conn
,
4254 char *inbuf
,char *outbuf
, int dum_size
, int dum_buffsize
);
4255 int reply_sesssetup_and_X(connection_struct
*conn
, char *inbuf
,char *outbuf
,int length
,int bufsize
);
4256 int reply_chkpth(connection_struct
*conn
, char *inbuf
,char *outbuf
, int dum_size
, int dum_buffsize
);
4257 int reply_getatr(connection_struct
*conn
, char *inbuf
,char *outbuf
, int dum_size
, int dum_buffsize
);
4258 int reply_setatr(connection_struct
*conn
, char *inbuf
,char *outbuf
, int dum_size
, int dum_buffsize
);
4259 int reply_dskattr(connection_struct
*conn
, char *inbuf
,char *outbuf
, int dum_size
, int dum_buffsize
);
4260 int reply_search(connection_struct
*conn
, char *inbuf
,char *outbuf
, int dum_size
, int dum_buffsize
);
4261 int reply_fclose(connection_struct
*conn
, char *inbuf
,char *outbuf
, int dum_size
, int dum_buffsize
);
4262 int reply_open(connection_struct
*conn
, char *inbuf
,char *outbuf
, int dum_size
, int dum_buffsize
);
4263 int reply_open_and_X(connection_struct
*conn
, char *inbuf
,char *outbuf
,int length
,int bufsize
);
4264 int reply_ulogoffX(connection_struct
*conn
, char *inbuf
,char *outbuf
,int length
,int bufsize
);
4265 int reply_mknew(connection_struct
*conn
, char *inbuf
,char *outbuf
, int dum_size
, int dum_buffsize
);
4266 int reply_ctemp(connection_struct
*conn
, char *inbuf
,char *outbuf
, int dum_size
, int dum_buffsize
);
4267 int reply_unlink(connection_struct
*conn
, char *inbuf
,char *outbuf
, int dum_size
, int dum_buffsize
);
4268 int reply_readbraw(connection_struct
*conn
, char *inbuf
, char *outbuf
, int dum_size
, int dum_buffsize
);
4269 int reply_lockread(connection_struct
*conn
, char *inbuf
,char *outbuf
, int length
, int dum_buffsiz
);
4270 int reply_read(connection_struct
*conn
, char *inbuf
,char *outbuf
, int dum_size
, int dum_buffsize
);
4271 int reply_read_and_X(connection_struct
*conn
, char *inbuf
,char *outbuf
,int length
,int bufsize
);
4272 int reply_writebraw(connection_struct
*conn
, char *inbuf
,char *outbuf
, int dum_size
, int dum_buffsize
);
4273 int reply_writeunlock(connection_struct
*conn
, char *inbuf
,char *outbuf
, int dum_size
, int dum_buffsize
);
4274 int reply_write(connection_struct
*conn
, char *inbuf
,char *outbuf
,int dum_size
,int dum_buffsize
);
4275 int reply_write_and_X(connection_struct
*conn
, char *inbuf
,char *outbuf
,int length
,int bufsize
);
4276 int reply_lseek(connection_struct
*conn
, char *inbuf
,char *outbuf
, int dum_size
, int dum_buffsize
);
4277 int reply_flush(connection_struct
*conn
, char *inbuf
,char *outbuf
, int dum_size
, int dum_buffsize
);
4278 int reply_exit(connection_struct
*conn
,
4279 char *inbuf
,char *outbuf
, int dum_size
, int dum_buffsize
);
4280 int reply_close(connection_struct
*conn
,
4281 char *inbuf
,char *outbuf
, int dum_size
, int dum_buffsize
);
4282 int reply_writeclose(connection_struct
*conn
,
4283 char *inbuf
,char *outbuf
, int dum_size
, int dum_buffsize
);
4284 int reply_lock(connection_struct
*conn
,
4285 char *inbuf
,char *outbuf
, int length
, int dum_buffsize
);
4286 int reply_unlock(connection_struct
*conn
, char *inbuf
,char *outbuf
, int dum_size
, int dum_buffsize
);
4287 int reply_tdis(connection_struct
*conn
,
4288 char *inbuf
,char *outbuf
, int dum_size
, int dum_buffsize
);
4289 int reply_echo(connection_struct
*conn
,
4290 char *inbuf
,char *outbuf
, int dum_size
, int dum_buffsize
);
4291 int reply_printopen(connection_struct
*conn
,
4292 char *inbuf
,char *outbuf
, int dum_size
, int dum_buffsize
);
4293 int reply_printclose(connection_struct
*conn
,
4294 char *inbuf
,char *outbuf
, int dum_size
, int dum_buffsize
);
4295 int reply_printqueue(connection_struct
*conn
,
4296 char *inbuf
,char *outbuf
, int dum_size
, int dum_buffsize
);
4297 int reply_printwrite(connection_struct
*conn
, char *inbuf
,char *outbuf
, int dum_size
, int dum_buffsize
);
4298 int reply_mkdir(connection_struct
*conn
, char *inbuf
,char *outbuf
, int dum_size
, int dum_buffsize
);
4299 int reply_rmdir(connection_struct
*conn
, char *inbuf
,char *outbuf
, int dum_size
, int dum_buffsize
);
4300 int rename_internals(connection_struct
*conn
,
4301 char *inbuf
, char *outbuf
, char *name
,
4302 char *newname
, BOOL replace_if_exists
);
4303 int reply_mv(connection_struct
*conn
, char *inbuf
,char *outbuf
, int dum_size
, int dum_buffsize
);
4304 int reply_copy(connection_struct
*conn
, char *inbuf
,char *outbuf
, int dum_size
, int dum_buffsize
);
4305 int reply_setdir(connection_struct
*conn
, char *inbuf
,char *outbuf
, int dum_size
, int dum_buffsize
);
4306 int reply_lockingX(connection_struct
*conn
, char *inbuf
,char *outbuf
,int length
,int bufsize
);
4307 int reply_readbmpx(connection_struct
*conn
, char *inbuf
,char *outbuf
,int length
,int bufsize
);
4308 int reply_writebmpx(connection_struct
*conn
, char *inbuf
,char *outbuf
, int dum_size
, int dum_buffsize
);
4309 int reply_writebs(connection_struct
*conn
, char *inbuf
,char *outbuf
, int dum_size
, int dum_buffsize
);
4310 int reply_setattrE(connection_struct
*conn
, char *inbuf
,char *outbuf
, int dum_size
, int dum_buffsize
);
4311 int reply_getattrE(connection_struct
*conn
, char *inbuf
,char *outbuf
, int dum_size
, int dum_buffsize
);
4313 /*The following definitions come from smbd/server.c */
4315 BOOL
reload_services(BOOL test
);
4316 void exit_server(char *reason
);
4318 /*The following definitions come from smbd/service.c */
4320 BOOL
become_service(connection_struct
*conn
,BOOL do_chdir
);
4321 int find_service(char *service
);
4322 connection_struct
*make_connection(char *service
,char *user
,
4324 char *password
, int pwlen
,
4325 char *dev
,uint16 vuid
, int *ecode
);
4326 void close_cnum(connection_struct
*conn
, uint16 vuid
);
4328 /*The following definitions come from smbd/ssl.c */
4330 int sslutil_init(int isServer
);
4331 int sslutil_accept(int fd
);
4332 int sslutil_fd_is_ssl(int fd
);
4333 int sslutil_connect(int fd
);
4334 int sslutil_disconnect(int fd
);
4335 int sslutil_negotiate_ssl(int fd
, int msg_type
);
4337 /*The following definitions come from smbd/trans2.c */
4339 void mask_convert( char *mask
);
4340 int reply_findclose(connection_struct
*conn
,
4341 char *inbuf
,char *outbuf
,int length
,int bufsize
);
4342 int reply_findnclose(connection_struct
*conn
,
4343 char *inbuf
,char *outbuf
,int length
,int bufsize
);
4344 int reply_transs2(connection_struct
*conn
,
4345 char *inbuf
,char *outbuf
,int length
,int bufsize
);
4346 int reply_trans2(connection_struct
*conn
,
4347 char *inbuf
,char *outbuf
,int length
,int bufsize
);
4349 /*The following definitions come from smbd/uid.c */
4351 BOOL
become_user(connection_struct
*conn
, uint16 vuid
);
4352 BOOL
become_userk(connection_struct
*conn
, const vuser_key
*key
);
4353 BOOL
unbecome_user(void );
4355 /*The following definitions come from smbd/vfs-wrap.c */
4357 int vfswrap_dummy_connect(struct vfs_connection_struct
*conn
, char *service
,
4359 void vfswrap_dummy_disconnect(void);
4360 SMB_BIG_UINT
vfswrap_disk_free(char *path
, SMB_BIG_UINT
*bsize
,
4361 SMB_BIG_UINT
*dfree
, SMB_BIG_UINT
*dsize
);
4362 DIR *vfswrap_opendir(char *fname
);
4363 struct dirent
*vfswrap_readdir(DIR *dirp
);
4364 int vfswrap_mkdir(char *path
, mode_t mode
);
4365 int vfswrap_rmdir(char *path
);
4366 int vfswrap_closedir(DIR *dirp
);
4367 int vfswrap_open(char *fname
, int flags
, mode_t mode
);
4368 int vfswrap_close(int fd
);
4369 ssize_t
vfswrap_read(int fd
, char *data
, size_t n
);
4370 ssize_t
vfswrap_write(int fd
, char *data
, size_t n
);
4371 SMB_OFF_T
vfswrap_lseek(int filedes
, SMB_OFF_T offset
, int whence
);
4372 int vfswrap_rename(char *old
, char *new);
4373 void vfswrap_sync_file(int fd
);
4374 int vfswrap_stat(char *fname
, SMB_STRUCT_STAT
*sbuf
);
4375 int vfswrap_fstat(int fd
, SMB_STRUCT_STAT
*sbuf
);
4376 int vfswrap_lstat(char *path
,
4377 SMB_STRUCT_STAT
*sbuf
);
4378 BOOL
vfswrap_fcntl_lock(int fd
, int op
, SMB_OFF_T offset
, SMB_OFF_T count
,
4380 int vfswrap_unlink(char *path
);
4381 int vfswrap_chmod(char *path
, mode_t mode
);
4382 int vfswrap_utime(char *path
, struct utimbuf
*times
);
4384 /*The following definitions come from smbd/vfs.c */
4386 int vfs_init_default(connection_struct
*conn
);
4387 BOOL
vfs_init_custom(connection_struct
*conn
);
4388 BOOL
vfs_file_exist(connection_struct
*conn
,char *fname
,SMB_STRUCT_STAT
*sbuf
);
4389 ssize_t
vfs_write_data(files_struct
*fsp
,char *buffer
,size_t N
);
4390 SMB_OFF_T
vfs_transfer_file(int in_fd
, files_struct
*in_fsp
,
4391 int out_fd
, files_struct
*out_fsp
,
4392 SMB_OFF_T n
, char *header
, int headlen
, int align
);
4393 char *vfs_readdirname(connection_struct
*conn
, void *p
);
4395 /*The following definitions come from smbwrapper/realcalls.c */
4397 int real_utime(const char *name
, struct utimbuf
*buf
);
4398 int real_utimes(const char *name
, struct timeval tv
[2]);
4400 /*The following definitions come from smbwrapper/shared.c */
4402 void smbw_setup_shared(void);
4403 char *smbw_getshared(const char *name
);
4404 void smbw_setshared(const char *name
, const char *val
);
4405 int smbw_setenv(const char *name
, const char *value
);
4406 int smbw_shared_fd(int fd
);
4408 /*The following definitions come from smbwrapper/smbw.c */
4410 void smbw_init(void);
4411 int smbw_fd(int fd
);
4412 int smbw_local_fd(int fd
);
4413 ino_t
smbw_inode(const char *name
);
4414 void clean_fname(char *name
);
4415 char *smbw_parse_path(const char *fname
, char *server
, char *share
, char *path
);
4416 int smbw_path(const char *path
);
4417 int smbw_errno(struct cli_state
*c
);
4418 struct smbw_server
*smbw_server(char *server
, char *share
);
4419 struct smbw_file
*smbw_file(int fd
);
4420 int smbw_open(const char *fname
, int flags
, mode_t mode
);
4421 ssize_t
smbw_pread(int fd
, void *buf
, size_t count
, off_t ofs
);
4422 ssize_t
smbw_read(int fd
, void *buf
, size_t count
);
4423 ssize_t
smbw_write(int fd
, void *buf
, size_t count
);
4424 ssize_t
smbw_pwrite(int fd
, void *buf
, size_t count
, off_t ofs
);
4425 int smbw_close(int fd
);
4426 int smbw_fcntl(int fd
, int cmd
, long arg
);
4427 int smbw_access(const char *name
, int mode
);
4428 int smbw_readlink(const char *path
, char *buf
, size_t bufsize
);
4429 int smbw_unlink(const char *fname
);
4430 int smbw_rename(const char *oldname
, const char *newname
);
4431 int smbw_utime(const char *fname
, void *buf
);
4432 int smbw_utimes(const char *fname
, void *buf
);
4433 int smbw_chown(const char *fname
, uid_t owner
, gid_t group
);
4434 int smbw_chmod(const char *fname
, mode_t newmode
);
4435 off_t
smbw_lseek(int fd
, off_t offset
, int whence
);
4436 int smbw_dup(int fd
);
4437 int smbw_dup2(int fd
, int fd2
);
4438 int smbw_fork(void);
4440 /*The following definitions come from smbwrapper/smbw_dir.c */
4442 struct smbw_dir
*smbw_dir(int fd
);
4443 int smbw_dirp(DIR *dirp
);
4444 int smbw_dir_open(const char *fname
);
4445 int smbw_dir_fstat(int fd
, struct stat
*st
);
4446 int smbw_dir_close(int fd
);
4447 int smbw_getdents(unsigned int fd
, struct dirent
*dirp
, int count
);
4448 int smbw_chdir(const char *name
);
4449 off_t
smbw_dir_lseek(int fd
, off_t offset
, int whence
);
4450 int smbw_mkdir(const char *fname
, mode_t mode
);
4451 int smbw_rmdir(const char *fname
);
4452 char *smbw_getcwd(char *buf
, size_t size
);
4453 int smbw_fchdir(unsigned int fd
);
4454 DIR *smbw_opendir(const char *fname
);
4455 struct dirent
*smbw_readdir(DIR *dirp
);
4456 int smbw_closedir(DIR *dirp
);
4457 void smbw_seekdir(DIR *dirp
, off_t offset
);
4458 off_t
smbw_telldir(DIR *dirp
);
4460 /*The following definitions come from smbwrapper/smbw_stat.c */
4462 void smbw_setup_stat(struct stat
*st
, char *fname
, size_t size
, int mode
);
4463 BOOL
smbw_getatr(struct smbw_server
*srv
, char *path
,
4464 uint16
*mode
, size_t *size
,
4465 time_t *c_time
, time_t *a_time
, time_t *m_time
,
4467 int smbw_stat_printjob(struct smbw_server
*srv
,char *path
,
4468 size_t *size
, time_t *m_time
);
4469 int smbw_fstat(int fd
, struct stat
*st
);
4470 int smbw_stat(const char *fname
, struct stat
*st
);
4472 /*The following definitions come from spoolssd/spoolssd.c */
4474 msrpc_service_fns
*get_service_fns(void);
4476 /*The following definitions come from spoolssd/srv_spoolss_nt.c */
4478 uint32
_spoolss_open_printer_ex( const UNISTR2
*printername
,
4480 uint32 unknown0
, uint32 cbbuf
,
4481 uint32 devmod
, uint32 access_required
,
4482 uint32 unknown1
, uint32 unknown2
,
4483 uint32 unknown3
, uint32 unknown4
,
4484 uint32 unknown5
, uint32 unknown6
,
4485 uint32 unknown7
, uint32 unknown8
,
4486 uint32 unknown9
, uint32 unknown10
,
4487 const UNISTR2
*station
, const UNISTR2
*username
,
4488 POLICY_HND
*handle
);
4489 uint32
_spoolss_closeprinter(POLICY_HND
*handle
);
4490 uint32
_spoolss_getprinterdata(const POLICY_HND
*handle
, UNISTR2
*valuename
,
4494 uint32
*numeric_data
,
4496 uint32
_spoolss_rffpcnex(const POLICY_HND
*handle
,
4497 uint32 flags
, uint32 options
,
4498 const UNISTR2
*localmachine
,
4499 uint32 printerlocal
,
4500 SPOOL_NOTIFY_OPTION
*option
);
4501 uint32
_spoolss_rfnpcnex( const POLICY_HND
*handle
,
4503 const SPOOL_NOTIFY_OPTION
*option
,
4505 SPOOL_NOTIFY_INFO
*info
);
4506 uint32
_spoolss_enumprinters(
4508 const UNISTR2
*servername
,
4510 const BUFFER
*buffer
,
4514 PRINTER_INFO_CTR
*ctr
,
4516 uint32
_spoolss_getprinter( POLICY_HND
*handle
,
4521 uint32
_spoolss_getprinterdriver2( const POLICY_HND
*handle
,
4522 const UNISTR2
*uni_arch
,
4527 uint32
_spoolss_startpageprinter(const POLICY_HND
*handle
);
4528 uint32
_spoolss_endpageprinter(const POLICY_HND
*handle
);
4529 uint32
_spoolss_startdocprinter( const POLICY_HND
*handle
, uint32 level
,
4530 DOC_INFO
*docinfo
, uint32
*jobid
);
4531 uint32
_spoolss_enddocprinter(const POLICY_HND
*handle
);
4532 uint32
_spoolss_writeprinter( const POLICY_HND
*handle
,
4534 const uint8
*buffer
,
4535 uint32
*buffer_written
);
4536 uint32
_spoolss_setprinter( const POLICY_HND
*handle
,
4538 const SPOOL_PRINTER_INFO_LEVEL
*info
,
4539 const DEVICEMODE
*devmode
,
4540 uint32 sec_buf_size
,
4541 const char *sec_buf
,
4543 uint32
_spoolss_fcpn( const POLICY_HND
*handle
);
4544 uint32
_spoolss_addjob( const POLICY_HND
*handle
, uint32 level
,
4545 const BUFFER
*buffer
,
4547 uint32
_spoolss_enumjobs( const POLICY_HND
*handle
,
4549 uint32 reqnumofjobs
,
4554 uint32
_spoolss_schedulejob( const POLICY_HND
*handle
, uint32 jobid
);
4555 uint32
_spoolss_setjob( const POLICY_HND
*handle
,
4560 uint32
_spoolss_enumprinterdrivers( const UNISTR2
*name
,
4561 const UNISTR2
*environment
,
4565 uint32
*numofdrivers
);
4566 uint32
_spoolss_enumforms( const POLICY_HND
*handle
,
4570 uint32
*numofforms
);
4571 uint32
_spoolss_enumports( const UNISTR2
*name
,
4575 uint32
*numofports
);
4576 uint32
_spoolss_addprinterex( const UNISTR2
*uni_srv_name
,
4578 const SPOOL_PRINTER_INFO_LEVEL
*info
,
4584 const SPOOL_USER_LEVEL
*user
,
4585 POLICY_HND
*handle
);
4586 uint32
_spoolss_addprinterdriver( const UNISTR2
*server_name
,
4588 const SPOOL_PRINTER_DRIVER_INFO_LEVEL
*info
);
4589 uint32
_spoolss_getprinterdriverdirectory( const UNISTR2
*name
,
4590 const UNISTR2
*uni_environment
,
4592 DRIVER_DIRECTORY_CTR
*ctr
,
4594 uint32
_spoolss_enumprinterdata(const POLICY_HND
*handle
,
4598 uint32
*realvaluesize
,
4602 uint32
*realdatasize
);
4603 uint32
_spoolss_setprinterdata( const POLICY_HND
*handle
,
4604 const UNISTR2
*value
,
4609 uint32 numeric_data
);
4610 uint32
_spoolss_addform( const POLICY_HND
*handle
,
4613 uint32
_spoolss_setform( const POLICY_HND
*handle
,
4614 const UNISTR2
*uni_name
,
4617 uint32
_spoolss_enumprintprocessors(const UNISTR2
*name
,
4618 const UNISTR2
*environment
,
4620 PRINTPROCESSOR_1
**info_1
,
4622 uint32
*numofprintprocessors
);
4623 uint32
_spoolss_enumprintmonitors( const UNISTR2
*name
,
4625 PRINTMONITOR_1
**info_1
,
4627 uint32
*numofprintmonitors
);
4628 uint32
_spoolss_getjob( const POLICY_HND
*handle
,
4634 /*The following definitions come from srvsvcd/srv_srvsvc_nt.c */
4636 uint32
_srv_net_remote_tod( UNISTR2
*srv_name
, TIME_OF_DAY_INFO
*tod
);
4637 uint32
_srv_net_srv_get_info( UNISTR2
*srv_name
, uint32 switch_value
,
4639 uint32
_srv_net_share_enum( const UNISTR2
*srv_name
,
4640 uint32 switch_value
, SRV_SHARE_INFO_CTR
*ctr
,
4641 uint32 preferred_len
, ENUM_HND
*enum_hnd
,
4642 uint32
*total_entries
, uint32 share_level
);
4643 uint32
_srv_net_sess_enum( const UNISTR2
*srv_name
,
4644 uint32 switch_value
, SRV_SESS_INFO_CTR
*ctr
,
4645 uint32 preferred_len
, ENUM_HND
*enum_hnd
,
4646 uint32
*total_entries
, uint32 sess_level
);
4647 uint32
_srv_net_conn_enum( const UNISTR2
*srv_name
,
4648 uint32 switch_value
, SRV_CONN_INFO_CTR
*ctr
,
4649 uint32 preferred_len
, ENUM_HND
*enum_hnd
,
4650 uint32
*total_entries
, uint32 conn_level
);
4651 uint32
_srv_net_file_enum( const UNISTR2
*srv_name
,
4652 uint32 switch_value
, SRV_FILE_INFO_CTR
*ctr
,
4653 uint32 preferred_len
, ENUM_HND
*enum_hnd
,
4654 uint32
*total_entries
, uint32 file_level
);
4656 /*The following definitions come from srvsvcd/srvsvcd.c */
4658 msrpc_service_fns
*get_service_fns(void);
4660 /*The following definitions come from svcctld/srv_svcctl_nt.c */
4662 uint32
_svc_close(POLICY_HND
*pol
);
4663 uint32
_svc_open_service(const POLICY_HND
*scman_pol
,
4664 const UNISTR2
* uni_svc_name
,
4667 uint32
_svc_stop_service(const POLICY_HND
*pol
,
4676 uint32
_svc_start_service(const POLICY_HND
*pol
,
4679 const UNISTR2
*argv
);
4680 uint32
_svc_open_sc_man(const UNISTR2
*uni_srv_name
,
4681 const UNISTR2
*uni_db_name
,
4684 uint32
_svc_enum_svcs_status(const POLICY_HND
*pol
,
4685 uint32 service_type
,
4686 uint32 service_state
,
4688 ENUM_HND
*resume_hnd
,
4689 ENUM_SRVC_STATUS
*svcs
,
4690 uint32
*more_buf_size
,
4692 uint32
_svc_query_disp_name(const POLICY_HND
*scman_pol
,
4693 const UNISTR2
*uni_svc_name
,
4695 UNISTR2
*uni_disp_name
,
4698 /*The following definitions come from svcctld/svcctld.c */
4700 msrpc_service_fns
*get_service_fns(void);
4702 /*The following definitions come from tdb/tdb.c */
4704 char *tdb_error(TDB_CONTEXT
*tdb
);
4705 int tdb_update(TDB_CONTEXT
*tdb
, TDB_DATA key
, TDB_DATA dbuf
);
4706 TDB_DATA
tdb_fetch(TDB_CONTEXT
*tdb
, TDB_DATA key
);
4707 int tdb_exists(TDB_CONTEXT
*tdb
, TDB_DATA key
);
4708 int tdb_traverse(TDB_CONTEXT
*tdb
, int (*fn
)(TDB_CONTEXT
*tdb
, TDB_DATA key
, TDB_DATA dbuf
, void* state
), void* state
);
4709 TDB_DATA
tdb_firstkey(TDB_CONTEXT
*tdb
);
4710 TDB_DATA
tdb_nextkey(TDB_CONTEXT
*tdb
, TDB_DATA key
);
4711 int tdb_delete(TDB_CONTEXT
*tdb
, TDB_DATA key
);
4712 int tdb_store(TDB_CONTEXT
*tdb
, TDB_DATA key
, TDB_DATA dbuf
, int flag
);
4713 TDB_CONTEXT
*tdb_open(char *name
, int hash_size
, int tdb_flags
,
4714 int open_flags
, mode_t mode
);
4715 int tdb_close(TDB_CONTEXT
*tdb
);
4716 int tdb_writelock(TDB_CONTEXT
*tdb
);
4717 int tdb_writeunlock(TDB_CONTEXT
*tdb
);
4718 int tdb_lockchain(TDB_CONTEXT
*tdb
, TDB_DATA key
);
4719 int tdb_unlockchain(TDB_CONTEXT
*tdb
, TDB_DATA key
);
4721 /*The following definitions come from utils/smbpasswd.c */
4723 int main(int argc
, char **argv
);
4725 /*The following definitions come from web/cgi.c */
4727 void cgi_load_variables(FILE *f1
);
4728 char *cgi_variable(char *name
);
4730 char *cgi_user_name(void);
4731 void cgi_setup(char *rootdir
, int auth_required
);
4732 char *cgi_baseurl(void);
4733 char *cgi_pathinfo(void);
4734 char *cgi_remote_host(void);
4735 char *cgi_remote_addr(void);
4736 BOOL
cgi_waspost(void);
4738 /*The following definitions come from web/diagnose.c */
4740 BOOL
nmbd_running(void);
4741 BOOL
smbd_running(void);
4743 /*The following definitions come from web/startstop.c */
4745 void start_smbd(void);
4746 void start_nmbd(void);
4747 void stop_smbd(void);
4748 void stop_nmbd(void);
4749 void kill_pid(pid_t pid
);
4751 /*The following definitions come from web/statuspage.c */
4753 void status_page(void);
4755 /*The following definitions come from web/swat.c */
4758 /*The following definitions come from winregd/winregd.c */
4760 msrpc_service_fns
*get_service_fns(void);
4762 /*The following definitions come from wkssvcd/srv_wkssvc_nt.c */
4764 uint32
_wks_query_info( const UNISTR2
*srv_name
, uint16 switch_value
,
4765 WKS_INFO_100
*wks100
);
4767 /*The following definitions come from wkssvcd/wkssvcd.c */
4769 msrpc_service_fns
*get_service_fns(void);
4770 #endif /* _PROTO_H_ */