X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=lib%2Freconnect.h;h=4446713ce8734d078ea8c9266341f7f856eddb82;hb=b0fb94a346e52f36aeef238dd5f9bef9a10c14ef;hp=52f1001f18961a0f9fd9c603cac6b0154d4c84d7;hpb=eba18f0044cbe3654b4c796bbe7c056ca1793c70;p=sliver-openvswitch.git diff --git a/lib/reconnect.h b/lib/reconnect.h index 52f1001f1..4446713ce 100644 --- a/lib/reconnect.h +++ b/lib/reconnect.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009, 2010 Nicira Networks. + * Copyright (c) 2009, 2010, 2012 Nicira, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -67,10 +67,10 @@ void reconnect_disable(struct reconnect *, long long int now); void reconnect_force_reconnect(struct reconnect *, long long int now); bool reconnect_is_connected(const struct reconnect *); -unsigned int reconnect_get_connection_duration(const struct reconnect *, - long long int now); -unsigned int reconnect_get_disconnect_duration(const struct reconnect *, - long long int now); +unsigned int reconnect_get_last_connect_elapsed(const struct reconnect *, + long long int now); +unsigned int reconnect_get_last_disconnect_elapsed(const struct reconnect *, + long long int now); void reconnect_disconnected(struct reconnect *, long long int now, int error); void reconnect_connecting(struct reconnect *, long long int now); @@ -79,7 +79,7 @@ void reconnect_listen_error(struct reconnect *, long long int now, int error); void reconnect_connected(struct reconnect *, long long int now); void reconnect_connect_failed(struct reconnect *, long long int now, int error); -void reconnect_received(struct reconnect *, long long int now); +void reconnect_activity(struct reconnect *, long long int now); enum reconnect_action { RECONNECT_CONNECT = 1, @@ -92,18 +92,18 @@ int reconnect_timeout(struct reconnect *, long long int now); struct reconnect_stats { /* All times and durations in this structure are in milliseconds. */ - long long int creation_time; /* Time reconnect_create() called. */ - long long int last_received; /* Last call to reconnect_received(). */ - long long int last_connected; /* Last call to reconnect_connected(). */ + long long int creation_time; /* Time reconnect_create() called. */ + long long int last_activity; /* Last call to reconnect_activity(). */ + long long int last_connected; /* Last call to reconnect_connected(). */ long long int last_disconnected; /* Last call to reconnect_disconnected(). */ - int backoff; /* Current backoff duration. */ + int backoff; /* Current backoff duration. */ - unsigned int seqno; /* # of connections + # of disconnections. */ + unsigned int seqno; /* # of connections + # of disconnections. */ - bool is_connected; /* Currently connected? */ - unsigned int current_connection_duration; /* Time of current connection. */ - unsigned int current_disconnect_duration; /* Time disconnected (if disconnected). */ - unsigned int total_connected_duration; /* Sum of all connections. */ + bool is_connected; /* Currently connected? */ + unsigned int msec_since_connect; /* Time since last connect. */ + unsigned int msec_since_disconnect; /* Time since last disconnect. */ + unsigned int total_connected_duration; /* Sum of all connections. */ unsigned int n_attempted_connections; unsigned int n_successful_connections;