Advertise capabilities via RegEx and discover respective peers using matching strings. More...
Macros | |
#define | GNUNET_REGEX_INITIAL_BYTES 24 |
Constant for how many bytes the initial string regex should have. More... | |
Typedefs | |
typedef void(* | GNUNET_REGEX_Found) (void *cls, const struct GNUNET_PeerIdentity *id, const struct GNUNET_PeerIdentity *get_path, unsigned int get_path_length, const struct GNUNET_PeerIdentity *put_path, unsigned int put_path_length) |
Search callback function, invoked for every result that was found. More... | |
Functions | |
struct GNUNET_REGEX_Announcement * | GNUNET_REGEX_announce (const struct GNUNET_CONFIGURATION_Handle *cfg, const char *regex, struct GNUNET_TIME_Relative refresh_delay, uint16_t compression) |
Announce this peer under the given regular expression. More... | |
void | GNUNET_REGEX_announce_cancel (struct GNUNET_REGEX_Announcement *a) |
Stop announcing the regex specified by the given handle. 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... | |
Advertise capabilities via RegEx and discover respective peers using matching strings.
#define GNUNET_REGEX_INITIAL_BYTES 24 |
Constant for how many bytes the initial string regex should have.
Definition at line 57 of file gnunet_regex_service.h.
typedef void(* GNUNET_REGEX_Found) (void *cls, const struct GNUNET_PeerIdentity *id, const struct GNUNET_PeerIdentity *get_path, unsigned int get_path_length, const struct GNUNET_PeerIdentity *put_path, unsigned int put_path_length) |
Search callback function, invoked for every result that was found.
cls | Closure provided in GNUNET_REGEX_search. |
id | Peer providing a regex that matches the string. |
get_path | Path of the get request. |
get_path_length | Length of get_path. |
put_path | Path of the put request. |
put_path_length | Length of the put_path. |
Definition at line 109 of file gnunet_regex_service.h.
struct GNUNET_REGEX_Announcement* GNUNET_REGEX_announce | ( | const struct GNUNET_CONFIGURATION_Handle * | cfg, |
const char * | regex, | ||
struct GNUNET_TIME_Relative | refresh_delay, | ||
uint16_t | compression | ||
) |
Announce this peer under the given regular expression.
Does not free resources, must call GNUNET_REGEX_announce_cancel for that.
cfg | configuration to use |
regex | Regular expression to announce. |
refresh_delay | after what delay should the announcement be repeated? |
compression | How many characters per edge can we squeeze? |
Announce this peer under the given regular expression.
cfg | configuration to use |
regex | Regular expression to announce. |
refresh_delay | after what delay should the announcement be repeated? |
compression | How many characters per edge can we squeeze? |
Definition at line 139 of file regex_api_announce.c.
References _, announce_reconnect(), cfg, GNUNET_REGEX_Announcement::cfg, GNUNET_REGEX_Announcement::compression, GNUNET_break, GNUNET_ERROR_TYPE_WARNING, GNUNET_free, GNUNET_log, GNUNET_MAX_MESSAGE_SIZE, GNUNET_new, GNUNET_strdup, GNUNET_REGEX_Announcement::mq, GNUNET_REGEX_Announcement::refresh_delay, and GNUNET_REGEX_Announcement::regex.
Referenced by run().
void GNUNET_REGEX_announce_cancel | ( | struct GNUNET_REGEX_Announcement * | a | ) |
Stop announcing the regex specified by the given handle.
a | handle returned by a previous GNUNET_REGEX_announce call. |
Definition at line 173 of file regex_api_announce.c.
References GNUNET_free, GNUNET_MQ_destroy(), GNUNET_REGEX_Announcement::mq, and GNUNET_REGEX_Announcement::regex.
Referenced by cleanup().
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.
The search runs until GNUNET_REGEX_search_cancel is called, even if results are returned.
cfg | configuration to use |
string | String to match against the regexes in the DHT. |
callback | Callback for found peers. |
callback_cls | Closure for callback . |
Definition at line 189 of file regex_api_search.c.
References _, GNUNET_REGEX_Search::callback, GNUNET_REGEX_Search::callback_cls, cfg, GNUNET_REGEX_Search::cfg, GNUNET_break, GNUNET_ERROR_TYPE_DEBUG, GNUNET_ERROR_TYPE_WARNING, GNUNET_free, GNUNET_log, GNUNET_MAX_MESSAGE_SIZE, GNUNET_new, GNUNET_strdup, LOG, GNUNET_REGEX_Search::mq, search_reconnect(), and GNUNET_REGEX_Search::string.
Referenced by create_channel_to_destination().
void GNUNET_REGEX_search_cancel | ( | struct GNUNET_REGEX_Search * | s | ) |
Stop search and free all data used by a GNUNET_REGEX_search call.
s | Handle returned by a previous GNUNET_REGEX_search call. |
Definition at line 225 of file regex_api_search.c.
References GNUNET_free, GNUNET_MQ_destroy(), GNUNET_REGEX_Search::mq, and GNUNET_REGEX_Search::string.
Referenced by free_channel_state(), and handle_regex_result().