diff options
author | Matthias Wachs <wachs@net.in.tum.de> | 2013-11-13 15:04:21 +0000 |
---|---|---|
committer | Matthias Wachs <wachs@net.in.tum.de> | 2013-11-13 15:04:21 +0000 |
commit | 97f8a1ba8d1d43025ae43ab33bca12efbd49f355 (patch) | |
tree | 406396c6cd263e9cac02f60a9b80663f66bb374c /src/namestore/namestore_api.c | |
parent | be479981b97e8eeeb4ac251bb413a08b425a0fdd (diff) | |
download | gnunet-97f8a1ba8d1d43025ae43ab33bca12efbd49f355.tar.gz gnunet-97f8a1ba8d1d43025ae43ab33bca12efbd49f355.zip |
adding pseudonym NICK automatically to records sets
Diffstat (limited to 'src/namestore/namestore_api.c')
-rw-r--r-- | src/namestore/namestore_api.c | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/src/namestore/namestore_api.c b/src/namestore/namestore_api.c index c05386908..034352bd9 100644 --- a/src/namestore/namestore_api.c +++ b/src/namestore/namestore_api.c | |||
@@ -33,6 +33,7 @@ | |||
33 | #include "gnunet_dnsparser_lib.h" | 33 | #include "gnunet_dnsparser_lib.h" |
34 | #include "gnunet_arm_service.h" | 34 | #include "gnunet_arm_service.h" |
35 | #include "gnunet_signatures.h" | 35 | #include "gnunet_signatures.h" |
36 | #include "gnunet_gns_service.h" | ||
36 | #include "gnunet_namestore_service.h" | 37 | #include "gnunet_namestore_service.h" |
37 | #include "namestore.h" | 38 | #include "namestore.h" |
38 | 39 | ||
@@ -1065,6 +1066,34 @@ GNUNET_NAMESTORE_records_store (struct GNUNET_NAMESTORE_Handle *h, | |||
1065 | return qe; | 1066 | return qe; |
1066 | } | 1067 | } |
1067 | 1068 | ||
1069 | /** | ||
1070 | * Set the desired nick name for a zone | ||
1071 | * | ||
1072 | * @param h handle to the namestore | ||
1073 | * @param pkey private key of the zone | ||
1074 | * @param nick the nick name to set | ||
1075 | * @param cont continuation to call when done | ||
1076 | * @param cont_cls closure for 'cont' | ||
1077 | * @return handle to abort the request | ||
1078 | */ | ||
1079 | struct GNUNET_NAMESTORE_QueueEntry * | ||
1080 | GNUNET_NAMESTORE_set_nick (struct GNUNET_NAMESTORE_Handle *h, | ||
1081 | const struct GNUNET_CRYPTO_EcdsaPrivateKey *pkey, | ||
1082 | const char *nick, | ||
1083 | GNUNET_NAMESTORE_ContinuationWithStatus cont, | ||
1084 | void *cont_cls) | ||
1085 | { | ||
1086 | struct GNUNET_GNSRECORD_Data rd; | ||
1087 | |||
1088 | memset (&rd, 0, sizeof (rd)); | ||
1089 | rd.data = nick; | ||
1090 | rd.data_size = strlen (nick) +1; | ||
1091 | rd.record_type = GNUNET_GNSRECORD_TYPE_NICK; | ||
1092 | rd.expiration_time = GNUNET_TIME_UNIT_FOREVER_ABS.abs_value_us; | ||
1093 | rd.flags |= GNUNET_GNSRECORD_RF_PRIVATE; | ||
1094 | return GNUNET_NAMESTORE_records_store(h, pkey, GNUNET_GNS_MASTERZONE_STR, 1, &rd, cont, cont_cls); | ||
1095 | } | ||
1096 | |||
1068 | 1097 | ||
1069 | /** | 1098 | /** |
1070 | * Lookup an item in the namestore. | 1099 | * Lookup an item in the namestore. |