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

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

?? uip.c

?? 58enc28j06protuesuip09.rar
?? C
?? 第 1 頁 / 共 4 頁
字號:
/** * \addtogroup uip * @{ *//** * \file * The uIP TCP/IP stack code. * \author Adam Dunkels <adam@dunkels.com> *//* * Copyright (c) 2001-2003, Adam Dunkels. * 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 uIP TCP/IP stack. * * $Id: uip.c,v 1.62.2.10 2003/10/07 13:23:01 adam Exp $ * *//*This is a small implementation of the IP and TCP protocols (as well assome basic ICMP stuff). The implementation couples the IP, TCP and theapplication layers very tightly. To keep the size of the compiled codedown, this code also features heavy usage of the goto statement.The principle is that we have a small buffer, called the uip_buf, inwhich the device driver puts an incoming packet. The TCP/IP stackparses the headers in the packet, and calls upon the application. Ifthe remote host has sent data to the application, this data is presentin the uip_buf and the application read the data from there. It is upto the application to put this data into a byte stream if needed. Theapplication will not be fed with data that is out of sequence.If the application whishes to send data to the peer, it should put itsdata into the uip_buf, 40 bytes from the start of the buffer. TheTCP/IP stack will calculate the checksums, and fill in the necessaryheader fields and finally send the packet back to the peer.*/#include "uip.h"#include "uipopt.h"#include "uip_arch.h"#include "uart.h"
#include "myopt.h"/*-----------------------------------------------------------------------------------*//* Variable definitions. *//* The IP address of this host. If it is defined to be fixed (by setting UIP_FIXEDADDR to 1 in uipopt.h), the address is set here. Otherwise, the address */#if UIP_FIXEDADDR > 0const u16_t uip_hostaddr[2] =  {HTONS((UIP_IPADDR0 << 8) | UIP_IPADDR1),   HTONS((UIP_IPADDR2 << 8) | UIP_IPADDR3)};const u16_t uip_arp_draddr[2] =  {HTONS((UIP_DRIPADDR0 << 8) | UIP_DRIPADDR1),   HTONS((UIP_DRIPADDR2 << 8) | UIP_DRIPADDR3)};const u16_t uip_arp_netmask[2] =  {HTONS((UIP_NETMASK0 << 8) | UIP_NETMASK1),   HTONS((UIP_NETMASK2 << 8) | UIP_NETMASK3)};#elseu16_t uip_hostaddr[2];       u16_t uip_arp_draddr[2], uip_arp_netmask[2];#endif /* UIP_FIXEDADDR */u8_t uip_buf[UIP_BUFSIZE+2];   /* The packet buffer that contains				incoming packets. */volatile u8_t *uip_appdata;  /* The uip_appdata pointer points to				application data. */volatile u8_t *uip_sappdata;  /* The uip_appdata pointer points to the				 application data which is to be sent. */#if UIP_URGDATA > 0volatile u8_t *uip_urgdata;  /* The uip_urgdata pointer points to				urgent data (out-of-band data), if				present. */volatile u8_t uip_urglen, uip_surglen;#endif /* UIP_URGDATA > 0 */volatile u16_t uip_len, uip_slen;                             /* The uip_len is either 8 or 16 bits,				depending on the maximum packet				size. */volatile u8_t uip_flags;     /* The uip_flags variable is used for				communication between the TCP/IP stack				and the application program. */struct uip_conn *uip_conn;   /* uip_conn always points to the current				connection. */struct uip_conn uip_conns[UIP_CONNS];                             /* The uip_conns array holds all TCP				connections. */u16_t uip_listenports[UIP_LISTENPORTS];                             /* The uip_listenports list all currently				listning ports. */#if UIP_UDPstruct uip_udp_conn *uip_udp_conn;struct uip_udp_conn uip_udp_conns[UIP_UDP_CONNS];#endif /* UIP_UDP */static u16_t ipid;           /* Ths ipid variable is an increasing				number that is used for the IP ID				field. */static u8_t iss[4];          /* The iss variable is used for the TCP				initial sequence number. */#if UIP_ACTIVE_OPENstatic u16_t lastport;       /* Keeps track of the last port used for				a new connection. */#endif /* UIP_ACTIVE_OPEN *//* Temporary variables. */volatile u8_t uip_acc32[4];static u8_t c, opt;static u16_t tmp16;/* Structures and definitions. */#define TCP_FIN 0x01#define TCP_SYN 0x02#define TCP_RST 0x04#define TCP_PSH 0x08#define TCP_ACK 0x10#define TCP_URG 0x20#define TCP_CTL 0x3f#define ICMP_ECHO_REPLY 0#define ICMP_ECHO       8     /* Macros. */#define BUF ((uip_tcpip_hdr *)&uip_buf[UIP_LLH_LEN])#define FBUF ((uip_tcpip_hdr *)&uip_reassbuf[0])#define ICMPBUF ((uip_icmpip_hdr *)&uip_buf[UIP_LLH_LEN])#define UDPBUF ((uip_udpip_hdr *)&uip_buf[UIP_LLH_LEN])#if UIP_STATISTICS == 1struct uip_stats uip_stat;#define UIP_STAT(s) s#else#define UIP_STAT(s)#endif /* UIP_STATISTICS == 1 */#if UIP_LOGGING == 1#include <stdio.h>void uip_log(char *msg);#define UIP_LOG(m) uip_log(m)#else#define UIP_LOG(m)#endif /* UIP_LOGGING == 1 *//*-----------------------------------------------------------------------------------*/voiduip_init(void){  for(c = 0; c < UIP_LISTENPORTS; ++c) {    uip_listenports[c] = 0;  }  for(c = 0; c < UIP_CONNS; ++c) {    uip_conns[c].tcpstateflags = CLOSED;  }#if UIP_ACTIVE_OPEN  lastport = 1024;#endif /* UIP_ACTIVE_OPEN */#if UIP_UDP  for(c = 0; c < UIP_UDP_CONNS; ++c) {    uip_udp_conns[c].lport = 0;  }#endif /* UIP_UDP */    /* IPv4 initialization. */#if UIP_FIXEDADDR == 0  uip_hostaddr[0] = uip_hostaddr[1] = 0;#endif /* UIP_FIXEDADDR */}/*-----------------------------------------------------------------------------------*/#if UIP_ACTIVE_OPENstruct uip_conn *uip_connect(u16_t *ripaddr, u16_t rport){  register struct uip_conn *conn, *cconn;    /* Find an unused local port. */ again:  ++lastport;  if(lastport >= 32000) {    lastport = 4096;  }  /* Check if this port is already in use, and if so try to find     another one. */  for(c = 0; c < UIP_CONNS; ++c) {    conn = &uip_conns[c];    if(conn->tcpstateflags != CLOSED &&       conn->lport == htons(lastport)) {      goto again;    }  }  conn = 0;  for(c = 0; c < UIP_CONNS; ++c) {    cconn = &uip_conns[c];     if(cconn->tcpstateflags == CLOSED) {      conn = cconn;      break;    }    if(cconn->tcpstateflags == TIME_WAIT) {      if(conn == 0 ||	 cconn->timer > uip_conn->timer) {	conn = cconn;      }    }  }  if(conn == 0) {    return 0;  }    conn->tcpstateflags = SYN_SENT;  conn->snd_nxt[0] = iss[0];  conn->snd_nxt[1] = iss[1];  conn->snd_nxt[2] = iss[2];  conn->snd_nxt[3] = iss[3];  conn->initialmss = conn->mss = UIP_TCP_MSS;    conn->len = 1;   /* TCP length of the SYN is one. */  conn->nrtx = 0;  conn->timer = 1; /* Send the SYN next time around. */  conn->rto = UIP_RTO;  conn->sa = 0;  conn->sv = 16;  conn->lport = htons(lastport);  conn->rport = rport;  conn->ripaddr[0] = ripaddr[0];  conn->ripaddr[1] = ripaddr[1];    return conn;}#endif /* UIP_ACTIVE_OPEN *//*-----------------------------------------------------------------------------------*/#if UIP_UDPstruct uip_udp_conn *uip_udp_new(u16_t *ripaddr, u16_t rport){  register struct uip_udp_conn *conn;    /* Find an unused local port. */ again:  ++lastport;  if(lastport >= 32000) {    lastport = 4096;  }    for(c = 0; c < UIP_UDP_CONNS; ++c) {    if(uip_udp_conns[c].lport == lastport) {      goto again;    }  }  conn = 0;  for(c = 0; c < UIP_UDP_CONNS; ++c) {    if(uip_udp_conns[c].lport == 0) {      conn = &uip_udp_conns[c];       break;    }  }  if(conn == 0) {    return 0;  }    conn->lport = HTONS(lastport);  conn->rport = HTONS(rport);  conn->ripaddr[0] = ripaddr[0];  conn->ripaddr[1] = ripaddr[1];    return conn;}#endif /* UIP_UDP *//*-----------------------------------------------------------------------------------*/voiduip_unlisten(u16_t port){  for(c = 0; c < UIP_LISTENPORTS; ++c) {    if(uip_listenports[c] == port) {      uip_listenports[c] = 0;      return;    }  }}/*-----------------------------------------------------------------------------------*/voiduip_listen(u16_t port){  for(c = 0; c < UIP_LISTENPORTS; ++c) {    if(uip_listenports[c] == 0) {      uip_listenports[c] = port;      return;    }  }}/*-----------------------------------------------------------------------------------*//* XXX: IP fragment reassembly: not well-tested. */#if UIP_REASSEMBLY#define UIP_REASS_BUFSIZE (UIP_BUFSIZE - UIP_LLH_LEN)static u8_t uip_reassbuf[UIP_REASS_BUFSIZE];static u8_t uip_reassbitmap[UIP_REASS_BUFSIZE / (8 * 8)];static const u8_t bitmap_bits[8] = {0xff, 0x7f, 0x3f, 0x1f,				    0x0f, 0x07, 0x03, 0x01};static u16_t uip_reasslen;static u8_t uip_reassflags;#define UIP_REASS_FLAG_LASTFRAG 0x01static u8_t uip_reasstmr;#define IP_HLEN 20#define IP_MF   0x20static u8_tuip_reass(void){  u16_t offset, len;  u16_t i;  /* If ip_reasstmr is zero, no packet is present in the buffer, so we     write the IP header of the fragment into the reassembly     buffer. The timer is updated with the maximum age. */  if(uip_reasstmr == 0) {    memcpy(uip_reassbuf, &BUF->vhl, IP_HLEN);    uip_reasstmr = UIP_REASS_MAXAGE;    uip_reassflags = 0;    /* Clear the bitmap. */    memset(uip_reassbitmap, sizeof(uip_reassbitmap), 0);  }  /* Check if the incoming fragment matches the one currently present     in the reasembly buffer. If so, we proceed with copying the     fragment into the buffer. */  if(BUF->srcipaddr[0] == FBUF->srcipaddr[0] &&     BUF->srcipaddr[1] == FBUF->srcipaddr[1] &&     BUF->destipaddr[0] == FBUF->destipaddr[0] &&     BUF->destipaddr[1] == FBUF->destipaddr[1] &&     BUF->ipid[0] == FBUF->ipid[0] &&     BUF->ipid[1] == FBUF->ipid[1]) {    len = (BUF->len[0] << 8) + BUF->len[1] - (BUF->vhl & 0x0f) * 4;    offset = (((BUF->ipoffset[0] & 0x3f) << 8) + BUF->ipoffset[1]) * 8;    /* If the offset or the offset + fragment length overflows the

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
成人综合在线观看| 亚洲精品在线免费观看视频| 欧美日韩视频在线一区二区| www国产成人| 亚洲小说欧美激情另类| 国产一区二区不卡在线| 欧美四级电影网| 亚洲欧美激情在线| 国产伦精一区二区三区| 欧美乱熟臀69xxxxxx| 中文字幕在线不卡| 国产成人在线视频免费播放| 91麻豆精品国产自产在线观看一区| 国产精品美女一区二区三区| 毛片av中文字幕一区二区| 欧美性色黄大片手机版| 国产精品久久网站| 国产不卡一区视频| 久久久噜噜噜久久中文字幕色伊伊| 亚洲成年人网站在线观看| 91蜜桃免费观看视频| 国产欧美日韩麻豆91| 韩国欧美国产1区| 日韩美女一区二区三区| 舔着乳尖日韩一区| 欧美视频在线不卡| 无码av中文一区二区三区桃花岛| 欧美在线免费视屏| 亚洲国产视频网站| 欧美色图在线观看| 亚洲成人激情av| 欧美日韩亚洲综合一区| 亚洲成av人**亚洲成av**| 色老头久久综合| 亚洲国产精品嫩草影院| 色国产综合视频| 亚洲地区一二三色| 91精品国产一区二区| 日本欧美在线观看| 2022国产精品视频| 国产福利一区在线观看| 国产日韩欧美精品综合| 北岛玲一区二区三区四区| 国产精品超碰97尤物18| 91蝌蚪porny成人天涯| 亚洲综合自拍偷拍| 欧美久久久久中文字幕| 久久电影网站中文字幕| 久久久噜噜噜久噜久久综合| 丁香激情综合国产| 一区二区视频免费在线观看| 欧美日韩色一区| 经典三级在线一区| 国产精品国产三级国产普通话蜜臀| 97久久精品人人澡人人爽| 亚洲资源在线观看| 欧美大胆人体bbbb| 成人高清免费观看| 亚洲成人免费电影| 国产无遮挡一区二区三区毛片日本| 成人午夜精品在线| 偷拍亚洲欧洲综合| 久久精品在这里| 色婷婷精品久久二区二区蜜臀av | 久久九九影视网| 99视频精品在线| 日本网站在线观看一区二区三区 | 国产美女在线观看一区| 国产精品国产a级| 91麻豆精品国产自产在线观看一区| 国产一区二区不卡老阿姨| 亚洲人成网站色在线观看| 欧美一区二区福利在线| av资源站一区| 精品一区中文字幕| 国产精品白丝在线| 欧美在线观看视频一区二区| 日本伊人午夜精品| 亚洲少妇中出一区| 日韩色在线观看| 91免费版在线| 国产一区二三区| 日韩二区在线观看| 亚洲自拍偷拍欧美| 国产精品免费久久久久| 欧美一级免费大片| 欧美在线免费观看视频| 国产成人高清在线| 久久av老司机精品网站导航| 一个色综合av| 亚洲欧美偷拍卡通变态| 精品欧美一区二区在线观看| 欧美天天综合网| 色综合中文字幕国产 | 国产精品污网站| 欧美一级艳片视频免费观看| 色综合久久久久网| 成人少妇影院yyyy| 国产精品影视网| 另类小说视频一区二区| 午夜不卡av免费| 亚洲图片有声小说| 亚洲精品五月天| 中文字幕日韩av资源站| 国产免费成人在线视频| 久久综合中文字幕| 精品999久久久| 欧美成人a视频| 日韩你懂的在线播放| 欧美高清视频www夜色资源网| 91国偷自产一区二区开放时间 | 国产成人综合视频| 国产很黄免费观看久久| 国产一区中文字幕| 国产一区二区精品在线观看| 精品一区二区在线视频| 裸体在线国模精品偷拍| 免费日韩伦理电影| 久久99精品国产麻豆婷婷| 久久不见久久见中文字幕免费| 美女精品一区二区| 精品一区二区三区香蕉蜜桃| 免播放器亚洲一区| 国产一区二区精品久久99| 国产精品一区二区免费不卡| 国产精品99久| 一本色道久久综合亚洲精品按摩| 91麻豆免费看片| 欧美性欧美巨大黑白大战| 欧美日韩一级黄| 精品久久一区二区三区| 久久嫩草精品久久久精品一| 国产婷婷一区二区| 一色桃子久久精品亚洲| 一区二区三区自拍| 老司机精品视频导航| 国产成人啪免费观看软件| av影院午夜一区| 欧美日韩国产片| 久久久久国产精品厨房| 国产精品电影院| 五月激情综合网| 国产999精品久久| 91成人免费在线视频| 欧美一级在线观看| 亚洲欧洲日本在线| 日韩电影在线一区二区| 国产成a人无v码亚洲福利| 欧美影视一区在线| 日韩精品一区在线| 日韩理论片网站| 奇米影视一区二区三区小说| 成人天堂资源www在线| 欧美日韩国产另类一区| 精品久久久久av影院| 亚洲视频狠狠干| 国内精品自线一区二区三区视频| 色综合久久久网| 久久日韩精品一区二区五区| 亚洲欧美另类小说| 国产一区视频网站| 欧美精品一二三| 中文字幕一区在线观看| 免费观看久久久4p| 91福利精品视频| 中文字幕不卡在线| 极品美女销魂一区二区三区| 色综合婷婷久久| 中文字幕av一区 二区| 日韩精品一区第一页| 97精品久久久久中文字幕| 亚洲精品一区二区精华| 亚洲国产成人av好男人在线观看| 高清在线成人网| 日韩免费福利电影在线观看| 亚洲黄色尤物视频| 99久久er热在这里只有精品66| 精品精品国产高清a毛片牛牛 | 另类中文字幕网| 欧美日韩精品欧美日韩精品| 1000部国产精品成人观看| 国产老肥熟一区二区三区| 日韩三级精品电影久久久 | 成人一区二区视频| 久久久精品免费观看| 日韩在线卡一卡二| 欧美精品 日韩| 亚洲第一av色| 欧美日韩精品一区二区天天拍小说 | 欧美一区午夜视频在线观看| 国产精品乱码妇女bbbb| 国产精品一区免费视频| 精品国产亚洲在线| 国产综合久久久久影院| 欧美sm美女调教| 国产精品一区二区免费不卡| 久久伊99综合婷婷久久伊| 激情丁香综合五月| 久久精品欧美一区二区三区不卡| 久久国产综合精品|