Main Page   Modules   Data Structures   File List   Data Fields   Globals   Related Pages   Examples  

XgDHCPC


Data Structures

struct  DYNCFG

Functions

int NutDhcpParse (DYNCFG *cfgp, struct bootp *bp, int len)
 Parse a DHCP reply telegram.

int NutDhcpDiscover (UDPSOCKET *sock, u_long daddr, u_short dport, struct bootp *bp, DYNCFG *cfgp)
 Broadcast a DHCP discover telegram.

int NutDhcpRequest (UDPSOCKET *sock, u_long daddr, u_short dport, struct bootp *bp, DYNCFG *cfgp)
int NutDhcpRelease (UDPSOCKET *sock, u_long daddr, u_short dport, struct bootp *bp, DYNCFG *cfgp)
int NutDhcpClientStart (NUTDEVICE *dev)
 Start DHCP Client.


Function Documentation

int NutDhcpClientStart NUTDEVICE   dev
 

Start DHCP Client.

Note:
Applications typically do not call this function. It's automatically called by NutNetIfConfig(), if the IP address parameter is set to zero.
Bug:
The client doesn't send update information to the server. To avoid loosing the assignment while Ethernut is down, addresses can be fixed in the DHCP server tables.

int NutDhcpDiscover UDPSOCKET   sock,
u_long    daddr,
u_short    dport,
struct bootp   bp,
DYNCFG *    cfgp
 

Broadcast a DHCP discover telegram.

Parameters:
sock  Socket descriptor. This pointer must have been retrieved by calling NutUdpCreateSocket().
daddr  Destination IP address, typically INADDR_BROADCAST.
dport  Destination port, typically 67.
bp  Pointer to a buffer to be used for transmission. No specific initialization required.
cfgp  Pointer to an initialized DYNCFG structure.
Returns:
0 on success, -1 if send failed.

int NutDhcpParse DYNCFG *    cfgp,
struct bootp   bp,
int    len
 

Parse a DHCP reply telegram.

Parameters:
cfgp  Pointer to config structure.
bp  Pointer to the reply telegram.
len  Number of valid bytes in the reply telegram.
Returns:
0 on success, -1 otherwise.

int NutDhcpRelease UDPSOCKET   sock,
u_long    daddr,
u_short    dport,
struct bootp   bp,
DYNCFG *    cfgp
 

Release our ip address.

int NutDhcpRequest UDPSOCKET   sock,
u_long    daddr,
u_short    dport,
struct bootp   bp,
DYNCFG *    cfgp
 

Broadcast the offered settings.

Parameters:
sock  Socket descriptor. This pointer must have been retrieved by calling NutUdpCreateSocket().
daddr  Destination IP address, typically INADDR_BROADCAST.
dport  Destination port, typically 67.
bp  Pointer to a buffer to be used for transmission.
cfgp  Pointer to an initialized DYNCFG structure.
Returns:
0 on success, -1 if send failed.


Generated on Thu Jan 30 22:31:00 2003 for EduNet by doxygen1.2.18