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

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

?? netbuflib.c

?? vxwork源代碼
?? C
?? 第 1 頁 / 共 5 頁
字號:
/* netBufLib.c - network buffer library *//* Copyright 1984 - 2001 Wind River Systems, Inc. */#include "copyright_wrs.h"/*modification history--------------------01r,07may02,kbw  man page edits01q,15oct01,rae  merge from truestack ver 01w, base 01n (SPR #65195 etc.)01p,08feb01,kbw  fixing a man page format problem01o,07feb01,spm  removed unused garbage collection code; updated documentation01n,26aug98,fle  doc : fixed a proc header trouble with netPoolInit01m,25aug98,n_s  M_WAIT will only call _pNetBufCollect 1 time. spr #2210401l,12dec97,kbw  making minor man page fixes01k,11dec97,vin  added netMblkOffsetToBufCopy part of SPR 9563.01j,08dec97,vin  added netMblkChainDup() SPR 9966.01i,05dec97,vin  changed netMblkClFree to netMblkFree in netTupleGet()01h,03dec97,vin  added netTupleGet() SPR 9955, added some unsupported routines 01g,13nov97,vin  code clean up.01f,25oct97,kbw  making minor man page fixes01e,08oct97,vin  corrected clBlkFree()01d,06oct97,vin  fixed a man page.01c,30sep97,vin  changed MSIZE to M_BLK_SZ.01b,19sep97,vin  added cluster Blks, fixed bugs, removed reference count		 pointers.01a,08aug97,vin  written.*//*DESCRIPTIONThis library contains routines that you can use to organize and maintaina memory pool that consists of pools of `mBlk' structures, pools of `clBlk'structures, and pools of clusters.  The `mBlk' and `clBlk' structuresare used to manage the clusters.  The clusters are containers for the datadescribed by the `mBlk' and `clBlk' structures.These structures and the various routines of this library constitute abuffering API that has been designed to meet the needs both of network protocols and network device drivers. The `mBlk' structure is the primary vehicle for passing data betweena network driver and a protocol.  However, the `mBlk' structure mustfirst be properly joined with a `clBlk' structure that was previouslyjoined with a cluster.  Thus, the actual vehicle for passing data isnot merely an `mBlk' structure but an `mBlk'-`clBlk'-clusterconstruct. To use this feature, include the following component:INCLUDE_NETWRS_NETBUFLIBINCLUDE FILES: netBufLib.hINTERNAL	 ------------        |mBlk       |        |manages    |	|clusterBlk |        |           |	|	    |        ------------|\    -------------	              \   |clBlk      |		       \  |manages the|			\ |cluster.   |		         \|clRefCnt=1 |			  ------------|			           \				    \				     \  ------------|				      \|Cluster     |				       |	    |				       |	    |				       |	    |				       |	    |				       |-------------Two mBlks sharing the same cluster:-----------------------------------                                                          -----------|                      |-----------|        | mBlk      |                      | mBlk      |        |           |                      |           |        |           |                      |           |        |           |                      |           |        |           |                      |           |        |-----------\                      /-----------|                     \                    /                          \                  /                       \                /                        \|------------|/                         | clBlk      |                                        |            |                                         |clRefCnt = 2|                                         |            |                                         |            |                                         |------------\                                                       \                                                      |---------------|                                       | cluster       |                                       |               |                                       |               |                                       |---------------|*//* includes */#include "vxWorks.h"#include "stdlib.h"#include "intLib.h"#include "string.h"#include "semaphore.h"#include "memLib.h"#include "errnoLib.h"#include "netBufLib.h"#include "private/semLibP.h"#include "memPartLib.h"/* Virtual Stack Support */#ifdef VIRTUAL_STACK#include "netinet/vsLib.h"#endif/* defines */#undef NETBUF_DEBUG#ifdef NETBUF_DEBUG#include "logLib.h"#endif /* NETBUF_DEBUG */#define FROM_KHEAP      1   /* let _poolInit() use KHEAP_ALLOC */#define FROM_HOMEPDHEAP 0   /* let _poolInit() use calloc() */ /* global */VOIDFUNCPTR 		_pNetBufCollect = NULL; /* protocol specific routine *//* extern */IMPORT int ffsMsb ();/* forward declarations */LOCAL STATUS		_poolInit (NET_POOL_ID pNetPool, M_CL_CONFIG *                                   pMclBlkConfig, CL_DESC * pClDescTbl,                                   int clDescTblNumEnt, BOOL fromKheap);LOCAL M_BLK_ID 		_mBlkCarve (NET_POOL_ID pNetPool, int num,                                    char * pool);LOCAL CL_BLK_ID 	_clBlkCarve (int num, char * pool);LOCAL CL_BUF_ID 	_clPoolCarve (CL_POOL_ID pClPool, int num, int clSize,                                      char * pool);LOCAL STATUS 		_memPoolInit (int num, int unitSize, int headerSize,                                      char * memArea);LOCAL void		_mBlkFree (NET_POOL_ID pNetPool, M_BLK_ID pMblk);LOCAL void 		_clBlkFree (CL_BLK_ID pClBlk);LOCAL void 		_clFree (NET_POOL_ID pNetPool, char * pClBuf);LOCAL M_BLK_ID 		_mBlkClFree (NET_POOL_ID pNetPool, M_BLK_ID pMblk);LOCAL M_BLK_ID 		_mBlkGet (NET_POOL_ID pNetPool, int canWait,                                  UCHAR type);LOCAL CL_BLK_ID		_clBlkGet (NET_POOL_ID pNetPool, int canWait);LOCAL char *	 	_clusterGet (NET_POOL_ID pNetPool, CL_POOL_ID pClPool);LOCAL STATUS 		_mClGet (NET_POOL_ID pNetPool, M_BLK_ID pMblk,                                 int bufSize, int canWait, BOOL bestFit);LOCAL CL_POOL_ID 	_clPoolIdGet (NET_POOL_ID pNetPool, int	bufSize,                                      BOOL bestFit);LOCAL POOL_FUNC dfltFuncTbl =		/* default pool function table */    {    _poolInit,    _mBlkFree,    _clBlkFree,    _clFree,    _mBlkClFree,    _mBlkGet,    _clBlkGet,    _clusterGet,    _mClGet,    _clPoolIdGet,    };/* * this is a global pointer to a function table provided as a back door * for users who want to use a different allocation scheme for defaults * By initializing this _pNetPoolFuncTbl at runtime before initialization of * the network stack, one can change the default function table.  The system * pools use the default function table. */   POOL_FUNC * 	_pNetPoolFuncTbl = &dfltFuncTbl;/********************************************************************************  * _poolInit - initialize the net pool** This function initializes a net pool** RETURNS: OK or ERROR.** NOMANUAL*/LOCAL STATUS _poolInit    (    NET_POOL_ID		pNetPool,	/* pointer to a net pool */    M_CL_CONFIG *	pMclBlkConfig,	/* pointer to mBlk,clBlk config */    CL_DESC *		pClDescTbl,	/* pointer to cluster desc table */    int			clDescTblNumEnt, /* number of cluster desc entries */    BOOL                fromKheap       /* 1:KHEAP_ALLOC  0:malloc/calloc */    )    {    int 		ix;		/* index variable */    int 		iy; 		/* index variable */    int 		log2Size;	/* cluster size to the base 2 */    CL_DESC * 		pClDesc;	/* pointer to the cluster descriptor */    CL_POOL * 		pClPool; 	/* pointer to the cluster pool */    char * 		memArea;    bzero ((char *) pNetPool->clTbl, sizeof (pNetPool->clTbl));    if (fromKheap)	{	if ((pNetPool->pPoolStat = (M_STAT *) KHEAP_ALLOC(sizeof (M_STAT))) == NULL)	    return (ERROR);	bzero ((char *)pNetPool->pPoolStat, sizeof (M_STAT));	}    else {	if ((pNetPool->pPoolStat = (M_STAT *) calloc (1, sizeof (M_STAT))) == NULL)	    return (ERROR);        }    pNetPool->pmBlkHead = NULL;    if (pMclBlkConfig != NULL)	/* if mbuf config is specified */        {        if (pMclBlkConfig->memSize <            ((pMclBlkConfig->mBlkNum *  (M_BLK_SZ + sizeof(long))) +             (pMclBlkConfig->clBlkNum * CL_BLK_SZ)))            {            errno = S_netBufLib_MEMSIZE_INVALID;            goto poolInitError;            }        /* initialize the memory pool */        if (_memPoolInit (pMclBlkConfig->mBlkNum, M_BLK_SZ, sizeof(void *),                          pMclBlkConfig->memArea                          ) != OK)            {            goto poolInitError;            }        /* carve up the mBlk pool */        pNetPool->pmBlkHead = _mBlkCarve (        				 pNetPool,                                         pMclBlkConfig->mBlkNum,                                         pMclBlkConfig->memArea                                         );        /* increment free mBlks  and number of mBlks */        pNetPool->mBlkCnt		      = pMclBlkConfig->mBlkNum;        pNetPool->mBlkFree		      = pMclBlkConfig->mBlkNum;        pNetPool->pPoolStat->mTypes [MT_FREE] = pMclBlkConfig->mBlkNum;        pNetPool->pPoolStat->mNum 	      = pMclBlkConfig->mBlkNum;        memArea = (char * )((int)pMclBlkConfig->memArea +                            (pMclBlkConfig->mBlkNum * (M_BLK_SZ +                                                       sizeof(long))));        if (pMclBlkConfig->clBlkNum > 0)            {            /* initialize the memory pool */            if (_memPoolInit (pMclBlkConfig->clBlkNum, CL_BLK_SZ, 0, memArea)                != OK)                goto poolInitError;            pNetPool->pClBlkHead = _clBlkCarve (                                               pMclBlkConfig->clBlkNum,                                               memArea                                               );            if (pNetPool->pClBlkHead == NULL)                goto poolInitError;            }        }    /* initialize clusters */    pNetPool->clMask   = 0;    pNetPool->clLg2Max = 0;    pNetPool->clLg2Min = 0;    for (pClDesc = pClDescTbl, ix = 0 ; (pClDesc != NULL) &&             (pClDesc->clNum > 0) && (ix < clDescTblNumEnt); ix++, pClDesc++)	{	/* range check cluster type */	if ((pClDesc->clSize < CL_SIZE_MIN) || (pClDesc->clSize > CL_SIZE_MAX))            {#ifdef NETBUF_DEBUG	    logMsg ("poolInit -- Invalid cluster type\n", 0, 0, 0, 0, 0, 0);#endif /* NETBUF_DEBUG */            errno = S_netBufLib_CLSIZE_INVALID;            goto poolInitError;            }	log2Size 	 = SIZE_TO_LOG2(pClDesc->clSize);	pNetPool->clMask |= CL_LOG2_TO_CL_SIZE(log2Size); /* set the mask */	if ((pNetPool->clLg2Max == 0) && (pNetPool->clLg2Min == 0))	    {	    pNetPool->clLg2Min 	= log2Size;	    pNetPool->clLg2Max 	= log2Size;	    }	pNetPool->clLg2Max  = max(log2Size, pNetPool->clLg2Max);	pNetPool->clLg2Min  = min(log2Size, pNetPool->clLg2Min);        pNetPool->clSizeMax = CL_LOG2_TO_CL_SIZE(pNetPool->clLg2Max);        pNetPool->clSizeMin = CL_LOG2_TO_CL_SIZE(pNetPool->clLg2Min);	if (fromKheap)	    {	    if ((pClPool = (CL_POOL *) KHEAP_ALLOC(sizeof(CL_POOL))) == NULL)		{#ifdef NETBUF_DEBUG		logMsg ("poolInit -- cluster pool allocation\n", 0, 0, 0, 0, 0, 0);#endif /* NETBUF_DEBUG */		errno = S_netBufLib_NO_SYSTEM_MEMORY;		goto poolInitError;		}	    bzero ((char *)pClPool, sizeof (CL_POOL));	    }	else {	    if ((pClPool = (CL_POOL *) calloc (1, sizeof(CL_POOL))) == NULL)		{#ifdef NETBUF_DEBUG		logMsg ("poolInit -- cluster pool allocation\n", 0, 0, 0, 0, 0, 0);#endif /* NETBUF_DEBUG */		errno = S_netBufLib_NO_SYSTEM_MEMORY;		goto poolInitError;		}	    }        pNetPool->clTbl [CL_LOG2_TO_CL_INDEX(log2Size)] = pClPool;	for (iy = (log2Size - 1);	    ((!(pNetPool->clMask & CL_LOG2_TO_CL_SIZE(iy))) &&	     (CL_LOG2_TO_CL_INDEX(iy) >= CL_INDX_MIN))  ; iy--)	    {	    pNetPool->clTbl [CL_LOG2_TO_CL_INDEX(iy)] = pClPool;	    }	pClPool->clSize	  = pClDesc->clSize;        pClPool->clLg2	  = log2Size;        pClPool->pNetPool = pNetPool; /* initialize the back pointer */        if (pClDesc->memSize < (pClDesc->clNum * (pClDesc->clSize +                                                  sizeof(int))))            {            errno = S_netBufLib_MEMSIZE_INVALID;            goto poolInitError;            }        if (_memPoolInit (pClDesc->clNum, pClDesc->clSize,                          sizeof (void *) , pClDesc->memArea) != OK)            goto poolInitError;        pClPool->pClHead = _clPoolCarve (pClPool, pClDesc->clNum,                                         pClDesc->clSize, pClDesc->memArea);        if (pClPool->pClHead == NULL)            {            goto poolInitError;            }        pClPool->clNum	   = pClDesc->clNum;        pClPool->clNumFree = pClDesc->clNum;	}    return (OK);    poolInitError:    netPoolDelete (pNetPool);    return (ERROR);    }/********************************************************************************* _mBlkCarve - carve up the mBlk pool.** This function carves the the mBlks from a pre allocated pool.** RETURNS: M_BLK_ID or NULL.** NOMANUAL*/LOCAL M_BLK_ID _mBlkCarve    (    NET_POOL_ID		pNetPool,	/* pointer to net pool */

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
成人a区在线观看| 中文子幕无线码一区tr| 91老司机福利 在线| 国产日韩一级二级三级| 国产欧美一区二区精品秋霞影院| 久久综合丝袜日本网| 国产午夜精品一区二区| 国产欧美一区二区精品性| 国产人久久人人人人爽| 国产精品美女久久久久久久久久久| 日本一区二区综合亚洲| 亚洲色图欧美激情| 亚洲高清视频在线| 日本aⅴ免费视频一区二区三区| 日日夜夜免费精品视频| 精品在线一区二区| 不卡av在线免费观看| 99久久精品久久久久久清纯| 色欧美片视频在线观看在线视频| 在线一区二区三区| 日韩一区二区精品在线观看| 亚洲精品一区二区三区影院 | 日韩**一区毛片| 蜜臀av性久久久久蜜臀aⅴ| 国产精品一二三四区| 9i看片成人免费高清| 欧美日韩三级一区二区| 欧美tickling挠脚心丨vk| 国产精品久久久久永久免费观看| 亚洲va天堂va国产va久| 国产一区二区看久久| 91麻豆精品秘密| 欧美变态口味重另类| 亚洲视频网在线直播| 免费高清在线视频一区·| 国产91精品在线观看| 欧美日韩免费高清一区色橹橹| 精品国免费一区二区三区| 一区二区视频在线看| 精品一区二区日韩| 欧美日韩一区二区在线观看| 久久精品欧美一区二区三区麻豆| 亚洲高清在线视频| 91麻豆精品国产91久久久久久久久 | 麻豆精品国产传媒mv男同| 成人黄色软件下载| 精品国产乱码久久久久久闺蜜| 亚洲天堂福利av| 国产一区二区不卡在线 | 精品免费99久久| 亚洲一区二区黄色| 成av人片一区二区| 国产调教视频一区| 麻豆精品一区二区| 亚洲制服丝袜在线| 91麻豆免费视频| 国产精品色一区二区三区| 另类中文字幕网| 欧美96一区二区免费视频| 欧美视频一区二区三区四区 | 中文天堂在线一区| 国产一区二区三区精品视频| 欧美一区二区三区在线电影| 亚洲高清三级视频| 欧美日韩精品三区| 亚洲一卡二卡三卡四卡五卡| 色八戒一区二区三区| 国产精品不卡在线| av一二三不卡影片| 99久久久精品免费观看国产蜜| 久久久久久久久99精品| 在线免费亚洲电影| 亚洲男人天堂一区| 一本色道**综合亚洲精品蜜桃冫| 中文字幕中文字幕中文字幕亚洲无线| 国产成人免费视频网站| 欧美激情资源网| 成人午夜在线视频| 91在线免费播放| 亚洲综合丁香婷婷六月香| 欧美在线观看视频一区二区| 亚洲图片欧美综合| 欧美一区二区视频在线观看| 久久精品久久久精品美女| 亚洲精品在线观看网站| 成人精品gif动图一区| 亚洲欧美在线视频观看| 亚洲精品高清视频在线观看| 色久优优欧美色久优优| 性感美女久久精品| 日韩免费看的电影| 成人精品国产免费网站| 一区二区三区四区不卡视频| 欧美高清一级片在线| 精品一区二区日韩| 国产精品高潮呻吟| 亚洲成年人影院| 精品国产乱子伦一区| 成人免费视频播放| 亚洲一区二区三区国产| 欧美哺乳videos| 91免费版在线| 精品一区二区日韩| 怡红院av一区二区三区| 欧美成人精品二区三区99精品| 粉嫩aⅴ一区二区三区四区五区| 91原创在线视频| 久久国产精品99精品国产| 日韩理论片一区二区| 日韩欧美久久久| 99r国产精品| 喷白浆一区二区| 亚洲卡通动漫在线| 国产婷婷精品av在线| 欧美日韩一区久久| 成人av在线观| 久久天天做天天爱综合色| 在线观看av一区二区| 国产成人精品免费视频网站| 亚洲成a天堂v人片| 亚洲欧洲精品一区二区精品久久久| 7777精品伊人久久久大香线蕉的 | 亚洲视频免费在线| 日韩欧美在线网站| 91丨九色丨蝌蚪丨老版| 国产做a爰片久久毛片| 亚洲成av人影院| 亚洲精品国产无套在线观| 日韩精品一区二区三区在线| 一道本成人在线| 成人在线综合网| 捆绑调教一区二区三区| 亚洲成人自拍网| 亚洲欧洲综合另类| 国产精品国产馆在线真实露脸| 精品国产青草久久久久福利| 一本色道久久综合亚洲aⅴ蜜桃| 精品亚洲成a人在线观看| 午夜久久久影院| 亚洲在线中文字幕| 自拍偷拍欧美精品| 国产精品免费av| 国产精品伦理一区二区| 91精品国产欧美一区二区成人| 欧美亚洲一区三区| 99re这里只有精品首页| av在线综合网| 91在线视频18| 成人av综合一区| thepron国产精品| 99精品久久只有精品| 成人动漫一区二区三区| 成人禁用看黄a在线| av电影天堂一区二区在线| 99麻豆久久久国产精品免费优播| 日本一区二区三区在线不卡| 2022国产精品视频| 精品福利av导航| 日本一区二区三区四区| 国产精品免费aⅴ片在线观看| www.一区二区| 91激情在线视频| 91精品国产综合久久福利| 欧美大片免费久久精品三p| 国产调教视频一区| 韩国v欧美v亚洲v日本v| 色88888久久久久久影院按摩| 天天射综合影视| 免费看日韩a级影片| 国产美女在线精品| 欧美高清在线视频| 亚洲女同女同女同女同女同69| 国产精品超碰97尤物18| 亚洲18影院在线观看| 麻豆精品久久久| 92国产精品观看| 在线电影国产精品| 日本一区二区三区四区| 一区二区在线观看视频| 蜜桃精品在线观看| 成人蜜臀av电影| 精品国产制服丝袜高跟| 99v久久综合狠狠综合久久| 精品视频999| 欧美激情一区二区三区四区 | 欧美日韩国产欧美日美国产精品| 91精品国产欧美一区二区成人| 精品国产精品网麻豆系列| 亚洲天天做日日做天天谢日日欢| 一级女性全黄久久生活片免费| 黑人精品欧美一区二区蜜桃| 一本到一区二区三区| 欧美白人最猛性xxxxx69交| **欧美大码日韩| 国精产品一区一区三区mba桃花| 成人毛片视频在线观看| 777午夜精品免费视频| 亚洲国产精品黑人久久久| 青椒成人免费视频| 99久久伊人网影院|