mirror of
https://gitlab.isc.org/isc-projects/dhcp
synced 2025-08-29 21:38:10 +00:00
Add function prototypes; add state to lease structure
This commit is contained in:
parent
11b37280ba
commit
fc2df23a11
@ -98,24 +98,41 @@ struct lease {
|
|||||||
struct lease *next;
|
struct lease *next;
|
||||||
struct lease *prev;
|
struct lease *prev;
|
||||||
struct lease *n_uid, *n_hw;
|
struct lease *n_uid, *n_hw;
|
||||||
|
struct lease *waitq_next;
|
||||||
|
|
||||||
struct iaddr ip_addr;
|
struct iaddr ip_addr;
|
||||||
TIME starts, ends, timestamp;
|
TIME starts, ends, timestamp;
|
||||||
TIME offered_expiry;
|
TIME offered_expiry;
|
||||||
unsigned char *uid;
|
unsigned char *uid;
|
||||||
int uid_len;
|
int uid_len;
|
||||||
|
int uid_max;
|
||||||
|
unsigned char uid_buf [32];
|
||||||
char *hostname;
|
char *hostname;
|
||||||
struct host_decl *host;
|
struct host_decl *host;
|
||||||
struct subnet *subnet;
|
struct subnet *subnet;
|
||||||
struct shared_network *shared_network;
|
struct shared_network *shared_network;
|
||||||
|
struct interface_info *ip;
|
||||||
struct hardware hardware_addr;
|
struct hardware hardware_addr;
|
||||||
int state;
|
|
||||||
int xid;
|
|
||||||
int flags;
|
int flags;
|
||||||
# define STATIC_LEASE 1
|
# define STATIC_LEASE 1
|
||||||
# define BOOTP_LEASE 2
|
# define BOOTP_LEASE 2
|
||||||
# define DYNAMIC_BOOTP_OK 4
|
# define DYNAMIC_BOOTP_OK 4
|
||||||
# define PERSISTENT_FLAGS (DYNAMIC_BOOTP_OK)
|
# define PERSISTENT_FLAGS (DYNAMIC_BOOTP_OK)
|
||||||
# define EPHEMERAL_FLAGS (BOOTP_LEASE)
|
# define EPHEMERAL_FLAGS (BOOTP_LEASE)
|
||||||
|
# define MS_NULL_TERMINATION 8
|
||||||
|
|
||||||
|
struct tree_cache *options [256];
|
||||||
|
u_int32_t expiry, renewal, rebind;
|
||||||
|
char *filename, *server_name;
|
||||||
|
|
||||||
|
u_int32_t xid;
|
||||||
|
u_int16_t secs;
|
||||||
|
u_int16_t bootp_flags;
|
||||||
|
struct in_addr ciaddr;
|
||||||
|
struct in_addr giaddr;
|
||||||
|
u_int8_t hops;
|
||||||
|
u_int8_t offer;
|
||||||
};
|
};
|
||||||
|
|
||||||
#define ROOT_GROUP 0
|
#define ROOT_GROUP 0
|
||||||
@ -214,6 +231,7 @@ struct client_lease {
|
|||||||
|
|
||||||
/* Possible states in which the client can be. */
|
/* Possible states in which the client can be. */
|
||||||
enum dhcp_state {
|
enum dhcp_state {
|
||||||
|
S_REBOOTING,
|
||||||
S_INIT,
|
S_INIT,
|
||||||
S_SELECTING,
|
S_SELECTING,
|
||||||
S_REQUESTING,
|
S_REQUESTING,
|
||||||
@ -239,6 +257,9 @@ struct client_config {
|
|||||||
TIME select_interval; /* Wait this many seconds from the
|
TIME select_interval; /* Wait this many seconds from the
|
||||||
first DHCPDISCOVER before
|
first DHCPDISCOVER before
|
||||||
picking an offered lease. */
|
picking an offered lease. */
|
||||||
|
TIME reboot_timeout; /* When in INIT-REBOOT, wait this
|
||||||
|
long before giving up and going
|
||||||
|
to INIT. */
|
||||||
struct string_list *media; /* Possible network media values. */
|
struct string_list *media; /* Possible network media values. */
|
||||||
char *script_name; /* Name of config script. */
|
char *script_name; /* Name of config script. */
|
||||||
enum { IGNORE, ACCEPT, PREFER } bootp_policy;
|
enum { IGNORE, ACCEPT, PREFER } bootp_policy;
|
||||||
@ -461,6 +482,7 @@ void dhcpdecline PROTO ((struct packet *));
|
|||||||
void dhcpinform PROTO ((struct packet *));
|
void dhcpinform PROTO ((struct packet *));
|
||||||
void nak_lease PROTO ((struct packet *, struct iaddr *cip));
|
void nak_lease PROTO ((struct packet *, struct iaddr *cip));
|
||||||
void ack_lease PROTO ((struct packet *, struct lease *, unsigned char, TIME));
|
void ack_lease PROTO ((struct packet *, struct lease *, unsigned char, TIME));
|
||||||
|
void dhcp_reply PROTO ((struct lease *));
|
||||||
struct lease *find_lease PROTO ((struct packet *, struct shared_network *));
|
struct lease *find_lease PROTO ((struct packet *, struct shared_network *));
|
||||||
struct lease *mockup_lease PROTO ((struct packet *,
|
struct lease *mockup_lease PROTO ((struct packet *,
|
||||||
struct shared_network *,
|
struct shared_network *,
|
||||||
@ -689,6 +711,7 @@ void send_request PROTO ((struct interface_info *));
|
|||||||
void send_release PROTO ((struct interface_info *));
|
void send_release PROTO ((struct interface_info *));
|
||||||
void send_decline PROTO ((struct interface_info *));
|
void send_decline PROTO ((struct interface_info *));
|
||||||
|
|
||||||
|
void state_reboot PROTO ((struct interface_info *));
|
||||||
void state_init PROTO ((struct interface_info *));
|
void state_init PROTO ((struct interface_info *));
|
||||||
void state_selecting PROTO ((struct interface_info *));
|
void state_selecting PROTO ((struct interface_info *));
|
||||||
void state_requesting PROTO ((struct interface_info *));
|
void state_requesting PROTO ((struct interface_info *));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user