![]() |
GNUnet
0.11.x
|
command line tool to manipulate the local zone More...
#include "platform.h"
#include <gnunet_util_lib.h>
#include <gnunet_dnsparser_lib.h>
#include <gnunet_identity_service.h>
#include <gnunet_gnsrecord_lib.h>
#include <gnunet_gns_service.h>
#include <gnunet_namestore_service.h>
Go to the source code of this file.
Data Structures | |
struct | RecordSetEntry |
Entry in record set for bulk processing. More... | |
Functions | |
static void | do_shutdown (void *cls) |
Task run on shutdown. More... | |
static void | test_finished () |
Check if we are finished, and if so, perform shutdown. More... | |
static void | add_continuation (void *cls, int32_t success, const char *emsg) |
Continuation called to notify client about result of the operation. More... | |
static void | del_continuation (void *cls, int32_t success, const char *emsg) |
Continuation called to notify client about result of the operation. More... | |
static void | zone_iteration_finished (void *cls) |
Function called when we are done with a zone iteration. More... | |
static void | zone_iteration_error_cb (void *cls) |
Function called when we encountered an error in a zone iteration. More... | |
static void | display_record (const char *rname, unsigned int rd_len, const struct GNUNET_GNSRECORD_Data *rd) |
Process a record that was stored in the namestore. More... | |
static void | display_record_iterator (void *cls, const struct GNUNET_IDENTITY_PrivateKey *zone_key, const char *rname, unsigned int rd_len, const struct GNUNET_GNSRECORD_Data *rd) |
Process a record that was stored in the namestore. More... | |
static void | display_record_monitor (void *cls, const struct GNUNET_IDENTITY_PrivateKey *zone_key, const char *rname, unsigned int rd_len, const struct GNUNET_GNSRECORD_Data *rd) |
Process a record that was stored in the namestore. More... | |
static void | display_record_lookup (void *cls, const struct GNUNET_IDENTITY_PrivateKey *zone_key, const char *rname, unsigned int rd_len, const struct GNUNET_GNSRECORD_Data *rd) |
Process a record that was stored in the namestore. More... | |
static void | sync_cb (void *cls) |
Function called once we are in sync in monitor mode. More... | |
static void | monitor_error_cb (void *cls) |
Function called on errors while monitoring. More... | |
static void | lookup_error_cb (void *cls) |
Function called on errors while monitoring. More... | |
static void | add_error_cb (void *cls) |
Function called if lookup fails. More... | |
static void | get_existing_record (void *cls, const struct GNUNET_IDENTITY_PrivateKey *zone_key, const char *rec_name, unsigned int rd_count, const struct GNUNET_GNSRECORD_Data *rd) |
We're storing a record; this function is given the existing record so that we can merge the information. More... | |
static void | reverse_error_cb (void *cls) |
Function called if we encountered an error in zone-to-name. More... | |
static void | handle_reverse_lookup (void *cls, const struct GNUNET_IDENTITY_PrivateKey *zone, const char *label, unsigned int rd_count, const struct GNUNET_GNSRECORD_Data *rd) |
Function called with the result of our attempt to obtain a name for a given public key. More... | |
static void | del_lookup_error_cb (void *cls) |
Function called if lookup for deletion fails. More... | |
static void | del_monitor (void *cls, const struct GNUNET_IDENTITY_PrivateKey *zone, const char *label, unsigned int rd_count, const struct GNUNET_GNSRECORD_Data *rd) |
We were asked to delete something; this function is called with the existing records. More... | |
static int | parse_expiration (const char *expirationstring, int *etime_is_rel, uint64_t *etime) |
Parse expiration time. More... | |
static void | replace_cont (void *cls, int success, const char *emsg) |
Function called when namestore is done with the replace operation. More... | |
static void | run_with_zone_pkey (const struct GNUNET_CONFIGURATION_Handle *cfg) |
We have obtained the zone's private key, so now process the main commands using it. More... | |
static void | identity_cb (void *cls, struct GNUNET_IDENTITY_Ego *ego) |
Callback invoked from identity service with ego information. More... | |
static void | default_ego_cb (void *cls, struct GNUNET_IDENTITY_Ego *ego, void **ctx, const char *name) |
Function called with the default ego to be used for GNS operations. More... | |
static void | id_connect_cb (void *cls, struct GNUNET_IDENTITY_Ego *ego, void **ctx, const char *name) |
Function called with ALL of the egos known to the identity service, used on startup if the user did not specify a zone on the command-line. More... | |
static void | run (void *cls, char *const *args, const char *cfgfile, const struct GNUNET_CONFIGURATION_Handle *cfg) |
Main function that will be run. More... | |
static int | multirecord_process (struct GNUNET_GETOPT_CommandLineProcessorContext *ctx, void *scls, const char *option, const char *value) |
Command-line option parser function that allows the user to specify a complete record as one argument for adding/removing. More... | |
struct GNUNET_GETOPT_CommandLineOption | multirecord_option (char shortName, const char *name, const char *argumentHelp, const char *description, struct RecordSetEntry **rs) |
Allow user to specify keywords. More... | |
int | main (int argc, char *const *argv) |
The main function for gnunet-namestore. More... | |
Variables | |
static struct GNUNET_NAMESTORE_Handle * | ns |
Handle to the namestore. More... | |
static struct GNUNET_IDENTITY_PrivateKey | zone_pkey |
Private key for the our zone. More... | |
static struct GNUNET_IDENTITY_EgoLookup * | el |
Handle to identity lookup. More... | |
static struct GNUNET_IDENTITY_Handle * | idh |
Identity service handle. More... | |
struct GNUNET_IDENTITY_Operation * | get_default |
Obtain default ego. More... | |
static char * | ego_name |
Name of the ego controlling the zone. More... | |
static int | add |
Desired action is to add a record. More... | |
static struct GNUNET_NAMESTORE_QueueEntry * | add_qe_uri |
Queue entry for the 'add-uri' operation. More... | |
static struct GNUNET_NAMESTORE_QueueEntry * | add_qe |
Queue entry for the 'add' operation. More... | |
static struct GNUNET_NAMESTORE_QueueEntry * | get_qe |
Queue entry for the 'lookup' operation. More... | |
static struct GNUNET_NAMESTORE_QueueEntry * | reverse_qe |
Queue entry for the 'reverse lookup' operation (in combination with a name). More... | |
static int | list |
Desired action is to list records. More... | |
static struct GNUNET_NAMESTORE_ZoneIterator * | list_it |
List iterator for the 'list' operation. More... | |
static int | del |
Desired action is to remove a record. More... | |
static int | is_public |
Is record public (opposite of GNUNET_GNSRECORD_RF_PRIVATE) More... | |
static int | is_shadow |
Is record a shadow record (GNUNET_GNSRECORD_RF_SHADOW_RECORD) More... | |
static struct GNUNET_NAMESTORE_QueueEntry * | del_qe |
Queue entry for the 'del' operation. More... | |
static struct GNUNET_NAMESTORE_QueueEntry * | set_qe |
Queue entry for the 'set/replace' operation. More... | |
static char * | name |
Name of the records to add/list/remove. More... | |
static char * | value |
Value of the record to add/remove. More... | |
static char * | uri |
URI to import. More... | |
static char * | reverse_pkey |
Reverse lookup to perform. More... | |
static char * | typestring |
Type of the record to add/remove, NULL to remove all. More... | |
static char * | expirationstring |
Desired expiration time. More... | |
static char * | nickstring |
Desired nick name. More... | |
static int | ret |
Global return value. More... | |
static uint32_t | type |
Type string converted to DNS type value. More... | |
static void * | data |
Value in binary format. More... | |
static size_t | data_size |
Number of bytes in data. More... | |
static uint64_t | etime |
Expiration string converted to numeric value. More... | |
static int | etime_is_rel = GNUNET_SYSERR |
Is expiration time relative or absolute time? More... | |
static struct GNUNET_NAMESTORE_ZoneMonitor * | zm |
Monitor handle. More... | |
static int | monitor |
Enables monitor mode. More... | |
static struct RecordSetEntry * | recordset |
Entry in record set for processing records in bulk. More... | |
|
static |
Task run on shutdown.
Cleans up everything.
cls | unused |
Definition at line 231 of file gnunet-namestore.c.
References data, GNUNET_free, GNUNET_IDENTITY_cancel(), GNUNET_IDENTITY_disconnect(), GNUNET_IDENTITY_ego_lookup_cancel(), GNUNET_NAMESTORE_cancel(), GNUNET_NAMESTORE_disconnect(), GNUNET_NAMESTORE_zone_iteration_stop(), GNUNET_NAMESTORE_zone_monitor_stop(), uri, and zone_pkey.
Referenced by run().
|
static |
Check if we are finished, and if so, perform shutdown.
Definition at line 307 of file gnunet-namestore.c.
References GNUNET_SCHEDULER_shutdown().
Referenced by add_continuation(), add_error_cb(), del_continuation(), del_lookup_error_cb(), del_monitor(), display_record_lookup(), get_existing_record(), handle_reverse_lookup(), lookup_error_cb(), zone_iteration_error_cb(), and zone_iteration_finished().
|
static |
Continuation called to notify client about result of the operation.
cls | closure, location of the QueueEntry pointer to NULL out |
success | GNUNET_SYSERR on failure (including timeout/queue drop/failure to validate) GNUNET_NO if content was already there GNUNET_YES (or other positive value) on success |
emsg | NULL on success, otherwise an error message |
Definition at line 326 of file gnunet-namestore.c.
References _, GNUNET_NO, GNUNET_YES, qe, ret, and test_finished().
Referenced by get_existing_record(), and run_with_zone_pkey().
|
static |
Continuation called to notify client about result of the operation.
cls | closure, unused |
success | GNUNET_SYSERR on failure (including timeout/queue drop/failure to validate) GNUNET_NO if content was already there GNUNET_YES (or other positive value) on success |
emsg | NULL on success, otherwise an error message |
Definition at line 355 of file gnunet-namestore.c.
References _, GNUNET_NO, GNUNET_SYSERR, and test_finished().
Referenced by del_monitor().
|
static |
Function called when we are done with a zone iteration.
Definition at line 381 of file gnunet-namestore.c.
References test_finished().
Referenced by run_with_zone_pkey().
|
static |
Function called when we encountered an error in a zone iteration.
Definition at line 393 of file gnunet-namestore.c.
References ret, and test_finished().
Referenced by run_with_zone_pkey().
|
static |
Process a record that was stored in the namestore.
rname | name that is being mapped (at most 255 characters long) |
rd_len | number of entries in rd array |
rd | array of records with data to store |
Definition at line 411 of file gnunet-namestore.c.
References _, GNUNET_TIME_Absolute::abs_value_us, data, data_size, GNUNET_GNSRECORD_Data::expiration_time, GNUNET_free, GNUNET_GNS_EMPTY_LABEL_AT, GNUNET_GNSRECORD_number_to_typename(), GNUNET_GNSRECORD_RF_PRIVATE, GNUNET_GNSRECORD_RF_RELATIVE_EXPIRATION, GNUNET_GNSRECORD_RF_SHADOW_RECORD, GNUNET_GNSRECORD_TYPE_ANY, GNUNET_GNSRECORD_TYPE_NICK, GNUNET_GNSRECORD_typename_to_number(), GNUNET_GNSRECORD_value_to_string(), GNUNET_NAMESTORE_zone_iterator_next(), GNUNET_NO, GNUNET_STRINGS_absolute_time_to_string(), GNUNET_STRINGS_relative_time_to_string(), GNUNET_YES, name, GNUNET_TIME_Relative::rel_value_us, type, and typestring.
Referenced by display_record_iterator(), display_record_lookup(), and display_record_monitor().
|
static |
Process a record that was stored in the namestore.
cls | closure |
zone_key | private key of the zone |
rname | name that is being mapped (at most 255 characters long) |
rd_len | number of entries in rd array |
rd | array of records with data to store |
Definition at line 498 of file gnunet-namestore.c.
References display_record(), and GNUNET_NAMESTORE_zone_iterator_next().
Referenced by run_with_zone_pkey().
|
static |
Process a record that was stored in the namestore.
cls | closure |
zone_key | private key of the zone |
rname | name that is being mapped (at most 255 characters long) |
rd_len | number of entries in rd array |
rd | array of records with data to store |
Definition at line 521 of file gnunet-namestore.c.
References display_record(), and GNUNET_NAMESTORE_zone_monitor_next().
Referenced by run_with_zone_pkey().
|
static |
Process a record that was stored in the namestore.
cls | closure |
zone_key | private key of the zone |
rname | name that is being mapped (at most 255 characters long) |
rd_len | number of entries in rd array |
rd | array of records with data to store |
Definition at line 544 of file gnunet-namestore.c.
References display_record(), and test_finished().
Referenced by run_with_zone_pkey().
|
static |
Function called once we are in sync in monitor mode.
cls | NULL |
Definition at line 564 of file gnunet-namestore.c.
Referenced by run_with_zone_pkey().
|
static |
Function called on errors while monitoring.
cls | NULL |
Definition at line 577 of file gnunet-namestore.c.
Referenced by run_with_zone_pkey().
|
static |
Function called on errors while monitoring.
cls | NULL |
Definition at line 590 of file gnunet-namestore.c.
References test_finished().
Referenced by run_with_zone_pkey().
|
static |
Function called if lookup fails.
Definition at line 603 of file gnunet-namestore.c.
References GNUNET_break, ret, and test_finished().
Referenced by run_with_zone_pkey().
|
static |
We're storing a record; this function is given the existing record so that we can merge the information.
cls | closure, unused |
zone_key | private key of the zone |
rec_name | 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 624 of file gnunet-namestore.c.
References _, add_continuation(), GNUNET_GNSRECORD_Data::data, data, GNUNET_GNSRECORD_Data::data_size, data_size, etime, etime_is_rel, GNUNET_GNSRECORD_Data::expiration_time, GNUNET_GNSRECORD_Data::flags, GNUNET_assert, GNUNET_break, GNUNET_DNSPARSER_TYPE_CNAME, GNUNET_DNSPARSER_TYPE_SOA, GNUNET_ERROR_TYPE_DEBUG, GNUNET_GNSRECORD_RF_PRIVATE, GNUNET_GNSRECORD_RF_RELATIVE_EXPIRATION, GNUNET_GNSRECORD_RF_SHADOW_RECORD, GNUNET_GNSRECORD_TYPE_EDKEY, GNUNET_GNSRECORD_TYPE_GNS2DNS, GNUNET_GNSRECORD_TYPE_PKEY, GNUNET_log, GNUNET_memcpy, GNUNET_NAMESTORE_records_store(), GNUNET_NO, GNUNET_TIME_UNIT_FOREVER_ABS, GNUNET_YES, is_public, is_shadow, name, GNUNET_GNSRECORD_Data::record_type, ret, test_finished(), type, and zone_pkey.
Referenced by run_with_zone_pkey().
|
static |
Function called if we encountered an error in zone-to-name.
Definition at line 764 of file gnunet-namestore.c.
References reverse_pkey.
Referenced by run_with_zone_pkey().
|
static |
Function called with the result of our attempt to obtain a name for a given public key.
cls | NULL |
zone | private key of the zone; NULL on disconnect |
label | label of the records; NULL on disconnect |
rd_count | number of entries in rd array, 0 if label was deleted |
rd | array of records with data to store |
Definition at line 783 of file gnunet-namestore.c.
References ego_name, reverse_pkey, and test_finished().
Referenced by run_with_zone_pkey().
|
static |
Function called if lookup for deletion fails.
Definition at line 806 of file gnunet-namestore.c.
References GNUNET_break, ret, and test_finished().
Referenced by run_with_zone_pkey().
|
static |
We were asked to delete something; this function is called with the existing records.
Now we should determine what should be deleted and then issue the deletion operation.
cls | NULL |
zone | private key of the zone we are deleting from |
label | name of the records we are editing |
rd_count | size of the rd array |
rd | existing records |
Definition at line 828 of file gnunet-namestore.c.
References _, data, data_size, del_continuation(), GNUNET_free, GNUNET_GNSRECORD_TYPE_ANY, GNUNET_GNSRECORD_typename_to_number(), GNUNET_GNSRECORD_value_to_string(), GNUNET_NAMESTORE_records_store(), name, GNUNET_GNSRECORD_Data::record_type, ret, test_finished(), type, typestring, value, and zone_pkey.
Referenced by run_with_zone_pkey().
|
static |
Parse expiration time.
expirationstring | text to parse |
etime_is_rel[out] | set to GNUNET_YES if time is relative |
etime[out] | set to expiration time (abs or rel) |
Definition at line 914 of file gnunet-namestore.c.
References GNUNET_TIME_Absolute::abs_value_us, GNUNET_ERROR_TYPE_DEBUG, GNUNET_log, GNUNET_NO, GNUNET_OK, GNUNET_STRINGS_absolute_time_to_string(), GNUNET_STRINGS_fancy_time_to_absolute(), GNUNET_STRINGS_fancy_time_to_relative(), GNUNET_STRINGS_relative_time_to_string(), GNUNET_SYSERR, GNUNET_TIME_UNIT_FOREVER_ABS, GNUNET_YES, and GNUNET_TIME_Relative::rel_value_us.
Referenced by multirecord_process(), and run_with_zone_pkey().
|
static |
Function called when namestore is done with the replace operation.
cls | NULL |
success | GNUNET_SYSERR on failure (including timeout/queue drop/failure to validate) GNUNET_NO if content was already there or not found GNUNET_YES (or other positive value) on success |
emsg | NULL on success, otherwise an error message |
Definition at line 962 of file gnunet-namestore.c.
References _, GNUNET_ERROR_TYPE_MESSAGE, GNUNET_log, GNUNET_OK, GNUNET_SCHEDULER_shutdown(), and ret.
Referenced by run_with_zone_pkey().
|
static |
We have obtained the zone's private key, so now process the main commands using it.
cfg | configuration to use |
Definition at line 985 of file gnunet-namestore.c.
References _, add, add_continuation(), add_error_cb(), GNUNET_GNSRECORD_Data::data, data, GNUNET_GNSRECORD_Data::data_size, data_size, del, del_lookup_error_cb(), del_monitor(), display_record_iterator(), display_record_lookup(), display_record_monitor(), e, etime, etime_is_rel, GNUNET_GNSRECORD_Data::expiration_time, expirationstring, GNUNET_GNSRECORD_Data::flags, get_existing_record(), GNUNET_DNSPARSER_TYPE_OPENPGPKEY, GNUNET_DNSPARSER_TYPE_SRV, GNUNET_DNSPARSER_TYPE_TLSA, GNUNET_ERROR_TYPE_ERROR, GNUNET_free, GNUNET_GNS_EMPTY_LABEL_AT, GNUNET_GNSRECORD_number_to_typename(), GNUNET_GNSRECORD_RF_RELATIVE_EXPIRATION, GNUNET_GNSRECORD_RF_SHADOW_RECORD, GNUNET_GNSRECORD_string_to_value(), GNUNET_GNSRECORD_TYPE_NICK, GNUNET_GNSRECORD_typename_to_number(), GNUNET_IDENTITY_key_get_length(), GNUNET_IDENTITY_public_key_from_string(), GNUNET_log, GNUNET_NAMESTORE_connect(), GNUNET_NAMESTORE_records_lookup(), GNUNET_NAMESTORE_records_store(), GNUNET_NAMESTORE_zone_iteration_start(), GNUNET_NAMESTORE_zone_monitor_start(), GNUNET_NAMESTORE_zone_to_name(), GNUNET_new_array, GNUNET_OK, GNUNET_SCHEDULER_shutdown(), GNUNET_strdup, GNUNET_STRINGS_utf8_tolower(), GNUNET_YES, handle_reverse_lookup(), is_public, is_shadow, list, lookup_error_cb(), monitor, monitor_error_cb(), name, nickstring, parse_expiration(), pkey, GNUNET_GNSRECORD_Data::record_type, replace_cont(), ret, reverse_error_cb(), reverse_pkey, sh, sync_cb(), GNUNET_IDENTITY_PublicKey::type, type, typestring, uri, value, zone_iteration_error_cb(), zone_iteration_finished(), and zone_pkey.
Referenced by identity_cb(), and run().
|
static |
Callback invoked from identity service with ego information.
An ego of NULL means the ego was not found.
cls | closure with the configuration |
ego | an ego known to identity service, or NULL |
Definition at line 1282 of file gnunet-namestore.c.
References _, cfg, ego_name, GNUNET_free, GNUNET_IDENTITY_ego_get_private_key(), GNUNET_SCHEDULER_shutdown(), name, ret, run_with_zone_pkey(), and zone_pkey.
Referenced by default_ego_cb(), and run().
|
static |
Function called with the default ego to be used for GNS operations.
Used if the user did not specify a zone via command-line or environment variables.
cls | NULL |
ego | default ego, NULL for none |
ctx | NULL |
name | unused |
Definition at line 1327 of file gnunet-namestore.c.
References _, cfg, GNUNET_SCHEDULER_shutdown(), identity_cb(), and ret.
Referenced by id_connect_cb().
|
static |
Function called with ALL of the egos known to the identity service, used on startup if the user did not specify a zone on the command-line.
Once the iteration is done (ego is NULL), we ask for the default ego for "namestore".
cls | a struct GNUNET_CONFIGURATION_Handle |
ego | an ego, NULL for end of iteration |
ctx | NULL |
name | name associated with ego |
Definition at line 1367 of file gnunet-namestore.c.
References cfg, default_ego_cb(), and GNUNET_IDENTITY_get().
Referenced by run().
|
static |
Main function that will be run.
cls | closure |
args | remaining command-line arguments |
cfgfile | name of the configuration file used (for saving, can be NULL!) |
cfg | configuration |
Definition at line 1392 of file gnunet-namestore.c.
References _, do_shutdown(), ego_name, getenv(), GNUNET_ERROR_TYPE_WARNING, GNUNET_IDENTITY_connect(), GNUNET_IDENTITY_ego_lookup(), GNUNET_log, GNUNET_OK, GNUNET_SCHEDULER_add_shutdown(), GNUNET_SCHEDULER_shutdown(), GNUNET_strdup, GNUNET_STRINGS_string_to_data(), id_connect_cb(), identity_cb(), ret, run_with_zone_pkey(), uri, and zone_pkey.
Referenced by main().
|
static |
Command-line option parser function that allows the user to specify a complete record as one argument for adding/removing.
A pointer to the head of the list of record sets must be passed as the "scls" argument.
ctx | command line processor context |
scls | must be of type "struct GNUNET_FS_Uri **" |
option | name of the option (typically 'R') |
value | command line argument given; format is "TTL TYPE FLAGS VALUE" where TTL is an expiration time (rel or abs), always given in seconds (without the unit), TYPE is a DNS/GNS record type, FLAGS is either "n" for no flags or a combination of 's' (shadow) and 'p' (public) and VALUE is the value (in human-readable format) |
Definition at line 1460 of file gnunet-namestore.c.
References _, GNUNET_GNSRECORD_Data::data, GNUNET_GNSRECORD_Data::data_size, etime_is_rel, GNUNET_GNSRECORD_Data::expiration_time, GNUNET_GNSRECORD_Data::flags, GNUNET_asprintf(), GNUNET_ERROR_TYPE_ERROR, GNUNET_free, GNUNET_GNSRECORD_number_to_typename(), GNUNET_GNSRECORD_RF_NONE, GNUNET_GNSRECORD_RF_PRIVATE, GNUNET_GNSRECORD_RF_RELATIVE_EXPIRATION, GNUNET_GNSRECORD_RF_SHADOW_RECORD, GNUNET_GNSRECORD_string_to_value(), GNUNET_GNSRECORD_typename_to_number(), GNUNET_log, GNUNET_malloc, GNUNET_OK, GNUNET_strdup, GNUNET_SYSERR, head, RecordSetEntry::next, parse_expiration(), RecordSetEntry::record, and GNUNET_GNSRECORD_Data::record_type.
Referenced by multirecord_option().
struct GNUNET_GETOPT_CommandLineOption multirecord_option | ( | char | shortName, |
const char * | name, | ||
const char * | argumentHelp, | ||
const char * | description, | ||
struct RecordSetEntry ** | rs | ||
) |
Allow user to specify keywords.
shortName | short name of the option | |
name | long name of the option | |
argumentHelp | help text for the option argument | |
description | long help text for the option | |
[out] | topKeywords | set to the desired value |
Definition at line 1578 of file gnunet-namestore.c.
References GNUNET_GETOPT_CommandLineOption::argumentHelp, GNUNET_GETOPT_CommandLineOption::description, multirecord_process(), name, and GNUNET_GETOPT_CommandLineOption::shortName.
Referenced by main().
int main | ( | int | argc, |
char *const * | argv | ||
) |
The main function for gnunet-namestore.
argc | number of arguments from the command line |
argv | command line arguments |
Definition at line 1605 of file gnunet-namestore.c.
References _, add, del, ego_name, expirationstring, gettext_noop, GNUNET_free_nz, GNUNET_GETOPT_OPTION_END, GNUNET_GETOPT_option_flag(), GNUNET_GETOPT_option_string(), GNUNET_log_setup(), GNUNET_OK, GNUNET_PROGRAM_run(), GNUNET_STRINGS_get_utf8_args(), is_public, is_shadow, list, monitor, multirecord_option(), nickstring, ret, reverse_pkey, run(), typestring, uri, and value.
|
static |
Handle to the namestore.
Definition at line 57 of file gnunet-namestore.c.
|
static |
Private key for the our zone.
Definition at line 62 of file gnunet-namestore.c.
Referenced by del_monitor(), do_shutdown(), get_existing_record(), identity_cb(), run(), and run_with_zone_pkey().
|
static |
Handle to identity lookup.
Definition at line 67 of file gnunet-namestore.c.
|
static |
Identity service handle.
Definition at line 72 of file gnunet-namestore.c.
struct GNUNET_IDENTITY_Operation* get_default |
Obtain default ego.
Definition at line 77 of file gnunet-namestore.c.
|
static |
Name of the ego controlling the zone.
Definition at line 82 of file gnunet-namestore.c.
Referenced by handle_reverse_lookup(), identity_cb(), main(), and run().
|
static |
Desired action is to add a record.
Definition at line 87 of file gnunet-namestore.c.
Referenced by main(), and run_with_zone_pkey().
|
static |
Queue entry for the 'add-uri' operation.
Definition at line 92 of file gnunet-namestore.c.
|
static |
Queue entry for the 'add' operation.
Definition at line 97 of file gnunet-namestore.c.
|
static |
Queue entry for the 'lookup' operation.
Definition at line 102 of file gnunet-namestore.c.
|
static |
Queue entry for the 'reverse lookup' operation (in combination with a name).
Definition at line 107 of file gnunet-namestore.c.
|
static |
Desired action is to list records.
Definition at line 112 of file gnunet-namestore.c.
Referenced by main(), and run_with_zone_pkey().
|
static |
List iterator for the 'list' operation.
Definition at line 117 of file gnunet-namestore.c.
|
static |
Desired action is to remove a record.
Definition at line 122 of file gnunet-namestore.c.
Referenced by forward_resolution(), GNUNET_ABD_delegate_issue(), handle_delegate_collection_cb(), main(), run_with_zone_pkey(), and send_lookup_response().
|
static |
Is record public (opposite of GNUNET_GNSRECORD_RF_PRIVATE)
Definition at line 127 of file gnunet-namestore.c.
Referenced by get_existing_record(), main(), and run_with_zone_pkey().
|
static |
Is record a shadow record (GNUNET_GNSRECORD_RF_SHADOW_RECORD)
Definition at line 132 of file gnunet-namestore.c.
Referenced by get_existing_record(), main(), and run_with_zone_pkey().
|
static |
Queue entry for the 'del' operation.
Definition at line 137 of file gnunet-namestore.c.
|
static |
Queue entry for the 'set/replace' operation.
Definition at line 142 of file gnunet-namestore.c.
|
static |
Name of the records to add/list/remove.
Definition at line 147 of file gnunet-namestore.c.
Referenced by del_monitor(), display_record(), get_existing_record(), identity_cb(), multirecord_option(), and run_with_zone_pkey().
|
static |
Value of the record to add/remove.
Definition at line 152 of file gnunet-namestore.c.
Referenced by add_get_request_to_pending(), add_setter_action(), add_to_tc(), age_values(), attr_in_claims_request(), bandwidth_stats_iterator(), barrier_destroy_iterator(), bind_loose_channel(), build_result_set(), cache_clear_iterator(), call_iterator(), cancel_pending_request(), change_peer_respect(), channel_destroy_iterator(), check_connection_quality(), check_known_address(), check_known_challenge(), check_validation_request_pending(), check_vectors(), clean_local_client(), clean_request(), cleanup_channel(), cleanup_destination(), cleanup_iterator(), cleanup_validation_entry(), client_release_ports(), close_files_iter(), collector(), consume_cont(), cookie_identity_interpretation(), database_setup(), debug_channel(), decrementBit(), del_monitor(), delete_entries(), destroy_active_client_request(), destroy_ai_cb(), destroy_all_address_it(), destroy_channel_cb(), destroy_elements_iterator(), destroy_it(), destroy_iterator_cb(), destroy_key_to_element_iter(), destroy_paths_now(), destroy_port_cb(), destroy_remaining_channels(), destroy_session_cb(), destroy_session_shutdown_cb(), destroy_tunnels_now(), destroy_watch(), disconnect_all_neighbours(), disconnect_and_free_peer_entry(), dns_string_to_value(), dns_value_to_string(), do_flood(), do_restart_typemap_message(), drop_client_entries(), escape_name(), execute_get(), execute_select(), expire_blocks(), expire_entries(), filter_all(), filtered_map_initialization(), find_address_cb(), find_address_it(), find_advertisable_hello(), find_ai_cb(), find_ai_no_session_cb(), find_best_address_it(), find_by_message_uuid(), find_by_unique_id(), find_closest(), find_result_set(), find_sender_by_address(), find_trees(), flush_respect(), forward_reply(), free_ack_cummulator_cb(), free_addr_it(), free_all_it(), free_backtalker_cb(), free_blacklist_entry(), free_connect_info(), free_dv_routes_cb(), free_ego(), free_entry(), free_host_entry(), free_item(), free_matching_requests(), free_neighbour_cb(), free_peer(), free_pending_ack_cb(), free_preference(), free_reassembly_cb(), free_request(), free_request_it(), free_result(), free_service_record(), free_sug_handle(), free_tmps(), free_tracker(), free_validation_state_cb(), free_value(), free_waiting_entry(), get_active_address_it(), get_all_peers_iterator(), get_all_tunnels_iterator(), get_cb(), get_iterator(), get_lt_delete_it(), get_queue_delete_it(), get_receiver_delete_it(), get_result_present(), get_sender_delete_it(), get_session_delete_it(), get_url_parameter_copy(), GNUNET_CONFIGURATION_deserialize(), GNUNET_NETWORK_socket_disable_corking(), GSF_cadet_release_clients(), handle_ack(), handle_set(), heap_plugin_get_expiration(), heap_plugin_get_replication(), heap_plugin_get_zero_anonymity(), heap_plugin_put(), incrementBit(), init_key_to_element_iterator(), initialize_map_unfiltered(), iterate_addresses(), iterate_channels_cb(), iterate_clear_members(), iterate_close_room(), iterate_destroy_contact(), iterate_destroy_contacts(), iterate_destroy_egos(), iterate_destroy_entries(), iterate_destroy_member_infos(), iterate_destroy_message(), iterate_destroy_messages(), iterate_destroy_room(), iterate_destroy_rooms(), iterate_destroy_tunnels(), iterate_entries(), iterate_find_tunnel(), iterate_reachables(), iterate_reset_room(), iterate_save_messages(), iterate_save_rooms(), iterate_send_member_infos(), iterate_send_room_message(), iterate_zones(), iterator_bf_create(), iterator_bf_reduce(), jwt_parse_attributes(), locate_by_id(), lookup_queue_it(), lookup_session_it(), main(), mark_match_down(), mark_peer_down(), move_to_pending(), move_to_queue(), neighbour_delete(), neighbours_iterate(), normalize_address(), notify_change(), notify_client_about_session(), notify_client_queues(), notify_tunnel_up_cb(), op_get_element_iterator(), opc_free_iterator(), opc_search_iterator(), open_port_cb(), parse_jwt(), parse_record(), parse_record_data(), peerinfo_it(), prepare_ibf_iterator(), printer(), process(), process_client_result(), process_reply(), process_result_with_request(), process_stat_in(), process_update_node(), put_cb(), rcop_cleanup_iterator(), reachability_iterator(), regex_cancel_dht_get(), regex_result_iterator(), reghost_free_iterator(), reghost_match_iterator(), remove_by_unique_id(), remove_iterator(), reschedule_hellos(), rewatch_it(), run(), run_with_zone_pkey(), schedule_current_round(), search_iterator(), search_result_free(), search_result_freeze_probes(), search_result_resume_probes(), search_result_stop(), search_result_suspend(), send_full_element_iterator(), send_missing_full_elements_iter(), send_offers_iterator(), send_session_info_iter(), send_utilization_data(), session_cmp_it(), session_disconnect_it(), session_lookup_client_by_address(), session_lookup_it(), session_tag_it(), set_cont(), set_insert_iterator(), signal_result_resume(), socket_set_nodelay(), stat_iterator(), stop_peer_request(), store_and_free_entries(), stun_attr2str(), stun_msg2str(), sum_relative_preferences(), template_plugin_update_session_timeout(), test_blacklisted(), test_exist_cb(), test_result_present(), ticket_collect(), transmit_suggestion(), try_add_peers(), try_combine_recent(), update_abs_sum(), update_flood_times(), update_iterator(), update_rel_sum(), update_sre_result_maps(), validation_entry_match(), watch_notifier_it(), write_item(), and zone_to_name().
|
static |
URI to import.
Definition at line 157 of file gnunet-namestore.c.
Referenced by do_shutdown(), main(), run(), and run_with_zone_pkey().
|
static |
Reverse lookup to perform.
Definition at line 162 of file gnunet-namestore.c.
Referenced by handle_reverse_lookup(), main(), reverse_error_cb(), and run_with_zone_pkey().
|
static |
Type of the record to add/remove, NULL to remove all.
Definition at line 167 of file gnunet-namestore.c.
Referenced by del_monitor(), display_record(), main(), and run_with_zone_pkey().
|
static |
Desired expiration time.
Definition at line 172 of file gnunet-namestore.c.
Referenced by main(), and run_with_zone_pkey().
|
static |
Desired nick name.
Definition at line 177 of file gnunet-namestore.c.
Referenced by main(), and run_with_zone_pkey().
|
static |
Global return value.
Definition at line 182 of file gnunet-namestore.c.
Referenced by add_continuation(), add_error_cb(), default_ego_cb(), del_lookup_error_cb(), del_monitor(), get_existing_record(), identity_cb(), main(), replace_cont(), run(), run_with_zone_pkey(), and zone_iteration_error_cb().
|
static |
Type string converted to DNS type value.
Definition at line 187 of file gnunet-namestore.c.
Referenced by del_monitor(), display_record(), get_existing_record(), and run_with_zone_pkey().
|
static |
Value in binary format.
Definition at line 192 of file gnunet-namestore.c.
Referenced by del_monitor(), display_record(), do_shutdown(), get_existing_record(), and run_with_zone_pkey().
|
static |
Number of bytes in data.
Definition at line 197 of file gnunet-namestore.c.
Referenced by del_monitor(), display_record(), get_existing_record(), and run_with_zone_pkey().
|
static |
Expiration string converted to numeric value.
Definition at line 202 of file gnunet-namestore.c.
Referenced by get_existing_record(), and run_with_zone_pkey().
|
static |
Is expiration time relative or absolute time?
Definition at line 207 of file gnunet-namestore.c.
Referenced by get_existing_record(), multirecord_process(), and run_with_zone_pkey().
|
static |
Monitor handle.
Definition at line 212 of file gnunet-namestore.c.
Referenced by check_result(), client_disconnect_cb(), continue_store_activity(), GNUNET_NAMESTORE_zone_monitor_start(), handle_monitor_next(), handle_monitor_start(), handle_result(), handle_sync(), monitor_iterate_cb(), monitor_iteration_next(), mq_error_handler(), and warn_monitor_slow().
|
static |
Enables monitor mode.
Definition at line 217 of file gnunet-namestore.c.
Referenced by main(), and run_with_zone_pkey().
|
static |
Entry in record set for processing records in bulk.
Definition at line 222 of file gnunet-namestore.c.