xref: /aosp_15_r20/external/libevent/include/event2/dns_struct.h (revision 663afb9b963571284e0f0a60f257164ab54f64bf)
1*663afb9bSAndroid Build Coastguard Worker /*
2*663afb9bSAndroid Build Coastguard Worker  * Copyright (c) 2000-2007 Niels Provos <[email protected]>
3*663afb9bSAndroid Build Coastguard Worker  * Copyright (c) 2007-2012 Niels Provos and Nick Mathewson
4*663afb9bSAndroid Build Coastguard Worker  *
5*663afb9bSAndroid Build Coastguard Worker  * Redistribution and use in source and binary forms, with or without
6*663afb9bSAndroid Build Coastguard Worker  * modification, are permitted provided that the following conditions
7*663afb9bSAndroid Build Coastguard Worker  * are met:
8*663afb9bSAndroid Build Coastguard Worker  * 1. Redistributions of source code must retain the above copyright
9*663afb9bSAndroid Build Coastguard Worker  *    notice, this list of conditions and the following disclaimer.
10*663afb9bSAndroid Build Coastguard Worker  * 2. Redistributions in binary form must reproduce the above copyright
11*663afb9bSAndroid Build Coastguard Worker  *    notice, this list of conditions and the following disclaimer in the
12*663afb9bSAndroid Build Coastguard Worker  *    documentation and/or other materials provided with the distribution.
13*663afb9bSAndroid Build Coastguard Worker  * 3. The name of the author may not be used to endorse or promote products
14*663afb9bSAndroid Build Coastguard Worker  *    derived from this software without specific prior written permission.
15*663afb9bSAndroid Build Coastguard Worker  *
16*663afb9bSAndroid Build Coastguard Worker  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
17*663afb9bSAndroid Build Coastguard Worker  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
18*663afb9bSAndroid Build Coastguard Worker  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
19*663afb9bSAndroid Build Coastguard Worker  * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
20*663afb9bSAndroid Build Coastguard Worker  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
21*663afb9bSAndroid Build Coastguard Worker  * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
22*663afb9bSAndroid Build Coastguard Worker  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
23*663afb9bSAndroid Build Coastguard Worker  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24*663afb9bSAndroid Build Coastguard Worker  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
25*663afb9bSAndroid Build Coastguard Worker  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26*663afb9bSAndroid Build Coastguard Worker  */
27*663afb9bSAndroid Build Coastguard Worker #ifndef EVENT2_DNS_STRUCT_H_INCLUDED_
28*663afb9bSAndroid Build Coastguard Worker #define EVENT2_DNS_STRUCT_H_INCLUDED_
29*663afb9bSAndroid Build Coastguard Worker 
30*663afb9bSAndroid Build Coastguard Worker /** @file event2/dns_struct.h
31*663afb9bSAndroid Build Coastguard Worker 
32*663afb9bSAndroid Build Coastguard Worker   Data structures for dns.  Using these structures may hurt forward
33*663afb9bSAndroid Build Coastguard Worker   compatibility with later versions of Libevent: be careful!
34*663afb9bSAndroid Build Coastguard Worker 
35*663afb9bSAndroid Build Coastguard Worker  */
36*663afb9bSAndroid Build Coastguard Worker 
37*663afb9bSAndroid Build Coastguard Worker #ifdef __cplusplus
38*663afb9bSAndroid Build Coastguard Worker extern "C" {
39*663afb9bSAndroid Build Coastguard Worker #endif
40*663afb9bSAndroid Build Coastguard Worker 
41*663afb9bSAndroid Build Coastguard Worker #include <event2/event-config.h>
42*663afb9bSAndroid Build Coastguard Worker #ifdef EVENT__HAVE_SYS_TYPES_H
43*663afb9bSAndroid Build Coastguard Worker #include <sys/types.h>
44*663afb9bSAndroid Build Coastguard Worker #endif
45*663afb9bSAndroid Build Coastguard Worker #ifdef EVENT__HAVE_SYS_TIME_H
46*663afb9bSAndroid Build Coastguard Worker #include <sys/time.h>
47*663afb9bSAndroid Build Coastguard Worker #endif
48*663afb9bSAndroid Build Coastguard Worker 
49*663afb9bSAndroid Build Coastguard Worker /* For int types. */
50*663afb9bSAndroid Build Coastguard Worker #include <event2/util.h>
51*663afb9bSAndroid Build Coastguard Worker 
52*663afb9bSAndroid Build Coastguard Worker /*
53*663afb9bSAndroid Build Coastguard Worker  * Structures used to implement a DNS server.
54*663afb9bSAndroid Build Coastguard Worker  */
55*663afb9bSAndroid Build Coastguard Worker 
56*663afb9bSAndroid Build Coastguard Worker struct evdns_server_request {
57*663afb9bSAndroid Build Coastguard Worker 	int flags;
58*663afb9bSAndroid Build Coastguard Worker 	int nquestions;
59*663afb9bSAndroid Build Coastguard Worker 	struct evdns_server_question **questions;
60*663afb9bSAndroid Build Coastguard Worker };
61*663afb9bSAndroid Build Coastguard Worker struct evdns_server_question {
62*663afb9bSAndroid Build Coastguard Worker 	int type;
63*663afb9bSAndroid Build Coastguard Worker #ifdef __cplusplus
64*663afb9bSAndroid Build Coastguard Worker 	int dns_question_class;
65*663afb9bSAndroid Build Coastguard Worker #else
66*663afb9bSAndroid Build Coastguard Worker 	/* You should refer to this field as "dns_question_class".  The
67*663afb9bSAndroid Build Coastguard Worker 	 * name "class" works in C for backward compatibility, and will be
68*663afb9bSAndroid Build Coastguard Worker 	 * removed in a future version. (1.5 or later). */
69*663afb9bSAndroid Build Coastguard Worker 	int class;
70*663afb9bSAndroid Build Coastguard Worker #define dns_question_class class
71*663afb9bSAndroid Build Coastguard Worker #endif
72*663afb9bSAndroid Build Coastguard Worker 	char name[1];
73*663afb9bSAndroid Build Coastguard Worker };
74*663afb9bSAndroid Build Coastguard Worker 
75*663afb9bSAndroid Build Coastguard Worker #ifdef __cplusplus
76*663afb9bSAndroid Build Coastguard Worker }
77*663afb9bSAndroid Build Coastguard Worker #endif
78*663afb9bSAndroid Build Coastguard Worker 
79*663afb9bSAndroid Build Coastguard Worker #endif /* EVENT2_DNS_STRUCT_H_INCLUDED_ */
80*663afb9bSAndroid Build Coastguard Worker 
81