#include "platform.h"
#include "gnunet_rest_plugin.h"
#include <gnunet_rest_lib.h>
#include "copying_plugin.h"
Go to the source code of this file.
Data Structures | |
struct | Plugin |
Handle for a plugin. More... | |
struct | RequestHandle |
The request handle. More... | |
Macros | |
#define | GNUNET_REST_API_NS_COPYING "/copying" |
#define | GNUNET_REST_COPYING_TEXT "GNU Affero General Public License version 3 or later. See also: <http://www.gnu.org/licenses/>" |
Functions | |
static void | cleanup_handle (struct RequestHandle *handle) |
Cleanup request handle. More... | |
static void | get_cont (struct GNUNET_REST_RequestHandle *con_handle, const char *url, void *cls) |
Handle rest request. More... | |
static void | options_cont (struct GNUNET_REST_RequestHandle *con_handle, const char *url, void *cls) |
Handle rest request. More... | |
enum GNUNET_GenericReturnValue | REST_copying_process_request (void *plugin, struct GNUNET_REST_RequestHandle *conndata_handle, GNUNET_REST_ResultProcessor proc, void *proc_cls) |
Function processing the REST call. More... | |
void * | REST_copying_init (const struct GNUNET_CONFIGURATION_Handle *c) |
Entry point for the plugin. More... | |
void | REST_copying_done (struct GNUNET_REST_Plugin *api) |
Exit point from the plugin. More... | |
Variables | |
static struct RequestHandle * | requests_head |
DLL. More... | |
static struct RequestHandle * | requests_tail |
DLL. More... | |
#define GNUNET_REST_API_NS_COPYING "/copying" |
Definition at line 32 of file copying_plugin.c.
#define GNUNET_REST_COPYING_TEXT "GNU Affero General Public License version 3 or later. See also: <http://www.gnu.org/licenses/>" |
Definition at line 34 of file copying_plugin.c.
|
static |
Cleanup request handle.
handle | Handle to clean up |
Definition at line 94 of file copying_plugin.c.
References GNUNET_CONTAINER_DLL_remove, GNUNET_ERROR_TYPE_DEBUG, GNUNET_free, GNUNET_log, handle, requests_head, and requests_tail.
Referenced by get_cont(), options_cont(), and REST_copying_done().
|
static |
Handle rest request.
handle | the lookup handle |
Definition at line 111 of file copying_plugin.c.
References cleanup_handle(), GNUNET_REST_COPYING_TEXT, GNUNET_REST_create_response(), handle, and MHD_HTTP_OK.
Referenced by REST_copying_process_request().
|
static |
Handle rest request.
handle | the lookup handle |
Definition at line 132 of file copying_plugin.c.
References cleanup_handle(), GNUNET_assert, GNUNET_REST_create_response(), handle, and MHD_HTTP_OK.
Referenced by REST_copying_process_request().
enum GNUNET_GenericReturnValue REST_copying_process_request | ( | void * | plugin, |
struct GNUNET_REST_RequestHandle * | conndata_handle, | ||
GNUNET_REST_ResultProcessor | proc, | ||
void * | proc_cls | ||
) |
Function processing the REST call.
method | HTTP method |
url | URL of the HTTP request |
data | body of the HTTP request (optional) |
data_size | length of the body |
proc | callback function for the result |
proc_cls | closure for proc |
Definition at line 162 of file copying_plugin.c.
References get_cont(), GNUNET_CONTAINER_DLL_insert, GNUNET_new, GNUNET_REST_API_NS_COPYING, GNUNET_REST_handle_request(), GNUNET_REST_HANDLER_END, handle, handlers, options_cont(), requests_head, and requests_tail.
Referenced by run().
void * REST_copying_init | ( | const struct GNUNET_CONFIGURATION_Handle * | c | ) |
Entry point for the plugin.
cls | the "struct GNUNET_NAMESTORE_PluginEnvironment*" |
Definition at line 195 of file copying_plugin.c.
References _, GNUNET_REST_Plugin::cls, GNUNET_ERROR_TYPE_INFO, GNUNET_log, GNUNET_new, GNUNET_REST_API_NS_COPYING, GNUNET_REST_Plugin::name, and plugin.
Referenced by run().
void REST_copying_done | ( | struct GNUNET_REST_Plugin * | api | ) |
Exit point from the plugin.
cls | the plugin context (as returned by "init") |
Definition at line 221 of file copying_plugin.c.
References Plugin::api, cleanup_handle(), GNUNET_BLOCK_PluginFunctions::cls, GNUNET_ERROR_TYPE_DEBUG, GNUNET_free, GNUNET_log, plugin, and requests_head.
Referenced by do_shutdown().
|
static |
DLL.
Definition at line 81 of file copying_plugin.c.
Referenced by cleanup_handle(), REST_copying_done(), and REST_copying_process_request().
|
static |
DLL.
Definition at line 86 of file copying_plugin.c.
Referenced by cleanup_handle(), and REST_copying_process_request().