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

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

?? mpqueuetask.c

?? 這是全套的PPP協議的源碼
?? C
字號:
/* mpQueueTask.c - MP receive/send Queue and Task related source file *//* Copyright 1999 Wind River Systems, Inc. */ #include "copyright_wrs.h"/*modification history--------------------01b,19feb02,ak	 input parameter validation in all the functions01a,19feb01,nts  created.*//*DESCRIPTIONThis module implements the MP receive and send Queue and the related taskswhich are useful in exchanging the packets between the MEMBER and MANAGERstacks of the MP system.INCLUDES: mpFramingLayerP.h*//* includes */#include "vxWorks.h"#include "stdio.h"#include "stdlib.h"#include "private/ppp/mpFramingLayerP.h"/* defines */#define		MAX_JOB_DATA_SIZE	64/********************************************************************************* mpSendQueueCreate - Creates the MP send Queue** This function creates the MP send Queue.* * RETURNS: OK or ERROR** SEE ALSO: mpReceiveQueueCreate*/STATUS mpSendQueueCreate    (    MP_FRAMING_LAYER	*pMpFramingLayerComponent,	unsigned int		mpSendQueueDepth    )    {	if (pMpFramingLayerComponent == NULL)		return ERROR;    if ((pMpFramingLayerComponent->mpSendRing = 			rngCreate (mpSendQueueDepth)) != NULL)		{		return OK;		}	else		{		pfwPrintError (__FILE__, "mpSendQueueCreate", __LINE__, NULL, NULL, 		       "Queue create ERROR");		return ERROR;		}	}/********************************************************************************* mpReceiveQueueCreate - Creates the MP receive Queue** This function creates the MP receive Queue.* * RETURNS: OK or ERROR** SEE ALSO: mpSendQueueCreate*/STATUS mpReceiveQueueCreate    (    MP_FRAMING_LAYER	*pMpFramingLayerComponent,	unsigned int		mpReceiveQueueDepth    )    {	if (pMpFramingLayerComponent == NULL)		return ERROR;    if ((pMpFramingLayerComponent->mpReceiveRing =			rngCreate (mpReceiveQueueDepth)) != NULL)		{		return OK;		}	else		{		pfwPrintError (__FILE__, "mpReceiveQueueCreate", __LINE__, NULL, NULL, 		       "Queue create ERROR");		return ERROR;		}	}/********************************************************************************* mpSendTask - Creates the MP send task** This function creates the MP send task* * RETURNS: N/A** SEE ALSO: mpReceiveTask*/void mpSendTask    (    MP_FRAMING_LAYER	*pMpFramingLayerComponent    )    {    MP_JOB_RING_ITEM	mpSendJobItem;	FAST BOOL			ok;	BOOL				jobQIsEmpty;	char data [MAX_JOB_DATA_SIZE];	if (pMpFramingLayerComponent == NULL)		return;	bzero (data, sizeof (data));    jobQIsEmpty = TRUE;		while (TRUE)		{		if (jobQIsEmpty)			semTake (pMpFramingLayerComponent->sendSem, WAIT_FOREVER);		/* Get a job from the job queue */		ok = rngBufGet (pMpFramingLayerComponent->mpSendRing, 						(char *) &mpSendJobItem, 						sizeof (MP_JOB_RING_ITEM)) == sizeof (MP_JOB_RING_ITEM);		if (ok)			{			ok = rngBufGet (pMpFramingLayerComponent->mpSendRing, data, 								mpSendJobItem.size) == mpSendJobItem.size;			}		jobQIsEmpty = (ok) ? FALSE : TRUE;		if (ok)			(*mpSendJobItem.jobHandlerFunc) ((void *) data); 		}	}/********************************************************************************* mpReceiveTask - Creates the MP receive task** This function creates the MP receive task* * RETURNS: N/A** SEE ALSO: mpSendTask*/void  mpReceiveTask    (    MP_FRAMING_LAYER	*pMpFramingLayerComponent    )    {    MP_JOB_RING_ITEM	mpReceiveJobItem;	FAST BOOL			ok;	BOOL				jobQIsEmpty;	char 				data [MAX_JOB_DATA_SIZE];	if (pMpFramingLayerComponent == NULL)		return;	bzero (data, sizeof (data));    jobQIsEmpty = FALSE;		while (TRUE)		{		if (jobQIsEmpty)			semTake (pMpFramingLayerComponent->receiveSem, WAIT_FOREVER);		/* Get a job from the job queue */		ok = rngBufGet (pMpFramingLayerComponent->mpReceiveRing, 						(char *) &mpReceiveJobItem, 						sizeof (MP_JOB_RING_ITEM)) == sizeof (MP_JOB_RING_ITEM);		if (ok)			ok = rngBufGet (pMpFramingLayerComponent->mpReceiveRing, data, 								mpReceiveJobItem.size) == mpReceiveJobItem.size;		jobQIsEmpty = (ok) ? FALSE : TRUE;		if (ok)			(*mpReceiveJobItem.jobHandlerFunc) ((void *) data);		}	}/********************************************************************************* mpSendQueueAdd - Adds a job to the send queue** This function adds a job to the send queue* * RETURNS: OK or ERROR** SEE ALSO: mpReceiveQueueAdd*/STATUS mpSendQueueAdd    (    PFW_OBJ		*pfwObj,		/* reference to the framework object */	FUNCPTR		jobHandlerFunc,	/* pointer to the function to be executed by									send queue task */	void		*data,			/* data buffer to be used by the function */	int			size			/* size of the data to be processed */    )    {	MP_FRAMING_LAYER	*pMpFramingLayerObj = NULL;	MP_JOB_RING_ITEM	item;	unsigned int		totalSize = 0;	if (pfwObj == NULL)		{        pfwPrintError (__FILE__, "mpSendQueueAdd", __LINE__, pfwObj, NULL, 		       "Invalid argument: Null framework object pointer");        return (ERROR);        }		pMpFramingLayerObj = (MP_FRAMING_LAYER *)pfwLayerObjGet 												(pfwObj, "MP_FRAMING_LAYER");		if (pMpFramingLayerObj == NULL)		{		pfwPrintError (__FILE__, "mpSendQueueAdd", __LINE__, pfwObj, NULL, 		       "Layer object is NULL");        return (ERROR);			}	if (pMpFramingLayerObj->mpSendRing == NULL)		{        pfwPrintError (__FILE__, "mpSendQueueAdd", __LINE__, pfwObj, NULL, 		       "Send job queue does not exist");        return (ERROR);        }	if (jobHandlerFunc == NULL)		{        pfwPrintError (__FILE__, "mpSendQueueAdd", __LINE__, pfwObj, NULL, 		       "Invalid argument: Null fuction pointer");        return (ERROR);        }		if (size < 0 || size > MAX_JOB_DATA_SIZE) 		{        pfwPrintError (__FILE__, "mpSendQueueAdd", __LINE__, pfwObj, NULL, 		       "Invalid argument: size is out of range");        return (ERROR);        }	item.jobHandlerFunc = jobHandlerFunc;	item.size = size;	totalSize = size + sizeof (MP_JOB_RING_ITEM);		if ( rngFreeBytes (pMpFramingLayerObj->mpSendRing) >= totalSize)		{		rngBufPut (pMpFramingLayerObj->mpSendRing, (char *) &item, 			                                    	sizeof (MP_JOB_RING_ITEM));        rngBufPut (pMpFramingLayerObj->mpSendRing, (char *) data, size);		semGive (pMpFramingLayerObj->sendSem);        return (OK);		}		return (ERROR);	}/********************************************************************************* mpReceiveQueueAdd - Adds a job to the receive queue** This function adds a job to the receive queue* * RETURNS: OK or ERROR** SEE ALSO: mpSendQueueAdd*/STATUS mpReceiveQueueAdd    (    PFW_OBJ		*pfwObj,		/* reference to the framework object */	FUNCPTR		jobHandlerFunc,	/* pointer to the function to be executed by									send queue task */	void		*data,			/* data buffer to be used by the function */	int			size			/* size of the data to be processed */    )    {	MP_FRAMING_LAYER	*pMpFramingLayerObj = NULL;	MP_JOB_RING_ITEM	item;	unsigned int		totalSize = 0;	if (pfwObj == NULL)		{        pfwPrintError (__FILE__, "mpReceiveQueueAdd", __LINE__, pfwObj, NULL, 		       "Invalid argument: Null framework object pointer");        return (ERROR);        }		pMpFramingLayerObj = (MP_FRAMING_LAYER *)pfwLayerObjGet 												(pfwObj, "MP_FRAMING_LAYER");	if (pMpFramingLayerObj == NULL)		{		pfwPrintError (__FILE__, "mpReceiveQueueAdd", __LINE__, pfwObj, NULL, 		       "Layer object is NULL");        return (ERROR);			}	if (pMpFramingLayerObj->mpReceiveRing == NULL)		{        pfwPrintError (__FILE__, "mpReceiveQueueAdd", __LINE__, pfwObj, NULL, 		       "Receive job queue does not exist");         return (ERROR);        }	if (jobHandlerFunc == NULL)		{        pfwPrintError (__FILE__, "mpReceiveQueueAdd", __LINE__, pfwObj, NULL, 		       "Invalid argument: Null fuction pointer");        return (ERROR);        }	if (size < 0 || size > MAX_JOB_DATA_SIZE) 		{        pfwPrintError (__FILE__, "mpReceiveQueueAdd", __LINE__, pfwObj, NULL, 		       "Invalid argument: size is out of range");        return (ERROR);        }	item.jobHandlerFunc = jobHandlerFunc;	item.size = size;	totalSize = size + sizeof (MP_JOB_RING_ITEM);	if (rngFreeBytes (pMpFramingLayerObj->mpReceiveRing) >= totalSize)		{		rngBufPut (pMpFramingLayerObj->mpReceiveRing, (char *) &item, 			                                    	sizeof (MP_JOB_RING_ITEM));        rngBufPut (pMpFramingLayerObj->mpReceiveRing, (char *) data, size);		semGive (pMpFramingLayerObj->receiveSem);        return (OK);		}		return (ERROR);	}/********************************************************************************* mpSendQueueDelete - Delete the MP send Queue** This function deletes the MP send Queue.* * RETURNS: N/A** SEE ALSO: mpReceiveQueueCreate*/void mpSendQueueDelete    (    MP_FRAMING_LAYER	*pMpFramingLayerComponent    )    {	if (pMpFramingLayerComponent == NULL)		return;	rngDelete (pMpFramingLayerComponent->mpSendRing);		}/********************************************************************************* mpReceiveQueueDelete - Delete the MP receive Queue** This function deletes the MP receive Queue.* * RETURNS: N/A** SEE ALSO: mpSendQueueDelete*/void mpReceiveQueueDelete    (    MP_FRAMING_LAYER	*pMpFramingLayerComponent    )    {	if (pMpFramingLayerComponent == NULL)		return;	rngDelete (pMpFramingLayerComponent->mpReceiveRing);	}/************************end of file mpQueueTask.c*****************************/

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
色一情一伦一子一伦一区| 精品不卡在线视频| 精品国产一区二区三区四区四| 国产午夜精品一区二区三区四区 | 日韩影院精彩在线| 成人永久免费视频| 欧美成人乱码一区二区三区| 一个色综合av| 成人激情小说网站| 久久网站热最新地址| 亚洲高清在线视频| 99re热视频这里只精品| 久久精品一区蜜桃臀影院| 美女诱惑一区二区| 欧美日韩不卡一区| 一区二区三区波多野结衣在线观看 | 久久精品人人做| 性欧美疯狂xxxxbbbb| 日本黄色一区二区| 亚洲国产视频直播| 色成人在线视频| 国产精品美女久久久久久久| 久久99国内精品| 日韩欧美一二三区| 美女看a上一区| 91精品午夜视频| 日韩电影在线观看一区| 欧美日韩一区二区三区高清| 一区二区三区在线观看国产| 99综合影院在线| 中文字幕乱码一区二区免费| 高清成人在线观看| 中文字幕日韩av资源站| av一区二区久久| 中文字幕在线不卡| 99久久伊人精品| 亚洲男人天堂一区| 欧美视频三区在线播放| 亚洲成av人影院| 91精品国产一区二区| 日本vs亚洲vs韩国一区三区二区| 欧美精品三级日韩久久| 奇米亚洲午夜久久精品| 欧美一级生活片| 美女尤物国产一区| 国产亚洲精品aa| av毛片久久久久**hd| 最新中文字幕一区二区三区| 色哟哟一区二区在线观看| 亚洲一区二区三区中文字幕 | 国产成人免费视频网站| 国产精品私人影院| 色哟哟日韩精品| 奇米色一区二区| 久久综合成人精品亚洲另类欧美 | 亚洲欧美视频在线观看| 欧美视频中文字幕| 秋霞午夜av一区二区三区| 久久久精品日韩欧美| 不卡视频在线看| 亚洲综合久久久| 日韩欧美的一区| 成人激情电影免费在线观看| 亚洲午夜视频在线观看| 久久综合九色综合97婷婷女人| 不卡一区中文字幕| 日本欧美一区二区三区乱码| 欧美激情一区二区三区四区| 在线免费精品视频| 极品销魂美女一区二区三区| 亚洲丝袜美腿综合| 精品999在线播放| 91久久精品一区二区三区| 久久aⅴ国产欧美74aaa| 亚洲最快最全在线视频| 日韩精品自拍偷拍| 91久久精品国产91性色tv| 六月丁香综合在线视频| 亚洲一区自拍偷拍| 国产欧美一区二区三区在线老狼| 欧美私人免费视频| 99热这里都是精品| 国产真实乱偷精品视频免| 亚洲综合成人在线| 国产视频一区在线播放| 6080午夜不卡| 一本大道久久精品懂色aⅴ| 狠狠网亚洲精品| 日韩1区2区3区| 亚洲美女一区二区三区| 日本一区二区三区国色天香| 欧美肥妇free| 色综合久久久久综合体| 国产盗摄一区二区| 精品制服美女久久| 日韩激情av在线| 一区二区在线看| 国产精品乱码妇女bbbb| 欧美成人精品福利| 欧美一级午夜免费电影| 欧美美女直播网站| 欧美亚洲图片小说| 91论坛在线播放| av在线不卡电影| 不卡视频一二三四| 成人福利在线看| 成人免费av网站| 国产一区视频在线看| 国产真实乱子伦精品视频| 九九国产精品视频| 麻豆91在线观看| 久久丁香综合五月国产三级网站| 青青青爽久久午夜综合久久午夜| 亚欧色一区w666天堂| 日日摸夜夜添夜夜添精品视频| 亚洲精品欧美激情| 樱桃视频在线观看一区| 亚洲欧洲精品成人久久奇米网| 国产精品电影院| 亚洲欧美日韩在线播放| 中文字幕一区二区三区四区不卡 | 精品国产乱码久久久久久蜜臀| 日韩一二三区不卡| 日韩亚洲欧美成人一区| 欧美大尺度电影在线| 久久综合九色综合97婷婷女人| 久久久国产午夜精品| 欧美激情中文不卡| 亚洲欧美另类图片小说| 一区二区三区欧美视频| 日韩av不卡在线观看| 韩国三级中文字幕hd久久精品| 国产酒店精品激情| 成人网男人的天堂| 欧美最猛性xxxxx直播| 在线不卡欧美精品一区二区三区| 欧美一级久久久| 国产亚洲1区2区3区| 亚洲人成在线观看一区二区| 亚洲成av人片在线观看无码| 久久精品国产澳门| www.亚洲激情.com| 欧美日韩精品系列| 精品乱码亚洲一区二区不卡| 中文字幕在线一区二区三区| 亚洲午夜免费电影| 九一久久久久久| 91亚洲精华国产精华精华液| 91精品国模一区二区三区| 久久久国产精品午夜一区ai换脸| 18欧美亚洲精品| 蜜臀久久99精品久久久久久9 | 蜜臀精品一区二区三区在线观看| 国产成人综合在线| 欧美日韩三级视频| 国产亚洲精品aa| 日韩主播视频在线| www.久久久久久久久| 欧美精品在线视频| 国产精品久久久久三级| 午夜激情综合网| av不卡一区二区三区| 精品福利视频一区二区三区| 一区二区三区日本| 高清beeg欧美| 精品国偷自产国产一区| 亚洲综合免费观看高清在线观看 | 美女精品一区二区| 日本道在线观看一区二区| 国产三级精品视频| 男人的天堂久久精品| 欧美色综合天天久久综合精品| 中文字幕免费不卡在线| 美女视频一区在线观看| 欧美在线你懂的| 国产精品美女久久久久aⅴ国产馆 国产精品美女久久久久av爽李琼 国产精品美女久久久久高潮 | 91在线一区二区| 久久久无码精品亚洲日韩按摩| 婷婷久久综合九色国产成人| 99re这里只有精品6| 国产午夜精品久久久久久免费视| 日韩中文字幕不卡| 欧美性色黄大片| 亚洲日本一区二区| 丁香六月综合激情| 国产日韩欧美不卡| 国产成人在线影院| 久久这里都是精品| 国内精品在线播放| 日韩视频一区二区三区在线播放| 一区二区三区久久久| 99久久精品国产麻豆演员表| 国产亚洲一区二区三区在线观看| 紧缚捆绑精品一区二区| 日韩免费视频一区二区| 日韩av电影天堂| 日韩欧美电影一区| 国产一区二区在线看| 久久奇米777| 国产综合色产在线精品|