GNUnet
0.22.2
nss_gns_query.h
Go to the documentation of this file.
1
/*
2
This file is part of GNUnet.
3
Copyright (C) 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
#ifndef NSS_GNS_QUERY_H
21
#define NSS_GNS_QUERY_H
22
26
#include <inttypes.h>
27
28
/* Maximum number of entries to return */
29
#define MAX_ENTRIES 16
30
31
typedef
struct
32
{
33
uint32_t
address
;
34
}
ipv4_address_t
;
35
36
37
typedef
struct
38
{
39
uint8_t
address
[16];
40
}
ipv6_address_t
;
41
42
43
struct
userdata
44
{
45
int
count
;
46
int
data_len
;
/* only valid when doing reverse lookup */
47
union
48
{
49
ipv4_address_t
ipv4
[
MAX_ENTRIES
];
50
ipv6_address_t
ipv6
[
MAX_ENTRIES
];
51
char
*
name
[
MAX_ENTRIES
];
52
}
data
;
53
};
54
55
68
int
69
gns_resolve_name
(
int
af,
70
const
char
*
name
,
71
struct
userdata
*
userdata
);
72
73
#endif
address
static char * address
GNS address for this phone.
Definition:
gnunet-conversation.c:225
name
static char * name
Name (label) of the records to list.
Definition:
gnunet-namecache.c:48
gns_resolve_name
int gns_resolve_name(int af, const char *name, struct userdata *userdata)
Wrapper function that uses gnunet-gns cli tool to resolve an IPv4/6 address.
Definition:
nss_gns_query.c:58
MAX_ENTRIES
#define MAX_ENTRIES
Parts taken from nss-mdns.
Definition:
nss_gns_query.h:29
ipv4_address_t
Definition:
nss_gns_query.h:32
ipv4_address_t::address
uint32_t address
Definition:
nss_gns_query.h:33
ipv6_address_t
Definition:
nss_gns_query.h:38
userdata
Definition:
nss_gns_query.h:44
userdata::data_len
int data_len
Definition:
nss_gns_query.h:46
userdata::count
int count
Definition:
nss_gns_query.h:45
userdata::name
char * name[16]
Definition:
nss_gns_query.h:51
userdata::ipv6
ipv6_address_t ipv6[16]
Definition:
nss_gns_query.h:50
userdata::ipv4
ipv4_address_t ipv4[16]
Definition:
nss_gns_query.h:49
userdata::data
union userdata::@57 data
src
service
gns
nss
nss_gns_query.h
Generated by
1.9.4