71 "72QC35CO20UJN1E91KPJFNT9TG4CLKAPB4VK9S3Q758S9MLBRKOG";
102 va_list ap, apc1, apc2;
108 while (NULL != (
arg = va_arg (apc1,
char *)))
109 arglen += strlen (
arg) + 1;
112 while (NULL != (
arg = va_arg (apc2,
char *)))
115 argp += strlen (
arg);
131 fprintf (stderr,
"Failed to run `%s'\n",
args);
139 fprintf (stderr,
"Failed to wait for `%s'\n",
args);
151 fprintf (stderr,
"`%s' is still running\n",
args);
158 fprintf (stderr,
"Failed to check the status of `%s'\n",
args);
168 char *
pk,
int *found_rec)
173 for (i = 0; i < rd_len; i++)
188 if (0 == strcmp (s,
pk))
207 const char *rname,
unsigned int rd_len,
212 if (0 == strcmp (rname,
"private"))
214 else if (0 == strcmp (rname,
"pin"))
230 NULL, NULL, &
st, &code,
232 "gnunet-namestore",
"-z",
"master-zone",
233 "-a",
"-e",
"never",
"-n",
"private",
"-p",
244 NULL, NULL, &
st, &code,
246 "gnunet-namestore",
"-z",
"master-zone",
247 "-a",
"-e",
"never",
"-n",
"pin",
"-p",
"-t",
302 const char *identifier)
329 if (NULL != identifier)
383run (
void *cls,
char *
const *
args,
const char *cfgfile,
392 NULL, NULL, &
st, &code,
394 "gnunet-arm",
"-I", NULL))
398 "GNUnet is not running, please start GNUnet before running import\n");
403 NULL, NULL, &
st, &code,
405 "gnunet-identity",
"-C",
"master-zone", NULL))
409 NULL, NULL, &
st, &code,
411 "gnunet-identity",
"-C",
"private-zone", NULL))
415 NULL, NULL, &
st, &code,
417 "gnunet-identity",
"-C",
"sks-zone", NULL))
421 NULL, NULL, &
st, &code,
423 "gnunet-identity",
"-e",
"master-zone",
"-s",
428 NULL, NULL, &
st, &code,
430 "gnunet-identity",
"-e",
"master-zone",
"-s",
435 NULL, NULL, &
st, &code,
437 "gnunet-identity",
"-e",
"master-zone",
"-s",
442 NULL, NULL, &
st, &code,
444 "gnunet-identity",
"-e",
"master-zone",
"-s",
445 "gns-intercept", NULL))
449 NULL, NULL, &
st, &code,
451 "gnunet-identity",
"-e",
"private-zone",
"-s",
452 "gns-private", NULL))
456 NULL, NULL, &
st, &code,
458 "gnunet-identity",
"-e",
"sks-zone",
"-s",
476main (
int argc,
char *
const *argv)
487 "This program will import some GNS authorities into your GNS namestore."),
struct GNUNET_GETOPT_CommandLineOption GNUNET_GETOPT_OPTION_END
struct GNUNET_GETOPT_CommandLineOption options[]
static struct GNUNET_SCHEDULER_Task * st
The shutdown task.
static char * data
The data to insert into the dht.
static struct GNUNET_FS_Handle * ctx
static void get_ego(void *cls, struct GNUNET_IDENTITY_Ego *ego, void **ctx, const char *identifier)
Get master-zone and private-zone keys.
static void zone_iteration_finished(void *cls)
static void check_pkey(unsigned int rd_len, const struct GNUNET_GNSRECORD_Data *rd, char *pk, int *found_rec)
static struct GNUNET_CRYPTO_EcdsaPrivateKey master_pk
Binary version of PKEY for master-zone.
static char * master_zone_pkey
String version of PKEY for master-zone.
static void zone_iterator(void *cls, const struct GNUNET_CRYPTO_EcdsaPrivateKey *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 const struct GNUNET_CONFIGURATION_Handle * cfg
Configuration we are using.
static struct GNUNET_IDENTITY_Handle * sh
Handle to IDENTITY service.
static void shutdown_task(void *cls)
Task run on shutdown.
static void run(void *cls, char *const *args, const char *cfgfile, const struct GNUNET_CONFIGURATION_Handle *c)
Main function that will be run.
static char * private_zone_pkey
String version of PKEY for private-zone.
static int found_private_rec
Set to GNUNET_YES if private record was found;.
static struct GNUNET_NAMESTORE_Handle * ns
Handle to the namestore.
static int run_process_and_wait(enum GNUNET_OS_InheritStdioFlags std_inheritance, struct GNUNET_DISK_PipeHandle *pipe_stdin, struct GNUNET_DISK_PipeHandle *pipe_stdout, enum GNUNET_OS_ProcessStatusType *st, unsigned long *code, const char *filename,...)
struct GNUNET_NAMESTORE_ZoneIterator * list_it
Zone iterator for master zone.
static char * pin_zone_pkey
String version of PKEY for pin-zone.
int main(int argc, char *const *argv)
The main function for gnunet-gns.
static int found_pin_rec
Set to GNUNET_YES if pin record was found;.
static void zone_iteration_error(void *cls)
struct GNUNET_CRYPTO_PrivateKey pk
Private key from command line option, or NULL.
static struct GNUNET_CRYPTO_PublicKey pubkey
Public key of the zone to look in.
static struct GNUNET_GNSRECORD_Data rd[50]
The record data under a single label.
static size_t data_size
Number of bytes in data.
static struct GNUNET_OS_Process * p
Helper process we started.
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;.
enum GNUNET_GenericReturnValue GNUNET_GNSRECORD_identity_from_data(const char *data, size_t data_size, uint32_t type, struct GNUNET_CRYPTO_PublicKey *key)
Build a #GNUNET_GNSRECORD_PublicKey from zone delegation resource record data.
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.
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.
char * GNUNET_CRYPTO_ecdsa_public_key_to_string(const struct GNUNET_CRYPTO_EcdsaPublicKey *pub)
Convert a public key to a string.
enum GNUNET_GenericReturnValue GNUNET_log_setup(const char *comp, const char *loglevel, const char *logfile)
Setup logging.
#define GNUNET_malloc(size)
Wrapper around malloc.
#define GNUNET_free(ptr)
Wrapper around free.
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.
struct GNUNET_NAMESTORE_ZoneIterator * GNUNET_NAMESTORE_zone_iteration_start(struct GNUNET_NAMESTORE_Handle *h, const struct GNUNET_CRYPTO_PrivateKey *zone, GNUNET_SCHEDULER_TaskCallback error_cb, void *error_cb_cls, GNUNET_NAMESTORE_RecordMonitor proc, void *proc_cls, GNUNET_SCHEDULER_TaskCallback finish_cb, void *finish_cb_cls)
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.
GNUNET_OS_InheritStdioFlags
Flags that determine which of the standard streams should be inherited by the child process.
GNUNET_OS_ProcessStatusType
Process status types.
enum GNUNET_GenericReturnValue GNUNET_OS_process_status(struct GNUNET_OS_Process *proc, enum GNUNET_OS_ProcessStatusType *type, unsigned long *code)
Retrieve the status of a process.
enum GNUNET_GenericReturnValue GNUNET_OS_process_wait(struct GNUNET_OS_Process *proc)
Wait for a process to terminate.
struct GNUNET_OS_Process * GNUNET_OS_start_process_va(enum GNUNET_OS_InheritStdioFlags std_inheritance, struct GNUNET_DISK_PipeHandle *pipe_stdin, struct GNUNET_DISK_PipeHandle *pipe_stdout, struct GNUNET_DISK_PipeHandle *pipe_stderr, const char *filename, va_list va)
Start a process.
@ GNUNET_OS_INHERIT_STD_NONE
No standard streams should be inherited.
@ GNUNET_OS_INHERIT_STD_OUT_AND_ERR
When these flags are set, the child process will inherit stdout and stderr of the parent.
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,...
Private ECC key encoded for transmission.
Public ECC key (always for Curve25519) encoded in a format suitable for network transmission and ECDS...
An identity key as per LSD0001.
Handle used to manage a pipe.
Definition of a command line option.
Connection to the NAMESTORE service.
Handle for a zone iterator operation.