tcp_in.c

来自「TCP-IP红宝书源代码」· C语言 代码 · 共 25 行

C
25
字号
/* tcp_in.c - tcp_in */

#include <conf.h>
#include <kernel.h>
#include <network.h>
#include <ports.h>

/*------------------------------------------------------------------------
 *  tcp_in - deliver an inbound TCP packet to the TCP process
 *------------------------------------------------------------------------
 */
int
tcp_in(struct netif *pni, struct ep *pep)
{
	/* drop instead of blocking on psend */ 

	TcpInSegs++;
	if (pcount(tcps_iport) >= TCPQLEN) {
		freebuf(pep);
		return SYSERR;
	}
	psend(tcps_iport, (int)pep);
	return OK;
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?