Prepared for new API client implementation
authorBart Polot <bart@net.in.tum.de>
Thu, 5 May 2011 19:03:44 +0000 (19:03 +0000)
committerBart Polot <bart@net.in.tum.de>
Thu, 5 May 2011 19:03:44 +0000 (19:03 +0000)
src/mesh/mesh_api_new.c

index 2c292f7f1cd8b64d91df68e74a16b387397ce342..5cb50b0d11b04b40ac808b693a16d6b624c2d43e 100644 (file)
@@ -41,9 +41,11 @@ extern "C"
  * Opaque handle to the service.
  */
 struct GNUNET_MESH_Handle {
+    GNUNET_CLIENT_Connection            *mesh;
     struct GNUNET_MESH_Tunnel           *head;
     struct GNUNET_MESH_Tunnel           *tail;
     GNUNET_MESH_TunnelEndHandler        cleaner;
+    void                                *cls;
 };
 
 /**
@@ -79,10 +81,22 @@ GNUNET_MESH_connect (const struct GNUNET_CONFIGURATION_Handle *cfg,
                      GNUNET_MESH_TunnelEndHandler cleaner,
                      const struct GNUNET_MESH_MessageHandler *handlers, 
                      const GNUNET_MESH_ApplicationType *stypes) {
-    GNUNET_MESH_Handle *h;
+    GNUNET_MESH_Handle                  *h;
+    struct GNUNET_MESH_MessageHandler   *aux;
+    int                                 i;
+    uint16_t                            *types;
+
     h = GNUNET_malloc(sizeof(GNUNET_MESH_Handle));
 
     h->cleaner = cleaner;
+    h->mesh = GNUNET_CLIENT_connect("mesh", cfg);
+    h->cls = cls;
+
+    aux = handlers;
+    for(i = 0; handlers[i].type; i++) {
+        
+    }
+    
     return h;
 }