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

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

?? bsdsocklib.c

?? vxworks的完整的源代碼
?? 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一区二区三区免费野_久草精品视频
色老汉一区二区三区| 天天影视网天天综合色在线播放| 国产精品18久久久久| 日韩欧美成人激情| 久久99精品久久久久婷婷| 日韩精品一区二区三区视频| 精品一区二区三区蜜桃| 亚洲精品一区在线观看| 高清日韩电视剧大全免费| 国产嫩草影院久久久久| 99久久婷婷国产综合精品电影| 亚洲欧美在线高清| 欧美中文一区二区三区| 亚洲444eee在线观看| 日韩欧美国产综合在线一区二区三区| 九九热在线视频观看这里只有精品| 国产三级欧美三级日产三级99 | 一区二区国产视频| 国产精品99久| 欧美国产一区二区在线观看| 成人福利视频在线看| 1区2区3区精品视频| 精品视频在线免费看| 日本欧美韩国一区三区| 国产亚洲精品bt天堂精选| 成人午夜看片网址| 亚洲第一成人在线| 精品国产一区二区精华| 波多野结衣中文字幕一区 | 色综合av在线| 青青草伊人久久| 国产欧美日韩视频一区二区| 色94色欧美sute亚洲线路一久 | 日韩精品一区二区三区在线观看| 九色综合国产一区二区三区| 自拍偷在线精品自拍偷无码专区| 欧美乱妇15p| 成人国产精品免费观看动漫| 日韩国产一二三区| 中文字幕亚洲精品在线观看| 欧美一区二区三区小说| 成人免费视频视频在线观看免费| 日韩精品一二三四| 国产精品久久久久影视| 日韩欧美一级在线播放| 91极品视觉盛宴| 国产美女视频91| 婷婷综合久久一区二区三区| 国产精品欧美一区二区三区| 精品久久久久久久久久久久包黑料 | 国产xxx精品视频大全| 日韩精品一二区| 亚洲欧美日韩精品久久久久| 欧美精品一区二区三区视频 | 色诱亚洲精品久久久久久| 精品亚洲国产成人av制服丝袜| 亚洲精品国产高清久久伦理二区| 精品播放一区二区| 91麻豆精品国产| 在线影视一区二区三区| 成人影视亚洲图片在线| 久久精品国产99国产| 亚洲第一搞黄网站| 亚洲激情五月婷婷| 国产精品嫩草影院com| 久久久久久久综合色一本| 欧美剧情片在线观看| 91九色最新地址| 91视频91自| 9i在线看片成人免费| 成人综合婷婷国产精品久久 | 狠狠色狠狠色合久久伊人| 天堂午夜影视日韩欧美一区二区| 亚洲男人的天堂一区二区| 国产精品午夜电影| 久久久91精品国产一区二区精品| 日韩欧美国产综合在线一区二区三区 | 亚洲人快播电影网| 国产精品成人免费精品自在线观看 | 成人国产精品免费观看| 波多野结衣在线aⅴ中文字幕不卡| 高清在线不卡av| 高清视频一区二区| 成人成人成人在线视频| 波多野结衣中文一区| www.色精品| 91国产成人在线| 欧美日韩一区二区在线观看 | 国模大尺度一区二区三区| 九九在线精品视频| 国产一区二区三区精品视频| 国产精品一二一区| 成人av在线看| 91啪九色porn原创视频在线观看| 色先锋久久av资源部| 欧美无人高清视频在线观看| 欧美一区二区在线视频| 精品处破学生在线二十三| 国产日韩欧美不卡在线| 自拍偷拍欧美精品| 亚洲国产aⅴ成人精品无吗| 天天操天天综合网| 激情伊人五月天久久综合| 国产成人精品1024| 99久久国产综合色|国产精品| 91豆麻精品91久久久久久| 91精品啪在线观看国产60岁| 精品国产成人系列| 国产精品午夜免费| 亚洲成人免费在线| 加勒比av一区二区| eeuss影院一区二区三区| 欧美在线观看一二区| 日韩欧美一二三区| 国产精品美女视频| 日产欧产美韩系列久久99| 国产成人日日夜夜| 欧美日韩国产a| 久久九九影视网| 亚洲一区二区不卡免费| 国产原创一区二区| 欧美视频精品在线观看| 久久久精品国产免大香伊| 一区二区三区久久| 紧缚捆绑精品一区二区| 在线免费观看一区| 国产午夜精品一区二区三区嫩草| 亚洲国产综合在线| 国产成a人亚洲精| 69堂亚洲精品首页| 最新欧美精品一区二区三区| 免费的国产精品| 色哦色哦哦色天天综合| 久久尤物电影视频在线观看| 亚洲精品高清视频在线观看| 国产剧情一区二区三区| 欧美性色欧美a在线播放| 337p粉嫩大胆噜噜噜噜噜91av | 91免费版pro下载短视频| 精品三级av在线| 亚洲日本中文字幕区| 日韩和欧美一区二区三区| 黄一区二区三区| 777久久久精品| 中文字幕av一区二区三区免费看| 亚洲图片欧美综合| 成人污视频在线观看| 欧美一卡二卡在线观看| 亚洲日本在线a| 国产成人免费视频网站高清观看视频| 欧美在线一区二区| 中日韩av电影| 七七婷婷婷婷精品国产| 91亚洲男人天堂| 2017欧美狠狠色| 首页亚洲欧美制服丝腿| 国产成人精品免费网站| 日韩欧美国产高清| 亚洲电影你懂得| 99久久久无码国产精品| 欧美激情在线看| 激情深爱一区二区| 日韩一区二区在线观看视频| 亚洲与欧洲av电影| 成人av影院在线| 国产亚洲1区2区3区| 美女视频一区二区| 91精品欧美综合在线观看最新 | 婷婷综合五月天| 91久久精品一区二区二区| 国产精品电影一区二区| 免费在线观看精品| 日韩精品中文字幕一区| 午夜精品福利视频网站| 91国内精品野花午夜精品| 国产日韩欧美一区二区三区综合| 国产精品一区2区| 久久色在线观看| 久久91精品国产91久久小草| 日韩免费视频一区二区| 精品在线免费视频| 日韩精品在线网站| 另类的小说在线视频另类成人小视频在线 | xfplay精品久久| 蜜桃av噜噜一区二区三区小说| 欧美亚州韩日在线看免费版国语版| 一区二区三区 在线观看视频| 91网站最新网址| 亚洲少妇屁股交4| 91色九色蝌蚪| 男女激情视频一区| 91精品国产麻豆| 免费视频一区二区| 日韩一区二区三区高清免费看看| 九九九久久久精品| 久久久一区二区| 高清成人在线观看| 国产精品蜜臀av| 欧美在线免费播放| 日本不卡在线视频|