tfinsert.c

来自「关于TCP方面的」· C语言 代码 · 共 29 行

C
29
字号
/* tfinsert.c - tfinsert */#include <conf.h>#include <kernel.h>#include <network.h>#include <mem.h>#include <q.h>/*------------------------------------------------------------------------ *  tfinsert - add a new TCP segment fragment to a TCB sequence queue *------------------------------------------------------------------------ */inttfinsert(struct tcb *ptcb, tcpseq seq, unsigned datalen){	struct	tcpfrag	*tf;	if (datalen == 0)		return OK;	tf = (struct tcpfrag *)getmem(sizeof(struct tcpfrag));	tf->tf_seq = seq;	tf->tf_len = datalen;	if (ptcb->tcb_rsegq < 0)		ptcb->tcb_rsegq = newq(NTCPFRAG, QF_WAIT);	if (enq(ptcb->tcb_rsegq, tf, -tf->tf_seq) < 0)		freemem(tf, sizeof(struct tcpfrag));	return OK;}

⌨️ 快捷键说明

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