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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? tcp_timer.c

?? vxworks下的實現(xiàn)網絡TCPIP協(xié)議的原代碼
?? C
字號:
/* tcp_timer.c - TCP timer routines *//* Copyright 1984-1996 Wind River Systems, Inc. */#include "copyright_wrs.h"/* * Copyright (c) 1982, 1986, 1988, 1990, 1993, 1995 *	The Regents of the University of California.  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. All advertising materials mentioning features or use of this software *    must display the following acknowledgement: *	This product includes software developed by the University of *	California, Berkeley and its contributors. * 4. Neither the name of the University 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 REGENTS 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 REGENTS 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. * *	@(#)tcp_timer.c	8.2 (Berkeley) 5/24/95 *//*modification history--------------------01c,08mar97,vin  added changes to accomodate changes in pcb structure.01b,30oct96,vin  changed calls to tcp_respond, mtod(tp->t_template ...).01a,03mar96,vin  created from BSD4.4 stuff,integrated with 02j.*//*DESCRIPTION*/#include "vxWorks.h"#include "net/systm.h"#include "net/mbuf.h"#include "sys/socket.h"#include "net/socketvar.h"#include "net/protosw.h"#include "errno.h"#include "net/if.h"#include "net/route.h"#include "netinet/in.h"#include "netinet/in_pcb.h"#include "netinet/in_systm.h"#include "netinet/ip.h"#include "netinet/ip_var.h"#include "netinet/tcp.h"#include "netinet/tcp_fsm.h"#include "netinet/tcp_seq.h"#include "netinet/tcp_timer.h"#include "netinet/tcp_debug.h"#include "netinet/tcp_var.h"#include "netinet/tcpip.h"/* globals */int     tcp_keepidle = TCPTV_KEEP_IDLE;int     tcp_keepintvl = TCPTV_KEEPINTVL;int	tcp_keepcnt = TCPTV_KEEPCNT;int	tcp_keepinit = TCPTV_KEEP_INIT;int	tcp_maxpersistidle = TCPTV_KEEP_IDLE;   /* max idle time in persist */int     tcp_maxidle;/* * Fast timeout routine for processing delayed acks */voidtcp_fasttimo(){	register struct inpcb *inp;	register struct tcpcb *tp;	int s;        s = splnet();        for (inp = tcb.lh_first; inp != NULL; inp = inp->inp_list.le_next) {		if ((tp = (struct tcpcb *)inp->inp_ppcb) &&		    (tp->t_flags & TF_DELACK)) {			tp->t_flags &= ~TF_DELACK;			tp->t_flags |= TF_ACKNOW;			tcpstat.tcps_delack++;			(void) tcp_output(tp);		}        }	splx(s);}/* * Tcp protocol timeout routine called every 500 ms. * Updates the timers in all active tcb's and * causes finite state machine actions if timers expire. */voidtcp_slowtimo(){	register struct inpcb *ip, *ipnxt;	register struct tcpcb *tp;	int s = splnet();#ifdef BSDDEBUG        int ostate;#endif	register int i;	tcp_maxidle = tcp_keepcnt * tcp_keepintvl;	/*	 * Search through tcb's and update active timers.	 */	ip = tcb.lh_first;	if (ip == 0) {		splx(s);		return;	}	for (; ip != NULL; ip = ipnxt) {		ipnxt = ip->inp_list.le_next;		tp = intotcpcb(ip);		if (tp == 0 || tp->t_state == TCPS_LISTEN)			continue;		for (i = 0; i < TCPT_NTIMERS; i++) {			if (tp->t_timer[i] && --tp->t_timer[i] == 0) {#ifdef BSDDEBUG                                ostate = tp->t_state;#endif                                tp = tcp_timers(tp, i);                                if (tp == NULL)                                        goto tpgone;#ifdef BSDDEBUG                                if (tp->t_inpcb->inp_socket->so_options                                    & SO_DEBUG)                                    (*tcpTraceRtn)(TA_USER, ostate, tp,                                                   (struct tcpiphdr *)0,                                                   PRU_SLOWTIMO);#endif			}		}		tp->t_idle++;		if (tp->t_rtt)			tp->t_rtt++;tpgone:		;	}	tcp_iss += TCP_ISSINCR/PR_SLOWHZ;		/* increment iss */#ifdef TCP_COMPAT_42	if ((int)tcp_iss < 0)		tcp_iss = TCP_ISSINCR;			/* XXX */#endif	tcp_now++;					/* for timestamps */	splx(s);}#ifndef TUBA_INCLUDE/* * Cancel all timers for TCP tp. */voidtcp_canceltimers(tp)	struct tcpcb *tp;{	register int i;	for (i = 0; i < TCPT_NTIMERS; i++)		tp->t_timer[i] = 0;}int	tcp_backoff[TCP_MAXRXTSHIFT + 1] =    { 1, 2, 4, 8, 16, 32, 64, 64, 64, 64, 64, 64, 64 };int tcp_totbackoff = 511;	/* sum of tcp_backoff[] *//* * TCP timer processing. */struct tcpcb *tcp_timers(tp, timer)	register struct tcpcb *tp;	int timer;{	register int rexmt;	switch (timer) {	/*	 * 2 MSL timeout in shutdown went off.  If we're closed but	 * still waiting for peer to close and connection has been idle	 * too long, or if 2MSL time is up from TIME_WAIT, delete connection	 * control block.  Otherwise, check again in a bit.	 */	case TCPT_2MSL:		if (tp->t_state != TCPS_TIME_WAIT &&		    tp->t_idle <= tcp_maxidle)			tp->t_timer[TCPT_2MSL] = tcp_keepintvl;		else			tp = tcp_close(tp);		break;	/*	 * Retransmission timer went off.  Message has not	 * been acked within retransmit interval.  Back off	 * to a longer retransmit interval and retransmit one segment.	 */	case TCPT_REXMT:		if (++tp->t_rxtshift > TCP_MAXRXTSHIFT) {			tp->t_rxtshift = TCP_MAXRXTSHIFT;			tcpstat.tcps_timeoutdrop++;			tp = tcp_drop(tp, tp->t_softerror ?			    tp->t_softerror : ETIMEDOUT);			break;		}		tcpstat.tcps_rexmttimeo++;		rexmt = TCP_REXMTVAL(tp) * tcp_backoff[tp->t_rxtshift];		TCPT_RANGESET(tp->t_rxtcur, rexmt,		    tp->t_rttmin, TCPTV_REXMTMAX);		tp->t_timer[TCPT_REXMT] = tp->t_rxtcur;		/*		 * If losing, let the lower level know and try for		 * a better route.  Also, if we backed off this far,		 * our srtt estimate is probably bogus.  Clobber it		 * so we'll take the next rtt measurement as our srtt;		 * move the current srtt into rttvar to keep the current		 * retransmit times until then.		 */		if (tp->t_rxtshift > TCP_MAXRXTSHIFT / 4) {			in_losing(tp->t_inpcb);			tp->t_rttvar += (tp->t_srtt >> TCP_RTT_SHIFT);			tp->t_srtt = 0;		}		tp->snd_nxt = tp->snd_una;		/*		 * If timing a segment in this window, stop the timer.		 */		tp->t_rtt = 0;		/*		 * Close the congestion window down to one segment		 * (we'll open it by one segment for each ack we get).		 * Since we probably have a window's worth of unacked		 * data accumulated, this "slow start" keeps us from		 * dumping all that data as back-to-back packets (which		 * might overwhelm an intermediate gateway).		 *		 * There are two phases to the opening: Initially we		 * open by one mss on each ack.  This makes the window		 * size increase exponentially with time.  If the		 * window is larger than the path can handle, this		 * exponential growth results in dropped packet(s)		 * almost immediately.  To get more time between 		 * drops but still "push" the network to take advantage		 * of improving conditions, we switch from exponential		 * to linear window opening at some threshhold size.		 * For a threshhold, we use half the current window		 * size, truncated to a multiple of the mss.		 *		 * (the minimum cwnd that will give us exponential		 * growth is 2 mss.  We don't allow the threshhold		 * to go below this.)		 */		{		u_int win = min(tp->snd_wnd, tp->snd_cwnd) / 2 / tp->t_maxseg;		if (win < 2)			win = 2;		tp->snd_cwnd = tp->t_maxseg;		tp->snd_ssthresh = win * tp->t_maxseg;		tp->t_dupacks = 0;		}		(void) tcp_output(tp);		break;	/*	 * Persistance timer into zero window.	 * Force a byte to be output, if possible.	 */	case TCPT_PERSIST:		tcpstat.tcps_persisttimeo++;		/*		 * Hack: if the peer is dead/unreachable, we do not		 * time out if the window is closed.  After a full		 * backoff, drop the connection if the idle time		 * (no responses to probes) reaches the maximum		 * backoff that we would use if retransmitting.		 */		if (tp->t_rxtshift == TCP_MAXRXTSHIFT &&		    (tp->t_idle >= tcp_maxpersistidle ||		    tp->t_idle >= TCP_REXMTVAL(tp) * tcp_totbackoff)) {			tcpstat.tcps_persistdrop++;			tp = tcp_drop(tp, ETIMEDOUT);			break;		}		tcp_setpersist(tp);		tp->t_force = 1;		(void) tcp_output(tp);		tp->t_force = 0;		break;	/*	 * Keep-alive timer went off; send something	 * or drop connection if idle for too long.	 */	case TCPT_KEEP:		tcpstat.tcps_keeptimeo++;		if (tp->t_state < TCPS_ESTABLISHED)			goto dropit;		if (tp->t_inpcb->inp_socket->so_options & SO_KEEPALIVE &&		    tp->t_state <= TCPS_CLOSE_WAIT) {		    	if (tp->t_idle >= tcp_keepidle + tcp_maxidle)				goto dropit;			/*			 * Send a packet designed to force a response			 * if the peer is up and reachable:			 * either an ACK if the connection is still alive,			 * or an RST if the peer has closed the connection			 * due to timeout or reboot.			 * Using sequence number tp->snd_una-1			 * causes the transmitted zero-length segment			 * to lie outside the receive window;			 * by the protocol spec, this requires the			 * correspondent TCP to respond.			 */			tcpstat.tcps_keepprobe++;#ifdef TCP_COMPAT_42			/*			 * The keepalive packet must have nonzero length			 * to get a 4.2 host to respond.			 */			tcp_respond(tp, 				    mtod(tp->t_template, struct tcpiphdr *),				    (struct mbuf *)NULL,				    tp->rcv_nxt - 1, tp->snd_una - 1, 0);#else			tcp_respond(tp, 				    mtod(tp->t_template, struct tcpiphdr *),				    (struct mbuf *)NULL,				    tp->rcv_nxt, tp->snd_una - 1, 0);#endif			tp->t_timer[TCPT_KEEP] = tcp_keepintvl;		} else			tp->t_timer[TCPT_KEEP] = tcp_keepidle;		break;	dropit:		tcpstat.tcps_keepdrops++;		tp = tcp_drop(tp, ETIMEDOUT);		break;	}	return (tp);}#endif /* TUBA_INCLUDE */

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国内偷窥港台综合视频在线播放| 91精品在线免费| 欧美日韩综合色| 欧美激情一区二区| 免费视频一区二区| 欧美日韩极品在线观看一区| 亚洲丝袜精品丝袜在线| 国产福利一区二区三区视频在线| 久久综合久久综合久久| 久久先锋影音av鲁色资源| 91热门视频在线观看| 欧美tickling网站挠脚心| 国产毛片精品一区| 石原莉奈在线亚洲二区| 洋洋成人永久网站入口| 免费xxxx性欧美18vr| 蜜臀精品久久久久久蜜臀| 国产精品自拍在线| 日韩免费看的电影| 激情小说亚洲一区| 久久er99精品| 日韩欧美一区中文| 国产大陆a不卡| 久久国产精品72免费观看| 国产日韩欧美激情| 午夜在线成人av| 久久成人免费网站| 中文字幕一区二区三区四区不卡 | 一区免费观看视频| 日韩av一区二区在线影视| 成人激情图片网| 中文无字幕一区二区三区| 国产一区二区免费视频| 日韩在线一区二区| 亚洲国产精品久久人人爱蜜臀 | 成人精品视频.| 亚洲激情男女视频| 这里只有精品99re| 欧美日韩一区中文字幕| 欧美综合视频在线观看| 精品一区二区三区在线观看国产 | 国产成人综合自拍| 国产一区二区三区黄视频| 乱中年女人伦av一区二区| 视频一区视频二区在线观看| 午夜在线成人av| 日韩和的一区二区| 日韩av电影免费观看高清完整版在线观看| 亚洲午夜久久久久| 天天av天天翘天天综合网| 久久久久久日产精品| 欧美情侣在线播放| 欧美日韩不卡一区二区| 欧美一区二区三区小说| av一区二区三区四区| 蜜桃视频免费观看一区| 免费在线观看一区二区三区| 久久99精品久久久久| 国产一区二区三区在线观看免费视频 | 日本怡春院一区二区| 久久精品国产第一区二区三区| 经典三级一区二区| 成人亚洲精品久久久久软件| 99久久99久久免费精品蜜臀| 激情亚洲综合在线| 国产成人aaa| 美女精品自拍一二三四| 九九视频精品免费| 成人h精品动漫一区二区三区| jlzzjlzz国产精品久久| 色av成人天堂桃色av| 国产成人精品一区二| 成人精品一区二区三区中文字幕| 91看片淫黄大片一级在线观看| 欧美三级电影一区| 欧美成人精品高清在线播放| 国产亚洲美州欧州综合国| 精品成人一区二区三区| 6080国产精品一区二区| 久久亚洲欧美国产精品乐播| 中文字幕一区二区在线播放| 亚洲电影激情视频网站| 国产在线精品一区在线观看麻豆| 99这里只有久久精品视频| 欧美军同video69gay| 欧美午夜精品免费| 91黄色小视频| 欧美成人a视频| 日韩理论在线观看| 美女久久久精品| 91精品福利在线| 国产亚洲精品久| 亚洲成av人**亚洲成av**| 国产福利不卡视频| 欧美日韩成人综合在线一区二区| 国产亚洲1区2区3区| 婷婷亚洲久悠悠色悠在线播放| 国产91富婆露脸刺激对白| 欧美特级限制片免费在线观看| 26uuuu精品一区二区| 一区二区在线观看视频| 国内精品国产三级国产a久久| 色菇凉天天综合网| 国产午夜亚洲精品理论片色戒| 无码av免费一区二区三区试看| 顶级嫩模精品视频在线看| 91精品国产美女浴室洗澡无遮挡| 中文字幕亚洲一区二区va在线| 久久99精品久久久久久动态图| 91成人网在线| 国产精品白丝在线| 一区二区三区四区视频精品免费 | 色久优优欧美色久优优| 欧美精品一区二区高清在线观看| 亚洲一区av在线| 日精品一区二区三区| 成人成人成人在线视频| 免费高清不卡av| 91免费国产在线观看| 久久久国产精华| 久久99国产精品麻豆| 在线成人免费视频| 一区二区三区四区精品在线视频| 国产suv精品一区二区6| 久久午夜电影网| 美日韩一区二区| 91麻豆精品国产自产在线| 一区二区三区日韩| 91丨porny丨在线| 国产精品欧美一区喷水| 国产精品一卡二卡在线观看| 精品国产伦一区二区三区观看体验| 午夜不卡av在线| 欧美午夜电影在线播放| 一区二区欧美国产| 欧美在线制服丝袜| 亚洲精品菠萝久久久久久久| 99久久国产综合精品色伊| 国产精品天美传媒| 成人精品一区二区三区中文字幕| 欧美国产在线观看| 粉嫩高潮美女一区二区三区| 国产日产精品一区| 成人毛片老司机大片| 国产精品欧美一区二区三区| www.综合网.com| 亚洲情趣在线观看| 国产精品18久久久久| 国产亚洲女人久久久久毛片| 粉嫩欧美一区二区三区高清影视| 中文字幕成人网| 91视频观看视频| 亚洲综合在线视频| 欧美喷水一区二区| 久久 天天综合| 久久精子c满五个校花| 成年人国产精品| 一级精品视频在线观看宜春院| 欧美日韩在线不卡| 日本成人超碰在线观看| 久久人人超碰精品| 99精品在线免费| 亚洲国产成人精品视频| 日韩一级免费一区| 国产成人啪午夜精品网站男同| 中文子幕无线码一区tr| 色就色 综合激情| 蜜臀久久99精品久久久画质超高清| 精品91自产拍在线观看一区| 成人黄色片在线观看| 一区二区三区 在线观看视频| 正在播放一区二区| 国产91精品精华液一区二区三区 | 久久久久成人黄色影片| 99麻豆久久久国产精品免费| 亚洲电影一区二区三区| 精品毛片乱码1区2区3区| 国产91综合一区在线观看| 亚洲精选免费视频| 91精品国产综合久久精品app| 精彩视频一区二区三区| 一区二区三区毛片| 精品国产凹凸成av人导航| gogogo免费视频观看亚洲一| 日韩av一区二区三区| 欧美国产激情二区三区| 欧美久久婷婷综合色| 国产成人高清在线| 午夜视频在线观看一区| 中文字幕欧美日韩一区| 欧美亚洲另类激情小说| 国产成人综合视频| av一本久道久久综合久久鬼色| 日韩不卡一区二区三区| 国产精品久久久久桃色tv| 8v天堂国产在线一区二区| 99国产精品久久久| 精品一区二区免费在线观看| 亚洲精品乱码久久久久久黑人| 精品国产91洋老外米糕|