aboutsummaryrefslogtreecommitdiff
path: root/src/testbed/gnunet-service-testbed.h
diff options
context:
space:
mode:
authorSree Harsha Totakura <totakura@in.tum.de>2013-01-25 10:55:49 +0000
committerSree Harsha Totakura <totakura@in.tum.de>2013-01-25 10:55:49 +0000
commit302168de1e43aec3d2d2dfe3fd6707b0f3f68300 (patch)
tree241c25a1c9630f701e4b15977f679e4f6286ccf9 /src/testbed/gnunet-service-testbed.h
parentf4ac441409d20d314d3733cf454dece1aae42e99 (diff)
downloadgnunet-302168de1e43aec3d2d2dfe3fd6707b0f3f68300.tar.gz
gnunet-302168de1e43aec3d2d2dfe3fd6707b0f3f68300.zip
separate hello cache as module
Diffstat (limited to 'src/testbed/gnunet-service-testbed.h')
-rw-r--r--src/testbed/gnunet-service-testbed.h56
1 files changed, 35 insertions, 21 deletions
diff --git a/src/testbed/gnunet-service-testbed.h b/src/testbed/gnunet-service-testbed.h
index 1ddc89540..4fa137780 100644
--- a/src/testbed/gnunet-service-testbed.h
+++ b/src/testbed/gnunet-service-testbed.h
@@ -24,6 +24,7 @@
24 * @author Sree Harsha Totakura 24 * @author Sree Harsha Totakura
25 */ 25 */
26 26
27#include "platform.h"
27#include "gnunet_util_lib.h" 28#include "gnunet_util_lib.h"
28#include "gnunet_testbed_service.h" 29#include "gnunet_testbed_service.h"
29#include "gnunet_transport_service.h" 30#include "gnunet_transport_service.h"
@@ -783,28 +784,41 @@ struct LCFContextQueue
783 784
784 785
785/** 786/**
786 * Hello cache entry 787 * Looks up in the hello cache and returns the HELLO of the given peer
788 *
789 * @param id the peer identity of the peer whose HELLO has to be looked up
790 * @return the HELLO message; NULL if not found
787 */ 791 */
788struct HelloCacheEntry 792const struct GNUNET_MessageHeader *
789{ 793TESTBED_hello_cache_lookup (const struct GNUNET_PeerIdentity *id);
790 /** 794
791 * DLL next ptr for least recently used hello cache entries 795/**
792 */ 796 * Caches the HELLO of the given peer. Updates the HELLO if it was already
793 struct HelloCacheEntry *next; 797 * cached before
798 *
799 * @param id the peer identity of the peer whose HELLO has to be cached
800 * @param hello the HELLO message
801 */
802void
803TESTBED_hello_cache_add (const struct GNUNET_PeerIdentity *id,
804 const struct GNUNET_MessageHeader *hello);
805
806
807/**
808 * Initializes the cache
809 *
810 * @param size the size of the cache
811 */
812void
813TESTBED_cache_init (unsigned int size);
814
815
816/**
817 * Clear cache
818 */
819void
820TESTBED_cache_clear ();
794 821
795 /**
796 * DLL prev ptr for least recently used hello cache entries
797 */
798 struct HelloCacheEntry *prev;
799 822
800 /**
801 * The key for this entry
802 */
803 struct GNUNET_HashCode key;
804
805 /**
806 * The HELLO message
807 */
808 struct GNUNET_MessageHeader *hello;
809};
810 823
824/* End of gnunet-service-testbed.h */