diff options
author | Ted Lemon <source@isc.org> | 2000-08-31 04:40:05 +0000 |
---|---|---|
committer | Ted Lemon <source@isc.org> | 2000-08-31 04:40:05 +0000 |
commit | fcbeefb3ba5a15cf0584d984b7a03b37a2f07253 (patch) | |
tree | 6137454dd5dc64f0343b7ce1f2734a9bc726bfc9 /includes/failover.h | |
parent | 058159169d22c87bc948efcc0c2c845c6e610e02 (diff) | |
download | isc-dhcp-fcbeefb3ba5a15cf0584d984b7a03b37a2f07253.tar.gz |
Move state information common to both peers into a common structure.
Diffstat (limited to 'includes/failover.h')
-rw-r--r-- | includes/failover.h | 36 |
1 files changed, 17 insertions, 19 deletions
diff --git a/includes/failover.h b/includes/failover.h index b2c0957e..36b7ffbd 100644 --- a/includes/failover.h +++ b/includes/failover.h @@ -217,9 +217,10 @@ typedef struct { u_int32_t xid; } dhcp_failover_link_t; -typedef struct { +typedef struct _dhcp_failover_listener { OMAPI_OBJECT_PREAMBLE; - unsigned local_port; + struct _dhcp_failover_listener *next; + omapi_addr_t address; } dhcp_failover_listener_t; #endif /* FAILOVER_PROTOCOL */ @@ -234,7 +235,8 @@ enum failover_state { recover, recover_done, shut_down, - paused + paused, + startup }; /* Service states are simplifications of failover states, particularly @@ -251,25 +253,28 @@ enum service_state { }; #if defined (FAILOVER_PROTOCOL) +typedef struct _dhcp_failover_config { + struct option_cache *address; + int port; + u_int32_t max_flying_updates; + enum failover_state state; + TIME stos; + u_int32_t max_response_delay; +} dhcp_failover_config_t; + typedef struct _dhcp_failover_state { OMAPI_OBJECT_PREAMBLE; struct _dhcp_failover_state *next; char *name; /* Name of this failover instance. */ - struct option_cache *address; /* Partner's IP address or hostname. */ - int port; /* Partner's TCP port. */ - struct option_cache *server_addr; /* IP address on which to listen. */ + dhcp_failover_config_t me; /* My configuration. */ + dhcp_failover_config_t partner; /* Partner's configuration. */ + enum failover_state saved_state; /* Saved state during startup. */ struct data_string server_identifier; /* Server identifier (IP addr) */ - int listen_port; /* Port on which to listen. */ - u_int32_t max_flying_updates; u_int32_t mclt; u_int8_t *hba; /* Hash bucket array for load balancing. */ int load_balance_max_secs; - enum failover_state partner_state; - TIME partner_stos; - enum failover_state my_state; - TIME my_stos; enum service_state service_state; const char *nrr; /* Printable reason why we're in the not_responding service state (empty @@ -286,13 +291,6 @@ typedef struct _dhcp_failover_state { TIME last_timestamp_received; /* The last timestamp we sent that has been returned by our partner. */ TIME skew; /* The skew between our clock and our partner's. */ - u_int32_t max_transmit_idle; /* Always send a poll if we haven't sent - some other packet more recently than - this. */ - u_int32_t max_response_delay; /* If the returned timestamp on the - last packet we received is older - than this, communications have been - interrupted. */ struct lease *update_queue_head; /* List of leases we haven't sent to peer. */ struct lease *update_queue_tail; |