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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? mbufsocklib.c

?? vxworks的完整的源代碼
?? C
字號(hào):
/* mbufSockLib.c - BSD mbuf socket interface library *//* Copyright 1984-2001 Wind River Systems, Inc. */#include "copyright_wrs.h"/*modification history--------------------01f,15oct01,rae  merge from truestack01e,04dec00,adb  if (errno = EWOULDBLOCK) changed to if (EWOULDBLOCK == errno)01d,25aug97,vin  fixed SPR8908.01d,22nov96,vin  added new cluster support, initialized header fields for		 for every packet.01c,13nov95,dzb  changed to validate mbufId.type off MBUF_VALID (SPR #4066).01b,20nov94,kdl	 Fix blank line in comment block, for mangen.01a,08nov94,dzb  written.*//*DESCRIPTIONThis library contains routines that communicate over BSD sockets usingthe `mbuf interface' described in the mbufLib manual page.  These mbufsocket calls interoperate with BSD sockets in a similar manner to thesocket routines in sockLib, but they avoid copying data unnecessarilybetween application buffers and network buffers.NOMANUAL*//* includes */#include "vxWorks.h"#include "sockLib.h"#include "zbufSockLib.h"#include "mbufSockLib.h"#include "sys/socket.h"/* declare mbuf socket interface function table */LOCAL ZBUF_SOCK_FUNC	mbufSockFunc =    {    (FUNCPTR) _mbufLibInit,			/* back-end init pointer */    (FUNCPTR) _mbufSockSend,    (FUNCPTR) _mbufSockSendto,    (FUNCPTR) _mbufSockBufSend,    (FUNCPTR) _mbufSockBufSendto,    (FUNCPTR) _mbufSockRecv,    (FUNCPTR) _mbufSockRecvfrom    };/********************************************************************************* _mbufSockLibInit - initialize the BSD mbuf socket interface library** The mbufSockLib API func table "mbufSockFunc" is published to the caller* by the return value of this routine.  Typically, this func table is used by* the zbufSock facility to call mbufSock routines within this library to* perform socket operations.  Even though the zbufSock interface defines* the ZBUF_SOCK_FUNC struct, it doesn't necessarily mean that zbufs must* be present.  This library may be used even if zbufs have been scaled out* of the system.** RETURNS:* A pointer to a func table containing the mbufSockLib API.** NOMANUAL*/void * _mbufSockLibInit (void)    {    return ((void *) &mbufSockFunc);		/* no init necessary */    }/********************************************************************************* _mbufSockSend - send mbuf data to a socket** This routine transmits all of the data in <mbufId> to a previously* established connection-based (stream) socket.** The <mbufLen> parameter is only used for determining the amount of space* needed from the socket write buffer.  <mbufLen> has no affect on how many* bytes are sent; the entire mbuf chain will be transmitted.  If the length of* <mbufId> is not known, it must be determined using _mbufLength() before* calling this routine.** This routine transfers ownership of the mbuf chain from the user application* to the VxWorks network stack.  The mbuf ID <mbufId> is deleted by this* routine, and should not be used after this routine is called, even if* an ERROR status is returned.  The exceptions to this are if this routine* failed because the mbuf socket interface library was not uninitialized or an* invalid mbuf ID was passed in, in which case <mbufId> is not deleted.* Additionally, if the call fails during a non-blocking I/O socket write* with an errno of EWOULDBLOCK, then <mbufId> is not deleted, so that it may* be re-sent by the caller at a later time.** RETURNS* The number of bytes sent, or ERROR if the call fails.** SEE ALSO: mbufLength** NOMANUAL*/int _mbufSockSend    (    int			s,		/* socket to send to */    MBUF_ID		mbufId,		/* mbuf chain to transmit */    int			mbufLen,	/* length of entire mbuf chain */    int			flags		/* flags to underlying protocols */    )    {    MBUF_SEG		mbufSeg;		/* start of chain */    int			retVal = 0;		/* send() return status */    if (mbufId->type != MBUF_VALID)		/* invalid mbuf ID ? */	{	errno = S_mbufLib_ID_INVALID;	return (ERROR);	}    if ((mbufSeg = mbufId->mbufHead) != NULL)	/* send mbuf chain */	{	mbufSeg->m_pkthdr.rcvif = NULL;	mbufSeg->m_pkthdr.len = mbufLen;        mbufSeg->m_flags |= M_PKTHDR;	        retVal = send (s, (char *) mbufSeg, mbufLen, flags | MSG_MBUF);	}    /* do not delete mbuf ID on EWOULDBLOCK error so user can resend ID */    if ((retVal != ERROR) || (errno != EWOULDBLOCK))        MBUF_ID_DELETE_EMPTY(mbufId);    return (retVal);    }/********************************************************************************* _mbufSockSendto - send a mbuf message to a socket** This routine sends the entire message in <mbufId> to the datagram socket* named by <to>.  The socket <s> will be received by the receiver as the* sending socket.** The <mbufLen> parameter is only used for determining the amount of space* needed from the socket write buffer.  <mbufLen> has no affect on how many* bytes are sent; the entire mbuf chain will be transmitted.  If the length of* <mbufId> is not known, it must be determined using _mbufLength() before* calling this routine.** This routine transfers ownership of the mbuf chain from the user application* to the VxWorks network stack.  The mbuf ID <mbufId> is deleted by this* routine, and should not be used after this routine is called, even if* an ERROR status is returned.  The exceptions to this are if this routine* failed because the mbuf socket interface library was not uninitialized or an* invalid mbuf ID was passed in, in which case <mbufId> is not deleted.* Additionally, if the call fails during a non-blocking I/O socket write* with an errno of EWOULDBLOCK, then <mbufId> is not deleted, so that it may* be re-sent by the caller at a later time.** RETURNS* The number of bytes sent, or ERROR if the call fails.** SEE ALSO: mbufLength** NOMANUAL*/int _mbufSockSendto    (    int			s,		/* socket to send to */    MBUF_ID		mbufId,		/* mbuf chain to transmit */    int			mbufLen,	/* length of entire mbuf chain */    int			flags,		/* flags to underlying protocols */    struct sockaddr *	to,		/* recipient's address */    int			tolen		/* length of <to> sockaddr */    )    {    MBUF_SEG		mbufSeg;		/* start of chain */    int			retVal = 0;		/* sendto() return status */    if (mbufId->type != MBUF_VALID)		/* invalid mbuf ID ? */	{	errno = S_mbufLib_ID_INVALID;	return (ERROR);	}    if ((mbufSeg = mbufId->mbufHead) != NULL)	/* send mbuf chain */	{	mbufSeg->m_pkthdr.rcvif = NULL;	mbufSeg->m_pkthdr.len = mbufLen;        mbufSeg->m_flags |= M_PKTHDR;	        retVal = sendto (s, (char *) mbufSeg, mbufLen, flags | MSG_MBUF,	to, tolen);	}    /* do not delete mbuf ID on EWOULDBLOCK error so user can resend ID */    if ((retVal != ERROR) || (errno != EWOULDBLOCK))        MBUF_ID_DELETE_EMPTY(mbufId);    return (retVal);    }/********************************************************************************* _mbufSockBufSend - create an mbuf from user data and send it to a socket** This routine creates an mbuf from the user buffer <buf>, and transmits* it to a previously established connection-based (stream) socket.** The user provided free routine <freeRtn> will be called when <buf>* is no longer being used by the TCP/IP network stack.  If <freeRtn> is NULL,* this routine will function normally, except that the user will not be* notified when <buf> is released by the network stack.  <freeRtn> will be* called from the context of the task that last references it.  This is* typically either tNetTask context, or the caller's task context.* <freeRtn> should be declared as follows:* .CS*       void freeRtn*           (*           caddr_t     buf,    /@ pointer to user buffer @/*           int         freeArg /@ user provided argument to free routine @/*           )* .CE** RETURNS:* The number of bytes sent, or ERROR if the call fails.** NOMANUAL*/int _mbufSockBufSend    (    int			s,		/* socket to send to */    char *		buf,		/* pointer to data buffer */    int			bufLen,		/* number of bytes to send */    VOIDFUNCPTR		freeRtn,	/* free routine callback */    int			freeArg,	/* argument to free routine */    int			flags		/* flags to underlying protocols */    )    {    struct mbufId	mbufIdNew;		/* dummy ID to insert into */    MBUF_SEG		mbufSeg;		/* start of mbuf chain */    int			retVal = 0;		/* send() return status */    mbufIdNew.mbufHead = NULL;			/* init dummy ID */    mbufIdNew.type = MBUF_VALID;    /* build an mbuf chain with the user buffer as only mbuf */    if ((mbufSeg = _mbufInsertBuf (&mbufIdNew, NULL, 0, buf,	bufLen, freeRtn, freeArg)) == NULL)	{        if (freeRtn != NULL)			/* call free routine on error */	    (*freeRtn) (buf, freeArg);        return (ERROR);	}    mbufSeg->m_pkthdr.rcvif = NULL;    mbufSeg->m_pkthdr.len = bufLen;     mbufSeg->m_flags |= M_PKTHDR;	    if (((retVal = send (s, (char *) mbufSeg, bufLen, flags | MSG_MBUF)) ==	ERROR) && (errno == EWOULDBLOCK))        m_freem (mbufSeg);			/* free for EWOULDBLOCK case */    return (retVal);    }/********************************************************************************* _mbufSockBufSendto - create an mbuf from a message and send it to a socket** This routine creates an mbuf from the user buffer <buf>, and sends* it to the datagram socket named by <to>.  The socket <s> will be* received by the receiver as the sending socket.** The user provided free routine <freeRtn> will be called when <buf>* is no longer being used by the UDP/IP network stack.  If <freeRtn> is NULL,* this routine will function normally, except that the user will not be* notified when <buf> is released by the network stack.  <freeRtn> will be* called from the context of the task that last references it.  This is* typically either tNetTask context or the caller's task context.* <freeRtn> should be declared as follows:* .CS*       void freeRtn*           (*           caddr_t     buf,    /@ pointer to user buffer @/*           int         freeArg /@ user provided argument to free routine @/*           )* .CE** RETURNS:* The number of bytes sent, or ERROR if the call fails.** NOMANUAL*/int _mbufSockBufSendto    (    int			s,		/* socket to send to */    char *		buf,		/* pointer to data buffer */    int			bufLen,		/* number of bytes to send */    VOIDFUNCPTR		freeRtn,	/* free routine callback */    int			freeArg,	/* argument to free routine */    int			flags,		/* flags to underlying protocols */    struct sockaddr *	to,		/* recipient's address */    int			tolen		/* length of <to> sockaddr */    )    {    struct mbufId	mbufIdNew;		/* dummy ID to insert into */    MBUF_SEG		mbufSeg;		/* start of mbuf chain */    int			retVal = 0;		/* sendto() return status */    mbufIdNew.mbufHead = NULL;			/* init dummy ID */    mbufIdNew.type = MBUF_VALID;    /* build an mbuf chain with the user buffer as only mbuf */    if ((mbufSeg = _mbufInsertBuf (&mbufIdNew, NULL, 0, buf,	bufLen, freeRtn, freeArg)) == NULL)	{        if (freeRtn != NULL)			/* call free routine on error */	    (*freeRtn) (buf, freeArg);        return (ERROR);	}    mbufSeg->m_pkthdr.rcvif = NULL;    mbufSeg->m_pkthdr.len = bufLen;     mbufSeg->m_flags |= M_PKTHDR;	    if (((retVal = sendto (s, (char *) mbufSeg, bufLen, flags | MSG_MBUF,        to, tolen)) == ERROR) && (EWOULDBLOCK == errno))        m_freem (mbufSeg);			/* free for EWOULDBLOCK case */    return (retVal);    }/********************************************************************************* _mbufSockRecv - receive data from a socket and place into a mbuf** This routine receives data from a connection-based (stream) socket, and* returns the data to the user in a newly created mbuf chain.** The <pLen> parameter indicates the number of bytes requested by the caller.* If the operation is successful, the number of bytes received will be* returned through this paramter.** RETURNS:* The mbuf ID of a newly created mbuf chain containing the received data,* or NULL if the operation failed.** NOMANUAL*/MBUF_ID _mbufSockRecv    (    int			s,		/* socket to receive data from */    int			flags,		/* flags to underlying protocols */    int *		pLen		/* length of mbuf requested/received */    )    {    MBUF_ID		mbufId;			/* mbuf returned to user */    MBUF_SEG		mbufSeg = NULL;		/* received mbuf chain */    int			status;			/* recv() return status */    MBUF_ID_CREATE(mbufId);			/* create ID for recv data */    if (mbufId == NULL)        return (NULL);    if ((status = (recv (s, (char *) &mbufSeg, *pLen, flags | MSG_MBUF))) ==	ERROR)					/* Rx data from the socket */	{	MBUF_ID_DELETE_EMPTY(mbufId);	return (NULL);	}    mbufId->mbufHead = mbufSeg;			/* hook into mbuf ID */    *pLen = status;				/* stuff return length */    return (mbufId);    }/********************************************************************************* _mbufSockRecvfrom - receive a message from a socket and place into a mbuf** This routine receives a message from a datagram socket, and* returns the message to the user in a newly created mbuf chain.** The message is received regardless of whether the socket is connected.* If <from> is non-zero, the address of the sender's socket is copied to it.* The value-result parameter <pFromLen> should be initialized to the size of* the <from> buffer.  On return, <pFromLen> contains the actual size of the* address stored in <from>.** The <pLen> parameter indicates the number of bytes requested by the caller.* If the operation is successful, the number of bytes received will be* returned through this paramter.** RETURNS:* The mbuf ID of a newly created mbuf chain containing the received message,* or NULL if the operation failed.** NOMANUAL*/MBUF_ID _mbufSockRecvfrom    (    int			s,		/* socket to receive from */    int			flags,		/* flags to underlying protocols */    int *		pLen,		/* length of mbuf requested/received */    struct sockaddr *	from,		/* where to copy sender's addr */    int *		pFromLen	/* value/result length of <from> */    )    {    MBUF_ID		mbufId;			/* mbuf returned to user */    MBUF_SEG		mbufSeg = NULL;		/* received mbuf chain */    int			status;			/* recvfrom() return status */    MBUF_ID_CREATE(mbufId);			/* create ID for recv data */    if (mbufId == NULL)        return (NULL);    if ((status = (recvfrom (s, (char *) &mbufSeg, *pLen, flags | MSG_MBUF,	from, pFromLen))) == ERROR)		/* Rx message from the socket */	{	MBUF_ID_DELETE_EMPTY(mbufId);	return (NULL);	}    mbufId->mbufHead = mbufSeg;			/* hook into mbuf ID */    *pLen = status;				/* stuff return length */    return (mbufId);    }

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
91亚洲国产成人精品一区二三| 日韩三级.com| 99久久精品一区二区| 国产激情视频一区二区三区欧美| 久久精品久久精品| 老司机免费视频一区二区| 裸体在线国模精品偷拍| 久久99这里只有精品| 韩国一区二区在线观看| 国产伦精一区二区三区| 成人伦理片在线| 色婷婷狠狠综合| 9191久久久久久久久久久| 欧美一区二区成人6969| 欧美成人精品二区三区99精品| 久久亚洲欧美国产精品乐播| 国产亚洲精品久| 亚洲欧美一区二区三区国产精品 | 日韩理论片中文av| 一区二区高清视频在线观看| 亚洲综合图片区| 日韩va亚洲va欧美va久久| 精久久久久久久久久久| 国产精华液一区二区三区| 99精品一区二区三区| 欧美年轻男男videosbes| 欧美草草影院在线视频| 国产精品入口麻豆九色| 一区二区三区色| 久久精品国产77777蜜臀| 国产盗摄一区二区三区| 91精彩视频在线| 精品捆绑美女sm三区| 欧美国产欧美亚州国产日韩mv天天看完整| 1024成人网色www| 日韩av不卡在线观看| 国产**成人网毛片九色| 色婷婷久久久综合中文字幕| 日韩精品中文字幕在线不卡尤物 | 久久国产夜色精品鲁鲁99| 韩国视频一区二区| 91一区一区三区| 日韩免费观看2025年上映的电影| 欧美经典一区二区| www.久久精品| 欧美日韩国产a| 国产日韩综合av| 亚洲午夜激情av| 国产·精品毛片| 欧美一区二区三区日韩视频| 国产欧美精品一区二区色综合朱莉| 亚洲黄色性网站| 激情五月播播久久久精品| 91蜜桃在线免费视频| 精品久久国产字幕高潮| 亚洲欧美偷拍卡通变态| 国产一区二三区| 欧美日本乱大交xxxxx| 国产欧美一区在线| 蜜桃一区二区三区在线| 91国产成人在线| 国产午夜精品一区二区三区四区| 偷拍日韩校园综合在线| av中文字幕不卡| 精品国免费一区二区三区| 夜夜操天天操亚洲| 国产精品一区2区| 日韩视频在线永久播放| 亚洲国产日产av| 色综合中文字幕| 欧美国产欧美综合| 国内成人自拍视频| 日韩亚洲欧美一区二区三区| 亚洲国产一区二区三区青草影视| 成人性生交大片免费| 精品国产第一区二区三区观看体验| 夜夜精品视频一区二区| av在线不卡观看免费观看| 久久综合一区二区| 久草热8精品视频在线观看| 欧美人xxxx| 亚洲激情成人在线| 91色乱码一区二区三区| 国产精品二三区| 丁香激情综合国产| 国产午夜亚洲精品理论片色戒| 喷水一区二区三区| 欧美日韩激情一区二区三区| 怡红院av一区二区三区| 本田岬高潮一区二区三区| 久久精品男人天堂av| 精品在线一区二区三区| 日韩午夜av一区| 蜜桃av噜噜一区| 日韩欧美国产高清| 免费久久99精品国产| 制服丝袜亚洲精品中文字幕| 天堂蜜桃91精品| 欧美精品亚洲一区二区在线播放| 亚洲国产aⅴ成人精品无吗| 91福利视频网站| 亚洲午夜久久久久久久久电影网| 色噜噜狠狠一区二区三区果冻| 亚洲靠逼com| 色伊人久久综合中文字幕| 亚洲欧美色综合| 欧美亚洲动漫另类| 午夜精品aaa| 91精品视频网| 国产在线播放一区二区三区| 国产亚洲成aⅴ人片在线观看| 国产成人99久久亚洲综合精品| 国产欧美一区二区精品婷婷| 丁香啪啪综合成人亚洲小说| 国产精品美女视频| 99国产精品99久久久久久| 亚洲人吸女人奶水| 亚洲柠檬福利资源导航| 在线影视一区二区三区| 三级亚洲高清视频| 日韩欧美卡一卡二| 国产成a人亚洲精| 亚洲欧美另类图片小说| 欧洲激情一区二区| 日本不卡视频一二三区| 久久久久久久久99精品| 99久久国产综合精品女不卡 | 99久久久国产精品| 亚洲一区在线观看视频| 91精品国产综合久久蜜臀| 精品一区二区三区的国产在线播放| 久久久久久久久免费| 成人精品免费网站| 亚洲mv在线观看| 久久一区二区三区四区| 99视频精品在线| 天堂成人免费av电影一区| 久久久午夜电影| 在线亚洲+欧美+日本专区| 久久国内精品自在自线400部| 国产日韩欧美亚洲| 欧美日韩一区成人| 国内久久婷婷综合| 亚洲欧美色一区| 日韩欧美一级片| 北条麻妃一区二区三区| 日本 国产 欧美色综合| 国产精品久久网站| 制服丝袜日韩国产| 99re这里只有精品首页| 图片区小说区国产精品视频| 久久久精品人体av艺术| 欧美日韩亚洲综合| 国产成人精品网址| 午夜影院久久久| 中文字幕亚洲欧美在线不卡| 91精品在线观看入口| zzijzzij亚洲日本少妇熟睡| 免费一级片91| 亚洲欧美另类小说视频| 久久久噜噜噜久噜久久综合| 欧美日韩精品一区视频| av午夜精品一区二区三区| 另类小说一区二区三区| 亚洲一区二区视频| 国产精品久久久久久久久久久免费看 | 亚洲精选免费视频| 久久青草欧美一区二区三区| 欧美美女网站色| 99免费精品在线| 国产精品一级二级三级| 日韩avvvv在线播放| 亚洲免费高清视频在线| 日本一区二区三区久久久久久久久不| 欧美日本在线播放| 91麻豆福利精品推荐| 成人一区二区三区中文字幕| 精品一区二区三区视频在线观看| 亚洲成a人片综合在线| 综合色中文字幕| 国产女同互慰高潮91漫画| 欧美一区二区三区视频| 欧美日韩国产片| 日本黄色一区二区| eeuss影院一区二区三区 | 欧美大胆人体bbbb| 欧美男女性生活在线直播观看| 99精品国产热久久91蜜凸| 国产经典欧美精品| 国产在线精品一区二区不卡了| 蜜桃久久久久久| 免费在线一区观看| 日本中文字幕不卡| 日本强好片久久久久久aaa| 午夜国产不卡在线观看视频| 色综合色综合色综合 | 欧美一区二区在线视频| 精品视频一区 二区 三区| 色88888久久久久久影院按摩 | 日韩一二三区视频|