00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #ifndef _SMB_SHARE_MODES_H_
00022 #define _SMB_STATE_MODES_H_
00023
00024 #ifdef __cplusplus
00025 extern "C" {
00026 #endif
00027
00028 #if HAVE_INTTYPES_H
00029 # include <inttypes.h>
00030 #else
00031 # if HAVE_STDINT_H
00032 # include <stdint.h>
00033 # endif
00034 #endif
00035
00036
00037 struct smbdb_ctx;
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047 struct smb_share_mode_entry {
00048 uint64_t dev;
00049 uint64_t ino;
00050 uint32_t share_access;
00051 uint32_t access_mask;
00052 struct timeval open_time;
00053 uint32_t file_id;
00054 struct process_id pid;
00055 };
00056
00057
00058
00059
00060
00061 struct smbdb_ctx *smb_share_mode_db_open(const char *db_path);
00062 int smb_share_mode_db_close(struct smbdb_ctx *db_ctx);
00063
00064
00065
00066
00067
00068 int smb_lock_share_mode_entry(struct smbdb_ctx *db_ctx,
00069 uint64_t dev,
00070 uint64_t ino);
00071
00072 int smb_unlock_share_mode_entry(struct smbdb_ctx *db_ctx,
00073 uint64_t dev,
00074 uint64_t ino);
00075
00076
00077
00078
00079
00080 int smb_get_share_mode_entries(struct smbdb_ctx *db_ctx,
00081 uint64_t dev,
00082 uint64_t ino,
00083 struct smb_share_mode_entry **pp_list,
00084 unsigned char *p_delete_on_close);
00085
00086 int smb_create_share_mode_entry(struct smbdb_ctx *db_ctx,
00087 uint64_t dev,
00088 uint64_t ino,
00089 const struct smb_share_mode_entry *set_entry,
00090 const char *path);
00091
00092 int smb_delete_share_mode_entry(struct smbdb_ctx *db_ctx,
00093 uint64_t dev,
00094 uint64_t ino,
00095 const struct smb_share_mode_entry *set_entry);
00096
00097 int smb_change_share_mode_entry(struct smbdb_ctx *db_ctx,
00098 uint64_t dev,
00099 uint64_t ino,
00100 const struct smb_share_mode_entry *set_entry,
00101 const struct smb_share_mode_entry *new_entry);
00102
00103 #ifdef __cplusplus
00104 }
00105 #endif
00106 #endif