-remove trailing whitespace
[oweals/gnunet.git] / src / dns / dns.h
1 /*
2       This file is part of GNUnet
3       (C) 2012 Christian Grothoff (and other contributing authors)
4
5       GNUnet is free software; you can redistribute it and/or modify
6       it under the terms of the GNU General Public License as published
7       by the Free Software Foundation; either version 3, or (at your
8       option) any later version.
9
10       GNUnet is distributed in the hope that it will be useful, but
11       WITHOUT ANY WARRANTY; without even the implied warranty of
12       MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
13       General Public License for more details.
14
15       You should have received a copy of the GNU General Public License
16       along with GNUnet; see the file COPYING.  If not, write to the
17       Free Software Foundation, Inc., 59 Temple Place - Suite 330,
18       Boston, MA 02111-1307, USA.
19  */
20
21 /**
22  * @file dns/dns.h
23  * @brief IPC messages between DNS API and DNS service
24  * @author Christian Grothoff
25  */
26 #ifndef DNS_H
27 #define DNS_H
28
29 GNUNET_NETWORK_STRUCT_BEGIN
30
31
32 /**
33  * Message from client to DNS service to register itself.
34  */
35 struct GNUNET_DNS_Register
36 {
37   /**
38     * Header of type GNUNET_MESSAGE_TYPE_DNS_CLIENT_INIT
39    */
40   struct GNUNET_MessageHeader header;
41
42   /**
43    * NBO encoding of 'enum GNUNET_DNS_Flags' for the client.
44    */
45   uint32_t flags;
46 };
47
48
49 /**
50  * Message from DNS service to client: please handle a request.
51  */
52 struct GNUNET_DNS_Request
53 {
54   /**
55     * Header of type GNUNET_MESSAGE_TYPE_DNS_CLIENT_REQUEST
56    */
57   struct GNUNET_MessageHeader header;
58
59   /**
60    * Always zero.
61    */
62   uint32_t reserved GNUNET_PACKED;
63
64   /**
65    * Unique request ID.
66    */
67   uint64_t request_id GNUNET_PACKED;
68
69   /* followed by original DNS request (without UDP header) */
70
71 };
72
73
74 /**
75  * Message from client to DNS service: here is my reply.
76  */
77 struct GNUNET_DNS_Response
78 {
79   /**
80    * Header of type GNUNET_MESSAGE_TYPE_DNS_CLIENT_RESPONSE
81    */
82   struct GNUNET_MessageHeader header;
83
84   /**
85    * Zero to drop, 1 for no change (no payload), 2 for update (message has payload).
86    */
87   uint32_t drop_flag GNUNET_PACKED;
88
89   /**
90    * Unique request ID.
91    */
92   uint64_t request_id GNUNET_PACKED;
93
94   /* followed by original DNS request (without UDP header) */
95
96 };
97
98
99 GNUNET_NETWORK_STRUCT_END
100
101 #endif