2 * Copyright (c) 2000-2001 Proofpoint, Inc. and its suppliers.
5 * By using this file, you agree to the terms and conditions set
6 * forth in the LICENSE file which can be found at the top level of
7 * the sendmail distribution.
12 * Copyright (c) 1995, 1996, 1997, 1998, 1999 Kungliga Tekniska Högskolan
13 * (Royal Institute of Technology, Stockholm, Sweden).
14 * All rights reserved.
16 * Redistribution and use in source and binary forms, with or without
17 * modification, are permitted provided that the following conditions
20 * 1. Redistributions of source code must retain the above copyright
21 * notice, this list of conditions and the following disclaimer.
23 * 2. Redistributions in binary form must reproduce the above copyright
24 * notice, this list of conditions and the following disclaimer in the
25 * documentation and/or other materials provided with the distribution.
27 * 3. Neither the name of the Institute nor the names of its contributors
28 * may be used to endorse or promote products derived from this software
29 * without specific prior written permission.
31 * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
32 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
33 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
34 * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
35 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
36 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
37 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
38 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
39 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
40 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
44 /* $Id: sm_resolve.h,v 8.9 2013-11-22 20:51:56 ca Exp $ */
50 /* We use these, but they are not always present in <arpa/nameser.h> */
74 unsigned int dns_q_type;
75 unsigned int dns_q_class;
80 unsigned int mx_r_preference;
86 unsigned int srv_r_priority;
87 unsigned int srv_r_weight;
88 unsigned int srv_r_port;
93 typedef struct resource_record RESOURCE_RECORD_T;
95 struct resource_record
99 unsigned int rr_class;
101 unsigned int rr_size;
106 MX_RECORD_T *rr_afsdb; /* mx and afsdb are identical */
107 SRV_RECORDT_T *rr_srv;
109 struct in_addr *rr_a;
112 struct in6_addr *rr_aaaa;
116 RESOURCE_RECORD_T *rr_next;
119 # if !defined(T_A) && !defined(T_AAAA)
120 /* XXX if <arpa/nameser.h> isn't included */
121 typedef int HEADER; /* will never be used */
128 RESOURCE_RECORD_T *dns_r_head;
131 #define SM_DNS_FL_EDNS0 0x01
132 #define SM_DNS_FL_DNSSEC 0x02
134 /* flags for parse_dns_reply() et.al. */
135 #define RR_AS_TEXT 0x01 /* convert some RRs to text, e.g., TLSA */
136 #define RR_RAW 0x02 /* return some RRs as "raw" data */
137 /* currently not used (set, but not read) */
138 #define RR_NO_CNAME 0x04 /* do not try CNAME lookup */
139 #define RR_ONLY_CNAME 0x08 /* if !RR_NO_CNAME" return only CNAME */
141 extern void dns_free_data __P((DNS_REPLY_T *));
142 extern int dns_string_to_type __P((const char *));
143 extern const char *dns_type_to_string __P((int));
144 extern DNS_REPLY_T *dns_lookup_map __P((const char *, int, int, time_t,
146 extern DNS_REPLY_T *dns_lookup_int __P((const char *, int, int, time_t,
147 int, unsigned int, unsigned int, int *, int *));
149 extern DNS_REPLY_T *dns_lookup __P((const char *domain,
150 const char *type_name,
156 struct hostent *dns2he __P((DNS_REPLY_T *, int));
159 /* what to do if family is not supported? add SM_ASSERT()? */
160 #define FAM2T_(family) (((family) == AF_INET) ? T_A : T_AAAA)
163 const char *herrno2txt __P((int));
164 int setherrnofromstring __P((const char *, int *));
165 int getttlfromstring __P((const char *));
166 int tstdns_search __P((const char *, int, int, u_char *, int));
167 int tstdns_querydomain __P((const char *, const char *, int, int, unsigned char *, int));
169 # endif /* DNSSEC_TEST*/
172 # define RES_TRUSTAD 0
174 #define SM_RES_DNSSEC (RES_USE_EDNS0|RES_USE_DNSSEC|RES_TRUSTAD)
176 #endif /* DNSMAP || DANE */
178 #if DNSSEC_TEST || _FFR_NAMESERVER
179 # ifdef _DEFINE_SMR_GLOBALS
182 # define SMR_EXTERN extern
184 SMR_EXTERN char *NameSearchList;
186 extern int nsportip __P((char *));
187 #endif /* DNSSEC_TEST || _FFR_NAMESERVER */
189 #endif /* ! SM_RESOLVE_H */