2013-03-09 03:37:30 +04:00
|
|
|
/**
|
|
|
|
* xrdp: A Remote Desktop Protocol server.
|
|
|
|
*
|
2013-03-19 06:43:20 +04:00
|
|
|
* Copyright (C) Laxmikant Rashinkar 2013 LK.Rashinkar@gmail.com
|
2013-03-09 03:37:30 +04:00
|
|
|
*
|
|
|
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
* you may not use this file except in compliance with the License.
|
|
|
|
* You may obtain a copy of the License at
|
|
|
|
*
|
|
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
*
|
|
|
|
* Unless required by applicable law or agreed to in writing, software
|
|
|
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
* See the License for the specific language governing permissions and
|
|
|
|
* limitations under the License.
|
|
|
|
*/
|
2012-10-30 07:12:24 +04:00
|
|
|
|
2013-03-09 03:37:30 +04:00
|
|
|
#ifndef _CHANSRV_FUSE_H
|
|
|
|
#define _CHANSRV_FUSE_H
|
2012-10-30 07:12:24 +04:00
|
|
|
|
2019-12-22 15:37:38 +03:00
|
|
|
#include <sys/types.h>
|
|
|
|
#include <time.h>
|
2019-03-21 19:48:01 +03:00
|
|
|
|
2019-12-22 15:37:38 +03:00
|
|
|
#include "arch.h"
|
2019-11-14 17:43:57 +03:00
|
|
|
#include "ms-erref.h"
|
2019-03-21 19:48:01 +03:00
|
|
|
|
2019-11-14 17:43:57 +03:00
|
|
|
/* Used to pass file info back to chansrv_fuse from devredir */
|
2019-03-21 19:48:01 +03:00
|
|
|
struct file_attr
|
2013-03-09 03:37:30 +04:00
|
|
|
{
|
2013-05-20 04:23:18 +04:00
|
|
|
tui32 mode; /* File mode. */
|
2019-12-05 19:44:52 +03:00
|
|
|
off_t size; /* Size of file, in bytes. */
|
2013-05-20 04:23:18 +04:00
|
|
|
time_t atime; /* Time of last access. */
|
|
|
|
time_t mtime; /* Time of last modification. */
|
2013-03-09 03:37:30 +04:00
|
|
|
};
|
2012-10-30 07:12:24 +04:00
|
|
|
|
2019-11-14 17:43:57 +03:00
|
|
|
/* Bitmask values used to identify individual elements in
|
|
|
|
* struct file_attr
|
|
|
|
*/
|
|
|
|
#define TO_SET_MODE (1<<0)
|
|
|
|
#define TO_SET_SIZE (1<<1)
|
|
|
|
#define TO_SET_ATIME (1<<2)
|
|
|
|
#define TO_SET_MTIME (1<<3)
|
|
|
|
#define TO_SET_ALL (TO_SET_MODE | TO_SET_SIZE | TO_SET_ATIME | TO_SET_MTIME)
|
|
|
|
|
|
|
|
/* Private type passed into and back-from devredir */
|
|
|
|
typedef struct xfuse_info XFUSE_INFO;
|
|
|
|
|
2016-12-23 20:52:22 +03:00
|
|
|
int xfuse_init(void);
|
|
|
|
int xfuse_deinit(void);
|
2013-03-09 03:37:30 +04:00
|
|
|
int xfuse_check_wait_objs(void);
|
|
|
|
int xfuse_get_wait_objs(tbus *objs, int *count, int *timeout);
|
2017-01-22 21:27:50 +03:00
|
|
|
int xfuse_create_share(tui32 share_id, const char *dirname);
|
2019-11-14 17:43:57 +03:00
|
|
|
void xfuse_delete_share(tui32 share_id);
|
2013-03-09 03:37:30 +04:00
|
|
|
|
|
|
|
int xfuse_clear_clip_dir(void);
|
2017-01-22 21:27:50 +03:00
|
|
|
int xfuse_file_contents_range(int stream_id, const char *data, int data_bytes);
|
2013-03-09 03:37:30 +04:00
|
|
|
int xfuse_file_contents_size(int stream_id, int file_size);
|
2019-11-14 17:43:57 +03:00
|
|
|
int xfuse_add_clip_dir_item(const char *filename,
|
|
|
|
int flags, int size, int lindex);
|
|
|
|
|
|
|
|
/* State pointer types (opaque outside this module), used for
|
|
|
|
* callback data
|
|
|
|
*/
|
|
|
|
struct state_dirscan;
|
|
|
|
struct state_lookup;
|
|
|
|
struct state_setattr;
|
|
|
|
struct state_open;
|
|
|
|
struct state_create;
|
|
|
|
struct state_read;
|
|
|
|
struct state_write;
|
|
|
|
struct state_remove;
|
|
|
|
struct state_rename;
|
|
|
|
struct state_close;
|
|
|
|
|
2013-03-09 03:37:30 +04:00
|
|
|
|
2013-03-19 06:43:20 +04:00
|
|
|
/* functions that are invoked from devredir */
|
2019-11-14 17:43:57 +03:00
|
|
|
void xfuse_devredir_cb_enum_dir_add_entry(
|
|
|
|
struct state_dirscan *fip,
|
|
|
|
const char *name,
|
|
|
|
const struct file_attr *fattr);
|
|
|
|
void xfuse_devredir_cb_enum_dir_done(struct state_dirscan *fip,
|
|
|
|
enum NTSTATUS IoStatus);
|
|
|
|
|
|
|
|
void xfuse_devredir_cb_lookup_entry(struct state_lookup *fip,
|
|
|
|
enum NTSTATUS IoStatus,
|
|
|
|
const struct file_attr *file_info);
|
|
|
|
|
|
|
|
void xfuse_devredir_cb_setattr(struct state_setattr *fip,
|
|
|
|
enum NTSTATUS IoStatus);
|
|
|
|
|
|
|
|
void xfuse_devredir_cb_create_file(struct state_create *fip,
|
|
|
|
enum NTSTATUS IoStatus,
|
|
|
|
tui32 DeviceId, tui32 FileId);
|
|
|
|
|
|
|
|
void xfuse_devredir_cb_open_file(struct state_open *fip,
|
|
|
|
enum NTSTATUS IoStatus,
|
|
|
|
tui32 DeviceId, tui32 FileId);
|
|
|
|
|
|
|
|
void xfuse_devredir_cb_read_file(struct state_read *fip,
|
|
|
|
const char *buf, size_t length);
|
2019-03-13 13:56:37 +03:00
|
|
|
void xfuse_devredir_cb_write_file(
|
2019-11-14 17:43:57 +03:00
|
|
|
struct state_write *fip,
|
|
|
|
enum NTSTATUS IoStatus,
|
|
|
|
off_t offset,
|
2019-03-13 13:56:37 +03:00
|
|
|
size_t length);
|
2019-11-14 17:43:57 +03:00
|
|
|
|
|
|
|
void xfuse_devredir_cb_rmdir_or_file(struct state_remove *fip,
|
|
|
|
enum NTSTATUS IoStatus);
|
|
|
|
|
|
|
|
void xfuse_devredir_cb_rename_file(struct state_rename *fip,
|
|
|
|
enum NTSTATUS IoStatus);
|
|
|
|
|
|
|
|
void xfuse_devredir_cb_file_close(struct state_close *fip);
|
2012-11-05 01:52:33 +04:00
|
|
|
|
2012-10-30 07:12:24 +04:00
|
|
|
#endif
|