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

? 歡迎來(lái)到蟲(chóng)蟲(chóng)下載站! | ?? 資源下載 ?? 資源專(zhuān)輯 ?? 關(guān)于我們
? 蟲(chóng)蟲(chóng)下載站

?? ip.c

?? 基于AT91SAM7x256的硬件平臺(tái)的WEB服務(wù)器源碼(A&shy DS版本, ucOS_II+LWIP+自己編寫(xiě)的DNS查詢工具)
?? C
字號(hào):
/* @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 *//** * 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%"X32_F" 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%"X32_F"\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();  /* identify the IP header */  iphdr = p->payload;  if (IPH_V(iphdr) != 4) {    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 %"U16_F") does not fit in first pbuf (len %"U16_F"), IP packet droppped.\n",      iphdrlen, p->len));    /* free (drop) packet pbufs */    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) {    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) {    /* 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)) {                 /* break out of for loop */        break;      }    }  }  /* packet not for us? */  if (netif == NULL) {    /* packet not for us, route or discard */#if IP_FORWARD    /* non-broadcast packet? */    if (!ip_addr_isbroadcast(&(iphdr->dest), inp)) {      /* try to forward IP packet on (other) interfaces */      ip_forward(p, iphdr, inp);    }    else#endif /* IP_FORWARD */    {      snmp_inc_ipindiscards();    }    pbuf_free(p);    return ERR_OK;  }  /* packet consists of multiple fragments? */  if ((IPH_OFFSET(iphdr) & htons(IP_OFFMASK | IP_MF)) != 0) {#if IP_REASSEMBLY /* packet fragment reassembly code present? */    /* reassemble the packet*/    p = ip_reass(p);    /* packet not fully reassembled yet? */    if (p == NULL) {      return ERR_OK;    }    iphdr = p->payload;#else /* IP_REASSEMBLY == 0, no packet fragment reassembly code present */    pbuf_free(p);    IP_STATS_INC(ip.opterr);    IP_STATS_INC(ip.drop);    snmp_inc_ipunknownprotos();    return ERR_OK;#endif /* IP_REASSEMBLY */  }#if IP_OPTIONS == 0 /* no support for IP options in the IP header? */  if (iphdrlen > IP_HLEN) {    pbuf_free(p);    IP_STATS_INC(ip.opterr);    IP_STATS_INC(ip.drop);    snmp_inc_ipunknownprotos();    return ERR_OK;  }#endif /* IP_OPTIONS == 0 */  /* send to upper layers */  ip_debug_print(p);#if LWIP_RAW  /* raw input did not eat the packet? */  if (raw_input(p, inp) == 0) {#endif /* LWIP_RAW */  switch (IPH_PROTO(iphdr)) {#if LWIP_UDP  case IP_PROTO_UDP:  case IP_PROTO_UDPLITE:    snmp_inc_ipindelivers();    udp_input(p, inp);    break;#endif /* LWIP_UDP */#if LWIP_TCP  case IP_PROTO_TCP:    snmp_inc_ipindelivers();    tcp_input(p, inp);    break;#endif /* LWIP_TCP */  case IP_PROTO_ICMP:    snmp_inc_ipindelivers();    icmp_input(p, inp);    break;  default:    /* send ICMP destination protocol unreachable unless is was a broadcast */    if (!ip_addr_isbroadcast(&(iphdr->dest), inp) &&        !ip_addr_ismulticast(&(iphdr->dest))) {      p->payload = iphdr;      icmp_dest_unreach(p, ICMP_DUR_PROTO);    }    pbuf_free(p);    IP_STATS_INC(ip.proterr);    IP_STATS_INC(ip.drop);    snmp_inc_ipunknownprotos();  }#if LWIP_RAW  } /* LWIP_RAW */#endif  return ERR_OK;}/** * Sends an IP packet on a network interface. This function constructs * the IP header and calculates the IP header checksum. If the source * IP address is NULL, the IP address of the outgoing network * interface is filled in as source address. */err_tip_output_if(struct pbuf *p, struct ip_addr *src, struct ip_addr *dest,             u8_t ttl, u8_t tos,             u8_t proto, struct netif *netif){  struct ip_hdr *iphdr;  u16_t ip_id = 0;  snmp_inc_ipoutrequests();  if (dest != IP_HDRINCL) {    if (pbuf_header(p, IP_HLEN)) {      LWIP_DEBUGF(IP_DEBUG | 2, ("ip_output: not enough room for IP header in pbuf\n"));      IP_STATS_INC(ip.err);      snmp_inc_ipoutdiscards();      return ERR_BUF;    }    iphdr = p->payload;    IPH_TTL_SET(iphdr, ttl);    IPH_PROTO_SET(iphdr, proto);    ip_addr_set(&(iphdr->dest), dest);    IPH_VHLTOS_SET(iphdr, 4, IP_HLEN / 4, tos);    IPH_LEN_SET(iphdr, htons(p->tot_len));    IPH_OFFSET_SET(iphdr, htons(IP_DF));    IPH_ID_SET(iphdr, htons(ip_id));    ++ip_id;    if (ip_addr_isany(src)) {      ip_addr_set(&(iphdr->src), &(netif->ip_addr));    } else {      ip_addr_set(&(iphdr->src), src);    }    IPH_CHKSUM_SET(iphdr, 0);#if CHECKSUM_GEN_IP    IPH_CHKSUM_SET(iphdr, inet_chksum(iphdr, IP_HLEN));#endif  } else {    iphdr = p->payload;    dest = &(iphdr->dest);  }#if IP_FRAG  /* don't fragment if interface has mtu set to 0 [loopif] */  if (netif->mtu && (p->tot_len > netif->mtu))    return ip_frag(p,netif,dest);#endif  IP_STATS_INC(ip.xmit);  LWIP_DEBUGF(IP_DEBUG, ("ip_output_if: %c%c%"U16_F"\n", netif->name[0], netif->name[1], netif->num));  ip_debug_print(p);  LWIP_DEBUGF(IP_DEBUG, ("netif->output()"));  return netif->output(netif, p, dest);}/** * Simple interface to ip_output_if. It finds the outgoing network * interface and calls upon ip_output_if to do the actual work. */err_tip_output(struct pbuf *p, struct ip_addr *src, struct ip_addr *dest,          u8_t ttl, u8_t tos, u8_t proto){  struct netif *netif;  if ((netif = ip_route(dest)) == NULL) {    LWIP_DEBUGF(IP_DEBUG | 2, ("ip_output: No route to 0x%"X32_F"\n", dest->addr));    IP_STATS_INC(ip.rterr);    snmp_inc_ipoutdiscards();    return ERR_RTE;  }  return ip_output_if(p, src, dest, ttl, tos, proto, netif);}#if IP_DEBUGvoidip_debug_print(struct pbuf *p){  struct ip_hdr *iphdr = p->payload;  u8_t *payload;  payload = (u8_t *)iphdr + IP_HLEN;  LWIP_DEBUGF(IP_DEBUG, ("IP header:\n"));  LWIP_DEBUGF(IP_DEBUG, ("+-------------------------------+\n"));  LWIP_DEBUGF(IP_DEBUG, ("|%2"S16_F" |%2"S16_F" |  0x%02"X16_F" |     %5"U16_F"     | (v, hl, tos, len)\n",                    IPH_V(iphdr),                    IPH_HL(iphdr),                    IPH_TOS(iphdr),                    ntohs(IPH_LEN(iphdr))));  LWIP_DEBUGF(IP_DEBUG, ("+-------------------------------+\n"));  LWIP_DEBUGF(IP_DEBUG, ("|    %5"U16_F"      |%"U16_F"%"U16_F"%"U16_F"|    %4"U16_F"   | (id, flags, offset)\n",                    ntohs(IPH_ID(iphdr)),                    ntohs(IPH_OFFSET(iphdr)) >> 15 & 1,                    ntohs(IPH_OFFSET(iphdr)) >> 14 & 1,                    ntohs(IPH_OFFSET(iphdr)) >> 13 & 1,                    ntohs(IPH_OFFSET(iphdr)) & IP_OFFMASK));  LWIP_DEBUGF(IP_DEBUG, ("+-------------------------------+\n"));  LWIP_DEBUGF(IP_DEBUG, ("|  %3"U16_F"  |  %3"U16_F"  |    0x%04"X16_F"     | (ttl, proto, chksum)\n",                    IPH_TTL(iphdr),                    IPH_PROTO(iphdr),                    ntohs(IPH_CHKSUM(iphdr))));  LWIP_DEBUGF(IP_DEBUG, ("+-------------------------------+\n"));  LWIP_DEBUGF(IP_DEBUG, ("|  %3"U16_F"  |  %3"U16_F"  |  %3"U16_F"  |  %3"U16_F"  | (src)\n",                    ip4_addr1(&iphdr->src),                    ip4_addr2(&iphdr->src),                    ip4_addr3(&iphdr->src),                    ip4_addr4(&iphdr->src)));  LWIP_DEBUGF(IP_DEBUG, ("+-------------------------------+\n"));  LWIP_DEBUGF(IP_DEBUG, ("|  %3"U16_F"  |  %3"U16_F"  |  %3"U16_F"  |  %3"U16_F"  | (dest)\n",                    ip4_addr1(&iphdr->dest),                    ip4_addr2(&iphdr->dest),                    ip4_addr3(&iphdr->dest),                    ip4_addr4(&iphdr->dest)));  LWIP_DEBUGF(IP_DEBUG, ("+-------------------------------+\n"));}#endif /* IP_DEBUG */

?? 快捷鍵說(shuō)明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲bdsm女犯bdsm网站| 色哟哟亚洲精品| 99精品国产热久久91蜜凸| 久久伊人蜜桃av一区二区| 亚洲欧洲在线观看av| 秋霞av亚洲一区二区三| 欧美精品在线观看播放| 2024国产精品视频| 欧美一级日韩不卡播放免费| 亚洲精品乱码久久久久久久久 | 99在线精品免费| 国精产品一区一区三区mba桃花| 欧美在线啊v一区| 亚洲国产成人午夜在线一区| 在线免费观看日本欧美| 国产亚洲精品bt天堂精选| 免费成人性网站| 欧美日韩精品一区二区天天拍小说| 日韩一级二级三级| 久99久精品视频免费观看| 欧美性色综合网| 亚洲人成伊人成综合网小说| 欧美图区在线视频| 国产精品国产三级国产普通话三级 | 色欧美片视频在线观看在线视频| 精品日韩欧美一区二区| 偷拍一区二区三区四区| 91麻豆免费观看| 自拍偷在线精品自拍偷无码专区| 狠狠狠色丁香婷婷综合激情 | 91免费视频网| 国产精品毛片久久久久久久| 国产乱国产乱300精品| 精品美女在线播放| 美洲天堂一区二卡三卡四卡视频 | 成人小视频在线观看| 久久蜜桃一区二区| 国产精品白丝jk白祙喷水网站| 日韩精品一区二区三区老鸭窝 | 一区二区三区电影在线播| av成人免费在线观看| 国产精品美女一区二区三区| 成人涩涩免费视频| 国产精品午夜春色av| 成人免费毛片app| 中文字幕一区二区三区蜜月 | 热久久一区二区| 欧美乱妇20p| 日本成人在线看| 欧美大片在线观看一区二区| 欧美电影一区二区| 午夜激情综合网| 91精品国产综合久久久蜜臀粉嫩 | 亚洲国产成人一区二区三区| 成人黄页毛片网站| 中文字幕一区二区三区四区不卡| 99re成人在线| 亚洲一区二区精品久久av| 欧美美女视频在线观看| 日本不卡免费在线视频| 日韩一区二区三区三四区视频在线观看| 蜜桃一区二区三区四区| 337p粉嫩大胆噜噜噜噜噜91av| 国产传媒欧美日韩成人| 国产精品久久久久影院亚瑟| 色综合天天综合网天天看片| 无吗不卡中文字幕| 精品国产电影一区二区| 成人免费毛片片v| 亚洲影院免费观看| 欧美日韩综合在线免费观看| 久久精品国产久精国产爱| 久久九九久久九九| 91麻豆免费在线观看| 日韩电影在线观看电影| 久久久久久久久免费| 91视频在线看| 视频一区欧美精品| 久久精品人人做人人爽人人| 91偷拍与自偷拍精品| 香蕉成人伊视频在线观看| 久久影院午夜片一区| 99久久精品国产观看| 亚洲一卡二卡三卡四卡| 精品欧美乱码久久久久久1区2区| 粉嫩绯色av一区二区在线观看| 亚洲自拍偷拍网站| 精品久久久久一区| 色悠悠亚洲一区二区| 麻豆精品一区二区av白丝在线| 国产欧美一区二区精品秋霞影院| 色婷婷综合久久久| 蜜桃视频一区二区| 亚洲三级免费观看| 欧美一区二区在线不卡| 99精品视频中文字幕| 日韩国产欧美在线视频| 国产精品欧美经典| 91精品久久久久久久久99蜜臂| 日韩免费看的电影| 精品毛片乱码1区2区3区| 精品国产一二三| 久久男人中文字幕资源站| 日韩一区中文字幕| 激情综合色播激情啊| 欧美日韩和欧美的一区二区| 国内精品伊人久久久久av一坑 | 欧美国产日本韩| 免费精品视频最新在线| 成人一区二区三区视频在线观看| 色综合天天综合色综合av | 91免费观看国产| 国产精品久久久久久亚洲伦 | 欧美另类变人与禽xxxxx| 欧美三级韩国三级日本一级| 日韩丝袜美女视频| 国产日产欧美一区二区视频| 免费精品99久久国产综合精品| 国产电影一区二区三区| 色综合久久综合网欧美综合网| 亚洲综合一区二区| 国产专区综合网| 国产精品女主播av| 成人综合在线观看| 精品国内片67194| 亚洲一卡二卡三卡四卡五卡| 欧美视频一区二区三区在线观看| 日本一区二区三区电影| 99久久99久久综合| 欧美电影免费观看高清完整版在线观看| 亚洲国产一二三| 国产成人av电影免费在线观看| 7777精品伊人久久久大香线蕉的| 亚洲一区二区av在线| 国产精品一色哟哟哟| 日韩手机在线导航| 亚洲自拍偷拍九九九| 国产激情一区二区三区| 国产无遮挡一区二区三区毛片日本| 亚洲男帅同性gay1069| 国产成人免费视频| 精品久久久久久久久久久久久久久| 亚洲激情欧美激情| 国产精品一区二区久激情瑜伽 | 91亚洲资源网| 久久久精品欧美丰满| 美女尤物国产一区| 欧美一区二区三区不卡| 国产高清在线观看免费不卡| 国产三级欧美三级日产三级99| 看国产成人h片视频| 欧美电影免费观看完整版| 韩国女主播一区二区三区| 1区2区3区精品视频| av一本久道久久综合久久鬼色| 亚洲欧美日韩国产综合| 日韩一区二区电影在线| 亚洲成av人综合在线观看| 国产精品久久久久久妇女6080| 午夜精品在线看| 成人免费在线视频观看| 亚洲成a人v欧美综合天堂 | 国产高清精品久久久久| 久久成人免费网| 久久99精品久久久久久国产越南 | 另类中文字幕网| 久久精品国产一区二区三区免费看| 麻豆精品久久久| 另类调教123区| 久久99精品国产麻豆婷婷洗澡| 久久国产精品72免费观看| 久久成人久久鬼色| 国产成人无遮挡在线视频| 国产91精品一区二区麻豆网站 | 日韩在线播放一区二区| 蜜桃精品在线观看| 国产一区二区三区免费播放| 国产**成人网毛片九色| 91视视频在线观看入口直接观看www | 狠狠色狠狠色合久久伊人| 紧缚捆绑精品一区二区| 国产精一区二区三区| k8久久久一区二区三区| 欧美综合一区二区| 在线综合视频播放| 久久久久久久综合色一本| 综合激情成人伊人| 婷婷久久综合九色综合伊人色| 老司机精品视频一区二区三区| 国产精品夜夜嗨| 一本大道久久a久久精品综合| 欧美精品久久一区二区三区| 精品国产精品网麻豆系列 | 欧美一二三区在线观看| 久久久久久99久久久精品网站| 亚洲天堂成人在线观看| 日本中文字幕一区| 成人污污视频在线观看| 欧美日韩一区二区三区免费看| 精品国产精品一区二区夜夜嗨|