40 #define WARN_RELATIVE_EXPIRATION_LIMIT GNUNET_TIME_relative_multiply ( \
41 GNUNET_TIME_UNIT_MINUTES, 15)
372 "Relative expiration times of less than %s are not recommended. To improve availability, consider increasing this value.\n",
377 "Storing record with relative expiration time of %s\n",
387 "Storing record with absolute expiration time of %s\n",
407 tok = strtok_r (cp,
" ", &saveptr);
411 _ (
"Missing entries in record line `%s'.\n"),
417 if (UINT32_MAX ==
record.record_type)
423 tok = strtok_r (NULL,
" ", &saveptr);
427 _ (
"Empty record line argument is not allowed.\n"));
431 if (1 != sscanf (tok,
"%" SCNu64, &
record.expiration_time))
434 _ (
"Error parsing expiration time %s.\n"), tok);
438 tok = strtok_r (NULL,
" ", &saveptr);
442 _ (
"Empty record line argument is not allowed.\n"));
447 if (NULL != strchr (tok, (
unsigned char)
'r'))
449 if (NULL == strchr (tok, (
unsigned char)
'p'))
451 if (NULL != strchr (tok, (
unsigned char)
'S'))
453 if (NULL != strchr (tok, (
unsigned char)
's'))
455 if (NULL != strchr (tok, (
unsigned char)
'C'))
457 tok += strlen (tok) + 1;
464 _ (
"Invalid record data for type %s: `%s'.\n"),
475 memcpy (&r[1], raw_data,
record.data_size);
620 for (ego_entry =
ego_head; NULL != ego_entry;)
623 ego_entry = ego_entry->
next;
635 fprintf (stderr,
"Failed to commit to namestore: `%s'\n",
668 _ (
"Adding record failed: %s\n"),
702 _ (
"Deleting record failed: %s\n"),
761 fprintf (stderr,
"Error iterating over zone\n");
838 if ((NULL !=
name) && (0 != strcmp (
name, rname)))
841 for (
unsigned int i = 0; i < rd_len; i++)
868 fprintf (stdout,
"%s.%s:\n", rname, is_orphaned ? orphaned_str :
875 for (
unsigned int i = 0; i < rd_len; i++)
889 _ (
"\tCorrupt or unsupported record of type %u\n"),
890 (
unsigned int)
rd[i].record_type);
904 sprintf (flgstr,
"[%s%s%s%s%s]",
912 " %s %" PRIu64
" %s %s\n",
914 rd[i].expiration_time,
919 "\t%s: %s (%s)\t%s\t%s\n",
1002 unsigned int rd_len,
1027 unsigned int rd_len,
1047 fprintf (stdout,
"%s",
"Monitor is now in sync.\n");
1060 fprintf (stderr,
"%s",
"Monitor disconnected and out of sync.\n");
1074 fprintf (stderr,
"%s",
"Failed to lookup record.\n");
1106 const char *rec_name,
1116 if (0 != strcmp (rec_name,
name))
1125 "Received %u records for name `%s'\n",
1128 for (
unsigned int i = 0; i <
rd_count; i++)
1138 "A SOA record exists already under `%s', cannot add a second SOA to the same zone.\n"),
1210 fprintf (stdout,
"%s.%s\n", label,
ego_name);
1248 unsigned int rd_left;
1259 "There are no records under label `%s' that could be deleted.\n"),
1282 for (
unsigned int i = 0; i <
rd_count; i++)
1292 (0 == strcmp (vs,
value)))))
1293 rdx[rd_left++] =
rd[i];
1302 "There are no records under label `%s' that match the request for deletion.\n"),
1356 fprintf (stderr,
_ (
"No options given\n"));
1370 fprintf (stderr,
_ (
"Recordlines only work with option `%s'\n"),
1379 _ (
"Missing option `%s' for operation `%s'\n"),
1410 fprintf (stderr,
_ (
"Invalid nick `%s'\n"),
nickstring);
1431 _ (
"Missing option `%s' for operation `%s'\n"),
1441 _ (
"Missing option `%s' for operation `%s'\n"),
1451 _ (
"Missing option `%s' for operation `%s'\n"),
1459 if (UINT32_MAX ==
type)
1461 fprintf (stderr,
_ (
"Unsupported type `%s'\n"),
typestring);
1471 _ (
"For DNS record types `SRV', `TLSA' and `OPENPGPKEY'"));
1472 fprintf (stderr,
", please use a `BOX' record instead\n");
1480 _ (
"Missing option `%s' for operation `%s'\n"),
1491 _ (
"Value `%s' invalid for record type `%s'\n"),
1501 _ (
"Missing option `%s' for operation `%s'\n"),
1528 _ (
"Missing option `%s' for operation `%s'\n"),
1538 _ (
"Missing option `%s' for operation `%s'\n"),
1571 _ (
"Missing option `%s' for operation `%s'\n"),
1596 _ (
"Missing option `%s' for operation `%s'\n"),
1630 _ (
"Missing option `%s' for operation `%s'\n"),
1632 _ (
"reverse-pkey"));
1642 _ (
"Invalid public key for reverse lookup `%s'\n"),
1664 _ (
"Missing option `%s' for operation `%s'\n"),
1672 memset (
sh, 0, 105);
1673 memset (sname, 0, 64);
1675 if ((2 != (sscanf (
uri,
"gnunet://gns/%58s/%63s",
sh, sname))) ||
1679 fprintf (stderr,
_ (
"Invalid URI `%s'\n"),
uri);
1687 _ (
"Missing option `%s' for operation `%s'\n"),
1701 memset (&
rd, 0,
sizeof(
rd));
1734 #define MAX_LINE_LEN 4086
1751 NULL != ego_entry; ego_entry = ego_entry->
next)
1755 if (0 == memcmp (&ego_pubkey, &
pubkey,
sizeof (
pubkey)))
1764 for (ego_entry =
ego_head; NULL != ego_entry; ego_entry = ego_entry->
next)
1767 if (0 != strcmp (str, ego_entry->
identifier))
1783 static int have_next_zonekey =
GNUNET_NO;
1796 while (NULL != fgets (
buf,
sizeof (
buf), stdin))
1798 if (1 >= strlen (
buf))
1800 if (
buf[strlen (
buf) - 1] ==
'\n')
1801 buf[strlen (
buf) - 1] =
'\0';
1805 if (
buf[strlen (
buf) - 1] ==
':')
1807 memset (next_name, 0,
sizeof (next_name));
1808 strncpy (next_name,
buf, strlen (
buf) - 1);
1809 tmp = strchr (next_name,
'.');
1812 fprintf (stderr,
"Error parsing name `%s'\n", next_name);
1819 fprintf (stderr,
"Error parsing zone name `%s'\n", tmp + 1);
1841 fprintf (stderr,
"Warning, encountered recordline without zone\n");
1856 fprintf (stderr,
"Warning, encountered recordline without zone\n");
1871 "Failed to start transaction: %s\n",
1908 if ((NULL !=
name) && (NULL !=
ego))
1942 const char *cfgfile,
1949 if (NULL !=
args[0])
1952 _ (
"Superfluous command line arguments (starting with `%s') ignored\n"),
1959 fprintf (stderr,
_ (
"Failed to connect to namestore\n"));
1967 fprintf (stderr,
_ (
"Cannot connect to identity service\n"));
2004 "expiration time for record to use (for adding only), \"never\" is possible"),
2010 "set the desired nick name for the zone"),
2015 "monitor changes in the namestore"),
2021 "name of the record to add/delete/display"),
2031 "determine our name for the given KEY"),
2037 "type of the record to add/delete/display"),
2048 "value of the record to add/delete"),
2059 "include-maintenance",
2061 "do not filter maintenance records"),
2066 "purge namestore of all orphans"),
2071 "show private key for orphaned records for recovery using `gnunet-identity -C -P <key>'. Use in combination with --display"),
2074 "purge-zone-records",
2076 "delete all records in specified zone"),
2082 "create shadow record (only valid if all other records of the same type have expired"),
2088 "name of the ego controlling the zone"),
2103 _ (
"GNUnet zone manipulation tool"),
struct GNUNET_GETOPT_CommandLineOption GNUNET_GETOPT_OPTION_END
struct GNUNET_GETOPT_CommandLineOption options[]
#define GNUNET_GNSRECORD_TYPE_NICK
GNS nick names.
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_NAMESTORE_RECORD_EXISTS
Record already exists.
@ GNUNET_EC_NONE
No error (success).
@ GNUNET_EC_NAMESTORE_RECORD_NOT_FOUND
Record not found.
#define gettext_noop(String)
static struct Experiment * e
static struct SolverHandle * sh
static struct PendingResolutions * head
Head of list of pending resolution requests.
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.
struct GNUNET_IDENTITY_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_IDENTITY_PublicKey pubkey
Public key of the zone to look in.
static char * zone
Name of the zone being managed.
static const struct GNUNET_IDENTITY_PrivateKey * zone_key
Private key of the zone.
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 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 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, struct GNUNET_TIME_Absolute expiry)
Process a record that was stored in the namestore.
static void del_lookup_error_cb(void *cls)
Function called if lookup for deletion fails.
static struct GNUNET_NAMESTORE_ZoneMonitor * zm
Monitor handle.
static int parse_recordline(const char *line)
static void del_continuation(void *cls, enum GNUNET_ErrorCode ec)
static struct GNUNET_IDENTITY_PrivateKey zone_pkey
Private key for the our zone.
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 display_record(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.
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, struct GNUNET_TIME_Absolute expiry)
Process a record that was stored in the namestore.
static char * nickstring
Desired nick name.
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.
static void commit_cb(void *cls, enum GNUNET_ErrorCode ec)
const struct GNUNET_CONFIGURATION_Handle * cfg
Configuration handle.
static struct GNUNET_NAMESTORE_QueueEntry * del_qe
Queue entry for the 'del' operation.
static int purge_zone
Purge zone contents.
static void collect_zone_records_to_purge(const struct GNUNET_IDENTITY_PrivateKey *zone_key, const char *rname, unsigned int rd_len, const struct GNUNET_GNSRECORD_Data *rd)
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 ret
Global return value.
static void reset_handles(void)
static void purge_orphans_iterator(void *cls, const struct GNUNET_IDENTITY_PrivateKey *zone_key, const char *rname, unsigned int rd_len, const struct GNUNET_GNSRECORD_Data *rd, struct GNUNET_TIME_Absolute expiry)
static void * data
Value in binary format.
static void lookup_error_cb(void *cls)
Function called on errors while monitoring.
static void do_shutdown(void *cls)
Task run on shutdown.
static void begin_cb(void *cls, enum GNUNET_ErrorCode ec)
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 is_shadow
Is record a shadow record (GNUNET_GNSRECORD_RF_SHADOW)
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.
static int get_identity_for_string(const char *str, struct GNUNET_IDENTITY_PrivateKey *zk)
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 void finish_command(void)
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 informati...
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 int parse_expiration(const char *expirationstring, int *etime_is_rel, uint64_t *etime)
Parse expiration time.
static void marked_deleted(void *cls, enum GNUNET_ErrorCode ec)
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 n...
static struct GNUNET_NAMESTORE_ZoneIterator * list_it
List iterator for the 'list' operation.
static struct MarkedRecord * marked_tail
Marked record list.
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 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.
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 void purge_zone_iterator(void *cls, const struct GNUNET_IDENTITY_PrivateKey *zone_key, const char *rname, unsigned int rd_len, const struct GNUNET_GNSRECORD_Data *rd, struct GNUNET_TIME_Absolute expiry)
static size_t data_size
Number of bytes in data.
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.
static char * expirationstring
Desired expiration time.
static struct GNUNET_NAMESTORE_QueueEntry * add_qe_uri
Queue entry for the 'add-uri' operation.
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.
static void collect_orphans(const struct GNUNET_IDENTITY_PrivateKey *zone_key, const char *rname, unsigned int rd_len, const struct GNUNET_GNSRECORD_Data *rd)
static void process_command_stdin()
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 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 int is_public
Is record public (opposite of GNUNET_GNSRECORD_RF_PRIVATE)
static struct GNUNET_DNSSTUB_Context * ctx
Context for DNS resolution.
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_MAX_NAME_LENGTH
Maximum length of a name in DNS.
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.
@ 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_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.
char * GNUNET_GNSRECORD_value_to_string(uint32_t type, const void *data, size_t data_size)
Convert the 'value' of a record to a string.
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/'*'.
@ 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_IDENTITY_PrivateKey * GNUNET_IDENTITY_ego_get_private_key(const struct GNUNET_IDENTITY_Ego *ego)
Obtain the ECC key associated with a ego.
enum GNUNET_GenericReturnValue GNUNET_IDENTITY_public_key_from_string(const char *str, struct GNUNET_IDENTITY_PublicKey *key)
Parses a (Base32) string representation of the public key.
ssize_t GNUNET_IDENTITY_public_key_get_length(const struct GNUNET_IDENTITY_PublicKey *key)
Get the compacted length of a GNUNET_IDENTITY_PublicKey.
char * GNUNET_IDENTITY_private_key_to_string(const struct GNUNET_IDENTITY_PrivateKey *key)
Creates a (Base32) string representation of the private key.
void GNUNET_IDENTITY_ego_get_public_key(struct GNUNET_IDENTITY_Ego *ego, struct GNUNET_IDENTITY_PublicKey *pk)
Get the identifier (public key) of an 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.
#define GNUNET_log(kind,...)
#define GNUNET_memcpy(dst, src, n)
Call memcpy() but check for n being 0 first.
int GNUNET_log_setup(const char *comp, const char *loglevel, const char *logfile)
Setup logging.
#define GNUNET_assert(cond)
Use this for fatal errors that cannot be handled.
#define GNUNET_break(cond)
Use this for internal assertion violations that are not fatal (can be handled) but should not occur.
@ GNUNET_ERROR_TYPE_WARNING
@ GNUNET_ERROR_TYPE_ERROR
@ GNUNET_ERROR_TYPE_MESSAGE
@ GNUNET_ERROR_TYPE_DEBUG
#define GNUNET_strdup(a)
Wrapper around GNUNET_xstrdup_.
#define GNUNET_new(type)
Allocate a struct or union of the given type.
#define GNUNET_malloc(size)
Wrapper around malloc.
#define GNUNET_new_array(n, type)
Allocate a size n array with structs or unions of the given type.
#define GNUNET_free(ptr)
Wrapper around free.
#define GNUNET_free_nz(ptr)
Wrapper around free.
void GNUNET_NAMESTORE_disconnect(struct GNUNET_NAMESTORE_Handle *h)
Disconnect from the namestore service (and free associated resources).
struct GNUNET_NAMESTORE_QueueEntry * GNUNET_NAMESTORE_records_lookup(struct GNUNET_NAMESTORE_Handle *h, const struct GNUNET_IDENTITY_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_transaction_begin(struct GNUNET_NAMESTORE_Handle *h, GNUNET_NAMESTORE_ContinuationWithStatus cont, void *cont_cls)
New API draft.
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.
void GNUNET_NAMESTORE_zone_monitor_stop(struct GNUNET_NAMESTORE_ZoneMonitor *zm)
Stop monitoring a zone for changes.
struct GNUNET_NAMESTORE_ZoneIterator * GNUNET_NAMESTORE_zone_iteration_start2(struct GNUNET_NAMESTORE_Handle *h, const struct GNUNET_IDENTITY_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_store(struct GNUNET_NAMESTORE_Handle *h, const struct GNUNET_IDENTITY_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.
struct GNUNET_NAMESTORE_ZoneMonitor * GNUNET_NAMESTORE_zone_monitor_start2(const struct GNUNET_CONFIGURATION_Handle *cfg, const struct GNUNET_IDENTITY_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_Handle * GNUNET_NAMESTORE_connect(const struct GNUNET_CONFIGURATION_Handle *cfg)
Connect to the namestore service.
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_QueueEntry * GNUNET_NAMESTORE_transaction_commit(struct GNUNET_NAMESTORE_Handle *h, GNUNET_NAMESTORE_ContinuationWithStatus cont, void *cont_cls)
Commit a namestore transaction.
struct GNUNET_NAMESTORE_QueueEntry * GNUNET_NAMESTORE_zone_to_name(struct GNUNET_NAMESTORE_Handle *h, const struct GNUNET_IDENTITY_PrivateKey *zone, const struct GNUNET_IDENTITY_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.
void GNUNET_NAMESTORE_zone_iteration_stop(struct GNUNET_NAMESTORE_ZoneIterator *it)
Stops iteration and releases the namestore handle for further calls.
enum GNUNET_GenericReturnValue GNUNET_PROGRAM_run(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_now(GNUNET_SCHEDULER_TaskCallback task, void *task_cls)
Schedule a new task to be run as soon as possible.
struct GNUNET_SCHEDULER_Task * GNUNET_SCHEDULER_add_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.
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.
enum GNUNET_GenericReturnValue GNUNET_STRINGS_get_utf8_args(int argc, char *const *argv, int *u8argc, char *const **u8argv)
Returns utf-8 encoded arguments.
#define GNUNET_TIME_relative_cmp(t1, op, t2)
Compare two relative times.
const char * GNUNET_STRINGS_absolute_time_to_string(struct GNUNET_TIME_Absolute t)
Like asctime, except for GNUnet time.
const char * GNUNET_STRINGS_relative_time_to_string(struct GNUNET_TIME_Relative delta, int do_round)
Give relative time in human-readable fancy format.
#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.
char * identifier
Ego Identifier.
struct EgoEntry * prev
DLL.
struct EgoEntry * next
DLL.
struct GNUNET_IDENTITY_Ego * ego
The Ego.
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.
A private key for an identity as per LSD0001.
An identity key as per LSD0001.
Connection to the NAMESTORE service.
An QueueEntry used to store information for a pending NAMESTORE record operation.
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 GNUNET_IDENTITY_PrivateKey key
The zone key.
struct MarkedRecord * next
DLL.
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.