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

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

?? inet.c

?? MCS-51的一個(gè)Free小型操作系統(tǒng),在KeilC中下編譯工作
?? C
字號(hào):
/* * 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> * *//* inet.c * * Functions common to all TCP/IP modules, such as the Internet checksum and the * byte order functions. * */#include "lwip/opt.h"#include "lwip/arch.h"#include "lwip/def.h"#include "lwip/inet.h"#include "lwip/sys.h"/* This is a reference implementation of the checksum algorithm, with the * aim of being simple, correct and fully portable. Checksumming is the * first thing you would want to optimize for your platform. You will * need to port it to your architecture and in your sys_arch.h: *  * #define LWIP_CHKSUM <your_checksum_routine> */#ifndef LWIP_CHKSUM#define LWIP_CHKSUM lwip_standard_chksum/** * lwip checksum * * @param dataptr points to start of data to be summed at any boundary * @param len length of data to be summed * @return host order (!) lwip checksum (non-inverted Internet sum)  * * @note accumulator size limits summable lenght to 64k * @note host endianess is irrelevant (p3 RFC1071) */static u16_tlwip_standard_chksum(void *dataptr, u16_t len){  u32_t acc;  u16_t src;  u8_t *octetptr;  acc = 0;  /* dataptr may be at odd or even addresses */  octetptr = (u8_t*)dataptr;  while (len > 1)  {    /* declare first octet as most significant       thus assume network order, ignoring host order */    src = (*octetptr) << 8;    octetptr++;    /* declare second octet as least significant */    src |= (*octetptr);    octetptr++;    acc += src;    len -= 2;  }  if (len > 0)  {    /* accumulate remaining octet */    src = (*octetptr) << 8;    acc += src;  }  /* add deferred carry bits */  acc = (acc >> 16) + (acc & 0x0000ffffUL);  if ((acc & 0xffff0000) != 0) {    acc = (acc >> 16) + (acc & 0x0000ffffUL);  }  /* This maybe a little confusing: reorder sum using htons()     instead of ntohs() since it has a little less call overhead.     The caller must invert bits for Internet sum ! */  return htons((u16_t)acc);}#endif#if 0/* * Curt McDowell * Broadcom Corp. * csm@broadcom.com * * IP checksum two bytes at a time with support for * unaligned buffer. * Works for len up to and including 0x20000. * by Curt McDowell, Broadcom Corp. 12/08/2005 */static u16_tlwip_standard_chksum2(void *dataptr, int len){  u8_t *pb = dataptr;  u16_t *ps, t = 0;  u32_t sum = 0;  int odd = ((u32_t)pb & 1);  /* Get aligned to u16_t */  if (odd && len > 0) {    ((u8_t *)&t)[1] = *pb++;    len--;  }  /* Add the bulk of the data */  ps = (u16_t *)pb;  while (len > 1) {    sum += *ps++;    len -= 2;  }  /* Consume left-over byte, if any */  if (len > 0)    ((u8_t *)&t)[0] = *(u8_t *)ps;;  /* Add end bytes */  sum += t;  /*  Fold 32-bit sum to 16 bits */  while (sum >> 16)    sum = (sum & 0xffff) + (sum >> 16);  /* Swap if alignment was odd */  if (odd)    sum = ((sum & 0xff) << 8) | ((sum & 0xff00) >> 8);  return sum;}/** * An optimized checksum routine. Basically, it uses loop-unrolling on * the checksum loop, treating the head and tail bytes specially, whereas * the inner loop acts on 8 bytes at a time.  * * @arg start of buffer to be checksummed. May be an odd byte address. * @len number of bytes in the buffer to be checksummed. *  * @todo First argument type conflicts with generic checksum routine. *  * by Curt McDowell, Broadcom Corp. December 8th, 2005 */static u16_tlwip_standard_chksum4(u8_t *pb, int len){  u16_t *ps, t = 0;  u32_t *pl;  u32_t sum = 0, tmp;  /* starts at odd byte address? */  int odd = ((u32_t)pb & 1);  if (odd && len > 0) {    ((u8_t *)&t)[1] = *pb++;    len--;  }  ps = (u16_t *)pb;  if (((u32_t)ps & 3) && len > 1) {    sum += *ps++;    len -= 2;  }  pl = (u32_t *)ps;  while (len > 7)  {    tmp = sum + *pl++;          /* ping */    if (tmp < sum)      tmp++;                    /* add back carry */    sum = tmp + *pl++;          /* pong */    if (sum < tmp)      sum++;                    /* add back carry */    len -= 8;  }  /* make room in upper bits */  sum = (sum >> 16) + (sum & 0xffff);  ps = (u16_t *)pl;  /* 16-bit aligned word remaining? */  while (len > 1) {    sum += *ps++;    len -= 2;  }  /* dangling tail byte remaining? */  if (len > 0)                  /* include odd byte */    ((u8_t *)&t)[0] = *(u8_t *)ps;  sum += t;                     /* add end bytes */  while (sum >> 16)             /* combine halves */    sum = (sum >> 16) + (sum & 0xffff);  if (odd)    sum = ((sum & 0xff) << 8) | ((sum & 0xff00) >> 8);  return sum;}#endif/* inet_chksum_pseudo: * * Calculates the pseudo Internet checksum used by TCP and UDP for a pbuf chain. */u16_tinet_chksum_pseudo(struct pbuf *p,       struct ip_addr *src, struct ip_addr *dest,       u8_t proto, u16_t proto_len){  u32_t acc;  struct pbuf *q;  u8_t swapped;  acc = 0;  swapped = 0;  /* iterate through all pbuf in chain */  for(q = p; q != NULL; q = q->next) {    LWIP_DEBUGF(INET_DEBUG, ("inet_chksum_pseudo(): checksumming pbuf %p (has next %p) \n",      (void *)q, (void *)q->next));    acc += LWIP_CHKSUM(q->payload, q->len);    /*LWIP_DEBUGF(INET_DEBUG, ("inet_chksum_pseudo(): unwrapped lwip_chksum()=%"X32_F" \n", acc));*/    while (acc >> 16) {      acc = (acc & 0xffffUL) + (acc >> 16);    }    if (q->len % 2 != 0) {      swapped = 1 - swapped;      acc = ((acc & 0xff) << 8) | ((acc & 0xff00UL) >> 8);    }    /*LWIP_DEBUGF(INET_DEBUG, ("inet_chksum_pseudo(): wrapped lwip_chksum()=%"X32_F" \n", acc));*/  }  if (swapped) {    acc = ((acc & 0xff) << 8) | ((acc & 0xff00UL) >> 8);  }  acc += (src->addr & 0xffffUL);  acc += ((src->addr >> 16) & 0xffffUL);  acc += (dest->addr & 0xffffUL);  acc += ((dest->addr >> 16) & 0xffffUL);  acc += (u32_t)htons((u16_t)proto);  acc += (u32_t)htons(proto_len);  while (acc >> 16) {    acc = (acc & 0xffffUL) + (acc >> 16);  }  LWIP_DEBUGF(INET_DEBUG, ("inet_chksum_pseudo(): pbuf chain lwip_chksum()=%"X32_F"\n", acc));  return (u16_t)~(acc & 0xffffUL);}/* inet_chksum: * * Calculates the Internet checksum over a portion of memory. Used primarely for IP * and ICMP. */u16_tinet_chksum(void *dataptr, u16_t len){  u32_t acc;  acc = LWIP_CHKSUM(dataptr, len);  while (acc >> 16) {    acc = (acc & 0xffff) + (acc >> 16);  }  return (u16_t)~(acc & 0xffff);}u16_tinet_chksum_pbuf(struct pbuf *p){  u32_t acc;  struct pbuf *q;  u8_t swapped;  acc = 0;  swapped = 0;  for(q = p; q != NULL; q = q->next) {    acc += LWIP_CHKSUM(q->payload, q->len);    while (acc >> 16) {      acc = (acc & 0xffffUL) + (acc >> 16);    }    if (q->len % 2 != 0) {      swapped = 1 - swapped;      acc = (acc & 0x00ffUL << 8) | (acc & 0xff00UL >> 8);    }  }  if (swapped) {    acc = ((acc & 0x00ffUL) << 8) | ((acc & 0xff00UL) >> 8);  }  return (u16_t)~(acc & 0xffffUL);}/* Here for now until needed in other places in lwIP */#ifndef isascii#define in_range(c, lo, up)  ((u8_t)c >= lo && (u8_t)c <= up)#define isascii(c)           in_range(c, 0x20, 0x7f)#define isdigit(c)           in_range(c, '0', '9')#define isxdigit(c)          (isdigit(c) || in_range(c, 'a', 'f') || in_range(c, 'A', 'F'))#define islower(c)           in_range(c, 'a', 'z')#define isspace(c)           (c == ' ' || c == '\f' || c == '\n' || c == '\r' || c == '\t' || c == '\v')#endif				 /*  * Ascii internet address interpretation routine.  * The value returned is in network order.  */ /*  */ /* inet_addr */ u32_t inet_addr(const char *cp) {     struct in_addr val;     if (inet_aton(cp, &val)) {         return (val.s_addr);     }     return (INADDR_NONE); } /*  * Check whether "cp" is a valid ascii representation  * of an Internet address and convert to a binary address.  * Returns 1 if the address is valid, 0 if not.  * This replaces inet_addr, the return value from which  * cannot distinguish between failure and a local broadcast address.  */ /*  */ /* inet_aton */ s8_t inet_aton(const char *cp, struct in_addr *addr) {     u32_t val;     s32_t base, n;     char c;     u32_t parts[4];     u32_t* pp = parts;     c = *cp;     for (;;) {         /*          * Collect number up to ``.''.          * Values are specified as for C:          * 0x=hex, 0=octal, isdigit=decimal.          */         if (!isdigit(c))             return (0);         val = 0; base = 10;         if (c == '0') {             c = *++cp;             if (c == 'x' || c == 'X')                 base = 16, c = *++cp;             else                 base = 8;         }         for (;;) {             if (isdigit(c)) {                 val = (val * base) + (s16_t)(c - '0');                 c = *++cp;             } else if (base == 16 && isxdigit(c)) {                 val = (val << 4) |                     (s16_t)(c + 10 - (islower(c) ? 'a' : 'A'));                 c = *++cp;             } else             break;         }         if (c == '.') {             /*              * Internet format:              *  a.b.c.d              *  a.b.c   (with c treated as 16 bits)              *  a.b (with b treated as 24 bits)              */             if (pp >= parts + 3)                 return (0);             *pp++ = val;             c = *++cp;         } else             break;     }     /*      * Check for trailing characters.      */     if (c != '\0' && (!isascii(c) || !isspace(c)))         return (0);     /*      * Concoct the address according to      * the number of parts specified.      */     n = pp - parts + 1;     switch (n) {     case 0:         return (0);     /* initial nondigit */     case 1:             /* a -- 32 bits */         break;     case 2:             /* a.b -- 8.24 bits */         if (val > 0xffffff)             return (0);         val |= parts[0] << 24;         break;     case 3:             /* a.b.c -- 8.8.16 bits */         if (val > 0xffff)             return (0);         val |= (parts[0] << 24) | (parts[1] << 16);         break;     case 4:             /* a.b.c.d -- 8.8.8.8 bits */         if (val > 0xff)             return (0);         val |= (parts[0] << 24) | (parts[1] << 16) | (parts[2] << 8);         break;     }     if (addr)         addr->s_addr = htonl(val);     return (1); }/* Convert numeric IP address into decimal dotted ASCII representation. * returns ptr to static buffer; not reentrant! */char *inet_ntoa(struct in_addr addr){  static char str[16];  u32_t s_addr = addr.s_addr;  char inv[3];  char *rp;  u8_t *ap;  u8_t rem;  u8_t n;  u8_t i;  rp = str;  ap = (u8_t *)&s_addr;  for(n = 0; n < 4; n++) {    i = 0;    do {      rem = *ap % (u8_t)10;      *ap /= (u8_t)10;      inv[i++] = '0' + rem;    } while(*ap);    while(i--)      *rp++ = inv[i];    *rp++ = '.';    ap++;  }  *--rp = 0;  return str;}#ifndef BYTE_ORDER#error BYTE_ORDER is not defined#endif#if BYTE_ORDER == LITTLE_ENDIANu16_thtons(u16_t n){  return ((n & 0xff) << 8) | ((n & 0xff00) >> 8);}u16_tntohs(u16_t n){  return htons(n);}u32_thtonl(u32_t n){  return ((n & 0xff) << 24) |    ((n & 0xff00) << 8) |    ((n & 0xff0000) >> 8) |    ((n & 0xff000000) >> 24);}u32_tntohl(u32_t n){  return htonl(n);}#endif /* BYTE_ORDER == LITTLE_ENDIAN */

?? 快捷鍵說(shuō)明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美日韩在线播| 精品处破学生在线二十三| 99re在线视频这里只有精品| 国产盗摄一区二区| 国产麻豆精品视频| 国内精品免费**视频| 免费人成黄页网站在线一区二区| av影院午夜一区| 国产精品一区二区在线观看网站| 狠狠色综合播放一区二区| 国产在线精品一区二区夜色| 九九精品一区二区| 国产精品一二二区| 成人国产精品免费观看视频| 99精品久久免费看蜜臀剧情介绍| 99久久综合狠狠综合久久| 99国产精品久久久久久久久久久| 99久久99精品久久久久久| 91成人在线观看喷潮| 欧美精品一卡二卡| 欧美一区二区二区| 久久久五月婷婷| 中文字幕一区二区三区四区不卡| 亚洲黄色小说网站| 男女男精品网站| 国产一区 二区| av不卡在线播放| 91高清视频免费看| 日韩午夜激情视频| 中文字幕精品一区二区精品绿巨人| 国产精品美女久久久久久久网站| 亚洲免费观看高清完整版在线观看熊| 亚洲无线码一区二区三区| 美女国产一区二区| 不卡的av中国片| 欧美日韩一二区| 精品成人佐山爱一区二区| 亚洲欧美中日韩| 亚洲成年人影院| 国产一二精品视频| 一本色道亚洲精品aⅴ| 欧美一区二区视频在线观看| 亚洲成人免费影院| 韩日精品视频一区| 91在线视频在线| 日韩丝袜美女视频| 亚洲色图欧洲色图婷婷| 日韩电影一区二区三区四区| 国产69精品久久久久毛片| 欧美性色欧美a在线播放| 精品国精品自拍自在线| 最新国产の精品合集bt伙计| 免费看黄色91| 91影视在线播放| 日韩欧美一区二区久久婷婷| 中文字幕欧美一区| 久久97超碰色| 欧美中文字幕一区| 国产欧美日韩精品在线| 同产精品九九九| 成熟亚洲日本毛茸茸凸凹| 9191国产精品| 亚洲男人的天堂av| 国产老妇另类xxxxx| 欧美日韩精品电影| 综合久久一区二区三区| 久久成人久久爱| 欧美综合亚洲图片综合区| 国产欧美综合色| 美国欧美日韩国产在线播放| 日本乱人伦aⅴ精品| 国产精品五月天| 久久国产精品99精品国产 | 在线播放91灌醉迷j高跟美女| 欧美国产欧美综合| 久久爱www久久做| 欧美日韩一区二区三区四区五区| 国产精品无人区| 狠狠网亚洲精品| 欧美一区二区三区视频免费播放| 亚洲精选一二三| 99精品国产99久久久久久白柏| 欧美mv和日韩mv的网站| 天天综合天天综合色| 色婷婷av一区二区三区大白胸 | 韩国一区二区视频| 欧美精三区欧美精三区| 亚洲美女视频一区| 国产成a人亚洲精| www亚洲一区| 激情图区综合网| 日韩一卡二卡三卡| 日韩二区三区在线观看| 欧美日韩第一区日日骚| 一区二区三区日韩精品视频| 成人黄色电影在线| 国产欧美精品区一区二区三区| 久久99精品久久久久| 日韩一级片在线播放| 婷婷一区二区三区| 欧美日本在线观看| 亚洲444eee在线观看| 欧美色精品在线视频| 一区二区三区精品| 91豆麻精品91久久久久久| 亚洲免费观看在线视频| 91免费在线视频观看| 亚洲男人的天堂一区二区| 色94色欧美sute亚洲线路一ni| 亚洲精品视频一区二区| 国产日产欧产精品推荐色| 国产成人精品亚洲午夜麻豆| 久久久电影一区二区三区| 国产91精品一区二区麻豆亚洲| 国产亚洲成aⅴ人片在线观看| 国产精品系列在线观看| 国产人久久人人人人爽| 不卡大黄网站免费看| 亚洲欧美日韩中文字幕一区二区三区| 99re在线精品| 亚洲国产婷婷综合在线精品| 欧美人狂配大交3d怪物一区| 免费在线观看一区| 久久网这里都是精品| 成人精品高清在线| 一区二区三区欧美在线观看| 欧美日本一道本| 久久99精品久久久久久国产越南| 久久久久国产精品厨房| 91免费视频网| 日韩国产欧美视频| 日韩限制级电影在线观看| 国产成人午夜视频| 亚洲色图自拍偷拍美腿丝袜制服诱惑麻豆 | 青青草国产成人99久久| 久久精品一区二区三区不卡 | 6080yy午夜一二三区久久| 美女视频黄免费的久久| 国产欧美一区二区精品性| 99国产精品久久久久久久久久| 亚洲自拍欧美精品| ww亚洲ww在线观看国产| 一本到不卡免费一区二区| 日本一不卡视频| 国产精品丝袜黑色高跟| 在线欧美小视频| 国产主播一区二区三区| 亚洲欧美一区二区三区孕妇| 日韩亚洲欧美成人一区| www..com久久爱| 日韩一区精品字幕| 一区视频在线播放| 日韩一区二区在线观看| 成人动漫在线一区| 蜜臀久久99精品久久久久久9| 国产精品乱子久久久久| 欧美一区日韩一区| 成人午夜精品在线| 日韩成人免费看| 亚洲欧洲在线观看av| 欧美大度的电影原声| 91色婷婷久久久久合中文| 男人的天堂亚洲一区| 国产精品传媒入口麻豆| 91麻豆精品国产91久久久久久久久| 国产精品888| 日韩精品视频网站| 《视频一区视频二区| 欧美成人猛片aaaaaaa| 欧美中文字幕一二三区视频| 国产精品乡下勾搭老头1| 日韩精品一二三| 一区二区三区中文字幕电影| 国产欧美一区二区三区在线老狼| 69堂国产成人免费视频| 色偷偷成人一区二区三区91| 福利一区福利二区| 麻豆久久一区二区| 午夜电影网一区| 一区二区三区日韩精品视频| 黑人巨大精品欧美一区| 午夜久久久影院| 伊人夜夜躁av伊人久久| 久久久久成人黄色影片| 日韩欧美一级在线播放| 7777精品久久久大香线蕉 | 精品av久久707| 在线成人av网站| 在线欧美日韩国产| 91一区在线观看| 99亚偷拍自图区亚洲| 国产成人亚洲综合a∨猫咪| 韩国女主播一区二区三区| 青青国产91久久久久久| 亚洲成人自拍一区| 亚洲国产成人va在线观看天堂| 综合久久久久久| 国产精品不卡一区| 国产精品久久午夜夜伦鲁鲁| 久久久91精品国产一区二区三区|