GNUnet  0.10.x
gnunet_regex_service.h
Go to the documentation of this file.
1 /*
2  This file is part of GNUnet
3  Copyright (C) 2012, 2013 GNUnet e.V.
4 
5  GNUnet is free software: you can redistribute it and/or modify it
6  under the terms of the GNU Affero General Public License as published
7  by the Free Software Foundation, either version 3 of the License,
8  or (at your option) any later version.
9 
10  GNUnet is distributed in the hope that it will be useful, but
11  WITHOUT ANY WARRANTY; without even the implied warranty of
12  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13  Affero General Public License for more details.
14 
15  You should have received a copy of the GNU Affero General Public License
16  along with this program. If not, see <http://www.gnu.org/licenses/>.
17 
18  SPDX-License-Identifier: AGPL3.0-or-later
19  */
36 #ifndef GNUNET_REGEX_SERVICE_H
37 #define GNUNET_REGEX_SERVICE_H
38 
39 #include "gnunet_util_lib.h"
40 
41 #ifdef __cplusplus
42 extern "C"
43 {
44 #if 0 /* keep Emacsens' auto-indent happy */
45 }
46 #endif
47 #endif
48 
49 
53 #define GNUNET_REGEX_INITIAL_BYTES 24
54 
55 
60 
64 struct GNUNET_REGEX_Search;
65 
66 
81  const char *regex,
83  uint16_t compression);
84 
85 
91 void
93 
94 
105 typedef void
106 (*GNUNET_REGEX_Found)(void *cls,
107  const struct GNUNET_PeerIdentity *id,
108  const struct GNUNET_PeerIdentity *get_path,
109  unsigned int get_path_length,
110  const struct GNUNET_PeerIdentity *put_path,
111  unsigned int put_path_length);
112 
113 
126 struct GNUNET_REGEX_Search *
128  const char *string,
130  void *callback_cls);
131 
132 
138 void
140 
141 
142 #if 0 /* keep Emacsens' auto-indent happy */
143 {
144 #endif
145 #ifdef __cplusplus
146 }
147 #endif
148 
149 #endif
150  /* end of group */
void GNUNET_REGEX_announce_cancel(struct GNUNET_REGEX_Announcement *a)
Stop announcing the regex specified by the given handle.
Handle to store cached data about a regex announce.
static struct GNUNET_IDENTITY_Handle * id
Handle to identity service.
uint16_t compression
Number of characters per edge.
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.
GNUNET_REGEX_Found callback
Function to call with results.
void * callback_cls
Closure for callback.
void GNUNET_REGEX_search_cancel(struct GNUNET_REGEX_Search *s)
Stop search and free all data used by a GNUNET_REGEX_search call.
static struct GNUNET_CONFIGURATION_Handle * cfg
Our configuration.
Definition: gnunet-arm.c:104
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.
char * regex
Message we&#39;re sending to the service.
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.
The identity of the host (wraps the signing key of the peer).
configuration data
Definition: configuration.c:83
Handle to store data about a regex search.
Time for relative time used by GNUnet, in microseconds.
struct GNUNET_TIME_Relative refresh_delay
Frequency of announcements.