📄 ipfcons.c,v
字号:
head 1.1;access;symbols;locks dls:1.1; strict;comment @ * @;1.1date 97.09.21.19.27.09; author dls; state Dist;branches;next ;desc@@1.1log@pre-3e code@text@/* ipfcons.c - ipfcons */#include <conf.h>#include <kernel.h>#include <network.h>/*------------------------------------------------------------------------ * ipfcons - construct a single packet from an IP fragment queue *------------------------------------------------------------------------ */struct ep *ipfcons(iq)struct ipfq *iq;{ struct ep *pep, *peptmp; struct ip *pip; int off, seq; pep = (struct ep *)getbuf(Net.lrgpool); if (pep == (struct ep *)SYSERR) { while (peptmp = (struct ep *)deq(iq->ipf_q)) { IpReasmFails++; freebuf(peptmp); } freeq(iq->ipf_q); iq->ipf_state = IPFF_FREE; return 0; } /* copy the Ether and IP headers */ peptmp = (struct ep *)deq(iq->ipf_q); pip = (struct ip *)peptmp->ep_data; off = IP_HLEN(pip); seq = 0; blkcopy(pep, peptmp, EP_HLEN+off); /* copy the data */ while (peptmp != 0) { int dlen, doff; pip = (struct ip *)peptmp->ep_data; doff = IP_HLEN(pip) + seq - ((pip->ip_fragoff&IP_FRAGOFF)<<3); dlen = pip->ip_len - doff; blkcopy(pep->ep_data+off, peptmp->ep_data+doff, dlen); off += dlen; seq += dlen; freebuf(peptmp); peptmp = (struct ep *)deq(iq->ipf_q); } /* fix the large packet header */ pip = (struct ip *)pep->ep_data; pip->ip_len = off; pip->ip_fragoff = 0; /* release resources */ freeq(iq->ipf_q); iq->ipf_state = IPFF_FREE; IpReasmOKs++; return pep;}@
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -