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

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

?? netif.c

?? FreeRtos Source code Version 4.04
?? C
字號:
/** * @file * * lwIP network interface abstraction *//* * Copyright (c) 2001-2004 Swedish Institute of Computer Science. * All rights reserved. * * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain the above copyright notice, *    this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright notice, *    this list of conditions and the following disclaimer in the documentation *    and/or other materials provided with the distribution. * 3. The name of the author may not be used to endorse or promote products *    derived from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY * OF SUCH DAMAGE. * * This file is part of the lwIP TCP/IP stack. * * Author: Adam Dunkels <adam@sics.se> * */#include "lwip/opt.h"#include "lwip/def.h"#include "lwip/ip_addr.h"#include "lwip/netif.h"#include "lwip/tcp.h"struct netif *netif_list = NULL;struct netif *netif_default = NULL;/** * Add a network interface to the list of lwIP netifs. * * @param netif a pre-allocated netif structure * @param ipaddr IP address for the new netif * @param netmask network mask for the new netif * @param gw default gateway IP address for the new netif * @param state opaque data passed to the new netif * @param init callback function that initializes the interface * @param input callback function that is called to pass * ingress packets up in the protocol layer stack. * * @return netif, or NULL if failed. */struct netif *netif_add(struct netif *netif, struct ip_addr *ipaddr, struct ip_addr *netmask,  struct ip_addr *gw,  void *state,  err_t (* init)(struct netif *netif),  err_t (* input)(struct pbuf *p, struct netif *netif)){  static int netifnum = 0;  #if LWIP_DHCP  /* netif not under DHCP control by default */  netif->dhcp = NULL;#endif  /* remember netif specific state information data */  netif->state = state;  netif->num = netifnum++;  netif->input = input;  netif_set_addr(netif, ipaddr, netmask, gw);  /* call user specified initialization function for netif */  if (init(netif) != ERR_OK) {    return NULL;  }  /* add this netif to the list */  netif->next = netif_list;  netif_list = netif;  LWIP_DEBUGF(NETIF_DEBUG, ("netif: added interface %c%c IP addr ",    netif->name[0], netif->name[1]));  ip_addr_debug_print(NETIF_DEBUG, ipaddr);  LWIP_DEBUGF(NETIF_DEBUG, (" netmask "));  ip_addr_debug_print(NETIF_DEBUG, netmask);  LWIP_DEBUGF(NETIF_DEBUG, (" gw "));  ip_addr_debug_print(NETIF_DEBUG, gw);  LWIP_DEBUGF(NETIF_DEBUG, ("\n"));  return netif;}voidnetif_set_addr(struct netif *netif,struct ip_addr *ipaddr, struct ip_addr *netmask,    struct ip_addr *gw){  netif_set_ipaddr(netif, ipaddr);  netif_set_netmask(netif, netmask);  netif_set_gw(netif, gw);}void netif_remove(struct netif * netif){  if ( netif == NULL ) return;  /*  is it the first netif? */  if (netif_list == netif) {    netif_list = netif->next;  }  else {    /*  look for netif further down the list */    struct netif * tmpNetif;    for (tmpNetif = netif_list; tmpNetif != NULL; tmpNetif = tmpNetif->next) {      if (tmpNetif->next == netif) {        tmpNetif->next = netif->next;        break;        }    }    if (tmpNetif == NULL)      return; /*  we didn't find any netif today */  }  /* this netif is default? */  if (netif_default == netif)    /* reset default netif */    netif_default = NULL;  LWIP_DEBUGF( NETIF_DEBUG, ("netif_remove: removed netif\n") );}struct netif *netif_find(char *name){  struct netif *netif;  u8_t num;  if (name == NULL) {    return NULL;  }  num = name[2] - '0';  for(netif = netif_list; netif != NULL; netif = netif->next) {    if (num == netif->num &&       name[0] == netif->name[0] &&       name[1] == netif->name[1]) {      LWIP_DEBUGF(NETIF_DEBUG, ("netif_find: found %c%c\n", name[0], name[1]));      return netif;    }  }  LWIP_DEBUGF(NETIF_DEBUG, ("netif_find: didn't find %c%c\n", name[0], name[1]));  return NULL;}voidnetif_set_ipaddr(struct netif *netif, struct ip_addr *ipaddr){  /* TODO: Handling of obsolete pcbs */  /* See:  http://mail.gnu.org/archive/html/lwip-users/2003-03/msg00118.html */#if LWIP_TCP  struct tcp_pcb *pcb;  struct tcp_pcb_listen *lpcb;  /* address is actually being changed? */  if ((ip_addr_cmp(ipaddr, &(netif->ip_addr))) == 0)  {    /* extern struct tcp_pcb *tcp_active_pcbs; defined by tcp.h */    LWIP_DEBUGF(NETIF_DEBUG | 1, ("netif_set_ipaddr: netif address being changed\n"));    pcb = tcp_active_pcbs;    while (pcb != NULL) {      /* PCB bound to current local interface address? */      if (ip_addr_cmp(&(pcb->local_ip), &(netif->ip_addr))) {        /* this connection must be aborted */        struct tcp_pcb *next = pcb->next;        LWIP_DEBUGF(NETIF_DEBUG | 1, ("netif_set_ipaddr: aborting TCP pcb %p\n", (void *)pcb));        tcp_abort(pcb);        pcb = next;      } else {        pcb = pcb->next;      }    }    for (lpcb = tcp_listen_pcbs.listen_pcbs; lpcb != NULL; lpcb = lpcb->next) {      /* PCB bound to current local interface address? */      if (ip_addr_cmp(&(lpcb->local_ip), &(netif->ip_addr))) {        /* The PCB is listening to the old ipaddr and         * is set to listen to the new one instead */        ip_addr_set(&(lpcb->local_ip), ipaddr);      }    }  }#endif  ip_addr_set(&(netif->ip_addr), ipaddr);#if 0 /* only allowed for Ethernet interfaces TODO: how can we check? */  /** For Ethernet network interfaces, we would like to send a   *  "gratuitous ARP"; this is an ARP packet sent by a node in order   *  to spontaneously cause other nodes to update an entry in their   *  ARP cache. From RFC 3220 "IP Mobility Support for IPv4" section 4.6.   */   etharp_query(netif, ipaddr, NULL);#endif  LWIP_DEBUGF(NETIF_DEBUG | DBG_TRACE | DBG_STATE | 3, ("netif: IP address of interface %c%c set to %u.%u.%u.%u\n",    netif->name[0], netif->name[1],    ip4_addr1(&netif->ip_addr),    ip4_addr2(&netif->ip_addr),    ip4_addr3(&netif->ip_addr),    ip4_addr4(&netif->ip_addr)));}voidnetif_set_gw(struct netif *netif, struct ip_addr *gw){  ip_addr_set(&(netif->gw), gw);  LWIP_DEBUGF(NETIF_DEBUG | DBG_TRACE | DBG_STATE | 3, ("netif: GW address of interface %c%c set to %u.%u.%u.%u\n",    netif->name[0], netif->name[1],    ip4_addr1(&netif->gw),    ip4_addr2(&netif->gw),    ip4_addr3(&netif->gw),    ip4_addr4(&netif->gw)));}voidnetif_set_netmask(struct netif *netif, struct ip_addr *netmask){  ip_addr_set(&(netif->netmask), netmask);  LWIP_DEBUGF(NETIF_DEBUG | DBG_TRACE | DBG_STATE | 3, ("netif: netmask of interface %c%c set to %u.%u.%u.%u\n",    netif->name[0], netif->name[1],    ip4_addr1(&netif->netmask),    ip4_addr2(&netif->netmask),    ip4_addr3(&netif->netmask),    ip4_addr4(&netif->netmask)));}voidnetif_set_default(struct netif *netif){  netif_default = netif;  LWIP_DEBUGF(NETIF_DEBUG, ("netif: setting default interface %c%c\n",           netif ? netif->name[0] : '\'', netif ? netif->name[1] : '\''));}/** * Bring an interface up, available for processing * traffic. *  * @note: Enabling DHCP on a down interface will make it come * up once configured. *  * @see dhcp_start() */ void netif_set_up(struct netif *netif){  netif->flags |= NETIF_FLAG_UP;}/** * Ask if an interface is up */ u8_t netif_is_up(struct netif *netif){  return (netif->flags & NETIF_FLAG_UP)?1:0;}/** * Bring an interface down, disabling any traffic processing. * * @note: Enabling DHCP on a down interface will make it come * up once configured. *  * @see dhcp_start() */ void netif_set_down(struct netif *netif){  netif->flags &= ~NETIF_FLAG_UP;}voidnetif_init(void){  netif_list = netif_default = NULL;}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
91在线你懂得| 国内成人自拍视频| 中文字幕一区二区三区视频| 26uuu精品一区二区| 欧美大胆一级视频| 精品国产欧美一区二区| 欧美福利视频一区| 日韩欧美色综合| 2024国产精品视频| 国产免费成人在线视频| 国产精品久久影院| 亚洲欧美精品午睡沙发| 亚洲一级二级三级| 日本系列欧美系列| 国内国产精品久久| 一本到高清视频免费精品| 99久久久精品| 欧美性大战久久| 日韩你懂的电影在线观看| 日韩久久精品一区| 国产精品卡一卡二卡三| 亚洲老妇xxxxxx| 五月天婷婷综合| 久草这里只有精品视频| 国产91精品精华液一区二区三区| 国产成人精品一区二| 日本久久一区二区三区| 欧美一级理论片| 亚洲欧洲精品一区二区三区| 亚洲福利一区二区三区| 国内精品久久久久影院色| 不卡av电影在线播放| 欧美三电影在线| 久久一日本道色综合| 亚洲欧美日韩在线| 激情综合亚洲精品| 成人午夜看片网址| 欧美一区二区视频免费观看| 国产精品久久久久一区二区三区| 午夜亚洲福利老司机| 国产69精品久久99不卡| 欧美欧美欧美欧美首页| 国产精品丝袜久久久久久app| 亚洲在线中文字幕| 成人小视频免费在线观看| 717成人午夜免费福利电影| 国产精品毛片久久久久久| 午夜在线成人av| 99久久综合国产精品| 日韩美女在线视频| 亚洲黄色小说网站| 粉嫩绯色av一区二区在线观看| 51久久夜色精品国产麻豆| 国产精品色婷婷久久58| 精品一区二区三区在线播放 | 国产麻豆一精品一av一免费| 色先锋aa成人| 国产午夜精品久久久久久久| 奇米影视一区二区三区| 欧美写真视频网站| 樱花草国产18久久久久| 福利91精品一区二区三区| 欧美精品一区二区高清在线观看| 亚洲成在人线免费| 欧美在线观看视频一区二区| 一区免费观看视频| 成人深夜福利app| 国产三级一区二区| 国产米奇在线777精品观看| 欧美一级日韩免费不卡| 亚洲444eee在线观看| 精品视频色一区| 亚洲成av人片观看| 欧美精品少妇一区二区三区| 亚洲国产综合人成综合网站| 在线看日韩精品电影| 亚洲激情图片qvod| 欧美在线制服丝袜| 午夜亚洲国产au精品一区二区| 欧美在线免费播放| 亚洲成人黄色小说| 日韩一区二区三区免费观看| 久久99这里只有精品| 精品国产一区二区三区久久久蜜月| 美女任你摸久久| 久久这里只有精品6| 成人网男人的天堂| 亚洲精品综合在线| 欧美区视频在线观看| 免费在线看成人av| 久久久久久亚洲综合影院红桃| 国产成人高清在线| 亚洲色图制服丝袜| 欧美色国产精品| 狠狠色狠狠色综合| 欧美经典三级视频一区二区三区| 国产成人免费xxxxxxxx| 一区二区三区四区不卡在线| 欧美性生交片4| 日本午夜精品一区二区三区电影 | aaa欧美大片| 午夜影院在线观看欧美| 久久众筹精品私拍模特| 色婷婷亚洲综合| 日韩国产欧美三级| 久久久久久**毛片大全| 色呦呦国产精品| 免费观看一级特黄欧美大片| 国产日韩v精品一区二区| 91电影在线观看| 国产在线观看免费一区| 久久99精品一区二区三区三区| 国产精品另类一区| 欧美日韩国产高清一区二区三区| 国产在线精品一区二区不卡了 | 欧美男生操女生| 国产在线精品免费av| 亚洲动漫第一页| 国产日韩欧美不卡在线| 欧美一区二区视频在线观看| 成人免费视频视频在线观看免费| 婷婷一区二区三区| 国产精品成人免费精品自在线观看| 欧美日韩精品系列| 成人a区在线观看| 久久国产人妖系列| 亚洲国产精品久久不卡毛片| 中文字幕免费不卡在线| 欧美成人一区二区三区片免费 | 精品一区免费av| 一个色妞综合视频在线观看| 国产婷婷精品av在线| 7777精品伊人久久久大香线蕉超级流畅| 激情综合色综合久久| 香蕉成人啪国产精品视频综合网| 日韩理论片网站| 中文无字幕一区二区三区| 欧美r级在线观看| 在线综合视频播放| 欧美色区777第一页| 色综合久久88色综合天天免费| 大美女一区二区三区| 国内精品免费**视频| 久久99精品久久久久久 | 精品国产一区二区三区久久久蜜月| 欧美在线免费视屏| 91高清视频免费看| 91免费版pro下载短视频| 不卡一区二区在线| 成人av电影在线播放| 日韩三级电影网址| 日韩一区二区三区四区五区六区| 欧美性xxxxxxxx| 欧美高清精品3d| 日韩欧美国产一二三区| 日韩精品一区二区三区蜜臀| 日韩欧美国产成人一区二区| 欧美一区二区免费观在线| 日韩一区二区中文字幕| 亚洲精品在线网站| 国产日韩一级二级三级| 国产精品美女久久久久久久久| 国产精品伦一区二区三级视频| 国产精品不卡在线| 樱桃国产成人精品视频| 亚洲成人777| 激情综合网天天干| 99免费精品视频| 欧洲视频一区二区| 欧美美女bb生活片| 精品欧美一区二区久久| 国产亚洲视频系列| 亚洲精品视频免费观看| 午夜精品视频在线观看| 国内成人免费视频| eeuss鲁片一区二区三区| 欧美中文字幕一区| 日韩精品中文字幕一区| 国产精品乱人伦中文| 亚洲国产综合在线| 国产在线精品免费| 色天使久久综合网天天| 91麻豆精品国产自产在线观看一区 | 精品999在线播放| 欧美经典三级视频一区二区三区| 亚洲精品你懂的| 精品亚洲成a人在线观看| 9人人澡人人爽人人精品| 欧美精品tushy高清| 国产精品久久久久一区二区三区 | 激情欧美一区二区| www..com久久爱| 日韩午夜激情视频| 国产精品欧美一级免费| 日韩av电影天堂| 97成人超碰视| 久久在线观看免费| 天堂在线亚洲视频| 99久久综合国产精品| 国产亚洲一区字幕|