亚洲欧美第一页_禁久久精品乱码_粉嫩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人片在www色猫咪| 亚洲女厕所小便bbb| 国产精品不卡视频| 亚洲视频一区在线| 亚洲色图.com| 亚洲一区二区三区四区在线| 亚洲精选在线视频| 亚洲成人综合网站| 久久99深爱久久99精品| 国产精品一区二区三区乱码 | 亚洲精品国产无套在线观| 亚洲人成7777| 青青草视频一区| 老司机精品视频一区二区三区| 久久国产精品露脸对白| 国产91色综合久久免费分享| 成人一区二区在线观看| 欧美在线视频不卡| 日韩三级.com| 国产精品视频你懂的| 亚洲老妇xxxxxx| 秋霞av亚洲一区二区三| 欧美视频完全免费看| 欧美一级专区免费大片| 久久一日本道色综合| 亚洲同性同志一二三专区| 亚洲大片一区二区三区| 国产成人综合亚洲网站| 91影院在线免费观看| 欧美一区二区三区色| 欧美国产日本韩| 亚洲成人动漫精品| 成人高清免费观看| 欧美精品第一页| 国产精品卡一卡二| 全部av―极品视觉盛宴亚洲| 99视频精品全部免费在线| 欧美酷刑日本凌虐凌虐| 国产精品乱子久久久久| 日韩电影在线看| av电影天堂一区二区在线| 欧美高清你懂得| 亚洲人成伊人成综合网小说| 国内精品视频666| 欧美精品一卡二卡| 国产精品国产自产拍在线| 免费高清在线视频一区·| 成人91在线观看| 久久久三级国产网站| 日韩精品电影在线| 91丨国产丨九色丨pron| 久久精品视频在线免费观看| 日韩精品亚洲专区| 欧美亚洲动漫制服丝袜| 亚洲视频一区二区在线观看| 国产精品一品视频| 日韩精品在线一区| 免费久久精品视频| 91精品国产日韩91久久久久久| 一区二区视频在线看| 高清日韩电视剧大全免费| 日韩欧美综合一区| 日本大胆欧美人术艺术动态| xnxx国产精品| 国内精品伊人久久久久av一坑| 欧美美女一区二区| 亚洲18影院在线观看| 欧美亚洲国产怡红院影院| 亚洲色图另类专区| 欧美最猛性xxxxx直播| 9191久久久久久久久久久| 中文字幕在线观看一区| 懂色av一区二区夜夜嗨| 久久久国产精品麻豆| 国产美女久久久久| 中文字幕av在线一区二区三区| 高清不卡在线观看| 国产精品久久久久久亚洲毛片 | 免费观看一级特黄欧美大片| 欧美日韩免费观看一区三区| 亚洲成人av一区二区| 欧美性大战久久| 国产精品一级片在线观看| 久久精品亚洲一区二区三区浴池| 国产伦精品一区二区三区免费迷| 久久久久久亚洲综合| 成人黄色在线看| 有坂深雪av一区二区精品| 亚洲免费在线看| 欧美色男人天堂| 婷婷综合另类小说色区| 欧美精品日韩一区| 蜜臀精品一区二区三区在线观看| 精品免费日韩av| 成人免费高清视频在线观看| 久久美女艺术照精彩视频福利播放| 国产日韩av一区| 久久免费精品国产久精品久久久久 | 欧美精品乱人伦久久久久久| 亚洲国产美国国产综合一区二区| 欧美日韩免费观看一区二区三区 | 日韩精品一区二区三区四区视频| 久久er99热精品一区二区| 国产日韩欧美精品电影三级在线| 色婷婷综合久久久久中文一区二区| 亚洲国产精品嫩草影院| www欧美成人18+| 97se亚洲国产综合自在线| 午夜精品一区二区三区电影天堂| 精品国产乱码久久久久久1区2区| jvid福利写真一区二区三区| 婷婷中文字幕综合| 亚洲欧洲av另类| 日韩免费视频一区| 99精品一区二区三区| 麻豆精品视频在线观看免费| 最新热久久免费视频| 日韩一区二区三区电影| 91亚洲国产成人精品一区二三| 捆绑调教一区二区三区| 一区二区三区四区不卡视频| 久久综合九色欧美综合狠狠| 欧美特级限制片免费在线观看| 国产成人午夜精品5599 | 精品一二线国产| 亚洲精品免费电影| 中文字幕va一区二区三区| 日韩欧美色电影| 欧美日本国产视频| 一本色道综合亚洲| 成人高清视频免费观看| 麻豆freexxxx性91精品| 亚洲一区二区欧美激情| 国产精品久久久久久久久免费桃花| 欧美一区二区视频在线观看 | 欧美一级爆毛片| 欧美日韩免费一区二区三区| 日韩精品一区二区三区老鸭窝| 91碰在线视频| av在线不卡网| 99国内精品久久| 成人听书哪个软件好| 国产福利精品导航| 激情六月婷婷久久| 精品一区二区三区视频| 日本欧美一区二区三区| 日韩不卡在线观看日韩不卡视频| 夜夜嗨av一区二区三区网页| 亚洲自拍偷拍图区| 亚洲国产精品久久久久婷婷884| 一区二区在线观看免费| 亚洲一区二区美女| 日日夜夜精品视频天天综合网| 亚洲国产综合色| 日韩国产精品久久久久久亚洲| 亚洲成人免费视| 午夜激情综合网| 久久精品久久99精品久久| 国内精品嫩模私拍在线| 国产不卡在线播放| 成人av免费网站| 在线免费观看一区| 7777精品伊人久久久大香线蕉完整版| 欧美日本在线播放| 日韩精品一区二区三区四区| 国产三级精品视频| 亚洲私人影院在线观看| 一区二区三区成人| 日韩精品午夜视频| 狠狠色2019综合网| 91原创在线视频| 欧美日韩一区二区三区高清| 欧美xxxxxxxxx| √…a在线天堂一区| 亚洲午夜视频在线| 久久电影网电视剧免费观看| 国产不卡在线视频| 欧美三级乱人伦电影| 精品久久国产老人久久综合| 亚洲国产精品成人久久综合一区| 一区二区三区在线免费| 美女网站视频久久| a级精品国产片在线观看| 666欧美在线视频| 日本一区二区高清| 五月婷婷久久丁香| 国产v综合v亚洲欧| 欧美一三区三区四区免费在线看 | 一区二区三区高清| 麻豆成人久久精品二区三区小说| 波多野结衣视频一区| 欧美片网站yy| 中文字幕中文字幕一区二区 | 国产亚洲精品aa午夜观看| 亚洲国产中文字幕在线视频综合 | 日韩理论在线观看| 久久成人av少妇免费| 在线观看视频一区二区欧美日韩 |