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

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

?? tcp_output.c

?? vxworks下的實現(xiàn)網(wǎng)絡(luò)TCPIP協(xié)議的原代碼
?? C
?? 第 1 頁 / 共 2 頁
字號:
/* tcp_output.c - TCP output routines *//* Copyright 1984 - 1999 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_output.c	8.4 (Berkeley) 5/24/95 *//*modification history--------------------01d,16mar99,spm  recovered orphaned code from tor2_0_x branch (SPR #25770)01c,10dec98,n_s  fixed state machine update for ENOBUFs error. spr 2331601b,22nov96,vin  added cluster support replaced m_gethdr(..) with 		 mHdrClGet(..).01a,03mar96,vin  created from BSD4.4lite2. Integrated with 02n of tcp_output.c*//*DESCRIPTION*/#include "vxWorks.h"#include "net/mbuf.h"#include "net/protosw.h"#include "sys/socket.h"#include "net/socketvar.h"#include "errno.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"#define	TCPOUTFLAGS#include "netinet/tcp_fsm.h"#include "netinet/tcp_seq.h"#include "netinet/tcp_timer.h"#include "netinet/tcp_var.h"#include "netinet/tcpip.h"#include "net/systm.h"#ifdef	BSDDEBUG#include "netinet/tcp_debug.h"#endif	/* BSDDEBUG */#ifdef notyetextern struct mbuf *m_copypack();#endif#define MAX_TCPOPTLEN	32	/* max # bytes that go in options *//* * Tcp output routine: figure out what should be sent and send it. */inttcp_output(tp)	register struct tcpcb *tp;{	register struct socket *so = tp->t_inpcb->inp_socket;	register long len, win;	int off, flags, error;	register struct mbuf *m;	register struct tcpiphdr *ti;	u_char opt[MAX_TCPOPTLEN];	unsigned optlen, hdrlen;	int idle, sendalot;		BOOL     pktSent = FALSE;   /* TRUE if a packet has been sent to IP */	/*	 * Determine length of data that should be transmitted,	 * and flags that will be used.	 * If there is some data or critical controls (SYN, RST)	 * to send, then transmit; otherwise, investigate further.	 */	idle = (tp->snd_max == tp->snd_una);	if (idle && tp->t_idle >= tp->t_rxtcur)		/*		 * We have been idle for "a while" and no acks are		 * expected to clock out any data we send --		 * slow start to get ack "clock" running again.		 */		tp->snd_cwnd = tp->t_maxseg;again:	sendalot = 0;	off = tp->snd_nxt - tp->snd_una;	win = min(tp->snd_wnd, tp->snd_cwnd);	flags = tcp_outflags[tp->t_state];	/*	 * If in persist timeout with window of 0, send 1 byte.	 * Otherwise, if window is small but nonzero	 * and timer expired, we will send what we can	 * and go to transmit state.	 */	if (tp->t_force) {		if (win == 0) {			/*			 * If we still have some data to send, then			 * clear the FIN bit.  Usually this would			 * happen below when it realizes that we			 * aren't sending all the data.  However,			 * if we have exactly 1 byte of unset data,			 * then it won't clear the FIN bit below,			 * and if we are in persist state, we wind			 * up sending the packet without recording			 * that we sent the FIN bit.			 *			 * We can't just blindly clear the FIN bit,			 * because if we don't have any more data			 * to send then the probe will be the FIN			 * itself.			 */			if (off < so->so_snd.sb_cc)				flags &= ~TH_FIN;			win = 1;		} else {			tp->t_timer[TCPT_PERSIST] = 0;			tp->t_rxtshift = 0;		}	}	len = min(so->so_snd.sb_cc, win) - off;	if (len < 0) {		/*		 * If FIN has been sent but not acked,		 * but we haven't been called to retransmit,		 * len will be -1.  Otherwise, window shrank		 * after we sent into it.  If window shrank to 0,		 * cancel pending retransmit and pull snd_nxt		 * back to (closed) window.  We will enter persist		 * state below.  If the window didn't close completely,		 * just wait for an ACK.		 */		len = 0;		if (win == 0) {			tp->t_timer[TCPT_REXMT] = 0;			tp->snd_nxt = tp->snd_una;		}	}	if (len > tp->t_maxseg) {		len = tp->t_maxseg;		sendalot = 1;	}	if (SEQ_LT(tp->snd_nxt + len, tp->snd_una + so->so_snd.sb_cc))		flags &= ~TH_FIN;	win = sbspace(&so->so_rcv);	/*	 * Sender silly window avoidance.  If connection is idle	 * and can send all data, a maximum segment,	 * at least a maximum default-size segment do it,	 * or are forced, do it; otherwise don't bother.	 * If peer's buffer is tiny, then send	 * when window is at least half open.	 * If retransmitting (possibly after persist timer forced us	 * to send into a small window), then must resend.	 */	if (len) {		if (len == tp->t_maxseg)			goto send;		if ((idle || tp->t_flags & TF_NODELAY) &&		    len + off >= so->so_snd.sb_cc)			goto send;		if (tp->t_force)			goto send;		if (len >= tp->max_sndwnd / 2)			goto send;		if (SEQ_LT(tp->snd_nxt, tp->snd_max))			goto send;	}	/*	 * Compare available window to amount of window	 * known to peer (as advertised window less	 * next expected input).  If the difference is at least two	 * max size segments, or at least 50% of the maximum possible	 * window, then want to send a window update to peer.	 */	if (win > 0) {		/* 		 * "adv" is the amount we can increase the window,		 * taking into account that we are limited by		 * TCP_MAXWIN << tp->rcv_scale.		 */		long adv = min(win, (long)TCP_MAXWIN << tp->rcv_scale) -			(tp->rcv_adv - tp->rcv_nxt);		if (adv >= (long) (2 * tp->t_maxseg))			goto send;		if (2 * adv >= (long) so->so_rcv.sb_hiwat)			goto send;	}	/*	 * Send if we owe peer an ACK.	 */	if (tp->t_flags & TF_ACKNOW)		goto send;	if (flags & (TH_SYN|TH_RST))		goto send;	if (SEQ_GT(tp->snd_up, tp->snd_una))		goto send;	/*	 * If our state indicates that FIN should be sent	 * and we have not yet done so, or we're retransmitting the FIN,	 * then we need to send.	 */	if (flags & TH_FIN &&	    ((tp->t_flags & TF_SENTFIN) == 0 || tp->snd_nxt == tp->snd_una))		goto send;	/*	 * TCP window updates are not reliable, rather a polling protocol	 * using ``persist'' packets is used to insure receipt of window	 * updates.  The three ``states'' for the output side are:	 *	idle			not doing retransmits or persists	 *	persisting		to move a small or zero window	 *	(re)transmitting	and thereby not persisting	 *	 * tp->t_timer[TCPT_PERSIST]	 *	is set when we are in persist state.	 * tp->t_force	 *	is set when we are called to send a persist packet.	 * tp->t_timer[TCPT_REXMT]	 *	is set when we are retransmitting	 * The output side is idle when both timers are zero.	 *	 * If send window is too small, there is data to transmit, and no	 * retransmit or persist is pending, then go to persist state.	 * If nothing happens soon, send when timer expires:	 * if window is nonzero, transmit what we can,	 * otherwise force out a byte.	 */	if (so->so_snd.sb_cc && tp->t_timer[TCPT_REXMT] == 0 &&	    tp->t_timer[TCPT_PERSIST] == 0) {		tp->t_rxtshift = 0;		tcp_setpersist(tp);	}	/*	 * No reason to send a segment, just return.	 */	return (0);send:	/*	 * Before ESTABLISHED, force sending of initial options	 * unless TCP set not to do any options.	 * NOTE: we assume that the IP/TCP header plus TCP options	 * always fit in a single mbuf, leaving room for a maximum	 * link header, i.e.	 *	max_linkhdr + sizeof (struct tcpiphdr) + optlen <= MHLEN	 */	optlen = 0;	hdrlen = sizeof (struct tcpiphdr);	if (flags & TH_SYN) {		tp->snd_nxt = tp->iss;		if ((tp->t_flags & TF_NOOPT) == 0) {			u_short mss;			opt[0] = TCPOPT_MAXSEG;			opt[1] = 4;			mss = htons((u_short) tcp_mss(tp, 0));			bcopy((caddr_t)&mss, (caddr_t)(opt + 2), sizeof(mss));			optlen = 4;	 			if ((tp->t_flags & TF_REQ_SCALE) &&			    ((flags & TH_ACK) == 0 ||			    (tp->t_flags & TF_RCVD_SCALE))) {				*((u_long *) (opt + optlen)) = htonl(					TCPOPT_NOP << 24 |					TCPOPT_WINDOW << 16 |					TCPOLEN_WINDOW << 8 |					tp->request_r_scale);				optlen += 4;			}		} 	}  	/*	 * Send a timestamp and echo-reply if this is a SYN and our side 	 * wants to use timestamps (TF_REQ_TSTMP is set) or both our side	 * and our peer have sent timestamps in our SYN's. 	 */ 	if ((tp->t_flags & (TF_REQ_TSTMP|TF_NOOPT)) == TF_REQ_TSTMP && 	     (flags & TH_RST) == 0 && 	    ((flags & (TH_SYN|TH_ACK)) == TH_SYN ||	     (tp->t_flags & TF_RCVD_TSTMP))) {		u_long *lp = (u_long *)(opt + optlen);  		/* Form timestamp option as shown in appendix A of RFC 1323. */ 		*lp++ = htonl(TCPOPT_TSTAMP_HDR); 		*lp++ = htonl(tcp_now); 		*lp   = htonl(tp->ts_recent); 		optlen += TCPOLEN_TSTAMP_APPA; 	} 	hdrlen += optlen; 	/*	 * Adjust data length if insertion of options will	 * bump the packet length beyond the t_maxseg length.	 */	if (len > tp->t_maxseg - optlen) {		len = tp->t_maxseg - optlen;		sendalot = 1;		flags &= ~TH_FIN;	 }#ifdef DIAGNOSTIC 	if (max_linkhdr + hdrlen > CL_SIZE_128)		panic("tcphdr too big");#endif	/*	 * Grab a header mbuf, attaching a copy of data to

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产一区二区三区电影在线观看 | 日韩一区二区在线看| 日韩三级中文字幕| 国产精品电影一区二区三区| 日韩精品电影一区亚洲| 成人app网站| 精品福利一区二区三区免费视频| 亚洲精品你懂的| 国产成人精品免费网站| 91精品国产综合久久久久久漫画| 综合亚洲深深色噜噜狠狠网站| 日本视频在线一区| 在线一区二区三区做爰视频网站| 国产三级精品视频| 精品在线免费视频| 91精品久久久久久久久99蜜臂| 亚洲激情自拍视频| av一区二区久久| 国产日产亚洲精品系列| 久久疯狂做爰流白浆xx| 欧美精品自拍偷拍动漫精品| 一区二区三区中文字幕| 99久久久久免费精品国产| 国产日产欧美一区二区三区| 国产一区二区三区黄视频 | 欧美视频中文字幕| 亚洲欧美日韩在线不卡| av在线一区二区| 国产精品乱码一区二区三区软件| 韩国一区二区在线观看| 日韩欧美色综合| 另类小说色综合网站| 91精品国产色综合久久久蜜香臀| 亚洲成人在线免费| 欧美日韩1234| 日本午夜精品一区二区三区电影 | 在线看国产一区二区| 一区二区三区在线观看动漫| 91小视频免费观看| 亚洲精品国产成人久久av盗摄| 在线观看网站黄不卡| 亚洲午夜精品网| 欧美一区中文字幕| 麻豆精品视频在线| 久久综合色综合88| 成人高清在线视频| 亚洲综合色婷婷| 欧美日韩亚洲综合在线| 天天做天天摸天天爽国产一区| 制服.丝袜.亚洲.另类.中文| 美女国产一区二区三区| 久久久久久亚洲综合影院红桃| 国产999精品久久久久久绿帽| 中文字幕免费不卡在线| 色8久久精品久久久久久蜜| 亚洲高清免费一级二级三级| 日韩精品自拍偷拍| 岛国av在线一区| 一区二区三区在线观看视频| 91麻豆精品国产自产在线| 黄色日韩网站视频| 亚洲丝袜自拍清纯另类| 欧美狂野另类xxxxoooo| 精品亚洲aⅴ乱码一区二区三区| 国产欧美日韩在线| 欧美日本一区二区| 国产盗摄一区二区| 午夜精品久久久久影视| 久久精品这里都是精品| 色噜噜狠狠色综合中国| 久久精品av麻豆的观看方式| 中文字幕综合网| 91精品国产乱码久久蜜臀| 国产99精品在线观看| 婷婷六月综合网| 国产精品久久午夜夜伦鲁鲁| 91精品国产欧美一区二区18| 成人h动漫精品一区二区| 日韩电影在线免费| 专区另类欧美日韩| 久久精品日产第一区二区三区高清版 | 成人看片黄a免费看在线| 亚洲国产精品一区二区尤物区| 2021中文字幕一区亚洲| 91福利资源站| 高清国产一区二区| 婷婷丁香激情综合| 一区二区三区日本| 国产精品网站在线观看| 日韩三级高清在线| 在线一区二区视频| av不卡一区二区三区| 国产麻豆视频一区二区| 日本成人在线电影网| 亚洲一区二区视频在线观看| 国产精品毛片久久久久久久| www激情久久| 91精品国产综合久久久蜜臀粉嫩 | 国产精品传媒入口麻豆| 欧美xxxx在线观看| 日韩亚洲国产中文字幕欧美| 欧美色图12p| 在线观看成人小视频| 99久久精品免费精品国产| 国产一区二区福利视频| 麻豆91免费观看| 欧美a一区二区| 亚洲国产aⅴ天堂久久| 亚洲三级小视频| 国产精品电影院| 国产精品福利一区二区| 中文av一区二区| 国产视频亚洲色图| 久久日一线二线三线suv| 欧美一级黄色片| 欧美电影免费观看高清完整版| 91精品蜜臀在线一区尤物| 日韩亚洲欧美一区| 欧美成人三级电影在线| 日韩视频免费观看高清完整版| 日韩免费看网站| 欧美白人最猛性xxxxx69交| 久久夜色精品国产噜噜av| 久久久影视传媒| 国产精品视频一二三区| 国产精品久久看| 亚洲欧美日韩国产成人精品影院 | 国产综合色在线| 国产精品自拍三区| 成人av午夜电影| 在线视频国内一区二区| 在线不卡一区二区| 欧美mv日韩mv国产网站app| 日韩一区二区三区视频在线观看| 欧美v日韩v国产v| 欧美激情一二三区| 亚洲裸体xxx| 蜜臀久久99精品久久久久久9| 精品影院一区二区久久久| 国产成人在线视频网站| 91玉足脚交白嫩脚丫在线播放| 欧美性猛片aaaaaaa做受| 日韩欧美色综合| 中文字幕视频一区| 亚洲v中文字幕| 国产伦精品一区二区三区免费 | 精品一区二区久久久| 国产精品综合一区二区| 91小视频免费看| 日韩亚洲欧美成人一区| 亚洲欧洲99久久| 日韩精品一级中文字幕精品视频免费观看 | 亚洲精品成人天堂一二三| 天天做天天摸天天爽国产一区| 国产一区二区三区黄视频 | 99精品偷自拍| 日韩一级成人av| 亚洲欧洲成人av每日更新| 人禽交欧美网站| 91丝袜美腿高跟国产极品老师 | 国产精品1024久久| 欧美视频自拍偷拍| 中文幕一区二区三区久久蜜桃| 一区二区免费看| 国产一区二区三区观看| 欧美中文字幕一区二区三区| 亚洲精品一区二区在线观看| 亚洲精品国产第一综合99久久| 精品一区二区三区av| 91精品办公室少妇高潮对白| 日韩美女天天操| 日韩中文欧美在线| 在线观看日产精品| 欧美激情一二三区| 精彩视频一区二区| 欧美日韩免费不卡视频一区二区三区| 国产欧美一区二区精品秋霞影院| 亚洲va欧美va人人爽午夜| 91在线视频播放地址| 久久午夜老司机| 奇米四色…亚洲| 欧美高清视频不卡网| 亚洲精品视频观看| 成人午夜电影久久影院| 久久综合久久鬼色中文字| 人人狠狠综合久久亚洲| 7777精品伊人久久久大香线蕉最新版 | 另类小说图片综合网| 4hu四虎永久在线影院成人| 一区二区久久久久| 99久免费精品视频在线观看| 日本一区二区三区高清不卡| 极品瑜伽女神91| 日韩手机在线导航| 视频在线观看91| 欧美电影在哪看比较好| 日产欧产美韩系列久久99| 欧美日韩国产精品自在自线| 亚洲午夜久久久久| 欧美日韩精品欧美日韩精品|