gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUnet-SVN] r14880 - gnunet/src/mesh


From: gnunet
Subject: [GNUnet-SVN] r14880 - gnunet/src/mesh
Date: Tue, 5 Apr 2011 20:08:47 +0200

Author: bartpolot
Date: 2011-04-05 20:08:47 +0200 (Tue, 05 Apr 2011)
New Revision: 14880

Modified:
   gnunet/src/mesh/Makefile.am
   gnunet/src/mesh/gnunet-service-mesh.c
   gnunet/src/mesh/mesh.h
Log:
Make mesh service compile


Modified: gnunet/src/mesh/Makefile.am
===================================================================
--- gnunet/src/mesh/Makefile.am 2011-04-05 17:36:06 UTC (rev 14879)
+++ gnunet/src/mesh/Makefile.am 2011-04-05 18:08:47 UTC (rev 14880)
@@ -9,6 +9,8 @@
   XLIB = -lgcov
 endif
 
+bin_PROGRAMS = $(STUD_PROGS) \
+ gnunet-service-mesh
 
 lib_LTLIBRARIES = \
   libgnunetmesh.la
@@ -22,3 +24,11 @@
 libgnunetmesh_la_LDFLAGS = \
   $(GN_LIB_LDFLAGS) $(WINFLAGS) \
   -version-info 0:0:0
+
+gnunet_service_mesh_SOURCES = \
+ gnunet-service-mesh.c         
+
+gnunet_service_mesh_LDADD = \
+  $(top_builddir)/src/core/libgnunetcore.la
+#  $(top_builddir)/src/transport/libgnunettransport.la \
+#  $(top_builddir)/src/util/libgnunetutil.la

Modified: gnunet/src/mesh/gnunet-service-mesh.c
===================================================================
--- gnunet/src/mesh/gnunet-service-mesh.c       2011-04-05 17:36:06 UTC (rev 
14879)
+++ gnunet/src/mesh/gnunet-service-mesh.c       2011-04-05 18:08:47 UTC (rev 
14880)
@@ -31,11 +31,12 @@
  * - speed requirement specification (change?) in mesh API -- API call
  */
 
-#include <stdint.h>
+#include "platform.h"
 #include "gnunet_common.h"
 #include "gnunet_util_lib.h"
 #include "gnunet_core_service.h"
-#include <netinet/in.h>
+#include "gnunet_protocols.h"
+#include "mesh.h"
 
 
 
/******************************************************************************/
@@ -244,7 +245,7 @@
     /**
      * Is the peer reachable? Is the peer even connected?
      */
-    struct PeerState state;
+    enum PeerState state;
 
     /**
      * Who to send the data to
@@ -275,7 +276,7 @@
     /**
      * List of all the peers that form the path from origin to target
      */
-    PeerInfo *peers;
+    struct PeerInfo *peers;
 };
 
 /**
@@ -356,36 +357,12 @@
     int fixme;
 };
 
-/**
- * Handler for requests of creating new path
- * type: struct GNUNET_CORE_MessageHandler
- *
- * @param cls closure
- * @param client the client this message is from
- * @param message the message received
- */
-static void
-handle_mesh_path_create (void *cls,
-                         struct GNUNET_SERVER_Client *client,
-                         const struct GNUNET_MessageHeader *message)
-{
-    return;
-}
 
-/**
- * Handler for client disconnection
- *
- * @param cls closure
- * @param client identification of the client; NULL
- *        for the last call when the server is destroyed
- */
-static void
-handle_client_disconnect (void *cls, struct GNUNET_SERVER_Client *client)
-{
-    /* Remove client from list, delete all timers and queues associated */
-    return;
-}
 
+/******************************************************************************/
+/********************      MESH NETWORK HANDLERS     
**************************/
+/******************************************************************************/
+
 /**
  * Core handler for path creation
  * struct GNUNET_CORE_MessageHandler
@@ -394,6 +371,8 @@
  * @param message message
  * @param peer peer identity this notification is about
  * @param atsi performance data
+ * @return GNUNET_OK to keep the connection open,
+ *         GNUNET_SYSERR to close it (signal serious error)
  *
  */
 static int
@@ -418,7 +397,8 @@
  * @param message message
  * @param peer peer identity this notification is about
  * @param atsi performance data
- *
+ * @return GNUNET_OK to keep the connection open,
+ *         GNUNET_SYSERR to close it (signal serious error)
  */
 static int
 handle_mesh_network_traffic (void *cls,
@@ -440,13 +420,78 @@
  * Functions to handle messages from core
  */
 static struct GNUNET_CORE_MessageHandler core_handlers[] = {
-  {&handle_mesh_path_create, NULL, GNUNET_MESSAGE_TYPE_MESH_PATH_CREATE, 0},
+  {&handle_mesh_path_create, GNUNET_MESSAGE_TYPE_MESH_PATH_CREATE, 0},
   {&handle_mesh_network_traffic, GNUNET_MESSAGE_TYPE_MESH_DATA_GO, 0},
   {&handle_mesh_network_traffic, GNUNET_MESSAGE_TYPE_MESH_DATA_BACK, 0},
   {NULL, 0, 0}
 };
 
+
+
+/******************************************************************************/
+/*********************       MESH LOCAL HANDLES      
**************************/
+/******************************************************************************/
+
 /**
+ * Handler for client disconnection
+ *
+ * @param cls closure
+ * @param client identification of the client; NULL
+ *        for the last call when the server is destroyed
+ */
+static void
+handle_client_disconnect (void *cls, struct GNUNET_SERVER_Client *client)
+{
+    /* Remove client from list, delete all timers and queues associated */
+    return;
+}
+
+/**
+ * Handler for new clients
+ * 
+ * @param cls closure
+ * @param client identification of the client
+ * @param message the actual message, which includes messages the client wants
+ */
+static void
+handle_local_new_client (void *cls,
+                         struct GNUNET_SERVER_Client *client,
+                         const struct GNUNET_MessageHeader *message)
+{
+    return;
+}
+
+/**
+ * Handler for connection requests
+ * 
+ * @param cls closure
+ * @param client identification of the client
+ * @param message the actual message
+ */
+static void
+handle_local_connect (void *cls,
+                         struct GNUNET_SERVER_Client *client,
+                         const struct GNUNET_MessageHeader *message)
+{
+    return;
+}
+
+/**
+ * Handler for client traffic
+ * 
+ * @param cls closure
+ * @param client identification of the client
+ * @param message the actual message
+ */
+static void
+handle_local_network_traffic (void *cls,
+                         struct GNUNET_SERVER_Client *client,
+                         const struct GNUNET_MessageHeader *message)
+{
+    return;
+}
+
+/**
  * Functions to handle messages from clients
  */
 /* MESSAGES DEFINED:
@@ -464,16 +509,16 @@
 #define GNUNET_MESSAGE_TYPE_MESH_LOCAL_DATA_BROADCAST       283
  */
 static struct GNUNET_SERVER_MessageHandler plugin_handlers[] = {
-  {&handle_local_new_client, NULL, GNUNET_MESSAGE_TYPE_LOCAL_CONNECT, 0},
+  {&handle_local_new_client, NULL, GNUNET_MESSAGE_TYPE_MESH_LOCAL_CONNECT, 0},
   {&handle_local_connect, NULL, 
GNUNET_MESSAGE_TYPE_MESH_LOCAL_CONNECT_PEER_ANY, 0},
   {&handle_local_connect, NULL, 
GNUNET_MESSAGE_TYPE_MESH_LOCAL_CONNECT_PEER_ALL, 0},
   {&handle_local_connect, NULL, 
GNUNET_MESSAGE_TYPE_MESH_LOCAL_CONNECT_PEER_ADD, 0},
   {&handle_local_connect, NULL, 
GNUNET_MESSAGE_TYPE_MESH_LOCAL_CONNECT_PEER_DEL, 0},
   {&handle_local_connect, NULL, 
GNUNET_MESSAGE_TYPE_MESH_LOCAL_CONNECT_PEER_BY_TYPE, sizeof(struct 
GNUNET_MESH_ConnectPeerByType)},
   {&handle_local_connect, NULL, 
GNUNET_MESSAGE_TYPE_MESH_LOCAL_CONNECT_PEER_CANCEL, sizeof(struct 
GNUNET_MESH_Control)},
-  {&handle_local_network_traffic, NULL, 
GNUNET_MESSAGE_TYPE_LOCAL_TRANSMIT_READY, sizeof(struct GNUNET_MESH_Control)},
-  {&handle_local_network_traffic, NULL, GNUNET_MESSAGE_TYPE_LOCAL_DATA, 0}, /* 
FIXME needed? */
-  {&handle_local_network_traffic, NULL, 
GNUNET_MESSAGE_TYPE_LOCAL_DATA_BROADCAST, 0}, /* FIXME needed? */
+  {&handle_local_network_traffic, NULL, 
GNUNET_MESSAGE_TYPE_MESH_LOCAL_TRANSMIT_READY, sizeof(struct 
GNUNET_MESH_Control)},
+  {&handle_local_network_traffic, NULL, GNUNET_MESSAGE_TYPE_MESH_LOCAL_DATA, 
0}, /* FIXME needed? */
+  {&handle_local_network_traffic, NULL, 
GNUNET_MESSAGE_TYPE_MESH_LOCAL_DATA_BROADCAST, 0}, /* FIXME needed? */
   {NULL, NULL, 0, 0}
 };
 
@@ -525,7 +570,7 @@
 }
 
 /**
- * Process mesh requests. FIXME NON FUNCTIONAL, COPIED FROM DHT!!
+ * Process mesh requests. FIXME NON FUNCTIONAL, SKELETON
  *
  * @param cls closure
  * @param server the initialized server
@@ -536,10 +581,7 @@
      struct GNUNET_SERVER_Handle *server,
      const struct GNUNET_CONFIGURATION_Handle *c)
 {
-  struct GNUNET_TIME_Relative next_send_time;
-  unsigned long long temp_config_num;
-  char *converge_modifier_buf;
-  GNUNET_CORE_Handle *core;
+  struct GNUNET_CORE_Handle *core;
 
   GNUNET_SERVER_add_handlers (server, plugin_handlers);
   GNUNET_SERVER_disconnect_notify (server, &handle_client_disconnect, NULL);

Modified: gnunet/src/mesh/mesh.h
===================================================================
--- gnunet/src/mesh/mesh.h      2011-04-05 17:36:06 UTC (rev 14879)
+++ gnunet/src/mesh/mesh.h      2011-04-05 18:08:47 UTC (rev 14880)
@@ -112,7 +112,7 @@
 
     uint32_t tunnel_id GNUNET_PACKED;
 
-    struct GNUNET_PeerIdentity destination GNUNET_PACKED;
+    struct GNUNET_PeerIdentity destination;
 
     /* uint8_t data[] */
 };




reply via email to

[Prev in Thread] Current Thread [Next in Thread]