26 #ifndef REGEX_INTERNAL_LIB_H 27 #define REGEX_INTERNAL_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 int iterator(void *cls, const struct GNUNET_PeerIdentity *key, void *value)
Iterator over hash map entries.
void REGEX_INTERNAL_automaton_destroy(struct REGEX_INTERNAL_Automaton *a)
Free the memory allocated by constructing the REGEX_INTERNAL_Automaton.
static struct GNUNET_IDENTITY_Handle * id
Handle to identity service.
Automaton representation.
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'.
static struct GNUNET_ARM_Handle * h
Connection with ARM.
Connection to the DHT service.
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'.
int REGEX_INTERNAL_eval(struct REGEX_INTERNAL_Automaton *a, const char *string)
Evaluates the given 'string' against the given compiled regex.
struct GNUNET_STATISTICS_Handle * stats
Handle to the statistics service.
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.
Handle to store cached data about a regex announce.
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_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_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.
struct GNUNET_HashCode key
The key used in the DHT.
Struct to keep information of searches of services described by a regex using a user-provided string ...
Private ECC key encoded for transmission.
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.
The identity of the host (wraps the signing key of the peer).
common function to manipulate blocks stored by regex in the DHT
REGEX_INTERNAL_Found callback
const char * regex
Regular expression.
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.
const struct GNUNET_CRYPTO_EddsaPrivateKey * priv
Our private key.
static struct GNUNET_DHT_Handle * dht
Handle to the DHT.
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_reannounce(struct REGEX_INTERNAL_Announcement *h)
Announce again a regular expression previously announced.
void REGEX_INTERNAL_announce_cancel(struct REGEX_INTERNAL_Announcement *h)
Clear all cached data used by a regex announce.
uint16_t len
length of data (which is always a uint32_t, but presumably this can be used to specify that fewer byt...