ab8b6cb43cc9467bad5b205f515fc4ea5ba315cf
[oweals/gnunet.git] / src / gns / nss / nss_gns_query.h
1 #ifndef fooqueryhfoo
2 #define fooqueryhfoo
3
4 /* $Id$ */
5
6 /***
7   This file is part of nss-mdns.
8  
9   nss-mdns is free software; you can redistribute it and/or modify it
10   under the terms of the GNU Lesser General Public License as
11   published by the Free Software Foundation; either version 2 of the
12   License, or (at your option) any later version.
13  
14   nss-mdns is distributed in the hope that it will be useful, but
15   WITHOUT ANY WARRANTY; without even the implied warranty of
16   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17   General Public License for more details.
18  
19   You should have received a copy of the GNU Lesser General Public
20   License along with nss-mdns; if not, write to the Free Software
21   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
22   USA.
23 ***/
24
25 #include <inttypes.h>
26
27 /* Maximum number of entries to return */
28 #define MAX_ENTRIES 16
29
30 typedef struct {
31     uint32_t address;
32 } ipv4_address_t;
33
34 typedef struct {
35     uint8_t address[16];
36 } ipv6_address_t;
37
38
39 struct userdata {
40   int count;
41   int data_len; /* only valid when doing reverse lookup */
42   union  {
43       ipv4_address_t ipv4[MAX_ENTRIES];
44       ipv6_address_t ipv6[MAX_ENTRIES];
45       char *name[MAX_ENTRIES];
46   } data;
47 };
48
49 int gns_resolve_name(int af,
50                const char *name,
51                struct userdata *userdata);
52
53 #endif