&plugin->select_membership);
sql_prepare (plugin->dbh,
- "INSERT INTO messages\n"
+ "INSERT OR IGNORE INTO messages\n"
" (channel_id, hop_counter, signature, purpose,\n"
" fragment_id, fragment_offset, message_id,\n"
" group_generation, multicast_flags, psycstore_flags, data)\n"
GNUNET_free_non_null (plugin->fn);
}
-/**
+/**
* Execute a prepared statement with a @a channel_key argument.
*
* @param plugin Plugin handle.
* @param stmt Statement to execute.
* @param channel_key Public key of the channel.
- *
+ *
* @return #GNUNET_OK on success, else #GNUNET_SYSERR
*/
static int
exec_channel (struct Plugin *plugin, sqlite3_stmt *stmt,
- const struct GNUNET_CRYPTO_EccPublicSignKey *channel_key)
+ const struct GNUNET_CRYPTO_EddsaPublicKey *channel_key)
{
if (SQLITE_OK != sqlite3_bind_blob (stmt, 1, channel_key,
sizeof (*channel_key), SQLITE_STATIC))
static int
channel_key_store (struct Plugin *plugin,
- const struct GNUNET_CRYPTO_EccPublicSignKey *channel_key)
+ const struct GNUNET_CRYPTO_EddsaPublicKey *channel_key)
{
sqlite3_stmt *stmt = plugin->insert_channel_key;
static int
slave_key_store (struct Plugin *plugin,
- const struct GNUNET_CRYPTO_EccPublicSignKey *slave_key)
+ const struct GNUNET_CRYPTO_EddsaPublicKey *slave_key)
{
sqlite3_stmt *stmt = plugin->insert_slave_key;
}
-/**
+/**
* Store join/leave events for a PSYC channel in order to be able to answer
* membership test queries later.
*
*/
static int
membership_store (void *cls,
- const struct GNUNET_CRYPTO_EccPublicSignKey *channel_key,
- const struct GNUNET_CRYPTO_EccPublicSignKey *slave_key,
+ const struct GNUNET_CRYPTO_EddsaPublicKey *channel_key,
+ const struct GNUNET_CRYPTO_EddsaPublicKey *slave_key,
int did_join,
uint64_t announced_at,
uint64_t effective_since,
return GNUNET_OK;
}
-/**
+/**
* Test if a member was admitted to the channel at the given message ID.
*
* @see GNUNET_PSYCSTORE_membership_test()
- *
+ *
* @return #GNUNET_YES if the member was admitted, #GNUNET_NO if not,
* #GNUNET_SYSERR if there was en error.
*/
static int
membership_test (void *cls,
- const struct GNUNET_CRYPTO_EccPublicSignKey *channel_key,
- const struct GNUNET_CRYPTO_EccPublicSignKey *slave_key,
+ const struct GNUNET_CRYPTO_EddsaPublicKey *channel_key,
+ const struct GNUNET_CRYPTO_EddsaPublicKey *slave_key,
uint64_t message_id)
{
struct Plugin *plugin = cls;
return ret;
}
-/**
+/**
* Store a message fragment sent to a channel.
*
* @see GNUNET_PSYCSTORE_fragment_store()
- *
+ *
* @return #GNUNET_OK on success, else #GNUNET_SYSERR
*/
static int
fragment_store (void *cls,
- const struct GNUNET_CRYPTO_EccPublicSignKey *channel_key,
+ const struct GNUNET_CRYPTO_EddsaPublicKey *channel_key,
const struct GNUNET_MULTICAST_MessageHeader *msg,
uint32_t psycstore_flags)
{
return GNUNET_OK;
}
-/**
+/**
* Set additional flags for a given message.
*
* They are OR'd with any existing flags set.
- *
+ *
* @return #GNUNET_OK on success, else #GNUNET_SYSERR
*/
static int
message_add_flags (void *cls,
- const struct GNUNET_CRYPTO_EccPublicSignKey *channel_key,
+ const struct GNUNET_CRYPTO_EddsaPublicKey *channel_key,
uint64_t message_id,
uint64_t psycstore_flags)
{
return cb (cb_cls, (void *) msg, sqlite3_column_int64 (stmt, 8));
}
-/**
+/**
* Retrieve a message fragment by fragment ID.
*
* @see GNUNET_PSYCSTORE_fragment_get()
- *
+ *
* @return #GNUNET_OK on success, else #GNUNET_SYSERR
*/
static int
fragment_get (void *cls,
- const struct GNUNET_CRYPTO_EccPublicSignKey *channel_key,
+ const struct GNUNET_CRYPTO_EddsaPublicKey *channel_key,
uint64_t fragment_id,
GNUNET_PSYCSTORE_FragmentCallback cb,
void *cb_cls)
return ret;
}
-/**
+/**
* Retrieve all fragments of a message.
*
* @see GNUNET_PSYCSTORE_message_get()
- *
+ *
* @return #GNUNET_OK on success, else #GNUNET_SYSERR
*/
static int
message_get (void *cls,
- const struct GNUNET_CRYPTO_EccPublicSignKey *channel_key,
+ const struct GNUNET_CRYPTO_EddsaPublicKey *channel_key,
uint64_t message_id,
uint64_t *returned_fragments,
GNUNET_PSYCSTORE_FragmentCallback cb,
return ret;
}
-/**
+/**
* Retrieve a fragment of message specified by its message ID and fragment
* offset.
*
* @see GNUNET_PSYCSTORE_message_get_fragment()
- *
+ *
* @return #GNUNET_OK on success, else #GNUNET_SYSERR
*/
static int
message_get_fragment (void *cls,
- const struct GNUNET_CRYPTO_EccPublicSignKey *channel_key,
+ const struct GNUNET_CRYPTO_EddsaPublicKey *channel_key,
uint64_t message_id,
uint64_t fragment_offset,
GNUNET_PSYCSTORE_FragmentCallback cb,
return ret;
}
-/**
+/**
* Retrieve the max. values of message counters for a channel.
*
* @see GNUNET_PSYCSTORE_counters_get()
- *
+ *
* @return #GNUNET_OK on success, else #GNUNET_SYSERR
*/
static int
counters_message_get (void *cls,
- const struct GNUNET_CRYPTO_EccPublicSignKey *channel_key,
+ const struct GNUNET_CRYPTO_EddsaPublicKey *channel_key,
uint64_t *max_fragment_id,
uint64_t *max_message_id,
uint64_t *max_group_generation)
return ret;
}
-/**
+/**
* Retrieve the max. values of state counters for a channel.
*
* @see GNUNET_PSYCSTORE_counters_get()
- *
+ *
* @return #GNUNET_OK on success, else #GNUNET_SYSERR
*/
static int
counters_state_get (void *cls,
- const struct GNUNET_CRYPTO_EccPublicSignKey *channel_key,
+ const struct GNUNET_CRYPTO_EddsaPublicKey *channel_key,
uint64_t *max_state_message_id)
{
struct Plugin *plugin = cls;
}
-/**
+/**
* Set a state variable to the given value.
- *
+ *
* @return #GNUNET_OK on success, else #GNUNET_SYSERR
*/
static int
state_set (struct Plugin *plugin, sqlite3_stmt *stmt,
- const struct GNUNET_CRYPTO_EccPublicSignKey *channel_key,
+ const struct GNUNET_CRYPTO_EddsaPublicKey *channel_key,
const char *name, const void *value, size_t value_size)
{
int ret = GNUNET_SYSERR;
static int
update_message_id (struct Plugin *plugin, sqlite3_stmt *stmt,
- const struct GNUNET_CRYPTO_EccPublicSignKey *channel_key,
+ const struct GNUNET_CRYPTO_EddsaPublicKey *channel_key,
uint64_t message_id)
{
if (SQLITE_OK != sqlite3_bind_int64 (stmt, 1, message_id)
*/
static int
state_modify_begin (void *cls,
- const struct GNUNET_CRYPTO_EccPublicSignKey *channel_key,
+ const struct GNUNET_CRYPTO_EddsaPublicKey *channel_key,
uint64_t message_id, uint64_t state_delta)
{
struct Plugin *plugin = cls;
}
-/**
+/**
* Set the current value of state variable.
*
* @see GNUNET_PSYCSTORE_state_modify()
- *
+ *
* @return #GNUNET_OK on success, else #GNUNET_SYSERR
*/
static int
state_modify_set (void *cls,
- const struct GNUNET_CRYPTO_EccPublicSignKey *channel_key,
+ const struct GNUNET_CRYPTO_EddsaPublicKey *channel_key,
const char *name, const void *value, size_t value_size)
{
struct Plugin *plugin = cls;
*/
static int
state_modify_end (void *cls,
- const struct GNUNET_CRYPTO_EccPublicSignKey *channel_key,
+ const struct GNUNET_CRYPTO_EddsaPublicKey *channel_key,
uint64_t message_id)
{
struct Plugin *plugin = cls;
*/
static int
state_sync_begin (void *cls,
- const struct GNUNET_CRYPTO_EccPublicSignKey *channel_key)
+ const struct GNUNET_CRYPTO_EddsaPublicKey *channel_key)
{
struct Plugin *plugin = cls;
return exec_channel (plugin, plugin->delete_state_sync, channel_key);
}
-/**
+/**
* Set the current value of state variable.
*
* @see GNUNET_PSYCSTORE_state_modify()
- *
+ *
* @return #GNUNET_OK on success, else #GNUNET_SYSERR
*/
static int
state_sync_set (void *cls,
- const struct GNUNET_CRYPTO_EccPublicSignKey *channel_key,
+ const struct GNUNET_CRYPTO_EddsaPublicKey *channel_key,
const char *name, const void *value, size_t value_size)
{
struct Plugin *plugin = cls;
*/
static int
state_sync_end (void *cls,
- const struct GNUNET_CRYPTO_EccPublicSignKey *channel_key,
+ const struct GNUNET_CRYPTO_EddsaPublicKey *channel_key,
uint64_t message_id)
{
struct Plugin *plugin = cls;
}
-/**
+/**
* Reset the state of a channel.
*
* @see GNUNET_PSYCSTORE_state_reset()
- *
+ *
* @return #GNUNET_OK on success, else #GNUNET_SYSERR
*/
static int
-state_reset (void *cls, const struct GNUNET_CRYPTO_EccPublicSignKey *channel_key)
+state_reset (void *cls, const struct GNUNET_CRYPTO_EddsaPublicKey *channel_key)
{
struct Plugin *plugin = cls;
return exec_channel (plugin, plugin->delete_state, channel_key);
}
-/**
+/**
* Update signed values of state variables in the state store.
*
* @see GNUNET_PSYCSTORE_state_hash_update()
- *
+ *
* @return #GNUNET_OK on success, else #GNUNET_SYSERR
*/
static int
state_update_signed (void *cls,
- const struct GNUNET_CRYPTO_EccPublicSignKey *channel_key)
+ const struct GNUNET_CRYPTO_EddsaPublicKey *channel_key)
{
struct Plugin *plugin = cls;
return exec_channel (plugin, plugin->update_state_signed, channel_key);
}
-/**
+/**
* Retrieve a state variable by name.
*
* @see GNUNET_PSYCSTORE_state_get()
- *
+ *
* @return #GNUNET_OK on success, else #GNUNET_SYSERR
*/
static int
-state_get (void *cls, const struct GNUNET_CRYPTO_EccPublicSignKey *channel_key,
+state_get (void *cls, const struct GNUNET_CRYPTO_EddsaPublicKey *channel_key,
const char *name, GNUNET_PSYCSTORE_StateCallback cb, void *cb_cls)
{
struct Plugin *plugin = cls;
}
-/**
+/**
* Retrieve all state variables for a channel with the given prefix.
*
* @see GNUNET_PSYCSTORE_state_get_prefix()
- *
+ *
* @return #GNUNET_OK on success, else #GNUNET_SYSERR
*/
static int
-state_get_prefix (void *cls, const struct GNUNET_CRYPTO_EccPublicSignKey *channel_key,
+state_get_prefix (void *cls, const struct GNUNET_CRYPTO_EddsaPublicKey *channel_key,
const char *name, GNUNET_PSYCSTORE_StateCallback cb,
void *cb_cls)
{
}
-/**
+/**
* Retrieve all signed state variables for a channel.
*
* @see GNUNET_PSYCSTORE_state_get_signed()
- *
+ *
* @return #GNUNET_OK on success, else #GNUNET_SYSERR
*/
static int
state_get_signed (void *cls,
- const struct GNUNET_CRYPTO_EccPublicSignKey *channel_key,
+ const struct GNUNET_CRYPTO_EddsaPublicKey *channel_key,
GNUNET_PSYCSTORE_StateCallback cb, void *cb_cls)
{
struct Plugin *plugin = cls;
}
-/**
+/**
* Entry point for the plugin.
*
* @param cls The struct GNUNET_CONFIGURATION_Handle.