aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBart Polot <bart@net.in.tum.de>2012-10-26 14:05:59 +0000
committerBart Polot <bart@net.in.tum.de>2012-10-26 14:05:59 +0000
commit993a74c191842519ad6c82216fb7a0ee2bb09456 (patch)
tree459069823378d5127b5c7acafadc11620ae16a0c
parent82bc20a8bcbfb269da4dd54476382c924497e7ec (diff)
downloadgnunet-993a74c191842519ad6c82216fb7a0ee2bb09456.tar.gz
gnunet-993a74c191842519ad6c82216fb7a0ee2bb09456.zip
- add compression length to mesh api announce_regex
-rw-r--r--src/include/gnunet_mesh_service.h20
-rw-r--r--src/mesh/mesh_api.c13
2 files changed, 24 insertions, 9 deletions
diff --git a/src/include/gnunet_mesh_service.h b/src/include/gnunet_mesh_service.h
index 568a05448..b9f0e49c6 100644
--- a/src/include/gnunet_mesh_service.h
+++ b/src/include/gnunet_mesh_service.h
@@ -227,16 +227,24 @@ typedef void (*GNUNET_MESH_PeerConnectHandler) (void *cls,
227 * Announce to ther peer the availability of services described by the regex, 227 * Announce to ther peer the availability of services described by the regex,
228 * in order to be reachable to other peers via connect_by_string. 228 * in order to be reachable to other peers via connect_by_string.
229 * 229 *
230 * Note that the first 8 characters are considered to be part of a prefix, 230 * Note that the first GNUNET_REGEX_INITIAL_BYTES characters are considered
231 * (for instance 'gnunet://'). If you put a variable part in there (*, +. ()), 231 * to be part of a prefix, (for instance 'gnunet://').
232 * all matching strings will be stored in the DHT. 232 * If you put a variable part in there (*, +. ()), all matching strings
233 * will be stored in the DHT.
233 * 234 *
234 * @param h handle to mesh. 235 * @param h Handle to mesh.
235 * @param regex string with the regular expression describing local services. 236 * @param regex String with the regular expression describing local services.
237 * @param compression_characters How many characters can be assigned to one
238 * edge of the graph. The bigger the variability
239 * of the data, the smaller this parameter should
240 * be (down to 1).
241 * For maximum compression, use strlen (regex)
242 * or 0 (special value). Use with care!
236 */ 243 */
237void 244void
238GNUNET_MESH_announce_regex (struct GNUNET_MESH_Handle *h, 245GNUNET_MESH_announce_regex (struct GNUNET_MESH_Handle *h,
239 const char *regex); 246 const char *regex,
247 unsigned int compression_characters);
240 248
241 249
242/** 250/**
diff --git a/src/mesh/mesh_api.c b/src/mesh/mesh_api.c
index 9a644d83f..9c20b4268 100644
--- a/src/mesh/mesh_api.c
+++ b/src/mesh/mesh_api.c
@@ -1666,12 +1666,19 @@ GNUNET_MESH_disconnect (struct GNUNET_MESH_Handle *handle)
1666 * (for instance 'gnunet://'). If you put a variable part in there (*, +. ()), 1666 * (for instance 'gnunet://'). If you put a variable part in there (*, +. ()),
1667 * all matching strings will be stored in the DHT. 1667 * all matching strings will be stored in the DHT.
1668 * 1668 *
1669 * @param h handle to mesh. 1669 * @param h Handle to mesh.
1670 * @param regex string with the regular expression describing local services. 1670 * @param regex String with the regular expression describing local services.
1671 * @param compression_characters How many characters can be assigned to one
1672 * edge of the graph. The bigger the variability
1673 * of the data, the smaller this parameter should
1674 * be (down to 1).
1675 * For maximum compression, use strlen (regex)
1676 * or 0 (special value). Use with care!
1671 */ 1677 */
1672void 1678void
1673GNUNET_MESH_announce_regex (struct GNUNET_MESH_Handle *h, 1679GNUNET_MESH_announce_regex (struct GNUNET_MESH_Handle *h,
1674 const char *regex) 1680 const char *regex,
1681 unsigned int compression_characters)
1675{ 1682{
1676 struct GNUNET_MessageHeader *msg; 1683 struct GNUNET_MessageHeader *msg;
1677 size_t len; 1684 size_t len;