/* CMS REPLACEMENT HISTORY, Element RESOLV.H */ /* *9C1 11-DEC-2000 17:38:32 MYTH "V51 baselevel code freeze" */ /* 9A1 12-MAY-2000 00:51:59 MUGGERIDGE "V51IFT baselevel code freeze" */ /* 9B1 11-MAY-2000 15:39:03 MUGGERIDGE "V51IFT baselevel code freeze" */ /* *9 10-MAY-1999 15:44:05 FOUNTAIN "put back res_use_inet6 for backward compatibility" */ /* *8 3-MAY-1999 13:44:06 FOUNTAIN "Check-in of IPv6 related changes for the EAK" */ /* 7B1 28-OCT-1998 19:51:31 MUGGERIDGE "V50SSB baselevel code freeze" */ /* 7A1 18-JUN-1998 05:37:09 MUGGERIDGE "V50IFT baselevel code freeze" */ /* *7 20-MAY-1998 17:11:07 FOUNTAIN "changes for _p_class_sym" */ /* *6 14-APR-1998 20:08:24 DOUB "the symbol __TCPIP_ALLOCATE_RES__ renamed to __TCPIP_RESOLVER_BUILD" */ /* *5 7-APR-1998 17:54:54 DOUB "save the server we talked to last" */ /* *4 1-APR-1998 16:52:08 GEMIGNANI "Direct h_errno to IPC" */ /* *3 23-MAR-1998 17:25:33 GEMIGNANI "ACCESS_SHR support for _res" */ /* *2 4-FEB-1998 17:46:51 GEMIGNANI "Fix inclusions" */ /* *1 19-JAN-1998 15:24:36 GEMIGNANI "Initial population of IPv6 source" */ /* CMS REPLACEMENT HISTORY, Element RESOLV.H */ #ifndef __RESOLV_LOADED #define __RESOLV_LOADED 1 #ifndef __CRTL_VER # define __CRTL_VER __VMS_VER #endif #if __CRTL_VER >= 70000000 /* Only OpenVMS V6.2 or later */ /* ** THIS HEADER IS SPECIALLY DESIGNED FOR THE TCPIP OPENVMS ENVIRONMENT. ** ** THE BIND LIBRARY SHOULD BE BUILT WITH /DEFINE=__TCPIP_RESOLVER_BUILD__ ** OTHERWISE THE INTERFACE TO TCPIP$ACCESS_SHR.EXE WILL BE USED. */ /**************************************************************************** ** ** - Resolver configuration file ** ***************************************************************************** ** Header is nonstandard ***************************************************************************** ** ** Copyright Digital Equipment Corporation 1993, 1995. All rights reserved. ** ** Restricted Rights: Use, duplication, or disclosure by the U.S. ** Government is subject to restrictions as set forth in subparagraph ** (c) (1) (ii) of DFARS 252.227-7013, or in FAR 52.227-19, or in FAR ** 52.227-14 Alt. III, as applicable. ** ** This software is proprietary to and embodies the confidential ** technology of Digital Equipment Corporation. Possession, use, or ** copying of this software and media is authorized only pursuant to a ** valid written license from Digital or an authorized sublicensor. ** ****************************************************************************** */ #ifdef OBSOLETE #include //OBSOLETE #if (!defined(BSD)) || (BSD < 199306) # include //OBSOLETE #else # include //OBSOLETE #endif #include //OBSOLETE #endif /* OBSOLETE */ #include #include #include #pragma __nostandard #ifdef __cplusplus extern "C" { #endif /* ** Ensure that regardless of user /pointer_size usage, we begin processing ** using a 32 bit pointer context. */ #if __INITIAL_POINTER_SIZE # if (__CRTL_VER < 70000000) || !defined __ALPHA # error " Pointer size usage not permitted before OpenVMS Alpha V7.0" # endif # pragma __pointer_size __save # pragma __pointer_size 32 #endif /* ** The function hostalias accepts either a 32 bit or 64 bit pointer, but ** always returns a 32 bit pointer. Define a 32 bit character pointer. */ #ifndef __CHAR_PTR32 # define __CHAR_PTR32 1 typedef char * __char_ptr32; typedef const char * __const_char_ptr32; #endif #ifndef __U_CHAR_PTR32 # define __U_CHAR_PTR32 1 typedef u_char * __u_char_ptr32; typedef const u_char * __const_u_char_ptr32; #endif /* ** Enable 64 bit pointers for prototypes when the user has used the ** /pointer_size qualifier. */ #if __INITIAL_POINTER_SIZE #pragma __pointer_size 64 #endif /* ** Function prototypes */ __char_ptr32 hostalias (const char *); /* * Revision information. This is the release date in YYYYMMDD format. * It can change every day so the right thing to do with it is use it * in preprocessor commands such as "#if (__RES > 19931104)". Do not * compare for equality; rather, use it to determine whether your resolver * is new enough to contain a certain feature. */ #define __RES 19960801 /* * This used to be defined in res_query.c, now it's in herror.c. It was * never extern'd by any *.h file before it was placed here. herror.c is * part of libresolv.a even though it might make more sense in libnetdb.a * or even libnet.a. */ #if defined __TCPIP_RESOLVER_BUILD__ extern int h_errno; #else int *TCPIP$GET_H_ERRNO_ADDR(void); #define h_errno *TCPIP$GET_H_ERRNO_ADDR() #endif /* * Resolver configuration file. * Normally not present, but may contain the address of the * inital name server(s) to query and the domain search list. */ #ifndef _PATH_RESCONF #define _PATH_RESCONF "/etc/resolv.conf" #endif /* * Global defines and variables for resolver stub. */ #define MAXNS 3 /* max # name servers we'll track */ #define MAXDFLSRCH 3 /* # default domain levels to try */ #define MAXDNSRCH 6 /* max # domains in search path */ #define LOCALDOMAINPARTS 2 /* min levels in name that is "local" */ #define RES_TIMEOUT 5 /* min. seconds between retries */ #define MAXRESOLVSORT 10 /* number of net to sort on */ #define RES_MAXNDOTS 15 /* should reflect bit field size */ struct __res_state { #if !defined __TCPIP_RESOLVER_BUILD__ struct { #endif int retrans; /* retransmition time interval */ int retry; /* number of times to retransmit */ u_long options; /* option flags - see below. */ int nscount; /* number of name servers */ struct sockaddr_in nsaddr_list[MAXNS]; /* address of name server */ #define nsaddr nsaddr_list[0] /* for backward compatibility */ u_short id; /* current message id */ char *dnsrch[MAXDNSRCH+1]; /* components of domain to search */ char defdname[256]; /* default domain (deprecated) */ u_long pfcode; /* RES_PRF_ flags - see below. */ unsigned ndots:4; /* threshold for initial abs. query */ unsigned nsort:4; /* number of elements in sort_list[] */ char unused[3]; struct { struct in_addr addr; u_int32_t mask; } sort_list[MAXRESOLVSORT]; union { struct sockaddr_in last_nsaddr; /* the server we just talked to */ char pad[72]; /* On an i386 this means 512b total. */ } reserved; #define last_ns reserved.last_nsaddr #if !defined __TCPIP_RESOLVER_BUILD__ } res_state; #endif }; /* * Resolver options (keep these in synch with res_debug.c, please) */ #define RES_INIT 0x00000001 /* address initialized */ #define RES_DEBUG 0x00000002 /* print debug messages */ #define RES_AAONLY 0x00000004 /* authoritative answers only (!IMPL)*/ #define RES_USEVC 0x00000008 /* use virtual circuit */ #define RES_PRIMARY 0x00000010 /* query primary server only (!IMPL) */ #define RES_IGNTC 0x00000020 /* ignore trucation errors */ #define RES_RECURSE 0x00000040 /* recursion desired */ #define RES_DEFNAMES 0x00000080 /* use default domain name */ #define RES_STAYOPEN 0x00000100 /* Keep TCP socket open */ #define RES_DNSRCH 0x00000200 /* search up local domain tree */ #define RES_INSECURE1 0x00000400 /* type 1 security disabled */ #define RES_INSECURE2 0x00000800 /* type 2 security disabled */ #define RES_NOALIASES 0x00001000 /* shuts off HOSTALIASES feature */ #define RES_USE_INET6 0x00002000 /* use/map IPv6 in gethostbyname() */ #define RES_DEFAULT (RES_RECURSE | RES_DEFNAMES | RES_DNSRCH) #define OPT_NONE 0x00000000 #define INT_V4MAPPED 0x00000001 /* * Resolver "pfcode" values. Used by dig. */ #define RES_PRF_STATS 0x00000001 #define RES_PRF_UPDATE 0x00000002 #define RES_PRF_CLASS 0x00000004 #define RES_PRF_CMD 0x00000008 #define RES_PRF_QUES 0x00000010 #define RES_PRF_ANS 0x00000020 #define RES_PRF_AUTH 0x00000040 #define RES_PRF_ADD 0x00000080 #define RES_PRF_HEAD1 0x00000100 #define RES_PRF_HEAD2 0x00000200 #define RES_PRF_TTLID 0x00000400 #define RES_PRF_HEADX 0x00000800 #define RES_PRF_QUERY 0x00001000 #define RES_PRF_REPLY 0x00002000 #define RES_PRF_INIT 0x00004000 /* 0x00008000 */ typedef enum { res_goahead, res_nextns, res_modified, res_done, res_error } res_sendhookact; typedef res_sendhookact (*res_send_qhook) (struct sockaddr_in * const *ns, const u_char **query, int *querylen, u_char *ans, int anssiz, int *resplen); typedef res_sendhookact (*res_send_rhook) (const struct sockaddr_in *ns, const u_char *query, int querylen, u_char *ans, int anssiz, int *resplen); struct res_sym { int number; /* Identifying number, like T_MX */ char * name; /* Its symbolic name, like "MX" */ char * humanname; /* Its fun name, like "mail exchanger" */ }; #if defined __TCPIP_RESOLVER_BUILD__ extern struct __res_state _res; extern const struct res_sym __p_class_syms[]; extern const struct res_sym __p_type_syms[]; #else /* Use interface to get the _res in TCPIP$ACCESS_SHR.EXE */ extern struct __res_state *TCPIP$GET__RES_ADDR(void); extern const struct res_sym *TCPIP$P_CLASS_SYMS(); extern const struct res_sym *TCPIP$P_TYPE_SYMS(); #define _res ((struct __res_state *) TCPIP$GET__RES_ADDR())->res_state #endif #if defined __TCPIP_RESOLVER_BUILD__ #define res_hnok __res_hnok #define res_ownok __res_ownok #define res_mailok __res_mailok #define res_dnok __res_dnok #define sym_ston __sym_ston #define sym_ntos __sym_ntos #define sym_ntop __sym_ntop #define b64_ntop __b64_ntop #define b64_pton __b64_pton #define loc_ntoa __loc_ntoa #define loc_aton __loc_aton #define fp_resstat __fp_resstat #define p_query __p_query #define dn_skipname __dn_skipname #define fp_resstat __fp_resstat #define fp_query __fp_query #define fp_nquery __fp_nquery #define hostalias __hostalias #define putlong __putlong #define putshort __putshort #define p_class __p_class #define p_time __p_time #define p_type __p_type #define p_query __p_query #define p_cdnname __p_cdnname #define p_section __p_section #define p_cdname __p_cdname #define p_fqnname __p_fqnname #define p_fqname __p_fqname #define p_option __p_option #define p_secstodate __p_secstodate #define dn_count_labels __dn_count_labels #define dn_comp __dn_comp #define dn_expand __dn_expand #define res_init __res_init #define res_randomid __res_randomid #define res_query __res_query #define res_search __res_search #define res_querydomain __res_querydomain #define res_mkquery __res_mkquery #define res_send __res_send #define res_isourserver __res_isourserver #define res_nameinquery __res_nameinquery #define res_queriesmatch __res_queriesmatch #define res_close __res_close #define res_update __res_update #define res_mkupdate __res_mkupdate #define res_mkupdrec __res_mkupdrec #define res_freeupdrec __res_freeupdrec #define __p_class_syms __res_p_class_syms #define __p_type_syms __res_p_type_syms #else /* Use interface to ACCESS_SHR */ #define res_hnok TCPIP$RES_HNOK #define res_ownok TCPIP$RES_OWNOK #define res_mailok TCPIP$RES_MAILOK #define res_dnok TCPIP$RES_DNOK #define sym_ston TCPIP$SYM_STON #define sym_ntos TCPIP$SYM_NTOS #define sym_ntop TCPIP$SYM_NTOP #define b64_ntop TCPIP$B64_NTOP #define b64_pton TCPIP$B64_PTON #define loc_ntoa TCPIP$LOC_NTOA #define loc_aton TCPIP$LOC_ATON #define fp_resstat TCPIP$FP_RESSTAT #define p_query TCPIP$P_QUERY #define dn_skipname TCPIP$DN_SKIPNAME #define fp_resstat TCPIP$FP_RESSTAT #define fp_query TCPIP$FP_QUERY #define fp_nquery TCPIP$FP_NQUERY #define hostalias TCPIP$HOSTALIAS #define putlong TCPIP$PUTLONG #define putshort TCPIP$PUTSHORT #define p_class TCPIP$P_CLASS #define p_time TCPIP$P_TIME #define p_type TCPIP$P_TYPE #define p_query TCPIP$P_QUERY #define p_cdnname TCPIP$P_CDNNAME #define p_section TCPIP$P_SECTION #define p_cdname TCPIP$P_CDNAME #define p_fqnname TCPIP$P_FQNNAME #define p_fqname TCPIP$P_FQNAME #define p_option TCPIP$P_OPTION #define p_secstodate TCPIP$P_SECSTODATE #define dn_count_labels TCPIP$DN_COUNT_LABELS #define dn_comp TCPIP$DN_COMP #define dn_expand TCPIP$DN_EXPAND #define res_init TCPIP$RES_INIT #define res_randomid TCPIP$RES_RANDOMID #define res_query TCPIP$RES_QUERY #define res_search TCPIP$RES_SEARCH #define res_querydomain TCPIP$RES_QUERYDOMAIN #define res_mkquery TCPIP$RES_MKQUERY #define res_send TCPIP$RES_SEND #define res_isourserver TCPIP$RES_ISOURSERVER #define res_nameinquery TCPIP$RES_NAMEINQUERY #define res_queriesmatch TCPIP$RES_QUERIESMATCH #define res_close TCPIP$RES_CLOSE #define res_update TCPIP$RES_UPDATE #define res_mkupdate TCPIP$RES_MKUPDATE #define res_mkupdrec TCPIP$RES_MKUPDREC #define res_freeupdrec TCPIP$RES_FREEUPDREC #define __p_class_syms (TCPIP$P_CLASS_SYMS()) #define __p_type_syms (TCPIP$P_TYPE_SYMS()) #define _res_opcodes TCPIP$RES_OPCODES #define _res_resultcodes TCPIP$RES_RESULTCODES #define _res_sectioncodes TCPIP$RES_SECTION_CODES #endif int res_hnok (const char *); int res_ownok (const char *); int res_mailok (const char *); int res_dnok (const char *); int sym_ston (const struct res_sym *, const char *, int *); __const_char_ptr32 sym_ntos (const struct res_sym *, int, int *); __const_char_ptr32 sym_ntop (const struct res_sym *, int, int *); int b64_ntop (u_char const *, size_t, char *, size_t); int b64_pton (char const *, u_char *, size_t); int loc_aton (const char *ascii, u_char *binary); __const_char_ptr32 loc_ntoa (const u_char *binary, char *ascii); int dn_skipname (const u_char *, const u_char *); void fp_resstat (struct __res_state *, FILE *); void fp_query (const u_char *, FILE *); void fp_nquery (const u_char *, int, FILE *); __char_ptr32 hostalias (const char *); void putlong (u_int32_t, u_char *); void putshort (u_int16_t, u_char *); __char_ptr32 p_class (int); __char_ptr32 p_time (u_int32_t); __char_ptr32 p_type (int); void p_query (const u_char *); __u_char_ptr32 p_cdnname (const u_char *, const u_char *, int, FILE *); __u_char_ptr32 p_cdname (const u_char *, const u_char *, FILE *); __u_char_ptr32 p_fqnname (const u_char *cp, const u_char *msg, int, char *, int); __const_u_char_ptr32 p_fqname (const u_char *, const u_char *, FILE *); __char_ptr32 p_option (u_long option); __char_ptr32 p_secstodate (u_long); int dn_count_labels (const char *); int dn_comp (const char *, u_char *, int, u_char **, u_char **); int dn_expand (const u_char *, const u_char *, const u_char *, char *, int); int res_init (void); u_int res_randomid (void); int res_query (const char *, int, int, u_char *, int); int res_search (const char *, int, int, u_char *, int); int res_querydomain (const char *, const char *, int, int, u_char *, int); int res_mkquery (int, const char *, int, int, const u_char *, int, const u_char *, u_char *, int); int res_send (const u_char *, int, u_char *, int); int res_isourserver (const struct sockaddr_in *); int res_nameinquery (const char *, int, int, const u_char *, const u_char *); int res_queriesmatch (const u_char *, const u_char *, const u_char *, const u_char *); void res_close (void); __char_ptr32 p_section (int section, int opcode); int res_update (ns_updrec *); int res_mkupdate (ns_updrec *, u_char *, int); ns_updrec * res_mkupdrec (int, const char *, u_int, u_int, u_long); void res_freeupdrec (ns_updrec *); /* ** Restore the users pointer context */ #if __INITIAL_POINTER_SIZE # pragma __pointer_size __restore #endif #ifdef __cplusplus } #endif #pragma __standard #endif /* __RESOLV_LOADED */ #endif /* __CRTL_VER */