From: Bart Polot Date: Thu, 14 Jun 2012 16:50:52 +0000 (+0000) Subject: - add api side implementation of blacklisting X-Git-Tag: initial-import-from-subversion-38251~13057 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=78471039156f66f6b2a9f09e44e691c1207d2636;p=oweals%2Fgnunet.git - add api side implementation of blacklisting --- diff --git a/src/mesh/mesh_api.c b/src/mesh/mesh_api.c index a2b1d67da..086b5fa71 100644 --- a/src/mesh/mesh_api.c +++ b/src/mesh/mesh_api.c @@ -1381,6 +1381,20 @@ GNUNET_MESH_disconnect (struct GNUNET_MESH_Handle *handle) } +/** + * Announce to ther peer the availability of services described by the regex, + * in order to be reachable to other peers via connect_by_string. + * + * @param h handle to mesh. + * @param regex string with the regular expression describing local services. + */ +void +GNUNET_MESH_announce_regex (struct GNUNET_MESH_Handle *h, + const char *regex) +{ + +} + /** * Create a new tunnel (we're initiator and will be allowed to add/remove peers * and to broadcast). @@ -1575,7 +1589,10 @@ GNUNET_MESH_peer_request_connect_by_type (struct GNUNET_MESH_Tunnel *tunnel, */ void GNUNET_MESH_peer_request_connect_by_string (struct GNUNET_MESH_Tunnel *tunnel, - const char *description); + const char *description) +{ + +} /** @@ -1588,7 +1605,18 @@ GNUNET_MESH_peer_request_connect_by_string (struct GNUNET_MESH_Tunnel *tunnel, */ void GNUNET_MESH_peer_blacklist (struct GNUNET_MESH_Tunnel *tunnel, - const struct GNUNET_PeerIdentity *peer); + const struct GNUNET_PeerIdentity *peer) +{ + struct GNUNET_MESH_PeerControl msg; + + msg.header.size = htons (sizeof (struct GNUNET_MESH_PeerControl)); + msg.header.type = htons (GNUNET_MESSAGE_TYPE_MESH_LOCAL_PEER_BLACKLIST); + msg.tunnel_id = htonl (tunnel->tid); + msg.peer = *peer; + send_packet (tunnel->mesh, &msg.header, tunnel); + + return; +} /** @@ -1602,7 +1630,18 @@ GNUNET_MESH_peer_blacklist (struct GNUNET_MESH_Tunnel *tunnel, */ void GNUNET_MESH_peer_unblacklist (struct GNUNET_MESH_Tunnel *tunnel, - const struct GNUNET_PeerIdentity *peer); + const struct GNUNET_PeerIdentity *peer) +{ + struct GNUNET_MESH_PeerControl msg; + + msg.header.size = htons (sizeof (struct GNUNET_MESH_PeerControl)); + msg.header.type = htons (GNUNET_MESSAGE_TYPE_MESH_LOCAL_PEER_UNBLACKLIST); + msg.tunnel_id = htonl (tunnel->tid); + msg.peer = *peer; + send_packet (tunnel->mesh, &msg.header, tunnel); + + return; +} /**