/** DHCPDISCOVER:发现阶段(DHCP客户端在网络中广播发送DHCP DISCOVER请求报文,发现DHCP服务器,请求IP地址租约)*/
/** DHCPOFFER:提供阶段(DHCP服务器通过DHCPOFFER报文向DHCP客户端提供IP地址预分配)*/
/** DHCPREQUEST:选择阶段(DHCP客户端通过DHCPREQUEST报文确认选择第一个DHCP服务器为他提供IP地址自动分配服务)*/
/** DHCPACK:确认阶段(被选择的DHCP服务器通过DHCPACK报文把在DHCPOFFER报文中准备的IP地址租约给对应DHCP客户端)*/
//netif链表
struct netif{
/** pointer to next in linked list */
struct netif *next;
/** IP address configuration in network byte order */
struct ip_addr ip_addr;
struct ip_addr netmask;
struct ip_addr gw;
/** This function is called by the network device driver
* to pass a packet up the TCP/IP stack. */
err_t (* input)(struct pbuf *p, struct netif *inp);
/** This function is called by the IP module when it wants
* to send a packet on the interface. This function typically
* first resolves the hardware address, then sends the packet. */
err_t (* output)(struct netif *netif, struct pbuf *p,
struct ip_addr *
lwip_DHCP
最新推荐文章于 2024-05-04 14:53:27 发布