const struct GNUNET_GNSRECORD_Data *rd);
-/**
- * Set the desired nick name for a zone
- *
- * @param h handle to the namestore
- * @param pkey private key of the zone
- * @param nick the nick name to set
- * @param cont continuation to call when done
- * @param cont_cls closure for @a cont
- * @return handle to abort the request
- */
-struct GNUNET_NAMESTORE_QueueEntry *
-GNUNET_NAMESTORE_set_nick (struct GNUNET_NAMESTORE_Handle *h,
- const struct GNUNET_CRYPTO_EcdsaPrivateKey *pkey,
- const char *nick,
- GNUNET_NAMESTORE_ContinuationWithStatus cont,
- void *cont_cls);
-
-
/**
* Lookup an item in the namestore.
*
GNUNET_free (rd);
return;
}
+ if (NULL != nickstring)
+ {
+ if (0 == strlen (nickstring))
+ {
+ fprintf (stderr, _ ("Invalid nick `%s'\n"), nickstring);
+ GNUNET_SCHEDULER_shutdown ();
+ ret = 1;
+ return;
+ }
+ add = 1;
+ typestring = GNUNET_strdup (GNUNET_GNSRECORD_number_to_typename (GNUNET_GNSRECORD_TYPE_NICK));
+ name = GNUNET_strdup (GNUNET_GNS_EMPTY_LABEL_AT);
+ value = GNUNET_strdup (nickstring);
+ is_public = 0;
+ expirationstring = GNUNET_strdup ("never");
+ GNUNET_free (nickstring);
+ nickstring = NULL;
+ }
if (add)
{
&add_continuation,
&add_qe_uri);
}
- if (NULL != nickstring)
- {
- if (0 == strlen (nickstring))
- {
- fprintf (stderr, _ ("Invalid nick `%s'\n"), nickstring);
- GNUNET_SCHEDULER_shutdown ();
- ret = 1;
- return;
- }
- add_qe_uri = GNUNET_NAMESTORE_set_nick (ns,
- &zone_pkey,
- nickstring,
- &add_continuation,
- &add_qe_uri);
- }
if (monitor)
{
zm = GNUNET_NAMESTORE_zone_monitor_start (cfg,
}
-/**
- * Set the desired nick name for a zone
- *
- * @param h handle to the namestore
- * @param pkey private key of the zone
- * @param nick the nick name to set
- * @param cont continuation to call when done
- * @param cont_cls closure for @a cont
- * @return handle to abort the request
- */
-struct GNUNET_NAMESTORE_QueueEntry *
-GNUNET_NAMESTORE_set_nick (struct GNUNET_NAMESTORE_Handle *h,
- const struct GNUNET_CRYPTO_EcdsaPrivateKey *pkey,
- const char *nick,
- GNUNET_NAMESTORE_ContinuationWithStatus cont,
- void *cont_cls)
-{
- struct GNUNET_GNSRECORD_Data rd;
-
- if (NULL == h->mq)
- return NULL;
- memset (&rd, 0, sizeof(rd));
- rd.data = nick;
- rd.data_size = strlen (nick) + 1;
- rd.record_type = GNUNET_GNSRECORD_TYPE_NICK;
- rd.expiration_time = GNUNET_TIME_UNIT_FOREVER_ABS.abs_value_us;
- rd.flags |= GNUNET_GNSRECORD_RF_PRIVATE;
- return GNUNET_NAMESTORE_records_store (h,
- pkey,
- GNUNET_GNS_EMPTY_LABEL_AT,
- 1,
- &rd,
- cont,
- cont_cls);
-}
-
-
/**
* Lookup an item in the namestore.
*
*/
#include "platform.h"
#include "gnunet_namestore_service.h"
+#include "gnunet_gns_service.h"
#include "gnunet_testing_lib.h"
#include "gnunet_dnsparser_lib.h"
const struct GNUNET_CONFIGURATION_Handle *cfg,
struct GNUNET_TESTING_Peer *peer)
{
+ struct GNUNET_GNSRECORD_Data rd;
+
endbadly_task = GNUNET_SCHEDULER_add_delayed (TIMEOUT,
&endbadly,
NULL);
nsh = GNUNET_NAMESTORE_connect (cfg);
GNUNET_break (NULL != nsh);
- nsqe = GNUNET_NAMESTORE_set_nick (nsh,
- &privkey,
- TEST_NICK,
- &nick_cont,
- (void *) name);
+ memset (&rd, 0, sizeof(rd));
+ rd.data = TEST_NICK;
+ rd.data_size = strlen (TEST_NICK) + 1;
+ rd.record_type = GNUNET_GNSRECORD_TYPE_NICK;
+ rd.expiration_time = GNUNET_TIME_UNIT_FOREVER_ABS.abs_value_us;
+ rd.flags |= GNUNET_GNSRECORD_RF_PRIVATE;
+ nsqe = GNUNET_NAMESTORE_records_store (nsh,
+ &privkey,
+ GNUNET_GNS_EMPTY_LABEL_AT,
+ 1,
+ &rd,
+ &nick_cont,
+ (void *) name);
+
if (NULL == nsqe)
{
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
*/
#include "platform.h"
#include "gnunet_namestore_service.h"
+#include "gnunet_gns_service.h"
#include "gnunet_testing_lib.h"
#include "namestore.h"
#include "gnunet_dnsparser_lib.h"
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
"Nick 1 added : %s\n",
(success == GNUNET_OK) ? "SUCCESS" : "FAIL");
+ struct GNUNET_GNSRECORD_Data rd;
+
+ memset (&rd, 0, sizeof(rd));
+ rd.data = ZONE_NICK_2;
+ rd.data_size = strlen (ZONE_NICK_2) + 1;
+ rd.record_type = GNUNET_GNSRECORD_TYPE_NICK;
+ rd.expiration_time = GNUNET_TIME_UNIT_FOREVER_ABS.abs_value_us;
+ rd.flags |= GNUNET_GNSRECORD_RF_PRIVATE;
+ nsqe = GNUNET_NAMESTORE_records_store (nsh,
+ &privkey2,
+ GNUNET_GNS_EMPTY_LABEL_AT,
+ 1,
+ &rd,
+ &nick_2_cont,
+ &privkey2);
- nsqe = GNUNET_NAMESTORE_set_nick (nsh,
- &privkey2, ZONE_NICK_2, &nick_2_cont,
- &privkey2);
if (NULL == nsqe)
{
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
empty_zone_end (void *cls)
{
GNUNET_assert (nsh == cls);
+ struct GNUNET_GNSRECORD_Data rd;
+
zi = NULL;
GNUNET_CRYPTO_ecdsa_key_create (&privkey);
GNUNET_CRYPTO_ecdsa_key_create (&privkey2);
- nsqe = GNUNET_NAMESTORE_set_nick (nsh,
- &privkey,
- ZONE_NICK_1,
- &nick_1_cont,
- NULL);
+
+ memset (&rd, 0, sizeof(rd));
+ rd.data = ZONE_NICK_1;
+ rd.data_size = strlen (ZONE_NICK_1) + 1;
+ rd.record_type = GNUNET_GNSRECORD_TYPE_NICK;
+ rd.expiration_time = GNUNET_TIME_UNIT_FOREVER_ABS.abs_value_us;
+ rd.flags |= GNUNET_GNSRECORD_RF_PRIVATE;
+ nsqe = GNUNET_NAMESTORE_records_store (nsh,
+ &privkey,
+ GNUNET_GNS_EMPTY_LABEL_AT,
+ 1,
+ &rd,
+ &nick_1_cont,
+ NULL);
if (NULL == nsqe)
{
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,