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