亚洲欧美第一页_禁久久精品乱码_粉嫩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一区二区三区免费野_久草精品视频
亚洲成人第一页| 91看片淫黄大片一级| 午夜精品在线看| 亚洲卡通欧美制服中文| 亚洲色图制服丝袜| 一区二区三区高清不卡| 亚洲线精品一区二区三区| 亚洲国产一二三| 奇米888四色在线精品| 激情五月婷婷综合网| 国产一区二区在线看| 成人午夜在线播放| 色综合久久综合| 欧美高清视频不卡网| 精品人在线二区三区| 欧美大白屁股肥臀xxxxxx| 久久久青草青青国产亚洲免观| 国产欧美日韩综合精品一区二区| 亚洲欧洲精品天堂一级| 怡红院av一区二区三区| 日韩av中文字幕一区二区 | 欧美中文字幕一区二区三区亚洲 | 欧美一三区三区四区免费在线看 | 亚洲一区视频在线| 亚洲va韩国va欧美va精品| 狠狠色丁香久久婷婷综合丁香| 国产一区视频在线看| 91在线云播放| 欧美一区二区三区电影| 国产精品欧美经典| 日日夜夜精品视频免费| 国产91精品久久久久久久网曝门| 在线观看亚洲一区| 精品处破学生在线二十三| 亚洲欧美日韩中文字幕一区二区三区| 亚洲电影一区二区| 国产精品88av| 欧美日韩国产综合一区二区三区| 欧美草草影院在线视频| 亚洲欧美日韩国产手机在线 | 麻豆精品一区二区综合av| 国产精品小仙女| 欧美日韩国产综合一区二区三区 | 国产精品毛片a∨一区二区三区| 亚洲综合一二三区| 成人免费高清在线观看| 日韩一区二区三区观看| 亚洲国产精品久久久久婷婷884| 国产在线精品一区在线观看麻豆| 欧美日韩亚洲综合在线 欧美亚洲特黄一级| 视频一区二区中文字幕| 色先锋aa成人| 国产精品免费av| 午夜精品久久久久久久久久 | 中文一区二区在线观看 | 日韩精品一区二| 亚洲一区二区三区四区在线观看| 高清不卡一二三区| 久久精品男人天堂av| 久久狠狠亚洲综合| 这里只有精品视频在线观看| 夜夜嗨av一区二区三区| 97精品视频在线观看自产线路二| 国产午夜精品一区二区三区四区| 美日韩黄色大片| 日韩色视频在线观看| 午夜一区二区三区在线观看| 日本精品裸体写真集在线观看| 国产精品久久久久久久裸模 | 91精品福利视频| 亚洲欧洲制服丝袜| 色综合欧美在线| 一区二区免费视频| 欧美吻胸吃奶大尺度电影| 一区二区三区在线观看欧美 | 另类的小说在线视频另类成人小视频在线 | 欧美大片顶级少妇| 久久er99精品| 精品国产乱码91久久久久久网站| 久久国产人妖系列| 精品国产一区二区三区忘忧草| 秋霞午夜鲁丝一区二区老狼| 欧美一级视频精品观看| 久久成人免费网| 久久久久久久久久久久久久久99 | 中日韩av电影| 成人av午夜影院| 亚洲三级视频在线观看| 在线免费观看日韩欧美| 亚洲小少妇裸体bbw| 欧美日韩国产一区| 久久99国产精品麻豆| 久久精品在这里| 成人精品视频一区二区三区尤物| 日韩一区日韩二区| 欧美天堂一区二区三区| 毛片不卡一区二区| 国产精品无圣光一区二区| 色综合亚洲欧洲| 免费亚洲电影在线| 久久久久久久综合| 欧美性极品少妇| 国产一区二区三区美女| 亚洲欧美在线aaa| 这里只有精品99re| 成人午夜精品在线| 婷婷开心久久网| 国产亚洲欧美色| 欧美日韩中文字幕精品| 国内精品国产成人国产三级粉色 | 日本一区二区三区四区在线视频 | 成人午夜电影久久影院| 亚洲国产另类av| 国产午夜精品在线观看| 欧美日韩欧美一区二区| 国产成人啪免费观看软件| 亚洲精品免费在线观看| 国产拍欧美日韩视频二区| 欧美精品色一区二区三区| 国产成人在线色| 日本欧洲一区二区| 一区二区三区日韩精品视频| www国产成人免费观看视频 深夜成人网 | 久久免费精品国产久精品久久久久| a级高清视频欧美日韩| 精品一区二区三区在线播放视频| 中文字幕在线播放不卡一区| 精品国产伦一区二区三区观看体验| 91麻豆免费看片| 国产成人精品三级麻豆| 久久精品噜噜噜成人88aⅴ| 亚洲一级二级三级在线免费观看| 国产清纯白嫩初高生在线观看91 | 国产资源精品在线观看| 亚洲一区在线电影| 亚洲欧美另类久久久精品2019| 2024国产精品| 日韩精品一区国产麻豆| 91精品国产高清一区二区三区 | 亚洲综合999| 1024成人网| 中文字幕精品一区二区精品绿巨人 | 国产精品三级久久久久三级| 精品奇米国产一区二区三区| 欧美精品久久天天躁| 日本黄色一区二区| 色噜噜夜夜夜综合网| 色悠久久久久综合欧美99| 99久久精品国产麻豆演员表| 成人国产电影网| 成人av网址在线| 99久久99久久久精品齐齐| 国产xxx精品视频大全| 国产乱国产乱300精品| 国产麻豆欧美日韩一区| 国产一区二区三区精品欧美日韩一区二区三区 | 欧美一区二区在线免费播放| 欧美伦理视频网站| 日韩一级片网站| 欧美大片免费久久精品三p| 精品久久久久久久久久久久包黑料| 日韩免费观看高清完整版 | 1024成人网色www| 一区二区成人在线| 亚洲丰满少妇videoshd| 亚洲日本va午夜在线影院| 久久九九久精品国产免费直播| 欧美日韩在线观看一区二区| k8久久久一区二区三区| 国内精品久久久久影院一蜜桃| 日韩国产欧美三级| 国产精品久久777777| 精品日韩在线观看| 日韩欧美一级二级三级| 337p亚洲精品色噜噜噜| 欧美网站一区二区| av在线不卡免费看| 色欲综合视频天天天| 色综合咪咪久久| 欧美在线观看禁18| 亚洲成国产人片在线观看| 一区二区三区丝袜| 亚洲在线视频一区| 亚洲国产美女搞黄色| 亚洲综合丁香婷婷六月香| 一区二区在线观看免费视频播放| 国产精品国产自产拍高清av| 国产精品久久久爽爽爽麻豆色哟哟| 国产日韩精品久久久| 26uuu久久天堂性欧美| 91麻豆精品国产| 高潮精品一区videoshd| 亚洲电影在线播放| 午夜激情一区二区三区| 香蕉久久夜色精品国产使用方法| 五月天久久比比资源色| 蜜桃视频在线一区| 成人一级片在线观看| 国产精品1024| 亚洲第一电影网|