sresolv  1.12.11devel
sres_record.h
Go to the documentation of this file.
1 /*
2  * This file is part of the Sofia-SIP package
3  *
4  * Copyright (C) 2005 Nokia Corporation.
5  *
6  * Contact: Pekka Pessi <pekka.pessi@nokia-email.address.hidden>
7  *
8  * This library is free software; you can redistribute it and/or
9  * modify it under the terms of the GNU Lesser General Public License
10  * as published by the Free Software Foundation; either version 2.1 of
11  * the License, or (at your option) any later version.
12  *
13  * This library is distributed in the hope that it will be useful, but
14  * WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16  * Lesser General Public License for more details.
17  *
18  * You should have received a copy of the GNU Lesser General Public
19  * License along with this library; if not, write to the Free Software
20  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
21  * 02110-1301 USA
22  *
23  */
24 
25 #ifndef SOFIA_RESOLV_SRES_RECORD_H
26 
27 #define SOFIA_RESOLV_SRES_RECORD_H
28 
44 
45 #ifdef __cplusplus
46 extern "C" {
47 #endif
48 
50 typedef struct sres_common
51 {
52  int r_refcount;
53  char *r_name;
62 
65  SRES_OK = 0,
72  /* Errors generated by sresolv */
78  _SRES_LAST_ERR
79 };
80 
82 typedef struct sres_soa_record
83 {
85  char *soa_mname;
86  char *soa_rname;
93 
95 typedef struct sres_generic
96 {
98  uint8_t g_data[128];
100 
102 typedef struct sres_a_record
103 {
105  struct in_addr a_addr;
107 
112 typedef struct
113 {
114  uint8_t u6_addr[16];
115 } sres_in6_t;
116 
118 typedef struct sres_a6_record
119 {
122  uint8_t a6_pad[3];
124  char *a6_prename;
126 
128 typedef struct sres_aaaa_record
129 {
133 
135 typedef struct sres_cname_record
136 {
138  char *cn_cname;
140 
142 typedef struct sres_ptr_record
143 {
145  char *ptr_domain;
147 
149 typedef struct sres_srv_record
150 {
155  uint16_t srv_pad;
156  char *srv_target;
158 
160 typedef struct sres_naptr_record
161 {
165  char *na_flags;
166  char *na_services;
167  char *na_regexp;
168  char *na_replace;
170 
171 
172 #ifndef SRES_RECORD_T
173 #define SRES_RECORD_T
174 
175 typedef union sres_record sres_record_t;
176 #endif
177 
180 {
191 };
192 
196  sres_class_any = 255
197 };
198 
232  sres_type_srv = 33,
235  sres_type_naptr = 35,
249  sres_qtype_any = 255
250 };
251 
253 SRESPUBFUN char const *sres_record_type(int type, char buffer[8]);
254 
256 SRESPUBFUN char const *sres_record_status(int status, char buffer[8]);
257 
260  sres_record_t const *);
261 
262 #ifdef __cplusplus
263 }
264 #endif
265 
266 #endif /* SOFIA_RESOLV_SRES_CACHE_H */
sres_common::r_status
uint16_t r_status
Status of query (nonzero upon an error)
Definition: sres_record.h:54
sres_qtype_ixfr
@ sres_qtype_ixfr
Incremental zone transfer.
Definition: sres_record.h:245
SRES_TIMEOUT_ERR
@ SRES_TIMEOUT_ERR
Timeout occurred.
Definition: sres_record.h:73
sres_generic
Generic DNS record.
Definition: sres_record.h:96
sres_a6_record_t
struct sres_a6_record sres_a6_record_t
Aggregated address record for IPv6 (RFC 2874, deprecated).
sres_srv_record::srv_record
sres_common_t srv_record[1]
Common part of DNS records.
Definition: sres_record.h:151
sres_type_nsap
@ sres_type_nsap
NSAP address.
Definition: sres_record.h:221
sres_a6_record
Aggregated address record for IPv6 (RFC 2874, deprecated).
Definition: sres_record.h:119
sres_type_eid
@ sres_type_eid
Endpoint identifier.
Definition: sres_record.h:230
sres_soa_record::soa_record
sres_common_t soa_record[1]
Common part of DNS records.
Definition: sres_record.h:84
sres_ptr_record::ptr_record
sres_common_t ptr_record[1]
Common part of DNS records.
Definition: sres_record.h:144
sres_naptr_record::na_record
sres_common_t na_record[1]
Common part of DNS records.
Definition: sres_record.h:162
sres_common::r_rdlen
uint16_t r_rdlen
Length of record data.
Definition: sres_record.h:59
sres_naptr_record
Naming authority pointer record (RFC 2915).
Definition: sres_record.h:161
sres_type_null
@ sres_type_null
Null resource record.
Definition: sres_record.h:209
sres_soa_record::soa_retry
uint32_t soa_retry
Interval between refres retries.
Definition: sres_record.h:89
sres_type_ptr
@ sres_type_ptr
Domain name pointer (sres_ptr_record).
Definition: sres_record.h:211
sres_record::sr_a6
sres_a6_record_t sr_a6[1]
A6 (IP6 address) record.
Definition: sres_record.h:187
sres_record_type
SRESPUBFUN char const * sres_record_type(int type, char buffer[8])
Convert type to its name.
Definition: sres.c:1504
SRES_FORMAT_ERR
@ SRES_FORMAT_ERR
Server could not interpret query.
Definition: sres_record.h:66
uint32_t
SU_U32_T uint32_t
sres_a_record::a_addr
struct in_addr a_addr
IP4 address.
Definition: sres_record.h:105
sres_config.h
Configuration for Sofia DNS Resolver.
sres_a_record::a_record
sres_common_t a_record[1]
Common part of DNS records.
Definition: sres_record.h:104
sres_type_mr
@ sres_type_mr
Mail rename name.
Definition: sres_record.h:208
sres_type_a
@ sres_type_a
IPv4 address (sres_a_record).
Definition: sres_record.h:201
sres_soa_record::soa_rname
char * soa_rname
Person responsible for domain.
Definition: sres_record.h:86
sres_type_afsdb
@ sres_type_afsdb
AFS cell database.
Definition: sres_record.h:217
sres_record::sr_aaaa
sres_aaaa_record_t sr_aaaa[1]
AAAA (IP6 address) record.
Definition: sres_record.h:188
sres_generic_t
struct sres_generic sres_generic_t
Generic DNS record.
sres_naptr_record::na_order
uint16_t na_order
Processing order for NAPTR records.
Definition: sres_record.h:163
sres_qtype_axfr
@ sres_qtype_axfr
Transfer zone of authority.
Definition: sres_record.h:246
sres_ptr_record_t
struct sres_ptr_record sres_ptr_record_t
Pointer record (RFC 1035).
sres_type_sig
@ sres_type_sig
Security signature.
Definition: sres_record.h:223
SRES_SERVER_ERR
@ SRES_SERVER_ERR
Server error.
Definition: sres_record.h:67
SRES_UNIMPL_ERR
@ SRES_UNIMPL_ERR
Not implemented.
Definition: sres_record.h:69
sres_in6_t
IPv6 address used by sresolv library.
Definition: sres_record.h:113
sres_common::r_ttl
uint32_t r_ttl
Time-to-live.
Definition: sres_record.h:58
sres_record::sr_srv
sres_srv_record_t sr_srv[1]
SRV record.
Definition: sres_record.h:189
sres_srv_record::srv_target
char * srv_target
Domain name of the target host.
Definition: sres_record.h:156
sres_common::r_name
char * r_name
Domain name.
Definition: sres_record.h:53
sres_cname_record
Canonic name record (RFC 1035).
Definition: sres_record.h:136
sres_naptr_record::na_prefer
uint16_t na_prefer
Preference.
Definition: sres_record.h:164
sres_soa_record::soa_refresh
uint32_t soa_refresh
Refresh intercal.
Definition: sres_record.h:88
sres_ptr_record
Pointer record (RFC 1035).
Definition: sres_record.h:143
sres_record::sr_naptr
sres_naptr_record_t sr_naptr[1]
NAPTR record.
Definition: sres_record.h:190
sres_type_gpos
@ sres_type_gpos
ICBM record.
Definition: sres_record.h:226
sres_type_rt
@ sres_type_rt
Router.
Definition: sres_record.h:220
sres_type_atma
@ sres_type_atma
ATM Address.
Definition: sres_record.h:234
sres_aaaa_record::aaaa_addr
sres_in6_t aaaa_addr
IP6 address.
Definition: sres_record.h:131
sres_type_hinfo
@ sres_type_hinfo
Host information.
Definition: sres_record.h:212
sres_a6_record::a6_suffix
sres_in6_t a6_suffix
Address suffix.
Definition: sres_record.h:123
sres_status
sres_status
Possible values for r_status (RCODE) in sres_common.
Definition: sres_record.h:64
sres_soa_record::soa_minimum
uint32_t soa_minimum
Minimum TTL for any record in zone.
Definition: sres_record.h:91
sres_aaaa_record::aaaa_record
sres_common_t aaaa_record[1]
Common part of DNS records.
Definition: sres_record.h:130
sres_type_mb
@ sres_type_mb
Mailbox domain name.
Definition: sres_record.h:206
sres_record::sr_cname
sres_cname_record_t sr_cname[1]
CNAME (canonic name) record.
Definition: sres_record.h:185
sres_common::r_refcount
int r_refcount
Number of references to this record.
Definition: sres_record.h:52
sres_qtype_mailb
@ sres_qtype_mailb
Transfer mailbox records.
Definition: sres_record.h:247
sres_cname_record::cn_record
sres_common_t cn_record[1]
Common part of DNS records.
Definition: sres_record.h:137
sres_soa_record
Start of a zone of authority record (RFC 1035).
Definition: sres_record.h:83
sres_type_srv
@ sres_type_srv
Server Selection (RFC 2782, sres_srv_record).
Definition: sres_record.h:232
sres_type_mf
@ sres_type_mf
Mail forwarder.
Definition: sres_record.h:203
sres_type_soa
@ sres_type_soa
Start of authority zone (sres_soa_record).
Definition: sres_record.h:205
sres_a_record_t
struct sres_a_record sres_a_record_t
Address record (RFC 1035).
sres_class_in
@ sres_class_in
Internet (IN)
Definition: sres_record.h:195
SRESPUBFUN
#define SRESPUBFUN
SRESPUBFUN declares an exported function.
Definition: sres_config.h:41
sres_type_loc
@ sres_type_loc
Location Information.
Definition: sres_record.h:228
sres_type_nsap_ptr
@ sres_type_nsap_ptr
Reverse NSAP lookup.
Definition: sres_record.h:222
sres_record_status
SRESPUBFUN char const * sres_record_status(int status, char buffer[8])
Convert status to its name.
Definition: sres.c:1563
sres_type_mg
@ sres_type_mg
Mail group member.
Definition: sres_record.h:207
sres_common_t
struct sres_common sres_common_t
Common part of all DNS records.
sres_common::r_size
uint16_t r_size
Size of this record.
Definition: sres_record.h:55
SRES_OK
@ SRES_OK
No error condition.
Definition: sres_record.h:65
sres_generic::g_data
uint8_t g_data[128]
Record data.
Definition: sres_record.h:98
sres_type_key
@ sres_type_key
Security key.
Definition: sres_record.h:224
sres_type_txt
@ sres_type_txt
Text strings.
Definition: sres_record.h:215
sres_class
sres_class
Protocol family classes.
Definition: sres_record.h:194
sres_qtypes
sres_qtypes
Query types.
Definition: sres_record.h:200
sres_cname_record_t
struct sres_cname_record sres_cname_record_t
Canonic name record (RFC 1035).
sres_srv_record::srv_weight
uint16_t srv_weight
Weight.
Definition: sres_record.h:153
sres_type_mx
@ sres_type_mx
Mail routing information.
Definition: sres_record.h:214
sres_class_any
@ sres_class_any
Any class.
Definition: sres_record.h:196
sres_type_opt
@ sres_type_opt
EDNS 0 option (RFC 2671)
Definition: sres_record.h:242
sres_type_dname
@ sres_type_dname
Non-terminal DNAME (for IPv6)
Definition: sres_record.h:240
sres_type_x25
@ sres_type_x25
X_25 calling address.
Definition: sres_record.h:218
SRES_AUTH_ERR
@ SRES_AUTH_ERR
Refused.
Definition: sres_record.h:70
sres_qtype_tsig
@ sres_qtype_tsig
Transaction signature.
Definition: sres_record.h:244
sres_srv_record::srv_priority
uint16_t srv_priority
Priority.
Definition: sres_record.h:152
sres_record::sr_record
sres_common_t sr_record[1]
Common part of all DNS records.
Definition: sres_record.h:181
sres_a6_record::a6_record
sres_common_t a6_record[1]
Common part of DNS records.
Definition: sres_record.h:120
sres_naptr_record::na_regexp
char * na_regexp
Substitution expression.
Definition: sres_record.h:167
sres_common::r_parsed
uint16_t r_parsed
Nonzero if parsed.
Definition: sres_record.h:60
sres_soa_record_t
struct sres_soa_record sres_soa_record_t
Start of a zone of authority record (RFC 1035).
sres_type_nxt
@ sres_type_nxt
Next domain.
Definition: sres_record.h:229
sres_srv_record_t
struct sres_srv_record sres_srv_record_t
Service location record (RFC 2782).
SRES_NAME_ERR
@ SRES_NAME_ERR
No domain name.
Definition: sres_record.h:68
sres_ptr_record::ptr_domain
char * ptr_domain
Domain.
Definition: sres_record.h:145
sres_common
Common part of all DNS records.
Definition: sres_record.h:51
sres_aaaa_record_t
struct sres_aaaa_record sres_aaaa_record_t
Address record for IPv6 (RFC 1886).
sres_type_a6
@ sres_type_a6
IPv6 address (deprecates AAAA)
Definition: sres_record.h:239
sres_a6_record::a6_prelen
uint8_t a6_prelen
Prefix length.
Definition: sres_record.h:121
sres_record_compare
SRESPUBFUN int sres_record_compare(sres_record_t const *, sres_record_t const *)
Compare two records.
Definition: sres.c:1607
sres_srv_record::srv_port
uint16_t srv_port
Service port on the target host.
Definition: sres_record.h:154
sres_common::r_type
uint16_t r_type
Record type (A, CNAME, A6, etc)
Definition: sres_record.h:56
sres_type_cert
@ sres_type_cert
Certification record.
Definition: sres_record.h:238
sres_qtype_maila
@ sres_qtype_maila
Transfer mail agent records.
Definition: sres_record.h:248
sres_a_record
Address record (RFC 1035).
Definition: sres_record.h:103
SRES_RECORD_ERR
@ SRES_RECORD_ERR
Name has no given record type.
Definition: sres_record.h:74
sres_record
Union of different DNS records.
Definition: sres_record.h:180
sres_type_rp
@ sres_type_rp
Responsible person.
Definition: sres_record.h:216
sres_qtype_any
@ sres_qtype_any
Wildcard match.
Definition: sres_record.h:249
sres_type_nimloc
@ sres_type_nimloc
Nimrod Locator.
Definition: sres_record.h:231
sres_soa_record::soa_expire
uint32_t soa_expire
Upper limit on zone expiration time
Definition: sres_record.h:90
sres_type_cname
@ sres_type_cname
Canonical name (sres_cname_record).
Definition: sres_record.h:204
sres_aaaa_record
Address record for IPv6 (RFC 1886).
Definition: sres_record.h:129
sres_type_sink
@ sres_type_sink
Kitchen sink (experimental)
Definition: sres_record.h:241
uint16_t
SU_U16_T uint16_t
sres_type_minfo
@ sres_type_minfo
Mailbox information.
Definition: sres_record.h:213
sres_a6_record::a6_prename
char * a6_prename
Prefix name.
Definition: sres_record.h:124
sres_naptr_record_t
struct sres_naptr_record sres_naptr_record_t
Naming authority pointer record (RFC 2915).
sres_soa_record::soa_mname
char * soa_mname
Primary name server.
Definition: sres_record.h:85
sres_record::sr_generic
sres_generic_t sr_generic[1]
Generic (unparsed) DNS record.
Definition: sres_record.h:182
sres_generic::g_record
sres_common_t g_record[1]
Common part of DNS records.
Definition: sres_record.h:97
sres_type_kx
@ sres_type_kx
Key Exchange.
Definition: sres_record.h:237
sres_record::sr_ptr
sres_ptr_record_t sr_ptr[1]
PTR (pointer) record.
Definition: sres_record.h:186
sres_naptr_record::na_services
char * na_services
Services available.
Definition: sres_record.h:166
sres_type_isdn
@ sres_type_isdn
ISDN calling address.
Definition: sres_record.h:219
sres_type_ns
@ sres_type_ns
Authoritative server.
Definition: sres_record.h:202
sres_type_px
@ sres_type_px
X.400 mail mapping.
Definition: sres_record.h:225
SRES_NETWORK_ERR
@ SRES_NETWORK_ERR
Network or DNS configuration error.
Definition: sres_record.h:76
sres_common::r_class
uint16_t r_class
Record class (IN)
Definition: sres_record.h:57
sres_type_aaaa
@ sres_type_aaaa
IPv6 Address (sres_aaaa_record).
Definition: sres_record.h:227
SRES_INTERNAL_ERR
@ SRES_INTERNAL_ERR
Internal error.
Definition: sres_record.h:75
sres_type_naptr
@ sres_type_naptr
Naming Authority PoinTeR (RFC 2915, sres_naptr_record)
Definition: sres_record.h:235
sres_srv_record
Service location record (RFC 2782).
Definition: sres_record.h:150
sres_type_wks
@ sres_type_wks
Well known service.
Definition: sres_record.h:210
sres_record::sr_soa
sres_soa_record_t sr_soa[1]
SOA (start-of-authority) record.
Definition: sres_record.h:183
uint8_t
SU_U8_T uint8_t
sres_soa_record::soa_serial
uint32_t soa_serial
Version number.
Definition: sres_record.h:87
sres_naptr_record::na_flags
char * na_flags
Flags for interpretation and rewriting.
Definition: sres_record.h:165
sres_naptr_record::na_replace
char * na_replace
Replacement.
Definition: sres_record.h:168
sres_record::sr_a
sres_a_record_t sr_a[1]
A (address) record.
Definition: sres_record.h:184

Sofia-SIP 1.12.11devel - Copyright (C) 2006 Nokia Corporation. All rights reserved. Licensed under the terms of the GNU Lesser General Public License.