Go to the source code of this file.
Variables | |
int | outstanding_pings |
const int | dhcp_type_name_max = ((sizeof dhcp_type_names) / sizeof (char *)) |
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.
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.
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 |
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.
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. |
void get_server_source_address | ( | struct in_addr * | from, |
struct option_state * | options, | ||
struct option_state * | out_options, | ||
struct packet * | packet ) |
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).
packet | inbound packet received from the client |
cip | address requested by the client |
network_group | optional scope for use in setting up options |
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.
Constructs a hostname option from the name of the host declaration if there is one and no hostname has otherwise been provided and the use-host-decl-names flag is set, then adds the new option to the given option_state. This funciton is used for both bootp and dhcp.
packet | inbound packet received from the client |
lease | lease associated with the client |
options | option state to search and update |