DHCP
[TCP/IP Stack from Microchip Version 4.50 (Modified)]


Detailed Description

Dynamic Host Configuration Protocol (DHCP) is a protocol used by networked devices (clients) to obtain various parameters necessary for the clients to operate in an Internet Protocol (IP) network.

By using this protocol, system administration workload greatly decreases, and devices can be added to the network with minimal or no manual configurations (Source: Wikipedia).


Files

file  DHCP.c
 Dynamic Host Configuration Protocol (DHCP) Client Module for Microchip TCP/IP Stack.
file  DHCP.h
 DHCP Defs for Microchip TCP/IP Stack.

Defines

#define DHCPIsBound()   (DHCPFlags.bits.bIsBound)
 Determines if the DHCP server is currently bound.

Functions

void DHCPReset (void)
 Resets the DHCP Client.
void DHCPTask (void)
 Performs periodic DHCP tasks.
void DHCPDisable (void)
 Disables the DHCP client.
void DHCPEnable (void)
 Enables the DHCP client.
BOOL DHCPHasBoundStateChanged (void)
 This function checks whether the internal address bound state of thze DHCP client has changed.
void DHCPGetIPParameterFromServer (IPConfig_t *pIPConfig)
 If DHCP client is bound this function fills the given IP structure with the current IP parameters obtained from DHCP server.
BOOL DHCPIsEnabled (void)
 This function returns the enable state of the DHCP client.
BOOL DHCPHasFailed (void)
 This function returns the failed state of the DHCP client.


Define Documentation

 
#define DHCPIsBound (  )     (DHCPFlags.bits.bIsBound)

Determines if the DHCP server is currently bound.

Return values:
TRUE DHCP is bound to given configuration.
FALSE DHCP has not yet been bound.
Remarks:
This function is a MACRO to DHCPFlags.bits.bIsBound.


Function Documentation

void DHCPDisable ( void   ) 

Disables the DHCP client.

Disables the DHCP client by sending the state machine to "SM_DHCP_DISABLED". If the board was previously configured by DHCP, the configuration will continue to be used but the module will no longer preform any renewals.

Precondition:
None
Returns:
None
Remarks:
Since the board continues using its old configuration, it is possible that the lease may expire and the DHCP server provide the IP to another client. The application should replace the current IP address and other configuration with static information following a call to this function.

void DHCPEnable ( void   ) 

Enables the DHCP client.

Enables the DHCP client if it is disabled. If it is already enabled, nothing is done.

Precondition:
None
Returns:
None

void DHCPGetIPParameterFromServer ( IPConfig_t pIPConfig  ) 

If DHCP client is bound this function fills the given IP structure with the current IP parameters obtained from DHCP server.

Those parameters which are not obtained by server stay zero. If the client is not bound then the structure is cleared only.

Parameters:
pIPConfig Pointer to IP structure field.

BOOL DHCPHasBoundStateChanged ( void   ) 

This function checks whether the internal address bound state of thze DHCP client has changed.

The bound state change is a semaphore and clears automatically with this function call (if set).

Return values:
TRUE State has changed (either got an IP address or lost the current IP due elapsed lease time. Check DHCPIsBound for more details.
FALSE State has not changed since last call.

BOOL DHCPHasFailed ( void   ) 

This function returns the failed state of the DHCP client.

Return values:
TRUE Obtaining has failed for the first time - client tries later automatically.
FALSE The client has successfully obtained IP data or obtianing is currently in progress.

BOOL DHCPIsEnabled ( void   ) 

This function returns the enable state of the DHCP client.

Return values:
TRUE The client is enabled.
FALSE The client is disabled.

void DHCPReset ( void   ) 

Resets the DHCP Client.

Resets the DHCP Client, giving up any current lease, knowledge of DHCP servers, etc.

Precondition:
None
Returns:
None

void DHCPTask ( void   ) 

Performs periodic DHCP tasks.

This function performs any periodic tasks requied by the DHCP module, such as sending and receiving messages involved with obtaining and maintaining a lease.

Precondition:
None
Returns:
None
MODIFIX: Added AutoIP support.

Todo:
Save the probed auto IP-Address in EEPROM


Generated on Fri Mar 29 10:34:28 2013 for Netzer by  doxygen 1.5.5