ISC DHCP  4.3.0
A reference DHCPv4 and DHCPv6 implementation
dhcp.c File Reference
#include "dhcpd.h"
#include <errno.h>
#include <limits.h>
#include <sys/time.h>
#include "trace.h"

Go to the source code of this file.

Functions

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)
 
void ack_lease (struct packet *packet, struct lease *lease, unsigned int offer, TIME when, char *msg, int ms_nulltp, struct host_decl *hp)
 
void delayed_ack_enqueue (struct lease *lease)
 
void flush_ackqueue (void *foo)
 
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 setup_server_source_address (struct in_addr *from, struct option_state *options, struct packet *packet)
 

Variables

int outstanding_pings
 
struct leasequeueackqueue_head
 
struct leasequeueackqueue_tail
 
int outstanding_acks
 
int max_outstanding_acks = DEFAULT_DELAYED_ACK
 
int max_ack_delay_secs = DEFAULT_ACK_DELAY_SECS
 
int max_ack_delay_usecs = DEFAULT_ACK_DELAY_USECS
 
int min_ack_delay_usecs = DEFAULT_MIN_ACK_DELAY_USECS
 
const int dhcp_type_name_max = ((sizeof dhcp_type_names) / sizeof (char *))
 

Function Documentation

◆ ack_lease()

void ack_lease ( struct packet packet,
struct lease lease,
unsigned int  offer,
TIME  when,
char *  msg,
int  ms_nulltp,
struct host_decl hp 
)

Definition at line 1792 of file dhcp.c.

◆ allocate_lease()

int allocate_lease ( struct lease **  lp,
struct packet packet,
struct pool pool,
int peer_has_leases 
)

Definition at line 4453 of file dhcp.c.

◆ delayed_ack_enqueue()

void delayed_ack_enqueue ( struct lease lease)

Definition at line 3282 of file dhcp.c.

◆ dhcp()

void dhcp ( struct packet packet)

Definition at line 114 of file dhcp.c.

◆ dhcp_reply()

void dhcp_reply ( struct lease lease)

Definition at line 3404 of file dhcp.c.

◆ dhcpdecline()

void dhcpdecline ( struct packet packet,
int  ms_nulltp 
)

Definition at line 879 of file dhcp.c.

◆ dhcpdiscover()

void dhcpdiscover ( struct packet packet,
int  ms_nulltp 
)

Definition at line 293 of file dhcp.c.

◆ dhcpinform()

void dhcpinform ( struct packet packet,
int  ms_nulltp 
)

Definition at line 1006 of file dhcp.c.

◆ dhcprelease()

void dhcprelease ( struct packet packet,
int  ms_nulltp 
)

Definition at line 743 of file dhcp.c.

◆ dhcprequest()

void dhcprequest ( struct packet packet,
int  ms_nulltp,
struct lease ip_lease 
)

Definition at line 434 of file dhcp.c.

◆ find_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 
)

Definition at line 3649 of file dhcp.c.

◆ flush_ackqueue()

void flush_ackqueue ( void *  foo)

Definition at line 3364 of file dhcp.c.

◆ get_server_source_address()

void get_server_source_address ( struct in_addr *  from,
struct option_state options,
struct option_state out_options,
struct packet packet 
)

Definition at line 4784 of file dhcp.c.

◆ locate_network()

int locate_network ( struct packet packet)

Definition at line 4669 of file dhcp.c.

◆ mockup_lease()

int mockup_lease ( struct lease **  lp,
struct packet packet,
struct shared_network share,
struct host_decl hp 
)

Definition at line 4403 of file dhcp.c.

◆ nak_lease()

void nak_lease ( struct packet packet,
struct iaddr cip 
)

Definition at line 1609 of file dhcp.c.

◆ permitted()

int permitted ( struct packet packet,
struct permit permit_list 
)

Definition at line 4610 of file dhcp.c.

◆ print_client_identifier_from_packet()

char* print_client_identifier_from_packet ( struct packet packet)

Definition at line 77 of file dhcp.c.

◆ print_hw_addr_or_client_id()

char* print_hw_addr_or_client_id ( struct packet packet)

Definition at line 102 of file dhcp.c.

◆ setup_server_source_address()

void setup_server_source_address ( struct in_addr *  from,
struct option_state options,
struct packet packet 
)

Definition at line 4862 of file dhcp.c.

Variable Documentation

◆ ackqueue_head

struct leasequeue* ackqueue_head

Definition at line 40 of file dhcp.c.

◆ ackqueue_tail

struct leasequeue * ackqueue_tail

Definition at line 40 of file dhcp.c.

◆ dhcp_type_name_max

const int dhcp_type_name_max = ((sizeof dhcp_type_names) / sizeof (char *))

Definition at line 71 of file dhcp.c.

◆ max_ack_delay_secs

int max_ack_delay_secs = DEFAULT_ACK_DELAY_SECS

Definition at line 46 of file dhcp.c.

◆ max_ack_delay_usecs

int max_ack_delay_usecs = DEFAULT_ACK_DELAY_USECS

Definition at line 47 of file dhcp.c.

◆ max_outstanding_acks

int max_outstanding_acks = DEFAULT_DELAYED_ACK

Definition at line 45 of file dhcp.c.

◆ min_ack_delay_usecs

int min_ack_delay_usecs = DEFAULT_MIN_ACK_DELAY_USECS

Definition at line 48 of file dhcp.c.

◆ outstanding_acks

int outstanding_acks

Definition at line 44 of file dhcp.c.

◆ outstanding_pings

int outstanding_pings

Definition at line 38 of file dhcp.c.