diff options
author | Nathan S. Evans <evans@in.tum.de> | 2010-09-02 15:56:57 +0000 |
---|---|---|
committer | Nathan S. Evans <evans@in.tum.de> | 2010-09-02 15:56:57 +0000 |
commit | 3bb80e50970bfee5ebea155b00f37adcd4d4c75e (patch) | |
tree | ac6ca7a1dbdd2dbf8aaba7b88a37225eb3904bbd /src | |
parent | 017907f0af8c44ae86d20c241cb9662e0ac8be2b (diff) | |
download | gnunet-3bb80e50970bfee5ebea155b00f37adcd4d4c75e.tar.gz gnunet-3bb80e50970bfee5ebea155b00f37adcd4d4c75e.zip |
missing definition
Diffstat (limited to 'src')
-rw-r--r-- | src/testing/testing_group.c | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/src/testing/testing_group.c b/src/testing/testing_group.c index 30efc4985..e2e91c8d7 100644 --- a/src/testing/testing_group.c +++ b/src/testing/testing_group.c | |||
@@ -3540,6 +3540,29 @@ GNUNET_TESTING_daemon_get (struct GNUNET_TESTING_PeerGroup *pg, unsigned int pos | |||
3540 | return NULL; | 3540 | return NULL; |
3541 | } | 3541 | } |
3542 | 3542 | ||
3543 | /* | ||
3544 | * Get a daemon by peer identity, so callers can | ||
3545 | * retrieve the daemon without knowing it's offset. | ||
3546 | * | ||
3547 | * @param pg the peer group to retrieve the daemon from | ||
3548 | * @param peer_id the peer identity of the daemon to retrieve | ||
3549 | * | ||
3550 | * @return the daemon on success, or NULL if no such peer identity is found | ||
3551 | */ | ||
3552 | struct GNUNET_TESTING_Daemon * | ||
3553 | GNUNET_TESTING_daemon_get_by_id (struct GNUNET_TESTING_PeerGroup *pg, struct GNUNET_PeerIdentity *peer_id) | ||
3554 | { | ||
3555 | unsigned int i; | ||
3556 | |||
3557 | for (i = 0; i < pg->total; i ++) | ||
3558 | { | ||
3559 | if (0 == memcmp(&pg->peers[i].daemon->id, peer_id, sizeof(struct GNUNET_PeerIdentity))) | ||
3560 | return pg->peers[i].daemon; | ||
3561 | } | ||
3562 | |||
3563 | return NULL; | ||
3564 | } | ||
3565 | |||
3543 | /** | 3566 | /** |
3544 | * Prototype of a function that will be called when a | 3567 | * Prototype of a function that will be called when a |
3545 | * particular operation was completed the testing library. | 3568 | * particular operation was completed the testing library. |