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

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