File manager - Edit - /home/sarjilsh/cityfoodcenter.co.uk/bind9.zip
Back
PK `�]�J�R lwres/net.hnu �[��� /* * Copyright (C) Internet Systems Consortium, Inc. ("ISC") * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, you can obtain one at https://mozilla.org/MPL/2.0/. * * See the COPYRIGHT file distributed with this work for additional * information regarding copyright ownership. */ #ifndef LWRES_NET_H #define LWRES_NET_H 1 /***** ***** Module Info *****/ /*! \file net.h * This module is responsible for defining the following basic networking * types: * *\li struct in_addr *\li struct in6_addr *\li struct sockaddr *\li struct sockaddr_in *\li struct sockaddr_in6 * * It ensures that the AF_ and PF_ macros are defined. * * It declares ntoh[sl]() and hton[sl](). * * It declares lwres_net_aton(), lwres_net_ntop(), and lwres_net_pton(). * * It ensures that #INADDR_LOOPBACK, #INADDR_ANY and #IN6ADDR_ANY_INIT * are defined. */ /*** *** Imports. ***/ #include <lwres/platform.h> /* Required for LWRES_PLATFORM_*. */ #include <unistd.h> #include <sys/types.h> #include <sys/socket.h> /* Contractual promise. */ #include <sys/ioctl.h> #include <sys/time.h> #include <sys/un.h> #include <netinet/in.h> /* Contractual promise. */ #include <arpa/inet.h> /* Contractual promise. */ #ifdef LWRES_PLATFORM_NEEDNETINETIN6H #include <netinet/in6.h> /* Required on UnixWare. */ #endif #ifdef LWRES_PLATFORM_NEEDNETINET6IN6H #include <netinet6/in6.h> /* Required on BSD/OS for in6_pktinfo. */ #endif #include <net/if.h> #include <lwres/lang.h> #ifndef LWRES_PLATFORM_HAVEIPV6 #include <lwres/ipv6.h> /* Contractual promise. */ #endif #ifdef LWRES_PLATFORM_HAVEINADDR6 #define in6_addr in_addr6 /* Required for pre RFC2133 implementations. */ #endif /*! * Required for some pre RFC2133 implementations. * IN6ADDR_ANY_INIT and IN6ADDR_LOOPBACK_INIT were added in * draft-ietf-ipngwg-bsd-api-04.txt or draft-ietf-ipngwg-bsd-api-05.txt. * If 's6_addr' is defined then assume that there is a union and three * levels otherwise assume two levels required. */ #ifndef IN6ADDR_ANY_INIT #ifdef s6_addr #define IN6ADDR_ANY_INIT { { { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 } } } #else #define IN6ADDR_ANY_INIT { { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 } } #endif #endif /*! * Initialize address loopback. See IN6ADDR_ANY_INIT */ #ifndef IN6ADDR_LOOPBACK_INIT #ifdef s6_addr #define IN6ADDR_LOOPBACK_INIT { { { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1 } } } #else #define IN6ADDR_LOOPBACK_INIT { { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1 } } #endif #endif /*% Used by AI_ALL */ #ifndef AF_INET6 #define AF_INET6 99 #endif /*% Used to return IPV6 address types. */ #ifndef PF_INET6 #define PF_INET6 AF_INET6 #endif /*% inaddr Loopback */ #ifndef INADDR_LOOPBACK #define INADDR_LOOPBACK 0x7f000001UL #endif LWRES_LANG_BEGINDECLS const char * lwres_net_ntop(int af, const void *src, char *dst, size_t size); int lwres_net_pton(int af, const char *src, void *dst); int lwres_net_aton(const char *cp, struct in_addr *addr); LWRES_LANG_ENDDECLS #endif /* LWRES_NET_H */ PK `�]p.b�� � lwres/stdlib.hnu �[��� /* * Copyright (C) Internet Systems Consortium, Inc. ("ISC") * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, you can obtain one at https://mozilla.org/MPL/2.0/. * * See the COPYRIGHT file distributed with this work for additional * information regarding copyright ownership. */ #ifndef LWRES_STDLIB_H #define LWRES_STDLIB_H 1 /*! \file lwres/stdlib.h */ #include <stdlib.h> #include <lwres/lang.h> #include <lwres/platform.h> #ifdef LWRES_PLATFORM_NEEDSTRTOUL #define strtoul lwres_strtoul #endif LWRES_LANG_BEGINDECLS unsigned long lwres_strtoul(const char *, char **, int); LWRES_LANG_ENDDECLS #endif PK `�]�X3R�; �; lwres/lwres.hnu �[��� /* * Copyright (C) Internet Systems Consortium, Inc. ("ISC") * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, you can obtain one at https://mozilla.org/MPL/2.0/. * * See the COPYRIGHT file distributed with this work for additional * information regarding copyright ownership. */ #ifndef LWRES_LWRES_H #define LWRES_LWRES_H 1 #include <inttypes.h> #include <stdio.h> #include <lwres/context.h> #include <lwres/lang.h> #include <lwres/list.h> #include <lwres/lwpacket.h> #include <lwres/platform.h> /*! \file lwres/lwres.h */ /*! * Design notes: * * Each opcode has two structures and three functions which operate on each * structure. For example, using the "no operation/ping" opcode as an * example: * * <ul><li>lwres_nooprequest_t: * * lwres_nooprequest_render() takes a lwres_nooprequest_t and * and renders it into wire format, storing the allocated * buffer information in a passed-in buffer. When this buffer * is no longer needed, it must be freed by * lwres_context_freemem(). All other memory used by the * caller must be freed manually, including the * lwres_nooprequest_t passed in.<br /><br /> * * lwres_nooprequest_parse() takes a wire format message and * breaks it out into a lwres_nooprequest_t. The structure * must be freed via lwres_nooprequest_free() when it is no longer * needed.<br /><br /> * * lwres_nooprequest_free() releases into the lwres_context_t * any space allocated during parsing.</li> * * <li>lwres_noopresponse_t: * * The functions used are similar to the three used for * requests, just with different names.</li></ul> * * Typically, the client will use request_render, response_parse, and * response_free, while the daemon will use request_parse, response_render, * and request_free. * * The basic flow of a typical client is: * * \li fill in a request_t, and call the render function. * * \li Transmit the buffer returned to the daemon. * * \li Wait for a response. * * \li When a response is received, parse it into a response_t. * * \li free the request buffer using lwres_context_freemem(). * * \li free the response structure and its associated buffer using * response_free(). */ #define LWRES_UDP_PORT 921 /*%< UDP Port Number */ #define LWRES_RECVLENGTH 16384 /*%< Maximum Packet Length */ #define LWRES_ADDR_MAXLEN 16 /*%< changing this breaks ABI */ #define LWRES_RESOLV_CONF "/etc/resolv.conf" /*%< Location of resolv.conf */ /*% DNSSEC is not required (input). Only relevant to rrset queries. */ #define LWRES_FLAG_TRUSTNOTREQUIRED 0x00000001U /*% The data was crypto-verified with DNSSEC (output). */ #define LWRES_FLAG_SECUREDATA 0x00000002U /*% no-op */ #define LWRES_OPCODE_NOOP 0x00000000U /*% lwres_nooprequest_t */ typedef struct { /* public */ uint16_t datalength; unsigned char *data; } lwres_nooprequest_t; /*% lwres_noopresponse_t */ typedef struct { /* public */ uint16_t datalength; unsigned char *data; } lwres_noopresponse_t; /*% get addresses by name */ #define LWRES_OPCODE_GETADDRSBYNAME 0x00010001U /*% lwres_addr_t */ typedef struct lwres_addr lwres_addr_t; /*% LWRES_LIST */ typedef LWRES_LIST(lwres_addr_t) lwres_addrlist_t; /*% lwres_addr */ struct lwres_addr { uint32_t family; uint16_t length; unsigned char address[LWRES_ADDR_MAXLEN]; uint32_t zone; LWRES_LINK(lwres_addr_t) link; }; /*% lwres_gabnrequest_t */ typedef struct { /* public */ uint32_t flags; uint32_t addrtypes; uint16_t namelen; char *name; } lwres_gabnrequest_t; /*% lwres_gabnresponse_t */ typedef struct { /* public */ uint32_t flags; uint16_t naliases; uint16_t naddrs; char *realname; char **aliases; uint16_t realnamelen; uint16_t *aliaslen; lwres_addrlist_t addrs; /*! if base != NULL, it will be freed when this structure is freed. */ void *base; size_t baselen; } lwres_gabnresponse_t; /*% get name by address */ #define LWRES_OPCODE_GETNAMEBYADDR 0x00010002U /*% lwres_gnbarequest_t */ typedef struct { /* public */ uint32_t flags; lwres_addr_t addr; } lwres_gnbarequest_t; /*% lwres_gnbaresponse_t */ typedef struct { /* public */ uint32_t flags; uint16_t naliases; char *realname; char **aliases; uint16_t realnamelen; uint16_t *aliaslen; /*! if base != NULL, it will be freed when this structure is freed. */ void *base; size_t baselen; } lwres_gnbaresponse_t; /*% get rdata by name */ #define LWRES_OPCODE_GETRDATABYNAME 0x00010003U /*% lwres_grbnrequest_t */ typedef struct { /* public */ uint32_t flags; uint16_t rdclass; uint16_t rdtype; uint16_t namelen; char *name; } lwres_grbnrequest_t; /*% lwres_grbnresponse_t */ typedef struct { /* public */ uint32_t flags; uint16_t rdclass; uint16_t rdtype; uint32_t ttl; uint16_t nrdatas; uint16_t nsigs; char *realname; uint16_t realnamelen; unsigned char **rdatas; uint16_t *rdatalen; unsigned char **sigs; uint16_t *siglen; /*% if base != NULL, it will be freed when this structure is freed. */ void *base; size_t baselen; } lwres_grbnresponse_t; /*% Used by lwres_getrrsetbyname() */ #define LWRDATA_VALIDATED 0x00000001 /*! * resolv.conf data */ #define LWRES_CONFMAXNAMESERVERS 3 /*%< max 3 "nameserver" entries */ #define LWRES_CONFMAXLWSERVERS 1 /*%< max 1 "lwserver" entry */ #define LWRES_CONFMAXSEARCH 8 /*%< max 8 domains in "search" entry */ #define LWRES_CONFMAXLINELEN 256 /*%< max size of a line */ #define LWRES_CONFMAXSORTLIST 10 /*%< max 10 */ /*% lwres_conf_t */ typedef struct { lwres_context_t *lwctx; lwres_addr_t nameservers[LWRES_CONFMAXNAMESERVERS]; uint8_t nsnext; /*%< index for next free slot */ lwres_addr_t lwservers[LWRES_CONFMAXLWSERVERS]; uint8_t lwnext; /*%< index for next free slot */ char *domainname; char *search[LWRES_CONFMAXSEARCH]; uint8_t searchnxt; /*%< index for next free slot */ struct { lwres_addr_t addr; /*% mask has a non-zero 'family' and 'length' if set */ lwres_addr_t mask; } sortlist[LWRES_CONFMAXSORTLIST]; uint8_t sortlistnxt; uint8_t resdebug; /*%< non-zero if 'options debug' set */ uint8_t ndots; /*%< set to n in 'options ndots:n' */ uint8_t no_tld_query; /*%< non-zero if 'options no_tld_query' */ int32_t attempts; /*%< set to n in 'options attempts:n' */ int32_t timeout; /*%< set to n in 'options timeout:n' */ } lwres_conf_t; #define LWRES_ADDRTYPE_V4 0x00000001U /*%< ipv4 */ #define LWRES_ADDRTYPE_V6 0x00000002U /*%< ipv6 */ #define LWRES_MAX_ALIASES 16 /*%< max # of aliases */ #define LWRES_MAX_ADDRS 64 /*%< max # of addrs */ LWRES_LANG_BEGINDECLS /*% This is in host byte order. */ LIBLWRES_EXTERNAL_DATA extern uint16_t lwres_udp_port; LIBLWRES_EXTERNAL_DATA extern const char *lwres_resolv_conf; lwres_result_t lwres_gabnrequest_render(lwres_context_t *ctx, lwres_gabnrequest_t *req, lwres_lwpacket_t *pkt, lwres_buffer_t *b); lwres_result_t lwres_gabnresponse_render(lwres_context_t *ctx, lwres_gabnresponse_t *req, lwres_lwpacket_t *pkt, lwres_buffer_t *b); lwres_result_t lwres_gabnrequest_parse(lwres_context_t *ctx, lwres_buffer_t *b, lwres_lwpacket_t *pkt, lwres_gabnrequest_t **structp); lwres_result_t lwres_gabnresponse_parse(lwres_context_t *ctx, lwres_buffer_t *b, lwres_lwpacket_t *pkt, lwres_gabnresponse_t **structp); void lwres_gabnrequest_free(lwres_context_t *ctx, lwres_gabnrequest_t **structp); /**< * Frees any dynamically allocated memory for this structure. * * Requires: * * ctx != NULL, and be a context returned via lwres_context_create(). * * structp != NULL && *structp != NULL. * * Ensures: * * *structp == NULL. * * All memory allocated by this structure will be returned to the * system via the context's free function. */ void lwres_gabnresponse_free(lwres_context_t *ctx, lwres_gabnresponse_t **structp); /**< * Frees any dynamically allocated memory for this structure. * * Requires: * * ctx != NULL, and be a context returned via lwres_context_create(). * * structp != NULL && *structp != NULL. * * Ensures: * * *structp == NULL. * * All memory allocated by this structure will be returned to the * system via the context's free function. */ lwres_result_t lwres_gnbarequest_render(lwres_context_t *ctx, lwres_gnbarequest_t *req, lwres_lwpacket_t *pkt, lwres_buffer_t *b); lwres_result_t lwres_gnbaresponse_render(lwres_context_t *ctx, lwres_gnbaresponse_t *req, lwres_lwpacket_t *pkt, lwres_buffer_t *b); lwres_result_t lwres_gnbarequest_parse(lwres_context_t *ctx, lwres_buffer_t *b, lwres_lwpacket_t *pkt, lwres_gnbarequest_t **structp); lwres_result_t lwres_gnbaresponse_parse(lwres_context_t *ctx, lwres_buffer_t *b, lwres_lwpacket_t *pkt, lwres_gnbaresponse_t **structp); void lwres_gnbarequest_free(lwres_context_t *ctx, lwres_gnbarequest_t **structp); /**< * Frees any dynamically allocated memory for this structure. * * Requires: * * ctx != NULL, and be a context returned via lwres_context_create(). * * structp != NULL && *structp != NULL. * * Ensures: * * *structp == NULL. * * All memory allocated by this structure will be returned to the * system via the context's free function. */ void lwres_gnbaresponse_free(lwres_context_t *ctx, lwres_gnbaresponse_t **structp); /**< * Frees any dynamically allocated memory for this structure. * * Requires: * * ctx != NULL, and be a context returned via lwres_context_create(). * * structp != NULL && *structp != NULL. * * Ensures: * * *structp == NULL. * * All memory allocated by this structure will be returned to the * system via the context's free function. */ lwres_result_t lwres_grbnrequest_render(lwres_context_t *ctx, lwres_grbnrequest_t *req, lwres_lwpacket_t *pkt, lwres_buffer_t *b); lwres_result_t lwres_grbnresponse_render(lwres_context_t *ctx, lwres_grbnresponse_t *req, lwres_lwpacket_t *pkt, lwres_buffer_t *b); lwres_result_t lwres_grbnrequest_parse(lwres_context_t *ctx, lwres_buffer_t *b, lwres_lwpacket_t *pkt, lwres_grbnrequest_t **structp); lwres_result_t lwres_grbnresponse_parse(lwres_context_t *ctx, lwres_buffer_t *b, lwres_lwpacket_t *pkt, lwres_grbnresponse_t **structp); void lwres_grbnrequest_free(lwres_context_t *ctx, lwres_grbnrequest_t **structp); /**< * Frees any dynamically allocated memory for this structure. * * Requires: * * ctx != NULL, and be a context returned via lwres_context_create(). * * structp != NULL && *structp != NULL. * * Ensures: * * *structp == NULL. * * All memory allocated by this structure will be returned to the * system via the context's free function. */ void lwres_grbnresponse_free(lwres_context_t *ctx, lwres_grbnresponse_t **structp); /**< * Frees any dynamically allocated memory for this structure. * * Requires: * * ctx != NULL, and be a context returned via lwres_context_create(). * * structp != NULL && *structp != NULL. * * Ensures: * * *structp == NULL. * * All memory allocated by this structure will be returned to the * system via the context's free function. */ lwres_result_t lwres_nooprequest_render(lwres_context_t *ctx, lwres_nooprequest_t *req, lwres_lwpacket_t *pkt, lwres_buffer_t *b); /**< * Allocate space and render into wire format a noop request packet. * * Requires: * * ctx != NULL, and be a context returned via lwres_context_create(). * * b != NULL, and points to a lwres_buffer_t. The contents of the * buffer structure will be initialized to contain the wire-format * noop request packet. * * Caller needs to fill in parts of "pkt" before calling: * serial, maxrecv, result. * * Returns: * * Returns 0 on success, non-zero on failure. * * On successful return, *b will contain data about the wire-format * packet. It can be transmitted in any way, including lwres_sendblock(). */ lwres_result_t lwres_noopresponse_render(lwres_context_t *ctx, lwres_noopresponse_t *req, lwres_lwpacket_t *pkt, lwres_buffer_t *b); lwres_result_t lwres_nooprequest_parse(lwres_context_t *ctx, lwres_buffer_t *b, lwres_lwpacket_t *pkt, lwres_nooprequest_t **structp); /**< * Parse a noop request. Note that to get here, the lwpacket must have * already been parsed and removed by the caller, otherwise it would be * pretty hard for it to know this is the right function to call. * * The function verifies bits of the header, but does not modify it. */ lwres_result_t lwres_noopresponse_parse(lwres_context_t *ctx, lwres_buffer_t *b, lwres_lwpacket_t *pkt, lwres_noopresponse_t **structp); void lwres_nooprequest_free(lwres_context_t *ctx, lwres_nooprequest_t **structp); void lwres_noopresponse_free(lwres_context_t *ctx, lwres_noopresponse_t **structp); /**< * Frees any dynamically allocated memory for this structure. * * Requires: * * ctx != NULL, and be a context returned via lwres_context_create(). * * structp != NULL && *structp != NULL. * * Ensures: * * *structp == NULL. * * All memory allocated by this structure will be returned to the * system via the context's free function. */ lwres_result_t lwres_conf_parse(lwres_context_t *ctx, const char *filename); /**< * parses a resolv.conf-format file and stores the results in the structure * pointed to by *ctx. * * Requires: * ctx != NULL * filename != NULL && strlen(filename) > 0 * * Returns: * LWRES_R_SUCCESS on a successful parse. * Anything else on error, although the structure may be partially filled * in. */ lwres_result_t lwres_conf_print(lwres_context_t *ctx, FILE *fp); /**< * Prints a resolv.conf-format of confdata output to fp. * * Requires: * ctx != NULL */ void lwres_conf_init(lwres_context_t *ctx); /**< * sets all internal fields to a default state. Used to initialize a new * lwres_conf_t structure (not reset a used on). * * Requires: * ctx != NULL */ void lwres_conf_clear(lwres_context_t *ctx); /**< * frees all internally allocated memory in confdata. Uses the memory * routines supplied by ctx. * * Requires: * ctx != NULL */ lwres_conf_t * lwres_conf_get(lwres_context_t *ctx); /**< * Be extremely cautions in modifying the contents of this structure; it * needs an API to return the various bits of data, walk lists, etc. * * Requires: * ctx != NULL */ /* * Helper functions */ lwres_result_t lwres_data_parse(lwres_buffer_t *b, unsigned char **p, uint16_t *len); lwres_result_t lwres_string_parse(lwres_buffer_t *b, char **c, uint16_t *len); lwres_result_t lwres_addr_parse(lwres_buffer_t *b, lwres_addr_t *addr); lwres_result_t lwres_getaddrsbyname(lwres_context_t *ctx, const char *name, uint32_t addrtypes, lwres_gabnresponse_t **structp); lwres_result_t lwres_getnamebyaddr(lwres_context_t *ctx, uint32_t addrtype, uint16_t addrlen, const unsigned char *addr, lwres_gnbaresponse_t **structp); lwres_result_t lwres_getrdatabyname(lwres_context_t *ctx, const char *name, uint16_t rdclass, uint16_t rdtype, uint32_t flags, lwres_grbnresponse_t **structp); LWRES_LANG_ENDDECLS #endif /* LWRES_LWRES_H */ PK `�]I,�� lwres/int.hnu �[��� /* * Copyright (C) Internet Systems Consortium, Inc. ("ISC") * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, you can obtain one at https://mozilla.org/MPL/2.0/. * * See the COPYRIGHT file distributed with this work for additional * information regarding copyright ownership. */ #ifndef LWRES_INT_H #define LWRES_INT_H 1 #include <inttypes.h> /*! \file lwres/int.h */ typedef lwres_int8_t int8_t; typedef lwres_uint8_t uint8_t; typedef lwres_int16_t int16_t; typedef lwres_uint16_t uint16_t; typedef lwres_int32_t int32_t; typedef lwres_uint32_t uint32_t; typedef lwres_int64_t int64_t; typedef lwres_uint64_t uint64_t; #endif /* LWRES_INT_H */ PK `�]���� � lwres/result.hnu �[��� /* * Copyright (C) Internet Systems Consortium, Inc. ("ISC") * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, you can obtain one at https://mozilla.org/MPL/2.0/. * * See the COPYRIGHT file distributed with this work for additional * information regarding copyright ownership. */ #ifndef LWRES_RESULT_H #define LWRES_RESULT_H 1 /*! \file lwres/result.h */ typedef unsigned int lwres_result_t; #define LWRES_R_SUCCESS 0 #define LWRES_R_NOMEMORY 1 #define LWRES_R_TIMEOUT 2 #define LWRES_R_NOTFOUND 3 #define LWRES_R_UNEXPECTEDEND 4 /* unexpected end of input */ #define LWRES_R_FAILURE 5 /* generic failure */ #define LWRES_R_IOERROR 6 #define LWRES_R_NOTIMPLEMENTED 7 #define LWRES_R_UNEXPECTED 8 #define LWRES_R_TRAILINGDATA 9 #define LWRES_R_INCOMPLETE 10 #define LWRES_R_RETRY 11 #define LWRES_R_TYPENOTFOUND 12 #define LWRES_R_TOOLARGE 13 #endif /* LWRES_RESULT_H */ PK `�]�c�r�0 �0 lwres/netdb.hnu �[��� /* * Copyright (C) Internet Systems Consortium, Inc. ("ISC") * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, you can obtain one at https://mozilla.org/MPL/2.0/. * * See the COPYRIGHT file distributed with this work for additional * information regarding copyright ownership. */ /*! \file */ #ifndef LWRES_NETDB_H #define LWRES_NETDB_H 1 #include <stddef.h> /* Required on FreeBSD (and others?) for size_t. */ #include <netdb.h> /* Contractual provision. */ #include <lwres/lang.h> /* * Define if <netdb.h> does not declare struct addrinfo. */ #undef ISC_LWRES_NEEDADDRINFO #ifdef ISC_LWRES_NEEDADDRINFO struct addrinfo { int ai_flags; /* AI_PASSIVE, AI_CANONNAME */ int ai_family; /* PF_xxx */ int ai_socktype; /* SOCK_xxx */ int ai_protocol; /* 0 or IPPROTO_xxx for IPv4 and IPv6 */ size_t ai_addrlen; /* Length of ai_addr */ char *ai_canonname; /* Canonical name for hostname */ struct sockaddr *ai_addr; /* Binary address */ struct addrinfo *ai_next; /* Next structure in linked list */ }; #endif /* * Undefine all #defines we are interested in as <netdb.h> may or may not have * defined them. */ /* * Error return codes from gethostbyname() and gethostbyaddr() * (left in extern int h_errno). */ #undef NETDB_INTERNAL #undef NETDB_SUCCESS #undef HOST_NOT_FOUND #undef TRY_AGAIN #undef NO_RECOVERY #undef NO_DATA #undef NO_ADDRESS #define NETDB_INTERNAL -1 /* see errno */ #define NETDB_SUCCESS 0 /* no problem */ #define HOST_NOT_FOUND 1 /* Authoritative Answer Host not found */ #define TRY_AGAIN 2 /* Non-Authoritative Host not found, or SERVERFAIL */ #define NO_RECOVERY 3 /* Non recoverable errors, FORMERR, REFUSED, NOTIMP */ #define NO_DATA 4 /* Valid name, no data record of requested type */ #define NO_ADDRESS NO_DATA /* no address, look for MX record */ /* * Error return codes from getaddrinfo() */ #undef EAI_ADDRFAMILY #undef EAI_AGAIN #undef EAI_BADFLAGS #undef EAI_FAIL #undef EAI_FAMILY #undef EAI_MEMORY #undef EAI_NODATA #undef EAI_NONAME #undef EAI_SERVICE #undef EAI_SOCKTYPE #undef EAI_SYSTEM #undef EAI_BADHINTS #undef EAI_PROTOCOL #undef EAI_OVERFLOW #undef EAI_MAX #define EAI_ADDRFAMILY 1 /* address family for hostname not supported */ #define EAI_AGAIN 2 /* temporary failure in name resolution */ #define EAI_BADFLAGS 3 /* invalid value for ai_flags */ #define EAI_FAIL 4 /* non-recoverable failure in name resolution */ #define EAI_FAMILY 5 /* ai_family not supported */ #define EAI_MEMORY 6 /* memory allocation failure */ #define EAI_NODATA 7 /* no address associated with hostname */ #define EAI_NONAME 8 /* hostname nor servname provided, or not known */ #define EAI_SERVICE 9 /* servname not supported for ai_socktype */ #define EAI_SOCKTYPE 10 /* ai_socktype not supported */ #define EAI_SYSTEM 11 /* system error returned in errno */ #define EAI_BADHINTS 12 #define EAI_PROTOCOL 13 #define EAI_OVERFLOW 14 #define EAI_MAX 15 /* * Flag values for getaddrinfo() */ #undef AI_PASSIVE #undef AI_CANONNAME #undef AI_NUMERICHOST #define AI_PASSIVE 0x00000001 #define AI_CANONNAME 0x00000002 #define AI_NUMERICHOST 0x00000004 /* * Flag values for getipnodebyname() */ #undef AI_V4MAPPED #undef AI_ALL #undef AI_ADDRCONFIG #undef AI_DEFAULT #define AI_V4MAPPED 0x00000008 #define AI_ALL 0x00000010 #define AI_ADDRCONFIG 0x00000020 #define AI_DEFAULT (AI_V4MAPPED|AI_ADDRCONFIG) /* * Constants for lwres_getnameinfo() */ #undef NI_MAXHOST #undef NI_MAXSERV #define NI_MAXHOST 1025 #define NI_MAXSERV 32 /* * Flag values for lwres_getnameinfo() */ #undef NI_NOFQDN #undef NI_NUMERICHOST #undef NI_NAMEREQD #undef NI_NUMERICSERV #undef NI_DGRAM #undef NI_NUMERICSCOPE #define NI_NOFQDN 0x00000001 #define NI_NUMERICHOST 0x00000002 #define NI_NAMEREQD 0x00000004 #define NI_NUMERICSERV 0x00000008 #define NI_DGRAM 0x00000010 #define NI_NUMERICSCOPE 0x00000020 /*2553bis-00*/ /* * Define if <netdb.h> does not declare struct rrsetinfo. */ #define ISC_LWRES_NEEDRRSETINFO 1 #ifdef ISC_LWRES_NEEDRRSETINFO /* * Structures for getrrsetbyname() */ struct rdatainfo { unsigned int rdi_length; unsigned char *rdi_data; }; struct rrsetinfo { unsigned int rri_flags; int rri_rdclass; int rri_rdtype; unsigned int rri_ttl; unsigned int rri_nrdatas; unsigned int rri_nsigs; char *rri_name; struct rdatainfo *rri_rdatas; struct rdatainfo *rri_sigs; }; /* * Flags for getrrsetbyname() */ #define RRSET_VALIDATED 0x00000001 /* Set was dnssec validated */ /* * Return codes for getrrsetbyname() */ #define ERRSET_SUCCESS 0 #define ERRSET_NOMEMORY 1 #define ERRSET_FAIL 2 #define ERRSET_INVAL 3 #define ERRSET_NONAME 4 #define ERRSET_NODATA 5 #endif /* * Define to map into lwres_ namespace. */ #define LWRES_NAMESPACE #ifdef LWRES_NAMESPACE /* * Use our versions not the ones from the C library. */ #ifdef getnameinfo #undef getnameinfo #endif #define getnameinfo lwres_getnameinfo #ifdef getaddrinfo #undef getaddrinfo #endif #define getaddrinfo lwres_getaddrinfo #ifdef freeaddrinfo #undef freeaddrinfo #endif #define freeaddrinfo lwres_freeaddrinfo #ifdef gai_strerror #undef gai_strerror #endif #define gai_strerror lwres_gai_strerror #ifdef herror #undef herror #endif #define herror lwres_herror #ifdef hstrerror #undef hstrerror #endif #define hstrerror lwres_hstrerror #ifdef getipnodebyname #undef getipnodebyname #endif #define getipnodebyname lwres_getipnodebyname #ifdef getipnodebyaddr #undef getipnodebyaddr #endif #define getipnodebyaddr lwres_getipnodebyaddr #ifdef freehostent #undef freehostent #endif #define freehostent lwres_freehostent #ifdef gethostbyname #undef gethostbyname #endif #define gethostbyname lwres_gethostbyname #ifdef gethostbyname2 #undef gethostbyname2 #endif #define gethostbyname2 lwres_gethostbyname2 #ifdef gethostbyaddr #undef gethostbyaddr #endif #define gethostbyaddr lwres_gethostbyaddr #ifdef gethostent #undef gethostent #endif #define gethostent lwres_gethostent #ifdef sethostent #undef sethostent #endif #define sethostent lwres_sethostent #ifdef endhostent #undef endhostent #endif #define endhostent lwres_endhostent /* #define sethostfile lwres_sethostfile */ #ifdef gethostbyname_r #undef gethostbyname_r #endif #define gethostbyname_r lwres_gethostbyname_r #ifdef gethostbyaddr_r #undef gethostbyaddr_r #endif #define gethostbyaddr_r lwres_gethostbyaddr_r #ifdef gethostent_r #undef gethostent_r #endif #define gethostent_r lwres_gethostent_r #ifdef sethostent_r #undef sethostent_r #endif #define sethostent_r lwres_sethostent_r #ifdef endhostent_r #undef endhostent_r #endif #define endhostent_r lwres_endhostent_r #ifdef getrrsetbyname #undef getrrsetbyname #endif #define getrrsetbyname lwres_getrrsetbyname #ifdef freerrset #undef freerrset #endif #define freerrset lwres_freerrset #ifdef notyet #define getservbyname lwres_getservbyname #define getservbyport lwres_getservbyport #define getservent lwres_getservent #define setservent lwres_setservent #define endservent lwres_endservent #define getservbyname_r lwres_getservbyname_r #define getservbyport_r lwres_getservbyport_r #define getservent_r lwres_getservent_r #define setservent_r lwres_setservent_r #define endservent_r lwres_endservent_r #define getprotobyname lwres_getprotobyname #define getprotobynumber lwres_getprotobynumber #define getprotoent lwres_getprotoent #define setprotoent lwres_setprotoent #define endprotoent lwres_endprotoent #define getprotobyname_r lwres_getprotobyname_r #define getprotobynumber_r lwres_getprotobynumber_r #define getprotoent_r lwres_getprotoent_r #define setprotoent_r lwres_setprotoent_r #define endprotoent_r lwres_endprotoent_r #ifdef getnetbyname #undef getnetbyname #endif #define getnetbyname lwres_getnetbyname #ifdef getnetbyaddr #undef getnetbyaddr #endif #define getnetbyaddr lwres_getnetbyaddr #ifdef getnetent #undef getnetent #endif #define getnetent lwres_getnetent #ifdef setnetent #undef setnetent #endif #define setnetent lwres_setnetent #ifdef endnetent #undef endnetent #endif #define endnetent lwres_endnetent #ifdef getnetbyname_r #undef getnetbyname_r #endif #define getnetbyname_r lwres_getnetbyname_r #ifdef getnetbyaddr_r #undef getnetbyaddr_r #endif #define getnetbyaddr_r lwres_getnetbyaddr_r #ifdef getnetent_r #undef getnetent_r #endif #define getnetent_r lwres_getnetent_r #ifdef setnetent_r #undef setnetent_r #endif #define setnetent_r lwres_setnetent_r #ifdef endnetent_r #undef endnetent_r #endif #define endnetent_r lwres_endnetent_r #endif /* notyet */ #ifdef h_errno #undef h_errno #endif #define h_errno lwres_h_errno #endif /* LWRES_NAMESPACE */ LWRES_LANG_BEGINDECLS extern int lwres_h_errno; int lwres_getaddrinfo(const char *, const char *, const struct addrinfo *, struct addrinfo **); int lwres_getnameinfo(const struct sockaddr *, size_t, char *, size_t, char *, size_t, int); void lwres_freeaddrinfo(struct addrinfo *); char *lwres_gai_strerror(int); struct hostent *lwres_gethostbyaddr(const char *, int, int); struct hostent *lwres_gethostbyname(const char *); struct hostent *lwres_gethostbyname2(const char *, int); struct hostent *lwres_gethostent(void); struct hostent *lwres_getipnodebyname(const char *, int, int, int *); struct hostent *lwres_getipnodebyaddr(const void *, size_t, int, int *); void lwres_endhostent(void); void lwres_sethostent(int); /* void lwres_sethostfile(const char *); */ void lwres_freehostent(struct hostent *); int lwres_getrrsetbyname(const char *, unsigned int, unsigned int, unsigned int, struct rrsetinfo **); void lwres_freerrset(struct rrsetinfo *); #ifdef notyet struct netent *lwres_getnetbyaddr(unsigned long, int); struct netent *lwres_getnetbyname(const char *); struct netent *lwres_getnetent(void); void lwres_endnetent(void); void lwres_setnetent(int); struct protoent *lwres_getprotobyname(const char *); struct protoent *lwres_getprotobynumber(int); struct protoent *lwres_getprotoent(void); void lwres_endprotoent(void); void lwres_setprotoent(int); struct servent *lwres_getservbyname(const char *, const char *); struct servent *lwres_getservbyport(int, const char *); struct servent *lwres_getservent(void); void lwres_endservent(void); void lwres_setservent(int); #endif /* notyet */ void lwres_herror(const char *); const char *lwres_hstrerror(int); struct hostent *lwres_gethostbyaddr_r(const char *, int, int, struct hostent *, char *, int, int *); struct hostent *lwres_gethostbyname_r(const char *, struct hostent *, char *, int, int *); struct hostent *lwres_gethostent_r(struct hostent *, char *, int, int *); void lwres_sethostent_r(int); void lwres_endhostent_r(void); #ifdef notyet struct netent *lwres_getnetbyname_r(const char *, struct netent *, char *, int); struct netent *lwres_getnetbyaddr_r(long, int, struct netent *, char *, int); struct netent *lwres_getnetent_r(struct netent *, char *, int); void lwres_setnetent_r(int); void lwres_endnetent_r(void); struct protoent *lwres_getprotobyname_r(const char *, struct protoent *, char *, int); struct protoent *lwres_getprotobynumber_r(int, struct protoent *, char *, int); struct protoent *lwres_getprotoent_r(struct protoent *, char *, int); void lwres_setprotoent_r(int); void lwres_endprotoent_r(void); struct servent *lwres_getservbyname_r(const char *name, const char *, struct servent *, char *, int); struct servent *lwres_getservbyport_r(int port, const char *, struct servent *, char *, int); struct servent *lwres_getservent_r(struct servent *, char *, int); void lwres_setservent_r(int); void lwres_endservent_r(void); #endif /* notyet */ LWRES_LANG_ENDDECLS #ifdef notyet /* This is nec'y to make this include file properly replace the sun version. */ #ifdef sun #ifdef __GNU_LIBRARY__ #include <rpc/netdb.h> /* Required. */ #else /* !__GNU_LIBRARY__ */ struct rpcent { char *r_name; /* name of server for this rpc program */ char **r_aliases; /* alias list */ int r_number; /* rpc program number */ }; struct rpcent *lwres_getrpcbyname(); struct rpcent *lwres_getrpcbynumber(), struct rpcent *lwres_getrpcent(); #endif /* __GNU_LIBRARY__ */ #endif /* sun */ #endif /* notyet */ /* * Tell Emacs to use C mode on this file. * Local variables: * mode: c * End: */ #endif /* LWRES_NETDB_H */ PK `�]#0�{s"