]> git.ipfire.org Git - thirdparty/dhcp.git/commitdiff
Add some missing data structures to the failover_state structure.
authorTed Lemon <source@isc.org>
Mon, 1 May 2000 23:40:15 +0000 (23:40 +0000)
committerTed Lemon <source@isc.org>
Mon, 1 May 2000 23:40:15 +0000 (23:40 +0000)
includes/failover.h

index 799de1388006203ae787bdd9b754f4c2f78a2f26..e2de329749f691e6ad68d4bbebdcbb84728670dc 100644 (file)
@@ -201,6 +201,7 @@ enum failover_state {
        partner_down,
        normal,
        communications_interrupted,
+       potential_conflict_nic,
        potential_conflict,
        recover
 };
@@ -211,18 +212,23 @@ typedef struct _dhcp_failover_state {
        struct _dhcp_failover_state *next;
        char *name;                     /* Name of this failover instance. */
        struct option_cache *address;   /* Partner's IP address or hostname. */
-       int listen_port;
        int port;                       /* Partner's TCP port. */
-       struct iaddr server_addr;
+       struct option_cache *server_addr; /* IP address on which to listen. */
+       int listen_port;                /* Port on which to listen. */
        u_int32_t max_flying_updates;
        u_int32_t mclt;
-       u_int8_t *hba;
+
+       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;
 
+       omapi_object_t *link_to_peer;   /* Currently-established link
+                                          to peer. */
+
        enum {
                primary, secondary
        } i_am;         /* We are primary or secondary in this relationship. */
@@ -238,16 +244,13 @@ typedef struct _dhcp_failover_state {
                                           last packet we received is older
                                           than this, communications have been
                                           interrupted. */
-       /* The ack queue and update queue are circular lists, so you can
-          tell whether or not a lease is on one of the lists by looking
-          at its next pointer.   Or maybe we should just flag it as
-          UPDATE_PENDING or ACK_PENDING.    But anyway, two seperate
-          queues.   Hm. Maybe these should be hash tables, with no pointer
-          from the peer to the lease. */
-       struct lease *update_queue;     /* List of leases we haven't sent
-                                          to peer. */
-       struct lease *ack_queue;        /* List of lease updates the peer
+       struct lease *update_queue_head; /* List of leases we haven't sent
+                                           to peer. */
+       struct lease *update_queue_tail;
+
+       struct lease *ack_queue_head;   /* List of lease updates the peer
                                           hasn't yet acked. */
+       struct lease *ack_queue_tail;
        int cur_unacked_updates;        /* Number of updates we've sent
                                           that have not yet been acked. */
 } dhcp_failover_state_t;