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

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

?? ip.c

?? “華為模塊(GTM900)+ ARM(LPC2104) + LWIP1.1”以PPP 方式實現GPRS 無線數據傳輸
?? C
?? 第 1 頁 / 共 2 頁
字號:
/* @file * * This is the IP layer implementation for incoming and outgoing IP traffic. *  * @see ip_frag.c * *//* * 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/mem.h"#include "lwip/ip.h"#include "lwip/ip_frag.h"#include "lwip/inet.h"#include "lwip/netif.h"#include "lwip/icmp.h"#include "lwip/raw.h"#include "lwip/udp.h"#include "lwip/tcp.h"#include "lwip/stats.h"#include "arch/perf.h"#include "lwip/snmp.h"#if LWIP_DHCP#  include "lwip/dhcp.h"#endif /* LWIP_DHCP */#include "uart.h"/** * Initializes the IP layer. */voidip_init(void){  /* no initializations as of yet */}/** * Finds the appropriate network interface for a given IP address. It * searches the list of network interfaces linearly. A match is found * if the masked IP address of the network interface equals the masked * IP address given to the function. */struct netif *ip_route(struct ip_addr *dest){  struct netif *netif;  /* iterate through netifs */  for(netif = netif_list; netif != NULL; netif = netif->next) {    /* network mask matches? */    if (ip_addr_netcmp(dest, &(netif->ip_addr), &(netif->netmask))) {      /* return netif on which to forward IP packet */      return netif;    }  }  /* no matching netif found, use default netif */  return netif_default;}#if IP_FORWARD/** * Forwards an IP packet. It finds an appropriate route for the * packet, decrements the TTL value of the packet, adjusts the * checksum and outputs the packet on the appropriate interface. */static struct netif *ip_forward(struct pbuf *p, struct ip_hdr *iphdr, struct netif *inp){  struct netif *netif;  PERF_START;  /* Find network interface where to forward this IP packet to. */  netif = ip_route((struct ip_addr *)&(iphdr->dest));  if (netif == NULL) {    LWIP_DEBUGF(IP_DEBUG, ("ip_forward: no forwarding route for 0x%lx found\n",                      iphdr->dest.addr));    snmp_inc_ipnoroutes();    return (struct netif *)NULL;  }  /* Do not forward packets onto the same network interface on which   * they arrived. */  if (netif == inp) {    LWIP_DEBUGF(IP_DEBUG, ("ip_forward: not bouncing packets back on incoming interface.\n"));    snmp_inc_ipnoroutes();    return (struct netif *)NULL;  }  /* decrement TTL */  IPH_TTL_SET(iphdr, IPH_TTL(iphdr) - 1);  /* send ICMP if TTL == 0 */  if (IPH_TTL(iphdr) == 0) {    /* Don't send ICMP messages in response to ICMP messages */    if (IPH_PROTO(iphdr) != IP_PROTO_ICMP) {      icmp_time_exceeded(p, ICMP_TE_TTL);      snmp_inc_icmpouttimeexcds();    }    return (struct netif *)NULL;  }  /* Incrementally update the IP checksum. */  if (IPH_CHKSUM(iphdr) >= htons(0xffff - 0x100)) {    IPH_CHKSUM_SET(iphdr, IPH_CHKSUM(iphdr) + htons(0x100) + 1);  } else {    IPH_CHKSUM_SET(iphdr, IPH_CHKSUM(iphdr) + htons(0x100));  }  LWIP_DEBUGF(IP_DEBUG, ("ip_forward: forwarding packet to 0x%lx\n",                    iphdr->dest.addr));  IP_STATS_INC(ip.fw);  IP_STATS_INC(ip.xmit);    snmp_inc_ipforwdatagrams(); // PERF_STOP("ip_forward");  /* transmit pbuf on chosen interface */  netif->output(netif, p, (struct ip_addr *)&(iphdr->dest));  return netif;}#endif /* IP_FORWARD *//** * This function is called by the network interface device driver when * an IP packet is received. The function does the basic checks of the * IP header such as packet size being at least larger than the header * size etc. If the packet was not destined for us, the packet is * forwarded (using ip_forward). The IP checksum is always checked. * * Finally, the packet is sent to the upper layer protocol input function. *  *  *  */err_tip_input(struct pbuf *p, struct netif *inp) {  struct ip_hdr *iphdr;  struct netif *netif;  u16_t iphdrlen;  IP_STATS_INC(ip.recv);  snmp_inc_ipinreceives();  DEBUG_FUNCTION("ip_input()");  /* identify the IP header */  iphdr = p->payload;  if (IPH_V(iphdr) != 4) {    LWIP_DEBUGF(IP_DEBUG | 1, ("IP packet dropped due to bad version number %u\n", IPH_V(iphdr)));     DEBUG_EVENT("IP packet dropped due to bad version number");	    ip_debug_print(p);    pbuf_free(p);    IP_STATS_INC(ip.err);    IP_STATS_INC(ip.drop);    snmp_inc_ipunknownprotos();    return ERR_OK;  }  /* obtain IP header length in number of 32-bit words */  iphdrlen = IPH_HL(iphdr);  /* calculate IP header length in bytes */  iphdrlen *= 4;  /* header length exceeds first pbuf length? */  if (iphdrlen > p->len) {    LWIP_DEBUGF(IP_DEBUG | 2, ("IP header (len %u) does not fit in first pbuf (len %u), IP packet droppped.\n",      iphdrlen, p->len));    /* free (drop) packet pbufs */	    DEBUG_EVENT("IP header (len %u) does not fit in first pbuf (len %u), IP packet droppped.");	    pbuf_free(p);    IP_STATS_INC(ip.lenerr);    IP_STATS_INC(ip.drop);    snmp_inc_ipindiscards();    return ERR_OK;  }  /* verify checksum */#if CHECKSUM_CHECK_IP  if (inet_chksum(iphdr, iphdrlen) != 0) {    LWIP_DEBUGF(IP_DEBUG | 2, ("Checksum (0x%x) failed, IP packet dropped.\n", inet_chksum(iphdr, iphdrlen)));    DEBUG_EVENT("Checksum (0x%x) failed, IP packet dropped..");	    ip_debug_print(p);    pbuf_free(p);    IP_STATS_INC(ip.chkerr);    IP_STATS_INC(ip.drop);    snmp_inc_ipindiscards();    return ERR_OK;  }#endif  /* Trim pbuf. This should have been done at the netif layer,   * but we'll do it anyway just to be sure that its done. */  pbuf_realloc(p, ntohs(IPH_LEN(iphdr)));  /* match packet against an interface, i.e. is this packet for us? */  for (netif = netif_list; netif != NULL; netif = netif->next) {    LWIP_DEBUGF(IP_DEBUG, ("ip_input: iphdr->dest 0x%lx netif->ip_addr 0x%lx (0x%lx, 0x%lx, 0x%lx)\n",      iphdr->dest.addr, netif->ip_addr.addr,      iphdr->dest.addr & netif->netmask.addr,      netif->ip_addr.addr & netif->netmask.addr,      iphdr->dest.addr & ~(netif->netmask.addr)));    /* interface is up and configured? */    if ((netif_is_up(netif)) && (!ip_addr_isany(&(netif->ip_addr))))    {	  /* unicast to this interface address? */      if (ip_addr_cmp(&(iphdr->dest), &(netif->ip_addr)) ||         /* or broadcast on this interface network address? */         ip_addr_isbroadcast(&(iphdr->dest), netif)) {        LWIP_DEBUGF(IP_DEBUG, ("ip_input: packet accepted on interface %c%c\n",          netif->name[0], netif->name[1]));        /* break out of for loop */        break;      }    }  }#if LWIP_DHCP  /* Pass DHCP messages regardless of destination address. DHCP traffic is addressed   * using link layer addressing (such as Ethernet MAC) so we must not filter on IP.   * According to RFC 1542 section 3.1.1, referred by RFC 2131).

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美人妖巨大在线| 日本不卡视频在线| 成人av资源下载| 中文字幕一区二区三区不卡在线| 国产盗摄视频一区二区三区| 久久嫩草精品久久久久| 国产高清精品久久久久| 国产精品国产三级国产普通话三级 | 麻豆精品视频在线| 久久只精品国产| av在线不卡免费看| 亚洲va中文字幕| 日韩精品在线看片z| 国产精品一区二区在线观看网站| 欧美激情艳妇裸体舞| 97se亚洲国产综合在线| 亚洲一区二区美女| 欧美大胆一级视频| 成人av在线网站| 午夜久久福利影院| 久久先锋影音av鲁色资源| 97se亚洲国产综合自在线观| 天堂成人免费av电影一区| 久久久精品综合| 在线观看91精品国产入口| 久久精品国产亚洲高清剧情介绍 | 中日韩av电影| 欧美日韩黄视频| 国产精一区二区三区| 亚洲欧美一区二区在线观看| 欧美日韩国产三级| 成人福利视频网站| 免费成人av在线| 国产精品久久久久毛片软件| 91精品在线免费观看| 成人av片在线观看| 日本大胆欧美人术艺术动态| 天天影视网天天综合色在线播放 | 色哟哟日韩精品| 久久99精品国产麻豆不卡| 亚洲欧美日韩国产中文在线| 欧美va日韩va| 欧美日韩一卡二卡| 不卡的电影网站| 精品一区二区在线视频| 亚洲妇熟xx妇色黄| 国产精品美女久久久久av爽李琼| 欧美精品v国产精品v日韩精品| 不卡一区二区三区四区| 秋霞av亚洲一区二区三| 最新国产の精品合集bt伙计| 337p日本欧洲亚洲大胆色噜噜| 91麻豆精东视频| 国产一区激情在线| 奇米色一区二区| 亚洲福利一区二区| 亚洲精品中文在线| 国产精品亲子乱子伦xxxx裸| 精品国产123| 91精品国产手机| 欧美性做爰猛烈叫床潮| 91丨九色丨国产丨porny| 国产成人av电影在线| 国产美女视频91| 精东粉嫩av免费一区二区三区| 日韩国产精品大片| 亚洲电影第三页| 亚洲国产sm捆绑调教视频 | 精品国产欧美一区二区| 在线不卡免费av| 在线不卡的av| 777午夜精品免费视频| 欧美日韩一区高清| 欧美伊人久久大香线蕉综合69 | 色婷婷一区二区| 91麻豆免费视频| 色视频成人在线观看免| 91无套直看片红桃| 99久久er热在这里只有精品66| 国产高清精品网站| 国产成人精品免费在线| 成人亚洲精品久久久久软件| 成人在线综合网| 99精品视频在线观看免费| av午夜精品一区二区三区| 99久久婷婷国产综合精品电影| 97久久超碰国产精品电影| 欧美久久久久久久久久| 欧美日韩国产一级| 91精品国产一区二区| 欧美电影免费观看高清完整版在| 亚洲精品一区二区三区影院 | 国产精品久久久久久久裸模| 中文字幕综合网| 亚洲超丰满肉感bbw| 男人的天堂久久精品| 久久国产精品色| 国产999精品久久| 色综合久久综合| 欧美美女一区二区| 精品久久久久一区| 国产精品毛片大码女人| 亚洲主播在线播放| 另类成人小视频在线| 成人午夜免费av| 在线观看日韩电影| 日韩欧美成人午夜| 国产精品视频观看| 亚洲123区在线观看| 久久不见久久见免费视频7| 成人开心网精品视频| 欧美在线视频日韩| 久久综合狠狠综合久久综合88| 中文字幕亚洲欧美在线不卡| 日韩一区精品字幕| 成人毛片在线观看| 在线不卡的av| 国产精品免费免费| 青青草97国产精品免费观看无弹窗版 | 中文字幕亚洲区| 欧美aⅴ一区二区三区视频| 成人国产免费视频| 久久久久久免费网| 午夜精品视频一区| 成人毛片老司机大片| 欧美一区二区久久| 一区二区三区四区不卡视频| 麻豆精品一区二区三区| 在线一区二区三区| 久久精品男人的天堂| 婷婷久久综合九色综合绿巨人| 懂色中文一区二区在线播放| 国产欧美一区二区三区鸳鸯浴| 国产精品18久久久久久久久久久久 | 亚洲二区在线观看| 成人精品亚洲人成在线| 911精品产国品一二三产区| 一区在线观看免费| 国产尤物一区二区| 日韩一级免费观看| 亚洲小少妇裸体bbw| 99麻豆久久久国产精品免费 | 国产欧美一区二区精品性| 三级久久三级久久| 色婷婷av一区二区三区之一色屋| 久久久亚洲午夜电影| 日本不卡1234视频| 欧美中文字幕一区二区三区亚洲| 亚洲国产精品精华液ab| 精品影视av免费| 欧美一二区视频| 日韩精品一二三四| 欧美日韩美少妇 | 亚洲风情在线资源站| 日本韩国欧美一区| 日韩一区在线免费观看| 成人av电影在线| 国产欧美一区二区精品秋霞影院| 久久国产精品一区二区| 日韩网站在线看片你懂的| 日本视频在线一区| 欧美一区二区在线免费观看| 亚洲成人在线观看视频| 欧美丝袜丝交足nylons| 一二三区精品福利视频| 91视频免费播放| 亚洲私人黄色宅男| 91丨九色porny丨蝌蚪| 亚洲精品自拍动漫在线| 在线视频你懂得一区| 欧美成人aa大片| 精品亚洲成a人| 亚洲精品在线观看网站| 久久er99热精品一区二区| 欧美一级欧美三级| 久久精品国产99国产精品| 日韩精品一区国产麻豆| 国产精选一区二区三区| 欧美国产精品久久| 成人福利视频在线| 亚洲精品菠萝久久久久久久| 91久久精品一区二区| 亚洲亚洲人成综合网络| 制服视频三区第一页精品| 美女国产一区二区三区| 欧美精品一区二区不卡| 粉嫩嫩av羞羞动漫久久久| 亚洲欧美日韩在线不卡| 欧美日韩国产免费一区二区 | 一区二区在线看| 欧美日韩卡一卡二| 精品在线观看视频| 国产精品欧美一级免费| 91福利在线看| 麻豆精品国产传媒mv男同| 国产婷婷色一区二区三区四区| www.一区二区| 久久天天做天天爱综合色| 亚洲一区二区三区四区在线观看 | av在线免费不卡|