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

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

?? resolvlib.c

?? vxworks的源代碼
?? C
?? 第 1 頁 / 共 2 頁
字號:
    char *             pHostBuf,    int                bufLen    )    {    struct hostent *       pHostEnt;         /* Ptr to host entry */    if (pInetAddr == 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 (resolvHostGetByAddr (pInetAddr, 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 (_gethostbyaddr (pInetAddr, 4, AF_INET, 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 (resolvHostGetByAddr (pInetAddr, pHostEnt, pHostBuf, bufLen) != NULL)            {            return (pHostEnt);            }        }    return (NULL);             /* Host Name Not found */    }/********************************************************************************* resolvParamsSet - set the parameters which control the resolver library** This routine sets the resolver parameters.  <pResolvParams> passes in* a pointer to a RESOLV_PARAMS_S structure, which is defined as follows: * .CS*     typedef struct*        {*        char   queryOrder;*        char   domainName [MAXDNAME];*        char   nameServersAddr [MAXNS][MAXIPADDRLEN];*        } RESOLV_PARAMS_S;* .CE* Use the members of this structure to specify the settings you want to * apply to the resolver.  It is important to remember that multiple tasks * can use the resolver library and that the settings specified in * this RESOLV_PARAMS_S structure affect all queries from all tasks.  In * addition, you should set resolver parameters at initialization and not * while queries could be in progress. Otherwise, the results of the query * are unpredictable.  ** Before calling resolvParamsSet(), you should first call resolvParamsGet() * to populate a RESOLV_PARAMS_S structure with the current settings.  Then* you change the values of the members that interest you.    ** Valid values for the `queryOrder' member of RESOLV_PARAMS_S structure * are defined in resolvLib.h.  Set the `domainName' member to the domain to * which this resolver belongs.  Set the `nameServersAddr' member to the IP * addresses of the DNS server that the resolver can query.  You must specify * the IP addresses in standard dotted decimal notation.  This function tries * to validate the values in the `queryOrder' and `nameServerAddr' members.  * This function does not try to validate the domain name.  ** RETURNS: OK if the parameters are valid, ERROR otherwise.** SEE ALSO:* resolvGetHostByName(), resolvGetHostByAddr(), resolvDNExpand(),* resolvDNComp(), resolvSend(), resolvInit(), resolvParamsGet(),* resolvMkQuery(), resolvQuery()*/STATUS resolvParamsSet     (    RESOLV_PARAMS_S *  pResolvParams  /* ptr to resolver parameter struct */    )    {    struct in_addr   ipAddr;    int               index;   /* Validate queryOrder parameters */   if (pResolvParams->queryOrder != QUERY_LOCAL_FIRST &&        pResolvParams->queryOrder != QUERY_DNS_FIRST &&       pResolvParams->queryOrder != QUERY_DNS_ONLY)       return (ERROR);    /* Validate IP addresses */    for (index = 0 ; (index < MAXNS) && 	 (pResolvParams->nameServersAddr [index][0] != '\0'); index++)	{	if (inet_aton (pResolvParams->nameServersAddr [index], &ipAddr) != OK)		return(ERROR);	}    /* Update queryOrder parameter */    resolvParams.queryOrder = pResolvParams->queryOrder;    /* Update the name server IP addresses in decimal dot notation */    for (index = 0, _res.nscount = 0; (index < MAXNS) && 	 (pResolvParams->nameServersAddr [index][0] != '\0'); index++)	{		(void) inet_aton (pResolvParams->nameServersAddr [index], &ipAddr);	/* update the resolver server entry */	_res.nsaddr_list [index].sin_addr = ipAddr;	_res.nsaddr_list [index].sin_family = AF_INET;	_res.nsaddr_list [index].sin_port = htons(NAMESERVER_PORT);        _res.lookups [index] = 'b';        _res.nscount++;  /* Number of DNS servers to query */	}    _res.lookups [index] = 'f';    /* Update domain name; Assume a valid domain name */    (void) strcpy (_res.defdname, pResolvParams->domainName);    return (OK);    }/********************************************************************************* resolvParamsGet - get the parameters which control the resolver library** This routine copies the resolver parameters to the RESOLV_PARAMS_S* structure referenced in the <pResolvParms> parameter.  The RESOLV_PARAMS_S* structure is defined in resolvLib.h as follows: * .CS*     typedef struct*        {*        char   queryOrder;*        char   domainName [MAXDNAME];*        char   nameServersAddr [MAXNS][MAXIPADDRLEN];*        } RESOLV_PARAMS_S;* .CE* Typically, you call this function just before calling resolvParamsSet().* The resolvParamsGet() call populates the RESOLV_PARAMS_S structure. * You can then modify the default values just before calling * resolvParamsSet().  ** RETURNS: N/A** SEE ALSO:* resolvGetHostByName(), resolvGetHostByAddr(), resolvDNExpand(),* resolvDNComp(), resolvSend(), resolvParamsSet(), resolvInit(),* resolvMkQuery(), resolvQuery()*/void resolvParamsGet     (    RESOLV_PARAMS_S *     pResolvParams  /* ptr to resolver parameter struct */    )    {    int index;    pResolvParams->queryOrder = resolvParams.queryOrder;    (void) strcpy (pResolvParams->domainName, _res.defdname);        /* Copy the name server IP addresses in decimal dot notation */     for ( index = 0 ; index < MAXNS ; index++)	{ 	if (index < _res.nscount)	    {	    inet_ntoa_b (_res.nsaddr_list [index].sin_addr,			 pResolvParams->nameServersAddr [index]);	    }	else	    {	    pResolvParams->nameServersAddr [index][0] = 0;	    }	}    }/********************************************************************************* resolvHostLibGetByName - query the DNS server in behalf of hostGetByName** When the resolver library is installed, the routine hostGetByName() in the * hostLib library invokes this routine.  When the host name is not found by* hostGetByName in the static host table.  This feature allows existing * applications to take advantage of the resolver without any changes.** NOMANUAL** ERRNO:*  S_resolvLib_TRY_AGAIN*  S_resolvLib_HOST_NOT_FOUND*  S_resolvLib_NO_DATA*  S_resolvLib_NO_RECOVERY** RETURNS: IP address of host, or ERROR if the host was not found.*/LOCAL int resolvHostLibGetByName     (    char * pHostName       /* Pointer to host name */    )    {    char reqBuf [MAX_HOSTLIB_BUF];	       /* Holding buffer  */    char *     pHostBuf;    int        bufLen;    struct hostent *       pHostEnt;           /* Ptr to host entry */    /* Try to get the answer from the DNS Server */    pHostBuf = reqBuf;    bufLen   = sizeof(reqBuf);    pHostEnt = hostEntFormat (& pHostBuf, & bufLen, MAXALIASES, MAXADDRS);    pHostEnt = _gethostbyname (pHostName, pHostEnt, pHostBuf, bufLen);    if (pHostEnt != NULL)	{	return (*(int *)(pHostEnt->h_addr_list [0])); /* Host IP address */	}    return (ERROR);  /* Host IP address not found ! */    }/********************************************************************************* resolvHostLibGetByAddr - query the DNS server in behalf of hostGetByAddr()** When the resolver library is installed the routine hostGetByAddr() in the * hostLib library invokes this routine.  When the IP address is not found by* hostGetByAddr() in the static host table.  This feature allows existing * applications to take advantage of the resolver without any changes.  The* <addr> paramter specifies the IP address and <pHostName> points to the* official name of the host when the query is successful.** NOMANUAL** ERRNO:*  S_resolvLib_TRY_AGAIN*  S_resolvLib_HOST_NOT_FOUND*  S_resolvLib_NO_DATA*  S_resolvLib_NO_RECOVERY** RETURNS: OK, or ERROR if the host name was not found.*/LOCAL STATUS resolvHostLibGetByAddr    (    int   addr,			/* IP address of requested host name */    char * pHostName		/* host name output by this routine */    )    {    char reqBuf [MAX_HOSTLIB_BUF];	       /* Holding buffer  */    char *     pHostBuf;    int        bufLen;    struct hostent *       pHostEnt;           /* Ptr to host entry */    /* Try to get the answer from the DNS Server */    pHostBuf = reqBuf;    bufLen   = sizeof(reqBuf);    pHostEnt = hostEntFormat (& pHostBuf, & bufLen, MAXALIASES, MAXADDRS);    pHostEnt = _gethostbyaddr ((char *)&addr, 4, AF_INET, pHostEnt, 			       pHostBuf, bufLen);    if (pHostEnt != NULL)	{        strcpy (pHostName, pHostEnt->h_name);  /* Copy the host official name */	return (OK);	}    return (ERROR);    }/********************************************************************************* resolvDNExpand - expand a DNS compressed name from a DNS packet** This functions expands a compressed DNS name from a DNS packet.  The <msg>* parameter points to that start of the DNS packet.  The <eomorig> parameter* points to the last location of the DNS packet plus 1.  The <comp_dn> * parameter points to the compress domain name, and <exp_dn> parameter * expects a pointer to a buffer.  Upon function completion, this buffer * contains the expanded domain name.  Use the <length> parameter to pass in* the size of the buffer referenced by the <exp_dn> parameter.  ** RETURNS: The length of the expanded domain name, or ERROR on failure.** SEE ALSO:* resolvGetHostByName(), resolvGetHostByAddr(), resolvInit(),* resolvDNComp(), resolvSend(), resolvParamsSet(), resolvParamsGet(),* resolvMkQuery(), resolvQuery()*/int resolvDNExpand     (    const u_char * msg,     /* ptr to the start of the DNS packet */    const u_char * eomorig, /* ptr to the last location +1 of the DNS packet */    const u_char * comp_dn, /* ptr to the compressed domain name */          u_char * exp_dn,  /* ptr to where the expanded DN is output */          int      length   /* length of the buffer pointed by <expd_dn> */    );/********************************************************************************* resolvDNComp - compress a DNS name in a DNS packet** This routine takes the expanded domain name referenced in the <exp_dn> * parameter, compresses it, and stores the compressed name in the location* pointed to by the <comp_dn> parameter.  The <length> parameter passes in * the length of the buffer starting at <comp_dn>.  The <dnptrs> parameter * is a pointer to a list of pointers to previously compressed names.  The * <lastdnptr> parameter points to the last entry in the <dnptrs> array.** RETURNS: The size of the compressed name, or ERROR.** SEE ALSO:* resolvGetHostByName(), resolvGetHostByAddr(), resolvDNExpand(),* resolvInit(), resolvSend(), resolvParamsSet(), resolvParamsGet(),* resolvMkQuery(), resolvQuery()*/int resolvDNComp     (    const u_char *  exp_dn,   /* ptr to the expanded domain name */          u_char *  comp_dn,  /* ptr to where to output the compressed name */            int       length,   /* length of the buffer pointed by <comp_dn> */          u_char ** dnptrs,   /* ptr to a ptr list of compressed names */           u_char ** lastdnptr /* ptr to the last entry pointed by <dnptrs> */      );/********************************************************************************* resolvQuery - construct a query, send it, wait for a response** This routine constructs a query for the domain specified in the <name> * parameter.  The <class> parameter specifies the class of the query. * The <type> parameter specifies the type of query. The routine then sends* the query to the DNS server.  When the server responds, the response is * validated and copied to the buffer you supplied in the <answer> parameter.* Use the <anslen> parameter to pass in the size of the buffer referenced* in <answer>.** RETURNS: The length of the response or ERROR.** ERRNO:*  S_resolvLib_TRY_AGAIN*  S_resolvLib_HOST_NOT_FOUND*  S_resolvLib_NO_DATA*  S_resolvLib_NO_RECOVERY** SEE ALSO:* resolvGetHostByName(), resolvGetHostByAddr(), resolvDNExpand(),* resolvDNComp(), resolvInit(), resolvParamsSet(), resolvParamsGet(),* resolvMkQuery()*/int resolvQuery     (    char   *name,       /* domain name */    int    class,       /* query class for IP is C_IN */    int    type,        /* type is T_A, T_PTR, ... */    u_char *answer,     /* buffer to put answer */    int    anslen       /* length of answer buffer */    );/********************************************************************************* resolvMkQuery - create all types of DNS queries** This routine uses the input parameters to create a domain name query.* You can set the <op> parameter to QUERY or IQUERY.  Specify the domain * name in <dname>, the class in <class>, the query type in <type>.  Valid* values for type include T_A, T_PTR, and so on.  Use <data> to add Resource * Record data to the query.  Use <datalen> to pass in the length of the * data buffer.  Set <newrr_in> to NULL.  This parameter is reserved for * future use.  The <buf> parameter expects a pointer to the output buffer * for the constructed query.  Use <buflen> to pass in the length of the * buffer referenced in <buf>.** RETURNS: The length of the constructed query or ERROR.** SEE ALSO:* resolvGetHostByName(), resolvGetHostByAddr(), resolvDNExpand(),* resolvDNComp(), resolvSend(), resolvParamsSet(), resolvParamsGet(),* resolvInit(), resolvQuery()*/int resolvMkQuery     (          int     op,	       /* set to desire query QUERY or IQUERY */    const char *  dname,       /* domain name to be use in the query */    int           class,       /* query class for IP is C_IN */    int           type,        /* type is T_A, T_PTR, ... */    const char *  data,        /* resource Record (RR) data */    int           datalen,     /* length of the RR */    const char *  newrr_in,    /* not used always set to NULL */          char *  buf,         /* out of the constructed query */          int     buflen       /* length of the buffer for the query */    );/********************************************************************************* resolvSend - send a pre-formatted query and return the answer** This routine takes a pre-formatted DNS query and sends it to the domain* server.  Use <buf> to pass in a pointer to the query.  Use <buflen> to * pass in the size of the buffer referenced in <buf>.  The <answer> parameter* expects a pointer to a buffer into which this routine can write the * answer retrieved from the server.  Use <anslen> to pass in the size of* the buffer you have provided in <anslen>.** RETURNS: The length of the response or ERROR.** ERRNO:*  S_resolvLib_TRY_AGAIN*  ECONNREFUSE*  ETIMEDOU** SEE ALSO:* resolvGetHostByName(), resolvGetHostByAddr(), resolvDNExpand(),* resolvDNComp(), resolvInit(), resolvParamsSet(), resolvParamsGet(),* resolvMkQuery(), resolvQuery()*/int resolvSend     (    const char * buf,		/* pre-formatted query */          int    buflen,	/* length of query */          char * answer,	/* buffer for answer */          int    anslen		/* length of answer */    );

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美偷拍一区二区| 26uuu国产在线精品一区二区| 欧美日韩免费观看一区二区三区 | 一区二区三区小说| 久久 天天综合| 欧美色精品天天在线观看视频| 久久久综合视频| 亚洲成国产人片在线观看| 国产成人在线视频播放| 日韩视频一区二区三区| 一区二区三区在线观看国产| 夫妻av一区二区| www激情久久| 久久精品久久综合| 欧美老肥妇做.爰bbww视频| 亚洲视频资源在线| 成人动漫av在线| 国产亚洲视频系列| 精品一区精品二区高清| 91精品国产综合久久小美女| 亚洲一区二区三区视频在线| 99麻豆久久久国产精品免费优播| 久久久99精品免费观看不卡| 九九国产精品视频| 欧美一区二区高清| 青青草伊人久久| 日韩一区二区电影| 日韩激情视频在线观看| 欧美老女人第四色| 午夜精品免费在线观看| 欧美日韩国产高清一区| 亚洲成人免费在线观看| 欧美三级欧美一级| 亚洲成人av在线电影| 欧美日韩在线观看一区二区| 亚洲网友自拍偷拍| 欧美精品视频www在线观看| 午夜精品爽啪视频| 日韩欧美国产电影| 久久成人久久鬼色| 国产午夜精品福利| 成人看片黄a免费看在线| 中文字幕中文字幕在线一区| 94-欧美-setu| 一区二区在线观看视频在线观看| 91黄色免费版| 天堂va蜜桃一区二区三区| 日韩片之四级片| 国产精品538一区二区在线| 中文字幕中文字幕在线一区| 在线欧美小视频| 男男成人高潮片免费网站| 精品国产网站在线观看| 成人h动漫精品| 黑人精品欧美一区二区蜜桃| 国产欧美视频一区二区| 色综合久久久久久久久| 日韩中文字幕区一区有砖一区| 欧美xingq一区二区| 成人精品一区二区三区四区 | 日韩精品中文字幕在线不卡尤物 | 久久综合狠狠综合久久综合88 | 亚洲国产精品t66y| 91麻豆国产福利精品| 视频一区视频二区在线观看| 国产午夜亚洲精品午夜鲁丝片| 成人激情小说乱人伦| 日韩经典一区二区| 国产精品家庭影院| 欧美一区二区三区性视频| 成人丝袜视频网| 午夜影院在线观看欧美| 欧美极品xxx| 制服丝袜亚洲播放| 91免费观看视频在线| 久久国产精品一区二区| 亚洲人吸女人奶水| 久久久久久99精品| 欧美精品丝袜久久久中文字幕| 国产福利不卡视频| 青青青爽久久午夜综合久久午夜| 亚洲欧洲精品天堂一级| 精品国产凹凸成av人网站| 欧美亚洲动漫精品| 国产 欧美在线| 精品一区二区久久久| 亚洲国产综合色| 国产精品久久久久久久久晋中 | 在线精品视频小说1| 国产成人8x视频一区二区| 日韩vs国产vs欧美| 亚洲一区在线电影| 1区2区3区精品视频| 久久精品日产第一区二区三区高清版 | 91视频观看视频| 国产乱码精品一区二区三区av| 日韩精品电影在线| 亚洲一区二区三区三| 亚洲你懂的在线视频| 日本一区二区不卡视频| 精品少妇一区二区三区免费观看| 欧美日韩dvd在线观看| 色综合久久综合| 一本一道波多野结衣一区二区 | 琪琪久久久久日韩精品| 午夜精品一区二区三区电影天堂| 亚洲欧美另类图片小说| 国产精品久久99| 国产精品第13页| 成人免费在线视频观看| 国产精品美女久久久久高潮| 欧美激情一区二区三区不卡| 国产亚洲精品久| 欧美国产日韩a欧美在线观看| 国产日韩欧美一区二区三区综合| 26uuu国产日韩综合| 久久综合成人精品亚洲另类欧美| 欧美成人r级一区二区三区| 日韩欧美一区二区久久婷婷| 日韩欧美中文一区| 精品第一国产综合精品aⅴ| 日韩欧美一区在线| 亚洲精品在线观看视频| 国产日本亚洲高清| 国产精品久久久久久久久久免费看| 国产精品久久久一区麻豆最新章节| 国产精品天干天干在观线| 中文字幕一区二区在线播放| 亚洲日本在线视频观看| 一区二区欧美精品| 青青草一区二区三区| 国产一区二三区好的| 成人av在线影院| 欧美色视频一区| 欧美r级在线观看| 国产精品免费人成网站| 亚洲一区av在线| 免费久久99精品国产| 国产精品影视在线| 97精品久久久久中文字幕| 欧美在线看片a免费观看| 日韩视频永久免费| 国产精品国产三级国产aⅴ原创| 亚洲综合久久久久| 狠狠色狠狠色综合| 在线一区二区观看| 精品少妇一区二区三区免费观看| 国产精品久久久久久久久免费桃花 | 91亚洲大成网污www| 91精品国产色综合久久不卡蜜臀| 久久理论电影网| 一区二区三区免费| 精品一区二区三区蜜桃| 在线视频中文字幕一区二区| 日韩一级二级三级| 亚洲色图在线播放| 激情五月激情综合网| 欧美在线观看视频一区二区| 久久女同精品一区二区| 午夜亚洲福利老司机| 高清成人免费视频| 91精品国产色综合久久ai换脸 | 亚洲精品在线网站| 夜色激情一区二区| 国产精品一级黄| 制服视频三区第一页精品| 国产欧美日韩精品在线| 日本vs亚洲vs韩国一区三区二区 | 国产精品99精品久久免费| 欧美三级在线视频| 亚洲色图欧美激情| 国产米奇在线777精品观看| 欧美日韩一区二区三区在线看| 国产日韩精品一区二区三区 | 欧美aaaaa成人免费观看视频| 99久久精品费精品国产一区二区| 日韩一级欧美一级| 午夜精品成人在线| 在线观看三级视频欧美| 国产精品久久久久久久久搜平片 | 午夜久久久久久久久久一区二区| 99久久久久久| 国产精品久久久久四虎| 国产一区二区三区免费观看| 欧美一区二区黄| 日韩av电影一区| 欧美日本一道本在线视频| 一区二区视频在线| 91在线国产观看| 日韩理论片中文av| 99re在线视频这里只有精品| 国产亚洲精品福利| 国产成人精品免费视频网站| 亚洲精品在线观看视频| 精品亚洲国内自在自线福利| 精品日韩成人av| 激情综合色播激情啊| 久久久久久久久久久电影| 国产一二三精品| 中文字幕精品—区二区四季|