diff options
author | Martin Schanzenbach <mschanzenbach@posteo.de> | 2012-06-01 08:58:20 +0000 |
---|---|---|
committer | Martin Schanzenbach <mschanzenbach@posteo.de> | 2012-06-01 08:58:20 +0000 |
commit | 76cf6a96f1c43ef4b2740b8f34fc1f2ee82b1fa8 (patch) | |
tree | fe6a06a1d0aba269a4a24eedd4feb89b14562d77 /src/gns/nss/nss_gns_query.h | |
parent | 41c71f34fed8af85b1ff13394cc5f1c30a7b6ac6 (diff) | |
download | gnunet-76cf6a96f1c43ef4b2740b8f34fc1f2ee82b1fa8.tar.gz gnunet-76cf6a96f1c43ef4b2740b8f34fc1f2ee82b1fa8.zip |
cleanup
Diffstat (limited to 'src/gns/nss/nss_gns_query.h')
-rw-r--r-- | src/gns/nss/nss_gns_query.h | 53 |
1 files changed, 53 insertions, 0 deletions
diff --git a/src/gns/nss/nss_gns_query.h b/src/gns/nss/nss_gns_query.h new file mode 100644 index 000000000..ab8b6cb43 --- /dev/null +++ b/src/gns/nss/nss_gns_query.h | |||
@@ -0,0 +1,53 @@ | |||
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 | ||