GNUnet 0.22.2
gnunet-service-messenger_member_session.h
Go to the documentation of this file.
1/*
2 This file is part of GNUnet.
3 Copyright (C) 2021--2024 GNUnet e.V.
4
5 GNUnet is free software: you can redistribute it and/or modify it
6 under the terms of the GNU Affero General Public License as published
7 by the Free Software Foundation, either version 3 of the License,
8 or (at your option) any later version.
9
10 GNUnet is distributed in the hope that it will be useful, but
11 WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Affero General Public License for more details.
14
15 You should have received a copy of the GNU Affero General Public License
16 along with this program. If not, see <http://www.gnu.org/licenses/>.
17
18 SPDX-License-Identifier: AGPL3.0-or-later
19 */
26#ifndef GNUNET_SERVICE_MESSENGER_MEMBER_SESSION_H
27#define GNUNET_SERVICE_MESSENGER_MEMBER_SESSION_H
28
29#include "gnunet_util_lib.h"
30#include "gnunet_time_lib.h"
31
34
36
38{
40
43
45
48
51
53
56};
57
70 const struct GNUNET_CRYPTO_PublicKey *pubkey);
71
86 const struct GNUNET_MESSENGER_Message *message,
87 const struct GNUNET_HashCode *hash);
88
94void
96
109 const struct GNUNET_HashCode *hash);
110
120void
122
131
142is_member_session_completed (const struct
144
153
160const struct GNUNET_HashCode*
162
169const struct GNUNET_ShortHashCode*
171
178const struct GNUNET_CRYPTO_PublicKey*
181
188const struct GNUNET_HashCode*
189get_member_session_context (const struct
191
200
216 const struct GNUNET_MESSENGER_Message *message,
217 const struct GNUNET_HashCode *hash);
218
232 const struct GNUNET_HashCode *hash,
233 enum GNUNET_GenericReturnValue ownership);
234
245void
247 const struct GNUNET_MESSENGER_Message *message,
248 const struct GNUNET_HashCode *hash);
249
257void
259 const struct GNUNET_HashCode *hash);
260
269void
271 const char *directory);
272
281void
283 const char *directory);
284
292void
294 const char *directory);
295
296#endif //GNUNET_SERVICE_MESSENGER_MEMBER_SESSION_H
static struct GNUNET_CRYPTO_PublicKey pubkey
Public key of the zone to look in.
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.
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.
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.
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.
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 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.
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.
struct GNUNET_MESSENGER_Contact * get_member_session_contact(struct GNUNET_MESSENGER_MemberSession *session)
Returns the contact which is connected to a given 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 me...
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 requir...
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 com...
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.
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.
enum GNUNET_GenericReturnValue is_member_session_completed(const struct GNUNET_MESSENGER_MemberSession *session)
Returns if the given member session has been completed.
enum GNUNET_GenericReturnValue is_member_session_closed(const struct GNUNET_MESSENGER_MemberSession *session)
Returns if the given member session has been closed.
const struct GNUNET_HashCode * get_member_session_context(const struct GNUNET_MESSENGER_MemberSession *session)
Returns the member context of a given member session.
Functions related to time.
GNUNET_GenericReturnValue
Named constants for return values.
Internal representation of the hash map.
An identity key as per LSD0001.
A 512-bit hashcode.
struct GNUNET_CONTAINER_MultiHashMap * history
struct GNUNET_MESSENGER_MemberSession * prev
struct GNUNET_MESSENGER_MemberSession * next
struct GNUNET_MESSENGER_ListMessages messages
A 256-bit hashcode.
Time for absolute times used by GNUnet, in microseconds.