-typedef struct SilcSFTPFilesystemStruct {
- /* Find a file handle by the file handle data indicated by the `data'.
- If the handle is not found this returns NULL. */
- SilcSFTPHandle (*sftp_get_handle)(void *context, SilcSFTP sftp,
- const unsigned char *data,
- uint32 data_len);
-
- /* Return encoded handle of `handle' or NULL on error. The caller
- must free the returned buffer. */
- unsigned char *(*sftp_encode_handle)(void *context, SilcSFTP sftp,
- SilcSFTPHandle handle,
- uint32 *handle_len);
-
- /* Open a file indicated by the `filename' with flags indicated by the
- `pflags', and with attributes indicated by the `attr'. Calls the
- `callback' to return the opened file handle. */
- void (*sftp_open)(void *context, SilcSFTP sftp,
- const char *filename,
- SilcSFTPFileOperation pflags,
- SilcSFTPAttributes attr,
- SilcSFTPHandleCallback callback,
- void *callback_context);
-
- /* Closes the file indicated by the file handle `handle'. Calls the
- `callback' to indicate the status of the closing. */
- void (*sftp_close)(void *context, SilcSFTP sftp,
- SilcSFTPHandle handle,
- SilcSFTPStatusCallback callback,
- void *callback_context);
-
- /* Reads data from the file indicated by the file handle `handle' starting
- from the offset of `offset' at most `len' bytes. The `callback' is
- called to return the read data. */
- void (*sftp_read)(void *context, SilcSFTP sftp,
- SilcSFTPHandle handle,
- uint64 offset,
- uint32 len,
- SilcSFTPDataCallback callback,
- void *callback_context);
-
- /* Writes to a file indicated by the file handle `handle' starting from
- offset of `offset' at most `data_len' bytes of `data'. The `callback'
- is called to indicate the status of the writing. */
- void (*sftp_write)(void *context, SilcSFTP sftp,
- SilcSFTPHandle handle,
- uint64 offset,
- const unsigned char *data,
- uint32 data_len,
- SilcSFTPStatusCallback callback,
- void *callback_context);
-
- /* Removes a file indicated by the `filename'. Calls the `callback'
- to indicate the status of the removing. */
- void (*sftp_remove)(void *context, SilcSFTP sftp,
- const char *filename,
- SilcSFTPStatusCallback callback,
- void *callback_context);
-
- /* Renames a file indicated by the `oldname' to the name `newname'. The
- `callback' is called to indicate the status of the renaming. */
- void (*sftp_rename)(void *context, SilcSFTP sftp,
- const char *oldname,
- const char *newname,
- SilcSFTPStatusCallback callback,
- void *callback_context);
-
- /* Creates a new directory indicated by the `path' with attributes indicated
- by the `attrs'. The `callback' is called to indicate the status of the
- creation. */
- void (*sftp_mkdir)(void *context, SilcSFTP sftp,
- const char *path,
- SilcSFTPAttributes attrs,
- SilcSFTPStatusCallback callback,
- void *callback_context);
-
- /* Removes a directory indicated by the `path' and calls the `callback'
- to indicate the status of the removal. */
- void (*sftp_rmdir)(void *context, SilcSFTP sftp,
- const char *path,
- SilcSFTPStatusCallback callback,
- void *callback_context);
-
- /* Opens a directory indicated by the `path'. The `callback' is called
- to return the opened file handle. */
- void (*sftp_opendir)(void *context, SilcSFTP sftp,
- const char *path,
- SilcSFTPHandleCallback callback,
- void *callback_context);
-
- /* Reads the contents of the directory indicated by the `handle' and
- calls the `callback' to return the read file(s) from the directory. */
- void (*sftp_readdir)(void *context, SilcSFTP sftp,
- SilcSFTPHandle handle,
- SilcSFTPNameCallback callback,
- void *callback_context);
-
- /* Gets the file attributes for a file indicated by the `path'. This
- will follow symbolic links also. Calls the `callback' to return the
- file attributes. */
- void (*sftp_stat)(void *context, SilcSFTP sftp,
- const char *path,
- SilcSFTPAttrCallback callback,
- void *callback_context);
-
- /* Gets the file attributes for a file indicated by the `path'. This
- will not follow symbolic links. Calls the `callback' to return the
- file attributes. */
- void (*sftp_lstat)(void *context, SilcSFTP sftp,
- const char *path,
- SilcSFTPAttrCallback callback,
- void *callback_context);
-
- /* Gets a file attributes for a opened file indicated by the `handle'.
- Calls the `callback' to return the file attributes. */
- void (*sftp_fstat)(void *context, SilcSFTP sftp,
- SilcSFTPHandle handle,
- SilcSFTPAttrCallback callback,
- void *callback_context);
-
- /* Sets a file attributes to a file indicated by the `path' with the
- attributes indicated by the `attrs'. Calls the `callback' to indicate
- the status of the setting. */
- void (*sftp_setstat)(void *context, SilcSFTP sftp,
- const char *path,
- SilcSFTPAttributes attrs,
- SilcSFTPStatusCallback callback,
- void *callback_context);
-
- /* Sets a file attributes to a opened file indicated by the `handle' with
- the attributes indicated by the `attrs'. Calls the `callback' to
- indicate the status of the setting. */
- void (*sftp_fsetstat)(void *context, SilcSFTP sftp,
- SilcSFTPHandle handle,
- SilcSFTPAttributes attrs,
- SilcSFTPStatusCallback callback,
- void *callback_context);
-
- /* Reads the target of a symbolic link indicated by the `path'. The
- `callback' is called to return the target of the symbolic link. */
- void (*sftp_readlink)(void *context, SilcSFTP sftp,
- const char *path,
- SilcSFTPNameCallback callback,
- void *callback_context);
-
- /* Creates a new symbolic link indicated by the `linkpath' to the target
- indicated by the `targetpath'. The `callback' is called to indicate
- the status of creation. */
- void (*sftp_symlink)(void *context, SilcSFTP sftp,
- const char *linkpath,
- const char *targetpath,
- SilcSFTPStatusCallback callback,
- void *callback_context);
-
- /* Canonicalizes the path indicated by the `path' to a absolute path.
- The `callback' is called to return the absolute path. */
- void (*sftp_realpath)(void *context, SilcSFTP sftp,
- const char *path,
- SilcSFTPNameCallback callback,
- void *callback_context);
+typedef enum {
+ SILC_SFTP_MONITOR_INIT = 0x0001,
+ SILC_SFTP_MONITOR_OPEN = 0x0002,
+ SILC_SFTP_MONITOR_CLOSE = 0x0004,
+ SILC_SFTP_MONITOR_READ = 0x0008,
+ SILC_SFTP_MONITOR_WRITE = 0x0010,
+ SILC_SFTP_MONITOR_REMOVE = 0x0020,
+ SILC_SFTP_MONITOR_RENAME = 0x0040,
+ SILC_SFTP_MONITOR_MKDIR = 0x0080,
+ SILC_SFTP_MONITOR_RMDIR = 0x0100,
+ SILC_SFTP_MONITOR_OPENDIR = 0x0200,
+ SILC_SFTP_MONITOR_READDIR = 0x0400,
+ SILC_SFTP_MONITOR_STAT = 0x0800,
+ SILC_SFTP_MONITOR_LSTAT = 0x1000,
+ SILC_SFTP_MONITOR_FSTAT = 0x2000,
+ SILC_SFTP_MONITOR_SETSTAT = 0x4000,
+ SILC_SFTP_MONITOR_FSETSTAT = 0x8000,
+ SILC_SFTP_MONITOR_READLINK = 0x10000,
+ SILC_SFTP_MONITOR_SYMLINK = 0x20000,
+ SILC_SFTP_MONITOR_REALPATH = 0x40000,
+ SILC_SFTP_MONITOR_EXTENDED = 0x80000,
+} SilcSFTPMonitors;
+/***/