ze-filter
(ze-filter-0.8.0-develop-180218)
ze-dns.h
Go to the documentation of this file.
1
/*
2
* Copyright (c) 2000-2001 Sendmail, Inc. and its suppliers.
3
* All rights reserved.
4
*
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.
8
*
9
*/
10
11
/*
12
* Copyright (c) 1995, 1996, 1997, 1998, 1999 Kungliga Tekniska Högskolan
13
* (Royal Institute of Technology, Stockholm, Sweden).
14
* All rights reserved.
15
*
16
* Redistribution and use in source and binary forms, with or without
17
* modification, are permitted provided that the following conditions
18
* are met:
19
*
20
* 1. Redistributions of source code must retain the above copyright
21
* notice, this list of conditions and the following disclaimer.
22
*
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.
26
*
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.
30
*
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
41
* SUCH DAMAGE.
42
*/
43
44
/* $Id: sm_resolve.h,v 8.8 2001/09/01 00:06:02 gshapiro Exp $ */
45
46
#ifndef __ZE_ROKEN_RESOLVE_H
47
53
/* We use these, but they are not always present in <arpa/nameser.h> */
54
55
#define NETINET6 1
56
57
# ifndef T_TXT
58
# define T_TXT 16
59
# endif
/* ! T_TXT */
60
# ifndef T_AFSDB
61
# define T_AFSDB 18
62
# endif
/* ! T_AFSDB */
63
# ifndef T_SRV
64
# define T_SRV 33
65
# endif
/* ! T_SRV */
66
# ifndef T_NAPTR
67
# define T_NAPTR 35
68
# endif
/* ! T_NAPTR */
69
70
typedef
struct
71
{
72
char
*
dns_q_domain
;
73
unsigned
int
dns_q_type
;
74
unsigned
int
dns_q_class
;
75
}
DNS_QUERY_T
;
76
77
typedef
struct
78
{
79
unsigned
int
mx_r_preference
;
80
char
mx_r_domain[1];
81
}
MX_RECORD_T
;
82
83
typedef
struct
84
{
85
unsigned
int
srv_r_priority
;
86
unsigned
int
srv_r_weight
;
87
unsigned
int
srv_r_port
;
88
char
srv_r_target[1];
89
}
SRV_RECORDT_T
;
90
91
92
typedef
struct
resource_record
RR_RECORD_T
;
93
94
struct
resource_record
95
{
96
char
*
rr_domain
;
97
unsigned
int
rr_type
;
98
unsigned
int
rr_class
;
99
unsigned
int
rr_ttl
;
100
unsigned
int
rr_size
;
101
union
102
{
103
void
*
rr_data
;
104
MX_RECORD_T
*
rr_mx
;
105
MX_RECORD_T
*
rr_afsdb
;
/* mx and afsdb are identical */
106
SRV_RECORDT_T
*
rr_srv
;
107
struct
in_addr *
rr_a
;
108
# if NETINET6
109
struct
in6_addr *
rr_aaaa
;
110
# endif
/* NETINET6 */
111
char
*
rr_txt
;
112
}
rr_u
;
113
RR_RECORD_T
*
rr_next
;
114
};
115
116
# if !defined(T_A) && !defined(T_AAAA)
117
/* XXX if <arpa/nameser.h> isn't included */
118
typedef
int
HEADER
;
/* will never be used */
119
# endif
/* !defined(T_A) && !defined(T_AAAA) */
120
121
typedef
struct
122
{
123
uint32_t
dns_signature
;
124
HEADER
dns_r_h
;
125
DNS_QUERY_T
dns_r_q
;
126
RR_RECORD_T
*
dns_r_head
;
127
int
dns_error
;
128
}
DNS_REPLY_T
;
129
130
131
void
dns_free_data
(
DNS_REPLY_T
*);
132
int
dns_string_to_type
(
const
char
*);
133
134
const
char
*
dns_type_to_string
(
int
);
135
136
int
dns_lookup
(
const
char
*
domain
,
137
const
char
*type_name,
138
time_t retrans,
int
retry,
DNS_REPLY_T
*);
139
140
#define DNS_NO_ERR 0
141
#define DNS_ERR_TMPFAIL -1
142
#define DNS_ERR_NOTFOUND -2
143
#define DNS_ERR_SRV -3
144
#define DNS_LOC_ERR -4
145
146
extern
bool
dns_lock
;
147
150
# define __ZE_ROKEN_RESOLVE_H
151
#endif
/* __ZE_ROKEN_RESOLVE_H */
MX_RECORD_T
Definition:
ze-dns.h:77
resource_record::rr_srv
SRV_RECORDT_T * rr_srv
Definition:
ze-dns.h:106
HEADER
int HEADER
Definition:
ze-dns.h:118
dns_lock
bool dns_lock
resource_record::rr_class
unsigned int rr_class
Definition:
ze-dns.h:98
DNS_REPLY_T::dns_r_q
DNS_QUERY_T dns_r_q
Definition:
ze-dns.h:125
resource_record::rr_next
RR_RECORD_T * rr_next
Definition:
ze-dns.h:113
DNS_QUERY_T::dns_q_domain
char * dns_q_domain
Definition:
ze-dns.h:72
resource_record::rr_data
void * rr_data
Definition:
ze-dns.h:103
dns_lookup
int dns_lookup(const char *domain, const char *type_name, time_t retrans, int retry, DNS_REPLY_T *)
resource_record
Definition:
ze-dns.h:94
DNS_REPLY_T::dns_r_h
HEADER dns_r_h
Definition:
ze-dns.h:124
SRV_RECORDT_T::srv_r_weight
unsigned int srv_r_weight
Definition:
ze-dns.h:86
SRV_RECORDT_T::srv_r_port
unsigned int srv_r_port
Definition:
ze-dns.h:87
resource_record::rr_u
union resource_record::@0 rr_u
SRV_RECORDT_T
Definition:
ze-dns.h:83
resource_record::rr_ttl
unsigned int rr_ttl
Definition:
ze-dns.h:99
dns_type_to_string
const char * dns_type_to_string(int)
Definition:
ze-dns.c:164
DNS_REPLY_T::dns_error
int dns_error
Definition:
ze-dns.h:127
resource_record::rr_mx
MX_RECORD_T * rr_mx
Definition:
ze-dns.h:104
dns_free_data
void dns_free_data(DNS_REPLY_T *)
Definition:
ze-dns.c:190
DNS_QUERY_T::dns_q_class
unsigned int dns_q_class
Definition:
ze-dns.h:74
resource_record::rr_size
unsigned int rr_size
Definition:
ze-dns.h:100
DNS_REPLY_T::dns_signature
uint32_t dns_signature
Definition:
ze-dns.h:123
resource_record::rr_txt
char * rr_txt
Definition:
ze-dns.h:111
resource_record::rr_a
struct in_addr * rr_a
Definition:
ze-dns.h:107
MX_RECORD_T::mx_r_preference
unsigned int mx_r_preference
Definition:
ze-dns.h:79
DNS_REPLY_T::dns_r_head
RR_RECORD_T * dns_r_head
Definition:
ze-dns.h:126
resource_record::rr_domain
char * rr_domain
Definition:
ze-dns.h:96
DNS_QUERY_T
Definition:
ze-dns.h:70
DNS_REPLY_T
Definition:
ze-dns.h:121
resource_record::rr_aaaa
struct in6_addr * rr_aaaa
Definition:
ze-dns.h:109
DNS_QUERY_T::dns_q_type
unsigned int dns_q_type
Definition:
ze-dns.h:73
SRV_RECORDT_T::srv_r_priority
unsigned int srv_r_priority
Definition:
ze-dns.h:85
dns_string_to_type
int dns_string_to_type(const char *)
resource_record::rr_type
unsigned int rr_type
Definition:
ze-dns.h:97
resource_record::rr_afsdb
MX_RECORD_T * rr_afsdb
Definition:
ze-dns.h:105
uint32_t
long uint32_t
Definition:
ze-sys.h:489
domain
char domain[]
include
ze-dns.h
Generated by
1.8.13