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

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

?? resolvlib.c

?? vxworks source code, used for develop vxworks system.
?? C
?? 第 1 頁 / 共 2 頁
字號:
/* resolvLib.c - DNS resolver library *//* Copyright 1984 - 2001 Wind River Systems, Inc */#include <copyright_wrs.h>/* modification history -------------------------01k,15oct01,rae  merge from truestack ver 01l, base 01j (SPRs 67238, 28659)01j,06oct98,jmp  moved doc to resolvLibDoc.c.01i,14dec97,jdi  doc: cleanup.01h,19aug97,jag  fixed man page problems in resolvInit() SPR#9173, fixed		 SPR#9174, SPR#9175. Deleted getHostInfo(), getbyaddrWrapper()01g,04aug97,kbw  fixed man page problems found in beta review01f,19may97,spm  added checks for NULL pointers to user interface (SPR #8603)01e,30apr97,kbw  fiddled man page text 01d,01apr97,kbw  fixed man page text, changed parameter name to "length"                 in resolvDNExpand 01c,01apr97,jag  removed unused variable resolvDefaultDomainName.  Added                 routines: resolvHostLibGetByAddr(), resolvHostLibGetByName().                 Added necessary man pages.01b,05feb97,jag  added debug function pointer in resolvInit. MAX_DOMAIN_NAME01a,12aug96,rjc  written*//*!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!      WARNING      !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!         DOCUMENTATION of this library is located in resolvLibDoc.c      If you modify any documented routine, please update resolvLibDoc.c.!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!*//* includes */#include <vxWorks.h>#include <resolvLib.h>#include <semLib.h>#include <hostLib.h>#include <stdlib.h>#include <sockLib.h>#include <netinet/in.h>#include <inetLib.h>#include <stdio.h>#include <ctype.h>#include <errnoLib.h>#include <string.h>/* defines */#define  LOCAL_ENTRIES_TTL     60     /* Local entries have a ttl for 60 seconds */#define  ALIGNMENT              4     /* for word alignment */#define  MAX_DOMAIN_NAME      260     /* Max domain name including EOS marker */#define  MAX_HOSTLIB_BUF      512     /* hostLib interface functions buffer *//* macro to align ptr to buffer and decrement buffer size accordingly */#define ALIGN_BUF_PTR(pBuf, bufLen, alignment)     \     while ((UINT) (pBuf) % (alignment) != 0) \        {    \        ++ (pBuf);  \        -- (bufLen);  \        }/* typedefs *//* Globals *//* * Resolver state default settings.  Structure moved here from res_init.c */struct __res_state _res = 	{        RES_TIMEOUT,                    /* retransmition time interval */        4,                              /* number of times to retransmit */        RES_DEFAULT,                    /* options flags */        1,                              /* number of name servers */	};/* This variable point to the optional debug routine */FUNCPTR pdnsDebugFunc;/* locals */LOCAL RESOLV_PARAMS_S            resolvParams;        /* resolver settings */LOCAL STATUS resolvHostLibGetByAddr (int addr, char * pHostName);LOCAL int resolvHostLibGetByName (char * pHostName);/* externs */extern struct hostent *  _gethostbyname ();extern struct hostent *  _gethostbyaddr ();/* Ptrs defined in hostLib.c.  These ptrs are set by the resolver library */extern FUNCPTR _presolvHostLibGetByName;extern FUNCPTR _presolvHostLibGetByAddr;/********************************************************************************* hostEntFormat - Formats a char array as a structure of type hostent** This routine formarts a character array pointed to by <ppBuf> of the length * specified by <pBuflen>.  It creates a hostent structure in the buffer along* with the `h_aliases' and `h_addr_list' vectors big enough for <numAliases> * aliases and <numAddrs> addresses respectively. On a successful return * <ppBuf> and <pBuflen> specify the remaining unused part of the buffer.** NOMANUAL** RETURNS: A pointer to a hostent structure on success, or NULL if the* input buffer is too small.*/LOCAL struct hostent *  hostEntFormat    (    char **           ppBuf,      /* Pointer to character buffer pointer */    int *             pBufLen,    /* Pointer to the buffer length */    int               numAliases, /* Max # of host aliases expected */    int               numAddrs    /* Max # of host addresses expected */    )    {    char *            pTmp;    struct hostent *  pHostEnt;    pTmp =  *ppBuf;    if (((numAliases + 1 + numAddrs + 1) * sizeof (char *) +          sizeof (struct hostent) + 3 + 3) > *pBufLen)        {        return (NULL);        }    ALIGN_BUF_PTR (pTmp, *pBufLen, ALIGNMENT);    pHostEnt = (struct hostent *) pTmp;    pTmp += sizeof (struct hostent);    *pBufLen -= sizeof (struct hostent);     ALIGN_BUF_PTR (pTmp, *pBufLen, ALIGNMENT);    pHostEnt->h_aliases = (char **) pTmp;     pTmp += (numAliases + 1)* sizeof (char **);    *pBufLen -=  (numAliases + 1) * sizeof (char **);     pHostEnt->h_addr_list = (char **) pTmp;    pTmp += (numAddrs + 1)  * sizeof (char **);    *pBufLen -= (numAddrs + 1)  * sizeof (char **);    *ppBuf = pTmp;    return (pHostEnt);    }/********************************************************************************* resolvInit - initialize the resolver library ** This function initializes the resolver.  <pNameServer> is a single IP address* for a name server in dotted decimal notation.  <pDefaultDomainName> is the * default domain name to be appended to names without a dot.  The function * pointer <pdnsDebugRtn> is set to the resolver debug function.  Additional* name servers can be configured using the function resolvParamsSet().** RETURNS: OK or ERROR.** SEE ALSO:* resolvGetHostByName(), resolvGetHostByAddr(), resolvDNExpand(),* resolvDNComp(), resolvSend(), resolvParamsSet(), resolvParamsGet(),* resolvQuery()*/STATUS resolvInit    (    char *     pNameServer,	    /* pointer to Name server IP address */    char *     pDefaultDomainName,  /* default domain name */    FUNCPTR    pdnsDebugRtn         /* function ptr to debug routine */    )    {    int nserv = 0;           /* number of nameserver records read from file */    struct in_addr   ipAddr;    /* Initialize global pointer to the DNS debug routine */    pdnsDebugFunc = (FUNCPTR) NULL;    if (pdnsDebugRtn != NULL)	pdnsDebugFunc = pdnsDebugRtn;    _res.nsaddr.sin_addr.s_addr = INADDR_ANY;    _res.nsaddr.sin_family = AF_INET;    _res.nsaddr.sin_port = htons(NAMESERVER_PORT);    _res.ndots = 1;    _res.pfcode = 0;    strncpy (_res.lookups, "b", sizeof _res.lookups);        if (inet_aton (pNameServer, &ipAddr) == OK) 	{	_res.nsaddr_list [nserv].sin_addr = ipAddr;	_res.nsaddr_list [nserv].sin_family = AF_INET;	_res.nsaddr_list [nserv].sin_port = htons(NAMESERVER_PORT);	nserv++;	}    else	{	/* Illegal IP address for DNS server */	return (ERROR);	}    _res.nscount = nserv;	/* Number of name servers */    _res.dnsrch [0] = _res.defdname;    _res.options |= RES_INIT | RES_DEFNAMES | RES_DEBUG;    (void) strcpy (_res.defdname, pDefaultDomainName);    /* The resolver is initialized to query only the DNS server */    resolvParams.queryOrder = QUERY_DNS_ONLY;    /* Install pointers used by hostLib to access the resolver library */    _presolvHostLibGetByName = resolvHostLibGetByName;    _presolvHostLibGetByAddr = resolvHostLibGetByAddr;    return (OK);    }/********************************************************************************* resolvHostGetByName - queries the static host table for the host name** Retrieve host information installed by hostAdd() and install it in the* `hostent' structure referenced in <pHostEnt>.  This routine uses the * buffer referenced in <pBuf> to store hostname and network address * information.** NOMANUAL** RETURNS: A pointer to hostent, or NULL if the entry was not found.*/LOCAL struct hostent *  resolvHostGetByName     (    char *             pHostName,  /* pointer to the name of the host */    struct hostent *   pHostEnt,   /* ptr to hostent to hold the results */    char *             pBuf,       /* buffer to be used by hostnt */    int                bufLen      /* length of the buffer */    )    {    ALIGN_BUF_PTR (pBuf, bufLen, ALIGNMENT);    *(int*) pBuf =  hostTblSearchByName (pHostName);    if (*(int*)pBuf != ERROR)        {        pHostEnt->h_addr_list [0] = pBuf;        pHostEnt->h_addr_list [1] = NULL;	pHostEnt->h_addrtype = AF_INET;	pHostEnt->h_length = sizeof (int);        pBuf += sizeof (int);        pHostEnt->h_name = pBuf;        strcpy (pBuf, pHostName);        pHostEnt->h_ttl =  LOCAL_ENTRIES_TTL;        return (pHostEnt);        }    return (NULL);    }/********************************************************************************* resolvHostGetByAddr - queries the static host table for the IP address** Retrieve host information installed by hostAdd().  Copies the entry into* the hostent specified by <pHostEnt>, using the buffer specified by <pBuf> and* bufLen for storing hostname and network address info.** NOMANUAL** RETURNS: A pointer to hostent on sucess, or NULL.*/LOCAL struct hostent *  resolvHostGetByAddr     (    const char *       pAddr,    /* pointer to IP address in network order */    struct hostent *   pHostEnt, /* ptr to hostent to hold the results */    char *             pBuf,     /* buffer used by hostent */    int                bufLen    /* length of the buffer */    )    {    ALIGN_BUF_PTR (pBuf, bufLen, ALIGNMENT);    *(int*) pBuf = *(int*)pAddr;    pHostEnt->h_addr_list [0] = pBuf;    pHostEnt->h_addr_list [1] = NULL;    pBuf += 4;    if (hostTblSearchByAddr (*((int *)pAddr), pBuf) != OK)        {        return (NULL);        }    pHostEnt->h_name = pBuf;    pHostEnt->h_aliases [0] = NULL;    pHostEnt->h_ttl =  LOCAL_ENTRIES_TTL;    return (pHostEnt);    }/********************************************************************************* resolvGetHostByName - query the DNS server for the IP address of a host** This function returns a `hostent' structure. This structure is defined as* follows: ** .CS*     struct   hostent *     {*     char *   h_name;          /@ official name of host @/ *     char **  h_aliases;       /@ alias list @/*     int      h_addrtype;      /@ address type @/*     int      h_length;        /@ length of address @/ *     char **  h_addr_list;     /@ list of addresses from name server @/*     unsigned int h_ttl;       /@ Time to Live in Seconds for this entry @/*     }* .CE* The `h_aliases' and `h_addr_type' vectors are NULL-terminated.** Specify the host you want to query in <pHostname>.  Use <pBuf> and <bufLen> * to specify the location and size of a buffer to receive the `hostent' * structure and its associated contents.  Host addresses are returned in * network byte order.  Given the information this routine retrieves, the * <pBuf> buffer should be 512 bytes or larger.** RETURNS: A pointer to a `hostent' structure if the host is found, or * NULL if the parameters are invalid, the host is not found, or the * buffer is too small.** ERRNO:*  S_resolvLib_INVALID_PARAMETER*  S_resolvLib_BUFFER_2_SMALL*  S_resolvLib_TRY_AGAIN*  S_resolvLib_HOST_NOT_FOUND*  S_resolvLib_NO_DATA*  S_resolvLib_NO_RECOVERY* * SEE ALSO:* resolvInit(), resolvGetHostByAddr(), resolvDNExpand(),* resolvDNComp(), resolvSend(), resolvParamsSet(), resolvParamsGet(),* resolvMkQuery(), resolvQuery()*/struct hostent *  resolvGetHostByName    (    char *     pHostName,  /* ptr to the name of  the host */    char *     pHostBuf,   /* ptr to the buffer used by hostent structure */    int        bufLen      /* length of the buffer */     )    {    struct hostent *       pHostEnt;         /* Ptr to host entry */      /* Validate input parameters */    if (pHostName == NULL || pHostBuf == NULL)        {        errnoSet (S_resolvLib_INVALID_PARAMETER);        return (NULL);        }    /* Format input buffer for use as a hostent structure */    pHostEnt = hostEntFormat (&pHostBuf, &bufLen, MAXALIASES, MAXADDRS);    if (pHostEnt == NULL)        {        errno = S_resolvLib_BUFFER_2_SMALL;        return (NULL);        }    /* Check the hostLib static host table first ? */    if (resolvParams.queryOrder == QUERY_LOCAL_FIRST)        {        if (resolvHostGetByName (pHostName, pHostEnt, pHostBuf, bufLen) != NULL)            {            return (pHostEnt);            }        }    /*      * Ask the DNS Server to resolve the query.  In the case of queryOrder set     * to QUERY_ DNS_ONLY, this is the only query done.     */    if (_gethostbyname (pHostName,  pHostEnt, pHostBuf, bufLen))        {        return (pHostEnt);      /* Got an answer from the DNS server */        }    /* We need to check the hostLib static host table next */    if (resolvParams.queryOrder == QUERY_DNS_FIRST)        {        if (resolvHostGetByName (pHostName, pHostEnt, pHostBuf, bufLen) != NULL)            {            return (pHostEnt);            }        }     return (NULL);  /* Host IP Address Not Found */    }/********************************************************************************* resolvGetHostByAddr - query the DNS server for the host name of an IP address** This function returns a `hostent' structure, which is defined as follows:** .CS* struct   hostent *     {*     char *   h_name;            /@ official name of host @/*     char **  h_aliases;         /@ alias list @/*     int      h_addrtype;        /@ address type @/*     int      h_length;          /@ length of address @/*     char **  h_addr_list;       /@ list of addresses from name server @/*     unsigned int h_ttl;         /@ Time to Live in Seconds for this entry @/*     }* .CE* The `h_aliases' and `h_addr_type' vectors are NULL-terminated.** The <pinetAddr> parameter passes in the IP address (in network byte order)* for the host whose name you want to discover.  The <pBuf> and <bufLen> * parameters specify the location and size (512 bytes or more) of the buffer * that is to receive the hostent structure.  resolvGetHostByAddr() returns * host addresses are returned in network byte order. ** RETURNS: A pointer to a `hostent' structure if the host is found, or * NULL if the parameters are invalid, host is not found, or the buffer * is too small.* * ERRNO:*  S_resolvLib_INVALID_PARAMETER*  S_resolvLib_BUFFER_2_SMALL*  S_resolvLib_TRY_AGAIN*  S_resolvLib_HOST_NOT_FOUND*  S_resolvLib_NO_DATA*  S_resolvLib_NO_RECOVERY** SEE ALSO:* resolvGetHostByName(), resolvInit(), resolvDNExpand(),* resolvDNComp(), resolvSend(), resolvParamsSet(), resolvParamsGet(),* resolvMkQuery(), resolvQuery()*/struct hostent *     resolvGetHostByAddr     (    const char *       pInetAddr,

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲激情av在线| 伊人色综合久久天天人手人婷| 久久只精品国产| 久久久午夜电影| 欧美大胆一级视频| 国产精品色哟哟| 亚洲一级电影视频| 九一九一国产精品| 色哟哟国产精品| 欧美成人猛片aaaaaaa| 欧美激情中文不卡| 日韩高清电影一区| 激情成人午夜视频| 色天天综合色天天久久| 精品剧情在线观看| 亚洲免费观看高清| 韩国精品主播一区二区在线观看 | 91精品国产乱码| 成人精品高清在线| 欧美特级限制片免费在线观看| 欧美成人aa大片| 亚洲精品欧美在线| 国产乱妇无码大片在线观看| 欧美三区在线观看| 国产精品麻豆视频| 麻豆极品一区二区三区| 91玉足脚交白嫩脚丫在线播放| 欧美电影免费观看高清完整版在线 | 欧美性大战xxxxx久久久| 精品国产麻豆免费人成网站| 亚洲福利国产精品| 99re免费视频精品全部| 久久蜜臀中文字幕| 免费av网站大全久久| 欧美在线啊v一区| 亚洲欧洲一区二区在线播放| 国产另类ts人妖一区二区| 欧美一区午夜视频在线观看 | 国产精品一区二区三区99| 欧美高清dvd| 国产精品久久久久久久浪潮网站| 日韩主播视频在线| 欧美色欧美亚洲另类二区| 亚洲乱码中文字幕| av一区二区三区四区| 国产无一区二区| 国产精品一区二区视频| 日韩一级免费观看| 图片区小说区区亚洲影院| 欧美性生交片4| 亚洲国产精品一区二区www在线| 97久久超碰精品国产| 一区在线观看免费| 国产精品一区二区免费不卡 | av成人老司机| 亚洲欧美国产三级| 色婷婷亚洲婷婷| 亚洲精品视频在线看| 91色porny在线视频| 国产精品精品国产色婷婷| 91麻豆国产精品久久| 一区二区三区精品| 欧美日韩一卡二卡三卡 | 精品一区二区三区免费视频| 日韩午夜中文字幕| 卡一卡二国产精品| 久久久久久电影| 成人高清在线视频| 亚洲精品v日韩精品| 欧美日韩另类一区| 亚洲激情第一区| 555www色欧美视频| 国产精品2024| 综合分类小说区另类春色亚洲小说欧美| 91麻豆精品国产无毒不卡在线观看| 日本一区二区三区免费乱视频| 国产乱子伦视频一区二区三区 | 久久se这里有精品| 国产三级欧美三级| 色婷婷久久久综合中文字幕| √…a在线天堂一区| 91影院在线观看| 亚洲成人精品在线观看| 日韩欧美一二三| 粉嫩av一区二区三区粉嫩| 一区二区三区小说| 精品久久人人做人人爽| 成人精品电影在线观看| 五月天婷婷综合| 91精品国产乱码久久蜜臀| 日韩极品在线观看| 国产精品久久久久久福利一牛影视| 在线视频国内自拍亚洲视频| 麻豆国产欧美日韩综合精品二区| 欧美国产日产图区| 欧美一区二区三区在线电影| 豆国产96在线|亚洲| 五月激情综合婷婷| 日韩三级视频在线看| 99精品视频一区| 激情图区综合网| 一二三区精品福利视频| 欧美精品一区二| 欧美伊人精品成人久久综合97| 麻豆视频一区二区| 亚洲精品伦理在线| 久久日韩精品一区二区五区| 欧美又粗又大又爽| 日本亚洲免费观看| 国产欧美一区二区精品性| 欧美绝品在线观看成人午夜影视| 高清国产午夜精品久久久久久| 亚洲国产成人porn| 亚洲人成电影网站色mp4| 久久久蜜臀国产一区二区| 欧美日韩国产影片| 风间由美一区二区av101 | 欧美日韩mp4| 91网站在线观看视频| 国内久久精品视频| 亚洲成av人片在线| 玉米视频成人免费看| 国产精品久久久久7777按摩| 2024国产精品| 日韩美女一区二区三区四区| 欧美老年两性高潮| 欧美日韩久久不卡| 91国产免费看| 日本精品一级二级| 国产精品系列在线观看| 麻豆成人综合网| 日韩av一区二区三区四区| 亚洲国产精品一区二区久久恐怖片| 亚洲色图在线看| 亚洲黄色免费电影| 亚洲影视在线观看| 亚洲一区二区三区在线| 亚洲一区二区在线视频| 亚洲国产精品人人做人人爽| 亚洲精品中文在线影院| 中文字幕免费不卡| 中文av一区二区| 国产精品国产三级国产普通话三级| 久久久久久影视| 国产欧美一区二区精品性色超碰 | 国内精品自线一区二区三区视频| 尤物av一区二区| 亚洲午夜在线电影| 日韩国产在线观看一区| 亚洲超碰97人人做人人爱| 日本特黄久久久高潮| 国内成人免费视频| 99国产精品久久久久| 欧美一区二区免费观在线| 欧美国产日韩亚洲一区| 亚洲国产精品人人做人人爽| 国产一区二区主播在线| 欧美日韩中文字幕精品| 久久久久国产精品人| 亚洲国产欧美一区二区三区丁香婷| 国产一区二区三区| 欧美日韩精品综合在线| 国产精品美女久久福利网站| 免费观看成人鲁鲁鲁鲁鲁视频| av在线免费不卡| 久久久99精品久久| 日韩av中文字幕一区二区三区| 91亚洲资源网| 精品毛片乱码1区2区3区| 亚洲午夜av在线| 91免费看片在线观看| 欧美成人一区二区三区在线观看 | 精品国产第一区二区三区观看体验| 最近日韩中文字幕| 国产成人在线看| 欧美电视剧在线观看完整版| 亚洲影院在线观看| 色婷婷精品久久二区二区蜜臂av| 久久精品人人做人人爽人人| 日韩av一区二| 欧美日韩三级在线| 亚洲综合视频在线| 色婷婷亚洲一区二区三区| 国产精品二三区| 成人黄页毛片网站| 国产三级欧美三级日产三级99| 久久国产精品一区二区| 91精品国产91综合久久蜜臀| 亚洲va欧美va天堂v国产综合| 91美女视频网站| 综合久久久久久| 成人性生交大片免费看在线播放| 久久久久高清精品| 国精品**一区二区三区在线蜜桃| 欧美一区二区三区播放老司机| 亚洲v中文字幕| 在线播放91灌醉迷j高跟美女 | 国产精品国产三级国产普通话99| 国产麻豆精品在线| 国产欧美va欧美不卡在线|