"Fossies" - the Fresh Open Source Software Archive 
Member "nss_ldap-265/resolve.h" (6 Nov 2009, 3285 Bytes) of package /linux/privat/old/nss_ldap-265.tar.gz:
As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) C and C++ source code syntax highlighting (style:
standard) with prefixed line numbers and
code folding option.
Alternatively you can here
view or
download the uninterpreted source code file.
1 /*
2 * Copyright (c) 1995, 1996, 1997 Kungliga Tekniska Hvgskolan
3 * (Royal Institute of Technology, Stockholm, Sweden).
4 * All rights reserved.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions
8 * are met:
9 *
10 * 1. Redistributions of source code must retain the above copyright
11 * notice, this list of conditions and the following disclaimer.
12 *
13 * 2. Redistributions in binary form must reproduce the above copyright
14 * notice, this list of conditions and the following disclaimer in the
15 * documentation and/or other materials provided with the distribution.
16 *
17 * 3. All advertising materials mentioning features or use of this software
18 * must display the following acknowledgement:
19 * This product includes software developed by the Kungliga Tekniska
20 * Hvgskolan and its contributors.
21 *
22 * 4. Neither the name of the Institute nor the names of its contributors
23 * may be used to endorse or promote products derived from this software
24 * without specific prior written permission.
25 *
26 * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
27 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
28 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
29 * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
30 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
31 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
32 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
33 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
34 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
35 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
36 * SUCH DAMAGE.
37 */
38
39 /* $Id: resolve.h,v 2.6 2009/05/26 07:25:12 lukeh Exp $ */
40
41 /* THIS IS NOT (yet) A PUBLIC INTERFACE */
42
43 #ifndef __RESOLVE_H__
44 #define __RESOLVE_H__
45
46 /* when would this *not* be defined? */
47 #include "config.h"
48
49 #include <arpa/nameser.h>
50 #ifdef HAVE_ARPA_NAMESER_COMPAT_H
51 #include <arpa/nameser_compat.h>
52 #endif
53
54 /* We use these, but they are not always present in <arpa/nameser.h> */
55
56 #ifndef T_TXT
57 #define T_TXT 16
58 #endif
59 #ifndef T_AFSDB
60 #define T_AFSDB 18
61 #endif
62 #ifndef T_SRV
63 #define T_SRV 33
64 #endif
65
66 struct dns_query
67 {
68 char *domain;
69 unsigned type;
70 unsigned class;
71 };
72
73 struct mx_record
74 {
75 unsigned preference;
76 char domain[1];
77 };
78
79 struct srv_record
80 {
81 unsigned priority;
82 unsigned weight;
83 unsigned port;
84 char target[1];
85 };
86
87 struct resource_record
88 {
89 char *domain;
90 unsigned type;
91 unsigned class;
92 unsigned ttl;
93 unsigned size;
94 union
95 {
96 void *data;
97 struct mx_record *mx;
98 struct mx_record *afsdb; /* mx and afsdb are identical */
99 struct srv_record *srv;
100 struct in_addr *a;
101 char *txt;
102 }
103 u;
104 struct resource_record *next;
105 };
106
107 struct dns_reply
108 {
109 HEADER h;
110 struct dns_query q;
111 struct resource_record *head;
112 };
113
114 #define dns_lookup _nss_ldap_dns_lookup
115 #define dns_free_data _nss_ldap_dns_free_data
116
117 struct dns_reply *dns_lookup (const char *, const char *);
118
119 void dns_free_data (struct dns_reply *r);
120
121 #endif /* __RESOLVE_H__ */