aboutsummaryrefslogtreecommitdiff
path: root/src/reclaim/gnunet-reclaim.c
diff options
context:
space:
mode:
authorSchanzenbach, Martin <mschanzenbach@posteo.de>2019-07-15 14:25:38 +0200
committerSchanzenbach, Martin <mschanzenbach@posteo.de>2019-07-15 14:25:38 +0200
commitc33467bf10a68ca91e338988b00cebbf825586fe (patch)
treedd7756396c7b3f6b87b86113421e8fccf62dfe95 /src/reclaim/gnunet-reclaim.c
parentfebfb2408227b432e0455f62590cda628323437a (diff)
downloadgnunet-c33467bf10a68ca91e338988b00cebbf825586fe.tar.gz
gnunet-c33467bf10a68ca91e338988b00cebbf825586fe.zip
more useful output
Diffstat (limited to 'src/reclaim/gnunet-reclaim.c')
-rw-r--r--src/reclaim/gnunet-reclaim.c362
1 files changed, 247 insertions, 115 deletions
diff --git a/src/reclaim/gnunet-reclaim.c b/src/reclaim/gnunet-reclaim.c
index fcb7b9bc6..b2f6b4c3c 100644
--- a/src/reclaim/gnunet-reclaim.c
+++ b/src/reclaim/gnunet-reclaim.c
@@ -196,9 +196,12 @@ ticket_issue_cb (void *cls, const struct GNUNET_RECLAIM_Ticket *ticket)
196{ 196{
197 char *ticket_str; 197 char *ticket_str;
198 reclaim_op = NULL; 198 reclaim_op = NULL;
199 if (NULL != ticket) { 199 if (NULL != ticket)
200 ticket_str = GNUNET_STRINGS_data_to_string_alloc ( 200 {
201 ticket, sizeof (struct GNUNET_RECLAIM_Ticket)); 201 ticket_str =
202 GNUNET_STRINGS_data_to_string_alloc (ticket,
203 sizeof (
204 struct GNUNET_RECLAIM_Ticket));
202 printf ("%s\n", ticket_str); 205 printf ("%s\n", ticket_str);
203 GNUNET_free (ticket_str); 206 GNUNET_free (ticket_str);
204 } 207 }
@@ -209,35 +212,45 @@ static void
209store_attr_cont (void *cls, int32_t success, const char *emsg) 212store_attr_cont (void *cls, int32_t success, const char *emsg)
210{ 213{
211 reclaim_op = NULL; 214 reclaim_op = NULL;
212 if (GNUNET_SYSERR == success) { 215 if (GNUNET_SYSERR == success)
216 {
213 fprintf (stderr, "%s\n", emsg); 217 fprintf (stderr, "%s\n", emsg);
214 } 218 }
215 cleanup_task = GNUNET_SCHEDULER_add_now (&do_cleanup, NULL); 219 cleanup_task = GNUNET_SCHEDULER_add_now (&do_cleanup, NULL);
216} 220}
217 221
218static void 222static void
219process_attrs (void *cls, const struct GNUNET_CRYPTO_EcdsaPublicKey *identity, 223process_attrs (void *cls,
224 const struct GNUNET_CRYPTO_EcdsaPublicKey *identity,
220 const struct GNUNET_RECLAIM_ATTRIBUTE_Claim *attr) 225 const struct GNUNET_RECLAIM_ATTRIBUTE_Claim *attr)
221{ 226{
222 char *value_str; 227 char *value_str;
223 char *id; 228 char *id;
224 const char *attr_type; 229 const char *attr_type;
225 230
226 if (NULL == identity) { 231 if (NULL == identity)
232 {
227 reclaim_op = NULL; 233 reclaim_op = NULL;
228 cleanup_task = GNUNET_SCHEDULER_add_now (&do_cleanup, NULL); 234 cleanup_task = GNUNET_SCHEDULER_add_now (&do_cleanup, NULL);
229 return; 235 return;
230 } 236 }
231 if (NULL == attr) { 237 if (NULL == attr)
238 {
232 ret = 1; 239 ret = 1;
233 return; 240 return;
234 } 241 }
235 value_str = GNUNET_RECLAIM_ATTRIBUTE_value_to_string (attr->type, attr->data, 242 value_str = GNUNET_RECLAIM_ATTRIBUTE_value_to_string (attr->type,
243 attr->data,
236 attr->data_size); 244 attr->data_size);
237 attr_type = GNUNET_RECLAIM_ATTRIBUTE_number_to_typename (attr->type); 245 attr_type = GNUNET_RECLAIM_ATTRIBUTE_number_to_typename (attr->type);
238 id = GNUNET_STRINGS_data_to_string_alloc (&attr->id, sizeof (uint64_t)); 246 id = GNUNET_STRINGS_data_to_string_alloc (&attr->id, sizeof (uint64_t));
239 fprintf (stdout, "Name: %s; Value: %s (%s); Version %u; ID: %s\n", attr->name, 247 fprintf (stdout,
240 value_str, attr_type, attr->version, id); 248 "Name: %s; Value: %s (%s); Version %u; ID: %s\n",
249 attr->name,
250 value_str,
251 attr_type,
252 attr->version,
253 id);
241 GNUNET_free (id); 254 GNUNET_free (id);
242} 255}
243 256
@@ -261,14 +274,20 @@ ticket_iter (void *cls, const struct GNUNET_RECLAIM_Ticket *ticket)
261{ 274{
262 char *aud; 275 char *aud;
263 char *ref; 276 char *ref;
277 char *tkt;
264 278
265 aud = GNUNET_STRINGS_data_to_string_alloc ( 279 aud =
266 &ticket->audience, sizeof (struct GNUNET_CRYPTO_EcdsaPublicKey)); 280 GNUNET_STRINGS_data_to_string_alloc (&ticket->audience,
281 sizeof (struct
282 GNUNET_CRYPTO_EcdsaPublicKey));
267 ref = GNUNET_STRINGS_data_to_string_alloc (&ticket->rnd, sizeof (uint64_t)); 283 ref = GNUNET_STRINGS_data_to_string_alloc (&ticket->rnd, sizeof (uint64_t));
268 284 tkt =
269 fprintf (stdout, "Ticket ID: %s | Audience: %s\n", ref, aud); 285 GNUNET_STRINGS_data_to_string_alloc (ticket,
286 sizeof (struct GNUNET_RECLAIM_Ticket));
287 fprintf (stdout, "Ticket: %s | ID: %s | Audience: %s\n", tkt, ref, aud);
270 GNUNET_free (aud); 288 GNUNET_free (aud);
271 GNUNET_free (ref); 289 GNUNET_free (ref);
290 GNUNET_free (tkt);
272 GNUNET_RECLAIM_ticket_iteration_next (ticket_iterator); 291 GNUNET_RECLAIM_ticket_iteration_next (ticket_iterator);
273} 292}
274 293
@@ -294,7 +313,8 @@ static void
294process_rvk (void *cls, int success, const char *msg) 313process_rvk (void *cls, int success, const char *msg)
295{ 314{
296 reclaim_op = NULL; 315 reclaim_op = NULL;
297 if (GNUNET_OK != success) { 316 if (GNUNET_OK != success)
317 {
298 fprintf (stderr, "Revocation failed.\n"); 318 fprintf (stderr, "Revocation failed.\n");
299 ret = 1; 319 ret = 1;
300 } 320 }
@@ -306,7 +326,8 @@ static void
306process_delete (void *cls, int success, const char *msg) 326process_delete (void *cls, int success, const char *msg)
307{ 327{
308 reclaim_op = NULL; 328 reclaim_op = NULL;
309 if (GNUNET_OK != success) { 329 if (GNUNET_OK != success)
330 {
310 fprintf (stderr, "Deletion failed.\n"); 331 fprintf (stderr, "Deletion failed.\n");
311 ret = 1; 332 ret = 1;
312 } 333 }
@@ -322,57 +343,87 @@ iter_finished (void *cls)
322 int type; 343 int type;
323 344
324 attr_iterator = NULL; 345 attr_iterator = NULL;
325 if (list) { 346 if (list)
347 {
326 cleanup_task = GNUNET_SCHEDULER_add_now (&do_cleanup, NULL); 348 cleanup_task = GNUNET_SCHEDULER_add_now (&do_cleanup, NULL);
327 return; 349 return;
328 } 350 }
329 351
330 if (issue_attrs) { 352 if (issue_attrs)
331 reclaim_op = GNUNET_RECLAIM_ticket_issue ( 353 {
332 reclaim_handle, pkey, &rp_key, attr_list, &ticket_issue_cb, NULL); 354 reclaim_op = GNUNET_RECLAIM_ticket_issue (reclaim_handle,
355 pkey,
356 &rp_key,
357 attr_list,
358 &ticket_issue_cb,
359 NULL);
333 return; 360 return;
334 } 361 }
335 if (consume_ticket) { 362 if (consume_ticket)
336 reclaim_op = GNUNET_RECLAIM_ticket_consume (reclaim_handle, pkey, &ticket, 363 {
337 &process_attrs, NULL); 364 reclaim_op = GNUNET_RECLAIM_ticket_consume (reclaim_handle,
365 pkey,
366 &ticket,
367 &process_attrs,
368 NULL);
338 timeout = GNUNET_SCHEDULER_add_delayed ( 369 timeout = GNUNET_SCHEDULER_add_delayed (
339 GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 10), 370 GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 10),
340 &timeout_task, NULL); 371 &timeout_task,
372 NULL);
341 return; 373 return;
342 } 374 }
343 if (revoke_ticket) { 375 if (revoke_ticket)
344 reclaim_op = GNUNET_RECLAIM_ticket_revoke (reclaim_handle, pkey, &ticket, 376 {
345 &process_rvk, NULL); 377 reclaim_op = GNUNET_RECLAIM_ticket_revoke (reclaim_handle,
378 pkey,
379 &ticket,
380 &process_rvk,
381 NULL);
346 return; 382 return;
347 } 383 }
348 if (attr_delete) { 384 if (attr_delete)
349 if (NULL == attr_to_delete) { 385 {
386 if (NULL == attr_to_delete)
387 {
350 fprintf (stdout, "No such attribute ``%s''\n", attr_delete); 388 fprintf (stdout, "No such attribute ``%s''\n", attr_delete);
351 return; 389 return;
352 } 390 }
353 reclaim_op = GNUNET_RECLAIM_attribute_delete ( 391 reclaim_op = GNUNET_RECLAIM_attribute_delete (reclaim_handle,
354 reclaim_handle, pkey, attr_to_delete, &process_delete, NULL); 392 pkey,
393 attr_to_delete,
394 &process_delete,
395 NULL);
355 return; 396 return;
356 } 397 }
357 if (attr_name) { 398 if (attr_name)
399 {
358 if (NULL == type_str) 400 if (NULL == type_str)
359 type = GNUNET_RECLAIM_ATTRIBUTE_TYPE_STRING; 401 type = GNUNET_RECLAIM_ATTRIBUTE_TYPE_STRING;
360 else 402 else
361 type = GNUNET_RECLAIM_ATTRIBUTE_typename_to_number (type_str); 403 type = GNUNET_RECLAIM_ATTRIBUTE_typename_to_number (type_str);
362 404
363 GNUNET_assert (GNUNET_SYSERR != 405 GNUNET_assert (GNUNET_SYSERR !=
364 GNUNET_RECLAIM_ATTRIBUTE_string_to_value ( 406 GNUNET_RECLAIM_ATTRIBUTE_string_to_value (type,
365 type, attr_value, (void **)&data, &data_size)); 407 attr_value,
366 if (NULL != claim) { 408 (void **) &data,
409 &data_size));
410 if (NULL != claim)
411 {
367 claim->type = type; 412 claim->type = type;
368 claim->data = data; 413 claim->data = data;
369 claim->data_size = data_size; 414 claim->data_size = data_size;
370 } else { 415 }
416 else
417 {
371 claim = 418 claim =
372 GNUNET_RECLAIM_ATTRIBUTE_claim_new (attr_name, type, data, data_size); 419 GNUNET_RECLAIM_ATTRIBUTE_claim_new (attr_name, type, data, data_size);
373 } 420 }
374 reclaim_op = GNUNET_RECLAIM_attribute_store ( 421 reclaim_op = GNUNET_RECLAIM_attribute_store (reclaim_handle,
375 reclaim_handle, pkey, claim, &exp_interval, &store_attr_cont, NULL); 422 pkey,
423 claim,
424 &exp_interval,
425 &store_attr_cont,
426 NULL);
376 GNUNET_free (data); 427 GNUNET_free (data);
377 GNUNET_free (claim); 428 GNUNET_free (claim);
378 return; 429 return;
@@ -381,7 +432,8 @@ iter_finished (void *cls)
381} 432}
382 433
383static void 434static void
384iter_cb (void *cls, const struct GNUNET_CRYPTO_EcdsaPublicKey *identity, 435iter_cb (void *cls,
436 const struct GNUNET_CRYPTO_EcdsaPublicKey *identity,
385 const struct GNUNET_RECLAIM_ATTRIBUTE_Claim *attr) 437 const struct GNUNET_RECLAIM_ATTRIBUTE_Claim *attr)
386{ 438{
387 struct GNUNET_RECLAIM_ATTRIBUTE_ClaimListEntry *le; 439 struct GNUNET_RECLAIM_ATTRIBUTE_ClaimListEntry *le;
@@ -391,44 +443,68 @@ iter_cb (void *cls, const struct GNUNET_CRYPTO_EcdsaPublicKey *identity,
391 char *id; 443 char *id;
392 const char *attr_type; 444 const char *attr_type;
393 445
394 if ((NULL != attr_name) && (NULL != claim)) { 446 if ((NULL != attr_name) && (NULL != claim))
395 if (0 == strcasecmp (attr_name, attr->name)) { 447 {
396 claim = GNUNET_RECLAIM_ATTRIBUTE_claim_new (attr->name, attr->type, 448 if (0 == strcasecmp (attr_name, attr->name))
397 attr->data, attr->data_size); 449 {
450 claim = GNUNET_RECLAIM_ATTRIBUTE_claim_new (attr->name,
451 attr->type,
452 attr->data,
453 attr->data_size);
398 } 454 }
399 } else if (issue_attrs) { 455 }
456 else if (issue_attrs)
457 {
400 attrs_tmp = GNUNET_strdup (issue_attrs); 458 attrs_tmp = GNUNET_strdup (issue_attrs);
401 attr_str = strtok (attrs_tmp, ","); 459 attr_str = strtok (attrs_tmp, ",");
402 while (NULL != attr_str) { 460 while (NULL != attr_str)
403 if (0 != strcasecmp (attr_str, attr->name)) { 461 {
462 if (0 != strcasecmp (attr_str, attr->name))
463 {
404 attr_str = strtok (NULL, ","); 464 attr_str = strtok (NULL, ",");
405 continue; 465 continue;
406 } 466 }
407 le = GNUNET_new (struct GNUNET_RECLAIM_ATTRIBUTE_ClaimListEntry); 467 le = GNUNET_new (struct GNUNET_RECLAIM_ATTRIBUTE_ClaimListEntry);
408 le->claim = GNUNET_RECLAIM_ATTRIBUTE_claim_new ( 468 le->claim = GNUNET_RECLAIM_ATTRIBUTE_claim_new (attr->name,
409 attr->name, attr->type, attr->data, attr->data_size); 469 attr->type,
470 attr->data,
471 attr->data_size);
410 le->claim->version = attr->version; 472 le->claim->version = attr->version;
411 le->claim->id = attr->id; 473 le->claim->id = attr->id;
412 GNUNET_CONTAINER_DLL_insert (attr_list->list_head, attr_list->list_tail, 474 GNUNET_CONTAINER_DLL_insert (attr_list->list_head,
475 attr_list->list_tail,
413 le); 476 le);
414 break; 477 break;
415 } 478 }
416 GNUNET_free (attrs_tmp); 479 GNUNET_free (attrs_tmp);
417 } else if (attr_delete && (NULL == attr_to_delete)) { 480 }
481 else if (attr_delete && (NULL == attr_to_delete))
482 {
418 label = GNUNET_STRINGS_data_to_string_alloc (&attr->id, sizeof (uint64_t)); 483 label = GNUNET_STRINGS_data_to_string_alloc (&attr->id, sizeof (uint64_t));
419 if (0 == strcasecmp (attr_delete, label)) { 484 if (0 == strcasecmp (attr_delete, label))
420 attr_to_delete = GNUNET_RECLAIM_ATTRIBUTE_claim_new ( 485 {
421 attr->name, attr->type, attr->data, attr->data_size); 486 attr_to_delete = GNUNET_RECLAIM_ATTRIBUTE_claim_new (attr->name,
487 attr->type,
488 attr->data,
489 attr->data_size);
422 attr_to_delete->id = attr->id; 490 attr_to_delete->id = attr->id;
423 } 491 }
424 GNUNET_free (label); 492 GNUNET_free (label);
425 } else if (list) { 493 }
426 attr_str = GNUNET_RECLAIM_ATTRIBUTE_value_to_string (attr->type, attr->data, 494 else if (list)
495 {
496 attr_str = GNUNET_RECLAIM_ATTRIBUTE_value_to_string (attr->type,
497 attr->data,
427 attr->data_size); 498 attr->data_size);
428 attr_type = GNUNET_RECLAIM_ATTRIBUTE_number_to_typename (attr->type); 499 attr_type = GNUNET_RECLAIM_ATTRIBUTE_number_to_typename (attr->type);
429 id = GNUNET_STRINGS_data_to_string_alloc (&attr->id, sizeof (uint64_t)); 500 id = GNUNET_STRINGS_data_to_string_alloc (&attr->id, sizeof (uint64_t));
430 fprintf (stdout, "Name: %s; Value: %s (%s); Version %u; ID: %s\n", 501 fprintf (stdout,
431 attr->name, attr_str, attr_type, attr->version, id); 502 "Name: %s; Value: %s (%s); Version %u; ID: %s\n",
503 attr->name,
504 attr_str,
505 attr_type,
506 attr->version,
507 id);
432 GNUNET_free (id); 508 GNUNET_free (id);
433 } 509 }
434 GNUNET_RECLAIM_get_attributes_next (attr_iterator); 510 GNUNET_RECLAIM_get_attributes_next (attr_iterator);
@@ -437,50 +513,69 @@ iter_cb (void *cls, const struct GNUNET_CRYPTO_EcdsaPublicKey *identity,
437static void 513static void
438start_process () 514start_process ()
439{ 515{
440 if (NULL == pkey) { 516 if (NULL == pkey)
517 {
441 fprintf (stderr, "Ego %s not found\n", ego_name); 518 fprintf (stderr, "Ego %s not found\n", ego_name);
442 cleanup_task = GNUNET_SCHEDULER_add_now (&do_cleanup, NULL); 519 cleanup_task = GNUNET_SCHEDULER_add_now (&do_cleanup, NULL);
443 return; 520 return;
444 } 521 }
445 522
446 if (list_tickets) { 523 if (list_tickets)
447 ticket_iterator = GNUNET_RECLAIM_ticket_iteration_start ( 524 {
448 reclaim_handle, pkey, &ticket_iter_err, NULL, &ticket_iter, NULL, 525 ticket_iterator = GNUNET_RECLAIM_ticket_iteration_start (reclaim_handle,
449 &ticket_iter_fin, NULL); 526 pkey,
527 &ticket_iter_err,
528 NULL,
529 &ticket_iter,
530 NULL,
531 &ticket_iter_fin,
532 NULL);
450 return; 533 return;
451 } 534 }
452 535
453 if ((NULL != rp) && 536 if ((NULL != rp) &&
454 GNUNET_OK != GNUNET_CRYPTO_ecdsa_public_key_from_string (rp, strlen (rp), &rp_key)) 537 GNUNET_OK !=
538 GNUNET_CRYPTO_ecdsa_public_key_from_string (rp, strlen (rp), &rp_key))
455 { 539 {
456 fprintf (stderr, "%s is not a public key!\n", rp); 540 fprintf (stderr, "%s is not a public key!\n", rp);
457 cleanup_task = GNUNET_SCHEDULER_add_now (&do_cleanup, NULL); 541 cleanup_task = GNUNET_SCHEDULER_add_now (&do_cleanup, NULL);
458 return; 542 return;
459 } 543 }
460 if (NULL != consume_ticket) 544 if (NULL != consume_ticket)
461 GNUNET_STRINGS_string_to_data (consume_ticket, strlen (consume_ticket), 545 GNUNET_STRINGS_string_to_data (consume_ticket,
546 strlen (consume_ticket),
462 &ticket, 547 &ticket,
463 sizeof (struct GNUNET_RECLAIM_Ticket)); 548 sizeof (struct GNUNET_RECLAIM_Ticket));
464 if (NULL != revoke_ticket) 549 if (NULL != revoke_ticket)
465 GNUNET_STRINGS_string_to_data (revoke_ticket, strlen (revoke_ticket), 550 GNUNET_STRINGS_string_to_data (revoke_ticket,
551 strlen (revoke_ticket),
466 &ticket, 552 &ticket,
467 sizeof (struct GNUNET_RECLAIM_Ticket)); 553 sizeof (struct GNUNET_RECLAIM_Ticket));
468 554
469 attr_list = GNUNET_new (struct GNUNET_RECLAIM_ATTRIBUTE_ClaimList); 555 attr_list = GNUNET_new (struct GNUNET_RECLAIM_ATTRIBUTE_ClaimList);
470 claim = NULL; 556 claim = NULL;
471 attr_iterator = GNUNET_RECLAIM_get_attributes_start ( 557 attr_iterator = GNUNET_RECLAIM_get_attributes_start (reclaim_handle,
472 reclaim_handle, pkey, &iter_error, NULL, &iter_cb, NULL, &iter_finished, 558 pkey,
473 NULL); 559 &iter_error,
560 NULL,
561 &iter_cb,
562 NULL,
563 &iter_finished,
564 NULL);
474} 565}
475 566
476static int init = GNUNET_YES; 567static int init = GNUNET_YES;
477 568
478static void 569static void
479ego_cb (void *cls, struct GNUNET_IDENTITY_Ego *ego, void **ctx, 570ego_cb (void *cls,
571 struct GNUNET_IDENTITY_Ego *ego,
572 void **ctx,
480 const char *name) 573 const char *name)
481{ 574{
482 if (NULL == name) { 575 if (NULL == name)
483 if (GNUNET_YES == init) { 576 {
577 if (GNUNET_YES == init)
578 {
484 init = GNUNET_NO; 579 init = GNUNET_NO;
485 start_process (); 580 start_process ();
486 } 581 }
@@ -493,23 +588,28 @@ ego_cb (void *cls, struct GNUNET_IDENTITY_Ego *ego, void **ctx,
493 588
494 589
495static void 590static void
496run (void *cls, char *const *args, const char *cfgfile, 591run (void *cls,
592 char *const *args,
593 const char *cfgfile,
497 const struct GNUNET_CONFIGURATION_Handle *c) 594 const struct GNUNET_CONFIGURATION_Handle *c)
498{ 595{
499 ret = 0; 596 ret = 0;
500 if (NULL == ego_name) { 597 if (NULL == ego_name)
598 {
501 ret = 1; 599 ret = 1;
502 fprintf (stderr, _ ("Ego is required\n")); 600 fprintf (stderr, _ ("Ego is required\n"));
503 return; 601 return;
504 } 602 }
505 603
506 if ((NULL == attr_value) && (NULL != attr_name)) { 604 if ((NULL == attr_value) && (NULL != attr_name))
605 {
507 ret = 1; 606 ret = 1;
508 fprintf (stderr, _ ("Attribute value missing!\n")); 607 fprintf (stderr, _ ("Attribute value missing!\n"));
509 return; 608 return;
510 } 609 }
511 610
512 if ((NULL == rp) && (NULL != issue_attrs)) { 611 if ((NULL == rp) && (NULL != issue_attrs))
612 {
513 ret = 1; 613 ret = 1;
514 fprintf (stderr, _ ("Requesting party key is required!\n")); 614 fprintf (stderr, _ ("Requesting party key is required!\n"));
515 return; 615 return;
@@ -527,45 +627,77 @@ main (int argc, char *const argv[])
527 exp_interval = GNUNET_TIME_UNIT_HOURS; 627 exp_interval = GNUNET_TIME_UNIT_HOURS;
528 struct GNUNET_GETOPT_CommandLineOption options[] = { 628 struct GNUNET_GETOPT_CommandLineOption options[] = {
529 629
530 GNUNET_GETOPT_option_string ('a', "add", "NAME", 630 GNUNET_GETOPT_option_string ('a',
531 gettext_noop ("Add an attribute NAME"), 631 "add",
532 &attr_name), 632 "NAME",
533 GNUNET_GETOPT_option_string ('d', "delete", "ID", 633 gettext_noop ("Add an attribute NAME"),
534 gettext_noop ("Delete the attribute with ID"), 634 &attr_name),
535 &attr_delete), 635 GNUNET_GETOPT_option_string ('d',
536 GNUNET_GETOPT_option_string ('V', "value", "VALUE", 636 "delete",
537 gettext_noop ("The attribute VALUE"), 637 "ID",
538 &attr_value), 638 gettext_noop ("Delete the attribute with ID"),
539 GNUNET_GETOPT_option_string ('e', "ego", "EGO", 639 &attr_delete),
540 gettext_noop ("The EGO to use"), &ego_name), 640 GNUNET_GETOPT_option_string ('V',
541 GNUNET_GETOPT_option_string ( 641 "value",
542 'r', "rp", "RP", gettext_noop ("Specify the relying party for issue"), 642 "VALUE",
543 &rp), 643 gettext_noop ("The attribute VALUE"),
544 GNUNET_GETOPT_option_flag ( 644 &attr_value),
545 'D', "dump", gettext_noop ("List attributes for EGO"), &list), 645 GNUNET_GETOPT_option_string ('e',
546 GNUNET_GETOPT_option_string ( 646 "ego",
547 'i', "issue", "A1,A2,...", 647 "EGO",
548 gettext_noop ( 648 gettext_noop ("The EGO to use"),
549 "Issue a ticket for a set of attributes separated by comma"), 649 &ego_name),
550 &issue_attrs), 650 GNUNET_GETOPT_option_string ('r',
551 GNUNET_GETOPT_option_string ('C', "consume", "TICKET", 651 "rp",
552 gettext_noop ("Consume a ticket"), 652 "RP",
553 &consume_ticket), 653 gettext_noop (
554 GNUNET_GETOPT_option_string ('R', "revoke", "TICKET", 654 "Specify the relying party for issue"),
555 gettext_noop ("Revoke a ticket"), 655 &rp),
556 &revoke_ticket), 656 GNUNET_GETOPT_option_flag ('D',
557 GNUNET_GETOPT_option_string ( 657 "dump",
558 't', "type", "TYPE", gettext_noop ("Type of attribute"), &type_str), 658 gettext_noop ("List attributes for EGO"),
559 GNUNET_GETOPT_option_flag ( 659 &list),
560 'T', "tickets", gettext_noop ("List tickets of ego"), &list_tickets), 660 GNUNET_GETOPT_option_string (
561 GNUNET_GETOPT_option_relative_time ( 661 'i',
562 'E', "expiration", "INTERVAL", 662 "issue",
563 gettext_noop ("Expiration interval of the attribute"), &exp_interval), 663 "A1,A2,...",
564 664 gettext_noop (
565 GNUNET_GETOPT_OPTION_END}; 665 "Issue a ticket for a set of attributes separated by comma"),
566 if (GNUNET_OK != GNUNET_PROGRAM_run (argc, argv, "gnunet-reclaim", 666 &issue_attrs),
667 GNUNET_GETOPT_option_string ('C',
668 "consume",
669 "TICKET",
670 gettext_noop ("Consume a ticket"),
671 &consume_ticket),
672 GNUNET_GETOPT_option_string ('R',
673 "revoke",
674 "TICKET",
675 gettext_noop ("Revoke a ticket"),
676 &revoke_ticket),
677 GNUNET_GETOPT_option_string ('t',
678 "type",
679 "TYPE",
680 gettext_noop ("Type of attribute"),
681 &type_str),
682 GNUNET_GETOPT_option_flag ('T',
683 "tickets",
684 gettext_noop ("List tickets of ego"),
685 &list_tickets),
686 GNUNET_GETOPT_option_relative_time ('E',
687 "expiration",
688 "INTERVAL",
689 gettext_noop (
690 "Expiration interval of the attribute"),
691 &exp_interval),
692
693 GNUNET_GETOPT_OPTION_END};
694 if (GNUNET_OK != GNUNET_PROGRAM_run (argc,
695 argv,
696 "gnunet-reclaim",
567 _ ("re:claimID command line tool"), 697 _ ("re:claimID command line tool"),
568 options, &run, NULL)) 698 options,
699 &run,
700 NULL))
569 return 1; 701 return 1;
570 else 702 else
571 return ret; 703 return ret;