⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 ipfhcopy.c,v

📁 关于IP协议方面的
💻 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@/* ipfhcopy.c - ipfhcopy */#include <conf.h>#include <kernel.h>#include <network.h>/*------------------------------------------------------------------------ *  ipfhcopy -  copy the hardware, IP header, and options for a fragment *------------------------------------------------------------------------ */int ipfhcopy(pepto, pepfrom, offindg)struct	ep	*pepto, *pepfrom;unsigned int	offindg;{	struct	ip	*pipfrom = (struct ip *)pepfrom->ep_data;	unsigned	i, maxhlen, olen, otype;	unsigned	hlen = (IP_MINHLEN<<2);	if (offindg == 0) {		blkcopy(pepto, pepfrom, EP_HLEN+IP_HLEN(pipfrom));		return IP_HLEN(pipfrom);	}	blkcopy(pepto, pepfrom, EP_HLEN+hlen);	/* copy options */	maxhlen = IP_HLEN(pipfrom);	i = hlen;	while (i < maxhlen) {		otype = pepfrom->ep_data[i];		olen = pepfrom->ep_data[++i];		if (otype & IPO_COPY) {			blkcopy(&pepto->ep_data[hlen],				pepfrom->ep_data[i-1], olen);			hlen += olen;		} else if (otype == IPO_NOP || otype == IPO_EOOP) {			pepto->ep_data[hlen++] = otype;			olen = 1;		}		i += olen-1;				if (otype == IPO_EOOP)			break;	}	/* pad to a multiple of 4 octets */	while (hlen % 4)		pepto->ep_data[hlen++] = IPO_NOP;	return hlen;}@

⌨️ 快捷键说明

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