sresolv  1.13.16
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
27 #define SOFIA_RESOLV_SRES_RECORD_H
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
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 */
Configuration for Sofia DNS Resolver.
#define SRESPUBFUN
SRESPUBFUN declares an exported function.
Definition: sres_config.h:41
sres_qtypes
Query types.
Definition: sres_record.h:200
@ sres_type_hinfo
Host information.
Definition: sres_record.h:212
@ sres_type_x25
X_25 calling address.
Definition: sres_record.h:218
@ sres_type_sink
Kitchen sink (experimental)
Definition: sres_record.h:241
@ sres_type_atma
ATM Address.
Definition: sres_record.h:234
@ sres_type_soa
Start of authority zone (sres_soa_record).
Definition: sres_record.h:205
@ sres_type_gpos
ICBM record.
Definition: sres_record.h:226
@ sres_type_nimloc
Nimrod Locator.
Definition: sres_record.h:231
@ sres_qtype_axfr
Transfer zone of authority.
Definition: sres_record.h:246
@ sres_type_wks
Well known service.
Definition: sres_record.h:210
@ sres_type_nsap_ptr
Reverse NSAP lookup.
Definition: sres_record.h:222
@ sres_type_naptr
Naming Authority PoinTeR (RFC 2915, sres_naptr_record)
Definition: sres_record.h:235
@ sres_type_afsdb
AFS cell database.
Definition: sres_record.h:217
@ sres_type_mr
Mail rename name.
Definition: sres_record.h:208
@ sres_type_dname
Non-terminal DNAME (for IPv6)
Definition: sres_record.h:240
@ sres_qtype_maila
Transfer mail agent records.
Definition: sres_record.h:248
@ sres_type_ptr
Domain name pointer (sres_ptr_record).
Definition: sres_record.h:211
@ sres_type_srv
Server Selection (RFC 2782, sres_srv_record).
Definition: sres_record.h:232
@ sres_type_aaaa
IPv6 Address (sres_aaaa_record).
Definition: sres_record.h:227
@ sres_qtype_any
Wildcard match.
Definition: sres_record.h:249
@ sres_type_mx
Mail routing information.
Definition: sres_record.h:214
@ sres_type_isdn
ISDN calling address.
Definition: sres_record.h:219
@ sres_type_opt
EDNS 0 option (RFC 2671)
Definition: sres_record.h:242
@ sres_type_a6
IPv6 address (deprecates AAAA)
Definition: sres_record.h:239
@ sres_type_mf
Mail forwarder.
Definition: sres_record.h:203
@ sres_qtype_ixfr
Incremental zone transfer.
Definition: sres_record.h:245
@ sres_type_rp
Responsible person.
Definition: sres_record.h:216
@ sres_type_txt
Text strings.
Definition: sres_record.h:215
@ sres_type_loc
Location Information.
Definition: sres_record.h:228
@ sres_type_nxt
Next domain.
Definition: sres_record.h:229
@ sres_type_eid
Endpoint identifier.
Definition: sres_record.h:230
@ sres_type_a
IPv4 address (sres_a_record).
Definition: sres_record.h:201
@ sres_qtype_mailb
Transfer mailbox records.
Definition: sres_record.h:247
@ sres_type_px
X.400 mail mapping.
Definition: sres_record.h:225
@ sres_type_null
Null resource record.
Definition: sres_record.h:209
@ sres_type_nsap
NSAP address.
Definition: sres_record.h:221
@ sres_type_kx
Key Exchange.
Definition: sres_record.h:237
@ sres_type_cname
Canonical name (sres_cname_record).
Definition: sres_record.h:204
@ sres_type_rt
Router.
Definition: sres_record.h:220
@ sres_type_minfo
Mailbox information.
Definition: sres_record.h:213
@ sres_type_sig
Security signature.
Definition: sres_record.h:223
@ sres_type_mb
Mailbox domain name.
Definition: sres_record.h:206
@ sres_type_cert
Certification record.
Definition: sres_record.h:238
@ sres_qtype_tsig
Transaction signature.
Definition: sres_record.h:244
@ sres_type_key
Security key.
Definition: sres_record.h:224
@ sres_type_ns
Authoritative server.
Definition: sres_record.h:202
@ sres_type_mg
Mail group member.
Definition: sres_record.h:207
struct sres_aaaa_record sres_aaaa_record_t
Address record for IPv6 (RFC 1886).
struct sres_a6_record sres_a6_record_t
Aggregated address record for IPv6 (RFC 2874, deprecated).
struct sres_ptr_record sres_ptr_record_t
Pointer record (RFC 1035).
SRESPUBFUN int sres_record_compare(sres_record_t const *, sres_record_t const *)
Compare two records.
Definition: sres.c:1619
sres_status
Possible values for r_status (RCODE) in sres_common.
Definition: sres_record.h:64
@ SRES_FORMAT_ERR
Server could not interpret query.
Definition: sres_record.h:66
@ SRES_OK
No error condition.
Definition: sres_record.h:65
@ SRES_SERVER_ERR
Server error.
Definition: sres_record.h:67
@ SRES_TIMEOUT_ERR
Timeout occurred.
Definition: sres_record.h:73
@ SRES_NAME_ERR
No domain name.
Definition: sres_record.h:68
@ SRES_NETWORK_ERR
Network or DNS configuration error.
Definition: sres_record.h:76
@ SRES_INTERNAL_ERR
Internal error.
Definition: sres_record.h:75
@ SRES_UNIMPL_ERR
Not implemented.
Definition: sres_record.h:69
@ SRES_AUTH_ERR
Refused.
Definition: sres_record.h:70
@ SRES_RECORD_ERR
Name has no given record type.
Definition: sres_record.h:74
struct sres_common sres_common_t
Common part of all DNS records.
SRESPUBFUN char const * sres_record_type(int type, char buffer[8])
Convert type to its name.
Definition: sres.c:1516
sres_class
Protocol family classes.
Definition: sres_record.h:194
@ sres_class_in
Internet (IN)
Definition: sres_record.h:195
@ sres_class_any
Any class.
Definition: sres_record.h:196
struct sres_a_record sres_a_record_t
Address record (RFC 1035).
SRESPUBFUN char const * sres_record_status(int status, char buffer[8])
Convert status to its name.
Definition: sres.c:1575
struct sres_soa_record sres_soa_record_t
Start of a zone of authority record (RFC 1035).
struct sres_srv_record sres_srv_record_t
Service location record (RFC 2782).
struct sres_naptr_record sres_naptr_record_t
Naming authority pointer record (RFC 2915).
struct sres_generic sres_generic_t
Generic DNS record.
struct sres_cname_record sres_cname_record_t
Canonic name record (RFC 1035).
Aggregated address record for IPv6 (RFC 2874, deprecated).
Definition: sres_record.h:119
uint8_t a6_prelen
Prefix length.
Definition: sres_record.h:121
sres_in6_t a6_suffix
Address suffix.
Definition: sres_record.h:123
sres_common_t a6_record[1]
Common part of DNS records.
Definition: sres_record.h:120
char * a6_prename
Prefix name.
Definition: sres_record.h:124
Address record (RFC 1035).
Definition: sres_record.h:103
sres_common_t a_record[1]
Common part of DNS records.
Definition: sres_record.h:104
struct in_addr a_addr
IP4 address.
Definition: sres_record.h:105
Address record for IPv6 (RFC 1886).
Definition: sres_record.h:129
sres_in6_t aaaa_addr
IP6 address.
Definition: sres_record.h:131
sres_common_t aaaa_record[1]
Common part of DNS records.
Definition: sres_record.h:130
Canonic name record (RFC 1035).
Definition: sres_record.h:136
sres_common_t cn_record[1]
Common part of DNS records.
Definition: sres_record.h:137
Common part of all DNS records.
Definition: sres_record.h:51
uint16_t r_parsed
Nonzero if parsed.
Definition: sres_record.h:60
uint16_t r_class
Record class (IN)
Definition: sres_record.h:57
int r_refcount
Number of references to this record.
Definition: sres_record.h:52
uint16_t r_rdlen
Length of record data.
Definition: sres_record.h:59
uint16_t r_size
Size of this record.
Definition: sres_record.h:55
uint16_t r_type
Record type (A, CNAME, A6, etc)
Definition: sres_record.h:56
char * r_name
Domain name.
Definition: sres_record.h:53
uint16_t r_status
Status of query (nonzero upon an error)
Definition: sres_record.h:54
uint32_t r_ttl
Time-to-live.
Definition: sres_record.h:58
Generic DNS record.
Definition: sres_record.h:96
sres_common_t g_record[1]
Common part of DNS records.
Definition: sres_record.h:97
uint8_t g_data[128]
Record data.
Definition: sres_record.h:98
IPv6 address used by sresolv library.
Definition: sres_record.h:113
Naming authority pointer record (RFC 2915).
Definition: sres_record.h:161
char * na_regexp
Substitution expression.
Definition: sres_record.h:167
char * na_replace
Replacement.
Definition: sres_record.h:168
uint16_t na_prefer
Preference.
Definition: sres_record.h:164
sres_common_t na_record[1]
Common part of DNS records.
Definition: sres_record.h:162
char * na_services
Services available.
Definition: sres_record.h:166
char * na_flags
Flags for interpretation and rewriting.
Definition: sres_record.h:165
uint16_t na_order
Processing order for NAPTR records.
Definition: sres_record.h:163
Pointer record (RFC 1035).
Definition: sres_record.h:143
sres_common_t ptr_record[1]
Common part of DNS records.
Definition: sres_record.h:144
char * ptr_domain
Domain.
Definition: sres_record.h:145
Start of a zone of authority record (RFC 1035).
Definition: sres_record.h:83
uint32_t soa_refresh
Refresh intercal.
Definition: sres_record.h:88
uint32_t soa_expire
Upper limit on zone expiration time
Definition: sres_record.h:90
char * soa_rname
Person responsible for domain.
Definition: sres_record.h:86
uint32_t soa_serial
Version number.
Definition: sres_record.h:87
uint32_t soa_minimum
Minimum TTL for any record in zone.
Definition: sres_record.h:91
char * soa_mname
Primary name server.
Definition: sres_record.h:85
uint32_t soa_retry
Interval between refres retries.
Definition: sres_record.h:89
sres_common_t soa_record[1]
Common part of DNS records.
Definition: sres_record.h:84
Service location record (RFC 2782).
Definition: sres_record.h:150
char * srv_target
Domain name of the target host.
Definition: sres_record.h:156
uint16_t srv_port
Service port on the target host.
Definition: sres_record.h:154
uint16_t srv_priority
Priority.
Definition: sres_record.h:152
sres_common_t srv_record[1]
Common part of DNS records.
Definition: sres_record.h:151
uint16_t srv_weight
Weight.
Definition: sres_record.h:153
SU_U32_T uint32_t
SU_U16_T uint16_t
SU_U8_T uint8_t
Union of different DNS records.
Definition: sres_record.h:180
sres_common_t sr_record[1]
Common part of all DNS records.
Definition: sres_record.h:181
sres_soa_record_t sr_soa[1]
SOA (start-of-authority) record.
Definition: sres_record.h:183
sres_aaaa_record_t sr_aaaa[1]
AAAA (IP6 address) record.
Definition: sres_record.h:188
sres_srv_record_t sr_srv[1]
SRV record.
Definition: sres_record.h:189
sres_a6_record_t sr_a6[1]
A6 (IP6 address) record.
Definition: sres_record.h:187
sres_cname_record_t sr_cname[1]
CNAME (canonic name) record.
Definition: sres_record.h:185
sres_a_record_t sr_a[1]
A (address) record.
Definition: sres_record.h:184
sres_naptr_record_t sr_naptr[1]
NAPTR record.
Definition: sres_record.h:190
sres_ptr_record_t sr_ptr[1]
PTR (pointer) record.
Definition: sres_record.h:186
sres_generic_t sr_generic[1]
Generic (unparsed) DNS record.
Definition: sres_record.h:182

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