⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 lwres_resutil.3

📁 bind 9.3结合mysql数据库
💻 3
字号:
.\" Copyright (C) 2004  Internet Systems Consortium, Inc. ("ISC").\" Copyright (C) 2000, 2001  Internet Software Consortium..\".\" Permission to use, copy, modify, and distribute this software for any.\" purpose with or without fee is hereby granted, provided that the above.\" copyright notice and this permission notice appear in all copies..\".\" THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH.\" REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY.\" AND FITNESS.  IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,.\" INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM.\" LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE.\" OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR.\" PERFORMANCE OF THIS SOFTWARE..\".\" $Id: lwres_resutil.3,v 1.14.2.1.8.1 2004/03/06 07:41:44 marka Exp $.\".TH "LWRES_RESUTIL" "3" "Jun 30, 2000" "BIND9" "".SH NAMElwres_string_parse, lwres_addr_parse, lwres_getaddrsbyname, lwres_getnamebyaddr \- lightweight resolver utility functions.SH SYNOPSIS\fB#include <lwres/lwres.h>.sp.nalwres_result_tlwres_string_parse(lwres_buffer_t *b, char **c, lwres_uint16_t *len);.ad.sp.nalwres_result_tlwres_addr_parse(lwres_buffer_t *b, lwres_addr_t *addr);.ad.sp.nalwres_result_tlwres_getaddrsbyname(lwres_context_t *ctx, const char *name, lwres_uint32_t addrtypes, lwres_gabnresponse_t **structp);.ad.sp.nalwres_result_tlwres_getnamebyaddr(lwres_context_t *ctx, lwres_uint32_t addrtype, lwres_uint16_t addrlen, const unsigned char *addr, lwres_gnbaresponse_t **structp);.ad\fR.SH "DESCRIPTION".PP\fBlwres_string_parse()\fR retrieves a DNS-encodedstring starting the current pointer of lightweight resolver buffer\fIb\fR: i.e. b->current.When the function returns, the address of the first byte of theencoded string is returned via \fI*c\fR and thelength of that string is given by \fI*len\fR. Thebuffer's current pointer is advanced to point at the characterfollowing the string length, the encoded string, and the trailing\fBNULL\fR character..PP\fBlwres_addr_parse()\fR extracts an address from thebuffer \fIb\fR. The buffer's current pointerb->current is presumed to point at an encodedaddress: the address preceded by a 32-bit protocol family identifierand a 16-bit length field. The encoded address is copied toaddr->address andaddr->length indicates the size in bytes ofthe address that was copied. b->current isadvanced to point at the next byte of available data in the bufferfollowing the encoded address..PP\fBlwres_getaddrsbyname()\fRand\fBlwres_getnamebyaddr()\fRuse the\fBlwres_gnbaresponse_t\fRstructure defined below:.sp.nftypedef struct {        lwres_uint32_t          flags;        lwres_uint16_t          naliases;        lwres_uint16_t          naddrs;        char                   *realname;        char                  **aliases;        lwres_uint16_t          realnamelen;        lwres_uint16_t         *aliaslen;        lwres_addrlist_t        addrs;        void                   *base;        size_t                  baselen;} lwres_gabnresponse_t;.sp.fiThe contents of this structure are not manipulated directly butthey are controlled through the\fBlwres_gabn\fR(3)functions..PPThe lightweight resolver uses\fBlwres_getaddrsbyname()\fR to perform foward lookups.Hostname \fIname\fR is looked up using the resolvercontext \fIctx\fR for memory allocation.\fIaddrtypes\fR is a bitmask indicating which type ofaddresses are to be looked up. Current values for this bitmask are\fBLWRES_ADDRTYPE_V4\fR for IPv4 addresses and\fBLWRES_ADDRTYPE_V6\fR for IPv6 addresses. Results of thelookup are returned in \fI*structp\fR..PP\fBlwres_getnamebyaddr()\fR performs reverse lookups.Resolver context \fIctx\fR is used for memoryallocation. The address type is indicated by\fIaddrtype\fR: \fBLWRES_ADDRTYPE_V4\fR or\fBLWRES_ADDRTYPE_V6\fR. The address to be looked up is givenby \fIaddr\fR and its length is\fIaddrlen\fR bytes. The result of the function callis made available through \fI*structp\fR..SH "RETURN VALUES".PPSuccessful calls to\fBlwres_string_parse()\fRand\fBlwres_addr_parse()\fRreturnLWRES_R_SUCCESS.Both functions returnLWRES_R_FAILUREif the buffer is corrupt orLWRES_R_UNEXPECTEDENDif the buffer has less space than expected for the components of theencoded string or address..PP\fBlwres_getaddrsbyname()\fRreturnsLWRES_R_SUCCESSon success and it returnsLWRES_R_NOTFOUNDif the hostname\fIname\fRcould not be found..PPLWRES_R_SUCCESSis returned by a successful call to\fBlwres_getnamebyaddr()\fR..PPBoth\fBlwres_getaddrsbyname()\fRand\fBlwres_getnamebyaddr()\fRreturnLWRES_R_NOMEMORYwhen memory allocation requests fail andLWRES_R_UNEXPECTEDENDif the buffers used for sending queries and receiving replies are toosmall..SH "SEE ALSO".PP\fBlwres_buffer\fR(3),\fBlwres_gabn\fR(3).

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -