213 "New incoming connection to room (%s) from peer: %s\n",
236 "New tunnel in room (%s) established to peer: %s\n",
354 "Port of room (%s) could not be opened!\n",
358 goto complete_opening;
373 "You could not join the room, therefore it keeps closed!\n");
391 "Peer message could not be sent!\n");
444 "You could not connect to that door!\n");
453 "Connection failure during entrance!\n");
506 "Packing message with peer signature: %s\n",
544 if (tunnel == closure->
exclude)
592 "Sending message from handle in room: %s (%s)\n",
671 closure.
hash = &message_hash;
716 "Merging messages by handle in room: %s\n",
733 "Merging messages failed: %s\n",
759 "Deletion is delayed forever: operation is impossible!\n");
776 "Unpermitted request for deletion by member (%s) of message (%s)!\n",
792 "Deletion has failed: operation denied!\n");
849 "Requesting link of message with hash: %s\n",
871 "Requested message is missing in local storage: %s\n",
878 "Unpermitted request for access by member (%s) of message (%s)!\n",
882 callback (cls, room, message, hash);
902 callback (cls, room, NULL, hash);
965 for (element = handles->
head; element; element = element->
next)
1060 element = element->
next;
1116 message_store, &(element->
hash));
1119 goto finish_handling;
1126 goto finish_handling;
1135 goto finish_handling;
1141 goto finish_handling;
1345 "Message handling dropped: Peer is missing!\n");
1360 "Message handling dropped: Member is missing!\n");
1369 "Message handling dropped: Session is missing!\n");
1474 char *basement_file;
1514 char *basement_file;
1558 "Remove member session from room: %s (%s)\n",
1575 &session_dir,
"%s%s%c%s%c%s%c%s%c", room_dir,
struct GNUNET_MQ_MessageHandlers handlers[]
struct GNUNET_MQ_Envelope * env
static int forward
Search direction: forward.
static int start
Set if we are to start default services (including ARM).
static char * dir
Set to the directory where runtime files are stored.
static uint16_t port
Port number.
static uint64_t timestamp(void)
Get current timestamp.
struct GNUNET_HashCode key
The key used in the DHT.
static GstElement * source
Appsrc instance into which we write data for the pipeline.
static struct GNUNET_CRYPTO_PublicKey pubkey
Public key of the zone to look in.
static char * value
Value of the record to add/remove.
static int result
Global testing status.
static void destroy_tunnel(void *cls)
This tunnel is no longer used, destroy it.
static struct GNUNET_CADET_Handle * cadet
Handle for cadet.
enum GNUNET_GenericReturnValue required_connection_between(size_t count, size_t src, size_t dst)
Returns GNUNET_YES or GNUNET_NO to determine if the peers of index src and index dst should be connec...
size_t count_of_tunnels(const struct GNUNET_MESSENGER_ListTunnels *tunnels)
Returns the count of peers in a list (typically from the basement of a room).
enum GNUNET_GenericReturnValue change_srv_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...
void notify_srv_handle_member_id(struct GNUNET_MESSENGER_SrvHandle *handle, struct GNUNET_MESSENGER_SrvRoom *room, const struct GNUNET_ShortHashCode *member_id, enum GNUNET_GenericReturnValue reset)
Notifies the handle that a new member id needs to be used.
const struct GNUNET_CRYPTO_PublicKey * get_srv_handle_key(const struct GNUNET_MESSENGER_SrvHandle *handle)
Returns the public key of a given handle.
const struct GNUNET_ShortHashCode * get_srv_handle_member_id(const struct GNUNET_MESSENGER_SrvHandle *handle, const struct GNUNET_HashCode *key)
Returns the member id of a given handle in a specific room.
enum GNUNET_GenericReturnValue is_srv_handle_routing(const struct GNUNET_MESSENGER_SrvHandle *handle, const struct GNUNET_HashCode *key)
Returns whether a given handle has enabled routing for a room using a specific key by opening that ro...
void init_list_messages(struct GNUNET_MESSENGER_ListMessages *messages)
Initializes list of message hashes as empty list.
void add_to_list_messages(struct GNUNET_MESSENGER_ListMessages *messages, const struct GNUNET_HashCode *hash)
Adds a specific hash from a message to the end of the list.
const struct GNUNET_ShortHashCode * get_member_id(const struct GNUNET_MESSENGER_Member *member)
Returns the current id of a given member.
void remove_member_session(struct GNUNET_MESSENGER_Member *member, struct GNUNET_MESSENGER_MemberSession *session)
Removes a given member session from its member.
struct GNUNET_MESSENGER_MemberSession * get_member_session_of(struct GNUNET_MESSENGER_Member *member, const struct GNUNET_MESSENGER_Message *message, const struct GNUNET_HashCode *hash)
Returns the member session of a member using a public key which can verify the signature of a given m...
struct GNUNET_MESSENGER_MemberSession * get_member_session(const struct GNUNET_MESSENGER_Member *member, const struct GNUNET_CRYPTO_PublicKey *public_key)
Returns the member session of a member identified by a given public key.
struct GNUNET_MESSENGER_Subscription * get_member_subscription(struct GNUNET_MESSENGER_Member *member, const struct GNUNET_ShortHashCode *discourse)
Returns the active subscription of a given member to a selected discourse.
void destroy_member_session(struct GNUNET_MESSENGER_MemberSession *session)
Destroys a member session and frees its memory fully.
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.
struct GNUNET_TIME_Absolute get_member_session_start(const struct GNUNET_MESSENGER_MemberSession *session)
Returns the timestamp of the member session's start.
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.
const struct GNUNET_ShortHashCode * get_member_session_id(const struct GNUNET_MESSENGER_MemberSession *session)
Returns the member id of a given member session.
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 own...
enum GNUNET_GenericReturnValue is_member_session_completed(const struct GNUNET_MESSENGER_MemberSession *session)
Returns if the given member session has been completed.
struct GNUNET_MESSENGER_Member * get_store_member_of(struct GNUNET_MESSENGER_MemberStore *store, const struct GNUNET_MESSENGER_Message *message)
Returns the member of a store using a sender id of a given message.
int iterate_store_members(struct GNUNET_MESSENGER_MemberStore *store, GNUNET_MESSENGER_MemberIteratorCallback it, void *cls)
Iterate through all member sessions currently connected to the members of the given member store and ...
void save_member_store(struct GNUNET_MESSENGER_MemberStore *store, const char *directory)
Saves members from a member store into a directory.
void load_member_store(struct GNUNET_MESSENGER_MemberStore *store, const char *directory)
Loads members from a directory into a member store.
struct GNUNET_MESSENGER_Member * add_store_member(struct GNUNET_MESSENGER_MemberStore *store, const struct GNUNET_ShortHashCode *id)
Adds a member to a store under a specific id and returns it on success.
void init_member_store(struct GNUNET_MESSENGER_MemberStore *store, struct GNUNET_MESSENGER_SrvRoom *room)
Initializes a member store as fully empty connected to a room.
void clear_member_store(struct GNUNET_MESSENGER_MemberStore *store)
Clears a member store, wipes its content and deallocates its memory.
struct GNUNET_MESSENGER_Member * get_store_member(const struct GNUNET_MESSENGER_MemberStore *store, const struct GNUNET_ShortHashCode *id)
Returns the member in a store identified by a given id.
void handle_message_id(struct GNUNET_MESSENGER_SrvRoom *room, struct GNUNET_MESSENGER_SenderSession *session, const struct GNUNET_MESSENGER_Message *message, const struct GNUNET_HashCode *hash)
Handles a received or sent id message to change a members id.
void handle_message_delete(struct GNUNET_MESSENGER_SrvRoom *room, struct GNUNET_MESSENGER_SenderSession *session, const struct GNUNET_MESSENGER_Message *message, const struct GNUNET_HashCode *hash)
Handles a received or sent delete message to delete a specific message from the store.
void handle_message_peer(struct GNUNET_MESSENGER_SrvRoom *room, struct GNUNET_MESSENGER_SenderSession *session, const struct GNUNET_MESSENGER_Message *message, const struct GNUNET_HashCode *hash)
Handles a received or sent peer message to make changes of the basement in the room.
void handle_message_join(struct GNUNET_MESSENGER_SrvRoom *room, struct GNUNET_MESSENGER_SenderSession *session, const struct GNUNET_MESSENGER_Message *message, const struct GNUNET_HashCode *hash)
Handles a received or sent join message to make changes of current member information.
void handle_message_key(struct GNUNET_MESSENGER_SrvRoom *room, struct GNUNET_MESSENGER_SenderSession *session, const struct GNUNET_MESSENGER_Message *message, const struct GNUNET_HashCode *hash)
Handles a received or sent key message to change the key of a member and rearrange the contacts accor...
void handle_message_leave(struct GNUNET_MESSENGER_SrvRoom *room, struct GNUNET_MESSENGER_SenderSession *session, const struct GNUNET_MESSENGER_Message *message, const struct GNUNET_HashCode *hash)
Handles a received or sent leave message to make changes of current member information.
void handle_message_subscribe(struct GNUNET_MESSENGER_SrvRoom *room, struct GNUNET_MESSENGER_SenderSession *session, const struct GNUNET_MESSENGER_Message *message, const struct GNUNET_HashCode *hash)
Handles a received or sent subscribe message to subscribe a member to a discourse.
void handle_message_connection(struct GNUNET_MESSENGER_SrvRoom *room, struct GNUNET_MESSENGER_SenderSession *session, const struct GNUNET_MESSENGER_Message *message, const struct GNUNET_HashCode *hash)
Handles a received or sent connection message to update connection information about a peer.
void handle_message_miss(struct GNUNET_MESSENGER_SrvRoom *room, struct GNUNET_MESSENGER_SenderSession *session, const struct GNUNET_MESSENGER_Message *message, const struct GNUNET_HashCode *hash)
Handles a received or sent miss message to drop a peer from the basement in the room.
struct GNUNET_MESSENGER_Message * create_message_info(struct GNUNET_MESSENGER_Service *service)
Creates and allocates a new info message containing the hosts service peer identity and version.
struct GNUNET_MESSENGER_Message * create_message_miss(const struct GNUNET_PeerIdentity *peer)
Creates and allocates a new miss message containing the missing peer identity.
struct GNUNET_MESSENGER_Message * create_message_peer(struct GNUNET_MESSENGER_Service *service)
Creates and allocates a new peer message containing a services peer identity.
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 th...
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.
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.
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.
void send_message_key(struct GNUNET_MESSENGER_SrvRoom *room, struct GNUNET_MESSENGER_SrvHandle *handle, const struct GNUNET_MESSENGER_Message *message, const struct GNUNET_HashCode *hash)
Handles a sent key message to ensure changes to the public key of the sending handle.
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.
const struct GNUNET_HashCode * get_message_state_merge_hash(const struct GNUNET_MESSENGER_MessageState *state)
void save_message_state(const struct GNUNET_MESSENGER_MessageState *state, const char *path)
void clear_message_state(struct GNUNET_MESSENGER_MessageState *state)
void get_message_state_chain_hash(const struct GNUNET_MESSENGER_MessageState *state, struct GNUNET_HashCode *hash)
void init_message_state(struct GNUNET_MESSENGER_MessageState *state)
void update_message_state(struct GNUNET_MESSENGER_MessageState *state, enum GNUNET_GenericReturnValue requested, const struct GNUNET_MESSENGER_Message *message, const struct GNUNET_HashCode *hash)
void load_message_state(struct GNUNET_MESSENGER_MessageState *state, const char *path)
enum GNUNET_GenericReturnValue contains_store_message(const struct GNUNET_MESSENGER_MessageStore *store, const struct GNUNET_HashCode *hash)
Checks if a message matching a given hash is stored in a message store.
void save_message_store(struct GNUNET_MESSENGER_MessageStore *store, const char *directory)
Saves messages from a message store into a directory.
enum GNUNET_GenericReturnValue put_store_message(struct GNUNET_MESSENGER_MessageStore *store, const struct GNUNET_HashCode *hash, struct GNUNET_MESSENGER_Message *message)
Stores a message into the message store.
void clear_message_store(struct GNUNET_MESSENGER_MessageStore *store)
Clears a message store, wipes its content and deallocates its memory.
void init_message_store(struct GNUNET_MESSENGER_MessageStore *store)
Initializes a message store as fully empty.
void cleanup_store_discourse_messages_before(struct GNUNET_MESSENGER_MessageStore *store, const struct GNUNET_ShortHashCode *discourse, const struct GNUNET_TIME_Absolute timestamp)
Cleans up and deletes all discourse messages existing in the message store memory before a certain ti...
void load_message_store(struct GNUNET_MESSENGER_MessageStore *store, const char *directory)
Loads messages from a directory into a message store.
const struct GNUNET_MESSENGER_MessageLink * get_store_message_link(struct GNUNET_MESSENGER_MessageStore *store, const struct GNUNET_HashCode *hash, enum GNUNET_GenericReturnValue deleted_only)
Returns the message link from a message store matching a given hash.
const struct GNUNET_MESSENGER_Message * get_store_message(struct GNUNET_MESSENGER_MessageStore *store, const struct GNUNET_HashCode *hash)
Returns the message from a message store matching a given hash.
@ GNUNET_MESSENGER_OP_UNKNOWN
@ GNUNET_MESSENGER_OP_REQUEST
@ GNUNET_MESSENGER_OP_DELETE
@ GNUNET_MESSENGER_OP_MERGE
void cancel_store_operation(struct GNUNET_MESSENGER_OperationStore *store, const struct GNUNET_HashCode *hash)
Stops any active operation under a given hash in a specific operation store.
void save_operation_store(const struct GNUNET_MESSENGER_OperationStore *store, const char *directory)
Saves operations from an operation store into a directory.
void clear_operation_store(struct GNUNET_MESSENGER_OperationStore *store)
Clears an operation store, stops all operations and deallocates its memory.
void load_operation_store(struct GNUNET_MESSENGER_OperationStore *store, const char *directory)
Loads operations from a directory into an operation store.
enum GNUNET_MESSENGER_OperationType get_store_operation_type(const struct GNUNET_MESSENGER_OperationStore *store, const struct GNUNET_HashCode *hash)
Returns the type of the active operation under a given hash in a specific operation store.
void init_operation_store(struct GNUNET_MESSENGER_OperationStore *store, struct GNUNET_MESSENGER_SrvRoom *room)
Initializes an operation store as fully empty with a given room.
enum GNUNET_GenericReturnValue 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_PeerIdentity * get_store_peer_of(struct GNUNET_MESSENGER_PeerStore *store, const struct GNUNET_MESSENGER_Message *message, const struct GNUNET_HashCode *hash)
Returns the peer identity inside the store which verifies the signature of a given message as valid.
void load_peer_store(struct GNUNET_MESSENGER_PeerStore *store, const char *path)
Loads peer identities from a file into a peer store.
void clear_peer_store(struct GNUNET_MESSENGER_PeerStore *store)
Clears a peer store, wipes its content and deallocates its memory.
void save_peer_store(const struct GNUNET_MESSENGER_PeerStore *store, const char *path)
Saves peer identities from a peer store into a file.
void init_peer_store(struct GNUNET_MESSENGER_PeerStore *store, struct GNUNET_MESSENGER_Service *service)
Initializes a peer store as fully empty.
uint32_t get_srv_room_amount_of_tunnels(const struct GNUNET_MESSENGER_SrvRoom *room)
Returns the amount of active tunnels of a given room.
static enum GNUNET_GenericReturnValue request_room_message_step(struct GNUNET_MESSENGER_SrvRoom *room, const struct GNUNET_HashCode *hash, const struct GNUNET_MESSENGER_MemberSession *session, GNUNET_MESSENGER_MessageRequestCallback callback, void *cls)
static enum GNUNET_GenericReturnValue iterate_destroy_tunnels(void *cls, const struct GNUNET_PeerIdentity *key, void *value)
const struct GNUNET_MESSENGER_SrvTunnel * get_srv_room_tunnel(const struct GNUNET_MESSENGER_SrvRoom *room, const struct GNUNET_PeerIdentity *peer)
Returns a tunnel inside of a room leading towards a given peer if such a tunnel exists,...
static void get_room_data_subdir(struct GNUNET_MESSENGER_SrvRoom *room, char **dir)
static enum GNUNET_GenericReturnValue join_room(struct GNUNET_MESSENGER_SrvRoom *room, struct GNUNET_MESSENGER_SrvHandle *handle, struct GNUNET_MESSENGER_Member *member, const struct GNUNET_ShortHashCode *id)
enum GNUNET_GenericReturnValue update_room_message(struct GNUNET_MESSENGER_SrvRoom *room, struct GNUNET_MESSENGER_Message *message, const struct GNUNET_HashCode *hash)
struct GNUNET_MESSENGER_SrvRoom * create_srv_room(struct GNUNET_MESSENGER_SrvHandle *handle, const struct GNUNET_HashCode *key)
Creates and allocates a new room for a handle with a given key.
void save_srv_room(struct GNUNET_MESSENGER_SrvRoom *room)
Saves the configuration for a given room of a service which contains the last messages hash and the r...
void rebuild_srv_room_basement_structure(struct GNUNET_MESSENGER_SrvRoom *room)
Rebuilds the decentralized structure for a room by ensuring all required connections are made dependi...
struct GNUNET_MESSENGER_MessageStore * get_srv_room_message_store(struct GNUNET_MESSENGER_SrvRoom *room)
Returns the used message store of a given room.
static void * callback_room_connect(void *cls, struct GNUNET_CADET_Channel *channel, const struct GNUNET_PeerIdentity *source)
static enum GNUNET_GenericReturnValue send_room_info(struct GNUNET_MESSENGER_SrvRoom *room, struct GNUNET_MESSENGER_SrvHandle *handle, struct GNUNET_MESSENGER_SrvTunnel *tunnel)
static void remove_room_member_session(struct GNUNET_MESSENGER_SrvRoom *room, struct GNUNET_MESSENGER_MemberSession *session)
static enum GNUNET_GenericReturnValue iterate_member_for_subscription(void *cls, const struct GNUNET_CRYPTO_PublicKey *public_key, struct GNUNET_MESSENGER_MemberSession *session)
static enum GNUNET_GenericReturnValue join_room_locally(struct GNUNET_MESSENGER_SrvRoom *room, struct GNUNET_MESSENGER_SrvHandle *handle)
enum GNUNET_GenericReturnValue enter_srv_room_at(struct GNUNET_MESSENGER_SrvRoom *room, struct GNUNET_MESSENGER_SrvHandle *handle, const struct GNUNET_PeerIdentity *door)
Connects a tunnel to a hosting peer of a room through a so called door which is represented by a peer...
struct GNUNET_MESSENGER_PeerStore * get_srv_room_peer_store(struct GNUNET_MESSENGER_SrvRoom *room)
Returns the used peer store of a given room.
static void idle_request_room_messages(void *cls)
void merge_srv_room_last_messages(struct GNUNET_MESSENGER_SrvRoom *room, struct GNUNET_MESSENGER_SrvHandle *handle)
Reduces all current forks inside of the message history of a room to one remaining last message by me...
struct GNUNET_MQ_Envelope * pack_srv_room_message(const struct GNUNET_MESSENGER_SrvRoom *room, const struct GNUNET_MESSENGER_SrvHandle *handle, struct GNUNET_MESSENGER_Message *message, struct GNUNET_HashCode *hash, enum GNUNET_MESSENGER_PackMode mode)
Packs a message depending on the selected mode into a newly allocated envelope.
void check_srv_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...
void remove_srv_room(struct GNUNET_MESSENGER_SrvRoom *room)
Removes the configuration for a given room of a service.
enum GNUNET_GenericReturnValue open_srv_room(struct GNUNET_MESSENGER_SrvRoom *room, struct GNUNET_MESSENGER_SrvHandle *handle)
Tries to open a room for a given handle.
void destroy_srv_room(struct GNUNET_MESSENGER_SrvRoom *room, enum GNUNET_GenericReturnValue deletion)
Destroys a room and frees its memory fully.
static void sign_srv_room_message_by_peer(const void *cls, struct GNUNET_MESSENGER_Message *message, uint16_t length, char *buffer, const struct GNUNET_HashCode *hash)
void forward_srv_room_message(struct GNUNET_MESSENGER_SrvRoom *room, struct GNUNET_MESSENGER_SrvTunnel *tunnel, struct GNUNET_MESSENGER_Message *message, const struct GNUNET_HashCode *hash)
Forwards a message with a given hash to a specific tunnel inside of a room.
void cleanup_srv_room_discourse_messages(struct GNUNET_MESSENGER_SrvRoom *room, const struct GNUNET_ShortHashCode *discourse)
Cleanup discourse messages outside of current subscriptions from a specific discourse of all the memb...
uint32_t get_srv_room_connection_flags(const struct GNUNET_MESSENGER_SrvRoom *room)
Returns connection flags about connection information of a given room and the service managing it.
enum GNUNET_GenericReturnValue request_srv_room_message(struct GNUNET_MESSENGER_SrvRoom *room, const struct GNUNET_HashCode *hash, const struct GNUNET_MESSENGER_MemberSession *session, GNUNET_MESSENGER_MessageRequestCallback callback, void *cls)
Requests a message from a room identified by a given hash.
static void handle_room_messages(struct GNUNET_MESSENGER_SrvRoom *room)
void callback_room_handle_message(struct GNUNET_MESSENGER_SrvRoom *room, const struct GNUNET_MESSENGER_Message *message, const struct GNUNET_HashCode *hash)
enum GNUNET_GenericReturnValue send_srv_room_message(struct GNUNET_MESSENGER_SrvRoom *room, struct GNUNET_MESSENGER_SrvHandle *handle, struct GNUNET_MESSENGER_Message *message)
Sends a message from a given handle into a room.
struct GNUNET_MESSENGER_OperationStore * get_srv_room_operation_store(struct GNUNET_MESSENGER_SrvRoom *room)
Returns the used operation store of a given room.
static enum GNUNET_GenericReturnValue iterate_send_room_message(void *cls, const struct GNUNET_PeerIdentity *key, void *value)
static void close_srv_room(struct GNUNET_MESSENGER_SrvRoom *room)
void solve_srv_room_member_collisions(struct GNUNET_MESSENGER_SrvRoom *room, const struct GNUNET_CRYPTO_PublicKey *public_key, const struct GNUNET_ShortHashCode *member_id, struct GNUNET_TIME_Absolute timestamp)
Checks for potential collisions with member ids and solves them changing active handles ids if they u...
struct GNUNET_CADET_Handle * get_srv_room_cadet(struct GNUNET_MESSENGER_SrvRoom *room)
Returns the CADET handle from a rooms service.
enum GNUNET_GenericReturnValue delete_srv_room_message(struct GNUNET_MESSENGER_SrvRoom *room, struct GNUNET_MESSENGER_MemberSession *session, const struct GNUNET_HashCode *hash, const struct GNUNET_TIME_Relative delay)
Deletes a message from the room with a given hash in a specific delay if the provided member by its s...
const struct GNUNET_HashCode * get_srv_room_key(const struct GNUNET_MESSENGER_SrvRoom *room)
Returns the shared secret you need to access a room.
static enum GNUNET_GenericReturnValue iterate_update_member_sessions(void *cls, const struct GNUNET_CRYPTO_PublicKey *public_key, struct GNUNET_MESSENGER_MemberSession *session)
struct GNUNET_MESSENGER_MemberStore * get_srv_room_member_store(struct GNUNET_MESSENGER_SrvRoom *room)
Returns the used member store of a given room.
void load_srv_room(struct GNUNET_MESSENGER_SrvRoom *room)
Loads the local configuration for a given room of a service which contains the last messages hash and...
#define GNUNET_MESSENGER_MERGE_DELAY
#define GNUNET_MESSENGER_IDLE_DELAY
void() GNUNET_MESSENGER_MessageRequestCallback(void *cls, struct GNUNET_MESSENGER_SrvRoom *room, const struct GNUNET_MESSENGER_Message *message, const struct GNUNET_HashCode *hash)
Method called whenever a message is found during a request in a room.
enum GNUNET_GenericReturnValue get_service_peer_identity(struct GNUNET_MESSENGER_Service *service, struct GNUNET_PeerIdentity *peer)
Tries to write the peer identity of the peer running a service on to the peer parameter.
void handle_service_message(struct GNUNET_MESSENGER_Service *service, struct GNUNET_MESSENGER_SrvRoom *room, const struct GNUNET_MESSENGER_SenderSession *session, const struct GNUNET_MESSENGER_Message *message, const struct GNUNET_HashCode *hash)
Sends a received or sent message with a given hash to each handle of a service which is currently mem...
void forward_tunnel_message(struct GNUNET_MESSENGER_SrvTunnel *tunnel, const struct GNUNET_MESSENGER_Message *message, const struct GNUNET_HashCode *hash)
Forwards a given message with a known hash through a tunnel.
void send_tunnel_envelope(struct GNUNET_MESSENGER_SrvTunnel *tunnel, struct GNUNET_MQ_Envelope *env, const struct GNUNET_HashCode *hash)
Sends an envelope containing a message with a given hash through a tunnel.
enum GNUNET_GenericReturnValue is_tunnel_connected(const struct GNUNET_MESSENGER_SrvTunnel *tunnel)
Returns the status of a currently bound channel of a tunnel.
void bind_tunnel(struct GNUNET_MESSENGER_SrvTunnel *tunnel, struct GNUNET_CADET_Channel *channel)
Binds a CADET channel to a tunnel and replaces its channel the tunnel is currently bound to if necess...
uint32_t get_tunnel_messenger_version(const struct GNUNET_MESSENGER_SrvTunnel *tunnel)
Returns the current messenger version the peer connected via a given tunnel has reported to be using ...
void callback_tunnel_disconnect(void *cls, const struct GNUNET_CADET_Channel *channel)
Callback for a CADET channel disconnecting to manage this event as a proper tunnel provided as its cl...
struct GNUNET_MESSENGER_SrvTunnel * create_tunnel(struct GNUNET_MESSENGER_SrvRoom *room, const struct GNUNET_PeerIdentity *door)
Creates and allocates a tunnel of a room to a specific peer identity (called door).
void disconnect_tunnel(struct GNUNET_MESSENGER_SrvTunnel *tunnel)
Disconnects and unbinds a channel from a tunnel.
enum GNUNET_GenericReturnValue connect_tunnel(struct GNUNET_MESSENGER_SrvTunnel *tunnel)
Tries to connect a tunnel by creating a new CADET channel and binding it.
enum GNUNET_GenericReturnValue send_tunnel_message(struct GNUNET_MESSENGER_SrvTunnel *tunnel, void *handle, struct GNUNET_MESSENGER_Message *message)
Sends a message by packing it automatically into an envelope and passing it through the tunnel.
static struct GNUNET_VPN_Handle * handle
Handle to vpn service.
static enum @44 mode
Should we do a PUT (mode = 0) or GET (mode = 1);.
struct GNUNET_CADET_Port * GNUNET_CADET_open_port(struct GNUNET_CADET_Handle *h, const struct GNUNET_HashCode *port, GNUNET_CADET_ConnectEventHandler connects, void *connects_cls, GNUNET_CADET_WindowSizeEventHandler window_changes, GNUNET_CADET_DisconnectEventHandler disconnects, const struct GNUNET_MQ_MessageHandler *handlers)
Open a port to receive incoming MQ-based channels.
void GNUNET_CADET_close_port(struct GNUNET_CADET_Port *p)
Close a port opened with GNUNET_CADET_open_port.
enum GNUNET_GenericReturnValue GNUNET_DISK_directory_remove(const char *filename)
Remove all files in a directory (rm -rf).
enum GNUNET_GenericReturnValue GNUNET_DISK_directory_test(const char *fil, int is_readable)
Test if fil is a directory and listable.
enum GNUNET_GenericReturnValue GNUNET_DISK_directory_create(const char *dir)
Implementation of "mkdir -p".
#define GNUNET_CONTAINER_DLL_remove(head, tail, element)
Remove an element from a DLL.
#define GNUNET_CONTAINER_DLL_insert_tail(head, tail, element)
Insert an element at the tail of a DLL.
void GNUNET_CRYPTO_hash(const void *block, size_t size, struct GNUNET_HashCode *ret)
Compute hash of a given block.
void * GNUNET_CONTAINER_multipeermap_get(const struct GNUNET_CONTAINER_MultiPeerMap *map, const struct GNUNET_PeerIdentity *key)
Given a key find a value in the map matching the key.
void GNUNET_CONTAINER_multipeermap_destroy(struct GNUNET_CONTAINER_MultiPeerMap *map)
Destroy a hash map.
int GNUNET_CONTAINER_multipeermap_iterate(struct GNUNET_CONTAINER_MultiPeerMap *map, GNUNET_CONTAINER_PeerMapIterator it, void *it_cls)
Iterate over all entries in the map.
unsigned int GNUNET_CONTAINER_multihashmap_size(const struct GNUNET_CONTAINER_MultiHashMap *map)
Get the number of key-value pairs in the map.
struct GNUNET_CONTAINER_MultiPeerMap * GNUNET_CONTAINER_multipeermap_create(unsigned int len, int do_not_copy_keys)
Create a multi peer map (hash map for public keys of peers).
unsigned int GNUNET_CONTAINER_multipeermap_size(const struct GNUNET_CONTAINER_MultiPeerMap *map)
Get the number of key-value pairs in the map.
int GNUNET_CONTAINER_multipeermap_put(struct GNUNET_CONTAINER_MultiPeerMap *map, const struct GNUNET_PeerIdentity *key, void *value, enum GNUNET_CONTAINER_MultiHashMapOption opt)
Store a key-value pair in the map.
enum GNUNET_GenericReturnValue GNUNET_CONTAINER_multipeermap_remove(struct GNUNET_CONTAINER_MultiPeerMap *map, const struct GNUNET_PeerIdentity *key, const void *value)
Remove the given key-value pair from the map.
@ GNUNET_CONTAINER_MULTIHASHMAPOPTION_MULTIPLE
Allow multiple values with the same key.
#define GNUNET_log(kind,...)
#define GNUNET_memcmp(a, b)
Compare memory in a and b, where both must be of the same pointer type.
#define GNUNET_memcpy(dst, src, n)
Call memcpy() but check for n being 0 first.
GNUNET_GenericReturnValue
Named constants for return values.
@ GNUNET_PUBLIC_KEY_TYPE_EDDSA
EDDSA identity.
@ GNUNET_SCHEDULER_PRIORITY_IDLE
Run when otherwise idle.
const char * GNUNET_i2s(const struct GNUNET_PeerIdentity *pid)
Convert a peer identity to a string (for printing debug messages).
#define GNUNET_assert(cond)
Use this for fatal errors that cannot be handled.
const char * GNUNET_sh2s(const struct GNUNET_ShortHashCode *shc)
Convert a short hash value to a string (for printing debug messages).
const char * GNUNET_h2s(const struct GNUNET_HashCode *hc)
Convert a hash value to a string (for printing debug messages).
@ GNUNET_ERROR_TYPE_WARNING
@ GNUNET_ERROR_TYPE_ERROR
@ GNUNET_ERROR_TYPE_DEBUG
int int GNUNET_asprintf(char **buf, const char *format,...) __attribute__((format(printf
Like asprintf, just portable.
#define GNUNET_new(type)
Allocate a struct or union of the given type.
#define GNUNET_free(ptr)
Wrapper around free.
const char * GNUNET_MESSENGER_name_of_kind(enum GNUNET_MESSENGER_MessageKind kind)
Get the name of a message kind.
#define GNUNET_MESSENGER_VERSION
Version number of GNUnet Messenger API.
@ GNUNET_MESSENGER_KIND_INFO
The info kind.
@ GNUNET_MESSENGER_KIND_MISS
The miss kind.
@ GNUNET_MESSENGER_KIND_REQUEST
The request kind.
@ GNUNET_MESSENGER_KIND_LEAVE
The leave kind.
@ GNUNET_MESSENGER_KIND_SUBSCRIBE
The subscribe kind.
@ GNUNET_MESSENGER_KIND_PEER
The peer kind.
@ GNUNET_MESSENGER_KIND_KEY
The key kind.
@ GNUNET_MESSENGER_KIND_JOIN
The join kind.
@ GNUNET_MESSENGER_KIND_DELETE
The delete kind.
@ GNUNET_MESSENGER_KIND_CONNECTION
The connection kind.
@ GNUNET_MESSENGER_KIND_MERGE
The merge kind.
@ GNUNET_MESSENGER_KIND_ID
The id kind.
@ GNUNET_MESSENGER_FLAG_CONNECTION_AUTO
The auto flag.
@ GNUNET_MESSENGER_FLAG_CONNECTION_NONE
The none flag.
#define GNUNET_MQ_handler_end()
End-marker for the handlers array.
#define GNUNET_MQ_hd_var_size(name, code, str, ctx)
void GNUNET_PEER_resolve(GNUNET_PEER_Id id, struct GNUNET_PeerIdentity *pid)
Convert an interned PID to a normal peer identity.
#define GNUNET_MESSAGE_TYPE_CADET_CLI
Traffic (net-cat style) used by the Command Line Interface.
void * GNUNET_SCHEDULER_cancel(struct GNUNET_SCHEDULER_Task *task)
Cancel the task with the specified identifier.
struct GNUNET_SCHEDULER_Task * GNUNET_SCHEDULER_add_delayed_with_priority(struct GNUNET_TIME_Relative delay, enum GNUNET_SCHEDULER_Priority priority, GNUNET_SCHEDULER_TaskCallback task, void *task_cls)
Schedule a new task to be run with a specified delay.
struct GNUNET_SCHEDULER_Task * GNUNET_SCHEDULER_add_with_priority(enum GNUNET_SCHEDULER_Priority prio, GNUNET_SCHEDULER_TaskCallback task, void *task_cls)
Schedule a new task to be run with a specified priority.
struct GNUNET_TIME_Relative GNUNET_TIME_relative_get_zero_(void)
Return relative time of 0ms.
struct GNUNET_TIME_Absolute GNUNET_TIME_absolute_get_forever_(void)
Return "forever".
struct GNUNET_TIME_Absolute GNUNET_TIME_absolute_get(void)
Get the current time.
struct GNUNET_TIME_Relative GNUNET_TIME_relative_get_forever_(void)
Return "forever".
#define GNUNET_TIME_absolute_cmp(t1, op, t2)
Compare two absolute times.
struct GNUNET_TIME_Relative GNUNET_TIME_absolute_get_difference(struct GNUNET_TIME_Absolute start, struct GNUNET_TIME_Absolute end)
Compute the time difference between the given start and end times.
struct GNUNET_TIME_AbsoluteNBO GNUNET_TIME_absolute_hton(struct GNUNET_TIME_Absolute a)
Convert absolute time to network byte order.
void load_list_tunnels(struct GNUNET_MESSENGER_ListTunnels *tunnels, const char *path)
Loads the list of tunnels peer identities from a file under a given path.
void init_list_tunnels(struct GNUNET_MESSENGER_ListTunnels *tunnels)
Initializes list of tunnels peer identities as empty list.
void save_list_tunnels(struct GNUNET_MESSENGER_ListTunnels *tunnels, const char *path)
Saves the list of tunnels peer identities to a file under a given path.
enum GNUNET_GenericReturnValue verify_list_tunnels_flag_token(const struct GNUNET_MESSENGER_ListTunnels *tunnels, const struct GNUNET_PeerIdentity *peer, enum GNUNET_MESSENGER_ConnectionFlags flag)
Verifies that a specific tunnel selected by its peer identity in a list of tunnels is the first in or...
struct GNUNET_MESSENGER_ListTunnel * find_list_tunnels(struct GNUNET_MESSENGER_ListTunnels *tunnels, const struct GNUNET_PeerIdentity *peer, size_t *index)
Searches linearly through the list of tunnels peer identities for matching a specific peer identity a...
void clear_list_tunnels(struct GNUNET_MESSENGER_ListTunnels *tunnels)
Clears the list of tunnels peer identities.
struct GNUNET_MESSENGER_ListTunnel * remove_from_list_tunnels(struct GNUNET_MESSENGER_ListTunnels *tunnels, struct GNUNET_MESSENGER_ListTunnel *element)
Removes a specific element from the list of tunnels peer identities and returns the next element in t...
enum GNUNET_GenericReturnValue is_peer_message(const struct GNUNET_MESSENGER_Message *message)
Returns whether a specific kind of message can be sent by the service without usage of a clients priv...
struct GNUNET_MQ_Envelope * pack_message(struct GNUNET_MESSENGER_Message *message, struct GNUNET_HashCode *hash, const GNUNET_MESSENGER_SignFunction sign, enum GNUNET_MESSENGER_PackMode mode, const void *cls)
Encodes the message to pack it into a newly allocated envelope if mode is equal to GNUNET_MESSENGER_P...
void destroy_message(struct GNUNET_MESSENGER_Message *message)
Destroys a message and frees its memory fully.
void sign_message_by_peer(struct GNUNET_MESSENGER_Message *message, uint16_t length, char *buffer, const struct GNUNET_HashCode *hash, const struct GNUNET_CONFIGURATION_Handle *cfg)
Signs the hash of a message with the peer identity of a given config and writes the signature into th...
GNUNET_MESSENGER_PackMode
@ GNUNET_MESSENGER_PACK_MODE_UNKNOWN
@ GNUNET_MESSENGER_PACK_MODE_ENVELOPE
enum GNUNET_GenericReturnValue generate_free_member_id(struct GNUNET_ShortHashCode *id, const struct GNUNET_CONTAINER_MultiShortmap *members)
Tries to generate an unused member id and store it into the id parameter.
void convert_messenger_key_to_port(const struct GNUNET_HashCode *key, struct GNUNET_HashCode *port)
Converts a Messenger service key of a room to the specific port which gets used for the CADET channel...
void convert_peer_identity_to_id(const struct GNUNET_PeerIdentity *identity, struct GNUNET_ShortHashCode *id)
Converts a peers identity to a short hash code which can be used as id to refer to a peer via sender ...
void delayed_disconnect_channel(struct GNUNET_CADET_Channel *channel)
Starts an urgent task to close a CADET channel asynchronously.
Opaque handle to a channel.
Opaque handle to the service.
An identity key as per LSD0001.
uint32_t type
Type of signature.
struct GNUNET_HashCode * hash
struct GNUNET_MESSENGER_SrvHandle * handle
struct GNUNET_MESSENGER_Message * message
struct GNUNET_MESSENGER_SrvTunnel * exclude
enum GNUNET_GenericReturnValue packed
struct GNUNET_MESSENGER_SrvRoom * room
struct GNUNET_MESSENGER_ListHandle * next
struct GNUNET_MESSENGER_SrvHandle * handle
struct GNUNET_MESSENGER_ListHandle * head
struct GNUNET_HashCode hash
struct GNUNET_MESSENGER_ListMessage * head
struct GNUNET_MESSENGER_ListMessage * tail
struct GNUNET_MESSENGER_ListTunnel * next
struct GNUNET_MESSENGER_ListTunnel * head
struct GNUNET_MESSENGER_MemberSessionCompletion * prev
struct GNUNET_MESSENGER_MemberSession * session
struct GNUNET_MESSENGER_MemberSessionCompletion * next
struct GNUNET_CRYPTO_PublicKey public_key
struct GNUNET_MESSENGER_Member * member
struct GNUNET_CONTAINER_MultiShortmap * members
struct GNUNET_MESSENGER_SrvRoom * room
struct GNUNET_TIME_Absolute start
const struct GNUNET_ShortHashCode * discourse
struct GNUNET_MESSENGER_MemberSessionCompletion * head
const struct GNUNET_MESSENGER_Message * message
const struct GNUNET_HashCode * hash
struct GNUNET_MESSENGER_MemberSessionCompletion * tail
struct GNUNET_CONTAINER_MultiHashMap * sessions
struct GNUNET_MESSENGER_MessageMerge merge
struct GNUNET_HashCode second
struct GNUNET_HashCode first
struct GNUNET_HashCode previous
The hash of a second previous message.
struct GNUNET_MESSENGER_MessageHeader header
Header.
struct GNUNET_MESSENGER_MessageBody body
Body.
struct GNUNET_MESSENGER_SrvRoom * room
struct GNUNET_PeerIdentity * peer
struct GNUNET_MESSENGER_MemberSession * member
enum GNUNET_GenericReturnValue auto_routing
unsigned long long min_routers
struct GNUNET_CADET_Handle * cadet
struct GNUNET_MESSENGER_ListHandles handles
struct GNUNET_HashCode * peer_message
struct GNUNET_MESSENGER_PeerStore peer_store
struct GNUNET_CONTAINER_MultiPeerMap * tunnels
struct GNUNET_MESSENGER_MemberStore member_store
struct GNUNET_MESSENGER_Service * service
struct GNUNET_CADET_Port * port
struct GNUNET_MESSENGER_ListTunnels basement
struct GNUNET_SCHEDULER_Task * idle
struct GNUNET_MESSENGER_MessageStore message_store
struct GNUNET_MESSENGER_MessageState state
struct GNUNET_MESSENGER_ListMessages handling
struct GNUNET_MESSENGER_OperationStore operation_store
struct GNUNET_MESSENGER_SrvHandle * host
struct GNUNET_HashCode key
struct GNUNET_CADET_Channel * channel
struct GNUNET_MESSENGER_SrvRoom * room
struct GNUNET_MESSENGER_Member * member
struct GNUNET_TIME_Absolute start
struct GNUNET_MESSENGER_SrvRoom * room
struct GNUNET_ShortHashCode discourse
Message handler for a specific message type.
The identity of the host (wraps the signing key of the peer).
Time for absolute times used by GNUnet, in microseconds.
Time for relative time used by GNUnet, in microseconds.