/[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.50 by likewise, Thu Jul 22 22:10:17 2004 UTC revision 1.51 by likewise, Thu Oct 14 11:57:53 2004 UTC
# Line 85  Line 85 
85  #if LWIP_DHCP /* don't build if not configured for use in lwipopt.h */  #if LWIP_DHCP /* don't build if not configured for use in lwipopt.h */
86    
87  /** global transaction identifier, must be  /** global transaction identifier, must be
88   *  unique for each DHCP request. */   *  unique for each DHCP request. We simply increment, starting
89     *  with this value (easy to match with a packet analyzer) */
90  static u32_t xid = 0xABCD0000;  static u32_t xid = 0xABCD0000;
91    
92  /** DHCP client state machine functions */  /** DHCP client state machine functions */
# Line 805  static void dhcp_bind(struct netif *neti Line 806  static void dhcp_bind(struct netif *neti
806    netif_set_netmask(netif, &sn_mask);    netif_set_netmask(netif, &sn_mask);
807    LWIP_DEBUGF(DHCP_DEBUG | DBG_STATE, ("dhcp_bind(): GW: 0x%08lx\n", gw_addr.addr));    LWIP_DEBUGF(DHCP_DEBUG | DBG_STATE, ("dhcp_bind(): GW: 0x%08lx\n", gw_addr.addr));
808    netif_set_gw(netif, &gw_addr);    netif_set_gw(netif, &gw_addr);
809      /* bring the interface up */
810      netif_set_up(netif);
811    /* netif is now bound to DHCP leased address */    /* netif is now bound to DHCP leased address */
812    dhcp_set_state(dhcp, DHCP_BOUND);    dhcp_set_state(dhcp, DHCP_BOUND);
813  }  }
# Line 960  static err_t dhcp_release(struct netif * Line 963  static err_t dhcp_release(struct netif *
963    msecs = dhcp->tries < 10 ? dhcp->tries * 1000 : 10 * 1000;    msecs = dhcp->tries < 10 ? dhcp->tries * 1000 : 10 * 1000;
964    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;
965    LWIP_DEBUGF(DHCP_DEBUG | DBG_TRACE | DBG_STATE, ("dhcp_release(): set request timeout %u msecs\n", msecs));    LWIP_DEBUGF(DHCP_DEBUG | DBG_TRACE | DBG_STATE, ("dhcp_release(): set request timeout %u msecs\n", msecs));
966      /* bring the interface down */
967      netif_set_down(netif);
968    /* remove IP address from interface */    /* remove IP address from interface */
969    netif_set_ipaddr(netif, IP_ADDR_ANY);    netif_set_ipaddr(netif, IP_ADDR_ANY);
970    netif_set_gw(netif, IP_ADDR_ANY);    netif_set_gw(netif, IP_ADDR_ANY);
971    netif_set_netmask(netif, IP_ADDR_ANY);    netif_set_netmask(netif, IP_ADDR_ANY);
972      
973    /* TODO: netif_down(netif); */    /* TODO: netif_down(netif); */
974    return result;    return result;
975  }  }

Legend:
Removed from v.1.50  
changed lines
  Added in v.1.51

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