diff options
author | Matthias Wachs <wachs@net.in.tum.de> | 2014-01-15 17:16:10 +0000 |
---|---|---|
committer | Matthias Wachs <wachs@net.in.tum.de> | 2014-01-15 17:16:10 +0000 |
commit | b0144a11f14f33ab010fd7cf8c61bdd361f20fd3 (patch) | |
tree | e33e892855dad39a0eb5897c0105a0fe651598c6 /src | |
parent | d9bc5ff9aef9e54c7a6f494b7096dc7b6b23183f (diff) | |
download | gnunet-b0144a11f14f33ab010fd7cf8c61bdd361f20fd3.tar.gz gnunet-b0144a11f14f33ab010fd7cf8c61bdd361f20fd3.zip |
header for transport validation monitoring API
Diffstat (limited to 'src')
-rw-r--r-- | src/include/gnunet_protocols.h | 2 | ||||
-rw-r--r-- | src/include/gnunet_transport_service.h | 43 |
2 files changed, 38 insertions, 7 deletions
diff --git a/src/include/gnunet_protocols.h b/src/include/gnunet_protocols.h index 1861c318b..ee8a1272c 100644 --- a/src/include/gnunet_protocols.h +++ b/src/include/gnunet_protocols.h | |||
@@ -1319,8 +1319,6 @@ extern "C" | |||
1319 | */ | 1319 | */ |
1320 | #define GNUNET_MESSAGE_TYPE_TRANSPORT_MONITOR_VALIDATION_RESPONSE 387 | 1320 | #define GNUNET_MESSAGE_TYPE_TRANSPORT_MONITOR_VALIDATION_RESPONSE 387 |
1321 | 1321 | ||
1322 | |||
1323 | |||
1324 | /******************************************************************************* | 1322 | /******************************************************************************* |
1325 | * FS-PUBLISH-HELPER IPC Messages | 1323 | * FS-PUBLISH-HELPER IPC Messages |
1326 | ******************************************************************************/ | 1324 | ******************************************************************************/ |
diff --git a/src/include/gnunet_transport_service.h b/src/include/gnunet_transport_service.h index 432eb702f..6e9d47b48 100644 --- a/src/include/gnunet_transport_service.h +++ b/src/include/gnunet_transport_service.h | |||
@@ -206,7 +206,28 @@ enum GNUNET_TRANSPORT_PeerState | |||
206 | GNUNET_TRANSPORT_PS_DISCONNECT_FINISHED | 206 | GNUNET_TRANSPORT_PS_DISCONNECT_FINISHED |
207 | }; | 207 | }; |
208 | 208 | ||
209 | enum GNUNET_TRANSPORT_ValidationState | ||
210 | { | ||
211 | /** | ||
212 | * Fresh validation entry | ||
213 | */ | ||
214 | GNUNET_TRANSPORT_VS_NEW, | ||
209 | 215 | ||
216 | /** | ||
217 | * Updated validation entry | ||
218 | */ | ||
219 | GNUNET_TRANSPORT_VS_UPDATE, | ||
220 | |||
221 | /** | ||
222 | * Timeout for validation entry | ||
223 | */ | ||
224 | GNUNET_TRANSPORT_VS_TIMEOUT, | ||
225 | |||
226 | /** | ||
227 | * Validation entry is removed | ||
228 | */ | ||
229 | GNUNET_TRANSPORT_VS_REMOVE, | ||
230 | }; | ||
210 | 231 | ||
211 | /** | 232 | /** |
212 | * Function called by the transport for each received message. | 233 | * Function called by the transport for each received message. |
@@ -319,10 +340,12 @@ typedef void (*GNUNET_TRANSPORT_PeerIterateCallback) (void *cls, | |||
319 | * | 340 | * |
320 | */ | 341 | */ |
321 | typedef void (*GNUNET_TRANSPORT_ValidationIterateCallback) (void *cls, | 342 | typedef void (*GNUNET_TRANSPORT_ValidationIterateCallback) (void *cls, |
322 | const struct GNUNET_PeerIdentity *peer, | 343 | const struct GNUNET_PeerIdentity *peer, |
323 | const struct GNUNET_HELLO_Address *address, | 344 | const struct GNUNET_HELLO_Address *address, |
324 | struct GNUNET_TIME_Absolute valid_until, | 345 | struct GNUNET_TIME_Absolute last_validation, |
325 | struct GNUNET_TIME_Absolute next_validation); | 346 | struct GNUNET_TIME_Absolute valid_until, |
347 | struct GNUNET_TIME_Absolute next_validation, | ||
348 | enum GNUNET_TRANSPORT_ValidationState state); | ||
326 | 349 | ||
327 | 350 | ||
328 | 351 | ||
@@ -601,7 +624,7 @@ GNUNET_TRANSPORT_address_to_string_cancel (struct | |||
601 | * @param state the state | 624 | * @param state the state |
602 | */ | 625 | */ |
603 | const char * | 626 | const char * |
604 | GNUNET_TRANSPORT_p2s (enum GNUNET_TRANSPORT_PeerState state); | 627 | GNUNET_TRANSPORT_ps2s (enum GNUNET_TRANSPORT_PeerState state); |
605 | 628 | ||
606 | 629 | ||
607 | /** | 630 | /** |
@@ -615,6 +638,16 @@ GNUNET_TRANSPORT_is_connected (enum GNUNET_TRANSPORT_PeerState state); | |||
615 | 638 | ||
616 | 639 | ||
617 | /** | 640 | /** |
641 | * Convert validation state to human-readable string. | ||
642 | * | ||
643 | * @param state the state value | ||
644 | * @return corresponding string | ||
645 | */ | ||
646 | const char * | ||
647 | GNUNET_TRANSPORT_vs2s (enum GNUNET_TRANSPORT_ValidationState state); | ||
648 | |||
649 | |||
650 | /** | ||
618 | * Return information about a specific peer or all peers currently known to | 651 | * Return information about a specific peer or all peers currently known to |
619 | * transport service once or in monitoring mode. To obtain information about | 652 | * transport service once or in monitoring mode. To obtain information about |
620 | * a specific peer, a peer identity can be passed. To obtain information about | 653 | * a specific peer, a peer identity can be passed. To obtain information about |