DHCP Client Invocation and Control


Modules

 IPv4 DHCP Client Control and Configuration
 IPv6 DHCP Client Control and Configuration

Data Structures

struct  dhcpc_nic_s
struct  dhcp_nic

Typedefs

typedef dhcpc_nic_s DHCP_config
typedef dhcp_nic DHCP_nic

Enumerations

enum  DHCP_Preference {
  DHCPv4_DISABLE = 1, DHCPv6_DISABLE = 2, IPv6_PREFERENCE = 4, DHCPv4_DISABLE_ADDRESSES = 8,
  DHCPv4_DISABLE_ROUTES = 16, DHCPv4_DISABLE_RESOLVER = 32, DHCPv6_DISABLE_ADDRESSES = 64, DHCPv6_DISABLE_RESOLVER = 128,
  DHCPv4_DISABLE_HOSTNAME_SET = 256, DHCP_ACCEPT_FIRST_LEASE = 512
}

Functions

DHCP_nicdhcp_nic (NLH_t nh, DHCP_Preference preference, char *eth_if_name, LIBDHCP_Capability dhc_cap, time_t timeout, LIBDHCP_Error_Handler error_handler, uint8_t log_level,...)
NIC_Res_t dhcp_nic_configure (DHCP_nic *dhcp_nic)
void dhcp_nic_free (DHCP_nic *)
NIC_Res_t do_dhcp (DHCP_Preference preference, char *eth_if_name, LIBDHCP_Capability dhc_cap, time_t timeout, LIBDHCP_Error_Handler error_handler, uint8_t log_level,...)

Detailed Description

Network Interface Configurator for BOTH the ISC DHCP IPv4 client library and the DHCPv6 IPv6 client library.

Typedef Documentation

typedef struct dhcpc_nic_s DHCP_config

DHCP_config: The DHCP network interface configuration structure.

This structure encapsulates the network configuration information returned in a DHCP lease, and the lease itself.

typedef struct dhcp_nic DHCP_nic

DHCP_nic: The DHCP network interface control structure.

This structure encapsulates the control and configuration of both DHCP clients.


Enumeration Type Documentation

enum DHCP_Preference

The DHCP_Preference enumeration.

Controls which clients are to be run, and which configuration actions are to be enabled on receipt of a lease.

Enumerator:
DHCPv4_DISABLE  disables the DHCPv4 client
DHCPv6_DISABLE  disabled the DHCPv6 client
IPv6_PREFERENCE  If neither DHCPv4_DISABLE nor DHCPv6_DISABLE are enabled, setting this will run the DHCPv6 client first, and configure IPv6 addresses / routes / DNS first
DHCPv4_DISABLE_ADDRESSES  Don't configure DHCPv4 addresses
DHCPv4_DISABLE_ROUTES  Don't configure DHCPv4 routes
DHCPv4_DISABLE_RESOLVER  Don't configure DHCPv4 resolv.conf entries
DHCPv6_DISABLE_ADDRESSES  Don't configure DHCPv6 address (ie. use radvd)
DHCPv6_DISABLE_RESOLVER  Don't configure DHCPv6 resolv.conf entries
DHCPv4_DISABLE_HOSTNAME_SET  Don't set hostname if DHCPv4 host-name option sent
DHCP_ACCEPT_FIRST_LEASE  If timeout == 0, and both clients are enabled, v4 and v6 clients are run in separate processes; if this preference is set, then the first client to get a lease will cause that lease to be accepted and the other client process to be terminated.

Definition at line 42 of file dhcp_nic.h.


Function Documentation

DHCP_nic* dhcp_nic ( NLH_t  nh,
DHCP_Preference  preference,
char *  eth_if_name,
LIBDHCP_Capability  dhc_cap,
time_t  timeout,
LIBDHCP_Error_Handler  error_handler,
uint8_t  log_level,
  ... 
)

dhcp_nic() : function which invokes the DHCP clients and returns a network interface configuration.

Parameters:
nh  nic library handle - see Network Interface Configurator
preference  DHCP_Preference -
See also:
DHCP_Preference
eth_if_name  network interface name - eg. 'eth0'
dhc_cap  DHCP_Capability -
See also:
DHCP_Capability
timeout  timeout -
See also:
LIBDHCP_Control::timeout
error_handler  error handler -
See also:
LIBDHCP_Control::error_handler
log_level  log level -
See also:
LIBDHCP_Control::log_level

Definition at line 410 of file dhcp_nic.c.

NIC_Res_t dhcp_nic_configure ( DHCP_nic dhcp_nic  ) 

dhcp_nic_configure () : function to apply the DHCP configuration to the network interface .

Parameters:
dhcp_nic 
See also:
DHCP_nic

Definition at line 517 of file dhcp_nic.c.

References nic_ip_address_list_node_s::addr, dhcp_nic::dhc6ctl, dhcp_nic::dhcpv4, dhcp_nic::dhcpv6, DHCPv6_DISABLE_RESOLVER, dhcpc_nic_s::dns_list, IPaddr_list_t, NIC_FAIL, dhcp_nic::preference, and dhcpc_nic_s::search_list.

Referenced by do_dhcp().

void dhcp_nic_free ( DHCP_nic  ) 

function dhcp_nic_free() : frees all resources associated with the DHCP_nic structure

Definition at line 439 of file dhcp_nic.c.

References dhcp_nic::dhc4ctl, dhcp_nic::dhc6ctl, dhcpv4_control_free(), dhcp_nic::dhcpv6, dhcpv6_nic_free(), dhcp_nic::nh, and nic_close().

Referenced by do_dhcp().

NIC_Res_t do_dhcp ( DHCP_Preference  preference,
char *  eth_if_name,
LIBDHCP_Capability  dhc_cap,
time_t  timeout,
LIBDHCP_Error_Handler  error_handler,
uint8_t  log_level,
  ... 
)

do_dhcp(): function to run the clients and apply the DHCP configuration to the network interface

Parameters:
preference  DHCP_Preference -
See also:
DHCP_Preference
eth_if_name  interface name
dhc_cap  DHCP_Capability -
See also:
DHCP_Capability
timeout  timeout -
See also:
LIBDHCP_Control::timeout
error_handler  error_handler
See also:
LIBDHCP_Control::error_handler
log_level  log_level -
See also:
LIBDHCP_Control::log_level

Definition at line 462 of file dhcp_nic.c.

References dhcp_nic_configure(), dhcp_nic_free(), LOG_FATAL, nic_close(), NIC_FAIL, and nic_open().


Generated on Thu Aug 10 22:16:41 2006 for libdhcp by  doxygen 1.4.7