access regex service to discover peers using matching strings More...
#include "platform.h"
#include "gnunet_protocols.h"
#include "gnunet_util_lib.h"
#include "gnunet_regex_service.h"
#include "regex_ipc.h"
Go to the source code of this file.
Data Structures | |
struct | GNUNET_REGEX_Search |
Handle to store data about a regex search. More... | |
Macros | |
#define | LOG(kind, ...) GNUNET_log_from (kind, "regex-api", __VA_ARGS__) |
Functions | |
static void | search_reconnect (struct GNUNET_REGEX_Search *s) |
(Re)connect to the REGEX service for the given search s. More... | |
static int | check_search_response (void *cls, const struct ResultMessage *result) |
We got a response or disconnect after asking regex to do the search. More... | |
static void | handle_search_response (void *cls, const struct ResultMessage *result) |
We got a response or disconnect after asking regex to do the search. More... | |
static void | mq_error_handler (void *cls, enum GNUNET_MQ_Error error) |
We got a disconnect after asking regex to do the announcement. More... | |
struct GNUNET_REGEX_Search * | GNUNET_REGEX_search (const struct GNUNET_CONFIGURATION_Handle *cfg, const char *string, GNUNET_REGEX_Found callback, void *callback_cls) |
Search for a peer offering a regex matching certain string in the DHT. More... | |
void | GNUNET_REGEX_search_cancel (struct GNUNET_REGEX_Search *s) |
Stop search and free all data used by a GNUNET_REGEX_search call. More... | |
access regex service to discover peers using matching strings
Definition in file regex_api_search.c.
#define LOG | ( | kind, | |
... | |||
) | GNUNET_log_from (kind, "regex-api", __VA_ARGS__) |
Definition at line 33 of file regex_api_search.c.
|
static |
(Re)connect to the REGEX service for the given search s.
s | context for the search search for |
Definition at line 156 of file regex_api_search.c.
References GNUNET_REGEX_Search::cfg, env, GNUNET_assert, GNUNET_CLIENT_connect(), GNUNET_memcpy, GNUNET_MESSAGE_TYPE_REGEX_RESULT, GNUNET_MESSAGE_TYPE_REGEX_SEARCH, GNUNET_MQ_handler_end, GNUNET_MQ_hd_var_size, GNUNET_MQ_msg_extra, GNUNET_MQ_send(), handlers, GNUNET_REGEX_Search::mq, mq_error_handler(), and GNUNET_REGEX_Search::string.
Referenced by GNUNET_REGEX_search(), and mq_error_handler().
|
static |
We got a response or disconnect after asking regex to do the search.
Check it is well-formed.
cls | the struct GNUNET_REGEX_Search to handle reply for |
result | the message |
Definition at line 86 of file regex_api_search.c.
References GNUNET_break, GNUNET_OK, GNUNET_SYSERR, result, and size.
|
static |
We got a response or disconnect after asking regex to do the search.
Handle it.
cls | the struct GNUNET_REGEX_Search to handle reply for |
result | the message |
Definition at line 110 of file regex_api_search.c.
References GNUNET_REGEX_Search::callback, GNUNET_REGEX_Search::callback_cls, GNUNET_ERROR_TYPE_DEBUG, GNUNET_i2s(), LOG, pid, and result.
|
static |
We got a disconnect after asking regex to do the announcement.
Retry.
cls | the struct GNUNET_REGEX_Search to retry |
error | error code |
Definition at line 139 of file regex_api_search.c.
References GNUNET_MQ_destroy(), GNUNET_REGEX_Search::mq, and search_reconnect().
Referenced by search_reconnect().