GNUnet MESSENGER service. More...
#include "platform.h"
#include "gnunet-service-messenger_message_kind.h"
#include "messenger_api_util.h"
Go to the source code of this file.
Functions | |
struct GNUNET_MESSENGER_Message * | create_message_info (const struct GNUNET_MESSENGER_Ego *ego) |
Creates and allocates a new info message containing the hosts EGO public key and a newly generated unique member id. More... | |
struct GNUNET_MESSENGER_Message * | create_message_join (const struct GNUNET_MESSENGER_Ego *ego) |
Creates and allocates a new join message containing the clients EGO public key. More... | |
struct GNUNET_MESSENGER_Message * | create_message_leave () |
Creates and allocates a new leave message. More... | |
struct GNUNET_MESSENGER_Message * | create_message_name (const char *name) |
Creates and allocates a new name message containing the name to change to. More... | |
struct GNUNET_MESSENGER_Message * | create_message_key (const struct GNUNET_IDENTITY_PrivateKey *key) |
Creates and allocates a new key message containing the public key to change to derived from its private counterpart. More... | |
struct GNUNET_MESSENGER_Message * | create_message_peer (const struct GNUNET_MESSENGER_Service *service) |
Creates and allocates a new peer message containing a services peer identity. More... | |
struct GNUNET_MESSENGER_Message * | create_message_id (const struct GNUNET_ShortHashCode *unique_id) |
Creates and allocates a new id message containing the unique member id to change to. More... | |
struct GNUNET_MESSENGER_Message * | create_message_miss (const struct GNUNET_PeerIdentity *peer) |
Creates and allocates a new miss message containing the missing peer identity. More... | |
struct GNUNET_MESSENGER_Message * | create_message_merge (const struct GNUNET_HashCode *previous) |
Creates and allocates a new merge message containing the hash of a second previous message besides the regular previous message mentioned in a messages header. More... | |
struct GNUNET_MESSENGER_Message * | create_message_request (const struct GNUNET_HashCode *hash) |
Creates and allocates a new request message containing the hash of a missing message. More... | |
struct GNUNET_MESSENGER_Message * | create_message_invite (const struct GNUNET_PeerIdentity *door, const struct GNUNET_HashCode *key) |
Creates and allocates a new invite message containing the peer identity of an entrance peer to a room using a given key as shared secret for communication. More... | |
struct GNUNET_MESSENGER_Message * | create_message_text (const char *text) |
Creates and allocates a new text message containing a string representing text. More... | |
struct GNUNET_MESSENGER_Message * | create_message_delete (const struct GNUNET_HashCode *hash, const struct GNUNET_TIME_Relative delay) |
Creates and allocates a new delete message containing the hash of a message to delete after a specific delay. More... | |
GNUnet MESSENGER service.
Definition in file gnunet-service-messenger_message_kind.c.
struct GNUNET_MESSENGER_Message* create_message_info | ( | const struct GNUNET_MESSENGER_Ego * | ego | ) |
Creates and allocates a new info message containing the hosts EGO public key and a newly generated unique member id.
(all values are stored as copy)
[in] | ego | EGO of the host |
[in] | members | Map of all assigned member ids |
Definition at line 32 of file gnunet-service-messenger_message_kind.c.
References GNUNET_MESSENGER_Message::body, create_message(), GNUNET_memcpy, GNUNET_MESSENGER_KIND_INFO, GNUNET_MESSENGER_VERSION, GNUNET_MESSENGER_MessageInfo::host_key, GNUNET_MESSENGER_MessageBody::info, GNUNET_MESSENGER_MessageInfo::messenger_version, and GNUNET_MESSENGER_Ego::pub.
Referenced by recv_message_info(), and send_room_info().
struct GNUNET_MESSENGER_Message* create_message_join | ( | const struct GNUNET_MESSENGER_Ego * | ego | ) |
Creates and allocates a new join message containing the clients EGO public key.
(all values are stored as copy)
[in] | ego | EGO of the client |
Definition at line 50 of file gnunet-service-messenger_message_kind.c.
References GNUNET_MESSENGER_Message::body, create_message(), GNUNET_memcpy, GNUNET_MESSENGER_KIND_JOIN, GNUNET_MESSENGER_MessageBody::join, GNUNET_MESSENGER_MessageJoin::key, and GNUNET_MESSENGER_Ego::pub.
Referenced by join_room().
struct GNUNET_MESSENGER_Message* create_message_leave | ( | ) |
Creates and allocates a new leave message.
Definition at line 66 of file gnunet-service-messenger_message_kind.c.
References create_message(), and GNUNET_MESSENGER_KIND_LEAVE.
Referenced by close_service_room().
struct GNUNET_MESSENGER_Message* create_message_name | ( | const char * | name | ) |
Creates and allocates a new name message containing the name to change to.
(all values are stored as copy)
[in] | name | New name |
Definition at line 72 of file gnunet-service-messenger_message_kind.c.
References GNUNET_MESSENGER_Message::body, create_message(), GNUNET_MESSENGER_KIND_NAME, GNUNET_strdup, name, GNUNET_MESSENGER_MessageName::name, and GNUNET_MESSENGER_MessageBody::name.
Referenced by callback_set_handle_name().
struct GNUNET_MESSENGER_Message* create_message_key | ( | const struct GNUNET_IDENTITY_PrivateKey * | key | ) |
Creates and allocates a new key message containing the public key to change to derived from its private counterpart.
(all values are stored as copy)
[in] | key | Private key of EGO |
Definition at line 87 of file gnunet-service-messenger_message_kind.c.
References GNUNET_MESSENGER_Message::body, create_message(), GNUNET_IDENTITY_key_get_public(), GNUNET_MESSENGER_KIND_KEY, key, GNUNET_MESSENGER_MessageKey::key, and GNUNET_MESSENGER_MessageBody::key.
Referenced by set_srv_handle_ego().
struct GNUNET_MESSENGER_Message* create_message_peer | ( | const struct GNUNET_MESSENGER_Service * | service | ) |
Creates and allocates a new peer message containing a services peer identity.
(all values are stored as copy)
[in] | service | Service |
Definition at line 102 of file gnunet-service-messenger_message_kind.c.
References GNUNET_MESSENGER_Message::body, create_message(), destroy_message(), get_service_peer_identity(), GNUNET_MESSENGER_KIND_PEER, GNUNET_OK, GNUNET_MESSENGER_MessagePeer::peer, GNUNET_MESSENGER_MessageBody::peer, and service.
Referenced by check_srv_room_peer_status(), and open_srv_room().
struct GNUNET_MESSENGER_Message* create_message_id | ( | const struct GNUNET_ShortHashCode * | unique_id | ) |
Creates and allocates a new id message containing the unique member id to change to.
(all values are stored as copy)
[in] | unique_id | Unique member id |
Definition at line 122 of file gnunet-service-messenger_message_kind.c.
References GNUNET_MESSENGER_Message::body, create_message(), GNUNET_memcpy, GNUNET_MESSENGER_KIND_ID, GNUNET_MESSENGER_MessageId::id, and GNUNET_MESSENGER_MessageBody::id.
Referenced by solve_srv_room_member_collisions().
struct GNUNET_MESSENGER_Message* create_message_miss | ( | const struct GNUNET_PeerIdentity * | peer | ) |
Creates and allocates a new miss message containing the missing peer identity.
(all values are stored as copy)
[in] | peer | Missing peer identity |
Definition at line 138 of file gnunet-service-messenger_message_kind.c.
References GNUNET_MESSENGER_Message::body, create_message(), GNUNET_memcpy, GNUNET_MESSENGER_KIND_MISS, GNUNET_MESSENGER_MessageBody::miss, GNUNET_MESSENGER_MessageMiss::peer, and peer.
Referenced by callback_room_disconnect().
struct GNUNET_MESSENGER_Message* create_message_merge | ( | const struct GNUNET_HashCode * | previous | ) |
Creates and allocates a new merge message containing the hash of a second previous message besides the regular previous message mentioned in a messages header.
(all values are stored as copy)
[in] | previous | Hash of message |
Definition at line 156 of file gnunet-service-messenger_message_kind.c.
References GNUNET_MESSENGER_Message::body, create_message(), GNUNET_memcpy, GNUNET_MESSENGER_KIND_MERGE, GNUNET_MESSENGER_MessageBody::merge, and GNUNET_MESSENGER_MessageMerge::previous.
Referenced by callback_room_merge(), and merge_srv_room_last_messages().
struct GNUNET_MESSENGER_Message* create_message_request | ( | const struct GNUNET_HashCode * | hash | ) |
Creates and allocates a new request message containing the hash of a missing message.
(all values are stored as copy)
[in] | hash | Hash of message |
Definition at line 172 of file gnunet-service-messenger_message_kind.c.
References GNUNET_MESSENGER_Message::body, create_message(), GNUNET_CRYPTO_hash_cmp(), GNUNET_memcpy, GNUNET_MESSENGER_KIND_REQUEST, GNUNET_MESSENGER_MessageRequest::hash, GNUNET_MESSENGER_MessageBody::request, and zero.
Referenced by callback_found_message().
struct GNUNET_MESSENGER_Message* create_message_invite | ( | const struct GNUNET_PeerIdentity * | door, |
const struct GNUNET_HashCode * | key | ||
) |
Creates and allocates a new invite message containing the peer identity of an entrance peer to a room using a given key as shared secret for communication.
(all values are stored as copy)
[in] | door | Peer identity |
[in] | key | Shared secret of a room |
Definition at line 194 of file gnunet-service-messenger_message_kind.c.
References GNUNET_MESSENGER_Message::body, create_message(), GNUNET_MESSENGER_MessageInvite::door, GNUNET_memcpy, GNUNET_MESSENGER_KIND_INVITE, GNUNET_MESSENGER_MessageBody::invite, key, and GNUNET_MESSENGER_MessageInvite::key.
struct GNUNET_MESSENGER_Message* create_message_text | ( | const char * | text | ) |
Creates and allocates a new text message containing a string representing text.
(all values are stored as copy)
[in] | text | Text |
Definition at line 212 of file gnunet-service-messenger_message_kind.c.
References GNUNET_MESSENGER_Message::body, create_message(), GNUNET_MESSENGER_KIND_TEXT, GNUNET_strdup, GNUNET_MESSENGER_MessageText::text, and GNUNET_MESSENGER_MessageBody::text.
struct GNUNET_MESSENGER_Message* create_message_delete | ( | const struct GNUNET_HashCode * | hash, |
const struct GNUNET_TIME_Relative | delay | ||
) |
Creates and allocates a new delete message containing the hash of a message to delete after a specific delay.
(all values are stored as copy)
[in] | hash | Hash of message |
[in] | delay | Delay of deletion |
Definition at line 227 of file gnunet-service-messenger_message_kind.c.
References GNUNET_MESSENGER_Message::body, create_message(), GNUNET_MESSENGER_MessageDelete::delay, delay, GNUNET_MESSENGER_MessageBody::deletion, GNUNET_memcpy, GNUNET_MESSENGER_KIND_DELETE, GNUNET_TIME_relative_hton(), and GNUNET_MESSENGER_MessageDelete::hash.