93 printf (
"spurious element\n");
167 uint64_t current_size,
179 "set intersection done\n");
194 "set %s: keep element %s\n",
203 "set %s: remove element %s\n",
214 "wrong element size: %u, expected %u\n",
221 "set %s: got element (%s)\n",
246 unsigned int n_opts = 0;
251 "listener failed\n");
256 "set listen cb called\n");
292 "Shutting down set profiler\n");
293 if (NULL != set_listener)
331 unsigned int n_opts = 0;
340 "could not retrieve host identity\n");
353 for (i = 0; i <
num_a; i++)
362 for (i = 0; i <
num_b; i++)
371 for (i = 0; i <
num_c; i++)
457 "return intersection instead of delta"),
473 "gnunet-seti-profiler",
static void statistics_done(void *cls, int success)
Success, all elements have been sent (and received).
static char * subsystem
Set to subsystem that we're going to get stats for (or NULL for all).
int GNUNET_SETI_add_element(struct GNUNET_SETI_Handle *set, const struct GNUNET_SETI_Element *element, GNUNET_SCHEDULER_TaskCallback cb, void *cb_cls)
Add an element to the given set.
static struct GNUNET_VPN_RedirectionRequest * request
Opaque redirection request handle.
static const struct GNUNET_CONFIGURATION_Handle * cfg
Configuration we are using.
The other peer refused to do the operation with us, or something went wrong.
unsigned int GNUNET_CONTAINER_multihashmap_size(const struct GNUNET_CONTAINER_MultiHashMap *map)
Get the number of key-value pairs in the map.
If a value with the given key exists, replace it.
static int set_insert_iterator(void *cls, const struct GNUNET_HashCode *key, void *value)
uint16_t size
Number of bytes in the buffer pointed to by data.
Handle for a GNUnet peer controlled by testing.
int GNUNET_SETI_commit(struct GNUNET_SETI_OperationHandle *oh, struct GNUNET_SETI_Handle *set)
Commit a set to be used with a set operation.
int GNUNET_TESTING_peer_run(const char *testdir, const char *cfgfilename, GNUNET_TESTING_TestMain tm, void *tm_cls)
Start a single peer and run a test using the testing library.
struct GNUNET_SCHEDULER_Task * GNUNET_SCHEDULER_add_shutdown(GNUNET_SCHEDULER_TaskCallback task, void *task_cls)
Schedule a new task to be run on shutdown, that is when a CTRL-C signal is received, or when GNUNET_SCHEDULER_shutdown() is being invoked.
struct GNUNET_STATISTICS_Handle * GNUNET_STATISTICS_create(const char *subsystem, const struct GNUNET_CONFIGURATION_Handle *cfg)
Get handle for the statistics service.
struct GNUNET_CONTAINER_MultiHashMap * received
Option for set operations.
#define GNUNET_assert(cond)
Use this for fatal errors that cannot be handled.
struct GNUNET_SETI_OperationHandle * oh
static unsigned int num_c
const char * GNUNET_h2s(const struct GNUNET_HashCode *hc)
Convert a hash value to a string (for printing debug messages).
static void pre_run(void *cls, char *const *args, const char *cfgfile, const struct GNUNET_CONFIGURATION_Handle *cfg)
Definition of a command line option.
static unsigned int use_intersection
int GNUNET_CONTAINER_multihashmap_remove_all(struct GNUNET_CONTAINER_MultiHashMap *map, const struct GNUNET_HashCode *key)
Remove all entries for the given key from the map.
void GNUNET_STATISTICS_destroy(struct GNUNET_STATISTICS_Handle *h, int sync_first)
Destroy a handle (free all state associated with it).
void GNUNET_SCHEDULER_shutdown(void)
Request the shutdown of a scheduler.
struct GNUNET_SETI_ListenHandle * GNUNET_SETI_listen(const struct GNUNET_CONFIGURATION_Handle *cfg, const struct GNUNET_HashCode *app_id, GNUNET_SETI_ListenCallback listen_cb, void *listen_cls)
Wait for set operation requests for the given application ID.
Opaque handle to a listen operation.
Internal representation of the hash map.
Handle for a set operation request from another peer.
struct GNUNET_GETOPT_CommandLineOption GNUNET_GETOPT_OPTION_END
static struct GNUNET_ARM_MonitorHandle * m
Monitor connection with ARM.
struct GNUNET_GETOPT_CommandLineOption GNUNET_GETOPT_option_filename(char shortName, const char *name, const char *argumentHelp, const char *description, char **str)
Allow user to specify a filename (automatically path expanded).
enum GNUNET_SETI_OptionType type
Type of the option.
Element should be added to the result set of the local peer, i.e.
static struct GNUNET_HashCode app_id
void GNUNET_CRYPTO_hash_create_random(enum GNUNET_CRYPTO_Quality mode, struct GNUNET_HashCode *result)
Create a random hash code.
static char * value
Value of the record to add/remove.
struct GNUNET_SETI_OperationHandle * GNUNET_SETI_accept(struct GNUNET_SETI_Request *request, const struct GNUNET_SETI_Option options[], GNUNET_SETI_ResultIterator result_cb, void *result_cls)
Accept a request we got via GNUNET_SETI_listen().
void GNUNET_SETI_operation_cancel(struct GNUNET_SETI_OperationHandle *oh)
Cancel the given set operation.
void GNUNET_CRYPTO_hash(const void *block, size_t size, struct GNUNET_HashCode *ret)
Compute hash of a given block.
static int statistics_result(void *cls, const char *subsystem, const char *name, uint64_t value, int is_persistent)
Callback function to process statistic values.
static void set_listen_cb(void *cls, const struct GNUNET_PeerIdentity *other_peer, const struct GNUNET_MessageHeader *context_msg, struct GNUNET_SETI_Request *request)
static FILE * statistics_file
The profiler will write statistics for all peers to this file.
uint16_t status
See PRISM_STATUS_*-constants.
const void * data
Actual data of the element.
struct GNUNET_SETI_Handle * GNUNET_SETI_create(const struct GNUNET_CONFIGURATION_Handle *cfg)
Create an empty set, supporting the specified operation.
static struct GNUNET_STATISTICS_Handle * statistics
Handle to the statistics service.
static struct GNUNET_PeerIdentity local_peer
struct GNUNET_TESTBED_Peer * peer
The peer associated with this model.
struct GNUNET_HashCode key
The key used in the DHT.
static const struct GNUNET_CONFIGURATION_Handle * config
int GNUNET_CONTAINER_multihashmap_put(struct GNUNET_CONTAINER_MultiHashMap *map, const struct GNUNET_HashCode *key, void *value, enum GNUNET_CONTAINER_MultiHashMapOption opt)
Store a key-value pair in the map.
Element should be delete from the result set of the local peer, i.e.
static struct GNUNET_SETI_ListenHandle * set_listener
int main(int argc, char **argv)
static struct GNUNET_CONTAINER_MultiHashMap * common_sent
static char * statistics_filename
The profiler will write statistics for all peers to the file with this name.
The identity of the host (wraps the signing key of the peer).
static void run(void *cls, const struct GNUNET_CONFIGURATION_Handle *cfg, struct GNUNET_TESTING_Peer *peer)
enum GNUNET_GenericReturnValue GNUNET_PROGRAM_run2(int argc, char *const *argv, const char *binaryName, const char *binaryHelp, const struct GNUNET_GETOPT_CommandLineOption *options, GNUNET_PROGRAM_Main task, void *task_cls, int run_without_scheduler)
Run a standard GNUnet command startup sequence (initialize loggers and configuration, parse options).
struct GNUNET_STATISTICS_GetHandle * GNUNET_STATISTICS_get(struct GNUNET_STATISTICS_Handle *handle, const char *subsystem, const char *name, GNUNET_STATISTICS_Callback cont, GNUNET_STATISTICS_Iterator proc, void *cls)
Get statistic from the peer.
static void check_all_done(void)
struct GNUNET_SET_Handle * set
static unsigned int num_b
GNUNET_SETI_Status
Status for the result callback.
static int map_remove_iterator(void *cls, const struct GNUNET_HashCode *key, void *value)
static unsigned int num_a
#define GNUNET_log(kind,...)
static unsigned int element_size
struct GNUNET_CONTAINER_MultiHashMap * sent
struct GNUNET_CONTAINER_MultiHashMap * GNUNET_CONTAINER_multihashmap_create(unsigned int len, int do_not_copy_keys)
Create a multi hash map.
void GNUNET_CRYPTO_random_block(enum GNUNET_CRYPTO_Quality mode, void *buffer, size_t length)
Fill block with a random values.
int GNUNET_CRYPTO_get_peer_identity(const struct GNUNET_CONFIGURATION_Handle *cfg, struct GNUNET_PeerIdentity *dst)
Retrieve the identity of the host's peer.
Return the elements remaining in the intersection (GNUNET_SETI_STATUS_ADD_LOCAL). ...
static void set_result_cb(void *cls, const struct GNUNET_SETI_Element *element, uint64_t current_size, enum GNUNET_SETI_Status status)
struct GNUNET_GETOPT_CommandLineOption GNUNET_GETOPT_option_uint(char shortName, const char *name, const char *argumentHelp, const char *description, unsigned int *val)
Allow user to specify an unsigned int.
struct GNUNET_SET_OperationHandle * oh
int GNUNET_CONTAINER_multihashmap_iterate(struct GNUNET_CONTAINER_MultiHashMap *map, GNUNET_CONTAINER_MulitHashMapIteratorCallback it, void *it_cls)
Iterate over all entries in the map.
uint32_t data
The data value.
void GNUNET_SETI_listen_cancel(struct GNUNET_SETI_ListenHandle *lh)
Cancel the given listen operation.
uint16_t element_type
Application-specific element type.
static void handle_shutdown(void *cls)
No good quality of the operation is needed (i.e., random numbers can be pseudo-random).
#define GNUNET_malloc(size)
Wrapper around malloc.
struct GNUNET_SETI_OperationHandle * GNUNET_SETI_prepare(const struct GNUNET_PeerIdentity *other_peer, const struct GNUNET_HashCode *app_id, const struct GNUNET_MessageHeader *context_msg, const struct GNUNET_SETI_Option options[], GNUNET_SETI_ResultIterator result_cb, void *result_cls)
Prepare a set operation to be evaluated with another peer.
#define gettext_noop(String)
void GNUNET_SETI_destroy(struct GNUNET_SETI_Handle *set)
Destroy the set handle, and free all associated resources.
High-quality operations are desired.