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

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

?? uipc_mbuf.c

?? 完整的TCP/IP源代碼
?? C
?? 第 1 頁 / 共 2 頁
字號:
/* uipc_mbuf.c - mbuf routines *//* Copyright 1984-1996 Wind River Systems, Inc. */#include "copyright_wrs.h"/* * Copyright (c) 1982, 1986, 1988, 1991, 1993, 1995 *	The Regents of the University of California.  All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright *    notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright *    notice, this list of conditions and the following disclaimer in the *    documentation and/or other materials provided with the distribution. * 3. All advertising materials mentioning features or use of this software *    must display the following acknowledgement: *	This product includes software developed by the University of *	California, Berkeley and its contributors. * 4. Neither the name of the University nor the names of its contributors *    may be used to endorse or promote products derived from this software *    without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * *	@(#)uipc_mbuf.c	8.4 (Berkeley) 2/14/95 *//*modification history--------------------01n,25aug98,n_s  made _bufCollect only call pr_drain 1 time. spr #2210401m,11dec97,vin  made m_free and m_freem as macros calling netMblkClFree		 and netMblkClChainFree functions.01l,08dec97,vin  removed m_copym merged with netMblkChainDup SPR 9966.		 moved old m_copym code to #if 0 section.01k,01dec97,vin  added system pool configuration logic.		 Ifdefed m_copyback and m_copydata in uipc_mbuf.c these                 need some rework so that they can be tied up efficiently                 with the new buffering scheme.01j,08oct97,vin  fixed clBlkFree.01i,05oct97,vin  bug fix in m_copym01h,19sep97,vin  added clBlk specific code, changed pointers to refcounts		 of clusters to refcounts since refcount has been moved to                 clBlk01g,11aug97,vin  interfaced with netBufLib.c, moved all windRiver specific		 buffering code to netBufLib.c01f,02jul97,vin  SPR 8878.01e,15may97,vin  reworked m_devget(), added support for width of copying.01d,31jan97,vin  removed local variable clLog2Def, cleanup01c,03dec96,vin  changed interface to m_getclr() added additional parameters.01b,13nov96,vin  removed BSD4.4 mbufs, modified m_devget, deleted m_get,		 m_gethdr, m_split, wrote new cluster and mBlk functions.		 moved m_copyback from rtsock.c.01a,03mar96,vin  created from BSD4.4 stuff,integrated with 02v of uipc_mbuf.c*/#include "vxWorks.h"#include "intLib.h"#include "net/mbuf.h"#include "net/systm.h"#include "net/domain.h"#include "net/protosw.h"/* externs */IMPORT struct domain *domains;IMPORT VOIDFUNCPTR _pNetBufCollect;IMPORT VOIDFUNCPTR _pWakeupRtn;/* globals *//* locals */LOCAL int 	MPFail;	 	/* XXX temp variable pullup fails */LOCAL NET_POOL	_netDpool; 	/* system network data pool */LOCAL NET_POOL	_netSysPool;	/* system network structure pool */NET_POOL_ID	_pNetDpool   = &_netDpool; NET_POOL_ID	_pNetSysPool = &_netSysPool; /* forward declarations */LOCAL void	_bufCollect (FAST SEM_ID pSem, VOID ** pPtrHead,                             FAST int *	pNumTasks, M_STAT * pPoolStat);LOCAL STATUS 	_netStackPoolInit (NET_POOL_ID pNetPool,                                   M_CL_CONFIG * pMclConfig,                                   CL_DESC * pClDescTbl,                                   int clTblNumEnt);/********************************************************************************* _netStackPoolInit - initialize the net pool** This routines initializes the netpool.** NOMANUAL** RETURNS: OK/ERROR*/LOCAL STATUS _netStackPoolInit    (    NET_POOL_ID		pNetPool,	/* pointer to a net pool */    M_CL_CONFIG * 	pMclConfig,	/* ptr to mblk/clBlk config tbl */    CL_DESC * 		pClDescTbl,	/* ptr to first entry in clDesc tbl */    int 		clTblNumEnt	/* number of entries */    )    {    int 		ix;		/* index variable */    CL_DESC * 		pClDesc;	/* pointer to the cluster descriptor */    if (pMclConfig->memArea == NULL)	/* do a default allocation */        {        /* memory size adjusted to hold the netPool pointer at the head */        pMclConfig->memSize = (pMclConfig->mBlkNum *                                (MSIZE + sizeof (long))) +            		       (pMclConfig->clBlkNum * CL_BLK_SZ);         if ((pMclConfig->memArea = (char *) malloc (pMclConfig->memSize))            == NULL)            {            panic ("no memory: mBlks/clBlks");            return (ERROR);             }        }    for (pClDesc = pClDescTbl, ix = 0; ix < clTblNumEnt; ix++, pClDesc++)        {        /* memory size adjusted for refcount, pool ptr and 4 byte alignmnt */                if (pClDesc->memArea == NULL) /* do a default allocation */            {            pClDesc->memSize = (pClDesc->clNum *                                (pClDesc->clSize + sizeof (long)));            if ((pClDesc->memArea = (char *)malloc (pClDesc->memSize)) == NULL)                {                panic ("no memory: clusters");                return (ERROR);                }            }        }    return (netPoolInit (pNetPool, pMclConfig, pClDescTbl, clTblNumEnt, NULL));    }/********************************************************************************* mbinit - initialize mbuf package** Initialize a number of mbufs and clusters to start the ball rolling.* This is accomplished by calling routines _mBlkAlloc() and _clAlloc()** NOMANUAL*/void mbinit (void)    {    netBufLibInit ();			/* initialize the buffering library */    _pNetBufCollect = _bufCollect; 	/* intialize buffer collect routine */    _pWakeupRtn	    = wakeup;		/* defined in unixLib.c */    if (_netStackPoolInit (_pNetDpool, &mClBlkConfig, &clDescTbl [0],                           clDescTblNumEnt) != OK)        goto mbInitError;    if (_netStackPoolInit (_pNetSysPool, &sysMclBlkConfig, &sysClDescTbl [0],                           sysClDescTblNumEnt) != OK)        goto mbInitError;    return;        mbInitError:    	{        panic ("mbinit");        return;        }    }/********************************************************************************* _bufCollect - drain protocols and collect required buffers** Must be called at splimp.* * NOMANUAL**/LOCAL void _bufCollect    (    FAST SEM_ID	pSem,			/* pointer to semaphore to block on */    VOID **	pPtrHead,		/* pointer to the head of free list */    FAST int *	pNumTasks,		/* pointer to the no. task blocked */    M_STAT *	pPoolStat		/* pointer to the pools stats struct */    )    {    FAST struct domain	*dp;    FAST struct protosw	*pr;    int	 		level; 		/* level of interrupt */    /* ask protocols to free space */    for (dp = domains; dp; dp = dp->dom_next)	for (pr = dp->dom_protosw; pr < dp->dom_protoswNPROTOSW; pr++)	    if (pr->pr_drain)		(*pr->pr_drain)();    level = intLock ();     pPoolStat->mDrain++;		/* no. of times protocols drained */    intUnlock (level);     }/********************************************************************************* mBufClGet - get a new mBlk with a cluster ** This routine allocates an mBlk and points it to a cluster allocated* Different clusters are allocated depending upon the cluster size requested.* * INTERNAL* * NOMANUAL* * RETURNS: NULL/mBlk*/struct mbuf * mBufClGet    (    int			canWait,	/* M_DONTWAIT/M_WAIT */    UCHAR		type,		/* type of data */    int			bufSize,	/* size of the buffer to get */    BOOL		bestFit		/* TRUE/FALSE */    )    {    FAST struct mbuf *	pMblk; 		/* pointer to mbuf */    pMblk = mBlkGet (_pNetDpool, canWait, type); 	/* get an mBlk */    /* allocate a cluster and point the mbuf to it */    if (pMblk && (mClGet (_pNetDpool, pMblk, bufSize, canWait, bestFit) != OK))	{	(void)m_free (pMblk); 	pMblk = NULL; 	}    return (pMblk);    }/********************************************************************************* mHdrClGet - get a new mBlkHdr with a cluster ** This routine allocates an mBlkHdr and points it to a cluster allocated* Different clusters are allocated depending upon the cluster size requested.** INTERNAL*  * NOMANUAL* * RETURNS: NULL/mBlkHdr*/struct mbuf * mHdrClGet    (    int			canWait,		/* M_DONTWAIT/M_WAIT */    UCHAR		type,			/* type of data */    int			bufSize,		/* size of the buffer to get */    BOOL		bestFit			/* TRUE/FALSE */    )    {    FAST struct mbuf *	pMblk = NULL; 			/* pointer to mbuf */    /* get an mBlk/cluster pair */        pMblk = mBlkGet (_pNetDpool, canWait, type); 	/* get an mBlk */    if (pMblk == NULL)        return (NULL);        pMblk->m_flags |= M_PKTHDR;     /* allocate a cluster and point the mbuf to it */    if (mClGet (_pNetDpool, pMblk, bufSize, canWait, bestFit) != OK)	{	(void)m_free (pMblk); 	pMblk = NULL; 	}    return (pMblk);    }/********************************************************************************* m_getclr - get a clean mBlk, cluster pair** This routine allocates an mBlk, points it to a cluster,* and zero's the cluster allocated.** INTERNAL*  * NOMANUAL* * RETURNS: NULL/mBlk*/struct mbuf * m_getclr    (    int 		canwait,		/* M_WAIT/M_DONTWAIT */    UCHAR		type,			/* type of mbuf to allocate */    int			bufSize,		/* size of the buffer to get */    BOOL		bestFit			/* TRUE/FALSE */    )    {    FAST struct mbuf *	pMblk = NULL; 		/* pointer to mbuf */    /* allocate mBlk/cluster pair */        if ((pMblk = mBufClGet (canwait, type, bufSize, bestFit)) != NULL)	bzero(mtod(pMblk, caddr_t), pMblk->m_extSize);     return (pMblk);    }#if 0 /* XXX */#endif /* XXX *//* * Mbuffer utility routines. *//********************************************************************************* m_prepend - prepend an mbuf to a chain.** Lesser-used path for M_PREPEND:* allocate new mbuf to prepend to chain,* copy junk along.*/struct mbuf * m_prepend(m, len, how)    register struct mbuf *m;    int len;    int how;    {    struct mbuf *mn;    if ((mn = mBufClGet (how, m->m_type, len, TRUE)) == NULL)	{	m_freem(m);	return ((struct mbuf *)NULL);	}    if (m->m_flags & M_PKTHDR)	{	mn->m_pkthdr = m->m_pkthdr;	mn->m_flags = m->m_flags;	m->m_flags &= ~M_PKTHDR;	}    mn->m_next = m;    m = mn;    if (len < m->m_extSize)	MH_ALIGN(m, len);    m->m_len = len;    return (m);    }/********************************************************************************* m_cat - concatenate mbuf chain n to m.** Concatenate mbuf chain n to m.* Both chains must be of the same type (e.g. MT_DATA).* Any m_pkthdr is not updated.*/void m_cat(m, n)    register struct mbuf * m;    register struct mbuf * n;    {    while (m->m_next)	m = m->m_next;    if (n != NULL)		/* clusters are used by default */	m->m_next = n;     }/********************************************************************************* m_adj - adjust the data in the mbuf**/void m_adj(mp, req_len)    struct mbuf * mp;    int req_len;    {    register int len = req_len;    register struct mbuf *m;    register count;    if ((m = mp) == NULL)	return;    if (len >= 0)	{	/*	 * Trim from head.	 */	while (m != NULL && len > 0)	    {	    if (m->m_len <= len)		{		len -= m->m_len;		m->m_len = 0;		m = m->m_next;		}	    else		{		m->m_len -= len;		m->m_data += len;		len = 0;		}	    }	m = mp;	if (mp->m_flags & M_PKTHDR)	    m->m_pkthdr.len -= (req_len - len);	}     else	{	/*	 * Trim from tail.  Scan the mbuf chain,	 * calculating its length and finding the last mbuf.	 * If the adjustment only affects this mbuf, then just	 * adjust and return.  Otherwise, rescan and truncate	 * after the remaining size.	 */	len = -len;

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
精品视频免费看| 日本高清无吗v一区| 日韩电影在线一区| 亚洲成a人v欧美综合天堂| 亚洲天堂久久久久久久| 国产精品视频九色porn| 国产精品乱人伦| 亚洲色图一区二区| 亚洲永久精品大片| 日本伊人精品一区二区三区观看方式| 天天做天天摸天天爽国产一区| 亚洲一区二区三区三| 日韩精品国产欧美| 久久国产人妖系列| 成人免费观看视频| 欧美自拍偷拍一区| 欧美一区午夜视频在线观看| 日韩欧美三级在线| 欧美激情综合在线| 亚洲综合成人在线视频| 麻豆精品视频在线| 成人污污视频在线观看| 91麻豆文化传媒在线观看| 欧美性生活久久| ww久久中文字幕| 日本一区二区三区四区| 亚洲三级电影网站| 日韩精品国产精品| caoporn国产精品| 欧美妇女性影城| 国产日本亚洲高清| 一区二区三区波多野结衣在线观看 | 日韩电影一二三区| 久草热8精品视频在线观看| 成人亚洲一区二区一| 欧美人妖巨大在线| 欧美韩国日本综合| 三级欧美在线一区| 色综合色综合色综合| 日韩精品一区二区三区老鸭窝| 国产精品久久三区| 精品一区二区三区欧美| 欧美手机在线视频| 亚洲色图欧洲色图婷婷| 激情综合色综合久久| 欧美日韩国产一区二区三区地区| 亚洲一区在线视频观看| 国产精品自拍av| 欧美日韩国产在线观看| 亚洲日本在线a| 国产精品一区二区三区99| 欧美美女一区二区| 一区二区三区在线观看网站| 国产一区二区在线看| 717成人午夜免费福利电影| 中文字幕日韩av资源站| 国产黄人亚洲片| 日韩一级在线观看| 午夜天堂影视香蕉久久| 在线国产亚洲欧美| 亚洲免费在线电影| 99精品视频在线免费观看| 国产亚洲一区二区三区| 韩国v欧美v日本v亚洲v| 日韩午夜精品电影| 奇米一区二区三区| 欧美日本韩国一区| 亚洲成人中文在线| 欧美性猛交xxxx黑人交| 一级中文字幕一区二区| 91在线观看地址| 亚洲欧美另类综合偷拍| www.欧美日韩| 亚洲美女视频在线观看| 色综合视频一区二区三区高清| 国产精品乱码一区二三区小蝌蚪| 不卡的电视剧免费网站有什么| 亚洲国产精品传媒在线观看| 国产成人免费视频精品含羞草妖精 | 亚洲欧美国产三级| 91丨九色丨国产丨porny| 亚洲欧美另类图片小说| 91精品91久久久中77777| 亚洲精选在线视频| 欧美日韩国产一区| 精品亚洲aⅴ乱码一区二区三区| 欧美www视频| 成人听书哪个软件好| 亚洲欧美日韩国产一区二区三区| 在线观看日韩精品| 免费成人av资源网| 国产精品午夜在线观看| 91麻豆高清视频| 视频一区二区三区在线| 欧美成人一区二区三区| 成人免费福利片| 五月婷婷综合激情| 久久综合色之久久综合| 99久久伊人网影院| 亚洲高清在线精品| www激情久久| 色婷婷国产精品| 久久国产福利国产秒拍| 成人欧美一区二区三区| 欧美一级免费大片| 成人小视频在线| 婷婷六月综合亚洲| 国产精品无遮挡| 51午夜精品国产| 成人免费看黄yyy456| 午夜精品久久久久久久久久| 国产亚洲精品资源在线26u| 色欧美88888久久久久久影院| 日本aⅴ精品一区二区三区| 国产精品久久久久久亚洲毛片| 欧美精选午夜久久久乱码6080| 精品视频一区三区九区| 国产精品一区在线观看乱码| 视频在线观看一区| 亚洲男同性恋视频| 久久精品日产第一区二区三区高清版 | 《视频一区视频二区| 日韩视频一区二区在线观看| 色综合中文字幕国产| 日韩av一区二区在线影视| 亚洲人成精品久久久久| 国产人伦精品一区二区| 欧美va亚洲va国产综合| 欧美喷水一区二区| 色婷婷av一区| 99re热视频这里只精品| 国产成人免费视频精品含羞草妖精| 五月婷婷激情综合网| 最新国产成人在线观看| 国产三级欧美三级| 亚洲精品一区二区三区香蕉 | 日韩一区二区在线看片| 在线国产亚洲欧美| 在线亚洲+欧美+日本专区| 国产suv精品一区二区6| 久久69国产一区二区蜜臀| 青青草国产精品97视觉盛宴| 亚洲激情校园春色| 亚洲久本草在线中文字幕| 国产精品久久久久天堂| 国产精品欧美一级免费| 亚洲国产成人午夜在线一区| 国产亚洲精品bt天堂精选| 久久久蜜桃精品| 欧美经典一区二区| 欧美激情中文不卡| 综合激情网...| 亚洲激情五月婷婷| 亚洲超丰满肉感bbw| 天堂成人国产精品一区| 丝袜美腿亚洲色图| 奇米色一区二区| 九九热在线视频观看这里只有精品| 久久av资源站| 国产成人综合网站| www.av精品| 欧美午夜精品电影| 欧美一区二区三区在线看| 精品久久久久一区| 国产视频一区在线播放| 中文字幕一区三区| 香蕉乱码成人久久天堂爱免费| 日本强好片久久久久久aaa| 日产欧产美韩系列久久99| 久久99日本精品| eeuss影院一区二区三区| 色噜噜夜夜夜综合网| 欧美日韩在线精品一区二区三区激情| 欧美日韩国产成人在线免费| 精品少妇一区二区三区日产乱码 | 亚洲最新视频在线观看| 五月天中文字幕一区二区| 精品一区二区在线视频| 成人综合婷婷国产精品久久免费| 色呦呦一区二区三区| 日韩色视频在线观看| 国产婷婷一区二区| 亚洲高清久久久| 国产剧情av麻豆香蕉精品| 一本一道久久a久久精品 | 精品在线播放免费| 9i看片成人免费高清| 欧美一区二区三区成人| 亚洲国产精品av| 99精品国产热久久91蜜凸| 欧美久久免费观看| 中文字幕第一区综合| 性久久久久久久久| 99精品欧美一区二区三区综合在线| 91精品久久久久久久久99蜜臂| 国产农村妇女毛片精品久久麻豆| 丝袜a∨在线一区二区三区不卡| 成人国产亚洲欧美成人综合网| 这里是久久伊人| 日韩美女久久久|