namestore for the GNUnet naming system More...
#include "gnunet_error_codes.h"
#include "gnunet_gnsrecord_lib.h"
#include "gnunet_protocols.h"
#include "gnunet_util_lib.h"
#include "gnunet_namestore_plugin.h"
#include "gnunet_statistics_service.h"
#include "namestore.h"
Go to the source code of this file.
Data Structures | |
struct | ZoneIteration |
A namestore iteration operation. More... | |
struct | NamestoreClient |
A namestore client. More... | |
struct | ZoneMonitor |
A namestore monitor. More... | |
struct | StoreActivity |
Information for an ongoing handle_record_store() operation. More... | |
struct | NickCache |
Entry in list of cached nick resolutions. More... | |
struct | RecordLookupContext |
Closure for lookup_it(). More... | |
struct | LookupExistingRecordsContext |
struct | ZoneToNameCtx |
Context for record remove operations passed from handle_zone_to_name to handle_zone_to_name_it as closure. More... | |
struct | ZoneIterationProcResult |
Context for record remove operations passed from run_zone_iteration_round to zone_iterate_proc as closure. More... | |
Macros | |
#define | LOG_STRERROR_FILE(kind, syscall, filename) GNUNET_log_from_strerror_file (kind, "util", syscall, filename) |
#define | MONITOR_STALL_WARN_DELAY GNUNET_TIME_UNIT_MINUTES |
If a monitor takes more than 1 minute to process an event, print a warning. More... | |
#define | NC_SIZE 16 |
Size of the cache used by get_nick_record() More... | |
Functions | |
static void | cleanup_task (void *cls) |
Task run during shutdown. More... | |
static void | free_store_activity (struct StoreActivity *sa) |
Release memory used by sa. More... | |
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. More... | |
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. More... | |
static struct GNUNET_GNSRECORD_Data * | get_nick_record (const struct GNUNET_CRYPTO_PrivateKey *zone) |
Return the NICK record for the zone (if it exists). More... | |
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. More... | |
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 notification context. More... | |
static void | send_store_response (struct NamestoreClient *nc, enum GNUNET_ErrorCode ec, uint32_t rid) |
Send response to the store request to the client. More... | |
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 us more messages. More... | |
static void | warn_monitor_slow (void *cls) |
Print a warning that one of our monitors is no longer reacting. More... | |
static int | continue_store_activity (struct StoreActivity *sa, int call_continue) |
Continue processing the sa. More... | |
static void | client_disconnect_cb (void *cls, struct GNUNET_SERVICE_Client *client, void *app_ctx) |
Called whenever a client is disconnected. More... | |
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. More... | |
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_record_lookup(). More... | |
static int | check_edit_record_set (void *cls, const struct EditRecordSetMessage *er_msg) |
Handles a GNUNET_MESSAGE_TYPE_NAMESTORE_RECORD_SET_EDIT message. More... | |
static void | handle_edit_record_set (void *cls, const struct EditRecordSetMessage *er_msg) |
Handles a GNUNET_MESSAGE_TYPE_NAMESTORE_RECORD_SET_EDIT message. More... | |
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. More... | |
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. More... | |
static int | check_record_lookup (void *cls, const struct LabelLookupMessage *ll_msg) |
Handles a GNUNET_MESSAGE_TYPE_NAMESTORE_RECORD_LOOKUP message. More... | |
static void | handle_record_lookup (void *cls, const struct LabelLookupMessage *ll_msg) |
Handles a GNUNET_MESSAGE_TYPE_NAMESTORE_RECORD_LOOKUP message. More... | |
static int | check_record_store (void *cls, const struct RecordStoreMessage *rp_msg) |
Checks a GNUNET_MESSAGE_TYPE_NAMESTORE_RECORD_STORE message. More... | |
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. More... | |
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 | handle_record_store (void *cls, const struct RecordStoreMessage *rp_msg) |
Handles a GNUNET_MESSAGE_TYPE_NAMESTORE_RECORD_STORE message. More... | |
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. More... | |
static enum GNUNET_GenericReturnValue | check_zone_to_name (void *cls, const struct ZoneToNameMessage *zis_msg) |
static void | handle_zone_to_name (void *cls, const struct ZoneToNameMessage *ztn_msg) |
Handles a GNUNET_MESSAGE_TYPE_NAMESTORE_ZONE_TO_NAME message. More... | |
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. More... | |
static void | run_zone_iteration_round (struct ZoneIteration *zi, uint64_t limit) |
Perform the next round of the zone iteration. More... | |
static enum GNUNET_GenericReturnValue | check_iteration_start (void *cls, const struct ZoneIterationStartMessage *zis_msg) |
static void | handle_iteration_start (void *cls, const struct ZoneIterationStartMessage *zis_msg) |
Handles a GNUNET_MESSAGE_TYPE_NAMESTORE_ZONE_ITERATION_START message. More... | |
static void | handle_iteration_stop (void *cls, const struct ZoneIterationStopMessage *zis_msg) |
Handles a GNUNET_MESSAGE_TYPE_NAMESTORE_ZONE_ITERATION_STOP message. More... | |
static void | handle_iteration_next (void *cls, const struct ZoneIterationNextMessage *zis_msg) |
Handles a GNUNET_MESSAGE_TYPE_NAMESTORE_ZONE_ITERATION_NEXT message. More... | |
static void | monitor_unblock (struct ZoneMonitor *zm) |
Function called when the monitor is ready for more data, and we should thus unblock PUT operations that were blocked on the monitor not being ready. More... | |
static void | monitor_sync (struct ZoneMonitor *zm) |
Send 'sync' message to zone monitor, we're now in sync. More... | |
static void | monitor_iteration_next (void *cls) |
Obtain the next datum during the zone monitor's zone initial iteration. More... | |
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. More... | |
static enum GNUNET_GenericReturnValue | check_monitor_start (void *cls, const struct ZoneMonitorStartMessage *zis_msg) |
static void | handle_monitor_start (void *cls, const struct ZoneMonitorStartMessage *zis_msg) |
Handles a GNUNET_MESSAGE_TYPE_NAMESTORE_MONITOR_START message. More... | |
static void | handle_monitor_next (void *cls, const struct ZoneMonitorNextMessage *nm) |
Handles a GNUNET_MESSAGE_TYPE_NAMESTORE_MONITOR_NEXT message. More... | |
static void | run (void *cls, const struct GNUNET_CONFIGURATION_Handle *cfg, struct GNUNET_SERVICE_Handle *service) |
Process namestore requests. More... | |
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. More... | |
Variables | |
static struct NickCache | nick_cache [16] |
We cache nick records to reduce DB load. More... | |
static const struct GNUNET_CRYPTO_PrivateKey | zero |
Public key of all zeros. More... | |
static const struct GNUNET_CONFIGURATION_Handle * | GSN_cfg |
Configuration handle. More... | |
static struct GNUNET_STATISTICS_Handle * | statistics |
Handle to the statistics service. More... | |
static char * | db_lib_name |
Name of the database plugin. More... | |
struct GNUNET_NAMESTORE_PluginFunctions * | GSN_database |
Database handle for service. More... | |
static struct ZoneMonitor * | monitor_head |
First active zone monitor. More... | |
static struct ZoneMonitor * | monitor_tail |
Last active zone monitor. More... | |
static struct StoreActivity * | sa_head |
Head of DLL of monitor-blocked store activities. More... | |
static struct StoreActivity * | sa_tail |
Tail of DLL of monitor-blocked store activities. More... | |
static struct GNUNET_NotificationContext * | monitor_nc |
Notification context shared by all monitors. More... | |
static int | return_orphaned |
Returned orphaned records? More... | |
namestore for the GNUnet naming system
Definition in file gnunet-service-namestore.c.
#define LOG_STRERROR_FILE | ( | kind, | |
syscall, | |||
filename | |||
) | GNUNET_log_from_strerror_file (kind, "util", syscall, filename) |
Definition at line 35 of file gnunet-service-namestore.c.
#define MONITOR_STALL_WARN_DELAY GNUNET_TIME_UNIT_MINUTES |
If a monitor takes more than 1 minute to process an event, print a warning.
Definition at line 41 of file gnunet-service-namestore.c.
#define NC_SIZE 16 |
Size of the cache used by get_nick_record()
Definition at line 46 of file gnunet-service-namestore.c.
|
static |
Task run during shutdown.
cls | unused |
Definition at line 390 of file gnunet-service-namestore.c.
References db_lib_name, GNUNET_break, GNUNET_ERROR_TYPE_DEBUG, GNUNET_free, GNUNET_log, GNUNET_NO, GNUNET_notification_context_destroy(), GNUNET_PLUGIN_unload(), GNUNET_STATISTICS_destroy(), GSN_database, monitor_nc, and statistics.
Referenced by run().
|
static |
Release memory used by sa.
sa | activity to free |
Definition at line 416 of file gnunet-service-namestore.c.
References GNUNET_CONTAINER_DLL_remove, GNUNET_free, sa_head, and sa_tail.
Referenced by client_disconnect_cb(), and continue_store_activity().
|
static |
Function called with the records for the GNUNET_GNS_EMPTY_LABEL_AT label in the zone.
Used to locate the GNUNET_GNSRECORD_TYPE_NICK record, which (if found) is then copied to cls for future use.
cls | a struct GNUNET_GNSRECORD_Data ** for storing the nick (if found) |
seq | sequence number of the record, MUST NOT BE ZERO |
private_key | the private key of the zone (unused) |
label | should be GNUNET_GNS_EMPTY_LABEL_AT |
rd_count | number of records in rd |
rd | records stored under label in the zone |
Definition at line 436 of file gnunet-service-namestore.c.
References GNUNET_GNSRECORD_Data::data, data_size, GNUNET_GNSRECORD_Data::data_size, GNUNET_GNSRECORD_Data::expiration_time, GNUNET_GNSRECORD_Data::flags, GNUNET_assert, GNUNET_break, GNUNET_GNS_EMPTY_LABEL_AT, GNUNET_GNSRECORD_TYPE_NICK, GNUNET_malloc, GNUNET_memcpy, rd, rd_count, GNUNET_GNSRECORD_Data::record_type, and res.
Referenced by get_nick_record().
|
static |
Add entry to the cache for zone and nick.
zone | zone key to cache under |
nick | nick entry to cache |
Definition at line 479 of file gnunet-service-namestore.c.
References GNUNET_TIME_Absolute::abs_value_us, GNUNET_GNSRECORD_Data::data, GNUNET_GNSRECORD_Data::data_size, GNUNET_free, GNUNET_malloc, GNUNET_memcmp, GNUNET_TIME_absolute_get(), NickCache::last_used, NC_SIZE, nick_cache, NickCache::rd, and NickCache::zone.
Referenced by get_nick_record(), and store_record_set().
|
static |
Return the NICK record for the zone (if it exists).
nc | the namestore client |
zone | private key for the zone to look for nick |
Definition at line 523 of file gnunet-service-namestore.c.
References cache_nick(), GNUNET_NAMESTORE_PluginFunctions::cls, GNUNET_GNSRECORD_Data::data, GNUNET_GNSRECORD_Data::data_size, GNUNET_CRYPTO_key_get_public(), GNUNET_ERROR_TYPE_BULK, GNUNET_ERROR_TYPE_DEBUG, GNUNET_get_log_call_status(), GNUNET_GNS_EMPTY_LABEL_AT, GNUNET_GNSRECORD_z2s(), GNUNET_log, GNUNET_LOG_CALL_STATUS, GNUNET_malloc, GNUNET_memcmp, GNUNET_OK, GNUNET_TIME_absolute_get(), GSN_database, NickCache::last_used, lookup_nick_it(), GNUNET_NAMESTORE_PluginFunctions::lookup_records, NC_SIZE, nick_cache, pub, NickCache::rd, res, and NickCache::zone.
Referenced by handle_edit_record_set(), handle_record_lookup(), and send_lookup_response_with_filter().
|
static |
Merge the nick record nick_rd with the rest of the record set given in rd2.
Store the result in rdc_res and rd_res. The nick_rd's expiration time is set to the maximum expiration time of all of the records in rd2.
nick_rd | the nick record to integrate | |
rd2_length | length of the rd2 array | |
rd2 | array of records | |
[out] | rdc_res | length of the resulting rd_res array |
[out] | rd_res | set to an array of records, including nick_rd and rd2; all of the variable-size 'data' fields in rd2 are allocated in the same chunk of memory! |
Definition at line 598 of file gnunet-service-namestore.c.
References data, GNUNET_GNSRECORD_Data::data, data_size, GNUNET_GNSRECORD_Data::data_size, GNUNET_GNSRECORD_Data::expiration_time, GNUNET_GNSRECORD_Data::flags, GNUNET_assert, GNUNET_break, GNUNET_GNSRECORD_RF_RELATIVE_EXPIRATION, GNUNET_GNSRECORD_RF_SUPPLEMENTAL, GNUNET_malloc, GNUNET_memcpy, and GNUNET_TIME_absolute_get().
Referenced by lookup_it(), and send_lookup_response_with_filter().
|
static |
Generate a struct LookupNameResponseMessage
and send it to the given client using the given notification context.
nc | client to unicast to |
request_id | request ID to use |
zone_key | zone key of the zone |
name | name |
rd_count | number of records in rd |
rd | array of records |
filter | record set filter |
FIXME if we ever support GNUNET_NAMESTORE_OMIT_PUBLIC, we need to omit adding this public record here
Definition at line 678 of file gnunet-service-namestore.c.
References env, RecordResultMessage::expire, filter, GNUNET_GNSRECORD_Data::flags, get_nick_record(), RecordResultMessage::gns_header, GNUNET_assert, GNUNET_break, GNUNET_CRYPTO_private_key_get_length(), GNUNET_CRYPTO_write_private_key_to_buffer(), GNUNET_ERROR_TYPE_DEBUG, GNUNET_ERROR_TYPE_ERROR, GNUNET_free, GNUNET_GNS_EMPTY_LABEL_AT, GNUNET_GNSRECORD_normalize_record_set(), GNUNET_GNSRECORD_records_get_size(), GNUNET_GNSRECORD_records_serialize(), GNUNET_GNSRECORD_RF_PRIVATE, GNUNET_log, GNUNET_memcpy, GNUNET_MESSAGE_TYPE_NAMESTORE_RECORD_RESULT, GNUNET_MQ_msg_extra, GNUNET_MQ_send(), GNUNET_NO, GNUNET_OK, GNUNET_SERVICE_client_drop(), GNUNET_STATISTICS_update(), GNUNET_TIME_absolute_hton(), GNUNET_TIME_UNIT_ZERO_ABS, RecordResultMessage::key_len, merge_with_nick_records(), name, RecordResultMessage::name_len, nc, GNUNET_NAMESTORE_Header::r_id, rd, rd_count, RecordResultMessage::rd_count, RecordResultMessage::rd_len, res, and statistics.
Referenced by continue_store_activity(), monitor_iterate_cb(), and zone_iterate_proc().
|
static |
Send response to the store request to the client.
nc | client to talk to |
ec | status of the operation |
rid | client's request ID |
Definition at line 806 of file gnunet-service-namestore.c.
References NamestoreResponseMessage::ec, env, NamestoreResponseMessage::gns_header, GNUNET_assert, GNUNET_ERROR_TYPE_DEBUG, GNUNET_log, GNUNET_MESSAGE_TYPE_NAMESTORE_GENERIC_RESPONSE, GNUNET_MQ_msg, GNUNET_MQ_send(), GNUNET_NO, GNUNET_STATISTICS_update(), nc, GNUNET_NAMESTORE_Header::r_id, and statistics.
Referenced by continue_store_activity(), and handle_record_store().
|
static |
Function called once we are done with the zone iteration and allow the zone iteration client to send us more messages.
zi | zone iteration we are processing |
Definition at line 835 of file gnunet-service-namestore.c.
References NamestoreClient::client, env, GNUNET_CONTAINER_DLL_remove, GNUNET_free, GNUNET_MESSAGE_TYPE_NAMESTORE_RECORD_RESULT_END, GNUNET_MQ_msg, GNUNET_MQ_send(), GNUNET_SERVICE_client_continue(), NamestoreClient::mq, ZoneIteration::nc, NamestoreClient::op_head, NamestoreClient::op_tail, GNUNET_NAMESTORE_Header::r_id, ZoneIteration::request_id, and ZoneIteration::send_end.
Referenced by run_zone_iteration_round().
|
static |
Print a warning that one of our monitors is no longer reacting.
cls | a struct ZoneMonitor to warn about |
Definition at line 859 of file gnunet-service-namestore.c.
References GNUNET_ERROR_TYPE_WARNING, GNUNET_log, GNUNET_SCHEDULER_add_delayed(), GNUNET_STRINGS_absolute_time_to_string(), MONITOR_STALL_WARN_DELAY, warn_monitor_slow(), and zm.
Referenced by continue_store_activity(), handle_monitor_next(), monitor_unblock(), and warn_monitor_slow().
|
static |
Continue processing the sa.
sa | store activity to process |
Definition at line 878 of file gnunet-service-namestore.c.
References NamestoreClient::client, GNUNET_NAMESTORE_ZoneMonitor::filter, free_store_activity(), GNUNET_assert, GNUNET_EC_NONE, GNUNET_ERROR_TYPE_DEBUG, GNUNET_GNSRECORD_records_deserialize(), GNUNET_log, GNUNET_memcmp, GNUNET_NO, GNUNET_NZL, GNUNET_OK, GNUNET_SCHEDULER_add_delayed(), GNUNET_SCHEDULER_cancel(), GNUNET_SERVICE_client_continue(), GNUNET_TIME_absolute_get(), GNUNET_YES, MONITOR_STALL_WARN_DELAY, name, RecordSet::name_len, StoreActivity::nc, StoreActivity::private_key, rd, rd_count, RecordSet::rd_count, RecordSet::rd_len, StoreActivity::rd_set_pos, StoreActivity::rid, StoreActivity::rs, send_lookup_response_with_filter(), send_store_response(), warn_monitor_slow(), zero, zm, StoreActivity::zm_pos, and GNUNET_NAMESTORE_ZoneMonitor::zone.
Referenced by client_disconnect_cb(), handle_record_store(), and monitor_unblock().
|
static |
Called whenever a client is disconnected.
Frees our resources associated with that client.
cls | closure |
client | identification of the client |
app_ctx | the struct NamestoreClient of client |
Definition at line 967 of file gnunet-service-namestore.c.
References continue_store_activity(), free_store_activity(), GNUNET_break, GNUNET_CONTAINER_DLL_remove, GNUNET_ERROR_TYPE_DEBUG, GNUNET_free, GNUNET_log, GNUNET_PLUGIN_unload(), GNUNET_SCHEDULER_cancel(), GNUNET_YES, monitor_head, monitor_tail, nc, StoreActivity::nc, StoreActivity::next, sa_head, zm, and StoreActivity::zm_pos.
|
static |
Add a client to our list of active clients.
cls | NULL |
client | client to add |
mq | message queue for client |
Definition at line 1039 of file gnunet-service-namestore.c.
References NamestoreClient::client, db_lib_name, GNUNET_CONFIGURATION_get_value_string(), GNUNET_ERROR_TYPE_DEBUG, GNUNET_ERROR_TYPE_ERROR, GNUNET_free, GNUNET_log, GNUNET_new, GNUNET_OK, GNUNET_OS_project_data_gnunet(), GNUNET_PLUGIN_load(), GNUNET_strdup, GSN_cfg, mq, and nc.
|
static |
Function called by the namestore plugin when we are trying to lookup a record as part of handle_record_lookup().
Merges all results into the context.
cls | closure with a struct RecordLookupContext |
seq | unique serial number of the record, MUST NOT BE ZERO |
private_key | private key of the zone |
label | name that is being mapped (at most 255 characters long) |
rd_count | number of entries in rd array |
rd | array of records with data to store |
Definition at line 1144 of file gnunet-service-namestore.c.
References RecordLookupContext::editor_hint, RecordLookupContext::filter, GNUNET_GNSRECORD_Data::flags, RecordLookupContext::found, GNUNET_assert, GNUNET_break, GNUNET_ERROR_TYPE_ERROR, GNUNET_free, GNUNET_GNS_EMPTY_LABEL_AT, GNUNET_GNSRECORD_normalize_record_set(), GNUNET_GNSRECORD_records_get_size(), GNUNET_GNSRECORD_records_serialize(), GNUNET_GNSRECORD_RF_PRIVATE, GNUNET_log, GNUNET_malloc, GNUNET_NO, GNUNET_OK, GNUNET_strdup, GNUNET_YES, RecordLookupContext::label, merge_with_nick_records(), RecordLookupContext::nick, rd, rd_count, RecordLookupContext::rd_ser_len, RecordLookupContext::res_rd, and RecordLookupContext::res_rd_count.
Referenced by handle_edit_record_set(), and handle_record_lookup().
|
static |
Handles a GNUNET_MESSAGE_TYPE_NAMESTORE_RECORD_SET_EDIT message.
cls | client sending the message |
er_msg | message of type struct EditRecordSetMessage |
Definition at line 1263 of file gnunet-service-namestore.c.
References EditRecordSetMessage::editor_hint_len, EditRecordSetMessage::gns_header, GNUNET_break, GNUNET_OK, GNUNET_SYSERR, GNUNET_NAMESTORE_Header::header, EditRecordSetMessage::key_len, EditRecordSetMessage::label_len, and GNUNET_MessageHeader::size.
|
static |
Handles a GNUNET_MESSAGE_TYPE_NAMESTORE_RECORD_SET_EDIT message.
cls | client sending the message |
ll_msg | message of type struct EditRecordSetMessage |
Definition at line 1292 of file gnunet-service-namestore.c.
References EditRecordSetResponseMessage::ec, RecordLookupContext::editor_hint, EditRecordSetResponseMessage::editor_hint_len, env, RecordLookupContext::filter, RecordLookupContext::found, get_nick_record(), EditRecordSetResponseMessage::gns_header, EditRecordSetMessage::gns_header, GNUNET_CRYPTO_read_private_key_from_buffer(), GNUNET_EC_NAMESTORE_NO_RESULTS, GNUNET_EC_NAMESTORE_UNKNOWN, GNUNET_EC_NONE, GNUNET_ERROR_TYPE_DEBUG, GNUNET_ERROR_TYPE_ERROR, GNUNET_free, GNUNET_GNSRECORD_FILTER_NONE, GNUNET_GNSRECORD_string_normalize(), GNUNET_log, GNUNET_memcpy, GNUNET_MESSAGE_TYPE_NAMESTORE_RECORD_SET_EDIT_RESPONSE, GNUNET_MQ_msg_extra, GNUNET_MQ_send(), GNUNET_NO, GNUNET_SERVICE_client_continue(), GNUNET_SERVICE_client_drop(), GNUNET_SYSERR, GNUNET_YES, EditRecordSetMessage::key_len, RecordLookupContext::label, EditRecordSetMessage::label_len, lookup_it(), nc, RecordLookupContext::nick, GNUNET_NAMESTORE_Header::r_id, EditRecordSetResponseMessage::rd_count, EditRecordSetResponseMessage::rd_len, RecordLookupContext::rd_ser_len, res, RecordLookupContext::res_rd, and RecordLookupContext::res_rd_count.
|
static |
Handles a GNUNET_MESSAGE_TYPE_NAMESTORE_RECORD_SET_EDIT_CANCEL message.
cls | client sending the message |
er_msg | message of type struct EditRecordSetMessage |
Definition at line 1392 of file gnunet-service-namestore.c.
References EditRecordSetCancelMessage::editor_hint_len, EditRecordSetCancelMessage::gns_header, GNUNET_break, GNUNET_OK, GNUNET_SYSERR, GNUNET_NAMESTORE_Header::header, EditRecordSetCancelMessage::key_len, EditRecordSetCancelMessage::label_len, and GNUNET_MessageHeader::size.
|
static |
Handles a GNUNET_MESSAGE_TYPE_NAMESTORE_RECORD_SET_EDIT_CANCEL message.
cls | client sending the message |
ll_msg | message of type struct EditRecordSetCancelMessage |
Definition at line 1425 of file gnunet-service-namestore.c.
References NamestoreResponseMessage::ec, EditRecordSetCancelMessage::editor_hint_len, env, NamestoreResponseMessage::gns_header, EditRecordSetCancelMessage::gns_header, GNUNET_CRYPTO_read_private_key_from_buffer(), GNUNET_EC_NAMESTORE_BACKEND_FAILED, GNUNET_EC_NONE, GNUNET_ERROR_TYPE_DEBUG, GNUNET_ERROR_TYPE_ERROR, GNUNET_free, GNUNET_GNSRECORD_string_normalize(), GNUNET_log, GNUNET_MESSAGE_TYPE_NAMESTORE_GENERIC_RESPONSE, GNUNET_MQ_msg, GNUNET_MQ_send(), GNUNET_OK, GNUNET_SERVICE_client_continue(), GNUNET_SERVICE_client_drop(), GNUNET_SYSERR, EditRecordSetCancelMessage::key_len, EditRecordSetCancelMessage::label_len, nc, GNUNET_NAMESTORE_Header::r_id, and res.
|
static |
Handles a GNUNET_MESSAGE_TYPE_NAMESTORE_RECORD_LOOKUP message.
cls | client sending the message |
ll_msg | message of type struct LabelLookupMessage |
Definition at line 1505 of file gnunet-service-namestore.c.
References LabelLookupMessage::gns_header, GNUNET_break, GNUNET_OK, GNUNET_SYSERR, GNUNET_NAMESTORE_Header::header, LabelLookupMessage::key_len, LabelLookupMessage::label_len, and GNUNET_MessageHeader::size.
|
static |
Handles a GNUNET_MESSAGE_TYPE_NAMESTORE_RECORD_LOOKUP message.
cls | client sending the message |
ll_msg | message of type struct LabelLookupMessage |
Definition at line 1531 of file gnunet-service-namestore.c.
References RecordLookupContext::editor_hint, env, RecordLookupContext::filter, LabelLookupMessage::filter, RecordLookupContext::found, LabelLookupResponseMessage::found, get_nick_record(), LabelLookupMessage::gns_header, LabelLookupResponseMessage::gns_header, GNUNET_CRYPTO_read_private_key_from_buffer(), GNUNET_ERROR_TYPE_DEBUG, GNUNET_ERROR_TYPE_ERROR, GNUNET_free, GNUNET_GNSRECORD_string_normalize(), GNUNET_log, GNUNET_memcpy, GNUNET_MESSAGE_TYPE_NAMESTORE_RECORD_LOOKUP_RESPONSE, GNUNET_MQ_msg_extra, GNUNET_MQ_send(), GNUNET_NO, GNUNET_SERVICE_client_continue(), GNUNET_SERVICE_client_drop(), GNUNET_SYSERR, GNUNET_YES, LabelLookupMessage::key_len, LabelLookupResponseMessage::key_len, RecordLookupContext::label, lookup_it(), LabelLookupResponseMessage::name_len, nc, RecordLookupContext::nick, GNUNET_NAMESTORE_Header::r_id, LabelLookupResponseMessage::rd_count, LabelLookupResponseMessage::rd_len, RecordLookupContext::rd_ser_len, res, RecordLookupContext::res_rd, RecordLookupContext::res_rd_count, and LabelLookupResponseMessage::reserved.
|
static |
Checks a GNUNET_MESSAGE_TYPE_NAMESTORE_RECORD_STORE message.
cls | client sending the message |
rp_msg | message of type struct RecordStoreMessage |
Definition at line 1625 of file gnunet-service-namestore.c.
References RecordStoreMessage::gns_header, GNUNET_break, GNUNET_OK, GNUNET_SYSERR, GNUNET_NAMESTORE_Header::header, RecordStoreMessage::key_len, RecordStoreMessage::rd_set_count, and GNUNET_MessageHeader::size.
|
static |
Check if set contains a tombstone, store if necessary.
cls | a struct GNUNET_GNSRECORD_Data ** for storing the nick (if found) |
seq | sequence number of the record, MUST NOT BE ZERO |
private_key | the private key of the zone (unused) |
label | should be GNUNET_GNS_EMPTY_LABEL_AT |
rd_count | number of records in rd |
rd | records stored under label in the zone |
Definition at line 1676 of file gnunet-service-namestore.c.
References LookupExistingRecordsContext::exp, GNUNET_ERROR_TYPE_ERROR, GNUNET_free, GNUNET_GNSRECORD_FILTER_OMIT_PRIVATE, GNUNET_GNSRECORD_normalize_record_set(), GNUNET_GNSRECORD_TYPE_TOMBSTONE, GNUNET_log, GNUNET_OK, GNUNET_YES, LookupExistingRecordsContext::only_tombstone, rd, rd_count, and GNUNET_GNSRECORD_Data::record_type.
Referenced by store_record_set().
|
static |
Definition at line 1714 of file gnunet-service-namestore.c.
References GNUNET_TIME_Absolute::abs_value_us, cache_nick(), GNUNET_GNSRECORD_Data::data, GNUNET_GNSRECORD_Data::data_size, LookupExistingRecordsContext::exp, GNUNET_GNSRECORD_Data::expiration_time, GNUNET_GNSRECORD_Data::flags, get_existing_rd_exp(), GNUNET_EC_NAMESTORE_LABEL_INVALID, GNUNET_EC_NAMESTORE_RECORD_DATA_INVALID, GNUNET_EC_NAMESTORE_RECORD_NOT_FOUND, GNUNET_EC_NAMESTORE_STORE_FAILED, GNUNET_EC_NONE, GNUNET_ERROR_TYPE_DEBUG, GNUNET_ERROR_TYPE_ERROR, GNUNET_free, GNUNET_GNS_EMPTY_LABEL_AT, GNUNET_GNSRECORD_FILTER_INCLUDE_MAINTENANCE, GNUNET_GNSRECORD_label_check(), GNUNET_GNSRECORD_normalize_record_set(), GNUNET_GNSRECORD_records_deserialize(), GNUNET_GNSRECORD_RF_MAINTENANCE, GNUNET_GNSRECORD_RF_PRIVATE, GNUNET_GNSRECORD_string_normalize(), GNUNET_GNSRECORD_TYPE_NICK, GNUNET_GNSRECORD_TYPE_TOMBSTONE, GNUNET_log, GNUNET_NO, GNUNET_NZL, GNUNET_OK, GNUNET_STATISTICS_update(), GNUNET_SYSERR, GNUNET_TIME_absolute_cmp, GNUNET_TIME_UNIT_ZERO_ABS, GNUNET_YES, RecordSet::name_len, nc, LookupExistingRecordsContext::only_tombstone, rd, rd_count, RecordSet::rd_count, RecordSet::rd_len, GNUNET_GNSRECORD_Data::record_type, res, and statistics.
Referenced by handle_record_store().
|
static |
Handles a GNUNET_MESSAGE_TYPE_NAMESTORE_RECORD_STORE message.
cls | client sending the message |
rp_msg | message of type struct RecordStoreMessage |
Definition at line 1912 of file gnunet-service-namestore.c.
References continue_store_activity(), RecordStoreMessage::gns_header, GNUNET_CONTAINER_DLL_insert, GNUNET_CRYPTO_read_private_key_from_buffer(), GNUNET_EC_NONE, GNUNET_ERROR_TYPE_DEBUG, GNUNET_ERROR_TYPE_ERROR, GNUNET_log, GNUNET_malloc, GNUNET_memcpy, GNUNET_SERVICE_client_continue(), GNUNET_SERVICE_client_drop(), GNUNET_SYSERR, GNUNET_YES, GNUNET_NAMESTORE_Header::header, RecordStoreMessage::key_len, monitor_head, nc, StoreActivity::nc, StoreActivity::private_key, GNUNET_NAMESTORE_Header::r_id, StoreActivity::rd_set_count, RecordStoreMessage::rd_set_count, StoreActivity::rd_set_pos, res, StoreActivity::rid, StoreActivity::rs, sa_head, sa_tail, send_store_response(), RecordStoreMessage::single_tx, GNUNET_MessageHeader::size, store_record_set(), and StoreActivity::zm_pos.
|
static |
Zone to name iterator.
cls | struct ZoneToNameCtx * |
seq | sequence number of the record, MUST NOT BE ZERO |
zone_key | the zone key |
name | name |
rd_count | number of records in rd |
rd | record data |
Definition at line 2019 of file gnunet-service-namestore.c.
References ZoneToNameCtx::ec, ZoneToNameResponseMessage::ec, env, ZoneToNameResponseMessage::gns_header, GNUNET_assert, GNUNET_break, GNUNET_CRYPTO_private_key_get_length(), GNUNET_CRYPTO_write_private_key_to_buffer(), GNUNET_EC_NAMESTORE_RECORD_TOO_BIG, GNUNET_EC_NAMESTORE_UNKNOWN, GNUNET_EC_NONE, GNUNET_ERROR_TYPE_DEBUG, GNUNET_GNSRECORD_records_get_size(), GNUNET_GNSRECORD_records_serialize(), GNUNET_log, GNUNET_MAX_MESSAGE_SIZE, GNUNET_memcpy, GNUNET_MESSAGE_TYPE_NAMESTORE_ZONE_TO_NAME_RESPONSE, GNUNET_MQ_msg_extra, GNUNET_MQ_send(), GNUNET_NAMESTORE_Header::header, ZoneToNameResponseMessage::key_len, NamestoreClient::mq, name, ZoneToNameResponseMessage::name_len, ZoneToNameCtx::nc, GNUNET_NAMESTORE_Header::r_id, rd, rd_count, ZoneToNameResponseMessage::rd_count, ZoneToNameResponseMessage::rd_len, ZoneToNameCtx::rid, and GNUNET_MessageHeader::size.
Referenced by handle_zone_to_name().
|
static |
Definition at line 2085 of file gnunet-service-namestore.c.
References GNUNET_OK.
|
static |
Handles a GNUNET_MESSAGE_TYPE_NAMESTORE_ZONE_TO_NAME message.
cls | client client sending the message |
ztn_msg | message of type 'struct ZoneToNameMessage' |
Definition at line 2099 of file gnunet-service-namestore.c.
References ZoneToNameCtx::ec, ZoneToNameResponseMessage::ec, env, ZoneToNameMessage::gns_header, ZoneToNameResponseMessage::gns_header, GNUNET_break, GNUNET_CRYPTO_read_private_key_from_buffer(), GNUNET_CRYPTO_read_public_key_from_buffer(), GNUNET_EC_NAMESTORE_ZONE_NOT_FOUND, GNUNET_ERROR_TYPE_DEBUG, GNUNET_log, GNUNET_MESSAGE_TYPE_NAMESTORE_ZONE_TO_NAME_RESPONSE, GNUNET_MQ_msg, GNUNET_MQ_send(), GNUNET_SERVICE_client_continue(), GNUNET_SERVICE_client_drop(), GNUNET_SYSERR, handle_zone_to_name_it(), ZoneToNameMessage::key_len, ZoneToNameResponseMessage::key_len, nc, ZoneToNameCtx::nc, ZoneToNameMessage::pkey_len, GNUNET_NAMESTORE_Header::r_id, and ZoneToNameCtx::rid.
|
static |
Process results for zone iteration from database.
cls | struct ZoneIterationProcResult |
seq | sequence number of the record, MUST NOT BE ZERO |
zone_key | the zone key |
name | name |
rd_count | number of records for this name |
rd | record data |
Definition at line 2205 of file gnunet-service-namestore.c.
References ZoneIteration::filter, GNUNET_assert, GNUNET_break, GNUNET_ERROR_TYPE_DEBUG, GNUNET_log, GNUNET_YES, ZoneIterationProcResult::limit, name, ZoneIteration::nc, rd, rd_count, ZoneIteration::request_id, ZoneIterationProcResult::run_again, send_lookup_response_with_filter(), ZoneIteration::seq, and ZoneIterationProcResult::zi.
Referenced by run_zone_iteration_round().
|
static |
Perform the next round of the zone iteration.
zi | zone iterator to process |
limit | number of results to return in one pass |
Definition at line 2254 of file gnunet-service-namestore.c.
References duration, GNUNET_break, GNUNET_ERROR_TYPE_DEBUG, GNUNET_is_zero, GNUNET_log, GNUNET_NO, GNUNET_STATISTICS_set(), GNUNET_SYSERR, GNUNET_TIME_absolute_get(), GNUNET_TIME_absolute_get_duration(), GNUNET_TIME_relative_divide(), GNUNET_YES, ZoneIterationProcResult::limit, nc, ZoneIteration::nc, GNUNET_TIME_Relative::rel_value_us, ZoneIterationProcResult::run_again, ZoneIteration::send_end, ZoneIteration::seq, start, statistics, ZoneIterationProcResult::zi, ZoneIteration::zone, zone_iterate_proc(), and zone_iteration_done_client_continue().
Referenced by handle_iteration_next(), and handle_iteration_start().
|
static |
Definition at line 2301 of file gnunet-service-namestore.c.
References ZoneIterationStartMessage::gns_header, GNUNET_break, GNUNET_OK, GNUNET_SYSERR, GNUNET_NAMESTORE_Header::header, ZoneIterationStartMessage::key_len, GNUNET_MessageHeader::size, and size.
|
static |
Handles a GNUNET_MESSAGE_TYPE_NAMESTORE_ZONE_ITERATION_START message.
cls | the client sending the message |
zis_msg | message from the client |
Definition at line 2326 of file gnunet-service-namestore.c.
References ZoneIteration::filter, ZoneIterationStartMessage::filter, ZoneIterationStartMessage::gns_header, GNUNET_CONTAINER_DLL_insert, GNUNET_CRYPTO_read_private_key_from_buffer(), GNUNET_ERROR_TYPE_DEBUG, GNUNET_free, GNUNET_log, GNUNET_new, GNUNET_SERVICE_client_drop(), GNUNET_SYSERR, ZoneIterationStartMessage::key_len, nc, ZoneIteration::nc, ZoneIteration::offset, GNUNET_NAMESTORE_Header::r_id, ZoneIteration::request_id, run_zone_iteration_round(), and ZoneIteration::zone.
|
static |
Handles a GNUNET_MESSAGE_TYPE_NAMESTORE_ZONE_ITERATION_STOP message.
cls | the client sending the message |
zis_msg | message from the client |
Definition at line 2370 of file gnunet-service-namestore.c.
References ZoneIterationStopMessage::gns_header, GNUNET_break, GNUNET_CONTAINER_DLL_remove, GNUNET_ERROR_TYPE_DEBUG, GNUNET_free, GNUNET_log, GNUNET_SERVICE_client_continue(), GNUNET_SERVICE_client_drop(), nc, ZoneIteration::next, GNUNET_NAMESTORE_Header::r_id, and ZoneIteration::request_id.
|
static |
Handles a GNUNET_MESSAGE_TYPE_NAMESTORE_ZONE_ITERATION_NEXT message.
cls | the client sending the message |
zis_msg | message from the client |
Definition at line 2402 of file gnunet-service-namestore.c.
References ZoneIterationNextMessage::gns_header, GNUNET_break, GNUNET_ERROR_TYPE_DEBUG, GNUNET_log, GNUNET_NO, GNUNET_ntohll(), GNUNET_SERVICE_client_drop(), GNUNET_STATISTICS_update(), ZoneIterationNextMessage::limit, nc, ZoneIteration::next, GNUNET_NAMESTORE_Header::r_id, ZoneIteration::request_id, run_zone_iteration_round(), and statistics.
|
static |
Function called when the monitor is ready for more data, and we should thus unblock PUT operations that were blocked on the monitor not being ready.
Definition at line 2437 of file gnunet-service-namestore.c.
References continue_store_activity(), GNUNET_ERROR_TYPE_DEBUG, GNUNET_log, GNUNET_NO, GNUNET_SCHEDULER_add_delayed(), GNUNET_SCHEDULER_cancel(), GNUNET_TIME_absolute_get(), GNUNET_YES, MONITOR_STALL_WARN_DELAY, StoreActivity::next, sa_head, warn_monitor_slow(), zm, and StoreActivity::zm_pos.
Referenced by handle_monitor_next(), and monitor_sync().
|
static |
Send 'sync' message to zone monitor, we're now in sync.
zm | monitor that is now in sync |
Definition at line 2479 of file gnunet-service-namestore.c.
References env, GNUNET_ERROR_TYPE_DEBUG, GNUNET_log, GNUNET_MESSAGE_TYPE_NAMESTORE_MONITOR_SYNC, GNUNET_MQ_msg, GNUNET_MQ_send(), GNUNET_NO, monitor_unblock(), GNUNET_NAMESTORE_ZoneMonitor::mq, and zm.
Referenced by handle_monitor_start(), and monitor_iteration_next().
|
static |
Obtain the next datum during the zone monitor's zone initial iteration.
cls | zone monitor that does its initial iteration |
Definition at line 2630 of file gnunet-service-namestore.c.
References GNUNET_assert, GNUNET_ERROR_TYPE_DEBUG, GNUNET_is_zero, GNUNET_log, GNUNET_NO, GNUNET_SERVICE_client_drop(), GNUNET_SYSERR, GNUNET_YES, monitor_iterate_cb(), monitor_sync(), nc, ret, zm, and GNUNET_NAMESTORE_ZoneMonitor::zone.
Referenced by handle_monitor_next(), handle_monitor_start(), and monitor_iterate_cb().
|
static |
A GNUNET_NAMESTORE_RecordIterator for monitors.
cls | a 'struct ZoneMonitor *' with information about the monitor |
seq | sequence number of the record, MUST NOT BE ZERO |
zone_key | zone key of the zone |
name | name |
rd_count | number of records in rd |
rd | array of records |
Definition at line 2516 of file gnunet-service-namestore.c.
References GNUNET_NAMESTORE_ZoneMonitor::filter, GNUNET_assert, GNUNET_ERROR_TYPE_DEBUG, GNUNET_log, GNUNET_NO, GNUNET_SCHEDULER_add_now(), GNUNET_STATISTICS_update(), GNUNET_YES, monitor_iteration_next(), name, rd, rd_count, send_lookup_response_with_filter(), ZoneMonitor::seq, statistics, and zm.
Referenced by monitor_iteration_next().
|
static |
Definition at line 2554 of file gnunet-service-namestore.c.
References GNUNET_break, GNUNET_OK, GNUNET_SYSERR, ZoneMonitorStartMessage::header, ZoneMonitorStartMessage::key_len, GNUNET_MessageHeader::size, and size.
|
static |
Handles a GNUNET_MESSAGE_TYPE_NAMESTORE_MONITOR_START message.
cls | the client sending the message |
zis_msg | message from the client |
Definition at line 2579 of file gnunet-service-namestore.c.
References ZoneMonitorStartMessage::filter, GNUNET_NAMESTORE_ZoneMonitor::filter, GNUNET_CONTAINER_DLL_insert, GNUNET_CRYPTO_read_private_key_from_buffer(), GNUNET_ERROR_TYPE_DEBUG, GNUNET_ERROR_TYPE_ERROR, GNUNET_free, GNUNET_log, GNUNET_new, GNUNET_notification_context_add(), GNUNET_SCHEDULER_add_now(), GNUNET_SERVICE_client_continue(), GNUNET_SERVICE_client_drop(), GNUNET_SERVICE_client_mark_monitor(), GNUNET_SYSERR, GNUNET_YES, ZoneMonitorStartMessage::iterate_first, ZoneMonitorStartMessage::key_len, monitor_head, monitor_iteration_next(), monitor_nc, monitor_sync(), monitor_tail, nc, zm, ZoneMonitor::zone, and GNUNET_NAMESTORE_ZoneMonitor::zone.
|
static |
Handles a GNUNET_MESSAGE_TYPE_NAMESTORE_MONITOR_NEXT message.
cls | the client sending the message |
nm | message from the client |
Definition at line 2679 of file gnunet-service-namestore.c.
References GNUNET_assert, GNUNET_break, GNUNET_ERROR_TYPE_DEBUG, GNUNET_log, GNUNET_ntohll(), GNUNET_SCHEDULER_add_delayed(), GNUNET_SCHEDULER_add_now(), GNUNET_SCHEDULER_cancel(), GNUNET_SERVICE_client_continue(), GNUNET_SERVICE_client_drop(), GNUNET_TIME_absolute_get(), GNUNET_YES, ZoneMonitor::limit, ZoneMonitorNextMessage::limit, monitor_head, monitor_iteration_next(), MONITOR_STALL_WARN_DELAY, monitor_unblock(), nc, warn_monitor_slow(), and zm.
|
static |
Process namestore requests.
cls | closure |
cfg | configuration to use |
service | the initialized service |
Definition at line 2739 of file gnunet-service-namestore.c.
References cfg, cleanup_task(), db_lib_name, GNUNET_asprintf(), GNUNET_CONFIGURATION_get_value_string(), GNUNET_CONFIGURATION_get_value_yesno(), GNUNET_ERROR_TYPE_DEBUG, GNUNET_ERROR_TYPE_ERROR, GNUNET_free, GNUNET_log, GNUNET_notification_context_create(), GNUNET_OK, GNUNET_OS_project_data_gnunet(), GNUNET_PLUGIN_load(), GNUNET_SCHEDULER_add_now(), GNUNET_SCHEDULER_add_shutdown(), GNUNET_STATISTICS_create(), GSN_cfg, GSN_database, monitor_nc, return_orphaned, and statistics.
Define "main" method using service macro.
|
static |
We cache nick records to reduce DB load.
Definition at line 326 of file gnunet-service-namestore.c.
Referenced by cache_nick(), and get_nick_record().
|
static |
Public key of all zeros.
Definition at line 331 of file gnunet-service-namestore.c.
Referenced by continue_store_activity(), create_message_request(), GNUNET_CRYPTO_edx25519_private_key_derive(), GNUNET_DHT_verify_path(), GNUNET_REGEX_ipv6policy2regex(), GNUNET_TIME_absolute_get_zero_(), and GNUNET_TIME_relative_get_zero_().
|
static |
Configuration handle.
Definition at line 336 of file gnunet-service-namestore.c.
Referenced by client_connect_cb(), and run().
|
static |
Handle to the statistics service.
Definition at line 341 of file gnunet-service-namestore.c.
Referenced by cleanup_task(), handle_iteration_next(), monitor_iterate_cb(), run(), run_zone_iteration_round(), send_lookup_response_with_filter(), send_store_response(), and store_record_set().
|
static |
Name of the database plugin.
Definition at line 346 of file gnunet-service-namestore.c.
Referenced by cleanup_task(), client_connect_cb(), and run().
struct GNUNET_NAMESTORE_PluginFunctions* GSN_database |
Database handle for service.
Definition at line 351 of file gnunet-service-namestore.c.
Referenced by cleanup_task(), get_nick_record(), and run().
|
static |
First active zone monitor.
Definition at line 357 of file gnunet-service-namestore.c.
Referenced by client_disconnect_cb(), handle_monitor_next(), handle_monitor_start(), and handle_record_store().
|
static |
Last active zone monitor.
Definition at line 362 of file gnunet-service-namestore.c.
Referenced by client_disconnect_cb(), and handle_monitor_start().
|
static |
Head of DLL of monitor-blocked store activities.
Definition at line 367 of file gnunet-service-namestore.c.
Referenced by client_disconnect_cb(), free_store_activity(), handle_record_store(), and monitor_unblock().
|
static |
Tail of DLL of monitor-blocked store activities.
Definition at line 372 of file gnunet-service-namestore.c.
Referenced by free_store_activity(), and handle_record_store().
|
static |
Notification context shared by all monitors.
Definition at line 377 of file gnunet-service-namestore.c.
Referenced by cleanup_task(), handle_monitor_start(), and run().
|
static |
Returned orphaned records?
Definition at line 382 of file gnunet-service-namestore.c.
Referenced by run().