aboutsummaryrefslogtreecommitdiff
path: root/src/gns/nss/nss_gns_query.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/gns/nss/nss_gns_query.h')
-rw-r--r--src/gns/nss/nss_gns_query.h44
1 files changed, 24 insertions, 20 deletions
diff --git a/src/gns/nss/nss_gns_query.h b/src/gns/nss/nss_gns_query.h
index 024f11e2e..48cab4b22 100644
--- a/src/gns/nss/nss_gns_query.h
+++ b/src/gns/nss/nss_gns_query.h
@@ -2,20 +2,18 @@
2 This file is part of GNUnet. 2 This file is part of GNUnet.
3 Copyright (C) 2012 GNUnet e.V. 3 Copyright (C) 2012 GNUnet e.V.
4 4
5 GNUnet is free software; you can redistribute it and/or modify 5 GNUnet is free software: you can redistribute it and/or modify it
6 it under the terms of the GNU General Public License as published 6 under the terms of the GNU Affero General Public License as published
7 by the Free Software Foundation; either version 3, or (at your 7 by the Free Software Foundation, either version 3 of the License,
8 option) any later version. 8 or (at your option) any later version.
9 9
10 GNUnet is distributed in the hope that it will be useful, but 10 GNUnet is distributed in the hope that it will be useful, but
11 WITHOUT ANY WARRANTY; without even the implied warranty of 11 WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 General Public License for more details. 13 Affero General Public License for more details.
14 14
15 You should have received a copy of the GNU General Public License 15 You should have received a copy of the GNU Affero General Public License
16 along with GNUnet; see the file COPYING. If not, write to the 16 along with this program. If not, see <http://www.gnu.org/licenses/>.
17 Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
18 Boston, MA 02110-1301, USA.
19*/ 17*/
20#ifndef NSS_GNS_QUERY_H 18#ifndef NSS_GNS_QUERY_H
21#define NSS_GNS_QUERY_H 19#define NSS_GNS_QUERY_H
@@ -28,25 +26,30 @@
28/* Maximum number of entries to return */ 26/* Maximum number of entries to return */
29#define MAX_ENTRIES 16 27#define MAX_ENTRIES 16
30 28
31typedef struct { 29typedef struct
32 uint32_t address; 30{
31 uint32_t address;
33} ipv4_address_t; 32} ipv4_address_t;
34 33
35typedef struct { 34
36 uint8_t address[16]; 35typedef struct
36{
37 uint8_t address[16];
37} ipv6_address_t; 38} ipv6_address_t;
38 39
39 40
40struct userdata { 41struct userdata
42{
41 int count; 43 int count;
42 int data_len; /* only valid when doing reverse lookup */ 44 int data_len; /* only valid when doing reverse lookup */
43 union { 45 union {
44 ipv4_address_t ipv4[MAX_ENTRIES]; 46 ipv4_address_t ipv4[MAX_ENTRIES];
45 ipv6_address_t ipv6[MAX_ENTRIES]; 47 ipv6_address_t ipv6[MAX_ENTRIES];
46 char *name[MAX_ENTRIES]; 48 char *name[MAX_ENTRIES];
47 } data; 49 } data;
48}; 50};
49 51
52
50/** 53/**
51 * Wrapper function that uses gnunet-gns cli tool to resolve 54 * Wrapper function that uses gnunet-gns cli tool to resolve
52 * an IPv4/6 address. 55 * an IPv4/6 address.
@@ -56,8 +59,9 @@ struct userdata {
56 * @param u the userdata (result struct) 59 * @param u the userdata (result struct)
57 * @return -1 on error else 0 60 * @return -1 on error else 0
58 */ 61 */
59int gns_resolve_name(int af, 62int
60 const char *name, 63gns_resolve_name(int af,
61 struct userdata *userdata); 64 const char *name,
65 struct userdata *userdata);
62 66
63#endif 67#endif