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

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

?? ip6.c

?? lwip在UCOS上的實現
?? 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> * *//* ip.c * * This is the code for the IP layer for IPv6. * */#include "lwip/opt.h"#include "lwip/def.h"#include "lwip/mem.h"#include "lwip/ip.h"#include "lwip/inet.h"#include "lwip/netif.h"#include "lwip/icmp.h"#include "lwip/udp.h"#include "lwip/tcp.h"#include "lwip/stats.h"#include "arch/perf.h"/* ip_init: * * Initializes the IP layer. */voidip_init(void){}/* ip_route: * * 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;  for(netif = netif_list; netif != NULL; netif = netif->next) {    if (ip_addr_netcmp(dest, &(netif->ip_addr), &(netif->netmask))) {      return netif;    }  }  return netif_default;}/* 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 voidip_forward(struct pbuf *p, struct ip_hdr *iphdr){  struct netif *netif;  PERF_START;  if ((netif = ip_route((struct ip_addr *)&(iphdr->dest))) == NULL) {    LWIP_DEBUGF(IP_DEBUG, ("ip_input: no forwarding route found for "));#if IP_DEBUG    ip_addr_debug_print(IP_DEBUG, &(iphdr->dest));#endif /* IP_DEBUG */    LWIP_DEBUGF(IP_DEBUG, ("\n"));    pbuf_free(p);    return;  }  /* Decrement TTL and send ICMP if ttl == 0. */  if (--iphdr->hoplim == 0) {    /* Don't send ICMP messages in response to ICMP messages */    if (iphdr->nexthdr != IP_PROTO_ICMP) {      icmp_time_exceeded(p, ICMP_TE_TTL);    }    pbuf_free(p);    return;  }  /* Incremental update of the IP checksum. */  /*  if (iphdr->chksum >= htons(0xffff - 0x100)) {    iphdr->chksum += htons(0x100) + 1;  } else {    iphdr->chksum += htons(0x100);    }*/  LWIP_DEBUGF(IP_DEBUG, ("ip_forward: forwarding packet to "));#if IP_DEBUG  ip_addr_debug_print(IP_DEBUG, &(iphdr->dest));#endif /* IP_DEBUG */  LWIP_DEBUGF(IP_DEBUG, ("\n"));#ifdef IP_STATS  ++lwip_stats.ip.fw;  ++lwip_stats.ip.xmit;#endif /* IP_STATS */  PERF_STOP("ip_forward");  netif->output(netif, p, (struct ip_addr *)&(iphdr->dest));}/* ip_input: * * 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. */voidip_input(struct pbuf *p, struct netif *inp) {  struct ip_hdr *iphdr;  struct netif *netif;  PERF_START;#if IP_DEBUG  ip_debug_print(p);#endif /* IP_DEBUG */#ifdef IP_STATS  ++lwip_stats.ip.recv;#endif /* IP_STATS */  /* identify the IP header */  iphdr = p->payload;  if (iphdr->v != 6) {    LWIP_DEBUGF(IP_DEBUG, ("IP packet dropped due to bad version number\n"));#if IP_DEBUG    ip_debug_print(p);#endif /* IP_DEBUG */    pbuf_free(p);#ifdef IP_STATS    ++lwip_stats.ip.err;    ++lwip_stats.ip.drop;#endif /* IP_STATS */    return;  }  /* is this packet for us? */  for(netif = netif_list; netif != NULL; netif = netif->next) {#if IP_DEBUG    LWIP_DEBUGF(IP_DEBUG, ("ip_input: iphdr->dest "));    ip_addr_debug_print(IP_DEBUG, &(iphdr->dest));    LWIP_DEBUGF(IP_DEBUG, ("netif->ip_addr "));    ip_addr_debug_print(IP_DEBUG, &(netif->ip_addr));    LWIP_DEBUGF(IP_DEBUG, ("\n"));#endif /* IP_DEBUG */    if (ip_addr_cmp(&(iphdr->dest), &(netif->ip_addr))) {      break;    }  }  if (netif == NULL) {    /* packet not for us, route or discard */#ifdef IP_FORWARD    ip_forward(p, iphdr);#endif    pbuf_free(p);    return;  }  pbuf_realloc(p, IP_HLEN + ntohs(iphdr->len));  /* send to upper layers */#if IP_DEBUG  /*  LWIP_DEBUGF("ip_input: \n");  ip_debug_print(p);  LWIP_DEBUGF("ip_input: p->len %"U16_F" p->tot_len %"U16_F"\n", p->len, p->tot_len);*/#endif /* IP_DEBUG */  pbuf_header(p, -IP_HLEN);  switch (iphdr->nexthdr) {  case IP_PROTO_UDP:    udp_input(p);    break;  case IP_PROTO_TCP:    tcp_input(p);    break;  case IP_PROTO_ICMP:    icmp_input(p, inp);    break;  default:    /* send ICMP destination protocol unreachable */    icmp_dest_unreach(p, ICMP_DUR_PROTO);    pbuf_free(p);    LWIP_DEBUGF(IP_DEBUG, ("Unsupported transport protocol %"U16_F"\n",          iphdr->nexthdr));#ifdef IP_STATS    ++lwip_stats.ip.proterr;    ++lwip_stats.ip.drop;#endif /* IP_STATS */  }  PERF_STOP("ip_input");}/* ip_output_if: * * 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 proto, struct netif *netif){  struct ip_hdr *iphdr;  PERF_START;  printf("len %"U16_F" tot_len %"U16_F"\n", p->len, p->tot_len);  if (pbuf_header(p, IP_HLEN)) {    LWIP_DEBUGF(IP_DEBUG, ("ip_output: not enough room for IP header in pbuf\n"));#ifdef IP_STATS    ++lwip_stats.ip.err;#endif /* IP_STATS */    return ERR_BUF;  }  printf("len %"U16_F" tot_len %"U16_F"\n", p->len, p->tot_len);  iphdr = p->payload;  if (dest != IP_HDRINCL) {    printf("!IP_HDRLINCL\n");    iphdr->hoplim = ttl;    iphdr->nexthdr = proto;    iphdr->len = htons(p->tot_len - IP_HLEN);    ip_addr_set(&(iphdr->dest), dest);    iphdr->v = 6;    if (ip_addr_isany(src)) {      ip_addr_set(&(iphdr->src), &(netif->ip_addr));    } else {      ip_addr_set(&(iphdr->src), src);    }  } else {    dest = &(iphdr->dest);  }#ifdef IP_STATS  ++lwip_stats.ip.xmit;#endif /* IP_STATS */  LWIP_DEBUGF(IP_DEBUG, ("ip_output_if: %c%c (len %"U16_F")\n", netif->name[0], netif->name[1], p->tot_len));#if IP_DEBUG  ip_debug_print(p);#endif /* IP_DEBUG */  PERF_STOP("ip_output_if");  return netif->output(netif, p, dest);}/* ip_output: * * 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 proto){  struct netif *netif;  if ((netif = ip_route(dest)) == NULL) {    LWIP_DEBUGF(IP_DEBUG, ("ip_output: No route to 0x%"X32_F"\n", dest->addr));#ifdef IP_STATS    ++lwip_stats.ip.rterr;#endif /* IP_STATS */    return ERR_RTE;  }  return ip_output_if (p, src, dest, ttl, 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" |  %"X16_F"%"X16_F"  |      %"X16_F"%"X16_F"           | (v, traffic class, flow label)\n",        iphdr->v,        iphdr->tclass1, iphdr->tclass2,        iphdr->flow1, iphdr->flow2));  LWIP_DEBUGF(IP_DEBUG, ("+-------------------------------+\n"));  LWIP_DEBUGF(IP_DEBUG, ("|    %5"U16_F"      | %2"U16_F"  |  %2"U16_F"   | (len, nexthdr, hoplim)\n",        ntohs(iphdr->len),        iphdr->nexthdr,        iphdr->hoplim));  LWIP_DEBUGF(IP_DEBUG, ("+-------------------------------+\n"));  LWIP_DEBUGF(IP_DEBUG, ("|       %4"X32_F"      |       %4"X32_F"     | (src)\n",        ntohl(iphdr->src.addr[0]) >> 16 & 0xffff,        ntohl(iphdr->src.addr[0]) & 0xffff));  LWIP_DEBUGF(IP_DEBUG, ("|       %4"X32_F"      |       %4"X32_F"     | (src)\n",        ntohl(iphdr->src.addr[1]) >> 16 & 0xffff,        ntohl(iphdr->src.addr[1]) & 0xffff));  LWIP_DEBUGF(IP_DEBUG, ("|       %4"X32_F"      |       %4"X32_F"     | (src)\n",        ntohl(iphdr->src.addr[2]) >> 16 & 0xffff,        ntohl(iphdr->src.addr[2]) & 0xffff));  LWIP_DEBUGF(IP_DEBUG, ("|       %4"X32_F"      |       %4"X32_F"     | (src)\n",        ntohl(iphdr->src.addr[3]) >> 16 & 0xffff,        ntohl(iphdr->src.addr[3]) & 0xffff));  LWIP_DEBUGF(IP_DEBUG, ("+-------------------------------+\n"));  LWIP_DEBUGF(IP_DEBUG, ("|       %4"X32_F"      |       %4"X32_F"     | (dest)\n",        ntohl(iphdr->dest.addr[0]) >> 16 & 0xffff,        ntohl(iphdr->dest.addr[0]) & 0xffff));  LWIP_DEBUGF(IP_DEBUG, ("|       %4"X32_F"      |       %4"X32_F"     | (dest)\n",        ntohl(iphdr->dest.addr[1]) >> 16 & 0xffff,        ntohl(iphdr->dest.addr[1]) & 0xffff));  LWIP_DEBUGF(IP_DEBUG, ("|       %4"X32_F"      |       %4"X32_F"     | (dest)\n",        ntohl(iphdr->dest.addr[2]) >> 16 & 0xffff,        ntohl(iphdr->dest.addr[2]) & 0xffff));  LWIP_DEBUGF(IP_DEBUG, ("|       %4"X32_F"      |       %4"X32_F"     | (dest)\n",        ntohl(iphdr->dest.addr[3]) >> 16 & 0xffff,        ntohl(iphdr->dest.addr[3]) & 0xffff));  LWIP_DEBUGF(IP_DEBUG, ("+-------------------------------+\n"));}#endif /* IP_DEBUG */

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
日韩电影免费在线观看网站| 欧美成人性战久久| 综合色天天鬼久久鬼色| 成人av资源下载| 中文字幕在线观看一区二区| 91麻豆文化传媒在线观看| 亚洲人成在线观看一区二区| 在线一区二区视频| 偷拍与自拍一区| 欧美大度的电影原声| 国产成人综合网站| 亚洲男女一区二区三区| 欧美美女一区二区在线观看| 蜜臀精品一区二区三区在线观看 | 一区二区三区国产豹纹内裤在线| 色哟哟亚洲精品| 天天色天天操综合| 精品理论电影在线| 99国产精品99久久久久久| 亚洲综合激情另类小说区| 日韩欧美电影一二三| 成人在线视频一区| 亚洲福利视频导航| 久久夜色精品国产噜噜av| 91小视频在线观看| 日本亚洲免费观看| 国产精品精品国产色婷婷| 欧美另类z0zxhd电影| 国产成人亚洲精品青草天美| 一区二区三区高清| 欧美精品一区二区蜜臀亚洲| 色婷婷av一区二区三区大白胸| 男男视频亚洲欧美| 综合久久综合久久| 精品理论电影在线观看| 在线欧美小视频| 国产精品99久久久久久久vr| 亚洲国产欧美在线| 中文字幕+乱码+中文字幕一区| 在线播放中文字幕一区| 99在线热播精品免费| 美日韩一级片在线观看| 亚洲精品视频一区二区| 国产视频视频一区| 91精品国产一区二区三区蜜臀| 97aⅴ精品视频一二三区| 老司机精品视频一区二区三区| 亚洲另类在线一区| www国产亚洲精品久久麻豆| 欧美日韩精品欧美日韩精品一 | 久久99精品国产麻豆不卡| 亚洲天堂成人在线观看| 精品福利一区二区三区| 欧美日韩免费观看一区二区三区| k8久久久一区二区三区| 蜜臀av一级做a爰片久久| 亚洲一区二区成人在线观看| 国产精品福利电影一区二区三区四区| 日韩欧美一区电影| 欧美精品日韩精品| 欧美影院精品一区| 色综合色狠狠天天综合色| 成人一区在线观看| 国产乱国产乱300精品| 久久www免费人成看片高清| 肉色丝袜一区二区| 亚洲成人自拍一区| 亚洲一区日韩精品中文字幕| 亚洲人成网站色在线观看| 欧美韩国一区二区| 久久无码av三级| 久久亚洲二区三区| 26uuu亚洲综合色| 欧美大胆一级视频| 亚洲精品在线免费观看视频| 日韩精品一区在线观看| 欧美电影精品一区二区| 精品粉嫩超白一线天av| 26uuu精品一区二区三区四区在线 26uuu精品一区二区在线观看 | 久久麻豆一区二区| 久久综合久久99| 久久蜜桃av一区二区天堂| 国产视频在线观看一区二区三区 | 欧美一区二区视频免费观看| 91精品国产综合久久小美女| 91精品国产综合久久精品图片 | 日韩女优av电影| 欧美成人乱码一区二区三区| 亚洲精品在线三区| 欧美国产激情二区三区| 亚洲欧洲av一区二区三区久久| 亚洲色图制服诱惑| 亚洲韩国一区二区三区| 丝袜诱惑制服诱惑色一区在线观看| 视频在线观看91| 久久成人av少妇免费| 丰满放荡岳乱妇91ww| 波多野结衣精品在线| 日本电影亚洲天堂一区| 欧美高清激情brazzers| 欧美成人艳星乳罩| 中文一区在线播放 | 午夜精品久久久| 麻豆精品视频在线观看免费| 国产福利一区在线观看| 色综合一个色综合| 56国语精品自产拍在线观看| 久久嫩草精品久久久精品| 日韩理论片在线| 日本伊人午夜精品| 成人美女视频在线观看18| 欧美亚洲一区三区| 精品国产一区二区三区av性色| 中文字幕中文字幕在线一区| 亚洲va韩国va欧美va| 国产精品主播直播| 在线视频你懂得一区| 精品成人一区二区| 亚洲精品视频在线观看网站| 久久国产免费看| 91一区二区三区在线观看| 欧美一区三区二区| 国产精品久久久久久久久免费相片 | 懂色av中文一区二区三区| 欧美伊人精品成人久久综合97| 欧美电影一区二区| 国产精品久久久久久久久动漫| 亚洲主播在线观看| 国产成人啪午夜精品网站男同| 欧美三级日韩三级| 国产精品情趣视频| 麻豆成人免费电影| 欧美亚洲图片小说| 国产精品免费久久久久| 蜜臀av一区二区在线免费观看| 色噜噜狠狠成人中文综合| 国产视频一区二区三区在线观看| 午夜国产不卡在线观看视频| 94-欧美-setu| 国产色产综合色产在线视频| 日本欧美大码aⅴ在线播放| 色av一区二区| 中文字幕一区二区三区四区不卡| 久久激情综合网| 欧美日韩第一区日日骚| 亚洲欧美激情一区二区| 国产福利视频一区二区三区| 日韩欧美国产一区在线观看| 亚洲综合色丁香婷婷六月图片| 成人福利电影精品一区二区在线观看| 日韩欧美亚洲国产另类| 亚洲r级在线视频| 色8久久精品久久久久久蜜| 国产精品电影一区二区三区| 国产成人精品免费一区二区| www激情久久| 久久99深爱久久99精品| 日韩情涩欧美日韩视频| 日韩在线a电影| 69久久99精品久久久久婷婷| 日韩国产成人精品| 69堂成人精品免费视频| 日韩国产欧美三级| 51精品视频一区二区三区| 偷拍与自拍一区| 91精品国产色综合久久ai换脸 | 亚洲视频你懂的| 一本久道久久综合中文字幕| 日韩理论电影院| 91久久久免费一区二区| 一级女性全黄久久生活片免费| 日本精品免费观看高清观看| 亚洲精品免费看| 欧美综合色免费| 石原莉奈在线亚洲二区| 日韩你懂的在线观看| 国产毛片一区二区| 欧美激情综合五月色丁香| 懂色av一区二区三区免费观看| 国产精品亲子乱子伦xxxx裸| 97久久精品人人爽人人爽蜜臀| 亚洲色图在线视频| 精品视频一区三区九区| 蜜臀av亚洲一区中文字幕| 久久亚洲一区二区三区四区| 成人h精品动漫一区二区三区| 亚洲色图自拍偷拍美腿丝袜制服诱惑麻豆| a4yy欧美一区二区三区| 亚洲国产精品久久艾草纯爱 | 色婷婷综合在线| 亚洲福利视频一区二区| 欧美v日韩v国产v| 高清成人免费视频| 依依成人综合视频| 欧美一区午夜视频在线观看| 高清不卡一二三区| 一区二区三区在线影院| 欧美一区二区啪啪| 成人黄色免费短视频| 亚洲电影一级黄|