aboutsummaryrefslogtreecommitdiff
path: root/src/lib/util/resolver.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/util/resolver.h')
-rw-r--r--src/lib/util/resolver.h93
1 files changed, 93 insertions, 0 deletions
diff --git a/src/lib/util/resolver.h b/src/lib/util/resolver.h
new file mode 100644
index 000000000..e487f6e6f
--- /dev/null
+++ b/src/lib/util/resolver.h
@@ -0,0 +1,93 @@
1/*
2 This file is part of GNUnet.
3 Copyright (C) 2009, 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 Affero 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 You should have received a copy of the GNU Affero General Public License
16 along with this program. If not, see <http://www.gnu.org/licenses/>.
17
18 SPDX-License-Identifier: AGPL3.0-or-later
19 */
20
21/**
22 * @author Christian Grothoff
23 * @file util/resolver.h
24 */
25#ifndef RESOLVER_H
26#define RESOLVER_H
27
28#include "gnunet_common.h"
29
30GNUNET_NETWORK_STRUCT_BEGIN
31
32/**
33 * Request for the resolver. Followed by either the "struct sockaddr"
34 * or the 0-terminated hostname.
35 *
36 * The response will be one or more messages of type
37 * RESOLVER_RESPONSE, each with the message header immediately
38 * followed by the requested data (0-terminated hostname or struct
39 * in[6]_addr, depending on direction). The last RESOLVER_RESPONSE
40 * will just be a header without any data (used to indicate the end of
41 * the list).
42 */
43struct GNUNET_RESOLVER_GetMessage
44{
45 /**
46 * Type: #GNUNET_MESSAGE_TYPE_RESOLVER_REQUEST
47 */
48 struct GNUNET_MessageHeader header;
49
50 /**
51 * GNUNET_YES to get hostname from IP,
52 * GNUNET_NO to get IP from hostname.
53 */
54 int32_t direction GNUNET_PACKED;
55
56 /**
57 * Address family to use (AF_INET, AF_INET6 or AF_UNSPEC).
58 */
59 int32_t af GNUNET_PACKED;
60
61 /**
62 * identifies the request and is contained in the response message. The
63 * client has to match response to request by this identifier.
64 */
65 uint32_t client_id GNUNET_PACKED;
66
67 /* followed by 0-terminated string for A/AAAA-lookup or
68 by 'struct in_addr' / 'struct in6_addr' for reverse lookup */
69};
70
71
72struct GNUNET_RESOLVER_ResponseMessage
73{
74 /**
75 * Type: #GNUNET_MESSAGE_TYPE_RESOLVER_RESPONSE
76 */
77 struct GNUNET_MessageHeader header;
78
79 /**
80 * identifies the request this message responds to. The client
81 * has to match response to request by this identifier.
82 */
83 uint32_t client_id GNUNET_PACKED;
84
85 /* followed by 0-terminated string for response to a reverse lookup
86 * or by 'struct in_addr' / 'struct in6_addr' for response to
87 * A/AAAA-lookup
88 */
89};
90
91GNUNET_NETWORK_STRUCT_END
92
93#endif