aboutsummaryrefslogtreecommitdiff
path: root/src/namestore
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2014-04-18 12:20:18 +0000
committerChristian Grothoff <christian@grothoff.org>2014-04-18 12:20:18 +0000
commit678b787845fa0b1f20b360027d0bbbc11c3fed98 (patch)
treeaf8595da03b54b705db2c52a111d5a4bb9d3547a /src/namestore
parent214ff64d6c40131b273532bf8cff154faf669cff (diff)
downloadgnunet-678b787845fa0b1f20b360027d0bbbc11c3fed98.tar.gz
gnunet-678b787845fa0b1f20b360027d0bbbc11c3fed98.zip
hack namestore pending capability
Diffstat (limited to 'src/namestore')
-rw-r--r--src/namestore/gnunet-namestore.c31
1 files changed, 21 insertions, 10 deletions
diff --git a/src/namestore/gnunet-namestore.c b/src/namestore/gnunet-namestore.c
index ec6ccbfbe..8dc35984e 100644
--- a/src/namestore/gnunet-namestore.c
+++ b/src/namestore/gnunet-namestore.c
@@ -1,6 +1,6 @@
1/* 1/*
2 This file is part of GNUnet. 2 This file is part of GNUnet.
3 (C) 2012, 2013 Christian Grothoff (and other contributing authors) 3 (C) 2012, 2013, 2014 Christian Grothoff (and other contributing authors)
4 4
5 GNUnet is free software; you can redistribute it and/or modify 5 GNUnet is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published 6 it under the terms of the GNU General Public License as published
@@ -102,12 +102,17 @@ static int del;
102/** 102/**
103 * Is record public (opposite of #GNUNET_GNSRECORD_RF_PRIVATE) 103 * Is record public (opposite of #GNUNET_GNSRECORD_RF_PRIVATE)
104 */ 104 */
105static int public; 105static int is_public;
106 106
107/** 107/**
108 * Is record a shadow record (#GNUNET_GNSRECORD_RF_SHADOW_RECORD) 108 * Is record a shadow record (#GNUNET_GNSRECORD_RF_SHADOW_RECORD)
109 */ 109 */
110static int shadow; 110static int is_shadow;
111
112/**
113 * Is record pending approval (#GNUNET_GNSRECORD_RF_PENDING)
114 */
115static int is_pending;
111 116
112/** 117/**
113 * Queue entry for the 'del' operation. 118 * Queue entry for the 'del' operation.
@@ -475,10 +480,12 @@ get_existing_record (void *cls,
475 rde->data = data; 480 rde->data = data;
476 rde->data_size = data_size; 481 rde->data_size = data_size;
477 rde->record_type = type; 482 rde->record_type = type;
478 if (1 == shadow) 483 if (1 == is_shadow)
479 rde->flags |= GNUNET_GNSRECORD_RF_SHADOW_RECORD; 484 rde->flags |= GNUNET_GNSRECORD_RF_SHADOW_RECORD;
480 if (1 != public) 485 if (1 != is_public)
481 rde->flags |= GNUNET_GNSRECORD_RF_PRIVATE; 486 rde->flags |= GNUNET_GNSRECORD_RF_PRIVATE;
487 if (1 == is_pending)
488 rde->flags |= GNUNET_GNSRECORD_RF_PENDING;
482 if (GNUNET_YES == etime_is_rel) 489 if (GNUNET_YES == etime_is_rel)
483 { 490 {
484 rde->expiration_time = etime_rel.rel_value_us; 491 rde->expiration_time = etime_rel.rel_value_us;
@@ -732,7 +739,7 @@ testservice_task (void *cls,
732 else 739 else
733 rd.expiration_time = GNUNET_TIME_UNIT_FOREVER_ABS.abs_value_us; 740 rd.expiration_time = GNUNET_TIME_UNIT_FOREVER_ABS.abs_value_us;
734 741
735 if (1 == shadow) 742 if (1 == is_shadow)
736 rd.flags |= GNUNET_GNSRECORD_RF_SHADOW_RECORD; 743 rd.flags |= GNUNET_GNSRECORD_RF_SHADOW_RECORD;
737 add_qe_uri = GNUNET_NAMESTORE_records_store (ns, 744 add_qe_uri = GNUNET_NAMESTORE_records_store (ns,
738 &zone_pkey, 745 &zone_pkey,
@@ -905,8 +912,9 @@ run (void *cls, char *const *args, const char *cfgfile,
905int 912int
906main (int argc, char *const *argv) 913main (int argc, char *const *argv)
907{ 914{
908 public = -1; 915 is_public = -1;
909 shadow = -1; 916 is_pending = -1;
917 is_shadow = -1;
910 918
911 static const struct GNUNET_GETOPT_CommandLineOption options[] = { 919 static const struct GNUNET_GETOPT_CommandLineOption options[] = {
912 {'a', "add", NULL, 920 {'a', "add", NULL,
@@ -944,10 +952,13 @@ main (int argc, char *const *argv)
944 &GNUNET_GETOPT_set_string, &value}, 952 &GNUNET_GETOPT_set_string, &value},
945 {'p', "public", NULL, 953 {'p', "public", NULL,
946 gettext_noop ("create or list public record"), 0, 954 gettext_noop ("create or list public record"), 0,
947 &GNUNET_GETOPT_set_one, &public}, 955 &GNUNET_GETOPT_set_one, &is_public},
956 {'P', "pending", NULL,
957 gettext_noop ("create record that is pending approval (and thus for now inactive)"), 0,
958 &GNUNET_GETOPT_set_one, &is_pending},
948 {'s', "shadow", NULL, 959 {'s', "shadow", NULL,
949 gettext_noop ("create shadow record (only valid if all other records of the same type have expired"), 0, 960 gettext_noop ("create shadow record (only valid if all other records of the same type have expired"), 0,
950 &GNUNET_GETOPT_set_one, &shadow}, 961 &GNUNET_GETOPT_set_one, &is_shadow},
951 {'z', "zone", "EGO", 962 {'z', "zone", "EGO",
952 gettext_noop ("name of the ego controlling the zone"), 1, 963 gettext_noop ("name of the ego controlling the zone"), 1,
953 &GNUNET_GETOPT_set_string, &ego_name}, 964 &GNUNET_GETOPT_set_string, &ego_name},