diff options
author | Ted Lemon <source@isc.org> | 1999-11-20 18:36:32 +0000 |
---|---|---|
committer | Ted Lemon <source@isc.org> | 1999-11-20 18:36:32 +0000 |
commit | d9eefc5dec0bd2986d1465276363f7b97d92b69a (patch) | |
tree | 5c8396c6474892bf2cb030ac6d4c88d9a63429fd /includes/failover.h | |
parent | b3677620b6bebff760d40ab7d73f918bfe66260a (diff) | |
download | isc-dhcp-d9eefc5dec0bd2986d1465276363f7b97d92b69a.tar.gz |
Mass commit for Brian Murrell.
Diffstat (limited to 'includes/failover.h')
-rw-r--r-- | includes/failover.h | 55 |
1 files changed, 51 insertions, 4 deletions
diff --git a/includes/failover.h b/includes/failover.h index e10abd9f..4432d0fa 100644 --- a/includes/failover.h +++ b/includes/failover.h @@ -20,15 +20,21 @@ * http://www.isc.org for more information. */ -struct failover_option { +struct failover_option_info { int code; char *name; - enum { FT_UINT8, FT_IPADDR, FT_UINT32, FT_BYTES, FT_DDNS, - FT_UINT16, FT_TEXT, FT_UNDEF, FT_DIGEST } data_type; + enum { FT_UINT8, FT_IPADDR, FT_UINT32, FT_BYTES, FT_DDNS, FT_DDNS1, + FT_UINT16, FT_TEXT, FT_UNDEF, FT_DIGEST } type; int num_present; - int data_offset; + int offset; + u_int32_t bit; }; +typedef struct { + int count; + u_int8_t *data; +} failover_option_t; + #define FM_OFFSET(x) ((char *)(((struct failover_message *)0).x) - \ (char *)(((struct failover_message *)0))) @@ -102,3 +108,44 @@ struct failover_option { #define FTM_STATE 10 #define FTM_CONTACT 11 #define FTM_DISCONNECT 12 + +#define DHCP_FAILOVER_MAX_MESSAGE_SIZE 2048 + +typedef struct { + u_int8_t type; + u_int32_t time; + u_int32_t xid; + int options_present; +} failover_message_t; + +typedef struct { + OMAPI_OBJECT_PREAMBLE; + char *peer_name; + unsigned peer_port; + int options_present; + enum dhcp_flink_state { + dhcp_flink_start, + dhcp_flink_message_length_wait, + dhcp_flink_message_wait, + dhcp_flink_disconnected, + dhcp_flink_state_max + } state; + failover_message_t *imsg; + u_int16_t imsg_len; + unsigned imsg_count; + u_int8_t imsg_payoff; /* Pay*load* offset. :') */ +} dhcp_failover_link_t; + +typedef struct { + OMAPI_OBJECT_PREAMBLE; + unsigned local_port; + char *peer_name; +} dhcp_failover_listener_t; + +typedef struct _dhcp_failover_state { + OMAPI_OBJECT_PREAMBLE; + struct _dhcp_failover_state *next; + char *remote_peer; + int listen_port; +} dhcp_failover_state_t; + |