*/
json_t *
GNUNET_JSON_from_gns_record (const char* rname,
- const struct GNUNET_GNSRECORD_Data *rd)
+ const struct GNUNET_GNSRECORD_Data *rd)
{
struct GNUNET_TIME_Absolute expiration_time;
const char *expiration_time_str;
*/
#include "platform.h"
#include "gnunet_util_lib.h"
-#include "gnunet_gnsrecord_lib.h"
#include "gnunet_json_lib.h"
#define GNUNET_JSON_GNSRECORD_VALUE "value"
}
else
{
- GNUNET_log(GNUNET_ERROR_TYPE_DEBUG, "Value invalid for expiration time");
+ GNUNET_log(GNUNET_ERROR_TYPE_DEBUG, "Expiration time invalid");
+ return GNUNET_SYSERR;
+ }
+ // check if flag is a valid enum value
+ if ((GNUNET_GNSRECORD_RF_NONE != flag)
+ && (GNUNET_GNSRECORD_RF_PRIVATE != flag)
+ && (GNUNET_GNSRECORD_RF_RELATIVE_EXPIRATION != flag)
+ && (GNUNET_GNSRECORD_RF_SHADOW_RECORD) != flag)
+ {
+ GNUNET_log(GNUNET_ERROR_TYPE_DEBUG, "Flag invalid");
return GNUNET_SYSERR;
}
gnsrecord_object->flags = (enum GNUNET_GNSRECORD_Flags)flag;
#include "microhttpd.h"
#include <jansson.h>
+
#define GNUNET_REST_API_NS_NAMESTORE "/namestore"
#define GNUNET_REST_SUBSYSTEM_NAMESTORE "namestore"
#define GNUNET_REST_NAMESTORE_RD_COUNT 1
-//TODO define other variables
-
/**
* The configuration handle
*/
const struct GNUNET_CONFIGURATION_Handle *cfg;
};
-//TODO add specific structs
-
/**
* The default namestore ego
*/
struct RequestHandle
{
- //TODO add specific entries
-
/**
* Records to store
*/
};
-
-//TODO add specific cleanup
/**
* Cleanup lookup handle
* @param handle Handle to clean up
static void
init_cont (struct RequestHandle *handle)
{
- //TODO specify parameter of init_cont if necessary
struct GNUNET_REST_RequestHandlerError err;
static const struct GNUNET_REST_RequestHandler handlers[] = {
{MHD_HTTP_METHOD_GET, GNUNET_REST_API_NS_NAMESTORE, &namestore_get},