1*40f5f2eeSchristos /* $NetBSD: dns_struct.h,v 1.1.1.3 2017/01/31 21:14:53 christos Exp $ */ 293dcc084Schristos /* 393dcc084Schristos * Copyright (c) 2000-2007 Niels Provos <provos@citi.umich.edu> 493dcc084Schristos * Copyright (c) 2007-2012 Niels Provos and Nick Mathewson 593dcc084Schristos * 693dcc084Schristos * Redistribution and use in source and binary forms, with or without 793dcc084Schristos * modification, are permitted provided that the following conditions 893dcc084Schristos * are met: 993dcc084Schristos * 1. Redistributions of source code must retain the above copyright 1093dcc084Schristos * notice, this list of conditions and the following disclaimer. 1193dcc084Schristos * 2. Redistributions in binary form must reproduce the above copyright 1293dcc084Schristos * notice, this list of conditions and the following disclaimer in the 1393dcc084Schristos * documentation and/or other materials provided with the distribution. 1493dcc084Schristos * 3. The name of the author may not be used to endorse or promote products 1593dcc084Schristos * derived from this software without specific prior written permission. 1693dcc084Schristos * 1793dcc084Schristos * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 1893dcc084Schristos * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 1993dcc084Schristos * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 2093dcc084Schristos * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 2193dcc084Schristos * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 2293dcc084Schristos * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 2393dcc084Schristos * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 2493dcc084Schristos * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 2593dcc084Schristos * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 2693dcc084Schristos * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 2793dcc084Schristos */ 28*40f5f2eeSchristos #ifndef EVENT2_DNS_STRUCT_H_INCLUDED_ 29*40f5f2eeSchristos #define EVENT2_DNS_STRUCT_H_INCLUDED_ 3093dcc084Schristos 3193dcc084Schristos /** @file event2/dns_struct.h 3293dcc084Schristos 3393dcc084Schristos Data structures for dns. Using these structures may hurt forward 3493dcc084Schristos compatibility with later versions of Libevent: be careful! 3593dcc084Schristos 3693dcc084Schristos */ 3793dcc084Schristos 3893dcc084Schristos #ifdef __cplusplus 3993dcc084Schristos extern "C" { 4093dcc084Schristos #endif 4193dcc084Schristos 4293dcc084Schristos #include <event2/event-config.h> 43*40f5f2eeSchristos #ifdef EVENT__HAVE_SYS_TYPES_H 4493dcc084Schristos #include <sys/types.h> 4593dcc084Schristos #endif 46*40f5f2eeSchristos #ifdef EVENT__HAVE_SYS_TIME_H 4793dcc084Schristos #include <sys/time.h> 4893dcc084Schristos #endif 4993dcc084Schristos 5093dcc084Schristos /* For int types. */ 5193dcc084Schristos #include <event2/util.h> 5293dcc084Schristos 5393dcc084Schristos /* 5493dcc084Schristos * Structures used to implement a DNS server. 5593dcc084Schristos */ 5693dcc084Schristos 5793dcc084Schristos struct evdns_server_request { 5893dcc084Schristos int flags; 5993dcc084Schristos int nquestions; 6093dcc084Schristos struct evdns_server_question **questions; 6193dcc084Schristos }; 6293dcc084Schristos struct evdns_server_question { 6393dcc084Schristos int type; 6493dcc084Schristos #ifdef __cplusplus 6593dcc084Schristos int dns_question_class; 6693dcc084Schristos #else 6793dcc084Schristos /* You should refer to this field as "dns_question_class". The 6893dcc084Schristos * name "class" works in C for backward compatibility, and will be 6993dcc084Schristos * removed in a future version. (1.5 or later). */ 7093dcc084Schristos int class; 7193dcc084Schristos #define dns_question_class class 7293dcc084Schristos #endif 7393dcc084Schristos char name[1]; 7493dcc084Schristos }; 7593dcc084Schristos 7693dcc084Schristos #ifdef __cplusplus 7793dcc084Schristos } 7893dcc084Schristos #endif 7993dcc084Schristos 80*40f5f2eeSchristos #endif /* EVENT2_DNS_STRUCT_H_INCLUDED_ */ 8193dcc084Schristos 82