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

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

?? bsdsocklib.c

?? vxwork源代碼
?? C
?? 第 1 頁 / 共 5 頁
字號:
/* bsdSockLib.c - UNIX BSD 4.4 compatible socket library *//* Copyright 1984 - 2001 Wind River Systems, Inc. */#include "copyright_wrs.h"/*modification history--------------------01u,05nov01,vvv  fixed compilation warnings01t,15oct01,rae  merge from truestack ver 01u, base 01r (SPRs 34005, 30608)01s,10nov00,spm  merged from version 01s of tor3_x branch (SPR #30608 fix)01r,29apr99,pul  Upgraded NPT phase3 code to tor2.0.001q,16mar99,spm  recovered orphaned code from tor2_0_x branch (SPR #25770)01p,02feb99,sgv  Added zbufsockrtn routine01o,02dec98,n_s  fixed sendmsg and recvmsg. spr 2355201n,10nov98,spm  unmapped closed socket file descriptors (SPR #21583)01m,26aug98,n_s  added return val check to mBufClGet in accept (). spr #22238.01l,17mar98,vin  fixed a nonblocking I/O bug SPR 20542.01k,17mar98,jmb  Merge patch by jmb from 03nov97: set small receive buffer                  which  HPSIM is TCP client. (SPR 8709) 01j,17mar98,jmb  Merge patch by jmb from 31oct97: Set receive buffer when                  HPSIM is a TCP server.  Work-aroun for MTU mismatch and                 pty problem in the SLIP connection.  (SPR 8709)01i,10dec97,sgv  fixed a bug in recvmsg, intialized control and from variables		 to NULL. 01h,06oct97,sgv  fixed sendmsg/recvmsg call, mbufs are not freed when EINVAL 		 is returned01g,06oct97,spm  added optional binary compatibility for BSD 4.3 applications01f,25jul97,vin  fixed so_accept function call, saved new fd in the socket		 structure.01e,03dec96,vin	 changed m_getclr to fit the new declaration.01d,22nov96,vin  modified for BSD44.01c,07aug95,dzb  NOMANUAL on headers.01b,25jul95,dzb  changed to just use DEV_HDR device header.01a,21jul95,dzb  created from sockLib.c, ver 04g.*//*This library provides UNIX BSD 4.4 compatible socket calls.  These callsmay be used to open, close, read, and write sockets, either on the sameCPU or over a network.  The calling sequences of these routines areidentical to UNIX BSD 4.4.ADDRESS FAMILYVxWorks sockets support only the Internet Domain address family; useAF_INET for the <domain> argument in subroutines that require it.There is no support for the UNIX Domain address family.IOCTL FUNCTIONSSockets respond to the following ioctl() functions.  These functions aredefined in the header files ioLib.h and ioctl.h..iP "FIONBIO" 18 3Turns on/off non-blocking I/O..CS    on = TRUE;    status = ioctl (sFd, FIONBIO, &on);.CE.iP "FIONREAD"Reports the number of bytes available to read on the socket.  On the returnof ioctl(), <bytesAvailable> has the number of bytes available to readon the socket..CS    status = ioctl (sFd, FIONREAD, &bytesAvailable);.CE.iP "SIOCATMARK"Reports whether there is out-of-band data to be read on the socket.  Onthe return of ioctl(), <atMark> will be TRUE (1) if there is out-of-banddata, otherwise it will be FALSE (0)..CS    status = ioctl (sFd, SIOCATMARK, &atMark);.CEINCLUDE FILES: types.h, bsdSockLib.h, socketvar.hSEE ALSO: netLib,.pG "Network"NOMANUAL*/#include "vxWorks.h"#include "sockFunc.h"#include "bsdSockMap.h"		/* map socket routines to bsdxxx() */#include "strLib.h"#include "errnoLib.h"#include "netLib.h"#include "ioLib.h"#include "iosLib.h"#include "tickLib.h"#include "vwModNum.h"#include "net/systm.h"#include "net/mbuf.h"#include "net/protosw.h"#include "net/socketvar.h"#include "net/uio.h"#include "bsdSockLib.h"#include "netinet/in.h"#ifdef VIRTUAL_STACK#include "netinet/vsLib.h"#endif    /* VIRTUAL_STACK */IMPORT STATUS soo_ioctl ();		/* for call into sys_socket.c *//* locals */LOCAL DEV_HDR	bsdSockDev;			/* BSD-specific device header */LOCAL int	bsdSockDrvNum;			/* BSD socket driver number */LOCAL char *	bsdSockName = "(socket)";	/* file name of BSD sockets *//* globals */BOOL 	bsdSock43ApiFlag = FALSE; 	/* Provide backward binary */                                        /* compatibility for BSD 4.3? */                                        /* (Set TRUE by default with */                                        /* BSD43_COMPATIBLE in configAll.h). */IMPORT SOCK_FUNC ** pSockFdMap;/* declare BSD socket interface function table */SOCK_FUNC	bsdSockFunc =    {    (FUNCPTR) sockLibInit,    (FUNCPTR) accept,    (FUNCPTR) bind,    (FUNCPTR) connect,    (FUNCPTR) connectWithTimeout,    (FUNCPTR) getpeername,    (FUNCPTR) getsockname,    (FUNCPTR) listen,    (FUNCPTR) recv,    (FUNCPTR) recvfrom,    (FUNCPTR) recvmsg,    (FUNCPTR) send,    (FUNCPTR) sendto,    (FUNCPTR) sendmsg,    (FUNCPTR) shutdown,    (FUNCPTR) socket,    (FUNCPTR) getsockopt,    (FUNCPTR) setsockopt,    (FUNCPTR) zbufsockrtn    };/* forward declarations  */LOCAL STATUS	bsdSockClose (struct socket *so);LOCAL int	bsdSockWrite (struct socket *so, char *buf, int bufLen);LOCAL int	bsdSockRead (struct socket *so, caddr_t buf, int bufLen);LOCAL int	bsdSockargs (struct mbuf ** aname, caddr_t name,		    int namelen, int type);LOCAL void 	bsdSockAddrRevert (struct sockaddr *);#ifdef VIRTUAL_STACKLOCAL STATUS    stackInstFromSockVsidSet (int s);#endif /* VIRTUAL_STACK *//********************************************************************************* bsdSockLibInit - install the BSD "socket driver" into the I/O system** bsdSockLibInit must be called once at configuration time before any socket* operations are performed.** RETURNS: a pointer to the BSD socket table, or NULL.** NOMANUAL*/SOCK_FUNC * sockLibInit (void)    {    if (bsdSockDrvNum > 0)        return (&bsdSockFunc);    if ((bsdSockDrvNum = iosDrvInstall ((FUNCPTR) NULL, (FUNCPTR) NULL,        (FUNCPTR) NULL, (FUNCPTR) bsdSockClose, (FUNCPTR) bsdSockRead,	(FUNCPTR) bsdSockWrite, (FUNCPTR) soo_ioctl)) == ERROR)	return (NULL);    bsdSockDev.drvNum = bsdSockDrvNum;	/* to please I/O system */    bsdSockDev.name   = bsdSockName;	/* for iosFdSet name optimiz. */    return (&bsdSockFunc);    }/********************************************************************************* bsdSocket - open a socket** This routine opens a socket and returns a socket descriptor.* The socket descriptor is passed to the other socket routines to identify the* socket.  The socket descriptor is a standard I/O system file descriptor* (fd) and can be used with the close(), read(), write(), and ioctl() routines.** Available socket types include:* .iP SOCK_STREAM 18* connection-based (stream) socket.* .iP SOCK_DGRAM* datagram (UDP) socket.* .iP SOCK_RAW* raw socket.* .LP** RETURNS: A socket descriptor, or ERROR.** NOMANUAL*/int socket    (    int domain,         /* address family (e.g. AF_INET) */    int type,           /* SOCK_STREAM, SOCK_DGRAM, or SOCK_RAW */    int protocol        /* socket protocol (usually 0) */    )    {    struct socket *so;    int fd;#ifndef  _WRS_VXWORKS_5_X    OBJ_ID fdObject;#endif    FAST int spl = splnet ();    int status = socreate (domain, &so, type, protocol);    splx (spl);    if (status)	{	netErrnoSet (status);        return (ERROR);	}    /* stick the socket into a file descriptor */    if ((fd = iosFdNew ((DEV_HDR *) &bsdSockDev, bsdSockName, (int) so)) ==	ERROR)	{	(void)bsdSockClose (so);	return (ERROR);	}#ifndef  _WRS_VXWORKS_5_X    /* set ownership of socket semaphores */    fdObject = iosFdObjIdGet (fd);    if (fdObject == NULL)        {	(void)bsdSockClose (so);	return (ERROR);        }    status = objOwnerSet (so->so_timeoSem, fdObject);    if (status == ERROR)        {	(void)bsdSockClose (so);	return (ERROR);        }    status = objOwnerSet (so->so_rcv.sb_Sem, fdObject);    if (status == ERROR)        {	(void)bsdSockClose (so);	return (ERROR);        }    status = objOwnerSet (so->so_snd.sb_Sem, fdObject);    if (status == ERROR)        {	(void)bsdSockClose (so);	return (ERROR);        }#endif /*  _WRS_VXWORKS_5_X */        /* save fd in the socket structure */    so->so_fd = fd;#ifdef VIRTUAL_STACK        /* set the vsid in the socket to the current stack */    status = setsockopt (fd, SOL_SOCKET, SO_VSID,                                (char *)&myStackNum, sizeof (myStackNum));    if (status)        {        netErrnoSet (status);        (void)bsdSockClose (so);        return (ERROR);        }#endif    /* VIRTUAL_STACK */        return (fd);    }/********************************************************************************* bsdSockClose - close a socket** bsdSockClose is called by the I/O system to close a socket.**/LOCAL STATUS bsdSockClose    (    struct socket *so    )    {    FAST int ret;    FAST int sx;    int fd;#ifdef VIRTUAL_STACK    /* Check if we are in the correct stack */        if (stackInstFromSockVsidSet (so->so_fd) != OK)        return (ERROR);#endif    /* VIRTUAL_STACK */    sx = splnet ();    fd = so->so_fd;    if (so->so_state & SS_NOFDREF)        ret = 0;    else        ret = soclose (so);    splx (sx);    /*      * Remove the mapping installed by the switchboard. Performing this     * step here is ugly, but the alternative is worse.     */    pSockFdMap [fd] = NULL;    return (ret);    }/********************************************************************************* bsdBind - bind a name to a socket** This routine associates a network address (also referred to as its "name")* with a specified socket so that other processes can connect or send to it.* When a socket is created with socket(), it belongs to an address family* but has no assigned name.** RETURNS:* OK, or ERROR if there is an invalid socket, the address is either* unavailable or in use, or the socket is already bound.** NOMANUAL*/STATUS bind    (    int s,                      /* socket descriptor */    struct sockaddr *name,      /* name to be bound */    int namelen                 /* length of name */    )    {    struct mbuf *nam;    int status;    struct socket *so;    /* extract the socket from the fd */    if ((so = (struct socket *) iosFdValue (s)) == (struct socket *) ERROR)        return (ERROR);#ifdef VIRTUAL_STACK    if (stackInstFromSockVsidSet (s) != OK)        return (ERROR);#endif    /* VIRTUAL_STACK */        status = bsdSockargs (&nam, (caddr_t) name, namelen, MT_SONAME);    if (status)	{	netErrnoSet (status);        return (ERROR);	}    status = sobind (so, nam);    if (status)	{	netErrnoSet (status);	m_freem (nam);        return (ERROR);	}    m_freem (nam);    return (OK);    }/********************************************************************************* bsdListen - enable connections to a socket** This routine enables connections to a socket.  It also specifies the* maximum number of unaccepted connections that can be pending at one time* (<backlog>).  After enabling connections with listen(), connections are* actually accepted by accept().** RETURNS: OK, or ERROR if the socket is invalid or unable to listen.** NOMANUAL*/STATUS listen    (    int s,              /* socket descriptor */    int backlog         /* number of connections to queue */    )    {    FAST int status;    FAST struct socket *so;    /* extract the socket from the fd */    if ((so = (struct socket *) iosFdValue (s)) == (struct socket *) ERROR)        return (ERROR);#ifdef VIRTUAL_STACK    if (stackInstFromSockVsidSet (s) != OK)        return (ERROR);#endif    /* VIRTUAL_STACK */        status = solisten (so, backlog);    if (status)	{	netErrnoSet (status);        return (ERROR);	}#if (CPU == SIMHPPA)/* *  Set the size of the receive buffer. *  This is the way (without rewriting the user app) to get *  data from the master to auto-segment and fit in the pty. */{    int bLen = 660;    return (setsockopt (s, SOL_SOCKET, SO_RCVBUF, &bLen, sizeof (bLen)));}#endif    return (OK);    }/********************************************************************************* bsdAccept - accept a connection from a socket** This routine accepts a connection on a socket, and returns a new socket* created for the connection.  The socket must be bound to an address with* bind(), and enabled for connections by a call to listen().  The accept()* routine dequeues the first connection and creates a new socket with the* same properties as <s>.  It blocks the caller until a connection is* present, unless the socket is marked as non-blocking.** The parameter <addrlen> should be initialized to the size of the available* buffer pointed to by <addr>.  Upon return, <addrlen> contains the size in* bytes of the peer's address stored in <addr>.** RETURNS* A socket descriptor, or ERROR if the call fails.** NOMANUAL*/int accept    (    int s,                      /* socket descriptor */    struct sockaddr *addr,      /* peer address */    int *addrlen                /* peer address length */

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲精品久久嫩草网站秘色| 欧美色图12p| 欧美精品乱码久久久久久按摩 | 99re热这里只有精品免费视频| 久久精品99国产国产精| 蜜臀av性久久久久蜜臀aⅴ| 无吗不卡中文字幕| 日本成人在线电影网| 视频一区二区国产| 午夜精品爽啪视频| 欧美性感一类影片在线播放| 在线免费观看日韩欧美| 欧美三级三级三级| 欧美一区二区三区公司| 欧美xxxx老人做受| 久久99精品国产麻豆婷婷| 麻豆极品一区二区三区| 国产精品一区在线观看你懂的| 国产一区福利在线| fc2成人免费人成在线观看播放 | 成人午夜免费电影| 99精品国产一区二区三区不卡| 99国产精品99久久久久久| 一区二区三区在线播| 久久久久国产精品麻豆ai换脸| 国产日韩亚洲欧美综合| 亚洲激情一二三区| 青青国产91久久久久久| 国产丶欧美丶日本不卡视频| 91色婷婷久久久久合中文| 亚洲欧美激情小说另类| 亚洲一区二区影院| 国产美女主播视频一区| 一本一道久久a久久精品综合蜜臀| 国产69精品久久777的优势| 亚洲综合一区二区精品导航| 蜜臀精品一区二区三区在线观看 | 日韩精品欧美成人高清一区二区| 奇米四色…亚洲| av一区二区三区| 欧美乱妇一区二区三区不卡视频| 欧美精品一区视频| 亚洲一区二区五区| 岛国av在线一区| 91精品国产91热久久久做人人 | 久久久不卡影院| 亚洲一区二区综合| 国产成人午夜精品影院观看视频| 91福利视频网站| 亚洲国产岛国毛片在线| 日本成人在线不卡视频| 色激情天天射综合网| 国产日韩欧美精品综合| 免费欧美在线视频| 欧美午夜在线观看| 国产午夜精品一区二区三区嫩草| 欧美色中文字幕| 一区在线观看免费| 国产美女在线观看一区| 亚洲免费观看高清完整版在线观看 | 成人app下载| 精品国内片67194| 亚洲成人在线网站| 欧美理论在线播放| 欧美福利电影网| 亚洲黄色在线视频| av中文字幕亚洲| 日本一区二区成人| 国模大尺度一区二区三区| 亚洲一区二三区| 色综合天天在线| 国产精品久99| 成人avav在线| 日韩伦理免费电影| 91小视频在线免费看| 国产精品色噜噜| 成人综合婷婷国产精品久久免费| 天天影视色香欲综合网老头| 91成人免费在线视频| 专区另类欧美日韩| 国产精品麻豆欧美日韩ww| 国产真实乱子伦精品视频| 欧美一级在线视频| 免费人成黄页网站在线一区二区| 5月丁香婷婷综合| 奇米影视一区二区三区| 精品久久久久99| 国产成人午夜片在线观看高清观看| 精品国精品国产| 国产乱色国产精品免费视频| 日本一区二区三区视频视频| 美洲天堂一区二卡三卡四卡视频| 欧美片网站yy| 蓝色福利精品导航| 久久人人超碰精品| av在线一区二区三区| 国产精品久久网站| 欧美日韩精品一区二区天天拍小说 | 欧美成人a∨高清免费观看| 国产一区日韩二区欧美三区| 自拍偷拍亚洲欧美日韩| 欧美日韩精品二区第二页| 狠狠色丁香久久婷婷综合_中| 精品国产sm最大网站免费看| 国产欧美一区二区三区在线看蜜臀| 久久久久一区二区三区四区| 99久久精品国产精品久久| 亚洲成人午夜影院| 日本一区免费视频| 欧美精品自拍偷拍动漫精品| 国产麻豆视频精品| 亚洲三级电影网站| 在线看国产一区| 婷婷久久综合九色国产成人| 91蜜桃网址入口| 精品视频在线看| 岛国精品在线观看| 精品久久久久99| 成人av在线影院| 亚洲欧美一区二区三区国产精品 | 国产盗摄视频一区二区三区| 久久综合网色—综合色88| 国产精品91一区二区| 国产精品国产馆在线真实露脸 | 欧美电视剧在线观看完整版| 不卡高清视频专区| 一区二区三区免费| 在线不卡欧美精品一区二区三区| 日本在线不卡视频| 日韩激情一区二区| 久久久精品国产99久久精品芒果| 国产原创一区二区| 一色桃子久久精品亚洲| 欧美三级视频在线| 国产一区二区视频在线| 亚洲欧洲美洲综合色网| 日韩网站在线看片你懂的| 婷婷综合另类小说色区| 国产盗摄一区二区| 国产精品美女久久久久久久久| 国产成人综合亚洲网站| 亚洲欧洲成人精品av97| 欧美日本精品一区二区三区| 国内成人精品2018免费看| 99re视频这里只有精品| 五月天一区二区三区| 欧美激情综合网| 欧美日韩高清一区二区三区| 男人操女人的视频在线观看欧美| 欧美激情一二三区| 欧美精品乱人伦久久久久久| 国产精品自拍毛片| 亚洲高清视频的网址| 国产精品色呦呦| 日韩免费在线观看| 欧美一区二区久久久| 91性感美女视频| 亚洲国产成人午夜在线一区| 国产午夜精品一区二区| 日韩欧美在线观看一区二区三区| 国产精品911| 麻豆成人久久精品二区三区小说| 亚洲人一二三区| 久久精品人人做人人爽人人| 欧美日韩电影在线| 日本一区二区综合亚洲| 日韩精品中文字幕一区二区三区 | 国内精品国产成人国产三级粉色| 一区二区三区在线不卡| 国产精品免费视频一区| 精品乱人伦一区二区三区| 色菇凉天天综合网| 成人免费va视频| 欧美大黄免费观看| 91精品欧美久久久久久动漫| 成人小视频在线观看| 国产日韩精品一区二区浪潮av| 日韩欧美一二区| 日韩视频在线你懂得| 欧美日韩不卡在线| 9191精品国产综合久久久久久| 91麻豆高清视频| 91在线视频免费观看| 欧美羞羞免费网站| 亚洲欧美一区二区久久 | 国产在线不卡一区| 午夜视频久久久久久| 欧美激情一区二区三区全黄| 欧美一级久久久| 久久91精品国产91久久小草| 欧美96一区二区免费视频| 51精品国自产在线| 欧美日韩午夜在线| 99国产一区二区三精品乱码| 99视频精品全部免费在线| av毛片久久久久**hd| 97精品久久久久中文字幕| 精品视频资源站| 欧美一个色资源| 精品国产3级a|