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

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

?? tcp.c

?? 君正早期ucos系統(tǒng)(只有早期的才不沒有打包成庫),MPLAYER,文件系統(tǒng),圖片解碼,瀏覽,電子書,錄音,想學(xué)ucos,識貨的人就下吧 russblock fmradio explore set
?? C
?? 第 1 頁 / 共 3 頁
字號:
/** * @file * * Transmission Control Protocol for IP * * This file contains common functions for the TCP implementation, such as functinos * for manipulating the data structures and the TCP timer functions. TCP functions * related to input and output is found in tcp_in.c and tcp_out.c respectively. * *//* * 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> * */#include <string.h>#include "lwip/opt.h"#include "lwip/def.h"#include "lwip/mem.h"#include "lwip/memp.h"#include "lwip/tcp.h"#if LWIP_TCP/* Incremented every coarse grained timer shot   (typically every 500 ms, determined by TCP_COARSE_TIMEOUT). */u32_t tcp_ticks;const u8_t tcp_backoff[13] =    { 1, 2, 3, 4, 5, 6, 7, 7, 7, 7, 7, 7, 7};/* The TCP PCB lists. *//** List of all TCP PCBs in LISTEN state */union tcp_listen_pcbs_t tcp_listen_pcbs;/** List of all TCP PCBs that are in a state in which * they accept or send data. */struct tcp_pcb *tcp_active_pcbs;  /** List of all TCP PCBs in TIME-WAIT state */struct tcp_pcb *tcp_tw_pcbs;struct tcp_pcb *tcp_tmp_pcb;static u8_t tcp_timer;static u16_t tcp_new_port(void);/** * Initializes the TCP layer. */voidtcp_init(void){  /* Clear globals. */  tcp_listen_pcbs.listen_pcbs = NULL;  tcp_active_pcbs = NULL;  tcp_tw_pcbs = NULL;  tcp_tmp_pcb = NULL;    /* initialize timer */  tcp_ticks = 0;  tcp_timer = 0;  }/** * Called periodically to dispatch TCP timers. * */voidtcp_tmr(void){  /* Call tcp_fasttmr() every 250 ms */  tcp_fasttmr();  if (++tcp_timer & 1) {    /* Call tcp_tmr() every 500 ms, i.e., every other timer       tcp_tmr() is called. */    tcp_slowtmr();  }}/** * Closes the connection held by the PCB. * */err_ttcp_close(struct tcp_pcb *pcb){  err_t err;#if TCP_DEBUG  LWIP_DEBUGF(TCP_DEBUG, ("tcp_close: closing in state "));  tcp_debug_print_state(pcb->state);  LWIP_DEBUGF(TCP_DEBUG, ("\n"));#endif /* TCP_DEBUG */  switch (pcb->state) {  case CLOSED:    /* Closing a pcb in the CLOSED state might seem erroneous,     * however, it is in this state once allocated and as yet unused     * and the user needs some way to free it should the need arise.     * Calling tcp_close() with a pcb that has already been closed, (i.e. twice)     * or for a pcb that has been used and then entered the CLOSED state      * is erroneous, but this should never happen as the pcb has in those cases     * been freed, and so any remaining handles are bogus. */    err = ERR_OK;    memp_free(MEMP_TCP_PCB, pcb);    pcb = NULL;    break;  case LISTEN:    err = ERR_OK;    tcp_pcb_remove((struct tcp_pcb **)&tcp_listen_pcbs.pcbs, pcb);    memp_free(MEMP_TCP_PCB_LISTEN, pcb);    pcb = NULL;    break;  case SYN_SENT:    err = ERR_OK;    tcp_pcb_remove(&tcp_active_pcbs, pcb);    memp_free(MEMP_TCP_PCB, pcb);    pcb = NULL;    break;  case SYN_RCVD:  case ESTABLISHED:    err = tcp_send_ctrl(pcb, TCP_FIN);    if (err == ERR_OK) {      pcb->state = FIN_WAIT_1;    }    break;  case CLOSE_WAIT:    err = tcp_send_ctrl(pcb, TCP_FIN);    if (err == ERR_OK) {      pcb->state = LAST_ACK;    }    break;  default:    /* Has already been closed, do nothing. */    err = ERR_OK;    pcb = NULL;    break;  }  if (pcb != NULL && err == ERR_OK) {    err = tcp_output(pcb);  }  return err;}/** * Aborts a connection by sending a RST to the remote host and deletes * the local protocol control block. This is done when a connection is * killed because of shortage of memory. * */voidtcp_abort(struct tcp_pcb *pcb){  u32_t seqno, ackno;  u16_t remote_port, local_port;  struct ip_addr remote_ip, local_ip;#if LWIP_CALLBACK_API    void (* errf)(void *arg, err_t err);#endif /* LWIP_CALLBACK_API */  void *errf_arg;    /* Figure out on which TCP PCB list we are, and remove us. If we     are in an active state, call the receive function associated with     the PCB with a NULL argument, and send an RST to the remote end. */  if (pcb->state == TIME_WAIT) {    tcp_pcb_remove(&tcp_tw_pcbs, pcb);    memp_free(MEMP_TCP_PCB, pcb);  } else {    seqno = pcb->snd_nxt;    ackno = pcb->rcv_nxt;    ip_addr_set(&local_ip, &(pcb->local_ip));    ip_addr_set(&remote_ip, &(pcb->remote_ip));    local_port = pcb->local_port;    remote_port = pcb->remote_port;#if LWIP_CALLBACK_API    errf = pcb->errf;#endif /* LWIP_CALLBACK_API */    errf_arg = pcb->callback_arg;    tcp_pcb_remove(&tcp_active_pcbs, pcb);    if (pcb->unacked != NULL) {      tcp_segs_free(pcb->unacked);    }    if (pcb->unsent != NULL) {      tcp_segs_free(pcb->unsent);    }#if TCP_QUEUE_OOSEQ        if (pcb->ooseq != NULL) {      tcp_segs_free(pcb->ooseq);    }#endif /* TCP_QUEUE_OOSEQ */    memp_free(MEMP_TCP_PCB, pcb);    TCP_EVENT_ERR(errf, errf_arg, ERR_ABRT);    LWIP_DEBUGF(TCP_RST_DEBUG, ("tcp_abort: sending RST\n"));    tcp_rst(seqno, ackno, &local_ip, &remote_ip, local_port, remote_port);  }}/** * Binds the connection to a local portnumber and IP address. If the * IP address is not given (i.e., ipaddr == NULL), the IP address of * the outgoing network interface is used instead. * */err_ttcp_bind(struct tcp_pcb *pcb, struct ip_addr *ipaddr, u16_t port){  struct tcp_pcb *cpcb;  if (port == 0) {    port = tcp_new_port();  }  /* Check if the address already is in use. */  for(cpcb = (struct tcp_pcb *)tcp_listen_pcbs.pcbs;      cpcb != NULL; cpcb = cpcb->next) {    if (cpcb->local_port == port) {      if (ip_addr_isany(&(cpcb->local_ip)) ||        ip_addr_isany(ipaddr) ||        ip_addr_cmp(&(cpcb->local_ip), ipaddr)) {          return ERR_USE;      }    }  }  for(cpcb = tcp_active_pcbs;      cpcb != NULL; cpcb = cpcb->next) {    if (cpcb->local_port == port) {      if (ip_addr_isany(&(cpcb->local_ip)) ||   ip_addr_isany(ipaddr) ||   ip_addr_cmp(&(cpcb->local_ip), ipaddr)) {  return ERR_USE;      }    }  }  if (!ip_addr_isany(ipaddr)) {    pcb->local_ip = *ipaddr;  }  pcb->local_port = port;  LWIP_DEBUGF(TCP_DEBUG, ("tcp_bind: bind to port %"U16_F"\n", port));  return ERR_OK;}#if LWIP_CALLBACK_APIstatic err_ttcp_accept_null(void *arg, struct tcp_pcb *pcb, err_t err){  (void)arg;  (void)pcb;  (void)err;  return ERR_ABRT;}#endif /* LWIP_CALLBACK_API *//** * Set the state of the connection to be LISTEN, which means that it * is able to accept incoming connections. The protocol control block * is reallocated in order to consume less memory. Setting the * connection to LISTEN is an irreversible process. * */struct tcp_pcb *tcp_listen(struct tcp_pcb *pcb){  struct tcp_pcb_listen *lpcb;  /* already listening? */  if (pcb->state == LISTEN) {    return pcb;  }  lpcb = memp_malloc(MEMP_TCP_PCB_LISTEN);  if (lpcb == NULL) {    return NULL;  }  lpcb->callback_arg = pcb->callback_arg;  lpcb->local_port = pcb->local_port;  lpcb->state = LISTEN;  lpcb->so_options = pcb->so_options;  lpcb->so_options |= SOF_ACCEPTCONN;  lpcb->ttl = pcb->ttl;  lpcb->tos = pcb->tos;  ip_addr_set(&lpcb->local_ip, &pcb->local_ip);  memp_free(MEMP_TCP_PCB, pcb);#if LWIP_CALLBACK_API  lpcb->accept = tcp_accept_null;#endif /* LWIP_CALLBACK_API */  TCP_REG(&tcp_listen_pcbs.listen_pcbs, lpcb);  return (struct tcp_pcb *)lpcb;}/** * This function should be called by the application when it has * processed the data. The purpose is to advertise a larger window * when the data has been processed. * */voidtcp_recved(struct tcp_pcb *pcb, u16_t len){  if ((u32_t)pcb->rcv_wnd + len > TCP_WND) {    pcb->rcv_wnd = TCP_WND;  } else {    pcb->rcv_wnd += len;  }  if (!(pcb->flags & TF_ACK_DELAY) &&     !(pcb->flags & TF_ACK_NOW)) {    /*     * We send an ACK here (if one is not already pending, hence     * the above tests) as tcp_recved() implies that the application     * has processed some data, and so we can open the receiver's     * window to allow more to be transmitted.  This could result in     * two ACKs being sent for each received packet in some limited cases     * (where the application is only receiving data, and is slow to     * process it) but it is necessary to guarantee that the sender can     * continue to transmit.     */    tcp_ack(pcb);  }   else if (pcb->flags & TF_ACK_DELAY && pcb->rcv_wnd >= TCP_WND/2) {    /* If we can send a window update such that there is a full     * segment available in the window, do so now.  This is sort of     * nagle-like in its goals, and tries to hit a compromise between     * sending acks each time the window is updated, and only sending     * window updates when a timer expires.  The "threshold" used     * above (currently TCP_WND/2) can be tuned to be more or less     * aggressive  */    tcp_ack_now(pcb);  }  LWIP_DEBUGF(TCP_DEBUG, ("tcp_recved: recveived %"U16_F" bytes, wnd %"U16_F" (%"U16_F").\n",         len, pcb->rcv_wnd, TCP_WND - pcb->rcv_wnd));}/** * A nastly hack featuring 'goto' statements that allocates a * new TCP local port. */static u16_ttcp_new_port(void){  struct tcp_pcb *pcb;#ifndef TCP_LOCAL_PORT_RANGE_START#define TCP_LOCAL_PORT_RANGE_START 4096#define TCP_LOCAL_PORT_RANGE_END   0x7fff#endif  static u16_t port = TCP_LOCAL_PORT_RANGE_START;   again:  if (++port > TCP_LOCAL_PORT_RANGE_END) {    port = TCP_LOCAL_PORT_RANGE_START;  }    for(pcb = tcp_active_pcbs; pcb != NULL; pcb = pcb->next) {    if (pcb->local_port == port) {      goto again;    }  }  for(pcb = tcp_tw_pcbs; pcb != NULL; pcb = pcb->next) {    if (pcb->local_port == port) {      goto again;    }

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
久久久久久亚洲综合影院红桃| 99久久综合狠狠综合久久| 久久精品国产网站| 国产精品一区一区三区| 色综合久久久久综合99| 欧美一区二区视频在线观看2022 | 免费看日韩精品| 国产成人综合视频| 欧美午夜电影一区| 久久久综合激的五月天| 一区二区三区高清| 国内精品免费**视频| 色综合天天在线| 精品久久久久久无| 亚洲小少妇裸体bbw| 国产精品系列在线观看| 欧美三级午夜理伦三级中视频| 久久日一线二线三线suv| 亚洲精品视频观看| 韩国一区二区三区| 欧美吻胸吃奶大尺度电影| 久久亚洲免费视频| 午夜精品久久久| 成人激情校园春色| 欧美videos大乳护士334| 一区二区三区欧美亚洲| 国产一区二区在线影院| 欧美日韩在线播放一区| 中文字幕精品综合| 久久99国产精品尤物| 欧美色图第一页| 国产精品成人网| 精一区二区三区| 欧美日韩国产小视频| 国产精品久久久久精k8| 精品一区二区国语对白| 欧美视频一区二区三区| 国产精品白丝在线| 国内偷窥港台综合视频在线播放| 欧美影院一区二区| 亚洲欧洲国产日韩| 国产精品99久| 精品国产乱码久久久久久图片 | 91精品国产福利在线观看| 综合中文字幕亚洲| 岛国精品在线播放| 26uuu欧美日本| 奇米影视7777精品一区二区| 欧美色男人天堂| 亚洲精品菠萝久久久久久久| 成人精品鲁一区一区二区| 精品久久久久久久人人人人传媒 | 精品福利二区三区| 日韩精品免费专区| 欧美精品色综合| 亚洲综合久久久久| 在线精品视频一区二区| 亚洲图片你懂的| av影院午夜一区| 欧美国产禁国产网站cc| 国产精品亚洲视频| 久久嫩草精品久久久久| 蜜臀av性久久久久av蜜臀妖精| 欧美久久免费观看| 午夜精品福利久久久| 欧美视频在线一区二区三区 | 日韩欧美专区在线| 天堂久久一区二区三区| 欧美女孩性生活视频| 午夜av一区二区三区| 欧美日韩一区在线| 日韩avvvv在线播放| 51精品国自产在线| 免费成人美女在线观看.| 日韩欧美你懂的| 久久电影网站中文字幕| 久久精品网站免费观看| 国产98色在线|日韩| 国产精品护士白丝一区av| 色综合天天综合色综合av | 91精品在线麻豆| 蜜臀av性久久久久蜜臀aⅴ| 欧美xxxx老人做受| 高清不卡一区二区在线| 国产精品成人在线观看| 在线观看亚洲成人| 日日夜夜精品视频免费| 日韩免费成人网| 国产精品一二三四五| 成人欧美一区二区三区在线播放| 色狠狠一区二区三区香蕉| 亚洲一区二区三区中文字幕| 91超碰这里只有精品国产| 毛片av中文字幕一区二区| 久久精品日韩一区二区三区| www.99精品| 亚洲国产精品尤物yw在线观看| 欧美一区在线视频| 国产乱色国产精品免费视频| ●精品国产综合乱码久久久久| 欧美日韩在线播放三区四区| 麻豆91免费看| 国产精品久久久久永久免费观看 | 日本亚洲天堂网| 久久久亚洲精华液精华液精华液 | 日韩精品成人一区二区三区| 亚洲精品一线二线三线| 99精品久久久久久| 丝瓜av网站精品一区二区| 久久亚洲春色中文字幕久久久| 成人黄色免费短视频| 午夜精品久久久久久久久久久| 久久嫩草精品久久久精品| 色综合久久中文综合久久97| 日韩精品乱码免费| 国产精品系列在线| 538在线一区二区精品国产| 国产传媒久久文化传媒| 亚洲永久精品国产| 国产午夜精品久久久久久久 | 日本伊人色综合网| 国产精品久久久久久久蜜臀| 欧美日韩国产乱码电影| 国产高清精品在线| 亚洲高清不卡在线观看| 久久久蜜臀国产一区二区| 91久久精品日日躁夜夜躁欧美| 激情亚洲综合在线| 亚洲影视在线播放| 国产片一区二区三区| 欧美精品乱码久久久久久| 成人一区二区在线观看| 日韩成人一级大片| 亚洲美女屁股眼交| 久久香蕉国产线看观看99| 欧美久久久久久久久久| 99视频有精品| 国产真实乱子伦精品视频| 亚洲18女电影在线观看| 国产精品国产成人国产三级| 欧美成人一区二区| 欧美午夜精品一区二区三区| 成人av网站大全| 精品亚洲欧美一区| 日韩精品一二三区| 一区二区三区精品在线观看| 欧美高清在线一区二区| 精品日韩一区二区三区| 欧美色综合天天久久综合精品| 成人影视亚洲图片在线| 国产在线播放一区| 奇米影视7777精品一区二区| 亚洲高清中文字幕| 一区二区三区**美女毛片| 国产精品毛片无遮挡高清| 欧美精品一区二区三区久久久| 欧美巨大另类极品videosbest| 色猫猫国产区一区二在线视频| 粉嫩久久99精品久久久久久夜| 久草中文综合在线| 蜜臀av性久久久久蜜臀aⅴ流畅 | 欧美xfplay| 欧美一区二区三区在线电影| 欧美日韩一区二区在线观看| 91麻豆精东视频| 91小视频免费观看| 成人教育av在线| 成人免费视频国产在线观看| 国产福利视频一区二区三区| 激情av综合网| 韩国女主播一区二区三区| 久久99最新地址| 久久国产精品免费| 久久国产三级精品| 另类小说视频一区二区| 麻豆久久一区二区| 麻豆国产欧美一区二区三区| 捆绑变态av一区二区三区| 美腿丝袜亚洲综合| 老司机精品视频一区二区三区| 久久精品99久久久| 国产专区欧美精品| 国产成人aaa| 成人影视亚洲图片在线| av电影一区二区| 色94色欧美sute亚洲线路一ni| 欧洲国内综合视频| 欧美三区在线观看| 欧美一区二区在线看| 日韩欧美你懂的| 国产调教视频一区| 国产精品二三区| 亚洲一区二区三区在线| 日韩二区三区在线观看| 蜜臀久久99精品久久久画质超高清| 麻豆久久久久久| 成人激情文学综合网| 在线日韩国产精品| 欧美一区二区高清| 久久久一区二区|