/[lwip]/lwip/src/core/dhcp.c
ViewVC logotype

Diff of /lwip/src/core/dhcp.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.23 by likewise, Tue Apr 1 15:00:26 2003 UTC revision 1.23.2.1 by likewise, Fri Apr 11 14:01:10 2003 UTC
# Line 139  static void dhcp_option_trailer(struct d Line 139  static void dhcp_option_trailer(struct d
139  static void dhcp_handle_nak(struct netif *netif) {  static void dhcp_handle_nak(struct netif *netif) {
140    struct dhcp *dhcp = netif->dhcp;    struct dhcp *dhcp = netif->dhcp;
141    u16_t msecs = 10 * 1000;    u16_t msecs = 10 * 1000;
142    DEBUGF(DHCP_DEBUG | DBG_TRACE, ("dhcp_handle_nak()\n"));    DEBUGF(DHCP_DEBUG | DBG_TRACE | 3, ("dhcp_handle_nak(netif=%p) %c%c%u\n", netif, netif->name[0], netif->name[1], netif->num));
143    dhcp->request_timeout = (msecs + DHCP_FINE_TIMER_MSECS - 1) / DHCP_FINE_TIMER_MSECS;    dhcp->request_timeout = (msecs + DHCP_FINE_TIMER_MSECS - 1) / DHCP_FINE_TIMER_MSECS;
144    DEBUGF(DHCP_DEBUG | DBG_TRACE | DBG_STATE, ("dhcp_handle_nak(): set request timeout %u msecs\n", msecs));    DEBUGF(DHCP_DEBUG | DBG_TRACE | DBG_STATE, ("dhcp_handle_nak(): set request timeout %u msecs\n", msecs));
145    dhcp_set_state(dhcp, DHCP_BACKING_OFF);    dhcp_set_state(dhcp, DHCP_BACKING_OFF);
# Line 157  static void dhcp_check(struct netif *net Line 157  static void dhcp_check(struct netif *net
157    struct dhcp *dhcp = netif->dhcp;    struct dhcp *dhcp = netif->dhcp;
158    err_t result;    err_t result;
159    u16_t msecs;    u16_t msecs;
160    DEBUGF(DHCP_DEBUG | DBG_TRACE, ("dhcp_check()\n"));    DEBUGF(DHCP_DEBUG | DBG_TRACE | 3, ("dhcp_check(netif=%p) %c%c\n", netif, netif->name[0], netif->name[1]));
161    /* create an ARP query for the offered IP address, expecting that no host    /* create an ARP query for the offered IP address, expecting that no host
162       responds, as the IP address should not be in use. */       responds, as the IP address should not be in use. */
163    result = etharp_query(netif, &dhcp->offered_ip_addr, NULL);    result = etharp_query(netif, &dhcp->offered_ip_addr, NULL);
# Line 181  static void dhcp_handle_offer(struct net Line 181  static void dhcp_handle_offer(struct net
181    struct dhcp *dhcp = netif->dhcp;    struct dhcp *dhcp = netif->dhcp;
182    /* obtain the server address */    /* obtain the server address */
183    u8_t *option_ptr = dhcp_get_option_ptr(dhcp, DHCP_OPTION_SERVER_ID);    u8_t *option_ptr = dhcp_get_option_ptr(dhcp, DHCP_OPTION_SERVER_ID);
184      DEBUGF(DHCP_DEBUG | DBG_TRACE | 3, ("dhcp_handle_offer(netif=%p) %c%c%u\n", netif, netif->name[0], netif->name[1], netif->num));
185    if (option_ptr != NULL)    if (option_ptr != NULL)
186    {    {
187      dhcp->server_ip_addr.addr = htonl(dhcp_get_option_long(&option_ptr[2]));      dhcp->server_ip_addr.addr = htonl(dhcp_get_option_long(&option_ptr[2]));
# Line 205  static err_t dhcp_select(struct netif *n Line 206  static err_t dhcp_select(struct netif *n
206    struct dhcp *dhcp = netif->dhcp;    struct dhcp *dhcp = netif->dhcp;
207    err_t result;    err_t result;
208    u32_t msecs;    u32_t msecs;
209    DEBUGF(DHCP_DEBUG | DBG_TRACE, ("dhcp_select()\n"));    DEBUGF(DHCP_DEBUG | DBG_TRACE | 3, ("dhcp_select(netif=%p) %c%c%u\n", netif, netif->name[0], netif->name[1], netif->num));
210    
211    /* create and initialize the DHCP message header */    /* create and initialize the DHCP message header */
212    result = dhcp_create_request(netif);    result = dhcp_create_request(netif);
# Line 715  static void dhcp_bind(struct netif *neti Line 716  static void dhcp_bind(struct netif *neti
716  {  {
717    struct dhcp *dhcp = netif->dhcp;    struct dhcp *dhcp = netif->dhcp;
718    struct ip_addr sn_mask, gw_addr;    struct ip_addr sn_mask, gw_addr;
719      DEBUGF(DHCP_DEBUG | DBG_TRACE | 3, ("dhcp_bind(netif=%p) %c%c%u\n", netif, netif->name[0], netif->name[1], netif->num));
720        
721    /* temporary DHCP lease? */    /* temporary DHCP lease? */
722    if (dhcp->offered_t1_renew != 0xffffffffUL) {    if (dhcp->offered_t1_renew != 0xffffffffUL) {

Legend:
Removed from v.1.23  
changed lines
  Added in v.1.23.2.1

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26