s3: file_walk_table -> files_forall
[kai/samba-autobuild/.git] / source3 / include / proto.h
index c10a885396c486f30431d9877e1f7b924bad96e8..69fd591057c78c1ea08a1e8244d09071995a7572 100644 (file)
@@ -420,8 +420,6 @@ void clobber_region(const char *fn, unsigned int line, char *dest, size_t len);
 
 /* The following definitions come from lib/conn_tdb.c  */
 
-struct db_record *connections_fetch_record(TALLOC_CTX *mem_ctx,
-                                          TDB_DATA key);
 struct db_record *connections_fetch_entry(TALLOC_CTX *mem_ctx,
                                          connection_struct *conn,
                                          const char *name);
@@ -433,6 +431,10 @@ int connections_forall(int (*fn)(struct db_record *rec,
                                 const struct connections_data *data,
                                 void *private_data),
                       void *private_data);
+int connections_forall_read(int (*fn)(const struct connections_key *key,
+                                     const struct connections_data *data,
+                                     void *private_data),
+                           void *private_data);
 bool connections_init(bool rw);
 
 /* The following definitions come from lib/dbwrap_util.c  */
@@ -1203,9 +1205,9 @@ uint32 map_share_mode_to_deny_mode(uint32 share_access, uint32 private_options);
 pid_t procid_to_pid(const struct server_id *proc);
 void set_my_vnn(uint32 vnn);
 uint32 get_my_vnn(void);
+void set_my_unique_id(uint64_t unique_id);
 struct server_id pid_to_procid(pid_t pid);
 struct server_id procid_self(void);
-struct server_id server_id_self(void);
 bool procid_equal(const struct server_id *p1, const struct server_id *p2);
 bool cluster_id_equal(const struct server_id *id1,
                      const struct server_id *id2);
@@ -1372,7 +1374,6 @@ char *print_sockaddr(char *dest,
                        const struct sockaddr_storage *psa);
 char *print_canonical_sockaddr(TALLOC_CTX *ctx,
                        const struct sockaddr_storage *pss);
-void set_sockaddr_port(struct sockaddr *psa, uint16_t port);
 const char *client_name(int fd);
 int get_socket_port(int fd);
 const char *client_addr(int fd, char *addr, size_t addrlen);
@@ -1749,9 +1750,6 @@ NTSTATUS ads_dns_lookup_ns(TALLOC_CTX *ctx,
                                const char *dnsdomain,
                                struct dns_rr_ns **nslist,
                                int *numns);
-bool sitename_store(const char *realm, const char *sitename);
-char *sitename_fetch(const char *realm);
-bool stored_sitename_changed(const char *realm, const char *sitename);
 NTSTATUS ads_dns_query_dcs(TALLOC_CTX *ctx,
                           const char *realm,
                           const char *sitename,
@@ -2137,17 +2135,6 @@ _PUBLIC_ NTSTATUS dcerpc_binding_build_tower(TALLOC_CTX *mem_ctx,
                                             const struct dcerpc_binding *binding,
                                             struct epm_tower *tower);
 
-/* The following definitions come from librpc/rpc/dcerpc.c  */
-
-struct rpc_request *dcerpc_ndr_request_send(struct dcerpc_pipe *p, const struct GUID *object, 
-                                           const struct ndr_interface_table *table, uint32_t opnum, 
-                                           TALLOC_CTX *mem_ctx, void *r);
-NTSTATUS dcerpc_ndr_request_recv(struct rpc_request *req);
-_PUBLIC_ NTSTATUS dcerpc_pipe_connect(TALLOC_CTX *parent_ctx, struct dcerpc_pipe **pp, 
-                                     const char *binding_string, const struct ndr_interface_table *table, 
-                                     struct cli_credentials *credentials, struct event_context *ev, 
-                                     struct loadparm_context *lp_ctx);
-
 /* The following definitions come from libsmb/cliconnect.c  */
 
 ADS_STATUS cli_session_setup_spnego(struct cli_state *cli, const char *user, 
@@ -2327,6 +2314,13 @@ NTSTATUS cli_echo_recv(struct tevent_req *req);
 NTSTATUS cli_echo(struct cli_state *cli, uint16_t num_echos, DATA_BLOB data);
 bool cli_ucs2(struct cli_state *cli);
 bool is_andx_req(uint8_t cmd);
+NTSTATUS cli_smb(TALLOC_CTX *mem_ctx, struct cli_state *cli,
+                uint8_t smb_command, uint8_t additional_flags,
+                uint8_t wct, uint16_t *vwv,
+                uint32_t num_bytes, const uint8_t *bytes,
+                struct tevent_req **result_parent,
+                uint8_t min_wct, uint8_t *pwct, uint16_t **pvwv,
+                uint32_t *pnum_bytes, uint8_t **pbytes);
 
 /* The following definitions come from libsmb/clierror.c  */
 
@@ -2839,8 +2833,8 @@ bool cli_qfileinfo(struct cli_state *cli, uint16_t fnum,
                    struct timespec *write_time,
                   struct timespec *change_time,
                    SMB_INO_T *ino);
-bool cli_qpathinfo_basic( struct cli_state *cli, const char *name,
-                          SMB_STRUCT_STAT *sbuf, uint32 *attributes );
+NTSTATUS cli_qpathinfo_basic(struct cli_state *cli, const char *name,
+                            SMB_STRUCT_STAT *sbuf, uint32 *attributes);
 bool cli_qfileinfo_test(struct cli_state *cli, uint16_t fnum, int level, char **poutdata, uint32 *poutlen);
 NTSTATUS cli_qpathinfo_alt_name(struct cli_state *cli, const char *fname, fstring alt_name);
 
@@ -4404,8 +4398,9 @@ char* get_string_param( const char* param );
 
 bool login_cache_init(void);
 bool login_cache_shutdown(void);
-LOGIN_CACHE * login_cache_read(struct samu *sampass);
-bool login_cache_write(const struct samu *sampass, LOGIN_CACHE entry);
+bool login_cache_read(struct samu *sampass, struct login_cache *entry);
+bool login_cache_write(const struct samu *sampass,
+                      const struct login_cache *entry);
 bool login_cache_delentry(const struct samu *sampass);
 
 /* The following definitions come from passdb/lookup_sid.c  */
@@ -4743,15 +4738,6 @@ bool secrets_delete_generic(const char *owner, const char *key);
 bool secrets_store_local_schannel_key(uint8_t schannel_key[16]);
 bool secrets_fetch_local_schannel_key(uint8_t schannel_key[16]);
 
-/* The following definitions come from passdb/secrets_schannel.c  */
-
-TDB_CONTEXT *open_schannel_session_store(TALLOC_CTX *mem_ctx);
-NTSTATUS schannel_fetch_session_key(TALLOC_CTX *mem_ctx,
-                                   const char *computer_name,
-                                   struct netlogon_creds_CredentialState **pcreds);
-NTSTATUS schannel_store_session_key(TALLOC_CTX *mem_ctx,
-                                   struct netlogon_creds_CredentialState *creds);
-
 /* The following definitions come from passdb/util_builtin.c  */
 
 bool lookup_builtin_rid(TALLOC_CTX *mem_ctx, uint32 rid, const char **name);
@@ -5582,7 +5568,8 @@ WERROR rpccli_spoolss_getprinterdata(struct rpc_pipe_client *cli,
                                     const char *value_name,
                                     uint32_t offered,
                                     enum winreg_Type *type,
-                                    union spoolss_PrinterData *data);
+                                    uint32_t *needed_p,
+                                    uint8_t **data_p);
 WERROR rpccli_spoolss_enumprinterkey(struct rpc_pipe_client *cli,
                                     TALLOC_CTX *mem_ctx,
                                     struct policy_handle *handle,
@@ -6163,7 +6150,6 @@ void msg_force_tdis(struct messaging_context *msg,
 
 bool yield_connection(connection_struct *conn, const char *name);
 int count_current_connections( const char *sharename, bool clear  );
-int count_all_current_connections(void);
 bool claim_connection(connection_struct *conn, const char *name,
                      uint32 msg_flags);
 bool register_message_flags(bool doreg, uint32 msg_flags);
@@ -6392,7 +6378,7 @@ void file_close_pid(uint16 smbpid, int vuid);
 void file_init(void);
 void file_close_user(int vuid);
 void file_dump_open_table(void);
-struct files_struct *file_walk_table(
+struct files_struct *files_forall(
        struct files_struct *(*fn)(struct files_struct *fsp,
                                   void *private_data),
        void *private_data);
@@ -6598,10 +6584,11 @@ void reply_nttranss(struct smb_request *req);
 
 /* The following definitions come from smbd/open.c  */
 
-NTSTATUS smb1_file_se_access_check(const struct security_descriptor *sd,
-                          const NT_USER_TOKEN *token,
-                          uint32_t access_desired,
-                          uint32_t *access_granted);
+NTSTATUS smb1_file_se_access_check(connection_struct *conn,
+                               const struct security_descriptor *sd,
+                               const NT_USER_TOKEN *token,
+                               uint32_t access_desired,
+                               uint32_t *access_granted);
 NTSTATUS fd_close(files_struct *fsp);
 void change_file_owner_to_parent(connection_struct *conn,
                                 const char *inherit_from_dir,
@@ -6635,7 +6622,8 @@ bool map_open_params_to_ntcreate(const struct smb_filename *smb_fname,
                                 uint32 *paccess_mask,
                                 uint32 *pshare_mode,
                                 uint32 *pcreate_disposition,
-                                uint32 *pcreate_options);
+                                uint32 *pcreate_options,
+                                uint32_t *pprivate_flags);
 NTSTATUS open_file_fchmod(struct smb_request *req, connection_struct *conn,
                          struct smb_filename *smb_fname,
                          files_struct **result);
@@ -6660,6 +6648,7 @@ NTSTATUS create_file_default(connection_struct *conn,
                             uint32_t file_attributes,
                             uint32_t oplock_request,
                             uint64_t allocation_size,
+                            uint32_t private_flags,
                             struct security_descriptor *sd,
                             struct ea_list *ea_list,
 
@@ -6754,7 +6743,7 @@ uint32_t map_canon_ace_perms(int snum,
                                 enum security_ace_type *pacl_type,
                                 mode_t perms,
                                 bool directory_ace);
-NTSTATUS unpack_nt_owners(int snum, uid_t *puser, gid_t *pgrp, uint32 security_info_sent, const SEC_DESC *psd);
+NTSTATUS unpack_nt_owners(connection_struct *conn, uid_t *puser, gid_t *pgrp, uint32 security_info_sent, const SEC_DESC *psd);
 SMB_ACL_T free_empty_sys_acl(connection_struct *conn, SMB_ACL_T the_acl);
 NTSTATUS posix_fget_nt_acl(struct files_struct *fsp, uint32_t security_info,
                           SEC_DESC **ppdesc);
@@ -7012,6 +7001,19 @@ bool session_claim(user_struct *vuser);
 void session_yield(user_struct *vuser);
 int list_sessions(TALLOC_CTX *mem_ctx, struct sessionid **session_list);
 
+/* The following definitions come from lib/sessionid_tdb.c  */
+
+bool sessionid_init(void);
+struct db_record *sessionid_fetch_record(TALLOC_CTX *mem_ctx, const char *key);
+int sessionid_traverse(int (*fn)(struct db_record *rec, const char *key,
+                                struct sessionid *session,
+                                void *private_data),
+                      void *private_data);
+int sessionid_traverse_read(int (*fn)(const char *key,
+                                     struct sessionid *session,
+                                     void *private_data),
+                           void *private_data);
+
 /* The following definitions come from smbd/sesssetup.c  */
 
 NTSTATUS parse_spnego_mechanisms(DATA_BLOB blob_in,
@@ -7105,6 +7107,11 @@ void become_root(void);
 void unbecome_root(void);
 bool become_user(connection_struct *conn, uint16 vuid);
 bool unbecome_user(void);
+uid_t get_current_uid(connection_struct *conn);
+gid_t get_current_gid(connection_struct *conn);
+const UNIX_USER_TOKEN *get_current_utok(connection_struct *conn);
+const NT_USER_TOKEN *get_current_nttok(connection_struct *conn);
+uint16_t get_current_vuid(connection_struct *conn);
 
 /* The following definitions come from smbd/utmp.c  */