#ifndef __RESOLV_LOADED #define __RESOLV_LOADED 1 #pragma __nostandard #include #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 2000 Compaq Computer Corporation ** ** Compaq and the Compaq logo Registered in U.S. Patent and Trademark Office. ** ** Confidential computer software. Valid license from Compaq required for ** possession, use or copying. Consistent with FAR 12.211 and 12.212, ** Commercial Computer Software, Computer Software Documentation, and ** Technical Data for Commercial Items are licensed to the U.S. Government ** under vendor's standard commercial license. ** ****************************************************************************** */ #ifdef __cplusplus extern "C" { #endif #include #include #include #include #include #if __INITIAL_POINTER_SIZE # pragma __pointer_size __save # pragma __pointer_size 32 #endif /* ** Conditionally define in_addr_t and __u_char_ptr32 structures */ #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 /* * 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) /* * 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" */ }; /* ** The following procedures are not defined in the DECC$SHR image, but ** instead must be resolved with the TCPIP images. ** ** If the user has defined a feature test macro, __TCPIP_GLOBALS, we will ** define these functions as globals which are resolved by a TCPIP object ** library. */ #ifdef __TCPIP_GLOBALS #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 #if 0 # define hostalias TCPIP$HOSTALIAS #endif #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 /* ** Function prototypes */ 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 #endif /* __RESOLV_LOADED */ #pragma __standard #endif /* __CRTL_VER */