GNUnet  0.11.x
Functions
gnunet-service-messenger_message_send.h File Reference

GNUnet MESSENGER service. More...

#include "platform.h"
#include "gnunet_crypto_lib.h"
#include "gnunet-service-messenger_message_kind.h"
#include "gnunet-service-messenger_tunnel.h"
#include "messenger_api_message.h"
Include dependency graph for gnunet-service-messenger_message_send.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

void send_message_join (struct GNUNET_MESSENGER_SrvRoom *room, struct GNUNET_MESSENGER_SrvHandle *handle, const struct GNUNET_MESSENGER_Message *message, const struct GNUNET_HashCode *hash)
 Handles a sent join message to ensure growth of the decentralized room structure. More...
 
void send_message_peer (struct GNUNET_MESSENGER_SrvRoom *room, struct GNUNET_MESSENGER_SrvHandle *handle, const struct GNUNET_MESSENGER_Message *message, const struct GNUNET_HashCode *hash)
 Handles a sent peer message to update the rooms peer message of this service. More...
 
void send_message_id (struct GNUNET_MESSENGER_SrvRoom *room, struct GNUNET_MESSENGER_SrvHandle *handle, const struct GNUNET_MESSENGER_Message *message, const struct GNUNET_HashCode *hash)
 Handles a sent id message to update the handles member id in the room. More...
 
void send_message_request (struct GNUNET_MESSENGER_SrvRoom *room, struct GNUNET_MESSENGER_SrvHandle *handle, const struct GNUNET_MESSENGER_Message *message, const struct GNUNET_HashCode *hash)
 Handles a sent request message to trigger the request operation for this service. More...
 

Detailed Description

GNUnet MESSENGER service.

Author
Tobias Frisch

Definition in file gnunet-service-messenger_message_send.h.

Function Documentation

◆ send_message_join()

void send_message_join ( struct GNUNET_MESSENGER_SrvRoom room,
struct GNUNET_MESSENGER_SrvHandle handle,
const struct GNUNET_MESSENGER_Message message,
const struct GNUNET_HashCode hash 
)

Handles a sent join message to ensure growth of the decentralized room structure.

(if the service provides a peer message for this room currently, it will be forwarded)

Parameters
[in/out]room Room of the message
[in/out]handle Sending handle
[in]messageJOIN-Message
[in]hashHash of the message

Definition at line 33 of file gnunet-service-messenger_message_send.c.

37 {
38  check_room_peer_status(room, NULL);
39 }
void check_room_peer_status(struct GNUNET_MESSENGER_SrvRoom *room, struct GNUNET_MESSENGER_SrvTunnel *tunnel)
Checks the current state of opening a given room from this peer and re-publishes it if necessary to a...

References check_room_peer_status().

Referenced by send_room_message().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ send_message_peer()

void send_message_peer ( struct GNUNET_MESSENGER_SrvRoom room,
struct GNUNET_MESSENGER_SrvHandle handle,
const struct GNUNET_MESSENGER_Message message,
const struct GNUNET_HashCode hash 
)

Handles a sent peer message to update the rooms peer message of this service.

(a set peer message indicates this service being a part of the decentralized room structure)

Parameters
[in/out]room Room of the message
[in/out]handle Sending handle
[in]messagePEER-Message
[in]hashHash of the message

Definition at line 42 of file gnunet-service-messenger_message_send.c.

46 {
47  if (!room->peer_message)
48  room->peer_message = GNUNET_new(struct GNUNET_HashCode);
49 
50  GNUNET_memcpy(room->peer_message, hash, sizeof(struct GNUNET_HashCode));
51 }
#define GNUNET_memcpy(dst, src, n)
Call memcpy() but check for n being 0 first.
#define GNUNET_new(type)
Allocate a struct or union of the given type.
A 512-bit hashcode.
struct GNUNET_HashCode * peer_message

References GNUNET_memcpy, GNUNET_new, and GNUNET_MESSENGER_SrvRoom::peer_message.

Referenced by send_room_message().

Here is the caller graph for this function:

◆ send_message_id()

void send_message_id ( struct GNUNET_MESSENGER_SrvRoom room,
struct GNUNET_MESSENGER_SrvHandle handle,
const struct GNUNET_MESSENGER_Message message,
const struct GNUNET_HashCode hash 
)

Handles a sent id message to update the handles member id in the room.

(changing member id is useful to prevent collisions)

Parameters
[in/out]room Room of the message
[in/out]handle Sending handle
[in]messageID-Message
[in]hashHash of the message

Definition at line 54 of file gnunet-service-messenger_message_send.c.

58 {
59  change_handle_member_id (handle, get_room_key(room), &(message->body.id.id));
60 }
static struct GNUNET_DNS_Handle * handle
Handle to transport service.
int change_handle_member_id(struct GNUNET_MESSENGER_SrvHandle *handle, const struct GNUNET_HashCode *key, const struct GNUNET_ShortHashCode *unique_id)
Changes the member id of a given handle in a specific room to match a unique_id and returns GNUNET_OK...
const struct GNUNET_HashCode * get_room_key(const struct GNUNET_MESSENGER_SrvRoom *room)
Returns the shared secret you need to access a room.
struct GNUNET_MESSENGER_MessageId id
struct GNUNET_ShortHashCode id
The new id which will replace the senders id in a room.
struct GNUNET_MESSENGER_MessageBody body
Body.

References GNUNET_MESSENGER_Message::body, change_handle_member_id(), get_room_key(), handle, GNUNET_MESSENGER_MessageId::id, and GNUNET_MESSENGER_MessageBody::id.

Referenced by send_room_message().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ send_message_request()

void send_message_request ( struct GNUNET_MESSENGER_SrvRoom room,
struct GNUNET_MESSENGER_SrvHandle handle,
const struct GNUNET_MESSENGER_Message message,
const struct GNUNET_HashCode hash 
)

Handles a sent request message to trigger the request operation for this service.

(the request operation will deactivate the possibility of spamming requests)

Parameters
[in/out]room Room of the message
[in/out]handle Sending handle
[in]messagePEER-Message
[in]hashHash of the message

Definition at line 63 of file gnunet-service-messenger_message_send.c.

67 {
69 
71  operation_store,
72  &(message->body.request.hash),
75  );
76 }
int use_store_operation(struct GNUNET_MESSENGER_OperationStore *store, const struct GNUNET_HashCode *hash, enum GNUNET_MESSENGER_OperationType type, struct GNUNET_TIME_Relative delay)
Tries to use an operation under a given hash in a specific operation store.
struct GNUNET_MESSENGER_OperationStore * get_room_operation_store(struct GNUNET_MESSENGER_SrvRoom *room)
Returns the used operation store of a given room.
#define GNUNET_MESSENGER_REQUEST_DELAY
struct GNUNET_MESSENGER_MessageRequest request
struct GNUNET_HashCode hash
The hash of the requested message.

References GNUNET_MESSENGER_Message::body, get_room_operation_store(), GNUNET_MESSENGER_OP_REQUEST, GNUNET_MESSENGER_REQUEST_DELAY, GNUNET_MESSENGER_MessageRequest::hash, GNUNET_MESSENGER_MessageBody::request, GNUNET_MESSENGER_OperationStore::room, and use_store_operation().

Referenced by send_room_message().

Here is the call graph for this function:
Here is the caller graph for this function: