first batch of license fixes (boring)
[oweals/gnunet.git] / src / dns / dns.h
1 /*
2       This file is part of GNUnet
3       Copyright (C) 2012 GNUnet e.V.
4
5       GNUnet is free software: you can redistribute it and/or modify it
6       under the terms of the GNU General Public License as published
7       by the Free Software Foundation, either version 3 of the License,
8       or (at your 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       Affero General Public License for more details.
14  */
15
16 /**
17  * @file dns/dns.h
18  * @brief IPC messages between DNS API and DNS service
19  * @author Christian Grothoff
20  */
21 #ifndef DNS_H
22 #define DNS_H
23
24 GNUNET_NETWORK_STRUCT_BEGIN
25
26
27 /**
28  * Message from client to DNS service to register itself.
29  */
30 struct GNUNET_DNS_Register
31 {
32   /**
33     * Header of type #GNUNET_MESSAGE_TYPE_DNS_CLIENT_INIT
34    */
35   struct GNUNET_MessageHeader header;
36
37   /**
38    * NBO encoding of `enum GNUNET_DNS_Flags` for the client.
39    */
40   uint32_t flags GNUNET_PACKED;
41 };
42
43
44 /**
45  * Message from DNS service to client: please handle a request.
46  */
47 struct GNUNET_DNS_Request
48 {
49   /**
50     * Header of type #GNUNET_MESSAGE_TYPE_DNS_CLIENT_REQUEST
51    */
52   struct GNUNET_MessageHeader header;
53
54   /**
55    * Always zero.
56    */
57   uint32_t reserved GNUNET_PACKED;
58
59   /**
60    * Unique request ID.
61    */
62   uint64_t request_id GNUNET_PACKED;
63
64   /* followed by original DNS request (without UDP header) */
65
66 };
67
68
69 /**
70  * Message from client to DNS service: here is my reply.
71  */
72 struct GNUNET_DNS_Response
73 {
74   /**
75    * Header of type #GNUNET_MESSAGE_TYPE_DNS_CLIENT_RESPONSE
76    */
77   struct GNUNET_MessageHeader header;
78
79   /**
80    * Zero to drop, 1 for no change (no payload), 2 for update (message has payload).
81    */
82   uint32_t drop_flag GNUNET_PACKED;
83
84   /**
85    * Unique request ID.
86    */
87   uint64_t request_id GNUNET_PACKED;
88
89   /* followed by original DNS request (without UDP header) */
90
91 };
92
93
94 GNUNET_NETWORK_STRUCT_END
95
96 #endif