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

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

?? ip6.c

?? MCS-51的一個Free小型操作系統,在KeilC中下編譯工作
?? 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一区二区三区免费野_久草精品视频
yourporn久久国产精品| 欧美aa在线视频| gogo大胆日本视频一区| 国产日产欧产精品推荐色| 国产一区二区导航在线播放| 国产亚洲一区二区三区四区| 成人免费视频播放| 亚洲品质自拍视频| 欧美网站大全在线观看| 美女看a上一区| 久久久综合九色合综国产精品| 国产福利视频一区二区三区| 国产精品久久久久永久免费观看 | 国产一区二区三区日韩| 亚洲国产精品成人综合色在线婷婷| 国产传媒日韩欧美成人| 国产精品大尺度| 91成人免费电影| 毛片基地黄久久久久久天堂| 日本一区二区三区四区在线视频 | 国产成人av电影在线| 亚洲三级久久久| 欧美精品高清视频| 国产精品资源站在线| 亚洲综合色婷婷| 精品国免费一区二区三区| 国产一区福利在线| 一区二区成人在线观看| 欧美xxxx老人做受| 色88888久久久久久影院按摩| 日本欧美加勒比视频| 久久久亚洲高清| 欧美三级一区二区| 国产一区二区三区综合| 夜夜嗨av一区二区三区中文字幕| 欧美va亚洲va| 在线观看日韩一区| 国产a精品视频| 奇米精品一区二区三区四区| 中文字幕在线一区免费| 日韩欧美中文一区| 在线观看免费成人| 国产suv精品一区二区883| 亚洲一区二区视频在线| 国产三级久久久| 欧美精品乱码久久久久久 | 中文字幕+乱码+中文字幕一区| 欧美午夜精品一区二区三区 | 日韩制服丝袜av| 日韩一区二区三区免费看| 国产福利一区二区| 日韩成人免费看| 亚洲欧美一区二区三区孕妇| 久久一日本道色综合| 91精品国产一区二区三区蜜臀| av福利精品导航| 国产精品一区久久久久| 日本不卡一二三| 亚洲国产一二三| 国产精品免费aⅴ片在线观看| 久久嫩草精品久久久久| 欧美大片在线观看一区| 欧美伦理电影网| 欧美亚洲一区二区在线观看| 99久久国产免费看| 成人激情av网| 成人午夜av电影| 国产成人在线视频网站| 韩国午夜理伦三级不卡影院| 日本不卡不码高清免费观看| 午夜精品一区在线观看| 亚洲成人在线免费| 亚洲国产成人高清精品| 亚洲高清免费观看| 亚洲电影一区二区三区| 亚洲伊人伊色伊影伊综合网| 亚洲激情自拍视频| 一区二区三区蜜桃| 亚洲国产日韩精品| 亚洲午夜免费福利视频| 午夜电影网亚洲视频| 午夜电影久久久| 蜜臀久久99精品久久久画质超高清| 亚洲成人三级小说| 亚洲地区一二三色| 青青草伊人久久| 国产一区亚洲一区| 不卡区在线中文字幕| 成人一区二区三区在线观看| 成人h精品动漫一区二区三区| 99国产精品久| 在线国产电影不卡| 日韩欧美久久久| 久久美女艺术照精彩视频福利播放 | 一区二区三区不卡在线观看| 亚洲成在人线在线播放| 日韩国产欧美在线观看| 麻豆精品视频在线| 丰满少妇久久久久久久| 色婷婷综合久久久久中文一区二区| 欧美在线制服丝袜| 日韩欧美视频在线| 国产日本一区二区| 亚洲综合色婷婷| 久久99久久99| www.亚洲精品| 欧美日韩亚洲国产综合| 日韩欧美国产高清| 国产日本亚洲高清| 亚洲电影一级片| 国产精品123| 在线观看三级视频欧美| 日韩美女一区二区三区四区| 中文字幕不卡的av| 日韩精品一级中文字幕精品视频免费观看 | 黄色资源网久久资源365| aaa亚洲精品| 91精品欧美综合在线观看最新| 国产喂奶挤奶一区二区三区| 亚洲综合图片区| 国产黄色成人av| 欧美色综合网站| 欧美国产日韩在线观看| 日本在线播放一区二区三区| 成a人片国产精品| 日韩视频免费观看高清在线视频| 亚洲欧洲精品一区二区精品久久久| 午夜激情一区二区| 99麻豆久久久国产精品免费| 555www色欧美视频| 亚洲欧美日韩一区| 国产一区二区三区四区五区入口| 欧美亚洲综合另类| 国产精品成人一区二区艾草| 美腿丝袜一区二区三区| 色94色欧美sute亚洲线路二| 精品对白一区国产伦| 亚洲国产cao| 97se亚洲国产综合自在线| 久久久久久久综合色一本| 一区二区成人在线| 色综合网色综合| 国产亚洲人成网站| 狠狠色狠狠色综合日日91app| 欧美三级日韩三级| 亚洲精品中文字幕乱码三区| 国产精品系列在线观看| 日韩情涩欧美日韩视频| 午夜激情一区二区| 欧美少妇性性性| 一区二区三区免费观看| 一本色道久久综合亚洲aⅴ蜜桃| 久久蜜桃av一区精品变态类天堂| 日本午夜一区二区| 欧美日韩亚洲不卡| 亚洲国产婷婷综合在线精品| 色综合久久天天| 中文字幕日韩av资源站| 成人网男人的天堂| 国产欧美日韩在线看| 国产一区二区h| 久久你懂得1024| 国产一区二区在线观看免费| 日韩欧美一区二区在线视频| 午夜久久久影院| 欧美福利视频一区| 日日骚欧美日韩| 5566中文字幕一区二区电影| 午夜精品123| 日韩欧美精品三级| 美女国产一区二区| 精品国产三级电影在线观看| 美腿丝袜在线亚洲一区| 欧美va亚洲va在线观看蝴蝶网| 久88久久88久久久| 2023国产精品视频| 激情五月婷婷综合网| 久久精品人人做人人爽97| 成人午夜在线播放| 亚洲人成7777| 欧美精品v日韩精品v韩国精品v| 午夜久久久影院| 精品国产乱码久久久久久老虎| 国内精品在线播放| 日韩一区有码在线| 欧美午夜理伦三级在线观看| 日韩成人免费在线| 国产欧美日韩另类视频免费观看| 成人美女在线观看| 亚洲成av人影院| 精品对白一区国产伦| 99久久久久免费精品国产| 亚洲午夜精品网| 91精品国产色综合久久不卡电影 | 欧美日本一道本| 久久精品国产精品亚洲红杏| 久久久www免费人成精品| 91在线国内视频| 日本系列欧美系列| 中文欧美字幕免费|