#include "gnunet-service-messenger_member_session.h"
#include "gnunet-service-messenger_room.h"
#include "gnunet-service-messenger_message_store.h"
#include "messenger_api_contact_store.h"
Go to the source code of this file.
Data Structures | |
struct | GNUNET_MESSENGER_MemberSessionHistoryEntry |
Functions | |
struct GNUNET_MESSENGER_MemberSession * | create_member_session (struct GNUNET_MESSENGER_Member *member, const struct GNUNET_CRYPTO_PublicKey *pubkey) |
Creates and allocates a new member session of a member with a given public key. More... | |
static void | check_member_session_completion (struct GNUNET_MESSENGER_MemberSession *session) |
static enum GNUNET_GenericReturnValue | iterate_copy_history (void *cls, const struct GNUNET_HashCode *key, void *value) |
struct GNUNET_MESSENGER_MemberSession * | switch_member_session (struct GNUNET_MESSENGER_MemberSession *session, const struct GNUNET_MESSENGER_Message *message, const struct GNUNET_HashCode *hash) |
Creates and allocates a new member session closing and replacing a given other session of the same member. More... | |
void | destroy_member_session (struct GNUNET_MESSENGER_MemberSession *session) |
Destroys a member session and frees its memory fully. More... | |
enum GNUNET_GenericReturnValue | reset_member_session (struct GNUNET_MESSENGER_MemberSession *session, const struct GNUNET_HashCode *hash) |
Resets a given member session which re-opens a member session for new usage. More... | |
void | close_member_session (struct GNUNET_MESSENGER_MemberSession *session) |
Closes a given member session which opens the request for completion of the given member session. More... | |
enum GNUNET_GenericReturnValue | is_member_session_closed (const struct GNUNET_MESSENGER_MemberSession *session) |
Returns if the given member session has been closed. More... | |
enum GNUNET_GenericReturnValue | is_member_session_completed (const struct GNUNET_MESSENGER_MemberSession *session) |
Returns if the given member session has been completed. More... | |
struct GNUNET_TIME_Absolute | get_member_session_start (const struct GNUNET_MESSENGER_MemberSession *session) |
Returns the timestamp of the member session's start. More... | |
const struct GNUNET_HashCode * | get_member_session_key (const struct GNUNET_MESSENGER_MemberSession *session) |
Returns the key of the room a given member session belongs to. More... | |
const struct GNUNET_ShortHashCode * | get_member_session_id (const struct GNUNET_MESSENGER_MemberSession *session) |
Returns the member id of a given member session. More... | |
const struct GNUNET_CRYPTO_PublicKey * | get_member_session_public_key (const struct GNUNET_MESSENGER_MemberSession *session) |
Returns the public key of a given member session. More... | |
const struct GNUNET_HashCode * | get_member_session_context (const struct GNUNET_MESSENGER_MemberSession *session) |
Returns the member context of a given member session. More... | |
struct GNUNET_MESSENGER_Contact * | get_member_session_contact (struct GNUNET_MESSENGER_MemberSession *session) |
Returns the contact which is connected to a given member session. More... | |
enum GNUNET_GenericReturnValue | verify_member_session_as_sender (const struct GNUNET_MESSENGER_MemberSession *session, const struct GNUNET_MESSENGER_Message *message, const struct GNUNET_HashCode *hash) |
Verifies a given member session as sender of a selected message and its hash. More... | |
enum GNUNET_GenericReturnValue | check_member_session_history (const struct GNUNET_MESSENGER_MemberSession *session, const struct GNUNET_HashCode *hash, enum GNUNET_GenericReturnValue ownership) |
Checks the history of a session for a specific message which is identified by its hash and if the ownership flag is set, if the message is owned by the sessions contact. More... | |
static void | update_member_chain_history (struct GNUNET_MESSENGER_MemberSession *session, const struct GNUNET_HashCode *hash, enum GNUNET_GenericReturnValue ownership) |
void | update_member_session_history (struct GNUNET_MESSENGER_MemberSession *session, const struct GNUNET_MESSENGER_Message *message, const struct GNUNET_HashCode *hash) |
Adds a given message to the history of a session using the messages hash. More... | |
static void | clear_member_chain_history (struct GNUNET_MESSENGER_MemberSession *session, const struct GNUNET_HashCode *hash) |
void | clear_member_session_history (struct GNUNET_MESSENGER_MemberSession *session, const struct GNUNET_HashCode *hash) |
Removes a message from the history of a session using the messages hash. More... | |
static void | load_member_session_history (struct GNUNET_MESSENGER_MemberSession *session, const char *path) |
void | load_member_session (struct GNUNET_MESSENGER_Member *member, const char *directory) |
Loads data from a directory into a new allocated and created member session of a member if the required information can be read from the content of the given directory. More... | |
static struct GNUNET_MESSENGER_MemberSession * | get_cycle_safe_next_session (struct GNUNET_MESSENGER_MemberSession *session, struct GNUNET_MESSENGER_MemberSession *next) |
void | load_member_session_next (struct GNUNET_MESSENGER_MemberSession *session, const char *directory) |
Loads the connection from one session to another through the next attribute. More... | |
static enum GNUNET_GenericReturnValue | iterate_save_member_session_history_hentries (void *cls, const struct GNUNET_HashCode *key, void *value) |
static void | save_member_session_history (struct GNUNET_MESSENGER_MemberSession *session, const char *path) |
void | save_member_session (struct GNUNET_MESSENGER_MemberSession *session, const char *directory) |
Saves data from a member session into a directory which can be load to restore the member session completely. More... | |
struct GNUNET_MESSENGER_MemberSession * create_member_session | ( | struct GNUNET_MESSENGER_Member * | member, |
const struct GNUNET_CRYPTO_PublicKey * | pubkey | ||
) |
Creates and allocates a new member session of a member with a given public key.
If the creation fails, NULL gets returned.
[in,out] | member | Member |
[in] | pubkey | Public key |
Definition at line 34 of file gnunet-service-messenger_member_session.c.
References GNUNET_MESSENGER_MemberSession::closed, GNUNET_MESSENGER_MemberSession::completed, GNUNET_MESSENGER_MemberSession::contact, GNUNET_MESSENGER_MemberSession::context, get_context_from_member(), get_member_contact_store(), get_member_session_context(), get_member_session_id(), get_member_session_key(), get_member_session_public_key(), get_store_contact(), GNUNET_CONTAINER_multihashmap_create(), GNUNET_free, GNUNET_memcpy, GNUNET_new, GNUNET_NO, GNUNET_TIME_absolute_get(), GNUNET_MESSENGER_MemberSession::history, increase_contact_rc(), init_list_messages(), GNUNET_MESSENGER_MemberSession::member, GNUNET_MESSENGER_MemberSession::messages, GNUNET_MESSENGER_MemberSession::next, GNUNET_MESSENGER_MemberSession::prev, pubkey, GNUNET_MESSENGER_MemberSession::public_key, GNUNET_MESSENGER_MemberSession::start, and GNUNET_MESSENGER_Member::store.
Referenced by load_member_session(), and try_member_session().
|
static |
Definition at line 90 of file gnunet-service-messenger_member_session.c.
References add_to_list_messages(), check_member_session_history(), clear_list_messages(), GNUNET_MESSENGER_MemberSession::completed, GNUNET_MESSENGER_MemberSession::contact, copy_list_messages(), decrease_contact_rc(), end, GNUNET_MESSENGER_MessageLink::first, get_member_contact_store(), get_member_session_context(), get_member_session_id(), get_srv_room_message_store(), get_store_message_link(), GNUNET_assert, GNUNET_CRYPTO_hash_cmp(), GNUNET_ERROR_TYPE_DEBUG, GNUNET_log, GNUNET_NO, GNUNET_sh2s(), GNUNET_YES, GNUNET_MESSENGER_ListMessage::hash, GNUNET_MESSENGER_ListMessages::head, init_list_messages(), is_member_session_completed(), list, GNUNET_MESSENGER_MemberSession::member, GNUNET_MESSENGER_MemberSession::messages, GNUNET_MESSENGER_MessageLink::multiple, GNUNET_MESSENGER_ListMessage::next, remove_store_contact(), GNUNET_MESSENGER_MemberStore::room, GNUNET_MESSENGER_MessageLink::second, start, GNUNET_MESSENGER_Member::store, and GNUNET_MESSENGER_ListMessages::tail.
Referenced by close_member_session(), switch_member_session(), and update_member_session_history().
|
static |
Definition at line 183 of file gnunet-service-messenger_member_session.c.
References GNUNET_assert, GNUNET_CONTAINER_multihashmap_put(), GNUNET_CONTAINER_MULTIHASHMAPOPTION_UNIQUE_FAST, GNUNET_YES, GNUNET_MESSENGER_MemberSession::history, key, GNUNET_MESSENGER_MemberSession::next, and value.
Referenced by switch_member_session().
struct GNUNET_MESSENGER_MemberSession * switch_member_session | ( | struct GNUNET_MESSENGER_MemberSession * | session, |
const struct GNUNET_MESSENGER_Message * | message, | ||
const struct GNUNET_HashCode * | hash | ||
) |
Creates and allocates a new member session closing and replacing a given other session of the same member.
The new session could have significant changes to the members public key or its member id depending on the used message to switch session. The new session will be linked to the old one.
[in,out] | session | Old member session |
[in] | message | Message |
[in] | hash | Hash of message |
Definition at line 201 of file gnunet-service-messenger_member_session.c.
References add_store_member(), GNUNET_MESSENGER_Message::body, check_member_session_completion(), GNUNET_MESSENGER_MemberSession::closed, GNUNET_MESSENGER_MemberSession::completed, GNUNET_MESSENGER_MemberSession::contact, GNUNET_MESSENGER_MemberSession::context, copy_list_messages(), get_context_from_member(), get_member_contact_store(), get_member_session_contact(), get_member_session_context(), get_member_session_id(), get_member_session_key(), get_member_session_public_key(), GNUNET_assert, GNUNET_CONTAINER_multihashmap_create(), GNUNET_CONTAINER_multihashmap_iterate(), GNUNET_CONTAINER_multihashmap_size(), GNUNET_free, GNUNET_memcpy, GNUNET_MESSENGER_KIND_ID, GNUNET_MESSENGER_KIND_KEY, GNUNET_new, GNUNET_NO, GNUNET_TIME_absolute_get(), GNUNET_YES, GNUNET_MESSENGER_Message::header, GNUNET_MESSENGER_MemberSession::history, GNUNET_MESSENGER_MessageId::id, GNUNET_MESSENGER_MessageBody::id, increase_contact_rc(), init_list_messages(), iterate_copy_history(), GNUNET_MESSENGER_MessageKey::key, GNUNET_MESSENGER_MessageBody::key, GNUNET_MESSENGER_MessageHeader::kind, GNUNET_MESSENGER_MemberSession::member, GNUNET_MESSENGER_MemberSession::messages, GNUNET_MESSENGER_MemberSession::next, GNUNET_MESSENGER_MemberSession::prev, GNUNET_MESSENGER_MemberSession::public_key, GNUNET_MESSENGER_MemberSession::start, GNUNET_MESSENGER_Member::store, and update_store_contact().
Referenced by handle_member_session_switch().
void destroy_member_session | ( | struct GNUNET_MESSENGER_MemberSession * | session | ) |
Destroys a member session and frees its memory fully.
[in,out] | session | Member session |
Definition at line 279 of file gnunet-service-messenger_member_session.c.
References clear_list_messages(), decrease_contact_rc(), get_member_contact_store(), get_member_session_contact(), get_member_session_context(), GNUNET_assert, GNUNET_CONTAINER_multihashmap_destroy(), GNUNET_free, GNUNET_YES, GNUNET_MESSENGER_MemberSession::history, GNUNET_MESSENGER_MemberSession::member, GNUNET_MESSENGER_MemberSession::messages, remove_store_contact(), and GNUNET_MESSENGER_Member::store.
Referenced by iterate_destroy_session(), and remove_room_member_session().
enum GNUNET_GenericReturnValue reset_member_session | ( | struct GNUNET_MESSENGER_MemberSession * | session, |
const struct GNUNET_HashCode * | hash | ||
) |
Resets a given member session which re-opens a member session for new usage.
Every connection to other sessions will be be dropped. The member sessions messages will be cleared but old history from uncompleted sessions however can be reused!
[in,out] | session | Member session |
[in] | hash | Hash of initial message (JOIN message!) |
Definition at line 303 of file gnunet-service-messenger_member_session.c.
References add_to_list_messages(), clear_list_messages(), GNUNET_MESSENGER_MemberSession::closed, GNUNET_MESSENGER_MemberSession::completed, GNUNET_MESSENGER_MemberSession::contact, get_member_contact_store(), get_member_session_context(), get_member_session_public_key(), get_store_contact(), GNUNET_assert, GNUNET_NO, GNUNET_OK, GNUNET_SYSERR, increase_contact_rc(), GNUNET_MESSENGER_MemberSession::member, GNUNET_MESSENGER_MemberSession::messages, GNUNET_MESSENGER_MemberSession::next, and GNUNET_MESSENGER_Member::store.
Referenced by handle_message_join().
void close_member_session | ( | struct GNUNET_MESSENGER_MemberSession * | session | ) |
Closes a given member session which opens the request for completion of the given member session.
Closing a session may complete a session and can't be used without a reset! (
[in,out] | session | Member session |
Definition at line 343 of file gnunet-service-messenger_member_session.c.
References check_member_session_completion(), GNUNET_MESSENGER_MemberSession::closed, GNUNET_assert, and GNUNET_YES.
Referenced by handle_message_leave().
enum GNUNET_GenericReturnValue is_member_session_closed | ( | const struct GNUNET_MESSENGER_MemberSession * | session | ) |
Returns if the given member session has been closed.
[in] | session | Member session |
Definition at line 353 of file gnunet-service-messenger_member_session.c.
References GNUNET_MESSENGER_MemberSession::closed, and GNUNET_assert.
enum GNUNET_GenericReturnValue is_member_session_completed | ( | const struct GNUNET_MESSENGER_MemberSession * | session | ) |
Returns if the given member session has been completed.
A completed member session can't verify any message as its own and it won't add any message to its history.
[in] | session | Member session |
Definition at line 362 of file gnunet-service-messenger_member_session.c.
References GNUNET_MESSENGER_MemberSession::completed, and GNUNET_assert.
Referenced by check_member_session_completion(), iterate_forward_members(), iterate_notify_about_members(), iterate_update_member_sessions(), update_member_session_history(), and verify_member_session_as_sender().
struct GNUNET_TIME_Absolute get_member_session_start | ( | const struct GNUNET_MESSENGER_MemberSession * | session | ) |
Returns the timestamp of the member session's start.
[in] | session | Member session |
Definition at line 372 of file gnunet-service-messenger_member_session.c.
References get_member_session_start(), and GNUNET_assert.
Referenced by get_member_session_start(), and solve_srv_room_member_collisions().
const struct GNUNET_HashCode * get_member_session_key | ( | const struct GNUNET_MESSENGER_MemberSession * | session | ) |
Returns the key of the room a given member session belongs to.
[in] | session | Member session |
Definition at line 384 of file gnunet-service-messenger_member_session.c.
References get_member_store_key(), GNUNET_assert, GNUNET_MESSENGER_MemberSession::member, and GNUNET_MESSENGER_Member::store.
Referenced by create_member_session(), and switch_member_session().
const struct GNUNET_ShortHashCode * get_member_session_id | ( | const struct GNUNET_MESSENGER_MemberSession * | session | ) |
Returns the member id of a given member session.
[in] | session | Member session |
Definition at line 393 of file gnunet-service-messenger_member_session.c.
References get_member_id(), GNUNET_assert, and GNUNET_MESSENGER_MemberSession::member.
Referenced by check_member_session_completion(), create_member_session(), delete_srv_room_message(), find_member_session_in_room(), iterate_notify_about_members(), notify_about_members(), remove_room_member_session(), request_room_message_step(), save_member_session(), send_message_join(), switch_member_session(), update_member_session_history(), and verify_member_session_as_sender().
const struct GNUNET_CRYPTO_PublicKey * get_member_session_public_key | ( | const struct GNUNET_MESSENGER_MemberSession * | session | ) |
Returns the public key of a given member session.
[in] | session | Member session |
Definition at line 402 of file gnunet-service-messenger_member_session.c.
References GNUNET_assert, and GNUNET_MESSENGER_MemberSession::public_key.
Referenced by add_member_session(), create_member_session(), handle_message_id(), iterate_member_sessions_it(), notify_srv_handle_message(), remove_member_session(), remove_room_member_session(), reset_member_session(), save_member_session(), switch_member_session(), and verify_member_session_as_sender().
const struct GNUNET_HashCode * get_member_session_context | ( | const struct GNUNET_MESSENGER_MemberSession * | session | ) |
Returns the member context of a given member session.
[in] | session | Member session |
Definition at line 412 of file gnunet-service-messenger_member_session.c.
References GNUNET_MESSENGER_MemberSession::context, and GNUNET_assert.
Referenced by check_member_session_completion(), create_member_session(), destroy_member_session(), get_next_member_session_context(), reset_member_session(), and switch_member_session().
struct GNUNET_MESSENGER_Contact * get_member_session_contact | ( | struct GNUNET_MESSENGER_MemberSession * | session | ) |
Returns the contact which is connected to a given member session.
[in] | session | Member session |
Definition at line 422 of file gnunet-service-messenger_member_session.c.
References GNUNET_MESSENGER_MemberSession::contact, and GNUNET_assert.
Referenced by destroy_member_session(), and switch_member_session().
enum GNUNET_GenericReturnValue verify_member_session_as_sender | ( | const struct GNUNET_MESSENGER_MemberSession * | session, |
const struct GNUNET_MESSENGER_Message * | message, | ||
const struct GNUNET_HashCode * | hash | ||
) |
Verifies a given member session as sender of a selected message and its hash.
The function returns GNUNET_OK if the message session is verified as sender, otherwise GNUNET_SYSERR.
[in] | session | Member session |
[in] | message | Message |
[in] | hash | Hash of message |
Definition at line 431 of file gnunet-service-messenger_member_session.c.
References check_member_session_history(), get_member_session_id(), get_member_session_public_key(), GNUNET_assert, GNUNET_CRYPTO_public_key_to_string(), GNUNET_ERROR_TYPE_DEBUG, GNUNET_h2s(), GNUNET_log, GNUNET_memcmp, GNUNET_OK, GNUNET_SYSERR, GNUNET_YES, GNUNET_MESSENGER_Message::header, is_member_session_completed(), GNUNET_MESSENGER_MessageHeader::sender_id, and verify_message().
Referenced by iterate_search_session(), and update_member_session_history().
enum GNUNET_GenericReturnValue check_member_session_history | ( | const struct GNUNET_MESSENGER_MemberSession * | session, |
const struct GNUNET_HashCode * | hash, | ||
enum GNUNET_GenericReturnValue | ownership | ||
) |
Checks the history of a session for a specific message which is identified by its hash and if the ownership flag is set, if the message is owned by the sessions contact.
[in] | session | Member session |
[in] | hash | Hash of message |
[in] | ownership | Ownership flag |
Definition at line 464 of file gnunet-service-messenger_member_session.c.
References GNUNET_assert, GNUNET_CONTAINER_multihashmap_contains(), GNUNET_CONTAINER_multihashmap_get(), GNUNET_NO, GNUNET_YES, and GNUNET_MESSENGER_MemberSession::history.
Referenced by check_member_session_completion(), delete_srv_room_message(), notify_about_members(), recv_message_request(), request_room_message_step(), and verify_member_session_as_sender().
|
static |
Definition at line 480 of file gnunet-service-messenger_member_session.c.
References GNUNET_assert, GNUNET_CONTAINER_multihashmap_put(), GNUNET_CONTAINER_MULTIHASHMAPOPTION_UNIQUE_FAST, GNUNET_OK, GNUNET_YES, GNUNET_MESSENGER_MemberSession::history, GNUNET_MESSENGER_MemberSession::next, and update_member_chain_history().
Referenced by update_member_chain_history(), and update_member_session_history().
void update_member_session_history | ( | struct GNUNET_MESSENGER_MemberSession * | session, |
const struct GNUNET_MESSENGER_Message * | message, | ||
const struct GNUNET_HashCode * | hash | ||
) |
Adds a given message to the history of a session using the messages hash.
The ownership will be set automatically.
[in,out] | session | Member session |
[in] | message | Message |
[in] | hash | Hash of message |
Definition at line 496 of file gnunet-service-messenger_member_session.c.
References add_to_list_messages(), check_member_session_completion(), GNUNET_MESSENGER_MemberSession::closed, get_member_session_id(), GNUNET_assert, GNUNET_ERROR_TYPE_DEBUG, GNUNET_h2s(), GNUNET_log, GNUNET_NO, GNUNET_OK, GNUNET_sh2s(), GNUNET_YES, is_member_session_completed(), is_message_session_bound(), GNUNET_MESSENGER_MemberSession::messages, update_member_chain_history(), and verify_member_session_as_sender().
Referenced by iterate_update_member_sessions().
|
static |
Definition at line 525 of file gnunet-service-messenger_member_session.c.
References clear_member_session_history(), GNUNET_assert, GNUNET_CONTAINER_multihashmap_remove_all(), GNUNET_MESSENGER_MemberSession::history, and GNUNET_MESSENGER_MemberSession::next.
Referenced by clear_member_session_history().
void clear_member_session_history | ( | struct GNUNET_MESSENGER_MemberSession * | session, |
const struct GNUNET_HashCode * | hash | ||
) |
Removes a message from the history of a session using the messages hash.
[in,out] | session | Member session |
[in] | hash | Hash of message |
Definition at line 537 of file gnunet-service-messenger_member_session.c.
References clear_member_chain_history(), and GNUNET_assert.
Referenced by clear_member_chain_history().
|
static |
Definition at line 553 of file gnunet-service-messenger_member_session.c.
References GNUNET_assert, GNUNET_CONTAINER_multihashmap_put(), GNUNET_CONTAINER_MULTIHASHMAPOPTION_UNIQUE_FAST, GNUNET_DISK_file_close(), GNUNET_DISK_file_open(), GNUNET_DISK_file_read(), GNUNET_DISK_file_seek(), GNUNET_DISK_file_test(), GNUNET_DISK_OPEN_READ, GNUNET_DISK_PERM_USER_READ, GNUNET_DISK_PERM_USER_WRITE, GNUNET_DISK_SEEK_SET, GNUNET_OK, GNUNET_YES, handle, GNUNET_MESSENGER_MemberSessionHistoryEntry::hash, GNUNET_MESSENGER_MemberSession::history, GNUNET_MESSENGER_MemberSessionHistoryEntry::ownership, and status.
Referenced by load_member_session().
void load_member_session | ( | struct GNUNET_MESSENGER_Member * | member, |
const char * | directory | ||
) |
Loads data from a directory into a new allocated and created member session of a member if the required information can be read from the content of the given directory.
[out] | member | Member |
[in] | directory | Path to a directory |
Definition at line 602 of file gnunet-service-messenger_member_session.c.
References GNUNET_TIME_Absolute::abs_value_us, add_member_session(), cfg, GNUNET_MESSENGER_MemberSession::closed, GNUNET_MESSENGER_MemberSession::completed, config_file, create_member_session(), GNUNET_asprintf(), GNUNET_assert, GNUNET_CONFIGURATION_create(), GNUNET_CONFIGURATION_destroy(), GNUNET_CONFIGURATION_get_value_number(), GNUNET_CONFIGURATION_get_value_string(), GNUNET_CONFIGURATION_parse(), GNUNET_CRYPTO_public_key_from_string(), GNUNET_DISK_file_test(), GNUNET_ERROR_TYPE_DEBUG, GNUNET_free, GNUNET_log, GNUNET_NO, GNUNET_OK, GNUNET_YES, key, load_list_messages(), load_member_session_history(), GNUNET_MESSENGER_MemberSession::messages, and GNUNET_MESSENGER_MemberSession::start.
Referenced by callback_scan_for_sessions().
|
static |
Definition at line 692 of file gnunet-service-messenger_member_session.c.
References GNUNET_MESSENGER_MemberSession::next.
Referenced by load_member_session_next().
void load_member_session_next | ( | struct GNUNET_MESSENGER_MemberSession * | session, |
const char * | directory | ||
) |
Loads the connection from one session to another through the next attribute.
Necessary information will be loaded from a configuration file inside of a given directory.
[in,out] | session | Member session |
[in] | directory | Path to a directory |
Definition at line 714 of file gnunet-service-messenger_member_session.c.
References cfg, config_file, get_cycle_safe_next_session(), get_member_session(), get_store_member(), GNUNET_asprintf(), GNUNET_assert, GNUNET_CONFIGURATION_create(), GNUNET_CONFIGURATION_destroy(), GNUNET_CONFIGURATION_get_data(), GNUNET_CONFIGURATION_get_value_string(), GNUNET_CONFIGURATION_parse(), GNUNET_CRYPTO_public_key_from_string(), GNUNET_DISK_file_test(), GNUNET_ERROR_TYPE_DEBUG, GNUNET_free, GNUNET_log, GNUNET_OK, GNUNET_YES, GNUNET_MESSENGER_MemberSession::member, GNUNET_MESSENGER_MemberSession::next, next_id, GNUNET_MESSENGER_MemberSession::prev, and GNUNET_MESSENGER_Member::store.
Referenced by iterate_load_next_session().
|
static |
Definition at line 781 of file gnunet-service-messenger_member_session.c.
References GNUNET_assert, GNUNET_DISK_file_write(), GNUNET_NO, GNUNET_YES, handle, key, and value.
Referenced by save_member_session_history().
|
static |
Definition at line 801 of file gnunet-service-messenger_member_session.c.
References GNUNET_assert, GNUNET_CONTAINER_multihashmap_iterate(), GNUNET_DISK_file_close(), GNUNET_DISK_file_open(), GNUNET_DISK_file_seek(), GNUNET_DISK_file_sync(), GNUNET_DISK_OPEN_CREATE, GNUNET_DISK_OPEN_WRITE, GNUNET_DISK_PERM_USER_READ, GNUNET_DISK_PERM_USER_WRITE, GNUNET_DISK_SEEK_SET, handle, GNUNET_MESSENGER_MemberSession::history, and iterate_save_member_session_history_hentries().
Referenced by save_member_session().
void save_member_session | ( | struct GNUNET_MESSENGER_MemberSession * | session, |
const char * | directory | ||
) |
Saves data from a member session into a directory which can be load to restore the member session completely.
[in] | session | Member session |
[in] | directory | Path to a directory |
Definition at line 835 of file gnunet-service-messenger_member_session.c.
References GNUNET_TIME_Absolute::abs_value_us, cfg, GNUNET_MESSENGER_MemberSession::closed, GNUNET_MESSENGER_MemberSession::completed, config_file, get_member_session_id(), get_member_session_public_key(), GNUNET_asprintf(), GNUNET_assert, GNUNET_CONFIGURATION_create(), GNUNET_CONFIGURATION_destroy(), GNUNET_CONFIGURATION_set_value_number(), GNUNET_CONFIGURATION_set_value_string(), GNUNET_CONFIGURATION_write(), GNUNET_CRYPTO_public_key_to_string(), GNUNET_ERROR_TYPE_DEBUG, GNUNET_free, GNUNET_log, GNUNET_STRINGS_data_to_string_alloc(), GNUNET_MESSENGER_MemberSession::messages, GNUNET_MESSENGER_MemberSession::next, next_id, save_list_messages(), save_member_session_history(), and GNUNET_MESSENGER_MemberSession::start.
Referenced by iterate_save_session().