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

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

?? mbuflib.c

?? vxworks的完整的源代碼
?? 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| 国产精品久久久久久久久免费樱桃| aaa欧美大片| 亚洲男人的天堂在线aⅴ视频| 91精品1区2区| 免费一级欧美片在线观看| 欧美成人激情免费网| 国产福利不卡视频| 国产精品日韩成人| 欧美午夜片在线观看| 免费高清在线视频一区·| 国产三级一区二区| 日本精品视频一区二区| 日韩av一区二区三区四区| 精品国产99国产精品| 成人av网在线| 午夜精品123| 欧美精品一区二区三区高清aⅴ| 99久久精品免费看| 午夜电影久久久| 国产色爱av资源综合区| 在线观看免费视频综合| 老司机精品视频导航| 国产精品视频第一区| 欧美日韩国产一区二区三区地区| 国产一区在线观看视频| 一区二区三区四区视频精品免费 | 久久国产剧场电影| 国产精品国产a| 91精品免费观看| thepron国产精品| 奇米影视一区二区三区小说| 最新国产の精品合集bt伙计| 日韩一区二区在线观看视频播放| 91亚洲精品久久久蜜桃| 精品一区二区综合| 亚洲电影一区二区三区| 欧美国产1区2区| 日韩欧美专区在线| 色婷婷久久久久swag精品| 国产综合色视频| 亚洲国产日韩一级| 国产精品国模大尺度视频| 日韩一区二区三区免费观看| 91丨porny丨在线| 国产精品中文字幕欧美| 日韩av电影免费观看高清完整版在线观看| 国产精品国产三级国产aⅴ中文| 欧美一级艳片视频免费观看| 欧美综合亚洲图片综合区| 国产成人福利片| 久久99久久99| 日韩精品国产欧美| 亚洲成av人片一区二区| 亚洲人精品一区| 国产亚洲va综合人人澡精品| 精品国产免费久久| 91精品国产欧美一区二区成人| 色婷婷狠狠综合| 成av人片一区二区| 高清久久久久久| 国产精华液一区二区三区| 视频一区二区三区中文字幕| 亚洲一区av在线| 亚洲欧洲综合另类在线| 亚洲欧洲99久久| 中文字幕+乱码+中文字幕一区| 精品欧美一区二区在线观看| 日韩色在线观看| 91精选在线观看| 91精品国产麻豆| 欧美一区二区成人| 日韩欧美一区二区三区在线| 555www色欧美视频| 91精品国产综合久久精品app | 毛片基地黄久久久久久天堂| 亚洲v中文字幕| 日韩精品欧美精品| 美女一区二区久久| 精品一区二区在线视频| 国产精品一区二区你懂的| 国产成人综合视频| 国产成人午夜精品5599| 成人国产精品免费网站| 91视视频在线直接观看在线看网页在线看| 99久久久久久| 欧美日韩日本视频| 日韩午夜av一区| 久久久国产精华| 国产精品欧美久久久久无广告| 国产精品久久夜| 亚洲第四色夜色| 精品亚洲国产成人av制服丝袜| 国产在线播放一区| 不卡视频一二三| 欧美曰成人黄网| 日韩免费成人网| 国产欧美日产一区| 亚洲精品中文在线| 日本欧美韩国一区三区| 丁香婷婷深情五月亚洲| 色一区在线观看| 日韩亚洲欧美在线| 国产精品久久久久久亚洲毛片 | 欧美激情在线一区二区三区| 亚洲欧美另类图片小说| 日本午夜精品视频在线观看 | 99久久久国产精品免费蜜臀| 欧美视频一区在线| 日韩精品在线一区二区| 亚洲欧美在线aaa| 成人免费观看视频| 欧美夫妻性生活| 久久久99精品久久| 一区二区三区日本| 国产在线乱码一区二区三区| 色综合中文综合网| 亚洲综合激情另类小说区| 午夜精品在线看| 国产一区二区三区免费播放| 色婷婷综合久久久久中文一区二区| 91精品国产综合久久精品图片 | 精品一区二区av| 日本高清不卡aⅴ免费网站| 日韩一区二区三区在线视频| 国产精品成人免费在线| 久久国产生活片100| 欧美三区在线观看| 国产精品美女久久久久高潮| 蜜臀久久久99精品久久久久久| 99精品久久99久久久久| 337p日本欧洲亚洲大胆色噜噜| 一区二区三区视频在线观看| 国产精品一级黄| 欧美电影免费观看完整版| 亚洲成在人线在线播放| 成人性生交大片免费看中文 | 欧美亚洲一区二区三区四区| 国产色一区二区| 麻豆专区一区二区三区四区五区| 日本电影亚洲天堂一区| 中文在线一区二区| 国产精品一区三区| 91精品国产91综合久久蜜臀| 一区二区三区四区高清精品免费观看 | 韩日精品视频一区| 欧美日韩免费在线视频| 国产精品成人免费在线| 高清国产一区二区| 日韩精品一区二区三区视频 | 欧美精品一区二区三区蜜臀 | 亚洲综合激情另类小说区| 波多野结衣中文字幕一区| 久久久影视传媒| 久88久久88久久久| 91精品福利在线一区二区三区 | 奇米影视一区二区三区小说| 欧美日韩美少妇| 天天操天天综合网| 欧美午夜电影网| 亚洲国产欧美在线| 欧美午夜电影在线播放| 亚洲高清视频在线| 欧美乱熟臀69xxxxxx| 亚洲国产精品一区二区www在线| 一本一本大道香蕉久在线精品 | 99国产精品久久久久| 欧美国产视频在线| 高清不卡在线观看av| 中文字幕在线观看不卡| 不卡一二三区首页| 亚洲色欲色欲www| www.在线欧美| 亚洲综合免费观看高清在线观看| 在线观看视频一区| 日本成人中文字幕| 久久一区二区视频| 成人免费看片app下载| 亚洲欧洲精品天堂一级 | 亚洲国产精品一区二区www| 欧美三级视频在线| 日韩精品乱码免费| 久久色在线观看| 97超碰欧美中文字幕| 亚洲一区在线电影| 日韩欧美第一区| 国产剧情一区二区| 中文字幕综合网| 5858s免费视频成人| 国产激情一区二区三区| 亚洲三级在线免费| 51精品秘密在线观看| 国产一区二区三区四区五区入口 |