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 */
recover,
recover_done,
shut_down,
- paused
+ paused,
+ startup
};
/* Service states are simplifications of failover states, particularly
};
#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
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;
#ifndef lint
static char copyright[] =
-"$Id: db.c,v 1.56 2000/08/11 01:26:08 neild Exp $ Copyright (c) 1995-2000 The Internet Software Consortium. All rights reserved.\n";
+"$Id: db.c,v 1.57 2000/08/31 04:40:05 mellon Exp $ Copyright (c) 1995-2000 The Internet Software Consortium. All rights reserved.\n";
#endif /* not lint */
#include "dhcpd.h"
if (errno)
++errors;
- t = gmtime (&state -> my_stos);
+ t = gmtime (&state -> me.stos);
errno = 0;
fprintf (db_file, "\n my state %s at %d %d/%02d/%02d %02d:%02d:%02d;",
- dhcp_failover_state_name_print (state -> my_state),
+ dhcp_failover_state_name_print (state -> me.state),
t -> tm_wday, t -> tm_year + 1900,
t -> tm_mon + 1, t -> tm_mday,
t -> tm_hour, t -> tm_min, t -> tm_sec);
if (errno)
++errors;
- t = gmtime (&state -> partner_stos);
+ t = gmtime (&state -> partner.stos);
errno = 0;
fprintf (db_file,
"\n partner state %s at %d %d/%02d/%02d %02d:%02d:%02d;",
- dhcp_failover_state_name_print (state -> my_state),
+ dhcp_failover_state_name_print (state -> partner.state),
t -> tm_wday, t -> tm_year + 1900,
t -> tm_mon + 1, t -> tm_mday,
t -> tm_hour, t -> tm_min, t -> tm_sec);