mirror of
https://gitlab.isc.org/isc-projects/dhcp
synced 2025-08-29 05:17:57 +00:00
Define all the elements in the message structure. Rename some constants.
This commit is contained in:
parent
35e0fdf8b6
commit
c689c0c9f0
@ -22,7 +22,7 @@
|
|||||||
|
|
||||||
struct failover_option_info {
|
struct failover_option_info {
|
||||||
int code;
|
int code;
|
||||||
char *name;
|
const char *name;
|
||||||
enum { FT_UINT8, FT_IPADDR, FT_UINT32, FT_BYTES, FT_TEXT_OR_BYTES,
|
enum { FT_UINT8, FT_IPADDR, FT_UINT32, FT_BYTES, FT_TEXT_OR_BYTES,
|
||||||
FT_DDNS, FT_DDNS1, FT_UINT16, FT_TEXT,
|
FT_DDNS, FT_DDNS1, FT_UINT16, FT_TEXT,
|
||||||
FT_UNDEF, FT_DIGEST } type;
|
FT_UNDEF, FT_DIGEST } type;
|
||||||
@ -32,12 +32,11 @@ struct failover_option_info {
|
|||||||
};
|
};
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
int count;
|
unsigned count;
|
||||||
u_int8_t *data;
|
u_int8_t *data;
|
||||||
} failover_option_t;
|
} failover_option_t;
|
||||||
|
|
||||||
#define FM_OFFSET(x) ((char *)(((struct failover_message *)0).x) - \
|
#define FM_OFFSET(x) (long)(&(((failover_message_t *)0) -> x))
|
||||||
(char *)(((struct failover_message *)0)))
|
|
||||||
|
|
||||||
#define FTO_BINDING_STATUS 1
|
#define FTO_BINDING_STATUS 1
|
||||||
#define FTB_BINDING_STATUS 0x00000002
|
#define FTB_BINDING_STATUS 0x00000002
|
||||||
@ -49,8 +48,8 @@ typedef struct {
|
|||||||
#define FTB_ADDRESSES_TRANSFERRED 0x00000010
|
#define FTB_ADDRESSES_TRANSFERRED 0x00000010
|
||||||
#define FTO_CLIENT_IDENTIFIER 5
|
#define FTO_CLIENT_IDENTIFIER 5
|
||||||
#define FTB_CLIENT_IDENTIFIER 0x00000020
|
#define FTB_CLIENT_IDENTIFIER 0x00000020
|
||||||
#define FTO_CLIENT_HARDWARE_ADDRESS 6
|
#define FTO_CHADDR 6
|
||||||
#define FTB_CLIENT_HARDWARE_ADDRESS 0x00000040
|
#define FTB_CHADDR 0x00000040
|
||||||
#define FTO_DDNS 7
|
#define FTO_DDNS 7
|
||||||
#define FTB_DDNS 0x00000080
|
#define FTB_DDNS 0x00000080
|
||||||
#define FTO_REJECT_REASON 8
|
#define FTO_REJECT_REASON 8
|
||||||
@ -61,8 +60,8 @@ typedef struct {
|
|||||||
#define FTB_MCLT 0x00000400
|
#define FTB_MCLT 0x00000400
|
||||||
#define FTO_VENDOR_CLASS 11
|
#define FTO_VENDOR_CLASS 11
|
||||||
#define FTB_VENDOR_CLASS 0x00000800
|
#define FTB_VENDOR_CLASS 0x00000800
|
||||||
#define FTO_EXPIRY 13
|
#define FTO_LEASE_EXPIRY 13
|
||||||
#define FTB_EXPIRY 0x00002000
|
#define FTB_LEASE_EXPIRY 0x00002000
|
||||||
#define FTO_POTENTIAL_EXPIRY 14
|
#define FTO_POTENTIAL_EXPIRY 14
|
||||||
#define FTB_POTENTIAL_EXPIRY 0x00004000
|
#define FTB_POTENTIAL_EXPIRY 0x00004000
|
||||||
#define FTO_GRACE_EXPIRY 15
|
#define FTO_GRACE_EXPIRY 15
|
||||||
@ -114,8 +113,37 @@ typedef struct {
|
|||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
u_int8_t type;
|
u_int8_t type;
|
||||||
|
|
||||||
|
u_int8_t binding_status;
|
||||||
|
u_int8_t protocol_version;
|
||||||
|
u_int8_t reject_reason;
|
||||||
|
u_int8_t server_flags;
|
||||||
|
u_int8_t server_state;
|
||||||
|
u_int8_t tls_reply;
|
||||||
|
u_int8_t tls_request;
|
||||||
|
u_int32_t stos;
|
||||||
u_int32_t time;
|
u_int32_t time;
|
||||||
u_int32_t xid;
|
u_int32_t xid;
|
||||||
|
u_int32_t addresses_transferred;
|
||||||
|
u_int32_t assigned_addr;
|
||||||
|
u_int32_t client_ltt;
|
||||||
|
u_int32_t expiry;
|
||||||
|
u_int32_t grace_expiry;
|
||||||
|
u_int32_t max_unacked;
|
||||||
|
u_int32_t mclt;
|
||||||
|
u_int32_t potential_expiry;
|
||||||
|
u_int32_t receive_timer;
|
||||||
|
u_int32_t server_addr;
|
||||||
|
failover_option_t chaddr;
|
||||||
|
failover_option_t client_identifier;
|
||||||
|
failover_option_t hba;
|
||||||
|
failover_option_t message;
|
||||||
|
failover_option_t reply_options;
|
||||||
|
failover_option_t request_options;
|
||||||
|
ddns_fqdn_t ddns;
|
||||||
|
failover_option_t vendor_class;
|
||||||
|
failover_option_t vendor_options;
|
||||||
|
|
||||||
int options_present;
|
int options_present;
|
||||||
} failover_message_t;
|
} failover_message_t;
|
||||||
|
|
||||||
@ -132,9 +160,11 @@ typedef struct {
|
|||||||
dhcp_flink_state_max
|
dhcp_flink_state_max
|
||||||
} state;
|
} state;
|
||||||
failover_message_t *imsg;
|
failover_message_t *imsg;
|
||||||
|
struct _dhcp_failover_state *state_object;
|
||||||
u_int16_t imsg_len;
|
u_int16_t imsg_len;
|
||||||
unsigned imsg_count;
|
unsigned imsg_count;
|
||||||
u_int8_t imsg_payoff; /* Pay*load* offset. :') */
|
u_int8_t imsg_payoff; /* Pay*load* offset. :') */
|
||||||
|
u_int32_t xid;
|
||||||
} dhcp_failover_link_t;
|
} dhcp_failover_link_t;
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
@ -148,5 +178,11 @@ typedef struct _dhcp_failover_state {
|
|||||||
struct _dhcp_failover_state *next;
|
struct _dhcp_failover_state *next;
|
||||||
char *remote_peer;
|
char *remote_peer;
|
||||||
int listen_port;
|
int listen_port;
|
||||||
|
struct iaddr server_addr;
|
||||||
|
unsigned max_flying_updates;
|
||||||
|
unsigned partner_timeout;
|
||||||
|
unsigned mclt;
|
||||||
|
u_int8_t *hba;
|
||||||
} dhcp_failover_state_t;
|
} dhcp_failover_state_t;
|
||||||
|
|
||||||
|
#define DHCP_FAILOVER_VERSION 1
|
||||||
|
Loading…
x
Reference in New Issue
Block a user