tcphowmuch.c

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

C
23
字号
/* tcphowmuch.c.c - tcphowmuch */

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

/*------------------------------------------------------------------------
 *  tcphowmuch.c - compute how much data is available to send
 *------------------------------------------------------------------------
 */
int
tcphowmuch(struct tcb *ptcb)
{
	int	tosend;

	tosend = ptcb->tcb_suna + ptcb->tcb_sbcount - ptcb->tcb_snext;
	if (ptcb->tcb_code & TCPF_SYN)
		++tosend;
	if (ptcb->tcb_flags & TCBF_SNDFIN)
		++tosend;
	return tosend;
}

⌨️ 快捷键说明

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