mirror of
https://github.com/falk-werner/webfuse-provider
synced 2026-03-02 04:09:18 +00:00
renamed to webfuse
This commit is contained in:
16
include/webfuse/adapter/api.h
Normal file
16
include/webfuse/adapter/api.h
Normal file
@@ -0,0 +1,16 @@
|
||||
#ifndef WF_ADAPTER_API_H
|
||||
#define WF_ADAPTER_API_H
|
||||
|
||||
#ifndef WF_API
|
||||
#define WF_API
|
||||
#endif
|
||||
|
||||
#ifndef WF_EXPORT
|
||||
#ifdef __GNUC__
|
||||
#define WF_EXPORT __attribute__ ((visibility ("default")))
|
||||
#else
|
||||
#define WF_EXPORT
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#endif
|
||||
23
include/webfuse/adapter/authenticate.h
Normal file
23
include/webfuse/adapter/authenticate.h
Normal file
@@ -0,0 +1,23 @@
|
||||
#ifndef WF_ADAPTER_AUTHENTICATE_H
|
||||
#define WF_ADAPTER_AUTHENTICATE_H
|
||||
|
||||
#ifndef __cplusplus
|
||||
#include <stdbool.h>
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C"
|
||||
{
|
||||
#endif
|
||||
|
||||
struct wf_credentials;
|
||||
|
||||
typedef bool wf_authenticate_fn(
|
||||
struct wf_credentials * credentials,
|
||||
void * user_data);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
25
include/webfuse/adapter/credentials.h
Normal file
25
include/webfuse/adapter/credentials.h
Normal file
@@ -0,0 +1,25 @@
|
||||
#ifndef WF_ADAPTER_CREDENTIALS_H
|
||||
#define WF_ADAPTER_CREDENTIALS_H
|
||||
|
||||
#include "webfuse/adapter/api.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C"
|
||||
{
|
||||
#endif
|
||||
|
||||
struct wf_credentials;
|
||||
|
||||
extern WF_API char const * wf_credentials_type(
|
||||
struct wf_credentials const * credentials);
|
||||
|
||||
extern WF_API char const * wf_credentials_get(
|
||||
struct wf_credentials const * credentials,
|
||||
char const * key);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
#endif
|
||||
31
include/webfuse/adapter/server.h
Normal file
31
include/webfuse/adapter/server.h
Normal file
@@ -0,0 +1,31 @@
|
||||
#ifndef WF_ADAPTER_SERVER_H
|
||||
#define WF_ADAPTER_SERVER_H
|
||||
|
||||
#include "webfuse/adapter/api.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C"
|
||||
{
|
||||
#endif
|
||||
|
||||
struct wf_server;
|
||||
struct wf_server_config;
|
||||
|
||||
extern WF_API struct wf_server * wf_server_create(
|
||||
struct wf_server_config * config);
|
||||
|
||||
extern WF_API void wf_server_dispose(
|
||||
struct wf_server * server);
|
||||
|
||||
extern WF_API void wf_server_run(
|
||||
struct wf_server * server);
|
||||
|
||||
extern WF_API void wf_server_shutdown(
|
||||
struct wf_server * server);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
#endif
|
||||
55
include/webfuse/adapter/server_config.h
Normal file
55
include/webfuse/adapter/server_config.h
Normal file
@@ -0,0 +1,55 @@
|
||||
#ifndef WF_ADAPTER_SERVER_CONFIG_H
|
||||
#define WF_ADAPTER_SERVER_CONFIG_H
|
||||
|
||||
#include "webfuse/adapter/api.h"
|
||||
#include "webfuse/adapter/authenticate.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C"
|
||||
{
|
||||
#endif
|
||||
|
||||
struct wf_server_config;
|
||||
|
||||
extern WF_API struct wf_server_config * wf_server_config_create(void);
|
||||
|
||||
extern WF_API void wf_server_config_dispose(
|
||||
struct wf_server_config * config);
|
||||
|
||||
|
||||
extern WF_API void wf_server_config_set_mountpoint(
|
||||
struct wf_server_config * config,
|
||||
char const * mount_point);
|
||||
|
||||
extern WF_API void wf_server_config_set_documentroot(
|
||||
struct wf_server_config * config,
|
||||
char const * document_root);
|
||||
|
||||
extern WF_API void wf_server_config_set_keypath(
|
||||
struct wf_server_config * config,
|
||||
char const * key_path);
|
||||
|
||||
extern WF_API void wf_server_config_set_certpath(
|
||||
struct wf_server_config * config,
|
||||
char const * cert_path);
|
||||
|
||||
extern WF_API void wf_server_config_set_vhostname(
|
||||
struct wf_server_config * config,
|
||||
char const * vhost_name);
|
||||
|
||||
extern WF_API void wf_server_config_set_port(
|
||||
struct wf_server_config * config,
|
||||
int port);
|
||||
|
||||
extern WF_API void wf_server_config_add_authenticator(
|
||||
struct wf_server_config * config,
|
||||
char const * type,
|
||||
wf_authenticate_fn * authenticate,
|
||||
void * user_data
|
||||
);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
35
include/webfuse/adapter/server_protocol.h
Normal file
35
include/webfuse/adapter/server_protocol.h
Normal file
@@ -0,0 +1,35 @@
|
||||
#ifndef WF_ADAPTER_SERVER_PROTOCOL_H
|
||||
#define WF_ADAPTER_SERVER_PROTOCOL_H
|
||||
|
||||
#include <webfuse/adapter/api.h>
|
||||
#include <webfuse/adapter/authenticate.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C"
|
||||
{
|
||||
#endif
|
||||
|
||||
struct wf_server_protocol;
|
||||
struct lws_protocols;
|
||||
|
||||
extern WF_API struct wf_server_protocol * wf_server_protocol_create(
|
||||
char * mount_point);
|
||||
|
||||
extern WF_API void wf_server_protocol_dispose(
|
||||
struct wf_server_protocol * protocol);
|
||||
|
||||
extern WF_API void wf_server_protocol_init_lws(
|
||||
struct wf_server_protocol * protocol,
|
||||
struct lws_protocols * lws_protocol);
|
||||
|
||||
extern WF_API void wf_server_protocol_add_authenticator(
|
||||
struct wf_server_protocol * protocol,
|
||||
char const * type,
|
||||
wf_authenticate_fn * authenticate,
|
||||
void * user_data);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
17
include/webfuse/core/status.h
Normal file
17
include/webfuse/core/status.h
Normal file
@@ -0,0 +1,17 @@
|
||||
#ifndef WF_STATUS_H
|
||||
#define WF_STATUS_H
|
||||
|
||||
#define WF_GOOD 0
|
||||
#define WF_BAD 1
|
||||
|
||||
#define WF_BAD_NOTIMPLEMENTED 2
|
||||
#define WF_BAD_TIMEOUT 3
|
||||
#define WF_BAD_BUSY 4
|
||||
#define WF_BAD_FORMAT 5
|
||||
|
||||
#define WF_BAD_NOENTRY 101
|
||||
#define WF_BAD_NOACCESS 102
|
||||
|
||||
typedef int wf_status;
|
||||
|
||||
#endif
|
||||
16
include/webfuse/provider/api.h
Normal file
16
include/webfuse/provider/api.h
Normal file
@@ -0,0 +1,16 @@
|
||||
#ifndef WFP_PROVIDER_API_H
|
||||
#define WFP_PROVIDER_API_H
|
||||
|
||||
#ifndef WFP_API
|
||||
#define WFP_API
|
||||
#endif
|
||||
|
||||
#ifndef WFP_EXPORT
|
||||
#ifdef __GNUC__
|
||||
#define WFP_EXPORT __attribute__ ((visibility ("default")))
|
||||
#else
|
||||
#define WFP_EXPORT
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#endif
|
||||
39
include/webfuse/provider/client.h
Normal file
39
include/webfuse/provider/client.h
Normal file
@@ -0,0 +1,39 @@
|
||||
#ifndef WF_PROVIDER_CLIENT_H
|
||||
#define WF_PROVIDER_CLIENT_H
|
||||
|
||||
#include "webfuse/provider/api.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C"
|
||||
{
|
||||
#endif
|
||||
|
||||
struct wfp_client;
|
||||
struct wfp_client_config;
|
||||
|
||||
extern WFP_API struct wfp_client * wfp_client_create(
|
||||
struct wfp_client_config * config);
|
||||
|
||||
extern WFP_API void wfp_client_connect(
|
||||
struct wfp_client * client,
|
||||
char const * url);
|
||||
|
||||
extern WFP_API void wfp_client_disconnect(
|
||||
struct wfp_client * client);
|
||||
|
||||
extern WFP_API void wfp_client_dispose(
|
||||
struct wfp_client * client);
|
||||
|
||||
extern WFP_API void wfp_client_run(
|
||||
struct wfp_client * client);
|
||||
|
||||
extern WFP_API void wfp_client_shutdown(
|
||||
struct wfp_client * client);
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
#endif
|
||||
88
include/webfuse/provider/client_config.h
Normal file
88
include/webfuse/provider/client_config.h
Normal file
@@ -0,0 +1,88 @@
|
||||
#ifndef WF_PROVIDER_CLIENT_CONFIG_H
|
||||
#define WF_PROVIDER_CLIENT_CONFIG_H
|
||||
|
||||
#include <webfuse/provider/api.h>
|
||||
|
||||
#include <webfuse/provider/operation/lookup.h>
|
||||
#include <webfuse/provider/operation/getattr.h>
|
||||
#include <webfuse/provider/operation/readdir.h>
|
||||
#include <webfuse/provider/operation/open.h>
|
||||
#include <webfuse/provider/operation/close.h>
|
||||
#include <webfuse/provider/operation/read.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C"
|
||||
{
|
||||
#endif
|
||||
|
||||
struct wfp_client_config;
|
||||
|
||||
typedef void wfp_connected_fn(
|
||||
void * user_data);
|
||||
|
||||
typedef void wfp_disconnected_fn(
|
||||
void * user_data);
|
||||
|
||||
typedef void wfp_ontimer_fn(
|
||||
void * user_data);
|
||||
|
||||
extern WFP_API struct wfp_client_config * wfp_client_config_create(void);
|
||||
|
||||
extern WFP_API void wfp_client_config_dispose(
|
||||
struct wfp_client_config * config);
|
||||
|
||||
extern WFP_API void wfp_client_config_set_userdata(
|
||||
struct wfp_client_config * config,
|
||||
void * user_data);
|
||||
|
||||
extern WFP_API void wfp_client_config_set_keypath(
|
||||
struct wfp_client_config * config,
|
||||
char const * key_path);
|
||||
|
||||
extern WFP_API void wfp_client_config_set_certpath(
|
||||
struct wfp_client_config * config,
|
||||
char const * cert_path);
|
||||
|
||||
extern WFP_API void wfp_client_config_set_onconnected(
|
||||
struct wfp_client_config * config,
|
||||
wfp_connected_fn * handler);
|
||||
|
||||
extern WFP_API void wfp_client_config_set_ondisconnected(
|
||||
struct wfp_client_config * config,
|
||||
wfp_disconnected_fn * handler);
|
||||
|
||||
extern WFP_API void wfp_client_config_set_ontimer(
|
||||
struct wfp_client_config * config,
|
||||
wfp_ontimer_fn * handler);
|
||||
|
||||
|
||||
extern WFP_API void wfp_client_config_set_onlookup(
|
||||
struct wfp_client_config * config,
|
||||
wfp_lookup_fn * handler);
|
||||
|
||||
extern WFP_API void wfp_client_config_set_ongetattr(
|
||||
struct wfp_client_config * config,
|
||||
wfp_getattr_fn * handler);
|
||||
|
||||
extern WFP_API void wfp_client_config_set_onreaddir(
|
||||
struct wfp_client_config * config,
|
||||
wfp_readdir_fn * handler);
|
||||
|
||||
extern WFP_API void wfp_client_config_set_onopen(
|
||||
struct wfp_client_config * config,
|
||||
wfp_open_fn * handler);
|
||||
|
||||
extern WFP_API void wfp_client_config_set_onclose(
|
||||
struct wfp_client_config * config,
|
||||
wfp_close_fn * handler);
|
||||
|
||||
extern WFP_API void wfp_client_config_set_onread(
|
||||
struct wfp_client_config * config,
|
||||
wfp_read_fn * handler);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
#endif
|
||||
32
include/webfuse/provider/client_protocol.h
Normal file
32
include/webfuse/provider/client_protocol.h
Normal file
@@ -0,0 +1,32 @@
|
||||
#ifndef WF_PROVIDER_CLIENT_PROTOCOL_H
|
||||
#define WF_PROVIDER_CLIENT_PROTOCOL_H
|
||||
|
||||
#include "webfuse/provider/api.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C"
|
||||
{
|
||||
#endif
|
||||
|
||||
struct wfp_client_protocol;
|
||||
struct wfp_provider;
|
||||
struct lws_protocols;
|
||||
|
||||
extern WFP_API struct wfp_client_protocol * wfp_client_protocol_create(
|
||||
struct wfp_provider const * provider,
|
||||
void * user_data);
|
||||
|
||||
extern WFP_API void wfp_client_protocol_dispose(
|
||||
struct wfp_client_protocol * protocol);
|
||||
|
||||
extern WFP_API void wfp_client_protocol_init_lws(
|
||||
struct wfp_client_protocol * protocol,
|
||||
struct lws_protocols * lws_protocol);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
#endif
|
||||
32
include/webfuse/provider/dirbuffer.h
Normal file
32
include/webfuse/provider/dirbuffer.h
Normal file
@@ -0,0 +1,32 @@
|
||||
#ifndef WF_PROVIDER_DIRBUFFER_H
|
||||
#define WF_PROVIDER_DIRBUFFER_H
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include "webfuse/provider/api.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C"
|
||||
{
|
||||
#endif
|
||||
|
||||
struct wfp_dirbuffer;
|
||||
|
||||
extern WFP_API struct wfp_dirbuffer * wfp_dirbuffer_create(void);
|
||||
|
||||
extern WFP_API void wfp_dirbuffer_dispose(
|
||||
struct wfp_dirbuffer * buffer);
|
||||
|
||||
extern WFP_API void wfp_dirbuffer_add(
|
||||
struct wfp_dirbuffer * buffer,
|
||||
char const * name,
|
||||
ino_t inode);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
#endif
|
||||
@@ -1,5 +1,5 @@
|
||||
#ifndef WSFSP_OPERATION_CLOSE_H
|
||||
#define WSFSP_OPERATION_CLOSE_H
|
||||
#ifndef WFP_OPERATION_CLOSE_H
|
||||
#define WFP_OPERATION_CLOSE_H
|
||||
|
||||
#ifndef __cplusplus
|
||||
#include <inttypes.h>
|
||||
@@ -11,14 +11,14 @@
|
||||
#include <sys/stat.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include "wsfs/provider/api.h"
|
||||
#include "webfuse/provider/api.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C"
|
||||
{
|
||||
#endif
|
||||
|
||||
typedef void wsfsp_close_fn(
|
||||
typedef void wfp_close_fn(
|
||||
ino_t inode,
|
||||
uint32_t handle,
|
||||
int flags,
|
||||
22
include/webfuse/provider/operation/error.h
Normal file
22
include/webfuse/provider/operation/error.h
Normal file
@@ -0,0 +1,22 @@
|
||||
#ifndef WFP_OPERATION_ERROR_H
|
||||
#define WFP_OPERATION_ERROR_H
|
||||
|
||||
#include "webfuse/provider/api.h"
|
||||
#include "webfuse/core/status.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C"
|
||||
{
|
||||
#endif
|
||||
|
||||
struct wfp_request;
|
||||
|
||||
extern WFP_API void wfp_respond_error(
|
||||
struct wfp_request * request,
|
||||
wf_status status);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
31
include/webfuse/provider/operation/getattr.h
Normal file
31
include/webfuse/provider/operation/getattr.h
Normal file
@@ -0,0 +1,31 @@
|
||||
#ifndef WFP_OPERATION_GETATTR_H
|
||||
#define WFP_OPERATION_GETATTR_H
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include "webfuse/provider/api.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C"
|
||||
{
|
||||
#endif
|
||||
|
||||
struct wfp_request;
|
||||
|
||||
typedef void wfp_getattr_fn(
|
||||
struct wfp_request * request,
|
||||
ino_t inode,
|
||||
void * user_data);
|
||||
|
||||
extern WFP_API void wfp_respond_getattr(
|
||||
struct wfp_request * request,
|
||||
struct stat const * stat);
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
32
include/webfuse/provider/operation/lookup.h
Normal file
32
include/webfuse/provider/operation/lookup.h
Normal file
@@ -0,0 +1,32 @@
|
||||
#ifndef WFP_OPERATION_LOOKUP_H
|
||||
#define WFP_OPERATION_LOOKUP_H
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include "webfuse/provider/api.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C"
|
||||
{
|
||||
#endif
|
||||
|
||||
struct wfp_request;
|
||||
|
||||
typedef void wfp_lookup_fn(
|
||||
struct wfp_request * request,
|
||||
ino_t parent,
|
||||
char const * name,
|
||||
void * user_data);
|
||||
|
||||
extern WFP_API void wfp_respond_lookup(
|
||||
struct wfp_request * request,
|
||||
struct stat const * stat);
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
@@ -1,5 +1,5 @@
|
||||
#ifndef WSFSP_OPERATION_OPEN_H
|
||||
#define WSFSP_OPERATION_OPEN_H
|
||||
#ifndef WFP_OPERATION_OPEN_H
|
||||
#define WFP_OPERATION_OPEN_H
|
||||
|
||||
#ifndef __cplusplus
|
||||
#include <inttypes.h>
|
||||
@@ -11,23 +11,23 @@
|
||||
#include <sys/stat.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include "wsfs/provider/api.h"
|
||||
#include "webfuse/provider/api.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C"
|
||||
{
|
||||
#endif
|
||||
|
||||
struct wsfsp_request;
|
||||
struct wfp_request;
|
||||
|
||||
typedef void wsfsp_open_fn(
|
||||
struct wsfsp_request * request,
|
||||
typedef void wfp_open_fn(
|
||||
struct wfp_request * request,
|
||||
ino_t inode,
|
||||
int flags,
|
||||
void * user_data);
|
||||
|
||||
extern WSFSP_API void wsfsp_respond_open(
|
||||
struct wsfsp_request * request,
|
||||
extern WFP_API void wfp_respond_open(
|
||||
struct wfp_request * request,
|
||||
uint32_t handle);
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#ifndef WSFSP_OPERATION_READ_H
|
||||
#define WSFSP_OPERATION_READ_H
|
||||
#ifndef WFP_OPERATION_READ_H
|
||||
#define WFP_OPERATION_READ_H
|
||||
|
||||
#ifndef __cplusplus
|
||||
#include <stddef.h>
|
||||
@@ -14,25 +14,25 @@ using std::size_t;
|
||||
#include <sys/stat.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include "wsfs/provider/api.h"
|
||||
#include "webfuse/provider/api.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C"
|
||||
{
|
||||
#endif
|
||||
|
||||
struct wsfsp_request;
|
||||
struct wfp_request;
|
||||
|
||||
typedef void wsfsp_read_fn(
|
||||
struct wsfsp_request * request,
|
||||
typedef void wfp_read_fn(
|
||||
struct wfp_request * request,
|
||||
ino_t inode,
|
||||
uint32_t handle,
|
||||
size_t offset,
|
||||
size_t length,
|
||||
void * user_data);
|
||||
|
||||
extern WSFSP_API void wsfsp_respond_read(
|
||||
struct wsfsp_request * request,
|
||||
extern WFP_API void wfp_respond_read(
|
||||
struct wfp_request * request,
|
||||
char const * data,
|
||||
size_t length);
|
||||
|
||||
31
include/webfuse/provider/operation/readdir.h
Normal file
31
include/webfuse/provider/operation/readdir.h
Normal file
@@ -0,0 +1,31 @@
|
||||
#ifndef WFP_OPERATION_READDIR_H
|
||||
#define WFP_OPERATION_READDIR_H
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include "webfuse/provider/api.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C"
|
||||
{
|
||||
#endif
|
||||
|
||||
struct wfp_dirbuffer;
|
||||
struct wfp_request;
|
||||
|
||||
typedef void wfp_readdir_fn(
|
||||
struct wfp_request * request,
|
||||
ino_t directory,
|
||||
void * user_data);
|
||||
|
||||
extern WFP_API void wfp_respond_readdir(
|
||||
struct wfp_request * request,
|
||||
struct wfp_dirbuffer * dirbuffer);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
13
include/webfuse_adapter.h
Normal file
13
include/webfuse_adapter.h
Normal file
@@ -0,0 +1,13 @@
|
||||
#ifndef WF_ADAPTER_H
|
||||
#define WF_ADAPTER_H
|
||||
|
||||
#include <webfuse/core/status.h>
|
||||
|
||||
#include <webfuse/adapter/api.h>
|
||||
#include <webfuse/adapter/server.h>
|
||||
#include <webfuse/adapter/server_config.h>
|
||||
#include <webfuse/adapter/server_protocol.h>
|
||||
#include <webfuse/adapter/authenticate.h>
|
||||
#include <webfuse/adapter/credentials.h>
|
||||
|
||||
#endif
|
||||
20
include/webfuse_provider.h
Normal file
20
include/webfuse_provider.h
Normal file
@@ -0,0 +1,20 @@
|
||||
#ifndef WF_PROVIDER_H
|
||||
#define WF_PROVIDER_H
|
||||
|
||||
#include <webfuse/core/status.h>
|
||||
|
||||
#include <webfuse/provider/api.h>
|
||||
#include <webfuse/provider/client.h>
|
||||
#include <webfuse/provider/client_config.h>
|
||||
#include <webfuse/provider/client_protocol.h>
|
||||
#include <webfuse/provider/dirbuffer.h>
|
||||
|
||||
#include <webfuse/provider/operation/error.h>
|
||||
#include <webfuse/provider/operation/lookup.h>
|
||||
#include <webfuse/provider/operation/getattr.h>
|
||||
#include <webfuse/provider/operation/readdir.h>
|
||||
#include <webfuse/provider/operation/open.h>
|
||||
#include <webfuse/provider/operation/close.h>
|
||||
#include <webfuse/provider/operation/read.h>
|
||||
|
||||
#endif
|
||||
@@ -1,16 +0,0 @@
|
||||
#ifndef WSFS_ADAPTER_API_H
|
||||
#define WSFS_ADAPTER_API_H
|
||||
|
||||
#ifndef WSFSA_API
|
||||
#define WSFSA_API
|
||||
#endif
|
||||
|
||||
#ifndef WSFSA_EXPORT
|
||||
#ifdef __GNUC__
|
||||
#define WSFSA_EXPORT __attribute__ ((visibility ("default")))
|
||||
#else
|
||||
#define WSFSA_EXPORT
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#endif
|
||||
@@ -1,23 +0,0 @@
|
||||
#ifndef WSFS_ADAPTER_AUTHENTICATE_H
|
||||
#define WSFS_ADAPTER_AUTHENTICATE_H
|
||||
|
||||
#ifndef __cplusplus
|
||||
#include <stdbool.h>
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C"
|
||||
{
|
||||
#endif
|
||||
|
||||
struct wsfs_credentials;
|
||||
|
||||
typedef bool wsfs_authenticate_fn(
|
||||
struct wsfs_credentials * credentials,
|
||||
void * user_data);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
@@ -1,25 +0,0 @@
|
||||
#ifndef WSFS_ADAPTER_CREDENTIALS_H
|
||||
#define WSFS_ADAPTER_CREDENTIALS_H
|
||||
|
||||
#include "wsfs/adapter/api.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C"
|
||||
{
|
||||
#endif
|
||||
|
||||
struct wsfs_credentials;
|
||||
|
||||
extern WSFSA_API char const * wsfs_credentials_type(
|
||||
struct wsfs_credentials const * credentials);
|
||||
|
||||
extern WSFSA_API char const * wsfs_credentials_get(
|
||||
struct wsfs_credentials const * credentials,
|
||||
char const * key);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
#endif
|
||||
@@ -1,31 +0,0 @@
|
||||
#ifndef WSFS_ADAPTER_SERVER_H
|
||||
#define WSFS_ADAPTER_SERVER_H
|
||||
|
||||
#include "wsfs/adapter/api.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C"
|
||||
{
|
||||
#endif
|
||||
|
||||
struct wsfs_server;
|
||||
struct wsfs_server_config;
|
||||
|
||||
extern WSFSA_API struct wsfs_server * wsfs_server_create(
|
||||
struct wsfs_server_config * config);
|
||||
|
||||
extern WSFSA_API void wsfs_server_dispose(
|
||||
struct wsfs_server * server);
|
||||
|
||||
extern WSFSA_API void wsfs_server_run(
|
||||
struct wsfs_server * server);
|
||||
|
||||
extern WSFSA_API void wsfs_server_shutdown(
|
||||
struct wsfs_server * server);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
#endif
|
||||
@@ -1,55 +0,0 @@
|
||||
#ifndef WSFS_ADAPTER_SERVER_CONFIG_H
|
||||
#define WSFS_ADAPTER_SERVER_CONFIG_H
|
||||
|
||||
#include "wsfs/adapter/api.h"
|
||||
#include "wsfs/adapter/authenticate.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C"
|
||||
{
|
||||
#endif
|
||||
|
||||
struct wsfs_server_config;
|
||||
|
||||
extern WSFSA_API struct wsfs_server_config * wsfs_server_config_create(void);
|
||||
|
||||
extern WSFSA_API void wsfs_server_config_dispose(
|
||||
struct wsfs_server_config * config);
|
||||
|
||||
|
||||
extern WSFSA_API void wsfs_server_config_set_mountpoint(
|
||||
struct wsfs_server_config * config,
|
||||
char const * mount_point);
|
||||
|
||||
extern WSFSA_API void wsfs_server_config_set_documentroot(
|
||||
struct wsfs_server_config * config,
|
||||
char const * document_root);
|
||||
|
||||
extern WSFSA_API void wsfs_server_config_set_keypath(
|
||||
struct wsfs_server_config * config,
|
||||
char const * key_path);
|
||||
|
||||
extern WSFSA_API void wsfs_server_config_set_certpath(
|
||||
struct wsfs_server_config * config,
|
||||
char const * cert_path);
|
||||
|
||||
extern WSFSA_API void wsfs_server_config_set_vhostname(
|
||||
struct wsfs_server_config * config,
|
||||
char const * vhost_name);
|
||||
|
||||
extern WSFSA_API void wsfs_server_config_set_port(
|
||||
struct wsfs_server_config * config,
|
||||
int port);
|
||||
|
||||
extern WSFSA_API void wsfs_server_config_add_authenticator(
|
||||
struct wsfs_server_config * config,
|
||||
char const * type,
|
||||
wsfs_authenticate_fn * authenticate,
|
||||
void * user_data
|
||||
);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
@@ -1,35 +0,0 @@
|
||||
#ifndef WSFS_ADAPTER_SERVER_PROTOCOL_H
|
||||
#define WSFS_ADAPTER_SERVER_PROTOCOL_H
|
||||
|
||||
#include <wsfs/adapter/api.h>
|
||||
#include <wsfs/adapter/authenticate.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C"
|
||||
{
|
||||
#endif
|
||||
|
||||
struct wsfs_server_protocol;
|
||||
struct lws_protocols;
|
||||
|
||||
extern WSFSA_API struct wsfs_server_protocol * wsfs_server_protocol_create(
|
||||
char * mount_point);
|
||||
|
||||
extern WSFSA_API void wsfs_server_protocol_dispose(
|
||||
struct wsfs_server_protocol * protocol);
|
||||
|
||||
extern WSFSA_API void wsfs_server_protocol_init_lws(
|
||||
struct wsfs_server_protocol * protocol,
|
||||
struct lws_protocols * lws_protocol);
|
||||
|
||||
extern WSFSA_API void wsfs_server_protocol_add_authenticator(
|
||||
struct wsfs_server_protocol * protocol,
|
||||
char const * type,
|
||||
wsfs_authenticate_fn * authenticate,
|
||||
void * user_data);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
@@ -1,17 +0,0 @@
|
||||
#ifndef WSFS_STATUS_H
|
||||
#define WSFS_STATUS_H
|
||||
|
||||
#define WSFS_GOOD 0
|
||||
#define WSFS_BAD 1
|
||||
|
||||
#define WSFS_BAD_NOTIMPLEMENTED 2
|
||||
#define WSFS_BAD_TIMEOUT 3
|
||||
#define WSFS_BAD_BUSY 4
|
||||
#define WSFS_BAD_FORMAT 5
|
||||
|
||||
#define WSFS_BAD_NOENTRY 101
|
||||
#define WSFS_BAD_NOACCESS 102
|
||||
|
||||
typedef int wsfs_status;
|
||||
|
||||
#endif
|
||||
@@ -1,16 +0,0 @@
|
||||
#ifndef WSFSP_PROVIDER_API_H
|
||||
#define WSFSP_PROVIDER_API_H
|
||||
|
||||
#ifndef WSFSP_API
|
||||
#define WSFSP_API
|
||||
#endif
|
||||
|
||||
#ifndef WSFSP_EXPORT
|
||||
#ifdef __GNUC__
|
||||
#define WSFSP_EXPORT __attribute__ ((visibility ("default")))
|
||||
#else
|
||||
#define WSFSP_EXPORT
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#endif
|
||||
@@ -1,39 +0,0 @@
|
||||
#ifndef WSFS_PROVIDER_CLIENT_H
|
||||
#define WSFS_PROVIDER_CLIENT_H
|
||||
|
||||
#include "wsfs/provider/api.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C"
|
||||
{
|
||||
#endif
|
||||
|
||||
struct wsfsp_client;
|
||||
struct wsfsp_client_config;
|
||||
|
||||
extern WSFSP_API struct wsfsp_client * wsfsp_client_create(
|
||||
struct wsfsp_client_config * config);
|
||||
|
||||
extern WSFSP_API void wsfsp_client_connect(
|
||||
struct wsfsp_client * client,
|
||||
char const * url);
|
||||
|
||||
extern WSFSP_API void wsfsp_client_disconnect(
|
||||
struct wsfsp_client * client);
|
||||
|
||||
extern WSFSP_API void wsfsp_client_dispose(
|
||||
struct wsfsp_client * client);
|
||||
|
||||
extern WSFSP_API void wsfsp_client_run(
|
||||
struct wsfsp_client * client);
|
||||
|
||||
extern WSFSP_API void wsfsp_client_shutdown(
|
||||
struct wsfsp_client * client);
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
#endif
|
||||
@@ -1,88 +0,0 @@
|
||||
#ifndef WSFS_PROVIDER_CLIENT_CONFIG_H
|
||||
#define WSFS_PROVIDER_CLIENT_CONFIG_H
|
||||
|
||||
#include <wsfs/provider/api.h>
|
||||
|
||||
#include <wsfs/provider/operation/lookup.h>
|
||||
#include <wsfs/provider/operation/getattr.h>
|
||||
#include <wsfs/provider/operation/readdir.h>
|
||||
#include <wsfs/provider/operation/open.h>
|
||||
#include <wsfs/provider/operation/close.h>
|
||||
#include <wsfs/provider/operation/read.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C"
|
||||
{
|
||||
#endif
|
||||
|
||||
struct wsfsp_client_config;
|
||||
|
||||
typedef void wsfsp_connected_fn(
|
||||
void * user_data);
|
||||
|
||||
typedef void wsfsp_disconnected_fn(
|
||||
void * user_data);
|
||||
|
||||
typedef void wsfsp_ontimer_fn(
|
||||
void * user_data);
|
||||
|
||||
extern WSFSP_API struct wsfsp_client_config * wsfsp_client_config_create(void);
|
||||
|
||||
extern WSFSP_API void wsfsp_client_config_dispose(
|
||||
struct wsfsp_client_config * config);
|
||||
|
||||
extern WSFSP_API void wsfsp_client_config_set_userdata(
|
||||
struct wsfsp_client_config * config,
|
||||
void * user_data);
|
||||
|
||||
extern WSFSP_API void wsfsp_client_config_set_keypath(
|
||||
struct wsfsp_client_config * config,
|
||||
char const * key_path);
|
||||
|
||||
extern WSFSP_API void wsfsp_client_config_set_certpath(
|
||||
struct wsfsp_client_config * config,
|
||||
char const * cert_path);
|
||||
|
||||
extern WSFSP_API void wsfsp_client_config_set_onconnected(
|
||||
struct wsfsp_client_config * config,
|
||||
wsfsp_connected_fn * handler);
|
||||
|
||||
extern WSFSP_API void wsfsp_client_config_set_ondisconnected(
|
||||
struct wsfsp_client_config * config,
|
||||
wsfsp_disconnected_fn * handler);
|
||||
|
||||
extern WSFSP_API void wsfsp_client_config_set_ontimer(
|
||||
struct wsfsp_client_config * config,
|
||||
wsfsp_ontimer_fn * handler);
|
||||
|
||||
|
||||
extern WSFSP_API void wsfsp_client_config_set_onlookup(
|
||||
struct wsfsp_client_config * config,
|
||||
wsfsp_lookup_fn * handler);
|
||||
|
||||
extern WSFSP_API void wsfsp_client_config_set_ongetattr(
|
||||
struct wsfsp_client_config * config,
|
||||
wsfsp_getattr_fn * handler);
|
||||
|
||||
extern WSFSP_API void wsfsp_client_config_set_onreaddir(
|
||||
struct wsfsp_client_config * config,
|
||||
wsfsp_readdir_fn * handler);
|
||||
|
||||
extern WSFSP_API void wsfsp_client_config_set_onopen(
|
||||
struct wsfsp_client_config * config,
|
||||
wsfsp_open_fn * handler);
|
||||
|
||||
extern WSFSP_API void wsfsp_client_config_set_onclose(
|
||||
struct wsfsp_client_config * config,
|
||||
wsfsp_close_fn * handler);
|
||||
|
||||
extern WSFSP_API void wsfsp_client_config_set_onread(
|
||||
struct wsfsp_client_config * config,
|
||||
wsfsp_read_fn * handler);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
#endif
|
||||
@@ -1,32 +0,0 @@
|
||||
#ifndef WSFS_PROVIDER_CLIENT_PROTOCOL_H
|
||||
#define WSFS_PROVIDER_CLIENT_PROTOCOL_H
|
||||
|
||||
#include "wsfs/provider/api.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C"
|
||||
{
|
||||
#endif
|
||||
|
||||
struct wsfsp_client_protocol;
|
||||
struct wsfsp_provider;
|
||||
struct lws_protocols;
|
||||
|
||||
extern WSFSP_API struct wsfsp_client_protocol * wsfsp_client_protocol_create(
|
||||
struct wsfsp_provider const * provider,
|
||||
void * user_data);
|
||||
|
||||
extern WSFSP_API void wsfsp_client_protocol_dispose(
|
||||
struct wsfsp_client_protocol * protocol);
|
||||
|
||||
extern WSFSP_API void wsfsp_client_protocol_init_lws(
|
||||
struct wsfsp_client_protocol * protocol,
|
||||
struct lws_protocols * lws_protocol);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
#endif
|
||||
@@ -1,32 +0,0 @@
|
||||
#ifndef WSFS_PROVIDER_DIRBUFFER_H
|
||||
#define WSFS_PROVIDER_DIRBUFFER_H
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include "wsfs/provider/api.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C"
|
||||
{
|
||||
#endif
|
||||
|
||||
struct wsfsp_dirbuffer;
|
||||
|
||||
extern WSFSP_API struct wsfsp_dirbuffer * wsfsp_dirbuffer_create(void);
|
||||
|
||||
extern WSFSP_API void wsfsp_dirbuffer_dispose(
|
||||
struct wsfsp_dirbuffer * buffer);
|
||||
|
||||
extern WSFSP_API void wsfsp_dirbuffer_add(
|
||||
struct wsfsp_dirbuffer * buffer,
|
||||
char const * name,
|
||||
ino_t inode);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
#endif
|
||||
@@ -1,22 +0,0 @@
|
||||
#ifndef WSFSP_OPERATION_ERROR_H
|
||||
#define WSFSP_OPERATION_ERROR_H
|
||||
|
||||
#include "wsfs/provider/api.h"
|
||||
#include "wsfs/core/status.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C"
|
||||
{
|
||||
#endif
|
||||
|
||||
struct wsfsp_request;
|
||||
|
||||
extern WSFSP_API void wsfsp_respond_error(
|
||||
struct wsfsp_request * request,
|
||||
wsfs_status status);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
@@ -1,31 +0,0 @@
|
||||
#ifndef WSFSP_OPERATION_GETATTR_H
|
||||
#define WSFSP_OPERATION_GETATTR_H
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include "wsfs/provider/api.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C"
|
||||
{
|
||||
#endif
|
||||
|
||||
struct wsfsp_request;
|
||||
|
||||
typedef void wsfsp_getattr_fn(
|
||||
struct wsfsp_request * request,
|
||||
ino_t inode,
|
||||
void * user_data);
|
||||
|
||||
extern WSFSP_API void wsfsp_respond_getattr(
|
||||
struct wsfsp_request * request,
|
||||
struct stat const * stat);
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
@@ -1,32 +0,0 @@
|
||||
#ifndef WSFSP_OPERATION_LOOKUP_H
|
||||
#define WSFSP_OPERATION_LOOKUP_H
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include "wsfs/provider/api.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C"
|
||||
{
|
||||
#endif
|
||||
|
||||
struct wsfsp_request;
|
||||
|
||||
typedef void wsfsp_lookup_fn(
|
||||
struct wsfsp_request * request,
|
||||
ino_t parent,
|
||||
char const * name,
|
||||
void * user_data);
|
||||
|
||||
extern WSFSP_API void wsfsp_respond_lookup(
|
||||
struct wsfsp_request * request,
|
||||
struct stat const * stat);
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
@@ -1,31 +0,0 @@
|
||||
#ifndef WSFSP_OPERATION_READDIR_H
|
||||
#define WSFSP_OPERATION_READDIR_H
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include "wsfs/provider/api.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C"
|
||||
{
|
||||
#endif
|
||||
|
||||
struct wsfsp_dirbuffer;
|
||||
struct wsfsp_request;
|
||||
|
||||
typedef void wsfsp_readdir_fn(
|
||||
struct wsfsp_request * request,
|
||||
ino_t directory,
|
||||
void * user_data);
|
||||
|
||||
extern WSFSP_API void wsfsp_respond_readdir(
|
||||
struct wsfsp_request * request,
|
||||
struct wsfsp_dirbuffer * dirbuffer);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
@@ -1,13 +0,0 @@
|
||||
#ifndef WSFS_ADAPTER_H
|
||||
#define WSFS_ADAPTER_H
|
||||
|
||||
#include <wsfs/core/status.h>
|
||||
|
||||
#include <wsfs/adapter/api.h>
|
||||
#include <wsfs/adapter/server.h>
|
||||
#include <wsfs/adapter/server_config.h>
|
||||
#include <wsfs/adapter/server_protocol.h>
|
||||
#include <wsfs/adapter/authenticate.h>
|
||||
#include <wsfs/adapter/credentials.h>
|
||||
|
||||
#endif
|
||||
@@ -1,20 +0,0 @@
|
||||
#ifndef WSFS_PROVIDER_H
|
||||
#define WSFS_PROVIDER_H
|
||||
|
||||
#include <wsfs/core/status.h>
|
||||
|
||||
#include <wsfs/provider/api.h>
|
||||
#include <wsfs/provider/client.h>
|
||||
#include <wsfs/provider/client_config.h>
|
||||
#include <wsfs/provider/client_protocol.h>
|
||||
#include <wsfs/provider/dirbuffer.h>
|
||||
|
||||
#include <wsfs/provider/operation/error.h>
|
||||
#include <wsfs/provider/operation/lookup.h>
|
||||
#include <wsfs/provider/operation/getattr.h>
|
||||
#include <wsfs/provider/operation/readdir.h>
|
||||
#include <wsfs/provider/operation/open.h>
|
||||
#include <wsfs/provider/operation/close.h>
|
||||
#include <wsfs/provider/operation/read.h>
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user