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

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

?? resolvlib.c

?? vxwork源代碼
?? 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一区二区三区免费野_久草精品视频
波多野结衣亚洲一区| 欧美在线观看视频一区二区三区 | 国产香蕉久久精品综合网| 91首页免费视频| 精品一区二区三区不卡| 一区二区在线观看视频| 久久精品男人的天堂| 91麻豆精品91久久久久久清纯 | 欧美精品电影在线播放| 成人一二三区视频| 蜜臀91精品一区二区三区 | 欧美影院一区二区三区| 狠狠色丁香久久婷婷综合_中 | 毛片av一区二区| 一区二区高清在线| 久久精品欧美日韩| 欧美v日韩v国产v| 欧美日韩一区国产| 色先锋资源久久综合| 国产凹凸在线观看一区二区| 美女视频一区二区| 性感美女久久精品| 亚洲激情第一区| 综合久久国产九一剧情麻豆| 国产欧美日韩综合精品一区二区| 日韩一区和二区| 欧美视频一区二区| 欧美在线观看一区二区| 91国在线观看| 在线观看亚洲成人| 在线观看视频欧美| 91小视频免费看| 色综合天天狠狠| 91老师国产黑色丝袜在线| 高清国产午夜精品久久久久久| 精品一区二区在线播放| 奇米色一区二区| 青娱乐精品视频在线| 日韩一区欧美二区| 国产精品911| 欧美视频在线播放| 亚洲成人自拍一区| 亚洲宅男天堂在线观看无病毒| 综合久久给合久久狠狠狠97色| 国产精品久久久久久久久久免费看| 日韩成人精品在线观看| 亚洲欧洲精品一区二区三区 | 精品乱人伦小说| 91美女蜜桃在线| 国产精品一区专区| 日韩在线播放一区二区| 亚洲黄色录像片| 国产欧美一区二区在线| 日韩精品一区二区在线| 欧美手机在线视频| 91啦中文在线观看| zzijzzij亚洲日本少妇熟睡| 久久er精品视频| 性久久久久久久| 亚洲一级电影视频| 亚洲免费观看高清完整版在线观看| 久久婷婷国产综合精品青草 | 粉嫩av一区二区三区粉嫩| 青青草精品视频| 亚洲成av人片一区二区三区| 专区另类欧美日韩| 国产精品污www在线观看| 久久网站热最新地址| 欧美videossexotv100| 欧美一区二区啪啪| 91精品一区二区三区久久久久久 | 亚洲欧洲日本在线| 国产精品久久久久久久岛一牛影视 | 色女孩综合影院| 91在线视频免费观看| 国产69精品一区二区亚洲孕妇| 国产一区激情在线| 韩国av一区二区三区| 国产乱码精品一区二区三区av| 九九在线精品视频| 国产一区二区导航在线播放| 国产一区二区三区四区五区美女 | 精品国产一区二区三区四区四 | 国产成人精品亚洲日本在线桃色| 经典三级一区二区| 国产成人精品综合在线观看| 国产精品1区二区.| 成人精品视频一区二区三区尤物| 国产成a人亚洲| 成人免费毛片a| 91免费视频网址| 欧美色网一区二区| 91精选在线观看| 精品国产乱码久久久久久免费| 久久亚洲精精品中文字幕早川悠里 | 色天天综合久久久久综合片| 欧洲av在线精品| 欧美人成免费网站| 欧美不卡123| 国产喷白浆一区二区三区| 亚洲欧洲色图综合| 亚洲一级二级在线| 看片网站欧美日韩| 成人性生交大合| 欧美日韩免费一区二区三区视频| 91精品国产丝袜白色高跟鞋| 久久一日本道色综合| 成人免费一区二区三区在线观看| 亚洲国产视频一区| 麻豆91在线观看| 暴力调教一区二区三区| 在线观看成人免费视频| 精品三级在线观看| 亚洲欧美欧美一区二区三区| 日本 国产 欧美色综合| 国产福利电影一区二区三区| 色综合天天综合狠狠| 欧美一区二区三区免费观看视频 | 麻豆精品在线观看| 99久久精品国产导航| 欧美精品在线观看播放| 国产欧美日韩在线观看| 性久久久久久久久久久久| 国产69精品久久久久毛片| 欧美日韩和欧美的一区二区| 久久久蜜臀国产一区二区| 一区二区三区日韩在线观看| 狂野欧美性猛交blacked| 色成年激情久久综合| 2020日本不卡一区二区视频| 一区二区在线看| 成人午夜伦理影院| 日韩免费视频线观看| 亚洲精品成人天堂一二三| 黄色日韩网站视频| 欧美人与z0zoxxxx视频| 日韩美女啊v在线免费观看| 久久成人精品无人区| 欧美在线一二三四区| 国产精品私人影院| 国产原创一区二区三区| 欧美日本精品一区二区三区| 中文字幕永久在线不卡| 狠狠久久亚洲欧美| 91精品福利在线一区二区三区 | 国产精品国产三级国产专播品爱网 | 久久久精品免费免费| 日韩中文字幕一区二区三区| 色综合久久六月婷婷中文字幕| 久久久国际精品| 激情久久久久久久久久久久久久久久 | 三级在线观看一区二区 | 欧美日韩亚洲国产综合| 中文字幕亚洲视频| 国产激情视频一区二区三区欧美| 日韩一级黄色片| 日韩不卡免费视频| 欧美日韩国产不卡| 亚洲国产精品久久久男人的天堂| 91视频在线看| |精品福利一区二区三区| 福利电影一区二区| 国产偷国产偷亚洲高清人白洁| 久久国产视频网| 精品区一区二区| 久久成人精品无人区| 久久一二三国产| 国产成人亚洲综合a∨婷婷图片 | 日韩美女在线视频| 青草国产精品久久久久久| 777a∨成人精品桃花网| 免费成人在线网站| 精品理论电影在线| 国产一区二区伦理片| 欧美激情综合五月色丁香小说| 国产成人免费视频一区| 国产欧美视频在线观看| 91亚洲国产成人精品一区二三| 亚洲免费成人av| 欧美精品日日鲁夜夜添| 日韩—二三区免费观看av| 精品剧情v国产在线观看在线| 韩国女主播一区| 国产精品午夜在线观看| 91网站最新地址| 午夜欧美在线一二页| 日韩欧美国产一区二区三区| 韩国精品久久久| 国产精品欧美久久久久无广告 | 欧美日本乱大交xxxxx| 麻豆91在线看| 国产精品久久久久久久岛一牛影视| 在线亚洲免费视频| 日韩高清不卡一区二区三区| 精品国产乱码久久久久久久久| 粗大黑人巨茎大战欧美成人| 亚洲永久免费视频| 欧美videos大乳护士334| 99re成人精品视频| 日韩精品欧美成人高清一区二区|