亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? mbuflib.c

?? vxwork源代碼
?? C
?? 第 1 頁 / 共 3 頁
字號:
        (*freeRtn) (mbufDesc->buf, freeArg);    lockKey = intLock ();    mbufDesc->mbufDescNext = mbufDescHead;	/* push desc onto free list */    mbufDescHead = mbufDesc;    intUnlock (lockKey);    }/********************************************************************************* _mbufInsertCopy - copy buffer data into an mbuf chain** This routine copies <len> bytes of data from the user buffer <buf> and* inserts it at the specified byte location in <mbufId>.  The user buffer* is in no way tied to the mbuf chain after this operation; a separate copy* of the data is made.** The location of insertion is specified by <mbufSeg> and <offset>.  Note* that insertion within a chain occurs before the byte location specified* by <mbufSeg> and <offset>.  Additionally, note that <mbufSeg> and <offset>* must be "NULL" and "0", respectively, when inserting into an empty mbuf ID.** RETURNS:* The mbuf pointer associated with the first inserted mbuf,* or NULL if the operation failed.** NOMANUAL*/MBUF_SEG _mbufInsertCopy    (    MBUF_ID		mbufId,		/* mbuf	ID into which data is copied */    MBUF_SEG		mbufSeg,	/* mbuf base for <offset> */    int			offset,		/* relative byte offset */    caddr_t		buf,		/* buffer from which data is copied  */    int			len		/* number of byte to copy */    )    {    MBUF_ID		mbufIdNew;		/* dummy ID for dup operation */    MBUF_SEG		mbufNew;		/* mbuf for copy */    MBUF_SEG *		pMbufPrev;		/* mbuf previous to mbufNew */    int			length;			/* length of each copy */    if (len <= 0)				/* have to copy some bytes */        {	errno = S_mbufLib_LENGTH_INVALID;	return (NULL);	}    MBUF_ID_CREATE (mbufIdNew);			/* create new ID for copy */    if (mbufIdNew == NULL)	return (NULL);    pMbufPrev = &mbufIdNew->mbufHead;		/* init prev ptr to head */    while (len)					/* while more to copy */	{	/* obtain a new mbuf with a data buffer pointed */	if ( (mbufNew = mBufClGet (M_WAIT, MT_DATA, len, FALSE)) == NULL)	    {	    /* release on fail */	    MBUF_ID_DELETE(mbufIdNew);			    return (NULL);	    }	length = min (len, mbufNew->m_extSize); /* num for copy */        bcopy (buf, mtod (mbufNew, char *), length);        buf += length;				/* bump to new buf position */	len -= length;	mbufNew->m_len = length;		/* set len to num copied */        *pMbufPrev = mbufNew;                   /* hook prev into new */	pMbufPrev = &mbufNew->m_next;           /* update prev mbuf ptr */	}    /* insert the new mbuf ID with copied data into <mbufId> */    if ((mbufSeg = _mbufInsert (mbufId, mbufSeg, offset, mbufIdNew)) == NULL)        {	/* release on fail */	MBUF_ID_DELETE(mbufIdNew);			return (NULL);	}    return (mbufSeg);				/* return inserted mbuf */    }/********************************************************************************* _mbufExtractCopy - copy data from an mbuf chain to a buffer** This routine copies <len> bytes of data from <mbufId> to the user* buffer <buf>.** The starting location of the copy is specified by <mbufSeg> and <offset>.** The number of bytes to be copied is given by <len>.  If this parameter* is negative, or is larger than the number of bytes in the chain after the* specified byte location, the rest of the chain will be copied. * The bytes to be copied may span more than one mbuf.** RETURNS:* The number of bytes copied from the mbuf chain to the buffer,* or ERROR if the operation failed.** NOMANUAL*/int _mbufExtractCopy    (    MBUF_ID		mbufId,		/* mbuf	ID from which data is copied */    MBUF_SEG		mbufSeg,	/* mbuf base for <offset> */    int			offset,		/* relative byte offset */    caddr_t		buf,		/* buffer into which data is copied */    int			len		/* number of bytes to copy */    )    {    caddr_t		buf0 = buf;		/* save starting position */    int			length;			/* length of each copy */    /* find the starting location for copying */    if ((mbufSeg = _mbufSegFind (mbufId, mbufSeg, &offset)) == NULL)	return (ERROR);    if (len < 0)				/* negative = rest of chain */	len = INT_MAX;    while (len && (mbufSeg != NULL))		/* while more to copy */	{        length = min (len, (mbufSeg->m_len - offset));	/* num for copy */        bcopy (mtod (mbufSeg, char *) + offset, buf, length);        buf += length;				/* bump to new buf position */        len -= length;	mbufSeg = mbufSeg->m_next;		/* bump to next mbuf in chain */	offset = 0;				/* no more offset */	}    return ((int) buf - (int) buf0);		/* return num bytes copied */    }/********************************************************************************* _mbufCut - cut bytes from an mbuf chain** This routine deletes <len> bytes from <mbufId> starting at the specified* byte location.** The starting location of deletion is specified by <mbufSeg> and <offset>.** The number of bytes to be cut is given by <len>.  If this parameter* is negative, or is larger than the number of bytes in the chain after the* specified byte location, the rest of the chain will be deleted.* The bytes to be deleted may span more than one mbuf.  If all the bytes* in any one mbuf are deleted, then the mbuf will be returned to the* system.  No mbuf may have zero bytes left in it.  ** Deleting bytes out of the middle of an mbuf will cause the mbuf to* be split into two mbufs.  The first mbuf will contain the portion* of the mbuf before the deleted bytes, while the other mbuf will* contain the end portion that remains after <len> bytes are deleted.** This routine returns the mbuf pointer associated with the mbuf just* after the deleted bytes.  In the case where bytes are cut off the end* of an mbuf chain, a value of MBUF_NONE is returned.** RETURNS:* The mbuf pointer associated with the mbuf following the deleted bytes,* or NULL if the operation failed.** NOMANUAL*/MBUF_SEG _mbufCut    (    MBUF_ID		mbufId,		/* mbuf	ID from which bytes are cut */    MBUF_SEG		mbufSeg,	/* mbuf base for <offset> */    int			offset,		/* relative byte offset */    int			len		/* number of bytes to cut */    )    {    MBUF_ID		mbufIdNew;	/* dummy ID for dup operation */    MBUF_SEG *		pMbufPrev;	/* mbuf prev deleted mbuf */    int			length;		/* length of each cut */    /* find the mbuf ptr previous to the cut */    if ((pMbufPrev = _mbufSegFindPrev (mbufId, mbufSeg, &offset)) == NULL)        return (NULL);    if ((mbufSeg = *pMbufPrev) == NULL)		/* find cut mbuf */	{	errno = S_mbufLib_SEGMENT_NOT_FOUND;	return (NULL);	}    if (len < 0)				/* negative = rest of chain */	len = INT_MAX;    while (len && (mbufSeg != NULL))		/* while more to cut */	{        length = min (len, (mbufSeg->m_len - offset)); /* num for cut */        len -= length;        if (offset != 0)			/* if !cutting off front... */	    {	    if (mbufSeg->m_len != (offset + length))/* cut from middle*/		{	        /* duplicate portion remaining after bytes to be cut */                if ((mbufIdNew = _mbufDup (mbufId, mbufSeg, offset + length,		    mbufSeg->m_len - offset - length)) == NULL)	            return (NULL);		                mbufIdNew->mbufHead->m_next = mbufSeg->m_next;                mbufSeg->m_next = mbufIdNew->mbufHead;/* hook in saved data */                mbufSeg->m_len = offset;	/* shorten to later portion */                MBUF_ID_DELETE_EMPTY(mbufIdNew);/* delete dup ID */		return (mbufSeg->m_next);	/* return next real mbuf */		}            else				/* cut to end */                {                mbufSeg->m_len -= length;	/* decrease by len deleted */		pMbufPrev = &mbufSeg->m_next;	/* update previous */		mbufSeg = mbufSeg->m_next;	/* bump current mbuf to next */		}	    offset = 0;				/* no more offset */	    }        else					/* cutting off front... */            {	    if (length == mbufSeg->m_len)	/* cutting whole mbuf ? */		{		mbufSeg = m_free (mbufSeg);	/* free and get next mbuf */		*pMbufPrev = mbufSeg;		/* hook prev to next mbuf */		}            else				/* cut off front portion */		{		mbufSeg->m_data += length;	/* bump up offset */	        mbufSeg->m_len -= length;	/* taken from front */		}            }        }    if (mbufSeg == NULL)			/* special case - cut off end */	return (MBUF_NONE);    return (mbufSeg);				/* return next real mbuf */    }/********************************************************************************* _mbufSplit - split an mbuf chain into two separate mbuf chains** This routine splits <mbufId> into two separate chains at the specified* byte location.  The first portion remains in <mbufId>, while the end* portion is returned in a newly created mbuf ID.** The location of the split is specified by <mbufSeg> and <offset>.** RETURNS:* The mbuf ID of a newly created chain containing the end portion of <mbufId>,* or NULL if the operation failed.** NOMANUAL*/MBUF_ID _mbufSplit    (    MBUF_ID		mbufId,		/* mbuf	ID to split into two */    MBUF_SEG		mbufSeg,	/* mbuf base for <offset> */    int			offset		/* relative byte offset */    )    {    MBUF_ID		mbufIdNew;		/* mbuf ID of later portion */    MBUF_SEG *		pMbufPrev;		/* mbuf prev to insert */    /* find the mbuf ptr previous to the split */    if ((pMbufPrev = _mbufSegFindPrev (mbufId, mbufSeg, &offset)) == NULL)        return (NULL);    if (offset == 0)				/* in middle of mbuf */	{        MBUF_ID_CREATE (mbufIdNew);		/* create ID for end portion */        if (mbufIdNew == NULL)	    return (NULL);        mbufIdNew->mbufHead = *pMbufPrev;	/* hook in new head */        *pMbufPrev = NULL;			/* tie off first portion */	}    else					/* split on mbuf boundary */	{        mbufSeg = *pMbufPrev;			/* find split mbuf */        if ((mbufIdNew = _mbufDup (mbufId, mbufSeg, offset,	    mbufSeg->m_len - offset)) == NULL)	    return (NULL);			/* dup later portion */        mbufIdNew->mbufHead->m_next = mbufSeg->m_next;        mbufSeg->m_len = offset;        mbufSeg->m_next = NULL;			/* tie off first portion */	}    return (mbufIdNew);				/* return ID for end */    }/********************************************************************************* _mbufDup - duplicate an mbuf chain** This routine duplicates <len> bytes of <mbufId> starting at the specified* byte location, and returns the mbuf ID of the newly created duplicate mbuf.** The starting location of duplication is specified by <mbufSeg> and <offset>.* The number of bytes to be duplicated is given by <len>.  If this* parameter is negative, or is larger than the than the number of bytes* in the chain after the specified byte location, the rest of the chain will* be duplicated.** Duplication of mbuf data only involves copying of the data when the mbuf* is not a cluster.  If the mbuf to be duplicated is a cluster, the mbuf* pointer information is duplicated, while the data is not.  This implies* that that the mbuf data is shared among all clusters associated* with a particular cluster data buffer.** RETURNS:* The mbuf ID of a newly created dupicate mbuf chain,* or NULL if the operation failed.** NOMANUAL*/MBUF_ID _mbufDup    (    MBUF_ID		mbufId,		/* mbuf ID to duplicate */    MBUF_SEG		mbufSeg,	/* mbuf base for <offset> */    int			offset,		/* relative byte offset */    int			len		/* number of bytes to duplicate */    )    {    MBUF_ID		mbufIdNew;	/* mbuf ID of duplicate */    MBUF_SEG		mbufNew;	/* mbuf for duplicate */    MBUF_SEG *		pMbufPrev;	/* mbuf prev to mbufNew */    /* find the starting location for duplicate */    if ((mbufSeg = _mbufSegFind (mbufId, mbufSeg, &offset)) == NULL)        return (NULL);    if (len < 0)				/* negative = rest of chain */	len = INT_MAX;    MBUF_ID_CREATE (mbufIdNew);			/* get ID for duplicate */    if (mbufIdNew == NULL)        return (NULL);    pMbufPrev = &mbufIdNew->mbufHead;		/* init prev ptr to head */    while (len && (mbufSeg != NULL))		/* while more to duplicate */	{	/* get mbuf for duplicate */        if ( (mbufNew = mBlkGet (_pNetDpool, M_WAIT, mbufSeg->m_type)) == NULL)	    {	    /* release on fail */	    	    MBUF_ID_DELETE(mbufIdNew);			    return (NULL);	    }        mbufNew->m_len = min (len, (mbufSeg->m_len - offset));        len -= mbufNew->m_len;			/* num to duplicate */	/* copy the cluster header mbuf info to duplicate */	mbufNew->m_data	= mtod (mbufSeg, char *)  + offset;	mbufNew->m_flags	= mbufSeg->m_flags;	mbufNew->m_ext	= mbufSeg->m_ext;	/* bump share count */	{	int s = intLock ();	++(mbufNew->m_extRefCnt);	intUnlock (s);	}	    	*pMbufPrev = mbufNew;			/* hook prev into duplicate */        pMbufPrev = &mbufNew->m_next;		/* update prev mbuf ptr */	mbufSeg = mbufSeg->m_next;		/* bump original chain */	offset = 0;				/* no more offset */	}    return (mbufIdNew);				/* return ID of duplicate */    }/********************************************************************************* _mbufLength - determine the legnth in bytes of an mbuf chain** This routine returns the number of bytes in the mbuf chain <mbufId>.** RETURNS:* The number of bytes in the mbuf chain,* or ERROR if the operation failed** NOMANUAL*/int _mbufLength    (    MBUF_ID		mbufId		/* mbuf	ID to find length of */    )    {    MBUF_SEG		mbuf;    int			length = 0;		/* total length */    if (mbufId == NULL || 	mbufId->type != MBUF_VALID)		/* invalid ID ? */	{	errno = S_mbufLib_ID_INVALID;	return (ERROR);	}    for (mbuf = mbufId->mbufHead; mbuf != NULL; mbuf = mbuf->m_next)        length += mbuf->m_len;    return (length);				/* return total length */    }#if	FALSE/********************************************************************************* _mbufSegJoin - coalesce two adjacent mbuf cluster fragments.** This routine combines two or more contiguous mbufs into a single* mbuf.  Such an operation is only feasible for joining mbufs* that have the same freeRtn and freeArg, and that follow eachother in* the chain.  This could be useful for coalescing mbufs fragmented* by split operations.* * Not in service yet -> not clear that it is a useful routine.** NOMANUAL*/STATUS _mbufSegJoin    (    MBUF_ID		mbufId,		/* mbuf ID containing mbufs to join */    MBUF_SEG		mbufSeg		/* first mbuf to join */    )    {    MBUF_SEG		mbufNext;    STATUS		status = ERROR;    if (mbufId == NULL	|| mbufId->type != MBUF_VALID)		/* invalid ID ? */	{	errno = S_mbufLib_ID_INVALID;	return (ERROR);	}    if (mbufId->mbufHead == NULL)		/* is this chain empty ? */        {		errno = S_mbufLib_ID_EMPTY;	return (ERROR);	}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
中文字幕精品三区| 极品销魂美女一区二区三区| 亚洲成av人片一区二区梦乃| 韩国毛片一区二区三区| 在线免费观看日本一区| 国产亚洲综合在线| 免费成人在线观看| 欧美性色黄大片手机版| 欧美激情自拍偷拍| 久久99精品国产.久久久久| 一本色道久久综合亚洲91| 久久亚洲精精品中文字幕早川悠里 | 亚洲午夜三级在线| 成人av综合在线| 久久久久久97三级| 精品一区二区在线视频| 欧美精品日日鲁夜夜添| 亚洲免费大片在线观看| 99热精品国产| 国产精品久久久久久久久图文区| 国产露脸91国语对白| 日韩欧美专区在线| 蜜桃免费网站一区二区三区| 欧美精品v日韩精品v韩国精品v| 亚洲精品高清在线| 日本高清不卡视频| 一区二区三区影院| 在线视频国内自拍亚洲视频| 亚洲精品国产视频| 欧美午夜在线一二页| 亚洲精品日日夜夜| 欧美亚洲动漫制服丝袜| 亚洲自拍偷拍欧美| 欧美日韩精品是欧美日韩精品| 亚洲桃色在线一区| 色综合久久综合网欧美综合网| 亚洲女同ⅹxx女同tv| 欧美在线观看一区二区| 亚洲成a人v欧美综合天堂下载 | 欧美嫩在线观看| 亚洲va欧美va人人爽午夜| 欧美在线999| 国产91精品一区二区麻豆亚洲| 久久综合网色—综合色88| 国产在线视频精品一区| 国产日韩欧美麻豆| 波波电影院一区二区三区| 亚洲欧美偷拍三级| 欧美日韩国产乱码电影| 日韩精品乱码av一区二区| 日韩欧美一级特黄在线播放| 国产精品一二一区| 日韩一区在线看| 欧美日本韩国一区二区三区视频 | 欧美一区二区精品| 国产资源精品在线观看| 日韩一区在线免费观看| 欧美日韩三级一区二区| 国产综合色精品一区二区三区| 久久综合狠狠综合久久综合88| 国产98色在线|日韩| 亚洲一区二区3| www久久精品| 在线欧美日韩精品| 精品一区二区综合| 一区二区三区四区在线| 日韩亚洲欧美在线| 97精品国产97久久久久久久久久久久| 亚洲成人777| 国产日韩精品一区二区浪潮av | 一区二区三区四区激情| 日韩欧美中文一区二区| 成人精品小蝌蚪| 日韩av电影免费观看高清完整版在线观看| 久久先锋影音av| 欧美日韩精品一二三区| 成人app在线| 人禽交欧美网站| 亚洲乱码精品一二三四区日韩在线| 69堂精品视频| 日韩一区二区三区免费看| 国产不卡视频一区| 青草国产精品久久久久久| 中文一区二区完整视频在线观看| 91精品久久久久久久91蜜桃 | 成人免费小视频| 亚洲精品一区二区精华| 欧美中文字幕一二三区视频| 国产精品2024| 免费在线观看视频一区| 亚洲主播在线播放| 最新成人av在线| 久久精品一二三| 欧美一二三区在线| 欧美日韩国产美女| 欧美午夜精品免费| 99精品在线免费| 粉嫩久久99精品久久久久久夜| 久久激情五月激情| 婷婷六月综合亚洲| 亚洲电影你懂得| 亚洲激情综合网| 亚洲欧美视频一区| 亚洲人成伊人成综合网小说| 欧美激情在线一区二区三区| 精品国产一区二区在线观看| 欧美一区二区三区免费大片| 欧美日韩你懂得| 欧美日韩亚洲综合| 欧美色区777第一页| 欧美午夜片在线观看| 欧美亚洲国产怡红院影院| 91视频一区二区| 99riav一区二区三区| 91女厕偷拍女厕偷拍高清| av成人免费在线| 91偷拍与自偷拍精品| 91原创在线视频| 91九色02白丝porn| 欧美艳星brazzers| 欧美欧美午夜aⅴ在线观看| 欧美日本视频在线| 欧美一区二区三区成人| 欧美大片拔萝卜| 国产午夜精品一区二区三区视频 | 欧美精品三级在线观看| 91精品国产91热久久久做人人| 欧美夫妻性生活| 日韩欧美一卡二卡| 日本一区二区视频在线观看| 亚洲永久精品大片| 午夜天堂影视香蕉久久| 日产欧产美韩系列久久99| 久久99精品久久久久久| 国产成人午夜精品5599| 91影院在线观看| 欧美高清www午色夜在线视频| 9191成人精品久久| 久久久久青草大香线综合精品| 国产女主播一区| 亚洲精品乱码久久久久久| 日韩电影在线一区二区三区| 激情欧美一区二区| 99精品视频在线观看| 欧美日韩视频在线一区二区 | 中文字幕av不卡| 午夜私人影院久久久久| 国产美女精品一区二区三区| 99这里只有久久精品视频| 欧美三级日韩三级| 久久久久久97三级| 亚洲一级不卡视频| 国产精品亚洲午夜一区二区三区| 91福利国产精品| 久久久久国产免费免费| 性做久久久久久久久| 成人免费视频一区| 欧美剧情电影在线观看完整版免费励志电影 | 色欧美88888久久久久久影院| 在线不卡欧美精品一区二区三区| 久久久777精品电影网影网 | 91国内精品野花午夜精品| 91精品国产日韩91久久久久久| 久久久久97国产精华液好用吗| 亚洲成av人片| 91在线国产观看| 久久伊99综合婷婷久久伊| 一区二区三区视频在线看| 国产在线乱码一区二区三区| 欧美日韩成人综合| 亚洲欧洲日产国产综合网| 久久丁香综合五月国产三级网站| 色偷偷88欧美精品久久久 | 欧美一级淫片007| 亚洲欧洲日韩一区二区三区| 精品在线免费视频| 欧美日韩三级一区二区| 亚洲男人的天堂网| 大胆欧美人体老妇| 久久综合色8888| 毛片不卡一区二区| 91麻豆精品91久久久久久清纯 | 国产精品美女一区二区三区| 亚洲福利一区二区| 色又黄又爽网站www久久| 中文字幕第一页久久| 国产一区二区免费视频| 日韩欧美国产小视频| 日韩电影在线观看一区| 欧美肥妇bbw| 天天做天天摸天天爽国产一区| 在线观看日韩国产| 伊人色综合久久天天| 99精品久久久久久| 亚洲欧美在线视频观看| 成人黄色软件下载| 亚洲欧洲成人精品av97| kk眼镜猥琐国模调教系列一区二区| 久久久99精品免费观看不卡| 国产麻豆精品在线观看|