亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? dhcp.c

?? 包含lwip這個精簡IP協議棧的ucos源代碼.
?? C
?? 第 1 頁 / 共 4 頁
字號:
    LWIP_DEBUGF(DHCP_DEBUG | DBG_TRACE | DBG_STATE, ("dhcp_timeout(): RENEWING, DHCP request timed out\n"));    /* just retry renewal */    /* note that the rebind timer will eventually time-out if renew does not work */    dhcp_renew(netif);  /* did not get response to rebind request? */  } else if (dhcp->state == DHCP_REBINDING) {    LWIP_DEBUGF(DHCP_DEBUG | DBG_TRACE | DBG_STATE, ("dhcp_timeout(): REBINDING, DHCP request timed out\n"));    if (dhcp->tries <= 8) {      dhcp_rebind(netif);    } else {      LWIP_DEBUGF(DHCP_DEBUG | DBG_TRACE | DBG_STATE, ("dhcp_timeout(): RELEASING, DISCOVERING\n"));      dhcp_release(netif);      dhcp_discover(netif);    }  }}/** * The renewal period has timed out. * * @param netif the netif under DHCP control */static void dhcp_t1_timeout(struct netif *netif){  struct dhcp *dhcp = netif->dhcp;  LWIP_DEBUGF(DHCP_DEBUG | DBG_STATE, ("dhcp_t1_timeout()\n"));  if ((dhcp->state == DHCP_REQUESTING) || (dhcp->state == DHCP_BOUND) || (dhcp->state == DHCP_RENEWING)) {    /* just retry to renew - note that the rebind timer (t2) will     * eventually time-out if renew tries fail. */    LWIP_DEBUGF(DHCP_DEBUG | DBG_TRACE | DBG_STATE, ("dhcp_t1_timeout(): must renew\n"));    dhcp_renew(netif);  }}/** * The rebind period has timed out. * */static void dhcp_t2_timeout(struct netif *netif){  struct dhcp *dhcp = netif->dhcp;  LWIP_DEBUGF(DHCP_DEBUG | DBG_TRACE | DBG_STATE, ("dhcp_t2_timeout()\n"));  if ((dhcp->state == DHCP_REQUESTING) || (dhcp->state == DHCP_BOUND) || (dhcp->state == DHCP_RENEWING)) {    /* just retry to rebind */    LWIP_DEBUGF(DHCP_DEBUG | DBG_TRACE | DBG_STATE, ("dhcp_t2_timeout(): must rebind\n"));    dhcp_rebind(netif);  }}/** * * @param netif the netif under DHCP control */static void dhcp_handle_ack(struct netif *netif){  struct dhcp *dhcp = netif->dhcp;  u8_t *option_ptr;  /* clear options we might not get from the ACK */  dhcp->offered_sn_mask.addr = 0;  dhcp->offered_gw_addr.addr = 0;  dhcp->offered_bc_addr.addr = 0;  /* lease time given? */  option_ptr = dhcp_get_option_ptr(dhcp, DHCP_OPTION_LEASE_TIME);  if (option_ptr != NULL) {    /* remember offered lease time */    dhcp->offered_t0_lease = dhcp_get_option_long(option_ptr + 2);  }  /* renewal period given? */  option_ptr = dhcp_get_option_ptr(dhcp, DHCP_OPTION_T1);  if (option_ptr != NULL) {    /* remember given renewal period */    dhcp->offered_t1_renew = dhcp_get_option_long(option_ptr + 2);  } else {    /* calculate safe periods for renewal */    dhcp->offered_t1_renew = dhcp->offered_t0_lease / 2;  }  /* renewal period given? */  option_ptr = dhcp_get_option_ptr(dhcp, DHCP_OPTION_T2);  if (option_ptr != NULL) {    /* remember given rebind period */    dhcp->offered_t2_rebind = dhcp_get_option_long(option_ptr + 2);  } else {    /* calculate safe periods for rebinding */    dhcp->offered_t2_rebind = dhcp->offered_t0_lease;  }  /* (y)our internet address */  ip_addr_set(&dhcp->offered_ip_addr, &dhcp->msg_in->yiaddr);/** * Patch #1308 * TODO: we must check if the file field is not overloaded by DHCP options! */#if 0  /* boot server address */  ip_addr_set(&dhcp->offered_si_addr, &dhcp->msg_in->siaddr);  /* boot file name */  if (dhcp->msg_in->file[0]) {    dhcp->boot_file_name = mem_malloc(strlen(dhcp->msg_in->file) + 1);    strcpy(dhcp->boot_file_name, dhcp->msg_in->file);  }#endif  /* subnet mask */  option_ptr = dhcp_get_option_ptr(dhcp, DHCP_OPTION_SUBNET_MASK);  /* subnet mask given? */  if (option_ptr != NULL) {    dhcp->offered_sn_mask.addr = htonl(dhcp_get_option_long(&option_ptr[2]));  }  /* gateway router */  option_ptr = dhcp_get_option_ptr(dhcp, DHCP_OPTION_ROUTER);  if (option_ptr != NULL) {    dhcp->offered_gw_addr.addr = htonl(dhcp_get_option_long(&option_ptr[2]));  }  /* broadcast address */  option_ptr = dhcp_get_option_ptr(dhcp, DHCP_OPTION_BROADCAST);  if (option_ptr != NULL) {    dhcp->offered_bc_addr.addr = htonl(dhcp_get_option_long(&option_ptr[2]));  }    /* DNS servers */  option_ptr = dhcp_get_option_ptr(dhcp, DHCP_OPTION_DNS_SERVER);  if (option_ptr != NULL) {    u8_t n;    dhcp->dns_count = dhcp_get_option_byte(&option_ptr[1]);    /* limit to at most DHCP_MAX_DNS DNS servers */    if (dhcp->dns_count > DHCP_MAX_DNS) dhcp->dns_count = DHCP_MAX_DNS;    for (n = 0; n < dhcp->dns_count; n++)    {      dhcp->offered_dns_addr[n].addr = htonl(dhcp_get_option_long(&option_ptr[2+(n<<2)]));    }  }}/** * Start DHCP negotiation for a network interface. * * If no DHCP client instance was attached to this interface, * a new client is created first. If a DHCP client instance * was already present, it restarts negotiation. * * @param netif The lwIP network interface * @return lwIP error code * - ERR_OK - No error * - ERR_MEM - Out of memory * */err_t dhcp_start(struct netif *netif){  struct dhcp *dhcp = netif->dhcp;  err_t result = ERR_OK;  LWIP_ASSERT("netif != NULL", netif != NULL);  LWIP_DEBUGF(DHCP_DEBUG | DBG_TRACE | DBG_STATE, ("dhcp_start(netif=%p) %c%c%u\n", netif, netif->name[0], netif->name[1], netif->num));  netif->flags &= ~NETIF_FLAG_DHCP;  /* no DHCP client attached yet? */  if (dhcp == NULL) {    LWIP_DEBUGF(DHCP_DEBUG | DBG_TRACE, ("dhcp_start(): starting new DHCP client\n"));    dhcp = mem_malloc(sizeof(struct dhcp));    if (dhcp == NULL) {      LWIP_DEBUGF(DHCP_DEBUG | DBG_TRACE, ("dhcp_start(): could not allocate dhcp\n"));      return ERR_MEM;    }    /* store this dhcp client in the netif */    netif->dhcp = dhcp;    LWIP_DEBUGF(DHCP_DEBUG | DBG_TRACE, ("dhcp_start(): allocated dhcp"));  /* already has DHCP client attached */  } else {    LWIP_DEBUGF(DHCP_DEBUG | DBG_TRACE | DBG_STATE | 3, ("dhcp_start(): restarting DHCP configuration\n"));  }  		/* clear data structure */	memset(dhcp, 0, sizeof(struct dhcp));  /* allocate UDP PCB */	dhcp->pcb = udp_new();	if (dhcp->pcb == NULL) {	  LWIP_DEBUGF(DHCP_DEBUG  | DBG_TRACE, ("dhcp_start(): could not obtain pcb\n"));	  mem_free((void *)dhcp);	  netif->dhcp = dhcp = NULL;	  return ERR_MEM;	}	LWIP_DEBUGF(DHCP_DEBUG | DBG_TRACE, ("dhcp_start(): starting DHCP configuration\n"));  /* (re)start the DHCP negotiation */  result = dhcp_discover(netif);  if (result != ERR_OK) {    /* free resources allocated above */    dhcp_stop(netif);    return ERR_MEM;  }  netif->flags |= NETIF_FLAG_DHCP;  return result;}/** * Inform a DHCP server of our manual configuration. * * This informs DHCP servers of our fixed IP address configuration * by sending an INFORM message. It does not involve DHCP address * configuration, it is just here to be nice to the network. * * @param netif The lwIP network interface * */void dhcp_inform(struct netif *netif){  struct dhcp *dhcp;  err_t result = ERR_OK;  dhcp = mem_malloc(sizeof(struct dhcp));  if (dhcp == NULL) {    LWIP_DEBUGF(DHCP_DEBUG | DBG_TRACE | 2, ("dhcp_inform(): could not allocate dhcp\n"));    return;  }  netif->dhcp = dhcp;  memset(dhcp, 0, sizeof(struct dhcp));  LWIP_DEBUGF(DHCP_DEBUG | DBG_TRACE, ("dhcp_inform(): allocated dhcp\n"));  dhcp->pcb = udp_new();  if (dhcp->pcb == NULL) {    LWIP_DEBUGF(DHCP_DEBUG | DBG_TRACE | 2, ("dhcp_inform(): could not obtain pcb"));    mem_free((void *)dhcp);    return;  }  LWIP_DEBUGF(DHCP_DEBUG | DBG_TRACE, ("dhcp_inform(): created new udp pcb\n"));  /* create and initialize the DHCP message header */  result = dhcp_create_request(netif);  if (result == ERR_OK) {    dhcp_option(dhcp, DHCP_OPTION_MESSAGE_TYPE, DHCP_OPTION_MESSAGE_TYPE_LEN);    dhcp_option_byte(dhcp, DHCP_INFORM);    dhcp_option(dhcp, DHCP_OPTION_MAX_MSG_SIZE, DHCP_OPTION_MAX_MSG_SIZE_LEN);    /* TODO: use netif->mtu ?! */    dhcp_option_short(dhcp, 576);    dhcp_option_trailer(dhcp);    pbuf_realloc(dhcp->p_out, sizeof(struct dhcp_msg) - DHCP_OPTIONS_LEN + dhcp->options_out_len);    udp_bind(dhcp->pcb, IP_ADDR_ANY, DHCP_CLIENT_PORT);    udp_connect(dhcp->pcb, IP_ADDR_BROADCAST, DHCP_SERVER_PORT);    LWIP_DEBUGF(DHCP_DEBUG | DBG_TRACE | DBG_STATE, ("dhcp_inform: INFORMING\n"));    udp_send(dhcp->pcb, dhcp->p_out);    udp_connect(dhcp->pcb, IP_ADDR_ANY, DHCP_SERVER_PORT);    dhcp_delete_request(netif);  } else {    LWIP_DEBUGF(DHCP_DEBUG | DBG_TRACE | 2, ("dhcp_inform: could not allocate DHCP request\n"));  }  if (dhcp != NULL)  {    if (dhcp->pcb != NULL) udp_remove(dhcp->pcb);    dhcp->pcb = NULL;    mem_free((void *)dhcp);    netif->dhcp = NULL;  }}#if DHCP_DOES_ARP_CHECK/** * Match an ARP reply with the offered IP address. * * @param addr The IP address we received a reply from * */void dhcp_arp_reply(struct netif *netif, struct ip_addr *addr){  LWIP_ASSERT("netif != NULL", netif != NULL);  LWIP_DEBUGF(DHCP_DEBUG | DBG_TRACE | 3, ("dhcp_arp_reply()\n"));  /* is a DHCP client doing an ARP check? */  if ((netif->dhcp != NULL) && (netif->dhcp->state == DHCP_CHECKING)) {    LWIP_DEBUGF(DHCP_DEBUG | DBG_TRACE | DBG_STATE, ("dhcp_arp_reply(): CHECKING, arp reply for 0x%08lx\n", addr->addr));    /* did a host respond with the address we       were offered by the DHCP server? */    if (ip_addr_cmp(addr, &netif->dhcp->offered_ip_addr)) {      /* we will not accept the offered address */      LWIP_DEBUGF(DHCP_DEBUG | DBG_TRACE | DBG_STATE | 1, ("dhcp_arp_reply(): arp reply matched with offered address, declining\n"));      dhcp_decline(netif);    }  }}/** * Decline an offered lease. * * Tell the DHCP server we do not accept the offered address. * One reason to decline the lease is when we find out the address * is already in use by another host (through ARP). */static err_t dhcp_decline(struct netif *netif){  struct dhcp *dhcp = netif->dhcp;  err_t result = ERR_OK;  u16_t msecs;  LWIP_DEBUGF(DHCP_DEBUG | DBG_TRACE | 3, ("dhcp_decline()\n"));  dhcp_set_state(dhcp, DHCP_BACKING_OFF);  /* create and initialize the DHCP message header */  result = dhcp_create_request(netif);  if (result == ERR_OK)  {    dhcp_option(dhcp, DHCP_OPTION_MESSAGE_TYPE, DHCP_OPTION_MESSAGE_TYPE_LEN);    dhcp_option_byte(dhcp, DHCP_DECLINE);    dhcp_option(dhcp, DHCP_OPTION_MAX_MSG_SIZE, DHCP_OPTION_MAX_MSG_SIZE_LEN);    dhcp_option_short(dhcp, 576);    dhcp_option(dhcp, DHCP_OPTION_REQUESTED_IP, 4);    dhcp_option_long(dhcp, ntohl(dhcp->offered_ip_addr.addr));    dhcp_option_trailer(dhcp);    /* resize pbuf to reflect true size of options */    pbuf_realloc(dhcp->p_out, sizeof(struct dhcp_msg) - DHCP_OPTIONS_LEN + dhcp->options_out_len);    udp_bind(dhcp->pcb, IP_ADDR_ANY, DHCP_CLIENT_PORT);    /* @todo: should we really connect here? we are performing sendto() */    udp_connect(dhcp->pcb, IP_ADDR_ANY, DHCP_SERVER_PORT);    /* per section 4.4.4, broadcast DECLINE messages */    udp_sendto(dhcp->pcb, dhcp->p_out, IP_ADDR_BROADCAST, DHCP_SERVER_PORT);    dhcp_delete_request(netif);    LWIP_DEBUGF(DHCP_DEBUG | DBG_TRACE | DBG_STATE, ("dhcp_decline: BACKING OFF\n"));  } else {    LWIP_DEBUGF(DHCP_DEBUG | DBG_TRACE | 2, ("dhcp_decline: could not allocate DHCP request\n"));  }  dhcp->tries++;  msecs = 10*1000;  dhcp->request_timeout = (msecs + DHCP_FINE_TIMER_MSECS - 1) / DHCP_FINE_TIMER_MSECS;   LWIP_DEBUGF(DHCP_DEBUG | DBG_TRACE, ("dhcp_decline(): set request timeout %u msecs\n", msecs));  return result;}#endif/** * Start the DHCP process, discover a DHCP server. * */static err_t dhcp_discover(struct netif *netif){  struct dhcp *dhcp = netif->dhcp;  err_t result = ERR_OK;  u16_t msecs;  LWIP_DEBUGF(DHCP_DEBUG | DBG_TRACE | 3, ("dhcp_discover()\n"));  ip_addr_set(&dhcp->offered_ip_addr, IP_ADDR_ANY);  /* create and initialize the DHCP message header */  result = dhcp_create_request(netif);  if (result == ERR_OK)  {    LWIP_DEBUGF(DHCP_DEBUG | DBG_TRACE, ("dhcp_discover: making request\n"));    dhcp_option(dhcp, DHCP_OPTION_MESSAGE_TYPE, DHCP_OPTION_MESSAGE_TYPE_LEN);    dhcp_option_byte(dhcp, DHCP_DISCOVER);    dhcp_option(dhcp, DHCP_OPTION_MAX_MSG_SIZE, DHCP_OPTION_MAX_MSG_SIZE_LEN);    dhcp_option_short(dhcp, 576);    dhcp_option(dhcp, DHCP_OPTION_PARAMETER_REQUEST_LIST, 4/*num options*/);    dhcp_option_byte(dhcp, DHCP_OPTION_SUBNET_MASK);    dhcp_option_byte(dhcp, DHCP_OPTION_ROUTER);    dhcp_option_byte(dhcp, DHCP_OPTION_BROADCAST);    dhcp_option_byte(dhcp, DHCP_OPTION_DNS_SERVER);

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美激情中文不卡| 91精品国模一区二区三区| 国产精品三级久久久久三级| 国产精品99久久久久久有的能看| 亚洲精品一区二区在线观看| 国产精品综合在线视频| 国产精品久久久一本精品| 91蜜桃网址入口| 亚洲午夜激情网站| 精品国产乱码久久久久久牛牛| 国产传媒一区在线| 日韩久久一区二区| 51午夜精品国产| 国产在线国偷精品免费看| 国产精品久久久久久户外露出 | 国产精品久久久一本精品 | 色综合久久综合| 午夜精品久久久久久| 久久久亚洲高清| 97精品电影院| 日韩有码一区二区三区| 久久精品人人做| 欧美一区二区视频观看视频| 狠狠色丁香久久婷婷综合_中| 国产日产欧产精品推荐色| 91麻豆国产香蕉久久精品| 美女一区二区视频| 最新国产の精品合集bt伙计| 555夜色666亚洲国产免| 高清国产一区二区| 午夜不卡av免费| 欧美国产成人精品| 91精品国产色综合久久不卡蜜臀| 高清日韩电视剧大全免费| 午夜激情综合网| 中文字幕第一区第二区| 91精品国产91久久久久久最新毛片| 成人免费观看男女羞羞视频| 日韩精彩视频在线观看| 亚洲人成影院在线观看| 精品国产一区二区三区av性色| 91在线观看成人| 国产精品一区二区免费不卡 | 国产精品久久久久久亚洲伦 | 国产欧美精品国产国产专区| 欧美福利视频一区| 色婷婷av一区| 成人黄色小视频在线观看| 青青草原综合久久大伊人精品优势| 亚洲欧洲国产日韩| 国产清纯美女被跳蛋高潮一区二区久久w| 欧美调教femdomvk| 成人av免费在线播放| 免费精品视频在线| 五月婷婷色综合| 亚洲视频电影在线| 中文字幕成人av| wwwwww.欧美系列| 91精品国产综合久久久久| 欧美视频在线一区二区三区 | 国产专区欧美精品| 奇米色一区二区| 亚洲bdsm女犯bdsm网站| 亚洲激情中文1区| 国产精品人成在线观看免费| 精品播放一区二区| 日韩欧美123| 欧美一区二区久久久| 91.com视频| 91麻豆精品国产91久久久使用方法| 一区二区三区国产豹纹内裤在线| 国产精品123区| 国产一区中文字幕| 蜜臀久久久99精品久久久久久| 亚洲国产综合视频在线观看| 亚洲欧美日韩人成在线播放| 亚洲丝袜精品丝袜在线| 中文字幕中文字幕一区二区| 亚洲国产精品精华液2区45| 日本一区二区免费在线观看视频| 久久久久久久久蜜桃| 欧美精品一区二区三区四区| 久久亚洲综合av| 久久久高清一区二区三区| 欧美精品一区二区久久久| 26uuu亚洲综合色欧美 | 在线观看日韩毛片| 欧美性受xxxx| 91精品午夜视频| 欧美刺激脚交jootjob| 亚洲精品在线电影| 国产精品午夜久久| 一区二区三区不卡视频在线观看| 亚洲欧洲日韩综合一区二区| 亚洲综合在线第一页| 亚洲h精品动漫在线观看| 日本在线不卡视频| 国产最新精品精品你懂的| 成人午夜在线播放| 在线视频你懂得一区二区三区| 欧美高清激情brazzers| 久久影院电视剧免费观看| 欧美国产日韩在线观看| 伊人色综合久久天天人手人婷| 五月综合激情网| 激情综合网天天干| 91影视在线播放| 欧美精品色一区二区三区| www成人在线观看| 亚洲精品成人在线| 老司机精品视频线观看86| 国产九色精品成人porny| 一本大道久久a久久精二百 | 久久久综合精品| 亚洲欧美激情插| 久久国产成人午夜av影院| www.成人在线| 91麻豆精品久久久久蜜臀| 国产精品私房写真福利视频| 亚洲一区二区三区四区在线观看 | 蜜臀av性久久久久蜜臀av麻豆| 福利电影一区二区| 欧美日韩免费观看一区二区三区| 欧美精品一区二区高清在线观看| 一区二区三区中文字幕电影| 国产一区欧美一区| 欧美三级电影一区| 国产精品久久毛片av大全日韩| 日韩精品色哟哟| 99久久久国产精品免费蜜臀| 精品国产免费一区二区三区四区 | 国产精品婷婷午夜在线观看| 日韩国产精品久久久| 成人不卡免费av| 欧美videos大乳护士334| 亚洲成人av电影| 99久久婷婷国产综合精品电影| 精品免费视频一区二区| 亚洲电影第三页| av在线不卡电影| 久久综合色之久久综合| 午夜欧美一区二区三区在线播放| 97超碰欧美中文字幕| 久久精品视频一区二区三区| 奇米精品一区二区三区在线观看| 欧美午夜电影在线播放| 亚洲日本一区二区| 成熟亚洲日本毛茸茸凸凹| 久久久精品欧美丰满| 蜜桃av一区二区三区电影| 欧美在线啊v一区| 最新国产成人在线观看| 成人av在线资源| 久久久久久电影| 国产美女精品在线| 久久综合久久99| 韩国av一区二区三区四区| 884aa四虎影成人精品一区| 午夜精品久久久久久| 欧美猛男超大videosgay| 樱花影视一区二区| 91精品办公室少妇高潮对白| 自拍偷拍亚洲欧美日韩| av中文字幕一区| 国产精品另类一区| 成+人+亚洲+综合天堂| 日本一二三不卡| 99精品热视频| 亚洲免费视频中文字幕| 91免费版在线| 亚洲一卡二卡三卡四卡五卡| 欧美日韩激情一区二区三区| 午夜精品一区在线观看| 欧美日韩成人一区| 美女精品一区二区| 久久久国产综合精品女国产盗摄| 国产一区日韩二区欧美三区| 久久精品男人天堂av| 国产+成+人+亚洲欧洲自线| 国产精品久久网站| 91网站在线播放| 亚洲成人免费视频| 日韩欧美一级片| 国产酒店精品激情| 一区精品在线播放| 欧美日韩一区成人| 久久99九九99精品| 国产精品久线在线观看| 在线国产亚洲欧美| 美女网站一区二区| 国产日本一区二区| 91久久国产综合久久| 蜜臀久久99精品久久久久宅男| 久久你懂得1024| 91蜜桃婷婷狠狠久久综合9色| 三级影片在线观看欧美日韩一区二区| 日韩欧美电影一二三| 高清久久久久久| 夜夜亚洲天天久久| 精品久久久久久无|