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

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

?? tcp.c

?? 是一本完整而詳細(xì)的TCP/IP協(xié)議指南。描述了屬于每一層的各個協(xié)議以及它們?nèi)绾卧诓煌僮飨到y(tǒng)中運(yùn)行。作者用Lawrence Berkeley實驗室的tcpdump程序來捕獲不同操作系統(tǒng)和TCP/IP實
?? C
?? 第 1 頁 / 共 3 頁
字號:
/* * Copyright (c) 2001, 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. Neither the name of the Institute nor the names of its contributors  *    may be used to endorse or promote products derived from this software  *    without specific prior written permission.  * * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``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 INSTITUTE OR CONTRIBUTORS 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> * * $Id: tcp.c,v 1.14 2002/03/04 10:47:56 adam Exp $ *//*-----------------------------------------------------------------------------------*//* tcp.c * * 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_input.c and tcp_output.c respectively. * *//*-----------------------------------------------------------------------------------*/#include "lwip/debug.h"#include "lwip/def.h"#include "lwip/mem.h"#include "lwip/memp.h"#include "lwip/tcp.h"/* 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, 4, 8, 16, 32, 64, 64, 64, 64, 64, 64, 64 };/* The TCP PCB lists. */struct tcp_pcb_listen *tcp_listen_pcbs;  /* List of all TCP PCBs in LISTEN state. */struct tcp_pcb *tcp_active_pcbs;  /* List of all TCP PCBs that are in a				 state in which they accept or send				 data. */struct tcp_pcb *tcp_tw_pcbs;      /* List of all TCP PCBs in TIME-WAIT. */struct tcp_pcb *tcp_tmp_pcb;#define MIN(x,y) (x) < (y)? (x): (y)#if MEMP_RECLAIMstatic u8_t tcp_memp_reclaim(void *arg, memp_t type);#endif#if MEM_RECLAIMstatic mem_size_t tcp_mem_reclaim(void *arg, mem_size_t size);#endifstatic u8_t tcp_timer;/*-----------------------------------------------------------------------------------*//* * tcp_init(): * * Initializes the TCP layer. *//*-----------------------------------------------------------------------------------*/voidtcp_init(void){  /* Clear globals. */  tcp_listen_pcbs = NULL;  tcp_active_pcbs = NULL;  tcp_tw_pcbs = NULL;  tcp_tmp_pcb = NULL;    /* Register memory reclaim function */#if MEM_RECLAIM  mem_register_reclaim((mem_reclaim_func)tcp_mem_reclaim, NULL);#endif /* MEM_RECLAIM */#if MEMP_RECLAIM  memp_register_reclaim(MEMP_PBUF, (memp_reclaim_func)tcp_memp_reclaim, NULL);  memp_register_reclaim(MEMP_TCP_SEG, (memp_reclaim_func)tcp_memp_reclaim, NULL);  memp_register_reclaim(MEMP_TCP_PCB, (memp_reclaim_func)tcp_memp_reclaim, NULL);#endif /* MEMP_RECLAIM */  /* initialize timer */  tcp_ticks = 0;  tcp_timer = 0;  }/*-----------------------------------------------------------------------------------*//* * tcp_tmr(): * * Called periodically to dispatch TCP timers. * *//*-----------------------------------------------------------------------------------*/voidtcp_tmr(){  ++tcp_timer;  if(tcp_timer == 10) {    tcp_timer = 0;  }    if(tcp_timer & 1) {    /* Call tcp_fasttmr() every 200 ms, i.e., every other timer       tcp_tmr() is called. */    tcp_fasttmr();  }  if(tcp_timer == 0 || tcp_timer == 5) {    /* Call tcp_slowtmr() every 500 ms, i.e., every fifth timer       tcp_tmr() is called. */    tcp_slowtmr();  }}/*-----------------------------------------------------------------------------------*//* * tcp_close(): * * Closes the connection held by the PCB. * *//*-----------------------------------------------------------------------------------*/err_ttcp_close(struct tcp_pcb *pcb){  err_t err;#if TCP_DEBUG  DEBUGF(TCP_DEBUG, ("tcp_close: closing in state "));  tcp_debug_print_state(pcb->state);  DEBUGF(TCP_DEBUG, ("\n"));#endif /* TCP_DEBUG */  switch(pcb->state) {  case LISTEN:    err = ERR_OK;    tcp_pcb_remove((struct tcp_pcb **)&tcp_listen_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:    err = tcp_send_ctrl(pcb, TCP_FIN);    if(err == ERR_OK) {      pcb->state = FIN_WAIT_1;    }    break;  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;}/*-----------------------------------------------------------------------------------*//* * tcp_abort() * * 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;  void (* errf)(void *arg, err_t err);  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 if(pcb->state == LISTEN) {    tcp_pcb_remove((struct tcp_pcb **)&tcp_listen_pcbs, pcb);    memp_free(MEMP_TCP_PCB_LISTEN, 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;    errf = pcb->errf;    errf_arg = pcb->callback_arg;    tcp_pcb_remove(&tcp_active_pcbs, pcb);    memp_free(MEMP_TCP_PCB, pcb);    if(errf != NULL) {      errf(errf_arg, ERR_ABRT);    }    DEBUGF(TCP_RST_DEBUG, ("tcp_abort: sending RST\n"));    tcp_rst(seqno, ackno, &local_ip, &remote_ip, local_port, remote_port);  }}/*-----------------------------------------------------------------------------------*//* * tcp_bind(): * * 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;  /* Check if the address already is in use. */  for(cpcb = (struct tcp_pcb *)tcp_listen_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;  DEBUGF(TCP_DEBUG, ("tcp_bind: bind to port %d\n", port));  return ERR_OK;}/*-----------------------------------------------------------------------------------*//* * tcp_listen(): * * 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){  pcb->state = LISTEN;  pcb = memp_realloc(MEMP_TCP_PCB, MEMP_TCP_PCB_LISTEN, pcb);  if(pcb == NULL) {    return NULL;  }  TCP_REG((struct tcp_pcb **)&tcp_listen_pcbs, pcb);  return pcb;}/*-----------------------------------------------------------------------------------*//* * tcp_recved(): * * 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){  pcb->rcv_wnd += len;  if(pcb->rcv_wnd > TCP_WND) {    pcb->rcv_wnd = TCP_WND;  }  if(!(pcb->flags & TF_ACK_DELAY) ||     !(pcb->flags & TF_ACK_NOW)) {    tcp_ack(pcb);  }  DEBUGF(TCP_DEBUG, ("tcp_recved: recveived %d bytes, wnd %u (%u).\n",		     len, pcb->rcv_wnd, TCP_WND - pcb->rcv_wnd));}/*-----------------------------------------------------------------------------------*//* * tcp_new_port(): * * A nastly hack featuring 'goto' statements that allocates a * new TCP local port. *//*-----------------------------------------------------------------------------------*/static u16_ttcp_new_port(void){  struct tcp_pcb *pcb;  static u16_t port = 4096;   again:  if(++port > 0x7fff) {    port = 4096;  }    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;    }  }  for(pcb = (struct tcp_pcb *)tcp_listen_pcbs; pcb != NULL; pcb = pcb->next) {    if(pcb->local_port == port) {      goto again;    }  }  return port;}/*-----------------------------------------------------------------------------------*//* * tcp_connect(): * * Connects to another host. The function given as the "connected" * argument will be called when the connection has been established. * *//*-----------------------------------------------------------------------------------*/err_ttcp_connect(struct tcp_pcb *pcb, struct ip_addr *ipaddr, u16_t port,	    err_t (* connected)(void *arg, struct tcp_pcb *tpcb, err_t err)){  u32_t optdata;  err_t ret;  u32_t iss;

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
一区二区三区四区不卡在线| 欧美大片在线观看| 亚洲一区在线视频| 欧美疯狂做受xxxx富婆| 日韩精品一级二级 | 三级不卡在线观看| 日韩色在线观看| 国产麻豆91精品| 亚洲人成网站在线| 欧美日韩不卡在线| 精品一区二区免费在线观看| 国产精品蜜臀av| 欧美日韩一区成人| 久久国产精品99精品国产| 国产欧美一区二区在线| 99精品久久99久久久久| 亚洲一二三区在线观看| 日韩精品影音先锋| 东方欧美亚洲色图在线| 亚洲午夜私人影院| 久久伊人中文字幕| 欧美中文字幕不卡| 国产专区综合网| 曰韩精品一区二区| 欧美va在线播放| 91在线国内视频| 日本亚洲免费观看| 中文字幕一区二区三区在线播放| 欧洲一区在线观看| 国产一区二区三区四区在线观看| 亚洲综合视频在线观看| 久久久噜噜噜久久中文字幕色伊伊| 91免费版在线| 国产乱码精品一区二区三区五月婷| 一个色妞综合视频在线观看| 欧美成va人片在线观看| 色综合久久综合中文综合网| 国产一区二区在线看| 亚洲高清久久久| 中文字幕精品综合| 日韩欧美一区二区免费| 欧洲人成人精品| 高清成人免费视频| 麻豆国产精品一区二区三区| 亚洲欧美日韩国产手机在线| 国产亚洲一区二区三区| 日韩一区二区精品在线观看| 色噜噜夜夜夜综合网| 福利一区在线观看| 久久爱另类一区二区小说| 亚洲第一在线综合网站| 亚洲精品伦理在线| 中文字幕亚洲在| 国产亚洲欧美日韩在线一区| 日韩一区二区三区电影在线观看| 欧美影院一区二区| 91免费版pro下载短视频| 懂色一区二区三区免费观看| 国内国产精品久久| 国产综合久久久久影院| 亚洲成av人影院| 亚洲成人激情av| 一二三区精品福利视频| 亚洲男人天堂一区| 综合电影一区二区三区| 国产精品乱码久久久久久| 国产欧美一区二区精品性色超碰 | 欧美激情一区二区三区在线| 亚洲精品一线二线三线| 日韩精品中文字幕在线一区| 日韩精品一区二| 精品久久五月天| 26uuu成人网一区二区三区| 日韩女优电影在线观看| 欧美va亚洲va| 久久久国产午夜精品| 国产亚洲综合性久久久影院| 国产人久久人人人人爽| 国产欧美日韩麻豆91| 国产精品久久久久影院老司| 亚洲欧美一区二区在线观看| 亚洲欧美视频在线观看| 一区二区三区在线视频免费 | 国产精品婷婷午夜在线观看| 中文字幕av一区二区三区免费看| 中文字幕+乱码+中文字幕一区| 国产精品美女久久福利网站| 国产精品女上位| 亚洲视频中文字幕| 亚洲一区av在线| 日韩av中文在线观看| 精品在线免费观看| 成人高清视频在线观看| 色综合天天综合在线视频| 欧洲视频一区二区| 日韩亚洲欧美中文三级| 久久久91精品国产一区二区精品| 日韩一区在线播放| 三级欧美在线一区| 国产麻豆精品在线观看| 99热国产精品| 91精品国产综合久久久久久久| 精品日韩一区二区| 国产精品不卡在线观看| 亚洲成人在线网站| 国产美女精品一区二区三区| 97久久久精品综合88久久| 欧美精品久久99久久在免费线| 欧美成人乱码一区二区三区| 国产精品蜜臀在线观看| 丝袜亚洲另类欧美综合| 国产高清不卡一区| 欧美三级日韩在线| 国产欧美精品在线观看| 亚洲动漫第一页| 国产91色综合久久免费分享| 欧美色倩网站大全免费| 欧美经典一区二区| 日日欢夜夜爽一区| 不卡大黄网站免费看| 91麻豆精品国产| 综合精品久久久| 国产乱码字幕精品高清av| 欧美日韩亚洲综合在线 欧美亚洲特黄一级| 精品美女在线播放| 亚洲一区二区精品久久av| 国产91露脸合集magnet| 欧美一区二视频| 亚洲精品乱码久久久久久久久 | av男人天堂一区| 精品少妇一区二区三区免费观看| 一区二区三区在线视频观看58| 韩国精品久久久| 3d动漫精品啪啪1区2区免费| 中文字幕亚洲视频| 国产一区二区电影| 3atv在线一区二区三区| 亚洲精品国产一区二区三区四区在线| 国产精品一区久久久久| 欧美丰满高潮xxxx喷水动漫| √…a在线天堂一区| 国产乱人伦偷精品视频不卡| 欧美一级夜夜爽| 视频一区二区欧美| 色老头久久综合| 亚洲婷婷综合色高清在线| 国产成人自拍在线| 精品久久久久香蕉网| 肉丝袜脚交视频一区二区| 欧美性xxxxx极品少妇| 亚洲天堂网中文字| 成人av先锋影音| 国产欧美精品一区二区色综合 | 国产乱码字幕精品高清av| 91精品国产综合久久精品| 亚洲成精国产精品女| 91国产免费看| 一区二区理论电影在线观看| 色综合中文字幕国产| 中文字幕一区二区三区在线观看| 国产成人av一区二区| 欧美极品少妇xxxxⅹ高跟鞋 | 成人丝袜高跟foot| 国产午夜精品久久久久久久 | 美女视频黄 久久| 91精品国产乱码久久蜜臀| 日韩精品久久理论片| 7799精品视频| 裸体一区二区三区| 精品国产凹凸成av人网站| 国产一区二区三区在线观看免费 | 国产欧美日韩久久| eeuss鲁一区二区三区| 亚洲欧洲av一区二区三区久久| 成人av免费网站| 一区免费观看视频| 色综合久久88色综合天天免费| 樱桃视频在线观看一区| 欧美系列日韩一区| 欧美aaaaaa午夜精品| 精品国一区二区三区| 国产91精品入口| 尤物视频一区二区| 日韩一卡二卡三卡| 国产福利精品一区| 亚洲精品少妇30p| 777奇米成人网| 国内精品不卡在线| ...xxx性欧美| 91精品国产一区二区三区蜜臀 | 日韩精品一区二区三区swag| 国产黄人亚洲片| 亚洲精品国产视频| 91麻豆精品国产综合久久久久久| 国内精品在线播放| 亚洲精品免费在线播放| 欧美mv和日韩mv的网站| 99精品在线免费| 日本在线不卡视频| ...中文天堂在线一区|