s3-schannel: remove remaining code that was using "struct dcinfo".
[ira/wip.git] / source3 / include / proto.h
index 6d9c35beb01d9bc7ae33b55d95f6747ea7e64e18..b87e3b7f9193e49455576fe67f3085c308f8f092 100644 (file)
@@ -442,8 +442,16 @@ bool dbwrap_fetch_uint32(struct db_context *db, const char *keystr,
 int dbwrap_store_uint32(struct db_context *db, const char *keystr, uint32_t v);
 NTSTATUS dbwrap_change_uint32_atomic(struct db_context *db, const char *keystr,
                                     uint32_t *oldval, uint32_t change_val);
+NTSTATUS dbwrap_trans_change_uint32_atomic(struct db_context *db,
+                                          const char *keystr,
+                                          uint32_t *oldval,
+                                          uint32_t change_val);
 NTSTATUS dbwrap_change_int32_atomic(struct db_context *db, const char *keystr,
-                                   int32 *oldval, int32 change_val);
+                                   int32_t *oldval, int32_t change_val);
+NTSTATUS dbwrap_trans_change_int32_atomic(struct db_context *db,
+                                         const char *keystr,
+                                         int32_t *oldval,
+                                         int32_t change_val);
 NTSTATUS dbwrap_trans_store(struct db_context *db, TDB_DATA key, TDB_DATA dbuf,
                            int flag);
 NTSTATUS dbwrap_trans_delete(struct db_context *db, TDB_DATA key);
@@ -713,6 +721,7 @@ struct named_mutex *grab_named_mutex(TALLOC_CTX *mem_ctx, const char *name,
 
 /* The following definitions come from lib/sharesec.c  */
 
+bool share_info_db_init(void);
 SEC_DESC *get_share_security_default( TALLOC_CTX *ctx, size_t *psize, uint32 def_access);
 SEC_DESC *get_share_security( TALLOC_CTX *ctx, const char *servicename,
                              size_t *psize);
@@ -1020,7 +1029,8 @@ char *current_timestring(TALLOC_CTX *ctx, bool hires);
 void srv_put_dos_date(char *buf,int offset,time_t unixdate);
 void srv_put_dos_date2(char *buf,int offset, time_t unixdate);
 void srv_put_dos_date3(char *buf,int offset,time_t unixdate);
-void put_long_date_timespec(char *p, struct timespec ts);
+void round_timespec(enum timestamp_set_resolution res, struct timespec *ts);
+void put_long_date_timespec(enum timestamp_set_resolution res, char *p, struct timespec ts);
 void put_long_date(char *p, time_t t);
 void dos_filetime_timespec(struct timespec *tsp);
 time_t make_unix_date2(const void *date_ptr, int zone_offset);
@@ -1036,6 +1046,8 @@ struct timespec timespec_current(void);
 struct timespec timespec_min(const struct timespec *ts1,
                           const struct timespec *ts2);
 int timespec_compare(const struct timespec *ts1, const struct timespec *ts2);
+void round_timespec_to_sec(struct timespec *ts);
+void round_timespec_to_usec(struct timespec *ts);
 struct timespec interpret_long_date(const char *p);
 void cli_put_dos_date(struct cli_state *cli, char *buf, int offset, time_t unixdate);
 void cli_put_dos_date2(struct cli_state *cli, char *buf, int offset, time_t unixdate);
@@ -1794,23 +1806,6 @@ bool create_local_private_krb5_conf_for_domain(const char *realm,
                                                const char *sitename,
                                                struct sockaddr_storage *pss);
 
-
-/* The following definitions come from libsmb/credentials.c  */
-
-char *credstr(const unsigned char *cred);
-void creds_server_init(uint32 neg_flags,
-                       struct dcinfo *dc,
-                       struct netr_Credential *clnt_chal,
-                       struct netr_Credential *srv_chal,
-                       const unsigned char mach_pw[16],
-                       struct netr_Credential *init_chal_out);
-bool netlogon_creds_server_check(const struct dcinfo *dc,
-                                const struct netr_Credential *rcv_cli_chal_in);
-bool netlogon_creds_server_step(struct dcinfo *dc,
-                               const struct netr_Authenticator *received_cred,
-                               struct netr_Authenticator *cred_out);
-void cred_hash3(unsigned char *out, const unsigned char *in, const unsigned char *key, int forw);
-
 /* The following definitions come from libads/kerberos_keytab.c  */
 
 int ads_keytab_add_entry(ADS_STRUCT *ads, const char *srvPrinc);
@@ -3053,7 +3048,7 @@ void debug_dsdcinfo_flags(int lvl, uint32_t flags);
 NTSTATUS dsgetdcname(TALLOC_CTX *mem_ctx,
                     struct messaging_context *msg_ctx,
                     const char *domain_name,
-                    struct GUID *domain_guid,
+                    const struct GUID *domain_guid,
                     const char *site_name,
                     uint32_t flags,
                     struct netr_DsRGetDCNameInfo **info);
@@ -3987,6 +3982,7 @@ bool lp_winbind_refresh_tickets(void);
 bool lp_winbind_offline_logon(void);
 bool lp_winbind_normalize_names(void);
 bool lp_winbind_rpc_only(void);
+bool lp_create_krb5_conf(void);
 const char **lp_idmap_domains(void);
 const char *lp_idmap_backend(void);
 char *lp_idmap_alloc_backend(void);
@@ -4179,6 +4175,7 @@ bool lp_administrative_share(int );
 bool lp_print_ok(int );
 bool lp_map_hidden(int );
 bool lp_map_archive(int );
+bool lp_store_create_time(int );
 bool lp_store_dos_attributes(int );
 bool lp_dmapi_support(int );
 bool lp_locking(const struct share_params *p );
@@ -4718,17 +4715,20 @@ NTSTATUS secrets_trusted_domains(TALLOC_CTX *mem_ctx, uint32 *num_domains,
 bool secrets_store_afs_keyfile(const char *cell, const struct afs_keyfile *keyfile);
 bool secrets_fetch_afs_key(const char *cell, struct afs_key *result);
 void secrets_fetch_ipc_userpass(char **username, char **domain, char **password);
-bool secrets_store_schannel_session_info(TALLOC_CTX *mem_ctx,
-                                        const char *remote_machine,
-                                        const struct dcinfo *pdc);
-bool secrets_restore_schannel_session_info(TALLOC_CTX *mem_ctx,
-                                          const char *remote_machine,
-                                          struct dcinfo **ppdc);
+TDB_CONTEXT *open_schannel_session_store(TALLOC_CTX *mem_ctx);
 bool secrets_store_generic(const char *owner, const char *key, const char *secret);
 char *secrets_fetch_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  */
+
+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);
@@ -6136,9 +6136,7 @@ connection_struct *conn_new(struct smbd_server_connection *sconn);
 bool conn_close_all(struct smbd_server_connection *sconn);
 bool conn_idle_all(struct smbd_server_connection *sconn, time_t t);
 void conn_clear_vuid_caches(struct smbd_server_connection *sconn, uint16 vuid);
-void conn_free_internal(connection_struct *conn);
-void conn_free(struct smbd_server_connection *sconn,
-              connection_struct *conn);
+void conn_free(connection_struct *conn);
 void msg_force_tdis(struct messaging_context *msg,
                    void *private_data,
                    uint32_t msg_type,
@@ -6175,14 +6173,15 @@ bool make_dir_struct(TALLOC_CTX *ctx,
                        uint32 mode,
                        time_t date,
                        bool uc);
-void init_dptrs(void);
-char *dptr_path(int key);
-char *dptr_wcard(int key);
-uint16 dptr_attr(int key);
-void dptr_close(int *key);
+bool init_dptrs(struct smbd_server_connection *sconn);
+char *dptr_path(struct smbd_server_connection *sconn, int key);
+char *dptr_wcard(struct smbd_server_connection *sconn, int key);
+uint16 dptr_attr(struct smbd_server_connection *sconn, int key);
+void dptr_close(struct smbd_server_connection *sconn, int *key);
 void dptr_closecnum(connection_struct *conn);
 void dptr_idlecnum(connection_struct *conn);
-void dptr_closepath(char *path,uint16 spid);
+void dptr_closepath(struct smbd_server_connection *sconn,
+                   char *path,uint16 spid);
 NTSTATUS dptr_create(connection_struct *conn, const char *path, bool old_handle, bool expect_close,uint16 spid,
                const char *wcard, bool wcard_has_wild, uint32 attr, struct dptr_struct **dptr_ret);
 int dptr_CloseDir(struct dptr_struct *dptr);
@@ -6197,12 +6196,15 @@ char *dptr_ReadDirName(TALLOC_CTX *ctx,
 bool dptr_SearchDir(struct dptr_struct *dptr, const char *name, long *poffset, SMB_STRUCT_STAT *pst);
 void dptr_DirCacheAdd(struct dptr_struct *dptr, const char *name, long offset);
 void dptr_init_search_op(struct dptr_struct *dptr);
-bool dptr_fill(char *buf1,unsigned int key);
-struct dptr_struct *dptr_fetch(char *buf,int *num);
-struct dptr_struct *dptr_fetch_lanman2(int dptr_num);
+bool dptr_fill(struct smbd_server_connection *sconn,
+              char *buf1,unsigned int key);
+struct dptr_struct *dptr_fetch(struct smbd_server_connection *sconn,
+                              char *buf,int *num);
+struct dptr_struct *dptr_fetch_lanman2(struct smbd_server_connection *sconn,
+                                      int dptr_num);
 bool dir_check_ftype(connection_struct *conn, uint32 mode, uint32 dirtype);
 bool get_dir_entry(TALLOC_CTX *ctx,
-               connection_struct *conn,
+               struct dptr_struct *dirptr,
                const char *mask,
                uint32 dirtype,
                char **pp_fname_out,
@@ -6256,6 +6258,19 @@ bool set_sticky_write_time_fsp(struct files_struct *fsp,
                               struct timespec mtime);
 bool update_write_time(struct files_struct *fsp);
 
+NTSTATUS set_create_timespec_ea(connection_struct *conn,
+                               struct files_struct *fsp,
+                               const struct smb_filename *smb_fname,
+                               struct timespec create_time);
+
+struct timespec get_create_timespec(connection_struct *conn,
+                               struct files_struct *fsp,
+                               const struct smb_filename *smb_fname);
+
+struct timespec get_change_timespec(connection_struct *conn,
+                               struct files_struct *fsp,
+                               const struct smb_filename *smb_fname);
+
 /* The following definitions come from smbd/error.c  */
 
 bool use_nt_status(void);
@@ -6737,7 +6752,8 @@ int chmod_acl(connection_struct *conn, const char *name, mode_t mode);
 int inherit_access_posix_acl(connection_struct *conn, const char *inherit_from_dir,
                       const char *name, mode_t mode);
 int fchmod_acl(files_struct *fsp, mode_t mode);
-bool set_unix_posix_default_acl(connection_struct *conn, const char *fname, SMB_STRUCT_STAT *psbuf,
+bool set_unix_posix_default_acl(connection_struct *conn, const char *fname,
+                               const SMB_STRUCT_STAT *psbuf,
                                uint16 num_def_acls, const char *pdata);
 bool set_unix_posix_acl(connection_struct *conn, files_struct *fsp, const char *fname, uint16 num_acls, const char *pdata);
 SEC_DESC *get_nt_acl_no_snum( TALLOC_CTX *ctx, const char *fname);
@@ -6975,8 +6991,7 @@ connection_struct *make_connection(struct smbd_server_connection *sconn,
                                   const char *service_in, DATA_BLOB password,
                                   const char *pdev, uint16 vuid,
                                   NTSTATUS *status);
-void close_cnum(struct smbd_server_connection *sconn,
-               connection_struct *conn, uint16 vuid);
+void close_cnum(connection_struct *conn, uint16 vuid);
 
 /* The following definitions come from smbd/session.c  */