27#include "gnunet_error_codes.h"
35#define LOG_STRERROR_FILE(kind, syscall, filename) \
36 GNUNET_log_from_strerror_file (kind, "util", syscall, filename)
41#define MONITOR_STALL_WARN_DELAY GNUNET_TIME_UNIT_MINUTES
438 const char *editor_hint,
453 for (
unsigned int c = 0; c <
rd_count; c++)
459 (*res)->data = &(*res)[1];
485 for (
unsigned int i = 0; i <
NC_SIZE; i++)
489 if ((NULL == oldest) ||
530 for (
unsigned int i = 0; i <
NC_SIZE; i++)
539 nick->
data = &nick[1];
554#if ! defined(GNUNET_CULL_LOGGING)
567 "No nick name set for zone `%s'\n",
599 unsigned int rd2_length,
601 unsigned int *rdc_res,
604 uint64_t latest_expiration;
610 (*rdc_res) = 1 + rd2_length;
611 if (0 == 1 + rd2_length)
618 for (
unsigned int i = 0; i < rd2_length; i++)
632 data = (
char *) &target[1 + rd2_length];
634 latest_expiration = 0;
635 for (
unsigned int i = 0; i < rd2_length; i++)
648 target[i].
data = (
void *) &
data[data_offset];
653 target[rd2_length] = *nick_rd;
657 target[rd2_length].
data = (
void *) &
data[data_offset];
693 unsigned int res_count;
694 unsigned int rd_nf_count;
732 res_count = rd_nf_count;
747 name_len = strlen (
name) + 1;
757 if (((
size_t) rd_ser_len) >= UINT16_MAX - name_len -
sizeof(*zir_msg))
767 name_len + rd_ser_len + key_len,
770 zir_msg->
name_len = htons (name_len);
771 zir_msg->
rd_count = htons (res_count);
772 zir_msg->
rd_len = htons ((uint16_t) rd_ser_len);
773 zir_msg->
key_len = htons (key_len);
778 name_tmp = (
char *) &zir_msg[1] + key_len;
780 rd_ser = &name_tmp[name_len];
785 "Sending RECORD_RESULT message with %u records\n",
788 "Record sets sent to clients",
815 "Sending GENERIC_RESPONSE message\n");
817 "Store requests completed",
823 rcr_msg->
ec = htonl (
ec);
864 "No response from monitor since %s\n",
889 buf = (
const char *) &sa[1];
890 for (
int i = sa->
rd_set_pos; i < sa->rd_set_count; i++)
895 rd_ser_len = ntohs (rd_set->
rd_len);
896 name = (
const char *) &rd_set[1];
909 "Checking monitors watching for `%s'\n",
919 if (
zm->limit ==
zm->iteration_cnt)
923 if (NULL !=
zm->sa_wait_warning)
925 zm->sa_wait_warning =
930 "Monitor is blocking client for `%s'\n",
935 "Notifying monitor about changes under label `%s'\n",
983 if (NULL !=
zm->task)
988 if (NULL !=
zm->sa_wait_warning)
991 zm->sa_wait_warning = NULL;
993 for (sa =
sa_head; NULL != sa; sa = sn)
1018 while (NULL != (no =
nc->op_head))
1068 if (NULL ==
nc->GSN_database)
1071 "Could not load database backend `%s'\n",
1146 const char *editor_hint,
1149 unsigned int rd_count_nf,
1160 if (0 != strcmp (label, rlc->
label))
1190 unsigned int rdc_res;
1266 uint16_t editor_hint_len;
1273 key_len = ntohs (er_msg->
key_len);
1275 if (name_len + editor_hint_len + key_len != src_size -
sizeof(
struct
1299 const char *name_tmp;
1303 uint16_t old_editor_hint_len;
1308 key_len = ntohs (er_msg->
key_len);
1315 (kb_read != key_len))
1318 "Error reading private key\n");
1322 name_tmp = (
const char *) &er_msg[1] + key_len;
1326 "Received NAMESTORE_RECORD_SET_EDIT message for name `%s'\n",
1330 if (NULL == conv_name)
1333 "Error converting name `%s'\n",
1338 name_len = strlen (conv_name) + 1;
1340 rlc.
label = conv_name;
1342 "Looking up without filter\n");
1349 res =
nc->GSN_database->edit_records (
nc->GSN_database->cls,
1356 old_editor_hint_len = 0;
1358 old_editor_hint_len = strlen (rlc.
editor_hint) + 1;
1396 uint16_t editor_hint_len;
1397 uint16_t editor_hint_repl_len;
1405 key_len = ntohs (er_msg->
key_len);
1407 if (name_len + editor_hint_len + editor_hint_repl_len + key_len != src_size
1432 const char *name_tmp;
1433 const char *editor_hint;
1434 const char *editor_hint_repl;
1437 uint16_t editor_hint_len;
1442 key_len = ntohs (er_msg->
key_len);
1450 (kb_read != key_len))
1453 "Error reading private key\n");
1457 name_tmp = (
const char *) &er_msg[1] + key_len;
1458 editor_hint = (
const char *) name_tmp + name_len;
1459 editor_hint_repl = (
const char *) name_tmp + name_len + editor_hint_len;
1462 "Received NAMESTORE_RECORD_SET_EDIT message for name `%s'\n",
1466 if (NULL == conv_name)
1469 "Error converting name `%s'\n",
1474 name_len = strlen (conv_name) + 1;
1476 "Clearing editor hint\n");
1477 res =
nc->GSN_database->clear_editor_hint (
nc->GSN_database->cls,
1513 key_len = ntohs (ll_msg->
key_len);
1538 const char *name_tmp;
1546 key_len = ntohs (ll_msg->
key_len);
1552 (kb_read != key_len))
1555 "Error reading private key\n");
1559 name_tmp = (
const char *) &ll_msg[1] + key_len;
1562 "Received NAMESTORE_RECORD_LOOKUP message for name `%s'\n",
1566 if (NULL == conv_name)
1569 "Error converting name `%s'\n",
1574 name_len = strlen (conv_name) + 1;
1576 rlc.
label = conv_name;
1578 "Looking up with filter %u\n", ntohs (ll_msg->
filter));
1585 res =
nc->GSN_database->lookup_records (
nc->GSN_database->cls,
1597 llr_msg->
name_len = htons (name_len);
1601 res_name = ((
char *) &llr_msg[1]) + key_len;
1628 size_t min_size_exp;
1629 size_t rd_set_count;
1635 key_len = ntohs (rp_msg->
key_len);
1637 min_size_exp =
sizeof(*rp_msg) + key_len +
sizeof (
struct RecordSet)
1639 if (msg_size < min_size_exp)
1678 const char *editor_hint,
1687 unsigned int rd_pub_count;
1721 const char *name_tmp;
1739 rd_ser_len = ntohs (rd_set->
rd_len);
1741 name_tmp = (
const char *) &rd_set[1];
1748 if (NULL == conv_name)
1751 "Error normalizing name `%s'\n",
1760 "Label invalid: `%s'\n",
1776 "Well-formed store requests received",
1780 "Creating %u records for name `%s'\n",
1784 (
GNUNET_NO ==
nc->GSN_database->lookup_records (
nc->GSN_database->cls,
1792 "Name `%s' does not exist, no deletion required\n",
1809 unsigned int rd_clean_off;
1810 unsigned int rd_nf_count;
1815 for (
unsigned int i = 0; i <
rd_count; i++)
1817 rd_clean[rd_clean_off] =
rd[i];
1842 "Error normalizing record set: `%s'\n",
1848 "%u/%u records before tombstone\n", rd_nf_count,
1862 rd_nf[rd_nf_count].
data = NULL;
1873 res =
nc->GSN_database->store_records (
nc->GSN_database->cls,
1884 (1 == rd_nf_count) &&
1889 "Client tried to remove non-existent record\n");
1917 uint16_t rd_set_count;
1929 key_len = ntohs (rp_msg->
key_len);
1931 rs_off =
sizeof (*rp_msg) + key_len;
1932 rs_len = rp_msg_len - rs_off;
1938 (kb_read != key_len))
1941 "Error reading private key\n");
1946 "Received NAMESTORE_RECORD_STORE message\n");
1949 buf = (
const char *) rp_msg + rs_off;
1951 nc->GSN_database->begin_tx (
nc->GSN_database->cls);
1952 for (
int i = 0; i < rd_set_count; i++)
1960 nc->GSN_database->rollback_tx (
nc->GSN_database->cls);
1968 nc->GSN_database->commit_tx (
nc->GSN_database->cls);
2021 const char *editor_hint,
2039 "Found result for zone-to-name lookup: `%s'\n",
2065 ztnr_msg->
ec = htonl (ztn_ctx->
ec);
2066 ztnr_msg->
rd_len = htons (rd_ser_len);
2073 name_tmp = (
char *) &ztnr_msg[1] +
key_len;
2124 "Error parsing private key.\n");
2129 pkey_len = ntohs (ztn_msg->
pkey_len);
2136 (kb_read != pkey_len))
2139 "Error parsing public key.\n");
2160 "Found no result for zone-to-name lookup.\n");
2207 const char *editor_hint,
2216 if ((NULL == zone_key) && (NULL ==
name))
2221 if ((NULL == zone_key) || (NULL ==
name))
2227 if (0 == proc->
limit)
2233 proc->
zi->
seq = seq;
2261 memset (&proc, 0,
sizeof(proc));
2263 "Asked to return up to %llu records at position %llu\n",
2264 (
unsigned long long) limit,
2265 (
unsigned long long) zi->
seq);
2274 nc->GSN_database->iterate_records (
nc->GSN_database->cls,
2288 "NAMESTORE iteration delay (μs/record)",
2291 if (0 == proc.
limit)
2293 "Returned %llu results, more results available\n",
2294 (
unsigned long long) limit);
2308 key_len = ntohs (zis_msg->
key_len);
2310 if (
size < key_len +
sizeof(*zis_msg))
2336 "Received ZONE_ITERATION_START message\n");
2337 key_len = ntohs (zis_msg->
key_len);
2346 (kb_read != key_len))
2378 "Received ZONE_ITERATION_STOP message\n");
2380 for (zi =
nc->op_head; NULL != zi; zi = zi->
next)
2411 "Received ZONE_ITERATION_NEXT message\n");
2413 "Iteration NEXT messages received",
2418 for (zi =
nc->op_head; NULL != zi; zi = zi->
next)
2442 "Unblocking zone monitor %p\n",
zm);
2443 while ((NULL != sa) && (
zm->limit >
zm->iteration_cnt))
2451 if (
zm->limit >
zm->iteration_cnt)
2454 if (NULL !=
zm->sa_wait_warning)
2457 zm->sa_wait_warning = NULL;
2463 if (NULL !=
zm->sa_wait_warning)
2465 zm->sa_wait_warning =
2484 "Syncing zone monitor %p\n",
zm);
2490 zm->iteration_cnt = 0;
2491 if ((
zm->limit > 0) && (
zm->sa_waiting))
2518 const char *editor_hint,
2530 "Monitor notifications sent",
2539 zm->iteration_cnt--;
2543 if ((0 ==
zm->iteration_cnt) && (0 !=
zm->limit))
2561 key_len = ntohs (zis_msg->
key_len);
2563 if (
size < key_len +
sizeof(*zis_msg))
2589 "Received ZONE_MONITOR_START message\n");
2592 key_len = ntohs (zis_msg->
key_len);
2600 (kb_read != key_len))
2603 "Error reading private key\n");
2617 if (
zm->in_first_iteration)
2639 zm->iteration_cnt =
zm->limit / 2;
2641 zm->iteration_cnt =
zm->limit;
2646 "Running iteration\n");
2648 ret =
nc->GSN_database->iterate_records (
nc->GSN_database->cls,
2664 "Zone empty... syncing\n");
2687 "Received ZONE_MONITOR_NEXT message with limit %llu\n",
2688 (
unsigned long long) inc);
2699 if (
zm->limit + inc < zm->
limit)
2706 if ((
zm->in_first_iteration) && (
zm->limit == inc))
2714 if ((
zm->limit >
zm->iteration_cnt) && (
zm->sa_waiting))
2720 if (NULL !=
zm->sa_wait_warning)
2723 zm->sa_wait_warning =
2763 "libgnunet_plugin_namestore_%s",
2775 "Could not load database backend `%s'\n",
struct GNUNET_MQ_Handle * mq
struct GNUNET_MQ_Envelope * env
static int start
Set if we are to start default services (including ARM).
static int ret
Final status code.
static struct GNUNET_CONFIGURATION_Handle * cfg
Our configuration.
static char * data
The data to insert into the dht.
static char * name
Name (label) of the records to list.
static unsigned int rd_count
Number of records for currently parsed set.
static char * res
Currently read line or NULL on EOF.
static struct GNUNET_GNSRECORD_Data rd[50]
The record data under a single label.
static struct GNUNET_NAMESTORE_ZoneMonitor * zm
Monitor handle.
static size_t data_size
Number of bytes in data.
static struct GNUNET_CRYPTO_EddsaPublicKey pub
static struct GNUNET_SERVICE_Handle * service
Handle to our service instance.
static struct GNUNET_NotificationContext * nc
Notification context for broadcasting to monitors.
static struct GNUNET_CONTAINER_BloomFilter * filter
Bloomfilter to quickly tell if we don't have the content.
static struct GNUNET_GNSRECORD_Data * get_nick_record(const struct GNUNET_CRYPTO_PrivateKey *zone)
Return the NICK record for the zone (if it exists).
static int check_edit_record_set(void *cls, const struct EditRecordSetMessage *er_msg)
Handles a GNUNET_MESSAGE_TYPE_NAMESTORE_RECORD_SET_EDIT message.
static enum GNUNET_GenericReturnValue check_iteration_start(void *cls, const struct ZoneIterationStartMessage *zis_msg)
static int return_orphaned
Returned orphaned records?
static void handle_iteration_start(void *cls, const struct ZoneIterationStartMessage *zis_msg)
Handles a GNUNET_MESSAGE_TYPE_NAMESTORE_ZONE_ITERATION_START message.
static struct StoreActivity * sa_tail
Tail of DLL of monitor-blocked store activities.
static void handle_iteration_stop(void *cls, const struct ZoneIterationStopMessage *zis_msg)
Handles a GNUNET_MESSAGE_TYPE_NAMESTORE_ZONE_ITERATION_STOP message.
GNUNET_SERVICE_MAIN(GNUNET_OS_project_data_gnunet(), "namestore", GNUNET_SERVICE_OPTION_NONE, &run, &client_connect_cb, &client_disconnect_cb, NULL, GNUNET_MQ_hd_var_size(record_store, GNUNET_MESSAGE_TYPE_NAMESTORE_RECORD_STORE, struct RecordStoreMessage, NULL), GNUNET_MQ_hd_var_size(edit_record_set, GNUNET_MESSAGE_TYPE_NAMESTORE_RECORD_SET_EDIT, struct EditRecordSetMessage, NULL), GNUNET_MQ_hd_var_size(edit_record_set_cancel, GNUNET_MESSAGE_TYPE_NAMESTORE_RECORD_SET_EDIT_CANCEL, struct EditRecordSetCancelMessage, NULL), GNUNET_MQ_hd_var_size(record_lookup, GNUNET_MESSAGE_TYPE_NAMESTORE_RECORD_LOOKUP, struct LabelLookupMessage, NULL), GNUNET_MQ_hd_var_size(zone_to_name, GNUNET_MESSAGE_TYPE_NAMESTORE_ZONE_TO_NAME, struct ZoneToNameMessage, NULL), GNUNET_MQ_hd_var_size(iteration_start, GNUNET_MESSAGE_TYPE_NAMESTORE_ZONE_ITERATION_START, struct ZoneIterationStartMessage, NULL), GNUNET_MQ_hd_fixed_size(iteration_next, GNUNET_MESSAGE_TYPE_NAMESTORE_ZONE_ITERATION_NEXT, struct ZoneIterationNextMessage, NULL), GNUNET_MQ_hd_fixed_size(iteration_stop, GNUNET_MESSAGE_TYPE_NAMESTORE_ZONE_ITERATION_STOP, struct ZoneIterationStopMessage, NULL), GNUNET_MQ_hd_var_size(monitor_start, GNUNET_MESSAGE_TYPE_NAMESTORE_MONITOR_START, struct ZoneMonitorStartMessage, NULL), GNUNET_MQ_hd_fixed_size(monitor_next, GNUNET_MESSAGE_TYPE_NAMESTORE_MONITOR_NEXT, struct ZoneMonitorNextMessage, NULL), GNUNET_MQ_handler_end())
Define "main" method using service macro.
static void monitor_iterate_cb(void *cls, uint64_t seq, const char *editor_hint, const struct GNUNET_CRYPTO_PrivateKey *zone_key, const char *name, unsigned int rd_count, const struct GNUNET_GNSRECORD_Data *rd)
A GNUNET_NAMESTORE_RecordIterator for monitors.
static void run_zone_iteration_round(struct ZoneIteration *zi, uint64_t limit)
Perform the next round of the zone iteration.
static void monitor_unblock(struct ZoneMonitor *zm)
Function called when the monitor is ready for more data, and we should thus unblock PUT operations th...
static void handle_record_store(void *cls, const struct RecordStoreMessage *rp_msg)
Handles a GNUNET_MESSAGE_TYPE_NAMESTORE_RECORD_STORE message.
static const struct GNUNET_CRYPTO_PrivateKey zero
Public key of all zeros.
static void monitor_sync(struct ZoneMonitor *zm)
Send 'sync' message to zone monitor, we're now in sync.
static void handle_zone_to_name_it(void *cls, uint64_t seq, const char *editor_hint, const struct GNUNET_CRYPTO_PrivateKey *zone_key, const char *name, unsigned int rd_count, const struct GNUNET_GNSRECORD_Data *rd)
Zone to name iterator.
static void handle_monitor_next(void *cls, const struct ZoneMonitorNextMessage *nm)
Handles a GNUNET_MESSAGE_TYPE_NAMESTORE_MONITOR_NEXT message.
static struct GNUNET_NotificationContext * monitor_nc
Notification context shared by all monitors.
struct GNUNET_NAMESTORE_PluginFunctions * GSN_database
Database handle for service.
static void cleanup_task(void *cls)
Task run during shutdown.
static char * db_lib_name
Name of the database plugin.
static int check_record_store(void *cls, const struct RecordStoreMessage *rp_msg)
Checks a GNUNET_MESSAGE_TYPE_NAMESTORE_RECORD_STORE message.
static struct GNUNET_STATISTICS_Handle * statistics
Handle to the statistics service.
static void * client_connect_cb(void *cls, struct GNUNET_SERVICE_Client *client, struct GNUNET_MQ_Handle *mq)
Add a client to our list of active clients.
static void merge_with_nick_records(const struct GNUNET_GNSRECORD_Data *nick_rd, unsigned int rd2_length, const struct GNUNET_GNSRECORD_Data *rd2, unsigned int *rdc_res, struct GNUNET_GNSRECORD_Data **rd_res)
Merge the nick record nick_rd with the rest of the record set given in rd2.
static struct StoreActivity * sa_head
Head of DLL of monitor-blocked store activities.
static void handle_record_lookup(void *cls, const struct LabelLookupMessage *ll_msg)
Handles a GNUNET_MESSAGE_TYPE_NAMESTORE_RECORD_LOOKUP message.
static void free_store_activity(struct StoreActivity *sa)
Release memory used by sa.
static void handle_zone_to_name(void *cls, const struct ZoneToNameMessage *ztn_msg)
Handles a GNUNET_MESSAGE_TYPE_NAMESTORE_ZONE_TO_NAME message.
static int continue_store_activity(struct StoreActivity *sa, int call_continue)
Continue processing the sa.
static struct ZoneMonitor * monitor_head
First active zone monitor.
static int check_record_lookup(void *cls, const struct LabelLookupMessage *ll_msg)
Handles a GNUNET_MESSAGE_TYPE_NAMESTORE_RECORD_LOOKUP message.
static void zone_iterate_proc(void *cls, uint64_t seq, const char *editor_hint, const struct GNUNET_CRYPTO_PrivateKey *zone_key, const char *name, unsigned int rd_count, const struct GNUNET_GNSRECORD_Data *rd)
Process results for zone iteration from database.
static void zone_iteration_done_client_continue(struct ZoneIteration *zi)
Function called once we are done with the zone iteration and allow the zone iteration client to send ...
#define MONITOR_STALL_WARN_DELAY
If a monitor takes more than 1 minute to process an event, print a warning.
static enum GNUNET_GenericReturnValue check_zone_to_name(void *cls, const struct ZoneToNameMessage *zis_msg)
static enum GNUNET_ErrorCode store_record_set(struct NamestoreClient *nc, const struct GNUNET_CRYPTO_PrivateKey *private_key, const struct RecordSet *rd_set, ssize_t *len)
static void monitor_iteration_next(void *cls)
Obtain the next datum during the zone monitor's zone initial iteration.
static void handle_edit_record_set_cancel(void *cls, const struct EditRecordSetCancelMessage *er_msg)
Handles a GNUNET_MESSAGE_TYPE_NAMESTORE_RECORD_SET_EDIT_CANCEL message.
static const struct GNUNET_CONFIGURATION_Handle * GSN_cfg
Configuration handle.
static void cache_nick(const struct GNUNET_CRYPTO_PrivateKey *zone, const struct GNUNET_GNSRECORD_Data *nick)
Add entry to the cache for zone and nick.
static void send_store_response(struct NamestoreClient *nc, enum GNUNET_ErrorCode ec, uint32_t rid)
Send response to the store request to the client.
static void handle_monitor_start(void *cls, const struct ZoneMonitorStartMessage *zis_msg)
Handles a GNUNET_MESSAGE_TYPE_NAMESTORE_MONITOR_START message.
#define NC_SIZE
Size of the cache used by get_nick_record()
static struct ZoneMonitor * monitor_tail
Last active zone monitor.
static void client_disconnect_cb(void *cls, struct GNUNET_SERVICE_Client *client, void *app_ctx)
Called whenever a client is disconnected.
static struct NickCache nick_cache[16]
We cache nick records to reduce DB load.
static void handle_iteration_next(void *cls, const struct ZoneIterationNextMessage *zis_msg)
Handles a GNUNET_MESSAGE_TYPE_NAMESTORE_ZONE_ITERATION_NEXT message.
static void handle_edit_record_set(void *cls, const struct EditRecordSetMessage *er_msg)
Handles a GNUNET_MESSAGE_TYPE_NAMESTORE_RECORD_SET_EDIT message.
static void warn_monitor_slow(void *cls)
Print a warning that one of our monitors is no longer reacting.
static void get_existing_rd_exp(void *cls, uint64_t seq, const char *editor_hint, const struct GNUNET_CRYPTO_PrivateKey *private_key, const char *label, unsigned int rd_count, const struct GNUNET_GNSRECORD_Data *rd)
Check if set contains a tombstone, store if necessary.
static int check_edit_record_set_cancel(void *cls, const struct EditRecordSetCancelMessage *er_msg)
Handles a GNUNET_MESSAGE_TYPE_NAMESTORE_RECORD_SET_EDIT_CANCEL message.
static int send_lookup_response_with_filter(struct NamestoreClient *nc, uint32_t request_id, const struct GNUNET_CRYPTO_PrivateKey *zone_key, const char *name, unsigned int rd_count, const struct GNUNET_GNSRECORD_Data *rd, enum GNUNET_GNSRECORD_Filter filter)
Generate a struct LookupNameResponseMessage and send it to the given client using the given notificat...
static enum GNUNET_GenericReturnValue check_monitor_start(void *cls, const struct ZoneMonitorStartMessage *zis_msg)
static void lookup_nick_it(void *cls, uint64_t seq, const char *editor_hint, const struct GNUNET_CRYPTO_PrivateKey *private_key, const char *label, unsigned int rd_count, const struct GNUNET_GNSRECORD_Data *rd)
Function called with the records for the GNUNET_GNS_EMPTY_LABEL_AT label in the zone.
static void run(void *cls, const struct GNUNET_CONFIGURATION_Handle *cfg, struct GNUNET_SERVICE_Handle *service)
Process namestore requests.
static void lookup_it(void *cls, uint64_t seq, const char *editor_hint, const struct GNUNET_CRYPTO_PrivateKey *private_key, const char *label, unsigned int rd_count_nf, const struct GNUNET_GNSRECORD_Data *rd_nf)
Function called by the namestore plugin when we are trying to lookup a record as part of handle_recor...
static struct GNUNET_TIME_Relative duration
Option '-d': duration of the mapping.
API that can be used to manipulate GNS record data.
Plugin API for the namestore database backend.
Constants for network protocols.
API to create, modify and access statistics.
#define GNUNET_MAX_MESSAGE_SIZE
Largest supported message (to be precise, one byte more than the largest possible message,...
enum GNUNET_GenericReturnValue GNUNET_CONFIGURATION_get_value_yesno(const struct GNUNET_CONFIGURATION_Handle *cfg, const char *section, const char *option)
Get a configuration value that should be in a set of "YES" or "NO".
enum GNUNET_GenericReturnValue GNUNET_CONFIGURATION_get_value_string(const struct GNUNET_CONFIGURATION_Handle *cfg, const char *section, const char *option, char **value)
Get a configuration value that should be a string.
#define GNUNET_CONTAINER_DLL_remove(head, tail, element)
Remove an element from a DLL.
#define GNUNET_CONTAINER_DLL_insert(head, tail, element)
Insert an element at the head of a DLL.
enum GNUNET_GenericReturnValue GNUNET_GNSRECORD_label_check(const char *label, char **emsg)
Check label for invalid characters.
const char * GNUNET_GNSRECORD_z2s(const struct GNUNET_CRYPTO_PublicKey *z)
Convert a zone to a string (for printing debug messages).
int GNUNET_GNSRECORD_records_deserialize(size_t len, const char *src, unsigned int rd_count, struct GNUNET_GNSRECORD_Data *dest)
Deserialize the given records to the given destination.
ssize_t GNUNET_GNSRECORD_records_serialize(unsigned int rd_count, const struct GNUNET_GNSRECORD_Data *rd, size_t dest_size, char *dest)
Serialize the given records to the given destination buffer.
ssize_t GNUNET_GNSRECORD_records_get_size(unsigned int rd_count, const struct GNUNET_GNSRECORD_Data *rd)
Calculate how many bytes we will need to serialize the given records.
#define GNUNET_GNS_EMPTY_LABEL_AT
String we use to indicate an empty label (top-level entry in the zone).
char * GNUNET_GNSRECORD_string_normalize(const char *src)
Normalize a UTF-8 string to a GNS name.
GNUNET_GNSRECORD_Filter
Filter for GNUNET_GNSRECORD_normalize_record_set().
enum GNUNET_GenericReturnValue GNUNET_GNSRECORD_normalize_record_set(const char *label, const struct GNUNET_GNSRECORD_Data *rd, unsigned int rd_count, struct GNUNET_GNSRECORD_Data *rd_public, unsigned int *rd_count_public, struct GNUNET_TIME_Absolute *min_expiry, enum GNUNET_GNSRECORD_Filter filter, char **emsg)
Normalize namestore records: Check for consistency and expirations.
@ GNUNET_GNSRECORD_RF_RELATIVE_EXPIRATION
This expiration time of the record is a relative time (not an absolute time).
@ GNUNET_GNSRECORD_RF_SUPPLEMENTAL
This is a supplemental record.
@ GNUNET_GNSRECORD_RF_MAINTENANCE
Maintenance records.
@ GNUNET_GNSRECORD_RF_PRIVATE
This is a private record of this peer and it should thus not be published.
@ GNUNET_GNSRECORD_FILTER_NONE
No filter flags set.
@ GNUNET_GNSRECORD_FILTER_INCLUDE_MAINTENANCE
Include maintenance records (TOMBSTONE etc).
@ GNUNET_GNSRECORD_FILTER_OMIT_PRIVATE
Filter private records.
#define GNUNET_is_zero(a)
Check that memory in a is all zeros.
#define GNUNET_log(kind,...)
#define GNUNET_NZL(l)
Macro used to avoid using 0 for the length of a variable-size array (Non-Zero-Length).
#define GNUNET_LOG_CALL_STATUS
enum GNUNET_GenericReturnValue GNUNET_CRYPTO_key_get_public(const struct GNUNET_CRYPTO_PrivateKey *privkey, struct GNUNET_CRYPTO_PublicKey *key)
Retrieves the public key representation of a private key.
uint64_t GNUNET_ntohll(uint64_t n)
Convert unsigned 64-bit integer to host byte order.
int GNUNET_get_log_call_status(int caller_level, const char *comp, const char *file, const char *function, int line)
Decides whether a particular logging call should or should not be allowed to be made.
ssize_t GNUNET_CRYPTO_private_key_get_length(const struct GNUNET_CRYPTO_PrivateKey *key)
Get the compacted length of a GNUNET_CRYPTO_PrivateKey.
#define GNUNET_memcmp(a, b)
Compare memory in a and b, where both must be of the same pointer type.
ssize_t GNUNET_CRYPTO_write_private_key_to_buffer(const struct GNUNET_CRYPTO_PrivateKey *key, void *buffer, size_t len)
Writes a GNUNET_CRYPTO_PrivateKey to a compact buffer.
#define GNUNET_memcpy(dst, src, n)
Call memcpy() but check for n being 0 first.
enum GNUNET_GenericReturnValue GNUNET_CRYPTO_read_public_key_from_buffer(const void *buffer, size_t len, struct GNUNET_CRYPTO_PublicKey *key, size_t *read)
Reads a GNUNET_CRYPTO_PublicKey from a compact buffer.
GNUNET_GenericReturnValue
Named constants for return values.
enum GNUNET_GenericReturnValue GNUNET_CRYPTO_read_private_key_from_buffer(const void *buffer, size_t len, struct GNUNET_CRYPTO_PrivateKey *key, size_t *read)
Reads a GNUNET_CRYPTO_PrivateKey from a compact buffer.
uint16_t size
The length of the struct (in bytes, including the length field itself), in big-endian format.
#define GNUNET_assert(cond)
Use this for fatal errors that cannot be handled.
#define GNUNET_break(cond)
Use this for internal assertion violations that are not fatal (can be handled) but should not occur.
@ GNUNET_ERROR_TYPE_WARNING
@ GNUNET_ERROR_TYPE_ERROR
@ GNUNET_ERROR_TYPE_DEBUG
int int GNUNET_asprintf(char **buf, const char *format,...) __attribute__((format(printf
Like asprintf, just portable.
#define GNUNET_strdup(a)
Wrapper around GNUNET_xstrdup_.
#define GNUNET_new(type)
Allocate a struct or union of the given type.
#define GNUNET_malloc(size)
Wrapper around malloc.
#define GNUNET_free(ptr)
Wrapper around free.
void GNUNET_notification_context_destroy(struct GNUNET_NotificationContext *nc)
Destroy the context, force disconnect for all subscribers.
void GNUNET_MQ_send(struct GNUNET_MQ_Handle *mq, struct GNUNET_MQ_Envelope *ev)
Send a message with the given message queue.
#define GNUNET_MQ_handler_end()
End-marker for the handlers array.
#define GNUNET_MQ_msg_extra(mvar, esize, type)
Allocate an envelope, with extra space allocated after the space needed by the message struct.
struct GNUNET_NotificationContext * GNUNET_notification_context_create(unsigned int queue_length)
Create a new notification context.
#define GNUNET_MQ_msg(mvar, type)
Allocate a GNUNET_MQ_Envelope.
#define GNUNET_MQ_hd_var_size(name, code, str, ctx)
#define GNUNET_MQ_hd_fixed_size(name, code, str, ctx)
void GNUNET_notification_context_add(struct GNUNET_NotificationContext *nc, struct GNUNET_MQ_Handle *mq)
Add a subscriber to the notification context.
const struct GNUNET_OS_ProjectData * GNUNET_OS_project_data_gnunet(void)
Return default project data used by 'libgnunetutil' for GNUnet.
void * GNUNET_PLUGIN_load(const struct GNUNET_OS_ProjectData *pd, const char *library_name, void *arg)
Setup plugin (runs the "init" callback and returns whatever "init" returned).
void * GNUNET_PLUGIN_unload(const char *library_name, void *arg)
Unload plugin (runs the "done" callback and returns whatever "done" returned).
#define GNUNET_MESSAGE_TYPE_NAMESTORE_RECORD_RESULT_END
Service to client: end of list of results.
#define GNUNET_MESSAGE_TYPE_NAMESTORE_RECORD_RESULT
Service to client: here is a (plaintext) record you requested.
#define GNUNET_MESSAGE_TYPE_NAMESTORE_RECORD_SET_EDIT
Message type for start of record edit with advisory lock.
#define GNUNET_MESSAGE_TYPE_NAMESTORE_ZONE_TO_NAME_RESPONSE
Service to client: result of zone-to-name lookup.
#define GNUNET_MESSAGE_TYPE_NAMESTORE_GENERIC_RESPONSE
Service to client: result of store operation.
#define GNUNET_MESSAGE_TYPE_NAMESTORE_RECORD_SET_EDIT_CANCEL
Message type for cancellation/reset of editor hint/advisory lock.
#define GNUNET_MESSAGE_TYPE_NAMESTORE_ZONE_ITERATION_NEXT
Client to service: next record(s) in iteration please.
#define GNUNET_MESSAGE_TYPE_NAMESTORE_ZONE_ITERATION_START
Client to service: please start iteration; receives "GNUNET_MESSAGE_TYPE_NAMESTORE_LOOKUP_NAME_RESPON...
#define GNUNET_MESSAGE_TYPE_NAMESTORE_ZONE_ITERATION_STOP
Client to service: stop iterating.
#define GNUNET_MESSAGE_TYPE_NAMESTORE_RECORD_LOOKUP_RESPONSE
Service to client: lookup label.
#define GNUNET_MESSAGE_TYPE_NAMESTORE_RECORD_SET_EDIT_RESPONSE
Return record set to edit with previous editor hint/advisory lock.
#define GNUNET_MESSAGE_TYPE_NAMESTORE_RECORD_STORE
Client to service: store records (as authority)
#define GNUNET_MESSAGE_TYPE_NAMESTORE_MONITOR_NEXT
Client to service: I am now ready for the next (set of) monitor events.
#define GNUNET_MESSAGE_TYPE_NAMESTORE_MONITOR_START
Client to service: start monitoring (yields sequence of "ZONE_ITERATION_RESPONSES" — forever).
#define GNUNET_MESSAGE_TYPE_NAMESTORE_ZONE_TO_NAME
Client to service: "reverse" lookup for zone name based on zone key.
#define GNUNET_MESSAGE_TYPE_NAMESTORE_MONITOR_SYNC
Service to client: you're now in sync.
#define GNUNET_MESSAGE_TYPE_NAMESTORE_RECORD_LOOKUP
Client to service: lookup label.
struct GNUNET_SCHEDULER_Task * GNUNET_SCHEDULER_add_shutdown(GNUNET_SCHEDULER_TaskCallback task, void *task_cls)
Schedule a new task to be run on shutdown, that is when a CTRL-C signal is received,...
void * GNUNET_SCHEDULER_cancel(struct GNUNET_SCHEDULER_Task *task)
Cancel the task with the specified identifier.
struct GNUNET_SCHEDULER_Task * GNUNET_SCHEDULER_add_now(GNUNET_SCHEDULER_TaskCallback task, void *task_cls)
Schedule a new task to be run as soon as possible.
struct GNUNET_SCHEDULER_Task * GNUNET_SCHEDULER_add_delayed(struct GNUNET_TIME_Relative delay, GNUNET_SCHEDULER_TaskCallback task, void *task_cls)
Schedule a new task to be run with a specified delay.
void GNUNET_SERVICE_client_mark_monitor(struct GNUNET_SERVICE_Client *c)
Set the 'monitor' flag on this client.
void GNUNET_SERVICE_client_drop(struct GNUNET_SERVICE_Client *c)
Ask the server to disconnect from the given client.
void GNUNET_SERVICE_client_continue(struct GNUNET_SERVICE_Client *c)
Continue receiving further messages from the given client.
@ GNUNET_SERVICE_OPTION_NONE
Use defaults.
struct GNUNET_STATISTICS_Handle * GNUNET_STATISTICS_create(const char *subsystem, const struct GNUNET_CONFIGURATION_Handle *cfg)
Get handle for the statistics service.
void GNUNET_STATISTICS_set(struct GNUNET_STATISTICS_Handle *handle, const char *name, uint64_t value, int make_persistent)
Set statistic value for the peer.
void GNUNET_STATISTICS_update(struct GNUNET_STATISTICS_Handle *handle, const char *name, int64_t delta, int make_persistent)
Set statistic value for the peer.
void GNUNET_STATISTICS_destroy(struct GNUNET_STATISTICS_Handle *h, int sync_first)
Destroy a handle (free all state associated with it).
struct GNUNET_TIME_Relative GNUNET_TIME_absolute_get_duration(struct GNUNET_TIME_Absolute whence)
Get the duration of an operation as the difference of the current time and the given start time "henc...
struct GNUNET_TIME_Absolute GNUNET_TIME_absolute_get(void)
Get the current time.
#define GNUNET_TIME_absolute_cmp(t1, op, t2)
Compare two absolute times.
#define GNUNET_TIME_UNIT_ZERO_ABS
Absolute time zero.
struct GNUNET_TIME_Relative GNUNET_TIME_relative_divide(struct GNUNET_TIME_Relative rel, unsigned long long factor)
Divide relative time by a given factor.
struct GNUNET_TIME_AbsoluteNBO GNUNET_TIME_absolute_hton(struct GNUNET_TIME_Absolute a)
Convert absolute time to network byte order.
const char * GNUNET_STRINGS_absolute_time_to_string(struct GNUNET_TIME_Absolute t)
Like asctime, except for GNUnet time.
common internal definitions for namestore service
static unsigned int size
Size of the "table".
static int zone_to_name(void *cls, const struct GNUNET_HashCode *key, void *value)
#define GNUNET_GNSRECORD_TYPE_NICK
GNS zone nickname.
#define GNUNET_GNSRECORD_TYPE_TOMBSTONE
Record type to indicate a previously delete record (PRIVATE only)
GNUNET_ErrorCode
Taler error codes.
@ GNUNET_EC_NAMESTORE_NO_RESULTS
No results given.
@ GNUNET_EC_NAMESTORE_LABEL_INVALID
Label invalid or malformed.
@ GNUNET_EC_NAMESTORE_BACKEND_FAILED
There was an error in the database backend.
@ GNUNET_EC_NAMESTORE_RECORD_TOO_BIG
Record size exceeds maximum limit.
@ GNUNET_EC_NAMESTORE_STORE_FAILED
Failed to store the given records.
@ GNUNET_EC_NAMESTORE_RECORD_DATA_INVALID
Record data invalid.
@ GNUNET_EC_NAMESTORE_ZONE_NOT_FOUND
Zone not found.
@ GNUNET_EC_NONE
No error (success).
@ GNUNET_EC_NAMESTORE_UNKNOWN
Unknown namestore error.
@ GNUNET_EC_NAMESTORE_RECORD_NOT_FOUND
Record not found.
Edit a record set and set editor hint/advisory lock.
struct GNUNET_NAMESTORE_Header gns_header
Type will be #GNUNET_MESSAGE_TYPE_NAMESTORE_EDIT_RECORD_SET_CANCEL.
uint16_t editor_hint_len
Unused.
uint16_t label_len
Length of the name.
uint16_t key_len
Length of the zone key.
Edit a record set and set editor hint/advisory lock.
struct GNUNET_NAMESTORE_Header gns_header
Type will be #GNUNET_MESSAGE_TYPE_NAMESTORE_EDIT_RECORD_SET.
uint16_t editor_hint_len
Unused.
uint16_t label_len
Length of the name.
uint16_t key_len
Length of the zone key.
Response to RecordSetEditMessage.
struct GNUNET_NAMESTORE_Header gns_header
Type will be GNUNET_MESSAGE_TYPE_NAMESTORE_RECORD_SET_EDIT_RESPONSE.
uint16_t editor_hint_len
Length of the editor hint.
uint16_t rd_count
Number of records contained.
uint16_t rd_len
Length of serialized record data.
A private key for an identity as per LSD0001.
An identity key as per LSD0001.
uint32_t record_type
Type of the GNS/DNS record.
const void * data
Binary value stored in the DNS record.
size_t data_size
Number of bytes in data.
enum GNUNET_GNSRECORD_Flags flags
Flags for the record.
uint64_t expiration_time
Expiration time for the DNS record.
Handle to a message queue.
struct returned by the initialization function of the plugin
enum GNUNET_GenericReturnValue(* lookup_records)(void *cls, const struct GNUNET_CRYPTO_PrivateKey *zone, const char *label, GNUNET_NAMESTORE_RecordIterator iter, void *iter_cls)
Lookup records in the datastore for which we are the authority.
void * cls
Closure to pass to all plugin functions.
struct GNUNET_MQ_Handle * mq
Handle to namestore service.
enum GNUNET_GNSRECORD_Filter filter
Record set filter for this monitor.
struct GNUNET_CRYPTO_PrivateKey zone
Monitored zone.
The notification context is the key datastructure for a convenience API used for transmission of noti...
Entry in list of pending tasks.
Handle to a client that is connected to a service.
Time for absolute times used by GNUnet, in microseconds.
uint64_t abs_value_us
The actual value.
Time for relative time used by GNUnet, in microseconds.
uint64_t rel_value_us
The actual value.
struct GNUNET_NAMESTORE_Header gns_header
Type will be GNUNET_MESSAGE_TYPE_NAMESTORE_RECORD_LOOKUP.
uint16_t key_len
Length of the zone key.
uint16_t filter
The record filter.
uint16_t label_len
Length of the name.
uint16_t rd_len
Length of serialized record data.
struct GNUNET_NAMESTORE_Header gns_header
Type will be GNUNET_MESSAGE_TYPE_NAMESTORE_RECORD_LOOKUP_RESPONSE.
uint16_t reserved
Reserved (alignment)
uint16_t key_len
Length of the zone key.
uint16_t rd_count
Number of records contained.
uint16_t name_len
Name length.
int16_t found
Was the label found in the database?? GNUNET_YES or GNUNET_NO.
struct GNUNET_TIME_Absolute exp
The expiration of the existing records or tombstone.
int only_tombstone
Whether the existing record set consists only of a tombstone (e.g.
struct ZoneIteration * op_head
Head of the DLL of Zone iteration operations in progress initiated by this client.
struct GNUNET_NAMESTORE_PluginFunctions * GSN_database
Database handle for client.
char * db_lib_name
Name of loaded plugin (needed for cleanup)
struct GNUNET_MQ_Handle * mq
Message queue for transmission to client.
struct GNUNET_SERVICE_Client * client
The client.
struct ZoneIteration * op_tail
Tail of the DLL of Zone iteration operations in progress initiated by this client.
Response to a record storage request.
struct GNUNET_NAMESTORE_Header gns_header
Type will be GNUNET_MESSAGE_TYPE_NAMESTORE_GENERIC_RESPONSE.
uint32_t ec
GNUNET_ErrorCode.
Entry in list of cached nick resolutions.
struct GNUNET_GNSRECORD_Data * rd
Cached record data.
struct GNUNET_TIME_Absolute last_used
Timestamp when this cache entry was used last.
struct GNUNET_CRYPTO_PrivateKey zone
Zone the cache entry is for.
char * editor_hint
The editor hint for set.
struct GNUNET_GNSRECORD_Data * nick
The nick for the zone.
char * res_rd
The record result.
const char * label
The label to look up.
int found
If a record set was found or not.
unsigned int res_rd_count
The number of found records.
ssize_t rd_ser_len
The length of the serialized records.
enum GNUNET_GNSRECORD_Filter filter
The record filter.
Record is returned from the namestore (as authority).
uint16_t rd_len
Length of serialized record data.
uint16_t name_len
Name length.
uint16_t rd_count
Number of records contained.
struct GNUNET_TIME_AbsoluteNBO expire
Expiration time if the record result (if any).
struct GNUNET_NAMESTORE_Header gns_header
Type will be GNUNET_MESSAGE_TYPE_NAMESTORE_RECORD_RESULT.
uint16_t key_len
Length of the zone key.
uint16_t rd_len
Length of serialized record data.
uint16_t rd_count
Number of records contained.
uint16_t name_len
Name length.
Store a record to the namestore (as authority).
struct GNUNET_NAMESTORE_Header gns_header
Type will be GNUNET_MESSAGE_TYPE_NAMESTORE_RECORD_STORE.
uint16_t rd_set_count
Number of record sets.
uint16_t single_tx
GNUNET_YES if all sets should be stored in a single transaction (e.g.
uint16_t key_len
Length of the zone key.
Information for an ongoing handle_record_store() operation.
struct StoreActivity * next
Kept in a DLL.
uint32_t rid
The request ID.
const struct RecordSet * rs
Copy of the original record set (as data fields in rd will point into it!).
uint16_t rd_set_count
The number of records in this activity.
struct NamestoreClient * nc
Which client triggered the store activity?
uint16_t rd_set_pos
The currently processed record.
struct StoreActivity * prev
Kept in a DLL.
struct ZoneMonitor * zm_pos
Next zone monitor that still needs to be notified about this PUT.
struct GNUNET_CRYPTO_PrivateKey private_key
The zone private key.
Ask for next result of zone iteration for the given operation.
struct GNUNET_NAMESTORE_Header gns_header
Type will be GNUNET_MESSAGE_TYPE_NAMESTORE_ZONE_ITERATION_NEXT.
uint64_t limit
Number of records to return to the iterator in one shot (before GNUNET_MESSAGE_TYPE_NAMESTORE_ZONE_IT...
Context for record remove operations passed from run_zone_iteration_round to zone_iterate_proc as clo...
struct ZoneIteration * zi
The zone iteration handle.
int run_again
Skip a result and run again unless GNUNET_NO.
uint64_t limit
Number of results left to be returned in this iteration.
Start a zone iteration for the given zone.
uint16_t key_len
Length of the zone key.
uint16_t filter
Record set filter control flags.
struct GNUNET_NAMESTORE_Header gns_header
Type will be GNUNET_MESSAGE_TYPE_NAMESTORE_ZONE_ITERATION_START.
Stop zone iteration for the given operation.
struct GNUNET_NAMESTORE_Header gns_header
Type will be GNUNET_MESSAGE_TYPE_NAMESTORE_ZONE_ITERATION_STOP.
A namestore iteration operation.
struct NamestoreClient * nc
Namestore client which initiated this zone iteration.
uint64_t seq
Last sequence number in the zone iteration used to address next result of the zone iteration in the s...
struct GNUNET_GNSRECORD_Data * nick
The nick to add to the records.
enum GNUNET_GNSRECORD_Filter filter
The record set filter.
struct GNUNET_CRYPTO_PrivateKey zone
Key of the zone we are iterating over.
int send_end
Set to GNUNET_YES if the last iteration exhausted the limit set by the client and we should send the ...
uint32_t request_id
The operation id for the zone iteration in the response for the client.
struct ZoneIteration * prev
Previous element in the DLL.
uint32_t offset
Offset of the zone iteration used to address next result of the zone iteration in the store.
struct ZoneIteration * next
Next element in the DLL.
Ask for next result of zone iteration for the given operation.
uint64_t limit
Number of records to return to the iterator in one shot (before #GNUNET_MESSAGE_TYPE_NAMESTORE_ZONE_M...
uint32_t iterate_first
GNUNET_YES to first iterate over all records, GNUNET_NO to only monitor changes.o
uint16_t filter
Record set filter control flags.
uint16_t key_len
Length of the zone key.
struct GNUNET_MessageHeader header
Type will be GNUNET_MESSAGE_TYPE_NAMESTORE_MONITOR_START.
struct GNUNET_SCHEDULER_Task * sa_wait_warning
Task to warn about slow monitors.
struct GNUNET_TIME_Absolute sa_waiting_start
Since when are we blocked on this monitor?
int in_first_iteration
Are we (still) in the initial iteration pass?
enum GNUNET_GNSRECORD_Filter filter
The record set filter.
struct ZoneMonitor * prev
Previous element in the DLL.
int sa_waiting
Is there a store activity waiting for this monitor? We only raise the flag when it happens and search...
uint64_t iteration_cnt
How many more requests may we receive from the iterator before it is at the limit we gave it?...
uint64_t limit
Current limit of how many more messages we are allowed to queue to this monitor.
uint64_t seq
Last sequence number in the zone iteration used to address next result of the zone iteration in the s...
struct GNUNET_CRYPTO_PrivateKey zone
Private key of the zone.
struct GNUNET_SCHEDULER_Task * task
Task active during initial iteration.
struct NamestoreClient * nc
Namestore client which initiated this zone monitor.
int run_again
Run again because we skipped an orphan.
struct ZoneMonitor * next
Next element in the DLL.
Context for record remove operations passed from handle_zone_to_name to handle_zone_to_name_it as clo...
struct NamestoreClient * nc
Namestore client.
uint32_t rid
Request id (to be used in the response to the client).
enum GNUNET_ErrorCode ec
Set to GNUNET_OK on success, GNUNET_SYSERR on error.
Lookup a name for a zone hash.
uint16_t pkey_len
Length of the public value zone key.
uint16_t key_len
Length of the zone key.
struct GNUNET_NAMESTORE_Header gns_header
Type will be GNUNET_MESSAGE_TYPE_NAMESTORE_ZONE_TO_NAME.
Response for zone to name lookup.
uint16_t name_len
Length of the name.
int32_t ec
result in NBO: GNUNET_EC_NONE on success, GNUNET_EC_NAMESTORE_NO_RESULTS if there were no results.
uint16_t key_len
Length of the zone key.
struct GNUNET_NAMESTORE_Header gns_header
Type will be GNUNET_MESSAGE_TYPE_NAMESTORE_ZONE_TO_NAME_RESPONSE.
uint16_t rd_count
Number of records contained.
uint16_t rd_len
Length of serialized record data.