improving code and build system to be in line with gnunet access control model for...
[oweals/gnunet.git] / src / dht / gnunet-service-dht_neighbours.c
index 9ebf1640035d44b179220ac5fffe8d73da86a565..4ea5dd6f4df0a41077b8b833349f80de36f12ec1 100644 (file)
@@ -90,6 +90,8 @@
 #define GET_TIMEOUT GNUNET_TIME_relative_multiply(GNUNET_TIME_UNIT_MINUTES, 2)
 
 
+GNUNET_NETWORK_STRUCT_BEGIN
+
 /**
  * P2P PUT message
  */
@@ -246,7 +248,7 @@ struct PeerGetMessage
   /* result bloomfilter */
 
 };
-
+GNUNET_NETWORK_STRUCT_END
 
 /**
  * Linked list of messages to send to a particular other peer.
@@ -1615,6 +1617,10 @@ handle_dht_p2p_put (void *cls, const struct GNUNET_PeerIdentity *peer,
                                pp, payload, payload_size);
   }
   GNUNET_CONTAINER_bloomfilter_free (bf);
+  GDS_CLIENTS_process_monitor (GNUNET_MESSAGE_TYPE_DHT_MONITOR_PUT,
+    GNUNET_TIME_absolute_ntoh (put->expiration_time), &put->key,
+    putlen, put_path, 0, NULL, ntohl(put->desired_replication_level),
+    ntohl (put->type), payload, payload_size);
   return GNUNET_YES;
 }
 
@@ -1820,6 +1826,10 @@ handle_dht_p2p_get (void *cls, const struct GNUNET_PeerIdentity *peer,
                               1, GNUNET_NO);
   }
 
+  GDS_CLIENTS_process_monitor (GNUNET_MESSAGE_TYPE_DHT_MONITOR_GET,
+    GNUNET_TIME_UNIT_FOREVER_ABS, &get->key, 0, NULL, 0, NULL,
+    ntohl (get->desired_replication_level), type, NULL, 0);
+
   /* P2P forwarding */
   if (eval != GNUNET_BLOCK_EVALUATION_OK_LAST)
     GDS_NEIGHBOURS_handle_get (type, options,
@@ -1951,6 +1961,12 @@ handle_dht_p2p_result (void *cls, const struct GNUNET_PeerIdentity *peer,
                          &prm->key, put_path_length, put_path, get_path_length,
                          xget_path, data, data_size);
   }
+
+  GDS_CLIENTS_process_monitor (GNUNET_MESSAGE_TYPE_DHT_MONITOR_GET_RESP,
+    GNUNET_TIME_absolute_ntoh (prm->expiration_time), &prm->key,
+    put_path_length, put_path, get_path_length, get_path,
+    0, type, data, data_size);
+
   return GNUNET_YES;
 }