26#ifndef REGEX_INTERNAL_LIB_H
27#define REGEX_INTERNAL_LIB_H
28#include "../../plugin/regex/regex_block_lib.h"
69 unsigned int max_path_len);
126 unsigned int num_edges,
187 uint16_t compression,
225 unsigned int get_path_length,
227 unsigned int put_path_length);
static struct GNUNET_ARM_Handle * h
Connection with ARM.
static struct GNUNET_DHT_Handle * dht
Handle to the DHT.
struct GNUNET_HashCode key
The key used in the DHT.
static struct GNUNET_IDENTITY_Handle * id
Handle to IDENTITY.
static struct GNUNET_STATISTICS_Handle * stats
Handle to the statistics service.
API to create, modify and access statistics.
void REGEX_INTERNAL_search_cancel(struct REGEX_INTERNAL_Search *h)
Stop search and free all data used by a REGEX_INTERNAL_search() call.
void REGEX_INTERNAL_iterate_all_edges(struct REGEX_INTERNAL_Automaton *a, REGEX_INTERNAL_KeyIterator iterator, void *iterator_cls)
Iterate over all edges starting from start state of automaton 'a'.
size_t REGEX_INTERNAL_get_first_key(const char *input_string, size_t string_len, struct GNUNET_HashCode *key)
Get the first key for the given input_string.
struct REGEX_INTERNAL_Automaton * REGEX_INTERNAL_construct_dfa(const char *regex, const size_t len, unsigned int max_path_len)
Construct DFA for the given 'regex' of length 'len'.
void(* REGEX_INTERNAL_Found)(void *cls, const struct GNUNET_PeerIdentity *id, const struct GNUNET_DHT_PathElement *get_path, unsigned int get_path_length, const struct GNUNET_DHT_PathElement *put_path, unsigned int put_path_length)
Search callback function.
int REGEX_INTERNAL_eval(struct REGEX_INTERNAL_Automaton *a, const char *string)
Evaluates the given 'string' against the given compiled regex.
void REGEX_INTERNAL_iterate_reachable_edges(struct REGEX_INTERNAL_Automaton *a, REGEX_INTERNAL_KeyIterator iterator, void *iterator_cls)
Iterate over all edges of automaton 'a' that are reachable from a state with a proof of at least GNUN...
void(* REGEX_INTERNAL_KeyIterator)(void *cls, const struct GNUNET_HashCode *key, const char *proof, int accepting, unsigned int num_edges, const struct REGEX_BLOCK_Edge *edges)
Iterator callback function.
struct REGEX_INTERNAL_Search * REGEX_INTERNAL_search(struct GNUNET_DHT_Handle *dht, const char *string, REGEX_INTERNAL_Found callback, void *callback_cls, struct GNUNET_STATISTICS_Handle *stats)
Search for a peer offering a regex matching certain string in the DHT.
void REGEX_INTERNAL_announce_cancel(struct REGEX_INTERNAL_Announcement *h)
Clear all cached data used by a regex announce.
void REGEX_INTERNAL_reannounce(struct REGEX_INTERNAL_Announcement *h)
Announce again a regular expression previously announced.
struct REGEX_INTERNAL_Announcement * REGEX_INTERNAL_announce(struct GNUNET_DHT_Handle *dht, const struct GNUNET_CRYPTO_EddsaPrivateKey *priv, const char *regex, uint16_t compression, struct GNUNET_STATISTICS_Handle *stats)
Announce a regular expression: put all states of the automaton in the DHT.
void REGEX_INTERNAL_automaton_destroy(struct REGEX_INTERNAL_Automaton *a)
Free the memory allocated by constructing the REGEX_INTERNAL_Automaton.
Private ECC key encoded for transmission.
Connection to the DHT service.
A (signed) path tracking a block's flow through the DHT is represented by an array of path elements,...
The identity of the host (wraps the signing key of the peer).
Handle to store cached data about a regex announce.
const struct GNUNET_CRYPTO_EddsaPrivateKey * priv
Our private key.
const char * regex
Regular expression.
Automaton representation.
Struct to keep information of searches of services described by a regex using a user-provided string ...
REGEX_INTERNAL_Found callback