1 /* OPENBSD BASED ON : include/netdb.h */
3 /* $NetBSD: getrrsetbyname.h,v 1.2 2006/02/04 22:32:14 christos Exp $ */
4 /* $OpenBSD: getrrsetbyname.c,v 1.4 2001/08/16 18:16:43 ho Exp $ */
7 * Copyright (c) 2001 Jakob Schlyter. All rights reserved.
9 * Redistribution and use in source and binary forms, with or without
10 * modification, are permitted provided that the following conditions
13 * 1. Redistributions of source code must retain the above copyright
14 * notice, this list of conditions and the following disclaimer.
16 * 2. Redistributions in binary form must reproduce the above copyright
17 * notice, this list of conditions and the following disclaimer in the
18 * documentation and/or other materials provided with the distribution.
20 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
21 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
22 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
23 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
24 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
25 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
26 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
27 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
28 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
29 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
33 * Portions Copyright (c) 1999-2001 Internet Software Consortium.
35 * Permission to use, copy, modify, and distribute this software for any
36 * purpose with or without fee is hereby granted, provided that the above
37 * copyright notice and this permission notice appear in all copies.
39 * THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM
40 * DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL
41 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL
42 * INTERNET SOFTWARE CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT,
43 * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING
44 * FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
45 * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
46 * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
49 #ifndef _GETRRSETBYNAME_H
50 #define _GETRRSETBYNAME_H
54 #ifndef HAVE_GETRRSETBYNAME
56 #include <sys/types.h>
57 #include <netinet/in.h>
58 #include <arpa/nameser.h>
71 * Flags for getrrsetbyname()
73 #ifndef RRSET_VALIDATED
74 # define RRSET_VALIDATED 1
78 * Return codes for getrrsetbyname()
80 #ifndef ERRSET_SUCCESS
81 # define ERRSET_SUCCESS 0
82 # define ERRSET_NOMEMORY 1
83 # define ERRSET_FAIL 2
84 # define ERRSET_INVAL 3
85 # define ERRSET_NONAME 4
86 # define ERRSET_NODATA 5
90 unsigned int rdi_length
; /* length of data */
91 unsigned char *rdi_data
; /* record data */
95 unsigned int rri_flags
; /* RRSET_VALIDATED ... */
96 unsigned int rri_rdclass
; /* class number */
97 unsigned int rri_rdtype
; /* RR type number */
98 unsigned int rri_ttl
; /* time to live */
99 unsigned int rri_nrdatas
; /* size of rdatas array */
100 unsigned int rri_nsigs
; /* size of sigs array */
101 char *rri_name
; /* canonical name */
102 struct rdatainfo
*rri_rdatas
; /* individual records */
103 struct rdatainfo
*rri_sigs
; /* individual signatures */
106 int getrrsetbyname(const char *, unsigned int, unsigned int, unsigned int, struct rrsetinfo
**);
107 void freerrset(struct rrsetinfo
*);
109 #endif /* !defined(HAVE_GETRRSETBYNAME) */
111 #endif /* _GETRRSETBYNAME_H */