diff options
author | Matthias Wachs <wachs@net.in.tum.de> | 2014-01-08 17:51:53 +0000 |
---|---|---|
committer | Matthias Wachs <wachs@net.in.tum.de> | 2014-01-08 17:51:53 +0000 |
commit | 5f05330cb3d9ec30347c07522de00624de9d6c67 (patch) | |
tree | 213d4a9fdd07a2017c5768d609280fce4b6f146c /src/transport/gnunet-service-transport_blacklist.c | |
parent | ce8e0739623ee25d2a29a75f393027a42bbe4d4f (diff) | |
download | gnunet-5f05330cb3d9ec30347c07522de00624de9d6c67.tar.gz gnunet-5f05330cb3d9ec30347c07522de00624de9d6c67.zip |
neighbour monitoring api implemented
Diffstat (limited to 'src/transport/gnunet-service-transport_blacklist.c')
-rw-r--r-- | src/transport/gnunet-service-transport_blacklist.c | 23 |
1 files changed, 13 insertions, 10 deletions
diff --git a/src/transport/gnunet-service-transport_blacklist.c b/src/transport/gnunet-service-transport_blacklist.c index db154d911..7e1d7d43b 100644 --- a/src/transport/gnunet-service-transport_blacklist.c +++ b/src/transport/gnunet-service-transport_blacklist.c | |||
@@ -474,29 +474,32 @@ struct TestConnectionContext | |||
474 | struct Blacklisters *bl; | 474 | struct Blacklisters *bl; |
475 | }; | 475 | }; |
476 | 476 | ||
477 | |||
478 | /** | 477 | /** |
479 | * Test if an existing connection is still acceptable given a new | 478 | * Test if an existing connection is still acceptable given a new |
480 | * blacklisting client. | 479 | * blacklisting client. |
481 | * | 480 | * |
482 | * @param cls the 'struct TestConnectionContest' | 481 | * @param cls the 'struct TestConnectionContest' |
483 | * @param neighbour neighbour's identity | 482 | * @param peer neighbour's identity |
484 | * @param address the address | 483 | * @param address the address |
485 | * @param bandwidth_in inbound quota in NBO | 484 | * @param state current state this peer is in |
486 | * @param bandwidth_out outbound quota in NBO | 485 | * @param state_timeout timeout for the current state of the peer |
486 | * @param bandwidth_in bandwidth assigned inbound | ||
487 | * @param bandwidth_out bandwidth assigned outbound | ||
487 | */ | 488 | */ |
488 | static void | 489 | static void |
489 | test_connection_ok (void *cls, const struct GNUNET_PeerIdentity *neighbour, | 490 | test_connection_ok (void *cls, const struct GNUNET_PeerIdentity *peer, |
490 | const struct GNUNET_HELLO_Address *address, | 491 | const struct GNUNET_HELLO_Address *address, |
491 | struct GNUNET_BANDWIDTH_Value32NBO bandwidth_in, | 492 | enum GNUNET_TRANSPORT_PeerState state, |
492 | struct GNUNET_BANDWIDTH_Value32NBO bandwidth_out) | 493 | struct GNUNET_TIME_Absolute state_timeout, |
494 | struct GNUNET_BANDWIDTH_Value32NBO bandwidth_in, | ||
495 | struct GNUNET_BANDWIDTH_Value32NBO bandwidth_out) | ||
493 | { | 496 | { |
494 | struct TestConnectionContext *tcc = cls; | 497 | struct TestConnectionContext *tcc = cls; |
495 | struct GST_BlacklistCheck *bc; | 498 | struct GST_BlacklistCheck *bc; |
496 | 499 | ||
497 | bc = GNUNET_new (struct GST_BlacklistCheck); | 500 | bc = GNUNET_new (struct GST_BlacklistCheck); |
498 | GNUNET_CONTAINER_DLL_insert (bc_head, bc_tail, bc); | 501 | GNUNET_CONTAINER_DLL_insert(bc_head, bc_tail, bc); |
499 | bc->peer = *neighbour; | 502 | bc->peer = *peer; |
500 | bc->cont = &confirm_or_drop_neighbour; | 503 | bc->cont = &confirm_or_drop_neighbour; |
501 | bc->cont_cls = NULL; | 504 | bc->cont_cls = NULL; |
502 | bc->bl_pos = tcc->bl; | 505 | bc->bl_pos = tcc->bl; |