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.h30
1 files changed, 18 insertions, 12 deletions
diff --git a/src/gns/nss/nss_gns_query.h b/src/gns/nss/nss_gns_query.h
index bb04f9004..48cab4b22 100644
--- a/src/gns/nss/nss_gns_query.h
+++ b/src/gns/nss/nss_gns_query.h
@@ -11,7 +11,7 @@
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 Affero 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 Affero General Public License 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/>. 16 along with this program. If not, see <http://www.gnu.org/licenses/>.
17*/ 17*/
@@ -26,25 +26,30 @@
26/* Maximum number of entries to return */ 26/* Maximum number of entries to return */
27#define MAX_ENTRIES 16 27#define MAX_ENTRIES 16
28 28
29typedef struct { 29typedef struct
30 uint32_t address; 30{
31 uint32_t address;
31} ipv4_address_t; 32} ipv4_address_t;
32 33
33typedef struct { 34
34 uint8_t address[16]; 35typedef struct
36{
37 uint8_t address[16];
35} ipv6_address_t; 38} ipv6_address_t;
36 39
37 40
38struct userdata { 41struct userdata
42{
39 int count; 43 int count;
40 int data_len; /* only valid when doing reverse lookup */ 44 int data_len; /* only valid when doing reverse lookup */
41 union { 45 union {
42 ipv4_address_t ipv4[MAX_ENTRIES]; 46 ipv4_address_t ipv4[MAX_ENTRIES];
43 ipv6_address_t ipv6[MAX_ENTRIES]; 47 ipv6_address_t ipv6[MAX_ENTRIES];
44 char *name[MAX_ENTRIES]; 48 char *name[MAX_ENTRIES];
45 } data; 49 } data;
46}; 50};
47 51
52
48/** 53/**
49 * Wrapper function that uses gnunet-gns cli tool to resolve 54 * Wrapper function that uses gnunet-gns cli tool to resolve
50 * an IPv4/6 address. 55 * an IPv4/6 address.
@@ -54,8 +59,9 @@ struct userdata {
54 * @param u the userdata (result struct) 59 * @param u the userdata (result struct)
55 * @return -1 on error else 0 60 * @return -1 on error else 0
56 */ 61 */
57int gns_resolve_name(int af, 62int
58 const char *name, 63gns_resolve_name(int af,
59 struct userdata *userdata); 64 const char *name,
65 struct userdata *userdata);
60 66
61#endif 67#endif