s3-rpc_client: move rpc_cli_transport structs and protos to rpc_transport.h
[Samba/gbeck.git] / source3 / include / proto.h
blob77ad93d21f5d321cb123c1067f6826f86420ed2a
1 /*
2 * Unix SMB/CIFS implementation.
3 * collected prototypes header
5 * frozen from "make proto" in May 2008
7 * Copyright (C) Michael Adam 2008
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation; either version 3 of the License, or
12 * (at your option) any later version.
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
19 * You should have received a copy of the GNU General Public License
20 * along with this program; if not, see <http://www.gnu.org/licenses/>.
23 #ifndef _PROTO_H_
24 #define _PROTO_H_
26 /* The following definitions come from lib/access.c */
28 bool client_match(const char *tok, const void *item);
29 bool list_match(const char **list,const void *item,
30 bool (*match_fn)(const char *, const void *));
31 bool allow_access(const char **deny_list,
32 const char **allow_list,
33 const char *cname,
34 const char *caddr);
36 /* The following definitions come from lib/adt_tree.c */
39 /* The following definitions come from lib/afs.c */
41 char *afs_createtoken_str(const char *username, const char *cell);
42 bool afs_login(connection_struct *conn);
43 bool afs_login(connection_struct *conn);
44 char *afs_createtoken_str(const char *username, const char *cell);
46 /* The following definitions come from lib/afs_settoken.c */
48 int afs_syscall( int subcall,
49 char * path,
50 int cmd,
51 char * cmarg,
52 int follow);
53 bool afs_settoken_str(const char *token_string);
54 bool afs_settoken_str(const char *token_string);
56 /* The following definitions come from lib/audit.c */
58 const char *audit_category_str(uint32 category);
59 const char *audit_param_str(uint32 category);
60 const char *audit_description_str(uint32 category);
61 bool get_audit_category_from_param(const char *param, uint32 *audit_category);
62 const char *audit_policy_str(TALLOC_CTX *mem_ctx, uint32 policy);
64 /* The following definitions come from lib/bitmap.c */
66 struct bitmap *bitmap_talloc(TALLOC_CTX *mem_ctx, int n);
67 int bitmap_copy(struct bitmap * const dst, const struct bitmap * const src);
68 bool bitmap_set(struct bitmap *bm, unsigned i);
69 bool bitmap_clear(struct bitmap *bm, unsigned i);
70 bool bitmap_query(struct bitmap *bm, unsigned i);
71 int bitmap_find(struct bitmap *bm, unsigned ofs);
73 /* The following definitions come from lib/charcnv.c */
75 char lp_failed_convert_char(void);
76 void lazy_initialize_conv(void);
77 void gfree_charcnv(void);
78 void init_iconv(void);
79 size_t convert_string(charset_t from, charset_t to,
80 void const *src, size_t srclen,
81 void *dest, size_t destlen, bool allow_bad_conv);
82 size_t unix_strupper(const char *src, size_t srclen, char *dest, size_t destlen);
83 char *talloc_strdup_upper(TALLOC_CTX *ctx, const char *s);
84 char *strupper_talloc(TALLOC_CTX *ctx, const char *s);
85 size_t unix_strlower(const char *src, size_t srclen, char *dest, size_t destlen);
86 char *talloc_strdup_lower(TALLOC_CTX *ctx, const char *s);
87 char *strlower_talloc(TALLOC_CTX *ctx, const char *s);
88 size_t ucs2_align(const void *base_ptr, const void *p, int flags);
89 size_t push_ascii(void *dest, const char *src, size_t dest_len, int flags);
90 size_t push_ascii_fstring(void *dest, const char *src);
91 size_t push_ascii_nstring(void *dest, const char *src);
92 size_t pull_ascii(char *dest, const void *src, size_t dest_len, size_t src_len, int flags);
93 size_t pull_ascii_fstring(char *dest, const void *src);
94 size_t pull_ascii_nstring(char *dest, size_t dest_len, const void *src);
95 size_t push_ucs2(const void *base_ptr, void *dest, const char *src, size_t dest_len, int flags);
96 size_t push_utf8_fstring(void *dest, const char *src);
97 bool push_utf8_talloc(TALLOC_CTX *ctx, char **dest, const char *src,
98 size_t *converted_size);
99 size_t pull_ucs2(const void *base_ptr, char *dest, const void *src, size_t dest_len, size_t src_len, int flags);
100 size_t pull_ucs2_base_talloc(TALLOC_CTX *ctx,
101 const void *base_ptr,
102 char **ppdest,
103 const void *src,
104 size_t src_len,
105 int flags);
106 size_t pull_ucs2_fstring(char *dest, const void *src);
107 bool push_ucs2_talloc(TALLOC_CTX *ctx, smb_ucs2_t **dest, const char *src,
108 size_t *converted_size);
109 bool pull_utf8_talloc(TALLOC_CTX *ctx, char **dest, const char *src,
110 size_t *converted_size);
111 bool pull_ucs2_talloc(TALLOC_CTX *ctx, char **dest, const smb_ucs2_t *src,
112 size_t *converted_size);
113 bool pull_ascii_talloc(TALLOC_CTX *ctx, char **dest, const char *src,
114 size_t *converted_size);
115 size_t push_string_check_fn(const char *function, unsigned int line,
116 void *dest, const char *src,
117 size_t dest_len, int flags);
118 size_t push_string_base(const char *function, unsigned int line,
119 const char *base, uint16 flags2,
120 void *dest, const char *src,
121 size_t dest_len, int flags);
122 size_t pull_string_fn(const char *function,
123 unsigned int line,
124 const void *base_ptr,
125 uint16 smb_flags2,
126 char *dest,
127 const void *src,
128 size_t dest_len,
129 size_t src_len,
130 int flags);
131 size_t pull_string_talloc_fn(const char *function,
132 unsigned int line,
133 TALLOC_CTX *ctx,
134 const void *base_ptr,
135 uint16 smb_flags2,
136 char **ppdest,
137 const void *src,
138 size_t src_len,
139 int flags);
140 size_t align_string(const void *base_ptr, const char *p, int flags);
142 /* The following definitions come from lib/clobber.c */
144 void clobber_region(const char *fn, unsigned int line, char *dest, size_t len);
146 /* The following definitions come from lib/conn_tdb.c */
148 struct db_record *connections_fetch_entry(TALLOC_CTX *mem_ctx,
149 connection_struct *conn,
150 const char *name);
151 int connections_traverse(int (*fn)(struct db_record *rec,
152 void *private_data),
153 void *private_data);
154 int connections_forall(int (*fn)(struct db_record *rec,
155 const struct connections_key *key,
156 const struct connections_data *data,
157 void *private_data),
158 void *private_data);
159 int connections_forall_read(int (*fn)(const struct connections_key *key,
160 const struct connections_data *data,
161 void *private_data),
162 void *private_data);
163 bool connections_init(bool rw);
165 /* The following definitions come from lib/dmallocmsg.c */
167 void register_dmalloc_msgs(struct messaging_context *msg_ctx);
169 /* The following definitions come from lib/dprintf.c */
171 void display_set_stderr(void);
173 /* The following definitions come from lib/errmap_unix.c */
175 NTSTATUS map_nt_error_from_unix(int unix_error);
176 int map_errno_from_nt_status(NTSTATUS status);
178 /* The following definitions come from lib/fault.c */
179 void fault_setup(void (*fn)(void *));
180 void dump_core_setup(const char *progname);
182 /* The following definitions come from lib/file_id.c */
184 struct file_id vfs_file_id_from_sbuf(connection_struct *conn, const SMB_STRUCT_STAT *sbuf);
185 bool file_id_equal(const struct file_id *id1, const struct file_id *id2);
186 const char *file_id_string_tos(const struct file_id *id);
187 void push_file_id_16(char *buf, const struct file_id *id);
188 void push_file_id_24(char *buf, const struct file_id *id);
189 void pull_file_id_24(char *buf, struct file_id *id);
191 /* The following definitions come from lib/gencache.c */
193 bool gencache_set(const char *keystr, const char *value, time_t timeout);
194 bool gencache_del(const char *keystr);
195 bool gencache_get(const char *keystr, char **valstr, time_t *timeout);
196 bool gencache_parse(const char *keystr,
197 void (*parser)(time_t timeout, DATA_BLOB blob,
198 void *private_data),
199 void *private_data);
200 bool gencache_get_data_blob(const char *keystr, DATA_BLOB *blob,
201 time_t *timeout, bool *was_expired);
202 bool gencache_stabilize(void);
203 bool gencache_set_data_blob(const char *keystr, const DATA_BLOB *blob, time_t timeout);
204 void gencache_iterate_blobs(void (*fn)(const char *key, DATA_BLOB value,
205 time_t timeout, void *private_data),
206 void *private_data, const char *pattern);
207 void gencache_iterate(void (*fn)(const char* key, const char *value, time_t timeout, void* dptr),
208 void* data, const char* keystr_pattern);
210 /* The following definitions come from lib/interface.c */
212 bool ismyaddr(const struct sockaddr *ip);
213 bool ismyip_v4(struct in_addr ip);
214 bool is_local_net(const struct sockaddr *from);
215 void setup_linklocal_scope_id(struct sockaddr *pss);
216 bool is_local_net_v4(struct in_addr from);
217 int iface_count(void);
218 int iface_count_v4_nl(void);
219 const struct in_addr *first_ipv4_iface(void);
220 struct interface *get_interface(int n);
221 const struct sockaddr_storage *iface_n_sockaddr_storage(int n);
222 const struct in_addr *iface_n_ip_v4(int n);
223 const struct in_addr *iface_n_bcast_v4(int n);
224 const struct sockaddr_storage *iface_n_bcast(int n);
225 const struct sockaddr_storage *iface_ip(const struct sockaddr *ip);
226 bool iface_local(const struct sockaddr *ip);
227 void load_interfaces(void);
228 void gfree_interfaces(void);
229 bool interfaces_changed(void);
231 /* The following definitions come from lib/ldap_debug_handler.c */
233 void init_ldap_debugging(void);
235 /* The following definitions come from lib/ldap_escape.c */
237 char *escape_ldap_string(TALLOC_CTX *mem_ctx, const char *s);
238 char *escape_rdn_val_string_alloc(const char *s);
240 /* The following definitions come from lib/module.c */
242 NTSTATUS smb_load_module(const char *module_name);
243 int smb_load_modules(const char **modules);
244 NTSTATUS smb_probe_module(const char *subsystem, const char *module);
245 NTSTATUS smb_load_module(const char *module_name);
246 int smb_load_modules(const char **modules);
247 NTSTATUS smb_probe_module(const char *subsystem, const char *module);
248 void init_modules(void);
250 /* The following definitions come from lib/ms_fnmatch.c */
252 int ms_fnmatch(const char *pattern, const char *string, bool translate_pattern,
253 bool is_case_sensitive);
254 int gen_fnmatch(const char *pattern, const char *string);
256 /* The following definitions come from lib/pidfile.c */
258 pid_t pidfile_pid(const char *name);
259 void pidfile_create(const char *program_name);
260 void pidfile_unlink(void);
262 /* The following definitions come from lib/recvfile.c */
264 ssize_t sys_recvfile(int fromfd,
265 int tofd,
266 SMB_OFF_T offset,
267 size_t count);
268 ssize_t sys_recvfile(int fromfd,
269 int tofd,
270 SMB_OFF_T offset,
271 size_t count);
272 ssize_t drain_socket(int sockfd, size_t count);
274 /* The following definitions come from lib/secdesc.c */
276 uint32_t get_sec_info(const struct security_descriptor *sd);
277 struct security_descriptor *sec_desc_merge(TALLOC_CTX *ctx, struct security_descriptor *new_sdb, struct security_descriptor *old_sdb);
278 struct sec_desc_buf *sec_desc_merge_buf(TALLOC_CTX *ctx, struct sec_desc_buf *new_sdb, struct sec_desc_buf *old_sdb);
279 struct security_descriptor *make_sec_desc(TALLOC_CTX *ctx,
280 enum security_descriptor_revision revision,
281 uint16 type,
282 const struct dom_sid *owner_sid, const struct dom_sid *grp_sid,
283 struct security_acl *sacl, struct security_acl *dacl, size_t *sd_size);
284 struct security_descriptor *dup_sec_desc(TALLOC_CTX *ctx, const struct security_descriptor *src);
285 NTSTATUS marshall_sec_desc(TALLOC_CTX *mem_ctx,
286 struct security_descriptor *secdesc,
287 uint8 **data, size_t *len);
288 NTSTATUS marshall_sec_desc_buf(TALLOC_CTX *mem_ctx,
289 struct sec_desc_buf *secdesc_buf,
290 uint8_t **data, size_t *len);
291 NTSTATUS unmarshall_sec_desc(TALLOC_CTX *mem_ctx, uint8 *data, size_t len,
292 struct security_descriptor **psecdesc);
293 NTSTATUS unmarshall_sec_desc_buf(TALLOC_CTX *mem_ctx, uint8_t *data, size_t len,
294 struct sec_desc_buf **psecdesc_buf);
295 struct security_descriptor *make_standard_sec_desc(TALLOC_CTX *ctx, const struct dom_sid *owner_sid, const struct dom_sid *grp_sid,
296 struct security_acl *dacl, size_t *sd_size);
297 struct sec_desc_buf *make_sec_desc_buf(TALLOC_CTX *ctx, size_t len, struct security_descriptor *sec_desc);
298 struct sec_desc_buf *dup_sec_desc_buf(TALLOC_CTX *ctx, struct sec_desc_buf *src);
299 NTSTATUS sec_desc_add_sid(TALLOC_CTX *ctx, struct security_descriptor **psd, const struct dom_sid *sid, uint32 mask, size_t *sd_size);
300 NTSTATUS sec_desc_mod_sid(struct security_descriptor *sd, struct dom_sid *sid, uint32 mask);
301 NTSTATUS sec_desc_del_sid(TALLOC_CTX *ctx, struct security_descriptor **psd, struct dom_sid *sid, size_t *sd_size);
302 bool sd_has_inheritable_components(const struct security_descriptor *parent_ctr, bool container);
303 NTSTATUS se_create_child_secdesc(TALLOC_CTX *ctx,
304 struct security_descriptor **ppsd,
305 size_t *psize,
306 const struct security_descriptor *parent_ctr,
307 const struct dom_sid *owner_sid,
308 const struct dom_sid *group_sid,
309 bool container);
310 NTSTATUS se_create_child_secdesc_buf(TALLOC_CTX *ctx,
311 struct sec_desc_buf **ppsdb,
312 const struct security_descriptor *parent_ctr,
313 bool container);
315 /* The following definitions come from lib/sendfile.c */
317 ssize_t sys_sendfile(int tofd, int fromfd, const DATA_BLOB *header, SMB_OFF_T offset, size_t count);
319 /* The following definitions come from lib/server_mutex.c */
321 struct named_mutex *grab_named_mutex(TALLOC_CTX *mem_ctx, const char *name,
322 int timeout);
324 /* The following definitions come from lib/sharesec.c */
326 bool share_info_db_init(void);
327 struct security_descriptor *get_share_security_default( TALLOC_CTX *ctx, size_t *psize, uint32 def_access);
328 struct security_descriptor *get_share_security( TALLOC_CTX *ctx, const char *servicename,
329 size_t *psize);
330 bool set_share_security(const char *share_name, struct security_descriptor *psd);
331 bool delete_share_security(const char *servicename);
332 bool share_access_check(const struct security_token *token, const char *sharename,
333 uint32 desired_access);
334 bool parse_usershare_acl(TALLOC_CTX *ctx, const char *acl_str, struct security_descriptor **ppsd);
336 /* The following definitions come from lib/smbrun.c */
338 int smbrun_no_sanitize(const char *cmd, int *outfd);
339 int smbrun(const char *cmd, int *outfd);
340 int smbrunsecret(const char *cmd, const char *secret);
342 /* The following definitions come from lib/sock_exec.c */
344 int sock_exec(const char *prog);
346 /* The following definitions come from lib/substitute.c */
348 void free_local_machine_name(void);
349 bool set_local_machine_name(const char *local_name, bool perm);
350 const char *get_local_machine_name(void);
351 bool set_remote_machine_name(const char *remote_name, bool perm);
352 const char *get_remote_machine_name(void);
353 void sub_set_smb_name(const char *name);
354 void set_current_user_info(const char *smb_name, const char *unix_name,
355 const char *domain);
356 void sub_set_socket_ids(const char *peeraddr, const char *peername,
357 const char *sockaddr);
358 const char *get_current_username(void);
359 void standard_sub_basic(const char *smb_name, const char *domain_name,
360 char *str, size_t len);
361 char *talloc_sub_basic(TALLOC_CTX *mem_ctx, const char *smb_name,
362 const char *domain_name, const char *str);
363 char *talloc_sub_specified(TALLOC_CTX *mem_ctx,
364 const char *input_string,
365 const char *username,
366 const char *domain,
367 uid_t uid,
368 gid_t gid);
369 char *talloc_sub_advanced(TALLOC_CTX *mem_ctx,
370 const char *servicename, const char *user,
371 const char *connectpath, gid_t gid,
372 const char *smb_name, const char *domain_name,
373 const char *str);
374 void standard_sub_advanced(const char *servicename, const char *user,
375 const char *connectpath, gid_t gid,
376 const char *smb_name, const char *domain_name,
377 char *str, size_t len);
378 char *standard_sub_conn(TALLOC_CTX *ctx, connection_struct *conn, const char *str);
380 /* The following definitions come from lib/sysacls.c */
382 int sys_acl_get_entry(SMB_ACL_T acl_d, int entry_id, SMB_ACL_ENTRY_T *entry_p);
383 int sys_acl_get_tag_type(SMB_ACL_ENTRY_T entry_d, SMB_ACL_TAG_T *type_p);
384 int sys_acl_get_permset(SMB_ACL_ENTRY_T entry_d, SMB_ACL_PERMSET_T *permset_p);
385 void *sys_acl_get_qualifier(SMB_ACL_ENTRY_T entry_d);
386 int sys_acl_clear_perms(SMB_ACL_PERMSET_T permset_d);
387 int sys_acl_add_perm(SMB_ACL_PERMSET_T permset_d, SMB_ACL_PERM_T perm);
388 int sys_acl_get_perm(SMB_ACL_PERMSET_T permset_d, SMB_ACL_PERM_T perm);
389 char *sys_acl_to_text(SMB_ACL_T acl_d, ssize_t *len_p);
390 SMB_ACL_T sys_acl_init(int count);
391 int sys_acl_create_entry(SMB_ACL_T *acl_p, SMB_ACL_ENTRY_T *entry_p);
392 int sys_acl_set_tag_type(SMB_ACL_ENTRY_T entry_d, SMB_ACL_TAG_T tag_type);
393 int sys_acl_set_qualifier(SMB_ACL_ENTRY_T entry_d, void *qual_p);
394 int sys_acl_set_permset(SMB_ACL_ENTRY_T entry_d, SMB_ACL_PERMSET_T permset_d);
395 int sys_acl_free_text(char *text);
396 int sys_acl_free_acl(SMB_ACL_T acl_d) ;
397 int sys_acl_free_qualifier(void *qual, SMB_ACL_TAG_T tagtype);
398 int sys_acl_valid(SMB_ACL_T acl_d);
399 SMB_ACL_T sys_acl_get_file(vfs_handle_struct *handle,
400 const char *path_p, SMB_ACL_TYPE_T type);
401 SMB_ACL_T sys_acl_get_fd(vfs_handle_struct *handle, files_struct *fsp);
402 int sys_acl_set_file(vfs_handle_struct *handle,
403 const char *name, SMB_ACL_TYPE_T type, SMB_ACL_T acl_d);
404 int sys_acl_set_fd(vfs_handle_struct *handle, files_struct *fsp,
405 SMB_ACL_T acl_d);
406 int sys_acl_delete_def_file(vfs_handle_struct *handle,
407 const char *path);
408 SMB_ACL_T sys_acl_get_file(vfs_handle_struct *handle,
409 const char *path_p, SMB_ACL_TYPE_T type);
410 SMB_ACL_T sys_acl_get_fd(vfs_handle_struct *handle, files_struct *fsp);
411 int sys_acl_set_file(vfs_handle_struct *handle,
412 const char *name, SMB_ACL_TYPE_T type, SMB_ACL_T acl_d);
413 int sys_acl_set_fd(vfs_handle_struct *handle, files_struct *fsp,
414 SMB_ACL_T acl_d);
415 int sys_acl_delete_def_file(vfs_handle_struct *handle,
416 const char *path);
417 SMB_ACL_T sys_acl_get_file(vfs_handle_struct *handle,
418 const char *path_p, SMB_ACL_TYPE_T type);
419 SMB_ACL_T sys_acl_get_fd(vfs_handle_struct *handle, files_struct *fsp);
420 int sys_acl_set_file(vfs_handle_struct *handle,
421 const char *name, SMB_ACL_TYPE_T type, SMB_ACL_T acl_d);
422 int sys_acl_set_fd(vfs_handle_struct *handle, files_struct *fsp,
423 SMB_ACL_T acl_d);
424 int sys_acl_delete_def_file(vfs_handle_struct *handle,
425 const char *path);
426 SMB_ACL_T sys_acl_get_file(vfs_handle_struct *handle,
427 const char *path_p, SMB_ACL_TYPE_T type);
428 SMB_ACL_T sys_acl_get_fd(vfs_handle_struct *handle, files_struct *fsp);
429 int sys_acl_set_file(vfs_handle_struct *handle,
430 const char *name, SMB_ACL_TYPE_T type, SMB_ACL_T acl_d);
431 int sys_acl_set_fd(vfs_handle_struct *handle, files_struct *fsp,
432 SMB_ACL_T acl_d);
433 int sys_acl_delete_def_file(vfs_handle_struct *handle,
434 const char *path);
435 SMB_ACL_T sys_acl_get_file(vfs_handle_struct *handle,
436 const char *path_p, SMB_ACL_TYPE_T type);
437 SMB_ACL_T sys_acl_get_fd(vfs_handle_struct *handle, files_struct *fsp);
438 int sys_acl_set_file(vfs_handle_struct *handle,
439 const char *name, SMB_ACL_TYPE_T type, SMB_ACL_T acl_d);
440 int sys_acl_set_fd(vfs_handle_struct *handle, files_struct *fsp,
441 SMB_ACL_T acl_d);
442 int sys_acl_delete_def_file(vfs_handle_struct *handle,
443 const char *path);
444 SMB_ACL_T sys_acl_get_file(vfs_handle_struct *handle,
445 const char *path_p, SMB_ACL_TYPE_T type);
446 SMB_ACL_T sys_acl_get_fd(vfs_handle_struct *handle, files_struct *fsp);
447 int sys_acl_set_file(vfs_handle_struct *handle,
448 const char *name, SMB_ACL_TYPE_T type, SMB_ACL_T acl_d);
449 int sys_acl_set_fd(vfs_handle_struct *handle, files_struct *fsp,
450 SMB_ACL_T acl_d);
451 int sys_acl_delete_def_file(vfs_handle_struct *handle,
452 const char *path);
453 SMB_ACL_T sys_acl_get_file(vfs_handle_struct *handle,
454 const char *path_p, SMB_ACL_TYPE_T type);
455 SMB_ACL_T sys_acl_get_fd(vfs_handle_struct *handle, files_struct *fsp);
456 int sys_acl_set_file(vfs_handle_struct *handle,
457 const char *name, SMB_ACL_TYPE_T type, SMB_ACL_T acl_d);
458 int sys_acl_set_fd(vfs_handle_struct *handle, files_struct *fsp,
459 SMB_ACL_T acl_d);
460 int sys_acl_delete_def_file(vfs_handle_struct *handle,
461 const char *path);
462 int no_acl_syscall_error(int err);
464 /* The following definitions come from lib/sysquotas.c */
466 int sys_get_quota(const char *path, enum SMB_QUOTA_TYPE qtype, unid_t id, SMB_DISK_QUOTA *dp);
467 int sys_set_quota(const char *path, enum SMB_QUOTA_TYPE qtype, unid_t id, SMB_DISK_QUOTA *dp);
469 /* The following definitions come from lib/sysquotas_*.c */
471 int sys_get_vfs_quota(const char *path, const char *bdev, enum SMB_QUOTA_TYPE qtype, unid_t id, SMB_DISK_QUOTA *dp);
472 int sys_set_vfs_quota(const char *path, const char *bdev, enum SMB_QUOTA_TYPE qtype, unid_t id, SMB_DISK_QUOTA *dp);
474 int sys_get_xfs_quota(const char *path, const char *bdev, enum SMB_QUOTA_TYPE qtype, unid_t id, SMB_DISK_QUOTA *dp);
475 int sys_set_xfs_quota(const char *path, const char *bdev, enum SMB_QUOTA_TYPE qtype, unid_t id, SMB_DISK_QUOTA *dp);
477 int sys_get_nfs_quota(const char *path, const char *bdev,
478 enum SMB_QUOTA_TYPE qtype,
479 unid_t id, SMB_DISK_QUOTA *dp);
480 int sys_set_nfs_quota(const char *path, const char *bdev,
481 enum SMB_QUOTA_TYPE qtype,
482 unid_t id, SMB_DISK_QUOTA *dp);
484 /* The following definitions come from lib/system.c */
486 void *sys_memalign( size_t align, size_t size );
487 int sys_usleep(long usecs);
488 ssize_t sys_read(int fd, void *buf, size_t count);
489 ssize_t sys_write(int fd, const void *buf, size_t count);
490 ssize_t sys_writev(int fd, const struct iovec *iov, int iovcnt);
491 ssize_t sys_pread(int fd, void *buf, size_t count, SMB_OFF_T off);
492 ssize_t sys_pwrite(int fd, const void *buf, size_t count, SMB_OFF_T off);
493 ssize_t sys_send(int s, const void *msg, size_t len, int flags);
494 ssize_t sys_sendto(int s, const void *msg, size_t len, int flags, const struct sockaddr *to, socklen_t tolen);
495 ssize_t sys_recv(int fd, void *buf, size_t count, int flags);
496 ssize_t sys_recvfrom(int s, void *buf, size_t len, int flags, struct sockaddr *from, socklen_t *fromlen);
497 int sys_fcntl_ptr(int fd, int cmd, void *arg);
498 int sys_fcntl_long(int fd, int cmd, long arg);
499 void update_stat_ex_mtime(struct stat_ex *dst, struct timespec write_ts);
500 void update_stat_ex_create_time(struct stat_ex *dst, struct timespec create_time);
501 int sys_stat(const char *fname, SMB_STRUCT_STAT *sbuf,
502 bool fake_dir_create_times);
503 int sys_fstat(int fd, SMB_STRUCT_STAT *sbuf,
504 bool fake_dir_create_times);
505 int sys_lstat(const char *fname,SMB_STRUCT_STAT *sbuf,
506 bool fake_dir_create_times);
507 int sys_ftruncate(int fd, SMB_OFF_T offset);
508 int sys_posix_fallocate(int fd, SMB_OFF_T offset, SMB_OFF_T len);
509 int sys_fallocate(int fd, enum vfs_fallocate_mode mode, SMB_OFF_T offset, SMB_OFF_T len);
510 SMB_OFF_T sys_lseek(int fd, SMB_OFF_T offset, int whence);
511 int sys_fseek(FILE *fp, SMB_OFF_T offset, int whence);
512 SMB_OFF_T sys_ftell(FILE *fp);
513 int sys_creat(const char *path, mode_t mode);
514 int sys_open(const char *path, int oflag, mode_t mode);
515 FILE *sys_fopen(const char *path, const char *type);
516 void kernel_flock(int fd, uint32 share_mode, uint32 access_mask);
517 SMB_STRUCT_DIR *sys_opendir(const char *name);
518 SMB_STRUCT_DIR *sys_fdopendir(int fd);
519 SMB_STRUCT_DIRENT *sys_readdir(SMB_STRUCT_DIR *dirp);
520 void sys_seekdir(SMB_STRUCT_DIR *dirp, long offset);
521 long sys_telldir(SMB_STRUCT_DIR *dirp);
522 void sys_rewinddir(SMB_STRUCT_DIR *dirp);
523 int sys_closedir(SMB_STRUCT_DIR *dirp);
524 int sys_mknod(const char *path, mode_t mode, SMB_DEV_T dev);
525 int sys_waitpid(pid_t pid,int *status,int options);
526 char *sys_getwd(char *s);
527 void set_effective_capability(enum smbd_capability capability);
528 void drop_effective_capability(enum smbd_capability capability);
529 long sys_random(void);
530 void sys_srandom(unsigned int seed);
531 int groups_max(void);
532 int sys_getgroups(int setlen, gid_t *gidset);
533 int sys_setgroups(gid_t UNUSED(primary_gid), int setlen, gid_t *gidset);
534 int sys_popen(const char *command);
535 int sys_pclose(int fd);
536 ssize_t sys_getxattr (const char *path, const char *name, void *value, size_t size);
537 ssize_t sys_lgetxattr (const char *path, const char *name, void *value, size_t size);
538 ssize_t sys_fgetxattr (int filedes, const char *name, void *value, size_t size);
539 ssize_t sys_listxattr (const char *path, char *list, size_t size);
540 ssize_t sys_llistxattr (const char *path, char *list, size_t size);
541 ssize_t sys_flistxattr (int filedes, char *list, size_t size);
542 int sys_removexattr (const char *path, const char *name);
543 int sys_lremovexattr (const char *path, const char *name);
544 int sys_fremovexattr (int filedes, const char *name);
545 int sys_setxattr (const char *path, const char *name, const void *value, size_t size, int flags);
546 int sys_lsetxattr (const char *path, const char *name, const void *value, size_t size, int flags);
547 int sys_fsetxattr (int filedes, const char *name, const void *value, size_t size, int flags);
548 uint32 unix_dev_major(SMB_DEV_T dev);
549 uint32 unix_dev_minor(SMB_DEV_T dev);
550 int sys_aio_read(SMB_STRUCT_AIOCB *aiocb);
551 int sys_aio_write(SMB_STRUCT_AIOCB *aiocb);
552 ssize_t sys_aio_return(SMB_STRUCT_AIOCB *aiocb);
553 int sys_aio_cancel(int fd, SMB_STRUCT_AIOCB *aiocb);
554 int sys_aio_error(const SMB_STRUCT_AIOCB *aiocb);
555 int sys_aio_fsync(int op, SMB_STRUCT_AIOCB *aiocb);
556 int sys_aio_suspend(const SMB_STRUCT_AIOCB * const cblist[], int n, const struct timespec *timeout);
557 int sys_aio_read(SMB_STRUCT_AIOCB *aiocb);
558 int sys_aio_write(SMB_STRUCT_AIOCB *aiocb);
559 ssize_t sys_aio_return(SMB_STRUCT_AIOCB *aiocb);
560 int sys_aio_cancel(int fd, SMB_STRUCT_AIOCB *aiocb);
561 int sys_aio_error(const SMB_STRUCT_AIOCB *aiocb);
562 int sys_aio_fsync(int op, SMB_STRUCT_AIOCB *aiocb);
563 int sys_aio_suspend(const SMB_STRUCT_AIOCB * const cblist[], int n, const struct timespec *timeout);
564 int sys_getpeereid( int s, uid_t *uid);
565 int sys_getnameinfo(const struct sockaddr *psa,
566 socklen_t salen,
567 char *host,
568 size_t hostlen,
569 char *service,
570 size_t servlen,
571 int flags);
572 int sys_connect(int fd, const struct sockaddr * addr);
574 /* The following definitions come from lib/system_smbd.c */
576 bool getgroups_unix_user(TALLOC_CTX *mem_ctx, const char *user,
577 gid_t primary_gid,
578 gid_t **ret_groups, uint32_t *p_ngroups);
580 /* The following definitions come from lib/tallocmsg.c */
582 void register_msg_pool_usage(struct messaging_context *msg_ctx);
584 /* The following definitions come from lib/time.c */
586 void push_dos_date(uint8_t *buf, int offset, time_t unixdate, int zone_offset);
587 void push_dos_date2(uint8_t *buf,int offset,time_t unixdate, int zone_offset);
588 void push_dos_date3(uint8_t *buf,int offset,time_t unixdate, int zone_offset);
589 uint32_t convert_time_t_to_uint32_t(time_t t);
590 time_t convert_uint32_t_to_time_t(uint32_t u);
591 bool nt_time_is_zero(const NTTIME *nt);
592 time_t generalized_to_unix_time(const char *str);
593 int get_server_zone_offset(void);
594 int set_server_zone_offset(time_t t);
595 char *timeval_string(TALLOC_CTX *ctx, const struct timeval *tp, bool hires);
596 char *current_timestring(TALLOC_CTX *ctx, bool hires);
597 void srv_put_dos_date(char *buf,int offset,time_t unixdate);
598 void srv_put_dos_date2(char *buf,int offset, time_t unixdate);
599 void srv_put_dos_date3(char *buf,int offset,time_t unixdate);
600 void round_timespec(enum timestamp_set_resolution res, struct timespec *ts);
601 void put_long_date_timespec(enum timestamp_set_resolution res, char *p, struct timespec ts);
602 void put_long_date(char *p, time_t t);
603 void dos_filetime_timespec(struct timespec *tsp);
604 time_t make_unix_date(const void *date_ptr, int zone_offset);
605 time_t make_unix_date2(const void *date_ptr, int zone_offset);
606 time_t make_unix_date3(const void *date_ptr, int zone_offset);
607 time_t srv_make_unix_date(const void *date_ptr);
608 time_t srv_make_unix_date2(const void *date_ptr);
609 time_t srv_make_unix_date3(const void *date_ptr);
610 struct timespec convert_time_t_to_timespec(time_t t);
611 struct timespec convert_timeval_to_timespec(const struct timeval tv);
612 struct timeval convert_timespec_to_timeval(const struct timespec ts);
613 struct timespec timespec_current(void);
614 struct timespec timespec_min(const struct timespec *ts1,
615 const struct timespec *ts2);
616 int timespec_compare(const struct timespec *ts1, const struct timespec *ts2);
617 void round_timespec_to_sec(struct timespec *ts);
618 void round_timespec_to_usec(struct timespec *ts);
619 struct timespec interpret_long_date(const char *p);
620 void TimeInit(void);
621 void get_process_uptime(struct timeval *ret_time);
622 void get_startup_time(struct timeval *ret_time);
623 time_t nt_time_to_unix_abs(const NTTIME *nt);
624 time_t uint64s_nt_time_to_unix_abs(const uint64_t *src);
625 void unix_timespec_to_nt_time(NTTIME *nt, struct timespec ts);
626 void unix_to_nt_time_abs(NTTIME *nt, time_t t);
627 const char *time_to_asc(const time_t t);
628 const char *display_time(NTTIME nttime);
629 bool nt_time_is_set(const NTTIME *nt);
631 /* The following definitions come from lib/username.c */
633 void flush_pwnam_cache(void);
634 char *get_user_home_dir(TALLOC_CTX *mem_ctx, const char *user);
635 struct passwd *Get_Pwnam_alloc(TALLOC_CTX *mem_ctx, const char *user);
637 /* The following definitions come from lib/util_names.c */
638 void gfree_netbios_names(void);
639 bool set_global_myname(const char *myname);
640 const char *global_myname(void);
641 bool set_global_myworkgroup(const char *myworkgroup);
642 const char *lp_workgroup(void);
643 const char *get_global_sam_name(void);
645 /* The following definitions come from lib/util.c */
647 enum protocol_types get_Protocol(void);
648 void set_Protocol(enum protocol_types p);
649 bool all_zero(const uint8_t *ptr, size_t size);
650 bool set_global_scope(const char *scope);
651 const char *global_scope(void);
652 void gfree_names(void);
653 void gfree_all( void );
654 const char *my_netbios_names(int i);
655 bool set_netbios_aliases(const char **str_array);
656 bool init_names(void);
657 struct user_auth_info *user_auth_info_init(TALLOC_CTX *mem_ctx);
658 const char *get_cmdline_auth_info_username(const struct user_auth_info *auth_info);
659 void set_cmdline_auth_info_username(struct user_auth_info *auth_info,
660 const char *username);
661 const char *get_cmdline_auth_info_domain(const struct user_auth_info *auth_info);
662 void set_cmdline_auth_info_domain(struct user_auth_info *auth_info,
663 const char *domain);
664 void set_cmdline_auth_info_password(struct user_auth_info *auth_info,
665 const char *password);
666 const char *get_cmdline_auth_info_password(const struct user_auth_info *auth_info);
667 bool set_cmdline_auth_info_signing_state(struct user_auth_info *auth_info,
668 const char *arg);
669 int get_cmdline_auth_info_signing_state(const struct user_auth_info *auth_info);
670 void set_cmdline_auth_info_use_ccache(struct user_auth_info *auth_info,
671 bool b);
672 bool get_cmdline_auth_info_use_ccache(const struct user_auth_info *auth_info);
673 void set_cmdline_auth_info_use_kerberos(struct user_auth_info *auth_info,
674 bool b);
675 bool get_cmdline_auth_info_use_kerberos(const struct user_auth_info *auth_info);
676 void set_cmdline_auth_info_fallback_after_kerberos(struct user_auth_info *auth_info,
677 bool b);
678 bool get_cmdline_auth_info_fallback_after_kerberos(const struct user_auth_info *auth_info);
679 void set_cmdline_auth_info_use_krb5_ticket(struct user_auth_info *auth_info);
680 void set_cmdline_auth_info_smb_encrypt(struct user_auth_info *auth_info);
681 void set_cmdline_auth_info_use_machine_account(struct user_auth_info *auth_info);
682 bool get_cmdline_auth_info_got_pass(const struct user_auth_info *auth_info);
683 bool get_cmdline_auth_info_smb_encrypt(const struct user_auth_info *auth_info);
684 bool get_cmdline_auth_info_use_machine_account(const struct user_auth_info *auth_info);
685 struct user_auth_info *get_cmdline_auth_info_copy(TALLOC_CTX *mem_ctx,
686 const struct user_auth_info *info);
687 bool set_cmdline_auth_info_machine_account_creds(struct user_auth_info *auth_info);
688 void set_cmdline_auth_info_getpass(struct user_auth_info *auth_info);
689 bool file_exist_stat(const char *fname,SMB_STRUCT_STAT *sbuf,
690 bool fake_dir_create_times);
691 bool socket_exist(const char *fname);
692 uint64_t get_file_size_stat(const SMB_STRUCT_STAT *sbuf);
693 SMB_OFF_T get_file_size(char *file_name);
694 char *attrib_string(uint16 mode);
695 void show_msg(char *buf);
696 void smb_set_enclen(char *buf,int len,uint16 enc_ctx_num);
697 void smb_setlen(char *buf,int len);
698 int set_message_bcc(char *buf,int num_bytes);
699 ssize_t message_push_blob(uint8 **outbuf, DATA_BLOB blob);
700 char *unix_clean_name(TALLOC_CTX *ctx, const char *s);
701 char *clean_name(TALLOC_CTX *ctx, const char *s);
702 ssize_t write_data_at_offset(int fd, const char *buffer, size_t N, SMB_OFF_T pos);
703 int set_blocking(int fd, bool set);
704 NTSTATUS reinit_after_fork(struct messaging_context *msg_ctx,
705 struct event_context *ev_ctx,
706 struct server_id id,
707 bool parent_longlived);
708 void *malloc_(size_t size);
709 void *memalign_array(size_t el_size, size_t align, unsigned int count);
710 void *calloc_array(size_t size, size_t nmemb);
711 void *Realloc(void *p, size_t size, bool free_old_on_error);
712 void add_to_large_array(TALLOC_CTX *mem_ctx, size_t element_size,
713 void *element, void *_array, uint32 *num_elements,
714 ssize_t *array_size);
715 char *get_myname(TALLOC_CTX *ctx);
716 char *get_mydnsdomname(TALLOC_CTX *ctx);
717 int interpret_protocol(const char *str,int def);
718 char *automount_lookup(TALLOC_CTX *ctx, const char *user_name);
719 char *automount_lookup(TALLOC_CTX *ctx, const char *user_name);
720 bool process_exists(const struct server_id pid);
721 const char *uidtoname(uid_t uid);
722 char *gidtoname(gid_t gid);
723 uid_t nametouid(const char *name);
724 gid_t nametogid(const char *name);
725 void smb_panic(const char *const why);
726 void log_stack_trace(void);
727 const char *readdirname(SMB_STRUCT_DIR *p);
728 bool is_in_path(const char *name, name_compare_entry *namelist, bool case_sensitive);
729 void set_namearray(name_compare_entry **ppname_array, const char *namelist);
730 void free_namearray(name_compare_entry *name_array);
731 bool fcntl_lock(int fd, int op, SMB_OFF_T offset, SMB_OFF_T count, int type);
732 bool fcntl_getlock(int fd, SMB_OFF_T *poffset, SMB_OFF_T *pcount, int *ptype, pid_t *ppid);
733 bool is_myname(const char *s);
734 bool is_myworkgroup(const char *s);
735 void ra_lanman_string( const char *native_lanman );
736 const char *get_remote_arch_str(void);
737 void set_remote_arch(enum remote_arch_types type);
738 enum remote_arch_types get_remote_arch(void);
739 const char *tab_depth(int level, int depth);
740 int str_checksum(const char *s);
741 void zero_free(void *p, size_t size);
742 int set_maxfiles(int requested_max);
743 int smb_mkstemp(char *name_template);
744 void *smb_xmalloc_array(size_t size, unsigned int count);
745 char *myhostname(void);
746 char *lock_path(const char *name);
747 char *pid_path(const char *name);
748 char *lib_path(const char *name);
749 char *modules_path(const char *name);
750 char *data_path(const char *name);
751 char *state_path(const char *name);
752 char *cache_path(const char *name);
753 const char *shlib_ext(void);
754 bool parent_dirname(TALLOC_CTX *mem_ctx, const char *dir, char **parent,
755 const char **name);
756 bool ms_has_wild(const char *s);
757 bool ms_has_wild_w(const smb_ucs2_t *s);
758 bool mask_match(const char *string, const char *pattern, bool is_case_sensitive);
759 bool mask_match_search(const char *string, const char *pattern, bool is_case_sensitive);
760 bool mask_match_list(const char *string, char **list, int listLen, bool is_case_sensitive);
761 bool unix_wild_match(const char *pattern, const char *string);
762 bool name_to_fqdn(fstring fqdn, const char *name);
763 void *talloc_append_blob(TALLOC_CTX *mem_ctx, void *buf, DATA_BLOB blob);
764 uint32 map_share_mode_to_deny_mode(uint32 share_access, uint32 private_options);
765 pid_t procid_to_pid(const struct server_id *proc);
766 void set_my_vnn(uint32 vnn);
767 uint32 get_my_vnn(void);
768 void set_my_unique_id(uint64_t unique_id);
769 struct server_id pid_to_procid(pid_t pid);
770 struct server_id procid_self(void);
771 bool procid_equal(const struct server_id *p1, const struct server_id *p2);
772 bool cluster_id_equal(const struct server_id *id1,
773 const struct server_id *id2);
774 bool procid_is_me(const struct server_id *pid);
775 struct server_id interpret_pid(const char *pid_string);
776 char *procid_str(TALLOC_CTX *mem_ctx, const struct server_id *pid);
777 char *procid_str_static(const struct server_id *pid);
778 bool procid_valid(const struct server_id *pid);
779 bool procid_is_local(const struct server_id *pid);
780 bool trans_oob(uint32_t bufsize, uint32_t offset, uint32_t length);
781 bool is_offset_safe(const char *buf_base, size_t buf_len, char *ptr, size_t off);
782 char *get_safe_ptr(const char *buf_base, size_t buf_len, char *ptr, size_t off);
783 char *get_safe_str_ptr(const char *buf_base, size_t buf_len, char *ptr, size_t off);
784 int get_safe_SVAL(const char *buf_base, size_t buf_len, char *ptr, size_t off, int failval);
785 int get_safe_IVAL(const char *buf_base, size_t buf_len, char *ptr, size_t off, int failval);
786 void split_domain_user(TALLOC_CTX *mem_ctx,
787 const char *full_name,
788 char **domain,
789 char **user);
790 void *_talloc_zero_zeronull(const void *ctx, size_t size, const char *name);
791 void *_talloc_memdup_zeronull(const void *t, const void *p, size_t size, const char *name);
792 void *_talloc_array_zeronull(const void *ctx, size_t el_size, unsigned count, const char *name);
793 void *_talloc_zero_array_zeronull(const void *ctx, size_t el_size, unsigned count, const char *name);
794 void *talloc_zeronull(const void *context, size_t size, const char *name);
795 const char *strip_hostname(const char *s);
796 bool tevent_req_poll_ntstatus(struct tevent_req *req,
797 struct tevent_context *ev,
798 NTSTATUS *status);
799 bool any_nt_status_not_ok(NTSTATUS err1, NTSTATUS err2, NTSTATUS *result);
800 int timeval_to_msec(struct timeval t);
802 /* The following definitions come from lib/util_builtin.c */
804 bool lookup_builtin_rid(TALLOC_CTX *mem_ctx, uint32 rid, const char **name);
805 bool lookup_builtin_name(const char *name, uint32 *rid);
806 const char *builtin_domain_name(void);
807 bool sid_check_is_builtin(const struct dom_sid *sid);
808 bool sid_check_is_in_builtin(const struct dom_sid *sid);
810 /* The following definitions come from lib/util_file.c */
812 char **file_lines_pload(const char *syscmd, int *numlines);
813 void file_lines_free(char **lines);
815 /* The following definitions come from lib/util_nscd.c */
817 void smb_nscd_flush_user_cache(void);
818 void smb_nscd_flush_group_cache(void);
820 /* The following definitions come from lib/util_nttoken.c */
822 struct security_token *dup_nt_token(TALLOC_CTX *mem_ctx, const struct security_token *ptoken);
823 NTSTATUS merge_nt_token(TALLOC_CTX *mem_ctx,
824 const struct security_token *token_1,
825 const struct security_token *token_2,
826 struct security_token **token_out);
827 bool token_sid_in_ace(const struct security_token *token, const struct security_ace *ace);
829 /* The following definitions come from lib/util_sec.c */
831 void sec_init(void);
832 uid_t sec_initial_uid(void);
833 gid_t sec_initial_gid(void);
834 bool non_root_mode(void);
835 void gain_root_privilege(void);
836 void gain_root_group_privilege(void);
837 void set_effective_uid(uid_t uid);
838 void set_effective_gid(gid_t gid);
839 void save_re_uid(void);
840 void restore_re_uid_fromroot(void);
841 void restore_re_uid(void);
842 void save_re_gid(void);
843 void restore_re_gid(void);
844 int set_re_uid(void);
845 void become_user_permanently(uid_t uid, gid_t gid);
846 bool is_setuid_root(void) ;
848 /* The following definitions come from lib/util_sid.c */
850 char *sid_to_fstring(fstring sidstr_out, const struct dom_sid *sid);
851 char *sid_string_talloc(TALLOC_CTX *mem_ctx, const struct dom_sid *sid);
852 char *sid_string_dbg(const struct dom_sid *sid);
853 char *sid_string_tos(const struct dom_sid *sid);
854 bool sid_linearize(char *outbuf, size_t len, const struct dom_sid *sid);
855 bool non_mappable_sid(struct dom_sid *sid);
856 char *sid_binstring_hex(const struct dom_sid *sid);
857 struct netr_SamInfo3;
858 NTSTATUS sid_array_from_info3(TALLOC_CTX *mem_ctx,
859 const struct netr_SamInfo3 *info3,
860 struct dom_sid **user_sids,
861 uint32_t *num_user_sids,
862 bool include_user_group_rid,
863 bool skip_ressource_groups);
865 /* The following definitions come from lib/util_sock.c */
867 bool is_broadcast_addr(const struct sockaddr *pss);
868 bool is_loopback_ip_v4(struct in_addr ip);
869 bool is_loopback_addr(const struct sockaddr *pss);
870 bool is_zero_addr(const struct sockaddr_storage *pss);
871 void zero_ip_v4(struct in_addr *ip);
872 void in_addr_to_sockaddr_storage(struct sockaddr_storage *ss,
873 struct in_addr ip);
874 bool same_net(const struct sockaddr *ip1,
875 const struct sockaddr *ip2,
876 const struct sockaddr *mask);
877 bool sockaddr_equal(const struct sockaddr *ip1,
878 const struct sockaddr *ip2);
879 bool is_address_any(const struct sockaddr *psa);
880 uint16_t get_sockaddr_port(const struct sockaddr_storage *pss);
881 char *print_sockaddr(char *dest,
882 size_t destlen,
883 const struct sockaddr_storage *psa);
884 char *print_canonical_sockaddr(TALLOC_CTX *ctx,
885 const struct sockaddr_storage *pss);
886 const char *client_name(int fd);
887 int get_socket_port(int fd);
888 const char *client_addr(int fd, char *addr, size_t addrlen);
889 const char *client_socket_addr(int fd, char *addr, size_t addr_len);
890 int client_socket_port(int fd);
891 void set_smb_read_error(enum smb_read_errors *pre,
892 enum smb_read_errors newerr);
893 void cond_set_smb_read_error(enum smb_read_errors *pre,
894 enum smb_read_errors newerr);
895 bool is_a_socket(int fd);
896 void set_socket_options(int fd, const char *options);
897 ssize_t read_udp_v4_socket(int fd,
898 char *buf,
899 size_t len,
900 struct sockaddr_storage *psa);
901 NTSTATUS read_fd_with_timeout(int fd, char *buf,
902 size_t mincnt, size_t maxcnt,
903 unsigned int time_out,
904 size_t *size_ret);
905 NTSTATUS read_data(int fd, char *buffer, size_t N);
906 ssize_t write_data(int fd, const char *buffer, size_t N);
907 ssize_t write_data_iov(int fd, const struct iovec *orig_iov, int iovcnt);
908 bool send_keepalive(int client);
909 NTSTATUS read_smb_length_return_keepalive(int fd, char *inbuf,
910 unsigned int timeout,
911 size_t *len);
912 NTSTATUS receive_smb_raw(int fd,
913 char *buffer,
914 size_t buflen,
915 unsigned int timeout,
916 size_t maxlen,
917 size_t *p_len);
918 int open_socket_in(int type,
919 uint16_t port,
920 int dlevel,
921 const struct sockaddr_storage *psock,
922 bool rebind);
923 NTSTATUS open_socket_out(const struct sockaddr_storage *pss, uint16_t port,
924 int timeout, int *pfd);
925 struct tevent_req *open_socket_out_send(TALLOC_CTX *mem_ctx,
926 struct event_context *ev,
927 const struct sockaddr_storage *pss,
928 uint16_t port,
929 int timeout);
930 NTSTATUS open_socket_out_recv(struct tevent_req *req, int *pfd);
931 struct tevent_req *open_socket_out_defer_send(TALLOC_CTX *mem_ctx,
932 struct event_context *ev,
933 struct timeval wait_time,
934 const struct sockaddr_storage *pss,
935 uint16_t port,
936 int timeout);
937 NTSTATUS open_socket_out_defer_recv(struct tevent_req *req, int *pfd);
938 int open_udp_socket(const char *host, int port);
939 const char *get_peer_name(int fd, bool force_lookup);
940 const char *get_peer_addr(int fd, char *addr, size_t addr_len);
941 int create_pipe_sock(const char *socket_dir,
942 const char *socket_name,
943 mode_t dir_perms);
944 const char *get_mydnsfullname(void);
945 bool is_myname_or_ipaddr(const char *s);
946 struct tevent_req *getaddrinfo_send(TALLOC_CTX *mem_ctx,
947 struct tevent_context *ev,
948 struct fncall_context *ctx,
949 const char *node,
950 const char *service,
951 const struct addrinfo *hints);
952 int getaddrinfo_recv(struct tevent_req *req, struct addrinfo **res);
953 int poll_one_fd(int fd, int events, int timeout, int *revents);
954 int poll_intr_one_fd(int fd, int events, int timeout, int *revents);
955 struct tevent_req *tstream_read_packet_send(TALLOC_CTX *mem_ctx,
956 struct tevent_context *ev,
957 struct tstream_context *stream,
958 size_t initial,
959 ssize_t (*more)(uint8_t *buf,
960 size_t buflen,
961 void *private_data),
962 void *private_data);
963 ssize_t tstream_read_packet_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx,
964 uint8_t **pbuf, int *perrno);
966 /* The following definitions come from lib/util_str.c */
968 bool next_token(const char **ptr, char *buff, const char *sep, size_t bufsize);
969 int StrCaseCmp(const char *s, const char *t);
970 int StrnCaseCmp(const char *s, const char *t, size_t len);
971 bool strnequal(const char *s1,const char *s2,size_t n);
972 bool strcsequal(const char *s1,const char *s2);
973 void strnorm(char *s, int case_default);
974 bool strisnormal(const char *s, int case_default);
975 char *push_skip_string(char *buf);
976 char *skip_string(const char *base, size_t len, char *buf);
977 size_t str_charnum(const char *s);
978 size_t str_ascii_charnum(const char *s);
979 bool trim_char(char *s,char cfront,char cback);
980 bool strhasupper(const char *s);
981 bool strhaslower(const char *s);
982 char *safe_strcpy_fn(const char *fn,
983 int line,
984 char *dest,
985 const char *src,
986 size_t maxlength);
987 char *safe_strcat_fn(const char *fn,
988 int line,
989 char *dest,
990 const char *src,
991 size_t maxlength);
992 char *alpha_strcpy_fn(const char *fn,
993 int line,
994 char *dest,
995 const char *src,
996 const char *other_safe_chars,
997 size_t maxlength);
998 char *StrnCpy_fn(const char *fn, int line,char *dest,const char *src,size_t n);
999 bool in_list(const char *s, const char *list, bool casesensitive);
1000 void string_free(char **s);
1001 bool string_set(char **dest,const char *src);
1002 void string_sub2(char *s,const char *pattern, const char *insert, size_t len,
1003 bool remove_unsafe_characters, bool replace_once,
1004 bool allow_trailing_dollar);
1005 void string_sub_once(char *s, const char *pattern,
1006 const char *insert, size_t len);
1007 void string_sub(char *s,const char *pattern, const char *insert, size_t len);
1008 void fstring_sub(char *s,const char *pattern,const char *insert);
1009 char *realloc_string_sub2(char *string,
1010 const char *pattern,
1011 const char *insert,
1012 bool remove_unsafe_characters,
1013 bool allow_trailing_dollar);
1014 char *realloc_string_sub(char *string,
1015 const char *pattern,
1016 const char *insert);
1017 char *talloc_string_sub2(TALLOC_CTX *mem_ctx, const char *src,
1018 const char *pattern,
1019 const char *insert,
1020 bool remove_unsafe_characters,
1021 bool replace_once,
1022 bool allow_trailing_dollar);
1023 char *talloc_string_sub(TALLOC_CTX *mem_ctx,
1024 const char *src,
1025 const char *pattern,
1026 const char *insert);
1027 void all_string_sub(char *s,const char *pattern,const char *insert, size_t len);
1028 char *talloc_all_string_sub(TALLOC_CTX *ctx,
1029 const char *src,
1030 const char *pattern,
1031 const char *insert);
1032 char *octal_string(int i);
1033 char *string_truncate(char *s, unsigned int length);
1034 char *strchr_m(const char *src, char c);
1035 char *strrchr_m(const char *s, char c);
1036 char *strnrchr_m(const char *s, char c, unsigned int n);
1037 char *strstr_m(const char *src, const char *findstr);
1038 void strlower_m(char *s);
1039 void strupper_m(char *s);
1040 size_t strlen_m(const char *s);
1041 size_t strlen_m_term(const char *s);
1042 size_t strlen_m_term_null(const char *s);
1043 int fstr_sprintf(fstring s, const char *fmt, ...);
1044 bool str_list_sub_basic( char **list, const char *smb_name,
1045 const char *domain_name );
1046 bool str_list_substitute(char **list, const char *pattern, const char *insert);
1048 char *ipstr_list_make(char **ipstr_list,
1049 const struct ip_service *ip_list,
1050 int ip_count);
1051 int ipstr_list_parse(const char *ipstr_list, struct ip_service **ip_list);
1052 void ipstr_list_free(char* ipstr_list);
1053 DATA_BLOB base64_decode_data_blob(const char *s);
1054 void base64_decode_inplace(char *s);
1055 char *base64_encode_data_blob(TALLOC_CTX *mem_ctx, DATA_BLOB data);
1056 uint64_t STR_TO_SMB_BIG_UINT(const char *nptr, const char **entptr);
1057 SMB_OFF_T conv_str_size(const char * str);
1058 void string_append(char **left, const char *right);
1059 bool add_string_to_array(TALLOC_CTX *mem_ctx,
1060 const char *str, const char ***strings,
1061 int *num);
1062 void sprintf_append(TALLOC_CTX *mem_ctx, char **string, ssize_t *len,
1063 size_t *bufsize, const char *fmt, ...);
1064 int asprintf_strupper_m(char **strp, const char *fmt, ...);
1065 char *talloc_asprintf_strupper_m(TALLOC_CTX *t, const char *fmt, ...);
1066 char *talloc_asprintf_strlower_m(TALLOC_CTX *t, const char *fmt, ...);
1067 char *sstring_sub(const char *src, char front, char back);
1068 bool validate_net_name( const char *name,
1069 const char *invalid_chars,
1070 int max_len);
1071 char *escape_shell_string(const char *src);
1072 char **str_list_make_v3(TALLOC_CTX *mem_ctx, const char *string, const char *sep);
1073 char *sanitize_username(TALLOC_CTX *mem_ctx, const char *username);
1075 /* The following definitions come from lib/util_unistr.c */
1077 void gfree_case_tables(void);
1078 void load_case_tables(void);
1079 size_t dos_PutUniCode(char *dst,const char *src, size_t len, bool null_terminate);
1080 char *skip_unibuf(char *src, size_t len);
1081 int rpcstr_push(void *dest, const char *src, size_t dest_len, int flags);
1082 int rpcstr_push_talloc(TALLOC_CTX *ctx, smb_ucs2_t **dest, const char *src);
1083 bool isvalid83_w(smb_ucs2_t c);
1084 size_t strlen_w(const smb_ucs2_t *src);
1085 size_t strnlen_w(const smb_ucs2_t *src, size_t max);
1086 smb_ucs2_t *strchr_w(const smb_ucs2_t *s, smb_ucs2_t c);
1087 smb_ucs2_t *strchr_wa(const smb_ucs2_t *s, char c);
1088 smb_ucs2_t *strrchr_w(const smb_ucs2_t *s, smb_ucs2_t c);
1089 smb_ucs2_t *strnrchr_w(const smb_ucs2_t *s, smb_ucs2_t c, unsigned int n);
1090 smb_ucs2_t *strstr_w(const smb_ucs2_t *s, const smb_ucs2_t *ins);
1091 bool strlower_w(smb_ucs2_t *s);
1092 bool strupper_w(smb_ucs2_t *s);
1093 void strnorm_w(smb_ucs2_t *s, int case_default);
1094 int strcmp_w(const smb_ucs2_t *a, const smb_ucs2_t *b);
1095 int strncmp_w(const smb_ucs2_t *a, const smb_ucs2_t *b, size_t len);
1096 int strcasecmp_w(const smb_ucs2_t *a, const smb_ucs2_t *b);
1097 int strncasecmp_w(const smb_ucs2_t *a, const smb_ucs2_t *b, size_t len);
1098 bool strequal_w(const smb_ucs2_t *s1, const smb_ucs2_t *s2);
1099 bool strnequal_w(const smb_ucs2_t *s1,const smb_ucs2_t *s2,size_t n);
1100 smb_ucs2_t *strdup_w(const smb_ucs2_t *src);
1101 smb_ucs2_t *strndup_w(const smb_ucs2_t *src, size_t len);
1102 smb_ucs2_t *strncpy_w(smb_ucs2_t *dest, const smb_ucs2_t *src, const size_t max);
1103 smb_ucs2_t *strncat_w(smb_ucs2_t *dest, const smb_ucs2_t *src, const size_t max);
1104 smb_ucs2_t *strcat_w(smb_ucs2_t *dest, const smb_ucs2_t *src);
1105 void string_replace_w(smb_ucs2_t *s, smb_ucs2_t oldc, smb_ucs2_t newc);
1106 bool trim_string_w(smb_ucs2_t *s, const smb_ucs2_t *front,
1107 const smb_ucs2_t *back);
1108 int strcmp_wa(const smb_ucs2_t *a, const char *b);
1109 int strncmp_wa(const smb_ucs2_t *a, const char *b, size_t len);
1110 smb_ucs2_t *strpbrk_wa(const smb_ucs2_t *s, const char *p);
1111 smb_ucs2_t *strstr_wa(const smb_ucs2_t *s, const char *ins);
1112 int toupper_ascii(int c);
1113 int tolower_ascii(int c);
1114 int isupper_ascii(int c);
1115 int islower_ascii(int c);
1117 /* The following definitions come from lib/version.c */
1119 const char *samba_version_string(void);
1121 /* The following definitions come from lib/wins_srv.c */
1123 bool wins_srv_is_dead(struct in_addr wins_ip, struct in_addr src_ip);
1124 void wins_srv_alive(struct in_addr wins_ip, struct in_addr src_ip);
1125 void wins_srv_died(struct in_addr wins_ip, struct in_addr src_ip);
1126 unsigned wins_srv_count(void);
1127 char **wins_srv_tags(void);
1128 void wins_srv_tags_free(char **list);
1129 struct in_addr wins_srv_ip_tag(const char *tag, struct in_addr src_ip);
1130 unsigned wins_srv_count_tag(const char *tag);
1132 /* The following definitions come from libsmb/cliconnect.c */
1134 ADS_STATUS cli_session_setup_spnego(struct cli_state *cli, const char *user,
1135 const char *pass, const char *user_domain,
1136 const char * dest_realm);
1138 NTSTATUS cli_session_setup(struct cli_state *cli,
1139 const char *user,
1140 const char *pass, int passlen,
1141 const char *ntpass, int ntpasslen,
1142 const char *workgroup);
1143 struct tevent_req *cli_session_setup_guest_create(TALLOC_CTX *mem_ctx,
1144 struct event_context *ev,
1145 struct cli_state *cli,
1146 struct tevent_req **psmbreq);
1147 struct tevent_req *cli_session_setup_guest_send(TALLOC_CTX *mem_ctx,
1148 struct event_context *ev,
1149 struct cli_state *cli);
1150 NTSTATUS cli_session_setup_guest_recv(struct tevent_req *req);
1151 struct tevent_req *cli_ulogoff_send(TALLOC_CTX *mem_ctx,
1152 struct tevent_context *ev,
1153 struct cli_state *cli);
1154 NTSTATUS cli_ulogoff_recv(struct tevent_req *req);
1155 NTSTATUS cli_ulogoff(struct cli_state *cli);
1156 struct tevent_req *cli_tcon_andx_create(TALLOC_CTX *mem_ctx,
1157 struct event_context *ev,
1158 struct cli_state *cli,
1159 const char *share, const char *dev,
1160 const char *pass, int passlen,
1161 struct tevent_req **psmbreq);
1162 struct tevent_req *cli_tcon_andx_send(TALLOC_CTX *mem_ctx,
1163 struct event_context *ev,
1164 struct cli_state *cli,
1165 const char *share, const char *dev,
1166 const char *pass, int passlen);
1167 NTSTATUS cli_tcon_andx_recv(struct tevent_req *req);
1168 NTSTATUS cli_tcon_andx(struct cli_state *cli, const char *share,
1169 const char *dev, const char *pass, int passlen);
1170 struct tevent_req *cli_tdis_send(TALLOC_CTX *mem_ctx,
1171 struct tevent_context *ev,
1172 struct cli_state *cli);
1173 NTSTATUS cli_tdis_recv(struct tevent_req *req);
1174 NTSTATUS cli_tdis(struct cli_state *cli);
1175 NTSTATUS cli_negprot(struct cli_state *cli);
1176 struct tevent_req *cli_negprot_send(TALLOC_CTX *mem_ctx,
1177 struct event_context *ev,
1178 struct cli_state *cli);
1179 NTSTATUS cli_negprot_recv(struct tevent_req *req);
1180 bool cli_session_request(struct cli_state *cli,
1181 struct nmb_name *calling, struct nmb_name *called);
1182 NTSTATUS cli_connect(struct cli_state *cli,
1183 const char *host,
1184 struct sockaddr_storage *dest_ss);
1185 NTSTATUS cli_start_connection(struct cli_state **output_cli,
1186 const char *my_name,
1187 const char *dest_host,
1188 struct sockaddr_storage *dest_ss, int port,
1189 int signing_state, int flags);
1190 NTSTATUS cli_full_connection(struct cli_state **output_cli,
1191 const char *my_name,
1192 const char *dest_host,
1193 struct sockaddr_storage *dest_ss, int port,
1194 const char *service, const char *service_type,
1195 const char *user, const char *domain,
1196 const char *password, int flags,
1197 int signing_state);
1198 bool attempt_netbios_session_request(struct cli_state **ppcli, const char *srchost, const char *desthost,
1199 struct sockaddr_storage *pdest_ss);
1200 NTSTATUS cli_raw_tcon(struct cli_state *cli,
1201 const char *service, const char *pass, const char *dev,
1202 uint16 *max_xmit, uint16 *tid);
1203 struct cli_state *get_ipc_connect(char *server,
1204 struct sockaddr_storage *server_ss,
1205 const struct user_auth_info *user_info);
1206 struct cli_state *get_ipc_connect_master_ip(TALLOC_CTX *ctx,
1207 struct ip_service *mb_ip,
1208 const struct user_auth_info *user_info,
1209 char **pp_workgroup_out);
1210 struct cli_state *get_ipc_connect_master_ip_bcast(TALLOC_CTX *ctx,
1211 const struct user_auth_info *user_info,
1212 char **pp_workgroup_out);
1214 /* The following definitions come from libsmb/clidfs.c */
1216 NTSTATUS cli_cm_force_encryption(struct cli_state *c,
1217 const char *username,
1218 const char *password,
1219 const char *domain,
1220 const char *sharename);
1221 struct cli_state *cli_cm_open(TALLOC_CTX *ctx,
1222 struct cli_state *referring_cli,
1223 const char *server,
1224 const char *share,
1225 const struct user_auth_info *auth_info,
1226 bool show_hdr,
1227 bool force_encrypt,
1228 int max_protocol,
1229 int port,
1230 int name_type);
1231 void cli_cm_display(const struct cli_state *c);
1232 struct client_dfs_referral;
1233 NTSTATUS cli_dfs_get_referral(TALLOC_CTX *ctx,
1234 struct cli_state *cli,
1235 const char *path,
1236 struct client_dfs_referral **refs,
1237 size_t *num_refs,
1238 size_t *consumed);
1239 bool cli_resolve_path(TALLOC_CTX *ctx,
1240 const char *mountpt,
1241 const struct user_auth_info *dfs_auth_info,
1242 struct cli_state *rootcli,
1243 const char *path,
1244 struct cli_state **targetcli,
1245 char **pp_targetpath);
1247 bool cli_check_msdfs_proxy(TALLOC_CTX *ctx,
1248 struct cli_state *cli,
1249 const char *sharename,
1250 char **pp_newserver,
1251 char **pp_newshare,
1252 bool force_encrypt,
1253 const char *username,
1254 const char *password,
1255 const char *domain);
1257 /* The following definitions come from libsmb/clientgen.c */
1259 int cli_set_message(char *buf,int num_words,int num_bytes,bool zero);
1260 unsigned int cli_set_timeout(struct cli_state *cli, unsigned int timeout);
1261 void cli_set_port(struct cli_state *cli, int port);
1262 bool cli_state_seqnum_persistent(struct cli_state *cli,
1263 uint16_t mid);
1264 bool cli_state_seqnum_remove(struct cli_state *cli,
1265 uint16_t mid);
1266 bool cli_receive_smb(struct cli_state *cli);
1267 bool cli_send_smb(struct cli_state *cli);
1268 bool cli_send_smb_direct_writeX(struct cli_state *cli,
1269 const char *p,
1270 size_t extradata);
1271 void cli_setup_packet_buf(struct cli_state *cli, char *buf);
1272 void cli_setup_packet(struct cli_state *cli);
1273 void cli_setup_bcc(struct cli_state *cli, void *p);
1274 NTSTATUS cli_set_domain(struct cli_state *cli, const char *domain);
1275 NTSTATUS cli_set_username(struct cli_state *cli, const char *username);
1276 NTSTATUS cli_set_password(struct cli_state *cli, const char *password);
1277 NTSTATUS cli_init_creds(struct cli_state *cli, const char *username, const char *domain, const char *password);
1278 struct cli_state *cli_initialise(void);
1279 struct cli_state *cli_initialise_ex(int signing_state);
1280 void cli_nt_pipes_close(struct cli_state *cli);
1281 void cli_shutdown(struct cli_state *cli);
1282 void cli_sockopt(struct cli_state *cli, const char *options);
1283 uint16 cli_setpid(struct cli_state *cli, uint16 pid);
1284 bool cli_set_case_sensitive(struct cli_state *cli, bool case_sensitive);
1285 struct tevent_req *cli_echo_send(TALLOC_CTX *mem_ctx, struct event_context *ev,
1286 struct cli_state *cli, uint16_t num_echos,
1287 DATA_BLOB data);
1288 NTSTATUS cli_echo_recv(struct tevent_req *req);
1289 NTSTATUS cli_echo(struct cli_state *cli, uint16_t num_echos, DATA_BLOB data);
1290 bool cli_ucs2(struct cli_state *cli);
1291 bool is_andx_req(uint8_t cmd);
1292 NTSTATUS cli_smb(TALLOC_CTX *mem_ctx, struct cli_state *cli,
1293 uint8_t smb_command, uint8_t additional_flags,
1294 uint8_t wct, uint16_t *vwv,
1295 uint32_t num_bytes, const uint8_t *bytes,
1296 struct tevent_req **result_parent,
1297 uint8_t min_wct, uint8_t *pwct, uint16_t **pvwv,
1298 uint32_t *pnum_bytes, uint8_t **pbytes);
1300 /* The following definitions come from libsmb/clierror.c */
1302 const char *cli_errstr(struct cli_state *cli);
1303 NTSTATUS cli_nt_error(struct cli_state *cli);
1304 void cli_dos_error(struct cli_state *cli, uint8 *eclass, uint32 *ecode);
1305 int cli_errno(struct cli_state *cli);
1306 bool cli_is_error(struct cli_state *cli);
1307 bool cli_is_nt_error(struct cli_state *cli);
1308 bool cli_is_dos_error(struct cli_state *cli);
1309 NTSTATUS cli_get_nt_error(struct cli_state *cli);
1310 void cli_set_nt_error(struct cli_state *cli, NTSTATUS status);
1311 void cli_reset_error(struct cli_state *cli);
1312 bool cli_state_is_connected(struct cli_state *cli);
1314 /* The following definitions come from libsmb/clifile.c */
1316 struct tevent_req *cli_setpathinfo_send(TALLOC_CTX *mem_ctx,
1317 struct tevent_context *ev,
1318 struct cli_state *cli,
1319 uint16_t level,
1320 const char *path,
1321 uint8_t *data,
1322 size_t data_len);
1323 NTSTATUS cli_setpathinfo_recv(struct tevent_req *req);
1324 NTSTATUS cli_setpathinfo(struct cli_state *cli,
1325 uint16_t level,
1326 const char *path,
1327 uint8_t *data,
1328 size_t data_len);
1330 struct tevent_req *cli_posix_symlink_send(TALLOC_CTX *mem_ctx,
1331 struct event_context *ev,
1332 struct cli_state *cli,
1333 const char *oldname,
1334 const char *newname);
1335 NTSTATUS cli_posix_symlink_recv(struct tevent_req *req);
1336 NTSTATUS cli_posix_symlink(struct cli_state *cli,
1337 const char *oldname,
1338 const char *newname);
1339 struct tevent_req *cli_posix_readlink_send(TALLOC_CTX *mem_ctx,
1340 struct event_context *ev,
1341 struct cli_state *cli,
1342 const char *fname,
1343 size_t len);
1344 NTSTATUS cli_posix_readlink_recv(struct tevent_req *req, struct cli_state *cli,
1345 char *retpath, size_t len);
1346 NTSTATUS cli_posix_readlink(struct cli_state *cli, const char *fname,
1347 char *linkpath, size_t len);
1348 struct tevent_req *cli_posix_hardlink_send(TALLOC_CTX *mem_ctx,
1349 struct event_context *ev,
1350 struct cli_state *cli,
1351 const char *oldname,
1352 const char *newname);
1353 NTSTATUS cli_posix_hardlink_recv(struct tevent_req *req);
1354 NTSTATUS cli_posix_hardlink(struct cli_state *cli,
1355 const char *oldname,
1356 const char *newname);
1357 uint32_t unix_perms_to_wire(mode_t perms);
1358 mode_t wire_perms_to_unix(uint32_t perms);
1359 struct tevent_req *cli_posix_getfacl_send(TALLOC_CTX *mem_ctx,
1360 struct event_context *ev,
1361 struct cli_state *cli,
1362 const char *fname);
1363 NTSTATUS cli_posix_getfacl_recv(struct tevent_req *req,
1364 TALLOC_CTX *mem_ctx,
1365 size_t *prb_size,
1366 char **retbuf);
1367 NTSTATUS cli_posix_getfacl(struct cli_state *cli,
1368 const char *fname,
1369 TALLOC_CTX *mem_ctx,
1370 size_t *prb_size,
1371 char **retbuf);
1372 struct tevent_req *cli_posix_stat_send(TALLOC_CTX *mem_ctx,
1373 struct event_context *ev,
1374 struct cli_state *cli,
1375 const char *fname);
1376 NTSTATUS cli_posix_stat_recv(struct tevent_req *req,
1377 SMB_STRUCT_STAT *sbuf);
1378 NTSTATUS cli_posix_stat(struct cli_state *cli,
1379 const char *fname,
1380 SMB_STRUCT_STAT *sbuf);
1381 struct tevent_req *cli_posix_chmod_send(TALLOC_CTX *mem_ctx,
1382 struct event_context *ev,
1383 struct cli_state *cli,
1384 const char *fname,
1385 mode_t mode);
1386 NTSTATUS cli_posix_chmod_recv(struct tevent_req *req);
1387 NTSTATUS cli_posix_chmod(struct cli_state *cli, const char *fname, mode_t mode);
1388 struct tevent_req *cli_posix_chown_send(TALLOC_CTX *mem_ctx,
1389 struct event_context *ev,
1390 struct cli_state *cli,
1391 const char *fname,
1392 uid_t uid,
1393 gid_t gid);
1394 NTSTATUS cli_posix_chown_recv(struct tevent_req *req);
1395 NTSTATUS cli_posix_chown(struct cli_state *cli,
1396 const char *fname,
1397 uid_t uid,
1398 gid_t gid);
1399 struct tevent_req *cli_rename_send(TALLOC_CTX *mem_ctx,
1400 struct event_context *ev,
1401 struct cli_state *cli,
1402 const char *fname_src,
1403 const char *fname_dst);
1404 NTSTATUS cli_rename_recv(struct tevent_req *req);
1405 NTSTATUS cli_rename(struct cli_state *cli, const char *fname_src, const char *fname_dst);
1406 struct tevent_req *cli_ntrename_send(TALLOC_CTX *mem_ctx,
1407 struct event_context *ev,
1408 struct cli_state *cli,
1409 const char *fname_src,
1410 const char *fname_dst);
1411 NTSTATUS cli_ntrename_recv(struct tevent_req *req);
1412 NTSTATUS cli_ntrename(struct cli_state *cli, const char *fname_src, const char *fname_dst);
1414 struct tevent_req *cli_nt_hardlink_send(TALLOC_CTX *mem_ctx,
1415 struct event_context *ev,
1416 struct cli_state *cli,
1417 const char *fname_src,
1418 const char *fname_dst);
1419 NTSTATUS cli_nt_hardlink_recv(struct tevent_req *req);
1420 NTSTATUS cli_nt_hardlink(struct cli_state *cli, const char *fname_src, const char *fname_dst);
1422 struct tevent_req *cli_unlink_send(TALLOC_CTX *mem_ctx,
1423 struct event_context *ev,
1424 struct cli_state *cli,
1425 const char *fname,
1426 uint16_t mayhave_attrs);
1427 NTSTATUS cli_unlink_recv(struct tevent_req *req);
1428 NTSTATUS cli_unlink(struct cli_state *cli, const char *fname, uint16_t mayhave_attrs);
1430 struct tevent_req *cli_mkdir_send(TALLOC_CTX *mem_ctx,
1431 struct event_context *ev,
1432 struct cli_state *cli,
1433 const char *dname);
1434 NTSTATUS cli_mkdir_recv(struct tevent_req *req);
1435 NTSTATUS cli_mkdir(struct cli_state *cli, const char *dname);
1436 struct tevent_req *cli_rmdir_send(TALLOC_CTX *mem_ctx,
1437 struct event_context *ev,
1438 struct cli_state *cli,
1439 const char *dname);
1440 NTSTATUS cli_rmdir_recv(struct tevent_req *req);
1441 NTSTATUS cli_rmdir(struct cli_state *cli, const char *dname);
1442 struct tevent_req *cli_nt_delete_on_close_send(TALLOC_CTX *mem_ctx,
1443 struct event_context *ev,
1444 struct cli_state *cli,
1445 uint16_t fnum,
1446 bool flag);
1447 NTSTATUS cli_nt_delete_on_close_recv(struct tevent_req *req);
1448 NTSTATUS cli_nt_delete_on_close(struct cli_state *cli, uint16_t fnum, bool flag);
1449 struct tevent_req *cli_ntcreate_send(TALLOC_CTX *mem_ctx,
1450 struct event_context *ev,
1451 struct cli_state *cli,
1452 const char *fname,
1453 uint32_t CreatFlags,
1454 uint32_t DesiredAccess,
1455 uint32_t FileAttributes,
1456 uint32_t ShareAccess,
1457 uint32_t CreateDisposition,
1458 uint32_t CreateOptions,
1459 uint8_t SecurityFlags);
1460 NTSTATUS cli_ntcreate_recv(struct tevent_req *req, uint16_t *pfnum);
1461 NTSTATUS cli_ntcreate(struct cli_state *cli,
1462 const char *fname,
1463 uint32_t CreatFlags,
1464 uint32_t DesiredAccess,
1465 uint32_t FileAttributes,
1466 uint32_t ShareAccess,
1467 uint32_t CreateDisposition,
1468 uint32_t CreateOptions,
1469 uint8_t SecurityFlags,
1470 uint16_t *pfid);
1471 uint8_t *smb_bytes_push_str(uint8_t *buf, bool ucs2, const char *str,
1472 size_t str_len, size_t *pconverted_size);
1473 uint8_t *smb_bytes_push_bytes(uint8_t *buf, uint8_t prefix,
1474 const uint8_t *bytes, size_t num_bytes);
1475 struct tevent_req *cli_open_create(TALLOC_CTX *mem_ctx,
1476 struct event_context *ev,
1477 struct cli_state *cli, const char *fname,
1478 int flags, int share_mode,
1479 struct tevent_req **psmbreq);
1480 struct tevent_req *cli_open_send(TALLOC_CTX *mem_ctx, struct event_context *ev,
1481 struct cli_state *cli, const char *fname,
1482 int flags, int share_mode);
1483 NTSTATUS cli_open_recv(struct tevent_req *req, uint16_t *fnum);
1484 NTSTATUS cli_open(struct cli_state *cli, const char *fname, int flags, int share_mode, uint16_t *pfnum);
1485 struct tevent_req *cli_close_create(TALLOC_CTX *mem_ctx,
1486 struct event_context *ev,
1487 struct cli_state *cli, uint16_t fnum,
1488 struct tevent_req **psubreq);
1489 struct tevent_req *cli_close_send(TALLOC_CTX *mem_ctx,
1490 struct event_context *ev,
1491 struct cli_state *cli, uint16_t fnum);
1492 NTSTATUS cli_close_recv(struct tevent_req *req);
1493 NTSTATUS cli_close(struct cli_state *cli, uint16_t fnum);
1494 struct tevent_req *cli_ftruncate_send(TALLOC_CTX *mem_ctx,
1495 struct event_context *ev,
1496 struct cli_state *cli,
1497 uint16_t fnum,
1498 uint64_t size);
1499 NTSTATUS cli_ftruncate_recv(struct tevent_req *req);
1500 NTSTATUS cli_ftruncate(struct cli_state *cli, uint16_t fnum, uint64_t size);
1501 NTSTATUS cli_locktype(struct cli_state *cli, uint16_t fnum,
1502 uint32_t offset, uint32_t len,
1503 int timeout, unsigned char locktype);
1504 bool cli_lock(struct cli_state *cli, uint16_t fnum,
1505 uint32_t offset, uint32_t len, int timeout, enum brl_type lock_type);
1506 struct tevent_req *cli_unlock_send(TALLOC_CTX *mem_ctx,
1507 struct event_context *ev,
1508 struct cli_state *cli,
1509 uint16_t fnum,
1510 uint64_t offset,
1511 uint64_t len);
1512 NTSTATUS cli_unlock_recv(struct tevent_req *req);
1513 NTSTATUS cli_unlock(struct cli_state *cli, uint16_t fnum, uint32_t offset, uint32_t len);
1514 bool cli_lock64(struct cli_state *cli, uint16_t fnum,
1515 uint64_t offset, uint64_t len, int timeout, enum brl_type lock_type);
1516 struct tevent_req *cli_unlock64_send(TALLOC_CTX *mem_ctx,
1517 struct event_context *ev,
1518 struct cli_state *cli,
1519 uint16_t fnum,
1520 uint64_t offset,
1521 uint64_t len);
1522 NTSTATUS cli_unlock64_recv(struct tevent_req *req);
1523 NTSTATUS cli_unlock64(struct cli_state *cli, uint16_t fnum, uint64_t offset, uint64_t len);
1524 struct tevent_req *cli_posix_lock_send(TALLOC_CTX *mem_ctx,
1525 struct event_context *ev,
1526 struct cli_state *cli,
1527 uint16_t fnum,
1528 uint64_t offset,
1529 uint64_t len,
1530 bool wait_lock,
1531 enum brl_type lock_type);
1532 NTSTATUS cli_posix_lock_recv(struct tevent_req *req);
1533 NTSTATUS cli_posix_lock(struct cli_state *cli, uint16_t fnum,
1534 uint64_t offset, uint64_t len,
1535 bool wait_lock, enum brl_type lock_type);
1536 struct tevent_req *cli_posix_unlock_send(TALLOC_CTX *mem_ctx,
1537 struct event_context *ev,
1538 struct cli_state *cli,
1539 uint16_t fnum,
1540 uint64_t offset,
1541 uint64_t len);
1542 NTSTATUS cli_posix_unlock_recv(struct tevent_req *req);
1543 NTSTATUS cli_posix_unlock(struct cli_state *cli, uint16_t fnum, uint64_t offset, uint64_t len);
1544 struct tevent_req *cli_getattrE_send(TALLOC_CTX *mem_ctx,
1545 struct event_context *ev,
1546 struct cli_state *cli,
1547 uint16_t fnum);
1548 NTSTATUS cli_getattrE_recv(struct tevent_req *req,
1549 uint16_t *attr,
1550 SMB_OFF_T *size,
1551 time_t *change_time,
1552 time_t *access_time,
1553 time_t *write_time);
1554 NTSTATUS cli_getattrE(struct cli_state *cli,
1555 uint16_t fnum,
1556 uint16_t *attr,
1557 SMB_OFF_T *size,
1558 time_t *change_time,
1559 time_t *access_time,
1560 time_t *write_time);
1561 struct tevent_req *cli_setattrE_send(TALLOC_CTX *mem_ctx,
1562 struct event_context *ev,
1563 struct cli_state *cli,
1564 uint16_t fnum,
1565 time_t change_time,
1566 time_t access_time,
1567 time_t write_time);
1568 NTSTATUS cli_setattrE_recv(struct tevent_req *req);
1569 NTSTATUS cli_setattrE(struct cli_state *cli,
1570 uint16_t fnum,
1571 time_t change_time,
1572 time_t access_time,
1573 time_t write_time);
1574 struct tevent_req *cli_getatr_send(TALLOC_CTX *mem_ctx,
1575 struct event_context *ev,
1576 struct cli_state *cli,
1577 const char *fname);
1578 NTSTATUS cli_getatr_recv(struct tevent_req *req,
1579 uint16_t *attr,
1580 SMB_OFF_T *size,
1581 time_t *write_time);
1582 NTSTATUS cli_getatr(struct cli_state *cli,
1583 const char *fname,
1584 uint16_t *attr,
1585 SMB_OFF_T *size,
1586 time_t *write_time);
1587 struct tevent_req *cli_setatr_send(TALLOC_CTX *mem_ctx,
1588 struct event_context *ev,
1589 struct cli_state *cli,
1590 const char *fname,
1591 uint16_t attr,
1592 time_t mtime);
1593 NTSTATUS cli_setatr_recv(struct tevent_req *req);
1594 NTSTATUS cli_setatr(struct cli_state *cli,
1595 const char *fname,
1596 uint16_t attr,
1597 time_t mtime);
1598 struct tevent_req *cli_chkpath_send(TALLOC_CTX *mem_ctx,
1599 struct event_context *ev,
1600 struct cli_state *cli,
1601 const char *fname);
1602 NTSTATUS cli_chkpath_recv(struct tevent_req *req);
1603 NTSTATUS cli_chkpath(struct cli_state *cli, const char *path);
1604 struct tevent_req *cli_dskattr_send(TALLOC_CTX *mem_ctx,
1605 struct event_context *ev,
1606 struct cli_state *cli);
1607 NTSTATUS cli_dskattr_recv(struct tevent_req *req, int *bsize, int *total,
1608 int *avail);
1609 NTSTATUS cli_dskattr(struct cli_state *cli, int *bsize, int *total, int *avail);
1610 struct tevent_req *cli_ctemp_send(TALLOC_CTX *mem_ctx,
1611 struct event_context *ev,
1612 struct cli_state *cli,
1613 const char *path);
1614 NTSTATUS cli_ctemp_recv(struct tevent_req *req,
1615 TALLOC_CTX *ctx,
1616 uint16_t *pfnum,
1617 char **outfile);
1618 NTSTATUS cli_ctemp(struct cli_state *cli,
1619 TALLOC_CTX *ctx,
1620 const char *path,
1621 uint16_t *pfnum,
1622 char **out_path);
1623 NTSTATUS cli_raw_ioctl(struct cli_state *cli, uint16_t fnum, uint32_t code, DATA_BLOB *blob);
1624 NTSTATUS cli_set_ea_path(struct cli_state *cli, const char *path,
1625 const char *ea_name, const char *ea_val,
1626 size_t ea_len);
1627 NTSTATUS cli_set_ea_fnum(struct cli_state *cli, uint16_t fnum,
1628 const char *ea_name, const char *ea_val,
1629 size_t ea_len);
1630 struct tevent_req *cli_get_ea_list_path_send(TALLOC_CTX *mem_ctx,
1631 struct tevent_context *ev,
1632 struct cli_state *cli,
1633 const char *fname);
1634 NTSTATUS cli_get_ea_list_path_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx,
1635 size_t *pnum_eas, struct ea_struct **peas);
1636 NTSTATUS cli_get_ea_list_path(struct cli_state *cli, const char *path,
1637 TALLOC_CTX *ctx,
1638 size_t *pnum_eas,
1639 struct ea_struct **pea_list);
1640 struct tevent_req *cli_posix_open_send(TALLOC_CTX *mem_ctx,
1641 struct event_context *ev,
1642 struct cli_state *cli,
1643 const char *fname,
1644 int flags,
1645 mode_t mode);
1646 NTSTATUS cli_posix_open_recv(struct tevent_req *req, uint16_t *pfnum);
1647 NTSTATUS cli_posix_open(struct cli_state *cli, const char *fname,
1648 int flags, mode_t mode, uint16_t *fnum);
1649 struct tevent_req *cli_posix_mkdir_send(TALLOC_CTX *mem_ctx,
1650 struct event_context *ev,
1651 struct cli_state *cli,
1652 const char *fname,
1653 mode_t mode);
1654 NTSTATUS cli_posix_mkdir_recv(struct tevent_req *req);
1655 NTSTATUS cli_posix_mkdir(struct cli_state *cli, const char *fname, mode_t mode);
1657 struct tevent_req *cli_posix_unlink_send(TALLOC_CTX *mem_ctx,
1658 struct event_context *ev,
1659 struct cli_state *cli,
1660 const char *fname);
1661 NTSTATUS cli_posix_unlink_recv(struct tevent_req *req);
1662 NTSTATUS cli_posix_unlink(struct cli_state *cli, const char *fname);
1664 struct tevent_req *cli_posix_rmdir_send(TALLOC_CTX *mem_ctx,
1665 struct event_context *ev,
1666 struct cli_state *cli,
1667 const char *fname);
1668 NTSTATUS cli_posix_rmdir_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx);
1669 NTSTATUS cli_posix_rmdir(struct cli_state *cli, const char *fname);
1670 struct tevent_req *cli_notify_send(TALLOC_CTX *mem_ctx,
1671 struct tevent_context *ev,
1672 struct cli_state *cli, uint16_t fnum,
1673 uint32_t buffer_size,
1674 uint32_t completion_filter, bool recursive);
1675 NTSTATUS cli_notify_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx,
1676 uint32_t *pnum_changes,
1677 struct notify_change **pchanges);
1679 /* The following definitions come from libsmb/clifsinfo.c */
1681 struct tevent_req *cli_unix_extensions_version_send(TALLOC_CTX *mem_ctx,
1682 struct tevent_context *ev,
1683 struct cli_state *cli);
1684 NTSTATUS cli_unix_extensions_version_recv(struct tevent_req *req,
1685 uint16_t *pmajor, uint16_t *pminor,
1686 uint32_t *pcaplow,
1687 uint32_t *pcaphigh);
1688 NTSTATUS cli_unix_extensions_version(struct cli_state *cli, uint16 *pmajor,
1689 uint16 *pminor, uint32 *pcaplow,
1690 uint32 *pcaphigh);
1691 struct tevent_req *cli_set_unix_extensions_capabilities_send(
1692 TALLOC_CTX *mem_ctx, struct tevent_context *ev, struct cli_state *cli,
1693 uint16_t major, uint16_t minor, uint32_t caplow, uint32_t caphigh);
1694 NTSTATUS cli_set_unix_extensions_capabilities_recv(struct tevent_req *req);
1695 NTSTATUS cli_set_unix_extensions_capabilities(struct cli_state *cli,
1696 uint16 major, uint16 minor,
1697 uint32 caplow, uint32 caphigh);
1698 struct tevent_req *cli_get_fs_attr_info_send(TALLOC_CTX *mem_ctx,
1699 struct tevent_context *ev,
1700 struct cli_state *cli);
1701 NTSTATUS cli_get_fs_attr_info_recv(struct tevent_req *req, uint32_t *fs_attr);
1702 NTSTATUS cli_get_fs_attr_info(struct cli_state *cli, uint32_t *fs_attr);
1703 NTSTATUS cli_get_fs_volume_info(struct cli_state *cli, fstring volume_name,
1704 uint32 *pserial_number, time_t *pdate);
1705 NTSTATUS cli_get_fs_full_size_info(struct cli_state *cli,
1706 uint64_t *total_allocation_units,
1707 uint64_t *caller_allocation_units,
1708 uint64_t *actual_allocation_units,
1709 uint64_t *sectors_per_allocation_unit,
1710 uint64_t *bytes_per_sector);
1711 NTSTATUS cli_get_posix_fs_info(struct cli_state *cli,
1712 uint32 *optimal_transfer_size,
1713 uint32 *block_size,
1714 uint64_t *total_blocks,
1715 uint64_t *blocks_available,
1716 uint64_t *user_blocks_available,
1717 uint64_t *total_file_nodes,
1718 uint64_t *free_file_nodes,
1719 uint64_t *fs_identifier);
1720 NTSTATUS cli_raw_ntlm_smb_encryption_start(struct cli_state *cli,
1721 const char *user,
1722 const char *pass,
1723 const char *domain);
1724 NTSTATUS cli_gss_smb_encryption_start(struct cli_state *cli);
1725 NTSTATUS cli_force_encryption(struct cli_state *c,
1726 const char *username,
1727 const char *password,
1728 const char *domain);
1730 /* The following definitions come from libsmb/clikrb5.c */
1732 bool unwrap_edata_ntstatus(TALLOC_CTX *mem_ctx,
1733 DATA_BLOB *edata,
1734 DATA_BLOB *edata_out);
1735 bool unwrap_pac(TALLOC_CTX *mem_ctx, DATA_BLOB *auth_data, DATA_BLOB *unwrapped_pac_data);
1737 /* The following definitions come from libsmb/clilist.c */
1739 NTSTATUS cli_list_old(struct cli_state *cli,const char *Mask,uint16 attribute,
1740 NTSTATUS (*fn)(const char *, struct file_info *,
1741 const char *, void *), void *state);
1742 NTSTATUS cli_list_trans(struct cli_state *cli, const char *mask,
1743 uint16_t attribute, int info_level,
1744 NTSTATUS (*fn)(const char *mnt, struct file_info *finfo,
1745 const char *mask, void *private_data),
1746 void *private_data);
1747 struct tevent_req *cli_list_send(TALLOC_CTX *mem_ctx,
1748 struct tevent_context *ev,
1749 struct cli_state *cli,
1750 const char *mask,
1751 uint16_t attribute,
1752 uint16_t info_level);
1753 NTSTATUS cli_list_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx,
1754 struct file_info **finfo, size_t *num_finfo);
1755 NTSTATUS cli_list(struct cli_state *cli,const char *Mask,uint16 attribute,
1756 NTSTATUS (*fn)(const char *, struct file_info *, const char *,
1757 void *), void *state);
1759 /* The following definitions come from libsmb/climessage.c */
1761 struct tevent_req *cli_message_send(TALLOC_CTX *mem_ctx,
1762 struct tevent_context *ev,
1763 struct cli_state *cli,
1764 const char *host, const char *username,
1765 const char *message);
1766 NTSTATUS cli_message_recv(struct tevent_req *req);
1767 NTSTATUS cli_message(struct cli_state *cli, const char *host,
1768 const char *username, const char *message);
1770 /* The following definitions come from libsmb/clioplock.c */
1772 struct tevent_req *cli_oplock_ack_send(TALLOC_CTX *mem_ctx,
1773 struct tevent_context *ev,
1774 struct cli_state *cli,
1775 uint16_t fnum, uint8_t level);
1776 NTSTATUS cli_oplock_ack_recv(struct tevent_req *req);
1777 NTSTATUS cli_oplock_ack(struct cli_state *cli, uint16_t fnum, unsigned char level);
1778 void cli_oplock_handler(struct cli_state *cli,
1779 NTSTATUS (*handler)(struct cli_state *, uint16_t, unsigned char));
1781 /* The following definitions come from libsmb/cliprint.c */
1783 int cli_print_queue(struct cli_state *cli,
1784 void (*fn)(struct print_job_info *));
1785 int cli_printjob_del(struct cli_state *cli, int job);
1787 /* The following definitions come from libsmb/cliquota.c */
1789 NTSTATUS cli_get_quota_handle(struct cli_state *cli, uint16_t *quota_fnum);
1790 void free_ntquota_list(SMB_NTQUOTA_LIST **qt_list);
1791 NTSTATUS cli_get_user_quota(struct cli_state *cli, int quota_fnum,
1792 SMB_NTQUOTA_STRUCT *pqt);
1793 NTSTATUS cli_set_user_quota(struct cli_state *cli, int quota_fnum,
1794 SMB_NTQUOTA_STRUCT *pqt);
1795 NTSTATUS cli_list_user_quota(struct cli_state *cli, int quota_fnum,
1796 SMB_NTQUOTA_LIST **pqt_list);
1797 NTSTATUS cli_get_fs_quota_info(struct cli_state *cli, int quota_fnum,
1798 SMB_NTQUOTA_STRUCT *pqt);
1799 NTSTATUS cli_set_fs_quota_info(struct cli_state *cli, int quota_fnum,
1800 SMB_NTQUOTA_STRUCT *pqt);
1802 /* The following definitions come from libsmb/clireadwrite.c */
1804 struct tevent_req *cli_read_andx_create(TALLOC_CTX *mem_ctx,
1805 struct event_context *ev,
1806 struct cli_state *cli, uint16_t fnum,
1807 off_t offset, size_t size,
1808 struct tevent_req **psmbreq);
1809 struct tevent_req *cli_read_andx_send(TALLOC_CTX *mem_ctx,
1810 struct event_context *ev,
1811 struct cli_state *cli, uint16_t fnum,
1812 off_t offset, size_t size);
1813 NTSTATUS cli_read_andx_recv(struct tevent_req *req, ssize_t *received,
1814 uint8_t **rcvbuf);
1815 struct tevent_req *cli_pull_send(TALLOC_CTX *mem_ctx,
1816 struct event_context *ev,
1817 struct cli_state *cli,
1818 uint16_t fnum, off_t start_offset,
1819 SMB_OFF_T size, size_t window_size,
1820 NTSTATUS (*sink)(char *buf, size_t n,
1821 void *priv),
1822 void *priv);
1823 NTSTATUS cli_pull_recv(struct tevent_req *req, SMB_OFF_T *received);
1824 NTSTATUS cli_pull(struct cli_state *cli, uint16_t fnum,
1825 off_t start_offset, SMB_OFF_T size, size_t window_size,
1826 NTSTATUS (*sink)(char *buf, size_t n, void *priv),
1827 void *priv, SMB_OFF_T *received);
1828 ssize_t cli_read(struct cli_state *cli, uint16_t fnum, char *buf,
1829 off_t offset, size_t size);
1830 ssize_t cli_write(struct cli_state *cli,
1831 uint16_t fnum, uint16 write_mode,
1832 const char *buf, off_t offset, size_t size);
1833 NTSTATUS cli_smbwrite(struct cli_state *cli, uint16_t fnum, char *buf,
1834 off_t offset, size_t size1, size_t *ptotal);
1835 struct tevent_req *cli_write_andx_create(TALLOC_CTX *mem_ctx,
1836 struct event_context *ev,
1837 struct cli_state *cli, uint16_t fnum,
1838 uint16_t mode, const uint8_t *buf,
1839 off_t offset, size_t size,
1840 struct tevent_req **reqs_before,
1841 int num_reqs_before,
1842 struct tevent_req **psmbreq);
1843 struct tevent_req *cli_write_andx_send(TALLOC_CTX *mem_ctx,
1844 struct event_context *ev,
1845 struct cli_state *cli, uint16_t fnum,
1846 uint16_t mode, const uint8_t *buf,
1847 off_t offset, size_t size);
1848 NTSTATUS cli_write_andx_recv(struct tevent_req *req, size_t *pwritten);
1850 struct tevent_req *cli_push_send(TALLOC_CTX *mem_ctx, struct event_context *ev,
1851 struct cli_state *cli,
1852 uint16_t fnum, uint16_t mode,
1853 off_t start_offset, size_t window_size,
1854 size_t (*source)(uint8_t *buf, size_t n,
1855 void *priv),
1856 void *priv);
1857 NTSTATUS cli_push_recv(struct tevent_req *req);
1858 NTSTATUS cli_push(struct cli_state *cli, uint16_t fnum, uint16_t mode,
1859 off_t start_offset, size_t window_size,
1860 size_t (*source)(uint8_t *buf, size_t n, void *priv),
1861 void *priv);
1863 /* The following definitions come from libsmb/clisecdesc.c */
1865 struct security_descriptor *cli_query_secdesc(struct cli_state *cli, uint16_t fnum,
1866 TALLOC_CTX *mem_ctx);
1867 NTSTATUS cli_set_secdesc(struct cli_state *cli, uint16_t fnum,
1868 struct security_descriptor *sd);
1870 /* The following definitions come from libsmb/clispnego.c */
1872 DATA_BLOB spnego_gen_negTokenInit(TALLOC_CTX *ctx,
1873 const char *OIDs[],
1874 DATA_BLOB *psecblob,
1875 const char *principal);
1877 #ifndef ASN1_MAX_OIDS
1878 #define ASN1_MAX_OIDS 20
1879 #endif
1880 bool spnego_parse_negTokenInit(TALLOC_CTX *ctx,
1881 DATA_BLOB blob,
1882 char *OIDs[ASN1_MAX_OIDS],
1883 char **principal,
1884 DATA_BLOB *secblob);
1885 DATA_BLOB spnego_gen_krb5_wrap(TALLOC_CTX *ctx, const DATA_BLOB ticket, const uint8 tok_id[2]);
1886 bool spnego_parse_krb5_wrap(TALLOC_CTX *ctx, DATA_BLOB blob, DATA_BLOB *ticket, uint8 tok_id[2]);
1887 int spnego_gen_krb5_negTokenInit(TALLOC_CTX *ctx,
1888 const char *principal, int time_offset,
1889 DATA_BLOB *targ,
1890 DATA_BLOB *session_key_krb5, uint32 extra_ap_opts,
1891 time_t *expire_time);
1892 bool spnego_parse_challenge(TALLOC_CTX *ctx, const DATA_BLOB blob,
1893 DATA_BLOB *chal1, DATA_BLOB *chal2);
1894 DATA_BLOB spnego_gen_auth(TALLOC_CTX *ctx, DATA_BLOB blob);
1895 bool spnego_parse_auth(TALLOC_CTX *ctx, DATA_BLOB blob, DATA_BLOB *auth);
1896 DATA_BLOB spnego_gen_auth_response(TALLOC_CTX *ctx, DATA_BLOB *reply, NTSTATUS nt_status,
1897 const char *mechOID);
1898 bool spnego_parse_auth_response(TALLOC_CTX *ctx,
1899 DATA_BLOB blob, NTSTATUS nt_status,
1900 const char *mechOID,
1901 DATA_BLOB *auth);
1903 bool spnego_parse_auth_and_mic(TALLOC_CTX *ctx, DATA_BLOB blob,
1904 DATA_BLOB *auth, DATA_BLOB *signature);
1905 DATA_BLOB spnego_gen_auth_response_and_mic(TALLOC_CTX *ctx,
1906 NTSTATUS nt_status,
1907 const char *mechOID,
1908 DATA_BLOB *reply,
1909 DATA_BLOB *mechlistMIC);
1910 bool spnego_mech_list_blob(TALLOC_CTX *mem_ctx,
1911 char **oid_list, DATA_BLOB *data);
1913 /* The following definitions come from libsmb/clistr.c */
1915 size_t clistr_push_fn(const char *function,
1916 unsigned int line,
1917 struct cli_state *cli,
1918 void *dest,
1919 const char *src,
1920 int dest_len,
1921 int flags);
1922 size_t clistr_pull_fn(const char *function,
1923 unsigned int line,
1924 const char *inbuf,
1925 char *dest,
1926 const void *src,
1927 int dest_len,
1928 int src_len,
1929 int flags);
1930 size_t clistr_pull_talloc_fn(const char *function,
1931 unsigned int line,
1932 TALLOC_CTX *ctx,
1933 const char *base,
1934 uint16_t flags2,
1935 char **pp_dest,
1936 const void *src,
1937 int src_len,
1938 int flags);
1939 size_t clistr_align_out(struct cli_state *cli, const void *p, int flags);
1941 /* The following definitions come from libsmb/clitrans.c */
1943 struct tevent_req *cli_trans_send(
1944 TALLOC_CTX *mem_ctx, struct event_context *ev,
1945 struct cli_state *cli, uint8_t cmd,
1946 const char *pipe_name, uint16_t fid, uint16_t function, int flags,
1947 uint16_t *setup, uint8_t num_setup, uint8_t max_setup,
1948 uint8_t *param, uint32_t num_param, uint32_t max_param,
1949 uint8_t *data, uint32_t num_data, uint32_t max_data);
1950 NTSTATUS cli_trans_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx,
1951 uint16_t *recv_flags2,
1952 uint16_t **setup, uint8_t min_setup,
1953 uint8_t *num_setup,
1954 uint8_t **param, uint32_t min_param,
1955 uint32_t *num_param,
1956 uint8_t **data, uint32_t min_data,
1957 uint32_t *num_data);
1958 NTSTATUS cli_trans(TALLOC_CTX *mem_ctx, struct cli_state *cli,
1959 uint8_t trans_cmd,
1960 const char *pipe_name, uint16_t fid, uint16_t function,
1961 int flags,
1962 uint16_t *setup, uint8_t num_setup, uint8_t max_setup,
1963 uint8_t *param, uint32_t num_param, uint32_t max_param,
1964 uint8_t *data, uint32_t num_data, uint32_t max_data,
1965 uint16_t *recv_flags2,
1966 uint16_t **rsetup, uint8_t min_rsetup, uint8_t *num_rsetup,
1967 uint8_t **rparam, uint32_t min_rparam, uint32_t *num_rparam,
1968 uint8_t **rdata, uint32_t min_rdata, uint32_t *num_rdata);
1970 /* The following definitions come from libsmb/conncache.c */
1972 NTSTATUS check_negative_conn_cache( const char *domain, const char *server);
1973 void add_failed_connection_entry(const char *domain, const char *server, NTSTATUS result) ;
1974 void flush_negative_conn_cache_for_domain(const char *domain);
1976 /* The following definitions come from libsmb/dsgetdcname.c */
1978 struct netr_DsRGetDCNameInfo;
1980 void debug_dsdcinfo_flags(int lvl, uint32_t flags);
1981 NTSTATUS dsgetdcname(TALLOC_CTX *mem_ctx,
1982 struct messaging_context *msg_ctx,
1983 const char *domain_name,
1984 const struct GUID *domain_guid,
1985 const char *site_name,
1986 uint32_t flags,
1987 struct netr_DsRGetDCNameInfo **info);
1989 /* The following definitions come from libsmb/errormap.c */
1991 NTSTATUS dos_to_ntstatus(uint8 eclass, uint32 ecode);
1992 void ntstatus_to_dos(NTSTATUS ntstatus, uint8 *eclass, uint32 *ecode);
1993 NTSTATUS werror_to_ntstatus(WERROR error);
1994 WERROR ntstatus_to_werror(NTSTATUS error);
1995 NTSTATUS map_nt_error_from_gss(uint32 gss_maj, uint32 minor);
1997 /* The following definitions come from libsmb/namecache.c */
1999 bool namecache_store(const char *name,
2000 int name_type,
2001 int num_names,
2002 struct ip_service *ip_list);
2003 bool namecache_fetch(const char *name,
2004 int name_type,
2005 struct ip_service **ip_list,
2006 int *num_names);
2007 bool namecache_delete(const char *name, int name_type);
2008 void namecache_flush(void);
2009 bool namecache_status_store(const char *keyname, int keyname_type,
2010 int name_type, const struct sockaddr_storage *keyip,
2011 const char *srvname);
2012 bool namecache_status_fetch(const char *keyname,
2013 int keyname_type,
2014 int name_type,
2015 const struct sockaddr_storage *keyip,
2016 char *srvname_out);
2018 /* The following definitions come from libsmb/namequery.c */
2020 bool saf_store( const char *domain, const char *servername );
2021 bool saf_join_store( const char *domain, const char *servername );
2022 bool saf_delete( const char *domain );
2023 char *saf_fetch( const char *domain );
2024 struct tevent_req *node_status_query_send(TALLOC_CTX *mem_ctx,
2025 struct tevent_context *ev,
2026 struct nmb_name *name,
2027 const struct sockaddr_storage *addr);
2028 NTSTATUS node_status_query_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx,
2029 struct node_status **pnode_status,
2030 int *pnum_names,
2031 struct node_status_extra *extra);
2032 NTSTATUS node_status_query(TALLOC_CTX *mem_ctx, struct nmb_name *name,
2033 const struct sockaddr_storage *addr,
2034 struct node_status **pnode_status,
2035 int *pnum_names,
2036 struct node_status_extra *extra);
2037 bool name_status_find(const char *q_name,
2038 int q_type,
2039 int type,
2040 const struct sockaddr_storage *to_ss,
2041 fstring name);
2042 int ip_service_compare(struct ip_service *ss1, struct ip_service *ss2);
2043 struct tevent_req *name_query_send(TALLOC_CTX *mem_ctx,
2044 struct tevent_context *ev,
2045 const char *name, int name_type,
2046 bool bcast, bool recurse,
2047 const struct sockaddr_storage *addr);
2048 NTSTATUS name_query_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx,
2049 struct sockaddr_storage **addrs, int *num_addrs,
2050 uint8_t *flags);
2051 NTSTATUS name_query(const char *name, int name_type,
2052 bool bcast, bool recurse,
2053 const struct sockaddr_storage *to_ss,
2054 TALLOC_CTX *mem_ctx,
2055 struct sockaddr_storage **addrs,
2056 int *num_addrs, uint8_t *flags);
2057 NTSTATUS name_resolve_bcast(const char *name,
2058 int name_type,
2059 struct ip_service **return_iplist,
2060 int *return_count);
2061 NTSTATUS resolve_wins(const char *name,
2062 int name_type,
2063 struct ip_service **return_iplist,
2064 int *return_count);
2065 NTSTATUS internal_resolve_name(const char *name,
2066 int name_type,
2067 const char *sitename,
2068 struct ip_service **return_iplist,
2069 int *return_count,
2070 const char *resolve_order);
2071 bool resolve_name(const char *name,
2072 struct sockaddr_storage *return_ss,
2073 int name_type,
2074 bool prefer_ipv4);
2075 NTSTATUS resolve_name_list(TALLOC_CTX *ctx,
2076 const char *name,
2077 int name_type,
2078 struct sockaddr_storage **return_ss_arr,
2079 unsigned int *p_num_entries);
2080 bool find_master_ip(const char *group, struct sockaddr_storage *master_ss);
2081 bool get_pdc_ip(const char *domain, struct sockaddr_storage *pss);
2082 NTSTATUS get_sorted_dc_list( const char *domain,
2083 const char *sitename,
2084 struct ip_service **ip_list,
2085 int *count,
2086 bool ads_only );
2087 NTSTATUS get_kdc_list( const char *realm,
2088 const char *sitename,
2089 struct ip_service **ip_list,
2090 int *count);
2092 /* The following definitions come from libsmb/namequery_dc.c */
2094 bool get_dc_name(const char *domain,
2095 const char *realm,
2096 fstring srv_name,
2097 struct sockaddr_storage *ss_out);
2099 /* The following definitions come from libsmb/nterr.c */
2101 const char *nt_errstr(NTSTATUS nt_code);
2102 const char *get_friendly_nt_error_msg(NTSTATUS nt_code);
2103 const char *get_nt_error_c_code(NTSTATUS nt_code);
2104 NTSTATUS nt_status_string_to_code(const char *nt_status_str);
2105 NTSTATUS nt_status_squash(NTSTATUS nt_status);
2107 /* The following definitions come from libsmb/ntlmssp.c */
2108 struct ntlmssp_state;
2109 NTSTATUS ntlmssp_set_username(struct ntlmssp_state *ntlmssp_state, const char *user) ;
2110 NTSTATUS ntlmssp_set_hashes(struct ntlmssp_state *ntlmssp_state,
2111 const uint8_t lm_hash[16],
2112 const uint8_t nt_hash[16]) ;
2113 NTSTATUS ntlmssp_set_password(struct ntlmssp_state *ntlmssp_state, const char *password) ;
2114 NTSTATUS ntlmssp_set_domain(struct ntlmssp_state *ntlmssp_state, const char *domain) ;
2115 void ntlmssp_want_feature_list(struct ntlmssp_state *ntlmssp_state, char *feature_list);
2116 void ntlmssp_want_feature(struct ntlmssp_state *ntlmssp_state, uint32_t feature);
2117 NTSTATUS ntlmssp_update(struct ntlmssp_state *ntlmssp_state,
2118 const DATA_BLOB in, DATA_BLOB *out) ;
2119 NTSTATUS ntlmssp_server_start(TALLOC_CTX *mem_ctx,
2120 bool is_standalone,
2121 const char *netbios_name,
2122 const char *netbios_domain,
2123 const char *dns_name,
2124 const char *dns_domain,
2125 struct ntlmssp_state **ntlmssp_state);
2126 NTSTATUS ntlmssp_client_start(TALLOC_CTX *mem_ctx,
2127 const char *netbios_name,
2128 const char *netbios_domain,
2129 bool use_ntlmv2,
2130 struct ntlmssp_state **_ntlmssp_state);
2132 /* The following definitions come from libsmb/passchange.c */
2134 NTSTATUS remote_password_change(const char *remote_machine, const char *user_name,
2135 const char *old_passwd, const char *new_passwd,
2136 char **err_str);
2138 /* The following definitions come from libsmb/samlogon_cache.c */
2140 bool netsamlogon_cache_init(void);
2141 bool netsamlogon_cache_shutdown(void);
2142 void netsamlogon_clear_cached_user(const struct dom_sid *user_sid);
2143 bool netsamlogon_cache_store(const char *username, struct netr_SamInfo3 *info3);
2144 struct netr_SamInfo3 *netsamlogon_cache_get(TALLOC_CTX *mem_ctx, const struct dom_sid *user_sid);
2145 bool netsamlogon_cache_have(const struct dom_sid *user_sid);
2147 /* The following definitions come from libsmb/smb_seal.c */
2149 NTSTATUS get_enc_ctx_num(const uint8_t *buf, uint16 *p_enc_ctx_num);
2150 bool common_encryption_on(struct smb_trans_enc_state *es);
2151 NTSTATUS common_ntlm_decrypt_buffer(struct ntlmssp_state *ntlmssp_state, char *buf);
2152 NTSTATUS common_ntlm_encrypt_buffer(struct ntlmssp_state *ntlmssp_state,
2153 uint16 enc_ctx_num,
2154 char *buf,
2155 char **ppbuf_out);
2156 NTSTATUS common_encrypt_buffer(struct smb_trans_enc_state *es, char *buffer, char **buf_out);
2157 NTSTATUS common_decrypt_buffer(struct smb_trans_enc_state *es, char *buf);
2158 void common_free_encryption_state(struct smb_trans_enc_state **pp_es);
2159 void common_free_enc_buffer(struct smb_trans_enc_state *es, char *buf);
2160 bool cli_encryption_on(struct cli_state *cli);
2161 void cli_free_encryption_context(struct cli_state *cli);
2162 void cli_free_enc_buffer(struct cli_state *cli, char *buf);
2163 NTSTATUS cli_decrypt_message(struct cli_state *cli);
2164 NTSTATUS cli_encrypt_message(struct cli_state *cli, char *buf, char **buf_out);
2166 /* The following definitions come from libsmb/clisigning.c */
2168 bool cli_simple_set_signing(struct cli_state *cli,
2169 const DATA_BLOB user_session_key,
2170 const DATA_BLOB response);
2171 bool cli_temp_set_signing(struct cli_state *cli);
2172 void cli_calculate_sign_mac(struct cli_state *cli, char *buf, uint32_t *seqnum);
2173 bool cli_check_sign_mac(struct cli_state *cli, const char *buf, uint32_t seqnum);
2174 bool client_is_signing_on(struct cli_state *cli);
2175 bool client_is_signing_allowed(struct cli_state *cli);
2176 bool client_is_signing_mandatory(struct cli_state *cli);
2177 void cli_set_signing_negotiated(struct cli_state *cli);
2179 /* The following definitions come from libsmb/smberr.c */
2181 const char *smb_dos_err_name(uint8 e_class, uint16 num);
2182 const char *get_dos_error_msg(WERROR result);
2183 const char *smb_dos_err_class(uint8 e_class);
2184 char *smb_dos_errstr(char *inbuf);
2185 WERROR map_werror_from_unix(int error);
2187 /* The following definitions come from libsmb/trustdom_cache.c */
2189 bool trustdom_cache_enable(void);
2190 bool trustdom_cache_shutdown(void);
2191 bool trustdom_cache_store(char* name, char* alt_name, const struct dom_sid *sid,
2192 time_t timeout);
2193 bool trustdom_cache_fetch(const char* name, struct dom_sid* sid);
2194 uint32 trustdom_cache_fetch_timestamp( void );
2195 bool trustdom_cache_store_timestamp( uint32 t, time_t timeout );
2196 void trustdom_cache_flush(void);
2197 void update_trustdom_cache( void );
2199 /* The following definitions come from libsmb/trusts_util.c */
2201 NTSTATUS trust_pw_change_and_store_it(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx,
2202 const char *domain,
2203 const char *account_name,
2204 unsigned char orig_trust_passwd_hash[16],
2205 enum netr_SchannelType sec_channel_type);
2206 NTSTATUS trust_pw_find_change_and_store_it(struct rpc_pipe_client *cli,
2207 TALLOC_CTX *mem_ctx,
2208 const char *domain) ;
2209 bool enumerate_domain_trusts( TALLOC_CTX *mem_ctx, const char *domain,
2210 char ***domain_names, uint32 *num_domains,
2211 struct dom_sid **sids );
2212 NTSTATUS change_trust_account_password( const char *domain, const char *remote_machine);
2214 /* The following definitions come from modules/vfs_default.c */
2216 ssize_t vfswrap_llistxattr(struct vfs_handle_struct *handle, const char *path, char *list, size_t size);
2217 ssize_t vfswrap_flistxattr(struct vfs_handle_struct *handle, struct files_struct *fsp, char *list, size_t size);
2218 NTSTATUS vfs_default_init(void);
2220 /* The following definitions come from param/loadparm.c */
2222 char *lp_smb_ports(void);
2223 char *lp_dos_charset(void);
2224 char *lp_unix_charset(void);
2225 char *lp_display_charset(void);
2226 char *lp_logfile(void);
2227 char *lp_configfile(void);
2228 char *lp_smb_passwd_file(void);
2229 char *lp_private_dir(void);
2230 char *lp_serverstring(void);
2231 int lp_printcap_cache_time(void);
2232 char *lp_addport_cmd(void);
2233 char *lp_enumports_cmd(void);
2234 char *lp_addprinter_cmd(void);
2235 char *lp_deleteprinter_cmd(void);
2236 char *lp_os2_driver_map(void);
2237 char *lp_lockdir(void);
2238 char *lp_statedir(void);
2239 char *lp_cachedir(void);
2240 char *lp_piddir(void);
2241 char *lp_mangling_method(void);
2242 int lp_mangle_prefix(void);
2243 char *lp_utmpdir(void);
2244 char *lp_wtmpdir(void);
2245 bool lp_utmp(void);
2246 char *lp_rootdir(void);
2247 char *lp_defaultservice(void);
2248 char *lp_msg_command(void);
2249 char *lp_get_quota_command(void);
2250 char *lp_set_quota_command(void);
2251 char *lp_auto_services(void);
2252 char *lp_passwd_program(void);
2253 char *lp_passwd_chat(void);
2254 char *lp_passwordserver(void);
2255 char *lp_name_resolve_order(void);
2256 char *lp_realm(void);
2257 const char *lp_afs_username_map(void);
2258 int lp_afs_token_lifetime(void);
2259 char *lp_log_nt_token_command(void);
2260 char *lp_username_map(void);
2261 const char *lp_logon_script(void);
2262 const char *lp_logon_path(void);
2263 const char *lp_logon_drive(void);
2264 const char *lp_logon_home(void);
2265 char *lp_remote_announce(void);
2266 char *lp_remote_browse_sync(void);
2267 bool lp_nmbd_bind_explicit_broadcast(void);
2268 const char **lp_wins_server_list(void);
2269 const char **lp_interfaces(void);
2270 const char *lp_socket_address(void);
2271 char *lp_nis_home_map_name(void);
2272 const char **lp_netbios_aliases(void);
2273 const char *lp_passdb_backend(void);
2274 const char **lp_preload_modules(void);
2275 char *lp_panic_action(void);
2276 char *lp_adduser_script(void);
2277 char *lp_renameuser_script(void);
2278 char *lp_deluser_script(void);
2279 const char *lp_guestaccount(void);
2280 char *lp_addgroup_script(void);
2281 char *lp_delgroup_script(void);
2282 char *lp_addusertogroup_script(void);
2283 char *lp_deluserfromgroup_script(void);
2284 char *lp_setprimarygroup_script(void);
2285 char *lp_addmachine_script(void);
2286 char *lp_shutdown_script(void);
2287 char *lp_abort_shutdown_script(void);
2288 char *lp_username_map_script(void);
2289 int lp_username_map_cache_time(void);
2290 char *lp_check_password_script(void);
2291 char *lp_wins_hook(void);
2292 const char *lp_template_homedir(void);
2293 const char *lp_template_shell(void);
2294 const char *lp_winbind_separator(void);
2295 int lp_acl_compatibility(void);
2296 bool lp_winbind_enum_users(void);
2297 bool lp_winbind_enum_groups(void);
2298 bool lp_winbind_use_default_domain(void);
2299 bool lp_winbind_trusted_domains_only(void);
2300 bool lp_winbind_nested_groups(void);
2301 int lp_winbind_expand_groups(void);
2302 bool lp_winbind_refresh_tickets(void);
2303 bool lp_winbind_offline_logon(void);
2304 bool lp_winbind_normalize_names(void);
2305 bool lp_winbind_rpc_only(void);
2306 bool lp_create_krb5_conf(void);
2307 int lp_winbind_max_domain_connections(void);
2308 const char *lp_idmap_backend(void);
2309 int lp_idmap_cache_time(void);
2310 int lp_idmap_negative_cache_time(void);
2311 int lp_keepalive(void);
2312 bool lp_passdb_expand_explicit(void);
2313 char *lp_ldap_suffix(void);
2314 char *lp_ldap_admin_dn(void);
2315 int lp_ldap_ssl(void);
2316 bool lp_ldap_ssl_ads(void);
2317 int lp_ldap_deref(void);
2318 int lp_ldap_follow_referral(void);
2319 int lp_ldap_passwd_sync(void);
2320 bool lp_ldap_delete_dn(void);
2321 int lp_ldap_replication_sleep(void);
2322 int lp_ldap_timeout(void);
2323 int lp_ldap_connection_timeout(void);
2324 int lp_ldap_page_size(void);
2325 int lp_ldap_debug_level(void);
2326 int lp_ldap_debug_threshold(void);
2327 char *lp_add_share_cmd(void);
2328 char *lp_change_share_cmd(void);
2329 char *lp_delete_share_cmd(void);
2330 char *lp_usershare_path(void);
2331 const char **lp_usershare_prefix_allow_list(void);
2332 const char **lp_usershare_prefix_deny_list(void);
2333 const char **lp_eventlog_list(void);
2334 bool lp_registry_shares(void);
2335 bool lp_usershare_allow_guests(void);
2336 bool lp_usershare_owner_only(void);
2337 bool lp_disable_netbios(void);
2338 bool lp_reset_on_zero_vc(void);
2339 bool lp_log_writeable_files_on_exit(void);
2340 bool lp_ms_add_printer_wizard(void);
2341 bool lp_dns_proxy(void);
2342 bool lp_wins_support(void);
2343 bool lp_we_are_a_wins_server(void);
2344 bool lp_wins_proxy(void);
2345 bool lp_local_master(void);
2346 bool lp_domain_logons(void);
2347 const char **lp_init_logon_delayed_hosts(void);
2348 int lp_init_logon_delay(void);
2349 bool lp_load_printers(void);
2350 bool lp_readraw(void);
2351 bool _lp_readraw(void);
2352 bool lp_large_readwrite(void);
2353 bool lp_writeraw(void);
2354 bool _lp_writeraw(void);
2355 bool lp_null_passwords(void);
2356 bool lp_obey_pam_restrictions(void);
2357 bool lp_encrypted_passwords(void);
2358 int lp_client_schannel(void);
2359 int lp_server_schannel(void);
2360 bool lp_syslog_only(void);
2361 bool lp_timestamp_logs(void);
2362 bool lp_debug_prefix_timestamp(void);
2363 bool lp_debug_hires_timestamp(void);
2364 bool lp_debug_pid(void);
2365 bool lp_debug_uid(void);
2366 bool lp_debug_class(void);
2367 bool lp_enable_core_files(void);
2368 bool lp_browse_list(void);
2369 bool lp_nis_home_map(void);
2370 bool lp_bind_interfaces_only(void);
2371 bool lp_pam_password_change(void);
2372 bool lp_unix_password_sync(void);
2373 bool lp_passwd_chat_debug(void);
2374 int lp_passwd_chat_timeout(void);
2375 bool lp_nt_pipe_support(void);
2376 bool lp_nt_status_support(void);
2377 bool lp_stat_cache(void);
2378 int lp_max_stat_cache_size(void);
2379 bool lp_allow_trusted_domains(void);
2380 bool lp_map_untrusted_to_domain(void);
2381 int lp_restrict_anonymous(void);
2382 bool lp_lanman_auth(void);
2383 bool lp_ntlm_auth(void);
2384 bool lp_client_plaintext_auth(void);
2385 bool lp_client_lanman_auth(void);
2386 bool lp_client_ntlmv2_auth(void);
2387 bool lp_host_msdfs(void);
2388 bool lp_kernel_oplocks(void);
2389 bool lp_enhanced_browsing(void);
2390 bool lp_use_mmap(void);
2391 bool lp_unix_extensions(void);
2392 bool lp_use_spnego(void);
2393 bool lp_client_use_spnego(void);
2394 bool lp_client_use_spnego_principal(void);
2395 bool lp_send_spnego_principal(void);
2396 bool lp_hostname_lookups(void);
2397 bool lp_change_notify(const struct share_params *p );
2398 bool lp_kernel_change_notify(const struct share_params *p );
2399 char * lp_dedicated_keytab_file(void);
2400 int lp_kerberos_method(void);
2401 bool lp_defer_sharing_violations(void);
2402 bool lp_enable_privileges(void);
2403 bool lp_enable_asu_support(void);
2404 int lp_os_level(void);
2405 int lp_max_ttl(void);
2406 int lp_max_wins_ttl(void);
2407 int lp_min_wins_ttl(void);
2408 int lp_max_log_size(void);
2409 int lp_max_open_files(void);
2410 int lp_open_files_db_hash_size(void);
2411 int lp_maxxmit(void);
2412 int lp_maxmux(void);
2413 int lp_passwordlevel(void);
2414 int lp_usernamelevel(void);
2415 int lp_deadtime(void);
2416 bool lp_getwd_cache(void);
2417 int lp_maxprotocol(void);
2418 int lp_minprotocol(void);
2419 int lp_security(void);
2420 const char **lp_auth_methods(void);
2421 bool lp_paranoid_server_security(void);
2422 int lp_maxdisksize(void);
2423 int lp_lpqcachetime(void);
2424 int lp_max_smbd_processes(void);
2425 bool _lp_disable_spoolss(void);
2426 int lp_syslog(void);
2427 int lp_lm_announce(void);
2428 int lp_lm_interval(void);
2429 int lp_machine_password_timeout(void);
2430 int lp_map_to_guest(void);
2431 int lp_oplock_break_wait_time(void);
2432 int lp_lock_spin_time(void);
2433 int lp_usershare_max_shares(void);
2434 const char *lp_socket_options(void);
2435 int lp_config_backend(void);
2436 int lp_smb2_max_read(void);
2437 int lp_smb2_max_write(void);
2438 int lp_smb2_max_trans(void);
2439 int lp_smb2_max_credits(void);
2440 char *lp_preexec(int );
2441 char *lp_postexec(int );
2442 char *lp_rootpreexec(int );
2443 char *lp_rootpostexec(int );
2444 char *lp_servicename(int );
2445 const char *lp_const_servicename(int );
2446 char *lp_pathname(int );
2447 char *lp_dontdescend(int );
2448 char *lp_username(int );
2449 const char **lp_invalid_users(int );
2450 const char **lp_valid_users(int );
2451 const char **lp_admin_users(int );
2452 const char **lp_svcctl_list(void);
2453 char *lp_cups_options(int );
2454 char *lp_cups_server(void);
2455 int lp_cups_encrypt(void);
2456 char *lp_iprint_server(void);
2457 int lp_cups_connection_timeout(void);
2458 const char *lp_ctdbd_socket(void);
2459 const char **lp_cluster_addresses(void);
2460 bool lp_clustering(void);
2461 int lp_ctdb_timeout(void);
2462 int lp_ctdb_locktime_warn_threshold(void);
2463 char *lp_printcommand(int );
2464 char *lp_lpqcommand(int );
2465 char *lp_lprmcommand(int );
2466 char *lp_lppausecommand(int );
2467 char *lp_lpresumecommand(int );
2468 char *lp_queuepausecommand(int );
2469 char *lp_queueresumecommand(int );
2470 const char *lp_printjob_username(int );
2471 const char **lp_hostsallow(int );
2472 const char **lp_hostsdeny(int );
2473 char *lp_magicscript(int );
2474 char *lp_magicoutput(int );
2475 char *lp_comment(int );
2476 char *lp_force_user(int );
2477 char *lp_force_group(int );
2478 const char **lp_readlist(int );
2479 const char **lp_writelist(int );
2480 const char **lp_printer_admin(int );
2481 char *lp_fstype(int );
2482 const char **lp_vfs_objects(int );
2483 char *lp_msdfs_proxy(int );
2484 char *lp_veto_files(int );
2485 char *lp_hide_files(int );
2486 char *lp_veto_oplocks(int );
2487 bool lp_msdfs_root(int );
2488 char *lp_aio_write_behind(int );
2489 char *lp_dfree_command(int );
2490 bool lp_autoloaded(int );
2491 bool lp_preexec_close(int );
2492 bool lp_rootpreexec_close(int );
2493 int lp_casesensitive(int );
2494 bool lp_preservecase(int );
2495 bool lp_shortpreservecase(int );
2496 bool lp_hide_dot_files(int );
2497 bool lp_hide_special_files(int );
2498 bool lp_hideunreadable(int );
2499 bool lp_hideunwriteable_files(int );
2500 bool lp_browseable(int );
2501 bool lp_access_based_share_enum(int );
2502 bool lp_readonly(int );
2503 bool lp_no_set_dir(int );
2504 bool lp_guest_ok(int );
2505 bool lp_guest_only(int );
2506 bool lp_administrative_share(int );
2507 bool lp_print_ok(int );
2508 bool lp_print_notify_backchannel(int );
2509 bool lp_map_hidden(int );
2510 bool lp_map_archive(int );
2511 bool lp_store_dos_attributes(int );
2512 bool lp_dmapi_support(int );
2513 bool lp_locking(const struct share_params *p );
2514 int lp_strict_locking(const struct share_params *p );
2515 bool lp_posix_locking(const struct share_params *p );
2516 bool lp_share_modes(int );
2517 bool lp_oplocks(int );
2518 bool lp_level2_oplocks(int );
2519 bool lp_onlyuser(int );
2520 bool lp_manglednames(const struct share_params *p );
2521 bool lp_widelinks(int );
2522 bool lp_symlinks(int );
2523 bool lp_syncalways(int );
2524 bool lp_strict_allocate(int );
2525 bool lp_strict_sync(int );
2526 bool lp_map_system(int );
2527 bool lp_delete_readonly(int );
2528 bool lp_fake_oplocks(int );
2529 bool lp_recursive_veto_delete(int );
2530 bool lp_dos_filemode(int );
2531 bool lp_dos_filetimes(int );
2532 bool lp_dos_filetime_resolution(int );
2533 bool lp_fake_dir_create_times(int);
2534 bool lp_async_smb_echo_handler(void);
2535 bool lp_multicast_dns_register(void);
2536 bool lp_blocking_locks(int );
2537 bool lp_inherit_perms(int );
2538 bool lp_inherit_acls(int );
2539 bool lp_inherit_owner(int );
2540 bool lp_use_client_driver(int );
2541 bool lp_default_devmode(int );
2542 bool lp_force_printername(int );
2543 bool lp_nt_acl_support(int );
2544 bool lp_force_unknown_acl_user(int );
2545 bool lp_ea_support(int );
2546 bool _lp_use_sendfile(int );
2547 bool lp_profile_acls(int );
2548 bool lp_map_acl_inherit(int );
2549 bool lp_afs_share(int );
2550 bool lp_acl_check_permissions(int );
2551 bool lp_acl_group_control(int );
2552 bool lp_acl_map_full_control(int );
2553 int lp_create_mask(int );
2554 int lp_force_create_mode(int );
2555 int lp_security_mask(int );
2556 int lp_force_security_mode(int );
2557 int lp_dir_mask(int );
2558 int lp_force_dir_mode(int );
2559 int lp_dir_security_mask(int );
2560 int lp_force_dir_security_mode(int );
2561 int lp_max_connections(int );
2562 int lp_defaultcase(int );
2563 int lp_minprintspace(int );
2564 int lp_printing(int );
2565 int lp_max_reported_jobs(int );
2566 int lp_oplock_contention_limit(int );
2567 int lp_csc_policy(int );
2568 int lp_write_cache_size(int );
2569 int lp_block_size(int );
2570 int lp_dfree_cache_time(int );
2571 int lp_allocation_roundup_size(int );
2572 int lp_aio_read_size(int );
2573 int lp_aio_write_size(int );
2574 int lp_map_readonly(int );
2575 int lp_directory_name_cache_size(int );
2576 int lp_smb_encrypt(int );
2577 char lp_magicchar(const struct share_params *p );
2578 int lp_winbind_cache_time(void);
2579 int lp_winbind_reconnect_delay(void);
2580 int lp_winbind_max_clients(void);
2581 const char **lp_winbind_nss_info(void);
2582 int lp_algorithmic_rid_base(void);
2583 int lp_name_cache_timeout(void);
2584 int lp_client_signing(void);
2585 int lp_server_signing(void);
2586 int lp_client_ldap_sasl_wrapping(void);
2587 char *lp_parm_talloc_string(int snum, const char *type, const char *option, const char *def);
2588 const char *lp_parm_const_string(int snum, const char *type, const char *option, const char *def);
2589 const char **lp_parm_string_list(int snum, const char *type, const char *option, const char **def);
2590 int lp_parm_int(int snum, const char *type, const char *option, int def);
2591 unsigned long lp_parm_ulong(int snum, const char *type, const char *option, unsigned long def);
2592 bool lp_parm_bool(int snum, const char *type, const char *option, bool def);
2593 int lp_parm_enum(int snum, const char *type, const char *option,
2594 const struct enum_list *_enum, int def);
2595 char *canonicalize_servicename(TALLOC_CTX *ctx, const char *src);
2596 bool lp_add_home(const char *pszHomename, int iDefaultService,
2597 const char *user, const char *pszHomedir);
2598 int lp_add_service(const char *pszService, int iDefaultService);
2599 bool lp_add_printer(const char *pszPrintername, int iDefaultService);
2600 bool lp_parameter_is_valid(const char *pszParmName);
2601 bool lp_parameter_is_global(const char *pszParmName);
2602 bool lp_parameter_is_canonical(const char *parm_name);
2603 bool lp_canonicalize_parameter(const char *parm_name, const char **canon_parm,
2604 bool *inverse);
2605 bool lp_canonicalize_parameter_with_value(const char *parm_name,
2606 const char *val,
2607 const char **canon_parm,
2608 const char **canon_val);
2609 void show_parameter_list(void);
2610 bool lp_string_is_valid_boolean(const char *parm_value);
2611 bool lp_invert_boolean(const char *str, const char **inverse_str);
2612 bool lp_canonicalize_boolean(const char *str, const char**canon_str);
2613 bool service_ok(int iService);
2614 bool process_registry_service(const char *service_name);
2615 bool process_registry_shares(void);
2616 bool lp_config_backend_is_registry(void);
2617 bool lp_config_backend_is_file(void);
2618 bool lp_file_list_changed(void);
2619 bool lp_idmap_uid(uid_t *low, uid_t *high);
2620 bool lp_idmap_gid(gid_t *low, gid_t *high);
2621 const char *lp_ldap_machine_suffix(void);
2622 const char *lp_ldap_user_suffix(void);
2623 const char *lp_ldap_group_suffix(void);
2624 const char *lp_ldap_idmap_suffix(void);
2625 void *lp_local_ptr_by_snum(int snum, void *ptr);
2626 bool lp_do_parameter(int snum, const char *pszParmName, const char *pszParmValue);
2627 bool lp_set_cmdline(const char *pszParmName, const char *pszParmValue);
2628 bool lp_set_option(const char *option);
2629 void init_locals(void);
2630 bool lp_is_default(int snum, struct parm_struct *parm);
2631 bool dump_a_parameter(int snum, char *parm_name, FILE * f, bool isGlobal);
2632 struct parm_struct *lp_get_parameter(const char *param_name);
2633 struct parm_struct *lp_next_parameter(int snum, int *i, int allparameters);
2634 bool lp_snum_ok(int iService);
2635 void lp_add_one_printer(const char *name, const char *comment, void *pdata);
2636 bool lp_loaded(void);
2637 void lp_killunused(bool (*snumused) (int));
2638 void lp_kill_all_services(void);
2639 void lp_killservice(int iServiceIn);
2640 const char* server_role_str(uint32 role);
2641 enum usershare_err parse_usershare_file(TALLOC_CTX *ctx,
2642 SMB_STRUCT_STAT *psbuf,
2643 const char *servicename,
2644 int snum,
2645 char **lines,
2646 int numlines,
2647 char **pp_sharepath,
2648 char **pp_comment,
2649 char **pp_cp_share_name,
2650 struct security_descriptor **ppsd,
2651 bool *pallow_guest);
2652 int load_usershare_service(const char *servicename);
2653 int load_usershare_shares(void);
2654 void gfree_loadparm(void);
2655 void lp_set_in_client(bool b);
2656 bool lp_is_in_client(void);
2657 bool lp_load(const char *pszFname,
2658 bool global_only,
2659 bool save_defaults,
2660 bool add_ipc,
2661 bool initialize_globals);
2662 bool lp_load_initial_only(const char *pszFname);
2663 bool lp_load_with_registry_shares(const char *pszFname,
2664 bool global_only,
2665 bool save_defaults,
2666 bool add_ipc,
2667 bool initialize_globals);
2668 int lp_numservices(void);
2669 void lp_dump(FILE *f, bool show_defaults, int maxtoprint);
2670 void lp_dump_one(FILE * f, bool show_defaults, int snum);
2671 int lp_servicenumber(const char *pszServiceName);
2672 bool share_defined(const char *service_name);
2673 struct share_params *get_share_params(TALLOC_CTX *mem_ctx,
2674 const char *sharename);
2675 struct share_iterator *share_list_all(TALLOC_CTX *mem_ctx);
2676 struct share_params *next_share(struct share_iterator *list);
2677 struct share_params *next_printer(struct share_iterator *list);
2678 struct share_params *snum2params_static(int snum);
2679 const char *volume_label(int snum);
2680 bool lp_domain_master(void);
2681 bool lp_domain_master_true_or_auto(void);
2682 bool lp_preferred_master(void);
2683 void lp_remove_service(int snum);
2684 void lp_copy_service(int snum, const char *new_name);
2685 int lp_default_server_announce(void);
2686 int lp_major_announce_version(void);
2687 int lp_minor_announce_version(void);
2688 void lp_set_name_resolve_order(const char *new_order);
2689 const char *lp_printername(int snum);
2690 void lp_set_logfile(const char *name);
2691 int lp_maxprintjobs(int snum);
2692 const char *lp_printcapname(void);
2693 bool lp_disable_spoolss( void );
2694 void lp_set_spoolss_state( uint32 state );
2695 uint32 lp_get_spoolss_state( void );
2696 bool lp_use_sendfile(int snum, struct smb_signing_state *signing_state);
2697 void set_use_sendfile(int snum, bool val);
2698 void set_store_dos_attributes(int snum, bool val);
2699 void lp_set_mangling_method(const char *new_method);
2700 bool lp_posix_pathnames(void);
2701 void lp_set_posix_pathnames(void);
2702 enum brl_flavour lp_posix_cifsu_locktype(files_struct *fsp);
2703 void lp_set_posix_default_cifsx_readwrite_locktype(enum brl_flavour val);
2704 int lp_min_receive_file_size(void);
2705 char* lp_perfcount_module(void);
2706 void lp_set_passdb_backend(const char *backend);
2707 void widelinks_warning(int snum);
2708 char *lp_ncalrpc_dir(void);
2710 /* The following definitions come from param/loadparm_server_role.c */
2712 int lp_server_role(void);
2713 void set_server_role(void);
2715 /* The following definitions come from param/util.c */
2717 uint32 get_int_param( const char* param );
2718 char* get_string_param( const char* param );
2720 /* The following definitions come from profile/profile.c */
2722 void set_profile_level(int level, struct server_id src);
2723 bool profile_setup(struct messaging_context *msg_ctx, bool rdonly);
2725 /* The following definitions come from librpc/rpc/rpc_common.c */
2727 bool smb_register_ndr_interface(const struct ndr_interface_table *interface);
2728 const struct ndr_interface_table *get_iface_from_syntax(
2729 const struct ndr_syntax_id *syntax);
2730 const char *get_pipe_name_from_syntax(TALLOC_CTX *mem_ctx,
2731 const struct ndr_syntax_id *syntax);
2733 /* The following definitions come from rpc_server/rpc_ncacn_np.c */
2734 struct auth_serversupplied_info;
2735 struct pipes_struct *make_internal_rpc_pipe_p(TALLOC_CTX *mem_ctx,
2736 const struct ndr_syntax_id *syntax,
2737 struct client_address *client_id,
2738 const struct auth_serversupplied_info *session_info,
2739 struct messaging_context *msg_ctx);
2740 NTSTATUS rpcint_binding_handle(TALLOC_CTX *mem_ctx,
2741 const struct ndr_interface_table *ndr_table,
2742 struct client_address *client_id,
2743 const struct auth_serversupplied_info *session_info,
2744 struct messaging_context *msg_ctx,
2745 struct dcerpc_binding_handle **binding_handle);
2746 NTSTATUS rpc_pipe_open_internal(TALLOC_CTX *mem_ctx,
2747 const struct ndr_syntax_id *abstract_syntax,
2748 const struct auth_serversupplied_info *serversupplied_info,
2749 struct client_address *client_id,
2750 struct messaging_context *msg_ctx,
2751 struct rpc_pipe_client **presult);
2752 NTSTATUS rpc_pipe_open_interface(TALLOC_CTX *mem_ctx,
2753 const struct ndr_syntax_id *syntax,
2754 const struct auth_serversupplied_info *session_info,
2755 struct client_address *client_id,
2756 struct messaging_context *msg_ctx,
2757 struct rpc_pipe_client **cli_pipe);
2759 /* The following definitions come from rpc_client/cli_pipe_schannel.c */
2761 NTSTATUS get_schannel_session_key(struct cli_state *cli,
2762 const char *domain,
2763 uint32 *pneg_flags,
2764 struct rpc_pipe_client **presult);
2766 /* The following definitions come from rpc_server/rpc_handles.c */
2768 size_t num_pipe_handles(struct pipes_struct *p);
2769 bool init_pipe_handles(struct pipes_struct *p, const struct ndr_syntax_id *syntax);
2770 bool create_policy_hnd(struct pipes_struct *p, struct policy_handle *hnd, void *data_ptr);
2771 bool find_policy_by_hnd(struct pipes_struct *p, const struct policy_handle *hnd,
2772 void **data_p);
2773 bool close_policy_hnd(struct pipes_struct *p, struct policy_handle *hnd);
2774 void close_policy_by_pipe(struct pipes_struct *p);
2775 bool pipe_access_check(struct pipes_struct *p);
2777 void *_policy_handle_create(struct pipes_struct *p, struct policy_handle *hnd,
2778 uint32_t access_granted, size_t data_size,
2779 const char *type, NTSTATUS *pstatus);
2780 #define policy_handle_create(_p, _hnd, _access, _type, _pstatus) \
2781 (_type *)_policy_handle_create((_p), (_hnd), (_access), sizeof(_type), #_type, \
2782 (_pstatus))
2784 void *_policy_handle_find(struct pipes_struct *p,
2785 const struct policy_handle *hnd,
2786 uint32_t access_required, uint32_t *paccess_granted,
2787 const char *name, const char *location,
2788 NTSTATUS *pstatus);
2789 #define policy_handle_find(_p, _hnd, _access_required, _access_granted, _type, _pstatus) \
2790 (_type *)_policy_handle_find((_p), (_hnd), (_access_required), \
2791 (_access_granted), #_type, __location__, (_pstatus))
2794 /* The following definitions come from rpc_server/srv_rpc_register.c */
2796 struct rpc_srv_callbacks {
2797 bool (*init)(void *private_data);
2798 bool (*shutdown)(void *private_data);
2799 void *private_data;
2802 struct api_struct;
2803 NTSTATUS rpc_srv_register(int version, const char *clnt,
2804 const char *srv,
2805 const struct ndr_interface_table *iface,
2806 const struct api_struct *cmds, int size,
2807 const struct rpc_srv_callbacks *rpc_srv_cb);
2809 NTSTATUS rpc_srv_unregister(const struct ndr_interface_table *iface);
2811 /* The following definitions come from rpc_server/srv_pipe.c */
2813 bool create_next_pdu(struct pipes_struct *p);
2814 bool api_pipe_bind_auth3(struct pipes_struct *p, struct ncacn_packet *pkt);
2815 bool setup_fault_pdu(struct pipes_struct *p, NTSTATUS status);
2816 NTSTATUS rpc_pipe_register_commands(int version, const char *clnt,
2817 const char *srv,
2818 const struct ndr_syntax_id *interface,
2819 const struct api_struct *cmds, int size);
2820 bool is_known_pipename(const char *cli_filename, struct ndr_syntax_id *syntax);
2822 /* The following definitions come from rpc_server/srv_pipe_hnd.c */
2824 struct pipes_struct *get_first_internal_pipe(void);
2825 struct pipes_struct *get_next_internal_pipe(struct pipes_struct *p);
2826 bool check_open_pipes(void);
2827 int close_internal_rpc_pipe_hnd(struct pipes_struct *p);
2829 bool fsp_is_np(struct files_struct *fsp);
2830 struct tsocket_address;
2831 NTSTATUS np_open(TALLOC_CTX *mem_ctx, const char *name,
2832 const struct tsocket_address *local_address,
2833 const struct tsocket_address *remote_address,
2834 struct client_address *client_id,
2835 struct auth_serversupplied_info *session_info,
2836 struct messaging_context *msg_ctx,
2837 struct fake_file_handle **phandle);
2838 bool np_read_in_progress(struct fake_file_handle *handle);
2839 struct tevent_req *np_write_send(TALLOC_CTX *mem_ctx, struct event_context *ev,
2840 struct fake_file_handle *handle,
2841 const uint8_t *data, size_t len);
2842 NTSTATUS np_write_recv(struct tevent_req *req, ssize_t *pnwritten);
2843 struct tevent_req *np_read_send(TALLOC_CTX *mem_ctx, struct event_context *ev,
2844 struct fake_file_handle *handle,
2845 uint8_t *data, size_t len);
2846 NTSTATUS np_read_recv(struct tevent_req *req, ssize_t *nread,
2847 bool *is_data_outstanding);
2849 ssize_t process_incoming_data(struct pipes_struct *p, char *data, size_t n);
2851 /* The following definitions come from rpc_server/srv_spoolss_nt.c */
2852 void srv_spoolss_cleanup(void);
2854 void do_drv_upgrade_printer(struct messaging_context *msg,
2855 void *private_data,
2856 uint32_t msg_type,
2857 struct server_id server_id,
2858 DATA_BLOB *data);
2859 void update_monitored_printq_cache(struct messaging_context *msg_ctx);
2861 /* The following definitions come from rpc_server/srv_srvsvc_nt.c */
2863 char *valid_share_pathname(TALLOC_CTX *ctx, const char *dos_pathname);
2865 /* The following definitions come from rpc_server/srv_svcctl_nt.c */
2867 bool init_service_op_table( void );
2868 bool shutdown_service_op_table(void);
2870 /* The following definitions come from lib/server_contexts.c */
2871 struct tevent_context *server_event_context(void);
2872 void server_event_context_free(void);
2873 struct messaging_context *server_messaging_context(void);
2874 void server_messaging_context_free(void);
2876 /* The following definitions come from lib/sessionid_tdb.c */
2877 struct sessionid;
2878 bool sessionid_init(void);
2879 struct db_record *sessionid_fetch_record(TALLOC_CTX *mem_ctx, const char *key);
2880 int sessionid_traverse(int (*fn)(struct db_record *rec, const char *key,
2881 struct sessionid *session,
2882 void *private_data),
2883 void *private_data);
2884 int sessionid_traverse_read(int (*fn)(const char *key,
2885 struct sessionid *session,
2886 void *private_data),
2887 void *private_data);
2889 /* The following definitions come from utils/passwd_util.c */
2891 char *stdin_new_passwd( void);
2892 char *get_pass( const char *prompt, bool stdin_get);
2894 /* The following definitions come from winbindd/nss_info.c */
2897 /* The following definitions come from winbindd/nss_info_template.c */
2899 NTSTATUS nss_info_template_init( void );
2901 /* The following definitions come from lib/avahi.c */
2903 struct AvahiPoll *tevent_avahi_poll(TALLOC_CTX *mem_ctx,
2904 struct tevent_context *ev);
2906 /* The following definitions come from lib/fncall.c */
2908 struct fncall_context *fncall_context_init(TALLOC_CTX *mem_ctx,
2909 int max_threads);
2910 struct tevent_req *fncall_send(TALLOC_CTX *mem_ctx, struct tevent_context *ev,
2911 struct fncall_context *ctx,
2912 void (*fn)(void *private_data),
2913 void *private_data);
2914 int fncall_recv(struct tevent_req *req, int *perr);
2916 /* The following definitions come from libsmb/smbsock_connect.c */
2918 struct tevent_req *smbsock_connect_send(TALLOC_CTX *mem_ctx,
2919 struct tevent_context *ev,
2920 const struct sockaddr_storage *addr,
2921 uint16_t port,
2922 const char *called_name,
2923 int called_type,
2924 const char *calling_name,
2925 int calling_type);
2926 NTSTATUS smbsock_connect_recv(struct tevent_req *req, int *sock,
2927 uint16_t *ret_port);
2928 NTSTATUS smbsock_connect(const struct sockaddr_storage *addr, uint16_t port,
2929 const char *called_name, int called_type,
2930 const char *calling_name, int calling_type,
2931 int *pfd, uint16_t *ret_port);
2933 struct tevent_req *smbsock_any_connect_send(TALLOC_CTX *mem_ctx,
2934 struct tevent_context *ev,
2935 const struct sockaddr_storage *addrs,
2936 const char **called_names,
2937 int *called_types,
2938 const char **calling_names,
2939 int *calling_types,
2940 size_t num_addrs, uint16_t port);
2941 NTSTATUS smbsock_any_connect_recv(struct tevent_req *req, int *pfd,
2942 size_t *chosen_index, uint16_t *chosen_port);
2943 NTSTATUS smbsock_any_connect(const struct sockaddr_storage *addrs,
2944 const char **called_names,
2945 int *called_types,
2946 const char **calling_names,
2947 int *calling_types,
2948 size_t num_addrs,
2949 uint16_t port,
2950 int *pfd, size_t *chosen_index,
2951 uint16_t *chosen_port);
2953 /* The following definitions come from lib/util_wellknown.c */
2955 bool sid_check_is_wellknown_domain(const struct dom_sid *sid, const char **name);
2956 bool sid_check_is_in_wellknown_domain(const struct dom_sid *sid);
2957 bool lookup_wellknown_sid(TALLOC_CTX *mem_ctx, const struct dom_sid *sid,
2958 const char **domain, const char **name);
2959 bool lookup_wellknown_name(TALLOC_CTX *mem_ctx, const char *name,
2960 struct dom_sid *sid, const char **domain);
2962 /* The following definitions come from lib/util_unixsids.c */
2964 bool sid_check_is_unix_users(const struct dom_sid *sid);
2965 bool sid_check_is_in_unix_users(const struct dom_sid *sid);
2966 void uid_to_unix_users_sid(uid_t uid, struct dom_sid *sid);
2967 void gid_to_unix_groups_sid(gid_t gid, struct dom_sid *sid);
2968 const char *unix_users_domain_name(void);
2969 bool lookup_unix_user_name(const char *name, struct dom_sid *sid);
2970 bool sid_check_is_unix_groups(const struct dom_sid *sid);
2971 bool sid_check_is_in_unix_groups(const struct dom_sid *sid);
2972 const char *unix_groups_domain_name(void);
2973 bool lookup_unix_group_name(const char *name, struct dom_sid *sid);
2975 /* The following definitions come from lib/filename_util.c */
2977 NTSTATUS get_full_smb_filename(TALLOC_CTX *ctx, const struct smb_filename *smb_fname,
2978 char **full_name);
2979 NTSTATUS create_synthetic_smb_fname(TALLOC_CTX *ctx, const char *base_name,
2980 const char *stream_name,
2981 const SMB_STRUCT_STAT *psbuf,
2982 struct smb_filename **smb_fname_out);
2983 NTSTATUS create_synthetic_smb_fname_split(TALLOC_CTX *ctx,
2984 const char *fname,
2985 const SMB_STRUCT_STAT *psbuf,
2986 struct smb_filename **smb_fname_out);
2987 const char *smb_fname_str_dbg(const struct smb_filename *smb_fname);
2988 const char *fsp_str_dbg(const struct files_struct *fsp);
2989 NTSTATUS copy_smb_filename(TALLOC_CTX *ctx,
2990 const struct smb_filename *smb_fname_in,
2991 struct smb_filename **smb_fname_out);
2992 bool is_ntfs_stream_smb_fname(const struct smb_filename *smb_fname);
2993 bool is_ntfs_default_stream_smb_fname(const struct smb_filename *smb_fname);
2995 /* The following definitions come from lib/dummyroot.c */
2997 void become_root(void);
2998 void unbecome_root(void);
3000 /* The following definitions come from lib/dummysmbd.c */
3002 int find_service(TALLOC_CTX *ctx, const char *service_in, char **p_service_out);
3003 bool conn_snum_used(int snum);
3004 void cancel_pending_lock_requests_by_fid(files_struct *fsp,
3005 struct byte_range_lock *br_lck,
3006 enum file_close_type close_type);
3007 void send_stat_cache_delete_message(struct messaging_context *msg_ctx,
3008 const char *name);
3009 NTSTATUS can_delete_directory(struct connection_struct *conn,
3010 const char *dirname);
3011 bool change_to_root_user(void);
3012 struct event_context *smbd_event_context(void);
3013 void contend_level2_oplocks_begin(files_struct *fsp,
3014 enum level2_contention_type type);
3015 void contend_level2_oplocks_end(files_struct *fsp,
3016 enum level2_contention_type type);
3018 #endif /* _PROTO_H_ */