- add service skeleton for regex connections
authorBart Polot <bart@net.in.tum.de>
Fri, 22 Jun 2012 14:20:37 +0000 (14:20 +0000)
committerBart Polot <bart@net.in.tum.de>
Fri, 22 Jun 2012 14:20:37 +0000 (14:20 +0000)
src/mesh/gnunet-service-mesh_new.c

index 86c572db9459b9eeb7bd7cbce9f479a505018de1..ccf26b59f24a1122f68c3ec2055dfd2fb6f662a9 100644 (file)
@@ -3988,6 +3988,26 @@ handle_local_new_client (void *cls, struct GNUNET_SERVER_Client *client,
 }
 
 
+/**
+ * Handler for clients announcing available services by a regular expression.
+ *
+ * @param cls closure
+ * @param client identification of the client
+ * @param message the actual message, which includes messages the client wants
+ */
+static void
+handle_local_announce_regex (void *cls, struct GNUNET_SERVER_Client *client,
+                             const struct GNUNET_MessageHeader *message)
+{
+  GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "announce regex started\n");
+
+  // FIXME complete
+
+  GNUNET_SERVER_receive_done (client, GNUNET_OK);
+  GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "announce regex processed\n");
+}
+
+
 /**
  * Handler for requests of new tunnels
  *
@@ -4495,6 +4515,26 @@ handle_local_connect_by_type (void *cls, struct GNUNET_SERVER_Client *client,
 }
 
 
+/**
+ * Handler for connection requests to new peers by a string service description.
+ *
+ * @param cls closure
+ * @param client identification of the client
+ * @param message the actual message, which includes messages the client wants
+ */
+static void
+handle_local_connect_by_string (void *cls, struct GNUNET_SERVER_Client *client,
+                                const struct GNUNET_MessageHeader *message)
+{
+  GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "connect by string started\n");
+
+  // FIXME complete
+
+  GNUNET_SERVER_receive_done (client, GNUNET_OK);
+  GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "connect by string processed\n");
+}
+
+
 /**
  * Handler for client traffic directed to one peer
  *
@@ -4747,6 +4787,8 @@ handle_local_multicast (void *cls, struct GNUNET_SERVER_Client *client,
 static struct GNUNET_SERVER_MessageHandler client_handlers[] = {
   {&handle_local_new_client, NULL,
    GNUNET_MESSAGE_TYPE_MESH_LOCAL_CONNECT, 0},
+  {&handle_local_announce_regex, NULL,
+   GNUNET_MESSAGE_TYPE_MESH_LOCAL_ANNOUNCE_REGEX, 0},
   {&handle_local_tunnel_create, NULL,
    GNUNET_MESSAGE_TYPE_MESH_LOCAL_TUNNEL_CREATE,
    sizeof (struct GNUNET_MESH_TunnelMessage)},
@@ -4768,6 +4810,8 @@ static struct GNUNET_SERVER_MessageHandler client_handlers[] = {
   {&handle_local_connect_by_type, NULL,
    GNUNET_MESSAGE_TYPE_MESH_LOCAL_PEER_ADD_BY_TYPE,
    sizeof (struct GNUNET_MESH_ConnectPeerByType)},
+  {&handle_local_connect_by_string, NULL,
+   GNUNET_MESSAGE_TYPE_MESH_LOCAL_PEER_ADD_BY_STRING, 0},
   {&handle_local_unicast, NULL,
    GNUNET_MESSAGE_TYPE_MESH_UNICAST, 0},
   {&handle_local_to_origin, NULL,