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_clients.c | |
parent | ce8e0739623ee25d2a29a75f393027a42bbe4d4f (diff) | |
download | gnunet-5f05330cb3d9ec30347c07522de00624de9d6c67.tar.gz gnunet-5f05330cb3d9ec30347c07522de00624de9d6c67.zip |
neighbour monitoring api implemented
Diffstat (limited to 'src/transport/gnunet-service-transport_clients.c')
-rw-r--r-- | src/transport/gnunet-service-transport_clients.c | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/src/transport/gnunet-service-transport_clients.c b/src/transport/gnunet-service-transport_clients.c index 6bd3e34d5..1fbd56c24 100644 --- a/src/transport/gnunet-service-transport_clients.c +++ b/src/transport/gnunet-service-transport_clients.c | |||
@@ -463,6 +463,8 @@ client_disconnect_notification (void *cls, struct GNUNET_SERVER_Client *client) | |||
463 | * @param cls the `struct TransportClient *` to notify | 463 | * @param cls the `struct TransportClient *` to notify |
464 | * @param peer identity of the neighbour | 464 | * @param peer identity of the neighbour |
465 | * @param address the address | 465 | * @param address the address |
466 | * @param state the current state of the peer | ||
467 | * @param state_timeout the time out for the state | ||
466 | * @param bandwidth_in inbound bandwidth in NBO | 468 | * @param bandwidth_in inbound bandwidth in NBO |
467 | * @param bandwidth_out outbound bandwidth in NBO | 469 | * @param bandwidth_out outbound bandwidth in NBO |
468 | */ | 470 | */ |
@@ -908,6 +910,8 @@ struct PeerIterationContext | |||
908 | * @param cls the 'struct PeerIterationContext' | 910 | * @param cls the 'struct PeerIterationContext' |
909 | * @param peer identity of the neighbour | 911 | * @param peer identity of the neighbour |
910 | * @param address the address | 912 | * @param address the address |
913 | * @param state current state this peer is in | ||
914 | * @param state_timeout timeout for the current state of the peer | ||
911 | * @param bandwidth_in inbound quota in NBO | 915 | * @param bandwidth_in inbound quota in NBO |
912 | * @param bandwidth_out outbound quota in NBO | 916 | * @param bandwidth_out outbound quota in NBO |
913 | */ | 917 | */ |
@@ -928,7 +932,9 @@ send_peer_information (void *cls, | |||
928 | { | 932 | { |
929 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 933 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
930 | "Sending information about `%s' using address `%s' in state `%s'\n", | 934 | "Sending information about `%s' using address `%s' in state `%s'\n", |
931 | GNUNET_i2s(peer), address); | 935 | GNUNET_i2s(peer), |
936 | (address != NULL) ? GST_plugins_a2s (address) : "<none>", | ||
937 | GNUNET_TRANSPORT_p2s (state)); | ||
932 | msg = compose_address_iterate_response_message (peer, address); | 938 | msg = compose_address_iterate_response_message (peer, address); |
933 | msg->state = htonl (state); | 939 | msg->state = htonl (state); |
934 | msg->state_timeout = GNUNET_TIME_absolute_hton(state_timeout); | 940 | msg->state_timeout = GNUNET_TIME_absolute_hton(state_timeout); |
@@ -1119,15 +1125,21 @@ GST_clients_unicast (struct GNUNET_SERVER_Client *client, | |||
1119 | * | 1125 | * |
1120 | * @param peer peer this update is about (never NULL) | 1126 | * @param peer peer this update is about (never NULL) |
1121 | * @param address address, NULL on disconnect | 1127 | * @param address address, NULL on disconnect |
1128 | * @param state the current state of the peer | ||
1129 | * @param state_timeout the time out for the state | ||
1122 | */ | 1130 | */ |
1123 | void | 1131 | void |
1124 | GST_clients_broadcast_address_notification (const struct GNUNET_PeerIdentity *peer, | 1132 | GST_clients_broadcast_peer_notification (const struct GNUNET_PeerIdentity *peer, |
1125 | const struct GNUNET_HELLO_Address *address) | 1133 | const struct GNUNET_HELLO_Address *address, |
1134 | enum GNUNET_TRANSPORT_PeerState state, | ||
1135 | struct GNUNET_TIME_Absolute state_timeout) | ||
1126 | { | 1136 | { |
1127 | struct PeerIterateResponseMessage *msg; | 1137 | struct PeerIterateResponseMessage *msg; |
1128 | struct MonitoringClient *mc; | 1138 | struct MonitoringClient *mc; |
1129 | static struct GNUNET_PeerIdentity all_zeros; | 1139 | static struct GNUNET_PeerIdentity all_zeros; |
1130 | msg = compose_address_iterate_response_message (peer, address); | 1140 | msg = compose_address_iterate_response_message (peer, address); |
1141 | msg->state = htonl (state); | ||
1142 | msg->state_timeout = GNUNET_TIME_absolute_hton (state_timeout); | ||
1131 | mc = monitoring_clients_head; | 1143 | mc = monitoring_clients_head; |
1132 | while (mc != NULL) | 1144 | while (mc != NULL) |
1133 | { | 1145 | { |