commit
d2adf0cffb
@ -0,0 +1,13 @@
|
||||
{
|
||||
lws realloc
|
||||
Helgrind:Race
|
||||
fun:_realloc
|
||||
fun:lws_realloc
|
||||
}
|
||||
|
||||
{
|
||||
lws zalloc
|
||||
Helgrind:Race
|
||||
fun:_realloc
|
||||
fun:lws_zalloc
|
||||
}
|
@ -1,10 +1,10 @@
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// \file adapter/api.h
|
||||
/// \file webfuse/api.h
|
||||
/// \brief API define for webfuse adapter.
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef WF_ADAPTER_API_H
|
||||
#define WF_ADAPTER_API_H
|
||||
#ifndef WF_API_H
|
||||
#define WF_API_H
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/// \def WF_API
|
@ -1,10 +1,10 @@
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// \file adapter/authenticate.h
|
||||
/// \file webfuse/authenticate.h
|
||||
/// \brief Authenticate function.
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef WF_ADAPTER_AUTHENTICATE_H
|
||||
#define WF_ADAPTER_AUTHENTICATE_H
|
||||
#ifndef WF_AUTHENTICATE_H
|
||||
#define WF_AUTHENTICATE_H
|
||||
|
||||
#ifndef __cplusplus
|
||||
#include <stdbool.h>
|
@ -1,13 +1,13 @@
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// \file adapter/client.h
|
||||
/// \file webfuse/client.h
|
||||
/// \brief Adapter client.
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef WF_ADAPTER_CLIENT_H
|
||||
#define WF_ADAPTER_CLIENT_H
|
||||
#ifndef WF_CLIENT_H
|
||||
#define WF_CLIENT_H
|
||||
|
||||
#include <webfuse/adapter/api.h>
|
||||
#include <webfuse/adapter/client_callback.h>
|
||||
#include <webfuse/api.h>
|
||||
#include <webfuse/client_callback.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C"
|
@ -1,10 +1,10 @@
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// \file adapter/client_callbak.h
|
||||
/// \file webfuse/client_callbak.h
|
||||
/// \brief Callback of adapter clients.
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef WF_ADAPTER_CLIENT_CALLBACK_H
|
||||
#define WF_ADAPTER_CLIENT_CALLBACK_H
|
||||
#ifndef WF_CLIENT_CALLBACK_H
|
||||
#define WF_CLIENT_CALLBACK_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C"
|
@ -1,12 +1,12 @@
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// \file adapter/client_tslconfig.h
|
||||
/// \file webfuse/client_tslconfig.h
|
||||
/// \brief Configuration of TLS (Transport Layer Security) for adapter clients.
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef WF_ADAPTER_CLIENT_TLSCONFIG_H
|
||||
#define WF_ADAPTER_CLIENT_TLSCONFIG_H
|
||||
#ifndef WF_CLIENT_TLSCONFIG_H
|
||||
#define WF_CLIENT_TLSCONFIG_H
|
||||
|
||||
#include <webfuse/adapter/api.h>
|
||||
#include <webfuse/api.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C"
|
@ -1,12 +1,12 @@
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// \file adapter/credentials.h
|
||||
/// \file webfuse/credentials.h
|
||||
/// \brief Credentials used for user authentication.
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef WF_ADAPTER_CREDENTIALS_H
|
||||
#define WF_ADAPTER_CREDENTIALS_H
|
||||
#ifndef WF_CREDENTIALS_H
|
||||
#define WF_CREDENTIALS_H
|
||||
|
||||
#include "webfuse/adapter/api.h"
|
||||
#include "webfuse/api.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C"
|
@ -1,12 +1,12 @@
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// \file adapter/mountpoint.h
|
||||
/// \file webfuse/mountpoint.h
|
||||
/// \brief Mointpoint.
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef WF_ADAPTER_MOUNTPOINT_H
|
||||
#define WF_ADAPTER_MOUNTPOINT_H
|
||||
#ifndef WF_MOUNTPOINT_H
|
||||
#define WF_MOUNTPOINT_H
|
||||
|
||||
#include <webfuse/adapter/api.h>
|
||||
#include <webfuse/api.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C"
|
@ -1,12 +1,12 @@
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// \file adapter/mountpoint_factory.h
|
||||
/// \file webfuse/mountpoint_factory.h
|
||||
/// \brief Defines a factory function to create mointpoints.
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef WF_ADAPTER_MOUNTPOINT_FACTORY_H
|
||||
#define WF_ADAPTER_MOUNTPOINT_FACTORY_H
|
||||
#ifndef WF_MOUNTPOINT_FACTORY_H
|
||||
#define WF_MOUNTPOINT_FACTORY_H
|
||||
|
||||
#include <webfuse/adapter/api.h>
|
||||
#include <webfuse/api.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C"
|
@ -1,5 +1,5 @@
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// \file protocol_names.h
|
||||
/// \file webufse/protocol_names.h
|
||||
/// \brief Names of websocket protocol.
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
#ifndef WF_PROTOCOL_NAMES_H
|
@ -1,32 +0,0 @@
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// \file provider/api.h
|
||||
/// \brief API define for webfuse provider.
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef WFP_PROVIDER_API_H
|
||||
#define WFP_PROVIDER_API_H
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/// \def WFP_API
|
||||
/// \brief Marks public symbols of libwebfuse_provider.
|
||||
//------------------------------------------------------------------------------
|
||||
#ifndef WFP_API
|
||||
#define WFP_API
|
||||
#endif
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/// \def WFP_EXPORT
|
||||
/// \brief Marks exported symbols as visible.
|
||||
///
|
||||
/// Set WFP_API to WFP_EXPORT when building libwebfuse_provider.so to export
|
||||
/// public symbols.
|
||||
//------------------------------------------------------------------------------
|
||||
#ifndef WFP_EXPORT
|
||||
#ifdef __GNUC__
|
||||
#define WFP_EXPORT __attribute__ ((visibility ("default")))
|
||||
#else
|
||||
#define WFP_EXPORT
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#endif
|
@ -1,105 +0,0 @@
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// \file provider/client.h
|
||||
/// \brief Webfuse provider client.
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef WF_PROVIDER_CLIENT_H
|
||||
#define WF_PROVIDER_CLIENT_H
|
||||
|
||||
#include "webfuse/provider/api.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C"
|
||||
{
|
||||
#endif
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/// \struct wfp_client
|
||||
/// \brief Webfuse provider client.
|
||||
//------------------------------------------------------------------------------
|
||||
struct wfp_client;
|
||||
|
||||
struct wfp_client_config;
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/// \brief Creates a webfuse provider client.
|
||||
///
|
||||
/// \note Client configuration is not managed by the client.
|
||||
///
|
||||
/// \param config pointer to client configuration.
|
||||
/// \return newly created client or NULL in case of an error.
|
||||
//------------------------------------------------------------------------------
|
||||
extern WFP_API struct wfp_client * wfp_client_create(
|
||||
struct wfp_client_config * config);
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/// \brief Connects the client to a remote webfuse adapter server.
|
||||
///
|
||||
/// \note This call starts to establish a connection. A callback is invoked,
|
||||
/// when the connection is estanlished.
|
||||
///
|
||||
/// \param client pointer to client
|
||||
/// \param url URL of remote webfuse adapter server
|
||||
///
|
||||
/// \see wfp_connected_fn
|
||||
/// \see wfp_client_config_set_onconnected
|
||||
//------------------------------------------------------------------------------
|
||||
extern WFP_API void wfp_client_connect(
|
||||
struct wfp_client * client,
|
||||
char const * url);
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/// \brief Disconnects a connected client.
|
||||
///
|
||||
/// \note This call starts to disconnect the connection. A callback is invoked
|
||||
/// when conntection is disconnected.
|
||||
///
|
||||
/// \param client pointer to client
|
||||
///
|
||||
/// \see wfp_disconnected_fn
|
||||
/// \see wfp_client_config_set_ondisconnected
|
||||
//------------------------------------------------------------------------------
|
||||
extern WFP_API void wfp_client_disconnect(
|
||||
struct wfp_client * client);
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/// \brief Disposes a client.
|
||||
///
|
||||
/// \note Client configuration is not managed by client.
|
||||
///
|
||||
/// \param client pointer to client
|
||||
//------------------------------------------------------------------------------
|
||||
extern WFP_API void wfp_client_dispose(
|
||||
struct wfp_client * client);
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/// \brief Triggers the client.
|
||||
///
|
||||
/// This function must be invoked in a loop while the client is running. It
|
||||
/// makes the server wait for the next event and processes it.
|
||||
///
|
||||
/// \param client pointer to client
|
||||
///
|
||||
/// \see wfp_client_interrupt
|
||||
//------------------------------------------------------------------------------
|
||||
extern WFP_API void wfp_client_service(
|
||||
struct wfp_client * client);
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/// \brief interrupt wfp_client_service
|
||||
///
|
||||
/// This function can be called from another thread.
|
||||
///
|
||||
/// \param client pointer to client
|
||||
///
|
||||
/// \see wfp_client_service
|
||||
//------------------------------------------------------------------------------
|
||||
extern WFP_API void wfp_client_interrupt(
|
||||
struct wfp_client * client);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
#endif
|
@ -1,240 +0,0 @@
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// \file provider/client_config.h
|
||||
/// \brief Client configuration of webfuse provider.
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#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>
|
||||
#include <webfuse/provider/credentials.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C"
|
||||
{
|
||||
#endif
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/// \struct wfp_client_config
|
||||
/// \brief Provider client configuration object.
|
||||
///
|
||||
/// Holds configuration of webfuse provider client.
|
||||
//------------------------------------------------------------------------------
|
||||
struct wfp_client_config;
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/// \brief Callback to signal when the client's connection is established.
|
||||
///
|
||||
/// \param user_data user defined context
|
||||
//------------------------------------------------------------------------------
|
||||
typedef void wfp_connected_fn(
|
||||
void * user_data);
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/// \brief Callback to signal when a client's connection is disconnected.
|
||||
///
|
||||
/// \param user_data user defined context
|
||||
//------------------------------------------------------------------------------
|
||||
typedef void wfp_disconnected_fn(
|
||||
void * user_data);
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/// \brief Creates a new client configuration.
|
||||
///
|
||||
/// \return newly created client configuration
|
||||
//------------------------------------------------------------------------------
|
||||
extern WFP_API struct wfp_client_config * wfp_client_config_create(void);
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/// \brief Disposes a client configuration.
|
||||
///
|
||||
/// \note The user defined context is not managed by the client configuration.
|
||||
///
|
||||
/// \param config pointer to client configuration
|
||||
//------------------------------------------------------------------------------
|
||||
extern WFP_API void wfp_client_config_dispose(
|
||||
struct wfp_client_config * config);
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/// \brief Sets a user defined context.
|
||||
///
|
||||
/// \note The user is responsible to manage the lifetime of user data.
|
||||
///
|
||||
/// \param config pointer to client configuration
|
||||
/// \param user_data user defined context
|
||||
//------------------------------------------------------------------------------
|
||||
extern WFP_API void wfp_client_config_set_userdata(
|
||||
struct wfp_client_config * config,
|
||||
void * user_data);
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/// \brief Sets the path to clients private key.
|
||||
///
|
||||
/// \note To enable TLS both, private key and certificate, must be specified.
|
||||
/// Otherwise, TLS is not used.
|
||||
///
|
||||
/// \param config pointer to client configuration
|
||||
/// \param key_path path of clients private key (pem file)
|
||||
//------------------------------------------------------------------------------
|
||||
extern WFP_API void wfp_client_config_set_keypath(
|
||||
struct wfp_client_config * config,
|
||||
char const * key_path);
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/// \brief Sets the path of clients certificate.
|
||||
///
|
||||
/// \note To enable TLS both, private key and certificate, must be specified.
|
||||
/// Otherwise, TLS is not used.
|
||||
///
|
||||
/// \param config pointer to client configuration
|
||||
/// \param cert_path path of the clients certificate (pem file)
|
||||
//------------------------------------------------------------------------------
|
||||
extern WFP_API void wfp_client_config_set_certpath(
|
||||
struct wfp_client_config * config,
|
||||
char const * cert_path);
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/// \brief Sets the path of ca file to verify servers.
|
||||
///
|
||||
/// \note To enable TLS both, private key and certificate, must be specified.
|
||||
/// Otherwise, TLS is not used.
|
||||
///
|
||||
/// \param config pointer to client configuration
|
||||
/// \param ca_filepath path of the ca file (pem file)
|
||||
//------------------------------------------------------------------------------
|
||||
extern WFP_API void wfp_client_config_set_ca_filepath(
|
||||
struct wfp_client_config * config,
|
||||
char const * ca_filepath);
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/// \brief Sets the onconnected handler.
|
||||
///
|
||||
/// The handler is invoked, when the client's conntection is established.
|
||||
///
|
||||
/// \param config pointer to client configuration
|
||||
/// \param handler pointer to handler
|
||||
//------------------------------------------------------------------------------
|
||||
extern WFP_API void wfp_client_config_set_onconnected(
|
||||
struct wfp_client_config * config,
|
||||
wfp_connected_fn * handler);
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/// \brief Sets ondisconnected handler
|
||||
///
|
||||
/// The handler is invoked, when the client's conntection is lost.
|
||||
///
|
||||
/// \param config pointer to client configuration
|
||||
/// \param handler pointer to handler
|
||||
//------------------------------------------------------------------------------
|
||||
extern WFP_API void wfp_client_config_set_ondisconnected(
|
||||
struct wfp_client_config * config,
|
||||
wfp_disconnected_fn * handler);
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/// \brief Sets onlookup handler.
|
||||
///
|
||||
/// The handler is invoked, when the identifier of a file is requested.
|
||||
///
|
||||
/// \param config pointer to client configuration
|
||||
/// \param handler pointer to handler
|
||||
///
|
||||
/// \see wfp_lookup_fn
|
||||
//------------------------------------------------------------------------------
|
||||
extern WFP_API void wfp_client_config_set_onlookup(
|
||||
struct wfp_client_config * config,
|
||||
wfp_lookup_fn * handler);
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/// \brief Sets ongetattr handler.
|
||||
///
|
||||
/// The handler is invoked, when attributes of a file are requested.
|
||||
///
|
||||
/// \param config pointer to client configuration
|
||||
/// \param handler pointer to handler
|
||||
///
|
||||
/// \see wfp_getattr_fn
|
||||
//------------------------------------------------------------------------------
|
||||
extern WFP_API void wfp_client_config_set_ongetattr(
|
||||
struct wfp_client_config * config,
|
||||
wfp_getattr_fn * handler);
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/// \brief Sets onreaddir handler.
|
||||
///
|
||||
/// The handler is invoked, when the contents of directory are requested-
|
||||
///
|
||||
/// \param config pointer to client configuration
|
||||
/// \param handler pointer to handler
|
||||
///
|
||||
/// \see wfp_readdir_fn
|
||||
//------------------------------------------------------------------------------
|
||||
extern WFP_API void wfp_client_config_set_onreaddir(
|
||||
struct wfp_client_config * config,
|
||||
wfp_readdir_fn * handler);
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/// \brief Sets onopen handler.
|
||||
///
|
||||
/// The handler is invoked, whe a file should be opened.
|
||||
///
|
||||
/// \param config pointer to client configuration
|
||||
/// \param handler pointer to handler
|
||||
///
|
||||
/// \see wfp_open_fn
|
||||
//------------------------------------------------------------------------------
|
||||
extern WFP_API void wfp_client_config_set_onopen(
|
||||
struct wfp_client_config * config,
|
||||
wfp_open_fn * handler);
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/// \brief Sets onclose handler.
|
||||
///
|
||||
/// The handler is invoked, when a file is closed.
|
||||
///
|
||||
/// \param config pointer to client configuration
|
||||
/// \param handler pointer to handler
|
||||
///
|
||||
/// \see wfp_close_fn
|
||||
//------------------------------------------------------------------------------
|
||||
extern WFP_API void wfp_client_config_set_onclose(
|
||||
struct wfp_client_config * config,
|
||||
wfp_close_fn * handler);
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/// \brief Sets onread handler.
|
||||
///
|
||||
/// The handler is invoked, when a files content is requested.
|
||||
///
|
||||
/// \param config pointer to client configuration
|
||||
/// \param handler pointer to handler
|
||||
///
|
||||
/// \see wfp_read_fn
|
||||
//------------------------------------------------------------------------------
|
||||
extern WFP_API void wfp_client_config_set_onread(
|
||||
struct wfp_client_config * config,
|
||||
wfp_read_fn * handler);
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/// \brief Enabled authentication.
|
||||
///
|
||||
/// \param config pointer to client configuration
|
||||
/// \param get_credentials pointer to function providing credentials when
|
||||
// needed.
|
||||
//------------------------------------------------------------------------------
|
||||
extern WFP_API void wfp_client_config_enable_authentication(
|
||||
struct wfp_client_config * config,
|
||||
wfp_get_credentials_fn * get_credentials);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
#endif
|
@ -1,117 +0,0 @@
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// \file provider/client_protocol.h
|
||||
/// \brief Provides low level access to libwebsockets protocol.
|
||||
///
|
||||
/// By default, libwebfuse encapsulates libwebsockets protocol by \ref
|
||||
/// wfp_client. But sometimes it might come in handy to have access to
|
||||
/// libwebsockets protocol. This allows to integrate libwebfuse in existing
|
||||
/// libwebsockets applications.
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#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
|
||||
/// \brief Opaque webfuse client protocol..
|
||||
//------------------------------------------------------------------------------
|
||||
struct wfp_client_protocol;
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/// \struct lws_protocols
|
||||
/// \brief Forward declaration of libwebsockets protocols structure.
|
||||
//------------------------------------------------------------------------------
|
||||
struct lws_protocols;
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/// \struct lws_context
|
||||
/// \brief Forward declaration of libwebsockets context structure.
|
||||
//------------------------------------------------------------------------------
|
||||
struct lws_context;
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/// \struct wfp_client_config
|
||||
/// \copydoc wfp_client_config
|
||||
//------------------------------------------------------------------------------
|
||||
struct wfp_client_config;
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/// \brief Creates a new webfuse provider client protocol.
|
||||
///
|
||||
/// \note The user is responsible to manage lifetime of \arg config.
|
||||
///
|
||||
/// \note TLS configuration is ignored, since TLS is managed by libwebsockets.
|
||||
///
|
||||
/// \param config pointer to client config
|
||||
/// \return newly created protocol
|
||||
//------------------------------------------------------------------------------
|
||||
extern WFP_API struct wfp_client_protocol * wfp_client_protocol_create(
|
||||
struct wfp_client_config const * config);
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/// \brief Disposes a protocol.
|
||||
///
|
||||
/// \note The user defined context is not managed by the protocol.
|
||||
///
|
||||
/// \param protocol pointer to protocol.
|
||||
//------------------------------------------------------------------------------
|
||||
extern WFP_API void wfp_client_protocol_dispose(
|
||||
struct wfp_client_protocol * protocol);
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/// \brief Initialized libwebsockets protocol structure.
|
||||
///
|
||||
/// \param protocol pointer to protocol
|
||||
/// \param lws_protocol pointer to libwebsockets protocol structure.
|
||||
//------------------------------------------------------------------------------
|
||||
extern WFP_API void wfp_client_protocol_init_lws(
|
||||
struct wfp_client_protocol * protocol,
|
||||
struct lws_protocols * lws_protocol);
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/// \brief Connects the protocol to a remote webfuse adapter server.
|
||||
///
|
||||
/// \note This call starts to establish a connection. A callback is invoked,
|
||||
/// when the connection is estanlished.
|
||||
///
|
||||
/// \param protocol pointer to protocol
|
||||
/// \param context lws context
|
||||
/// \param url URL of remote webfuse adapter server
|
||||
///
|
||||
/// \see wfp_connected_fn
|
||||
/// \see wfp_client_config_set_onconnected
|
||||
//------------------------------------------------------------------------------
|
||||
extern WFP_API void wfp_client_protocol_connect(
|
||||
struct wfp_client_protocol * protocol,
|
||||
struct lws_context * context,
|
||||
char const * url);
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/// \brief Disconnects the protocol from a remote webfuse adapter server.
|
||||
///
|
||||
/// \note This call starts to disconnect. A callback is invoked,
|
||||
/// when the connection is estanlished.
|
||||
///
|
||||
/// \param protocol pointer to protocol
|
||||
///
|
||||
/// \see wfp_connected_fn
|
||||
/// \see wfp_client_config_set_ondisconnected
|
||||
//------------------------------------------------------------------------------
|
||||
extern WFP_API void wfp_client_protocol_disconnect(
|
||||
struct wfp_client_protocol * protocol);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
#endif
|
@ -1,30 +0,0 @@
|
||||
#ifndef WF_PROVIDER_CREDENTIALS_H
|
||||
#define WF_PROVIDER_CREDENTIALS_H
|
||||
|
||||
#include <webfuse/provider/api.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C"
|
||||
{
|
||||
#endif
|
||||
|
||||
struct wfp_credentials;
|
||||
|
||||
typedef void wfp_get_credentials_fn(
|
||||
struct wfp_credentials * credentials,
|
||||
void * user_data);
|
||||
|
||||
extern WFP_API void wfp_credentials_set_type(
|
||||
struct wfp_credentials * credentials,
|
||||
char const * type);
|
||||
|
||||
extern WFP_API void wfp_credentials_add(
|
||||
struct wfp_credentials * credentials,
|
||||
char const * key,
|
||||
char const * value);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
@ -1,60 +0,0 @@
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// \file provider/dirbuffer.h
|
||||
/// \brief Buffer used for directory listing.
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#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
|
||||
/// \brief Buffer used for directory listing.
|
||||
///
|
||||
/// \see wfp_respond_readdir
|
||||
//------------------------------------------------------------------------------
|
||||
struct wfp_dirbuffer;
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/// \brief Creates a new dir buffer.
|
||||
///
|
||||
/// \return newly created dir buffer.
|
||||
//------------------------------------------------------------------------------
|
||||
extern WFP_API struct wfp_dirbuffer * wfp_dirbuffer_create(void);
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/// \brief Disposes a dir buffer.
|
||||
///
|
||||
/// \param buffer pointer to dir buffer
|
||||
//------------------------------------------------------------------------------
|
||||
extern WFP_API void wfp_dirbuffer_dispose(
|
||||
struct wfp_dirbuffer * buffer);
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/// \brief Adds an entry to dir buffer.
|
||||
///
|
||||
/// \param buffer pointer to dir buffer
|
||||
/// \param name name of the entry (file or directory)
|
||||
/// \param inode inode of the entry
|
||||
//------------------------------------------------------------------------------
|
||||
extern WFP_API void wfp_dirbuffer_add(
|
||||
struct wfp_dirbuffer * buffer,
|
||||
char const * name,
|
||||
ino_t inode);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
#endif
|
@ -1,46 +0,0 @@
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// \file provider/operation/close.h
|
||||
/// \brief Provider's close callback.
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef WFP_OPERATION_CLOSE_H
|
||||
#define WFP_OPERATION_CLOSE_H
|
||||
|
||||
#ifndef __cplusplus
|
||||
#include <inttypes.h>
|
||||
#else
|
||||
#include <cinttypes>
|
||||
#endif
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include "webfuse/provider/api.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C"
|
||||
{
|
||||
#endif
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/// \brief Callback invoked when a file is invoked.
|
||||
///
|
||||
/// This function does not respond.
|
||||
///
|
||||
/// \param inode inode of file to close
|
||||
/// \param handle handle of file to close
|
||||
/// \param flags file close flags
|
||||
/// \param user_data user defined context
|
||||
//------------------------------------------------------------------------------
|
||||
typedef void wfp_close_fn(
|
||||
ino_t inode,
|
||||
uint32_t handle,
|
||||
int flags,
|
||||
void * user_data);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
@ -1,36 +0,0 @@
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// \file provider/operation/error.h
|
||||
/// \brief Respond with error code.
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#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;
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/// \brief Respond to a request with an error.
|
||||
///
|
||||
/// A client's callback must respond with exactly one responde, either with a
|
||||
/// valid reponse regarding to the concrete request or with an error response.
|
||||
///
|
||||
/// \param request pointer to request
|
||||
/// \param status error code
|
||||
//------------------------------------------------------------------------------
|
||||
extern WFP_API void wfp_respond_error(
|
||||
struct wfp_request * request,
|
||||
wf_status status);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
@ -1,55 +0,0 @@
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// \file provider/operation/getattr.h
|
||||
/// \brief Get file attributes.
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#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;
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/// \brief Get file attributes.
|
||||
///
|
||||
/// \note After this function is called, exactly one response must be sent,
|
||||
/// either via \ref wfp_respond_getattr or via \ref wfp_respond_error.
|
||||
///
|
||||
/// \param request pointer to request
|
||||
/// \param inode inode of file to get attributes
|
||||
/// \param user_data user defined context
|
||||
///
|
||||
/// \see wfp_respond_getattr
|
||||
/// \see wfp_respond_error
|
||||
//------------------------------------------------------------------------------
|
||||
typedef void wfp_getattr_fn(
|
||||
struct wfp_request * request,
|
||||
ino_t inode,
|
||||
void * user_data);
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/// \brief Respond to a get attributes request.
|
||||
///
|
||||
/// \param request pointer to request
|
||||
/// \param stat file attributes
|
||||
//------------------------------------------------------------------------------
|
||||
extern WFP_API void wfp_respond_getattr(
|
||||
struct wfp_request * request,
|
||||
struct stat const * stat);
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
@ -1,57 +0,0 @@
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// \file provider/operation/lookup.h
|
||||
/// \brief Lookup file.
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#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;
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/// \brief Lookup a file or directory.
|
||||
///
|
||||
/// \note After this function is called, exactly one response must be sent,
|
||||
/// either via \ref wfp_respond_lookup or via \ref wfp_respond_error.
|
||||
///
|
||||
/// \param request pointer to request
|
||||
/// \param parent inode of parent
|
||||
/// \param name name of the filesystem object to lookup
|
||||
/// \param user_data pointer to user defined context
|
||||
///
|
||||
/// \see wfp_respond_lookup
|
||||
/// \see wfp_respond_error
|
||||
//------------------------------------------------------------------------------
|
||||
typedef void wfp_lookup_fn(
|
||||
struct wfp_request * request,
|
||||
ino_t parent,
|
||||
char const * name,
|
||||
void * user_data);
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/// \brief Respond to lookup request.
|
||||
///
|
||||
/// \param request pointer to request
|
||||
/// \param stat attributes of filesystem object
|
||||
//------------------------------------------------------------------------------
|
||||
extern WFP_API void wfp_respond_lookup(
|
||||
struct wfp_request * request,
|
||||
struct stat const * stat);
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
@ -1,63 +0,0 @@
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// \file provider/operation/open.h
|
||||
/// \brief Open a file.
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef WFP_OPERATION_OPEN_H
|
||||
#define WFP_OPERATION_OPEN_H
|
||||
|
||||
#ifndef __cplusplus
|
||||
#include <inttypes.h>
|
||||
#else
|
||||
#include <cinttypes>
|
||||
#endif
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include "webfuse/provider/api.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C"
|
||||
{
|
||||
#endif
|
||||
|
||||
struct wfp_request;
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/// \brief Open a file.
|
||||
///
|
||||
/// \note After this function is called, exactly one response must be sent,
|
||||
/// either via \ref wfp_respond_open or via \ref wfp_respond_error.
|
||||
///
|
||||
/// \param request pointer to request
|
||||
/// \param inode inode of the file to open
|
||||
/// \param flags file open flags
|
||||
/// \param user_data user defined context
|
||||
///
|
||||
/// \see wfp_respond_open
|
||||
/// \see wfp_respond_error
|
||||
//------------------------------------------------------------------------------
|
||||
typedef void wfp_open_fn(
|
||||
struct wfp_request * request,
|
||||
ino_t inode,
|
||||
int flags,
|
||||
void * user_data);
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/// \brief Respond to open file.
|
||||
///
|
||||
/// \param request pointer to request
|
||||
/// \param handle handle of the opened file
|
||||
//------------------------------------------------------------------------------
|
||||
extern WFP_API void wfp_respond_open(
|
||||
struct wfp_request * request,
|
||||
uint32_t handle);
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
@ -1,76 +0,0 @@
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// \file provider/operation/read.h
|
||||
/// \brief Read contents of a file.
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef WFP_OPERATION_READ_H
|
||||
#define WFP_OPERATION_READ_H
|
||||
|
||||
#ifndef __cplusplus
|
||||
#include <stddef.h>
|
||||
#include <inttypes.h>
|
||||
#else
|
||||
#include <cstddef>
|
||||
#include <cinttypes>
|
||||
using std::size_t;
|
||||
#endif
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include "webfuse/provider/api.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C"
|
||||
{
|
||||
#endif
|
||||
|
||||
struct wfp_request;
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/// \brief Requests content of a file.
|
||||
///
|
||||
/// On success, up to \arg length bytes should be returned via \ref
|
||||
/// wfp_respond_read.
|
||||
///
|
||||
/// \note After this function is called, exactly one response must be sent,
|
||||
/// either via \ref wfp_respond_read or via \ref wfp_respond_error.
|
||||
///
|
||||
/// \param request pointer to request
|
||||
/// \param inode inode of the file to read
|
||||
/// \param handle handle of the file to read (returned by open)
|
||||
/// \param offset offset within the file where to start reading
|
||||
/// \param length amount of bytes to read
|
||||
/// \param user_data used defined context
|
||||
///
|
||||
/// \see wfp_respond_read
|
||||
/// \see wfp_respond_error
|
||||
//------------------------------------------------------------------------------
|
||||
typedef void wfp_read_fn(
|
||||
struct wfp_request * request,
|
||||
ino_t inode,
|
||||
uint32_t handle,
|
||||
size_t offset,
|
||||
size_t length,
|
||||
void * user_data);
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/// \brief Respond to read.
|
||||
///
|
||||
/// \note The user is responsible to manage lifetime of \arg data.
|
||||
///
|
||||
/// \param request pointer to request
|
||||
/// \param data data read from file
|
||||
/// \param length amount of bytes read
|
||||
//------------------------------------------------------------------------------
|
||||
extern WFP_API void wfp_respond_read(
|
||||
struct wfp_request * request,
|
||||
char const * data,
|
||||
size_t length);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
@ -1,58 +0,0 @@
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// \file provider/operation/readdir.h
|
||||
/// \brief List directory contents.
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#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;
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/// \brief Requests the contents of a directory.
|
||||
///
|
||||
/// \note After this function is called, exactly one response must be sent,
|
||||
/// either via \ref wfp_respond_readdir or via \ref wfp_respond_error.
|
||||
///
|
||||
/// \param request pointer to request
|
||||
/// \param directory inode of directory to list
|
||||
/// \param user_data user defined context
|
||||
///
|
||||
/// \see wfp_respond_readdir
|
||||
/// \see wfp_respond_error
|
||||
//------------------------------------------------------------------------------
|
||||
typedef void wfp_readdir_fn(
|
||||
struct wfp_request * request,
|
||||
ino_t directory,
|
||||
void * user_data);
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/// \brief Respond to list directory contents.
|
||||
///
|
||||
/// \note The user is responsible to manage dirbuffe, p.e. to dispose
|
||||
/// it after this function is called.
|
||||
///
|
||||
/// \param request pointer to request
|
||||
/// \param dirbuffer contains contents of directory
|
||||
//------------------------------------------------------------------------------
|
||||
extern WFP_API void wfp_respond_readdir(
|
||||
struct wfp_request * request,
|
||||
struct wfp_dirbuffer * dirbuffer);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
@ -1,12 +1,12 @@
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// \file adapter/server.h
|
||||
/// \file webfuse/server.h
|
||||
/// \brief Adapter server.
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef WF_ADAPTER_SERVER_H
|
||||
#define WF_ADAPTER_SERVER_H
|
||||
#ifndef WF_SERVER_H
|
||||
#define WF_SERVER_H
|
||||
|
||||
#include "webfuse/adapter/api.h"
|
||||
#include "webfuse/api.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C"
|
@ -1,14 +1,14 @@
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// \file adapter/server_config.h
|
||||
/// \file webfuse/server_config.h
|
||||
/// \brief Server configuration.
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef WF_ADAPTER_SERVER_CONFIG_H
|
||||
#define WF_ADAPTER_SERVER_CONFIG_H
|
||||
#ifndef WF_SERVER_CONFIG_H
|
||||
#define WF_SERVER_CONFIG_H
|
||||
|
||||
#include "webfuse/adapter/api.h"
|
||||
#include "webfuse/adapter/authenticate.h"
|
||||
#include "webfuse/adapter/mountpoint_factory.h"
|
||||
#include "webfuse/api.h"
|
||||
#include "webfuse/authenticate.h"
|
||||
#include "webfuse/mountpoint_factory.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C"
|
@ -1,5 +1,5 @@
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// \file status.h
|
||||
/// \file webfuse/status.h
|
||||
/// \brief Generic status code.
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
@ -0,0 +1,25 @@
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// \file webfuse/webfuse.h
|
||||
/// \brief Convenience header to include all functionality of libfuse_adapter.
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef WF_WEBFUSE_H
|
||||
#define WF_WEBFUSE_H
|
||||
|
||||
#include <webfuse/status.h>
|
||||
#include <webfuse/protocol_names.h>
|
||||
|
||||
#include <webfuse/api.h>
|
||||
#include <webfuse/server.h>
|
||||
#include <webfuse/server_config.h>
|
||||
#include <webfuse/server_protocol.h>
|
||||
#include <webfuse/authenticate.h>
|
||||
#include <webfuse/credentials.h>
|
||||
#include <webfuse/mountpoint.h>
|
||||
|
||||
#include <webfuse/client.h>
|
||||
#include <webfuse/client_callback.h>
|
||||
#include <webfuse/client_tlsconfig.h>
|
||||
|
||||
|
||||
#endif
|
@ -1,25 +0,0 @@
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// \file webfuse_adapter.h
|
||||
/// \brief Convenience header to include all functionality of libfuse_adapter.
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef WF_ADAPTER_H
|
||||
#define WF_ADAPTER_H
|
||||
|
||||
#include <webfuse/core/status.h>
|
||||
#include <webfuse/core/protocol_names.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>
|
||||
#include <webfuse/adapter/mountpoint.h>
|
||||
|
||||
#include <webfuse/adapter/client.h>
|
||||
#include <webfuse/adapter/client_callback.h>
|
||||
#include <webfuse/adapter/client_tlsconfig.h>
|
||||
|
||||
|
||||
#endif
|
@ -1,27 +0,0 @@
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// \file webfuse_provider.h
|
||||
/// \brief Convenience header to include all functionality of libfuse_provider.
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef WF_PROVIDER_H
|
||||
#define WF_PROVIDER_H
|
||||
|
||||
#include <webfuse/core/status.h>
|
||||
#include <webfuse/core/protocol_names.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/credentials.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,15 +1,15 @@
|
||||
#include "webfuse_adapter.h"
|
||||
#include "webfuse/webfuse.h"
|
||||
|
||||
#include "webfuse/adapter/impl/server.h"
|
||||
#include "webfuse/adapter/impl/server_protocol.h"
|
||||
#include "webfuse/adapter/impl/server_config.h"
|
||||
#include "webfuse/adapter/impl/credentials.h"
|
||||
#include "webfuse/adapter/impl/mountpoint.h"
|
||||
#include "webfuse/impl/server.h"
|
||||
#include "webfuse/impl/server_protocol.h"
|
||||
#include "webfuse/impl/server_config.h"
|
||||
#include "webfuse/impl/credentials.h"
|
||||
#include "webfuse/impl/mountpoint.h"
|
||||
|
||||
#include "webfuse/core/util.h"
|
||||
#include "webfuse/impl/util/util.h"
|
||||
|
||||
#include "webfuse/adapter/impl/client.h"
|
||||
#include "webfuse/adapter/impl/client_tlsconfig.h"
|
||||
#include "webfuse/impl/client.h"
|
||||
#include "webfuse/impl/client_tlsconfig.h"
|
||||
|
||||
// server
|
||||
|
@ -1,18 +0,0 @@
|
||||
#include "webfuse/core/lws_log.h"
|
||||
#include <stdbool.h>
|
||||
#include <libwebsockets.h>
|
||||
|
||||
#define WF_LWSLOG_DISABLE 0
|
||||
|
||||
static bool wf_lwslog_is_diabled = false;
|
||||
|
||||
void wf_lwslog_disable(void)
|
||||
{
|
||||
if (!wf_lwslog_is_diabled)
|
||||
{
|
||||
lws_set_log_level(WF_LWSLOG_DISABLE, NULL);
|
||||
wf_lwslog_is_diabled = true;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1,15 +0,0 @@
|
||||
#ifndef WF_LWS_LOG_H
|
||||
#define WF_LWS_LOG_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C"
|
||||
{
|
||||
#endif
|
||||
|
||||
extern void wf_lwslog_disable(void);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
@ -1,17 +0,0 @@
|
||||
#include "webfuse/core/message_queue.h"
|
||||
#include "webfuse/core/message.h"
|
||||
#include "webfuse/core/container_of.h"
|
||||
|
||||
void wf_message_queue_cleanup(
|
||||
struct wf_slist * queue)
|
||||
{
|
||||
struct wf_slist_item * item = wf_slist_first(queue);
|
||||
while (NULL != item)
|
||||
{
|
||||
struct wf_slist_item * next = item->next;
|
||||
struct wf_message * message = wf_container_of(item, struct wf_message, item);
|
||||
wf_message_dispose(message);
|
||||
item = next;
|
||||
}
|
||||
wf_slist_init(queue);
|
||||
}
|
@ -1,19 +0,0 @@
|
||||
#ifndef WF_STATUS_INTERN_H
|
||||
#define WF_STATUS_INTERN_H
|
||||
|
||||
#include "webfuse/core/status.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
extern int wf_status_to_rc(wf_status status);
|
||||
|
||||
extern char const * wf_status_tostring(wf_status status);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
@ -1,31 +0,0 @@
|
||||
#include "webfuse/core/timer/timepoint.h"
|
||||
|
||||
#include <time.h>
|
||||
|
||||
#define WF_TIMER_MSEC_PER_SEC ((wf_timer_timepoint) 1000)
|
||||
#define WF_TIMER_NSEC_PER_MSEC ((wf_timer_timepoint) 1000 * 1000)
|
||||
|
||||
wf_timer_timepoint wf_timer_timepoint_now(void)
|
||||
{
|
||||
struct timespec tp;
|
||||
clock_gettime(CLOCK_MONOTONIC, &tp);
|
||||
|
||||
wf_timer_timepoint const now = (tp.tv_sec * WF_TIMER_MSEC_PER_SEC) + (tp.tv_nsec / WF_TIMER_NSEC_PER_MSEC);
|
||||
return now;
|
||||
}
|
||||
|
||||
wf_timer_timepoint wf_timer_timepoint_in_msec(wf_timer_timediff value)
|
||||
{
|
||||
wf_timer_timepoint const now = wf_timer_timepoint_now();
|
||||
wf_timer_timepoint result = now + ((wf_timer_timepoint) value);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
bool wf_timer_timepoint_is_elapsed(wf_timer_timepoint tp)
|
||||
{
|
||||
wf_timer_timepoint const now = wf_timer_timepoint_now();
|
||||
wf_timer_timediff const diff = (wf_timer_timediff) (tp - now);
|
||||
|
||||
return (0 > diff);
|
||||
}
|
@ -1,9 +1,9 @@
|
||||
#include "webfuse/adapter/impl/authenticator.h"
|
||||
#include "webfuse/impl/authenticator.h"
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "webfuse/adapter/impl/credentials.h"
|
||||
#include "webfuse/impl/credentials.h"
|
||||
|
||||
struct wf_impl_authenticator * wf_impl_authenticator_create(
|
||||
char const * type,
|
@ -1,9 +1,9 @@
|
||||
#include "webfuse/adapter/impl/authenticators.h"
|
||||
#include "webfuse/impl/authenticators.h"
|
||||
#include <stddef.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "webfuse/adapter/impl/authenticator.h"
|
||||
#include "webfuse/adapter/impl/credentials.h"
|
||||
#include "webfuse/impl/authenticator.h"
|
||||
#include "webfuse/impl/credentials.h"
|
||||
|
||||
static struct wf_impl_authenticator * wf_impl_authenticators_find(
|
||||
struct wf_impl_authenticators * authenticators,
|
@ -1,8 +1,8 @@
|
||||
#ifndef WF_ADAPTER_IMPL_CLIENT_PROTOCOL_H
|
||||
#define WF_ADAPTER_IMPL_CLIENT_PROTOCOL_H
|
||||
|
||||
#include "webfuse/adapter/client_callback.h"
|
||||
#include "webfuse/core/slist.h"
|
||||
#include "webfuse/client_callback.h"
|
||||
#include "webfuse/impl/util/slist.h"
|
||||
|
||||
#ifndef __cplusplus
|
||||
#include <stdbool.h>
|
@ -1,4 +1,4 @@
|
||||
#include "webfuse/adapter/impl/client_tlsconfig.h"
|
||||
#include "webfuse/impl/client_tlsconfig.h"
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
@ -1,4 +1,4 @@
|
||||
#include "webfuse/adapter/impl/credentials.h"
|
||||
#include "webfuse/impl/credentials.h"
|
||||
#include <string.h>
|
||||
|
||||
void wf_impl_credentials_init_default(
|
@ -1,13 +1,13 @@
|
||||
#include "webfuse/adapter/impl/filesystem.h"
|
||||
#include "webfuse/adapter/impl/operation/context.h"
|
||||
#include "webfuse/adapter/impl/operation/open.h"
|
||||
#include "webfuse/adapter/impl/operation/close.h"
|
||||
#include "webfuse/adapter/impl/operation/read.h"
|
||||
#include "webfuse/adapter/impl/operation/readdir.h"
|
||||
#include "webfuse/adapter/impl/operation/getattr.h"
|
||||
#include "webfuse/adapter/impl/operation/lookup.h"
|
||||
#include "webfuse/adapter/impl/session.h"
|
||||
#include "webfuse/adapter/impl/mountpoint.h"
|
||||
#include "webfuse/impl/filesystem.h"
|
||||
#include "webfuse/impl/operation/context.h"
|
||||
#include "webfuse/impl/operation/open.h"
|
||||
#include "webfuse/impl/operation/close.h"
|
||||
#include "webfuse/impl/operation/read.h"
|
||||
#include "webfuse/impl/operation/readdir.h"
|
||||
#include "webfuse/impl/operation/getattr.h"
|
||||
#include "webfuse/impl/operation/lookup.h"
|
||||
#include "webfuse/impl/session.h"
|
||||
#include "webfuse/impl/mountpoint.h"
|
||||
|
||||
#include <libwebsockets.h>
|
||||
|
@ -1,5 +1,5 @@
|
||||
#ifndef WF_JSONRPC_METHOD_INVOKE_FN_H
|
||||
#define WF_JSONRPC_METHOD_INVOKE_FN_H
|
||||
#ifndef WF_IMPL_JSONRPC_METHOD_INVOKE_FN_H
|
||||
#define WF_IMPL_JSONRPC_METHOD_INVOKE_FN_H
|
||||
|
||||
#include <jansson.h>
|
||||
|
@ -1,5 +1,5 @@
|
||||
#ifndef WF_JSONRPC_PROXY_FINISHED_FN_H
|
||||
#define WF_JSONRPC_PROXY_FINISHED_FN_H
|
||||
#ifndef WF_IMPL_JSONRPC_PROXY_FINISHED_FN_H
|
||||
#define WF_IMPL_JSONRPC_PROXY_FINISHED_FN_H
|
||||
|
||||
#include <jansson.h>
|
||||
|
@ -1,5 +1,5 @@
|
||||
#ifndef WF_JSONRPC_SEND_FN_H
|
||||
#define WF_JSONRPC_SEND_FN_H
|
||||
#ifndef WF_IMPL_JSONRPC_SEND_FN_H
|
||||
#define WF_IMPL_JSONRPC_SEND_FN_H
|
||||
|
||||
#ifndef __cplusplus
|
||||
#include <stdbool.h>
|
@ -0,0 +1,17 @@
|
||||
#include "webfuse/impl/message_queue.h"
|
||||
#include "webfuse/impl/message.h"
|
||||
#include "webfuse/impl/util/container_of.h"
|
||||
|
||||
void wf_impl_message_queue_cleanup(
|
||||
struct wf_slist * queue)
|
||||
{
|
||||
struct wf_slist_item * item = wf_impl_slist_first(queue);
|
||||
while (NULL != item)
|
||||
{
|
||||
struct wf_slist_item * next = item->next;
|
||||
struct wf_message * message = wf_container_of(item, struct wf_message, item);
|
||||
wf_impl_message_dispose(message);
|
||||
item = next;
|
||||
}
|
||||
wf_impl_slist_init(queue);
|
||||
}
|
@ -1,4 +1,4 @@
|
||||
#include "webfuse/adapter/impl/mountpoint.h"
|
||||
#include "webfuse/impl/mountpoint.h"
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
@ -1,7 +1,7 @@
|
||||
#ifndef WF_IMPL_MOUNTPOINT_H
|
||||
#define WF_IMPL_MOUNTPOINT_H
|
||||
|
||||
#include "webfuse/adapter/mountpoint.h"
|
||||
#include "webfuse/mountpoint.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C"
|
@ -1,4 +1,4 @@
|
||||
#include "webfuse/adapter/impl/mountpoint_factory.h"
|
||||
#include "webfuse/impl/mountpoint_factory.h"
|
||||
#include <stddef.h>
|
||||
|
||||
void
|
@ -1,7 +1,7 @@
|
||||
#ifndef WF_ADAPTER_IMPL_MOUNTPOINT_FACTORY_H
|
||||
#define WF_ADAPTER_IMPL_MOUNTPOINT_FACTORY_H
|
||||
|
||||
#include "webfuse/adapter/mountpoint_factory.h"
|
||||
#include "webfuse/mountpoint_factory.h"
|
||||
#include <stdbool.h>
|
||||
|
||||
#ifdef __cplusplus
|
@ -1,7 +1,7 @@
|
||||
#ifndef WF_ADAPTER_IMPL_OPERATION_CLOSE_H
|
||||
#define WF_ADAPTER_IMPL_OPERATION_CLOSE_H
|
||||
|
||||
#include "webfuse/adapter/impl/fuse_wrapper.h"
|
||||
#include "webfuse/impl/fuse_wrapper.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C"
|
@ -1,6 +1,6 @@
|
||||
#include "webfuse/adapter/impl/operation/context.h"
|
||||
#include "webfuse/adapter/impl/session_manager.h"
|
||||
#include "webfuse/adapter/impl/session.h"
|
||||
#include "webfuse/impl/operation/context.h"
|
||||
#include "webfuse/impl/session_manager.h"
|
||||
#include "webfuse/impl/session.h"
|
||||
#include <stddef.h>
|
||||
|
||||
struct wf_jsonrpc_proxy * wf_impl_operation_context_get_proxy(
|
@ -1,7 +1,7 @@
|
||||
#ifndef WF_ADAPTER_IMPL_OPERATION_CONTEXT_H
|
||||
#define WF_ADAPTER_IMPL_OPERATION_CONTEXT_H
|
||||
|
||||
#include "webfuse/adapter/impl/fuse_wrapper.h"
|
||||
#include "webfuse/impl/fuse_wrapper.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
@ -1,7 +1,7 @@
|
||||
#ifndef WF_ADAPTER_IMPL_OPERATION_GETATTR_H
|
||||
#define WF_ADAPTER_IMPL_OPERATION_GETATTR_H
|
||||
|
||||
#include "webfuse/adapter/impl/fuse_wrapper.h"
|
||||
#include "webfuse/impl/fuse_wrapper.h"
|
||||
|
||||
#include <jansson.h>
|
||||
#include <sys/types.h>
|
@ -1,7 +1,7 @@
|
||||
#ifndef WF_ADAPTER_IMPL_OPERATION_LOOKUP_H
|
||||
#define WF_ADAPTER_IMPL_OPERATION_LOOKUP_H
|
||||
|
||||
#include "webfuse/adapter/impl/fuse_wrapper.h"
|
||||
#include "webfuse/impl/fuse_wrapper.h"
|
||||
|
||||
#include <jansson.h>
|
||||
#include <sys/types.h>
|
@ -1,7 +1,7 @@
|
||||
#ifndef WF_ADAPTER_IMPL_OPERATION_OPEN_H
|
||||
#define WF_ADAPTER_IMPL_OPERATION_OPEN_H
|
||||
|
||||
#include "webfuse/adapter/impl/fuse_wrapper.h"
|
||||
#include "webfuse/impl/fuse_wrapper.h"
|
||||
#include <jansson.h>
|
||||
|
||||
#ifdef __cplusplus
|
@ -1,8 +1,8 @@
|
||||
#ifndef WF_ADAPTER_IMPL_OPERATION_READ_H
|
||||
#define WF_ADAPTER_IMPL_OPERATION_READ_H
|
||||
|
||||
#include "webfuse/adapter/impl/fuse_wrapper.h"
|
||||
#include "webfuse/core/status.h"
|
||||
#include "webfuse/impl/fuse_wrapper.h"
|
||||
#include "webfuse/status.h"
|
||||
|
||||
#include <jansson.h>
|
||||
|
@ -1,7 +1,7 @@
|
||||
#ifndef WF_ADAPTER_IMPL_OPERATION_READDIR_H
|
||||
#define WF_ADAPTER_IMPL_OPERATION_READDIR_H
|
||||
|
||||
#include "webfuse/adapter/impl/fuse_wrapper.h"
|
||||
#include "webfuse/impl/fuse_wrapper.h"
|
||||
#include <jansson.h>
|
||||
|
||||
#ifdef __cplusplus
|
@ -1,4 +1,4 @@
|
||||
#include "webfuse/adapter/impl/server_config.h"
|
||||
#include "webfuse/impl/server_config.h"
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
@ -1,8 +1,8 @@
|
||||
#ifndef WF_ADAPTER_IMPL_SERVER_CONFIG_H
|
||||
#define WF_ADAPTER_IMPL_SERVER_CONFIG_H
|
||||
|
||||
#include "webfuse/adapter/impl/authenticators.h"
|
||||
#include "webfuse/adapter/impl/mountpoint_factory.h"
|
||||
#include "webfuse/impl/authenticators.h"
|
||||
#include "webfuse/impl/mountpoint_factory.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
@ -1,11 +1,11 @@
|
||||
#ifndef WF_ADAPTER_IMPL_SERVER_PROTOCOL_H
|
||||
#define WF_ADAPTER_IMPL_SERVER_PROTOCOL_H
|
||||
|
||||
#include "webfuse/adapter/impl/authenticators.h"
|
||||
#include "webfuse/adapter/impl/mountpoint_factory.h"
|
||||
#include "webfuse/adapter/impl/session_manager.h"
|
||||
#include "webfuse/core/jsonrpc/proxy.h"
|
||||
#include "webfuse/core/jsonrpc/server.h"
|
||||
#include "webfuse/impl/authenticators.h"
|
||||
#include "webfuse/impl/mountpoint_factory.h"
|
||||
#include "webfuse/impl/session_manager.h"
|
||||
#include "webfuse/impl/jsonrpc/proxy.h"
|
||||
#include "webfuse/impl/jsonrpc/server.h"
|
||||
|
||||
#ifndef __cplusplus
|
||||
#include <stdbool.h>
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in new issue