|
char * | print_client_identifier_from_packet (struct packet *packet) |
|
char * | print_hw_addr_or_client_id (struct packet *packet) |
|
void | dhcp (struct packet *packet) |
|
void | dhcpdiscover (struct packet *packet, int ms_nulltp) |
|
void | dhcprequest (struct packet *packet, int ms_nulltp, struct lease *ip_lease) |
|
void | dhcprelease (struct packet *packet, int ms_nulltp) |
|
void | dhcpdecline (struct packet *packet, int ms_nulltp) |
|
void | dhcpinform (struct packet *packet, int ms_nulltp) |
|
void | nak_lease (struct packet *packet, struct iaddr *cip, struct group *network_group) |
| Constructs and sends a DHCP Nak.
|
|
void | echo_client_id (struct packet *packet, struct lease *lease, struct option_state *in_options, struct option_state *out_options) |
| Adds a dhcp-client-id option to a set of options Given a set of input options, it searches for echo-client-id. If it is defined and enabled, the given packet is searched for dhcp-client-id. If the option is found it is replicated into the given set of output options. This allows us to provide compliance with RFC 6842. It is called when we ack or nak a lease. In the latter case we may or may not have created the requisite scope to lookup echo-client-id.
|
|
void | check_pool_threshold (struct packet *packet, struct lease *lease, struct lease_state *state) |
|
void | ack_lease (struct packet *packet, struct lease *lease, unsigned int offer, TIME when, char *msg, int ms_nulltp, struct host_decl *hp) |
|
void | dhcp_reply (struct lease *lease) |
|
int | find_lease (struct lease **lp, struct packet *packet, struct shared_network *share, int *ours, int *peer_has_leases, struct lease *ip_lease_in, const char *file, int line) |
|
int | mockup_lease (struct lease **lp, struct packet *packet, struct shared_network *share, struct host_decl *hp) |
|
int | allocate_lease (struct lease **lp, struct packet *packet, struct pool *pool, int *peer_has_leases) |
|
int | permitted (struct packet *packet, struct permit *permit_list) |
|
int | locate_network (struct packet *packet) |
|
void | get_server_source_address (struct in_addr *from, struct option_state *options, struct option_state *out_options, struct packet *packet) |
|
void | eval_network_statements (struct option_state **network_options, struct packet *packet, struct group *network_group) |
| Builds option set from statements at the global and network scope.
|
|
void | use_host_decl_name (struct packet *packet, struct lease *lease, struct option_state *options) |
| Adds hostname option when use-host-decl-names is enabled.
|
|
Adds a dhcp-client-id option to a set of options Given a set of input options, it searches for echo-client-id. If it is defined and enabled, the given packet is searched for dhcp-client-id. If the option is found it is replicated into the given set of output options. This allows us to provide compliance with RFC 6842. It is called when we ack or nak a lease. In the latter case we may or may not have created the requisite scope to lookup echo-client-id.
Note the flag packet.sv_echo_client_id is set to reflect the configuration option. This bypases inaccessiblity of server_universe in cons_options() which must amend the PRL (when not empty) if echoing is enabled.
- Parameters
-
packet | inbound packet received from the client |
lease | lease associated with this client (if one) |
in_options | options in which to search for echo-client-id |
out_options | options to which to save the client-id |
Definition at line 2058 of file dhcp.c.
void eval_network_statements |
( |
struct option_state ** | network_options, |
|
|
struct packet * | packet, |
|
|
struct group * | network_group ) |
Builds option set from statements at the global and network scope.
Set up an option state list based on the global and network scopes. These are primarily used by NAK logic to locate dhcp-server-id and echo-client-id.
We don't go through all possible options - in particualr we skip the hosts and we don't include the lease to avoid making changes to it. This means that using these, we won't get the correct server id if the admin puts them on hosts or builds the server id with information from the lease.
As this is a fallback function (used to handle NAKs or sort out server id mismatch in failover) and requires configuration by the admin, it should be okay.
- Parameters
-
network_options | option_state to which options will be added. If it refers to NULL, it will be allocated. Caller is responsible to delete it. |
packet | inbound packet |
network_group | scope group to use if packet->shared_network is null. |
Definition at line 5573 of file dhcp.c.
void nak_lease |
( |
struct packet * | packet, |
|
|
struct iaddr * | cip, |
|
|
struct group * | network_group ) |
Constructs and sends a DHCP Nak.
In order to populate options such as dhcp-server-id and dhcp-client-identifier, the function creates a temporary option cache and evaluates options based on the packet's shared-network or the network_group in its absence, as well as the packet->clasess (if any).
- Parameters
-
packet | inbound packet received from the client |
cip | address requested by the client |
network_group | optional scope for use in setting up options |
Definition at line 1810 of file dhcp.c.