41#define WARN_RELATIVE_EXPIRATION_LIMIT GNUNET_TIME_relative_multiply ( \
42 GNUNET_TIME_UNIT_MINUTES, 15)
349#define INITIAL_RI_BUFFER_SIZE 5000
377 if (0 == strcmp (exp_str,
"never"))
391 "Relative expiration times of less than %s are not recommended. To improve availability, consider increasing this value.\n",
396 "Storing record with relative expiration time of %s\n",
406 "Storing record with absolute expiration time of %s\n",
425 tok = strtok_r (cp,
" ", &saveptr);
429 _ (
"Missing entries in record line `%s'.\n"),
435 if (UINT32_MAX ==
record.record_type)
441 tok = strtok_r (NULL,
" ", &saveptr);
445 _ (
"Empty record line argument is not allowed.\n"));
449 if (1 != sscanf (tok,
"%" SCNu64, &
record.expiration_time))
452 _ (
"Error parsing expiration time %s.\n"), tok);
456 tok = strtok_r (NULL,
" ", &saveptr);
460 _ (
"Empty record line argument is not allowed.\n"));
465 if (NULL != strchr (tok, (
unsigned char)
'r'))
467 if (NULL == strchr (tok, (
unsigned char)
'p'))
469 if (NULL != strchr (tok, (
unsigned char)
'S'))
471 if (NULL != strchr (tok, (
unsigned char)
's'))
473 if (NULL != strchr (tok, (
unsigned char)
'C'))
475 tok += strlen (tok) + 1;
482 _ (
"Invalid record data for type %s: `%s'.\n"),
493 memcpy (&r[1], raw_data,
record.data_size);
648 for (ego_entry =
ego_head; NULL != ego_entry;)
651 ego_entry = ego_entry->
next;
699 _ (
"Adding record failed: %s\n"),
736 _ (
"Deleting record failed: %s\n"),
796 fprintf (stderr,
"Error iterating over zone\n");
812 mrec->
key = *zone_key;
843 orphan->
key = *zone_key;
875 if ((NULL !=
name) && (0 != strcmp (
name, rname)))
878 for (
unsigned int i = 0; i < rd_len; i++)
905 fprintf (stdout,
"%s.%s:\n", rname, is_orphaned ? orphaned_str :
912 for (
unsigned int i = 0; i < rd_len; i++)
926 _ (
"\tCorrupt or unsupported record of type %u\n"),
927 (
unsigned int)
rd[i].record_type);
942 sprintf (flgstr,
"[%s%s%s%s%s]",
951 " %s %" PRIu64
" %s %s\n",
953 rd[i].expiration_time,
958 "\t%s: %s (%s)\t%s\t%s\t%s\n",
1021 unsigned int rd_len,
1046 unsigned int rd_len,
1071 unsigned int rd_len,
1091 fprintf (stdout,
"%s",
"Monitor is now in sync.\n");
1104 fprintf (stderr,
"%s",
"Monitor disconnected and out of sync.\n");
1118 fprintf (stderr,
"%s",
"Failed to lookup record.\n");
1150 const char *rec_name,
1160 if (0 != strcmp (rec_name,
name))
1169 "Received %u records for name `%s'\n",
1172 for (
unsigned int i = 0; i <
rd_count; i++)
1182 "A SOA record exists already under `%s', cannot add a second SOA to the same zone.\n"),
1256 fprintf (stdout,
"%s.%s\n", label,
ego_name);
1294 unsigned int rd_left;
1305 "There are no records under label `%s' that could be deleted.\n")
1329 for (
unsigned int i = 0; i <
rd_count; i++)
1339 (0 == strcmp (vs,
value)))))
1340 rdx[rd_left++] =
rd[i];
1349 "There are no records under label `%s' that match the request for deletion.\n"),
1398 unsigned int sent_here;
1446 fprintf (stderr,
_ (
"No options given\n"));
1460 fprintf (stderr,
_ (
"Recordlines only work with option `%s'\n"),
1469 _ (
"Missing option `%s' for operation `%s'\n"),
1500 fprintf (stderr,
_ (
"Invalid nick `%s'\n"),
nickstring);
1521 _ (
"Missing option `%s' for operation `%s'\n"),
1531 _ (
"Missing option `%s' for operation `%s'\n"),
1541 _ (
"Missing option `%s' for operation `%s'\n"),
1549 if (UINT32_MAX ==
type)
1551 fprintf (stderr,
_ (
"Unsupported type `%s'\n"),
typestring);
1563 "For DNS record types `SRV', `TLSA', `SMIMEA' and `OPENPGPKEY'"));
1564 fprintf (stderr,
", please use a `BOX' record instead\n");
1572 _ (
"Missing option `%s' for operation `%s'\n"),
1583 _ (
"Value `%s' invalid for record type `%s'\n"),
1593 _ (
"Missing option `%s' for operation `%s'\n"),
1620 _ (
"Missing option `%s' for operation `%s'\n"),
1630 _ (
"Missing option `%s' for operation `%s'\n"),
1664 _ (
"Missing option `%s' for operation `%s'\n"),
1689 _ (
"Missing option `%s' for operation `%s'\n"),
1726 _ (
"Missing option `%s' for operation `%s'\n"),
1728 _ (
"reverse-pkey"));
1738 _ (
"Invalid public key for reverse lookup `%s'\n"),
1760 _ (
"Missing option `%s' for operation `%s'\n"),
1768 memset (
sh, 0, 105);
1769 memset (sname, 0, 64);
1771 if ((2 != (sscanf (
uri,
"gnunet://gns/%58s/%63s",
sh, sname))) ||
1775 fprintf (stderr,
_ (
"Invalid URI `%s'\n"),
uri);
1783 _ (
"Missing option `%s' for operation `%s'\n"),
1797 memset (&
rd, 0,
sizeof(
rd));
1833#define MAX_LINE_LEN 4086
1850 NULL != ego_entry; ego_entry = ego_entry->
next)
1854 if (0 == memcmp (&ego_pubkey, &
pubkey,
sizeof (
pubkey)))
1863 for (ego_entry =
ego_head; NULL != ego_entry; ego_entry = ego_entry->
next)
1866 if (0 != strcmp (str, ego_entry->
identifier))
1883 static int have_next_recordline =
GNUNET_NO;
1886 char *current_name = NULL;
1892 if (NULL != current_name)
1897 while (NULL != fgets (buf,
sizeof (buf), stdin))
1899 if (1 >= strlen (buf))
1901 if (buf[strlen (buf) - 1] ==
'\n')
1902 buf[strlen (buf) - 1] =
'\0';
1906 if (buf[strlen (buf) - 1] ==
':')
1909 memset (next_name, 0,
sizeof (next_name));
1910 strncpy (next_name, buf, strlen (buf) - 1);
1911 tmp = strchr (next_name,
'.');
1914 fprintf (stderr,
"Error parsing name `%s'\n", next_name);
1921 fprintf (stderr,
"Error parsing zone name `%s'\n", tmp + 1);
1937 "Recordinfo array grown to %u bytes!\n",
1958 e->record.data, e->record.data_size);
1964 "Added %d records to record info\n",
rd_count);
1980 current_name, next_name);
1981 if (NULL != current_name)
1989 fprintf (stderr,
"Warning, encountered recordline without zone\n");
2018 e->record.data, e->record.data_size);
2028 fprintf (stderr,
"Warning, encountered recordline without zone\n");
2057 const char *ego_name_tmp)
2063 (void) ego_name_tmp;
2064 if ((NULL != ego_name_tmp) && (NULL !=
ego))
2073 if ((NULL !=
ego_name) && (NULL != ego_name_tmp) &&
2074 (0 == strcmp (
ego_name, ego_name_tmp)))
2100 const char *cfgfile,
2107 if (NULL !=
args[0])
2110 _ (
"Superfluous command line arguments (starting with `%s') ignored\n"),
2117 fprintf (stderr,
_ (
"Failed to connect to namestore\n"));
2125 fprintf (stderr,
_ (
"Cannot connect to identity service\n"));
2161 "expiration time for record to use (for adding only), \"never\" is possible"),
2167 "set the desired nick name for the zone"),
2172 "monitor changes in the namestore"),
2178 "name of the record to add/delete/display"),
2188 "determine our name for the given KEY"),
2194 "type of the record to add/delete/display"),
2205 "value of the record to add/delete"),
2216 "include-maintenance",
2218 "do not filter maintenance records"),
2223 "purge namestore of all orphans"),
2228 "show private key for orphaned records for recovery using `gnunet-identity -C -P <key>'. Use in combination with --display"),
2231 "purge-zone-records",
2233 "delete all records in specified zone"),
2239 "number of records to buffer and send as batch (for use with --from-stdin)"),
2245 "create shadow record (only valid if all other records of the same type have expired)"),
2251 "create maintenance record (e.g TOMBSTONEs)"),
2257 "name of the ego controlling the zone"),
2271 _ (
"GNUnet zone manipulation tool"),
struct GNUNET_GETOPT_CommandLineOption GNUNET_GETOPT_OPTION_END
struct GNUNET_GETOPT_CommandLineOption options[]
#define gettext_noop(String)
static bool finished
Set to true once we are finished and should exit after sending our final message to the parent.
static void record(void *cls, size_t data_size, const void *data)
Process recorded audio data.
static char * line
Desired phone line (string to be converted to a hash).
static struct GNUNET_DATASTORE_QueueEntry * qe
Current operation.
static struct GNUNET_FS_Handle * ctx
static struct GNUNET_IDENTITY_Handle * sh
Handle to IDENTITY service.
struct GNUNET_CRYPTO_PrivateKey pk
Private key from command line option, or NULL.
static char * pkey
Public key of the zone to look in, in ASCII.
static struct GNUNET_CRYPTO_PublicKey pubkey
Public key of the zone to look in.
static unsigned int rd_count
Number of records for currently parsed set.
static struct GNUNET_GNSRECORD_Data rd[50]
The record data under a single label.
static struct EgoEntry * ego_tail
Ego list.
static struct GNUNET_NAMESTORE_QueueEntry * ns_qe
Queue entry for begin/commit.
static void display_record_monitor(void *cls, const struct GNUNET_CRYPTO_PrivateKey *zone_key, const char *rname, unsigned int rd_len, const struct GNUNET_GNSRECORD_Data *rd, struct GNUNET_TIME_Absolute expiry)
Process a record that was stored in the namestore.
static int output_recordline
Output in recordline format.
static int omit_private
Filter private records.
static void zone_iteration_finished(void *cls)
Function called when we are done with a zone iteration.
static void replace_cont(void *cls, enum GNUNET_ErrorCode ec)
static void sync_cb(void *cls)
Function called once we are in sync in monitor mode.
static struct GNUNET_NAMESTORE_QueueEntry * get_qe
Queue entry for the 'lookup' operation.
static void del_lookup_error_cb(void *cls)
Function called if lookup for deletion fails.
static void purge_zone_iterator(void *cls, const struct GNUNET_CRYPTO_PrivateKey *zone_key, const char *rname, unsigned int rd_len, const struct GNUNET_GNSRECORD_Data *rd, struct GNUNET_TIME_Absolute expiry)
static struct GNUNET_CRYPTO_PrivateKey zone_pkey
Private key for the our zone.
static struct GNUNET_NAMESTORE_ZoneMonitor * zm
Monitor handle.
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.
static int parse_recordline(const char *line)
static void del_continuation(void *cls, enum GNUNET_ErrorCode ec)
static int list_orphaned
List records and zone keys of orphaned records.
#define WARN_RELATIVE_EXPIRATION_LIMIT
The upper bound for the zone iteration interval (per record).
static void purge_next_record(void *cls)
static int purge_orphaned
Purge orphaned records.
static struct GNUNET_NAMESTORE_QueueEntry * add_qe
Queue entry for the 'add' operation.
static void id_connect_cb(void *cls, struct GNUNET_IDENTITY_Ego *ego, void **ctx, const char *ego_name_tmp)
Function called with ALL of the egos known to the identity service, used on startup if the user did n...
static char * nickstring
Desired nick name.
static void display_record_lookup(void *cls, const struct GNUNET_CRYPTO_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.
static int monitor
Enables monitor mode.
static char * value
Value of the record to add/remove.
static int list
Desired action is to list records.
const struct GNUNET_CONFIGURATION_Handle * cfg
Configuration handle.
static struct GNUNET_NAMESTORE_QueueEntry * del_qe
Queue entry for the 'del' operation.
static void batch_insert_recordinfo(const struct GNUNET_CONFIGURATION_Handle *cfg)
We have obtained the zone's private key, so now process the main commands using it.
static int purge_zone
Purge zone contents.
static char * name
Name of the records to add/list/remove.
static int include_maintenance
Do not filter maintenance records.
static struct GNUNET_NAMESTORE_QueueEntry * set_qe
Queue entry for the 'set/replace' operation.
static int get_identity_for_string(const char *str, struct GNUNET_CRYPTO_PrivateKey *zk)
static void display_record(const struct GNUNET_CRYPTO_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.
static void collect_orphans(const struct GNUNET_CRYPTO_PrivateKey *zone_key, const char *rname, unsigned int rd_len, const struct GNUNET_GNSRECORD_Data *rd)
static int ret
Global return value.
static void handle_reverse_lookup(void *cls, const struct GNUNET_CRYPTO_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.
static void reset_handles(void)
static unsigned int max_batch_size
static void * data
Value in binary format.
static void lookup_error_cb(void *cls)
Function called on errors while monitoring.
static void clear_recordset()
static void do_shutdown(void *cls)
Task run on shutdown.
static struct GNUNET_IDENTITY_Handle * idh
Identity service handle.
static struct RecordSetEntry * recordset
Entry in record set for processing records in bulk.
static char * ego_name
Name of the ego controlling the zone.
static void reverse_error_cb(void *cls)
Function called if we encountered an error in zone-to-name.
static struct MarkedRecord * marked_head
Marked record list.
static struct EgoEntry * ego_head
Ego list.
static int parse_expiration(const char *exp_str, int *is_rel, uint64_t *exptime)
Parse expiration time.
static int is_shadow
Is record a shadow record (GNUNET_GNSRECORD_RF_SHADOW)
static void add_continuation(void *cls, enum GNUNET_ErrorCode ec)
static struct GNUNET_SCHEDULER_Task * purge_task
Purge task.
static void run(void *cls, char *const *args, const char *cfgfile, const struct GNUNET_CONFIGURATION_Handle *_cfg)
Main function that will be run.
static unsigned int ri_sent
static void finish_command(void)
static int del
Desired action is to remove a record.
static int etime_is_rel
Is expiration time relative or absolute time?
static void add_error_cb(void *cls)
Function called if lookup fails.
static struct GNUNET_NAMESTORE_Handle * ns
Handle to the namestore.
static void marked_deleted(void *cls, enum GNUNET_ErrorCode ec)
static struct GNUNET_NAMESTORE_ZoneIterator * list_it
List iterator for the 'list' operation.
static int is_maintenance
Is record a maintenance record (GNUNET_GNSRECORD_RF_MAINTENANCE)
static struct MarkedRecord * marked_tail
Marked record list.
static void display_record_iterator(void *cls, const struct GNUNET_CRYPTO_PrivateKey *zone_key, const char *rname, unsigned int rd_len, const struct GNUNET_GNSRECORD_Data *rd, struct GNUNET_TIME_Absolute expiry)
Process a record that was stored in the namestore.
static void purge_orphans_iterator(void *cls, const struct GNUNET_CRYPTO_PrivateKey *zone_key, const char *rname, unsigned int rd_len, const struct GNUNET_GNSRECORD_Data *rd, struct GNUNET_TIME_Absolute expiry)
static void monitor_error_cb(void *cls)
Function called on errors while monitoring.
static int read_from_stdin
Run in read from stdin mode.
static void process_command_stdin(void)
int main(int argc, char *const *argv)
The main function for gnunet-namestore.
static uint32_t type
Type string converted to DNS type value.
static size_t data_size
Number of bytes in data.
static char * expirationstring
Desired expiration time.
static unsigned int record_info_capacity
Maximum capacity of record_info array.
static void collect_zone_records_to_purge(const struct GNUNET_CRYPTO_PrivateKey *zone_key, const char *rname, unsigned int rd_len, const struct GNUNET_GNSRECORD_Data *rd)
static struct GNUNET_NAMESTORE_RecordInfo * record_info
static struct GNUNET_NAMESTORE_QueueEntry * add_qe_uri
Queue entry for the 'add-uri' operation.
static void del_monitor(void *cls, const struct GNUNET_CRYPTO_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.
static void schedule_finish(void *cls)
static int add
Desired action is to add a record.
static struct GNUNET_NAMESTORE_QueueEntry * reverse_qe
Queue entry for the 'reverse lookup' operation (in combination with a name).
static void zone_iteration_error_cb(void *cls)
Function called when we encountered an error in a zone iteration.
static void get_existing_record(void *cls, const struct GNUNET_CRYPTO_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 informati...
static char * typestring
Type of the record to add/remove, NULL to remove all.
static char * uri
URI to import.
static uint64_t etime
Expiration string converted to numeric value.
static char * reverse_pkey
Reverse lookup to perform.
static unsigned int ri_count
static int is_public
Is record public (opposite of GNUNET_GNSRECORD_RF_PRIVATE)
commonly used definitions; globals in this file are exempt from the rule that the module name ("commo...
API that can be used to manipulate GNS record data.
Identity service; implements identity management for GNUnet.
API that can be used to store naming information on a GNUnet node;.
#define GNUNET_CONTAINER_DLL_remove(head, tail, element)
Remove an element from a DLL.
#define GNUNET_CONTAINER_DLL_insert_tail(head, tail, element)
Insert an element at the tail of a DLL.
#define GNUNET_CONTAINER_DLL_insert(head, tail, element)
Insert an element at the head of a DLL.
#define GNUNET_DNSPARSER_TYPE_OPENPGPKEY
#define GNUNET_DNSPARSER_TYPE_TLSA
#define GNUNET_DNSPARSER_TYPE_SRV
#define GNUNET_DNSPARSER_TYPE_SOA
#define GNUNET_DNSPARSER_TYPE_SMIMEA
#define GNUNET_DNSPARSER_MAX_NAME_LENGTH
Maximum length of a name in DNS.
struct GNUNET_GETOPT_CommandLineOption GNUNET_GETOPT_option_uint(char shortName, const char *name, const char *argumentHelp, const char *description, unsigned int *val)
Allow user to specify an unsigned int.
struct GNUNET_GETOPT_CommandLineOption GNUNET_GETOPT_option_flag(char shortName, const char *name, const char *description, int *val)
Allow user to specify a flag (which internally means setting an integer to 1/GNUNET_YES/GNUNET_OK.
struct GNUNET_GETOPT_CommandLineOption GNUNET_GETOPT_option_string(char shortName, const char *name, const char *argumentHelp, const char *description, char **str)
Allow user to specify a string.
const char * GNUNET_GNSRECORD_number_to_typename(uint32_t type)
Convert a type number to the corresponding type string (e.g.
uint32_t GNUNET_GNSRECORD_typename_to_number(const char *dns_typename)
Convert a type name (e.g.
int GNUNET_GNSRECORD_string_to_value(uint32_t type, const char *s, void **data, size_t *data_size)
Convert human-readable version of the value s of a record of type type to the respective binary repre...
#define GNUNET_GNS_EMPTY_LABEL_AT
String we use to indicate an empty label (top-level entry in the zone).
GNUNET_GNSRECORD_Filter
Filter for GNUNET_GNSRECORD_normalize_record_set().
#define GNUNET_GNSRECORD_TYPE_ANY
Record type indicating any record/'*'.
char * GNUNET_GNSRECORD_value_to_string(uint32_t type, const void *data, size_t data_size)
Convert the binary value data of a record of type type to a human-readable string.
@ GNUNET_GNSRECORD_RF_RELATIVE_EXPIRATION
This expiration time of the record is a relative time (not an absolute time).
@ GNUNET_GNSRECORD_RF_CRITICAL
This record is critical.
@ GNUNET_GNSRECORD_RF_SUPPLEMENTAL
This is a supplemental record.
@ GNUNET_GNSRECORD_RF_MAINTENANCE
Maintenance records.
@ GNUNET_GNSRECORD_RF_SHADOW
This record should not be used unless all (other) records in the set with an absolute expiration time...
@ GNUNET_GNSRECORD_RF_PRIVATE
This is a private record of this peer and it should thus not be published.
@ GNUNET_GNSRECORD_RF_NONE
Entry for no flags / cleared flags.
@ 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.
const struct GNUNET_CRYPTO_PrivateKey * GNUNET_IDENTITY_ego_get_private_key(const struct GNUNET_IDENTITY_Ego *ego)
Obtain the ECC key associated with a ego.
struct GNUNET_IDENTITY_Handle * GNUNET_IDENTITY_connect(const struct GNUNET_CONFIGURATION_Handle *cfg, GNUNET_IDENTITY_Callback cb, void *cb_cls)
Connect to the identity service.
void GNUNET_IDENTITY_disconnect(struct GNUNET_IDENTITY_Handle *h)
Disconnect from identity service.
void GNUNET_IDENTITY_ego_get_public_key(struct GNUNET_IDENTITY_Ego *ego, struct GNUNET_CRYPTO_PublicKey *pk)
Get the identifier (public key) of an ego.
ssize_t GNUNET_CRYPTO_public_key_get_length(const struct GNUNET_CRYPTO_PublicKey *key)
Get the compacted length of a GNUNET_CRYPTO_PublicKey.
#define GNUNET_log(kind,...)
char * GNUNET_CRYPTO_private_key_to_string(const struct GNUNET_CRYPTO_PrivateKey *key)
Creates a (Base32) string representation of the private key.
#define GNUNET_memcmp(a, b)
Compare memory in a and b, where both must be of the same pointer type.
#define GNUNET_memcpy(dst, src, n)
Call memcpy() but check for n being 0 first.
enum GNUNET_GenericReturnValue GNUNET_CRYPTO_public_key_from_string(const char *str, struct GNUNET_CRYPTO_PublicKey *key)
Parses a (Base32) string representation of the public key.
#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.
enum GNUNET_GenericReturnValue GNUNET_log_setup(const char *comp, const char *loglevel, const char *logfile)
Setup logging.
@ GNUNET_ERROR_TYPE_WARNING
@ GNUNET_ERROR_TYPE_ERROR
@ GNUNET_ERROR_TYPE_MESSAGE
@ GNUNET_ERROR_TYPE_DEBUG
#define GNUNET_strdup(a)
Wrapper around GNUNET_xstrdup_.
#define GNUNET_array_grow(arr, size, tsize)
Grow a well-typed (!) array.
#define GNUNET_new(type)
Allocate a struct or union of the given type.
#define GNUNET_malloc(size)
Wrapper around malloc.
#define GNUNET_new_array(n, type)
Allocate a size n array with structs or unions of the given type.
#define GNUNET_free(ptr)
Wrapper around free.
struct GNUNET_NAMESTORE_ZoneIterator * GNUNET_NAMESTORE_zone_iteration_start2(struct GNUNET_NAMESTORE_Handle *h, const struct GNUNET_CRYPTO_PrivateKey *zone, GNUNET_SCHEDULER_TaskCallback error_cb, void *error_cb_cls, GNUNET_NAMESTORE_RecordSetMonitor proc, void *proc_cls, GNUNET_SCHEDULER_TaskCallback finish_cb, void *finish_cb_cls, enum GNUNET_GNSRECORD_Filter filter)
Starts a new zone iteration (used to periodically PUT all of our records into our DHT).
struct GNUNET_NAMESTORE_QueueEntry * GNUNET_NAMESTORE_records_lookup(struct GNUNET_NAMESTORE_Handle *h, const struct GNUNET_CRYPTO_PrivateKey *pkey, const char *label, GNUNET_SCHEDULER_TaskCallback error_cb, void *error_cb_cls, GNUNET_NAMESTORE_RecordMonitor rm, void *rm_cls)
Lookup an item in the namestore.
struct GNUNET_NAMESTORE_QueueEntry * GNUNET_NAMESTORE_record_set_store(struct GNUNET_NAMESTORE_Handle *h, const struct GNUNET_CRYPTO_PrivateKey *pkey, const char *label, unsigned int rd_count, const struct GNUNET_GNSRECORD_Data *rd, GNUNET_NAMESTORE_ContinuationWithStatus cont, void *cont_cls)
Store an item in the namestore.
void GNUNET_NAMESTORE_disconnect(struct GNUNET_NAMESTORE_Handle *h)
Disconnect from the namestore service (and free associated resources).
void GNUNET_NAMESTORE_zone_iterator_next(struct GNUNET_NAMESTORE_ZoneIterator *it, uint64_t limit)
Calls the record processor specified in GNUNET_NAMESTORE_zone_iteration_start for the next record.
void GNUNET_NAMESTORE_cancel(struct GNUNET_NAMESTORE_QueueEntry *qe)
Cancel a namestore operation.
struct GNUNET_NAMESTORE_QueueEntry * GNUNET_NAMESTORE_records_lookup2(struct GNUNET_NAMESTORE_Handle *h, const struct GNUNET_CRYPTO_PrivateKey *pkey, const char *label, GNUNET_SCHEDULER_TaskCallback error_cb, void *error_cb_cls, GNUNET_NAMESTORE_RecordMonitor rm, void *rm_cls, enum GNUNET_GNSRECORD_Filter filter)
Lookup an item in the namestore with GNSRECORD filter.
void GNUNET_NAMESTORE_zone_monitor_stop(struct GNUNET_NAMESTORE_ZoneMonitor *zm)
Stop monitoring a zone for changes.
struct GNUNET_NAMESTORE_QueueEntry * GNUNET_NAMESTORE_zone_to_name(struct GNUNET_NAMESTORE_Handle *h, const struct GNUNET_CRYPTO_PrivateKey *zone, const struct GNUNET_CRYPTO_PublicKey *value_zone, GNUNET_SCHEDULER_TaskCallback error_cb, void *error_cb_cls, GNUNET_NAMESTORE_RecordMonitor proc, void *proc_cls)
Look for an existing PKEY delegation record for a given public key.
struct GNUNET_NAMESTORE_ZoneMonitor * GNUNET_NAMESTORE_zone_monitor_start2(const struct GNUNET_CONFIGURATION_Handle *cfg, const struct GNUNET_CRYPTO_PrivateKey *zone, int iterate_first, GNUNET_SCHEDULER_TaskCallback error_cb, void *error_cb_cls, GNUNET_NAMESTORE_RecordSetMonitor monitor, void *monitor_cls, GNUNET_SCHEDULER_TaskCallback sync_cb, void *sync_cb_cls, enum GNUNET_GNSRECORD_Filter filter)
Begin monitoring a zone for changes.
struct GNUNET_NAMESTORE_QueueEntry * GNUNET_NAMESTORE_records_store(struct GNUNET_NAMESTORE_Handle *h, const struct GNUNET_CRYPTO_PrivateKey *pkey, unsigned int rd_set_count, const struct GNUNET_NAMESTORE_RecordInfo *record_info, unsigned int *rds_sent, GNUNET_NAMESTORE_ContinuationWithStatus cont, void *cont_cls)
Store one or more record sets in the namestore.
void GNUNET_NAMESTORE_zone_monitor_next(struct GNUNET_NAMESTORE_ZoneMonitor *zm, uint64_t limit)
Calls the monitor processor specified in GNUNET_NAMESTORE_zone_monitor_start for the next record(s).
struct GNUNET_NAMESTORE_Handle * GNUNET_NAMESTORE_connect(const struct GNUNET_CONFIGURATION_Handle *cfg)
Connect to the namestore service.
void GNUNET_NAMESTORE_zone_iteration_stop(struct GNUNET_NAMESTORE_ZoneIterator *it)
Stops iteration and releases the namestore handle for further calls.
const struct GNUNET_OS_ProjectData * GNUNET_OS_project_data_gnunet(void)
Return default project data used by 'libgnunetutil' for GNUnet.
enum GNUNET_GenericReturnValue GNUNET_PROGRAM_run(const struct GNUNET_OS_ProjectData *pd, int argc, char *const *argv, const char *binaryName, const char *binaryHelp, const struct GNUNET_GETOPT_CommandLineOption *options, GNUNET_PROGRAM_Main task, void *task_cls)
Run a standard GNUnet command startup sequence (initialize loggers and configuration,...
void GNUNET_SCHEDULER_shutdown(void)
Request the shutdown of a scheduler.
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.
enum GNUNET_GenericReturnValue GNUNET_STRINGS_fancy_time_to_relative(const char *fancy_time, struct GNUNET_TIME_Relative *rtime)
Convert a given fancy human-readable time to our internal representation.
#define GNUNET_TIME_relative_cmp(t1, op, t2)
Compare two relative times.
const char * GNUNET_STRINGS_relative_time_to_string(struct GNUNET_TIME_Relative delta, int do_round)
Give relative time in human-readable fancy format.
const char * GNUNET_STRINGS_absolute_time_to_string(struct GNUNET_TIME_Absolute t)
Like asctime, except for GNUnet time.
#define GNUNET_TIME_UNIT_FOREVER_ABS
Constant used to specify "forever".
enum GNUNET_GenericReturnValue GNUNET_STRINGS_fancy_time_to_absolute(const char *fancy_time, struct GNUNET_TIME_Absolute *atime)
Convert a given fancy human-readable time to our internal representation.
#define GNUNET_GNSRECORD_TYPE_NICK
GNS zone nickname.
const char * GNUNET_ErrorCode_get_hint(enum GNUNET_ErrorCode ec)
Returns a hint for a given error code.
GNUNET_ErrorCode
Taler error codes.
@ GNUNET_EC_NONE
No error (success).
@ GNUNET_EC_NAMESTORE_RECORD_EXISTS
Record already exists.
@ GNUNET_EC_NAMESTORE_RECORD_NOT_FOUND
Record not found.
The default namestore ego.
char * identifier
Ego Identifier.
struct EgoEntry * prev
DLL.
struct EgoEntry * next
DLL.
struct GNUNET_IDENTITY_Ego * ego
The Ego.
A private key for an identity as per LSD0001.
An identity key as per LSD0001.
Definition of a command line option.
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.
Connection to the NAMESTORE service.
An QueueEntry used to store information for a pending NAMESTORE record operation.
A struct for record bulk import.
struct GNUNET_GNSRECORD_Data * a_rd
Handle for a zone iterator operation.
Handle for a monitoring activity.
Entry in list of pending tasks.
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.
The record marked for deletion.
struct MarkedRecord * next
DLL.
struct GNUNET_CRYPTO_PrivateKey key
The zone key.
char * name
Ego Identifier.
struct MarkedRecord * prev
DLL.
Entry in record set for bulk processing.
struct GNUNET_GNSRECORD_Data record
The record to add/remove.
struct RecordSetEntry * next
Kept in a linked list.